react-cheminfo 0.66.0 → 0.68.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 (291) hide show
  1. package/README.md +22 -11
  2. package/lib/download/ui/FigureDownloadPanel.d.ts +7 -1
  3. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  4. package/lib/download/ui/FigureDownloadPanel.js +2 -2
  5. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  6. package/lib/ecosystem/core/sites.js +6 -6
  7. package/lib/ecosystem/core/sites.js.map +1 -1
  8. package/lib/ecosystem/core/types.d.ts +1 -1
  9. package/lib/ecosystem/core/types.d.ts.map +1 -1
  10. package/lib/ecosystem/ui/glyphs.js +2 -2
  11. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  12. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  13. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  14. package/lib/i18n/core/messageCatalog.d.ts +2 -2
  15. package/lib/i18n/vite/localeCatalog.d.ts +1 -1
  16. package/lib/ir/core/index.d.ts +2 -2
  17. package/lib/ir/core/index.d.ts.map +1 -1
  18. package/lib/ir/core/index.js.map +1 -1
  19. package/lib/ir/core/irEditorApi.d.ts +12 -0
  20. package/lib/ir/core/irEditorApi.d.ts.map +1 -1
  21. package/lib/ir/core/irReducer.d.ts +2 -2
  22. package/lib/ir/core/irReducer.d.ts.map +1 -1
  23. package/lib/ir/core/irSidePanels.d.ts +7 -1
  24. package/lib/ir/core/irSidePanels.d.ts.map +1 -1
  25. package/lib/ir/core/irState.d.ts +8 -5
  26. package/lib/ir/core/irState.d.ts.map +1 -1
  27. package/lib/ir/core/irState.js.map +1 -1
  28. package/lib/ir/ui/IrCanvas.d.ts +7 -0
  29. package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
  30. package/lib/ir/ui/IrCanvas.js +8 -3
  31. package/lib/ir/ui/IrCanvas.js.map +1 -1
  32. package/lib/ir/ui/IrChart.d.ts.map +1 -1
  33. package/lib/ir/ui/IrChart.js +5 -1
  34. package/lib/ir/ui/IrChart.js.map +1 -1
  35. package/lib/ir/ui/IrEditor.d.ts +22 -4
  36. package/lib/ir/ui/IrEditor.d.ts.map +1 -1
  37. package/lib/ir/ui/IrEditor.js.map +1 -1
  38. package/lib/ir/ui/IrShell.d.ts +9 -1
  39. package/lib/ir/ui/IrShell.d.ts.map +1 -1
  40. package/lib/ir/ui/IrShell.js +4 -19
  41. package/lib/ir/ui/IrShell.js.map +1 -1
  42. package/lib/ir/ui/IrSidePanel.d.ts +11 -0
  43. package/lib/ir/ui/IrSidePanel.d.ts.map +1 -1
  44. package/lib/ir/ui/IrSidePanel.js +12 -3
  45. package/lib/ir/ui/IrSidePanel.js.map +1 -1
  46. package/lib/ir/ui/RamanEditor.d.ts +22 -4
  47. package/lib/ir/ui/RamanEditor.d.ts.map +1 -1
  48. package/lib/ir/ui/RamanEditor.js.map +1 -1
  49. package/lib/ir/ui/VibrationalEditor.d.ts +18 -4
  50. package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -1
  51. package/lib/ir/ui/VibrationalEditor.js +4 -2
  52. package/lib/ir/ui/VibrationalEditor.js.map +1 -1
  53. package/lib/ir/ui/index.d.ts +1 -0
  54. package/lib/ir/ui/index.d.ts.map +1 -1
  55. package/lib/ir/ui/index.js.map +1 -1
  56. package/lib/ir/ui/irActions.d.ts +3 -3
  57. package/lib/ir/ui/irActions.d.ts.map +1 -1
  58. package/lib/ir/ui/irChartProps.d.ts +7 -0
  59. package/lib/ir/ui/irChartProps.d.ts.map +1 -1
  60. package/lib/ir/ui/irHostPanels.d.ts +53 -0
  61. package/lib/ir/ui/irHostPanels.d.ts.map +1 -0
  62. package/lib/ir/ui/irHostPanels.js +41 -0
  63. package/lib/ir/ui/irHostPanels.js.map +1 -0
  64. package/lib/ir/ui/useIrSide.d.ts +27 -0
  65. package/lib/ir/ui/useIrSide.d.ts.map +1 -0
  66. package/lib/ir/ui/useIrSide.js +42 -0
  67. package/lib/ir/ui/useIrSide.js.map +1 -0
  68. package/lib/ir/ui/useIrZoom.d.ts +8 -0
  69. package/lib/ir/ui/useIrZoom.d.ts.map +1 -1
  70. package/lib/ir/ui/useIrZoom.js +2 -1
  71. package/lib/ir/ui/useIrZoom.js.map +1 -1
  72. package/lib/locales/de.json +9 -1
  73. package/lib/locales/en.json +9 -1
  74. package/lib/locales/es.json +9 -1
  75. package/lib/locales/fr.json +9 -1
  76. package/lib/locales/it.json +9 -1
  77. package/lib/molecule3d/core/animatedPng.d.ts +25 -0
  78. package/lib/molecule3d/core/animatedPng.d.ts.map +1 -0
  79. package/lib/molecule3d/core/animatedPng.js +59 -0
  80. package/lib/molecule3d/core/animatedPng.js.map +1 -0
  81. package/lib/molecule3d/core/file.d.ts +24 -0
  82. package/lib/molecule3d/core/file.d.ts.map +1 -0
  83. package/lib/molecule3d/core/file.js +2 -0
  84. package/lib/molecule3d/core/file.js.map +1 -0
  85. package/lib/molecule3d/core/index.d.ts +4 -1
  86. package/lib/molecule3d/core/index.d.ts.map +1 -1
  87. package/lib/molecule3d/core/index.js +1 -0
  88. package/lib/molecule3d/core/index.js.map +1 -1
  89. package/lib/molecule3d/core/settings.d.ts +0 -7
  90. package/lib/molecule3d/core/settings.d.ts.map +1 -1
  91. package/lib/molecule3d/core/settings.js.map +1 -1
  92. package/lib/molecule3d/ui/Molecule3DExport.d.ts +10 -2
  93. package/lib/molecule3d/ui/Molecule3DExport.d.ts.map +1 -1
  94. package/lib/molecule3d/ui/Molecule3DExport.js +15 -2
  95. package/lib/molecule3d/ui/Molecule3DExport.js.map +1 -1
  96. package/lib/molecule3d/ui/Molecule3DToolbar.js +9 -2
  97. package/lib/molecule3d/ui/Molecule3DToolbar.js.map +1 -1
  98. package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
  99. package/lib/molecule3d/ui/MoleculeCanvas3D.js +23 -41
  100. package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
  101. package/lib/molecule3d/ui/drawScene.d.ts +2 -1
  102. package/lib/molecule3d/ui/drawScene.d.ts.map +1 -1
  103. package/lib/molecule3d/ui/drawScene.js.map +1 -1
  104. package/lib/molecule3d/ui/exportMoleculeImage.d.ts +15 -1
  105. package/lib/molecule3d/ui/exportMoleculeImage.d.ts.map +1 -1
  106. package/lib/molecule3d/ui/exportMoleculeImage.js +14 -2
  107. package/lib/molecule3d/ui/exportMoleculeImage.js.map +1 -1
  108. package/lib/molecule3d/ui/moleculeFrames.d.ts +47 -0
  109. package/lib/molecule3d/ui/moleculeFrames.d.ts.map +1 -0
  110. package/lib/molecule3d/ui/moleculeFrames.js +65 -0
  111. package/lib/molecule3d/ui/moleculeFrames.js.map +1 -0
  112. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +14 -1
  113. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
  114. package/lib/molecule3d/ui/renderMolecule.d.ts +3 -3
  115. package/lib/molecule3d/ui/renderMolecule.d.ts.map +1 -1
  116. package/lib/molecule3d/ui/renderMolecule.js +2 -1
  117. package/lib/molecule3d/ui/renderMolecule.js.map +1 -1
  118. package/lib/molecule3d/ui/sceneDrawer.d.ts +2 -1
  119. package/lib/molecule3d/ui/sceneDrawer.d.ts.map +1 -1
  120. package/lib/molecule3d/ui/sceneDrawer.js +9 -1
  121. package/lib/molecule3d/ui/sceneDrawer.js.map +1 -1
  122. package/lib/molecule3d/ui/useImageExport.d.ts +8 -3
  123. package/lib/molecule3d/ui/useImageExport.d.ts.map +1 -1
  124. package/lib/molecule3d/ui/useImageExport.js +13 -4
  125. package/lib/molecule3d/ui/useImageExport.js.map +1 -1
  126. package/lib/molecule3d/ui/useMoleculeScene.d.ts +2 -1
  127. package/lib/molecule3d/ui/useMoleculeScene.d.ts.map +1 -1
  128. package/lib/molecule3d/ui/useMoleculeScene.js.map +1 -1
  129. package/lib/molecule3d/ui/useMoleculeViewer.d.ts +16 -0
  130. package/lib/molecule3d/ui/useMoleculeViewer.d.ts.map +1 -0
  131. package/lib/molecule3d/ui/useMoleculeViewer.js +37 -0
  132. package/lib/molecule3d/ui/useMoleculeViewer.js.map +1 -0
  133. package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts +3 -3
  134. package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts.map +1 -1
  135. package/lib/molecule3d/ui/usePolarSurfaceArea.js +4 -3
  136. package/lib/molecule3d/ui/usePolarSurfaceArea.js.map +1 -1
  137. package/lib/molecule3d/ui/viewer.d.ts +4 -1
  138. package/lib/molecule3d/ui/viewer.d.ts.map +1 -1
  139. package/lib/molecule3d/ui/viewer.js +21 -19
  140. package/lib/molecule3d/ui/viewer.js.map +1 -1
  141. package/lib/molecule3d/ui/viewerTypes.d.ts +6 -0
  142. package/lib/molecule3d/ui/viewerTypes.d.ts.map +1 -1
  143. package/lib/molstar/core/captureScene.d.ts +19 -1
  144. package/lib/molstar/core/captureScene.d.ts.map +1 -1
  145. package/lib/molstar/core/captureScene.js +57 -2
  146. package/lib/molstar/core/captureScene.js.map +1 -1
  147. package/lib/molstar/core/index.d.ts +5 -2
  148. package/lib/molstar/core/index.d.ts.map +1 -1
  149. package/lib/molstar/core/index.js +4 -2
  150. package/lib/molstar/core/index.js.map +1 -1
  151. package/lib/molstar/core/trajectory.d.ts +56 -0
  152. package/lib/molstar/core/trajectory.d.ts.map +1 -0
  153. package/lib/molstar/core/trajectory.js +96 -0
  154. package/lib/molstar/core/trajectory.js.map +1 -0
  155. package/lib/panel/ui/PanelRail.d.ts.map +1 -1
  156. package/lib/panel/ui/PanelRail.js +1 -1
  157. package/lib/panel/ui/PanelRail.js.map +1 -1
  158. package/lib/raman.d.ts +2 -1
  159. package/lib/raman.d.ts.map +1 -1
  160. package/lib/raman.js.map +1 -1
  161. package/lib/router/core/basePath.d.ts +2 -2
  162. package/lib/router/core/basePath.js +2 -2
  163. package/lib/router/core/siteAddresses.d.ts +1 -1
  164. package/lib/router/core/siteAddresses.js +1 -1
  165. package/lib/seo/core/siteFiles.js +1 -1
  166. package/lib/seo/core/siteFiles.js.map +1 -1
  167. package/lib/server/answerAddresses.d.ts +3 -3
  168. package/lib/server/answerAddresses.js +3 -3
  169. package/lib/structure/core/index.d.ts +2 -0
  170. package/lib/structure/core/index.d.ts.map +1 -1
  171. package/lib/structure/core/index.js +1 -0
  172. package/lib/structure/core/index.js.map +1 -1
  173. package/lib/structure/core/structureTransfer.d.ts +29 -0
  174. package/lib/structure/core/structureTransfer.d.ts.map +1 -0
  175. package/lib/structure/core/structureTransfer.js +26 -0
  176. package/lib/structure/core/structureTransfer.js.map +1 -0
  177. package/lib/structure/ui/EditorImportButton.d.ts +20 -0
  178. package/lib/structure/ui/EditorImportButton.d.ts.map +1 -0
  179. package/lib/structure/ui/EditorImportButton.js +24 -0
  180. package/lib/structure/ui/EditorImportButton.js.map +1 -0
  181. package/lib/structure/ui/EditorImportProblem.d.ts +17 -0
  182. package/lib/structure/ui/EditorImportProblem.d.ts.map +1 -0
  183. package/lib/structure/ui/EditorImportProblem.js +32 -0
  184. package/lib/structure/ui/EditorImportProblem.js.map +1 -0
  185. package/lib/structure/ui/StructureDrop.d.ts +39 -0
  186. package/lib/structure/ui/StructureDrop.d.ts.map +1 -0
  187. package/lib/structure/ui/StructureDrop.js +19 -0
  188. package/lib/structure/ui/StructureDrop.js.map +1 -0
  189. package/lib/structure/ui/StructureDropOverlay.d.ts +16 -0
  190. package/lib/structure/ui/StructureDropOverlay.d.ts.map +1 -0
  191. package/lib/structure/ui/StructureDropOverlay.js +29 -0
  192. package/lib/structure/ui/StructureDropOverlay.js.map +1 -0
  193. package/lib/structure/ui/StructureEditor.d.ts +3 -80
  194. package/lib/structure/ui/StructureEditor.d.ts.map +1 -1
  195. package/lib/structure/ui/StructureEditor.js +21 -33
  196. package/lib/structure/ui/StructureEditor.js.map +1 -1
  197. package/lib/structure/ui/importedStructure.d.ts +25 -0
  198. package/lib/structure/ui/importedStructure.d.ts.map +1 -0
  199. package/lib/structure/ui/importedStructure.js +74 -0
  200. package/lib/structure/ui/importedStructure.js.map +1 -0
  201. package/lib/structure/ui/index.d.ts +2 -0
  202. package/lib/structure/ui/index.d.ts.map +1 -1
  203. package/lib/structure/ui/index.js +1 -0
  204. package/lib/structure/ui/index.js.map +1 -1
  205. package/lib/structure/ui/structureEditorProps.d.ts +98 -0
  206. package/lib/structure/ui/structureEditorProps.d.ts.map +1 -0
  207. package/lib/structure/ui/structureEditorProps.js +2 -0
  208. package/lib/structure/ui/structureEditorProps.js.map +1 -0
  209. package/lib/structure/ui/useDebouncedChange.d.ts +16 -0
  210. package/lib/structure/ui/useDebouncedChange.d.ts.map +1 -0
  211. package/lib/structure/ui/useDebouncedChange.js +30 -0
  212. package/lib/structure/ui/useDebouncedChange.js.map +1 -0
  213. package/lib/structure/ui/useStructureDrop.d.ts +30 -0
  214. package/lib/structure/ui/useStructureDrop.d.ts.map +1 -0
  215. package/lib/structure/ui/useStructureDrop.js +49 -0
  216. package/lib/structure/ui/useStructureDrop.js.map +1 -0
  217. package/lib/structure/ui/useStructureImport.d.ts +45 -0
  218. package/lib/structure/ui/useStructureImport.d.ts.map +1 -0
  219. package/lib/structure/ui/useStructureImport.js +62 -0
  220. package/lib/structure/ui/useStructureImport.js.map +1 -0
  221. package/package.json +6 -3
  222. package/src/download/ui/FigureDownloadPanel.tsx +9 -2
  223. package/src/ecosystem/core/sites.ts +6 -6
  224. package/src/ecosystem/core/types.ts +2 -2
  225. package/src/ecosystem/ui/glyphs.tsx +2 -2
  226. package/src/i18n/core/messageCatalog.ts +2 -2
  227. package/src/i18n/vite/localeCatalog.ts +1 -1
  228. package/src/ir/core/index.ts +6 -2
  229. package/src/ir/core/irEditorApi.ts +13 -0
  230. package/src/ir/core/irReducer.ts +2 -2
  231. package/src/ir/core/irSidePanels.ts +8 -1
  232. package/src/ir/core/irState.ts +8 -5
  233. package/src/ir/ui/IrCanvas.tsx +27 -2
  234. package/src/ir/ui/IrChart.tsx +11 -0
  235. package/src/ir/ui/IrEditor.tsx +22 -4
  236. package/src/ir/ui/IrShell.tsx +21 -22
  237. package/src/ir/ui/IrSidePanel.tsx +36 -10
  238. package/src/ir/ui/RamanEditor.tsx +22 -4
  239. package/src/ir/ui/VibrationalEditor.tsx +24 -5
  240. package/src/ir/ui/index.ts +1 -0
  241. package/src/ir/ui/irActions.ts +3 -3
  242. package/src/ir/ui/irChartProps.ts +7 -0
  243. package/src/ir/ui/irHostPanels.ts +76 -0
  244. package/src/ir/ui/useIrSide.ts +60 -0
  245. package/src/ir/ui/useIrZoom.ts +10 -0
  246. package/src/locales/de.json +9 -1
  247. package/src/locales/en.json +9 -1
  248. package/src/locales/es.json +9 -1
  249. package/src/locales/fr.json +9 -1
  250. package/src/locales/it.json +9 -1
  251. package/src/molecule3d/core/animatedPng.ts +79 -0
  252. package/src/molecule3d/core/file.ts +23 -0
  253. package/src/molecule3d/core/index.ts +3 -1
  254. package/src/molecule3d/core/settings.ts +0 -8
  255. package/src/molecule3d/ui/Molecule3DExport.tsx +43 -5
  256. package/src/molecule3d/ui/Molecule3DToolbar.tsx +9 -2
  257. package/src/molecule3d/ui/MoleculeCanvas3D.tsx +24 -38
  258. package/src/molecule3d/ui/drawScene.ts +2 -1
  259. package/src/molecule3d/ui/exportMoleculeImage.ts +28 -3
  260. package/src/molecule3d/ui/moleculeFrames.ts +88 -0
  261. package/src/molecule3d/ui/moleculeViewer3DProps.ts +14 -5
  262. package/src/molecule3d/ui/renderMolecule.ts +5 -3
  263. package/src/molecule3d/ui/sceneDrawer.ts +14 -2
  264. package/src/molecule3d/ui/useImageExport.ts +22 -5
  265. package/src/molecule3d/ui/useMoleculeScene.ts +2 -1
  266. package/src/molecule3d/ui/useMoleculeViewer.ts +46 -0
  267. package/src/molecule3d/ui/usePolarSurfaceArea.ts +6 -4
  268. package/src/molecule3d/ui/viewer.ts +34 -27
  269. package/src/molecule3d/ui/viewerTypes.ts +6 -0
  270. package/src/molstar/core/captureScene.ts +85 -2
  271. package/src/molstar/core/index.ts +13 -2
  272. package/src/molstar/core/trajectory.ts +117 -0
  273. package/src/panel/ui/PanelRail.tsx +3 -0
  274. package/src/raman.ts +2 -1
  275. package/src/router/core/basePath.ts +2 -2
  276. package/src/router/core/siteAddresses.ts +1 -1
  277. package/src/seo/core/siteFiles.ts +1 -1
  278. package/src/server/answerAddresses.ts +3 -3
  279. package/src/structure/core/index.ts +8 -0
  280. package/src/structure/core/structureTransfer.ts +37 -0
  281. package/src/structure/ui/EditorImportButton.tsx +59 -0
  282. package/src/structure/ui/EditorImportProblem.tsx +63 -0
  283. package/src/structure/ui/StructureDrop.tsx +66 -0
  284. package/src/structure/ui/StructureDropOverlay.tsx +50 -0
  285. package/src/structure/ui/StructureEditor.tsx +49 -134
  286. package/src/structure/ui/importedStructure.ts +83 -0
  287. package/src/structure/ui/index.ts +2 -0
  288. package/src/structure/ui/structureEditorProps.ts +103 -0
  289. package/src/structure/ui/useDebouncedChange.ts +41 -0
  290. package/src/structure/ui/useStructureDrop.ts +76 -0
  291. package/src/structure/ui/useStructureImport.ts +122 -0
