drugflow-molstar 0.3.77 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/build/drugflow-molstar-0.4.1.css +1 -0
  2. package/build/drugflow-molstar-component-0.4.1.js +25 -0
  3. package/build/drugflow-molstar-plugin-0.4.1.js +2 -0
  4. package/build/drugflow-molstar-plugin-0.4.1.js.LICENSE.txt +64 -0
  5. package/lib/alphafold-transparency.js +58 -125
  6. package/lib/contact.d.ts +15 -6
  7. package/lib/contact.js +71 -66
  8. package/lib/custom-events.js +16 -16
  9. package/lib/domain-annotations/behavior.js +20 -24
  10. package/lib/domain-annotations/color.d.ts +1 -1
  11. package/lib/domain-annotations/color.js +23 -22
  12. package/lib/domain-annotations/prop.d.ts +3 -3
  13. package/lib/domain-annotations/prop.js +54 -76
  14. package/lib/drugflow-molstar-component-build-0.3.78.js +2 -0
  15. package/lib/drugflow-molstar-component-build-0.4.1.js +2 -0
  16. package/lib/helpers.d.ts +4 -4
  17. package/lib/helpers.js +94 -99
  18. package/lib/index.js +1785 -2608
  19. package/lib/labels.d.ts +1 -1
  20. package/lib/labels.js +20 -23
  21. package/lib/loci-details.d.ts +2 -2
  22. package/lib/loci-details.js +26 -29
  23. package/lib/sifts-mapping.js +30 -34
  24. package/lib/sifts-mappings-behaviour.js +26 -30
  25. package/lib/spec.d.ts +1 -1
  26. package/lib/spec.js +50 -38
  27. package/lib/structure_contact3d.d.ts +13 -4
  28. package/lib/structure_contact3d.js +25 -46
  29. package/lib/subscribe-events.js +17 -17
  30. package/lib/superposition-export.js +100 -144
  31. package/lib/superposition-focus-representation.d.ts +1 -1
  32. package/lib/superposition-focus-representation.js +74 -112
  33. package/lib/superposition-sifts-mapping.d.ts +1 -1
  34. package/lib/superposition-sifts-mapping.js +56 -62
  35. package/lib/superposition.d.ts +2 -2
  36. package/lib/superposition.js +490 -726
  37. package/lib/ui/alphafold-superposition.d.ts +8 -9
  38. package/lib/ui/alphafold-superposition.js +96 -120
  39. package/lib/ui/alphafold-tranparency.d.ts +1 -2
  40. package/lib/ui/alphafold-tranparency.js +27 -43
  41. package/lib/ui/annotation-controls.d.ts +2 -3
  42. package/lib/ui/annotation-controls.js +81 -87
  43. package/lib/ui/export-superposition.js +33 -51
  44. package/lib/ui/pdbe-left-panel.d.ts +3 -3
  45. package/lib/ui/pdbe-left-panel.js +82 -106
  46. package/lib/ui/pdbe-screenshot-controls.d.ts +1 -1
  47. package/lib/ui/pdbe-screenshot-controls.js +54 -83
  48. package/lib/ui/pdbe-structure-controls.d.ts +4 -5
  49. package/lib/ui/pdbe-structure-controls.js +34 -57
  50. package/lib/ui/pdbe-viewport-controls.d.ts +1 -2
  51. package/lib/ui/pdbe-viewport-controls.js +23 -29
  52. package/lib/ui/segment-tree.d.ts +1 -2
  53. package/lib/ui/segment-tree.js +438 -590
  54. package/lib/ui/superposition-components.d.ts +1 -2
  55. package/lib/ui/superposition-components.js +196 -266
  56. package/lib/ui/superposition-viewport.d.ts +1 -2
  57. package/lib/ui/superposition-viewport.js +11 -18
  58. package/package.json +7 -4
  59. package/build/drugflow-molstar-0.3.62.css +0 -1
  60. package/build/drugflow-molstar-0.3.77.css +0 -1
  61. package/build/drugflow-molstar-component-0.3.62.js +0 -25
  62. package/build/drugflow-molstar-component-0.3.77.js +0 -25
  63. package/build/drugflow-molstar-light.css +0 -1
  64. package/build/drugflow-molstar-plugin-0.3.62.js +0 -2
  65. package/build/drugflow-molstar-plugin-0.3.62.js.LICENSE.txt +0 -39
  66. package/build/drugflow-molstar-plugin-0.3.77.js +0 -2
  67. package/build/drugflow-molstar-plugin-0.3.77.js.LICENSE.txt +0 -39
  68. package/lib/drugflow-molstar-component-build-0.1.2.js +0 -4268
  69. package/lib/drugflow-molstar-component-build-0.1.2.js.map +0 -1
  70. package/lib/drugflow-molstar-component-build-0.1.3.js +0 -2
  71. package/lib/drugflow-molstar-component-build-0.1.4.js +0 -2
  72. package/lib/drugflow-molstar-component-build-0.1.4.js.LICENSE.txt +0 -24
  73. package/lib/drugflow-molstar-component-build-0.1.5.js +0 -2
  74. package/lib/drugflow-molstar-component-build-0.1.5.js.LICENSE.txt +0 -24
  75. package/lib/drugflow-molstar-component-build-0.1.6.js +0 -2
  76. package/lib/drugflow-molstar-component-build-0.1.6.js.LICENSE.txt +0 -24
  77. package/lib/drugflow-molstar-component-build-0.2.10.js +0 -2
  78. package/lib/drugflow-molstar-component-build-0.2.10.js.LICENSE.txt +0 -24
  79. package/lib/drugflow-molstar-component-build-0.2.2.js +0 -2
  80. package/lib/drugflow-molstar-component-build-0.2.2.js.LICENSE.txt +0 -24
  81. package/lib/drugflow-molstar-component-build-0.2.3.js +0 -2
  82. package/lib/drugflow-molstar-component-build-0.2.3.js.LICENSE.txt +0 -24
  83. package/lib/drugflow-molstar-component-build-0.2.4.js +0 -2
  84. package/lib/drugflow-molstar-component-build-0.2.4.js.LICENSE.txt +0 -24
  85. package/lib/drugflow-molstar-component-build-0.2.5.js +0 -2
  86. package/lib/drugflow-molstar-component-build-0.2.5.js.LICENSE.txt +0 -24
  87. package/lib/drugflow-molstar-component-build-0.2.6.js +0 -2
  88. package/lib/drugflow-molstar-component-build-0.2.6.js.LICENSE.txt +0 -24
  89. package/lib/drugflow-molstar-component-build-0.2.7.js +0 -2
  90. package/lib/drugflow-molstar-component-build-0.2.7.js.LICENSE.txt +0 -24
  91. package/lib/drugflow-molstar-component-build-0.2.9.js +0 -2
  92. package/lib/drugflow-molstar-component-build-0.2.9.js.LICENSE.txt +0 -24
  93. package/lib/drugflow-molstar-component-build-0.3.1.js +0 -2
  94. package/lib/drugflow-molstar-component-build-0.3.1.js.LICENSE.txt +0 -24
  95. package/lib/drugflow-molstar-component-build-0.3.10.js +0 -2
  96. package/lib/drugflow-molstar-component-build-0.3.10.js.LICENSE.txt +0 -24
  97. package/lib/drugflow-molstar-component-build-0.3.11.js +0 -2
  98. package/lib/drugflow-molstar-component-build-0.3.11.js.LICENSE.txt +0 -24
  99. package/lib/drugflow-molstar-component-build-0.3.12.js +0 -2
  100. package/lib/drugflow-molstar-component-build-0.3.12.js.LICENSE.txt +0 -24
  101. package/lib/drugflow-molstar-component-build-0.3.13.js +0 -2
  102. package/lib/drugflow-molstar-component-build-0.3.13.js.LICENSE.txt +0 -24
  103. package/lib/drugflow-molstar-component-build-0.3.14.js +0 -2
  104. package/lib/drugflow-molstar-component-build-0.3.14.js.LICENSE.txt +0 -24
  105. package/lib/drugflow-molstar-component-build-0.3.15.js +0 -2
  106. package/lib/drugflow-molstar-component-build-0.3.15.js.LICENSE.txt +0 -24
  107. package/lib/drugflow-molstar-component-build-0.3.16.js +0 -2
  108. package/lib/drugflow-molstar-component-build-0.3.16.js.LICENSE.txt +0 -24
  109. package/lib/drugflow-molstar-component-build-0.3.17.js +0 -2
  110. package/lib/drugflow-molstar-component-build-0.3.17.js.LICENSE.txt +0 -24
  111. package/lib/drugflow-molstar-component-build-0.3.18.js +0 -2
  112. package/lib/drugflow-molstar-component-build-0.3.18.js.LICENSE.txt +0 -24
  113. package/lib/drugflow-molstar-component-build-0.3.19.js +0 -2
  114. package/lib/drugflow-molstar-component-build-0.3.19.js.LICENSE.txt +0 -24
  115. package/lib/drugflow-molstar-component-build-0.3.2.js +0 -2
  116. package/lib/drugflow-molstar-component-build-0.3.2.js.LICENSE.txt +0 -24
  117. package/lib/drugflow-molstar-component-build-0.3.20.js +0 -2
  118. package/lib/drugflow-molstar-component-build-0.3.20.js.LICENSE.txt +0 -24
  119. package/lib/drugflow-molstar-component-build-0.3.21.js +0 -2
  120. package/lib/drugflow-molstar-component-build-0.3.21.js.LICENSE.txt +0 -24
  121. package/lib/drugflow-molstar-component-build-0.3.22.js +0 -2
  122. package/lib/drugflow-molstar-component-build-0.3.22.js.LICENSE.txt +0 -24
  123. package/lib/drugflow-molstar-component-build-0.3.23.js +0 -2
  124. package/lib/drugflow-molstar-component-build-0.3.23.js.LICENSE.txt +0 -24
  125. package/lib/drugflow-molstar-component-build-0.3.24.js +0 -2
  126. package/lib/drugflow-molstar-component-build-0.3.24.js.LICENSE.txt +0 -24
  127. package/lib/drugflow-molstar-component-build-0.3.25.js +0 -2
  128. package/lib/drugflow-molstar-component-build-0.3.25.js.LICENSE.txt +0 -24
  129. package/lib/drugflow-molstar-component-build-0.3.26.js +0 -2
  130. package/lib/drugflow-molstar-component-build-0.3.26.js.LICENSE.txt +0 -24
  131. package/lib/drugflow-molstar-component-build-0.3.27.js +0 -2
  132. package/lib/drugflow-molstar-component-build-0.3.27.js.LICENSE.txt +0 -24
  133. package/lib/drugflow-molstar-component-build-0.3.28.js +0 -2
  134. package/lib/drugflow-molstar-component-build-0.3.28.js.LICENSE.txt +0 -24
  135. package/lib/drugflow-molstar-component-build-0.3.29.js +0 -2
  136. package/lib/drugflow-molstar-component-build-0.3.29.js.LICENSE.txt +0 -24
  137. package/lib/drugflow-molstar-component-build-0.3.3.js +0 -2
  138. package/lib/drugflow-molstar-component-build-0.3.3.js.LICENSE.txt +0 -24
  139. package/lib/drugflow-molstar-component-build-0.3.30.js +0 -2
  140. package/lib/drugflow-molstar-component-build-0.3.30.js.LICENSE.txt +0 -24
  141. package/lib/drugflow-molstar-component-build-0.3.31.js +0 -2
  142. package/lib/drugflow-molstar-component-build-0.3.31.js.LICENSE.txt +0 -24
  143. package/lib/drugflow-molstar-component-build-0.3.32.js +0 -2
  144. package/lib/drugflow-molstar-component-build-0.3.32.js.LICENSE.txt +0 -24
  145. package/lib/drugflow-molstar-component-build-0.3.33.js +0 -2
  146. package/lib/drugflow-molstar-component-build-0.3.33.js.LICENSE.txt +0 -24
  147. package/lib/drugflow-molstar-component-build-0.3.34.js +0 -2
  148. package/lib/drugflow-molstar-component-build-0.3.34.js.LICENSE.txt +0 -24
  149. package/lib/drugflow-molstar-component-build-0.3.35.js +0 -2
  150. package/lib/drugflow-molstar-component-build-0.3.35.js.LICENSE.txt +0 -24
  151. package/lib/drugflow-molstar-component-build-0.3.36.js +0 -2
  152. package/lib/drugflow-molstar-component-build-0.3.36.js.LICENSE.txt +0 -24
  153. package/lib/drugflow-molstar-component-build-0.3.37.js +0 -2
  154. package/lib/drugflow-molstar-component-build-0.3.37.js.LICENSE.txt +0 -24
  155. package/lib/drugflow-molstar-component-build-0.3.38.js +0 -2
  156. package/lib/drugflow-molstar-component-build-0.3.38.js.LICENSE.txt +0 -24
  157. package/lib/drugflow-molstar-component-build-0.3.39.js +0 -2
  158. package/lib/drugflow-molstar-component-build-0.3.39.js.LICENSE.txt +0 -24
  159. package/lib/drugflow-molstar-component-build-0.3.4.js +0 -2
  160. package/lib/drugflow-molstar-component-build-0.3.4.js.LICENSE.txt +0 -24
  161. package/lib/drugflow-molstar-component-build-0.3.40.js +0 -2
  162. package/lib/drugflow-molstar-component-build-0.3.40.js.LICENSE.txt +0 -24
  163. package/lib/drugflow-molstar-component-build-0.3.41.js +0 -2
  164. package/lib/drugflow-molstar-component-build-0.3.41.js.LICENSE.txt +0 -24
  165. package/lib/drugflow-molstar-component-build-0.3.42.js +0 -2
  166. package/lib/drugflow-molstar-component-build-0.3.42.js.LICENSE.txt +0 -24
  167. package/lib/drugflow-molstar-component-build-0.3.43.js +0 -2
  168. package/lib/drugflow-molstar-component-build-0.3.43.js.LICENSE.txt +0 -24
  169. package/lib/drugflow-molstar-component-build-0.3.44.js +0 -2
  170. package/lib/drugflow-molstar-component-build-0.3.44.js.LICENSE.txt +0 -24
  171. package/lib/drugflow-molstar-component-build-0.3.46.js +0 -2
  172. package/lib/drugflow-molstar-component-build-0.3.46.js.LICENSE.txt +0 -24
  173. package/lib/drugflow-molstar-component-build-0.3.47.js +0 -2
  174. package/lib/drugflow-molstar-component-build-0.3.47.js.LICENSE.txt +0 -24
  175. package/lib/drugflow-molstar-component-build-0.3.48.js +0 -2
  176. package/lib/drugflow-molstar-component-build-0.3.48.js.LICENSE.txt +0 -24
  177. package/lib/drugflow-molstar-component-build-0.3.49.js +0 -2
  178. package/lib/drugflow-molstar-component-build-0.3.49.js.LICENSE.txt +0 -24
  179. package/lib/drugflow-molstar-component-build-0.3.5.js +0 -2
  180. package/lib/drugflow-molstar-component-build-0.3.5.js.LICENSE.txt +0 -24
  181. package/lib/drugflow-molstar-component-build-0.3.50.js +0 -2
  182. package/lib/drugflow-molstar-component-build-0.3.50.js.LICENSE.txt +0 -24
  183. package/lib/drugflow-molstar-component-build-0.3.51.js +0 -2
  184. package/lib/drugflow-molstar-component-build-0.3.51.js.LICENSE.txt +0 -24
  185. package/lib/drugflow-molstar-component-build-0.3.52.js +0 -2
  186. package/lib/drugflow-molstar-component-build-0.3.52.js.LICENSE.txt +0 -24
  187. package/lib/drugflow-molstar-component-build-0.3.53.js +0 -2
  188. package/lib/drugflow-molstar-component-build-0.3.53.js.LICENSE.txt +0 -24
  189. package/lib/drugflow-molstar-component-build-0.3.54.js +0 -2
  190. package/lib/drugflow-molstar-component-build-0.3.54.js.LICENSE.txt +0 -24
  191. package/lib/drugflow-molstar-component-build-0.3.55.js +0 -2
  192. package/lib/drugflow-molstar-component-build-0.3.55.js.LICENSE.txt +0 -24
  193. package/lib/drugflow-molstar-component-build-0.3.56.js +0 -2
  194. package/lib/drugflow-molstar-component-build-0.3.56.js.LICENSE.txt +0 -24
  195. package/lib/drugflow-molstar-component-build-0.3.57.js +0 -2
  196. package/lib/drugflow-molstar-component-build-0.3.57.js.LICENSE.txt +0 -24
  197. package/lib/drugflow-molstar-component-build-0.3.58.js +0 -2
  198. package/lib/drugflow-molstar-component-build-0.3.58.js.LICENSE.txt +0 -24
  199. package/lib/drugflow-molstar-component-build-0.3.59.js +0 -2
  200. package/lib/drugflow-molstar-component-build-0.3.59.js.LICENSE.txt +0 -24
  201. package/lib/drugflow-molstar-component-build-0.3.6.js +0 -2
  202. package/lib/drugflow-molstar-component-build-0.3.6.js.LICENSE.txt +0 -24
  203. package/lib/drugflow-molstar-component-build-0.3.60.js +0 -2
  204. package/lib/drugflow-molstar-component-build-0.3.60.js.LICENSE.txt +0 -24
  205. package/lib/drugflow-molstar-component-build-0.3.61.js +0 -2
  206. package/lib/drugflow-molstar-component-build-0.3.61.js.LICENSE.txt +0 -24
  207. package/lib/drugflow-molstar-component-build-0.3.62.js +0 -2
  208. package/lib/drugflow-molstar-component-build-0.3.62.js.LICENSE.txt +0 -24
  209. package/lib/drugflow-molstar-component-build-0.3.63.js +0 -2
  210. package/lib/drugflow-molstar-component-build-0.3.63.js.LICENSE.txt +0 -24
  211. package/lib/drugflow-molstar-component-build-0.3.64.js +0 -2
  212. package/lib/drugflow-molstar-component-build-0.3.64.js.LICENSE.txt +0 -24
  213. package/lib/drugflow-molstar-component-build-0.3.65.js +0 -2
  214. package/lib/drugflow-molstar-component-build-0.3.65.js.LICENSE.txt +0 -24
  215. package/lib/drugflow-molstar-component-build-0.3.66.js +0 -2
  216. package/lib/drugflow-molstar-component-build-0.3.66.js.LICENSE.txt +0 -24
  217. package/lib/drugflow-molstar-component-build-0.3.67.js +0 -2
  218. package/lib/drugflow-molstar-component-build-0.3.67.js.LICENSE.txt +0 -24
  219. package/lib/drugflow-molstar-component-build-0.3.68.js +0 -2
  220. package/lib/drugflow-molstar-component-build-0.3.68.js.LICENSE.txt +0 -24
  221. package/lib/drugflow-molstar-component-build-0.3.69.js +0 -2
  222. package/lib/drugflow-molstar-component-build-0.3.69.js.LICENSE.txt +0 -24
  223. package/lib/drugflow-molstar-component-build-0.3.7.js +0 -2
  224. package/lib/drugflow-molstar-component-build-0.3.7.js.LICENSE.txt +0 -24
  225. package/lib/drugflow-molstar-component-build-0.3.70.js +0 -2
  226. package/lib/drugflow-molstar-component-build-0.3.70.js.LICENSE.txt +0 -24
  227. package/lib/drugflow-molstar-component-build-0.3.71.js +0 -2
  228. package/lib/drugflow-molstar-component-build-0.3.71.js.LICENSE.txt +0 -24
  229. package/lib/drugflow-molstar-component-build-0.3.72.js +0 -2
  230. package/lib/drugflow-molstar-component-build-0.3.72.js.LICENSE.txt +0 -24
  231. package/lib/drugflow-molstar-component-build-0.3.73.js +0 -2
  232. package/lib/drugflow-molstar-component-build-0.3.73.js.LICENSE.txt +0 -24
  233. package/lib/drugflow-molstar-component-build-0.3.74.js +0 -2
  234. package/lib/drugflow-molstar-component-build-0.3.74.js.LICENSE.txt +0 -24
  235. package/lib/drugflow-molstar-component-build-0.3.75.js +0 -2
  236. package/lib/drugflow-molstar-component-build-0.3.75.js.LICENSE.txt +0 -24
  237. package/lib/drugflow-molstar-component-build-0.3.76.js +0 -2
  238. package/lib/drugflow-molstar-component-build-0.3.76.js.LICENSE.txt +0 -24
  239. package/lib/drugflow-molstar-component-build-0.3.77.js +0 -2
  240. package/lib/drugflow-molstar-component-build-0.3.77.js.LICENSE.txt +0 -24
  241. package/lib/drugflow-molstar-component-build-0.3.8.js +0 -2
  242. package/lib/drugflow-molstar-component-build-0.3.8.js.LICENSE.txt +0 -24
  243. package/lib/drugflow-molstar-component-build-0.3.9.js +0 -2
  244. package/lib/drugflow-molstar-component-build-0.3.9.js.LICENSE.txt +0 -24
  245. package/lib/index2.d.ts +0 -1
  246. package/lib/index2.js +0 -1369
  247. package/lib/pdbe-molstar-component-build-3.1.2.js +0 -2
  248. package/lib/pdbe-molstar-component-build-3.1.2.js.LICENSE.txt +0 -24
  249. /package/lib/{drugflow-molstar-component-build-0.1.2.js.LICENSE.txt → drugflow-molstar-component-build-0.3.78.js.LICENSE.txt} +0 -0
  250. /package/lib/{drugflow-molstar-component-build-0.1.3.js.LICENSE.txt → drugflow-molstar-component-build-0.4.1.js.LICENSE.txt} +0 -0
