react-cheminfo 0.135.0 → 0.137.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/README.md +1 -1
  2. package/lib/crystal/core/cellAtoms.d.ts +43 -0
  3. package/lib/crystal/core/cellAtoms.d.ts.map +1 -0
  4. package/lib/crystal/core/cellAtoms.js +70 -0
  5. package/lib/crystal/core/cellAtoms.js.map +1 -0
  6. package/lib/crystal/core/index.d.ts +2 -0
  7. package/lib/crystal/core/index.d.ts.map +1 -1
  8. package/lib/crystal/core/index.js +1 -0
  9. package/lib/crystal/core/index.js.map +1 -1
  10. package/lib/crystal/core/molecules.d.ts.map +1 -1
  11. package/lib/crystal/core/molecules.js +6 -40
  12. package/lib/crystal/core/molecules.js.map +1 -1
  13. package/lib/crystal3d/core/cellClip.d.ts +46 -0
  14. package/lib/crystal3d/core/cellClip.d.ts.map +1 -0
  15. package/lib/crystal3d/core/cellClip.js +198 -0
  16. package/lib/crystal3d/core/cellClip.js.map +1 -0
  17. package/lib/crystal3d/core/cellGeometry.d.ts +63 -0
  18. package/lib/crystal3d/core/cellGeometry.d.ts.map +1 -0
  19. package/lib/crystal3d/core/cellGeometry.js +153 -0
  20. package/lib/crystal3d/core/cellGeometry.js.map +1 -0
  21. package/lib/crystal3d/core/cellStack.d.ts +51 -0
  22. package/lib/crystal3d/core/cellStack.d.ts.map +1 -0
  23. package/lib/crystal3d/core/cellStack.js +79 -0
  24. package/lib/crystal3d/core/cellStack.js.map +1 -0
  25. package/lib/crystal3d/core/crystalView.d.ts +81 -0
  26. package/lib/crystal3d/core/crystalView.d.ts.map +1 -0
  27. package/lib/crystal3d/core/crystalView.js +55 -0
  28. package/lib/crystal3d/core/crystalView.js.map +1 -0
  29. package/lib/crystal3d/core/drawingSet.d.ts +31 -0
  30. package/lib/crystal3d/core/drawingSet.d.ts.map +1 -0
  31. package/lib/crystal3d/core/drawingSet.js +63 -0
  32. package/lib/crystal3d/core/drawingSet.js.map +1 -0
  33. package/lib/crystal3d/core/elementDrawing.d.ts +50 -0
  34. package/lib/crystal3d/core/elementDrawing.d.ts.map +1 -0
  35. package/lib/crystal3d/core/elementDrawing.js +100 -0
  36. package/lib/crystal3d/core/elementDrawing.js.map +1 -0
  37. package/lib/crystal3d/core/elementExtent.d.ts +42 -0
  38. package/lib/crystal3d/core/elementExtent.d.ts.map +1 -0
  39. package/lib/crystal3d/core/elementExtent.js +56 -0
  40. package/lib/crystal3d/core/elementExtent.js.map +1 -0
  41. package/lib/crystal3d/core/elementLabels.d.ts +31 -0
  42. package/lib/crystal3d/core/elementLabels.d.ts.map +1 -0
  43. package/lib/crystal3d/core/elementLabels.js +99 -0
  44. package/lib/crystal3d/core/elementLabels.js.map +1 -0
  45. package/lib/crystal3d/core/elementShapes.d.ts +43 -0
  46. package/lib/crystal3d/core/elementShapes.d.ts.map +1 -0
  47. package/lib/crystal3d/core/elementShapes.js +115 -0
  48. package/lib/crystal3d/core/elementShapes.js.map +1 -0
  49. package/lib/crystal3d/core/frame.d.ts +36 -0
  50. package/lib/crystal3d/core/frame.d.ts.map +1 -0
  51. package/lib/crystal3d/core/frame.js +35 -0
  52. package/lib/crystal3d/core/frame.js.map +1 -0
  53. package/lib/crystal3d/core/framing.d.ts +41 -0
  54. package/lib/crystal3d/core/framing.d.ts.map +1 -0
  55. package/lib/crystal3d/core/framing.js +79 -0
  56. package/lib/crystal3d/core/framing.js.map +1 -0
  57. package/lib/crystal3d/core/index.d.ts +42 -0
  58. package/lib/crystal3d/core/index.d.ts.map +1 -0
  59. package/lib/crystal3d/core/index.js +29 -0
  60. package/lib/crystal3d/core/index.js.map +1 -0
  61. package/lib/crystal3d/core/labelText.d.ts +19 -0
  62. package/lib/crystal3d/core/labelText.d.ts.map +1 -0
  63. package/lib/crystal3d/core/labelText.js +42 -0
  64. package/lib/crystal3d/core/labelText.js.map +1 -0
  65. package/lib/crystal3d/core/latticeBasis.d.ts +49 -0
  66. package/lib/crystal3d/core/latticeBasis.d.ts.map +1 -0
  67. package/lib/crystal3d/core/latticeBasis.js +89 -0
  68. package/lib/crystal3d/core/latticeBasis.js.map +1 -0
  69. package/lib/crystal3d/core/mat3.d.ts +68 -0
  70. package/lib/crystal3d/core/mat3.d.ts.map +1 -0
  71. package/lib/crystal3d/core/mat3.js +146 -0
  72. package/lib/crystal3d/core/mat3.js.map +1 -0
  73. package/lib/crystal3d/core/operationMatrix.d.ts +44 -0
  74. package/lib/crystal3d/core/operationMatrix.d.ts.map +1 -0
  75. package/lib/crystal3d/core/operationMatrix.js +172 -0
  76. package/lib/crystal3d/core/operationMatrix.js.map +1 -0
  77. package/lib/crystal3d/core/orientation.d.ts +62 -0
  78. package/lib/crystal3d/core/orientation.d.ts.map +1 -0
  79. package/lib/crystal3d/core/orientation.js +166 -0
  80. package/lib/crystal3d/core/orientation.js.map +1 -0
  81. package/lib/crystal3d/core/palette.d.ts +24 -0
  82. package/lib/crystal3d/core/palette.d.ts.map +1 -0
  83. package/lib/crystal3d/core/palette.js +34 -0
  84. package/lib/crystal3d/core/palette.js.map +1 -0
  85. package/lib/crystal3d/core/primitives.d.ts +133 -0
  86. package/lib/crystal3d/core/primitives.d.ts.map +1 -0
  87. package/lib/crystal3d/core/primitives.js +80 -0
  88. package/lib/crystal3d/core/primitives.js.map +1 -0
  89. package/lib/crystal3d/core/structureText.d.ts +20 -0
  90. package/lib/crystal3d/core/structureText.d.ts.map +1 -0
  91. package/lib/crystal3d/core/structureText.js +37 -0
  92. package/lib/crystal3d/core/structureText.js.map +1 -0
  93. package/lib/crystal3d/core/supercell.d.ts +20 -0
  94. package/lib/crystal3d/core/supercell.d.ts.map +1 -0
  95. package/lib/crystal3d/core/supercell.js +35 -0
  96. package/lib/crystal3d/core/supercell.js.map +1 -0
  97. package/lib/crystal3d/core/types.d.ts +166 -0
  98. package/lib/crystal3d/core/types.d.ts.map +1 -0
  99. package/lib/crystal3d/core/types.js +10 -0
  100. package/lib/crystal3d/core/types.js.map +1 -0
  101. package/lib/crystal3d/core/vec3.d.ts +75 -0
  102. package/lib/crystal3d/core/vec3.d.ts.map +1 -0
  103. package/lib/crystal3d/core/vec3.js +119 -0
  104. package/lib/crystal3d/core/vec3.js.map +1 -0
  105. package/lib/crystal3d/ui/CrystalCanvas3D.d.ts +52 -0
  106. package/lib/crystal3d/ui/CrystalCanvas3D.d.ts.map +1 -0
  107. package/lib/crystal3d/ui/CrystalCanvas3D.js +250 -0
  108. package/lib/crystal3d/ui/CrystalCanvas3D.js.map +1 -0
  109. package/lib/crystal3d/ui/CrystalStructureView.d.ts +17 -0
  110. package/lib/crystal3d/ui/CrystalStructureView.d.ts.map +1 -0
  111. package/lib/crystal3d/ui/CrystalStructureView.js +79 -0
  112. package/lib/crystal3d/ui/CrystalStructureView.js.map +1 -0
  113. package/lib/crystal3d/ui/CrystalStructureViewer.d.ts +22 -0
  114. package/lib/crystal3d/ui/CrystalStructureViewer.d.ts.map +1 -0
  115. package/lib/crystal3d/ui/CrystalStructureViewer.js +29 -0
  116. package/lib/crystal3d/ui/CrystalStructureViewer.js.map +1 -0
  117. package/lib/crystal3d/ui/CrystalViewControls.d.ts +29 -0
  118. package/lib/crystal3d/ui/CrystalViewControls.d.ts.map +1 -0
  119. package/lib/crystal3d/ui/CrystalViewControls.js +24 -0
  120. package/lib/crystal3d/ui/CrystalViewControls.js.map +1 -0
  121. package/lib/crystal3d/ui/CrystalViewer3D.d.ts +72 -0
  122. package/lib/crystal3d/ui/CrystalViewer3D.d.ts.map +1 -0
  123. package/lib/crystal3d/ui/CrystalViewer3D.js +70 -0
  124. package/lib/crystal3d/ui/CrystalViewer3D.js.map +1 -0
  125. package/lib/crystal3d/ui/crystalScene.d.ts +97 -0
  126. package/lib/crystal3d/ui/crystalScene.d.ts.map +1 -0
  127. package/lib/crystal3d/ui/crystalScene.js +10 -0
  128. package/lib/crystal3d/ui/crystalScene.js.map +1 -0
  129. package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts +52 -0
  130. package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts.map +1 -0
  131. package/lib/crystal3d/ui/crystalStructureViewerProps.js +2 -0
  132. package/lib/crystal3d/ui/crystalStructureViewerProps.js.map +1 -0
  133. package/lib/crystal3d/ui/index.d.ts +16 -0
  134. package/lib/crystal3d/ui/index.d.ts.map +1 -0
  135. package/lib/crystal3d/ui/index.js +12 -0
  136. package/lib/crystal3d/ui/index.js.map +1 -0
  137. package/lib/crystal3d/ui/useCrystalCaption.d.ts +14 -0
  138. package/lib/crystal3d/ui/useCrystalCaption.d.ts.map +1 -0
  139. package/lib/crystal3d/ui/useCrystalCaption.js +32 -0
  140. package/lib/crystal3d/ui/useCrystalCaption.js.map +1 -0
  141. package/lib/crystal3d/viewer/animate.d.ts +49 -0
  142. package/lib/crystal3d/viewer/animate.d.ts.map +1 -0
  143. package/lib/crystal3d/viewer/animate.js +83 -0
  144. package/lib/crystal3d/viewer/animate.js.map +1 -0
  145. package/lib/crystal3d/viewer/camera.d.ts +44 -0
  146. package/lib/crystal3d/viewer/camera.d.ts.map +1 -0
  147. package/lib/crystal3d/viewer/camera.js +103 -0
  148. package/lib/crystal3d/viewer/camera.js.map +1 -0
  149. package/lib/crystal3d/viewer/index.d.ts +13 -0
  150. package/lib/crystal3d/viewer/index.d.ts.map +1 -0
  151. package/lib/crystal3d/viewer/index.js +8 -0
  152. package/lib/crystal3d/viewer/index.js.map +1 -0
  153. package/lib/crystal3d/viewer/layerRegistry.d.ts +24 -0
  154. package/lib/crystal3d/viewer/layerRegistry.d.ts.map +1 -0
  155. package/lib/crystal3d/viewer/layerRegistry.js +39 -0
  156. package/lib/crystal3d/viewer/layerRegistry.js.map +1 -0
  157. package/lib/crystal3d/viewer/meshPrimitives.d.ts +13 -0
  158. package/lib/crystal3d/viewer/meshPrimitives.d.ts.map +1 -0
  159. package/lib/crystal3d/viewer/meshPrimitives.js +76 -0
  160. package/lib/crystal3d/viewer/meshPrimitives.js.map +1 -0
  161. package/lib/crystal3d/viewer/plugin.d.ts +133 -0
  162. package/lib/crystal3d/viewer/plugin.d.ts.map +1 -0
  163. package/lib/crystal3d/viewer/plugin.js +181 -0
  164. package/lib/crystal3d/viewer/plugin.js.map +1 -0
  165. package/lib/crystal3d/viewer/renderCell.d.ts +43 -0
  166. package/lib/crystal3d/viewer/renderCell.d.ts.map +1 -0
  167. package/lib/crystal3d/viewer/renderCell.js +53 -0
  168. package/lib/crystal3d/viewer/renderCell.js.map +1 -0
  169. package/lib/crystal3d/viewer/renderElements.d.ts +54 -0
  170. package/lib/crystal3d/viewer/renderElements.d.ts.map +1 -0
  171. package/lib/crystal3d/viewer/renderElements.js +77 -0
  172. package/lib/crystal3d/viewer/renderElements.js.map +1 -0
  173. package/lib/crystal3d/viewer/renderStructure.d.ts +80 -0
  174. package/lib/crystal3d/viewer/renderStructure.d.ts.map +1 -0
  175. package/lib/crystal3d/viewer/renderStructure.js +143 -0
  176. package/lib/crystal3d/viewer/renderStructure.js.map +1 -0
  177. package/lib/crystal3d/viewer/sceneParts.d.ts +32 -0
  178. package/lib/crystal3d/viewer/sceneParts.d.ts.map +1 -0
  179. package/lib/crystal3d/viewer/sceneParts.js +77 -0
  180. package/lib/crystal3d/viewer/sceneParts.js.map +1 -0
  181. package/lib/crystal3d/viewer/shapeLayer.d.ts +41 -0
  182. package/lib/crystal3d/viewer/shapeLayer.d.ts.map +1 -0
  183. package/lib/crystal3d/viewer/shapeLayer.js +57 -0
  184. package/lib/crystal3d/viewer/shapeLayer.js.map +1 -0
  185. package/lib/crystal3d/viewer/textLayer.d.ts +21 -0
  186. package/lib/crystal3d/viewer/textLayer.d.ts.map +1 -0
  187. package/lib/crystal3d/viewer/textLayer.js +59 -0
  188. package/lib/crystal3d/viewer/textLayer.js.map +1 -0
  189. package/lib/crystal3d/viewer/viewer.d.ts +119 -0
  190. package/lib/crystal3d/viewer/viewer.d.ts.map +1 -0
  191. package/lib/crystal3d/viewer/viewer.js +172 -0
  192. package/lib/crystal3d/viewer/viewer.js.map +1 -0
  193. package/lib/crystal3d.d.ts +12 -0
  194. package/lib/crystal3d.d.ts.map +1 -0
  195. package/lib/crystal3d.js +12 -0
  196. package/lib/crystal3d.js.map +1 -0
  197. package/lib/download/core/croppedMarkup.d.ts.map +1 -1
  198. package/lib/download/core/croppedMarkup.js +16 -40
  199. package/lib/download/core/croppedMarkup.js.map +1 -1
  200. package/lib/download/core/dataUrl.d.ts +27 -0
  201. package/lib/download/core/dataUrl.d.ts.map +1 -0
  202. package/lib/download/core/dataUrl.js +54 -0
  203. package/lib/download/core/dataUrl.js.map +1 -0
  204. package/lib/download/core/index.d.ts +3 -0
  205. package/lib/download/core/index.d.ts.map +1 -1
  206. package/lib/download/core/index.js +2 -0
  207. package/lib/download/core/index.js.map +1 -1
  208. package/lib/download/core/svgMarkup.d.ts +39 -0
  209. package/lib/download/core/svgMarkup.d.ts.map +1 -0
  210. package/lib/download/core/svgMarkup.js +100 -0
  211. package/lib/download/core/svgMarkup.js.map +1 -0
  212. package/lib/drawing/ui/movingFigure.d.ts.map +1 -1
  213. package/lib/drawing/ui/movingFigure.js +4 -30
  214. package/lib/drawing/ui/movingFigure.js.map +1 -1
  215. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  216. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  217. package/lib/locales/de.json +26 -1
  218. package/lib/locales/en.json +26 -1
  219. package/lib/locales/es.json +26 -1
  220. package/lib/locales/fr.json +26 -1
  221. package/lib/locales/it.json +26 -1
  222. package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
  223. package/lib/molecule3d/ui/MoleculeCanvas3D.js +16 -27
  224. package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
  225. package/lib/molstar/bonds/bondRule.d.ts +16 -0
  226. package/lib/molstar/bonds/bondRule.d.ts.map +1 -0
  227. package/lib/molstar/bonds/bondRule.js +23 -0
  228. package/lib/molstar/bonds/bondRule.js.map +1 -0
  229. package/lib/molstar/bonds/index.d.ts +9 -0
  230. package/lib/molstar/bonds/index.d.ts.map +1 -0
  231. package/lib/molstar/bonds/index.js +9 -0
  232. package/lib/molstar/bonds/index.js.map +1 -0
  233. package/lib/molstar/ui/MolstarToolbar.d.ts +47 -0
  234. package/lib/molstar/ui/MolstarToolbar.d.ts.map +1 -0
  235. package/lib/molstar/ui/MolstarToolbar.js +28 -0
  236. package/lib/molstar/ui/MolstarToolbar.js.map +1 -0
  237. package/lib/molstar/ui/index.d.ts +10 -0
  238. package/lib/molstar/ui/index.d.ts.map +1 -0
  239. package/lib/molstar/ui/index.js +8 -0
  240. package/lib/molstar/ui/index.js.map +1 -0
  241. package/lib/molstar/ui/useMolstarTools.d.ts +63 -0
  242. package/lib/molstar/ui/useMolstarTools.d.ts.map +1 -0
  243. package/lib/molstar/ui/useMolstarTools.js +36 -0
  244. package/lib/molstar/ui/useMolstarTools.js.map +1 -0
  245. package/package.json +2 -1
  246. package/src/crystal/core/cellAtoms.ts +106 -0
  247. package/src/crystal/core/index.ts +2 -0
  248. package/src/crystal/core/molecules.ts +7 -44
  249. package/src/crystal3d/core/cellClip.ts +229 -0
  250. package/src/crystal3d/core/cellGeometry.ts +193 -0
  251. package/src/crystal3d/core/cellStack.ts +87 -0
  252. package/src/crystal3d/core/crystalView.ts +131 -0
  253. package/src/crystal3d/core/drawingSet.ts +71 -0
  254. package/src/crystal3d/core/elementDrawing.ts +147 -0
  255. package/src/crystal3d/core/elementExtent.ts +81 -0
  256. package/src/crystal3d/core/elementLabels.ts +130 -0
  257. package/src/crystal3d/core/elementShapes.ts +141 -0
  258. package/src/crystal3d/core/frame.ts +56 -0
  259. package/src/crystal3d/core/framing.ts +101 -0
  260. package/src/crystal3d/core/index.ts +134 -0
  261. package/src/crystal3d/core/labelText.ts +44 -0
  262. package/src/crystal3d/core/latticeBasis.ts +110 -0
  263. package/src/crystal3d/core/mat3.ts +163 -0
  264. package/src/crystal3d/core/operationMatrix.ts +255 -0
  265. package/src/crystal3d/core/orientation.ts +229 -0
  266. package/src/crystal3d/core/palette.ts +43 -0
  267. package/src/crystal3d/core/primitives.ts +183 -0
  268. package/src/crystal3d/core/structureText.ts +43 -0
  269. package/src/crystal3d/core/supercell.ts +40 -0
  270. package/src/crystal3d/core/types.ts +186 -0
  271. package/src/crystal3d/core/vec3.ts +127 -0
  272. package/src/crystal3d/ui/CrystalCanvas3D.tsx +393 -0
  273. package/src/crystal3d/ui/CrystalStructureView.tsx +153 -0
  274. package/src/crystal3d/ui/CrystalStructureViewer.tsx +39 -0
  275. package/src/crystal3d/ui/CrystalViewControls.tsx +129 -0
  276. package/src/crystal3d/ui/CrystalViewer3D.tsx +183 -0
  277. package/src/crystal3d/ui/crystalScene.ts +106 -0
  278. package/src/crystal3d/ui/crystalStructureViewerProps.ts +54 -0
  279. package/src/crystal3d/ui/index.ts +20 -0
  280. package/src/crystal3d/ui/useCrystalCaption.ts +38 -0
  281. package/src/crystal3d/viewer/animate.ts +113 -0
  282. package/src/crystal3d/viewer/camera.ts +139 -0
  283. package/src/crystal3d/viewer/index.ts +13 -0
  284. package/src/crystal3d/viewer/layerRegistry.ts +47 -0
  285. package/src/crystal3d/viewer/meshPrimitives.ts +102 -0
  286. package/src/crystal3d/viewer/plugin.ts +258 -0
  287. package/src/crystal3d/viewer/renderCell.ts +98 -0
  288. package/src/crystal3d/viewer/renderElements.ts +121 -0
  289. package/src/crystal3d/viewer/renderStructure.ts +209 -0
  290. package/src/crystal3d/viewer/sceneParts.ts +119 -0
  291. package/src/crystal3d/viewer/shapeLayer.ts +108 -0
  292. package/src/crystal3d/viewer/textLayer.ts +85 -0
  293. package/src/crystal3d/viewer/viewer.ts +223 -0
  294. package/src/crystal3d.ts +12 -0
  295. package/src/download/core/croppedMarkup.ts +16 -42
  296. package/src/download/core/dataUrl.ts +59 -0
  297. package/src/download/core/index.ts +3 -0
  298. package/src/download/core/svgMarkup.ts +113 -0
  299. package/src/drawing/ui/movingFigure.ts +4 -28
  300. package/src/locales/de.json +26 -1
  301. package/src/locales/en.json +26 -1
  302. package/src/locales/es.json +26 -1
  303. package/src/locales/fr.json +26 -1
  304. package/src/locales/it.json +26 -1
  305. package/src/molecule3d/ui/MoleculeCanvas3D.tsx +45 -71
  306. package/src/molstar/bonds/bondRule.ts +34 -0
  307. package/src/molstar/bonds/index.ts +9 -0
  308. package/src/molstar/ui/MolstarToolbar.tsx +103 -0
  309. package/src/molstar/ui/index.ts +14 -0
  310. package/src/molstar/ui/useMolstarTools.ts +98 -0
  311. package/styles/chrome.css +90 -0
