react-cheminfo 0.1.0 → 0.3.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/README.md +50 -9
- package/lib/citation/core/formats.js +2 -3
- package/lib/citation/core/formats.js.map +1 -1
- package/lib/citation/core/segments.d.ts +8 -0
- package/lib/citation/core/segments.d.ts.map +1 -1
- package/lib/citation/core/segments.js +12 -3
- package/lib/citation/core/segments.js.map +1 -1
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/ecosystem/core/sites.d.ts +1 -1
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +45 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.d.ts +33 -0
- package/lib/ecosystem/ui/EcosystemLinks.d.ts.map +1 -0
- package/lib/ecosystem/ui/EcosystemLinks.js +55 -0
- package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -0
- package/lib/ecosystem/ui/EcosystemMenu.d.ts +3 -1
- package/lib/ecosystem/ui/EcosystemMenu.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js +7 -84
- package/lib/ecosystem/ui/EcosystemMenu.js.map +1 -1
- package/lib/ecosystem/ui/SiteTile.d.ts +34 -0
- package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -0
- package/lib/ecosystem/ui/SiteTile.js +78 -0
- package/lib/ecosystem/ui/SiteTile.js.map +1 -0
- package/lib/ecosystem/ui/glyphs.d.ts +16 -0
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -0
- package/lib/ecosystem/ui/glyphs.js +41 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -0
- package/lib/ecosystem/ui/index.d.ts +4 -0
- package/lib/ecosystem/ui/index.d.ts.map +1 -1
- package/lib/ecosystem/ui/index.js +2 -0
- package/lib/ecosystem/ui/index.js.map +1 -1
- package/lib/ecosystem/ui/marks.d.ts.map +1 -1
- package/lib/ecosystem/ui/marks.js +3 -28
- package/lib/ecosystem/ui/marks.js.map +1 -1
- package/lib/orbital/core/atomicGrid.d.ts +58 -0
- package/lib/orbital/core/atomicGrid.d.ts.map +1 -0
- package/lib/orbital/core/atomicGrid.js +69 -0
- package/lib/orbital/core/atomicGrid.js.map +1 -0
- package/lib/orbital/core/atomicOrbitals.d.ts +97 -0
- package/lib/orbital/core/atomicOrbitals.d.ts.map +1 -0
- package/lib/orbital/core/atomicOrbitals.js +135 -0
- package/lib/orbital/core/atomicOrbitals.js.map +1 -0
- package/lib/orbital/core/constants.d.ts +33 -0
- package/lib/orbital/core/constants.d.ts.map +1 -0
- package/lib/orbital/core/constants.js +21 -0
- package/lib/orbital/core/constants.js.map +1 -0
- package/lib/orbital/core/electronConfiguration.d.ts +106 -0
- package/lib/orbital/core/electronConfiguration.d.ts.map +1 -0
- package/lib/orbital/core/electronConfiguration.js +207 -0
- package/lib/orbital/core/electronConfiguration.js.map +1 -0
- package/lib/orbital/core/grid.d.ts +60 -0
- package/lib/orbital/core/grid.d.ts.map +1 -0
- package/lib/orbital/core/grid.js +81 -0
- package/lib/orbital/core/grid.js.map +1 -0
- package/lib/orbital/core/hydrogenic.d.ts +99 -0
- package/lib/orbital/core/hydrogenic.d.ts.map +1 -0
- package/lib/orbital/core/hydrogenic.js +181 -0
- package/lib/orbital/core/hydrogenic.js.map +1 -0
- package/lib/orbital/core/index.d.ts +22 -0
- package/lib/orbital/core/index.d.ts.map +1 -0
- package/lib/orbital/core/index.js +12 -0
- package/lib/orbital/core/index.js.map +1 -0
- package/lib/orbital/core/numerics.d.ts +39 -0
- package/lib/orbital/core/numerics.d.ts.map +1 -0
- package/lib/orbital/core/numerics.js +75 -0
- package/lib/orbital/core/numerics.js.map +1 -0
- package/lib/orbital/core/occupancy.d.ts +44 -0
- package/lib/orbital/core/occupancy.d.ts.map +1 -0
- package/lib/orbital/core/occupancy.js +85 -0
- package/lib/orbital/core/occupancy.js.map +1 -0
- package/lib/orbital/core/palette.d.ts +36 -0
- package/lib/orbital/core/palette.d.ts.map +1 -0
- package/lib/orbital/core/palette.js +37 -0
- package/lib/orbital/core/palette.js.map +1 -0
- package/lib/orbital/core/realHarmonics.d.ts +57 -0
- package/lib/orbital/core/realHarmonics.d.ts.map +1 -0
- package/lib/orbital/core/realHarmonics.js +144 -0
- package/lib/orbital/core/realHarmonics.js.map +1 -0
- package/lib/orbital/core/sample.d.ts +52 -0
- package/lib/orbital/core/sample.d.ts.map +1 -0
- package/lib/orbital/core/sample.js +54 -0
- package/lib/orbital/core/sample.js.map +1 -0
- package/lib/orbital/core/screening.d.ts +46 -0
- package/lib/orbital/core/screening.d.ts.map +1 -0
- package/lib/orbital/core/screening.js +72 -0
- package/lib/orbital/core/screening.js.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts +57 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.js +105 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.js.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts +73 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.js +49 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.js.map +1 -0
- package/lib/orbital/ui/camera.d.ts +36 -0
- package/lib/orbital/ui/camera.d.ts.map +1 -0
- package/lib/orbital/ui/camera.js +98 -0
- package/lib/orbital/ui/camera.js.map +1 -0
- package/lib/orbital/ui/capability.d.ts +28 -0
- package/lib/orbital/ui/capability.d.ts.map +1 -0
- package/lib/orbital/ui/capability.js +77 -0
- package/lib/orbital/ui/capability.js.map +1 -0
- package/lib/orbital/ui/index.d.ts +17 -0
- package/lib/orbital/ui/index.d.ts.map +1 -0
- package/lib/orbital/ui/index.js +13 -0
- package/lib/orbital/ui/index.js.map +1 -0
- package/lib/orbital/ui/renderVolume.d.ts +57 -0
- package/lib/orbital/ui/renderVolume.d.ts.map +1 -0
- package/lib/orbital/ui/renderVolume.js +120 -0
- package/lib/orbital/ui/renderVolume.js.map +1 -0
- package/lib/orbital/ui/viewer.d.ts +86 -0
- package/lib/orbital/ui/viewer.d.ts.map +1 -0
- package/lib/orbital/ui/viewer.js +155 -0
- package/lib/orbital/ui/viewer.js.map +1 -0
- package/lib/orbital/ui/volumeField.d.ts +49 -0
- package/lib/orbital/ui/volumeField.d.ts.map +1 -0
- package/lib/orbital/ui/volumeField.js +108 -0
- package/lib/orbital/ui/volumeField.js.map +1 -0
- package/lib/orbital.d.ts +11 -0
- package/lib/orbital.d.ts.map +1 -0
- package/lib/orbital.js +11 -0
- package/lib/orbital.js.map +1 -0
- package/package.json +13 -5
- package/src/citation/core/formats.ts +2 -3
- package/src/citation/core/segments.ts +11 -3
- package/src/core.ts +1 -0
- package/src/ecosystem/core/sites.ts +51 -1
- package/src/ecosystem/ui/EcosystemLinks.tsx +114 -0
- package/src/ecosystem/ui/EcosystemMenu.tsx +8 -135
- package/src/ecosystem/ui/SiteTile.tsx +148 -0
- package/src/ecosystem/ui/glyphs.tsx +246 -0
- package/src/ecosystem/ui/index.ts +4 -0
- package/src/ecosystem/ui/marks.tsx +5 -159
- package/src/orbital/core/atomicGrid.ts +115 -0
- package/src/orbital/core/atomicOrbitals.ts +212 -0
- package/src/orbital/core/constants.ts +36 -0
- package/src/orbital/core/electronConfiguration.ts +242 -0
- package/src/orbital/core/grid.ts +126 -0
- package/src/orbital/core/hydrogenic.ts +222 -0
- package/src/orbital/core/index.ts +72 -0
- package/src/orbital/core/numerics.ts +79 -0
- package/src/orbital/core/occupancy.ts +100 -0
- package/src/orbital/core/palette.ts +56 -0
- package/src/orbital/core/realHarmonics.ts +172 -0
- package/src/orbital/core/sample.ts +91 -0
- package/src/orbital/core/screening.ts +90 -0
- package/src/orbital/ui/AtomicOrbitalCanvas.tsx +181 -0
- package/src/orbital/ui/AtomicOrbitalViewer.tsx +150 -0
- package/src/orbital/ui/camera.ts +125 -0
- package/src/orbital/ui/capability.ts +102 -0
- package/src/orbital/ui/index.ts +17 -0
- package/src/orbital/ui/renderVolume.ts +190 -0
- package/src/orbital/ui/viewer.ts +186 -0
- package/src/orbital/ui/volumeField.ts +128 -0
- package/src/orbital.ts +11 -0
package/README.md
CHANGED
|
@@ -25,15 +25,22 @@ npm i react-cheminfo
|
|
|
25
25
|
dependencies: a site already has them, and a second copy of `react-science`
|
|
26
26
|
would mean two Blueprint style trees in one page.
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Three entry points
|
|
29
29
|
|
|
30
|
-
| Import
|
|
31
|
-
|
|
|
32
|
-
| `react-cheminfo/
|
|
33
|
-
| `react-cheminfo/
|
|
30
|
+
| Import | Holds | Costs |
|
|
31
|
+
| ------------------------ | ----------------------------------------------------------------------------- | -------------- |
|
|
32
|
+
| `react-cheminfo/core` | the framework-free logic — citation formats, the site list, the orbital maths | nothing |
|
|
33
|
+
| `react-cheminfo/ui` | the React components of a site header | React |
|
|
34
|
+
| `react-cheminfo/orbital` | the 3D atomic-orbital viewer | React, molstar |
|
|
34
35
|
|
|
35
36
|
A backend serving an RIS endpoint, and every unit test of that logic, therefore
|
|
36
|
-
load no React at all
|
|
37
|
+
load no React at all — and a worker sampling an orbital loads neither React nor
|
|
38
|
+
molstar.
|
|
39
|
+
|
|
40
|
+
The orbital viewer has its own door because **molstar is several megabytes**: a
|
|
41
|
+
site that only wants the Tools menu must never be made to carry it. `molstar` is
|
|
42
|
+
an optional peer dependency, so `npm i react-cheminfo` installs nothing extra
|
|
43
|
+
until a site actually imports `react-cheminfo/orbital`.
|
|
37
44
|
|
|
38
45
|
The sources are organised the other way round — one folder per component
|
|
39
46
|
(`src/citation`, `src/ecosystem`), each holding a `core/` and a `ui/` half — and
|
|
@@ -84,15 +91,49 @@ import { EcosystemButton } from 'react-cheminfo/ui';
|
|
|
84
91
|
```
|
|
85
92
|
|
|
86
93
|
- `currentSiteId` is the one thing that differs per site: that tile is shown
|
|
87
|
-
with a _you are here_ label and is not a link. Passing nothing links all
|
|
94
|
+
with a _you are here_ label and is not a link. Passing nothing links them all.
|
|
88
95
|
- `compact` drops the text and the caret, leaving the icon alone to open the
|
|
89
96
|
menu, for a header that has run out of room. The label stays what the pointer
|
|
90
97
|
and a screen reader are told.
|
|
91
98
|
- A tile **lights up in the colour of the site it opens**, so running the
|
|
92
|
-
pointer down the grid is what makes the
|
|
99
|
+
pointer down the grid is what makes the pairs of colours read.
|
|
100
|
+
|
|
101
|
+
### `AtomicOrbitalViewer`
|
|
102
|
+
|
|
103
|
+
One hydrogen-like atomic orbital, screened by Slater's rules, sampled in the
|
|
104
|
+
browser and drawn as a signed isosurface with molstar.
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
import { AtomicOrbitalViewer } from 'react-cheminfo/orbital';
|
|
108
|
+
|
|
109
|
+
<AtomicOrbitalViewer atomicNumber={26} orbitalId="3dz2" />;
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
- The **maths is exact**, not a cartoon: a hydrogen-like radial function with its
|
|
113
|
+
`n − ℓ − 1` nodes, times a real spherical harmonic with its ℓ angular ones.
|
|
114
|
+
The Slater orbital a hybridisation model uses is nodeless and would draw a 3s
|
|
115
|
+
exactly like a 1s, only fatter.
|
|
116
|
+
- The canvas is behind a `React.lazy` boundary and **nothing this entry point
|
|
117
|
+
exports pulls molstar in statically**, so a page that never draws an orbital
|
|
118
|
+
never downloads it.
|
|
119
|
+
- A **WebGL probe runs before molstar is touched** (`probeViewerCapability`), so
|
|
120
|
+
a locked-down school machine gets a sentence rather than a blank rectangle.
|
|
121
|
+
- Every orbital is drawn at one canonical size. Molstar's camera clamps its near
|
|
122
|
+
plane, so uranium's 4f — which reaches 0.35 Å — would otherwise stay a dot in
|
|
123
|
+
the corner; the true extent is reported as ⟨r⟩ instead.
|
|
124
|
+
- `sample` accepts a worker-backed sampler when a site would rather not spend
|
|
125
|
+
~25 ms of its main thread per orbital. `runAtomicSample` from
|
|
126
|
+
`react-cheminfo/core` is the function that worker calls, and it imports
|
|
127
|
+
neither React nor molstar.
|
|
128
|
+
|
|
129
|
+
The maths is exported on its own from `react-cheminfo/core` —
|
|
130
|
+
`atomicOrbitalsOf`, `configurationOf`, `slaterScreening`, `radialProfile`,
|
|
131
|
+
`radialNodeRadii`, `sampleAtomicOrbital` — so a site can draw its own radial
|
|
132
|
+
plot, list an element's orbitals, or print a screened charge without mounting
|
|
133
|
+
anything.
|
|
93
134
|
|
|
94
135
|
Each mark keeps the geometry of that site's own logo where it has one, redrawn
|
|
95
|
-
on a plate of the site's own colour so
|
|
136
|
+
on a plate of the site's own colour so every mark of the family still reads as
|
|
96
137
|
one row, and carrying the site's answering colour on exactly one element —
|
|
97
138
|
which is what stops it collapsing into a flat shape at 16 px.
|
|
98
139
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { doiUrl } from "./reference.js";
|
|
2
2
|
import { renderHtml, renderMarkdown, renderText } from "./render.js";
|
|
3
|
-
import { citationSegments } from "./segments.js";
|
|
3
|
+
import { citationSegments, pageRange } from "./segments.js";
|
|
4
4
|
/**
|
|
5
5
|
* Every format offered, in the order the menu lists them. Plain text is not
|
|
6
6
|
* one of them: an HTML copy carries it as its second flavour, so a paste into
|
|
@@ -71,7 +71,6 @@ export function formatCitation(reference, format, style = DEFAULT_CITATION_STYLE
|
|
|
71
71
|
}
|
|
72
72
|
function formatBibTeX(reference) {
|
|
73
73
|
const { title, journal, year, volume, issue, publisher, doi } = reference;
|
|
74
|
-
const { firstPage, lastPage } = reference;
|
|
75
74
|
const fields = [
|
|
76
75
|
['author', authorList(reference, ' and ')],
|
|
77
76
|
['title', title],
|
|
@@ -79,7 +78,7 @@ function formatBibTeX(reference) {
|
|
|
79
78
|
['year', String(year)],
|
|
80
79
|
['volume', volume],
|
|
81
80
|
['number', issue],
|
|
82
|
-
['pages',
|
|
81
|
+
['pages', pageRange(reference, '--')],
|
|
83
82
|
['publisher', publisher],
|
|
84
83
|
['doi', doi],
|
|
85
84
|
['url', doiUrl(reference)],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../../src/citation/core/formats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../../src/citation/core/formats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAoB5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE;IACtE,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE;IAC1E,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;IAC/D,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE;IACnE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KA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Y,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -44,4 +44,12 @@ export declare const CITATION_STYLES: readonly [{
|
|
|
44
44
|
* @returns The segments of the citation, in reading order.
|
|
45
45
|
*/
|
|
46
46
|
export declare function citationSegments(reference: Reference, style: CitationStyleId): CitationSegment[];
|
|
47
|
+
/**
|
|
48
|
+
* The pages of a work, as its styles write them.
|
|
49
|
+
* @param reference - The work being written.
|
|
50
|
+
* @param dash - What joins the two ends, an en dash in every style but BibTeX.
|
|
51
|
+
* @returns One number for a journal that paginates by article number, the
|
|
52
|
+
* range otherwise.
|
|
53
|
+
*/
|
|
54
|
+
export declare function pageRange(reference: Reference, dash?: string): string;
|
|
47
55
|
//# sourceMappingURL=segments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../src/citation/core/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,0DAA0D;AAC1D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEjE,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,eAAe,CAAC;IACpB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6DAA6D;AAC7D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;EAKiB,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,eAAe,GACrB,eAAe,EAAE,CAanB"}
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../src/citation/core/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,0DAA0D;AAC1D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEjE,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,eAAe,CAAC;IACpB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6DAA6D;AAC7D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;EAKiB,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,eAAe,GACrB,eAAe,EAAE,CAanB;AAmHD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,SAAM,GAAG,MAAM,CAIlE"}
|
|
@@ -127,8 +127,17 @@ function initialsFirst(reference, lastSeparator) {
|
|
|
127
127
|
return names.join(', ');
|
|
128
128
|
return `${names.slice(0, -1).join(', ')}${lastSeparator}${last}`;
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
/**
|
|
131
|
+
* The pages of a work, as its styles write them.
|
|
132
|
+
* @param reference - The work being written.
|
|
133
|
+
* @param dash - What joins the two ends, an en dash in every style but BibTeX.
|
|
134
|
+
* @returns One number for a journal that paginates by article number, the
|
|
135
|
+
* range otherwise.
|
|
136
|
+
*/
|
|
137
|
+
export function pageRange(reference, dash = '–') {
|
|
138
|
+
const { firstPage, lastPage } = reference;
|
|
139
|
+
if (firstPage === lastPage)
|
|
140
|
+
return firstPage;
|
|
141
|
+
return `${firstPage}${dash}${lastPage}`;
|
|
133
142
|
}
|
|
134
143
|
//# sourceMappingURL=segments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../../src/citation/core/segments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAmBxC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACrD,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC7D,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE;IAC5D,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,6BAA6B,EAAE;CACzB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAoB,EACpB,KAAsB;IAEtB,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,KAAK;YACR,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;QACxB,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,KAAK,KAAK;YACR,OAAO,GAAG,CAAC,SAAS,C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Q,EAAE,GAAG,SAAS,CAAC;IAC1C,IAAI,SAAS,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC7C,OAAO,GAAG,SAAS,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;AAC1C,CAAC"}
|
package/lib/core.d.ts
CHANGED
package/lib/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC"}
|
package/lib/core.js
CHANGED
package/lib/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The sites the menu links to, in the order they are listed. */
|
|
2
|
-
export type SiteId = 'inchi' | 'vcl' | 'smiles' | 'chemcalc' | 'nmrium' | 'surge' | 'tex' | 'lcao' | 'regexp' | 'pdb';
|
|
2
|
+
export type SiteId = 'inchi' | 'vcl' | 'smiles' | 'chemcalc' | 'nmrium' | 'surge' | 'tex' | 'lcao' | 'regexp' | 'pdb' | 'elucidation' | 'equilibrium' | 'polycarp' | '3d' | 'pt';
|
|
3
3
|
export interface SiteName {
|
|
4
4
|
/** First half of the name, set in the site's leading colour. */
|
|
5
5
|
lead: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/core/sites.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,MAAM,MAAM,GACd,OAAO,GACP,KAAK,GACL,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,GACP,KAAK,GACL,MAAM,GACN,QAAQ,GACR,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/core/sites.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,MAAM,MAAM,GACd,OAAO,GACP,KAAK,GACL,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,GACP,KAAK,GACL,MAAM,GACN,QAAQ,GACR,KAAK,GACL,aAAa,GACb,aAAa,GACb,UAAU,GACV,IAAI,GACJ,IAAI,CAAC;AAET,MAAM,WAAW,QAAQ;IACvB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,IAAI,EAAE,QAAQ,CAAC;IACf,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAwInD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAEnD"}
|
|
@@ -93,6 +93,51 @@ export const ECOSYSTEM_SITES = [
|
|
|
93
93
|
brandAlt: '#b45309',
|
|
94
94
|
mark: { plate: '#2563eb', accent: '#fbbf24' },
|
|
95
95
|
},
|
|
96
|
+
{
|
|
97
|
+
id: 'elucidation',
|
|
98
|
+
name: { lead: 'elucidation', alt: 'cheminfo', dot: true },
|
|
99
|
+
host: 'elucidation.cheminfo.org',
|
|
100
|
+
tagline: 'A structure from a 1H NMR spectrum and a formula.',
|
|
101
|
+
brand: '#7e22ce',
|
|
102
|
+
brandAlt: '#b45309',
|
|
103
|
+
mark: { plate: '#7e22ce', accent: '#f59e0b' },
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'equilibrium',
|
|
107
|
+
name: { lead: 'Equi', alt: 'Librium' },
|
|
108
|
+
host: 'equilibrium.cheminfo.org',
|
|
109
|
+
tagline: 'Chemical equilibria: pH, speciation and titration curves.',
|
|
110
|
+
brand: '#0b5754',
|
|
111
|
+
brandAlt: '#a56600',
|
|
112
|
+
mark: { plate: '#0b5754', accent: '#f2a71b' },
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: 'polycarp',
|
|
116
|
+
name: { lead: 'Poly', alt: 'Carp' },
|
|
117
|
+
host: 'polycarp.cheminfo.org',
|
|
118
|
+
tagline: 'Predict the microstructure of a radical copolymerisation.',
|
|
119
|
+
brand: '#0d1d37',
|
|
120
|
+
brandAlt: '#0c9ba3',
|
|
121
|
+
mark: { plate: '#0d1d37', accent: '#0c9ba3' },
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: '3d',
|
|
125
|
+
name: { lead: '3d', alt: 'cheminfo', dot: true },
|
|
126
|
+
host: '3d.cheminfo.org',
|
|
127
|
+
tagline: 'Conformers in 3D from a structure you draw.',
|
|
128
|
+
brand: '#155e75',
|
|
129
|
+
brandAlt: '#b45309',
|
|
130
|
+
mark: { plate: '#155e75', accent: '#f97316' },
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 'pt',
|
|
134
|
+
name: { lead: 'pt', alt: 'cheminfo', dot: true },
|
|
135
|
+
host: 'pt.cheminfo.org',
|
|
136
|
+
tagline: 'The periodic table, coloured, plotted and taken apart.',
|
|
137
|
+
brand: '#15803d',
|
|
138
|
+
brandAlt: '#a16207',
|
|
139
|
+
mark: { plate: '#15803d', accent: '#fbbf24' },
|
|
140
|
+
},
|
|
96
141
|
];
|
|
97
142
|
/**
|
|
98
143
|
* The address of a site, which is its host over https.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../../src/ecosystem/core/sites.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../../src/ecosystem/core/sites.ts"],"names":[],"mappings":"AAgEA;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE;QACnD,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,sDAAsD;QAC/D,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,SAAS;QACnB,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;KAC9C;IACD;QACE,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE;QACjD,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,uDAAuD;QAChE,KAAK,EAAE,SAAS;QAChB,QAAQ,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D;QACE,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE;QAChD,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,wDAAwD;QACjE,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,SAAS;QACnB,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;KAC9C;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAmB;IACzC,OAAO,WAAW,IAAI,CAAC,IAAI,GAAG,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { SiteId } from '../core/sites.ts';
|
|
3
|
+
export interface EcosystemLinksProps {
|
|
4
|
+
/**
|
|
5
|
+
* The site the visitor is already on, which is written but never linked.
|
|
6
|
+
* @default undefined
|
|
7
|
+
*/
|
|
8
|
+
currentSiteId?: SiteId;
|
|
9
|
+
/**
|
|
10
|
+
* What introduces the section.
|
|
11
|
+
* @default 'Our other tools'
|
|
12
|
+
*/
|
|
13
|
+
heading?: string;
|
|
14
|
+
/**
|
|
15
|
+
* How much of each site is written. `grid` gives every site its mark, its
|
|
16
|
+
* name and the line saying what it does — which is what a crawler reads to
|
|
17
|
+
* know what it is following, so it is the default. `row` writes the names
|
|
18
|
+
* only, for a footer with no room.
|
|
19
|
+
* @default 'grid'
|
|
20
|
+
*/
|
|
21
|
+
layout?: 'grid' | 'row';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Every site of the family as a plain link, for the footer of a site. It is
|
|
25
|
+
* what lets a crawler — and a visitor with no patience for menus — walk from
|
|
26
|
+
* one of our tools to the next, so it is rendered on every page rather than
|
|
27
|
+
* behind a button.
|
|
28
|
+
* @param props - The site it sits on, what introduces the section, and how much
|
|
29
|
+
* of each site is written.
|
|
30
|
+
* @returns The section of links.
|
|
31
|
+
*/
|
|
32
|
+
export declare function EcosystemLinks(props: EcosystemLinksProps): ReactElement;
|
|
33
|
+
//# sourceMappingURL=EcosystemLinks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EcosystemLinks.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/ui/EcosystemLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA4C/C,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAqCvE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ECOSYSTEM_SITES, siteUrl } from "../core/sites.js";
|
|
3
|
+
import { SiteTile } from "./SiteTile.js";
|
|
4
|
+
// The menu of `EcosystemMenu` lives inside a popover, so its links only enter
|
|
5
|
+
// the document once somebody clicks. A crawler never clicks, so these are the
|
|
6
|
+
// links that carry the family: always rendered, in the page, followed — and
|
|
7
|
+
// each one carrying the name and the one line that says what it opens, as real
|
|
8
|
+
// text rather than a `title` a crawler ignores.
|
|
9
|
+
const SECTION_STYLE = {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
gap: 8,
|
|
13
|
+
};
|
|
14
|
+
const HEADING_STYLE = {
|
|
15
|
+
margin: 0,
|
|
16
|
+
color: '#5b6875',
|
|
17
|
+
fontSize: '0.75rem',
|
|
18
|
+
fontWeight: 600,
|
|
19
|
+
};
|
|
20
|
+
const GRID_STYLE = {
|
|
21
|
+
display: 'grid',
|
|
22
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(15rem, 1fr))',
|
|
23
|
+
gap: 2,
|
|
24
|
+
};
|
|
25
|
+
const ROW_STYLE = {
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexWrap: 'wrap',
|
|
28
|
+
alignItems: 'baseline',
|
|
29
|
+
gap: '0.35rem 0.9rem',
|
|
30
|
+
};
|
|
31
|
+
const LINK_STYLE = {
|
|
32
|
+
fontSize: '0.8125rem',
|
|
33
|
+
fontWeight: 600,
|
|
34
|
+
textDecoration: 'none',
|
|
35
|
+
whiteSpace: 'nowrap',
|
|
36
|
+
};
|
|
37
|
+
const CURRENT_STYLE = {
|
|
38
|
+
...LINK_STYLE,
|
|
39
|
+
color: '#8a96a3',
|
|
40
|
+
cursor: 'default',
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Every site of the family as a plain link, for the footer of a site. It is
|
|
44
|
+
* what lets a crawler — and a visitor with no patience for menus — walk from
|
|
45
|
+
* one of our tools to the next, so it is rendered on every page rather than
|
|
46
|
+
* behind a button.
|
|
47
|
+
* @param props - The site it sits on, what introduces the section, and how much
|
|
48
|
+
* of each site is written.
|
|
49
|
+
* @returns The section of links.
|
|
50
|
+
*/
|
|
51
|
+
export function EcosystemLinks(props) {
|
|
52
|
+
const { currentSiteId, heading = 'Our other tools', layout = 'grid' } = props;
|
|
53
|
+
return (_jsxs("nav", { className: "ecosystem-links", style: SECTION_STYLE, "aria-label": heading, children: [_jsx("h2", { style: HEADING_STYLE, children: heading }), layout === 'grid' ? (_jsx("div", { style: GRID_STYLE, children: ECOSYSTEM_SITES.map((site) => (_jsx(SiteTile, { site: site, isCurrent: site.id === currentSiteId }, site.id))) })) : (_jsx("div", { style: ROW_STYLE, children: ECOSYSTEM_SITES.map((site) => site.id === currentSiteId ? (_jsx("span", { style: CURRENT_STYLE, children: site.host }, site.id)) : (_jsx("a", { style: { ...LINK_STYLE, color: site.brand }, href: siteUrl(site), children: site.host }, site.id))) }))] }));
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=EcosystemLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EcosystemLinks.js","sourceRoot":"","sources":["../../../src/ecosystem/ui/EcosystemLinks.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAE1C,8EAA8E;AAC9E,8EAA8E;AAC9E,4EAA4E;AAC5E,+EAA+E;AAC/E,gDAAgD;AAChD,MAAM,aAAa,GAAkB;IACnC,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,GAAG,EAAE,CAAC;CACP,CAAC;AACF,MAAM,aAAa,GAAkB;IACnC,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,GAAG;CAChB,CAAC;AACF,MAAM,UAAU,GAAkB;IAChC,OAAO,EAAE,MAAM;IACf,mBAAmB,EAAE,sCAAsC;IAC3D,GAAG,EAAE,CAAC;CACP,CAAC;AACF,MAAM,SAAS,GAAkB;IAC/B,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,UAAU;IACtB,GAAG,EAAE,gBAAgB;CACtB,CAAC;AACF,MAAM,UAAU,GAAkB;IAChC,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,GAAG;IACf,cAAc,EAAE,MAAM;IACtB,UAAU,EAAE,QAAQ;CACrB,CAAC;AACF,MAAM,aAAa,GAAkB;IACnC,GAAG,UAAU;IACb,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;CAClB,CAAC;AAuBF;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,aAAa,EAAE,OAAO,GAAG,iBAAiB,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IAE9E,OAAO,CACL,eAAK,SAAS,EAAC,iBAAiB,EAAC,KAAK,EAAE,aAAa,gBAAc,OAAO,aACxE,aAAI,KAAK,EAAE,aAAa,YAAG,OAAO,GAAM,EACvC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CACnB,cAAK,KAAK,EAAE,UAAU,YACnB,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC7B,KAAC,QAAQ,IAEP,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAI,CAAC,EAAE,KAAK,aAAa,IAF/B,IAAI,CAAC,EAAE,CAGZ,CACH,CAAC,GACE,CACP,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,EAAE,SAAS,YAClB,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAC5B,IAAI,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC,CAAC,CAC1B,eAAoB,KAAK,EAAE,aAAa,YACrC,IAAI,CAAC,IAAI,IADD,IAAI,CAAC,EAAE,CAEX,CACR,CAAC,CAAC,CAAC,CACF,YAEE,KAAK,EAAE,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAC3C,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,YAElB,IAAI,CAAC,IAAI,IAJL,IAAI,CAAC,EAAE,CAKV,CACL,CACF,GACG,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -9,7 +9,9 @@ export interface EcosystemMenuProps {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* What the ecosystem button opens: every site of the family, each behind its
|
|
12
|
-
* own little logo and the two colours it owns.
|
|
12
|
+
* own little logo and the two colours it owns. It lives in a popover, so a
|
|
13
|
+
* crawler never reaches it — `EcosystemLinks` is what carries the family
|
|
14
|
+
* through the page itself.
|
|
13
15
|
* @param props - The site the visitor is already on.
|
|
14
16
|
* @returns The grid of sites.
|
|
15
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcosystemMenu.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/ui/EcosystemMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"EcosystemMenu.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/ui/EcosystemMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAuB/C,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAqBrE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { ECOSYSTEM_SITES
|
|
4
|
-
import {
|
|
3
|
+
import { ECOSYSTEM_SITES } from "../core/sites.js";
|
|
4
|
+
import { SiteTile } from "./SiteTile.js";
|
|
5
5
|
const PANEL_STYLE = {
|
|
6
6
|
display: 'flex',
|
|
7
7
|
width: 'min(34rem, 90vw)',
|
|
@@ -19,94 +19,17 @@ const GRID_STYLE = {
|
|
|
19
19
|
gridTemplateColumns: 'repeat(auto-fit, minmax(15rem, 1fr))',
|
|
20
20
|
gap: 2,
|
|
21
21
|
};
|
|
22
|
-
const TILE_STYLE = {
|
|
23
|
-
display: 'flex',
|
|
24
|
-
alignItems: 'center',
|
|
25
|
-
padding: '7px 8px',
|
|
26
|
-
border: '1px solid transparent',
|
|
27
|
-
borderRadius: 10,
|
|
28
|
-
color: '#16202c',
|
|
29
|
-
gap: 10,
|
|
30
|
-
textDecoration: 'none',
|
|
31
|
-
transition: 'background 120ms, border-color 120ms, transform 120ms',
|
|
32
|
-
};
|
|
33
|
-
const MARK_HOLDER_STYLE = {
|
|
34
|
-
display: 'flex',
|
|
35
|
-
transition: 'transform 160ms',
|
|
36
|
-
};
|
|
37
|
-
const TEXT_STYLE = { minWidth: 0 };
|
|
38
|
-
const NAME_STYLE = {
|
|
39
|
-
display: 'flex',
|
|
40
|
-
alignItems: 'baseline',
|
|
41
|
-
fontSize: '0.9375rem',
|
|
42
|
-
fontWeight: 700,
|
|
43
|
-
letterSpacing: '-0.01em',
|
|
44
|
-
gap: 6,
|
|
45
|
-
whiteSpace: 'nowrap',
|
|
46
|
-
};
|
|
47
|
-
const HERE_STYLE = {
|
|
48
|
-
fontSize: '0.625rem',
|
|
49
|
-
fontWeight: 700,
|
|
50
|
-
letterSpacing: '0.04em',
|
|
51
|
-
textTransform: 'uppercase',
|
|
52
|
-
};
|
|
53
|
-
const TAGLINE_STYLE = {
|
|
54
|
-
color: '#5b6875',
|
|
55
|
-
fontSize: '0.75rem',
|
|
56
|
-
lineHeight: 1.35,
|
|
57
|
-
};
|
|
58
22
|
/**
|
|
59
23
|
* What the ecosystem button opens: every site of the family, each behind its
|
|
60
|
-
* own little logo and the two colours it owns.
|
|
24
|
+
* own little logo and the two colours it owns. It lives in a popover, so a
|
|
25
|
+
* crawler never reaches it — `EcosystemLinks` is what carries the family
|
|
26
|
+
* through the page itself.
|
|
61
27
|
* @param props - The site the visitor is already on.
|
|
62
28
|
* @returns The grid of sites.
|
|
63
29
|
*/
|
|
64
30
|
export function EcosystemMenu(props) {
|
|
65
31
|
const { currentSiteId } = props;
|
|
66
32
|
const [hovered, setHovered] = useState(null);
|
|
67
|
-
return (_jsxs("div", { className: "ecosystem-menu", style: PANEL_STYLE, children: [_jsx("div", { style: HEADING_STYLE, children: "Our other tools, all in the browser" }), _jsx("div", { style: GRID_STYLE, children: ECOSYSTEM_SITES.map((site) => (_jsx(SiteTile, { site: site, isCurrent: site.id === currentSiteId, isHovered: hovered === site.id, onHover: setHovered }, site.id))) })] }));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* One site: its mark, its name in its own colours, and what it does.
|
|
71
|
-
* @param props - The site, and whether it is the current or the hovered one.
|
|
72
|
-
* @returns The tile.
|
|
73
|
-
*/
|
|
74
|
-
function SiteTile(props) {
|
|
75
|
-
const { site, isCurrent, isHovered, onHover } = props;
|
|
76
|
-
const lit = isHovered && !isCurrent;
|
|
77
|
-
const body = (_jsxs(_Fragment, { children: [_jsx("div", { style: {
|
|
78
|
-
...MARK_HOLDER_STYLE,
|
|
79
|
-
transform: lit ? 'scale(1.08) rotate(-6deg)' : 'none',
|
|
80
|
-
}, children: _jsx(SiteMark, { site: site }) }), _jsxs("div", { style: TEXT_STYLE, children: [_jsxs("div", { style: NAME_STYLE, children: [_jsxs("span", { children: [_jsx("span", { style: { color: site.brand }, children: site.name.lead }), site.name.dot ? _jsx("span", { style: { color: '#8a96a3' }, children: "." }) : null, _jsx("span", { style: { color: site.brandAlt }, children: site.name.alt })] }), isCurrent ? (_jsx("span", { style: { ...HERE_STYLE, color: site.brandAlt }, children: "you are here" })) : null] }), _jsx("div", { style: TAGLINE_STYLE, children: site.tagline })] })] }));
|
|
81
|
-
const style = {
|
|
82
|
-
...TILE_STYLE,
|
|
83
|
-
background: tint(site, isCurrent, lit),
|
|
84
|
-
borderColor: borderOf(site, isCurrent, lit),
|
|
85
|
-
transform: lit ? 'translateY(-1px)' : 'none',
|
|
86
|
-
cursor: isCurrent ? 'default' : 'pointer',
|
|
87
|
-
};
|
|
88
|
-
if (isCurrent)
|
|
89
|
-
return _jsx("div", { style: style, children: body });
|
|
90
|
-
return (_jsx("a", { style: style, href: siteUrl(site), title: site.host, target: "_blank", rel: "noreferrer", onMouseEnter: () => {
|
|
91
|
-
onHover(site.id);
|
|
92
|
-
}, onMouseLeave: () => {
|
|
93
|
-
onHover(null);
|
|
94
|
-
}, onFocus: () => {
|
|
95
|
-
onHover(site.id);
|
|
96
|
-
}, onBlur: () => {
|
|
97
|
-
onHover(null);
|
|
98
|
-
}, children: body }));
|
|
99
|
-
}
|
|
100
|
-
// A tile lights up in the colour of the site it opens, never in ours: the
|
|
101
|
-
// pointer moving down the grid is what makes the ten pairs of colours read.
|
|
102
|
-
function tint(site, isCurrent, lit) {
|
|
103
|
-
if (isCurrent)
|
|
104
|
-
return '#f5f7fa';
|
|
105
|
-
return lit ? `color-mix(in oklab, ${site.brand} 9%, white)` : 'transparent';
|
|
106
|
-
}
|
|
107
|
-
function borderOf(site, isCurrent, lit) {
|
|
108
|
-
if (isCurrent)
|
|
109
|
-
return '#dfe3e8';
|
|
110
|
-
return lit ? `color-mix(in oklab, ${site.brand} 32%, white)` : 'transparent';
|
|
33
|
+
return (_jsxs("div", { className: "ecosystem-menu", style: PANEL_STYLE, children: [_jsx("div", { style: HEADING_STYLE, children: "Our other tools, all in the browser" }), _jsx("div", { style: GRID_STYLE, children: ECOSYSTEM_SITES.map((site) => (_jsx(SiteTile, { site: site, isCurrent: site.id === currentSiteId, isHovered: hovered === site.id, onHover: setHovered, newTab: true }, site.id))) })] }));
|
|
111
34
|
}
|
|
112
35
|
//# sourceMappingURL=EcosystemMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcosystemMenu.js","sourceRoot":"","sources":["../../../src/ecosystem/ui/EcosystemMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"EcosystemMenu.js","sourceRoot":"","sources":["../../../src/ecosystem/ui/EcosystemMenu.tsx"],"names":[],"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
2
|
+
import type { EcosystemSite, SiteId } from '../core/sites.ts';
|
|
3
|
+
export interface SiteTileProps {
|
|
4
|
+
/** The site the tile opens. */
|
|
5
|
+
site: EcosystemSite;
|
|
6
|
+
/** Whether this is the site the visitor is already on. */
|
|
7
|
+
isCurrent: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the pointer is on it, which lights it in its own colour.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
isHovered?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Told which site the pointer moved onto, or null when it left.
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
onHover?: (id: SiteId | null) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the link opens a tab of its own. A menu the visitor opened on
|
|
20
|
+
* purpose does; a footer does not.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
newTab?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One site: its mark, its name in its own colours, and what it does. The name
|
|
27
|
+
* and the tagline are real text — that is what a crawler reads to know what it
|
|
28
|
+
* is following, so neither is ever a `title` attribute.
|
|
29
|
+
* @param props - The site, whether it is the current or the hovered one, and
|
|
30
|
+
* how the link opens.
|
|
31
|
+
* @returns The tile.
|
|
32
|
+
*/
|
|
33
|
+
export declare function SiteTile(props: SiteTileProps): ReactElement;
|
|
34
|
+
//# sourceMappingURL=SiteTile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SiteTile.d.ts","sourceRoot":"","sources":["../../../src/ecosystem/ui/SiteTile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA0C9D,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,CAwD3D"}
|