molstar 3.0.0-dev.8 → 3.0.2

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 (316) hide show
  1. package/README.md +7 -0
  2. package/build/viewer/index.html +2 -2
  3. package/build/viewer/molstar.js +1 -1
  4. package/lib/apps/viewer/app.d.ts +230 -0
  5. package/lib/apps/viewer/app.js +528 -0
  6. package/lib/apps/viewer/index.d.ts +2 -225
  7. package/lib/apps/viewer/index.html +2 -2
  8. package/lib/apps/viewer/index.js +2 -509
  9. package/lib/commonjs/apps/viewer/app.d.ts +230 -0
  10. package/lib/commonjs/apps/viewer/app.js +534 -0
  11. package/lib/commonjs/apps/viewer/index.d.ts +2 -225
  12. package/lib/commonjs/apps/viewer/index.js +2 -512
  13. package/lib/commonjs/examples/basic-wrapper/index.js +7 -3
  14. package/lib/commonjs/examples/proteopedia-wrapper/index.js +7 -1
  15. package/lib/commonjs/extensions/anvil/representation.js +1 -1
  16. package/lib/commonjs/extensions/model-export/export.d.ts +9 -0
  17. package/lib/commonjs/extensions/model-export/export.js +129 -0
  18. package/lib/commonjs/extensions/model-export/index.d.ts +7 -0
  19. package/lib/commonjs/extensions/model-export/index.js +36 -0
  20. package/lib/commonjs/extensions/model-export/ui.d.ts +11 -0
  21. package/lib/commonjs/extensions/model-export/ui.js +77 -0
  22. package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
  23. package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
  24. package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +2 -2
  25. package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +12 -4
  26. package/lib/commonjs/mol-canvas3d/canvas3d.js +2 -2
  27. package/lib/commonjs/mol-canvas3d/controls/trackball.d.ts +9 -4
  28. package/lib/commonjs/mol-canvas3d/controls/trackball.js +50 -11
  29. package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +1 -1
  30. package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +1 -1
  31. package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
  32. package/lib/commonjs/mol-gl/renderer.d.ts +2 -2
  33. package/lib/commonjs/mol-gl/renderer.js +3 -3
  34. package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
  35. package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
  36. package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  37. package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
  38. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
  39. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +1 -1
  40. package/lib/commonjs/mol-io/reader/mol/parser.d.ts +23 -1
  41. package/lib/commonjs/mol-io/reader/mol/parser.js +116 -4
  42. package/lib/commonjs/mol-io/reader/mol2/parser.d.ts +1 -1
  43. package/lib/commonjs/mol-io/reader/mol2/parser.js +33 -3
  44. package/lib/commonjs/mol-io/reader/mol2/schema.d.ts +12 -1
  45. package/lib/commonjs/mol-io/reader/mol2/schema.js +1 -1
  46. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
  47. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.js +9 -0
  48. package/lib/commonjs/mol-io/reader/sdf/parser.d.ts +3 -1
  49. package/lib/commonjs/mol-io/reader/sdf/parser.js +11 -2
  50. package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +9 -2
  51. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
  52. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +17 -4
  53. package/lib/commonjs/mol-math/geometry/symmetry-operator.d.ts +1 -1
  54. package/lib/commonjs/mol-math/geometry/symmetry-operator.js +10 -4
  55. package/lib/commonjs/mol-model/structure/export/mmcif.d.ts +1 -1
  56. package/lib/commonjs/mol-model/structure/export/mmcif.js +8 -5
  57. package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
  58. package/lib/commonjs/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
  59. package/lib/commonjs/mol-model/structure/model/properties/common.d.ts +1 -1
  60. package/lib/commonjs/mol-model/structure/structure/element/loci.d.ts +1 -1
  61. package/lib/commonjs/mol-model/structure/structure/element/loci.js +4 -2
  62. package/lib/commonjs/mol-model/structure/structure/element/stats.js +8 -0
  63. package/lib/commonjs/mol-model/structure/structure/properties.d.ts +1 -0
  64. package/lib/commonjs/mol-model/structure/structure/properties.js +2 -1
  65. package/lib/commonjs/mol-model/structure/structure/symmetry.js +1 -3
  66. package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.d.ts +2 -1
  67. package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.js +11 -2
  68. package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.d.ts +1 -1
  69. package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +20 -10
  70. package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.d.ts +1 -1
  71. package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.js +21 -11
  72. package/lib/commonjs/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
  73. package/lib/commonjs/mol-model/volume/volume.d.ts +7 -0
  74. package/lib/commonjs/mol-model/volume/volume.js +18 -0
  75. package/lib/commonjs/mol-model-formats/structure/basic/atomic.d.ts +2 -2
  76. package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +6 -6
  77. package/lib/commonjs/mol-model-formats/structure/basic/coarse.d.ts +1 -1
  78. package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +3 -3
  79. package/lib/commonjs/mol-model-formats/structure/basic/entities.d.ts +2 -1
  80. package/lib/commonjs/mol-model-formats/structure/basic/entities.js +28 -24
  81. package/lib/commonjs/mol-model-formats/structure/basic/parser.js +17 -8
  82. package/lib/commonjs/mol-model-formats/structure/basic/properties.d.ts +6 -1
  83. package/lib/commonjs/mol-model-formats/structure/basic/properties.js +12 -22
  84. package/lib/commonjs/mol-model-formats/structure/mol.d.ts +2 -1
  85. package/lib/commonjs/mol-model-formats/structure/mol.js +19 -5
  86. package/lib/commonjs/mol-model-formats/structure/mol2.d.ts +1 -1
  87. package/lib/commonjs/mol-model-formats/structure/mol2.js +37 -7
  88. package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.d.ts +18 -1
  89. package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +18 -5
  90. package/lib/commonjs/mol-model-props/common/custom-property.d.ts +1 -1
  91. package/lib/commonjs/mol-model-props/computed/interactions/common.d.ts +1 -1
  92. package/lib/commonjs/mol-model-props/computed/interactions/common.js +16 -24
  93. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  94. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
  95. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  96. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
  97. package/lib/commonjs/mol-model-props/sequence/best-database-mapping.js +15 -15
  98. package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -0
  99. package/lib/commonjs/mol-plugin/animation-loop.js +1 -1
  100. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
  101. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +11 -6
  102. package/lib/commonjs/mol-plugin/behavior/static/representation.js +1 -1
  103. package/lib/commonjs/mol-plugin/commands.d.ts +6 -2
  104. package/lib/commonjs/mol-plugin/config.d.ts +1 -1
  105. package/lib/commonjs/mol-plugin/spec.d.ts +1 -1
  106. package/lib/commonjs/mol-plugin/spec.js +3 -1
  107. package/lib/commonjs/mol-plugin-state/actions/file.d.ts +3 -2
  108. package/lib/commonjs/mol-plugin-state/actions/file.js +67 -31
  109. package/lib/commonjs/mol-plugin-state/actions/structure.d.ts +1 -0
  110. package/lib/commonjs/mol-plugin-state/actions/structure.js +41 -8
  111. package/lib/commonjs/mol-plugin-state/actions/volume.d.ts +1 -1
  112. package/lib/commonjs/mol-plugin-state/actions/volume.js +3 -3
  113. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
  114. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-rock.js +62 -0
  115. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
  116. package/lib/commonjs/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
  117. package/lib/commonjs/mol-plugin-state/animation/model.d.ts +4 -0
  118. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
  119. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
  120. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +172 -6
  121. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +74 -2
  122. package/lib/commonjs/mol-plugin-state/formats/volume.js +1 -11
  123. package/lib/commonjs/mol-plugin-state/manager/animation.d.ts +5 -1
  124. package/lib/commonjs/mol-plugin-state/manager/animation.js +5 -5
  125. package/lib/commonjs/mol-plugin-ui/structure/superposition.js +2 -2
  126. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
  127. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +4 -8
  128. package/lib/commonjs/mol-repr/shape/loci/common.d.ts +1 -1
  129. package/lib/commonjs/mol-repr/shape/loci/common.js +3 -3
  130. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  131. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
  132. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  133. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
  134. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  135. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
  136. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  137. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
  138. package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +1 -1
  139. package/lib/commonjs/mol-repr/structure/visual/util/bond.js +5 -4
  140. package/lib/commonjs/mol-repr/visual.d.ts +1 -1
  141. package/lib/commonjs/mol-repr/visual.js +2 -1
  142. package/lib/commonjs/mol-state/transform.js +12 -2
  143. package/lib/commonjs/mol-state/tree/immutable.d.ts +18 -0
  144. package/lib/commonjs/mol-state/tree/transient.d.ts +3 -4
  145. package/lib/commonjs/mol-theme/color/element-symbol.d.ts +289 -3
  146. package/lib/commonjs/mol-theme/color/element-symbol.js +25 -15
  147. package/lib/commonjs/mol-theme/color/entity-id.d.ts +1 -1
  148. package/lib/commonjs/mol-theme/color/entity-id.js +29 -5
  149. package/lib/commonjs/mol-theme/color/illustrative.d.ts +100 -29
  150. package/lib/commonjs/mol-theme/color/illustrative.js +26 -7
  151. package/lib/commonjs/mol-theme/color/molecule-type.d.ts +19 -1
  152. package/lib/commonjs/mol-theme/color/molecule-type.js +10 -5
  153. package/lib/commonjs/mol-theme/color/residue-name.d.ts +77 -1
  154. package/lib/commonjs/mol-theme/color/residue-name.js +10 -5
  155. package/lib/commonjs/mol-theme/color/secondary-structure.d.ts +27 -1
  156. package/lib/commonjs/mol-theme/color/secondary-structure.js +10 -5
  157. package/lib/commonjs/mol-theme/color.d.ts +253 -15
  158. package/lib/commonjs/mol-util/color/color.d.ts +1 -1
  159. package/lib/commonjs/mol-util/color/color.js +1 -1
  160. package/lib/commonjs/mol-util/color/params.d.ts +10 -0
  161. package/lib/commonjs/mol-util/color/params.js +19 -0
  162. package/lib/commonjs/servers/volume/config.js +3 -3
  163. package/lib/commonjs/servers/volume/query.js +1 -1
  164. package/lib/examples/basic-wrapper/index.js +7 -3
  165. package/lib/examples/proteopedia-wrapper/index.js +7 -1
  166. package/lib/extensions/anvil/representation.js +1 -1
  167. package/lib/extensions/model-export/export.d.ts +9 -0
  168. package/lib/extensions/model-export/export.js +125 -0
  169. package/lib/extensions/model-export/index.d.ts +7 -0
  170. package/lib/extensions/model-export/index.js +33 -0
  171. package/lib/extensions/model-export/ui.d.ts +11 -0
  172. package/lib/extensions/model-export/ui.js +74 -0
  173. package/lib/extensions/mp4-export/encoder.js +1 -1
  174. package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +2 -2
  175. package/lib/extensions/rcsb/graphql/types.d.ts +2 -2
  176. package/lib/mol-canvas3d/canvas3d.d.ts +12 -4
  177. package/lib/mol-canvas3d/canvas3d.js +2 -2
  178. package/lib/mol-canvas3d/controls/trackball.d.ts +9 -4
  179. package/lib/mol-canvas3d/controls/trackball.js +51 -12
  180. package/lib/mol-canvas3d/helper/interaction-events.js +1 -1
  181. package/lib/mol-canvas3d/passes/draw.d.ts +1 -1
  182. package/lib/mol-canvas3d/passes/draw.js +3 -3
  183. package/lib/mol-gl/renderer.d.ts +2 -2
  184. package/lib/mol-gl/renderer.js +3 -3
  185. package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
  186. package/lib/mol-io/reader/cif/schema/bird.js +1 -1
  187. package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  188. package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
  189. package/lib/mol-io/reader/cif/schema/mmcif.d.ts +2 -2
  190. package/lib/mol-io/reader/cif/schema/mmcif.js +1 -1
  191. package/lib/mol-io/reader/mol/parser.d.ts +23 -1
  192. package/lib/mol-io/reader/mol/parser.js +112 -3
  193. package/lib/mol-io/reader/mol2/parser.d.ts +1 -1
  194. package/lib/mol-io/reader/mol2/parser.js +33 -3
  195. package/lib/mol-io/reader/mol2/schema.d.ts +12 -1
  196. package/lib/mol-io/reader/mol2/schema.js +1 -1
  197. package/lib/mol-io/reader/sdf/parser-v3-util.d.ts +6 -0
  198. package/lib/mol-io/reader/sdf/parser-v3-util.js +9 -0
  199. package/lib/mol-io/reader/sdf/parser.d.ts +3 -1
  200. package/lib/mol-io/reader/sdf/parser.js +12 -3
  201. package/lib/mol-io/writer/cif/encoder/binary.js +9 -2
  202. package/lib/mol-math/geometry/primitives/sphere3d.d.ts +1 -1
  203. package/lib/mol-math/geometry/primitives/sphere3d.js +17 -4
  204. package/lib/mol-math/geometry/symmetry-operator.d.ts +1 -1
  205. package/lib/mol-math/geometry/symmetry-operator.js +10 -4
  206. package/lib/mol-model/structure/export/mmcif.d.ts +1 -1
  207. package/lib/mol-model/structure/export/mmcif.js +8 -5
  208. package/lib/mol-model/structure/model/properties/coarse/hierarchy.d.ts +1 -1
  209. package/lib/mol-model/structure/model/properties/coarse/hierarchy.js +24 -2
  210. package/lib/mol-model/structure/model/properties/common.d.ts +1 -1
  211. package/lib/mol-model/structure/structure/element/loci.d.ts +1 -1
  212. package/lib/mol-model/structure/structure/element/loci.js +4 -2
  213. package/lib/mol-model/structure/structure/element/stats.js +8 -0
  214. package/lib/mol-model/structure/structure/properties.d.ts +1 -0
  215. package/lib/mol-model/structure/structure/properties.js +2 -1
  216. package/lib/mol-model/structure/structure/symmetry.js +1 -3
  217. package/lib/mol-model/structure/structure/unit/bonds/common.d.ts +2 -1
  218. package/lib/mol-model/structure/structure/unit/bonds/common.js +9 -1
  219. package/lib/mol-model/structure/structure/unit/bonds/inter-compute.d.ts +1 -1
  220. package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -11
  221. package/lib/mol-model/structure/structure/unit/bonds/intra-compute.d.ts +1 -1
  222. package/lib/mol-model/structure/structure/unit/bonds/intra-compute.js +22 -12
  223. package/lib/mol-model/structure/structure/util/superposition-db-mapping.js +10 -5
  224. package/lib/mol-model/volume/volume.d.ts +7 -0
  225. package/lib/mol-model/volume/volume.js +18 -0
  226. package/lib/mol-model-formats/structure/basic/atomic.d.ts +2 -2
  227. package/lib/mol-model-formats/structure/basic/atomic.js +6 -6
  228. package/lib/mol-model-formats/structure/basic/coarse.d.ts +1 -1
  229. package/lib/mol-model-formats/structure/basic/coarse.js +3 -3
  230. package/lib/mol-model-formats/structure/basic/entities.d.ts +2 -1
  231. package/lib/mol-model-formats/structure/basic/entities.js +25 -22
  232. package/lib/mol-model-formats/structure/basic/parser.js +19 -10
  233. package/lib/mol-model-formats/structure/basic/properties.d.ts +6 -1
  234. package/lib/mol-model-formats/structure/basic/properties.js +12 -25
  235. package/lib/mol-model-formats/structure/mol.d.ts +2 -1
  236. package/lib/mol-model-formats/structure/mol.js +17 -3
  237. package/lib/mol-model-formats/structure/mol2.d.ts +1 -1
  238. package/lib/mol-model-formats/structure/mol2.js +37 -7
  239. package/lib/mol-model-formats/structure/property/bonds/index-pair.d.ts +18 -1
  240. package/lib/mol-model-formats/structure/property/bonds/index-pair.js +18 -5
  241. package/lib/mol-model-props/common/custom-property.d.ts +1 -1
  242. package/lib/mol-model-props/computed/interactions/common.d.ts +1 -1
  243. package/lib/mol-model-props/computed/interactions/common.js +16 -24
  244. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  245. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +44 -18
  246. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  247. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +38 -13
  248. package/lib/mol-model-props/sequence/best-database-mapping.js +15 -15
  249. package/lib/mol-plugin/animation-loop.d.ts +2 -0
  250. package/lib/mol-plugin/animation-loop.js +1 -1
  251. package/lib/mol-plugin/behavior/dynamic/representation.d.ts +1 -1
  252. package/lib/mol-plugin/behavior/dynamic/representation.js +11 -6
  253. package/lib/mol-plugin/behavior/static/representation.js +1 -1
  254. package/lib/mol-plugin/commands.d.ts +6 -2
  255. package/lib/mol-plugin/config.d.ts +1 -1
  256. package/lib/mol-plugin/spec.d.ts +1 -1
  257. package/lib/mol-plugin/spec.js +3 -1
  258. package/lib/mol-plugin/version.js +2 -2
  259. package/lib/mol-plugin-state/actions/file.d.ts +3 -2
  260. package/lib/mol-plugin-state/actions/file.js +67 -31
  261. package/lib/mol-plugin-state/actions/structure.d.ts +1 -0
  262. package/lib/mol-plugin-state/actions/structure.js +41 -8
  263. package/lib/mol-plugin-state/actions/volume.d.ts +1 -1
  264. package/lib/mol-plugin-state/actions/volume.js +3 -3
  265. package/lib/mol-plugin-state/animation/built-in/camera-rock.d.ts +16 -0
  266. package/lib/mol-plugin-state/animation/built-in/camera-rock.js +59 -0
  267. package/lib/mol-plugin-state/animation/built-in/camera-spin.d.ts +1 -1
  268. package/lib/mol-plugin-state/animation/built-in/camera-spin.js +9 -8
  269. package/lib/mol-plugin-state/animation/model.d.ts +4 -0
  270. package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +6 -6
  271. package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -1
  272. package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +172 -6
  273. package/lib/mol-plugin-state/builder/structure/representation-preset.js +74 -2
  274. package/lib/mol-plugin-state/formats/volume.js +1 -11
  275. package/lib/mol-plugin-state/manager/animation.d.ts +5 -1
  276. package/lib/mol-plugin-state/manager/animation.js +5 -5
  277. package/lib/mol-plugin-ui/structure/superposition.js +2 -2
  278. package/lib/mol-plugin-ui/viewport/simple-settings.d.ts +1 -1
  279. package/lib/mol-plugin-ui/viewport/simple-settings.js +4 -8
  280. package/lib/mol-repr/shape/loci/common.d.ts +1 -1
  281. package/lib/mol-repr/shape/loci/common.js +3 -3
  282. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  283. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.js +8 -4
  284. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  285. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +10 -6
  286. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  287. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +8 -4
  288. package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  289. package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +2 -2
  290. package/lib/mol-repr/structure/visual/util/bond.d.ts +1 -1
  291. package/lib/mol-repr/structure/visual/util/bond.js +5 -4
  292. package/lib/mol-repr/visual.d.ts +1 -1
  293. package/lib/mol-repr/visual.js +2 -1
  294. package/lib/mol-state/transform.js +12 -2
  295. package/lib/mol-state/tree/immutable.d.ts +18 -0
  296. package/lib/mol-state/tree/transient.d.ts +3 -4
  297. package/lib/mol-theme/color/element-symbol.d.ts +289 -3
  298. package/lib/mol-theme/color/element-symbol.js +25 -15
  299. package/lib/mol-theme/color/entity-id.d.ts +1 -1
  300. package/lib/mol-theme/color/entity-id.js +29 -5
  301. package/lib/mol-theme/color/illustrative.d.ts +100 -29
  302. package/lib/mol-theme/color/illustrative.js +26 -7
  303. package/lib/mol-theme/color/molecule-type.d.ts +19 -1
  304. package/lib/mol-theme/color/molecule-type.js +10 -5
  305. package/lib/mol-theme/color/residue-name.d.ts +77 -1
  306. package/lib/mol-theme/color/residue-name.js +10 -5
  307. package/lib/mol-theme/color/secondary-structure.d.ts +27 -1
  308. package/lib/mol-theme/color/secondary-structure.js +10 -5
  309. package/lib/mol-theme/color.d.ts +253 -15
  310. package/lib/mol-util/color/color.d.ts +1 -1
  311. package/lib/mol-util/color/color.js +1 -1
  312. package/lib/mol-util/color/params.d.ts +10 -0
  313. package/lib/mol-util/color/params.js +15 -0
  314. package/lib/servers/volume/config.js +3 -3
  315. package/lib/servers/volume/query.js +1 -1
  316. package/package.json +36 -38
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -63,11 +63,12 @@ function createInterUnitInteractionCylinderMesh(ctx, structure, theme, props, me
63
63
  if (!childUnitA)
64
64
  return true;
65
65
  var unitA = structure.unitMap.get(b.unitA);
66
- var fA = unitsFeatures.get(b.unitA);
67
- // TODO: check all members
68
- var eA = unitA.elements[fA.members[fA.offsets[b.indexA]]];
69
- if (!SortedArray.has(childUnitA.elements, eA))
70
- return true;
66
+ var _a = unitsFeatures.get(b.unitA), offsets = _a.offsets, members = _a.members;
67
+ for (var i = offsets[b.indexA], il = offsets[b.indexA + 1]; i < il; ++i) {
68
+ var eA = unitA.elements[members[i]];
69
+ if (!SortedArray.has(childUnitA.elements, eA))
70
+ return true;
71
+ }
71
72
  }