@@ -1085,5 +1085,30 @@
1085
1085
  "send.label": "Send to",
1086
1086
  "send.heading": "Send {what} to",
1087
1087
  "send.none": "Nothing on this page can be sent to another tool yet.",
1088
- "send.blocked": "The browser blocked the new tab: allow pop-ups for this site, then send again."
1088
+ "send.blocked": "The browser blocked the new tab: allow pop-ups for this site, then send again.",
1089
+ "crystal3d.draw": "Draw",
1090
+ "crystal3d.cells": "Cells",
1091
+ "crystal3d.packing.molecules": "Whole molecules",
1092
+ "crystal3d.packing.moleculesHelp": "Each molecule whole, in the cell its centre falls in.",
1093
+ "crystal3d.packing.cell": "Atoms in the cell",
1094
+ "crystal3d.packing.cellHelp": "Every atom inside the cell, cut where its walls cut it.",
1095
+ "crystal3d.unitCell": "Unit cell",
1096
+ "crystal3d.unitCellHelp": "The box of the unit cell.",
1097
+ "crystal3d.bonds": "Bonds",
1098
+ "crystal3d.bonds.all": "All",
1099
+ "crystal3d.bonds.allHelp": "Every bond between atoms close enough to be joined.",
1100
+ "crystal3d.bonds.noMetal": "No metal bonds",
1101
+ "crystal3d.bonds.noMetalHelp": "The dashed bonds to metal atoms are hidden.",
1102
+ "crystal3d.bonds.none": "None",
1103
+ "crystal3d.bonds.noneHelp": "The atoms alone, without any bond.",
1104
+ "crystal3d.caption.molecules.one": "1 molecule per cell",
1105
+ "crystal3d.caption.molecules.other": "{count} molecules per cell",
1106
+ "crystal3d.caption.atoms.one": "1 atom per cell",
1107
+ "crystal3d.caption.atoms.other": "{count} atoms per cell",
1108
+ "crystal3d.caption.cells.one": "1×1×1 cell",
1109
+ "crystal3d.caption.cells.other": "{count}×{count}×{count} cells",
1110
+ "crystal3d.caption.cellsCapped": "{count}×{count}×{count} cells, as {asked}×{asked}×{asked} would hold too many atoms",
1111
+ "crystal3d.unreadable": "That file could not be read",
1112
+ "crystal3d.tooLarge": "This cell holds {count} atoms, more than the viewer draws.",
1113
+ "crystal3d.unsupported": "No 3D on this machine"
1089
1114
  }
