react-cheminfo 0.28.0 → 0.30.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 (742) hide show
  1. package/README.md +79 -26
  2. package/lib/chart/core/axisLabels.d.ts +82 -0
  3. package/lib/chart/core/axisLabels.d.ts.map +1 -0
  4. package/lib/chart/core/axisLabels.js +111 -0
  5. package/lib/chart/core/axisLabels.js.map +1 -0
  6. package/lib/chart/core/boxLayout.d.ts +53 -0
  7. package/lib/chart/core/boxLayout.d.ts.map +1 -0
  8. package/lib/chart/core/boxLayout.js +112 -0
  9. package/lib/chart/core/boxLayout.js.map +1 -0
  10. package/lib/chart/core/chartAxisScale.d.ts +23 -2
  11. package/lib/chart/core/chartAxisScale.d.ts.map +1 -1
  12. package/lib/chart/core/chartAxisScale.js +64 -13
  13. package/lib/chart/core/chartAxisScale.js.map +1 -1
  14. package/lib/chart/core/chartDomain.d.ts +160 -0
  15. package/lib/chart/core/chartDomain.d.ts.map +1 -0
  16. package/lib/chart/core/chartDomain.js +46 -0
  17. package/lib/chart/core/chartDomain.js.map +1 -0
  18. package/lib/chart/core/chartGeometry.d.ts +131 -0
  19. package/lib/chart/core/chartGeometry.d.ts.map +1 -0
  20. package/lib/chart/core/chartGeometry.js +101 -0
  21. package/lib/chart/core/chartGeometry.js.map +1 -0
  22. package/lib/chart/core/chartPane.d.ts +11 -0
  23. package/lib/chart/core/chartPane.d.ts.map +1 -0
  24. package/lib/chart/core/chartPane.js +11 -0
  25. package/lib/chart/core/chartPane.js.map +1 -0
  26. package/lib/chart/core/chartScale.d.ts +4 -1
  27. package/lib/chart/core/chartScale.d.ts.map +1 -1
  28. package/lib/chart/core/chartScale.js +8 -4
  29. package/lib/chart/core/chartScale.js.map +1 -1
  30. package/lib/chart/core/chartTheme.d.ts +156 -0
  31. package/lib/chart/core/chartTheme.d.ts.map +1 -0
  32. package/lib/chart/core/chartTheme.js +156 -0
  33. package/lib/chart/core/chartTheme.js.map +1 -0
  34. package/lib/chart/core/chartViewport.d.ts +32 -5
  35. package/lib/chart/core/chartViewport.d.ts.map +1 -1
  36. package/lib/chart/core/chartViewport.js +40 -11
  37. package/lib/chart/core/chartViewport.js.map +1 -1
  38. package/lib/chart/core/guidePlacement.d.ts +52 -0
  39. package/lib/chart/core/guidePlacement.d.ts.map +1 -0
  40. package/lib/chart/core/guidePlacement.js +52 -0
  41. package/lib/chart/core/guidePlacement.js.map +1 -0
  42. package/lib/chart/core/index.d.ts +29 -2
  43. package/lib/chart/core/index.d.ts.map +1 -1
  44. package/lib/chart/core/index.js +19 -2
  45. package/lib/chart/core/index.js.map +1 -1
  46. package/lib/chart/core/labelStack.d.ts +27 -0
  47. package/lib/chart/core/labelStack.d.ts.map +1 -0
  48. package/lib/chart/core/labelStack.js +62 -0
  49. package/lib/chart/core/labelStack.js.map +1 -0
  50. package/lib/chart/core/legendBox.d.ts +152 -0
  51. package/lib/chart/core/legendBox.d.ts.map +1 -0
  52. package/lib/chart/core/legendBox.js +169 -0
  53. package/lib/chart/core/legendBox.js.map +1 -0
  54. package/lib/chart/core/selectionGeometry.d.ts +45 -0
  55. package/lib/chart/core/selectionGeometry.d.ts.map +1 -0
  56. package/lib/chart/core/selectionGeometry.js +49 -0
  57. package/lib/chart/core/selectionGeometry.js.map +1 -0
  58. package/lib/chart/core/spectrumColor.d.ts +80 -0
  59. package/lib/chart/core/spectrumColor.d.ts.map +1 -0
  60. package/lib/chart/core/spectrumColor.js +120 -0
  61. package/lib/chart/core/spectrumColor.js.map +1 -0
  62. package/lib/chart/core/stackCapacity.d.ts +136 -0
  63. package/lib/chart/core/stackCapacity.d.ts.map +1 -0
  64. package/lib/chart/core/stackCapacity.js +153 -0
  65. package/lib/chart/core/stackCapacity.js.map +1 -0
  66. package/lib/chart/core/svgPoint.d.ts +62 -0
  67. package/lib/chart/core/svgPoint.d.ts.map +1 -0
  68. package/lib/chart/core/svgPoint.js +43 -0
  69. package/lib/chart/core/svgPoint.js.map +1 -0
  70. package/lib/chart/core/tracePath.d.ts +94 -0
  71. package/lib/chart/core/tracePath.d.ts.map +1 -0
  72. package/lib/chart/core/tracePath.js +191 -0
  73. package/lib/chart/core/tracePath.js.map +1 -0
  74. package/lib/chart/core/trackerReadout.d.ts +55 -0
  75. package/lib/chart/core/trackerReadout.d.ts.map +1 -0
  76. package/lib/chart/core/trackerReadout.js +53 -0
  77. package/lib/chart/core/trackerReadout.js.map +1 -0
  78. package/lib/chart/core/viewTransform.d.ts +167 -0
  79. package/lib/chart/core/viewTransform.d.ts.map +1 -0
  80. package/lib/chart/core/viewTransform.js +188 -0
  81. package/lib/chart/core/viewTransform.js.map +1 -0
  82. package/lib/chart/core/zoomDomain.d.ts +127 -0
  83. package/lib/chart/core/zoomDomain.d.ts.map +1 -0
  84. package/lib/chart/core/zoomDomain.js +175 -0
  85. package/lib/chart/core/zoomDomain.js.map +1 -0
  86. package/lib/chart/ui/Axes.d.ts +104 -0
  87. package/lib/chart/ui/Axes.d.ts.map +1 -0
  88. package/lib/chart/ui/Axes.js +155 -0
  89. package/lib/chart/ui/Axes.js.map +1 -0
  90. package/lib/chart/ui/AxisGuide.d.ts +60 -0
  91. package/lib/chart/ui/AxisGuide.d.ts.map +1 -0
  92. package/lib/chart/ui/AxisGuide.js +111 -0
  93. package/lib/chart/ui/AxisGuide.js.map +1 -0
  94. package/lib/chart/ui/ChartStack.d.ts +81 -0
  95. package/lib/chart/ui/ChartStack.d.ts.map +1 -0
  96. package/lib/chart/ui/ChartStack.js +42 -0
  97. package/lib/chart/ui/ChartStack.js.map +1 -0
  98. package/lib/chart/ui/ChartTracker.d.ts +36 -0
  99. package/lib/chart/ui/ChartTracker.d.ts.map +1 -0
  100. package/lib/chart/ui/ChartTracker.js +27 -0
  101. package/lib/chart/ui/ChartTracker.js.map +1 -0
  102. package/lib/chart/ui/PlotCaption.d.ts +44 -0
  103. package/lib/chart/ui/PlotCaption.d.ts.map +1 -0
  104. package/lib/chart/ui/PlotCaption.js +68 -0
  105. package/lib/chart/ui/PlotCaption.js.map +1 -0
  106. package/lib/chart/ui/SelectionRect.d.ts +27 -0
  107. package/lib/chart/ui/SelectionRect.d.ts.map +1 -0
  108. package/lib/chart/ui/SelectionRect.js +31 -0
  109. package/lib/chart/ui/SelectionRect.js.map +1 -0
  110. package/lib/chart/ui/TraceLegend.d.ts +99 -0
  111. package/lib/chart/ui/TraceLegend.d.ts.map +1 -0
  112. package/lib/chart/ui/TraceLegend.js +45 -0
  113. package/lib/chart/ui/TraceLegend.js.map +1 -0
  114. package/lib/chart/ui/chartGestures.d.ts +158 -0
  115. package/lib/chart/ui/chartGestures.d.ts.map +1 -0
  116. package/lib/chart/ui/chartGestures.js +145 -0
  117. package/lib/chart/ui/chartGestures.js.map +1 -0
  118. package/lib/chart/ui/chartStackLevel.d.ts +115 -0
  119. package/lib/chart/ui/chartStackLevel.d.ts.map +1 -0
  120. package/lib/chart/ui/chartStackLevel.js +96 -0
  121. package/lib/chart/ui/chartStackLevel.js.map +1 -0
  122. package/lib/chart/ui/chartSurface.d.ts +35 -0
  123. package/lib/chart/ui/chartSurface.d.ts.map +1 -0
  124. package/lib/chart/ui/chartSurface.js +58 -0
  125. package/lib/chart/ui/chartSurface.js.map +1 -0
  126. package/lib/chart/ui/index.d.ts +24 -0
  127. package/lib/chart/ui/index.d.ts.map +1 -1
  128. package/lib/chart/ui/index.js +13 -0
  129. package/lib/chart/ui/index.js.map +1 -1
  130. package/lib/chart/ui/useChartPointer.d.ts +124 -0
  131. package/lib/chart/ui/useChartPointer.d.ts.map +1 -0
  132. package/lib/chart/ui/useChartPointer.js +152 -0
  133. package/lib/chart/ui/useChartPointer.js.map +1 -0
  134. package/lib/chart/ui/useChartSize.d.ts +49 -0
  135. package/lib/chart/ui/useChartSize.d.ts.map +1 -0
  136. package/lib/chart/ui/useChartSize.js +91 -0
  137. package/lib/chart/ui/useChartSize.js.map +1 -0
  138. package/lib/chart/ui/useChartWindow.d.ts +147 -0
  139. package/lib/chart/ui/useChartWindow.d.ts.map +1 -0
  140. package/lib/chart/ui/useChartWindow.js +135 -0
  141. package/lib/chart/ui/useChartWindow.js.map +1 -0
  142. package/lib/chart/ui/useChartZoom.d.ts +88 -0
  143. package/lib/chart/ui/useChartZoom.d.ts.map +1 -0
  144. package/lib/chart/ui/useChartZoom.js +142 -0
  145. package/lib/chart/ui/useChartZoom.js.map +1 -0
  146. package/lib/chart/ui/useWheelListener.d.ts +30 -0
  147. package/lib/chart/ui/useWheelListener.d.ts.map +1 -0
  148. package/lib/chart/ui/useWheelListener.js +57 -0
  149. package/lib/chart/ui/useWheelListener.js.map +1 -0
  150. package/lib/chrome/ui/AccountButton.d.ts +76 -0
  151. package/lib/chrome/ui/AccountButton.d.ts.map +1 -0
  152. package/lib/chrome/ui/AccountButton.js +66 -0
  153. package/lib/chrome/ui/AccountButton.js.map +1 -0
  154. package/lib/chrome/ui/index.d.ts +2 -0
  155. package/lib/chrome/ui/index.d.ts.map +1 -1
  156. package/lib/chrome/ui/index.js +1 -0
  157. package/lib/chrome/ui/index.js.map +1 -1
  158. package/lib/clipboard/core/copyPng.d.ts +13 -0
  159. package/lib/clipboard/core/copyPng.d.ts.map +1 -0
  160. package/lib/clipboard/core/copyPng.js +19 -0
  161. package/lib/clipboard/core/copyPng.js.map +1 -0
  162. package/lib/clipboard/core/index.d.ts +1 -0
  163. package/lib/clipboard/core/index.d.ts.map +1 -1
  164. package/lib/clipboard/core/index.js +1 -0
  165. package/lib/clipboard/core/index.js.map +1 -1
  166. package/lib/clipboard/ui/ClickToCopy.d.ts +6 -0
  167. package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
  168. package/lib/clipboard/ui/ClickToCopy.js +3 -3
  169. package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
  170. package/lib/core.d.ts +1 -0
  171. package/lib/core.d.ts.map +1 -1
  172. package/lib/core.js +1 -0
  173. package/lib/core.js.map +1 -1
  174. package/lib/download/core/exportStyles.d.ts +22 -0
  175. package/lib/download/core/exportStyles.d.ts.map +1 -0
  176. package/lib/download/core/exportStyles.js +19 -0
  177. package/lib/download/core/exportStyles.js.map +1 -0
  178. package/lib/download/core/imageResolution.d.ts +88 -0
  179. package/lib/download/core/imageResolution.d.ts.map +1 -0
  180. package/lib/download/core/imageResolution.js +77 -0
  181. package/lib/download/core/imageResolution.js.map +1 -0
  182. package/lib/download/core/index.d.ts +13 -0
  183. package/lib/download/core/index.d.ts.map +1 -1
  184. package/lib/download/core/index.js +8 -0
  185. package/lib/download/core/index.js.map +1 -1
  186. package/lib/download/core/pictureExport.d.ts +93 -0
  187. package/lib/download/core/pictureExport.d.ts.map +1 -0
  188. package/lib/download/core/pictureExport.js +116 -0
  189. package/lib/download/core/pictureExport.js.map +1 -0
  190. package/lib/download/core/stackedDrawing.d.ts +36 -0
  191. package/lib/download/core/stackedDrawing.d.ts.map +1 -0
  192. package/lib/download/core/stackedDrawing.js +98 -0
  193. package/lib/download/core/stackedDrawing.js.map +1 -0
  194. package/lib/download/core/svgBounds.d.ts +44 -0
  195. package/lib/download/core/svgBounds.d.ts.map +1 -0
  196. package/lib/download/core/svgBounds.js +69 -0
  197. package/lib/download/core/svgBounds.js.map +1 -0
  198. package/lib/download/core/svgNamespace.d.ts +9 -0
  199. package/lib/download/core/svgNamespace.d.ts.map +1 -0
  200. package/lib/download/core/svgNamespace.js +10 -0
  201. package/lib/download/core/svgNamespace.js.map +1 -0
  202. package/lib/download/core/svgToPng.d.ts +43 -0
  203. package/lib/download/core/svgToPng.d.ts.map +1 -0
  204. package/lib/download/core/svgToPng.js +79 -0
  205. package/lib/download/core/svgToPng.js.map +1 -0
  206. package/lib/download/core/svgToString.d.ts +45 -0
  207. package/lib/download/core/svgToString.d.ts.map +1 -0
  208. package/lib/download/core/svgToString.js +58 -0
  209. package/lib/download/core/svgToString.js.map +1 -0
  210. package/lib/download/ui/ExportDialogFrame.d.ts +46 -0
  211. package/lib/download/ui/ExportDialogFrame.d.ts.map +1 -0
  212. package/lib/download/ui/ExportDialogFrame.js +24 -0
  213. package/lib/download/ui/ExportDialogFrame.js.map +1 -0
  214. package/lib/download/ui/ExportImageDialog.d.ts +47 -0
  215. package/lib/download/ui/ExportImageDialog.d.ts.map +1 -0
  216. package/lib/download/ui/ExportImageDialog.js +25 -0
  217. package/lib/download/ui/ExportImageDialog.js.map +1 -0
  218. package/lib/download/ui/ExportNameField.d.ts +29 -0
  219. package/lib/download/ui/ExportNameField.d.ts.map +1 -0
  220. package/lib/download/ui/ExportNameField.js +99 -0
  221. package/lib/download/ui/ExportNameField.js.map +1 -0
  222. package/lib/download/ui/ExportPictureSection.d.ts +38 -0
  223. package/lib/download/ui/ExportPictureSection.d.ts.map +1 -0
  224. package/lib/download/ui/ExportPictureSection.js +48 -0
  225. package/lib/download/ui/ExportPictureSection.js.map +1 -0
  226. package/lib/download/ui/index.d.ts +10 -0
  227. package/lib/download/ui/index.d.ts.map +1 -1
  228. package/lib/download/ui/index.js +5 -0
  229. package/lib/download/ui/index.js.map +1 -1
  230. package/lib/download/ui/useDrawingBox.d.ts +23 -0
  231. package/lib/download/ui/useDrawingBox.d.ts.map +1 -0
  232. package/lib/download/ui/useDrawingBox.js +21 -0
  233. package/lib/download/ui/useDrawingBox.js.map +1 -0
  234. package/lib/error/core/describeSource.d.ts +17 -0
  235. package/lib/error/core/describeSource.d.ts.map +1 -0
  236. package/lib/error/core/describeSource.js +19 -0
  237. package/lib/error/core/describeSource.js.map +1 -0
  238. package/lib/error/core/index.d.ts +1 -0
  239. package/lib/error/core/index.d.ts.map +1 -1
  240. package/lib/error/core/index.js +1 -0
  241. package/lib/error/core/index.js.map +1 -1
  242. package/lib/help/ui/HelpBody.d.ts +10 -1
  243. package/lib/help/ui/HelpBody.d.ts.map +1 -1
  244. package/lib/help/ui/HelpBody.js +24 -1
  245. package/lib/help/ui/HelpBody.js.map +1 -1
  246. package/lib/help/ui/index.d.ts +1 -1
  247. package/lib/help/ui/index.d.ts.map +1 -1
  248. package/lib/help/ui/index.js.map +1 -1
  249. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  250. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  251. package/lib/ir/core/analysisSpectra.d.ts +46 -0
  252. package/lib/ir/core/analysisSpectra.d.ts.map +1 -0
  253. package/lib/ir/core/analysisSpectra.js +187 -0
  254. package/lib/ir/core/analysisSpectra.js.map +1 -0
  255. package/lib/ir/core/assignBands.d.ts +83 -0
  256. package/lib/ir/core/assignBands.d.ts.map +1 -0
  257. package/lib/ir/core/assignBands.js +83 -0
  258. package/lib/ir/core/assignBands.js.map +1 -0
  259. package/lib/ir/core/bandAssignments.d.ts +47 -0
  260. package/lib/ir/core/bandAssignments.d.ts.map +1 -0
  261. package/lib/ir/core/bandAssignments.js +305 -0
  262. package/lib/ir/core/bandAssignments.js.map +1 -0
  263. package/lib/ir/core/bandLabelPlan.d.ts +93 -0
  264. package/lib/ir/core/bandLabelPlan.d.ts.map +1 -0
  265. package/lib/ir/core/bandLabelPlan.js +104 -0
  266. package/lib/ir/core/bandLabelPlan.js.map +1 -0
  267. package/lib/ir/core/detectIrFormat.d.ts +23 -0
  268. package/lib/ir/core/detectIrFormat.d.ts.map +1 -0
  269. package/lib/ir/core/detectIrFormat.js +133 -0
  270. package/lib/ir/core/detectIrFormat.js.map +1 -0
  271. package/lib/ir/core/downloadSpectra.d.ts +26 -0
  272. package/lib/ir/core/downloadSpectra.d.ts.map +1 -0
  273. package/lib/ir/core/downloadSpectra.js +37 -0
  274. package/lib/ir/core/downloadSpectra.js.map +1 -0
  275. package/lib/ir/core/fromJcamp.d.ts +35 -0
  276. package/lib/ir/core/fromJcamp.d.ts.map +1 -0
  277. package/lib/ir/core/fromJcamp.js +48 -0
  278. package/lib/ir/core/fromJcamp.js.map +1 -0
  279. package/lib/ir/core/fromSpc.d.ts +30 -0
  280. package/lib/ir/core/fromSpc.d.ts.map +1 -0
  281. package/lib/ir/core/fromSpc.js +40 -0
  282. package/lib/ir/core/fromSpc.js.map +1 -0
  283. package/lib/ir/core/index.d.ts +51 -0
  284. package/lib/ir/core/index.d.ts.map +1 -0
  285. package/lib/ir/core/index.js +35 -0
  286. package/lib/ir/core/index.js.map +1 -0
  287. package/lib/ir/core/irBand.d.ts +45 -0
  288. package/lib/ir/core/irBand.d.ts.map +1 -0
  289. package/lib/ir/core/irBand.js +30 -0
  290. package/lib/ir/core/irBand.js.map +1 -0
  291. package/lib/ir/core/irCommands.d.ts +168 -0
  292. package/lib/ir/core/irCommands.d.ts.map +1 -0
  293. package/lib/ir/core/irCommands.js +94 -0
  294. package/lib/ir/core/irCommands.js.map +1 -0
  295. package/lib/ir/core/irDomain.d.ts +63 -0
  296. package/lib/ir/core/irDomain.d.ts.map +1 -0
  297. package/lib/ir/core/irDomain.js +136 -0
  298. package/lib/ir/core/irDomain.js.map +1 -0
  299. package/lib/ir/core/irEditorApi.d.ts +42 -0
  300. package/lib/ir/core/irEditorApi.d.ts.map +1 -0
  301. package/lib/ir/core/irEditorApi.js +10 -0
  302. package/lib/ir/core/irEditorApi.js.map +1 -0
  303. package/lib/ir/core/irFormat.d.ts +42 -0
  304. package/lib/ir/core/irFormat.d.ts.map +1 -0
  305. package/lib/ir/core/irFormat.js +51 -0
  306. package/lib/ir/core/irFormat.js.map +1 -0
  307. package/lib/ir/core/irMode.d.ts +160 -0
  308. package/lib/ir/core/irMode.d.ts.map +1 -0
  309. package/lib/ir/core/irMode.js +175 -0
  310. package/lib/ir/core/irMode.js.map +1 -0
  311. package/lib/ir/core/irReducer.d.ts +101 -0
  312. package/lib/ir/core/irReducer.d.ts.map +1 -0
  313. package/lib/ir/core/irReducer.js +207 -0
  314. package/lib/ir/core/irReducer.js.map +1 -0
  315. package/lib/ir/core/irSidePanels.d.ts +22 -0
  316. package/lib/ir/core/irSidePanels.d.ts.map +1 -0
  317. package/lib/ir/core/irSidePanels.js +12 -0
  318. package/lib/ir/core/irSidePanels.js.map +1 -0
  319. package/lib/ir/core/irSpectrum.d.ts +140 -0
  320. package/lib/ir/core/irSpectrum.d.ts.map +1 -0
  321. package/lib/ir/core/irSpectrum.js +34 -0
  322. package/lib/ir/core/irSpectrum.js.map +1 -0
  323. package/lib/ir/core/irState.d.ts +119 -0
  324. package/lib/ir/core/irState.d.ts.map +1 -0
  325. package/lib/ir/core/irState.js +92 -0
  326. package/lib/ir/core/irState.js.map +1 -0
  327. package/lib/ir/core/loadIrSpectra.d.ts +36 -0
  328. package/lib/ir/core/loadIrSpectra.d.ts.map +1 -0
  329. package/lib/ir/core/loadIrSpectra.js +44 -0
  330. package/lib/ir/core/loadIrSpectra.js.map +1 -0
  331. package/lib/ir/core/nearestBand.d.ts +35 -0
  332. package/lib/ir/core/nearestBand.d.ts.map +1 -0
  333. package/lib/ir/core/nearestBand.js +47 -0
  334. package/lib/ir/core/nearestBand.js.map +1 -0
  335. package/lib/ir/core/pickBands.d.ts +70 -0
  336. package/lib/ir/core/pickBands.d.ts.map +1 -0
  337. package/lib/ir/core/pickBands.js +125 -0
  338. package/lib/ir/core/pickBands.js.map +1 -0
  339. package/lib/ir/core/spectrumJcamp.d.ts +58 -0
  340. package/lib/ir/core/spectrumJcamp.d.ts.map +1 -0
  341. package/lib/ir/core/spectrumJcamp.js +156 -0
  342. package/lib/ir/core/spectrumJcamp.js.map +1 -0
  343. package/lib/ir/core/toIrSpectrum.d.ts +59 -0
  344. package/lib/ir/core/toIrSpectrum.d.ts.map +1 -0
  345. package/lib/ir/core/toIrSpectrum.js +56 -0
  346. package/lib/ir/core/toIrSpectrum.js.map +1 -0
  347. package/lib/ir/ui/BandMarks.d.ts +52 -0
  348. package/lib/ir/ui/BandMarks.d.ts.map +1 -0
  349. package/lib/ir/ui/BandMarks.js +71 -0
  350. package/lib/ir/ui/BandMarks.js.map +1 -0
  351. package/lib/ir/ui/BandsPanel.d.ts +31 -0
  352. package/lib/ir/ui/BandsPanel.d.ts.map +1 -0
  353. package/lib/ir/ui/BandsPanel.js +94 -0
  354. package/lib/ir/ui/BandsPanel.js.map +1 -0
  355. package/lib/ir/ui/IrAboutDialog.d.ts +18 -0
  356. package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -0
  357. package/lib/ir/ui/IrAboutDialog.js +32 -0
  358. package/lib/ir/ui/IrAboutDialog.js.map +1 -0
  359. package/lib/ir/ui/IrCanvas.d.ts +38 -0
  360. package/lib/ir/ui/IrCanvas.d.ts.map +1 -0
  361. package/lib/ir/ui/IrCanvas.js +41 -0
  362. package/lib/ir/ui/IrCanvas.js.map +1 -0
  363. package/lib/ir/ui/IrChart.d.ts +28 -0
  364. package/lib/ir/ui/IrChart.d.ts.map +1 -0
  365. package/lib/ir/ui/IrChart.js +114 -0
  366. package/lib/ir/ui/IrChart.js.map +1 -0
  367. package/lib/ir/ui/IrCommandProvider.d.ts +15 -0
  368. package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -0
  369. package/lib/ir/ui/IrCommandProvider.js +14 -0
  370. package/lib/ir/ui/IrCommandProvider.js.map +1 -0
  371. package/lib/ir/ui/IrCommandTooltip.d.ts +16 -0
  372. package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -0
  373. package/lib/ir/ui/IrCommandTooltip.js +22 -0
  374. package/lib/ir/ui/IrCommandTooltip.js.map +1 -0
  375. package/lib/ir/ui/IrDocumentationDialog.d.ts +18 -0
  376. package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -0
  377. package/lib/ir/ui/IrDocumentationDialog.js +68 -0
  378. package/lib/ir/ui/IrDocumentationDialog.js.map +1 -0
  379. package/lib/ir/ui/IrEditor.d.ts +60 -0
  380. package/lib/ir/ui/IrEditor.d.ts.map +1 -0
  381. package/lib/ir/ui/IrEditor.js +42 -0
  382. package/lib/ir/ui/IrEditor.js.map +1 -0
  383. package/lib/ir/ui/IrHeader.d.ts +13 -0
  384. package/lib/ir/ui/IrHeader.d.ts.map +1 -0
  385. package/lib/ir/ui/IrHeader.js +21 -0
  386. package/lib/ir/ui/IrHeader.js.map +1 -0
  387. package/lib/ir/ui/IrLogo.d.ts +20 -0
  388. package/lib/ir/ui/IrLogo.d.ts.map +1 -0
  389. package/lib/ir/ui/IrLogo.js +17 -0
  390. package/lib/ir/ui/IrLogo.js.map +1 -0
  391. package/lib/ir/ui/IrPointerTracker.d.ts +29 -0
  392. package/lib/ir/ui/IrPointerTracker.d.ts.map +1 -0
  393. package/lib/ir/ui/IrPointerTracker.js +47 -0
  394. package/lib/ir/ui/IrPointerTracker.js.map +1 -0
  395. package/lib/ir/ui/IrShell.d.ts +25 -0
  396. package/lib/ir/ui/IrShell.d.ts.map +1 -0
  397. package/lib/ir/ui/IrShell.js +178 -0
  398. package/lib/ir/ui/IrShell.js.map +1 -0
  399. package/lib/ir/ui/IrSidePanel.d.ts +26 -0
  400. package/lib/ir/ui/IrSidePanel.d.ts.map +1 -0
  401. package/lib/ir/ui/IrSidePanel.js +39 -0
  402. package/lib/ir/ui/IrSidePanel.js.map +1 -0
  403. package/lib/ir/ui/IrStateProvider.d.ts +19 -0
  404. package/lib/ir/ui/IrStateProvider.d.ts.map +1 -0
  405. package/lib/ir/ui/IrStateProvider.js +16 -0
  406. package/lib/ir/ui/IrStateProvider.js.map +1 -0
  407. package/lib/ir/ui/IrStatusBar.d.ts +14 -0
  408. package/lib/ir/ui/IrStatusBar.d.ts.map +1 -0
  409. package/lib/ir/ui/IrStatusBar.js +48 -0
  410. package/lib/ir/ui/IrStatusBar.js.map +1 -0
  411. package/lib/ir/ui/IrToolbar.d.ts +18 -0
  412. package/lib/ir/ui/IrToolbar.d.ts.map +1 -0
  413. package/lib/ir/ui/IrToolbar.js +32 -0
  414. package/lib/ir/ui/IrToolbar.js.map +1 -0
  415. package/lib/ir/ui/IrTraces.d.ts +63 -0
  416. package/lib/ir/ui/IrTraces.d.ts.map +1 -0
  417. package/lib/ir/ui/IrTraces.js +72 -0
  418. package/lib/ir/ui/IrTraces.js.map +1 -0
  419. package/lib/ir/ui/MetadataPanel.d.ts +15 -0
  420. package/lib/ir/ui/MetadataPanel.d.ts.map +1 -0
  421. package/lib/ir/ui/MetadataPanel.js +49 -0
  422. package/lib/ir/ui/MetadataPanel.js.map +1 -0
  423. package/lib/ir/ui/SpectraPanel.d.ts +20 -0
  424. package/lib/ir/ui/SpectraPanel.d.ts.map +1 -0
  425. package/lib/ir/ui/SpectraPanel.js +42 -0
  426. package/lib/ir/ui/SpectraPanel.js.map +1 -0
  427. package/lib/ir/ui/SpectrumRow.d.ts +26 -0
  428. package/lib/ir/ui/SpectrumRow.d.ts.map +1 -0
  429. package/lib/ir/ui/SpectrumRow.js +41 -0
  430. package/lib/ir/ui/SpectrumRow.js.map +1 -0
  431. package/lib/ir/ui/index.d.ts +56 -0
  432. package/lib/ir/ui/index.d.ts.map +1 -0
  433. package/lib/ir/ui/index.js +36 -0
  434. package/lib/ir/ui/index.js.map +1 -0
  435. package/lib/ir/ui/irActions.d.ts +52 -0
  436. package/lib/ir/ui/irActions.d.ts.map +1 -0
  437. package/lib/ir/ui/irActions.js +62 -0
  438. package/lib/ir/ui/irActions.js.map +1 -0
  439. package/lib/ir/ui/irChartProps.d.ts +116 -0
  440. package/lib/ir/ui/irChartProps.d.ts.map +1 -0
  441. package/lib/ir/ui/irChartProps.js +14 -0
  442. package/lib/ir/ui/irChartProps.js.map +1 -0
  443. package/lib/ir/ui/irCommandContext.d.ts +35 -0
  444. package/lib/ir/ui/irCommandContext.d.ts.map +1 -0
  445. package/lib/ir/ui/irCommandContext.js +44 -0
  446. package/lib/ir/ui/irCommandContext.js.map +1 -0
  447. package/lib/ir/ui/irStateContext.d.ts +26 -0
  448. package/lib/ir/ui/irStateContext.d.ts.map +1 -0
  449. package/lib/ir/ui/irStateContext.js +37 -0
  450. package/lib/ir/ui/irStateContext.js.map +1 -0
  451. package/lib/ir/ui/useIrEditor.d.ts +51 -0
  452. package/lib/ir/ui/useIrEditor.d.ts.map +1 -0
  453. package/lib/ir/ui/useIrEditor.js +88 -0
  454. package/lib/ir/ui/useIrEditor.js.map +1 -0
  455. package/lib/ir/ui/useIrPointer.d.ts +66 -0
  456. package/lib/ir/ui/useIrPointer.d.ts.map +1 -0
  457. package/lib/ir/ui/useIrPointer.js +53 -0
  458. package/lib/ir/ui/useIrPointer.js.map +1 -0
  459. package/lib/ir/ui/useIrShortcuts.d.ts +24 -0
  460. package/lib/ir/ui/useIrShortcuts.d.ts.map +1 -0
  461. package/lib/ir/ui/useIrShortcuts.js +73 -0
  462. package/lib/ir/ui/useIrShortcuts.js.map +1 -0
  463. package/lib/ir/ui/useIrZoom.d.ts +51 -0
  464. package/lib/ir/ui/useIrZoom.d.ts.map +1 -0
  465. package/lib/ir/ui/useIrZoom.js +46 -0
  466. package/lib/ir/ui/useIrZoom.js.map +1 -0
  467. package/lib/ir.d.ts +13 -0
  468. package/lib/ir.d.ts.map +1 -0
  469. package/lib/ir.js +13 -0
  470. package/lib/ir.js.map +1 -0
  471. package/lib/locales/de.json +3 -0
  472. package/lib/locales/en.json +3 -0
  473. package/lib/locales/es.json +3 -0
  474. package/lib/locales/fr.json +3 -0
  475. package/lib/panel/core/dialogStyles.d.ts +13 -0
  476. package/lib/panel/core/dialogStyles.d.ts.map +1 -0
  477. package/lib/panel/core/dialogStyles.js +11 -0
  478. package/lib/panel/core/dialogStyles.js.map +1 -0
  479. package/lib/panel/core/index.d.ts +19 -0
  480. package/lib/panel/core/index.d.ts.map +1 -0
  481. package/lib/panel/core/index.js +18 -0
  482. package/lib/panel/core/index.js.map +1 -0
  483. package/lib/panel/core/isEditingField.d.ts +17 -0
  484. package/lib/panel/core/isEditingField.d.ts.map +1 -0
  485. package/lib/panel/core/isEditingField.js +25 -0
  486. package/lib/panel/core/isEditingField.js.map +1 -0
  487. package/lib/panel/core/panelStyles.d.ts +242 -0
  488. package/lib/panel/core/panelStyles.d.ts.map +1 -0
  489. package/lib/panel/core/panelStyles.js +228 -0
  490. package/lib/panel/core/panelStyles.js.map +1 -0
  491. package/lib/panel/core/rowSpacers.d.ts +38 -0
  492. package/lib/panel/core/rowSpacers.d.ts.map +1 -0
  493. package/lib/panel/core/rowSpacers.js +31 -0
  494. package/lib/panel/core/rowSpacers.js.map +1 -0
  495. package/lib/panel/core/statusBar.d.ts +44 -0
  496. package/lib/panel/core/statusBar.d.ts.map +1 -0
  497. package/lib/panel/core/statusBar.js +40 -0
  498. package/lib/panel/core/statusBar.js.map +1 -0
  499. package/lib/panel/core/textFilter.d.ts +22 -0
  500. package/lib/panel/core/textFilter.d.ts.map +1 -0
  501. package/lib/panel/core/textFilter.js +32 -0
  502. package/lib/panel/core/textFilter.js.map +1 -0
  503. package/lib/panel/core/yieldToPainting.d.ts +17 -0
  504. package/lib/panel/core/yieldToPainting.d.ts.map +1 -0
  505. package/lib/panel/core/yieldToPainting.js +21 -0
  506. package/lib/panel/core/yieldToPainting.js.map +1 -0
  507. package/lib/panel/ui/AboutDialogFrame.d.ts +36 -0
  508. package/lib/panel/ui/AboutDialogFrame.d.ts.map +1 -0
  509. package/lib/panel/ui/AboutDialogFrame.js +43 -0
  510. package/lib/panel/ui/AboutDialogFrame.js.map +1 -0
  511. package/lib/panel/ui/ClearButton.d.ts +28 -0
  512. package/lib/panel/ui/ClearButton.d.ts.map +1 -0
  513. package/lib/panel/ui/ClearButton.js +23 -0
  514. package/lib/panel/ui/ClearButton.js.map +1 -0
  515. package/lib/panel/ui/DocumentationDialogFrame.d.ts +39 -0
  516. package/lib/panel/ui/DocumentationDialogFrame.d.ts.map +1 -0
  517. package/lib/panel/ui/DocumentationDialogFrame.js +29 -0
  518. package/lib/panel/ui/DocumentationDialogFrame.js.map +1 -0
  519. package/lib/panel/ui/FilterInput.d.ts +31 -0
  520. package/lib/panel/ui/FilterInput.d.ts.map +1 -0
  521. package/lib/panel/ui/FilterInput.js +23 -0
  522. package/lib/panel/ui/FilterInput.js.map +1 -0
  523. package/lib/panel/ui/HelpLabel.d.ts +24 -0
  524. package/lib/panel/ui/HelpLabel.d.ts.map +1 -0
  525. package/lib/panel/ui/HelpLabel.js +23 -0
  526. package/lib/panel/ui/HelpLabel.js.map +1 -0
  527. package/lib/panel/ui/PanelMessage.d.ts +41 -0
  528. package/lib/panel/ui/PanelMessage.d.ts.map +1 -0
  529. package/lib/panel/ui/PanelMessage.js +30 -0
  530. package/lib/panel/ui/PanelMessage.js.map +1 -0
  531. package/lib/panel/ui/PanelRail.d.ts +41 -0
  532. package/lib/panel/ui/PanelRail.d.ts.map +1 -0
  533. package/lib/panel/ui/PanelRail.js +12 -0
  534. package/lib/panel/ui/PanelRail.js.map +1 -0
  535. package/lib/panel/ui/Section.d.ts +25 -0
  536. package/lib/panel/ui/Section.d.ts.map +1 -0
  537. package/lib/panel/ui/Section.js +41 -0
  538. package/lib/panel/ui/Section.js.map +1 -0
  539. package/lib/panel/ui/SidePanelStack.d.ts +62 -0
  540. package/lib/panel/ui/SidePanelStack.d.ts.map +1 -0
  541. package/lib/panel/ui/SidePanelStack.js +40 -0
  542. package/lib/panel/ui/SidePanelStack.js.map +1 -0
  543. package/lib/panel/ui/SpectrumColorSwatch.d.ts +33 -0
  544. package/lib/panel/ui/SpectrumColorSwatch.d.ts.map +1 -0
  545. package/lib/panel/ui/SpectrumColorSwatch.js +76 -0
  546. package/lib/panel/ui/SpectrumColorSwatch.js.map +1 -0
  547. package/lib/panel/ui/index.d.ts +37 -0
  548. package/lib/panel/ui/index.d.ts.map +1 -0
  549. package/lib/panel/ui/index.js +24 -0
  550. package/lib/panel/ui/index.js.map +1 -0
  551. package/lib/panel/ui/useConfirmOnEnter.d.ts +19 -0
  552. package/lib/panel/ui/useConfirmOnEnter.d.ts.map +1 -0
  553. package/lib/panel/ui/useConfirmOnEnter.js +64 -0
  554. package/lib/panel/ui/useConfirmOnEnter.js.map +1 -0
  555. package/lib/panel/ui/useFilterBox.d.ts +23 -0
  556. package/lib/panel/ui/useFilterBox.d.ts.map +1 -0
  557. package/lib/panel/ui/useFilterBox.js +22 -0
  558. package/lib/panel/ui/useFilterBox.js.map +1 -0
  559. package/lib/panel/ui/useVirtualRows.d.ts +46 -0
  560. package/lib/panel/ui/useVirtualRows.d.ts.map +1 -0
  561. package/lib/panel/ui/useVirtualRows.js +56 -0
  562. package/lib/panel/ui/useVirtualRows.js.map +1 -0
  563. package/lib/panel/ui/useVirtualWindowRows.d.ts +40 -0
  564. package/lib/panel/ui/useVirtualWindowRows.d.ts.map +1 -0
  565. package/lib/panel/ui/useVirtualWindowRows.js +65 -0
  566. package/lib/panel/ui/useVirtualWindowRows.js.map +1 -0
  567. package/lib/structure/core/conformerBoltzmann.d.ts +56 -0
  568. package/lib/structure/core/conformerBoltzmann.d.ts.map +1 -0
  569. package/lib/structure/core/conformerBoltzmann.js +96 -0
  570. package/lib/structure/core/conformerBoltzmann.js.map +1 -0
  571. package/lib/structure/core/conformerEnergy.d.ts +69 -0
  572. package/lib/structure/core/conformerEnergy.d.ts.map +1 -0
  573. package/lib/structure/core/conformerEnergy.js +47 -0
  574. package/lib/structure/core/conformerEnergy.js.map +1 -0
  575. package/lib/structure/core/index.d.ts +3 -0
  576. package/lib/structure/core/index.d.ts.map +1 -1
  577. package/lib/structure/core/index.js +2 -0
  578. package/lib/structure/core/index.js.map +1 -1
  579. package/lib/structure/ui/ConformerTable.d.ts +73 -0
  580. package/lib/structure/ui/ConformerTable.d.ts.map +1 -0
  581. package/lib/structure/ui/ConformerTable.js +259 -0
  582. package/lib/structure/ui/ConformerTable.js.map +1 -0
  583. package/lib/structure/ui/conformerColumns.d.ts +30 -0
  584. package/lib/structure/ui/conformerColumns.d.ts.map +1 -0
  585. package/lib/structure/ui/conformerColumns.js +37 -0
  586. package/lib/structure/ui/conformerColumns.js.map +1 -0
  587. package/lib/ui.d.ts +5 -0
  588. package/lib/ui.d.ts.map +1 -1
  589. package/lib/ui.js +3 -0
  590. package/lib/ui.js.map +1 -1
  591. package/package.json +8 -1
  592. package/src/chart/core/axisLabels.ts +117 -0
  593. package/src/chart/core/boxLayout.ts +126 -0
  594. package/src/chart/core/chartAxisScale.ts +92 -10
  595. package/src/chart/core/chartDomain.ts +185 -0
  596. package/src/chart/core/chartGeometry.ts +159 -0
  597. package/src/chart/core/chartPane.ts +10 -0
  598. package/src/chart/core/chartScale.ts +7 -4
  599. package/src/chart/core/chartTheme.ts +161 -0
  600. package/src/chart/core/chartViewport.ts +40 -13
  601. package/src/chart/core/guidePlacement.ts +66 -0
  602. package/src/chart/core/index.ts +121 -2
  603. package/src/chart/core/labelStack.ts +72 -0
  604. package/src/chart/core/legendBox.ts +263 -0
  605. package/src/chart/core/selectionGeometry.ts +68 -0
  606. package/src/chart/core/spectrumColor.ts +129 -0
  607. package/src/chart/core/stackCapacity.ts +162 -0
  608. package/src/chart/core/svgPoint.ts +77 -0
  609. package/src/chart/core/tracePath.ts +228 -0
  610. package/src/chart/core/trackerReadout.ts +78 -0
  611. package/src/chart/core/viewTransform.ts +287 -0
  612. package/src/chart/core/zoomDomain.ts +235 -0
  613. package/src/chart/ui/Axes.tsx +361 -0
  614. package/src/chart/ui/AxisGuide.tsx +187 -0
  615. package/src/chart/ui/ChartStack.tsx +130 -0
  616. package/src/chart/ui/ChartTracker.tsx +101 -0
  617. package/src/chart/ui/PlotCaption.tsx +108 -0
  618. package/src/chart/ui/SelectionRect.tsx +52 -0
  619. package/src/chart/ui/TraceLegend.tsx +193 -0
  620. package/src/chart/ui/chartGestures.ts +270 -0
  621. package/src/chart/ui/chartStackLevel.tsx +210 -0
  622. package/src/chart/ui/chartSurface.ts +66 -0
  623. package/src/chart/ui/index.ts +35 -0
  624. package/src/chart/ui/useChartPointer.ts +223 -0
  625. package/src/chart/ui/useChartSize.ts +115 -0
  626. package/src/chart/ui/useChartWindow.ts +240 -0
  627. package/src/chart/ui/useChartZoom.ts +255 -0
  628. package/src/chart/ui/useWheelListener.ts +62 -0
  629. package/src/chrome/ui/AccountButton.tsx +185 -0
  630. package/src/chrome/ui/index.ts +2 -0
  631. package/src/clipboard/core/copyPng.ts +20 -0
  632. package/src/clipboard/core/index.ts +1 -0
  633. package/src/clipboard/ui/ClickToCopy.tsx +9 -1
  634. package/src/core.ts +1 -0
  635. package/src/download/core/exportStyles.ts +20 -0
  636. package/src/download/core/imageResolution.ts +118 -0
  637. package/src/download/core/index.ts +34 -0
  638. package/src/download/core/pictureExport.ts +207 -0
  639. package/src/download/core/stackedDrawing.ts +108 -0
  640. package/src/download/core/svgBounds.ts +80 -0
  641. package/src/download/core/svgNamespace.ts +9 -0
  642. package/src/download/core/svgToPng.ts +121 -0
  643. package/src/download/core/svgToString.ts +95 -0
  644. package/src/download/ui/ExportDialogFrame.tsx +86 -0
  645. package/src/download/ui/ExportImageDialog.tsx +91 -0
  646. package/src/download/ui/ExportNameField.tsx +148 -0
  647. package/src/download/ui/ExportPictureSection.tsx +142 -0
  648. package/src/download/ui/index.ts +11 -0
  649. package/src/download/ui/useDrawingBox.ts +37 -0
  650. package/src/error/core/describeSource.ts +18 -0
  651. package/src/error/core/index.ts +1 -0
  652. package/src/help/ui/HelpBody.tsx +41 -2
  653. package/src/help/ui/index.ts +6 -1
  654. package/src/ir/core/analysisSpectra.ts +231 -0
  655. package/src/ir/core/assignBands.ts +144 -0
  656. package/src/ir/core/bandAssignments.ts +329 -0
  657. package/src/ir/core/bandLabelPlan.ts +194 -0
  658. package/src/ir/core/detectIrFormat.ts +139 -0
  659. package/src/ir/core/downloadSpectra.ts +57 -0
  660. package/src/ir/core/fromJcamp.ts +70 -0
  661. package/src/ir/core/fromSpc.ts +61 -0
  662. package/src/ir/core/index.ts +113 -0
  663. package/src/ir/core/irBand.ts +57 -0
  664. package/src/ir/core/irCommands.ts +154 -0
  665. package/src/ir/core/irDomain.ts +163 -0
  666. package/src/ir/core/irEditorApi.ts +44 -0
  667. package/src/ir/core/irFormat.ts +57 -0
  668. package/src/ir/core/irMode.ts +203 -0
  669. package/src/ir/core/irReducer.ts +273 -0
  670. package/src/ir/core/irSidePanels.ts +20 -0
  671. package/src/ir/core/irSpectrum.ts +155 -0
  672. package/src/ir/core/irState.ts +173 -0
  673. package/src/ir/core/loadIrSpectra.ts +79 -0
  674. package/src/ir/core/nearestBand.ts +57 -0
  675. package/src/ir/core/pickBands.ts +181 -0
  676. package/src/ir/core/spectrumJcamp.ts +178 -0
  677. package/src/ir/core/toIrSpectrum.ts +102 -0
  678. package/src/ir/ui/BandMarks.tsx +166 -0
  679. package/src/ir/ui/BandsPanel.tsx +271 -0
  680. package/src/ir/ui/IrAboutDialog.tsx +121 -0
  681. package/src/ir/ui/IrCanvas.tsx +91 -0
  682. package/src/ir/ui/IrChart.tsx +215 -0
  683. package/src/ir/ui/IrCommandProvider.tsx +32 -0
  684. package/src/ir/ui/IrCommandTooltip.tsx +36 -0
  685. package/src/ir/ui/IrDocumentationDialog.tsx +174 -0
  686. package/src/ir/ui/IrEditor.tsx +99 -0
  687. package/src/ir/ui/IrHeader.tsx +39 -0
  688. package/src/ir/ui/IrLogo.tsx +49 -0
  689. package/src/ir/ui/IrPointerTracker.tsx +102 -0
  690. package/src/ir/ui/IrShell.tsx +285 -0
  691. package/src/ir/ui/IrSidePanel.tsx +78 -0
  692. package/src/ir/ui/IrStateProvider.tsx +32 -0
  693. package/src/ir/ui/IrStatusBar.tsx +97 -0
  694. package/src/ir/ui/IrToolbar.tsx +102 -0
  695. package/src/ir/ui/IrTraces.tsx +134 -0
  696. package/src/ir/ui/MetadataPanel.tsx +88 -0
  697. package/src/ir/ui/SpectraPanel.tsx +114 -0
  698. package/src/ir/ui/SpectrumRow.tsx +127 -0
  699. package/src/ir/ui/index.ts +56 -0
  700. package/src/ir/ui/irActions.ts +103 -0
  701. package/src/ir/ui/irChartProps.ts +118 -0
  702. package/src/ir/ui/irCommandContext.tsx +62 -0
  703. package/src/ir/ui/irStateContext.ts +48 -0
  704. package/src/ir/ui/useIrEditor.ts +139 -0
  705. package/src/ir/ui/useIrPointer.ts +109 -0
  706. package/src/ir/ui/useIrShortcuts.ts +95 -0
  707. package/src/ir/ui/useIrZoom.ts +86 -0
  708. package/src/ir.ts +13 -0
  709. package/src/locales/de.json +3 -0
  710. package/src/locales/en.json +3 -0
  711. package/src/locales/es.json +3 -0
  712. package/src/locales/fr.json +3 -0
  713. package/src/panel/core/dialogStyles.ts +11 -0
  714. package/src/panel/core/index.ts +47 -0
  715. package/src/panel/core/isEditingField.ts +23 -0
  716. package/src/panel/core/panelStyles.ts +248 -0
  717. package/src/panel/core/rowSpacers.ts +50 -0
  718. package/src/panel/core/statusBar.ts +48 -0
  719. package/src/panel/core/textFilter.ts +33 -0
  720. package/src/panel/core/yieldToPainting.ts +20 -0
  721. package/src/panel/ui/AboutDialogFrame.tsx +100 -0
  722. package/src/panel/ui/ClearButton.tsx +42 -0
  723. package/src/panel/ui/DocumentationDialogFrame.tsx +86 -0
  724. package/src/panel/ui/FilterInput.tsx +60 -0
  725. package/src/panel/ui/HelpLabel.tsx +43 -0
  726. package/src/panel/ui/PanelMessage.tsx +64 -0
  727. package/src/panel/ui/PanelRail.tsx +64 -0
  728. package/src/panel/ui/Section.tsx +66 -0
  729. package/src/panel/ui/SidePanelStack.tsx +109 -0
  730. package/src/panel/ui/SpectrumColorSwatch.tsx +119 -0
  731. package/src/panel/ui/index.ts +47 -0
  732. package/src/panel/ui/useConfirmOnEnter.ts +68 -0
  733. package/src/panel/ui/useFilterBox.ts +35 -0
  734. package/src/panel/ui/useVirtualRows.ts +82 -0
  735. package/src/panel/ui/useVirtualWindowRows.ts +86 -0
  736. package/src/structure/core/conformerBoltzmann.ts +102 -0
  737. package/src/structure/core/conformerEnergy.ts +97 -0
  738. package/src/structure/core/index.ts +15 -0
  739. package/src/structure/ui/ConformerTable.tsx +429 -0
  740. package/src/structure/ui/conformerColumns.ts +55 -0
  741. package/src/ui.ts +13 -0
  742. package/styles/chrome.css +55 -0
