react-cheminfo 0.74.0 → 0.75.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.
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +26 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/types.d.ts +1 -1
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +7 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -1
- package/lib/formula/core/elementRanges.d.ts +25 -0
- package/lib/formula/core/elementRanges.d.ts.map +1 -0
- package/lib/formula/core/elementRanges.js +35 -0
- package/lib/formula/core/elementRanges.js.map +1 -0
- package/lib/formula/core/formulaCandidates.d.ts +59 -0
- package/lib/formula/core/formulaCandidates.d.ts.map +1 -0
- package/lib/formula/core/formulaCandidates.js +50 -0
- package/lib/formula/core/formulaCandidates.js.map +1 -0
- package/lib/formula/core/index.d.ts +4 -0
- package/lib/formula/core/index.d.ts.map +1 -1
- package/lib/formula/core/index.js +2 -0
- package/lib/formula/core/index.js.map +1 -1
- package/lib/formula/ui/ElementRangeFields.d.ts +19 -0
- package/lib/formula/ui/ElementRangeFields.d.ts.map +1 -0
- package/lib/formula/ui/ElementRangeFields.js +23 -0
- package/lib/formula/ui/ElementRangeFields.js.map +1 -0
- package/lib/formula/ui/FormulaLookup.d.ts +47 -0
- package/lib/formula/ui/FormulaLookup.d.ts.map +1 -0
- package/lib/formula/ui/FormulaLookup.js +74 -0
- package/lib/formula/ui/FormulaLookup.js.map +1 -0
- package/lib/formula/ui/FormulaLookupResults.d.ts +20 -0
- package/lib/formula/ui/FormulaLookupResults.d.ts.map +1 -0
- package/lib/formula/ui/FormulaLookupResults.js +45 -0
- package/lib/formula/ui/FormulaLookupResults.js.map +1 -0
- package/lib/formula/ui/index.d.ts +2 -0
- package/lib/formula/ui/index.d.ts.map +1 -1
- package/lib/formula/ui/index.js +1 -0
- package/lib/formula/ui/index.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/locales/de.json +16 -0
- package/lib/locales/en.json +16 -0
- package/lib/locales/es.json +16 -0
- package/lib/locales/fr.json +16 -0
- package/lib/locales/it.json +16 -0
- package/lib/structure/ui/useToolbarFloor.d.ts.map +1 -1
- package/lib/structure/ui/useToolbarFloor.js +20 -10
- package/lib/structure/ui/useToolbarFloor.js.map +1 -1
- package/package.json +4 -3
- package/src/ecosystem/core/sites.ts +26 -0
- package/src/ecosystem/core/types.ts +3 -1
- package/src/ecosystem/ui/glyphs.tsx +46 -0
- package/src/formula/core/elementRanges.ts +44 -0
- package/src/formula/core/formulaCandidates.ts +109 -0
- package/src/formula/core/index.ts +15 -0
- package/src/formula/ui/ElementRangeFields.tsx +65 -0
- package/src/formula/ui/FormulaLookup.tsx +184 -0
- package/src/formula/ui/FormulaLookupResults.tsx +89 -0
- package/src/formula/ui/index.ts +2 -0
- package/src/locales/de.json +16 -0
- package/src/locales/en.json +16 -0
- package/src/locales/es.json +16 -0
- package/src/locales/fr.json +16 -0
- package/src/locales/it.json +16 -0
- package/src/structure/ui/useToolbarFloor.ts +19 -9
- package/styles/chrome.css +133 -0
package/src/locales/fr.json
CHANGED
|
@@ -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",
|
package/src/locales/it.json
CHANGED
|
@@ -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",
|
|
@@ -41,18 +41,28 @@ export function useToolbarFloor(
|
|
|
41
41
|
if (container === null) return;
|
|
42
42
|
|
|
43
43
|
return watchToolbar(container, (toolbar) => {
|
|
44
|
+
let frame = 0;
|
|
44
45
|
const size = new ResizeObserver(() => {
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
// Written on the next frame: growing the box from inside this callback
|
|
47
|
+
// resizes the editor element above the toolbar, whose own observer the
|
|
48
|
+
// browser then drops with a "ResizeObserver loop" error.
|
|
49
|
+
cancelAnimationFrame(frame);
|
|
50
|
+
frame = requestAnimationFrame(() => {
|
|
51
|
+
// offsetHeight, because a dialog opens under a scaling transform and
|
|
52
|
+
// a measured rectangle would be that of the half drawn toolbar.
|
|
53
|
+
const height = toolbar.offsetHeight;
|
|
54
|
+
// Zero is a toolbar being torn down or not yet laid out, never a
|
|
55
|
+
// toolbar that needs no room: writing the fallback for it would undo
|
|
56
|
+
// a correct floor and leave the palette cut off.
|
|
57
|
+
if (height === 0) return;
|
|
58
|
+
container.style.minHeight = `${toolbarFloorHeight(height, minHeight)}px`;
|
|
59
|
+
});
|
|
53
60
|
});
|
|
54
61
|
size.observe(toolbar);
|
|
55
|
-
return () =>
|
|
62
|
+
return () => {
|
|
63
|
+
cancelAnimationFrame(frame);
|
|
64
|
+
size.disconnect();
|
|
65
|
+
};
|
|
56
66
|
});
|
|
57
67
|
}, [minHeight, revision]);
|
|
58
68
|
|
package/styles/chrome.css
CHANGED
|
@@ -1760,6 +1760,139 @@ span.taxon-lineage__name {
|
|
|
1760
1760
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
1761
1761
|
}
|
|
1762
1762
|
|
|
1763
|
+
/* ── A formula lookup ────────────────────────────────────────────────────── */
|
|
1764
|
+
|
|
1765
|
+
/* Only the panel's own look: where it sits — a column beside a question, a
|
|
1766
|
+
sticky rail, a shadow — is the page's, through the class it passes. */
|
|
1767
|
+
.formula-lookup {
|
|
1768
|
+
display: flex;
|
|
1769
|
+
flex-direction: column;
|
|
1770
|
+
border: 1px solid var(--border);
|
|
1771
|
+
background: var(--surface);
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
.formula-lookup__header {
|
|
1775
|
+
display: flex;
|
|
1776
|
+
align-items: center;
|
|
1777
|
+
padding: 0.25rem 0.5rem 0.25rem 0.75rem;
|
|
1778
|
+
border-bottom: 1px solid var(--border);
|
|
1779
|
+
color: var(--text-muted);
|
|
1780
|
+
font-size: 0.8rem;
|
|
1781
|
+
font-weight: 700;
|
|
1782
|
+
gap: 0.25rem;
|
|
1783
|
+
letter-spacing: 0.04em;
|
|
1784
|
+
text-transform: uppercase;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
.formula-lookup__header > .bp6-button {
|
|
1788
|
+
margin-left: auto;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
.formula-lookup__body {
|
|
1792
|
+
display: flex;
|
|
1793
|
+
flex-direction: column;
|
|
1794
|
+
padding: 0.75rem;
|
|
1795
|
+
gap: 0.5rem;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
.formula-lookup__field {
|
|
1799
|
+
display: flex;
|
|
1800
|
+
flex-direction: column;
|
|
1801
|
+
color: var(--text-muted);
|
|
1802
|
+
font-size: 0.8rem;
|
|
1803
|
+
font-weight: 600;
|
|
1804
|
+
gap: 2px;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
.formula-lookup__hint {
|
|
1808
|
+
color: var(--text-muted);
|
|
1809
|
+
font-size: 0.75rem;
|
|
1810
|
+
line-height: 1.4;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
/* Two elements to a line: each box holds two or three digits. */
|
|
1814
|
+
.formula-lookup__ranges {
|
|
1815
|
+
display: grid;
|
|
1816
|
+
margin-top: 0.25rem;
|
|
1817
|
+
gap: 0.25rem 0.5rem;
|
|
1818
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
.formula-lookup__range {
|
|
1822
|
+
display: flex;
|
|
1823
|
+
min-width: 0;
|
|
1824
|
+
align-items: center;
|
|
1825
|
+
gap: 3px;
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
.formula-lookup__range .bp6-input-group {
|
|
1829
|
+
min-width: 0;
|
|
1830
|
+
flex: 1 1 0;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
.formula-lookup__range .bp6-input {
|
|
1834
|
+
padding-right: 4px;
|
|
1835
|
+
padding-left: 4px;
|
|
1836
|
+
text-align: center;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
.formula-lookup__element {
|
|
1840
|
+
width: 1.3rem;
|
|
1841
|
+
font-variant-numeric: tabular-nums;
|
|
1842
|
+
font-weight: 700;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
.formula-lookup__dash {
|
|
1846
|
+
color: var(--text-muted);
|
|
1847
|
+
font-size: 0.75rem;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
.formula-lookup__results {
|
|
1851
|
+
display: flex;
|
|
1852
|
+
flex-direction: column;
|
|
1853
|
+
padding: 0.75rem;
|
|
1854
|
+
border-top: 1px solid var(--border);
|
|
1855
|
+
gap: 0.25rem;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
/* A search still to come leaves the band empty rather than collapsing it. */
|
|
1859
|
+
.formula-lookup__results:empty {
|
|
1860
|
+
min-height: 2.5rem;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
.formula-lookup__count {
|
|
1864
|
+
color: var(--text-muted);
|
|
1865
|
+
font-size: 0.75rem;
|
|
1866
|
+
font-weight: 600;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
.formula-lookup__list {
|
|
1870
|
+
display: flex;
|
|
1871
|
+
overflow-y: auto;
|
|
1872
|
+
max-height: 40vh;
|
|
1873
|
+
flex-direction: column;
|
|
1874
|
+
padding: 0;
|
|
1875
|
+
margin: 0;
|
|
1876
|
+
list-style: none;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
/* A formula is never split across two lines. */
|
|
1880
|
+
.formula-lookup__list li {
|
|
1881
|
+
display: flex;
|
|
1882
|
+
align-items: baseline;
|
|
1883
|
+
justify-content: space-between;
|
|
1884
|
+
padding: 2px 0;
|
|
1885
|
+
font-size: 0.85rem;
|
|
1886
|
+
gap: 0.5rem;
|
|
1887
|
+
white-space: nowrap;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
.formula-lookup__ppm {
|
|
1891
|
+
color: var(--text-muted);
|
|
1892
|
+
font-size: 0.72rem;
|
|
1893
|
+
font-variant-numeric: tabular-nums;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1763
1896
|
/* ── A list of exercises ─────────────────────────────────────────────────── */
|
|
1764
1897
|
|
|
1765
1898
|
.exercise-list {
|