@@ -1085,5 +1085,30 @@
1085
1085
  "send.label": "Enviar a",
1086
1086
  "send.heading": "Enviar {what} a",
1087
1087
  "send.none": "Nada de esta página puede enviarse todavía a otra herramienta.",
1088
- "send.blocked": "El navegador bloqueó la nueva pestaña: permita las ventanas emergentes para este sitio y vuelva a enviar."
1088
+ "send.blocked": "El navegador bloqueó la nueva pestaña: permita las ventanas emergentes para este sitio y vuelva a enviar.",
1089
+ "crystal3d.draw": "Dibujar",
1090
+ "crystal3d.cells": "Celdas",
1091
+ "crystal3d.packing.molecules": "Moléculas enteras",
1092
+ "crystal3d.packing.moleculesHelp": "Cada molécula entera, en la celda donde cae su centro.",
1093
+ "crystal3d.packing.cell": "Átomos de la celda",
1094
+ "crystal3d.packing.cellHelp": "Cada átomo dentro de la celda, cortado donde lo cortan sus caras.",
1095
+ "crystal3d.unitCell": "Celda unidad",
1096
+ "crystal3d.unitCellHelp": "El contorno de la celda unidad.",
1097
+ "crystal3d.bonds": "Enlaces",
1098
+ "crystal3d.bonds.all": "Todos",
1099
+ "crystal3d.bonds.allHelp": "Cada enlace entre átomos lo bastante cercanos para unirse.",
1100
+ "crystal3d.bonds.noMetal": "Sin enlaces metálicos",
1101
+ "crystal3d.bonds.noMetalHelp": "Se ocultan los enlaces discontinuos hacia los átomos metálicos.",
1102
+ "crystal3d.bonds.none": "Ninguno",
1103
+ "crystal3d.bonds.noneHelp": "Solo los átomos, sin ningún enlace.",
1104
+ "crystal3d.caption.molecules.one": "1 molécula por celda",
1105
+ "crystal3d.caption.molecules.other": "{count} moléculas por celda",
1106
+ "crystal3d.caption.atoms.one": "1 átomo por celda",
1107
+ "crystal3d.caption.atoms.other": "{count} átomos por celda",
1108
+ "crystal3d.caption.cells.one": "1×1×1 celda",
1109
+ "crystal3d.caption.cells.other": "{count}×{count}×{count} celdas",
1110
+ "crystal3d.caption.cellsCapped": "{count}×{count}×{count} celdas, ya que {asked}×{asked}×{asked} contendrían demasiados átomos",
1111
+ "crystal3d.unreadable": "Ese archivo no se ha podido leer",
1112
+ "crystal3d.tooLarge": "Esta celda contiene {count} átomos, más de los que dibuja el visor.",
1113
+ "crystal3d.unsupported": "Sin 3D en este equipo"
1089
1114
  }
