react-cheminfo 0.74.0 → 0.76.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 (98) hide show
  1. package/lib/download/core/copySvg.d.ts +12 -0
  2. package/lib/download/core/copySvg.d.ts.map +1 -0
  3. package/lib/download/core/copySvg.js +38 -0
  4. package/lib/download/core/copySvg.js.map +1 -0
  5. package/lib/download/core/index.d.ts +1 -0
  6. package/lib/download/core/index.d.ts.map +1 -1
  7. package/lib/download/core/index.js +1 -0
  8. package/lib/download/core/index.js.map +1 -1
  9. package/lib/ecosystem/core/sites.d.ts.map +1 -1
  10. package/lib/ecosystem/core/sites.js +26 -0
  11. package/lib/ecosystem/core/sites.js.map +1 -1
  12. package/lib/ecosystem/core/types.d.ts +1 -1
  13. package/lib/ecosystem/core/types.d.ts.map +1 -1
  14. package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
  15. package/lib/ecosystem/ui/glyphs.js +7 -0
  16. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  17. package/lib/formula/core/elementRanges.d.ts +25 -0
  18. package/lib/formula/core/elementRanges.d.ts.map +1 -0
  19. package/lib/formula/core/elementRanges.js +35 -0
  20. package/lib/formula/core/elementRanges.js.map +1 -0
  21. package/lib/formula/core/formulaCandidates.d.ts +59 -0
  22. package/lib/formula/core/formulaCandidates.d.ts.map +1 -0
  23. package/lib/formula/core/formulaCandidates.js +50 -0
  24. package/lib/formula/core/formulaCandidates.js.map +1 -0
  25. package/lib/formula/core/index.d.ts +4 -0
  26. package/lib/formula/core/index.d.ts.map +1 -1
  27. package/lib/formula/core/index.js +2 -0
  28. package/lib/formula/core/index.js.map +1 -1
  29. package/lib/formula/ui/ElementRangeFields.d.ts +19 -0
  30. package/lib/formula/ui/ElementRangeFields.d.ts.map +1 -0
  31. package/lib/formula/ui/ElementRangeFields.js +23 -0
  32. package/lib/formula/ui/ElementRangeFields.js.map +1 -0
  33. package/lib/formula/ui/FormulaLookup.d.ts +47 -0
  34. package/lib/formula/ui/FormulaLookup.d.ts.map +1 -0
  35. package/lib/formula/ui/FormulaLookup.js +74 -0
  36. package/lib/formula/ui/FormulaLookup.js.map +1 -0
  37. package/lib/formula/ui/FormulaLookupResults.d.ts +20 -0
  38. package/lib/formula/ui/FormulaLookupResults.d.ts.map +1 -0
  39. package/lib/formula/ui/FormulaLookupResults.js +45 -0
  40. package/lib/formula/ui/FormulaLookupResults.js.map +1 -0
  41. package/lib/formula/ui/index.d.ts +2 -0
  42. package/lib/formula/ui/index.d.ts.map +1 -1
  43. package/lib/formula/ui/index.js +1 -0
  44. package/lib/formula/ui/index.js.map +1 -1
  45. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  46. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  47. package/lib/ir/core/bandAssignments.d.ts.map +1 -1
  48. package/lib/ir/core/bandAssignments.js +27 -0
  49. package/lib/ir/core/bandAssignments.js.map +1 -1
  50. package/lib/ir/ui/BandRow.d.ts +4 -4
  51. package/lib/ir/ui/BandRow.d.ts.map +1 -1
  52. package/lib/ir/ui/BandRow.js +41 -14
  53. package/lib/ir/ui/BandRow.js.map +1 -1
  54. package/lib/locales/de.json +18 -0
  55. package/lib/locales/en.json +18 -0
  56. package/lib/locales/es.json +18 -0
  57. package/lib/locales/fr.json +18 -0
  58. package/lib/locales/it.json +18 -0
  59. package/lib/structure/ui/CardStructure.d.ts +43 -0
  60. package/lib/structure/ui/CardStructure.d.ts.map +1 -0
  61. package/lib/structure/ui/CardStructure.js +28 -0
  62. package/lib/structure/ui/CardStructure.js.map +1 -0
  63. package/lib/structure/ui/StructurePicturePane.d.ts +1 -1
  64. package/lib/structure/ui/StructurePicturePane.d.ts.map +1 -1
  65. package/lib/structure/ui/StructurePicturePane.js +5 -2
  66. package/lib/structure/ui/StructurePicturePane.js.map +1 -1
  67. package/lib/structure/ui/index.d.ts +2 -0
  68. package/lib/structure/ui/index.d.ts.map +1 -1
  69. package/lib/structure/ui/index.js +1 -0
  70. package/lib/structure/ui/index.js.map +1 -1
  71. package/lib/structure/ui/useToolbarFloor.d.ts.map +1 -1
  72. package/lib/structure/ui/useToolbarFloor.js +20 -10
  73. package/lib/structure/ui/useToolbarFloor.js.map +1 -1
  74. package/package.json +4 -3
  75. package/src/download/core/copySvg.ts +40 -0
  76. package/src/download/core/index.ts +1 -0
  77. package/src/ecosystem/core/sites.ts +26 -0
  78. package/src/ecosystem/core/types.ts +3 -1
  79. package/src/ecosystem/ui/glyphs.tsx +46 -0
  80. package/src/formula/core/elementRanges.ts +44 -0
  81. package/src/formula/core/formulaCandidates.ts +109 -0
  82. package/src/formula/core/index.ts +15 -0
  83. package/src/formula/ui/ElementRangeFields.tsx +65 -0
  84. package/src/formula/ui/FormulaLookup.tsx +184 -0
  85. package/src/formula/ui/FormulaLookupResults.tsx +89 -0
  86. package/src/formula/ui/index.ts +2 -0
  87. package/src/ir/core/bandAssignments.ts +27 -0
  88. package/src/ir/ui/BandRow.tsx +84 -26
  89. package/src/locales/de.json +18 -0
  90. package/src/locales/en.json +18 -0
  91. package/src/locales/es.json +18 -0
  92. package/src/locales/fr.json +18 -0
  93. package/src/locales/it.json +18 -0
  94. package/src/structure/ui/CardStructure.tsx +76 -0
  95. package/src/structure/ui/StructurePicturePane.tsx +14 -1
  96. package/src/structure/ui/index.ts +2 -0
  97. package/src/structure/ui/useToolbarFloor.ts +19 -9
  98. package/styles/chrome.css +136 -3