@@ -1,42 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SuperpositionComponentControls = void 0;
4
- var tslib_1 = require("tslib");
5
- var jsx_runtime_1 = require("react/jsx-runtime");
6
- var commands_1 = require("Molstar/mol-plugin/commands");
7
- var mol_state_1 = require("Molstar/mol-state");
8
- var param_definition_1 = require("Molstar/mol-util/param-definition");
9
- var base_1 = require("Molstar/mol-plugin-ui/base");
10
- var common_1 = require("Molstar/mol-plugin-ui/controls/common");
11
- var icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
12
- var parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
13
- var operators_1 = require("rxjs/operators");
14
- var rxjs_1 = require("rxjs");
15
- var SuperpositionComponentControls = /** @class */ (function (_super) {
16
- tslib_1.__extends(SuperpositionComponentControls, _super);
17
- function SuperpositionComponentControls() {
18
- return _super !== null && _super.apply(this, arguments) || this;
19
- }
20
- SuperpositionComponentControls.prototype.defaultState = function () {
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const commands_1 = require("Molstar/mol-plugin/commands");
6
+ const mol_state_1 = require("Molstar/mol-state");
7
+ const param_definition_1 = require("Molstar/mol-util/param-definition");
8
+ const base_1 = require("Molstar/mol-plugin-ui/base");
9
+ const common_1 = require("Molstar/mol-plugin-ui/controls/common");
10
+ const icons_1 = require("Molstar/mol-plugin-ui/controls/icons");
11
+ const parameters_1 = require("Molstar/mol-plugin-ui/controls/parameters");
12
+ const operators_1 = require("rxjs/operators");
13
+ const rxjs_1 = require("rxjs");
14
+ class SuperpositionComponentControls extends base_1.CollapsableControls {
15
+ defaultState() {
21
16
  return {
22
17
  header: 'Components',
23
18
  isCollapsed: false,
24
19
  isDisabled: false,
25
20
  brand: { accent: 'blue', svg: icons_1.CubeOutlineSvg }
26
21
  };
27
- };
28
- SuperpositionComponentControls.prototype.renderControls = function () {
22
+ }
23
+ renderControls() {
29
24
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ComponentListControls, {}) });
30
- };
31
- return SuperpositionComponentControls;
32
- }(base_1.CollapsableControls));
25
+ }
26
+ }
33
27
  exports.SuperpositionComponentControls = SuperpositionComponentControls;