@@ -1085,5 +1085,30 @@
1085
1085
  "send.label": "Envoyer vers",
1086
1086
  "send.heading": "Envoyer {what} vers",
1087
1087
  "send.none": "Rien sur cette page ne peut encore être envoyé à un autre outil.",
1088
- "send.blocked": "Le navigateur a bloqué le nouvel onglet : autorisez les fenêtres pour ce site, puis envoyez à nouveau."
1088
+ "send.blocked": "Le navigateur a bloqué le nouvel onglet : autorisez les fenêtres pour ce site, puis envoyez à nouveau.",
1089
+ "crystal3d.draw": "Dessiner",
1090
+ "crystal3d.cells": "Mailles",
1091
+ "crystal3d.packing.molecules": "Molécules entières",
1092
+ "crystal3d.packing.moleculesHelp": "Chaque molécule entière, dans la maille où tombe son centre.",
1093
+ "crystal3d.packing.cell": "Atomes de la maille",
1094
+ "crystal3d.packing.cellHelp": "Chaque atome à l'intérieur de la maille, coupé là où ses faces le coupent.",
1095
+ "crystal3d.unitCell": "Maille",
1096
+ "crystal3d.unitCellHelp": "Le contour de la maille élémentaire.",
1097
+ "crystal3d.bonds": "Liaisons",
1098
+ "crystal3d.bonds.all": "Toutes",
1099
+ "crystal3d.bonds.allHelp": "Chaque liaison entre atomes assez proches pour être liés.",
1100
+ "crystal3d.bonds.noMetal": "Sans liaisons au métal",
1101
+ "crystal3d.bonds.noMetalHelp": "Les liaisons en pointillé vers les atomes métalliques sont masquées.",
1102
+ "crystal3d.bonds.none": "Aucune",
1103
+ "crystal3d.bonds.noneHelp": "Les atomes seuls, sans aucune liaison.",
1104
+ "crystal3d.caption.molecules.one": "1 molécule par maille",
1105
+ "crystal3d.caption.molecules.other": "{count} molécules par maille",
1106
+ "crystal3d.caption.atoms.one": "1 atome par maille",
1107
+ "crystal3d.caption.atoms.other": "{count} atomes par maille",
1108
+ "crystal3d.caption.cells.one": "1×1×1 maille",
1109
+ "crystal3d.caption.cells.other": "{count}×{count}×{count} mailles",
1110
+ "crystal3d.caption.cellsCapped": "{count}×{count}×{count} mailles, car {asked}×{asked}×{asked} contiendraient trop d'atomes",
1111
+ "crystal3d.unreadable": "Ce fichier n'a pas pu être lu",
1112
+ "crystal3d.tooLarge": "Cette maille contient {count} atomes, plus que la visionneuse n'en dessine.",
1113
+ "crystal3d.unsupported": "Pas de 3D sur cette machine"
1089
1114
  }