@@ -0,0 +1,71 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { CHART_COLORS, CHART_FONT, LABEL_HALO, } from "../../chart/core/chartTheme.js";
4
+ import { BAND_MARK, planBandLabels } from "../core/bandLabelPlan.js";
5
+ import { sameIrBand } from "../core/irBand.js";
6
+ import { bandsPointDown } from "../core/irMode.js";
7
+ /**
8
+ * A mark on every band, and a label on the ones there is room for.
9
+ *
10
+ * The mark reaches *away* from the label, into the band, because the clear space
11
+ * on the label's side is where the numbers are written and the mark is there to
12
+ * say which band they are about. So in transmittance both hang downwards from a
13
+ * dip and in absorbance both rise from a maximum, and the pair reads the same way
14
+ * up in either.
15
+ *
16
+ * A leader line is drawn only when a label had to be slid off its band to clear
17
+ * its neighbours — a leader from a label that is already directly above its band
18
+ * is a line saying what the position already said. A label slid too far is not
19
+ * drawn at all; the mark still says the band is there, which is the honest
20
+ * outcome, where a label hanging over a band it says nothing about is not.
21
+ * @param props - Component props.
22
+ * @returns The marks and labels, as SVG.
23
+ */
24
+ export function BandMarks(props) {
25
+ const { assigned, plot, xScale, yScale, mode, showAssignments = false, limit = 12, highlight = null, } = props;
26
+ const plans = useMemo(() => planBandLabels({
27
+ assigned,
28
+ plot,
29
+ xScale,
30
+ yScale,
31
+ mode,
32
+ showAssignments,
33
+ limit,
34
+ }), [assigned, plot, xScale, yScale, mode, showAssignments, limit]);
35
+ const down = bandsPointDown(mode);
36
+ const reach = down ? BAND_MARK : -BAND_MARK;
37
+ return (_jsx("g", { pointerEvents: "none", children: plans.map((plan) => {
38
+ const highlighted = sameIrBand(plan.band, highlight);
39
+ const dropped = !Number.isFinite(plan.labelX);
40
+ const firstBaseline = plan.baselines[0];
41
+ const slid = !dropped && Math.abs(plan.labelX - plan.tipX) > LEADER_AT;
42
+ return (_jsxs("g", { children: [_jsx("line", { x1: plan.tipX, y1: plan.tipY, x2: plan.tipX, y2: plan.tipY + reach, style: highlighted ? highlightMarkStyle : markStyle, strokeWidth: highlighted ? 2 : 1 }), slid && firstBaseline !== undefined ? (_jsx("line", { x1: plan.tipX, y1: plan.tipY + reach, x2: plan.labelX, y2: firstBaseline, style: leaderStyle })) : null, dropped
43
+ ? null
44
+ : plan.lines.map((line, index) => (_jsx("text", { x: plan.labelX, y: plan.baselines[index], textAnchor: "middle", style: highlighted ? highlightTextStyle : textStyle, children: line }, line)))] }, `${plan.band.spectrumId} ${plan.band.wavenumber}`));
45
+ }) }));
46
+ }
47
+ /**
48
+ * How far a label may sit from its band before a leader is drawn to it.
49
+ *
50
+ * Two pixels: below that the label is over its band and a leader would be a
51
+ * line nobody needs, and the declutter sweep leaves most labels within a pixel
52
+ * of where they wanted to be.
53
+ */
54
+ const LEADER_AT = 2;
55
+ const markStyle = { stroke: CHART_COLORS.annotation };
56
+ const highlightMarkStyle = { stroke: CHART_COLORS.highlight };
57
+ const leaderStyle = { stroke: CHART_COLORS.leader };
58
+ // Haloed: an infrared label is written over the trace as often as beside it,
59
+ // since a band is named where it dips and the neighbouring bands dip too.
60
+ const textStyle = {
61
+ fill: CHART_COLORS.labelText,
62
+ fontSize: CHART_FONT.label,
63
+ ...LABEL_HALO,
64
+ };
65
+ const highlightTextStyle = {
66
+ fill: CHART_COLORS.highlight,
67
+ fontSize: CHART_FONT.label,
68
+ fontWeight: 600,
69
+ ...LABEL_HALO,
70
+ };
71
+ //# sourceMappingURL=BandMarks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BandMarks.js","sourceRoot":"","sources":["../../../src/ir/ui/BandMarks.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,UAAU,GACX,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA+BnD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EACJ,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,eAA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;IAC1B,GAAG,UAAU;CACL,CAAC;AAEX,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,YAAY,CAAC,SAAS;IAC5B,QAAQ,EAAE,UAAU,CAAC,KAAK;IAC1B,UAAU,EAAE,GAAG;IACf,GAAG,UAAU;CACL,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { IrBand } from '../core/irBand.ts';
2
+ export interface BandsPanelProps {
3
+ /**
4
+ * The band the pointer is resting on, wherever it was hovered.
5
+ * @default null
6
+ */
7
+ highlight?: IrBand | null;
8
+ /**
9
+ * Told which band a row is hovered, so the chart can mark it.
10
+ * @default undefined
11
+ */
12
+ onHighlight?: (band: IrBand | null) => void;
13
+ }
14
+ /**
15
+ * Every band of the selected spectrum, and everything each one might be.
16
+ *
17
+ * This is the panel the viewer exists for. A trace can be looked at on its own;
18
+ * it is the table beside it that lets it be *read*, and the column that matters
19
+ * is the last one — **every** vibration whose range contains the band, not the
20
+ * best-fitting one. A band at 1715 cm⁻¹ genuinely is a ketone, an aldehyde and a
21
+ * carboxylic acid until something else decides, and a panel that named one would
22
+ * be asserting a structure the spectrum does not determine.
23
+ *
24
+ * Hovering a row marks the band on the chart and hovering the chart lights the
25
+ * row, which is the whole reason the highlight is threaded through the shell
26
+ * rather than held here: the two views are of one thing.
27
+ * @param props - Component props.
28
+ * @returns The panel.
29
+ */
30
+ export declare function BandsPanel(props: BandsPanelProps): import("react").JSX.Element;
31
+ //# sourceMappingURL=BandsPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BandsPanel.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/BandsPanel.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMhD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BA2GhD"}
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon } from '@blueprintjs/core';
3
+ import { useMemo } from 'react';
4
+ import { Button, Toolbar } from 'react-science/ui';
5
+ import { panelBodyStyle, panelCellStyle, panelEmptyStyle, panelHeaderCellStyle, panelNumberCellStyle, panelStyle, panelTableStyle, panelToolbarStyle, } from "../../panel/core/panelStyles.js";
6
+ import { sameIrBand } from "../core/irBand.js";
7
+ import { formatIrValue, formatWavenumber } from "../core/irFormat.js";
8
+ import { useIrActions, useIrEditorState } from "./irStateContext.js";
9
+ /**
10
+ * Every band of the selected spectrum, and everything each one might be.
11
+ *
12
+ * This is the panel the viewer exists for. A trace can be looked at on its own;
13
+ * it is the table beside it that lets it be *read*, and the column that matters
14
+ * is the last one — **every** vibration whose range contains the band, not the
15
+ * best-fitting one. A band at 1715 cm⁻¹ genuinely is a ketone, an aldehyde and a
16
+ * carboxylic acid until something else decides, and a panel that named one would
17
+ * be asserting a structure the spectrum does not determine.
18
+ *
19
+ * Hovering a row marks the band on the chart and hovering the chart lights the
20
+ * row, which is the whole reason the highlight is threaded through the shell
21
+ * rather than held here: the two views are of one thing.
22
+ * @param props - Component props.
23
+ * @returns The panel.
24
+ */
25
+ export function BandsPanel(props) {
26
+ const { highlight = null, onHighlight } = props;
27
+ const { state, selectedSpectrum, assigned } = useIrEditorState();
28
+ const actions = useIrActions();
29
+ const { mode, pickBands, showAssignments, picking } = state.settings;
30
+ const rows = useMemo(() => assigned, [assigned]);
31
+ const tsv = useMemo(() => bandsToTsv(rows, mode), [rows, mode]);
32
+ return (_jsxs("div", { style: panelStyle, children: [_jsxs("div", { style: panelToolbarStyle, children: [_jsxs(Toolbar, { "aria-label": "Band actions", children: [_jsx(Toolbar.Item, { icon: "locate", active: pickBands, tooltip: pickBands ? 'Stop picking bands' : 'Pick the bands', "aria-label": "Pick the bands", onClick: () => actions.setSettings({ pickBands: !pickBands }) }), _jsx(Toolbar.Item, { icon: "label", active: showAssignments, tooltip: "Name the assignments on the chart", "aria-label": "Name the assignments on the chart", disabled: !pickBands, onClick: () => actions.setSettings({ showAssignments: !showAssignments }) })] }), _jsxs("label", { style: thresholdStyle, children: [_jsx("span", { style: { opacity: 0.7 }, children: "threshold" }), _jsx("input", { type: "range", min: 0.005, max: 0.3, step: 0.005, value: picking.minRelativeHeight ?? 0.02, disabled: !pickBands, "aria-label": "How tall a band must be to be picked", onChange: (event) => actions.setSettings({
33
+ picking: { minRelativeHeight: event.target.valueAsNumber },
34
+ }) })] }), _jsx("span", { style: { flex: 1 } }), _jsx(Button, { variant: "minimal", icon: "clipboard", disabled: rows.length === 0, tooltipProps: { content: 'Copy the table' }, "aria-label": "Copy the table", onClick: () => void navigator.clipboard?.writeText(tsv) })] }), _jsx("div", { style: panelBodyStyle, children: selectedSpectrum === null ? (_jsx("p", { style: panelEmptyStyle, children: "No spectrum is selected." })) : !pickBands ? (_jsx("p", { style: panelEmptyStyle, children: "The bands are not being picked. Press the locate button above to find them." })) : rows.length === 0 ? (_jsx("p", { style: panelEmptyStyle, children: "No band was found above the threshold. Lower it to pick the weaker ones." })) : (_jsxs("table", { style: panelTableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: panelHeaderCellStyle, children: "cm\u207B\u00B9" }), _jsx("th", { style: panelHeaderCellStyle }), _jsx("th", { style: { ...panelHeaderCellStyle, textAlign: 'right' }, children: mode === 'absorbance' ? 'A' : '%T' }), _jsx("th", { style: panelHeaderCellStyle, children: "could be" })] }) }), _jsx("tbody", { children: rows.map((entry) => (_jsx(BandRow, { entry: entry, mode: mode, lit: sameIrBand(entry.band, highlight), onHighlight: onHighlight }, `${entry.band.spectrumId} ${entry.band.wavenumber}`))) })] })) })] }));
35
+ }
36
+ /**
37
+ * One band: where it is, how strong, and every vibration it could be.
38
+ *
39
+ * The candidates are written as one line rather than a list, so a strong band
40
+ * with four of them stays one row of the table and the wavenumbers keep reading
41
+ * down the column. The `title` carries them again with each one's note, which is
42
+ * where the reason to prefer one lives.
43
+ * @param props - Component props.
44
+ * @returns The row.
45
+ */
46
+ function BandRow(props) {
47
+ const { entry, mode, lit, onHighlight } = props;
48
+ const { band, candidates } = entry;
49
+ const value = mode === 'absorbance' ? band.absorbance : band.transmittance;
50
+ const detail = candidates
51
+ .map((candidate) => candidate.note === undefined
52
+ ? `${candidate.group} ${candidate.vibration}`
53
+ : `${candidate.group} ${candidate.vibration} — ${candidate.note}`)
54
+ .join('\n');
55
+ return (_jsxs("tr", { style: lit ? litRowStyle : undefined, onPointerEnter: () => onHighlight?.(band), onPointerLeave: () => onHighlight?.(null), children: [_jsx("td", { style: panelNumberCellStyle, children: formatWavenumber(band.wavenumber) }), _jsx("td", { style: panelCellStyle, title: STRENGTH_TITLES[band.strength], children: band.strength }), _jsx("td", { style: panelNumberCellStyle, children: formatIrValue(value, mode) }), _jsx("td", { style: panelCellStyle, title: detail, children: candidates.length === 0 ? (_jsx("span", { style: { opacity: 0.5 }, children: "\u2014" })) : (_jsxs("span", { style: { whiteSpace: 'normal' }, children: [candidates[0]?.group, " ", candidates[0]?.vibration, candidates.length > 1 ? (_jsxs("span", { style: { opacity: 0.6 }, children: [' ', _jsx(Icon, { icon: "more", size: 10 }), " ", candidates.length - 1, " more"] })) : null] })) })] }));
56
+ }
57
+ /** What each strength letter means, for the column that shows only the letter. */
58
+ const STRENGTH_TITLES = {
59
+ w: 'weak, relative to this spectrum',
60
+ m: 'medium, relative to this spectrum',
61
+ S: 'strong, relative to this spectrum',
62
+ };
63
+ /**
64
+ * The table as text, for pasting into a notebook.
65
+ *
66
+ * Tab separated with every candidate on the row, because the reason to copy a
67
+ * band table is to put it beside a structure and argue about it — and the
68
+ * argument is over the candidates rather than over the wavenumbers.
69
+ * @param rows - The bands, as they are shown.
70
+ * @param mode - Which value axis is being read.
71
+ * @returns The table, one line per band, with a heading.
72
+ */
73
+ function bandsToTsv(rows, mode) {
74
+ const heading = ['wavenumber', 'strength', mode, 'could be'].join('\t');
75
+ const lines = rows.map((entry) => [
76
+ formatWavenumber(entry.band.wavenumber),
77
+ entry.band.strength,
78
+ formatIrValue(mode === 'absorbance'
79
+ ? entry.band.absorbance
80
+ : entry.band.transmittance, mode),
81
+ entry.candidates
82
+ .map((candidate) => `${candidate.group} ${candidate.vibration}`)
83
+ .join('; '),
84
+ ].join('\t'));
85
+ return [heading, ...lines].join('\n');
86
+ }
87
+ const litRowStyle = { background: '#fff3e0' };
88
+ const thresholdStyle = {
89
+ display: 'inline-flex',
90
+ alignItems: 'center',
91
+ gap: 4,
92
+ fontSize: 11,
93
+ };
94
+ //# sourceMappingURL=BandsPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BandsPanel.js","sourceRoot":"","sources":["../../../src/ir/ui/BandsPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EACL,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAerE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,WAAW,EAA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,CACjB,IAA6B,EAC7B,IAAoC;IAEpC,MAAM,OAAO,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC/B;QACE,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,QAAQ;QACnB,aAAa,CACX,IAAI,KAAK,YAAY;YACnB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU;YACvB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,EAC5B,IAAI,CACL;QACD,KAAK,CAAC,UAAU;aACb,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;aAC/D,IAAI,CAAC,IAAI,CAAC;KACd,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACF,OAAO,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,WAAW,GAAG,EAAE,UAAU,EAAE,SAAS,EAAW,CAAC;AAEvD,MAAM,cAAc,GAAG;IACrB,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,GAAG,EAAE,CAAC;IACN,QAAQ,EAAE,EAAE;CACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface IrAboutDialogProps {
2
+ /** Whether the dialog is open. */
3
+ isOpen: boolean;
4
+ /** Close it. */
5
+ onClose: () => void;
6
+ }
7
+ /**
8
+ * What the viewer is, what it stands on, and who is owed for it.
9
+ *
10
+ * The credits are not decoration. Every band this viewer names is named out of a
11
+ * correlation table that generations of chemists compiled, every file it opens is
12
+ * read by somebody else's parser, and the examples it opens on are somebody
13
+ * else's measurements — so each is named here, with its licence where it has one.
14
+ * @param props - Component props.
15
+ * @returns The dialog.
16
+ */
17
+ export declare function IrAboutDialog(props: IrAboutDialogProps): import("react").JSX.Element;
18
+ //# sourceMappingURL=IrAboutDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrAboutDialog.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrAboutDialog.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BA+EtD"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog, DialogBody } from '@blueprintjs/core';
3
+ import { IrLogo } from "./IrLogo.js";
4
+ /**
5
+ * What the viewer is, what it stands on, and who is owed for it.
6
+ *
7
+ * The credits are not decoration. Every band this viewer names is named out of a
8
+ * correlation table that generations of chemists compiled, every file it opens is
9
+ * read by somebody else's parser, and the examples it opens on are somebody
10
+ * else's measurements — so each is named here, with its licence where it has one.
11
+ * @param props - Component props.
12
+ * @returns The dialog.
13
+ */
14
+ export function IrAboutDialog(props) {
15
+ const { isOpen, onClose } = props;
16
+ return (_jsx(Dialog, { isOpen: isOpen, onClose: onClose, title: "About the infrared viewer", icon: _jsx(IrLogo, { size: 20 }), style: dialogStyle, children: _jsxs(DialogBody, { children: [_jsxs("div", { style: brandStyle, children: [_jsx(IrLogo, { size: 64 }), _jsxs("div", { children: [_jsx("p", { style: leadStyle, children: "react-cheminfo/ir" }), _jsx("p", { style: paragraphStyle, children: "Draws an infrared spectrum the way infrared is printed, reads it as absorbance or as percent transmittance, picks its bands and offers every functional group each band could be." })] })] }), _jsx("h4", { style: headingStyle, children: "Credits" }), _jsxs("ul", { style: listStyle, children: [_jsxs("li", { children: [_jsx("strong", { children: "ir-spectrum" }), " (cheminfo, MIT) reads the JCAMP-DX and SPC files, derives the absorbance/transmittance pair, and picks the bands. This package deliberately does none of that arithmetic itself."] }), _jsxs("li", { children: [_jsx("strong", { children: "common-spectrum" }), ", ", _jsx("strong", { children: "jcampconverter" }), ' ', "and ", _jsx("strong", { children: "spc-parser" }), " (cheminfo, MIT) are what it reads through."] }), _jsxs("li", { children: [_jsx("strong", { children: "ml-spectra-processing" }), " (mljs, MIT) for the array work."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "shared chart" }), " of this package for the drawing \u2014 the same arithmetic every other spectrum viewer of the family is drawn with."] }), _jsxs("li", { children: [_jsx("strong", { children: "react-science" }), " and ", _jsx("strong", { children: "BlueprintJS" }), "(zakodium, Palantir) for the shell this viewer is shaped like."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "correlation table" }), " is the conventional teaching set of group frequencies, as any introductory spectroscopy text tabulates them. The ranges are deliberately the rounded, generous ones: narrowing them to look precise would rule out assignments that are genuinely possible."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "colours" }), " are Okabe and Ito's colour-universal palette, so two traces stay distinguishable for a reader with a colour vision deficiency."] })] }), _jsx("h4", { style: headingStyle, children: "Licence" }), _jsxs("p", { style: paragraphStyle, children: ["MIT, in the", ' ', _jsx("a", { href: "https://github.com/cheminfo/glycans", target: "_blank", rel: "noopener noreferrer", children: "cheminfo/glycans" }), ' ', "monorepo."] })] }) }));
17
+ }
18
+ const dialogStyle = { width: 'min(680px, 92vw)' };
19
+ const brandStyle = {
20
+ display: 'flex',
21
+ alignItems: 'flex-start',
22
+ gap: 16,
23
+ };
24
+ const leadStyle = {
25
+ margin: '0 0 4px',
26
+ fontWeight: 600,
27
+ fontSize: 16,
28
+ };
29
+ const paragraphStyle = { margin: '0 0 6px' };
30
+ const headingStyle = { margin: '14px 0 4px' };
31
+ const listStyle = { margin: 0, paddingLeft: 20 };
32
+ //# sourceMappingURL=IrAboutDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrAboutDialog.js","sourceRoot":"","sources":["../../../src/ir/ui/IrAboutDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AAStC;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACL,KAAC,MAAM,IACL,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,2BAA2B,EACjC,IAAI,EAAE,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,EAC1B,KAAK,EAAE,WAAW,YAElB,MAAC,UAAU,eACT,eAAK,KAAK,EAAE,UAAU,aACpB,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,EACpB,0BACE,YAAG,KAAK,EAAE,SAAS,kCAAuB,EAC1C,YAAG,KAAK,EAAE,cAAc,kMAIpB,IACA,IACF,EAEN,aAAI,KAAK,EAAE,YAAY,wBAAc,EACrC,cAAI,KAAK,EAAE,SAAS,aAClB,yBACE,2CAA4B,yLAIzB,EACL,yBACE,+CAAgC,QAAE,8CAA+B,EAAC,GAAG,UACjE,0CAA2B,mDAE5B,EACL,yBACE,qDAAsC,wCAEnC,EACL,iCACM,4CAA6B,4HAG9B,EACL,yBACE,6CAA8B,WAAK,2CAA4B,sEAE5D,EACL,iCACM,iDAAkC,oQAKnC,EACL,iCACM,uCAAwB,uIAGzB,IACF,EAEL,aAAI,KAAK,EAAE,YAAY,wBAAc,EACrC,aAAG,KAAK,EAAE,cAAc,4BACV,GAAG,EACf,YACE,IAAI,EAAC,qCAAqC,EAC1C,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,iCAGvB,EAAC,GAAG,iBAEN,IACO,GACN,CACV,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAW,CAAC;AAE3D,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,YAAY;IACxB,GAAG,EAAE,EAAE;CACC,CAAC;AAEX,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,EAAE;CACJ,CAAC;AAEX,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,SAAS,EAAW,CAAC;AAEtD,MAAM,YAAY,GAAG,EAAE,MAAM,EAAE,YAAY,EAAW,CAAC;AAEvD,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAW,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { IrBand } from '../core/irBand.ts';
2
+ export interface IrCanvasProps {
3
+ /**
4
+ * The band the pointer is resting on, wherever it was hovered — the chart or
5
+ * the band table.
6
+ * @default null
7
+ */
8
+ highlight?: IrBand | null;
9
+ /**
10
+ * Told which band the pointer has come to rest on.
11
+ * @default undefined
12
+ */
13
+ onHighlight?: (band: IrBand | null) => void;
14
+ /**
15
+ * Put on the box the chart is drawn in, so a picture can be taken of it. The
16
+ * box rather than the chart itself, because the chart is laid out again on
17
+ * every resize.
18
+ * @default undefined
19
+ */
20
+ attachChart?: (element: HTMLDivElement | null) => void;
21
+ }
22
+ /**
23
+ * The chart, and the status bar under it.
24
+ *
25
+ * This is where the state meets the drawing: the chart holds nothing, so
26
+ * everything it draws is read out of the state here and every gesture it reports
27
+ * is written back. The window in particular goes **both** ways — the chart is
28
+ * told what to show and reports what it arrives at — which is what lets a toolbar
29
+ * button and a drag both move it.
30
+ *
31
+ * The status bar is inside the canvas rather than under the whole shell, so it
32
+ * stops at the splitter: what is open on the right belongs to the chart, and a
33
+ * bar running under the panels as well would read as belonging to the page.
34
+ * @param props - Component props.
35
+ * @returns The canvas.
36
+ */
37
+ export declare function IrCanvas(props: IrCanvasProps): import("react").JSX.Element;
38
+ //# sourceMappingURL=IrCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrCanvas.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCanvas.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOhD,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAkC5C"}
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from 'react';
3
+ import { IrChart } from "./IrChart.js";
4
+ import { IrStatusBar } from "./IrStatusBar.js";
5
+ import { useIrActions, useIrEditorState } from "./irStateContext.js";
6
+ /**
7
+ * The chart, and the status bar under it.
8
+ *
9
+ * This is where the state meets the drawing: the chart holds nothing, so
10
+ * everything it draws is read out of the state here and every gesture it reports
11
+ * is written back. The window in particular goes **both** ways — the chart is
12
+ * told what to show and reports what it arrives at — which is what lets a toolbar
13
+ * button and a drag both move it.
14
+ *
15
+ * The status bar is inside the canvas rather than under the whole shell, so it
16
+ * stops at the splitter: what is open on the right belongs to the chart, and a
17
+ * bar running under the panels as well would read as belonging to the page.
18
+ * @param props - Component props.
19
+ * @returns The canvas.
20
+ */
21
+ export function IrCanvas(props) {
22
+ const { highlight = null, onHighlight, attachChart } = props;
23
+ const { state, visibleSpectra, assigned } = useIrEditorState();
24
+ const actions = useIrActions();
25
+ const { domain, tool, selectedId } = state.view;
26
+ const { mode, showAssignments, labelLimit } = state.settings;
27
+ const onDomainChange = useCallback((next) => {
28
+ actions.setDomain(next);
29
+ }, [actions]);
30
+ return (_jsxs("div", { style: rootStyle, children: [_jsx("div", { ref: attachChart, style: chartStyle, children: _jsx(IrChart, { spectra: visibleSpectra, mode: mode, assigned: assigned, showAssignments: showAssignments, labelLimit: labelLimit, highlight: highlight, onHighlight: onHighlight, domain: domain, onDomainChange: onDomainChange, drag: tool === 'box' ? 'box' : 'xAxis', emphasisedId: selectedId }) }), _jsx(IrStatusBar, {})] }));
31
+ }
32
+ const rootStyle = {
33
+ display: 'flex',
34
+ flexDirection: 'column',
35
+ flex: '1 1 1px',
36
+ minWidth: 0,
37
+ minHeight: 0,
38
+ };
39
+ /** The chart takes what the status bar does not. */
40
+ const chartStyle = { flex: '1 1 1px', minHeight: 0 };
41
+ //# sourceMappingURL=IrCanvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrCanvas.js","sourceRoot":"","sources":["../../../src/ir/ui/IrCanvas.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAKpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAuBrE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC7D,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC/D,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAChD,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC;IAE7D,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,IAAc,EAAE,EAAE;QACjB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,eAAK,KAAK,EAAE,SAAS,aACnB,cAAK,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,YACtC,KAAC,OAAO,IACN,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EACtC,YAAY,EAAE,UAAU,GACxB,GACE,EACN,KAAC,WAAW,KAAG,IACX,CACP,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;CACJ,CAAC;AAEX,oDAAoD;AACpD,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAW,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { IrChartProps } from './irChartProps.ts';
3
+ /**
4
+ * The chart: every layer of an infrared spectrum, in one SVG.
5
+ *
6
+ * **The wavenumber axis runs right to left**, 4000 at the left edge down to 400
7
+ * at the right, which is how every infrared spectrum has been printed since the
8
+ * technique was dispersive and the instrument scanned that way. It is done by
9
+ * building the scale onto a reversed pixel range and nothing else: the data stays
10
+ * in ascending wavenumbers, every window stays low end first, and no other piece
11
+ * of arithmetic in either package has to know. That is the whole reason
12
+ * `createScale` takes its range rather than deriving it.
13
+ *
14
+ * The axes go under the data, so a grid line is never read as a band. Only the
15
+ * data band is clipped, so a zoomed trace stops at the plot edge while the
16
+ * wavenumbers pinned to the bands are allowed out over the margin — clip those
17
+ * and the strongest band in the window loses its label. The drag rectangle and
18
+ * the crosshair go over everything, because each answers a question being asked
19
+ * right now.
20
+ *
21
+ * Nothing is held here. The spectra, the bands, what is being looked at and the
22
+ * window are all props, and every gesture comes back out as a callback — so one
23
+ * component draws an editor's chart, a report page's single spectrum and a test.
24
+ * @param props - Component props.
25
+ * @returns The chart.
26
+ */
27
+ export declare function IrChart(props: IrChartProps): ReactElement;
28
+ //# sourceMappingURL=IrChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrChart.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAmJzD"}
@@ -0,0 +1,114 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useId, useLayoutEffect, useMemo, useRef } from 'react';
3
+ import { sameChartDomain } from "../../chart/core/chartDomain.js";
4
+ import { MARGIN, plotRect } from "../../chart/core/chartGeometry.js";
5
+ import { Axes } from "../../chart/ui/Axes.js";
6
+ import { SelectionRect } from "../../chart/ui/SelectionRect.js";
7
+ import { chartSurfaceStyle } from "../../chart/ui/chartSurface.js";
8
+ import { useChartSize } from "../../chart/ui/useChartSize.js";
9
+ import { boxZoomOnly, yAxisTitle } from "../core/irMode.js";
10
+ import { BandMarks } from "./BandMarks.js";
11
+ import { IrPointerTracker } from "./IrPointerTracker.js";
12
+ import { IrTraces } from "./IrTraces.js";
13
+ import { useIrPointer } from "./useIrPointer.js";
14
+ import { useIrZoom } from "./useIrZoom.js";
15
+ /**
16
+ * The chart: every layer of an infrared spectrum, in one SVG.
17
+ *
18
+ * **The wavenumber axis runs right to left**, 4000 at the left edge down to 400
19
+ * at the right, which is how every infrared spectrum has been printed since the
20
+ * technique was dispersive and the instrument scanned that way. It is done by
21
+ * building the scale onto a reversed pixel range and nothing else: the data stays
22
+ * in ascending wavenumbers, every window stays low end first, and no other piece
23
+ * of arithmetic in either package has to know. That is the whole reason
24
+ * `createScale` takes its range rather than deriving it.
25
+ *
26
+ * The axes go under the data, so a grid line is never read as a band. Only the
27
+ * data band is clipped, so a zoomed trace stops at the plot edge while the
28
+ * wavenumbers pinned to the bands are allowed out over the margin — clip those
29
+ * and the strongest band in the window loses its label. The drag rectangle and
30
+ * the crosshair go over everything, because each answers a question being asked
31
+ * right now.
32
+ *
33
+ * Nothing is held here. The spectra, the bands, what is being looked at and the
34
+ * window are all props, and every gesture comes back out as a callback — so one
35
+ * component draws an editor's chart, a report page's single spectrum and a test.
36
+ * @param props - Component props.
37
+ * @returns The chart.
38
+ */
39
+ export function IrChart(props) {
40
+ const { spectra, mode = 'transmittance', assigned = NO_BANDS, showAssignments = false, labelLimit, highlight = null, onHighlight, domain = null, onDomainChange, drag = 'xAxis', emphasisedId = null, width, height, children, } = props;
41
+ const [containerRef, measured] = useChartSize();
42
+ const svgRef = useRef(null);
43
+ const plot = useMemo(() => plotRect({
44
+ width: width ?? measured.width,
45
+ height: height ?? measured.height,
46
+ }), [width, height, measured.width, measured.height]);
47
+ // Read back off the plot rather than off the measurement, so a chart briefly
48
+ // laid out at nothing still draws its axes inside a box that holds them.
49
+ const frameWidth = plot.right + MARGIN.right;
50
+ const frameHeight = plot.bottom + MARGIN.bottom;
51
+ // The host's window goes *into* the zoom rather than over it, so a drag is
52
+ // always measured against what is on screen.
53
+ const zoom = useIrZoom({ spectra, mode, svgRef, plot, domain, drag });
54
+ // The scales the zoom measured its gestures against — the x one running right
55
+ // to left. Taken from the hook rather than built here, because two scales over
56
+ // one axis is two chances to disagree about which way it runs, and a chart that
57
+ // disagreed with its own gestures would zoom to the mirror image of whatever
58
+ // was dragged over.
59
+ const { domain: shown, xScale, yScale, selection, handlers } = zoom;
60
+ const reported = useRef(shown);
61
+ // Before the browser paints, so a host that stores the window and hands it
62
+ // back does so in the frame the gesture landed in rather than the one after.
63
+ useLayoutEffect(() => {
64
+ if (sameChartDomain(reported.current, shown))
65
+ return;
66
+ reported.current = shown;
67
+ onDomainChange?.(shown);
68
+ }, [shown, onDomainChange]);
69
+ const bands = useMemo(() => {
70
+ const found = [];
71
+ for (const entry of assigned)
72
+ found.push(entry.band);
73
+ return found;
74
+ }, [assigned]);
75
+ const onBand = useCallback((band) => {
76
+ onHighlight?.(band);
77
+ }, [onHighlight]);
78
+ const pointer = useIrPointer({
79
+ svgRef,
80
+ plot,
81
+ xScale,
82
+ yScale,
83
+ mode,
84
+ bands,
85
+ onBand,
86
+ });
87
+ // React's generated id carries the punctuation it keeps its own ids apart
88
+ // with, which a URL fragment is under no obligation to accept.
89
+ const clipId = `ir-plot-${useId().replaceAll(/\W/g, '')}`;
90
+ return (_jsx("div", { ref: containerRef, style: containerStyle, children: _jsxs("svg", { ref: svgRef, role: "img", "aria-label": chartLabel(mode), width: frameWidth, height: frameHeight, viewBox: `0 0 ${frameWidth} ${frameHeight}`,
91
+ // The arrow gives way to the chart's own crosshair over the plot, and
92
+ // comes back over the margins, exactly as it does on a mass chart.
93
+ style: chartSurfaceStyle(pointer.position !== null), ...handlers, children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("rect", { x: plot.left, y: plot.top, width: plot.width, height: plot.height }) }) }), _jsx(Axes, { plot: plot, xDomain: shown.x, yDomain: shown.y, xScale: xScale, yScale: yScale, xTitle: "wavenumber (cm\u207B\u00B9)", yTitle: yAxisTitle(mode) }), _jsxs("g", { clipPath: `url(#${clipId})`, children: [_jsx(IrTraces, { spectra: spectra, mode: mode, plot: plot, xDomain: shown.x, xScale: xScale, yScale: yScale, emphasisedId: emphasisedId }), children] }), _jsx(BandMarks, { assigned: assigned, plot: plot, xScale: xScale, yScale: yScale, mode: mode, showAssignments: showAssignments, highlight: highlight, ...(labelLimit === undefined ? {} : { limit: labelLimit }) }), _jsx(SelectionRect, { selection: selection, plot: plot }), _jsx(IrPointerTracker, { position: pointer.position, readout: pointer.readout, plot: plot })] }) }));
94
+ }
95
+ /**
96
+ * What the chart is, and what can be done to it, for whoever cannot see it.
97
+ *
98
+ * The gestures differ by mode, so the sentence does too — a label promising the
99
+ * wheel to a reader who cannot watch it fail to do anything is worse than no
100
+ * label at all.
101
+ * @param mode - Which value axis is being drawn.
102
+ * @returns The label.
103
+ */
104
+ function chartLabel(mode) {
105
+ const axis = `Infrared spectrum read as ${yAxisTitle(mode)}, wavenumber running from high at the left to low at the right.`;
106
+ return boxZoomOnly(mode)
107
+ ? `${axis} Drag a rectangle over it to zoom to that rectangle, and double click to fit everything again.`
108
+ : `${axis} Drag across it to zoom the wavenumber axis, drag past the baseline to take the value axis with it, turn the wheel to scale the value axis, and double click to fit everything again.`;
109
+ }
110
+ /** What a chart nobody has picked any bands for marks. */
111
+ const NO_BANDS = Object.freeze([]);
112
+ /** The box the chart is measured against, and fills. */
113
+ const containerStyle = { width: '100%', height: '100%' };
114
+ //# sourceMappingURL=IrChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrChart.js","sourceRoot":"","sources":["../../../src/ir/ui/IrChart.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC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AAE,MAAM,EAAW,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IrCommandHandlers } from '../core/irCommands.ts';
3
+ export interface IrCommandProviderProps {
4
+ /** What each command does. */
5
+ handlers: IrCommandHandlers;
6
+ /** The viewer. */
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * Put the command handlers where the toolbar and the panels can reach them.
11
+ * @param props - Component props.
12
+ * @returns The provider.
13
+ */
14
+ export declare function IrCommandProvider(props: IrCommandProviderProps): import("react").JSX.Element;
15
+ //# sourceMappingURL=IrCommandProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrCommandProvider.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAK/D,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,kBAAkB;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAW9D"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { commandContext } from "./irCommandContext.js";
4
+ /**
5
+ * Put the command handlers where the toolbar and the panels can reach them.
6
+ * @param props - Component props.
7
+ * @returns The provider.
8
+ */
9
+ export function IrCommandProvider(props) {
10
+ const { handlers, children } = props;
11
+ const value = useMemo(() => ({ handlers, run: (id) => handlers[id]?.() }), [handlers]);
12
+ return (_jsx(commandContext.Provider, { value: value, children: children }));
13
+ }
14
+ //# sourceMappingURL=IrCommandProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrCommandProvider.js","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAwB,CAAC;AASxD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAErC,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EACnD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA2B,CAC5E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { IrCommandId } from '../core/irCommands.ts';
2
+ export interface IrCommandTooltipProps {
3
+ /** Which command the tooltip is about. */
4
+ id: IrCommandId;
5
+ }
6
+ /**
7
+ * One command's tooltip: its title, what it does, and every way to do it.
8
+ *
9
+ * `TooltipHelpContent` from react-science, which is what NMRium's tooltips are,
10
+ * so a page holding this viewer beside NMRium or the glycan editor explains
11
+ * itself the same way in all three.
12
+ * @param props - Component props.
13
+ * @returns The tooltip's content.
14
+ */
15
+ export declare function IrCommandTooltip(props: IrCommandTooltipProps): import("react").JSX.Element;
16
+ //# sourceMappingURL=IrCommandTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IrCommandTooltip.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandTooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpE,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,EAAE,EAAE,WAAW,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,+BAgB5D"}