@@ -1,36 +1,39 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Button, Icon } from '@blueprintjs/core';
3
+ import { useState } from 'react';
3
4
  import { panelCellStyle, panelNumberCellStyle, } from "../../panel/core/panelStyles.js";
4
5
  import { bandValue } from "../core/irBand.js";
5
6
  import { formatIrValue, formatWavenumber } from "../core/irFormat.js";
6
7
  /**
7
8
  * One band: where it is, how strong, and every vibration it could be.
8
9
  *
9
- * The candidates are written as one line rather than a list, so a strong band
10
- * with four of them stays one row of the table and the wavenumbers keep reading
11
- * down the column. The `title` carries them again with each one's note, which is
12
- * where the reason to prefer one lives.
10
+ * The candidates start as one line rather than a list, so a strong band with
11
+ * four of them stays one row of the table and the wavenumbers keep reading down
12
+ * the column. Its "more" opens the row onto every candidate with its note, which
13
+ * is where the reason to prefer one lives.
13
14
  * @param props - Component props.
14
15
  * @returns The row.
15
16
  */
16
17
  export function BandRow(props) {
17
18
  const { entry, mode, assignments, lit, onHighlight, onRemove } = props;
18
19
  const { band } = entry;
19
- 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(bandValue(band, mode) ?? Number.NaN, mode) }), assignments ? _jsx(CandidatesCell, { entry: entry }) : null, onRemove === undefined ? null : (_jsx("td", { style: removeCellStyle, children: _jsx(Button, { variant: "minimal", size: "small", icon: "small-cross", "aria-label": `Take away the band at ${formatWavenumber(band.wavenumber)} cm⁻¹`, onClick: () => onRemove(band) }) }))] }));
20
+ return (_jsxs("tr", { style: lit ? litRowStyle : rowStyle, 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(bandValue(band, mode) ?? Number.NaN, mode) }), assignments ? _jsx(CandidatesCell, { entry: entry }) : null, onRemove === undefined ? null : (_jsx("td", { style: removeCellStyle, children: _jsx(Button, { variant: "minimal", size: "small", icon: "small-cross", "aria-label": `Take away the band at ${formatWavenumber(band.wavenumber)} cm⁻¹`, onClick: () => onRemove(band) }) }))] }));
20
21
  }
21
22
  /**
22
- * What a band could be: the narrowest candidate, and how many more there are.
23
+ * What a band could be: the narrowest candidate and how many more there are,
24
+ * opened on a click into every candidate with the note that tells it apart.
23
25
  * @param props - Component props.
24
26
  * @returns The cell.
25
27
  */
26
28
  function CandidatesCell(props) {
27
29
  const { candidates } = props.entry;
28
- const detail = candidates
29
- .map((candidate) => candidate.note === undefined
30
- ? `${candidate.group} ${candidate.vibration}`
31
- : `${candidate.group} ${candidate.vibration} — ${candidate.note}`)
32
- .join('\n');
33
- return (_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] })) }));
30
+ const [open, setOpen] = useState(false);
31
+ if (candidates.length === 0) {
32
+ return (_jsx("td", { style: panelCellStyle, children: _jsx("span", { style: { opacity: 0.5 }, children: "\u2014" }) }));
33
+ }
34
+ const [first] = candidates;
35
+ const others = candidates.length - 1;
36
+ return (_jsxs("td", { style: candidatesCellStyle, children: [open ? (_jsx("ul", { style: candidateListStyle, children: candidates.map((candidate) => (_jsxs("li", { children: [candidate.group, " ", candidate.vibration, candidate.note === undefined ? null : (_jsx("div", { style: candidateNoteStyle, children: candidate.note }))] }, candidate.id))) })) : (_jsxs(_Fragment, { children: [first?.group, " ", first?.vibration] })), others > 0 ? (_jsxs(_Fragment, { children: [open ? null : ' ', _jsx("button", { type: "button", style: moreButtonStyle, "aria-expanded": open, onClick: () => setOpen(!open), children: open ? ('less') : (_jsxs(_Fragment, { children: [_jsx(Icon, { icon: "more", size: 10 }), " ", others, " more"] })) })] })) : null] }));
34
37
  }
35
38
  /** What each strength letter means, for the column that shows only the letter. */