@@ -1085,5 +1085,30 @@
1085
1085
  "send.label": "Invia a",
1086
1086
  "send.heading": "Invia {what} a",
1087
1087
  "send.none": "Nulla di questa pagina può ancora essere inviato a un altro strumento.",
1088
- "send.blocked": "Il browser ha bloccato la nuova scheda: consenti i pop-up per questo sito, poi invia di nuovo."
1088
+ "send.blocked": "Il browser ha bloccato la nuova scheda: consenti i pop-up per questo sito, poi invia di nuovo.",
1089
+ "crystal3d.draw": "Disegna",
1090
+ "crystal3d.cells": "Celle",
1091
+ "crystal3d.packing.molecules": "Molecole intere",
1092
+ "crystal3d.packing.moleculesHelp": "Ogni molecola intera, nella cella in cui cade il suo centro.",
1093
+ "crystal3d.packing.cell": "Atomi della cella",
1094
+ "crystal3d.packing.cellHelp": "Ogni atomo dentro la cella, tagliato dove lo tagliano le sue pareti.",
1095
+ "crystal3d.unitCell": "Cella elementare",
1096
+ "crystal3d.unitCellHelp": "Il contorno della cella elementare.",
1097
+ "crystal3d.bonds": "Legami",
1098
+ "crystal3d.bonds.all": "Tutti",
1099
+ "crystal3d.bonds.allHelp": "Ogni legame tra atomi abbastanza vicini da unirsi.",
1100
+ "crystal3d.bonds.noMetal": "Senza legami metallici",
1101
+ "crystal3d.bonds.noMetalHelp": "I legami tratteggiati verso gli atomi metallici sono nascosti.",
1102
+ "crystal3d.bonds.none": "Nessuno",
1103
+ "crystal3d.bonds.noneHelp": "Solo gli atomi, senza alcun legame.",
1104
+ "crystal3d.caption.molecules.one": "1 molecola per cella",
1105
+ "crystal3d.caption.molecules.other": "{count} molecole per cella",
1106
+ "crystal3d.caption.atoms.one": "1 atomo per cella",
1107
+ "crystal3d.caption.atoms.other": "{count} atomi per cella",
1108
+ "crystal3d.caption.cells.one": "1×1×1 cella",
1109
+ "crystal3d.caption.cells.other": "{count}×{count}×{count} celle",
1110
+ "crystal3d.caption.cellsCapped": "{count}×{count}×{count} celle, perché {asked}×{asked}×{asked} conterrebbero troppi atomi",
1111
+ "crystal3d.unreadable": "Non è stato possibile leggere quel file",
1112
+ "crystal3d.tooLarge": "Questa cella contiene {count} atomi, più di quanti il visualizzatore ne disegni.",
1113
+ "crystal3d.unsupported": "Niente 3D su questo computer"
1089
1114
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MoleculeCanvas3D.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/ui/MoleculeCanvas3D.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAmBzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAYxE,yCAAyC;AACzC,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,qBAAqB,EACrB,UAAU,GAAG,mBAAmB,CACjC;IACC,2EAA2E;IAC3E,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CAsK3E"}
1
+ {"version":3,"file":"MoleculeCanvas3D.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/ui/MoleculeCanvas3D.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAkBzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAYxE,yCAAyC;AACzC,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,qBAAqB,EACrB,UAAU,GAAG,mBAAmB,CACjC;IACC,2EAA2E;IAC3E,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CAyJ3E"}
@@ -2,12 +2,12 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { useEffect, useState } from 'react';
3
3
  import { useChromeT } from "../../i18n/ui/useT.js";
4
4
  import { DEFAULT_SPIN_SPEED } from "../../molstar/core/index.js";
5
+ import { MolstarToolbar } from "../../molstar/ui/MolstarToolbar.js";
6
+ import { useMolstarTools } from "../../molstar/ui/useMolstarTools.js";
5
7
  import { DEFAULT_FRAMES_PER_SECOND } from "../core/animatedPng.js";
6
8
  import { normalizeMolecule3DSettings, resolveMolecule3DTools, } from "../core/settings.js";
7
- import { Molecule3DExport } from "./Molecule3DExport.js";
8
9
  import { Molecule3DOptions } from "./Molecule3DOptions.js";
9
10
  import { Molecule3DStage } from "./Molecule3DStage.js";
10
- import { Molecule3DToolbar } from "./Molecule3DToolbar.js";
11
11
  import { highlightColorOf } from "./highlightColor.js";
12
12
  import { moleculeFileAtoms } from "./moleculeFileFormats.js";
13
13
  import { useAtomHover } from "./useAtomHover.js";
@@ -28,9 +28,7 @@ export function MoleculeCanvas3D(props) {
28
28
  const tools = resolveMolecule3DTools(toolsProp);
29
29
  const [initialSettings] = useState(() => normalizeMolecule3DSettings(defaultSettings));
30
30
  const [settings, setSettings] = useControlledState(settingsProp, initialSettings, onSettingsChange);
31
- const [spinning, setSpinning] = useControlledState(spinningProp, defaultSpinning, onSpinningChange);
32
31
  const { measurements, add: addMeasurement, remove: removeMeasurement, clear: clearMeasurements, } = useMeasurementList(measurementsProp, onMeasurementsChange);
33
- const [measureKind, setMeasureKind] = useState(null);
34
32
  const [frameCount, setFrameCount] = useState(0);
35
33
  const polarSurfaceArea = usePolarSurfaceArea(molfile, settings.surfaceColoring === 'polarity');
36
34
  // A callback ref: the element arriving is what creates the viewer, and every
@@ -42,15 +40,16 @@ export function MoleculeCanvas3D(props) {
42
40
  onFrameCountChange: setFrameCount,
43
41
  });
