pdbe-molstar 3.4.0 → 3.6.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/build/pdbe-molstar-component.js +2 -2
- package/build/pdbe-molstar-light.css +2 -2
- package/build/pdbe-molstar-plugin.js +2 -2
- package/build/pdbe-molstar-plugin.js.LICENSE.txt +26 -1
- package/build/pdbe-molstar.css +2 -2
- package/lib/alphafold-transparency.js +5 -6
- package/lib/custom-events.js +1 -1
- package/lib/domain-annotations/behavior.d.ts +1 -1
- package/lib/domain-annotations/color.js +2 -2
- package/lib/domain-annotations/prop.js +1 -2
- package/lib/extensions/complexes/coloring.d.ts +40 -0
- package/lib/extensions/complexes/coloring.js +118 -0
- package/lib/extensions/complexes/index.d.ts +55 -0
- package/lib/extensions/complexes/index.js +123 -0
- package/lib/extensions/complexes/superpose-by-biggest-chain.d.ts +17 -0
- package/lib/extensions/complexes/superpose-by-biggest-chain.js +135 -0
- package/lib/extensions/foldseek/index.d.ts +1 -1
- package/lib/extensions/foldseek/index.js +7 -7
- package/lib/extensions/interactions/index.d.ts +36 -0
- package/lib/extensions/interactions/index.js +112 -0
- package/lib/extensions/state-gallery/behavior.d.ts +1 -1
- package/lib/extensions/state-gallery/config.js +2 -2
- package/lib/extensions/state-gallery/manager.js +5 -4
- package/lib/extensions/state-gallery/ui.js +12 -12
- package/lib/helpers.d.ts +8 -0
- package/lib/helpers.js +175 -81
- package/lib/labels.d.ts +1 -1
- package/lib/loci-details.js +4 -5
- package/lib/plugin-custom-state.js +2 -2
- package/lib/sifts-mapping.js +1 -2
- package/lib/sifts-mappings-behaviour.d.ts +1 -1
- package/lib/spec-from-html.js +1 -2
- package/lib/spec.d.ts +1 -1
- package/lib/spec.js +3 -3
- package/lib/styles/pdbe-molstar/_index.scss +7 -7
- package/lib/styles/pdbe-molstar-dark.scss +2 -2
- package/lib/styles/pdbe-molstar-light.scss +2 -2
- package/lib/subscribe-events.js +1 -2
- package/lib/superposition-export.js +1 -2
- package/lib/superposition-focus-representation.d.ts +2 -2
- package/lib/superposition-focus-representation.js +1 -1
- package/lib/superposition-sifts-mapping.js +1 -2
- package/lib/superposition.d.ts +1 -1
- package/lib/superposition.js +34 -39
- package/lib/ui/alphafold-superposition.js +6 -6
- package/lib/ui/annotation-controls.d.ts +1 -1
- package/lib/ui/annotation-controls.js +2 -2
- package/lib/ui/annotation-row-controls.js +3 -3
- package/lib/ui/custom-controls.js +1 -1
- package/lib/ui/export-superposition.d.ts +0 -1
- package/lib/ui/export-superposition.js +1 -1
- package/lib/ui/icons.js +1 -1
- package/lib/ui/left-panel/core.d.ts +0 -1
- package/lib/ui/left-panel/core.js +5 -6
- package/lib/ui/left-panel/pdbe-left-panel.d.ts +0 -1
- package/lib/ui/left-panel/tabs.d.ts +1 -1
- package/lib/ui/left-panel/tabs.js +2 -2
- package/lib/ui/overlay.js +3 -4
- package/lib/ui/pdbe-screenshot-controls.js +4 -4
- package/lib/ui/pdbe-structure-controls.js +3 -3
- package/lib/ui/pdbe-viewport-controls.js +3 -4
- package/lib/ui/pdbe-viewport.d.ts +5 -2
- package/lib/ui/pdbe-viewport.js +24 -3
- package/lib/ui/segment-tree.js +40 -45
- package/lib/ui/split-ui/components.d.ts +1 -2
- package/lib/ui/split-ui/components.js +2 -2
- package/lib/ui/split-ui/split-ui.js +6 -7
- package/lib/ui/superposition-components.js +16 -21
- package/lib/ui/symmetry-annotation-controls.d.ts +4 -4
- package/lib/ui/symmetry-annotation-controls.js +18 -25
- package/lib/viewer.d.ts +31 -3
- package/lib/viewer.js +54 -40
- package/package.json +4 -4
|
@@ -62,7 +62,7 @@ class RemoveAllButton extends base_1.PluginUIComponent {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
function HelpSection(props) {
|
|
65
|
-
return (0, jsx_runtime_1.jsx)("div",
|
|
65
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'msp-simple-help-section', children: props.header });
|
|
66
66
|
}
|
|
67
67
|
/** Help section about superposition functionality for the left panel */
|
|
68
68
|
class SuperpositionHelpSection extends base_1.PluginUIComponent {
|
|
@@ -70,7 +70,7 @@ class SuperpositionHelpSection extends base_1.PluginUIComponent {
|
|
|
70
70
|
this.subscribe(this.plugin.events.canvas3d.settingsUpdated, () => this.forceUpdate());
|
|
71
71
|
}
|
|
72
72
|
render() {
|
|
73
|
-
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(HelpSection, { header: 'Superposition' }), (0, jsx_runtime_1.jsx)(help_1.HelpGroup,
|
|
73
|
+
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(HelpSection, { header: 'Superposition' }), (0, jsx_runtime_1.jsx)(help_1.HelpGroup, { header: 'Segment', children: (0, jsx_runtime_1.jsx)(help_1.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "Discrete UniProt sequence range mapped to the structure" }) }) }), (0, jsx_runtime_1.jsx)(help_1.HelpGroup, { header: 'Cluster', children: (0, jsx_runtime_1.jsx)(help_1.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "Structural chains that possess significantly close superposition Q-score" }) }) }), (0, jsx_runtime_1.jsx)(help_1.HelpGroup, { header: 'Representative chain', children: (0, jsx_runtime_1.jsx)(help_1.HelpText, { children: (0, jsx_runtime_1.jsx)("p", { children: "The best-ranked chain within a cluster chosen based on the model quality, resolution, observed residues ratio and UniProt sequence coverage" }) }) })] });
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
/** Body of 'help' tab in the left panel (core help + PDBe-specific help) */
|
package/lib/ui/overlay.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WithLoadingOverlay =
|
|
3
|
+
exports.WithLoadingOverlay = WithLoadingOverlay;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const base_1 = require("molstar/lib/mol-plugin-ui/base");
|
|
6
6
|
const plugin_custom_state_1 = require("../plugin-custom-state");
|
|
@@ -23,12 +23,11 @@ function WithLoadingOverlay(MainContent, OverlayContent = PDBeLoadingOverlayBox)
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MainContent, {}), this.state.showOverlay && (0, jsx_runtime_1.jsx)("div",
|
|
26
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MainContent, {}), this.state.showOverlay && (0, jsx_runtime_1.jsx)("div", { className: 'pdbemolstar-overlay', children: (0, jsx_runtime_1.jsx)(OverlayContent, {}) })] });
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
exports.WithLoadingOverlay = WithLoadingOverlay;
|
|
31
30
|
/** Overlay component with animated PDBe logo */
|
|
32
31
|
function PDBeLoadingOverlayBox() {
|
|
33
|
-
return (0, jsx_runtime_1.jsx)("div",
|
|
32
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'pdbemolstar-overlay-box', children: (0, jsx_runtime_1.jsxs)("svg", { className: 'pdbe-animated-logo', viewBox: '0 0 300 300', children: [(0, jsx_runtime_1.jsx)("path", { className: 'path-bg', fill: 'transparent', stroke: '#E13D3D', strokeWidth: '30', d: 'M 150 200 L 150 100 A 50 50 0 1 0 100 150 L 200 150 A 50 50 0 1 0 150 100 L 150 200 A 50 50 0 1 0 200 150 L 100 150 A 50 50 0 1 0 150 200 ' }), (0, jsx_runtime_1.jsx)("path", { className: 'path-cross', fill: 'transparent', stroke: '#72B260', strokeWidth: '30', d: 'M 150 100 L 150 200 M 100 150 L 200 150' }), (0, jsx_runtime_1.jsx)("path", { className: 'path-fg', fill: 'transparent', stroke: '#72B260', strokeWidth: '30', d: 'M 100 150 A 50 50 0 1 1 150 100 L 150 170 L 150 100 L 150 170 L 150 100 L 150 100 A 50 50 0 1 1 200 150 L 130 150 L 200 150 L 130 150 L 200 150 L 200 150 A 50 50 0 1 1 150 200 L 150 130 L 150 200 L 150 130 L 150 200 L 150 200 A 50 50 0 1 1 100 150 L 170 150 L 100 150 L 170 150 L 100 150' })] }) });
|
|
34
33
|
}
|
|
@@ -37,8 +37,8 @@ class DownloadScreenshotControls extends base_1.PluginUIComponent {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
this.copyImg = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
var
|
|
41
|
-
const src = yield ((
|
|
40
|
+
var _a;
|
|
41
|
+
const src = yield ((_a = this.plugin.helpers.viewportScreenshot) === null || _a === void 0 ? void 0 : _a.getImageDataUri());
|
|
42
42
|
this.setState({ imageData: src });
|
|
43
43
|
});
|
|
44
44
|
this.open = (e) => {
|
|
@@ -58,7 +58,7 @@ class DownloadScreenshotControls extends base_1.PluginUIComponent {
|
|
|
58
58
|
render() {
|
|
59
59
|
var _a;
|
|
60
60
|
const hasClipboardApi = !!((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.write);
|
|
61
|
-
return (0, jsx_runtime_1.jsxs)("div", { children: [this.state.showPreview && (0, jsx_runtime_1.jsxs)("div",
|
|
61
|
+
return (0, jsx_runtime_1.jsxs)("div", { children: [this.state.showPreview && (0, jsx_runtime_1.jsxs)("div", { className: 'msp-image-preview', children: [(0, jsx_runtime_1.jsx)(screenshot_1.ScreenshotPreview, { plugin: this.plugin }), (0, jsx_runtime_1.jsx)(CropControls, { plugin: this.plugin })] }), (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [!this.state.imageData && (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CopySvg, onClick: hasClipboardApi ? this.copy : this.copyImg, disabled: this.state.isDisabled, children: "Copy" }), this.state.imageData && (0, jsx_runtime_1.jsx)(common_1.Button, { onClick: () => this.setState({ imageData: undefined }), disabled: this.state.isDisabled, children: "Clear" }), (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.GetAppSvg, onClick: this.download, disabled: this.state.isDisabled, children: "Download" })] }), this.state.imageData && (0, jsx_runtime_1.jsxs)("div", { className: 'msp-row msp-copy-image-wrapper', children: [(0, jsx_runtime_1.jsx)("div", { children: "Right click below + Copy Image" }), (0, jsx_runtime_1.jsx)("img", { src: this.state.imageData, style: { width: '100%', height: 32, display: 'block' } })] }), (0, jsx_runtime_1.jsx)(ScreenshotParams, { plugin: this.plugin, isDisabled: this.state.isDisabled })] });
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
exports.DownloadScreenshotControls = DownloadScreenshotControls;
|
|
@@ -73,5 +73,5 @@ function CropControls({ plugin }) {
|
|
|
73
73
|
(0, use_behavior_1.useBehavior)(helper === null || helper === void 0 ? void 0 : helper.behaviors.relativeCrop);
|
|
74
74
|
if (!helper)
|
|
75
75
|
return null;
|
|
76
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
76
|
+
return (0, jsx_runtime_1.jsxs)("div", { style: { width: '100%', height: '24px', marginTop: '8px' }, children: [(0, jsx_runtime_1.jsx)(common_1.ToggleButton, { icon: icons_1.CropOrginalSvg, title: 'Auto-crop', inline: true, isSelected: cropParams === null || cropParams === void 0 ? void 0 : cropParams.auto, style: { background: 'transparent', float: 'left', width: 'auto', height: '24px', lineHeight: '24px' }, toggle: () => helper.toggleAutocrop(), label: 'Auto-crop ' + ((cropParams === null || cropParams === void 0 ? void 0 : cropParams.auto) ? 'On' : 'Off') }), !(cropParams === null || cropParams === void 0 ? void 0 : cropParams.auto) && (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CropSvg, title: 'Crop', style: { background: 'transparent', float: 'right', height: '24px', lineHeight: '24px', width: '24px', padding: '0' }, onClick: () => helper.autocrop() }), !(cropParams === null || cropParams === void 0 ? void 0 : cropParams.auto) && !helper.isFullFrame && (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CropFreeSvg, title: 'Reset Crop', style: { background: 'transparent', float: 'right', height: '24px', lineHeight: '24px', width: '24px', padding: '0' }, onClick: () => helper.resetCrop() })] });
|
|
77
77
|
}
|
|
@@ -18,7 +18,7 @@ const prop_1 = require("molstar/lib/extensions/assembly-symmetry/prop");
|
|
|
18
18
|
class PDBeStructureTools extends base_1.PluginUIComponent {
|
|
19
19
|
render() {
|
|
20
20
|
const AssemblySymmetryKey = prop_1.AssemblySymmetryData.Tag.Representation;
|
|
21
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div",
|
|
21
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-section-header', children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] }), (0, jsx_runtime_1.jsx)(source_1.StructureSourceControls, {}), (0, jsx_runtime_1.jsx)(annotation_controls_1.AnnotationsComponentControls, {}), (0, jsx_runtime_1.jsx)(quick_styles_1.StructureQuickStylesControls, {}), (0, jsx_runtime_1.jsx)(components_1.StructureComponentControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeStreamingControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeSourceControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, { skipKeys: [AssemblySymmetryKey] })] });
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
exports.PDBeStructureTools = PDBeStructureTools;
|
|
@@ -44,13 +44,13 @@ class CustomStructureControls extends base_1.PluginUIComponent {
|
|
|
44
44
|
exports.CustomStructureControls = CustomStructureControls;
|
|
45
45
|
class PDBeLigandViewStructureTools extends base_1.PluginUIComponent {
|
|
46
46
|
render() {
|
|
47
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div",
|
|
47
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-section-header', children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] }), (0, jsx_runtime_1.jsx)(components_1.StructureComponentControls, {}), (0, jsx_runtime_1.jsx)(volume_1.VolumeStreamingControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, {})] });
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.PDBeLigandViewStructureTools = PDBeLigandViewStructureTools;
|
|
51
51
|
class PDBeSuperpositionStructureTools extends base_1.PluginUIComponent {
|
|
52
52
|
render() {
|
|
53
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div",
|
|
53
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-section-header', children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: icons_1.BuildSvg }), "Structure Tools"] }), (0, jsx_runtime_1.jsx)(superposition_components_1.SuperpositionComponentControls, {}), (0, jsx_runtime_1.jsx)(alphafold_tranparency_1.AlphafoldTransparencyControls, {}), (0, jsx_runtime_1.jsx)(alphafold_superposition_1.AlphafoldPaeControls, {}), (0, jsx_runtime_1.jsx)(alphafold_superposition_1.AlphafoldSuperpositionControls, {}), (0, jsx_runtime_1.jsx)(measurements_1.StructureMeasurementsControls, {}), (0, jsx_runtime_1.jsx)(export_superposition_1.SuperpositionModelExportUI, {}), (0, jsx_runtime_1.jsx)(CustomStructureControls, {})] });
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
exports.PDBeSuperpositionStructureTools = PDBeSuperpositionStructureTools;
|
|
@@ -17,9 +17,8 @@ class PDBeViewportControls extends viewport_1.ViewportControls {
|
|
|
17
17
|
const showPDBeLink = (initParams === null || initParams === void 0 ? void 0 : initParams.moleculeId) && (initParams === null || initParams === void 0 ? void 0 : initParams.pdbeLink) && !(initParams === null || initParams === void 0 ? void 0 : initParams.superposition);
|
|
18
18
|
const pdbeLinkColor = this.isBlack() ? '#fff' : '#555';
|
|
19
19
|
const pdbeLink = {
|
|
20
|
-
|
|
21
|
-
bgStyle: { position: 'absolute', height: '
|
|
22
|
-
containerStyle: { position: 'absolute', right: '10px', top: '10px', padding: '3px 3px 3px 18px' },
|
|
20
|
+
containerStyle: { position: 'absolute', right: '10px', top: '10px', padding: '6px', paddingRight: '3px', paddingLeft: '18px' },
|
|
21
|
+
bgStyle: { position: 'absolute', height: '32px', width: '54px', marginLeft: '-33px' },
|
|
23
22
|
style: { display: 'inline-block', fontSize: '14px', color: pdbeLinkColor, borderBottom: 'none', cursor: 'pointer', textDecoration: 'none', position: 'absolute', right: '5px' },
|
|
24
23
|
pdbeImg: {
|
|
25
24
|
src: 'https://www.ebi.ac.uk/pdbe/entry/static/images/logos/PDBe/logo_T_64.png',
|
|
@@ -27,7 +26,7 @@ class PDBeViewportControls extends viewport_1.ViewportControls {
|
|
|
27
26
|
style: { height: '12px', width: '12px', border: 0, position: 'absolute', margin: '4px 0 0 -13px' },
|
|
28
27
|
},
|
|
29
28
|
};
|
|
30
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showPDBeLink && (0, jsx_runtime_1.jsxs)("div",
|
|
29
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showPDBeLink && (0, jsx_runtime_1.jsxs)("div", { className: 'msp-viewport-controls-buttons', style: pdbeLink.containerStyle, children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-semi-transparent-background', style: pdbeLink.bgStyle }), (0, jsx_runtime_1.jsxs)("a", { className: 'msp-pdbe-link', style: pdbeLink.style, target: "_blank", href: `https://pdbe.org/${initParams.moleculeId}`, children: [(0, jsx_runtime_1.jsx)("img", { src: pdbeLink.pdbeImg.src, alt: pdbeLink.pdbeImg.alt, style: pdbeLink.pdbeImg.style }), initParams.moleculeId] })] }), (0, jsx_runtime_1.jsx)("div", { style: { position: 'absolute', top: showPDBeLink ? (32 + 4) : 0, right: 0 }, children: super.render() })] });
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
exports.PDBeViewportControls = PDBeViewportControls;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DefaultViewport } from 'molstar/lib/mol-plugin-ui/plugin';
|
|
2
|
+
import { ComponentClass } from 'react';
|
|
3
3
|
/** A modified copy of DefaultViewport */
|
|
4
4
|
export declare class CustomizableDefaultViewport extends DefaultViewport {
|
|
5
5
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
/** Version of `PDBeViewport` to use as part of other components. Does not expand to fullscreen individually. */
|
|
8
|
+
export declare const PDBeViewport_NoFullscreen: ComponentClass<{}, any>;
|
|
9
|
+
/** Component containing 3D canvas, button in top left and top right corners, and tooltip box (center panel in default layout). Changes to fullscreen view by "Toggle Expanded Viewport" button, or "expanded" option. */
|
|
10
|
+
export declare const PDBeViewport: ComponentClass<{}, any>;
|
package/lib/ui/pdbe-viewport.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PDBeViewport = exports.CustomizableDefaultViewport = void 0;
|
|
3
|
+
exports.PDBeViewport = exports.PDBeViewport_NoFullscreen = exports.CustomizableDefaultViewport = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const base_1 = require("molstar/lib/mol-plugin-ui/base");
|
|
5
6
|
const controls_1 = require("molstar/lib/mol-plugin-ui/controls");
|
|
6
7
|
const plugin_1 = require("molstar/lib/mol-plugin-ui/plugin");
|
|
7
8
|
const task_1 = require("molstar/lib/mol-plugin-ui/task");
|
|
@@ -15,8 +16,28 @@ class CustomizableDefaultViewport extends plugin_1.DefaultViewport {
|
|
|
15
16
|
var _a, _b, _c, _d;
|
|
16
17
|
const VPControls = ((_b = (_a = this.plugin.spec.components) === null || _a === void 0 ? void 0 : _a.viewport) === null || _b === void 0 ? void 0 : _b.controls) || viewport_1.ViewportControls;
|
|
17
18
|
const SnapshotDescription = ((_d = (_c = this.plugin.spec.components) === null || _c === void 0 ? void 0 : _c.viewport) === null || _d === void 0 ? void 0 : _d.snapshotDescription) || controls_1.ViewportSnapshotDescription;
|
|
18
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(viewport_1.Viewport, {}), (0, jsx_runtime_1.jsxs)("div",
|
|
19
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(viewport_1.Viewport, {}), (0, jsx_runtime_1.jsxs)("div", { style: { position: 'absolute', inset: 0, pointerEvents: 'none' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'pdbemolstar-viewport-top-center-controls', children: [(0, jsx_runtime_1.jsx)(custom_controls_1.CustomControls, { region: 'viewport-top-center' }), (0, jsx_runtime_1.jsx)(controls_1.SelectionViewportControls, {})] }), (0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', pointerEvents: 'auto' }, children: (0, jsx_runtime_1.jsxs)("div", { className: 'msp-viewport-top-left-controls', children: [(0, jsx_runtime_1.jsx)(controls_1.AnimationViewportControls, {}), (0, jsx_runtime_1.jsx)(controls_1.TrajectoryViewportControls, {}), (0, jsx_runtime_1.jsx)(controls_1.StateSnapshotViewportControls, {}), (0, jsx_runtime_1.jsx)(custom_controls_1.CustomControls, { region: 'viewport-top-left' }), (0, jsx_runtime_1.jsx)(SnapshotDescription, {})] }) })] }), (0, jsx_runtime_1.jsx)(VPControls, {}), (0, jsx_runtime_1.jsx)(task_1.BackgroundTaskProgress, {}), (0, jsx_runtime_1.jsxs)("div", { className: 'msp-highlight-toast-wrapper', children: [(0, jsx_runtime_1.jsx)(controls_1.LociLabels, {}), (0, jsx_runtime_1.jsx)(toast_1.Toasts, {})] })] });
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
exports.CustomizableDefaultViewport = CustomizableDefaultViewport;
|
|
22
|
-
|
|
23
|
+
/** Return a React component with MainContent, expanded to whole browser window whenever `this.plugin.layout.state.isExpanded === true`. */
|
|
24
|
+
function Fullscreenable(MainContent) {
|
|
25
|
+
return class _Fullscreenable extends base_1.PurePluginUIComponent {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.state = { fullscreen: this.plugin.layout.state.isExpanded };
|
|
29
|
+
}
|
|
30
|
+
componentDidMount() {
|
|
31
|
+
this.subscribe(this.plugin.layout.events.updated, () => {
|
|
32
|
+
this.setState({ fullscreen: this.plugin.layout.state.isExpanded });
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: this.state.fullscreen ? 'msp-layout-expanded msp-viewport-expanded' : undefined, children: [(0, jsx_runtime_1.jsx)(MainContent, {}), ";"] });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Version of `PDBeViewport` to use as part of other components. Does not expand to fullscreen individually. */
|
|
41
|
+
exports.PDBeViewport_NoFullscreen = (0, overlay_1.WithLoadingOverlay)(CustomizableDefaultViewport);
|
|
42
|
+
/** Component containing 3D canvas, button in top left and top right corners, and tooltip box (center panel in default layout). Changes to fullscreen view by "Toggle Expanded Viewport" button, or "expanded" option. */
|
|
43
|
+
exports.PDBeViewport = Fullscreenable(exports.PDBeViewport_NoFullscreen);
|
package/lib/ui/segment-tree.js
CHANGED
|
@@ -60,13 +60,13 @@ class SegmentTree extends base_1.PurePluginUIComponent {
|
|
|
60
60
|
updatedParams.value = val;
|
|
61
61
|
this.setState({ segment: updatedParams });
|
|
62
62
|
setTimeout(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
var
|
|
63
|
+
var _a, _b;
|
|
64
64
|
const updatedSegmentIndex = parseInt(val.segment.split(' ')[0]);
|
|
65
65
|
customState.superpositionState.activeSegment = updatedSegmentIndex;
|
|
66
66
|
// Display current segment visible structures
|
|
67
67
|
yield this.displayStructures(customState.superpositionState.activeSegment - 1);
|
|
68
|
-
(
|
|
69
|
-
(
|
|
68
|
+
(_a = customState.events) === null || _a === void 0 ? void 0 : _a.isBusy.next(false);
|
|
69
|
+
(_b = customState.events) === null || _b === void 0 ? void 0 : _b.segmentUpdate.next(true);
|
|
70
70
|
}), 100);
|
|
71
71
|
return false;
|
|
72
72
|
});
|
|
@@ -120,14 +120,14 @@ class SegmentTree extends base_1.PurePluginUIComponent {
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
this.displayStructures = (segmentIndex) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
123
|
-
var
|
|
123
|
+
var _a;
|
|
124
124
|
const customState = this.customState;
|
|
125
125
|
const spState = customState.superpositionState;
|
|
126
126
|
if (!spState)
|
|
127
127
|
throw new Error('customState.superpositionState has not been initialized');
|
|
128
128
|
if (spState.visibleRefs[segmentIndex].length === 0) {
|
|
129
129
|
const loadStrs = [];
|
|
130
|
-
(
|
|
130
|
+
(_a = spState.segmentData) === null || _a === void 0 ? void 0 : _a[segmentIndex].clusters.forEach(cluster => {
|
|
131
131
|
var _a, _b;
|
|
132
132
|
let entryList = [cluster[0]];
|
|
133
133
|
if ((_b = (_a = customState.initParams) === null || _a === void 0 ? void 0 : _a.superpositionParams) === null || _b === void 0 ? void 0 : _b.superposeAll) {
|
|
@@ -243,10 +243,10 @@ class SegmentTree extends base_1.PurePluginUIComponent {
|
|
|
243
243
|
if (customState && customState.initParams && customState.initParams.superposition) {
|
|
244
244
|
sectionHeader = (0, jsx_runtime_1.jsx)(common_1.SectionHeader, { title: `Structure clusters - ${customState.initParams.moleculeId}` });
|
|
245
245
|
if (customState.superpositionError) {
|
|
246
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [sectionHeader, (0, jsx_runtime_1.jsx)("div",
|
|
246
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [sectionHeader, (0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center' }, children: customState.superpositionError })] });
|
|
247
247
|
}
|
|
248
248
|
else if (!customState.superpositionState || !customState.superpositionState.segmentData) {
|
|
249
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [sectionHeader, (0, jsx_runtime_1.jsx)("div",
|
|
249
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [sectionHeader, (0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center' }, children: "Loading Segment Data!" })] });
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
}
|
|
@@ -307,44 +307,39 @@ class ClusterNode extends base_1.PluginUIComponent {
|
|
|
307
307
|
const currentState = Object.assign({}, this.state);
|
|
308
308
|
this.setState({ showAll: false, showNone: false });
|
|
309
309
|
setTimeout(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
310
|
-
var
|
|
311
|
-
var
|
|
310
|
+
var _a, e_1, _b, _c;
|
|
311
|
+
var _d;
|
|
312
312
|
const loadStrs = [];
|
|
313
313
|
try {
|
|
314
|
-
for (var
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
// await PluginCommands.State.ToggleVisibility(this.plugin, { state: cell.parent!, ref: cell.transform.parent });
|
|
331
|
-
}
|
|
314
|
+
for (var _e = true, _f = tslib_1.__asyncValues(this.state.cluster), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
|
315
|
+
_c = _g.value;
|
|
316
|
+
_e = false;
|
|
317
|
+
const str = _c;
|
|
318
|
+
const structStateId = `${str.pdb_id}_${str.struct_asym_id}`;
|
|
319
|
+
let structRef = undefined;
|
|
320
|
+
if (customState && customState.superpositionState && customState.superpositionState.models[structStateId]) {
|
|
321
|
+
structRef = customState.superpositionState.models[structStateId];
|
|
322
|
+
}
|
|
323
|
+
if (structRef) {
|
|
324
|
+
const cell = this.plugin.state.data.cells.get(structRef);
|
|
325
|
+
if (cell) {
|
|
326
|
+
const isHidden = cell.state.isHidden ? true : false;
|
|
327
|
+
if ((isHidden && currentState.showAll) || (!isHidden && currentState.showNone)) {
|
|
328
|
+
yield commands_1.PluginCommands.State.ToggleVisibility(this.plugin, { state: cell.parent, ref: structRef });
|
|
329
|
+
// await PluginCommands.State.ToggleVisibility(this.plugin, { state: cell.parent!, ref: cell.transform.parent });
|
|
332
330
|
}
|
|
333
331
|
}
|
|
334
|
-
else {
|
|
335
|
-
if (currentState.showAll)
|
|
336
|
-
loadStrs.push(str);
|
|
337
|
-
}
|
|
338
332
|
}
|
|
339
|
-
|
|
340
|
-
|
|
333
|
+
else {
|
|
334
|
+
if (currentState.showAll)
|
|
335
|
+
loadStrs.push(str);
|
|
341
336
|
}
|
|
342
337
|
}
|
|
343
338
|
}
|
|
344
339
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
345
340
|
finally {
|
|
346
341
|
try {
|
|
347
|
-
if (!
|
|
342
|
+
if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);
|
|
348
343
|
}
|
|
349
344
|
finally { if (e_1) throw e_1.error; }
|
|
350
345
|
}
|
|
@@ -353,7 +348,7 @@ class ClusterNode extends base_1.PluginUIComponent {
|
|
|
353
348
|
if (loadStrs.length > 0) {
|
|
354
349
|
yield (0, superposition_1.renderSuperposition)(this.plugin, this.props.segmentIndex, loadStrs);
|
|
355
350
|
}
|
|
356
|
-
(
|
|
351
|
+
(_d = customState.events) === null || _d === void 0 ? void 0 : _d.isBusy.next(false);
|
|
357
352
|
}));
|
|
358
353
|
});
|
|
359
354
|
this.cancelAction = (e) => {
|
|
@@ -383,11 +378,11 @@ class ClusterNode extends base_1.PluginUIComponent {
|
|
|
383
378
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
384
379
|
const expand = (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: this.state.isCollapsed ? icons_1.ArrowRightSvg : icons_1.ArrowDropDownSvg, flex: '20px', onClick: this.toggleExpanded, transparent: true, disabled: this.state.isBusy, className: 'msp-no-hover-outline' });
|
|
385
380
|
const title = `Segment ${customState.superpositionState.activeSegment} Cluster ${this.props.clusterIndex + 1}`;
|
|
386
|
-
const label = (0, jsx_runtime_1.jsxs)(common_1.Button,
|
|
387
|
-
const selectionControls = (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.Button,
|
|
388
|
-
const mainRow = (0, jsx_runtime_1.jsxs)("div",
|
|
389
|
-
const searchControls = (0, jsx_runtime_1.jsxs)("div",
|
|
390
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [mainRow, (this.state.showAll || this.state.showNone) && (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div",
|
|
381
|
+
const label = (0, jsx_runtime_1.jsxs)(common_1.Button, { className: `msp-btn-tree-label`, noOverflow: true, title: title, disabled: this.state.isBusy, children: [(0, jsx_runtime_1.jsxs)("span", { children: ["Cluster ", this.props.clusterIndex + 1] }), " ", (0, jsx_runtime_1.jsxs)("small", { children: [this.state.cluster.length < this.props.cluster.length ? `${this.state.cluster.length} / ` : '', this.props.cluster.length, " chain", this.props.cluster.length > 1 ? 's' : ''] })] });
|
|
382
|
+
const selectionControls = (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CheckSvg, flex: true, onClick: this.selectAll, style: { flex: '0 0 50px', textAlign: 'center', fontSize: '80%', color: '#9cacc3', padding: 0 }, disabled: this.state.isBusy, title: `Show all chains`, children: "All" }), (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CloseSvg, flex: true, onClick: this.selectNone, style: { flex: '0 0 50px', textAlign: 'center', fontSize: '80%', color: '#9cacc3', padding: 0 }, disabled: this.state.isBusy, title: `Hide all chains`, children: "None" })] });
|
|
383
|
+
const mainRow = (0, jsx_runtime_1.jsxs)("div", { className: `msp-flex-row msp-tree-row`, style: { marginTop: '10px' }, children: [expand, label, this.props.cluster.length > 1 && selectionControls] });
|
|
384
|
+
const searchControls = (0, jsx_runtime_1.jsxs)("div", { className: 'msp-mapped-parameter-group', style: { fontSize: '90%' }, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'msp-control-row msp-transform-header-brand-gray', style: { height: '33px', marginLeft: '30px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: 'msp-control-row-label', children: "Search PDB ID" }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-row-ctrl', children: (0, jsx_runtime_1.jsx)("input", { type: 'text', placeholder: 'Enter PDB ID..', disabled: this.state.isBusy, onChange: e => this.inputStream.next(e.target.value), value: this.state.searchText, maxLength: 4 }) })] }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.CloseSvg, flex: true, onClick: this.clearSearch, style: { flex: '0 0 24px', padding: 0 }, disabled: this.state.isBusy || this.state.searchText === '', toggleState: this.state.searchText !== '', title: 'Clear search input' })] });
|
|
385
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [mainRow, (this.state.showAll || this.state.showNone) && (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { className: `msp-control-row msp-transform-header-brand-${this.state.showAll ? 'green' : 'red'}`, style: { display: 'flex', marginLeft: '20px', height: '35px' }, children: [(0, jsx_runtime_1.jsxs)("span", { className: 'msp-control-row-label', style: { flex: '1 1 auto', textAlign: 'left', fontSize: '85%' }, children: [this.state.showAll ? 'Display' : 'Hide', " ", this.state.cluster.length < this.props.cluster.length ? `${this.state.cluster.length} / ` : 'all ', this.props.cluster.length, " chains"] }), (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CheckSvg, flex: true, onClick: this.applyAction, style: { flex: '0 0 60px', textAlign: 'center', fontSize: '78%', color: '#9cacc3', padding: 0, margin: '0 1px' }, title: `Apply action`, children: "Apply" }), (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CloseSvg, flex: true, onClick: this.cancelAction, style: { flex: '0 0 60px', textAlign: 'center', fontSize: '78%', color: '#9cacc3', padding: 0, margin: '0 1px' }, title: `Cancel action`, children: "Cancel" })] }) }), (!this.state.isCollapsed && this.props.cluster.length > 5) && searchControls, !this.state.isCollapsed && (0, jsx_runtime_1.jsx)("div", { className: 'msp-tree-updates-wrapper', style: { maxHeight: (this.props.totalClusters > 1) ? '330px' : '87%', overflowY: 'auto' }, children: this.state.cluster.map((s, i) => (0, jsx_runtime_1.jsx)(StructureNode, { segmentIndex: this.props.segmentIndex, structure: s, isRep: i === 0 ? true : false }, `str-${s.pdb_id}${s.struct_asym_id}${i}`)) })] });
|
|
391
386
|
}
|
|
392
387
|
}
|
|
393
388
|
class StructureNode extends base_1.PluginUIComponent {
|
|
@@ -572,7 +567,7 @@ class StructureNode extends base_1.PluginUIComponent {
|
|
|
572
567
|
showAddChainBtn = false;
|
|
573
568
|
}
|
|
574
569
|
if (representations.length > 0) {
|
|
575
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
570
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-accent-offset', style: { marginLeft: '40px' }, children: [representations.length > 0 && representations.map((r, i) => (0, jsx_runtime_1.jsx)(StructureRepresentationEntry, { group: [structHierarchy], representation: r }, `${r.cell.transform.ref}-${i}`)), showAddChainBtn && (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-group-header', style: { marginTop: '1px' }, children: (0, jsx_runtime_1.jsxs)(common_1.Button, { noOverflow: true, className: 'msp-control-button-label', title: `Click to add chain representaion`, onClick: () => this.addChainRepr(), children: ["\u00A0\u00A0Add Chain ", this.props.structure.struct_asym_id, " Representation"] }) })] });
|
|
576
571
|
}
|
|
577
572
|
}
|
|
578
573
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
@@ -637,11 +632,11 @@ class StructureNode extends base_1.PluginUIComponent {
|
|
|
637
632
|
if (superpositionParams && superpositionParams.ligandView) {
|
|
638
633
|
strTitle = `${this.props.structure.pdb_id} ${this.props.structure.struct_asym_id}`;
|
|
639
634
|
}
|
|
640
|
-
const label = (0, jsx_runtime_1.jsxs)(common_1.Button,
|
|
635
|
+
const label = (0, jsx_runtime_1.jsxs)(common_1.Button, { className: `msp-btn-tree-label`, style: { borderLeftColor: this.panelColor }, noOverflow: true, title: strTitle, disabled: (invalidStruct || this.state.isBusy || this.state.isProcessing) ? true : false, onMouseEnter: this.highlight, onMouseLeave: this.clearHighlight, children: [(0, jsx_runtime_1.jsx)("span", { children: strTitle }), subTitle && (0, jsx_runtime_1.jsx)("small", { children: subTitle })] });
|
|
641
636
|
const expand = (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: !this.state.showControls ? icons_1.ArrowRightSvg : icons_1.ArrowDropDownSvg, flex: '20px', onClick: this.toggleControls, transparent: true, className: 'msp-no-hover-outline', disabled: (invalidStruct || this.state.isBusy || this.state.isProcessing) ? true : false });
|
|
642
637
|
const visibility = (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: this.state.isHidden ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, toggleState: false, small: true, onClick: this.toggleVisible, disabled: (invalidStruct || this.state.isBusy || this.state.isProcessing) ? true : false, title: this.state.isHidden ? `Show chain` : `Hide chain` });
|
|
643
|
-
const row = (0, jsx_runtime_1.jsxs)("div",
|
|
644
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
638
|
+
const row = (0, jsx_runtime_1.jsxs)("div", { className: `msp-flex-row msp-tree-row`, style: { marginLeft: !this.state.isHidden ? '10px' : '31px' }, children: [!this.state.isHidden && expand, label, visibility] });
|
|
639
|
+
return (0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: '1px' }, children: [row, this.state.showControls && this.updates()] });
|
|
645
640
|
}
|
|
646
641
|
}
|
|
647
642
|
class StructureRepresentationEntry extends base_1.PurePluginUIComponent {
|
|
@@ -677,6 +672,6 @@ class StructureRepresentationEntry extends base_1.PurePluginUIComponent {
|
|
|
677
672
|
}
|
|
678
673
|
if (((_f = repr.obj) === null || _f === void 0 ? void 0 : _f.data.repr) && ((_g = repr.obj) === null || _g === void 0 ? void 0 : _g.data.repr.label) === 'Custom Selection')
|
|
679
674
|
label = 'Custom Selection';
|
|
680
|
-
return (0, jsx_runtime_1.jsxs)("div",
|
|
675
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-representation-entry', children: [repr.parent && (0, jsx_runtime_1.jsx)(common_1.ExpandGroup, { header: `${label || 'Representation'}`, noOffset: true, headerStyle: { overflow: 'hidden' }, children: (0, jsx_runtime_1.jsx)(update_transform_1.UpdateTransformControl, { state: repr.parent, transform: repr.transform, customHeader: 'none', noMargin: true }) }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: this.props.representation.cell.state.isHidden ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, toggleState: false, onClick: this.toggleVisible, title: this.props.representation.cell.state.isHidden ? `Show representation` : `Hide representation`, small: true, className: 'msp-default-bg', style: { position: 'absolute', top: 0, right: 0, lineHeight: '24px', height: '24px', textAlign: 'right', width: '32px', paddingRight: '6px', background: 'none' } })] });
|
|
681
676
|
}
|
|
682
677
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ControlsWrapper, Log } from 'molstar/lib/mol-plugin-ui/plugin';
|
|
3
2
|
import { SequenceView } from 'molstar/lib/mol-plugin-ui/sequence';
|
|
4
3
|
export declare const UIComponents: {
|
|
5
|
-
/** Component containing 3D canvas, button in top left and top right corners, and tooltip box (center panel in default layout) */
|
|
4
|
+
/** Component containing 3D canvas, button in top left and top right corners, and tooltip box (center panel in default layout). Changes to fullscreen view by "Toggle Expanded Viewport" button, or "expanded" option. */
|
|
6
5
|
readonly PDBeViewport: import("react").ComponentClass<{}, any>;
|
|
7
6
|
/** Component containing 1D view of the sequences (top panel in default layout) */
|
|
8
7
|
readonly SequenceView: typeof SequenceView;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UIComponents = void 0;
|
|
4
4
|
const plugin_1 = require("molstar/lib/mol-plugin-ui/plugin");
|
|
5
5
|
const sequence_1 = require("molstar/lib/mol-plugin-ui/sequence");
|
|
6
|
-
const pdbe_viewport_1 = require("../pdbe-viewport");
|
|
7
6
|
const pdbe_left_panel_1 = require("../left-panel/pdbe-left-panel");
|
|
7
|
+
const pdbe_viewport_1 = require("../pdbe-viewport");
|
|
8
8
|
exports.UIComponents = {
|
|
9
|
-
/** Component containing 3D canvas, button in top left and top right corners, and tooltip box (center panel in default layout) */
|
|
9
|
+
/** Component containing 3D canvas, button in top left and top right corners, and tooltip box (center panel in default layout). Changes to fullscreen view by "Toggle Expanded Viewport" button, or "expanded" option. */
|
|
10
10
|
PDBeViewport: pdbe_viewport_1.PDBeViewport,
|
|
11
11
|
/** Component containing 1D view of the sequences (top panel in default layout) */
|
|
12
12
|
SequenceView: sequence_1.SequenceView,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.LayoutSpecComponent = LayoutSpecComponent;
|
|
4
|
+
exports.createPluginSplitUI = createPluginSplitUI;
|
|
5
|
+
exports.resolveHTMLElement = resolveHTMLElement;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
8
|
const base_1 = require("molstar/lib/mol-plugin-ui/base");
|
|
@@ -11,10 +13,9 @@ const spec_1 = require("../../spec");
|
|
|
11
13
|
function LayoutSpecComponent(target, component, props) {
|
|
12
14
|
return { target, component, props };
|
|
13
15
|
}
|
|
14
|
-
exports.LayoutSpecComponent = LayoutSpecComponent;
|
|
15
16
|
function createPluginSplitUI(options) {
|
|
16
|
-
var _a;
|
|
17
17
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
var _a;
|
|
18
19
|
const { spec, layout, onBeforeUIRender } = options;
|
|
19
20
|
const render = (_a = options.render) !== null && _a !== void 0 ? _a : react18_1.renderReact18;
|
|
20
21
|
const ctx = new context_1.PluginUIContext(spec || (0, spec_1.DefaultPluginUISpec)());
|
|
@@ -44,7 +45,6 @@ function createPluginSplitUI(options) {
|
|
|
44
45
|
return ctx;
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
exports.createPluginSplitUI = createPluginSplitUI;
|
|
48
48
|
function resolveHTMLElement(element) {
|
|
49
49
|
if (typeof element === 'string') {
|
|
50
50
|
const result = document.getElementById(element);
|
|
@@ -56,7 +56,6 @@ function resolveHTMLElement(element) {
|
|
|
56
56
|
return element;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
exports.resolveHTMLElement = resolveHTMLElement;
|
|
60
59
|
function PluginPanelWrapper({ plugin, component, props }) {
|
|
61
60
|
const [state, setState] = (0, react_1.useState)({ kind: 'pending' });
|
|
62
61
|
(0, react_1.useEffect)(() => {
|
|
@@ -73,7 +72,7 @@ function PluginPanelWrapper({ plugin, component, props }) {
|
|
|
73
72
|
}, [plugin]);
|
|
74
73
|
if (state.kind !== 'initialized') {
|
|
75
74
|
const message = state.kind === 'error' ? `Initialization error: ${state.message}` : 'Waiting for plugin initialization';
|
|
76
|
-
return (0, jsx_runtime_1.jsx)("div",
|
|
75
|
+
return (0, jsx_runtime_1.jsx)("div", { className: 'msp-plugin', style: { position: 'relative', width: '100%', height: '100%' }, children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-plugin-init-error', children: message }) });
|
|
77
76
|
}
|
|
78
|
-
return (0, jsx_runtime_1.jsx)(base_1.PluginReactContext.Provider,
|
|
77
|
+
return (0, jsx_runtime_1.jsx)(base_1.PluginReactContext.Provider, { value: plugin, children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-plugin', style: { position: 'relative', width: '100%', height: '100%' }, children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-plugin-content msp-layout-standard msp-layout-static', style: { position: 'relative', width: '100%', height: '100%' }, children: (0, react_1.createElement)(component, props) }) }) });
|
|
79
78
|
}
|