react-cheminfo 0.6.0 → 0.8.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 +16 -0
- package/lib/citation/core/index.d.ts +2 -0
- package/lib/citation/core/index.d.ts.map +1 -1
- package/lib/citation/core/index.js +2 -0
- package/lib/citation/core/index.js.map +1 -1
- package/lib/citation/core/platformPaper.d.ts +14 -0
- package/lib/citation/core/platformPaper.d.ts.map +1 -0
- package/lib/citation/core/platformPaper.js +28 -0
- package/lib/citation/core/platformPaper.js.map +1 -0
- package/lib/citation/core/teachingPaper.d.ts +15 -0
- package/lib/citation/core/teachingPaper.d.ts.map +1 -0
- package/lib/citation/core/teachingPaper.js +32 -0
- package/lib/citation/core/teachingPaper.js.map +1 -0
- package/lib/color/core/index.d.ts +1 -1
- package/lib/color/core/index.d.ts.map +1 -1
- package/lib/color/core/index.js +1 -1
- package/lib/color/core/index.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.js +5 -5
- package/lib/orbital/core/index.d.ts +1 -1
- package/lib/orbital/core/index.d.ts.map +1 -1
- package/lib/orbital/core/index.js +1 -1
- package/lib/orbital/core/index.js.map +1 -1
- package/lib/pedagogy/ui/TutorialStepStrip.d.ts +15 -2
- package/lib/pedagogy/ui/TutorialStepStrip.d.ts.map +1 -1
- package/lib/pedagogy/ui/TutorialStepStrip.js +15 -4
- package/lib/pedagogy/ui/TutorialStepStrip.js.map +1 -1
- package/lib/pedagogy/ui/index.d.ts +1 -1
- package/lib/pedagogy/ui/index.d.ts.map +1 -1
- package/lib/pedagogy/ui/index.js.map +1 -1
- package/lib/periodic/core/categories.d.ts +25 -0
- package/lib/periodic/core/categories.d.ts.map +1 -0
- package/lib/periodic/core/categories.js +70 -0
- package/lib/periodic/core/categories.js.map +1 -0
- package/lib/periodic/core/elements.d.ts +49 -0
- package/lib/periodic/core/elements.d.ts.map +1 -0
- package/lib/periodic/core/elements.js +175 -0
- package/lib/periodic/core/elements.js.map +1 -0
- package/lib/periodic/core/index.d.ts +6 -0
- package/lib/periodic/core/index.d.ts.map +1 -0
- package/lib/periodic/core/index.js +4 -0
- package/lib/periodic/core/index.js.map +1 -0
- package/lib/periodic/core/layout.d.ts +73 -0
- package/lib/periodic/core/layout.d.ts.map +1 -0
- package/lib/periodic/core/layout.js +132 -0
- package/lib/periodic/core/layout.js.map +1 -0
- package/lib/periodic/ui/CategoryLegend.d.ts +26 -0
- package/lib/periodic/ui/CategoryLegend.d.ts.map +1 -0
- package/lib/periodic/ui/CategoryLegend.js +53 -0
- package/lib/periodic/ui/CategoryLegend.js.map +1 -0
- package/lib/periodic/ui/ElementCell.d.ts +53 -0
- package/lib/periodic/ui/ElementCell.d.ts.map +1 -0
- package/lib/periodic/ui/ElementCell.js +56 -0
- package/lib/periodic/ui/ElementCell.js.map +1 -0
- package/lib/periodic/ui/PeriodicTable.d.ts +90 -0
- package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -0
- package/lib/periodic/ui/PeriodicTable.js +77 -0
- package/lib/periodic/ui/PeriodicTable.js.map +1 -0
- package/lib/periodic/ui/PeriodicTableChrome.d.ts +36 -0
- package/lib/periodic/ui/PeriodicTableChrome.d.ts.map +1 -0
- package/lib/periodic/ui/PeriodicTableChrome.js +72 -0
- package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -0
- package/lib/periodic/ui/index.d.ts +7 -0
- package/lib/periodic/ui/index.d.ts.map +1 -0
- package/lib/periodic/ui/index.js +4 -0
- package/lib/periodic/ui/index.js.map +1 -0
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/package.json +2 -1
- package/src/citation/core/index.ts +2 -0
- package/src/citation/core/platformPaper.ts +32 -0
- package/src/citation/core/teachingPaper.ts +36 -0
- package/src/color/core/index.ts +6 -1
- package/src/core.ts +1 -0
- package/src/ecosystem/core/sites.ts +5 -5
- package/src/orbital/core/index.ts +1 -1
- package/src/pedagogy/ui/TutorialStepStrip.tsx +35 -9
- package/src/pedagogy/ui/index.ts +4 -1
- package/src/periodic/core/categories.ts +83 -0
- package/src/periodic/core/elements.ts +217 -0
- package/src/periodic/core/index.ts +27 -0
- package/src/periodic/core/layout.ts +183 -0
- package/src/periodic/ui/CategoryLegend.tsx +105 -0
- package/src/periodic/ui/ElementCell.tsx +137 -0
- package/src/periodic/ui/PeriodicTable.tsx +226 -0
- package/src/periodic/ui/PeriodicTableChrome.tsx +170 -0
- package/src/periodic/ui/index.ts +6 -0
- package/src/ui.ts +1 -0
package/README.md
CHANGED
|
@@ -69,6 +69,7 @@ through a wildcard subpath exactly as `react-science` serves its own.
|
|
|
69
69
|
| **Widgets** | `CREDITS`, `credits` | `ErrorBoundary`, `CollapsibleSection`, `CapsuleFilter`, `HelpTooltip`, `CreditsList` |
|
|
70
70
|
| **Hooks & state** | `createWorkerChannel` | `persistBucket`, `useDebouncedValue`, `useContainerSize`, `useListKeyboardNavigation`, `useDisclosure` |
|
|
71
71
|
| **Chemistry** | `atomicOrbitalsOf`, `configurationOf`, `classifyMolfile`, `readStructure` | `AtomicOrbitalViewer` (`/orbital`), `StructureEditor`, `Structure` (`/structure`) |
|
|
72
|
+
| **Periodic table** | `PERIODIC_ELEMENTS`, `elementBySymbol`, `elementByAtomicNumber`, `cellOf`, `placedElements`, `elementByArrowKey`, `categorySwatch`, `CATEGORY_LABELS` | `PeriodicTable`, `ElementCell`, `CategoryLegend` |
|
|
72
73
|
|
|
73
74
|
Everything in that table is exported from `./core`, `./ui`, `./vite` or
|
|
74
75
|
`./structure` and nothing else is: the sub-components a component is built
|
|
@@ -162,6 +163,21 @@ sections below carry the whole set at once, so one copy pastes both citations an
|
|
|
162
163
|
one saved file holds both records (`references.ris`). Nothing changes for a site
|
|
163
164
|
asking for a single work.
|
|
164
165
|
|
|
166
|
+
The two works the whole family shares are held here rather than copied into each
|
|
167
|
+
site, so none of them can name a different version of the same paper — import
|
|
168
|
+
them from `react-cheminfo/core` and put the site's own work first:
|
|
169
|
+
|
|
170
|
+
| Export | The work |
|
|
171
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
172
|
+
| `PLATFORM_PAPER` / `PLATFORM_WORK` | Chemical data processed in the browser, which is what makes these applications rather than queues of jobs. Every site. |
|
|
173
|
+
| `TEACHING_PAPER` / `TEACHING_WORK` | Two decades of online teaching, which is what the tutorials and the exercises are. The sites that teach. |
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
import { PLATFORM_WORK, TEACHING_WORK } from 'react-cheminfo/core';
|
|
177
|
+
|
|
178
|
+
<CiteButton works={[OWN_WORK, TEACHING_WORK, PLATFORM_WORK]} />;
|
|
179
|
+
```
|
|
180
|
+
|
|
165
181
|
### `EcosystemButton`
|
|
166
182
|
|
|
167
183
|
The Tools entry of a site header: one button opening every other site of the
|
|
@@ -2,10 +2,12 @@ export { copyCitation, copyCitations } from './clipboard.ts';
|
|
|
2
2
|
export { downloadCitation, downloadCitations } from './download.ts';
|
|
3
3
|
export type { CitationDownload, CitationFormat, CitationFormatId, } from './formats.ts';
|
|
4
4
|
export { CITATION_DOWNLOADS, CITATION_FORMATS, DEFAULT_CITATION_STYLE, citationFilename, formatCitation, } from './formats.ts';
|
|
5
|
+
export { PLATFORM_PAPER, PLATFORM_WORK } from './platformPaper.ts';
|
|
5
6
|
export type { Reference, ReferenceAuthor } from './reference.ts';
|
|
6
7
|
export { doiUrl } from './reference.ts';
|
|
7
8
|
export type { CitationSegment, CitationStyle, CitationStyleId, } from './segments.ts';
|
|
8
9
|
export { CITATION_STYLES, citationSegments } from './segments.ts';
|
|
10
|
+
export { TEACHING_PAPER, TEACHING_WORK } from './teachingPaper.ts';
|
|
9
11
|
export type { CitedWork } from './works.ts';
|
|
10
12
|
export { citationsFilename, citedReferences, formatCitations, } from './works.ts';
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/citation/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,YAAY,EACV,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/citation/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,YAAY,EACV,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { copyCitation, copyCitations } from "./clipboard.js";
|
|
2
2
|
export { downloadCitation, downloadCitations } from "./download.js";
|
|
3
3
|
export { CITATION_DOWNLOADS, CITATION_FORMATS, DEFAULT_CITATION_STYLE, citationFilename, formatCitation, } from "./formats.js";
|
|
4
|
+
export { PLATFORM_PAPER, PLATFORM_WORK } from "./platformPaper.js";
|
|
4
5
|
export { doiUrl } from "./reference.js";
|
|
5
6
|
export { CITATION_STYLES, citationSegments } from "./segments.js";
|
|
7
|
+
export { TEACHING_PAPER, TEACHING_WORK } from "./teachingPaper.js";
|
|
6
8
|
export { citationsFilename, citedReferences, formatCitations, } from "./works.js";
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/citation/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMpE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/citation/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMpE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAMxC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Reference } from './reference.ts';
|
|
2
|
+
import type { CitedWork } from './works.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The platform every site of the family runs on: chemical data processed in the
|
|
5
|
+
* browser, which is what makes these applications rather than queues of jobs.
|
|
6
|
+
* One record holds it, so no site can name a different version of it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PLATFORM_PAPER: Reference;
|
|
9
|
+
/**
|
|
10
|
+
* The platform paper as the second work a site asks to be cited, after the work
|
|
11
|
+
* the tool itself implements.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PLATFORM_WORK: CitedWork;
|
|
14
|
+
//# sourceMappingURL=platformPaper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformPaper.d.ts","sourceRoot":"","sources":["../../../src/citation/core/platformPaper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,SAa5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAI3B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform every site of the family runs on: chemical data processed in the
|
|
3
|
+
* browser, which is what makes these applications rather than queues of jobs.
|
|
4
|
+
* One record holds it, so no site can name a different version of it.
|
|
5
|
+
*/
|
|
6
|
+
export const PLATFORM_PAPER = {
|
|
7
|
+
authors: [{ given: 'L.', family: 'Patiny' }],
|
|
8
|
+
title: 'Unlocking the Potential of Browser-Based Scientific Data Analysis: A 20-Year Journey of Expertise',
|
|
9
|
+
journal: 'CHIMIA',
|
|
10
|
+
journalAbbreviation: 'Chimia',
|
|
11
|
+
year: 2025,
|
|
12
|
+
volume: '79',
|
|
13
|
+
issue: '1-2',
|
|
14
|
+
firstPage: '66',
|
|
15
|
+
lastPage: '69',
|
|
16
|
+
doi: '10.2533/chimia.2025.66',
|
|
17
|
+
publisher: 'Swiss Chemical Society',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The platform paper as the second work a site asks to be cited, after the work
|
|
21
|
+
* the tool itself implements.
|
|
22
|
+
*/
|
|
23
|
+
export const PLATFORM_WORK = {
|
|
24
|
+
reference: PLATFORM_PAPER,
|
|
25
|
+
what: 'Data processing in the browser',
|
|
26
|
+
note: 'Cite it for the site itself, which runs in the browser.',
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=platformPaper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformPaper.js","sourceRoot":"","sources":["../../../src/citation/core/platformPaper.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC5C,KAAK,EACH,mGAAmG;IACrG,OAAO,EAAE,QAAQ;IACjB,mBAAmB,EAAE,QAAQ;IAC7B,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,wBAAwB;IAC7B,SAAS,EAAE,wBAAwB;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE,gCAAgC;IACtC,IAAI,EAAE,yDAAyD;CAChE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Reference } from './reference.ts';
|
|
2
|
+
import type { CitedWork } from './works.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The twenty years of online teaching the pedagogic sites of the family come
|
|
5
|
+
* out of: the tutorials, the exercises and the marking are the web-based tools
|
|
6
|
+
* it describes. One record holds it, so no site can name a different version
|
|
7
|
+
* of it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TEACHING_PAPER: Reference;
|
|
10
|
+
/**
|
|
11
|
+
* The teaching paper as one of the works a site that teaches asks to be cited,
|
|
12
|
+
* beside `PLATFORM_WORK` and the work the tool itself implements.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TEACHING_WORK: CitedWork;
|
|
15
|
+
//# sourceMappingURL=teachingPaper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teachingPaper.d.ts","sourceRoot":"","sources":["../../../src/citation/core/teachingPaper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,SAgB5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAI3B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The twenty years of online teaching the pedagogic sites of the family come
|
|
3
|
+
* out of: the tutorials, the exercises and the marking are the web-based tools
|
|
4
|
+
* it describes. One record holds it, so no site can name a different version
|
|
5
|
+
* of it.
|
|
6
|
+
*/
|
|
7
|
+
export const TEACHING_PAPER = {
|
|
8
|
+
authors: [
|
|
9
|
+
{ given: 'R.', family: 'Turin' },
|
|
10
|
+
{ given: 'L.', family: 'Patiny' },
|
|
11
|
+
],
|
|
12
|
+
title: 'Two Decades of Online Teaching: Trends, Challenges, and Future Directions',
|
|
13
|
+
journal: 'CHIMIA',
|
|
14
|
+
journalAbbreviation: 'Chimia',
|
|
15
|
+
year: 2023,
|
|
16
|
+
volume: '77',
|
|
17
|
+
issue: '10',
|
|
18
|
+
firstPage: '683',
|
|
19
|
+
lastPage: '687',
|
|
20
|
+
doi: '10.2533/chimia.2023.683',
|
|
21
|
+
publisher: 'Swiss Chemical Society',
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The teaching paper as one of the works a site that teaches asks to be cited,
|
|
25
|
+
* beside `PLATFORM_WORK` and the work the tool itself implements.
|
|
26
|
+
*/
|
|
27
|
+
export const TEACHING_WORK = {
|
|
28
|
+
reference: TEACHING_PAPER,
|
|
29
|
+
what: 'Teaching chemistry online',
|
|
30
|
+
note: 'Cite it for the exercises, which are the web-based teaching it describes.',
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=teachingPaper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teachingPaper.js","sourceRoot":"","sources":["../../../src/citation/core/teachingPaper.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAc;IACvC,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAChC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;KAClC;IACD,KAAK,EACH,2EAA2E;IAC7E,OAAO,EAAE,QAAQ;IACjB,mBAAmB,EAAE,QAAQ;IAC7B,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,KAAK;IACf,GAAG,EAAE,yBAAyB;IAC9B,SAAS,EAAE,wBAAwB;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,2EAA2E;CAClF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { ReadableInkOptions } from './contrast.ts';
|
|
2
2
|
export { contrastRatio, readableInk, relativeLuminance } from './contrast.ts';
|
|
3
3
|
export type { PositionInRangeOptions, Swatch } from './scale.ts';
|
|
4
|
-
export { VIRIDIS_SCALE, positionInRange, swatchFromScale } from './scale.ts';
|
|
4
|
+
export { VIRIDIS_SCALE, colorFromScale, positionInRange, swatchFromScale, } from './scale.ts';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/color/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/color/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
package/lib/color/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { contrastRatio, readableInk, relativeLuminance } from "./contrast.js";
|
|
2
|
-
export { VIRIDIS_SCALE, positionInRange, swatchFromScale } from "./scale.js";
|
|
2
|
+
export { VIRIDIS_SCALE, colorFromScale, positionInRange, swatchFromScale, } from "./scale.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/color/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/color/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
package/lib/core.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './ecosystem/core/index.ts';
|
|
|
8
8
|
export * from './format/core/index.ts';
|
|
9
9
|
export * from './orbital/core/index.ts';
|
|
10
10
|
export * from './pedagogy/core/index.ts';
|
|
11
|
+
export * from './periodic/core/index.ts';
|
|
11
12
|
export * from './router/core/index.ts';
|
|
12
13
|
export * from './seo/core/index.ts';
|
|
13
14
|
export * from './share/core/index.ts';
|
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;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,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,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
package/lib/core.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./ecosystem/core/index.js";
|
|
|
8
8
|
export * from "./format/core/index.js";
|
|
9
9
|
export * from "./orbital/core/index.js";
|
|
10
10
|
export * from "./pedagogy/core/index.js";
|
|
11
|
+
export * from "./periodic/core/index.js";
|
|
11
12
|
export * from "./router/core/index.js";
|
|
12
13
|
export * from "./seo/core/index.js";
|
|
13
14
|
export * from "./share/core/index.js";
|
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;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
|
@@ -40,8 +40,8 @@ export const ECOSYSTEM_SITES = [
|
|
|
40
40
|
repository: 'https://github.com/cheminfo/chemcalc.org',
|
|
41
41
|
tagline: 'Molecular formula, exact mass and isotopic distribution.',
|
|
42
42
|
brand: '#5b52e0',
|
|
43
|
-
brandAlt: '#
|
|
44
|
-
mark: { plate: '#5b52e0', accent: '#
|
|
43
|
+
brandAlt: '#d63384',
|
|
44
|
+
mark: { plate: '#5b52e0', accent: '#ff8ac2' },
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
id: 'nmrium',
|
|
@@ -139,9 +139,9 @@ export const ECOSYSTEM_SITES = [
|
|
|
139
139
|
host: 'polycarp.cheminfo.org',
|
|
140
140
|
repository: 'https://github.com/cheminfo/polycarp.cheminfo.org',
|
|
141
141
|
tagline: 'Predict the microstructure of a radical copolymerisation.',
|
|
142
|
-
brand: '#
|
|
143
|
-
brandAlt: '#
|
|
144
|
-
mark: { plate: '#
|
|
142
|
+
brand: '#701a75',
|
|
143
|
+
brandAlt: '#4d7c0f',
|
|
144
|
+
mark: { plate: '#701a75', accent: '#a3e635' },
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
id: '3d',
|
|
@@ -20,5 +20,5 @@ export { REAL_HARMONICS, SUBSHELL_LETTERS, harmonicsOf, subshellLetter, } from '
|
|
|
20
20
|
export type { AtomicSampleRequest, AtomicSampleResult, AtomicSampler, } from './sample.ts';
|
|
21
21
|
export { runAtomicSample } from './sample.ts';
|
|
22
22
|
export type { Screening } from './screening.ts';
|
|
23
|
-
export { slaterScreening } from './screening.ts';
|
|
23
|
+
export { groupRank, slaterScreening } from './screening.ts';
|
|
24
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orbital/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,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B,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -9,5 +9,5 @@ export { hundDistribution, outermostShell, withoutOutermostElectron, } from "./o
|
|
|
9
9
|
export { DEFAULT_PHASE_PALETTE_ID, PHASE_PALETTES } from "./palette.js";
|
|
10
10
|
export { REAL_HARMONICS, SUBSHELL_LETTERS, harmonicsOf, subshellLetter, } from "./realHarmonics.js";
|
|
11
11
|
export { runAtomicSample } from "./sample.js";
|
|
12
|
-
export { slaterScreening } from "./screening.js";
|
|
12
|
+
export { groupRank, slaterScreening } from "./screening.js";
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orbital/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,cAAc,GACf,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orbital/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,cAAc,GACf,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import type { ExerciseLevel
|
|
2
|
+
import type { ExerciseLevel } from '../core/types.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The little a strip needs of a step: what to call it, and which coloured group
|
|
5
|
+
* it belongs to. A tool passes its own steps, whatever else they carry.
|
|
6
|
+
*/
|
|
7
|
+
export interface TutorialStripStep {
|
|
8
|
+
/**
|
|
9
|
+
* What keys the button, when the tool gives its steps one.
|
|
10
|
+
* @default undefined — the position in the tour keys it instead
|
|
11
|
+
*/
|
|
12
|
+
id?: string;
|
|
13
|
+
title: string;
|
|
14
|
+
level: ExerciseLevel;
|
|
15
|
+
}
|
|
3
16
|
export interface TutorialStepStripProps {
|
|
4
17
|
/** The whole tour, in teaching order. */
|
|
5
|
-
steps: readonly
|
|
18
|
+
steps: readonly TutorialStripStep[];
|
|
6
19
|
/**
|
|
7
20
|
* Which step is open, as its position in `steps`. A position outside the
|
|
8
21
|
* tour is read as one of its ends, so a hand-edited link still opens.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TutorialStepStrip.d.ts","sourceRoot":"","sources":["../../../src/pedagogy/ui/TutorialStepStrip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"TutorialStepStrip.d.ts","sourceRoot":"","sources":["../../../src/pedagogy/ui/TutorialStepStrip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACpC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CA6D7E"}
|
|
@@ -29,7 +29,7 @@ function LevelStrip(props) {
|
|
|
29
29
|
const active = position === activeIndex;
|
|
30
30
|
buttons.push(_jsx(Tooltip, { content: step.title, hoverOpenDelay: HOVER_OPEN_DELAY, placement: "bottom", children: _jsx("button", { type: "button", "aria-label": `Step ${position + 1}: ${step.title}`, "aria-current": active ? 'step' : undefined, style: numberStyle(colours, active), onClick: () => {
|
|
31
31
|
onSelect(position);
|
|
32
|
-
}, children: position + 1 }) }, step.id));
|
|
32
|
+
}, children: position + 1 }) }, step.id ?? position));
|
|
33
33
|
}
|
|
34
34
|
return (_jsxs("div", { style: { ...STRIP_STYLE, background: colours.background }, children: [_jsx("span", { style: LABEL_STYLE, children: label }), buttons] }));
|
|
35
35
|
}
|
|
@@ -48,25 +48,36 @@ function clampIndex(index, total) {
|
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* The open step takes the darker shade of its own level, plus a border.
|
|
51
|
+
*
|
|
52
|
+
* Every button is the same square whatever it holds, so the numbers of one
|
|
53
|
+
* strip stand above those of the next and the tour reads as a grid.
|
|
51
54
|
* @param colours - The two shades of the level the step belongs to.
|
|
52
55
|
* @param active - Whether this is the step on screen.
|
|
53
56
|
* @returns The style of one numbered button.
|
|
54
57
|
*/
|
|
55
58
|
function numberStyle(colours, active) {
|
|
56
59
|
return {
|
|
57
|
-
|
|
60
|
+
display: 'inline-flex',
|
|
61
|
+
width: STEP_SIZE,
|
|
62
|
+
height: STEP_SIZE,
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
padding: 0,
|
|
58
66
|
border: active ? '2px solid #1c2127' : '1px solid rgb(17 20 24 / 20%)',
|
|
59
67
|
borderRadius: 4,
|
|
68
|
+
background: active ? colours.activeBackground : '#ffffff',
|
|
69
|
+
boxSizing: 'border-box',
|
|
60
70
|
color: '#1c2127',
|
|
61
71
|
cursor: 'pointer',
|
|
62
72
|
font: 'inherit',
|
|
63
73
|
fontSize: 12,
|
|
74
|
+
fontVariantNumeric: 'tabular-nums',
|
|
64
75
|
fontWeight: active ? 700 : 500,
|
|
65
76
|
lineHeight: 1,
|
|
66
|
-
minWidth: 26,
|
|
67
|
-
padding: active ? '5px 6px' : '6px 7px',
|
|
68
77
|
};
|
|
69
78
|
}
|
|
79
|
+
/** Wide enough for two digits, which every tour of ours stays under a hundred of. */
|
|
80
|
+
const STEP_SIZE = 28;
|
|
70
81
|
/** Long enough that the pointer can cross the strip without opening a title. */
|
|
71
82
|
const HOVER_OPEN_DELAY = 150;
|
|
72
83
|
const ROOT_STYLE = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TutorialStepStrip.js","sourceRoot":"","sources":["../../../src/pedagogy/ui/TutorialStepStrip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"TutorialStepStrip.js","sourceRoot":"","sources":["../../../src/pedagogy/ui/TutorialStepStrip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAkD7D;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,WAAW,EACX,KAAK,GAAG,IAAI,EACZ,SAAS,EACT,SAAS,GACV,GAAG,KAAK,CAAC;IACV,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAErD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AS,GAAG,EAAE,CAAC;AAErB,gFAAgF;AAChF,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,UAAU,GAAkB;IAChC,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,MAAM,WAAW,GAAkB;IACjC,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,QAAQ;IACpB,GAAG,EAAE,CAAC;IACN,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAM,WAAW,GAAkB;IACjC,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,GAAG;IACf,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAAM,WAAW,GAAkB;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,GAAG,EAAE,CAAC;IACN,UAAU,EAAE,CAAC;CACd,CAAC;AAEF,MAAM,UAAU,GAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC"}
|
|
@@ -20,7 +20,7 @@ export type { SyntaxTooltipContent, SyntaxTooltipExample, SyntaxTooltipProps, }
|
|
|
20
20
|
export { SyntaxTooltip } from './SyntaxTooltip.tsx';
|
|
21
21
|
export type { TestCaseListProps } from './TestCaseList.tsx';
|
|
22
22
|
export { TestCaseList } from './TestCaseList.tsx';
|
|
23
|
-
export type { TutorialStepStripProps } from './TutorialStepStrip.tsx';
|
|
23
|
+
export type { TutorialStepStripProps, TutorialStripStep, } from './TutorialStepStrip.tsx';
|
|
24
24
|
export { TutorialStepStrip } from './TutorialStepStrip.tsx';
|
|
25
25
|
export type { TutorialLevelColours } from './tutorialLevels.ts';
|
|
26
26
|
export { TUTORIAL_LEVEL_COLOURS } from './tutorialLevels.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.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index.js","sourceRoot":"","sources":["../../../src/pedagogy/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA8B,CAAC;AAKtE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAoB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAwB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AAMpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA6B,CAAC;AAMpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAqB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAKlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each family is called, and the colour it takes.
|
|
3
|
+
*
|
|
4
|
+
* Ten hues that stay distinguishable under deuteranopia and protanopia, and
|
|
5
|
+
* that keep the metals warm and the non-metals cool the way a wall chart does.
|
|
6
|
+
* Each is paired at load with the ink that stays readable on it, so a cell
|
|
7
|
+
* never has to compute a contrast while it renders.
|
|
8
|
+
*/
|
|
9
|
+
import type { Swatch } from '../../color/core/scale.ts';
|
|
10
|
+
import type { ElementCategory } from './elements.ts';
|
|
11
|
+
/** Families in the order a legend lists them, which is the order of the table. */
|
|
12
|
+
export declare const CATEGORY_ORDER: readonly ElementCategory[];
|
|
13
|
+
/** What each family is called in a legend. */
|
|
14
|
+
export declare const CATEGORY_LABELS: Record<ElementCategory, string>;
|
|
15
|
+
/** The colour of each family, with the ink that stays readable on it. */
|
|
16
|
+
export declare const CATEGORY_SWATCHES: Record<ElementCategory, Swatch>;
|
|
17
|
+
/** Shown for a cell whose family is unknown. */
|
|
18
|
+
export declare const UNKNOWN_SWATCH: Swatch;
|
|
19
|
+
/**
|
|
20
|
+
* The swatch of one family.
|
|
21
|
+
* @param category - Family to look up.
|
|
22
|
+
* @returns Its colour and the ink to write on it.
|
|
23
|
+
*/
|
|
24
|
+
export declare function categorySwatch(category: ElementCategory): Swatch;
|
|
25
|
+
//# sourceMappingURL=categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../../src/periodic/core/categories.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,SAAS,eAAe,EAWpD,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAW3D,CAAC;AAeF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CASxB,CAAC;AAIvC,gDAAgD;AAChD,eAAO,MAAM,cAAc,EAAE,MAG5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each family is called, and the colour it takes.
|
|
3
|
+
*
|
|
4
|
+
* Ten hues that stay distinguishable under deuteranopia and protanopia, and
|
|
5
|
+
* that keep the metals warm and the non-metals cool the way a wall chart does.
|
|
6
|
+
* Each is paired at load with the ink that stays readable on it, so a cell
|
|
7
|
+
* never has to compute a contrast while it renders.
|
|
8
|
+
*/
|
|
9
|
+
import { readableInk } from "../../color/core/contrast.js";
|
|
10
|
+
/** Families in the order a legend lists them, which is the order of the table. */
|
|
11
|
+
export const CATEGORY_ORDER = [
|
|
12
|
+
'alkali-metal',
|
|
13
|
+
'alkaline-earth-metal',
|
|
14
|
+
'transition-metal',
|
|
15
|
+
'post-transition-metal',
|
|
16
|
+
'metalloid',
|
|
17
|
+
'nonmetal',
|
|
18
|
+
'halogen',
|
|
19
|
+
'noble-gas',
|
|
20
|
+
'lanthanoid',
|
|
21
|
+
'actinoid',
|
|
22
|
+
];
|
|
23
|
+
/** What each family is called in a legend. */
|
|
24
|
+
export const CATEGORY_LABELS = {
|
|
25
|
+
'alkali-metal': 'Alkali metal',
|
|
26
|
+
'alkaline-earth-metal': 'Alkaline earth',
|
|
27
|
+
'transition-metal': 'Transition metal',
|
|
28
|
+
'post-transition-metal': 'Post-transition',
|
|
29
|
+
metalloid: 'Metalloid',
|
|
30
|
+
nonmetal: 'Non-metal',
|
|
31
|
+
halogen: 'Halogen',
|
|
32
|
+
'noble-gas': 'Noble gas',
|
|
33
|
+
lanthanoid: 'Lanthanoid',
|
|
34
|
+
actinoid: 'Actinoid',
|
|
35
|
+
};
|
|
36
|
+
const CATEGORY_BACKGROUNDS = {
|
|
37
|
+
'alkali-metal': '#f4a58a',
|
|
38
|
+
'alkaline-earth-metal': '#f6c98a',
|
|
39
|
+
'transition-metal': '#e8b7d4',
|
|
40
|
+
'post-transition-metal': '#c8c3ea',
|
|
41
|
+
metalloid: '#c9d67c',
|
|
42
|
+
nonmetal: '#7fd4a8',
|
|
43
|
+
halogen: '#8fd9d2',
|
|
44
|
+
'noble-gas': '#9ec9f0',
|
|
45
|
+
lanthanoid: '#f2d06b',
|
|
46
|
+
actinoid: '#e5a3a3',
|
|
47
|
+
};
|
|
48
|
+
/** The colour of each family, with the ink that stays readable on it. */
|
|
49
|
+
export const CATEGORY_SWATCHES = Object.fromEntries(CATEGORY_ORDER.map((category) => [
|
|
50
|
+
category,
|
|
51
|
+
{
|
|
52
|
+
background: CATEGORY_BACKGROUNDS[category],
|
|
53
|
+
foreground: readableInk(CATEGORY_BACKGROUNDS[category]),
|
|
54
|
+
},
|
|
55
|
+
]));
|
|
56
|
+
const UNKNOWN_BACKGROUND = '#e4e8ee';
|
|
57
|
+
/** Shown for a cell whose family is unknown. */
|
|
58
|
+
export const UNKNOWN_SWATCH = {
|
|
59
|
+
background: UNKNOWN_BACKGROUND,
|
|
60
|
+
foreground: readableInk(UNKNOWN_BACKGROUND),
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* The swatch of one family.
|
|
64
|
+
* @param category - Family to look up.
|
|
65
|
+
* @returns Its colour and the ink to write on it.
|
|
66
|
+
*/
|
|
67
|
+
export function categorySwatch(category) {
|
|
68
|
+
return CATEGORY_SWATCHES[category] ?? UNKNOWN_SWATCH;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../src/periodic/core/categories.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAK3D,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAA+B;IACxD,cAAc;IACd,sBAAsB;IACtB,kBAAkB;IAClB,uBAAuB;IACvB,WAAW;IACX,UAAU;IACV,SAAS;IACT,WAAW;IACX,YAAY;IACZ,UAAU;CACX,CAAC;AAEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAoC;IAC9D,cAAc,EAAE,cAAc;IAC9B,sBAAsB,EAAE,gBAAgB;IACxC,kBAAkB,EAAE,kBAAkB;IACtC,uBAAuB,EAAE,iBAAiB;IAC1C,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,WAAW;IACrB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,oBAAoB,GAAoC;IAC5D,cAAc,EAAE,SAAS;IACzB,sBAAsB,EAAE,SAAS;IACjC,kBAAkB,EAAE,SAAS;IAC7B,uBAAuB,EAAE,SAAS;IAClC,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAC5B,MAAM,CAAC,WAAW,CAChB,cAAc,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC/B,QAAQ;IACR;QACE,UAAU,EAAE,oBAAoB,CAAC,QAAQ,CAAC;QAC1C,UAAU,EAAE,WAAW,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;KACxD;CACF,CAAC,CACgC,CAAC;AAEvC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC,gDAAgD;AAChD,MAAM,CAAC,MAAM,cAAc,GAAW;IACpC,UAAU,EAAE,kBAAkB;IAC9B,UAAU,EAAE,WAAW,CAAC,kBAAkB,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAyB;IACtD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where every element sits in the table, and which family it belongs to.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately the *position* and nothing else: the masses, the isotopes and
|
|
5
|
+
* the exact monoisotopic masses are `chemical-elements`' subject, and a site
|
|
6
|
+
* that needs them reads them from there. Importing that package pulls its whole
|
|
7
|
+
* isotope table, which a site wanting only an element picker must not be made
|
|
8
|
+
* to carry — so the symbols and names are repeated here, and a test asserts
|
|
9
|
+
* they still agree with it.
|
|
10
|
+
*
|
|
11
|
+
* `block` follows the element's *position* in the table, which is what a
|
|
12
|
+
* student reads off it. The configuration is the authority on which subshell is
|
|
13
|
+
* actually filling, and the two disagree for a handful of elements — lanthanum
|
|
14
|
+
* fills 5d, not 4f. See `ELEMENT_ANOMALIES` in the orbital module.
|
|
15
|
+
*/
|
|
16
|
+
/** Region of the table an element sits in. */
|
|
17
|
+
export type ElementBlock = 's' | 'p' | 'd' | 'f';
|
|
18
|
+
/** Coarse family, used to colour the table. */
|
|
19
|
+
export type ElementCategory = 'alkali-metal' | 'alkaline-earth-metal' | 'transition-metal' | 'post-transition-metal' | 'metalloid' | 'nonmetal' | 'halogen' | 'noble-gas' | 'lanthanoid' | 'actinoid';
|
|
20
|
+
/** One element, as the table places it. */
|
|
21
|
+
export interface PeriodicElement {
|
|
22
|
+
/** Proton count, 1 to 118. */
|
|
23
|
+
atomicNumber: number;
|
|
24
|
+
/** Chemical symbol, e.g. `Fe`. */
|
|
25
|
+
symbol: string;
|
|
26
|
+
/** English name, spelled as `chemical-elements` spells it. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Row of the table, 1 to 7. */
|
|
29
|
+
period: number;
|
|
30
|
+
/** IUPAC column 1 to 18; `null` for the lanthanoids and the actinoids. */
|
|
31
|
+
group: number | null;
|
|
32
|
+
block: ElementBlock;
|
|
33
|
+
category: ElementCategory;
|
|
34
|
+
}
|
|
35
|
+
/** Every element, ordered by atomic number. */
|
|
36
|
+
export declare const PERIODIC_ELEMENTS: readonly PeriodicElement[];
|
|
37
|
+
/**
|
|
38
|
+
* Look up an element by its symbol.
|
|
39
|
+
* @param symbol - Chemical symbol, e.g. `Cl`. Case sensitive, as symbols are.
|
|
40
|
+
* @returns The element, or `undefined` when no element carries that symbol.
|
|
41
|
+
*/
|
|
42
|
+
export declare function elementBySymbol(symbol: string): PeriodicElement | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Look up an element by its atomic number.
|
|
45
|
+
* @param atomicNumber - Proton count, 1 to 118.
|
|
46
|
+
* @returns The element, or `undefined` when it is outside the table.
|
|
47
|
+
*/
|
|
48
|
+
export declare function elementByAtomicNumber(atomicNumber: number): PeriodicElement | undefined;
|
|
49
|
+
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/periodic/core/elements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjD,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,sBAAsB,GACtB,kBAAkB,GAClB,uBAAuB,GACvB,WAAW,GACX,UAAU,GACV,SAAS,GACT,WAAW,GACX,YAAY,GACZ,UAAU,CAAC;AAEf,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC;CAC3B;AA8HD,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAUvD,CAAC;AAMF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,GACnB,eAAe,GAAG,SAAS,CAE7B"}
|