44
42
  useMeasurementRemoval(container, viewerRef, tools.measure && molfile !== null ? removeMeasurement : undefined);
45
- useEffect(() => {
46
- void viewerRef.current?.setSpin(spinning, spinSpeed);
47
- }, [container, viewerRef, spinning, spinSpeed]);
43
+ const controls = useMolstarTools(viewerRef, container, {
44
+ spinning: spinningProp,
45
+ defaultSpinning,
46
+ onSpinningChange,
47
+ spinSpeed,
48
+ });
49
+ const { spinning } = controls;
48
50
  useEffect(() => {
49
51
  void viewerRef.current?.frames.play(playing, framesPerSecond);
50
52
  }, [container, viewerRef, playing, framesPerSecond]);
51
- useEffect(() => {
52
- void viewerRef.current?.setMeasureKind(measureKind);
53
- }, [container, viewerRef, measureKind]);
54
53
  // Kept out of the scene: a new highlight repaints the model, never redraws it.
55
54
  useEffect(() => {
56
55
  void viewerRef.current?.setHighlights(highlights, highlightColorOf(container));
@@ -67,7 +66,8 @@ export function MoleculeCanvas3D(props) {
67
66
  onFailureChange,
68
67
  camera: props,
69
68
  });
70
- const { canvasSize, exportImage, imageFile, copyImage, capture } = useImageExport(container, viewerRef, fileName, framesPerSecond);
69
+ const imageExport = useImageExport(container, viewerRef, fileName, framesPerSecond);
70
+ const { capture } = imageExport;
71
71
  useEffect(() => {
72
72
  if (onCapture === undefined || container === null)
73
73
  return;
@@ -76,11 +76,11 @@ export function MoleculeCanvas3D(props) {
76
76
  onCapture(null);
77
77
  };
78
78
  }, [onCapture, container, capture]);
79
- return (_jsx(Molecule3DStage, { style: { ...STAGE_STYLE, minHeight }, children: (fullscreen) => (_jsxs(_Fragment, { children: [_jsx("div", { ref: setContainer, style: CANVAS_STYLE, "data-testid": "molecule3d" }), molfile !== null && (_jsx("div", { style: OVERLAY_STYLE, children: _jsx(Molecule3DToolbar, { tools: tools, fullscreen: fullscreen, measureKind: measureKind, onMeasureKindChange: setMeasureKind, measurementCount: measurements.length, onClearMeasurements: clearMeasurements, spinning: spinning, onSpinningChange: setSpinning, showSurface: settings.showSurface, onShowSurfaceChange: (showSurface) => {
80
- setSettings({ ...settings, showSurface });
81
- }, onResetView: resetView, options: _jsx(Molecule3DOptions, { settings: settings, onChange: setSettings, polarSurfaceArea: polarSurfaceArea, defaults: initialSettings }), exportLabel: moleculeFileAtoms(molfile, frameCount) > 0
82
- ? t('molecule3d.exportImageOrMolfile')
83
- : undefined, exportPanel: _jsx(Molecule3DExport, { getSize: canvasSize, onExport: exportImage, onCopy: copyImage, writeFile: imageFile, frameCount: frameCount, molfile: molfile, fileName: fileName }) }) }))] })) }));
79
+ return (_jsx(Molecule3DStage, { style: { ...STAGE_STYLE, minHeight }, children: (fullscreen) => (_jsxs(_Fragment, { children: [_jsx("div", { ref: setContainer, style: CANVAS_STYLE, "data-testid": "molecule3d" }), molfile !== null && (_jsx(MolstarToolbar, { controls: controls, tools: tools, fullscreen: fullscreen, measurementCount: measurements.length, onClearMeasurements: clearMeasurements, showSurface: settings.showSurface, onShowSurfaceChange: (showSurface) => {
80
+ setSettings({ ...settings, showSurface });
81
+ }, onResetView: resetView, options: _jsx(Molecule3DOptions, { settings: settings, onChange: setSettings, polarSurfaceArea: polarSurfaceArea, defaults: initialSettings }), exportLabel: moleculeFileAtoms(molfile, frameCount) > 0
82
+ ? t('molecule3d.exportImageOrMolfile')
83
+ : undefined, imageExport: imageExport, frameCount: frameCount, molfile: molfile, fileName: fileName }))] })) }));
84
84
  }
85
85
  const NO_HIGHLIGHTS = [];
