drugflow-molstar 0.4.6 → 0.4.8

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.
Files changed (54) hide show
  1. package/build/drugflow-molstar-0.4.8.css +1 -0
  2. package/build/drugflow-molstar-component-0.4.8.js +25 -0
  3. package/build/drugflow-molstar-plugin-0.4.8.js +2 -0
  4. package/build/drugflow-molstar-plugin-0.4.8.js.LICENSE.txt +39 -0
  5. package/lib/alphafold-transparency.js +157 -62
  6. package/lib/contact.d.ts +7 -14
  7. package/lib/contact.js +68 -72
  8. package/lib/custom-events.js +15 -15
  9. package/lib/domain-annotations/behavior.d.ts +1 -1
  10. package/lib/domain-annotations/behavior.js +24 -20
  11. package/lib/domain-annotations/color.js +22 -22
  12. package/lib/domain-annotations/prop.js +111 -62
  13. package/lib/drugflow-molstar-component-build-0.4.7.js +2 -0
  14. package/lib/drugflow-molstar-component-build-0.4.7.js.LICENSE.txt +24 -0
  15. package/lib/drugflow-molstar-component-build-0.4.8.js +2 -0
  16. package/lib/drugflow-molstar-component-build-0.4.8.js.LICENSE.txt +24 -0
  17. package/lib/helpers.d.ts +3 -3
  18. package/lib/helpers.js +94 -89
  19. package/lib/index.d.ts +902 -1
  20. package/lib/index.js +2836 -1806
  21. package/lib/labels.d.ts +1 -1
  22. package/lib/labels.js +34 -20
  23. package/lib/loci-details.js +46 -34
  24. package/lib/sifts-mapping.js +32 -28
  25. package/lib/sifts-mappings-behaviour.d.ts +1 -1
  26. package/lib/sifts-mappings-behaviour.js +30 -26
  27. package/lib/spec.js +40 -52
  28. package/lib/structure_contact3d.d.ts +14 -21
  29. package/lib/structure_contact3d.js +46 -25
  30. package/lib/subscribe-events.js +18 -19
  31. package/lib/superposition-export.js +178 -102
  32. package/lib/superposition-focus-representation.d.ts +2 -2
  33. package/lib/superposition-focus-representation.js +131 -73
  34. package/lib/superposition-sifts-mapping.js +150 -105
  35. package/lib/superposition.js +810 -495
  36. package/lib/ui/alphafold-superposition.d.ts +1 -1
  37. package/lib/ui/alphafold-superposition.js +118 -94
  38. package/lib/ui/alphafold-tranparency.js +43 -27
  39. package/lib/ui/annotation-controls.js +89 -83
  40. package/lib/ui/export-superposition.d.ts +0 -1
  41. package/lib/ui/export-superposition.js +50 -32
  42. package/lib/ui/pdbe-left-panel.d.ts +0 -1
  43. package/lib/ui/pdbe-left-panel.js +105 -82
  44. package/lib/ui/pdbe-screenshot-controls.js +83 -54
  45. package/lib/ui/pdbe-structure-controls.js +57 -34
  46. package/lib/ui/pdbe-viewport-controls.js +29 -23
  47. package/lib/ui/segment-tree.js +663 -440
  48. package/lib/ui/superposition-components.js +312 -208
  49. package/lib/ui/superposition-viewport.js +18 -11
  50. package/package.json +3 -3
  51. package/build/drugflow-molstar-0.4.6.css +0 -1
  52. package/build/drugflow-molstar-component-0.4.6.js +0 -25
  53. package/build/drugflow-molstar-plugin-0.4.6.js +0 -2
  54. package/build/drugflow-molstar-plugin-0.4.6.js.LICENSE.txt +0 -64