34
28
  ;
35
- var ComponentListControls = /** @class */ (function (_super) {
36
- tslib_1.__extends(ComponentListControls, _super);
37
- function ComponentListControls() {
38
- var _this = _super !== null && _super.apply(this, arguments) || this;
39
- _this.state = {
29
+ class ComponentListControls extends base_1.PurePluginUIComponent {
30
+ constructor() {
31
+ super(...arguments);
32
+ this.state = {
40
33
  segmentWatch: false,
41
34
  ligSearchText: '',
42
35
  carbSearchText: '',
@@ -47,144 +40,108 @@ var ComponentListControls = /** @class */ (function (_super) {
47
40
  isCarbCollapsed: false,
48
41
  isBusy: false
49
42
  };
50
- _this.ligInputStream = new rxjs_1.Subject();
51
- _this.handleLigInputStream = function (inputStr) {
52
- _this.setState({ ligSearchText: inputStr });
53
- var filteredRes = _this.state.componentGroups.ligGroups.filter(function (g) {
54
- var gKeys = g[0].key.split(',');
55
- var cId1Arr = gKeys[0].split('-');
43
+ this.ligInputStream = new rxjs_1.Subject();
44
+ this.handleLigInputStream = (inputStr) => {
45
+ this.setState({ ligSearchText: inputStr });
46
+ const filteredRes = this.state.componentGroups.ligGroups.filter((g) => {
47
+ const gKeys = g[0].key.split(',');
48
+ const cId1Arr = gKeys[0].split('-');
56
49
  return cId1Arr[2].toLowerCase().indexOf(inputStr.toLowerCase()) >= 0;
57
50
  });
58
- _this.setState({ ligGroups: filteredRes });
51
+ this.setState({ ligGroups: filteredRes });
59
52
  };
60
- _this.carbInputStream = new rxjs_1.Subject();
61
- _this.handleCarbInputStream = function (inputStr) {
62
- _this.setState({ carbSearchText: inputStr });
63
- var filteredRes = _this.state.componentGroups.carbGroups.filter(function (g) {
64
- var gKeys = g[0].key.split(',');
65
- var cId1Arr = gKeys[0].split('-');
53
+ this.carbInputStream = new rxjs_1.Subject();
54
+ this.handleCarbInputStream = (inputStr) => {
55
+ this.setState({ carbSearchText: inputStr });
56
+ const filteredRes = this.state.componentGroups.carbGroups.filter((g) => {
57
+ const gKeys = g[0].key.split(',');
58
+ const cId1Arr = gKeys[0].split('-');
66
59
  cId1Arr.splice(0, 2);
67
60
  cId1Arr.pop();
68
61
  return cId1Arr.join('-').toLowerCase().indexOf(inputStr.toLowerCase()) >= 0;
69
62
  });
70
- _this.setState({ carbGroups: filteredRes });
63
+ this.setState({ carbGroups: filteredRes });
71
64
  };
72
- _this.toggleVisible = function (e, action, type) {
65
+ this.toggleVisible = (e, action, type) => {
73
66
  e.preventDefault();
74
67
  e.currentTarget.blur();
75
- var customState = _this.plugin.customState;
68
+ const customState = this.plugin.customState;
76
69
  customState.events.isBusy.next(true);
77
- var visualEntites = (type === 'ligands') ? _this.state.ligGroups : _this.state.carbGroups;
78
- setTimeout(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
79
- var visualEntites_1, visualEntites_1_1, visualEntity, e_1_1;
80
- var e_1, _a;
81
- return tslib_1.__generator(this, function (_b) {
82
- switch (_b.label) {
83
- case 0:
84
- _b.trys.push([0, 5, 6, 11]);
85
- visualEntites_1 = tslib_1.__asyncValues(visualEntites);
86
- _b.label = 1;
87
- case 1: return [4 /*yield*/, visualEntites_1.next()];
88
- case 2:
89
- if (!(visualEntites_1_1 = _b.sent(), !visualEntites_1_1.done)) return [3 /*break*/, 4];
90
- visualEntity = visualEntites_1_1.value;
91
- this.plugin.managers.structure.hierarchy.toggleVisibility(visualEntity, action);
92
- _b.label = 3;
93
- case 3: return [3 /*break*/, 1];
94
- case 4: return [3 /*break*/, 11];
95
- case 5:
96
- e_1_1 = _b.sent();
97
- e_1 = { error: e_1_1 };
98
- return [3 /*break*/, 11];
99
- case 6:
100
- _b.trys.push([6, , 9, 10]);
101
- if (!(visualEntites_1_1 && !visualEntites_1_1.done && (_a = visualEntites_1.return))) return [3 /*break*/, 8];
102
- return [4 /*yield*/, _a.call(visualEntites_1)];
103
- case 7:
104
- _b.sent();
105
- _b.label = 8;
106
- case 8: return [3 /*break*/, 10];
107
- case 9:
108
- if (e_1) throw e_1.error;
109
- return [7 /*endfinally*/];
110
- case 10: return [7 /*endfinally*/];
111
- case 11:
112
- ;
113
- customState.events.isBusy.next(false);
114
- return [2 /*return*/];
115
- }
116
- });
117
- }); });
70
+ const visualEntites = (type === 'ligands') ? this.state.ligGroups : this.state.carbGroups;
71
+ setTimeout(async () => {
72
+ for await (const visualEntity of visualEntites) {
73
+ this.plugin.managers.structure.hierarchy.toggleVisibility(visualEntity, action);
74
+ }
75
+ ;
76
+ customState.events.isBusy.next(false);
77
+ });
118
78
  };
119
- _this.showHideAllControls = function (type) {
120
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ icon: icons_1.CheckSvg, flex: true, onClick: function (e) { return _this.toggleVisible(e, 'show', type); }, style: { flex: '0 0 50px', textAlign: 'center', fontSize: '80%', color: '#9cacc3', padding: 0 }, title: "Show all ".concat(type), disabled: false }, { children: "All" })), (0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ icon: icons_1.CloseSvg, flex: true, onClick: function (e) { return _this.toggleVisible(e, 'hide', type); }, style: { flex: '0 0 50px', textAlign: 'center', fontSize: '80%', color: '#9cacc3', padding: 0 }, title: "Hide all ".concat(type), disabled: false }, { children: "None" }))] });
79
+ this.showHideAllControls = (type) => {
80
+ return (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: (e) => this.toggleVisible(e, 'show', type), style: { flex: '0 0 50px', textAlign: 'center', fontSize: '80%', color: '#9cacc3', padding: 0 }, title: `Show all ${type}`, disabled: false, children: "All" }), (0, jsx_runtime_1.jsx)(common_1.Button, { icon: icons_1.CloseSvg, flex: true, onClick: (e) => this.toggleVisible(e, 'hide', type), style: { flex: '0 0 50px', textAlign: 'center', fontSize: '80%', color: '#9cacc3', padding: 0 }, title: `Hide all ${type}`, disabled: false, children: "None" })] });
121
81
  };
122
- _this.clearLigSearch = function (e) {
82
+ this.clearLigSearch = (e) => {
123
83
  e.preventDefault();
124
- _this.setState({ ligSearchText: '' });
125
- _this.ligInputStream.next('');
84
+ this.setState({ ligSearchText: '' });
85
+ this.ligInputStream.next('');
126
86
  e.currentTarget.blur();
127
87
  };
128
- _this.clearCarbSearch = function (e) {
88
+ this.clearCarbSearch = (e) => {
129
89
  e.preventDefault();
130
- _this.setState({ carbSearchText: '' });
131
- _this.carbInputStream.next('');
90
+ this.setState({ carbSearchText: '' });
91
+ this.carbInputStream.next('');
132
92
  e.currentTarget.blur();
133
93
  };
134
- _this.collapseSection = function (e, type) {
94
+ this.collapseSection = (e, type) => {
135
95
  e.preventDefault();
136
96
  e.currentTarget.blur();
137
97
  if (type === 'ligands') {
138
- _this.setState({ isLigCollapsed: !_this.state.isLigCollapsed });
98
+ this.setState({ isLigCollapsed: !this.state.isLigCollapsed });
139
99
  }
140
100
  else {
141
- _this.setState({ isCarbCollapsed: !_this.state.isCarbCollapsed });
101
+ this.setState({ isCarbCollapsed: !this.state.isCarbCollapsed });
142
102
  }
143
103
  };
144
- _this.sectionHeader = function (type) {
145
- var showHideAllControls = (type === 'ligands') ? _this.showHideAllControls('ligands') : _this.showHideAllControls('carbohydrates');
146
- var title = (type === 'ligands') ? 'Ligand' : 'Carbohydrates';
147
- var visibleVisuals = (type === 'ligands') ? _this.state.ligGroups.length : _this.state.carbGroups.length;
148
- var totalVisuals = (type === 'ligands') ? _this.state.componentGroups.ligGroups.length : _this.state.componentGroups.carbGroups.length;
149
- return (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-flex-row', style: { marginTop: '6px' } }, { children: [(0, jsx_runtime_1.jsxs)("button", tslib_1.__assign({ className: 'msp-form-control msp-control-button-label msp-transform-header-brand-gray', style: { textAlign: 'left' }, onClick: function (e) { return _this.collapseSection(e, type); } }, { children: [(0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)("strong", { children: title }) }), (0, jsx_runtime_1.jsxs)("small", tslib_1.__assign({ style: { color: '#7d91b0' } }, { children: [" ( ", visibleVisuals, visibleVisuals < totalVisuals ? " / ".concat(totalVisuals) : '', " )"] }))] })), visibleVisuals > 1 && showHideAllControls] }));
104
+ this.sectionHeader = (type) => {
105
+ const showHideAllControls = (type === 'ligands') ? this.showHideAllControls('ligands') : this.showHideAllControls('carbohydrates');
106
+ const title = (type === 'ligands') ? 'Ligand' : 'Carbohydrates';
107
+ const visibleVisuals = (type === 'ligands') ? this.state.ligGroups.length : this.state.carbGroups.length;
108
+ const totalVisuals = (type === 'ligands') ? this.state.componentGroups.ligGroups.length : this.state.componentGroups.carbGroups.length;
109
+ return (0, jsx_runtime_1.jsxs)("div", { className: 'msp-flex-row', style: { marginTop: '6px' }, children: [(0, jsx_runtime_1.jsxs)("button", { className: 'msp-form-control msp-control-button-label msp-transform-header-brand-gray', style: { textAlign: 'left' }, onClick: (e) => this.collapseSection(e, type), children: [(0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)("strong", { children: title }) }), (0, jsx_runtime_1.jsxs)("small", { style: { color: '#7d91b0' }, children: [" ( ", visibleVisuals, visibleVisuals < totalVisuals ? ` / ${totalVisuals}` : '', " )"] })] }), visibleVisuals > 1 && showHideAllControls] });
150
110
  };
151
- return _this;
152
111
  }
153
- ComponentListControls.prototype.componentDidMount = function () {
154
- var _this = this;
155
- this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, function () {
156
- _this.categoriseGroups();
157
- _this.forceUpdate();
112
+ componentDidMount() {
113
+ this.subscribe(this.plugin.managers.structure.hierarchy.behaviors.selection, () => {
114
+ this.categoriseGroups();
115
+ this.forceUpdate();
158
116
  });
159
- this.subscribe(this.plugin.behaviors.state.isBusy, function (v) {
160
- _this.setState({ isBusy: v });
117
+ this.subscribe(this.plugin.behaviors.state.isBusy, v => {
118
+ this.setState({ isBusy: v });
161
119
  });
162
- };
163
- ComponentListControls.prototype.componentDidUpdate = function () {
164
- var _this = this;
165
- var customState = this.plugin.customState;
120
+ }
121
+ componentDidUpdate() {
122
+ const customState = this.plugin.customState;
166
123
  if (customState.events && !this.state.segmentWatch) {
167
124
  this.setState({ segmentWatch: true });
168
- this.subscribe(customState.events.segmentUpdate, function () {
169
- _this.categoriseGroups();
170
- _this.forceUpdate();
125
+ this.subscribe(customState.events.segmentUpdate, () => {
126
+ this.categoriseGroups();
127
+ this.forceUpdate();
171
128
  });
172
129
  }
173
- this.subscribe(this.ligInputStream.pipe((0, operators_1.debounceTime)(1000 / 24)), function (e) { return _this.handleLigInputStream(e); });
174
- this.subscribe(this.carbInputStream.pipe((0, operators_1.debounceTime)(1000 / 24)), function (e) { return _this.handleCarbInputStream(e); });
175
- };
176
- ComponentListControls.prototype.categoriseGroups = function () {
177
- var componentGroupsVal = { nonLigGroups: [], ligGroups: [], carbGroups: [], alphafold: [] };
178
- var componentGroups = this.plugin.managers.structure.hierarchy.currentComponentGroups;
179
- var customState = this.plugin.customState;
180
- componentGroups.forEach(function (g) {
181
- var isLigandView = false;
130
+ this.subscribe(this.ligInputStream.pipe((0, operators_1.debounceTime)(1000 / 24)), (e) => this.handleLigInputStream(e));
131
+ this.subscribe(this.carbInputStream.pipe((0, operators_1.debounceTime)(1000 / 24)), (e) => this.handleCarbInputStream(e));
132
+ }
133
+ categoriseGroups() {
134
+ let componentGroupsVal = { nonLigGroups: [], ligGroups: [], carbGroups: [], alphafold: [] };
135
+ const componentGroups = this.plugin.managers.structure.hierarchy.currentComponentGroups;
136
+ const customState = this.plugin.customState;
137
+ componentGroups.forEach((g) => {
138
+ let isLigandView = false;
182
139
  if (customState.initParams && customState.initParams.superpositionParams && customState.initParams.superpositionParams.ligandView) {
183
140
  isLigandView = true;
184
141
  }
185
142
  if (isLigandView) {
186
- var gKeys = g[0].key.split(',');
187
- var cId1Arr = gKeys[0].split('-');
143
+ const gKeys = g[0].key.split(',');
144
+ const cId1Arr = gKeys[0].split('-');
188
145
  if (gKeys.indexOf('superposition-focus-surr-sel') === -1) {
189
146
  if (cId1Arr[cId1Arr.length - 1] !== (customState.superpositionState.activeSegment - 1) + '')
190
147
  return;
@@ -206,8 +163,8 @@ var ComponentListControls = /** @class */ (function (_super) {
206
163
  }
207
164
  }
208
165
  else {
209
- var gKeys = g[0].key.split(',');
210
- if (gKeys.indexOf('superposition-focus-surr-sel') >= 0 || gKeys.indexOf("Chain-".concat(customState.superpositionState.activeSegment - 1)) >= 0) {
166
+ const gKeys = g[0].key.split(',');
167
+ if (gKeys.indexOf('superposition-focus-surr-sel') >= 0 || gKeys.indexOf(`Chain-${customState.superpositionState.activeSegment - 1}`) >= 0) {
211
168
  componentGroupsVal.nonLigGroups.push(g);
212
169
  }
213
170
  else if (gKeys.indexOf('alphafold-chain') >= 0) {
@@ -216,220 +173,193 @@ var ComponentListControls = /** @class */ (function (_super) {
216
173
  }
217
174
  });
218
175
  this.setState({ componentGroups: componentGroupsVal, ligGroups: componentGroupsVal.ligGroups, carbGroups: componentGroupsVal.carbGroups, ligSearchText: '', carbSearchText: '' });
219
- };
220
- ComponentListControls.prototype.render = function () {
221
- var _this = this;
222
- var ligSearchControls = (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-mapped-parameter-group', style: { fontSize: '90%' } }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-control-row msp-transform-header-brand-gray', style: { height: '33px' } }, { children: [(0, jsx_runtime_1.jsx)("span", tslib_1.__assign({ className: 'msp-control-row-label' }, { children: "Search Ligand" })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-control-row-ctrl' }, { children: (0, jsx_runtime_1.jsx)("input", { type: 'text', placeholder: 'Enter HET code', disabled: this.state.isBusy, onChange: function (e) { return _this.ligInputStream.next(e.target.value); }, value: this.state.ligSearchText, maxLength: 3 }) }))] })), (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.CloseSvg, flex: true, onClick: this.clearLigSearch, style: { flex: '0 0 24px', padding: 0 }, disabled: this.state.ligSearchText === '' || this.state.isBusy, toggleState: this.state.ligSearchText !== '', title: 'Clear search input' })] }));
223
- var carbSearchControls = (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-mapped-parameter-group', style: { fontSize: '90%' } }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-control-row msp-transform-header-brand-gray', style: { height: '33px' } }, { children: [(0, jsx_runtime_1.jsx)("span", tslib_1.__assign({ className: 'msp-control-row-label' }, { children: "Search Carbohydrate" })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-control-row-ctrl' }, { children: (0, jsx_runtime_1.jsx)("input", { type: 'text', placeholder: 'Enter HET code', disabled: this.state.isBusy, onChange: function (e) { return _this.carbInputStream.next(e.target.value); }, value: this.state.carbSearchText, maxLength: 3 }) }))] })), (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.CloseSvg, flex: true, onClick: this.clearCarbSearch, style: { flex: '0 0 24px', padding: 0 }, disabled: this.state.carbSearchText === '' || this.state.isBusy, toggleState: this.state.carbSearchText !== '', title: 'Clear search input' })] }));
224
- var ligSectionHeader = this.sectionHeader('ligands');
225
- var carbSectionHeader = this.sectionHeader('carbohydrates');
226
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(this.state.componentGroups.nonLigGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", { children: this.state.componentGroups.nonLigGroups.map(function (g) { return (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: true }, g[0].cell.transform.ref); }) }), (this.state.componentGroups.alphafold.length > 0) && (0, jsx_runtime_1.jsx)("div", { children: this.state.componentGroups.alphafold.map(function (g) { return (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: true, type: 'alphafold' }, g[0].cell.transform.ref); }) }), (this.state.componentGroups.ligGroups.length > 0) && ligSectionHeader, (!this.state.isLigCollapsed && this.state.componentGroups.ligGroups.length > 5) && ligSearchControls, (this.state.componentGroups.ligGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-control-offset', style: { maxHeight: '800px', overflowY: 'auto' } }, { children: !this.state.isLigCollapsed && this.state.ligGroups.map(function (g) { return (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: false }, g[0].cell.transform.ref); }) })), (this.state.componentGroups.carbGroups.length > 0) && carbSectionHeader, (!this.state.isCarbCollapsed && this.state.componentGroups.carbGroups.length > 5) && carbSearchControls, (this.state.componentGroups.carbGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-control-offset', style: { maxHeight: '800px', overflowY: 'auto' } }, { children: !this.state.isCarbCollapsed && this.state.carbGroups.map(function (g) { return (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: false }, g[0].cell.transform.ref); }) }))] });
227
- };
228
- return ComponentListControls;
229
- }(base_1.PurePluginUIComponent));
230
- var StructureComponentGroup = /** @class */ (function (_super) {
231
- tslib_1.__extends(StructureComponentGroup, _super);
232
- function StructureComponentGroup() {
233
- var _this = _super !== null && _super.apply(this, arguments) || this;
234
- _this.state = {
176
+ }
177
+ render() {
178
+ const ligSearchControls = (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' }, children: [(0, jsx_runtime_1.jsx)("span", { className: 'msp-control-row-label', children: "Search Ligand" }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-row-ctrl', children: (0, jsx_runtime_1.jsx)("input", { type: 'text', placeholder: 'Enter HET code', disabled: this.state.isBusy, onChange: e => this.ligInputStream.next(e.target.value), value: this.state.ligSearchText, maxLength: 3 }) })] }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.CloseSvg, flex: true, onClick: this.clearLigSearch, style: { flex: '0 0 24px', padding: 0 }, disabled: this.state.ligSearchText === '' || this.state.isBusy, toggleState: this.state.ligSearchText !== '', title: 'Clear search input' })] });
179
+ const carbSearchControls = (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' }, children: [(0, jsx_runtime_1.jsx)("span", { className: 'msp-control-row-label', children: "Search Carbohydrate" }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-row-ctrl', children: (0, jsx_runtime_1.jsx)("input", { type: 'text', placeholder: 'Enter HET code', disabled: this.state.isBusy, onChange: e => this.carbInputStream.next(e.target.value), value: this.state.carbSearchText, maxLength: 3 }) })] }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { svg: icons_1.CloseSvg, flex: true, onClick: this.clearCarbSearch, style: { flex: '0 0 24px', padding: 0 }, disabled: this.state.carbSearchText === '' || this.state.isBusy, toggleState: this.state.carbSearchText !== '', title: 'Clear search input' })] });
180
+ const ligSectionHeader = this.sectionHeader('ligands');
181
+ const carbSectionHeader = this.sectionHeader('carbohydrates');
182
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(this.state.componentGroups.nonLigGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", { children: this.state.componentGroups.nonLigGroups.map((g) => (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: true }, g[0].cell.transform.ref)) }), (this.state.componentGroups.alphafold.length > 0) && (0, jsx_runtime_1.jsx)("div", { children: this.state.componentGroups.alphafold.map((g) => (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: true, type: 'alphafold' }, g[0].cell.transform.ref)) }), (this.state.componentGroups.ligGroups.length > 0) && ligSectionHeader, (!this.state.isLigCollapsed && this.state.componentGroups.ligGroups.length > 5) && ligSearchControls, (this.state.componentGroups.ligGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-offset', style: { maxHeight: '800px', overflowY: 'auto' }, children: !this.state.isLigCollapsed && this.state.ligGroups.map((g) => (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: false }, g[0].cell.transform.ref)) }), (this.state.componentGroups.carbGroups.length > 0) && carbSectionHeader, (!this.state.isCarbCollapsed && this.state.componentGroups.carbGroups.length > 5) && carbSearchControls, (this.state.componentGroups.carbGroups.length > 0) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-control-offset', style: { maxHeight: '800px', overflowY: 'auto' }, children: !this.state.isCarbCollapsed && this.state.carbGroups.map((g) => (0, jsx_runtime_1.jsx)(StructureComponentGroup, { group: g, boldHeader: false }, g[0].cell.transform.ref)) })] });
183
+ }
184
+ }
185
+ class StructureComponentGroup extends base_1.PurePluginUIComponent {
186
+ constructor() {
187
+ super(...arguments);
188
+ this.state = {
235
189
  action: void 0,
236
190
  isHidden: false,
237
191
  isBusy: false
238
192
  };
239
- _this.checkAllHidden = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
240
- var allHidden, _i, _a, c;
241
- return tslib_1.__generator(this, function (_b) {
242
- allHidden = true;
243
- for (_i = 0, _a = this.props.group; _i < _a.length; _i++) {
244
- c = _a[_i];
245
- if (!c.cell.state.isHidden) {
246
- allHidden = false;
247
- break;
248
- }
193
+ this.checkAllHidden = async () => {
194
+ let allHidden = true;
195
+ for (const c of this.props.group) {
196
+ if (!c.cell.state.isHidden) {
197
+ allHidden = false;
198
+ break;
249
199
  }
250
- if (allHidden)
251
- this.setState({ isHidden: true });
252
- return [2 /*return*/];
253
- });
254
- }); };
255
- _this.toggleVisible = function (e) {
200
+ }
201
+ if (allHidden)
202
+ this.setState({ isHidden: true });
203
+ };
204
+ this.toggleVisible = (e) => {
256
205
  e.preventDefault();
257
206
  e.currentTarget.blur();
258
- _this.plugin.managers.structure.component.toggleVisibility(_this.props.group);
259
- _this.setState({ isHidden: !_this.state.isHidden });
260
- if (_this.props.type === 'alphafold') {
261
- var spState = _this.plugin.customState.superpositionState;
262
- spState.alphafold.visibility[spState.activeSegment - 1] = _this.state.isHidden;
207
+ this.plugin.managers.structure.component.toggleVisibility(this.props.group);
208
+ this.setState({ isHidden: !this.state.isHidden });
209
+ if (this.props.type === 'alphafold') {
210
+ const spState = this.plugin.customState.superpositionState;
211
+ spState.alphafold.visibility[spState.activeSegment - 1] = this.state.isHidden;
263
212
  }
264
213
  };
265
- _this.toggleAction = function () { return _this.setState({ action: _this.state.action === 'action' ? void 0 : 'action' }); };
266
- _this.highlight = function (e) {
214
+ this.toggleAction = () => this.setState({ action: this.state.action === 'action' ? void 0 : 'action' });
215
+ this.highlight = (e) => {
267
216
  e.preventDefault();
268
- if (!_this.props.group[0].cell.parent)
217
+ if (!this.props.group[0].cell.parent)
269
218
  return;
270
- commands_1.PluginCommands.Interactivity.Object.Highlight(_this.plugin, { state: _this.props.group[0].cell.parent, ref: _this.props.group.map(function (c) { return c.cell.transform.ref; }) });
219
+ commands_1.PluginCommands.Interactivity.Object.Highlight(this.plugin, { state: this.props.group[0].cell.parent, ref: this.props.group.map(c => c.cell.transform.ref) });
271
220
  };
272
- _this.clearHighlight = function (e) {
221
+ this.clearHighlight = (e) => {
273
222
  e.preventDefault();
274
- commands_1.PluginCommands.Interactivity.ClearHighlights(_this.plugin);
223
+ commands_1.PluginCommands.Interactivity.ClearHighlights(this.plugin);
275
224
  };
276
- _this.focus = function () {
277
- var allHidden = true;
278
- for (var _i = 0, _a = _this.props.group; _i < _a.length; _i++) {
279
- var c = _a[_i];
225
+ this.focus = () => {
226
+ let allHidden = true;
227
+ for (const c of this.props.group) {
280
228
  if (!c.cell.state.isHidden) {
281
229
  allHidden = false;
282
230
  break;
283
231
  }
284
232
  }
285
233
  if (allHidden) {
286
- _this.plugin.managers.structure.hierarchy.toggleVisibility(_this.props.group, 'show');
234
+ this.plugin.managers.structure.hierarchy.toggleVisibility(this.props.group, 'show');
287
235
  }
288
- _this.plugin.managers.camera.focusSpheres(_this.props.group, function (e) {
289
- var _a;
236
+ this.plugin.managers.camera.focusSpheres(this.props.group, e => {
290
237
  if (e.cell.state.isHidden)
291
238
  return;
292
- return (_a = e.cell.obj) === null || _a === void 0 ? void 0 : _a.data.boundary.sphere;
239
+ return e.cell.obj?.data.boundary.sphere;
293
240
  });
294
241
  };
295
- return _this;
296
242
  }
297
- Object.defineProperty(StructureComponentGroup.prototype, "pivot", {
298
- get: function () {
299
- return this.props.group[0];
300
- },
301
- enumerable: false,
302
- configurable: true
303
- });
304
- StructureComponentGroup.prototype.componentDidMount = function () {
305
- var _this = this;
243
+ get pivot() {
244
+ return this.props.group[0];
245
+ }
246
+ componentDidMount() {
306
247
  this.checkAllHidden();
307
- this.subscribe(this.plugin.state.events.cell.stateUpdated, function (e) {
308
- var _a, _b;
248
+ this.subscribe(this.plugin.state.events.cell.stateUpdated, e => {
309
249
  // if (State.ObjectEvent.isCell(e, this.pivot.cell)) this.forceUpdate();
310
- if (((_a = _this.pivot.cell.obj) === null || _a === void 0 ? void 0 : _a.label) === ((_b = e.cell.obj) === null || _b === void 0 ? void 0 : _b.label)) {
250
+ if (this.pivot.cell.obj?.label === e.cell.obj?.label) {
311
251
  if (!e.cell.state.isHidden) {
312
- _this.setState({ isHidden: false });
252
+ this.setState({ isHidden: false });
313
253
  }
314
254
  else {
315
- _this.checkAllHidden();
255
+ this.checkAllHidden();
316
256
  }
317
257
  }
318
258
  });
319
- this.subscribe(this.plugin.behaviors.state.isBusy, function (v) {
320
- _this.setState({ isBusy: v });
259
+ this.subscribe(this.plugin.behaviors.state.isBusy, v => {
260
+ this.setState({ isBusy: v });
321
261
  });
322
- this.subscribe(this.plugin.customState.events.isBusy, function (e) {
323
- _this.setState({ isBusy: e });
262
+ this.subscribe(this.plugin.customState.events.isBusy, (e) => {
263
+ this.setState({ isBusy: e });
324
264
  });
325
- };
326
- StructureComponentGroup.prototype.render = function () {
327
- var _this = this;
328
- var _a;
329
- var component = this.pivot;
330
- var cell = component.cell;
331
- var label = (_a = cell.obj) === null || _a === void 0 ? void 0 : _a.label;
332
- var labelEle = this.props.boldHeader ? (0, jsx_runtime_1.jsx)("strong", { children: label }) : label;
333
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: 'msp-flex-row' }, { children: [(0, jsx_runtime_1.jsx)(common_1.Button, tslib_1.__assign({ noOverflow: true, className: 'msp-control-button-label', title: "".concat(label, " - Click to focus."), onClick: this.focus, style: { textAlign: 'left' }, disabled: this.state.isBusy }, { children: labelEle })), (0, jsx_runtime_1.jsx)(common_1.IconButton, { disabled: this.state.isBusy, svg: this.state.isHidden ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, toggleState: false, onClick: this.toggleVisible, title: "".concat(this.state.isHidden ? 'Show' : 'Hide', " component"), small: true, className: 'msp-form-control', flex: true }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { disabled: this.state.isBusy, svg: icons_1.MoreHorizSvg, onClick: this.toggleAction, title: 'Actions', toggleState: this.state.action === 'action', className: 'msp-form-control', flex: true })] })), this.state.action === 'action' && (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-accent-offset' }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ style: { marginBottom: '6px' } }, { children: component.representations.map(function (r) { return (0, jsx_runtime_1.jsx)(StructureRepresentationEntry, { group: _this.props.group, representation: r }, r.cell.transform.ref); }) })) }))] });
334
- };
335
- return StructureComponentGroup;
336
- }(base_1.PurePluginUIComponent));
337
- var StructureRepresentationEntry = /** @class */ (function (_super) {
338
- tslib_1.__extends(StructureRepresentationEntry, _super);
339
- function StructureRepresentationEntry() {
340
- var _this = _super !== null && _super.apply(this, arguments) || this;
341
- _this.state = {
265
+ }
266
+ render() {
267
+ const component = this.pivot;
268
+ const cell = component.cell;
269
+ const label = cell.obj?.label;
270
+ const labelEle = this.props.boldHeader ? (0, jsx_runtime_1.jsx)("strong", { children: label }) : label;
271
+ return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(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: `${label} - Click to focus.`, onClick: this.focus, style: { textAlign: 'left' }, disabled: this.state.isBusy, children: labelEle }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { disabled: this.state.isBusy, svg: this.state.isHidden ? icons_1.VisibilityOffOutlinedSvg : icons_1.VisibilityOutlinedSvg, toggleState: false, onClick: this.toggleVisible, title: `${this.state.isHidden ? 'Show' : 'Hide'} component`, small: true, className: 'msp-form-control', flex: true }), (0, jsx_runtime_1.jsx)(common_1.IconButton, { disabled: this.state.isBusy, svg: icons_1.MoreHorizSvg, onClick: this.toggleAction, title: 'Actions', toggleState: this.state.action === 'action', className: 'msp-form-control', flex: true })] }), this.state.action === 'action' && (0, jsx_runtime_1.jsx)("div", { className: 'msp-accent-offset', children: (0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '6px' }, children: component.representations.map(r => (0, jsx_runtime_1.jsx)(StructureRepresentationEntry, { group: this.props.group, representation: r }, r.cell.transform.ref)) }) })] });
272
+ }
273
+ }
274
+ class StructureRepresentationEntry extends base_1.PurePluginUIComponent {
275
+ constructor() {
276
+ super(...arguments);
277
+ this.state = {
342
278
  isBusy: false,
343
279
  clusterVal: { cluster: 'All' }
344
280
  };
345
- _this.remove = function () { return _this.plugin.managers.structure.component.removeRepresentations(_this.props.group, _this.props.representation); };
346
- _this.toggleVisible = function (e) {
281
+ this.remove = () => this.plugin.managers.structure.component.removeRepresentations(this.props.group, this.props.representation);
282
+ this.toggleVisible = (e) => {
347
283
  e.preventDefault();
348
284
  e.currentTarget.blur();
349
- _this.plugin.managers.structure.component.toggleVisibility(_this.props.group, _this.props.representation);
285
+ this.plugin.managers.structure.component.toggleVisibility(this.props.group, this.props.representation);
350
286
  };
351
- _this.update = function (params) {
352
- return _this.updateRepresentations(_this.props.group, _this.props.representation, params);
287
+ this.update = (params) => {
288
+ return this.updateRepresentations(this.props.group, this.props.representation, params);
353
289
  };
354
- _this.selectCluster = function (params) {
355
- _this.setState({ clusterVal: { cluster: params.cluster } });
290
+ this.selectCluster = (params) => {
291
+ this.setState({ clusterVal: { cluster: params.cluster } });
356
292
  };
357
- return _this;
358
293
  }
359
- StructureRepresentationEntry.prototype.componentDidMount = function () {
360
- var _this = this;
361
- this.subscribe(this.plugin.state.events.cell.stateUpdated, function (e) {
362
- if (mol_state_1.State.ObjectEvent.isCell(e, _this.props.representation.cell))
363
- _this.forceUpdate();
294
+ componentDidMount() {
295
+ this.subscribe(this.plugin.state.events.cell.stateUpdated, e => {
296
+ if (mol_state_1.State.ObjectEvent.isCell(e, this.props.representation.cell))
297
+ this.forceUpdate();
364
298
  });
365
- this.subscribe(this.plugin.behaviors.state.isBusy, function (v) {
366
- _this.setState({ isBusy: v });
299
+ this.subscribe(this.plugin.behaviors.state.isBusy, v => {
300
+ this.setState({ isBusy: v });
367
301
  });
368
- this.subscribe(this.plugin.customState.events.isBusy, function (e) {
369
- _this.setState({ isBusy: e });
302
+ this.subscribe(this.plugin.customState.events.isBusy, (e) => {
303
+ this.setState({ isBusy: e });
370
304
  });
371
- };
372
- StructureRepresentationEntry.prototype.updateRepresentations = function (components, pivot, params) {
373
- var _a, _b, _c;
305
+ }
306
+ updateRepresentations(components, pivot, params) {
374
307
  if (components.length === 0)
375
308
  return Promise.resolve();
376
- var index = components[0].representations.indexOf(pivot);
309
+ const index = components[0].representations.indexOf(pivot);
377
310
  if (index < 0)
378
311
  return Promise.resolve();
379
- var superpositionState = this.plugin.customState.superpositionState;
380
- var filteredComps = [];
312
+ const superpositionState = this.plugin.customState.superpositionState;
313
+ let filteredComps = [];
381
314
  if (this.state.clusterVal.cluster !== 'All') {
382
- var clusterData = superpositionState.segmentData[superpositionState.activeSegment - 1].clusters[parseInt(this.state.clusterVal.cluster) - 1];
383
- filteredComps = clusterData.map(function (s) {
384
- return "".concat(s.pdb_id, "_").concat(s.struct_asym_id);
315
+ const clusterData = superpositionState.segmentData[superpositionState.activeSegment - 1].clusters[parseInt(this.state.clusterVal.cluster) - 1];
316
+ filteredComps = clusterData.map((s) => {
317
+ return `${s.pdb_id}_${s.struct_asym_id}`;
385
318
  });
386
319
  if (filteredComps.length === 0)
387
320
  return;
388
321
  }
389
- var update = this.plugin.state.data.build();
390
- for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {
391
- var c = components_1[_i];
322
+ const update = this.plugin.state.data.build();
323
+ for (const c of components) {
392
324
  // TODO: is it ok to use just the index here? Could possible lead to ugly edge cases, but perhaps not worth the trouble to "fix".
393
- var repr = c.representations[index];
325
+ const repr = c.representations[index];
394
326
  if (!repr)
395
327
  continue;
396
328
  if (repr.cell.transform.transformer !== pivot.cell.transform.transformer)
397
329
  continue;
398
330
  if (this.state.clusterVal.cluster !== 'All') {
399
- var rmIndex = filteredComps.indexOf(superpositionState.refMaps[repr.cell.transform.parent]);
331
+ const rmIndex = filteredComps.indexOf(superpositionState.refMaps[repr.cell.transform.parent]);
400
332
  if (rmIndex === -1)
401
333
  continue;
402
334
  }
403
- var updatedParams = {
404
- type: params.type ? params.type : (_a = repr.cell.params) === null || _a === void 0 ? void 0 : _a.values.type,
405
- colorTheme: params.colorTheme ? params.colorTheme : (_b = repr.cell.params) === null || _b === void 0 ? void 0 : _b.values.colorTheme,
406
- sizeTheme: params.sizeTheme ? params.sizeTheme : (_c = repr.cell.params) === null || _c === void 0 ? void 0 : _c.values.sizeTheme
335
+ const updatedParams = {
336
+ type: params.type ? params.type : repr.cell.params?.values.type,
337
+ colorTheme: params.colorTheme ? params.colorTheme : repr.cell.params?.values.colorTheme,
338
+ sizeTheme: params.sizeTheme ? params.sizeTheme : repr.cell.params?.values.sizeTheme
407
339
  };
408
340
  update.to(repr.cell).update(updatedParams);
409
341
  }
410
342
  return update.commit({ canUndo: 'Update Representation' });
411
- };
412
- StructureRepresentationEntry.prototype.render = function () {
413
- var _a, _b, _c, _d, _e, _f;
414
- var repr = this.props.representation.cell;
415
- var superpositionState = this.plugin.customState.superpositionState;
416
- var clusterSelectArr = [['All', 'All']];
417
- superpositionState.segmentData[superpositionState.activeSegment - 1].clusters.forEach(function (c, i) {
343
+ }
344
+ render() {
345
+ const repr = this.props.representation.cell;
346
+ const superpositionState = this.plugin.customState.superpositionState;
347
+ let clusterSelectArr = [['All', 'All']];
348
+ superpositionState.segmentData[superpositionState.activeSegment - 1].clusters.forEach((c, i) => {
418
349
  clusterSelectArr.push([(i + 1) + '', (i + 1) + '']);
419
350
  });
420
- var clusterOptions = {
351
+ const clusterOptions = {
421
352
  cluster: param_definition_1.ParamDefinition.Select('All', clusterSelectArr, { label: 'Select Cluster' })
422
353
  };
423
- var isSurrVisual = false;
424
- var isAlphafold = false;
354
+ let isSurrVisual = false;
355
+ let isAlphafold = false;
425
356
  if (repr && repr.obj) {
426
- var reprObj = repr.obj;
357
+ const reprObj = repr.obj;
427
358
  if (reprObj.tags && reprObj.tags.indexOf('superposition-focus-surr-repr') >= 0)
428
359
  isSurrVisual = true;
429
360
  if (reprObj.tags && reprObj.tags.indexOf('af-superposition-visual') >= 0)
430
361
  isAlphafold = true;
431
362
  }
432
- return (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-representation-entry' }, { children: repr.parent && (0, jsx_runtime_1.jsxs)("div", { children: [(clusterSelectArr.length > 2 && !isSurrVisual && !isAlphafold) && (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-representation-entry' }, { children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: clusterOptions, values: this.state.clusterVal, onChangeValues: this.selectCluster, isDisabled: this.state.isBusy }) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-representation-entry' }, { children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { type: (_a = repr.params) === null || _a === void 0 ? void 0 : _a.definition.type }, values: { type: (_b = repr.params) === null || _b === void 0 ? void 0 : _b.values.type }, onChangeValues: this.update, isDisabled: this.state.isBusy }) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-representation-entry' }, { children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { colorTheme: (_c = repr.params) === null || _c === void 0 ? void 0 : _c.definition.colorTheme }, values: { colorTheme: (_d = repr.params) === null || _d === void 0 ? void 0 : _d.values.colorTheme }, onChangeValues: this.update, isDisabled: this.state.isBusy }) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: 'msp-representation-entry' }, { children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { sizeTheme: (_e = repr.params) === null || _e === void 0 ? void 0 : _e.definition.sizeTheme }, values: { sizeTheme: (_f = repr.params) === null || _f === void 0 ? void 0 : _f.values.sizeTheme }, onChangeValues: this.update, isDisabled: this.state.isBusy }) }))] }) }));
433
- };
434
- return StructureRepresentationEntry;
435
- }(base_1.PurePluginUIComponent));
363
+ return (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: repr.parent && (0, jsx_runtime_1.jsxs)("div", { children: [(clusterSelectArr.length > 2 && !isSurrVisual && !isAlphafold) && (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: clusterOptions, values: this.state.clusterVal, onChangeValues: this.selectCluster, isDisabled: this.state.isBusy }) }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { type: repr.params?.definition.type }, values: { type: repr.params?.values.type }, onChangeValues: this.update, isDisabled: this.state.isBusy }) }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { colorTheme: repr.params?.definition.colorTheme }, values: { colorTheme: repr.params?.values.colorTheme }, onChangeValues: this.update, isDisabled: this.state.isBusy }) }), (0, jsx_runtime_1.jsx)("div", { className: 'msp-representation-entry', children: (0, jsx_runtime_1.jsx)(parameters_1.ParameterControls, { params: { sizeTheme: repr.params?.definition.sizeTheme }, values: { sizeTheme: repr.params?.values.sizeTheme }, onChangeValues: this.update, isDisabled: this.state.isBusy }) })] }) });
364
+ }
365
+ }