react-cheminfo 0.135.0 → 0.136.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 (287) hide show
  1. package/lib/crystal/core/cellAtoms.d.ts +43 -0
  2. package/lib/crystal/core/cellAtoms.d.ts.map +1 -0
  3. package/lib/crystal/core/cellAtoms.js +70 -0
  4. package/lib/crystal/core/cellAtoms.js.map +1 -0
  5. package/lib/crystal/core/index.d.ts +2 -0
  6. package/lib/crystal/core/index.d.ts.map +1 -1
  7. package/lib/crystal/core/index.js +1 -0
  8. package/lib/crystal/core/index.js.map +1 -1
  9. package/lib/crystal/core/molecules.d.ts.map +1 -1
  10. package/lib/crystal/core/molecules.js +6 -40
  11. package/lib/crystal/core/molecules.js.map +1 -1
  12. package/lib/crystal3d/core/cellClip.d.ts +46 -0
  13. package/lib/crystal3d/core/cellClip.d.ts.map +1 -0
  14. package/lib/crystal3d/core/cellClip.js +198 -0
  15. package/lib/crystal3d/core/cellClip.js.map +1 -0
  16. package/lib/crystal3d/core/cellGeometry.d.ts +63 -0
  17. package/lib/crystal3d/core/cellGeometry.d.ts.map +1 -0
  18. package/lib/crystal3d/core/cellGeometry.js +153 -0
  19. package/lib/crystal3d/core/cellGeometry.js.map +1 -0
  20. package/lib/crystal3d/core/cellStack.d.ts +51 -0
  21. package/lib/crystal3d/core/cellStack.d.ts.map +1 -0
  22. package/lib/crystal3d/core/cellStack.js +79 -0
  23. package/lib/crystal3d/core/cellStack.js.map +1 -0
  24. package/lib/crystal3d/core/crystalView.d.ts +71 -0
  25. package/lib/crystal3d/core/crystalView.d.ts.map +1 -0
  26. package/lib/crystal3d/core/crystalView.js +48 -0
  27. package/lib/crystal3d/core/crystalView.js.map +1 -0
  28. package/lib/crystal3d/core/drawingSet.d.ts +31 -0
  29. package/lib/crystal3d/core/drawingSet.d.ts.map +1 -0
  30. package/lib/crystal3d/core/drawingSet.js +63 -0
  31. package/lib/crystal3d/core/drawingSet.js.map +1 -0
  32. package/lib/crystal3d/core/elementDrawing.d.ts +50 -0
  33. package/lib/crystal3d/core/elementDrawing.d.ts.map +1 -0
  34. package/lib/crystal3d/core/elementDrawing.js +100 -0
  35. package/lib/crystal3d/core/elementDrawing.js.map +1 -0
  36. package/lib/crystal3d/core/elementExtent.d.ts +42 -0
  37. package/lib/crystal3d/core/elementExtent.d.ts.map +1 -0
  38. package/lib/crystal3d/core/elementExtent.js +56 -0
  39. package/lib/crystal3d/core/elementExtent.js.map +1 -0
  40. package/lib/crystal3d/core/elementLabels.d.ts +31 -0
  41. package/lib/crystal3d/core/elementLabels.d.ts.map +1 -0
  42. package/lib/crystal3d/core/elementLabels.js +99 -0
  43. package/lib/crystal3d/core/elementLabels.js.map +1 -0
  44. package/lib/crystal3d/core/elementShapes.d.ts +43 -0
  45. package/lib/crystal3d/core/elementShapes.d.ts.map +1 -0
  46. package/lib/crystal3d/core/elementShapes.js +115 -0
  47. package/lib/crystal3d/core/elementShapes.js.map +1 -0
  48. package/lib/crystal3d/core/frame.d.ts +36 -0
  49. package/lib/crystal3d/core/frame.d.ts.map +1 -0
  50. package/lib/crystal3d/core/frame.js +35 -0
  51. package/lib/crystal3d/core/frame.js.map +1 -0
  52. package/lib/crystal3d/core/framing.d.ts +41 -0
  53. package/lib/crystal3d/core/framing.d.ts.map +1 -0
  54. package/lib/crystal3d/core/framing.js +79 -0
  55. package/lib/crystal3d/core/framing.js.map +1 -0
  56. package/lib/crystal3d/core/index.d.ts +42 -0
  57. package/lib/crystal3d/core/index.d.ts.map +1 -0
  58. package/lib/crystal3d/core/index.js +29 -0
  59. package/lib/crystal3d/core/index.js.map +1 -0
  60. package/lib/crystal3d/core/labelText.d.ts +19 -0
  61. package/lib/crystal3d/core/labelText.d.ts.map +1 -0
  62. package/lib/crystal3d/core/labelText.js +42 -0
  63. package/lib/crystal3d/core/labelText.js.map +1 -0
  64. package/lib/crystal3d/core/latticeBasis.d.ts +49 -0
  65. package/lib/crystal3d/core/latticeBasis.d.ts.map +1 -0
  66. package/lib/crystal3d/core/latticeBasis.js +89 -0
  67. package/lib/crystal3d/core/latticeBasis.js.map +1 -0
  68. package/lib/crystal3d/core/mat3.d.ts +68 -0
  69. package/lib/crystal3d/core/mat3.d.ts.map +1 -0
  70. package/lib/crystal3d/core/mat3.js +146 -0
  71. package/lib/crystal3d/core/mat3.js.map +1 -0
  72. package/lib/crystal3d/core/operationMatrix.d.ts +44 -0
  73. package/lib/crystal3d/core/operationMatrix.d.ts.map +1 -0
  74. package/lib/crystal3d/core/operationMatrix.js +172 -0
  75. package/lib/crystal3d/core/operationMatrix.js.map +1 -0
  76. package/lib/crystal3d/core/orientation.d.ts +62 -0
  77. package/lib/crystal3d/core/orientation.d.ts.map +1 -0
  78. package/lib/crystal3d/core/orientation.js +166 -0
  79. package/lib/crystal3d/core/orientation.js.map +1 -0
  80. package/lib/crystal3d/core/palette.d.ts +24 -0
  81. package/lib/crystal3d/core/palette.d.ts.map +1 -0
  82. package/lib/crystal3d/core/palette.js +34 -0
  83. package/lib/crystal3d/core/palette.js.map +1 -0
  84. package/lib/crystal3d/core/primitives.d.ts +133 -0
  85. package/lib/crystal3d/core/primitives.d.ts.map +1 -0
  86. package/lib/crystal3d/core/primitives.js +80 -0
  87. package/lib/crystal3d/core/primitives.js.map +1 -0
  88. package/lib/crystal3d/core/structureText.d.ts +20 -0
  89. package/lib/crystal3d/core/structureText.d.ts.map +1 -0
  90. package/lib/crystal3d/core/structureText.js +37 -0
  91. package/lib/crystal3d/core/structureText.js.map +1 -0
  92. package/lib/crystal3d/core/supercell.d.ts +20 -0
  93. package/lib/crystal3d/core/supercell.d.ts.map +1 -0
  94. package/lib/crystal3d/core/supercell.js +35 -0
  95. package/lib/crystal3d/core/supercell.js.map +1 -0
  96. package/lib/crystal3d/core/types.d.ts +166 -0
  97. package/lib/crystal3d/core/types.d.ts.map +1 -0
  98. package/lib/crystal3d/core/types.js +10 -0
  99. package/lib/crystal3d/core/types.js.map +1 -0
  100. package/lib/crystal3d/core/vec3.d.ts +75 -0
  101. package/lib/crystal3d/core/vec3.d.ts.map +1 -0
  102. package/lib/crystal3d/core/vec3.js +119 -0
  103. package/lib/crystal3d/core/vec3.js.map +1 -0
  104. package/lib/crystal3d/ui/CrystalCanvas3D.d.ts +52 -0
  105. package/lib/crystal3d/ui/CrystalCanvas3D.d.ts.map +1 -0
  106. package/lib/crystal3d/ui/CrystalCanvas3D.js +242 -0
  107. package/lib/crystal3d/ui/CrystalCanvas3D.js.map +1 -0
  108. package/lib/crystal3d/ui/CrystalStructureView.d.ts +17 -0
  109. package/lib/crystal3d/ui/CrystalStructureView.d.ts.map +1 -0
  110. package/lib/crystal3d/ui/CrystalStructureView.js +76 -0
  111. package/lib/crystal3d/ui/CrystalStructureView.js.map +1 -0
  112. package/lib/crystal3d/ui/CrystalStructureViewer.d.ts +22 -0
  113. package/lib/crystal3d/ui/CrystalStructureViewer.d.ts.map +1 -0
  114. package/lib/crystal3d/ui/CrystalStructureViewer.js +29 -0
  115. package/lib/crystal3d/ui/CrystalStructureViewer.js.map +1 -0
  116. package/lib/crystal3d/ui/CrystalViewControls.d.ts +25 -0
  117. package/lib/crystal3d/ui/CrystalViewControls.d.ts.map +1 -0
  118. package/lib/crystal3d/ui/CrystalViewControls.js +22 -0
  119. package/lib/crystal3d/ui/CrystalViewControls.js.map +1 -0
  120. package/lib/crystal3d/ui/CrystalViewer3D.d.ts +72 -0
  121. package/lib/crystal3d/ui/CrystalViewer3D.d.ts.map +1 -0
  122. package/lib/crystal3d/ui/CrystalViewer3D.js +70 -0
  123. package/lib/crystal3d/ui/CrystalViewer3D.js.map +1 -0
  124. package/lib/crystal3d/ui/crystalScene.d.ts +91 -0
  125. package/lib/crystal3d/ui/crystalScene.d.ts.map +1 -0
  126. package/lib/crystal3d/ui/crystalScene.js +10 -0
  127. package/lib/crystal3d/ui/crystalScene.js.map +1 -0
  128. package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts +52 -0
  129. package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts.map +1 -0
  130. package/lib/crystal3d/ui/crystalStructureViewerProps.js +2 -0
  131. package/lib/crystal3d/ui/crystalStructureViewerProps.js.map +1 -0
  132. package/lib/crystal3d/ui/index.d.ts +16 -0
  133. package/lib/crystal3d/ui/index.d.ts.map +1 -0
  134. package/lib/crystal3d/ui/index.js +12 -0
  135. package/lib/crystal3d/ui/index.js.map +1 -0
  136. package/lib/crystal3d/ui/useCrystalCaption.d.ts +14 -0
  137. package/lib/crystal3d/ui/useCrystalCaption.d.ts.map +1 -0
  138. package/lib/crystal3d/ui/useCrystalCaption.js +32 -0
  139. package/lib/crystal3d/ui/useCrystalCaption.js.map +1 -0
  140. package/lib/crystal3d/viewer/animate.d.ts +49 -0
  141. package/lib/crystal3d/viewer/animate.d.ts.map +1 -0
  142. package/lib/crystal3d/viewer/animate.js +83 -0
  143. package/lib/crystal3d/viewer/animate.js.map +1 -0
  144. package/lib/crystal3d/viewer/camera.d.ts +44 -0
  145. package/lib/crystal3d/viewer/camera.d.ts.map +1 -0
  146. package/lib/crystal3d/viewer/camera.js +103 -0
  147. package/lib/crystal3d/viewer/camera.js.map +1 -0
  148. package/lib/crystal3d/viewer/index.d.ts +13 -0
  149. package/lib/crystal3d/viewer/index.d.ts.map +1 -0
  150. package/lib/crystal3d/viewer/index.js +8 -0
  151. package/lib/crystal3d/viewer/index.js.map +1 -0
  152. package/lib/crystal3d/viewer/layerRegistry.d.ts +24 -0
  153. package/lib/crystal3d/viewer/layerRegistry.d.ts.map +1 -0
  154. package/lib/crystal3d/viewer/layerRegistry.js +39 -0
  155. package/lib/crystal3d/viewer/layerRegistry.js.map +1 -0
  156. package/lib/crystal3d/viewer/meshPrimitives.d.ts +13 -0
  157. package/lib/crystal3d/viewer/meshPrimitives.d.ts.map +1 -0
  158. package/lib/crystal3d/viewer/meshPrimitives.js +76 -0
  159. package/lib/crystal3d/viewer/meshPrimitives.js.map +1 -0
  160. package/lib/crystal3d/viewer/plugin.d.ts +133 -0
  161. package/lib/crystal3d/viewer/plugin.d.ts.map +1 -0
  162. package/lib/crystal3d/viewer/plugin.js +181 -0
  163. package/lib/crystal3d/viewer/plugin.js.map +1 -0
  164. package/lib/crystal3d/viewer/renderCell.d.ts +43 -0
  165. package/lib/crystal3d/viewer/renderCell.d.ts.map +1 -0
  166. package/lib/crystal3d/viewer/renderCell.js +53 -0
  167. package/lib/crystal3d/viewer/renderCell.js.map +1 -0
  168. package/lib/crystal3d/viewer/renderElements.d.ts +54 -0
  169. package/lib/crystal3d/viewer/renderElements.d.ts.map +1 -0
  170. package/lib/crystal3d/viewer/renderElements.js +77 -0
  171. package/lib/crystal3d/viewer/renderElements.js.map +1 -0
  172. package/lib/crystal3d/viewer/renderStructure.d.ts +55 -0
  173. package/lib/crystal3d/viewer/renderStructure.d.ts.map +1 -0
  174. package/lib/crystal3d/viewer/renderStructure.js +103 -0
  175. package/lib/crystal3d/viewer/renderStructure.js.map +1 -0
  176. package/lib/crystal3d/viewer/sceneParts.d.ts +32 -0
  177. package/lib/crystal3d/viewer/sceneParts.d.ts.map +1 -0
  178. package/lib/crystal3d/viewer/sceneParts.js +77 -0
  179. package/lib/crystal3d/viewer/sceneParts.js.map +1 -0
  180. package/lib/crystal3d/viewer/shapeLayer.d.ts +41 -0
  181. package/lib/crystal3d/viewer/shapeLayer.d.ts.map +1 -0
  182. package/lib/crystal3d/viewer/shapeLayer.js +57 -0
  183. package/lib/crystal3d/viewer/shapeLayer.js.map +1 -0
  184. package/lib/crystal3d/viewer/textLayer.d.ts +21 -0
  185. package/lib/crystal3d/viewer/textLayer.d.ts.map +1 -0
  186. package/lib/crystal3d/viewer/textLayer.js +59 -0
  187. package/lib/crystal3d/viewer/textLayer.js.map +1 -0
  188. package/lib/crystal3d/viewer/viewer.d.ts +110 -0
  189. package/lib/crystal3d/viewer/viewer.d.ts.map +1 -0
  190. package/lib/crystal3d/viewer/viewer.js +157 -0
  191. package/lib/crystal3d/viewer/viewer.js.map +1 -0
  192. package/lib/crystal3d.d.ts +12 -0
  193. package/lib/crystal3d.d.ts.map +1 -0
  194. package/lib/crystal3d.js +12 -0
  195. package/lib/crystal3d.js.map +1 -0
  196. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  197. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  198. package/lib/locales/de.json +19 -1
  199. package/lib/locales/en.json +19 -1
  200. package/lib/locales/es.json +19 -1
  201. package/lib/locales/fr.json +19 -1
  202. package/lib/locales/it.json +19 -1
  203. package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
  204. package/lib/molecule3d/ui/MoleculeCanvas3D.js +16 -27
  205. package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
  206. package/lib/molstar/bonds/bondRule.d.ts +16 -0
  207. package/lib/molstar/bonds/bondRule.d.ts.map +1 -0
  208. package/lib/molstar/bonds/bondRule.js +23 -0
  209. package/lib/molstar/bonds/bondRule.js.map +1 -0
  210. package/lib/molstar/bonds/index.d.ts +9 -0
  211. package/lib/molstar/bonds/index.d.ts.map +1 -0
  212. package/lib/molstar/bonds/index.js +9 -0
  213. package/lib/molstar/bonds/index.js.map +1 -0
  214. package/lib/molstar/ui/MolstarToolbar.d.ts +47 -0
  215. package/lib/molstar/ui/MolstarToolbar.d.ts.map +1 -0
  216. package/lib/molstar/ui/MolstarToolbar.js +28 -0
  217. package/lib/molstar/ui/MolstarToolbar.js.map +1 -0
  218. package/lib/molstar/ui/index.d.ts +10 -0
  219. package/lib/molstar/ui/index.d.ts.map +1 -0
  220. package/lib/molstar/ui/index.js +8 -0
  221. package/lib/molstar/ui/index.js.map +1 -0
  222. package/lib/molstar/ui/useMolstarTools.d.ts +63 -0
  223. package/lib/molstar/ui/useMolstarTools.d.ts.map +1 -0
  224. package/lib/molstar/ui/useMolstarTools.js +36 -0
  225. package/lib/molstar/ui/useMolstarTools.js.map +1 -0
  226. package/package.json +2 -1
  227. package/src/crystal/core/cellAtoms.ts +106 -0
  228. package/src/crystal/core/index.ts +2 -0
  229. package/src/crystal/core/molecules.ts +7 -44
  230. package/src/crystal3d/core/cellClip.ts +229 -0
  231. package/src/crystal3d/core/cellGeometry.ts +193 -0
  232. package/src/crystal3d/core/cellStack.ts +87 -0
  233. package/src/crystal3d/core/crystalView.ts +114 -0
  234. package/src/crystal3d/core/drawingSet.ts +71 -0
  235. package/src/crystal3d/core/elementDrawing.ts +147 -0
  236. package/src/crystal3d/core/elementExtent.ts +81 -0
  237. package/src/crystal3d/core/elementLabels.ts +130 -0
  238. package/src/crystal3d/core/elementShapes.ts +141 -0
  239. package/src/crystal3d/core/frame.ts +56 -0
  240. package/src/crystal3d/core/framing.ts +101 -0
  241. package/src/crystal3d/core/index.ts +132 -0
  242. package/src/crystal3d/core/labelText.ts +44 -0
  243. package/src/crystal3d/core/latticeBasis.ts +110 -0
  244. package/src/crystal3d/core/mat3.ts +163 -0
  245. package/src/crystal3d/core/operationMatrix.ts +255 -0
  246. package/src/crystal3d/core/orientation.ts +229 -0
  247. package/src/crystal3d/core/palette.ts +43 -0
  248. package/src/crystal3d/core/primitives.ts +183 -0
  249. package/src/crystal3d/core/structureText.ts +43 -0
  250. package/src/crystal3d/core/supercell.ts +40 -0
  251. package/src/crystal3d/core/types.ts +186 -0
  252. package/src/crystal3d/core/vec3.ts +127 -0
  253. package/src/crystal3d/ui/CrystalCanvas3D.tsx +384 -0
  254. package/src/crystal3d/ui/CrystalStructureView.tsx +148 -0
  255. package/src/crystal3d/ui/CrystalStructureViewer.tsx +39 -0
  256. package/src/crystal3d/ui/CrystalViewControls.tsx +100 -0
  257. package/src/crystal3d/ui/CrystalViewer3D.tsx +183 -0
  258. package/src/crystal3d/ui/crystalScene.ts +100 -0
  259. package/src/crystal3d/ui/crystalStructureViewerProps.ts +54 -0
  260. package/src/crystal3d/ui/index.ts +20 -0
  261. package/src/crystal3d/ui/useCrystalCaption.ts +38 -0
  262. package/src/crystal3d/viewer/animate.ts +113 -0
  263. package/src/crystal3d/viewer/camera.ts +139 -0
  264. package/src/crystal3d/viewer/index.ts +13 -0
  265. package/src/crystal3d/viewer/layerRegistry.ts +47 -0
  266. package/src/crystal3d/viewer/meshPrimitives.ts +102 -0
  267. package/src/crystal3d/viewer/plugin.ts +258 -0
  268. package/src/crystal3d/viewer/renderCell.ts +98 -0
  269. package/src/crystal3d/viewer/renderElements.ts +121 -0
  270. package/src/crystal3d/viewer/renderStructure.ts +144 -0
  271. package/src/crystal3d/viewer/sceneParts.ts +119 -0
  272. package/src/crystal3d/viewer/shapeLayer.ts +108 -0
  273. package/src/crystal3d/viewer/textLayer.ts +85 -0
  274. package/src/crystal3d/viewer/viewer.ts +207 -0
  275. package/src/crystal3d.ts +12 -0
  276. package/src/locales/de.json +19 -1
  277. package/src/locales/en.json +19 -1
  278. package/src/locales/es.json +19 -1
  279. package/src/locales/fr.json +19 -1
  280. package/src/locales/it.json +19 -1
  281. package/src/molecule3d/ui/MoleculeCanvas3D.tsx +45 -71
  282. package/src/molstar/bonds/bondRule.ts +34 -0
  283. package/src/molstar/bonds/index.ts +9 -0
  284. package/src/molstar/ui/MolstarToolbar.tsx +103 -0
  285. package/src/molstar/ui/index.ts +14 -0
  286. package/src/molstar/ui/useMolstarTools.ts +98 -0
  287. package/styles/chrome.css +90 -0