72
73
  return false;
73
74
  }
@@ -115,8 +116,9 @@ function getInteractionLoci(pickingId, structure, id) {
115
116
  }
116
117
  return EmptyLoci;
117
118
  }
119
+ var __unitMap = new Map();
120
+ var __contactIndicesSet = new Set();
118
121
  function eachInteraction(loci, structure, apply, isMarking) {
119
- var _a;
120
122
  var changed = false;
121
123
  if (Interactions.isLoci(loci)) {
122
124
  if (!Structure.areEquivalent(loci.data.structure, structure))
@@ -125,8 +127,8 @@ function eachInteraction(loci, structure, apply, isMarking) {
125
127
  if (loci.data.interactions !== interactions)
126
128
  return false;
127
129
  var contacts = interactions.contacts;
128
- for (var _i = 0, _b = loci.elements; _i < _b.length; _i++) {
129
- var c = _b[_i];
130
+ for (var _i = 0, _a = loci.elements; _i < _a.length; _i++) {
131
+ var c = _a[_i];
130
132
  var idx = contacts.getEdgeIndex(c.indexA, c.unitA.id, c.indexB, c.unitB.id);
131
133
  if (idx !== -1) {
132
134
  if (apply(Interval.ofSingleton(idx)))
@@ -139,28 +141,52 @@ function eachInteraction(loci, structure, apply, isMarking) {
139
141
  return false;
140
142
  if (isMarking && loci.elements.length === 1)
141
143
  return false; // only a single unit
142
- var contacts_1 = (_a = InteractionsProvider.get(structure).value) === null || _a === void 0 ? void 0 : _a.contacts;
143
- if (!contacts_1)
144
+ var interactions = InteractionsProvider.get(structure).value;
145
+ if (!interactions)
144
146
  return false;
147
+ var contacts_1 = interactions.contacts, unitsFeatures_1 = interactions.unitsFeatures;
148
+ for (var _b = 0, _c = loci.elements; _b < _c.length; _b++) {
149
+ var e = _c[_b];
150
+ __unitMap.set(e.unit.id, e.indices);
151
+ }
145
152
  var _loop_1 = function (e) {
146
153
  var unit = e.unit;
147
154
  if (!Unit.isAtomic(unit))
148
155
  return "continue";
149
- if (isMarking && OrderedSet.size(e.indices) === 1)
150
- return "continue";
151
156
  OrderedSet.forEach(e.indices, function (v) {
152
157
  for (var _i = 0, _a = contacts_1.getContactIndicesForElement(v, unit); _i < _a.length; _i++) {
153
158
  var idx = _a[_i];
154
- if (apply(Interval.ofSingleton(idx)))
155
- changed = true;
159
+ __contactIndicesSet.add(idx);
156
160
  }
157
161
  });
158
162
  };
159
- // TODO when isMarking, all elements of contact features need to be in the loci
160
- for (var _c = 0, _d = loci.elements; _c < _d.length; _c++) {
161
- var e = _d[_c];
163
+ for (var _d = 0, _e = loci.elements; _d < _e.length; _d++) {
164
+ var e = _e[_d];
162
165
  _loop_1(e);
163
166
  }
167
+ __contactIndicesSet.forEach(function (i) {
168
+ if (isMarking) {
169
+ var _a = contacts_1.edges[i], indexA = _a.indexA, unitA = _a.unitA, indexB = _a.indexB, unitB = _a.unitB;
170
+ var indicesA = __unitMap.get(unitA);
171
+ var indicesB = __unitMap.get(unitB);
172
+ if (!indicesA || !indicesB)
173
+ return;
174
+ var _b = unitsFeatures_1.get(unitA), offsetsA = _b.offsets, membersA = _b.members;
175
+ for (var j = offsetsA[indexA], jl = offsetsA[indexA + 1]; j < jl; ++j) {
176
+ if (!OrderedSet.has(indicesA, membersA[j]))
177
+ return;
178
+ }
179
+ var _c = unitsFeatures_1.get(unitB), offsetsB = _c.offsets, membersB = _c.members;
180
+ for (var j = offsetsB[indexB], jl = offsetsB[indexB + 1]; j < jl; ++j) {
181
+ if (!OrderedSet.has(indicesB, membersB[j]))
182
+ return;
183
+ }
184
+ }
185
+ if (apply(Interval.ofSingleton(i)))
186
+ changed = true;
187
+ });
188
+ __unitMap.clear();
189
+ __contactIndicesSet.clear();
164
190
  }
165
191
  return changed;
166
192
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -49,9 +49,19 @@ function createIntraUnitInteractionsCylinderMesh(ctx, unit, structure, theme, pr
49
49
  var sizeB = theme.size.size(location);
50
50
  return Math.min(sizeA, sizeB) * sizeFactor;
51
51
  },
52
- ignore: function (edgeIndex) { return (flag[edgeIndex] === 1 /* Filtered */ ||
53
- // TODO: check all members
54
- (!!childUnit && !SortedArray.has(childUnit.elements, unit.elements[members[offsets[a[edgeIndex]]]]))); }
52
+ ignore: function (edgeIndex) {
53
+ if (flag[edgeIndex] === 1 /* Filtered */)
54
+ return true;
55
+ if (childUnit) {
56
+ var f = a[edgeIndex];
57
+ for (var i = offsets[f], jl = offsets[f + 1]; i < jl; ++i) {
58
+ var e = unit.elements[members[offsets[i]]];
59
+ if (!SortedArray.has(childUnit.elements, e))
60
+ return true;
61
+ }
62
+ }
63
+ return false;
64
+ }
55
65
  };
56
66
  m = createLinkCylinderMesh(ctx, builderProps, props, mesh);
57
67
  sphere = Sphere3D.expand(Sphere3D(), (childUnit !== null && childUnit !== void 0 ? childUnit : unit).boundary.sphere, 1 * sizeFactor);
@@ -98,6 +108,7 @@ function getInteractionLoci(pickingId, structureGroup, id) {
98
108
  }
99
109
  return EmptyLoci;
100
110
  }
111
+ var __contactIndicesSet = new Set();
101
112
  function eachInteraction(loci, structureGroup, apply, isMarking) {
102
113
  var changed = false;
103
114
  if (Interactions.isLoci(loci)) {
@@ -132,28 +143,42 @@ function eachInteraction(loci, structureGroup, apply, isMarking) {
132
143
  if (!interactions)
133
144
  return false;
134
145
  var unit = group.units[0];
135
- var contacts = interactions.unitsContacts.get(unit.id);
146
+ var contacts_1 = interactions.unitsContacts.get(unit.id);
136
147
  var features = interactions.unitsFeatures.get(unit.id);
137
- var groupCount_1 = contacts.edgeCount * 2;
138
- var offset_1 = contacts.offset;
148
+ var groupCount_1 = contacts_1.edgeCount * 2;
149
+ var offset_1 = contacts_1.offset;
139
150
  var _b = features.elementsIndex, fOffsets_1 = _b.offsets, fIndices_1 = _b.indices;
151
+ var members_1 = features.members, offsets_1 = features.offsets;
140
152
  var _loop_1 = function (e) {
141
153
  var unitIdx = group.unitIndexMap.get(e.unit.id);
142
- if (unitIdx !== undefined)
143
- return "continue";
144
- if (isMarking && OrderedSet.size(e.indices) === 1)
154
+ if (unitIdx === undefined)
145
155
  return "continue";
146
156
  OrderedSet.forEach(e.indices, function (v) {
147
157
  for (var i = fOffsets_1[v], il = fOffsets_1[v + 1]; i < il; ++i) {
148
158
  var fI = fIndices_1[i];
149
159
  for (var j = offset_1[fI], jl = offset_1[fI + 1]; j < jl; ++j) {
150
- if (apply(Interval.ofSingleton(unitIdx * groupCount_1 + j)))
151
- changed = true;
160
+ __contactIndicesSet.add(j);
161
+ }
162
+ }
163
+ });
164
+ __contactIndicesSet.forEach(function (i) {
165
+ if (isMarking) {
166
+ var fA = contacts_1.a[i];
167
+ for (var j = offsets_1[fA], jl = offsets_1[fA + 1]; j < jl; ++j) {
168
+ if (!OrderedSet.has(e.indices, members_1[j]))
169
+ return;
170
+ }
171
+ var fB = contacts_1.b[i];
172
+ for (var j = offsets_1[fB], jl = offsets_1[fB + 1]; j < jl; ++j) {
173
+ if (!OrderedSet.has(e.indices, members_1[j]))
174
+ return;
152
175
  }
153
176
  }
177
+ if (apply(Interval.ofSingleton(unitIdx * groupCount_1 + i)))
178
+ changed = true;
154
179
  });
180
+ __contactIndicesSet.clear();
155
181
  };
156
- // TODO: when isMarking, all elements of contact features need to be in the loci
157
182
  for (var _c = 0, _d = loci.elements; _c < _d.length; _c++) {
158
183
  var e = _d[_c];
159
184
  _loop_1(e);
@@ -19,7 +19,7 @@ var BestDatabaseSequenceMapping;
19
19
  type: 'static',
20
20
  defaultParams: {},
21
21
  getParams: function () { return ({}); },
22
- isApplicable: function (data) { var _a, _b; return MmcifFormat.is(data.sourceData) && ((_b = (_a = data.sourceData.data.frame.categories) === null || _a === void 0 ? void 0 : _a.atom_site) === null || _b === void 0 ? void 0 : _b.fieldNames.indexOf('db_name')) >= 0; },
22
+ isApplicable: function (data) { var _a, _b; return MmcifFormat.is(data.sourceData) && ((_b = (_a = data.sourceData.data.frame.categories) === null || _a === void 0 ? void 0 : _a.atom_site) === null || _b === void 0 ? void 0 : _b.fieldNames.indexOf('pdbx_sifts_xref_db_name')) >= 0; },
23
23
  obtain: function (ctx, data) { return __awaiter(_this, void 0, void 0, function () {
24
24
  return __generator(this, function (_a) {
25
25
  return [2 /*return*/, { value: fromCif(data) }];
@@ -32,7 +32,7 @@ var BestDatabaseSequenceMapping;
32
32
  if (!data)
33
33
  return '';
34
34
  var eI = loc.unit.elements[loc.element];
35
- var rI = model.atomicHierarchy.residueAtomSegments.offsets[eI];
35
+ var rI = model.atomicHierarchy.residueAtomSegments.index[eI];
36
36
  return data.accession[rI];
37
37
  }
38
38
  BestDatabaseSequenceMapping.getKey = getKey;
@@ -42,7 +42,7 @@ var BestDatabaseSequenceMapping;
42
42
  if (!data)
43
43
  return;
44
44
  var eI = loc.unit.elements[loc.element];
45
- var rI = model.atomicHierarchy.residueAtomSegments.offsets[eI];
45
+ var rI = model.atomicHierarchy.residueAtomSegments.index[eI];
46
46
  var dbName = data.dbName[rI];
47
47
  if (!dbName)
48
48
  return;
@@ -53,10 +53,10 @@ var BestDatabaseSequenceMapping;
53
53
  if (!MmcifFormat.is(model.sourceData))
54
54
  return;
55
55
  var atom_site = model.sourceData.data.frame.categories.atom_site;
56
- var db_name = atom_site.getField('db_name');
57
- var db_acc = atom_site.getField('db_acc');
58
- var db_num = atom_site.getField('db_num');
59
- var db_res = atom_site.getField('db_res');
56
+ var db_name = atom_site.getField('pdbx_sifts_xref_db_name');
57
+ var db_acc = atom_site.getField('pdbx_sifts_xref_db_acc');
58
+ var db_num = atom_site.getField('pdbx_sifts_xref_db_num');
59
+ var db_res = atom_site.getField('pdbx_sifts_xref_db_res');
60
60
  if (!db_name || !db_acc || !db_num || !db_res)
61
61
  return;
62
62
  var atomSourceIndex = model.atomicHierarchy.atomSourceIndex;
@@ -68,16 +68,16 @@ var BestDatabaseSequenceMapping;
68
68
  for (var i = 0; i < count; i++) {
69
69
  var row = atomSourceIndex.value(residueOffsets[i]);
70
70
  if (db_name.valueKind(row) !== 0 /* Present */) {
71
- dbName[row] = '';
72
- accession[row] = '';
73
- num[row] = 0;
74
- residue[row] = '';
71
+ dbName[i] = '';
72
+ accession[i] = '';
73
+ num[i] = 0;
74
+ residue[i] = '';
75
75
  continue;
76
76
  }
77
- dbName[row] = db_name.str(row);
78
- accession[row] = db_acc.str(row);
79
- num[row] = db_num.int(row);
80
- residue[row] = db_res.str(row);
77
+ dbName[i] = db_name.str(row);
78
+ accession[i] = db_acc.str(row);
79
+ num[i] = db_num.int(row);
80
+ residue[i] = db_res.str(row);
81
81
  }
82
82
  return { dbName: dbName, accession: accession, num: num, residue: residue };
83
83
  }
@@ -4,6 +4,7 @@
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  */
6
6
  import { PluginContext } from './context';
7
+ import { PluginAnimationManager } from '../mol-plugin-state/manager/animation';
7
8
  export declare class PluginAnimationLoop {
8
9
  private plugin;
9
10
  private currentFrame;
@@ -12,6 +13,7 @@ export declare class PluginAnimationLoop {
12
13
  tick(t: number, options?: {
13
14
  isSynchronous?: boolean;
14
15
  manualDraw?: boolean;
16
+ animation?: PluginAnimationManager.AnimationInfo;
15
17
  }): Promise<void>;
16
18
  private frame;
17
19
  resetTime(t?: number): void;
@@ -30,7 +30,7 @@ var PluginAnimationLoop = /** @class */ (function () {
30
30
  return __awaiter(this, void 0, void 0, function () {
31
31
  return __generator(this, function (_b) {
32
32
  switch (_b.label) {
33
- case 0: return [4 /*yield*/, this.plugin.managers.animation.tick(t, options === null || options === void 0 ? void 0 : options.isSynchronous)];
33
+ case 0: return [4 /*yield*/, this.plugin.managers.animation.tick(t, options === null || options === void 0 ? void 0 : options.isSynchronous, options === null || options === void 0 ? void 0 : options.animation)];
34
34
  case 1:
35
35
  _b.sent();
36
36
  (_a = this.plugin.canvas3d) === null || _a === void 0 ? void 0 : _a.tick(t, options);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
@@ -213,11 +213,16 @@ export var DefaultLociLabelProvider = PluginBehavior.create({
213
213
  this.f = {
214
214
  label: function (loci) {
215
215
  var label = [];
216
- if (StructureElement.Loci.is(loci) && loci.elements.length === 1) {
217
- var u = loci.elements[0].unit;
218
- var l = StructureElement.Location.create(loci.structure, u, u.elements[0]);
219
- var name_1 = StructureProperties.entity.pdbx_description(l).join(', ');
220
- label.push(name_1);
216
+ if (StructureElement.Loci.is(loci)) {
217
+ var entityNames = new Set();
218
+ for (var _i = 0, _a = loci.elements; _i < _a.length; _i++) {
219
+ var u = _a[_i].unit;
220
+ var l = StructureElement.Location.create(loci.structure, u, u.elements[0]);
221
+ var name_1 = StructureProperties.entity.pdbx_description(l).join(', ');
222
+ entityNames.add(name_1);
223
+ }
224
+ if (entityNames.size === 1)
225
+ entityNames.forEach(function (name) { return label.push(name); });
221
226
  }
222
227
  label.push(lociLabel(loci));
223
228
  return label.filter(function (l) { return !!l; }).join('</br>');
@@ -82,7 +82,7 @@ export function UpdateRepresentationVisibility(ctx) {
82
82
  });
83
83
  }
84
84
  function updateVisibility(cell, r) {
85
- if (r.state.visible === cell.state.isHidden) {
85
+ if (r.state.visible === !!cell.state.isHidden) {
86
86
  r.setState({ visible: !cell.state.isHidden });
87
87
  return true;
88
88
  }
@@ -278,8 +278,12 @@ export declare const PluginCommands: {
278
278
  rotateSpeed: number;
279
279
  zoomSpeed: number;
280
280
  panSpeed: number;
281
- spin: boolean;
282
- spinSpeed: number;
281
+ animate: import("../mol-util/param-definition").ParamDefinition.NamedParams<import("../mol-util/param-definition").ParamDefinition.Normalize<unknown>, "off"> | import("../mol-util/param-definition").ParamDefinition.NamedParams<import("../mol-util/param-definition").ParamDefinition.Normalize<{
282
+ speed: any;
283
+ }>, "spin"> | import("../mol-util/param-definition").ParamDefinition.NamedParams<import("../mol-util/param-definition").ParamDefinition.Normalize<{
284
+ speed: any;
285
+ angle: any;
286
+ }>, "rock">;
283
287
  staticMoving: boolean;
284
288
  dynamicDampingFactor: number;
285
289
  minDistance: number;
@@ -47,7 +47,7 @@ export declare const PluginConfig: {
47
47
  ShowAnimation: PluginConfigItem<boolean>;
48
48
  };
49
49
  Download: {
50
- DefaultPdbProvider: PluginConfigItem<"rcsb" | "pdbe">;
50
+ DefaultPdbProvider: PluginConfigItem<"rcsb" | "pdbe" | "pdbj">;
51
51
  DefaultEmdbProvider: PluginConfigItem<EmdbDownloadProvider>;
52
52
  };
53
53
  Structure: {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author David Sehnal <david.sehnal@gmail.com>
5
5
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
@@ -16,6 +16,7 @@ import { StateTransforms } from '../mol-plugin-state/transforms';
16
16
  import { BoxifyVolumeStreaming, CreateVolumeStreamingBehavior, InitVolumeStreaming } from '../mol-plugin/behavior/dynamic/volume-streaming/transformers';
17
17
  import { AnimateStateInterpolation } from '../mol-plugin-state/animation/built-in/state-interpolation';
18
18
  import { AnimateStructureSpin } from '../mol-plugin-state/animation/built-in/spin-structure';
19
+ import { AnimateCameraRock } from '../mol-plugin-state/animation/built-in/camera-rock';
19
20
  export { PluginSpec };
20
21
  var PluginSpec;
21
22
  (function (PluginSpec) {
@@ -95,6 +96,7 @@ export var DefaultPluginSpec = function () { return ({
95
96
  animations: [
96
97
  AnimateModelIndex,
97
98
  AnimateCameraSpin,
99
+ AnimateCameraRock,
98
100
  AnimateStateSnapshots,
99
101
  AnimateAssemblyUnwind,
100
102
  AnimateStructureSpin,
@@ -1,2 +1,2 @@
1
- export var PLUGIN_VERSION = '3.0.0-dev.8';
2
- export var PLUGIN_VERSION_DATE = new Date(typeof __MOLSTAR_DEBUG_TIMESTAMP__ !== 'undefined' ? __MOLSTAR_DEBUG_TIMESTAMP__ : 1640979636220);
1
+ export var PLUGIN_VERSION = '3.0.2';
2
+ export var PLUGIN_VERSION_DATE = new Date(typeof __MOLSTAR_DEBUG_TIMESTAMP__ !== 'undefined' ? __MOLSTAR_DEBUG_TIMESTAMP__ : 1643574187710);
@@ -4,15 +4,16 @@
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
6
6
  import { StateAction } from '../../mol-state';
7
+ import { Asset } from '../../mol-util/assets';
7
8
  import { ParamDefinition as PD } from '../../mol-util/param-definition';
8
9
  import { PluginStateObject } from '../objects';
9
10
  export declare const OpenFiles: StateAction<PluginStateObject.Root, void, PD.Normalize<{
10
- files: import("../../mol-util/assets").Asset.File[] | null;
11
+ files: Asset.File[] | null;
11
12
  format: PD.NamedParams<PD.Normalize<unknown>, "auto"> | PD.NamedParams<string, "specific">;
12
13
  visuals: boolean;
13
14
  }>>;
14
15
  export declare const DownloadFile: StateAction<PluginStateObject.Root, void, PD.Normalize<{
15
- url: string | import("../../mol-util/assets").Asset.Url;
16
+ url: string | Asset.Url;
16
17
  format: string;
17
18
  isBinary: boolean;
18
19
  visuals: boolean;
@@ -6,8 +6,10 @@
6
6
  import { __awaiter, __generator } from "tslib";
7
7
  import { StateAction } from '../../mol-state';
8
8
  import { Task } from '../../mol-task';
9
+ import { Asset } from '../../mol-util/assets';
9
10
  import { getFileInfo } from '../../mol-util/file-info';
10
11
  import { ParamDefinition as PD } from '../../mol-util/param-definition';
12
+ import { unzip } from '../../mol-util/zip/zip';
11
13
  import { PluginStateObject } from '../objects';
12
14
  export var OpenFiles = StateAction.build({
13
15
  display: { name: 'Open Files', description: 'Load one or more files and optionally create default visuals' },
@@ -31,53 +33,87 @@ export var OpenFiles = StateAction.build({
31
33
  case 0:
32
34
  plugin.behaviors.layout.leftPanelTabName.next('data');
33
35
  return [4 /*yield*/, state.transaction(function () { return __awaiter(void 0, void 0, void 0, function () {
34
- var _i, _a, file, info, isBinary, data, provider, parsed, e_1;
35
- var _b, _c;
36
- return __generator(this, function (_d) {
37
- switch (_d.label) {
36
+ var processFile, _i, _a, file, zippedFiles, _b, _c, _d, _e, _f, fn, filedata, asset, e_1;
37
+ return __generator(this, function (_g) {
38
+ switch (_g.label) {
38
39
  case 0:
39
40
  if (params.files === null) {
40
41
  plugin.log.error('No file(s) selected');
41
42
  return [2 /*return*/];
42
43
  }
44
+ processFile = function (file) { return __awaiter(void 0, void 0, void 0, function () {
45
+ var info, isBinary, data, provider, parsed;
46
+ var _a, _b;
47
+ return __generator(this, function (_c) {
48
+ switch (_c.label) {
49
+ case 0:
50
+ info = getFileInfo(file.file);
51
+ isBinary = plugin.dataFormats.binaryExtensions.has(info.ext);
52
+ return [4 /*yield*/, plugin.builders.data.readFile({ file: file, isBinary: isBinary })];
53
+ case 1:
54
+ data = (_c.sent()).data;
55
+ provider = params.format.name === 'auto'
56
+ ? plugin.dataFormats.auto(info, (_a = data.cell) === null || _a === void 0 ? void 0 : _a.obj)
57
+ : plugin.dataFormats.get(params.format.params);
58
+ if (!provider) {
59
+ plugin.log.warn("OpenFiles: could not find data provider for '".concat(info.name, ".").concat(info.ext, "'"));
60
+ return [2 /*return*/];
61
+ }
62
+ return [4 /*yield*/, provider.parse(plugin, data)];
63
+ case 2:
64
+ parsed = _c.sent();
65
+ if (!params.visuals) return [3 /*break*/, 4];
66
+ return [4 /*yield*/, ((_b = provider.visuals) === null || _b === void 0 ? void 0 : _b.call(provider, plugin, parsed))];
67
+ case 3:
68
+ _c.sent();
69
+ _c.label = 4;
70
+ case 4: return [2 /*return*/];
71
+ }
72
+ });
73
+ }); };
43
74
  _i = 0, _a = params.files;
44
- _d.label = 1;
75
+ _g.label = 1;
45
76
  case 1:
46
- if (!(_i < _a.length)) return [3 /*break*/, 9];
77
+ if (!(_i < _a.length)) return [3 /*break*/, 14];
47
78
  file = _a[_i];
48
- _d.label = 2;
79
+ _g.label = 2;
49
80
  case 2:
50
- _d.trys.push([2, 7, , 8]);
51
- info = getFileInfo(file.file);
52
- isBinary = plugin.dataFormats.binaryExtensions.has(info.ext);
53
- return [4 /*yield*/, plugin.builders.data.readFile({ file: file, isBinary: isBinary })];
54
- case 3:
55
- data = (_d.sent()).data;
56
- provider = params.format.name === 'auto'
57
- ? plugin.dataFormats.auto(info, (_b = data.cell) === null || _b === void 0 ? void 0 : _b.obj)
58
- : plugin.dataFormats.get(params.format.params);
59
- if (!provider) {
60
- plugin.log.warn("OpenFiles: could not find data provider for '".concat(info.name, ".").concat(info.ext, "'"));
61
- return [3 /*break*/, 8];
62
- }
63
- return [4 /*yield*/, provider.parse(plugin, data)];
81
+ _g.trys.push([2, 12, , 13]);
82
+ if (!(file.file && file.name.toLowerCase().endsWith('.zip'))) return [3 /*break*/, 9];
83
+ _b = unzip;
84
+ _c = [taskCtx];
85
+ return [4 /*yield*/, file.file.arrayBuffer()];
86
+ case 3: return [4 /*yield*/, _b.apply(void 0, _c.concat([_g.sent()]))];
64
87
  case 4:
65
- parsed = _d.sent();
66
- if (!params.visuals) return [3 /*break*/, 6];
67
- return [4 /*yield*/, ((_c = provider.visuals) === null || _c === void 0 ? void 0 : _c.call(provider, plugin, parsed))];
88
+ zippedFiles = _g.sent();
89
+ _d = 0, _e = Object.entries(zippedFiles);
90
+ _g.label = 5;
68
91
  case 5:
69
- _d.sent();
70
- _d.label = 6;
71
- case 6: return [3 /*break*/, 8];
92
+ if (!(_d < _e.length)) return [3 /*break*/, 8];
93
+ _f = _e[_d], fn = _f[0], filedata = _f[1];
94
+ asset = Asset.File(new File([filedata], fn));
95
+ return [4 /*yield*/, processFile(asset)];
96
+ case 6:
97
+ _g.sent();
98
+ _g.label = 7;
72
99
  case 7:
73
- e_1 = _d.sent();
100
+ _d++;
101
+ return [3 /*break*/, 5];
102
+ case 8: return [3 /*break*/, 11];
103
+ case 9: return [4 /*yield*/, processFile(file)];
104
+ case 10:
105
+ _g.sent();
106
+ _g.label = 11;
107
+ case 11: return [3 /*break*/, 13];
108
+ case 12:
109
+ e_1 = _g.sent();
74
110
  console.error(e_1);
75
111
  plugin.log.error("Error opening file '".concat(file.name, "'"));
76
- return [3 /*break*/, 8];
77
- case 8:
112
+ return [3 /*break*/, 13];
113
+ case 13:
78
114
  _i++;
79
115
  return [3 /*break*/, 1];
80
- case 9: return [2 /*return*/];
116
+ case 14: return [2 /*return*/];
81
117
  }
82
118
  });
83
119
  }); }).runInContext(taskCtx)];
@@ -14,6 +14,7 @@ export declare const PdbDownloadProvider: {
14
14
  pdbe: PD.Group<PD.Normalize<{
15
15
  variant: "updated" | "updated-bcif" | "updtaed-bcif" | "archival";
16
16
  }>>;
17
+ pdbj: PD.Group<PD.Normalize<unknown>>;
17
18
  };
18
19
  export declare type PdbDownloadProvider = keyof typeof PdbDownloadProvider;
19
20
  export { DownloadStructure };