@@ -17,6 +17,12 @@ export interface Molecule3DViewerOptions {
17
17
  * @default undefined
18
18
  */
19
19
  onMeasure?: (measurement: Measurement) => void;
20
+ /**
21
+ * Called with how many frames the file on screen holds, each time a file is
22
+ * drawn, and with 0 once the scene is emptied.
23
+ * @default undefined
24
+ */
25
+ onFrameCountChange?: (frameCount: number) => void;
20
26
  }
21
27
  /** How to draw the model. */
22
28
  export interface MoleculeStyle {
@@ -1 +1 @@
1
- {"version":3,"file":"viewerTypes.d.ts","sourceRoot":"","sources":["../../../src/molecule3d/ui/viewerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE/E,+CAA+C;AAC/C,MAAM,WAAW,uBAAuB;IACt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AAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -1,5 +1,6 @@
1
1
  /**
2
- * A picture of the scene, rendered off screen at a size of its own.
2
+ * A picture of the scene, rendered off screen at a size of its own — one
3
+ * frame, or every frame of the trajectory on screen.
3
4
  */
4
5
  import type { PluginContext } from 'molstar/lib/mol-plugin/context.js';
5
6
  import type { ImageSize } from '../../molecule3d/core/exportImage.ts';
@@ -11,4 +12,21 @@ import type { ImageSize } from '../../molecule3d/core/exportImage.ts';
11
12
  * @throws {Error} When the plugin has no screenshot helper.
12
13
  */
13
14
  export declare function captureScene(plugin: PluginContext, size: ImageSize): Promise<string>;
15
+ /** How a series of frames is played, so it can be resumed once captured. */
16
+ export interface FramePlayback {
17
+ playing: boolean;
18
+ framesPerSecond: number;
19
+ }
20
+ /**
21
+ * Render every frame of the trajectory on screen, in order, as the scene shows
22
+ * it: the model, its surface and the measurements over it, each at that frame.
23
+ * The animation is stopped while the frames are taken and resumed afterwards,
24
+ * and the scene is left on the frame it showed.
25
+ * @param plugin - The molstar context.
26
+ * @param size - Pixel size of each picture.
27
+ * @param playback - What to resume once the frames are taken.
28
+ * @returns One picture per frame; a scene of one model gives one.
29
+ * @throws {Error} When the plugin has no screenshot helper.
30
+ */
31
+ export declare function captureFrames(plugin: PluginContext, size: ImageSize, playback: FramePlayback): Promise<ImageData[]>;
14
32
  //# sourceMappingURL=captureScene.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"captureScene.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/captureScene.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,MAAM,CAAC,CAYjB"}
1
+ {"version":3,"file":"captureScene.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/captureScene.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAUtE;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,aAAa,GACtB,OAAO,CAAC,SAAS,EAAE,CAAC,CAkCtB"}
@@ -1,6 +1,9 @@
1
1
  /**
2
- * A picture of the scene, rendered off screen at a size of its own.
2
+ * A picture of the scene, rendered off screen at a size of its own — one
3
+ * frame, or every frame of the trajectory on screen.
3
4
  */
5
+ import { Task } from 'molstar/lib/mol-task/index.js';
6
+ import { setTrajectoryPlayback, showTrajectoryFrame, shownTrajectoryFrame, stopTrajectory, trajectoryFrameCount, } from "./trajectory.js";
4
7
  /**
5
8
  * Render the scene without its selection highlights or its axes.
6
9
  * @param plugin - The molstar context.
@@ -9,6 +12,58 @@
9
12
  * @throws {Error} When the plugin has no screenshot helper.
10
13
  */
11
14
  export async function captureScene(plugin, size) {
15
+ return pictureHelper(plugin, size).getImageDataUri();
16
+ }
17
+ /**
18
+ * Render every frame of the trajectory on screen, in order, as the scene shows
19
+ * it: the model, its surface and the measurements over it, each at that frame.
20
+ * The animation is stopped while the frames are taken and resumed afterwards,
21
+ * and the scene is left on the frame it showed.
22
+ * @param plugin - The molstar context.
23
+ * @param size - Pixel size of each picture.
24
+ * @param playback - What to resume once the frames are taken.
25
+ * @returns One picture per frame; a scene of one model gives one.
26
+ * @throws {Error} When the plugin has no screenshot helper.
27
+ */
28
+ export async function captureFrames(plugin, size, playback) {
29
+ const pass = pictureHelper(plugin, size).imagePass;
30
+ const loop = plugin.animationLoop;
31
+ const shown = shownTrajectoryFrame(plugin);
32
+ const count = Math.max(1, trajectoryFrameCount(plugin));
33
+ await stopTrajectory(plugin);
34
+ loop.stop({ noDraw: true });
35
+ try {
36
+ await pass.updateBackground();
37
+ const frames = [];
38
+ for (let index = 0; index < count; index++) {
39
+ // eslint-disable-next-line no-await-in-loop -- each frame is a commit of the state tree, and commits must not interleave
40
+ if (count > 1)
41
+ await showTrajectoryFrame(plugin, index);
42
+ // The scene is otherwise committed on the next animation frame, after
43
+ // the picture has been taken of the previous one.
44
+ plugin.canvas3d?.commit(true);
45
+ // eslint-disable-next-line no-await-in-loop -- one render at a time on the one image pass
46
+ const image = await plugin.runTask(Task.create('Render a frame', (runtime) => pass.getImageData(runtime, size.width, size.height)));
47
+ frames.push(image);
48
+ }
49
+ return frames;
50
+ }
51
+ finally {
52
+ if (count > 1)
53
+ await showTrajectoryFrame(plugin, shown);
54
+ loop.start({ immediate: true });
55
+ await setTrajectoryPlayback(plugin, playback.playing, playback.framesPerSecond);
56
+ }
57
+ }
58
+ /**
59
+ * The screenshot helper, set to draw a picture of `size` with no axes and an
60
+ * opaque background.
61
+ * @param plugin - The molstar context.
62
+ * @param size - Pixel size of the picture.
63
+ * @returns The helper.
64
+ * @throws {Error} When the plugin has no screenshot helper.
65
+ */
66
+ function pictureHelper(plugin, size) {
12
67
  const helper = plugin.helpers.viewportScreenshot;
13
68
  if (helper === undefined) {
14
69
  throw new Error('This viewer cannot take a picture of its scene.');
@@ -19,6 +74,6 @@ export async function captureScene(plugin, size) {
19
74
  axes: { name: 'off', params: {} },
20
75
  transparent: false,
21
76
  });
22
- return helper.getImageDataUri();
77
+ return helper;
23
78
  }
24
79
  //# sourceMappingURL=captureScene.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"captureScene.js","sourceRoot":"","sources":["../../../src/molstar/core/captureScene.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAqB,EACrB,IAAe;IAEf,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACjD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;QAC3B,GAAG,MAAM,CAAC,MAAM;QAChB,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;QAC5C,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACjC,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,eAAe,EAAE,CAAC;AAClC,CAAC"}
1
+ {"version":3,"file":"captureScene.js","sourceRoot":"","sources":["../../../src/molstar/core/captureScene.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAIrD,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAqB,EACrB,IAAe;IAEf,OAAO,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACvD,CAA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T,IAAI,KAAK,GAAG,CAAC;YAAE,MAAM,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,MAAM,qBAAqB,CACzB,MAAM,EACN,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,eAAe,CACzB,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,aAAa,CACpB,MAAqB,EACrB,IAAe;IAEf,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACjD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;QAC3B,GAAG,MAAM,CAAC,MAAM;QAChB,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;QAC5C,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACjC,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * The molstar layer under the 3D views: the plugin lifecycle, the camera, the
3
- * hover labels, the measurements, the highlights and the picture of a scene.
3
+ * hover labels, the measurements, the highlights, the frames of a trajectory
4
+ * and the picture of a scene.
4
5
  *
5
6
  * Three of our sites mount a headless molstar canvas — the molecule viewer
6
7
  * here, lcao's orbitals and symmetry's crystals — and each of them had its own
@@ -24,7 +25,9 @@ export type { HoverLabel } from './hover.ts';
24
25
  export { atomName, atomText, lociText, subscribeHover, subscribeHoverLabel, } from './hover.ts';
25
26
  export type { MolstarPluginOptions } from './plugin.ts';
26
27
  export { MolstarPlugin } from './plugin.ts';
27
- export { captureScene } from './captureScene.ts';
28
+ export type { FramePlayback } from './captureScene.ts';
29
+ export { captureFrames, captureScene } from './captureScene.ts';
28
30
  export type { MoleculeStructureSource } from './measurements.ts';
29
31
  export { MeasurementPicker, atomReferenceOf, clearMeasurements, renderMeasurements, } from './measurements.ts';
32
+ export { PLAYBACK_FPS_RANGE, clampFramesPerSecond, setTrajectoryPlayback, showTrajectoryFrame, shownTrajectoryFrame, stopTrajectory, trajectoryFrameCount, } from './trajectory.ts';
30
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,OAAO,GACR,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,OAAO,GACR,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,GACrB,MAAM,iBAAiB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * The molstar layer under the 3D views: the plugin lifecycle, the camera, the
3
- * hover labels, the measurements, the highlights and the picture of a scene.
3
+ * hover labels, the measurements, the highlights, the frames of a trajectory
4
+ * and the picture of a scene.
4
5
  *
5
6
  * Three of our sites mount a headless molstar canvas — the molecule viewer
6
7
  * here, lcao's orbitals and symmetry's crystals — and each of them had its own
@@ -20,6 +21,7 @@ export { focusPoint, resetCamera, sceneSphere, unionSphere, } from "./framing.js
20
21
  export { HighlightPainter, highlightOverpaint } from "./highlights.js";
21
22
  export { atomName, atomText, lociText, subscribeHover, subscribeHoverLabel, } from "./hover.js";
22
23
  export { MolstarPlugin } from "./plugin.js";
23
- export { captureScene } from "./captureScene.js";
24
+ export { captureFrames, captureScene } from "./captureScene.js";
24
25
  export { MeasurementPicker, atomReferenceOf, clearMeasurements, renderMeasurements, } from "./measurements.js";
26
+ export { PLAYBACK_FPS_RANGE, clampFramesPerSecond, setTrajectoryPlayback, showTrajectoryFrame, shownTrajectoryFrame, stopTrajectory, trajectoryFrameCount, } from "./trajectory.js";
25
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molstar/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,OAAO,GACR,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CA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@@ -0,0 +1,56 @@
1
+ /**
2
+ * The frames of a trajectory: how many there are, which one is shown, and
3
+ * playing them in a loop.
4
+ *
5
+ * molstar keeps a trajectory as one data node and shows one of its frames
6
+ * through a `ModelFromTrajectory` node whose `modelIndex` says which. Playing
7
+ * is molstar's own model-index animation, which steps that index; showing one
8
+ * frame sets it.
9
+ */
10
+ import type { PluginContext } from 'molstar/lib/mol-plugin/context.js';
11
+ /** How fast molstar's model-index animation can step, frames per second. */
12
+ export declare const PLAYBACK_FPS_RANGE: {
13
+ readonly minimum: 5;
14
+ readonly maximum: 60;
15
+ };
16
+ /**
17
+ * How many frames the trajectory on screen holds.
18
+ * @param plugin - The molstar context.
19
+ * @returns The most frames of any trajectory shown; 0 when none is.
20
+ */
21
+ export declare function trajectoryFrameCount(plugin: PluginContext): number;
22
+ /**
23
+ * Show one frame of every trajectory on screen, and everything built on it:
24
+ * the drawn model, its surface and the measurements over it.
25
+ * @param plugin - The molstar context.
26
+ * @param index - The frame, from 0.
27
+ * @returns Nothing; resolves once the state tree is updated.
28
+ */
29
+ export declare function showTrajectoryFrame(plugin: PluginContext, index: number): Promise<void>;
30
+ /**
31
+ * The frame on screen.
32
+ * @param plugin - The molstar context.
33
+ * @returns The index of the frame the first trajectory shows; 0 when none is.
34
+ */
35
+ export declare function shownTrajectoryFrame(plugin: PluginContext): number;
36
+ /**
37
+ * Play the frames in a loop, or stop them where they stand.
38
+ * @param plugin - The molstar context.
39
+ * @param playing - Whether to play. A trajectory of one frame never plays.
40
+ * @param framesPerSecond - How fast, clamped into {@link PLAYBACK_FPS_RANGE}.
41
+ * @returns Nothing; resolves once the animation is started or stopped.
42
+ */
43
+ export declare function setTrajectoryPlayback(plugin: PluginContext, playing: boolean, framesPerSecond: number): Promise<void>;
44
+ /**
45
+ * Stop the frames where they stand.
46
+ * @param plugin - The molstar context.
47
+ * @returns Nothing; resolves once the animation is stopped.
48
+ */
49
+ export declare function stopTrajectory(plugin: PluginContext): Promise<void>;
50
+ /**
51
+ * A frame rate molstar's model-index animation accepts.
52
+ * @param framesPerSecond - Any rate.
53
+ * @returns The rate, rounded and clamped into {@link PLAYBACK_FPS_RANGE}.
54
+ */
55
+ export declare function clampFramesPerSecond(framesPerSecond: number): number;
56
+ //# sourceMappingURL=trajectory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trajectory.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/trajectory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAMvE,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB;;;CAAuC,CAAC;AAEvE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAalE;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAElE;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAIpE"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The frames of a trajectory: how many there are, which one is shown, and
3
+ * playing them in a loop.
4
+ *
5
+ * molstar keeps a trajectory as one data node and shows one of its frames
6
+ * through a `ModelFromTrajectory` node whose `modelIndex` says which. Playing
7
+ * is molstar's own model-index animation, which steps that index; showing one
8
+ * frame sets it.
9
+ */
10
+ import { AnimateModelIndex } from 'molstar/lib/mol-plugin-state/animation/built-in/model-index.js';
11
+ import { PluginStateObject } from 'molstar/lib/mol-plugin-state/objects.js';
12
+ import { ModelFromTrajectory } from 'molstar/lib/mol-plugin-state/transforms/model.js';
13
+ import { StateSelection } from 'molstar/lib/mol-state/index.js';
14
+ /** How fast molstar's model-index animation can step, frames per second. */
15
+ export const PLAYBACK_FPS_RANGE = { minimum: 5, maximum: 60 };
16
+ /**
17
+ * How many frames the trajectory on screen holds.
18
+ * @param plugin - The molstar context.
19
+ * @returns The most frames of any trajectory shown; 0 when none is.
20
+ */
21
+ export function trajectoryFrameCount(plugin) {
22
+ const state = plugin.state.data;
23
+ let count = 0;
24
+ for (const model of modelCells(plugin)) {
25
+ const trajectory = StateSelection.findAncestorOfType(state.tree, state.cells, model.transform.ref, PluginStateObject.Molecule.Trajectory);
26
+ count = Math.max(count, trajectory?.obj?.data.frameCount ?? 0);
27
+ }
28
+ return count;
29
+ }
30
+ /**
31
+ * Show one frame of every trajectory on screen, and everything built on it:
32
+ * the drawn model, its surface and the measurements over it.
33
+ * @param plugin - The molstar context.
34
+ * @param index - The frame, from 0.
35
+ * @returns Nothing; resolves once the state tree is updated.
36
+ */
37
+ export async function showTrajectoryFrame(plugin, index) {
38
+ const update = plugin.build();
39
+ for (const model of modelCells(plugin)) {
40
+ update.to(model).update({ modelIndex: index });
41
+ }
42
+ await update.commit();
43
+ }
44
+ /**
45
+ * The frame on screen.
46
+ * @param plugin - The molstar context.
47
+ * @returns The index of the frame the first trajectory shows; 0 when none is.
48
+ */
49
+ export function shownTrajectoryFrame(plugin) {
50
+ return modelCells(plugin)[0]?.transform.params?.modelIndex ?? 0;
51
+ }
52
+ /**
53
+ * Play the frames in a loop, or stop them where they stand.
54
+ * @param plugin - The molstar context.
55
+ * @param playing - Whether to play. A trajectory of one frame never plays.
56
+ * @param framesPerSecond - How fast, clamped into {@link PLAYBACK_FPS_RANGE}.
57
+ * @returns Nothing; resolves once the animation is started or stopped.
58
+ */
59
+ export async function setTrajectoryPlayback(plugin, playing, framesPerSecond) {
60
+ if (!playing || trajectoryFrameCount(plugin) < 2) {
61
+ await stopTrajectory(plugin);
62
+ return;
63
+ }
64
+ await plugin.managers.animation.play(AnimateModelIndex, {
65
+ mode: { name: 'loop', params: { direction: 'forward' } },
66
+ duration: {
67
+ name: 'sequential',
68
+ params: { maxFps: clampFramesPerSecond(framesPerSecond) },
69
+ },
70
+ });
71
+ }
72
+ /**
73
+ * Stop the frames where they stand.
74
+ * @param plugin - The molstar context.
75
+ * @returns Nothing; resolves once the animation is stopped.
76
+ */
77
+ export async function stopTrajectory(plugin) {
78
+ const animation = plugin.managers.animation;
79
+ if (animation.isAnimating)
80
+ await animation.stop();
81
+ }
82
+ /**
83
+ * A frame rate molstar's model-index animation accepts.
84
+ * @param framesPerSecond - Any rate.
85
+ * @returns The rate, rounded and clamped into {@link PLAYBACK_FPS_RANGE}.
86
+ */
87
+ export function clampFramesPerSecond(framesPerSecond) {
88
+ const { minimum, maximum } = PLAYBACK_FPS_RANGE;
89
+ if (!Number.isFinite(framesPerSecond))
90
+ return minimum;
91
+ return Math.min(maximum, Math.max(minimum, Math.round(framesPerSecond)));
92
+ }
93
+ function modelCells(plugin) {
94
+ return plugin.state.data.select(StateSelection.Generators.ofTransformer(ModelFromTrajectory));
95
+ }
96
+ //# sourceMappingURL=trajectory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trajectory.js","sourceRoot":"","sources":["../../../src/molstar/core/trajectory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,4EAA4E;AAC5E,MAAM,CAAC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"}
@@ -1 +1 @@
1
- {"version":3,"file":"PanelRail.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/PanelRail.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;GAMG;AACH,MAAM,WAAW,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACpD,8DAA8D;IAC9D,EAAE,EAAE,GAAG,CAAC;IACR,yCAAyC;IACzC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC9B,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8BAA8B;AAC9B,MAAM,WAAW,cAAc,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACzD,uDAAuD;IACvD,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,8BAA8B;IAC9B,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,SAAS,MAAM,EAC1C,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,GACzB,SAAS,CAiBX"}
1
+ {"version":3,"file":"PanelRail.d.ts","sourceRoot":"","sources":["../../../src/panel/ui/PanelRail.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;GAMG;AACH,MAAM,WAAW,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACpD,8DAA8D;IAC9D,EAAE,EAAE,GAAG,CAAC;IACR,yCAAyC;IACzC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC9B,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8BAA8B;AAC9B,MAAM,WAAW,cAAc,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACzD,uDAAuD;IACvD,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,8BAA8B;IAC9B,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,SAAS,MAAM,EAC1C,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,GACzB,SAAS,CAoBX"}
@@ -7,6 +7,6 @@ import { ActivityBar } from 'react-science/ui';
7
7
  */
8
8
  export function PanelRail(props) {
9
9
  const { panels, openIds, onToggle } = props;
10
- return (_jsx(ActivityBar, { children: panels.map((panel) => (_jsx(ActivityBar.Item, { id: panel.id, icon: panel.icon, tooltip: panel.title, active: openIds.includes(panel.id), onClick: () => onToggle(panel.id) }, panel.id))) }));
10
+ return (_jsx(ActivityBar, { children: panels.map((panel) => (_jsx(ActivityBar.Item, { id: panel.id, icon: panel.icon, tooltip: panel.title, "aria-label": panel.title, active: openIds.includes(panel.id), onClick: () => onToggle(panel.id) }, panel.id))) }));
11
11
  }
12
12
  //# sourceMappingURL=PanelRail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PanelRail.js","sourceRoot":"","sources":["../../../src/panel/ui/PanelRail.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA4B/C;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,KAA0B;IAE1B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAA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ance.
9
9
  */
10
10
  export type { LoadedIrSpectrum } from './ir/core/analysisSpectra.ts';
11
- export type { IrEditorHandle } from './ir/core/irEditorApi.ts';
11
+ export type { IrEditorHandle, IrPlotClick } from './ir/core/irEditorApi.ts';
12
12
  export type { IrSpectrum } from './ir/core/irSpectrum.ts';
13
13
  export { toIrSpectra } from './ir/core/toIrSpectrum.ts';
14
+ export type { IrHostPanel } from './ir/ui/irHostPanels.ts';
14
15
  export type { RamanEditorHandle, RamanEditorProps, } from './ir/ui/RamanEditor.tsx';
15
16
  export { RamanEditor } from './ir/ui/RamanEditor.tsx';
16
17
  //# sourceMappingURL=raman.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"raman.d.ts","sourceRoot":"","sources":["../src/raman.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"raman.d.ts","sourceRoot":"","sources":["../src/raman.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5E,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC"}
package/lib/raman.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"raman.js","sourceRoot":"","sources":["../src/raman.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAKxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAyB,CAAC"}
1
+ {"version":3,"file":"raman.js","sourceRoot":"","sources":["../src/raman.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAMxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAyB,CAAC"}
@@ -2,8 +2,8 @@
2
2
  * Where a site is mounted, read off the page rather than off the build.
3
3
  *
4
4
  * The build is mount-agnostic — vite is given a relative base, so the same
5
- * `dist` serves `https://surge.cheminfo.org/` and
6
- * `https://www.cheminfo.org/surge/`. What tells the two apart is the `<base>`
5
+ * `dist` serves `https://isomers.cheminfo.org/` and
6
+ * `https://www.cheminfo.org/isomers/`. What tells the two apart is the `<base>`
7
7
  * the deployment stamps into the page it hands out, and `document.baseURI`
8
8
  * resolves it against the address actually opened. So this answers correctly
9
9
  * whether or not a slash closes the address, and on an address the SPA
@@ -3,8 +3,8 @@ import { trimTrailingSlash } from "./address.js";
3
3
  * Where a site is mounted, read off the page rather than off the build.
4
4
  *
5
5
  * The build is mount-agnostic — vite is given a relative base, so the same
6
- * `dist` serves `https://surge.cheminfo.org/` and
7
- * `https://www.cheminfo.org/surge/`. What tells the two apart is the `<base>`
6
+ * `dist` serves `https://isomers.cheminfo.org/` and
7
+ * `https://www.cheminfo.org/isomers/`. What tells the two apart is the `<base>`
8
8
  * the deployment stamps into the page it hands out, and `document.baseURI`
9
9
  * resolves it against the address actually opened. So this answers correctly
10
10
  * whether or not a slash closes the address, and on an address the SPA
@@ -6,7 +6,7 @@ import type { SiteId } from '../../ecosystem/core/sites.ts';
6
6
  *
7
7
  * The mount is read off the page, not off the build: the build carries no
8
8
  * mount, and the `<base>` a deployment stamps into its pages is what tells
9
- * `https://surge.cheminfo.org/` from `https://www.cheminfo.org/surge/`. Under
9
+ * `https://isomers.cheminfo.org/` from `https://www.cheminfo.org/isomers/`. Under
10
10
  * Node there is no page, and the mount is the root.
11
11
  * @param siteId - The site, as `ECOSYSTEM_SITES` names it.
12
12
  * @param options - A mount path to use instead of the one read off the page.
@@ -8,7 +8,7 @@ import { joinBasePath, normalizeBasePath, readMountPath, stripBasePath, } from "
8
8
  *
9
9
  * The mount is read off the page, not off the build: the build carries no
10
10
  * mount, and the `<base>` a deployment stamps into its pages is what tells
11
- * `https://surge.cheminfo.org/` from `https://www.cheminfo.org/surge/`. Under
11
+ * `https://isomers.cheminfo.org/` from `https://www.cheminfo.org/isomers/`. Under
12
12
  * Node there is no page, and the mount is the root.
13
13
  * @param siteId - The site, as `ECOSYSTEM_SITES` names it.
14
14
  * @param options - A mount path to use instead of the one read off the page.
@@ -77,7 +77,7 @@ export function resolveSite(site) {
77
77
  export function originOf(options) {
78
78
  const origin = options.origin ?? `https://${resolveSite(options.site).host}`;
79
79
  if (!HTTP_ORIGIN.test(origin) || !URL.canParse(origin)) {
80
- throw new Error(`an origin is an absolute address, e.g. https://surge.cheminfo.org: ${JSON.stringify(origin)}`);
80
+ throw new Error(`an origin is an absolute address, e.g. https://isomers.cheminfo.org: ${JSON.stringify(origin)}`);
81
81
  }
82
82
  return trimTrailingSlash(origin);
83
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"siteFiles.js","sourceRoot":"","sources":["../../../src/seo/core/siteFiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAA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C,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACb,wEAAwE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,OAAmB;IAC7C,OAAO,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AACvC,CAAC"}
@@ -6,9 +6,9 @@
6
6
  * The two are written however the deployment writes them — an origin, an
7
7
  * origin and a mount, with or without a trailing slash — and a page is named
8
8
  * from the site's own root, `/titration` and `titration` alike: every helper
9
- * joins the two with exactly one slash, so `https://www.cheminfo.org/surge`
10
- * and `https://www.cheminfo.org/surge/` both put `/generator` at
11
- * `https://www.cheminfo.org/surge/generator`.
9
+ * joins the two with exactly one slash, so `https://www.cheminfo.org/isomers`
10
+ * and `https://www.cheminfo.org/isomers/` both put `/generator` at
11
+ * `https://www.cheminfo.org/isomers/generator`.
12
12
  */
13
13
  /** Where the pages of an answer are served, as a deployment writes them. */
14
14
  export interface AnswerAddressesInput {
@@ -6,9 +6,9 @@
6
6
  * The two are written however the deployment writes them — an origin, an
7
7
  * origin and a mount, with or without a trailing slash — and a page is named
8
8
  * from the site's own root, `/titration` and `titration` alike: every helper
9
- * joins the two with exactly one slash, so `https://www.cheminfo.org/surge`
10
- * and `https://www.cheminfo.org/surge/` both put `/generator` at
11
- * `https://www.cheminfo.org/surge/generator`.
9
+ * joins the two with exactly one slash, so `https://www.cheminfo.org/isomers`
10
+ * and `https://www.cheminfo.org/isomers/` both put `/generator` at
11
+ * `https://www.cheminfo.org/isomers/generator`.
12
12
  */
13
13
  import { trimTrailingSlash } from "../router/core/address.js";
14
14
  import { joinBasePath } from "../router/core/basePath.js";
@@ -28,4 +28,6 @@ export type { StructurePicture, StructurePictureOptions, } from './structurePict
28
28
  export { STRUCTURE_BOND_LENGTH, structurePicture } from './structurePicture.ts';
29
29
  export type { StructureSource, StructureSourceInput, } from './structureSource.ts';
30
30
  export { structureSource } from './structureSource.ts';
31
+ export type { StructureTransfer, StructureTransferSource, } from './structureTransfer.ts';
32
+ export { carriesStructure, readStructureTransfer, } from './structureTransfer.ts';
31
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/structure/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,YAAY,EACZ,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,aAAa,EACb,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AACpC,YAA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jB,eAAe,EACf,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACV,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChF,YAAY,EACV,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EACV,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC"}
@@ -13,4 +13,5 @@ export { looksLikeSmarts, readStructure } from "./readStructure.js";
13
13
  export { structureError } from "./structureError.js";
14
14
  export { STRUCTURE_BOND_LENGTH, structurePicture } from "./structurePicture.js";
15
15
  export { structureSource } from "./structureSource.js";
16
+ export { carriesStructure, readStructureTransfer, } from "./structureTransfer.js";
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structure/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAOtE,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAKhF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structure/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAOtE,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAKhF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /** What a paste or a drop carried that a structure can be read from. */
2
+ export type StructureTransfer = {
3
+ kind: 'files';
4
+ files: File[];
5
+ } | {
6
+ kind: 'text';
7
+ text: string;
8
+ };
9
+ /** The part of a `DataTransfer` a structure is read from. */
10
+ export interface StructureTransferSource {
11
+ files: ArrayLike<File>;
12
+ getData: (format: string) => string;
13
+ }
14
+ /**
15
+ * What a paste or a drop holds: its files when it carries any, otherwise its
16
+ * text — a SMILES, an idCode, a molfile. A file copied in the file manager also
17
+ * carries its name as text, so the files win.
18
+ * @param transfer - The clipboard or drag data, `null` when the event has none.
19
+ * @returns The files or the trimmed text, or `null` when there is nothing.
20
+ */
21
+ export declare function readStructureTransfer(transfer: StructureTransferSource | null): StructureTransfer | null;
22
+ /**
23
+ * Whether a drag in progress may carry a structure. Until the drop only the
24
+ * types are readable, never the content, so a file or plain text is enough.
25
+ * @param types - `DataTransfer.types` of the drag.
26
+ * @returns Whether it is worth offering to take the drop.
27
+ */
28
+ export declare function carriesStructure(types: readonly string[]): boolean;
29
+ //# sourceMappingURL=structureTransfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structureTransfer.d.ts","sourceRoot":"","sources":["../../../src/structure/core/structureTransfer.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,MAAM,iBAAiB,GAC3B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,6DAA6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CACrC;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,uBAAuB,GAAG,IAAI,GACvC,iBAAiB,GAAG,IAAI,CAO1B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAElE"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * What a paste or a drop holds: its files when it carries any, otherwise its
3
+ * text — a SMILES, an idCode, a molfile. A file copied in the file manager also
4
+ * carries its name as text, so the files win.
5
+ * @param transfer - The clipboard or drag data, `null` when the event has none.
6
+ * @returns The files or the trimmed text, or `null` when there is nothing.
7
+ */
8
+ export function readStructureTransfer(transfer) {
9
+ if (transfer === null)
10
+ return null;
11
+ if (transfer.files.length > 0) {
12
+ return { kind: 'files', files: Array.from(transfer.files) };
13
+ }
14
+ const text = transfer.getData('text').trim();
15
+ return text === '' ? null : { kind: 'text', text };
16
+ }
17
+ /**
18
+ * Whether a drag in progress may carry a structure. Until the drop only the
19
+ * types are readable, never the content, so a file or plain text is enough.
20
+ * @param types - `DataTransfer.types` of the drag.
21
+ * @returns Whether it is worth offering to take the drop.
22
+ */
23
+ export function carriesStructure(types) {
24
+ return types.includes('Files') || types.includes('text/plain');
25
+ }
26
+ //# sourceMappingURL=structureTransfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structureTransfer.js","sourceRoot":"","sources":["../../../src/structure/core/structureTransfer.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAwC;IAExC,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;IAC9D,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7C,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAwB;IACvD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACjE,CAAC"}