@@ -1,59 +1,61 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnnotationsComponentControls = exports.TextsmsOutlinedSvg = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const common_1 = require("Molstar/mol-plugin-ui/controls/common");
6
- const base_1 = require("Molstar/mol-plugin-ui/base");
7
- const color_1 = require("Molstar/extensions/pdbe/structure-quality-report/color");
8
- const mol_state_1 = require("Molstar/mol-state");
9
- const parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
10
- const color_2 = require("../domain-annotations/color");
11
- const behavior_1 = require("Molstar/extensions/pdbe/structure-quality-report/behavior");
12
- const behavior_2 = require("../domain-annotations/behavior");
13
- const icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
14
- const hierarchy_1 = require("Molstar/mol-plugin-state/manager/structure/hierarchy");
15
- const _TextsmsOutlined = (0, jsx_runtime_1.jsxs)("svg", { width: '24px', height: '24px', viewBox: '0 0 24 24', children: [(0, jsx_runtime_1.jsx)("path", { fill: "none", d: "M0 0h24v24H0V0z" }), (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z" }), (0, jsx_runtime_1.jsx)("path", { d: "M7 9h2v2H7zM11 9h2v2h-2zM15 9h2v2h-2z" })] })] });
16
- function TextsmsOutlinedSvg() { return _TextsmsOutlined; }
3
+ exports.AnnotationsComponentControls = void 0;
17
4
  exports.TextsmsOutlinedSvg = TextsmsOutlinedSvg;
18
- class AnnotationsComponentControls extends base_1.PurePluginUIComponent {
19
- constructor() {
20
- super(...arguments);
21
- this.state = {
5
+ var tslib_1 = require("tslib");
6
+ var jsx_runtime_1 = require("react/jsx-runtime");
7
+ var common_1 = require("Molstar/mol-plugin-ui/controls/common");
8
+ var base_1 = require("Molstar/mol-plugin-ui/base");
9
+ var color_1 = require("Molstar/extensions/pdbe/structure-quality-report/color");
10
+ var mol_state_1 = require("Molstar/mol-state");
11
+ var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
12
+ var color_2 = require("../domain-annotations/color");
13
+ var behavior_1 = require("Molstar/extensions/pdbe/structure-quality-report/behavior");
14
+ var behavior_2 = require("../domain-annotations/behavior");
15
+ var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
16
+ var hierarchy_1 = require("Molstar/mol-plugin-state/manager/structure/hierarchy");
17
+ var _TextsmsOutlined = (0, jsx_runtime_1.jsxs)("svg", { width: '24px', height: '24px', viewBox: '0 0 24 24', children: [(0, jsx_runtime_1.jsx)("path", { fill: "none", d: "M0 0h24v24H0V0z" }), (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z" }), (0, jsx_runtime_1.jsx)("path", { d: "M7 9h2v2H7zM11 9h2v2h-2zM15 9h2v2h-2z" })] })] });
18
+ function TextsmsOutlinedSvg() { return _TextsmsOutlined; }
19
+ var AnnotationsComponentControls = /** @class */ (function (_super) {
20
+ tslib_1.__extends(AnnotationsComponentControls, _super);
21
+ function AnnotationsComponentControls() {
22
+ var _this = _super.apply(this, tslib_1.__spreadArray([], tslib_1.__read(arguments), false)) || this;
23
+ _this.state = {
22
24
  isCollapsed: false,
23
25
  validationApplied: false,
24
26
  domainAtnApplied: false,
25
27
  validationOptions: false,
26
28
  domainAtnOptions: false
27
29
  };
28
- this.getOptionParams = () => {
29
- let validationAnnotationCtrl = false;
30
- let domainAnnotationCtrl = false;
31
- const customState = this.plugin.customState;
30
+ _this.getOptionParams = function () {
31
+ var validationAnnotationCtrl = false;
32
+ var domainAnnotationCtrl = false;
33
+ var customState = _this.plugin.customState;
32
34
  if (customState && customState.initParams) {
33
35
  if (customState.initParams.validationAnnotation)
34
36
  validationAnnotationCtrl = true;
35
37
  if (customState.initParams.domainAnnotation)
36
38
  domainAnnotationCtrl = true;
37
39
  }
38
- if ((validationAnnotationCtrl && !this.state.validationParams) || (domainAnnotationCtrl && !this.state.domainAtnParams)) {
39
- const groupRef = mol_state_1.StateSelection.findTagInSubtree(this.plugin.state.data.tree, mol_state_1.StateTransform.RootRef, 'structure-component-static-polymer');
40
+ if ((validationAnnotationCtrl && !_this.state.validationParams) || (domainAnnotationCtrl && !_this.state.domainAtnParams)) {
41
+ var groupRef = mol_state_1.StateSelection.findTagInSubtree(_this.plugin.state.data.tree, mol_state_1.StateTransform.RootRef, 'structure-component-static-polymer');
40
42
  if (groupRef) {
41
- const struct = this.plugin.state.data.select(groupRef)[0].obj;
43
+ var struct = _this.plugin.state.data.select(groupRef)[0].obj;
42
44
  if (struct) {
43
- const themeDataCtx = { structure: struct.data };
44
- if (validationAnnotationCtrl && !this.state.validationParams) {
45
- const validationActionsParams = color_1.StructureQualityReportColorThemeProvider.getParams(themeDataCtx);
45
+ var themeDataCtx = { structure: struct.data };
46
+ if (validationAnnotationCtrl && !_this.state.validationParams) {
47
+ var validationActionsParams = color_1.StructureQualityReportColorThemeProvider.getParams(themeDataCtx);
46
48
  if (validationActionsParams) {
47
- this.setState({ validationParams: {
49
+ _this.setState({ validationParams: {
48
50
  params: validationActionsParams,
49
51
  values: { type: validationActionsParams.type.defaultValue }
50
52
  } });
51
53
  }
52
54
  }
53
- if (domainAnnotationCtrl && !this.state.domainAtnParams) {
54
- const domainActionsParams = color_2.DomainAnnotationsColorThemeProvider.getParams(themeDataCtx);
55
+ if (domainAnnotationCtrl && !_this.state.domainAtnParams) {
56
+ var domainActionsParams = color_2.DomainAnnotationsColorThemeProvider.getParams(themeDataCtx);
55
57
  if (domainActionsParams) {
56
- this.setState({ domainAtnParams: {
58
+ _this.setState({ domainAtnParams: {
57
59
  params: domainActionsParams,
58
60
  values: { type: domainActionsParams.type.defaultValue }
59
61
  } });
@@ -63,98 +65,102 @@ class AnnotationsComponentControls extends base_1.PurePluginUIComponent {
63
65
  }
64
66
  }
65
67
  };
66
- this.toggleCollapsed = () => {
67
- this.setState({ isCollapsed: !this.state.isCollapsed });
68
+ _this.toggleCollapsed = function () {
69
+ _this.setState({ isCollapsed: !_this.state.isCollapsed });
68
70
  };
69
- this.toggleOptions = (type) => {
71
+ _this.toggleOptions = function (type) {
70
72
  if (type === 0)
71
- this.setState({ validationOptions: !this.state.validationOptions });
73
+ _this.setState({ validationOptions: !_this.state.validationOptions });
72
74
  if (type === 1)
73
- this.setState({ domainAtnOptions: !this.state.domainAtnOptions });
75
+ _this.setState({ domainAtnOptions: !_this.state.domainAtnOptions });
74
76
  };
75
- this.applyAnnotation = (type, visibleState, params) => {
77
+ _this.applyAnnotation = function (type, visibleState, params) {
76
78
  // Defaults
77
- let themeName = 'polymer-id';
78
- let themePropsToAdd = behavior_1.PDBeStructureQualityReport;
79
- let themePropsToRemove = this.state.domainAtnParams ? behavior_2.PDBeDomainAnnotations : void 0;
79
+ var themeName = 'polymer-id';
80
+ var themePropsToAdd = behavior_1.PDBeStructureQualityReport;
81
+ var themePropsToRemove = _this.state.domainAtnParams ? behavior_2.PDBeDomainAnnotations : void 0;
80
82
  // Set Theme Params
81
83
  if (type === 0) {
82
84
  if (visibleState) {
83
85
  themeName = 'pdbe-structure-quality-report';
84
86
  }
85
- this.setState({ validationApplied: visibleState });
86
- this.setState({ domainAtnApplied: false });
87
+ _this.setState({ validationApplied: visibleState });
88
+ _this.setState({ domainAtnApplied: false });
87
89
  }
88
90
  else {
89
91
  themePropsToAdd = behavior_2.PDBeDomainAnnotations;
90
- themePropsToRemove = this.state.validationParams ? behavior_1.PDBeStructureQualityReport : void 0;
92
+ themePropsToRemove = _this.state.validationParams ? behavior_1.PDBeStructureQualityReport : void 0;
91
93
  if (visibleState)
92
94
  themeName = 'pdbe-domain-annotations';
93
- this.setState({ domainAtnApplied: visibleState });
94
- this.setState({ validationApplied: false });
95
+ _this.setState({ domainAtnApplied: visibleState });
96
+ _this.setState({ validationApplied: false });
95
97
  }
96
98
  // Update Tooltip
97
99
  if (visibleState && themeName !== 'polymer-id') {
98
- const addTooltipUpdate = this.plugin.state.behaviors.build().to(themePropsToAdd.id).update(themePropsToAdd, (old) => { old.showTooltip = true; });
99
- this.plugin.runTask(this.plugin.state.behaviors.updateTree(addTooltipUpdate));
100
+ var addTooltipUpdate = _this.plugin.state.behaviors.build().to(themePropsToAdd.id).update(themePropsToAdd, function (old) { old.showTooltip = true; });
101
+ _this.plugin.runTask(_this.plugin.state.behaviors.updateTree(addTooltipUpdate));
100
102
  if (themePropsToRemove) {
101
- const removeTooltipUpdate = this.plugin.state.behaviors.build().to(themePropsToRemove.id).update(themePropsToRemove, (old) => { old.showTooltip = false; });
102
- this.plugin.runTask(this.plugin.state.behaviors.updateTree(removeTooltipUpdate));
103
+ var removeTooltipUpdate = _this.plugin.state.behaviors.build().to(themePropsToRemove.id).update(themePropsToRemove, function (old) { old.showTooltip = false; });
104
+ _this.plugin.runTask(_this.plugin.state.behaviors.updateTree(removeTooltipUpdate));
103
105
  }
104
106
  }
105
- let polymerGroup;
106
- const componentGroups = this.plugin.managers.structure.hierarchy.currentComponentGroups;
107
- componentGroups.forEach((compGrp) => {
107
+ var polymerGroup;
108
+ var componentGroups = _this.plugin.managers.structure.hierarchy.currentComponentGroups;
109
+ componentGroups.forEach(function (compGrp) {
108
110
  if (compGrp[0].key === 'structure-component-static-polymer')
109
111
  polymerGroup = compGrp;
110
112
  });
111
113
  if (polymerGroup) {
112
- this.plugin.managers.structure.component.updateRepresentationsTheme(polymerGroup, { color: themeName, colorParams: params ? params : void 0 });
114
+ _this.plugin.managers.structure.component.updateRepresentationsTheme(polymerGroup, { color: themeName, colorParams: params ? params : void 0 });
113
115
  }
114
116
  };
115
- this.initApplyAnnotation = (type) => {
117
+ _this.initApplyAnnotation = function (type) {
116
118
  if (type === 0)
117
- this.applyAnnotation(0, !this.state.validationApplied, this.state.validationParams.values);
119
+ _this.applyAnnotation(0, !_this.state.validationApplied, _this.state.validationParams.values);
118
120
  if (type === 1)
119
- this.applyAnnotation(1, !this.state.domainAtnApplied, this.state.domainAtnParams.values);
121
+ _this.applyAnnotation(1, !_this.state.domainAtnApplied, _this.state.domainAtnParams.values);
120
122
  };
121
- this.updateValidationParams = (val) => {
122
- const updatedParams = { ...this.state.validationParams };
123
+ _this.updateValidationParams = function (val) {
124
+ var updatedParams = tslib_1.__assign({}, _this.state.validationParams);
123
125
  updatedParams.values = val;
124
- this.setState({ validationParams: updatedParams });
125
- if (this.state.validationApplied)
126
- this.applyAnnotation(0, this.state.validationApplied, val);
126
+ _this.setState({ validationParams: updatedParams });
127
+ if (_this.state.validationApplied)
128
+ _this.applyAnnotation(0, _this.state.validationApplied, val);
127
129
  };
128
- this.updateDomainAtnParams = (val) => {
129
- const updatedParams = { ...this.state.domainAtnParams };
130
+ _this.updateDomainAtnParams = function (val) {
131
+ var updatedParams = tslib_1.__assign({}, _this.state.domainAtnParams);
130
132
  updatedParams.values = val;
131
- this.setState({ domainAtnParams: updatedParams });
132
- if (this.state.domainAtnApplied)
133
- this.applyAnnotation(1, this.state.domainAtnApplied, val);
133
+ _this.setState({ domainAtnParams: updatedParams });
134
+ if (_this.state.domainAtnApplied)
135
+ _this.applyAnnotation(1, _this.state.domainAtnApplied, val);
134
136
  };
137
+ return _this;
135
138
  }
136
- componentDidMount() {
137
- this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, () => {
138
- this.getOptionParams();
139
- this.forceUpdate();
139
+ AnnotationsComponentControls.prototype.componentDidMount = function () {
140
+ var _this = this;
141
+ this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, function () {
142
+ _this.getOptionParams();
143
+ _this.forceUpdate();
140
144
  });
141
- this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, c => this.setState({
142
- description: hierarchy_1.StructureHierarchyManager.getSelectedStructuresDescription(this.plugin)
143
- }));
144
- }
145
- render() {
145
+ this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, function (c) { return _this.setState({
146
+ description: hierarchy_1.StructureHierarchyManager.getSelectedStructuresDescription(_this.plugin)
147
+ }); });
148
+ };
149
+ AnnotationsComponentControls.prototype.render = function () {
150
+ var _this = this;
146
151
  if (!this.state.validationParams && !this.state.domainAtnParams)
147
152
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
148
- const brand = {
153
+ var brand = {
149
154
  accent: 'green',
150
155
  svg: TextsmsOutlinedSvg
151
156
  };
152
- const wrapClass = this.state.isCollapsed
157
+ var wrapClass = this.state.isCollapsed
153
158
  ? 'msp-transform-wrapper msp-transform-wrapper-collapsed'
154
159
  : 'msp-transform-wrapper';
155
- return (0, jsx_runtime_1.jsxs)("div", { className: wrapClass, children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-transform-header', children: (0, jsx_runtime_1.jsxs)(common_1.Button, { icon: brand ? void 0 : this.state.isCollapsed ? icons_1.ArrowRightSvg : icons_1.ArrowDropDownSvg, noOverflow: true, onClick: this.toggleCollapsed, className: brand ? `msp-transform-header-brand msp-transform-header-brand-${brand.accent}` : void 0, title: `Click to ${this.state.isCollapsed ? 'expand' : 'collapse'}`, children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: brand?.svg, inline: true }), "Annotations", (0, jsx_runtime_1.jsx)("small", { style: { margin: '0 6px' }, children: this.state.isCollapsed ? '' : this.state.description })] }) }), !this.state.isCollapsed && this.state.validationParams &&
156
- (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)(common_1.Button, { noOverflow: true, className: 'msp-control-button-label', title: `Validation Report Annotations.`, style: { textAlign: 'left' }, children: "Validation Report" }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: () => this.initApplyAnnotation(0), toggleState: false, svg: !this.state.validationApplied ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, title: `Click to ${this.state.validationApplied ? 'Hide' : 'Show'} Validation Report Annotation`, small: true, className: 'msp-form-control', flex: true }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: () => this.toggleOptions(0), svg: icons_1.MoreHorizSvg, title: 'Actions', toggleState: this.state.validationOptions, className: 'msp-form-control', flex: true })] }), !this.state.isCollapsed && this.state.validationParams && this.state.validationOptions && (0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '6px' }, children: (0, jsx_runtime_1.jsx)("div", { className: "msp-accent-offset", children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: this.state.validationParams.params, values: this.state.validationParams.values, onChangeValues: this.updateValidationParams }) }) }) }), !this.state.isCollapsed && this.state.domainAtnParams &&
157
- (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)(common_1.Button, { noOverflow: true, className: 'msp-control-button-label', title: `Domain Annotations.`, style: { textAlign: 'left' }, children: "Domains" }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: () => this.initApplyAnnotation(1), toggleState: false, svg: !this.state.domainAtnApplied ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, title: `Click to ${this.state.domainAtnApplied ? 'Hide' : 'Show'} Domain Annotation`, small: true, className: 'msp-form-control', flex: true }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: () => this.toggleOptions(1), svg: icons_1.MoreHorizSvg, title: 'Actions', toggleState: this.state.domainAtnOptions, className: 'msp-form-control', flex: true })] }), !this.state.isCollapsed && this.state.domainAtnParams && this.state.domainAtnOptions && (0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '6px' }, children: (0, jsx_runtime_1.jsx)("div", { className: "msp-accent-offset", children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: this.state.domainAtnParams.params, values: this.state.domainAtnParams.values, onChangeValues: this.updateDomainAtnParams }) }) }) })] });
158
- }
159
- }
160
+ return (0, jsx_runtime_1.jsxs)("div", { className: wrapClass, children: [(0, jsx_runtime_1.jsx)("div", { className: 'msp-transform-header', children: (0, jsx_runtime_1.jsxs)(common_1.Button, { icon: brand ? void 0 : this.state.isCollapsed ? icons_1.ArrowRightSvg : icons_1.ArrowDropDownSvg, noOverflow: true, onClick: this.toggleCollapsed, className: brand ? "msp-transform-header-brand msp-transform-header-brand-".concat(brand.accent) : void 0, title: "Click to ".concat(this.state.isCollapsed ? 'expand' : 'collapse'), children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { svg: brand === null || brand === void 0 ? void 0 : brand.svg, inline: true }), "Annotations", (0, jsx_runtime_1.jsx)("small", { style: { margin: '0 6px' }, children: this.state.isCollapsed ? '' : this.state.description })] }) }), !this.state.isCollapsed && this.state.validationParams &&
161
+ (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)(common_1.Button, { noOverflow: true, className: 'msp-control-button-label', title: "Validation Report Annotations.", style: { textAlign: 'left' }, children: "Validation Report" }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: function () { return _this.initApplyAnnotation(0); }, toggleState: false, svg: !this.state.validationApplied ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, title: "Click to ".concat(this.state.validationApplied ? 'Hide' : 'Show', " Validation Report Annotation"), small: true, className: 'msp-form-control', flex: true }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: function () { return _this.toggleOptions(0); }, svg: icons_1.MoreHorizSvg, title: 'Actions', toggleState: this.state.validationOptions, className: 'msp-form-control', flex: true })] }), !this.state.isCollapsed && this.state.validationParams && this.state.validationOptions && (0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '6px' }, children: (0, jsx_runtime_1.jsx)("div", { className: "msp-accent-offset", children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: this.state.validationParams.params, values: this.state.validationParams.values, onChangeValues: this.updateValidationParams }) }) }) }), !this.state.isCollapsed && this.state.domainAtnParams &&
162
+ (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', children: [(0, jsx_runtime_1.jsx)(common_1.Button, { noOverflow: true, className: 'msp-control-button-label', title: "Domain Annotations.", style: { textAlign: 'left' }, children: "Domains" }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: function () { return _this.initApplyAnnotation(1); }, toggleState: false, svg: !this.state.domainAtnApplied ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, title: "Click to ".concat(this.state.domainAtnApplied ? 'Hide' : 'Show', " Domain Annotation"), small: true, className: 'msp-form-control', flex: true }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { onClick: function () { return _this.toggleOptions(1); }, svg: icons_1.MoreHorizSvg, title: 'Actions', toggleState: this.state.domainAtnOptions, className: 'msp-form-control', flex: true })] }), !this.state.isCollapsed && this.state.domainAtnParams && this.state.domainAtnOptions && (0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '6px' }, children: (0, jsx_runtime_1.jsx)("div", { className: "msp-accent-offset", children: (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: this.state.domainAtnParams.params, values: this.state.domainAtnParams.values, onChangeValues: this.updateDomainAtnParams }) }) }) })] });
163
+ };
164
+ return AnnotationsComponentControls;
165
+ }(base_1.PurePluginUIComponent));
160
166
  exports.AnnotationsComponentControls = AnnotationsComponentControls;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CollapsableControls, CollapsableState } from 'Molstar/mol-plugin-ui/base';