36
39
  const STRENGTH_TITLES = {
@@ -38,6 +41,30 @@ const STRENGTH_TITLES = {
38
41
  m: 'medium, relative to this spectrum',
39
42
  S: 'strong, relative to this spectrum',
40
43
  };
41
- const litRowStyle = { background: '#fff3e0' };
44
+ // Top, so an opened row keeps its wavenumber on the line of its first candidate.
45
+ const rowStyle = { verticalAlign: 'top' };
46
+ const litRowStyle = { ...rowStyle, background: '#fff3e0' };
42
47
  const removeCellStyle = { ...panelCellStyle, padding: 0, width: 1 };
48
+ const candidatesCellStyle = {
49
+ ...panelCellStyle,
50
+ whiteSpace: 'normal',
51
+ };
52
+ const candidateListStyle = {
53
+ display: 'flex',
54
+ flexDirection: 'column',
55
+ gap: 4,
56
+ margin: 0,
57
+ padding: 0,
58
+ listStyle: 'none',
59
+ };
60
+ const candidateNoteStyle = { fontSize: '0.9em', opacity: 0.6 };
61
+ const moreButtonStyle = {
62
+ padding: 0,
63
+ border: 0,
64
+ background: 'none',
65
+ color: 'inherit',
66
+ font: 'inherit',
67
+ opacity: 0.6,
68
+ cursor: 'pointer',
69
+ };
43
70
  //# sourceMappingURL=BandRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BandRow.js","sourceRoot":"","sources":["../../../src/ir/ui/BandRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAwBtE;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACvE,MAAM,EAAE,IAAI,EA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EAAE,OAAO,EAAE,GAAG,EAAW,CAAC;AAExE,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,MAAM;IAClB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,GAAG;IACZ,MAAM,EAAE,SAAS;CACT,CAAC"}
@@ -103,6 +103,7 @@
103
103
  "site.regexp.tagline": "Reguläre Ausdrücke in einer interaktiven Spielwiese lernen.",
104
104
  "site.pdb.tagline": "Ein schneller Blick auf jeden Eintrag der Protein Data Bank.",
105
105
  "site.elucidation.tagline": "Eine Struktur aus einem 1H-NMR-Spektrum und einer Formel.",
106
+ "site.spectroscopy.tagline": "Eine Struktur aus ihren IR-, Massen- und NMR-Spektren bestimmen.",
106
107
  "site.equilibrium.tagline": "Chemische Gleichgewichte: pH, Speziation und Titrationskurven.",
107
108
  "site.polycarp.tagline": "Die Mikrostruktur einer radikalischen Copolymerisation vorhersagen.",
108
109
  "site.3d.tagline": "Konformere in 3D aus einer Struktur, die Sie zeichnen.",
@@ -345,6 +346,21 @@
345
346
  "formula.wholeCounts": "„{formula}“ gibt einem Atom die Anzahl {count}; Anzahlen sind ganze Zahlen.",
346
347
  "formula.unknownNotation": "„{formula}“ verwendet eine Schreibweise, die dieses Werkzeug nicht zählt.",
347
348
  "formula.unreadable": "„{formula}“ ist keine Formel, die dieses Werkzeug lesen kann ({reason}).",
349
+ "formula.lookup.title": "Formelsuche",
350
+ "formula.lookup.reset": "Masse und Elementbereiche zurücksetzen",
351
+ "formula.lookup.mass": "Monoisotopische Masse",
352
+ "formula.lookup.massPlaceholder": "z. B. 128.0626",
353
+ "formula.lookup.neutral": "Die des neutralen Moleküls: Ziehen Sie die Protonen ab, die das Spektrum hinzugefügt hat.",
354
+ "formula.lookup.fewest": "Mindestzahl der {element}-Atome",
355
+ "formula.lookup.most": "Höchstzahl der {element}-Atome",
356
+ "formula.lookup.typeMass": "Geben Sie eine Masse ein, um die Formeln aufzulisten, die diese Bereiche zulassen.",
357
+ "formula.lookup.closest": "Die {count} nächsten von {total} Formeln",
358
+ "formula.lookup.countOne": "{count} Formel",
359
+ "formula.lookup.countMany": "{count} Formeln",
360
+ "formula.lookup.nothingFits": "Keine Formel passt. Erweitern Sie einen Bereich oder prüfen Sie die Masse.",
361
+ "formula.lookup.tooWide": "Diese Bereiche lassen zu viele Formeln für die Suche zu. Schränken Sie einen ein.",
362
+ "formula.lookup.ppm": "{value} ppm",
363
+ "formula.lookup.detail": "{mass} Da, Unsättigungsgrad {unsaturation}",
348
364
  "slides.exit": "Beenden",
349
365
  "slides.previousSlide": "Vorige Folie",
350
366
  "slides.nextSlide": "Nächste Folie",
@@ -571,6 +587,8 @@
571
587
  "structure.export.saveSvg": "Als SVG speichern",
572
588
  "structure.export.savePng": "Als PNG speichern",
573
589
  "structure.export.copyPng": "PNG kopieren",
590
+ "structure.export.copySvg": "SVG kopieren",
591
+ "structure.export.svgCopied": "In die Zwischenablage kopiert: SVG.",
574
592
  "structure.export.smiles": "SMILES",
575
593
  "structure.export.smilesHelp": "Die Struktur in einer Zeile, Stereochemie eingeschlossen. Jedes Programm liest sie.",
576
594
  "structure.export.molfileV3000": "Molfile V3000",
@@ -103,6 +103,7 @@
103
103
  "site.regexp.tagline": "Learn regular expressions in a live playground.",
104
104
  "site.pdb.tagline": "A fast look at any Protein Data Bank entry.",
105
105
  "site.elucidation.tagline": "A structure from a 1H NMR spectrum and a formula.",
106
+ "site.spectroscopy.tagline": "Find a structure from its IR, mass and NMR spectra.",
106
107
  "site.equilibrium.tagline": "Chemical equilibria: pH, speciation and titration curves.",
107
108
  "site.polycarp.tagline": "Predict the microstructure of a radical copolymerisation.",
108
109
  "site.3d.tagline": "Conformers in 3D from a structure you draw.",
@@ -345,6 +346,21 @@
345
346
  "formula.wholeCounts": "“{formula}” gives an atom a count of {count}; counts are whole numbers.",
346
347
  "formula.unknownNotation": "“{formula}” uses a notation this tool does not count.",
347
348
  "formula.unreadable": "“{formula}” is not a formula this tool can read ({reason}).",
349
+ "formula.lookup.title": "Formula lookup",
350
+ "formula.lookup.reset": "Reset the mass and the element ranges",
351
+ "formula.lookup.mass": "Monoisotopic mass",
352
+ "formula.lookup.massPlaceholder": "e.g. 128.0626",
353
+ "formula.lookup.neutral": "Of the neutral molecule: take the protons the spectrum added back off.",
354
+ "formula.lookup.fewest": "Fewest {element} atoms",
355
+ "formula.lookup.most": "Most {element} atoms",
356
+ "formula.lookup.typeMass": "Type a mass to list the formulas these ranges allow.",
357
+ "formula.lookup.closest": "The {count} closest of {total} formulas",
358
+ "formula.lookup.countOne": "{count} formula",
359
+ "formula.lookup.countMany": "{count} formulas",
360
+ "formula.lookup.nothingFits": "Nothing fits. Widen a range, or check the mass.",
361
+ "formula.lookup.tooWide": "These ranges allow too many formulas to search. Narrow one.",
362
+ "formula.lookup.ppm": "{value} ppm",
363
+ "formula.lookup.detail": "{mass} Da, unsaturation {unsaturation}",
348
364
  "slides.exit": "Exit",
349
365
  "slides.previousSlide": "Previous slide",
350
366
  "slides.nextSlide": "Next slide",
@@ -515,6 +531,8 @@
515
531
  "structure.export.saveSvg": "Save SVG",
516
532
  "structure.export.savePng": "Save PNG",
517
533
  "structure.export.copyPng": "Copy PNG",
534
+ "structure.export.copySvg": "Copy SVG",
535
+ "structure.export.svgCopied": "Copied the SVG to the clipboard.",
518
536
  "structure.export.smiles": "SMILES",
519
537
  "structure.export.smilesHelp": "The structure on one line, stereochemistry included. Every tool reads it.",
520
538
  "structure.export.molfileV3000": "Molfile V3000",
@@ -103,6 +103,7 @@
103
103
  "site.regexp.tagline": "Aprender expresiones regulares en un entorno interactivo.",
104
104
  "site.pdb.tagline": "Una mirada rápida a cualquier entrada del Protein Data Bank.",
105
105
  "site.elucidation.tagline": "Una estructura a partir de un espectro de RMN de 1H y una fórmula.",
106
+ "site.spectroscopy.tagline": "Encontrar una estructura a partir de sus espectros IR, de masas y de RMN.",
106
107
  "site.equilibrium.tagline": "Equilibrios químicos: pH, especiación y curvas de valoración.",
107
108
  "site.polycarp.tagline": "Predecir la microestructura de una copolimerización radicalaria.",
108
109
  "site.3d.tagline": "Confórmeros en 3D a partir de una estructura que usted dibuja.",
@@ -345,6 +346,21 @@
345
346
  "formula.wholeCounts": "«{formula}» da a un átomo la cantidad {count}; las cantidades son números enteros.",
346
347
  "formula.unknownNotation": "«{formula}» usa una notación que esta herramienta no cuenta.",
347
348
  "formula.unreadable": "«{formula}» no es una fórmula que esta herramienta sepa leer ({reason}).",
349
+ "formula.lookup.title": "Búsqueda de fórmulas",
350
+ "formula.lookup.reset": "Restablecer la masa y los intervalos de elementos",
351
+ "formula.lookup.mass": "Masa monoisotópica",
352
+ "formula.lookup.massPlaceholder": "p. ej. 128.0626",
353
+ "formula.lookup.neutral": "La de la molécula neutra: reste los protones que el espectro añadió.",
354
+ "formula.lookup.fewest": "Mínimo de átomos de {element}",
355
+ "formula.lookup.most": "Máximo de átomos de {element}",
356
+ "formula.lookup.typeMass": "Escriba una masa para listar las fórmulas que permiten estos intervalos.",
357
+ "formula.lookup.closest": "Las {count} más cercanas de {total} fórmulas",
358
+ "formula.lookup.countOne": "{count} fórmula",
359
+ "formula.lookup.countMany": "{count} fórmulas",
360
+ "formula.lookup.nothingFits": "Ninguna fórmula encaja. Amplíe un intervalo o compruebe la masa.",
361
+ "formula.lookup.tooWide": "Estos intervalos permiten demasiadas fórmulas para buscarlas. Reduzca uno.",
362
+ "formula.lookup.ppm": "{value} ppm",
363
+ "formula.lookup.detail": "{mass} Da, insaturación {unsaturation}",
348
364
  "slides.exit": "Salir",
349
365
  "slides.previousSlide": "Diapositiva anterior",
350
366
  "slides.nextSlide": "Diapositiva siguiente",
@@ -571,6 +587,8 @@
571
587
  "structure.export.saveSvg": "Guardar en SVG",
572
588
  "structure.export.savePng": "Guardar en PNG",
573
589
  "structure.export.copyPng": "Copiar el PNG",
590
+ "structure.export.copySvg": "Copiar el SVG",
591
+ "structure.export.svgCopied": "Copiado al portapapeles: SVG.",
574
592
  "structure.export.smiles": "SMILES",
575
593
  "structure.export.smilesHelp": "La estructura en una línea, con su estereoquímica. Todas las herramientas la leen.",
576
594
  "structure.export.molfileV3000": "Molfile V3000",
@@ -103,6 +103,7 @@
103
103
  "site.regexp.tagline": "Apprendre les expressions régulières dans un bac à sable interactif.",
104
104
  "site.pdb.tagline": "Un coup d'œil rapide sur n'importe quelle entrée de la Protein Data Bank.",
105
105
  "site.elucidation.tagline": "Une structure à partir d'un spectre RMN 1H et d'une formule.",
106
+ "site.spectroscopy.tagline": "Trouver une structure à partir de ses spectres IR, de masse et RMN.",
106
107
  "site.equilibrium.tagline": "Équilibres chimiques : pH, spéciation et courbes de titrage.",
107
108
  "site.polycarp.tagline": "Prédire la microstructure d'une copolymérisation radicalaire.",
108
109
  "site.3d.tagline": "Les conformères en 3D d'une structure que vous dessinez.",
@@ -345,6 +346,21 @@
345
346
  "formula.wholeCounts": "« {formula} » compte {count} pour un atome ; un nombre d’atomes est entier.",
346
347
  "formula.unknownNotation": "« {formula} » utilise une notation que cet outil ne compte pas.",
347
348
  "formula.unreadable": "« {formula} » n’est pas une formule que cet outil sait lire ({reason}).",
349
+ "formula.lookup.title": "Recherche de formule",
350
+ "formula.lookup.reset": "Réinitialiser la masse et les intervalles d’éléments",
351
+ "formula.lookup.mass": "Masse monoisotopique",
352
+ "formula.lookup.massPlaceholder": "p. ex. 128.0626",
353
+ "formula.lookup.neutral": "Celle de la molécule neutre : retirez les protons que le spectre a ajoutés.",
354
+ "formula.lookup.fewest": "{element} : nombre minimal d’atomes",
355
+ "formula.lookup.most": "{element} : nombre maximal d’atomes",
356
+ "formula.lookup.typeMass": "Tapez une masse pour lister les formules que ces intervalles permettent.",
357
+ "formula.lookup.closest": "Les {count} plus proches sur {total} formules",
358
+ "formula.lookup.countOne": "{count} formule",
359
+ "formula.lookup.countMany": "{count} formules",
360
+ "formula.lookup.nothingFits": "Aucune formule ne convient. Élargissez un intervalle, ou vérifiez la masse.",
361
+ "formula.lookup.tooWide": "Ces intervalles permettent trop de formules pour les parcourir. Resserrez-en un.",
362
+ "formula.lookup.ppm": "{value} ppm",
363
+ "formula.lookup.detail": "{mass} Da, insaturation {unsaturation}",
348
364
  "slides.exit": "Quitter",
349
365
  "slides.previousSlide": "Diapositive précédente",
350
366
  "slides.nextSlide": "Diapositive suivante",
@@ -571,6 +587,8 @@
571
587
  "structure.export.saveSvg": "Enregistrer en SVG",
572
588
  "structure.export.savePng": "Enregistrer en PNG",
573
589
  "structure.export.copyPng": "Copier le PNG",
590
+ "structure.export.copySvg": "Copier le SVG",
591
+ "structure.export.svgCopied": "Copié dans le presse-papiers : SVG.",
574
592
  "structure.export.smiles": "SMILES",
575
593
  "structure.export.smilesHelp": "La structure sur une ligne, stéréochimie comprise. Tous les logiciels le lisent.",
576
594
  "structure.export.molfileV3000": "Molfile V3000",
@@ -103,6 +103,7 @@
103
103
  "site.regexp.tagline": "Imparare le espressioni regolari in un ambiente interattivo.",
104
104
  "site.pdb.tagline": "Uno sguardo rapido a qualsiasi voce della Protein Data Bank.",
105
105
  "site.elucidation.tagline": "Una struttura da uno spettro NMR 1H e da una formula.",
106
+ "site.spectroscopy.tagline": "Trovare una struttura dai suoi spettri IR, di massa e NMR.",
106
107
  "site.equilibrium.tagline": "Equilibri chimici: pH, speciazione e curve di titolazione.",
107
108
  "site.polycarp.tagline": "Prevedere la microstruttura di una copolimerizzazione radicalica.",
108
109
  "site.3d.tagline": "Conformeri in 3D a partire da una struttura che si disegna.",
@@ -345,6 +346,21 @@
345
346
  "formula.wholeCounts": "«{formula}» dà a un atomo il numero {count}; i numeri di atomi sono interi.",
346
347
  "formula.unknownNotation": "«{formula}» usa una notazione che questo strumento non conta.",
347
348
  "formula.unreadable": "«{formula}» non è una formula che questo strumento sa leggere ({reason}).",
349
+ "formula.lookup.title": "Ricerca di formule",
350
+ "formula.lookup.reset": "Reimposta la massa e gli intervalli degli elementi",
351
+ "formula.lookup.mass": "Massa monoisotopica",
352
+ "formula.lookup.massPlaceholder": "es. 128.0626",
353
+ "formula.lookup.neutral": "Quella della molecola neutra: togli i protoni che lo spettro ha aggiunto.",
354
+ "formula.lookup.fewest": "Numero minimo di atomi di {element}",
355
+ "formula.lookup.most": "Numero massimo di atomi di {element}",
356
+ "formula.lookup.typeMass": "Scrivi una massa per elencare le formule che questi intervalli consentono.",
357
+ "formula.lookup.closest": "Le {count} più vicine su {total} formule",
358
+ "formula.lookup.countOne": "{count} formula",
359
+ "formula.lookup.countMany": "{count} formule",
360
+ "formula.lookup.nothingFits": "Nessuna formula corrisponde. Allarga un intervallo o controlla la massa.",
361
+ "formula.lookup.tooWide": "Questi intervalli consentono troppe formule per la ricerca. Restringine uno.",
362
+ "formula.lookup.ppm": "{value} ppm",
363
+ "formula.lookup.detail": "{mass} Da, insaturazione {unsaturation}",
348
364
  "slides.exit": "Esci",
349
365
  "slides.previousSlide": "Diapositiva precedente",
350
366
  "slides.nextSlide": "Diapositiva successiva",
@@ -515,6 +531,8 @@
515
531
  "structure.export.saveSvg": "Salva in SVG",
516
532
  "structure.export.savePng": "Salva in PNG",
517
533
  "structure.export.copyPng": "Copia il PNG",
534
+ "structure.export.copySvg": "Copia l’SVG",
535
+ "structure.export.svgCopied": "Copiato negli appunti: SVG.",
518
536
  "structure.export.smiles": "SMILES",
519
537
  "structure.export.smilesHelp": "La struttura su una riga, stereochimica compresa. Ogni strumento la legge.",
520
538
  "structure.export.molfileV3000": "Molfile V3000",
@@ -0,0 +1,43 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ import type { StructureProps } from './Structure.tsx';
3
+ /** What {@link CardStructure} draws and hands over. */
4
+ export interface CardStructureProps extends StructureProps {
5
+ /**
6
+ * Base name of every file saved from the export, extension excluded.
7
+ * @default 'structure'
8
+ */
9
+ name?: string;
10
+ /**
11
+ * Whether the structure is a query fragment, such as a toxicophore, whose
12
+ * idCode is not a molecule's.
13
+ * @default false
14
+ */
15
+ fragment?: boolean;
16
+ /**
17
+ * What the glyph is called, for the pointer and for a screen reader.
18
+ * @default the chrome's own line, `Copy or save the structure: SMILES,
19
+ * molfile`
20
+ */
21
+ label?: string;
22
+ /**
23
+ * The drawing, when the site draws the structure itself — its own
24
+ * highlights, its own numbering. The export still reads the notations.
25
+ * @default a `Structure` drawn from the same notations, at the same size
26
+ */
27
+ children?: ReactNode;
28
+ }
29
+ /**
30
+ * A structure of a card, with the glyph that hands it over: the export
31
+ * dialog, which copies it as an SVG or a PNG, a SMILES or a molfile, V2000 or
32
+ * V3000. Every structure an answer draws carries it, alone or in a grid, so
33
+ * none has to be redrawn to be reused.
34
+ *
35
+ * The glyph stands beside the top right corner, faded until the structure is
36
+ * pointed at, as the glyphs of `CardFigure` (`react-cheminfo/card`) do;
37
+ * `styles/card.css` draws both. A structure with nothing to read draws its
38
+ * placeholder alone.
39
+ * @param props - The structure, its size, and the name of its files.
40
+ * @returns The structure and its glyph.
41
+ */
42
+ export declare function CardStructure(props: CardStructureProps): ReactElement;
43
+ //# sourceMappingURL=CardStructure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardStructure.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/CardStructure.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAItD,uDAAuD;AACvD,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CA0BrE"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { OverlayLayer } from "../../overlay/ui/OverlayLayer.js";
3
+ import { structureSource } from "../core/structureSource.js";
4
+ import { Structure } from "./Structure.js";
5
+ import { StructureExportButton } from "./StructureExportButton.js";
6
+ /**
7
+ * A structure of a card, with the glyph that hands it over: the export
8
+ * dialog, which copies it as an SVG or a PNG, a SMILES or a molfile, V2000 or
9
+ * V3000. Every structure an answer draws carries it, alone or in a grid, so
10
+ * none has to be redrawn to be reused.
11
+ *
12
+ * The glyph stands beside the top right corner, faded until the structure is
13
+ * pointed at, as the glyphs of `CardFigure` (`react-cheminfo/card`) do;
14
+ * `styles/card.css` draws both. A structure with nothing to read draws its
15
+ * placeholder alone.
16
+ * @param props - The structure, its size, and the name of its files.
17
+ * @returns The structure and its glyph.
18
+ */
19
+ export function CardStructure(props) {
20
+ const { name, fragment, label, children, ...structure } = props;
21
+ const { idCode, coordinates, molfile, smiles } = structure;
22
+ const drawing = children ?? _jsx(Structure, { ...structure });
23
+ const source = structureSource({ idCode, coordinates, molfile, smiles });
24
+ if (source.kind === 'empty')
25
+ return _jsx(_Fragment, { children: drawing });
26
+ return (_jsxs("div", { className: "card-figure card-structure", children: [_jsx("div", { className: "card-figure__drawing", children: drawing }), _jsx(OverlayLayer, { density: "compact", awake: true, children: _jsx("div", { className: "card-figure__tools", "data-testid": "figure-tools", children: _jsx(StructureExportButton, { idCode: idCode, coordinates: coordinates, molfile: molfile, smiles: smiles, name: name, fragment: fragment, label: label }) }) })] }));
27
+ }
28
+ //# sourceMappingURL=CardStructure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardStructure.js","sourceRoot":"","sources":["../../../src/structure/ui/CardStructure.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAmC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAiB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA6B,CAAC;AA6BpE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAChE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC3D,MAAM,OAAO,GAAG,QAAQ,IAAI,KAAC,SAAS,OAAK,SAAS,GAAI,CAAC;IACzD,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACzE,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,4BAAG,OAAO,GAAI,CAAC;IAEnD,OAAO,CACL,eAAK,SAAS,EAAC,4BAA4B,aACzC,cAAK,SAAS,EAAC,sBAAsB,YAAE,OAAO,GAAO,EAErD,KAAC,YAAY,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,kBACnC,cAAK,SAAS,EAAC,oBAAoB,iBAAa,cAAc,YAC5D,KAAC,qBAAqB,IACpB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACZ,GACE,GACO,IACX,CACP,CAAC;AACJ,CAAC"}
@@ -9,7 +9,7 @@ export interface StructurePicturePaneProps {
9
9
  }
10
10
  /**
11
11
  * The structure as a picture: what it looks like, how big it leaves, and the
12
- * three ways it leaves.
12
+ * four ways it leaves.
13
13
  *
14
14
  * What is shown is the file: the preview is the very SVG the save button
15
15
  * writes, laid out smaller, so nobody saves a picture they have not seen. The
@@ -1 +1 @@
1
- {"version":3,"file":"StructurePicturePane.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/StructurePicturePane.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAwBzD,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,GAC/B,YAAY,CAgHd"}
1
+ {"version":3,"file":"StructurePicturePane.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/StructurePicturePane.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAyBzD,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,GAC/B,YAAY,CA4Hd"}
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button, SegmentedControl } from '@blueprintjs/core';
3
3
  import { useMemo, useState } from 'react';
4
4
  import { copyFigure } from "../../download/core/copyFigure.js";
5
+ import { copySvg } from "../../download/core/copySvg.js";
5
6
  import { downloadBlob } from "../../download/core/downloadBlob.js";
6
7
  import { downloadText } from "../../download/core/downloadText.js";
7
8
  import { figurePng } from "../../download/core/figurePng.js";
@@ -16,7 +17,7 @@ import { STRUCTURE_BOND_LENGTH, structurePicture, } from "../core/structurePictu
16
17
  const DEFAULT_SCALE = 2;
17
18
  /**
18
19
  * The structure as a picture: what it looks like, how big it leaves, and the
19
- * three ways it leaves.
20
+ * four ways it leaves.
20
21
  *
21
22
  * What is shown is the file: the preview is the very SVG the save button
22
23
  * writes, laid out smaller, so nobody saves a picture they have not seen. The
@@ -64,7 +65,9 @@ export function StructurePicturePane(props) {
64
65
  }) }), _jsx(Button, { icon: "download", size: "small", intent: "primary", text: t('structure.export.savePng'), onClick: () => void run(async () => {
65
66
  downloadBlob(await png(), `${fileName}.png`);
66
67
  return null;
67
- }) }), _jsx(Button, { icon: "clipboard", size: "small", text: t('structure.export.copyPng'), onClick: () =>
68
+ }) }), _jsx(Button, { icon: "clipboard", size: "small", text: t('structure.export.copySvg'), onClick: () => void run(async () => (await copySvg(picture.markup))
69
+ ? t('structure.export.svgCopied')
70
+ : t('clipboard.failed')) }), _jsx(Button, { icon: "clipboard", size: "small", text: t('structure.export.copyPng'), onClick: () =>
68
71
  // Safari only allows a clipboard write the click itself started,
69
72
  // so the image is handed over as a promise rather than awaited
70
73
  // first — see `copyFigure`.
@@ -1 +1 @@
1
- {"version":3,"file":"StructurePicturePane.js","sourceRoot":"","sources":["../../../src/structure/ui/StructurePicturePane.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,oCAAoC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AG,SAAS,EAAC,0BAA0B,EAAC,KAAK,EAAE,YAAY,YACxD,MAAM,GACL,CACL,IACG,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,IAAsB;IAK1C,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC;YAC9B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;YACpB,QAAQ,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,GAAG,uBAAuB;IAC1B,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,GAAG;CACiB,CAAC;AAEnC,MAAM,YAAY,GAAG;IACnB,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;IACZ,kBAAkB,EAAE,cAAc;CACF,CAAC;AAEnC,MAAM,YAAY,GAAG;IACnB,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;CACoB,CAAC"}
1
+ {"version":3,"file":"StructurePicturePane.js","sourceRoot":"","sources":["../../../src/structure/ui/StructurePicturePane.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,YAAY,EA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E,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;IACZ,kBAAkB,EAAE,cAAc;CACF,CAAC;AAEnC,MAAM,YAAY,GAAG;IACnB,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,KAAK,CAAC,SAAS;IACtB,QAAQ,EAAE,EAAE;CACoB,CAAC"}
@@ -27,6 +27,8 @@ export type { StructureExportDialogProps } from './StructureExportDialog.tsx';
27
27
  export { StructureExportDialog } from './StructureExportDialog.tsx';
28
28
  export type { StructureExportButtonProps } from './StructureExportButton.tsx';
29
29
  export { StructureExportButton } from './StructureExportButton.tsx';
30
+ export type { CardStructureProps } from './CardStructure.tsx';
31
+ export { CardStructure } from './CardStructure.tsx';
30
32
  export type { StructureExportPanelProps } from './StructureExportPanel.tsx';
31
33
  export type { ToolbarFloorOptions } from './useToolbarFloor.ts';
32
34
  export { useToolbarFloor } from './useToolbarFloor.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,0BAA0B,EA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AAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -18,6 +18,7 @@ export { StructureSearchDialog } from "./StructureSearchDialog.js";
18
18
  export { useStructureSearchModes } from "./useStructureSearchModes.js";
19
19
  export { StructureExportDialog } from "./StructureExportDialog.js";
20
20
  export { StructureExportButton } from "./StructureExportButton.js";
21
+ export { CardStructure } from "./CardStructure.js";
21
22
  export { useToolbarFloor } from "./useToolbarFloor.js";
22
23
  export { useStructureDraft } from "./useStructureDraft.js";
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structure/ui/index.ts"],"names":[],"mappings":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
@@ -1 +1 @@
1
- {"version":3,"file":"useToolbarFloor.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/useToolbarFloor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,mBAAwB,GAChC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAyBlC"}
1
+ {"version":3,"file":"useToolbarFloor.d.ts","sourceRoot":"","sources":["../../../src/structure/ui/useToolbarFloor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,mBAAwB,GAChC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAmClC"}
@@ -18,19 +18,29 @@ export function useToolbarFloor(options = {}) {
18
18
  if (container === null)
19
19
  return;
20
20
  return watchToolbar(container, (toolbar) => {
21
+ let frame = 0;
21
22
  const size = new ResizeObserver(() => {
22
- // offsetHeight, because a dialog opens under a scaling transform and a
23
- // measured rectangle would be that of the half drawn toolbar.
24
- const height = toolbar.offsetHeight;
25
- // Zero is a toolbar being torn down or not yet laid out, never a
26
- // toolbar that needs no room: writing the fallback for it would undo a
27
- // correct floor and leave the palette cut off.
28
- if (height === 0)
29
- return;
30
- container.style.minHeight = `${toolbarFloorHeight(height, minHeight)}px`;
23
+ // Written on the next frame: growing the box from inside this callback
24
+ // resizes the editor element above the toolbar, whose own observer the
25
+ // browser then drops with a "ResizeObserver loop" error.
26
+ cancelAnimationFrame(frame);
27
+ frame = requestAnimationFrame(() => {
28
+ // offsetHeight, because a dialog opens under a scaling transform and
29
+ // a measured rectangle would be that of the half drawn toolbar.
30
+ const height = toolbar.offsetHeight;
31
+ // Zero is a toolbar being torn down or not yet laid out, never a
32
+ // toolbar that needs no room: writing the fallback for it would undo
33
+ // a correct floor and leave the palette cut off.
34
+ if (height === 0)
35
+ return;
36
+ container.style.minHeight = `${toolbarFloorHeight(height, minHeight)}px`;
37
+ });
31
38
  });
32
39
  size.observe(toolbar);
33
- return () => size.disconnect();
40
+ return () => {
41
+ cancelAnimationFrame(frame);
42
+ size.disconnect();
43
+ };
34
44
  });
35
45
  }, [minHeight, revision]);
36
46
  return containerRef;
@@ -1 +1 @@
1
- {"version":3,"file":"useToolbarFloor.js","sourceRoot":"","sources":["../../../src/structure/ui/useToolbarFloor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAkBjD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,UAA+B,EAAE;IAEjC,MAAM,EAAE,SAAS,GAAG,GAAG,EAAE,QAAQ,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC;IAClD,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,eAAe,CAAC,GAAG,EAAE;QACnB,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC;QACvC,IAAI,SAAS,KAAK,IAAI;YAAE,OAAO;QAE/B,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YACzC,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,GAA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I,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE;gBACnC,uEAAuE;gBACvE,uEAAuE;gBACvE,yDAAyD;gBACzD,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBAC5B,KAAK,GAAG,qBAAqB,CAAC,GAAG,EAAE;oBACjC,qEAAqE;oBACrE,gEAAgE;oBAChE,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;oBACpC,iEAAiE;oBACjE,qEAAqE;oBACrE,iDAAiD;oBACjD,IAAI,MAAM,KAAK,CAAC;wBAAE,OAAO;oBACzB,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,kBAAkB,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC;gBAC3E,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO,GAAG,EAAE;gBACV,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE1B,OAAO,YAAY,CAAC;AACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-cheminfo",
3
- "version": "0.74.0",
3
+ "version": "0.76.0",
4
4
  "license": "MIT",
5
5
  "description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
6
6
  "author": "Luc Patiny",
@@ -82,6 +82,7 @@
82
82
  "ir-spectrum": "^4.2.0",
83
83
  "jcampconverter": "^12.5.11",
84
84
  "leven": "^4.1.0",
85
+ "mf-finder": "^3.4.25",
85
86
  "mf-parser": "^3.9.3",
86
87
  "ml-peak-shape-generator": "^5.6.0",
87
88
  "ml-spectra-processing": "^14.35.1",
@@ -112,7 +113,7 @@
112
113
  "@zakodium/tsconfig": "^1.0.5",
113
114
  "benchmark": "^2.1.4",
114
115
  "chemical-elements": "^2.3.2",
115
- "cheminfo-mcp-server": "^0.6.2",
116
+ "cheminfo-mcp-server": "^0.7.0",
116
117
  "eslint": "^9.39.5",
117
118
  "eslint-config-cheminfo-react": "^20.1.0",
118
119
  "eslint-config-cheminfo-typescript": "^22.1.0",
@@ -140,7 +141,7 @@
140
141
  "@blueprintjs/core": "^6.18.0",
141
142
  "@fastify/static": "^10.0.0",
142
143
  "@fastify/type-provider-typebox": "^6.0.0",
143
- "cheminfo-mcp-server": "^0.6.2",
144
+ "cheminfo-mcp-server": "^0.6.2 || ^0.7.0",
144
145
  "fastify": "^5.0.0",
145
146
  "ml-pca": "^4.1.1",
146
147
  "ml-signal-processing": "^2.2.2",