@@ -0,0 +1,70 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The crystal in 3D: what surrounds the canvas, and what to say when there
4
+ * cannot be one.
5
+ *
6
+ * Two things are settled before molstar is touched. The WebGL probe runs first,
7
+ * because molstar ships no canvas or SVG fallback and a locked-down school
8
+ * machine would otherwise get a blank rectangle with no explanation. And the
9
+ * canvas is a `React.lazy` boundary, so a page that never shows a crystal
10
+ * never downloads it.
11
+ *
12
+ * ```tsx
13
+ * import { CrystalViewer3D } from 'react-cheminfo/crystal3d';
14
+ *
15
+ * <CrystalViewer3D scene={{ atoms, cell, repeat: [2, 2, 2] }} height={480} />;
16
+ * ```
17
+ */
18
+ import { Callout, Spinner, SpinnerSize } from '@blueprintjs/core';
19
+ import { Suspense, lazy, useState } from 'react';
20
+ import { useChromeT } from "../../i18n/ui/useT.js";
21
+ // Deep import on purpose: the probe imports nothing, while a barrel would pull
22
+ // molstar in — which is exactly what asking first exists to avoid.
23
+ import { probeViewerCapability } from "../../orbital/ui/capability.js";
24
+ import { TOKEN } from "../../tokens/core/familyTokens.js";
25
+ const CrystalCanvas3D = lazy(async () => {
26
+ const module = await import("./CrystalCanvas3D.js");
27
+ return { default: module.CrystalCanvas3D };
28
+ });
29
+ /**
30
+ * The 3D crystal, with its failure and no-WebGL messages.
31
+ * @param props - See {@link CrystalViewer3DProps}.
32
+ * @returns The viewer, or an explanation of why this machine cannot show one.
33
+ */
34
+ export function CrystalViewer3D(props) {
35
+ const { scene, height = 420, background, tools, fileName, caption, emptyMessage, unsupportedNote, onHandle, } = props;
36
+ const t = useChromeT();
37
+ const [capability] = useState(probeViewerCapability);
38
+ const [failure, setFailure] = useState(null);
39
+ if (!capability.supported) {
40
+ return (_jsxs(Callout, { intent: "warning", icon: "desktop", title: t('crystal3d.unsupported'), compact: true, children: [t.or(`viewer.capability.${capability.reason}`, capability.message), ' ', unsupportedNote] }));
41
+ }
42
+ return (_jsxs("div", { style: ROOT_STYLE, children: [_jsx("div", { style: { ...FRAME_STYLE, height }, children: scene.atoms.length === 0 ? (_jsx("div", { style: NOTICE_STYLE, children: emptyMessage })) : (_jsx(Suspense, { fallback: _jsxs("div", { style: NOTICE_STYLE, children: [_jsx(Spinner, { size: SpinnerSize.STANDARD }), _jsx("span", { children: t('molecule3d.loadingViewer') })] }), children: _jsx(CrystalCanvas3D, { scene: scene, background: background, tools: tools, fileName: fileName, onFailure: setFailure, onHandle: onHandle }) })) }), caption === undefined ? null : (_jsx("div", { style: CAPTION_STYLE, children: caption })), failure !== null && (_jsx(Callout, { intent: "danger", title: t('molecule3d.couldNotDraw'), compact: true, children: failure }))] }));
43
+ }
44
+ const ROOT_STYLE = {
45
+ display: 'flex',
46
+ flexDirection: 'column',
47
+ gap: 6,
48
+ };
49
+ const FRAME_STYLE = {
50
+ position: 'relative',
51
+ overflow: 'hidden',
52
+ borderRadius: TOKEN.radius,
53
+ border: `1px solid ${TOKEN.border}`,
54
+ background: TOKEN.surface,
55
+ };
56
+ const NOTICE_STYLE = {
57
+ display: 'flex',
58
+ height: '100%',
59
+ flexDirection: 'column',
60
+ alignItems: 'center',
61
+ justifyContent: 'center',
62
+ gap: 10,
63
+ color: TOKEN.textMuted,
64
+ fontSize: 13,
65
+ };
66
+ const CAPTION_STYLE = {
67
+ color: TOKEN.textMuted,
68
+ fontSize: 12,
69
+ };
70
+ //# sourceMappingURL=CrystalViewer3D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CrystalViewer3D.js","sourceRoot":"","sources":["../../../src/crystal3d/ui/CrystalViewer3D.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,+EAA+E;AAC/E,mEAAmE;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAI1D,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE;IACtC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,sBAAuB,CAAC,CAAC;IACrD,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC;AAC7C,CAAC,CAAC,CAAC;AAiDH;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EACJ,KAAK,EACL,MAAM,GAAG,GAAG,EACZ,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,eAAe,EACf,QAAQ,GACT,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IACrD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAE5D,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QAC1B,OAAO,CACL,MAAC,OAAO,IACN,MAAM,EAAC,SAAS,EAChB,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,CAAC,CAAC,uBAAuB,CAAC,EACjC,OAAO,mBAEN,CAAC,CAAC,EAAE,CAAC,qBAAqB,UAAU,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,GAAG,EACvE,eAAe,IACR,CACX,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eAAK,KAAK,EAAE,UAAU,aACpB,cAAK,KAAK,EAAE,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,YACnC,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAC1B,cAAK,KAAK,EAAE,YAAY,YAAG,YAAY,GAAO,CAC/C,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IACP,QAAQ,EACN,eAAK,KAAK,EAAE,YAAY,aACtB,KAAC,OAAO,IAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,GAAI,EACvC,yBAAO,CAAC,CAAC,0BAA0B,CAAC,GAAQ,IACxC,YAGR,KAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,QAAQ,GAClB,GACO,CACZ,GACG,EACL,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC9B,cAAK,KAAK,EAAE,aAAa,YAAG,OAAO,GAAO,CAC3C,EACA,OAAO,KAAK,IAAI,IAAI,CACnB,KAAC,OAAO,IAAC,MAAM,EAAC,QAAQ,EAAC,KAAK,EAAE,CAAC,CAAC,yBAAyB,CAAC,EAAE,OAAO,kBAClE,OAAO,GACA,CACX,IACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAkB;IAChC,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,MAAM,WAAW,GAAkB;IACjC,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,QAAQ;IAClB,YAAY,EAAE,KAAK,CAAC,MAAM;IAC1B,MAAM,EAAE,aAAa,KAAK,CAAC,MAAM,EAAE;IACnC,UAAU,EAAE,KAAK,CAAC,OAAO;CAC1B,CAAC;AAEF,MAAM,YAAY,GAAkB;IAClC,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,MAAM;IACd,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,GAAG,EAAE,EAAE;IACP,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,aAAa,GAAkB;IACnC,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;CACb,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * What a page asks the crystal view to show.
3
+ *
4
+ * It is a plain description — atoms, a cell, a set of elements, an operation to
5
+ * play — so a page can build one without importing anything that pulls molstar
6
+ * in. The canvas that reads it is behind a `React.lazy` boundary, and this type
7
+ * is on the near side of it.
8
+ */
9
+ import type { Molecule3DCamera } from '../../molecule3d/core/camera.ts';
10
+ import type { Molecule3DCapture } from '../../molecule3d/ui/moleculeViewer3DProps.ts';
11
+ import type { ElementStyle } from '../core/primitives.ts';
12
+ import type { CellRepeat, SymmetryDrawing, UnitCell, ViewerAtom, ViewerOperation } from '../core/types.ts';
13
+ /** An operation to apply, and the cue that applies it again. */
14
+ export interface OperationPlayback {
15
+ /**
16
+ * Changing this number replays the operation; keeping it leaves the structure
17
+ * where it is. It is a cue rather than a flag so that pressing *Apply* twice
18
+ * plays it twice.
19
+ */
20
+ readonly nonce: number;
21
+ /** What to apply. */
22
+ readonly operation: ViewerOperation;
23
+ /**
24
+ * How long one application takes, milliseconds.
25
+ * @default 900
26
+ */
27
+ readonly durationMs?: number;
28
+ }
29
+ /** Everything on screen at once. */
30
+ export interface CrystalScene {
31
+ /**
32
+ * The atoms, expanded and repeated already, in Cartesian ångström. An empty
33
+ * list draws no structure, which is what an empty workbench shows.
34
+ */
35
+ readonly atoms: readonly ViewerAtom[];
36
+ /**
37
+ * The cell the atoms sit in, when there is one.
38
+ * @default null
39
+ */
40
+ readonly cell?: UnitCell | null;
41
+ /**
42
+ * How many cells the box is drawn around. It does not repeat the atoms —
43
+ * `supercellAtoms` does that, and the page has already called it.
44
+ * @default [1, 1, 1]
45
+ */
46
+ readonly repeat?: CellRepeat;
47
+ /**
48
+ * The symmetry elements drawn over the structure.
49
+ * @default []
50
+ */
51
+ readonly elements?: readonly SymmetryDrawing[];
52
+ /**
53
+ * Whether each element's name floats beside it.
54
+ * @default true
55
+ */
56
+ readonly labels?: boolean;
57
+ /**
58
+ * How thick and how large those elements are drawn. A cell scales it to its
59
+ * own edges, so the same figure reads the same on a 3.9 Å perovskite and a
60
+ * 24 Å zeolite.
61
+ * @default the defaults of `primitives.ts`
62
+ */
63
+ readonly elementStyle?: ElementStyle;
64
+ /**
65
+ * How the atoms are drawn.
66
+ * @default 'ball-and-stick'
67
+ */
68
+ readonly representation?: 'ball-and-stick' | 'spacefill';
69
+ /**
70
+ * An operation waiting to be applied.
71
+ * @default null
72
+ */
73
+ readonly play?: OperationPlayback | null;
74
+ /**
75
+ * Where the camera stands when this structure is drawn — the view a figure
76
+ * carried — instead of the framing every new structure gets. It is put back
77
+ * once; a later redraw frames the scene again.
78
+ * @default null
79
+ */
80
+ readonly camera?: Molecule3DCamera | null;
81
+ }
82
+ /** What the canvas hands a page that pictures it. */
83
+ export interface CrystalViewHandle {
84
+ /** Render the scene as a figure. */
85
+ readonly capture: Molecule3DCapture;
86
+ /** Where the camera stands, against what is drawn; `null` before anything is. */
87
+ readonly readCamera: () => Promise<Molecule3DCamera | null>;
88
+ /** Resolves once the structure asked for last is drawn. */
89
+ readonly whenDrawn: () => Promise<void>;
90
+ }
91
+ //# sourceMappingURL=crystalScene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crystalScene.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/ui/crystalScene.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,QAAQ,EACR,UAAU,EACV,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,gEAAgE;AAChE,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qBAAqB;IACrB,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC3C;AAED,qDAAqD;AACrD,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,iFAAiF;IACjF,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC5D,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * What a page asks the crystal view to show.
3
+ *
4
+ * It is a plain description — atoms, a cell, a set of elements, an operation to
5
+ * play — so a page can build one without importing anything that pulls molstar
6
+ * in. The canvas that reads it is behind a `React.lazy` boundary, and this type
7
+ * is on the near side of it.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=crystalScene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crystalScene.js","sourceRoot":"","sources":["../../../src/crystal3d/ui/crystalScene.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,52 @@
1
+ import type { Molecule3DTools } from '../../molecule3d/core/settings.ts';
2
+ import type { CrystalViewSettings } from '../core/crystalView.ts';
3
+ import type { CrystalViewHandle } from './crystalScene.ts';
4
+ /** Props of `CrystalStructureViewer`. */
5
+ export interface CrystalStructureViewerProps {
6
+ /** The CIF, as text. */
7
+ cif: string;
8
+ /**
9
+ * What the crystal is called, at the head of the caption.
10
+ * @default ''
11
+ */
12
+ name?: string;
13
+ /**
14
+ * How the crystal is drawn, when the page owns it — to keep it in the
15
+ * address, for one.
16
+ * @default undefined
17
+ */
18
+ settings?: CrystalViewSettings;
19
+ /**
20
+ * How the crystal is drawn at first, when the viewer owns it.
21
+ * @default DEFAULT_CRYSTAL_VIEW_SETTINGS
22
+ */
23
+ defaultSettings?: CrystalViewSettings;
24
+ /**
25
+ * Called with every change a chip makes.
26
+ * @default undefined
27
+ */
28
+ onSettingsChange?: (settings: CrystalViewSettings) => void;
29
+ /**
30
+ * How tall the canvas is: pixels, or any CSS length.
31
+ * @default 420
32
+ */
33
+ height?: number | string;
34
+ /**
35
+ * Which tools the toolbars offer; every one it does not name is on.
36
+ * @default every tool but the display options and the surface
37
+ */
38
+ tools?: Partial<Molecule3DTools>;
39
+ /**
40
+ * Base name of a picture saved from the toolbar, extension excluded.
41
+ * @default 'crystal'
42
+ */
43
+ fileName?: string;
44
+ /**
45
+ * Called with the means to picture the scene once the canvas exists, and with
46
+ * `null` once it is gone.
47
+ * @default undefined
48
+ */
49
+ onHandle?: (handle: CrystalViewHandle | null) => void;
50
+ }
51
+ export { DEFAULT_CRYSTAL_VIEW_SETTINGS as DEFAULT_SETTINGS } from '../core/crystalView.ts';
52
+ //# sourceMappingURL=crystalStructureViewerProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crystalStructureViewerProps.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/ui/crystalStructureViewerProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,yCAAyC;AACzC,MAAM,WAAW,2BAA2B;IAC1C,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC3D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;CACvD;AAED,OAAO,EAAE,6BAA6B,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { DEFAULT_CRYSTAL_VIEW_SETTINGS as DEFAULT_SETTINGS } from "../core/crystalView.js";
2
+ //# sourceMappingURL=crystalStructureViewerProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crystalStructureViewerProps.js","sourceRoot":"","sources":["../../../src/crystal3d/ui/crystalStructureViewerProps.ts"],"names":[],"mappings":"AAqDA,OAAO,EAAE,6BAA6B,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * What a page imports to show a crystal in 3D.
3
+ *
4
+ * **Nothing exported here may pull molstar in statically.** The canvas, the
5
+ * viewer class and the bond rule are reached through `React.lazy` only;
6
+ * type-only re-exports are erased and so are safe.
7
+ */
8
+ export type { CrystalScene, CrystalViewHandle, OperationPlayback, } from './crystalScene.ts';
9
+ export type { CrystalStructureViewerProps } from './crystalStructureViewerProps.ts';
10
+ export { CrystalStructureViewer } from './CrystalStructureViewer.tsx';
11
+ export type { CrystalViewControlsProps } from './CrystalViewControls.tsx';
12
+ export { CrystalViewControls } from './CrystalViewControls.tsx';
13
+ export type { CrystalViewer3DProps } from './CrystalViewer3D.tsx';
14
+ export { CrystalViewer3D } from './CrystalViewer3D.tsx';
15
+ export { useCrystalCaption } from './useCrystalCaption.ts';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * What a page imports to show a crystal in 3D.
3
+ *
4
+ * **Nothing exported here may pull molstar in statically.** The canvas, the
5
+ * viewer class and the bond rule are reached through `React.lazy` only;
6
+ * type-only re-exports are erased and so are safe.
7
+ */
8
+ export { CrystalStructureViewer } from "./CrystalStructureViewer.js";
9
+ export { CrystalViewControls } from "./CrystalViewControls.js";
10
+ export { CrystalViewer3D } from "./CrystalViewer3D.js";
11
+ export { useCrystalCaption } from "./useCrystalCaption.js";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crystal3d/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA8B,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * One line under a crystal saying what is on it: its name, what one cell
3
+ * holds, and how many cells are drawn.
4
+ */
5
+ import type { CrystalView } from '../core/crystalView.ts';
6
+ /**
7
+ * The caption of a crystal view.
8
+ * @param name - What the crystal is called; left out when empty.
9
+ * @param view - What `crystalView` found.
10
+ * @param asked - Cells along each axis asked for.
11
+ * @returns e.g. `Aspirin · 4 molecules per cell · 2×2×2 cells`.
12
+ */
13
+ export declare function useCrystalCaption(name: string, view: Pick<CrystalView, 'molecules' | 'atomsPerCell' | 'cells'>, asked: number): string;
14
+ //# sourceMappingURL=useCrystalCaption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCrystalCaption.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/ui/useCrystalCaption.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,cAAc,GAAG,OAAO,CAAC,EAC/D,KAAK,EAAE,MAAM,GACZ,MAAM,CAkBR"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * One line under a crystal saying what is on it: its name, what one cell
3
+ * holds, and how many cells are drawn.
4
+ */
5
+ import { useChromeT } from "../../i18n/ui/useT.js";
6
+ /**
7
+ * The caption of a crystal view.
8
+ * @param name - What the crystal is called; left out when empty.
9
+ * @param view - What `crystalView` found.
10
+ * @param asked - Cells along each axis asked for.
11
+ * @returns e.g. `Aspirin · 4 molecules per cell · 2×2×2 cells`.
12
+ */
13
+ export function useCrystalCaption(name, view, asked) {
14
+ const t = useChromeT();
15
+ const parts = [
16
+ name,
17
+ view.molecules > 0
18
+ ? view.molecules === 1
19
+ ? t('crystal3d.caption.molecules.one')
20
+ : t('crystal3d.caption.molecules.other', { count: view.molecules })
21
+ : view.atomsPerCell === 1
22
+ ? t('crystal3d.caption.atoms.one')
23
+ : t('crystal3d.caption.atoms.other', { count: view.atomsPerCell }),
24
+ view.cells < asked
25
+ ? t('crystal3d.caption.cellsCapped', { count: view.cells, asked })
26
+ : view.cells === 1
27
+ ? t('crystal3d.caption.cells.one')
28
+ : t('crystal3d.caption.cells.other', { count: view.cells }),
29
+ ];
30
+ return parts.filter((part) => part !== '').join(' · ');
31
+ }
32
+ //# sourceMappingURL=useCrystalCaption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCrystalCaption.js","sourceRoot":"","sources":["../../../src/crystal3d/ui/useCrystalCaption.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,IAA+D,EAC/D,KAAa;IAEb,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,MAAM,KAAK,GAAG;QACZ,IAAI;QACJ,IAAI,CAAC,SAAS,GAAG,CAAC;YAChB,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC;gBACpB,CAAC,CAAC,CAAC,CAAC,iCAAiC,CAAC;gBACtC,CAAC,CAAC,CAAC,CAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;YACrE,CAAC,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC;gBACvB,CAAC,CAAC,CAAC,CAAC,6BAA6B,CAAC;gBAClC,CAAC,CAAC,CAAC,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;QACtE,IAAI,CAAC,KAAK,GAAG,KAAK;YAChB,CAAC,CAAC,CAAC,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;YAClE,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC;gBAChB,CAAC,CAAC,CAAC,CAAC,6BAA6B,CAAC;gBAClC,CAAC,CAAC,CAAC,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;KAChE,CAAC;IACF,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Applying an operation to the structure, so a student watches it land back on
3
+ * itself.
4
+ *
5
+ * The structure moves and the symmetry elements do not: an axis that turned with
6
+ * the molecule would prove nothing. Moving it costs one GPU uniform per frame —
7
+ * `Representation.State.transform` is written straight into the renderable — so
8
+ * nothing is rebuilt and nothing is re-uploaded while the animation runs.
9
+ */
10
+ import type { PluginContext } from 'molstar/lib/mol-plugin/context.js';
11
+ import type { ViewerOperation } from '../core/types.ts';
12
+ /** How an operation is played. */
13
+ export interface PlayOptions {
14
+ /**
15
+ * How long one application takes, milliseconds.
16
+ * @default 900
17
+ */
18
+ durationMs?: number;
19
+ /**
20
+ * Called with the fraction played, 0 to 1, on every frame.
21
+ * @default undefined
22
+ */
23
+ onProgress?: (fraction: number) => void;
24
+ }
25
+ /**
26
+ * Play one application of an operation, and leave the structure where it lands.
27
+ *
28
+ * A second call cancels the first, so a student hammering the button never sees
29
+ * two animations fight.
30
+ * @param plugin - The molstar context.
31
+ * @param operation - What to apply.
32
+ * @param options - See {@link PlayOptions}.
33
+ * @returns Resolves when the operation has been applied in full, or as soon as
34
+ * a later call has taken over.
35
+ */
36
+ export declare function playOperation(plugin: PluginContext, operation: ViewerOperation, options?: PlayOptions): Promise<void>;
37
+ /**
38
+ * Hold the structure part-way through an operation, for a slider.
39
+ * @param plugin - The molstar context.
40
+ * @param operation - What is being applied.
41
+ * @param fraction - How far through, 0 to 1.
42
+ */
43
+ export declare function setOperationFraction(plugin: PluginContext, operation: ViewerOperation, fraction: number): void;
44
+ /**
45
+ * Put the structure back where it started, and stop any animation in flight.
46
+ * @param plugin - The molstar context.
47
+ */
48
+ export declare function resetOperation(plugin: PluginContext): void;
49
+ //# sourceMappingURL=animate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animate.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/viewer/animate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIxD,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,eAAe,EAC1B,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,eAAe,EAC1B,QAAQ,EAAE,MAAM,GACf,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAG1D"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Applying an operation to the structure, so a student watches it land back on
3
+ * itself.
4
+ *
5
+ * The structure moves and the symmetry elements do not: an axis that turned with
6
+ * the molecule would prove nothing. Moving it costs one GPU uniform per frame —
7
+ * `Representation.State.transform` is written straight into the renderable — so
8
+ * nothing is rebuilt and nothing is re-uploaded while the animation runs.
9
+ */
10
+ import { Mat4 } from 'molstar/lib/mol-math/linear-algebra.js';
11
+ import { IDENTITY_MATRIX4, operationAt } from "../core/operationMatrix.js";
12
+ import { structureRepresentation } from "./renderStructure.js";
13
+ /**
14
+ * Play one application of an operation, and leave the structure where it lands.
15
+ *
16
+ * A second call cancels the first, so a student hammering the button never sees
17
+ * two animations fight.
18
+ * @param plugin - The molstar context.
19
+ * @param operation - What to apply.
20
+ * @param options - See {@link PlayOptions}.
21
+ * @returns Resolves when the operation has been applied in full, or as soon as
22
+ * a later call has taken over.
23
+ */
24
+ export function playOperation(plugin, operation, options = {}) {
25
+ const { durationMs = 900, onProgress } = options;
26
+ const token = (tokens.get(plugin) ?? 0) + 1;
27
+ tokens.set(plugin, token);
28
+ if (durationMs <= 0) {
29
+ setOperationFraction(plugin, operation, 1);
30
+ onProgress?.(1);
31
+ return Promise.resolve();
32
+ }
33
+ const started = now();
34
+ return new Promise((resolve) => {
35
+ const step = () => {
36
+ if (tokens.get(plugin) !== token) {
37
+ resolve();
38
+ return;
39
+ }
40
+ const fraction = Math.min(1, (now() - started) / durationMs);
41
+ setOperationFraction(plugin, operation, fraction);
42
+ onProgress?.(fraction);
43
+ if (fraction < 1)
44
+ globalThis.requestAnimationFrame(step);
45
+ else
46
+ resolve();
47
+ };
48
+ globalThis.requestAnimationFrame(step);
49
+ });
50
+ }
51
+ /**
52
+ * Hold the structure part-way through an operation, for a slider.
53
+ * @param plugin - The molstar context.
54
+ * @param operation - What is being applied.
55
+ * @param fraction - How far through, 0 to 1.
56
+ */
57
+ export function setOperationFraction(plugin, operation, fraction) {
58
+ applyTransform(plugin, operationAt(operation, fraction));
59
+ }
60
+ /**
61
+ * Put the structure back where it started, and stop any animation in flight.
62
+ * @param plugin - The molstar context.
63
+ */
64
+ export function resetOperation(plugin) {
65
+ tokens.set(plugin, (tokens.get(plugin) ?? 0) + 1);
66
+ applyTransform(plugin, IDENTITY_MATRIX4);
67
+ }
68
+ function applyTransform(plugin, matrix) {
69
+ const representation = structureRepresentation(plugin);
70
+ if (representation === undefined)
71
+ return;
72
+ representation.setState({
73
+ transform: Mat4.fromArray(Mat4.identity(), matrix, 0),
74
+ });
75
+ plugin.canvas3d?.update(representation);
76
+ plugin.canvas3d?.requestDraw();
77
+ }
78
+ function now() {
79
+ return globalThis.performance.now();
80
+ }
81
+ /** The animation in flight per plugin; a new one invalidates the old. */
82
+ const tokens = new WeakMap();
83
+ //# sourceMappingURL=animate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animate.js","sourceRoot":"","sources":["../../../src/crystal3d/viewer/animate.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Framing the scene.
3
+ *
4
+ * What is on screen is measured here rather than read off molstar, for the
5
+ * reason `framing.ts` gives: a representation's own bounding sphere is padded by
6
+ * the largest ball it could ever draw. Each part of the scene registers its
7
+ * extent as it is drawn, and the camera frames the union — the framing itself,
8
+ * and the union, are `react-cheminfo`'s.
9
+ */
10
+ import type { PluginContext } from 'molstar/lib/mol-plugin/context.js';
11
+ import type { Molecule3DCamera } from '../../molecule3d/core/camera.ts';
12
+ import type { SceneSphere } from '../core/framing.ts';
13
+ import type { ViewOrientation } from '../core/orientation.ts';
14
+ /**
15
+ * Record how far one part of the scene reaches.
16
+ * @param plugin - The molstar context.
17
+ * @param key - Which part: the atoms, the cell, the elements.
18
+ * @param sphere - Its extent, or `null` once it is no longer drawn.
19
+ */
20
+ export declare function setSceneExtent(plugin: PluginContext, key: string, sphere: SceneSphere | null): void;
21
+ /**
22
+ * Frame everything on screen.
23
+ * @param plugin - The molstar context.
24
+ * @param durationMs - Transition length; 0 jumps.
25
+ * @param orientation - Where to look from, from `sceneOrientation`. Left out,
26
+ * the camera keeps the direction it is already pointing, which is what a
27
+ * reframe after a reader has turned the scene should do.
28
+ */
29
+ export declare function resetCamera(plugin: PluginContext, durationMs?: number, orientation?: ViewOrientation): void;
30
+ /**
31
+ * Where the camera stands, measured against what is drawn rather than in
32
+ * ångström, so a figure opens on the same view in a frame of another size.
33
+ * @param plugin - The molstar context.
34
+ * @returns The camera, or `null` while nothing is drawn to measure it against.
35
+ */
36
+ export declare function readCamera(plugin: PluginContext): Molecule3DCamera | null;
37
+ /**
38
+ * Put the camera where {@link readCamera} found it, against what is drawn now.
39
+ * @param plugin - The molstar context.
40
+ * @param camera - Where to stand.
41
+ */
42
+ export declare function applyCamera(plugin: PluginContext, camera: Molecule3DCamera): void;
43
+ export { DEFAULT_CAMERA_DURATION } from '../../molstar/core/index.ts';
44
+ //# sourceMappingURL=camera.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/viewer/camera.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAUxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAa9D;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,WAAW,GAAG,IAAI,GACzB,IAAI,CAYN;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EACrB,UAAU,SAA0B,EACpC,WAAW,CAAC,EAAE,eAAe,GAC5B,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,GAAG,IAAI,CASzE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,gBAAgB,GACvB,IAAI,CAcN;AAgBD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Framing the scene.
3
+ *
4
+ * What is on screen is measured here rather than read off molstar, for the
5
+ * reason `framing.ts` gives: a representation's own bounding sphere is padded by
6
+ * the largest ball it could ever draw. Each part of the scene registers its
7
+ * extent as it is drawn, and the camera frames the union — the framing itself,
8
+ * and the union, are `react-cheminfo`'s.
9
+ */
10
+ import { Sphere3D } from 'molstar/lib/mol-math/geometry.js';
11
+ import { Vec3 } from 'molstar/lib/mol-math/linear-algebra.js';
12
+ import { DEFAULT_CAMERA_DURATION, cameraToPose, framedRadius, poseToCamera, resetCamera as frameScene, unionSphere, } from "../../molstar/core/index.js";
13
+ /**
14
+ * The scene is measured as the ball through its furthest corners, and a camera
15
+ * fitting that ball to the window leaves a cell filling barely half of it: a
16
+ * cube touches its own circumscribed sphere only at eight corners, and uses
17
+ * about 82% of its diameter even seen square-on. So the ball handed to the
18
+ * camera is **smaller** than the one measured, by about the slack that costs.
19
+ * Nothing is cut at the orientations a cell is read at, and the reader can
20
+ * always pull back.
21
+ */
22
+ const SCENE_MARGIN = -0.12;
23
+ /**
24
+ * Record how far one part of the scene reaches.
25
+ * @param plugin - The molstar context.
26
+ * @param key - Which part: the atoms, the cell, the elements.
27
+ * @param sphere - Its extent, or `null` once it is no longer drawn.
28
+ */
29
+ export function setSceneExtent(plugin, key, sphere) {
30
+ let parts = extents.get(plugin);
31
+ if (parts === undefined) {
32
+ parts = new Map();
33
+ extents.set(plugin, parts);
34
+ }
35
+ if (sphere === null) {
36
+ parts.delete(key);
37
+ return;
38
+ }
39
+ const [x, y, z] = sphere.centre;
40
+ parts.set(key, Sphere3D.create(Vec3.create(x, y, z), sphere.radius));
41
+ }
42
+ /**
43
+ * Frame everything on screen.
44
+ * @param plugin - The molstar context.
45
+ * @param durationMs - Transition length; 0 jumps.
46
+ * @param orientation - Where to look from, from `sceneOrientation`. Left out,
47
+ * the camera keeps the direction it is already pointing, which is what a
48
+ * reframe after a reader has turned the scene should do.
49
+ */
50
+ export function resetCamera(plugin, durationMs = DEFAULT_CAMERA_DURATION, orientation) {
51
+ frameScene(plugin, {
52
+ spheres: [...(extents.get(plugin)?.values() ?? [])],
53
+ margin: SCENE_MARGIN,
54
+ durationMs,
55
+ orientation,
56
+ });
57
+ }
58
+ /**
59
+ * Where the camera stands, measured against what is drawn rather than in
60
+ * ångström, so a figure opens on the same view in a frame of another size.
61
+ * @param plugin - The molstar context.
62
+ * @returns The camera, or `null` while nothing is drawn to measure it against.
63
+ */
64
+ export function readCamera(plugin) {
65
+ const canvas = plugin.canvas3d;
66
+ const reference = sceneReference(plugin);
67
+ if (canvas === undefined || reference === null)
68
+ return null;
69
+ return poseToCamera(canvas.camera.getSnapshot(), reference, canvas.camera.getTargetDistance(reference.radius));
70
+ }
71
+ /**
72
+ * Put the camera where {@link readCamera} found it, against what is drawn now.
73
+ * @param plugin - The molstar context.
74
+ * @param camera - Where to stand.
75
+ */
76
+ export function applyCamera(plugin, camera) {
77
+ const canvas = plugin.canvas3d;
78
+ if (canvas === undefined)
79
+ return;
80
+ // Resolves a reframe molstar has queued, which would otherwise land after
81
+ // this move and undo it.
82
+ canvas.commit(true);
83
+ const reference = sceneReference(plugin);
84
+ if (reference === null)
85
+ return;
86
+ const pose = cameraToPose(camera, reference, canvas.camera.getTargetDistance(reference.radius));
87
+ canvas.camera.setState({ ...pose, radius: reference.radius }, 0);
88
+ }
89
+ /**
90
+ * The sphere a camera is measured against: every part drawn, framed.
91
+ * @param plugin - The molstar context whose scene is measured.
92
+ * @returns The centre and framed radius, or `null` while nothing is drawn.
93
+ */
94
+ function sceneReference(plugin) {
95
+ const union = unionSphere([...(extents.get(plugin)?.values() ?? [])]);
96
+ if (union === null || !(union.radius > 0))
97
+ return null;
98
+ return { center: union.center, radius: framedRadius(union.radius) };
99
+ }
100
+ /** What each part of the scene reaches, per plugin. */
101
+ const extents = new WeakMap();
102
+ export { DEFAULT_CAMERA_DURATION } from "../../molstar/core/index.js";
103
+ //# sourceMappingURL=camera.js.map