3
2
  export declare class SuperpositionModelExportUI extends CollapsableControls<{}, {}> {
4
3
  protected defaultState(): CollapsableState;
@@ -1,53 +1,71 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SuperpositionModelExportUI = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const base_1 = require("Molstar/mol-plugin-ui/base");
7
- const common_1 = require("Molstar/mol-plugin-ui/controls/common");
8
- const icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
9
- const parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
10
- const use_behavior_1 = require("Molstar/mol-plugin-ui/hooks/use-behavior");
11
- const param_definition_1 = require("Molstar/mol-util/param-definition");
12
- const superposition_export_1 = require("../superposition-export");
13
- class SuperpositionModelExportUI extends base_1.CollapsableControls {
14
- defaultState() {
4
+ var tslib_1 = require("tslib");
5
+ var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
7
+ var base_1 = require("Molstar/mol-plugin-ui/base");
8
+ var common_1 = require("Molstar/mol-plugin-ui/controls/common");
9
+ var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
10
+ var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
11
+ var use_behavior_1 = require("Molstar/mol-plugin-ui/hooks/use-behavior");
12
+ var param_definition_1 = require("Molstar/mol-util/param-definition");
13
+ var superposition_export_1 = require("../superposition-export");
14
+ var SuperpositionModelExportUI = /** @class */ (function (_super) {
15
+ tslib_1.__extends(SuperpositionModelExportUI, _super);
16
+ function SuperpositionModelExportUI() {
17
+ return _super !== null && _super.apply(this, arguments) || this;
18
+ }
19
+ SuperpositionModelExportUI.prototype.defaultState = function () {
15
20
  return {
16
21
  header: 'Export Models',
17
22
  isCollapsed: true,
18
23
  brand: { accent: 'cyan', svg: icons_1.GetAppSvg }
19
24
  };
20
- }
21
- renderControls() {
25
+ };
26
+ SuperpositionModelExportUI.prototype.renderControls = function () {
22
27
  return (0, jsx_runtime_1.jsx)(SuperpositionExportControls, { plugin: this.plugin });
23
- }
24
- }
28
+ };
29
+ return SuperpositionModelExportUI;
30
+ }(base_1.CollapsableControls));
25
31
  exports.SuperpositionModelExportUI = SuperpositionModelExportUI;
26
- const Params = {
32
+ var Params = {
27
33
  format: param_definition_1.ParamDefinition.Select('cif', [['cif', 'mmCIF'], ['bcif', 'Binary mmCIF']])
28
34
  };
29
- const DefaultParams = param_definition_1.ParamDefinition.getDefaultValues(Params);
30
- function SuperpositionExportControls({ plugin }) {
31
- const [params, setParams] = (0, react_1.useState)(DefaultParams);
32
- const [exporting, setExporting] = (0, react_1.useState)(false);
35
+ var DefaultParams = param_definition_1.ParamDefinition.getDefaultValues(Params);
36
+ function SuperpositionExportControls(_a) {
37
+ var _this = this;
38
+ var plugin = _a.plugin;
39
+ var _b = tslib_1.__read((0, react_1.useState)(DefaultParams), 2), params = _b[0], setParams = _b[1];
40
+ var _c = tslib_1.__read((0, react_1.useState)(false), 2), exporting = _c[0], setExporting = _c[1];
33
41
  (0, use_behavior_1.useBehavior)(plugin.managers.structure.hierarchy.behaviors.selection); // triggers UI update
34
- const isBusy = (0, use_behavior_1.useBehavior)(plugin.behaviors.state.isBusy);
35
- const hierarchy = plugin.managers.structure.hierarchy.current;
36
- let label = 'Nothing to Export';
42
+ var isBusy = (0, use_behavior_1.useBehavior)(plugin.behaviors.state.isBusy);
43
+ var hierarchy = plugin.managers.structure.hierarchy.current;
44
+ var label = 'Nothing to Export';
37
45
  if (hierarchy.structures.length === 1) {
38
46
  label = 'Export';
39
47
  }
40
48
  if (hierarchy.structures.length > 1) {
41
49
  label = 'Export (as ZIP)';
42
50
  }
43
- const onExport = async () => {
44
- setExporting(true);
45
- try {
46
- await (0, superposition_export_1.superpositionExportHierarchy)(plugin, { format: params.format });
47
- }
48
- finally {
49
- setExporting(false);
50
- }
51
- };
51
+ var onExport = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
52
+ return tslib_1.__generator(this, function (_a) {
53
+ switch (_a.label) {
54
+ case 0:
55
+ setExporting(true);
56
+ _a.label = 1;
57
+ case 1:
58
+ _a.trys.push([1, , 3, 4]);
59
+ return [4 /*yield*/, (0, superposition_export_1.superpositionExportHierarchy)(plugin, { format: params.format })];
60
+ case 2:
61
+ _a.sent();
62
+ return [3 /*break*/, 4];
63
+ case 3:
64
+ setExporting(false);
65
+ return [7 /*endfinally*/];
66
+ case 4: return [2 /*return*/];
67
+ }
68
+ });
69
+ }); };
52
70
  return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: Params, values: params, onChangeValues: setParams, isDisabled: isBusy || exporting }), (0, jsx_runtime_1.jsx)(common_1.Button, { onClick: onExport, style: { marginTop: 1 }, disabled: isBusy || hierarchy.structures.length === 0 || exporting, commit: hierarchy.structures.length ? 'on' : 'off', children: label })] });
53
71
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PluginUIComponent } from 'Molstar/mol-plugin-ui/base';
3
2
  export declare function WavesIconSvg(): import("react/jsx-runtime").JSX.Element;
4
3
  type LeftPanelTabName = 'none' | 'root' | 'data' | 'states' | 'settings' | 'help' | 'segments';