86
86
  const STAGE_STYLE = {
@@ -92,15 +92,4 @@ const STAGE_STYLE = {
92
92
  };
93
93
  /** molstar inserts its canvas here, which therefore has a size of its own. */
94
94
  const CANVAS_STYLE = { position: 'absolute', inset: 0 };
95
- const OVERLAY_STYLE = {
96
- position: 'absolute',
97
- top: 8,
98
- bottom: 8,
99
- left: 8,
100
- zIndex: 2,
101
- display: 'flex',
102
- alignItems: 'flex-start',
103
- gap: 8,
104
- pointerEvents: 'none',
105
- };
106
95
  //# sourceMappingURL=MoleculeCanvas3D.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MoleculeCanvas3D.js","sourceRoot":"","sources":["../../../src/molecule3d/ui/MoleculeCanvas3D.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,C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E,eAAe,GACzB,EAEJ,WAAW,EACT,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC;wBACxC,CAAC,CAAC,CAAC,CAAC,iCAAiC,CAAC;wBACtC,CAAC,CAAC,SAAS,EAEf,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,GAClB,CACH,IACA,CACJ,GACe,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,aAAa,GAAmC,EAAE,CAAC;AAEzD,MAAM,WAAW,GAAkB;IACjC,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,MAAM;IACb,YAAY,EAAE,CAAC;IACf,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,YAAY,GAAkB,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The longest bond molstar draws between two elements.
3
+ *
4
+ * Molecules are completed across the cell walls by this rule, so what the
5
+ * viewer draws as one molecule is exactly what the packing kept together. It
6
+ * is one molstar module with no imports of its own, so a page reading it pays
7
+ * for a table of thresholds, not for the 2.8 MB viewer.
8
+ */
9
+ /**
10
+ * The longest distance at which molstar bonds two atoms.
11
+ * @param a - One element symbol, e.g. `C`.
12
+ * @param b - The other.
13
+ * @returns The distance in ångström, or 0 for a pair it never bonds (H–H).
14
+ */
15
+ export declare function bondLimit(a: string, b: string): number;
16
+ //# sourceMappingURL=bondRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bondRule.d.ts","sourceRoot":"","sources":["../../../src/molstar/bonds/bondRule.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAUtD"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The longest bond molstar draws between two elements.
3
+ *
4
+ * Molecules are completed across the cell walls by this rule, so what the
5
+ * viewer draws as one molecule is exactly what the packing kept together. It
6
+ * is one molstar module with no imports of its own, so a page reading it pays
7
+ * for a table of thresholds, not for the 2.8 MB viewer.
8
+ */
9
+ import { getElementIdx, getElementThreshold, getPairingThreshold, isHydrogen, } from 'molstar/lib/mol-model/structure/structure/unit/bonds/common.js';
10
+ /**
11
+ * The longest distance at which molstar bonds two atoms.
12
+ * @param a - One element symbol, e.g. `C`.
13
+ * @param b - The other.
14
+ * @returns The distance in ångström, or 0 for a pair it never bonds (H–H).
15
+ */
16
+ export function bondLimit(a, b) {
17
+ const first = getElementIdx(a);
18
+ const second = getElementIdx(b);
19
+ if (isHydrogen(first) && isHydrogen(second))
20
+ return 0;
21
+ return getPairingThreshold(first, second, getElementThreshold(first), getElementThreshold(second));
22
+ }
23
+ //# sourceMappingURL=bondRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bondRule.js","sourceRoot":"","sources":["../../../src/molstar/bonds/bondRule.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,GACX,MAAM,gEAAgE,CAAC;AAExE;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS,EAAE,CAAS;IAC5C,MAAM,KAAK,GAAG,aAAa,CAAC,CAAkB,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,aAAa,CAAC,CAAkB,CAAC,CAAC;IACjD,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,CAAC,CAAC;IACtD,OAAO,mBAAmB,CACxB,KAAK,EACL,MAAM,EACN,mBAAmB,CAAC,KAAK,CAAC,EAC1B,mBAAmB,CAAC,MAAM,CAAC,CAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The longest bond molstar draws between two elements.
3
+ *
4
+ * Its own path because it is one small molstar module: a page that fills a
5
+ * crystal's cell before the viewer has loaded completes its molecules by the
6
+ * rule the viewer will join them by, without downloading the viewer.
7
+ */
8
+ export { bondLimit } from './bondRule.ts';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molstar/bonds/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The longest bond molstar draws between two elements.
3
+ *
4
+ * Its own path because it is one small molstar module: a page that fills a
5
+ * crystal's cell before the viewer has loaded completes its molecules by the
6
+ * rule the viewer will join them by, without downloading the viewer.
7
+ */
8
+ export { bondLimit } from "./bondRule.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molstar/bonds/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The toolbars every 3D view of the family floats over its canvas: reset,
3
+ * spin, export, full screen and help, then the measuring tools.
4
+ *
5
+ * It is `Molecule3DToolbar` placed in the top-left corner of the stage and fed
6
+ * from `useMolstarTools` and `useImageExport`, so a site drawing its own
7
+ * scene — orbitals, a crystal — gets the controls `<MoleculeViewer3D>` has
8
+ * without wiring them a second time.
9
+ */
10
+ import type { ReactElement } from 'react';
11
+ import type { Molecule3DFile } from '../../molecule3d/core/file.ts';
12
+ import type { Molecule3DToolbarProps } from '../../molecule3d/ui/Molecule3DToolbar.tsx';
13
+ import type { ImageExport } from '../../molecule3d/ui/useImageExport.ts';
14
+ import type { MolstarTools } from './useMolstarTools.ts';
15
+ /** Props of {@link MolstarToolbar}. */
16
+ export interface MolstarToolbarProps extends Omit<Molecule3DToolbarProps, 'measureKind' | 'onMeasureKindChange' | 'spinning' | 'onSpinningChange' | 'exportPanel'> {
17
+ /** The state `useMolstarTools` keeps. */
18
+ controls: MolstarTools;
19
+ /**
20
+ * The pictures the export tool saves and copies; the tool is left out
21
+ * without them.
22
+ * @default undefined
23
+ */
24
+ imageExport?: ImageExport;
25
+ /**
26
+ * Base name of what the export tool saves, extension excluded.
27
+ * @default 'molecule'
28
+ */
29
+ fileName?: string;
30
+ /**
31
+ * The file on screen, offered beside the pictures; say so in `exportLabel`.
32
+ * @default undefined — only pictures are offered
33
+ */
34
+ molfile?: Molecule3DFile | null;
35
+ /**
36
+ * How many frames the scene holds. Above one, a PNG may hold them all.
37
+ * @default 1
38
+ */
39
+ frameCount?: number;
40
+ }
41
+ /**
42
+ * The toolbars, in the top-left corner of a positioned stage.
43
+ * @param props - See {@link MolstarToolbarProps}.
44
+ * @returns The toolbars.
45
+ */
46
+ export declare function MolstarToolbar(props: MolstarToolbarProps): ReactElement;
47
+ //# sourceMappingURL=MolstarToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MolstarToolbar.d.ts","sourceRoot":"","sources":["../../../src/molstar/ui/MolstarToolbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAExF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,uCAAuC;AACvC,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,sBAAsB,EACpB,aAAa,GACb,qBAAqB,GACrB,UAAU,GACV,kBAAkB,GAClB,aAAa,CAChB;IACC,yCAAyC;IACzC,QAAQ,EAAE,YAAY,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CA2BvE"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Molecule3DExport } from "../../molecule3d/ui/Molecule3DExport.js";
3
+ import { Molecule3DToolbar } from "../../molecule3d/ui/Molecule3DToolbar.js";
4
+ /**
5
+ * The toolbars, in the top-left corner of a positioned stage.
6
+ * @param props - See {@link MolstarToolbarProps}.
7
+ * @returns The toolbars.
8
+ */
9
+ export function MolstarToolbar(props) {
10
+ const { controls, imageExport, fileName, molfile, frameCount, ...toolbar } = props;
11
+ return (_jsx("div", { style: OVERLAY_STYLE, children: _jsx(Molecule3DToolbar, { ...toolbar, measureKind: controls.measureKind, onMeasureKindChange: controls.setMeasureKind, spinning: controls.spinning, onSpinningChange: controls.setSpinning, exportPanel: imageExport === undefined ? undefined : (_jsx(Molecule3DExport, { getSize: imageExport.canvasSize, onExport: imageExport.exportImage, onCopy: imageExport.copyImage, writeFile: imageExport.imageFile, frameCount: frameCount, molfile: molfile, fileName: fileName })) }) }));
12
+ }
13
+ /**
14
+ * `pointerEvents` is off here and back on inside the toolbars, so the empty
15
+ * column beside them does not swallow a drag of the scene.
16
+ */
17
+ const OVERLAY_STYLE = {
18
+ position: 'absolute',
19
+ top: 8,
20
+ bottom: 8,
21
+ left: 8,
22
+ zIndex: 2,
23
+ display: 'flex',
24
+ alignItems: 'flex-start',
25
+ gap: 8,
26
+ pointerEvents: 'none',
27
+ };
28
+ //# sourceMappingUR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EAAE,MAAM;CACtB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The controls of a molstar canvas, for a site drawing a scene of its own:
3
+ * the toolbars `<MoleculeViewer3D>` floats over its canvas, and the state they
4
+ * keep on the viewer.
5
+ */
6
+ export type { MolstarToolbarProps } from './MolstarToolbar.tsx';
7
+ export { MolstarToolbar } from './MolstarToolbar.tsx';
8
+ export type { MolstarTools, MolstarToolsOptions, MolstarToolsViewer, } from './useMolstarTools.ts';
9
+ export { useMolstarTools } from './useMolstarTools.ts';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molstar/ui/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The controls of a molstar canvas, for a site drawing a scene of its own:
3
+ * the toolbars `<MoleculeViewer3D>` floats over its canvas, and the state they
4
+ * keep on the viewer.
5
+ */
6
+ export { MolstarToolbar } from "./MolstarToolbar.js";
7
+ export { useMolstarTools } from "./useMolstarTools.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molstar/ui/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAC;AAMtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * What the toolbar over a molstar canvas changes on the viewer: whether the
3
+ * scene turns, and what a click on an atom measures.
4
+ *
5
+ * Every 3D view of the family keeps its own viewer class — a molecule, its
6
+ * orbitals, a crystal — but all of them turn and measure the same way, so the
7
+ * state and the two effects that hand it to the viewer are written once here.
8
+ */
9
+ import type { RefObject } from 'react';
10
+ import type { MeasurementKind } from '../../molecule3d/core/measurement.ts';
11
+ /** What a viewer offers the toolbar; each method resolves once it is done. */
12
+ export interface MolstarToolsViewer {
13
+ /** Turn the automatic spin on or off, at `speed`. */
14
+ setSpin: (spinning: boolean, speed?: number) => Promise<void>;
15
+ /** Make clicks on atoms build this measurement, or give them back. */
16
+ setMeasureKind: (kind: MeasurementKind | null) => Promise<void>;
17
+ }
18
+ /** Options of {@link useMolstarTools}. */
19
+ export interface MolstarToolsOptions {
20
+ /**
21
+ * Whether the scene turns, when the parent owns it.
22
+ * @default undefined
23
+ */
24
+ spinning?: boolean;
25
+ /**
26
+ * Whether the scene turns at first, when the toolbar owns it.
27
+ * @default false
28
+ */
29
+ defaultSpinning?: boolean;
30
+ /**
31
+ * Called with every change of the spin.
32
+ * @default undefined
33
+ */
34
+ onSpinningChange?: (spinning: boolean) => void;
35
+ /**
36
+ * Turn rate, in molstar's own spin unit.
37
+ * @default DEFAULT_SPIN_SPEED
38
+ */
39
+ spinSpeed?: number;
40
+ }
41
+ /** The toolbar's state, and its setters. */
42
+ export interface MolstarTools {
43
+ /** The measurement a click on an atom builds, or `null`. */
44
+ measureKind: MeasurementKind | null;
45
+ setMeasureKind: (kind: MeasurementKind | null) => void;
46
+ /** Whether the scene turns. */
47
+ spinning: boolean;
48
+ setSpinning: (spinning: boolean) => void;
49
+ }
50
+ /**
51
+ * Keep the viewer turning and measuring as the toolbar says.
52
+ *
53
+ * Call it after the viewer is created, in the same component: effects run in
54
+ * the order they are declared, so a viewer created by an earlier effect is
55
+ * there when these run.
56
+ * @param viewerRef - The viewer, `null` while there is none.
57
+ * @param container - The element the viewer draws in; a new one is a new
58
+ * viewer, which is handed the state again.
59
+ * @param options - See {@link MolstarToolsOptions}.
60
+ * @returns See {@link MolstarTools}.
61
+ */
62
+ export declare function useMolstarTools(viewerRef: RefObject<MolstarToolsViewer | null>, container: HTMLElement | null, options?: MolstarToolsOptions): MolstarTools;
63
+ //# sourceMappingURL=useMolstarTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMolstarTools.d.ts","sourceRoot":"","sources":["../../../src/molstar/ui/useMolstarTools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAI5E,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,sEAAsE;IACtE,cAAc,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,cAAc,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,+BAA+B;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAAC,EAC/C,SAAS,EAAE,WAAW,GAAG,IAAI,EAC7B,OAAO,GAAE,mBAAwB,GAChC,YAAY,CAuBd"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * What the toolbar over a molstar canvas changes on the viewer: whether the
3
+ * scene turns, and what a click on an atom measures.
4
+ *
5
+ * Every 3D view of the family keeps its own viewer class — a molecule, its
6
+ * orbitals, a crystal — but all of them turn and measure the same way, so the
7
+ * state and the two effects that hand it to the viewer are written once here.
8
+ */
9
+ import { useEffect, useState } from 'react';
10
+ import { useControlledState } from "../../molecule3d/ui/useControlledState.js";
11
+ import { DEFAULT_SPIN_SPEED } from "../core/camera.js";
12
+ /**
13
+ * Keep the viewer turning and measuring as the toolbar says.
14
+ *
15
+ * Call it after the viewer is created, in the same component: effects run in
16
+ * the order they are declared, so a viewer created by an earlier effect is
17
+ * there when these run.
18
+ * @param viewerRef - The viewer, `null` while there is none.
19
+ * @param container - The element the viewer draws in; a new one is a new
20
+ * viewer, which is handed the state again.
21
+ * @param options - See {@link MolstarToolsOptions}.
22
+ * @returns See {@link MolstarTools}.
23
+ */
24
+ export function useMolstarTools(viewerRef, container, options = {}) {
25
+ const { spinning: spinningProp, defaultSpinning = false, onSpinningChange, spinSpeed = DEFAULT_SPIN_SPEED, } = options;
26
+ const [measureKind, setMeasureKind] = useState(null);
27
+ const [spinning, setSpinning] = useControlledState(spinningProp, defaultSpinning, onSpinningChange);
28
+ useEffect(() => {
29
+ void viewerRef.current?.setSpin(spinning, spinSpeed);
30
+ }, [viewerRef, container, spinning, spinSpeed]);
31
+ useEffect(() => {
32
+ void viewerRef.current?.setMeasureKind(measureKind);
33
+ }, [viewerRef, container, measureKind]);
34
+ return { measureKind, setMeasureKind, spinning, setSpinning };
35
+ }
36
+ //# sourceMappingURL=useMolstarTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMolstarTools.js","sourceRoot":"","sources":["../../../src/molstar/ui/useMolstarTools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA4CvD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAC7B,SAA+C,EAC/C,SAA6B,EAC7B,UAA+B,EAAE;IAEjC,MAAM,EACJ,QAAQ,EAAE,YAAY,EACtB,eAAe,GAAG,KAAK,EACvB,gBAAgB,EAChB,SAAS,GAAG,kBAAkB,GAC/B,GAAG,OAAO,CAAC;IACZ,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAyB,IAAI,CAAC,CAAC;IAC7E,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,kBAAkB,CAChD,YAAY,EACZ,eAAe,EACf,gBAAgB,CACjB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAExC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AAChE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-cheminfo",
3
- "version": "0.135.0",
3
+ "version": "0.137.0",
4
4
  "license": "MIT",
5
5
  "description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
6
6
  "author": "Luc Patiny",
@@ -21,6 +21,7 @@
21
21
  "./conformers": "./lib/conformers.js",
22
22
  "./core": "./lib/core.js",
23
23
  "./crystal": "./lib/crystal.js",
24
+ "./crystal3d": "./lib/crystal3d.js",
24
25
  "./demo": "./lib/demo.js",
25
26
  "./drawing": "./lib/drawing.js",
26
27
  "./formula": "./lib/formula.js",