react-cheminfo 0.8.0 → 0.9.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 +60 -2
- package/bin/check-tokens.mjs +105 -0
- package/lib/about/core/about.d.ts +95 -0
- package/lib/about/core/about.d.ts.map +1 -0
- package/lib/about/core/about.js +78 -0
- package/lib/about/core/about.js.map +1 -0
- package/lib/about/core/index.d.ts +3 -0
- package/lib/about/core/index.d.ts.map +1 -0
- package/lib/about/core/index.js +2 -0
- package/lib/about/core/index.js.map +1 -0
- package/lib/about/ui/AboutCitations.d.ts +14 -0
- package/lib/about/ui/AboutCitations.d.ts.map +1 -0
- package/lib/about/ui/AboutCitations.js +40 -0
- package/lib/about/ui/AboutCitations.js.map +1 -0
- package/lib/about/ui/AboutPage.d.ts +32 -0
- package/lib/about/ui/AboutPage.d.ts.map +1 -0
- package/lib/about/ui/AboutPage.js +70 -0
- package/lib/about/ui/AboutPage.js.map +1 -0
- package/lib/about/ui/AboutSection.d.ts +23 -0
- package/lib/about/ui/AboutSection.d.ts.map +1 -0
- package/lib/about/ui/AboutSection.js +28 -0
- package/lib/about/ui/AboutSection.js.map +1 -0
- package/lib/about/ui/index.d.ts +7 -0
- package/lib/about/ui/index.d.ts.map +1 -0
- package/lib/about/ui/index.js +4 -0
- package/lib/about/ui/index.js.map +1 -0
- package/lib/chrome/ui/index.d.ts +1 -0
- package/lib/chrome/ui/index.d.ts.map +1 -1
- package/lib/chrome/ui/index.js +3 -0
- package/lib/chrome/ui/index.js.map +1 -1
- package/lib/clipboard/ui/CodeBlock.d.ts.map +1 -1
- package/lib/clipboard/ui/CodeBlock.js +4 -1
- package/lib/clipboard/ui/CodeBlock.js.map +1 -1
- package/lib/color/ui/ColorScaleLegend.js +1 -1
- package/lib/color/ui/ColorScaleLegend.js.map +1 -1
- package/lib/core.d.ts +3 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +5 -0
- package/lib/core.js.map +1 -1
- package/lib/credits/core/credits.d.ts +36 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +42 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/credits/ui/CreditsList.js +1 -1
- package/lib/credits/ui/CreditsList.js.map +1 -1
- package/lib/delimited/ui/DelimitedTextPanel.js +1 -1
- package/lib/delimited/ui/DelimitedTextPanel.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 +10 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/tokens.d.ts.map +1 -1
- package/lib/ecosystem/core/tokens.js +1 -0
- package/lib/ecosystem/core/tokens.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.js +2 -2
- package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js.map +1 -1
- package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -1
- package/lib/ecosystem/ui/SiteTile.js +5 -5
- package/lib/ecosystem/ui/SiteTile.js.map +1 -1
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +3 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -1
- 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/orbital/core/realHarmonics.d.ts +5 -2
- package/lib/orbital/core/realHarmonics.d.ts.map +1 -1
- package/lib/orbital/core/realHarmonics.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts +18 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.js +84 -7
- package/lib/orbital/ui/AtomicOrbitalCanvas.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts +13 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.js +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.js.map +1 -1
- package/lib/orbital/ui/camera.d.ts +15 -0
- package/lib/orbital/ui/camera.d.ts.map +1 -1
- package/lib/orbital/ui/camera.js +68 -0
- package/lib/orbital/ui/camera.js.map +1 -1
- package/lib/orbital/ui/renderVolume.d.ts.map +1 -1
- package/lib/orbital/ui/renderVolume.js +8 -1
- package/lib/orbital/ui/renderVolume.js.map +1 -1
- package/lib/orbital/ui/serial.d.ts +25 -0
- package/lib/orbital/ui/serial.d.ts.map +1 -0
- package/lib/orbital/ui/serial.js +25 -0
- package/lib/orbital/ui/serial.js.map +1 -0
- package/lib/orbital/ui/viewer.d.ts +23 -0
- package/lib/orbital/ui/viewer.d.ts.map +1 -1
- package/lib/orbital/ui/viewer.js +70 -17
- package/lib/orbital/ui/viewer.js.map +1 -1
- package/lib/pedagogy/ui/ExerciseProgressHeader.js +1 -1
- package/lib/pedagogy/ui/ExerciseProgressHeader.js.map +1 -1
- package/lib/pedagogy/ui/GlossaryText.js +2 -2
- package/lib/pedagogy/ui/GlossaryText.js.map +1 -1
- package/lib/pedagogy/ui/ReferenceSectionBlock.js +5 -2
- package/lib/pedagogy/ui/ReferenceSectionBlock.js.map +1 -1
- package/lib/pedagogy/ui/SyntaxTooltip.js +2 -2
- package/lib/pedagogy/ui/SyntaxTooltip.js.map +1 -1
- package/lib/pedagogy/ui/TutorialStepStrip.js +4 -1
- package/lib/pedagogy/ui/TutorialStepStrip.js.map +1 -1
- package/lib/periodic/ui/CategoryLegend.js +1 -1
- package/lib/periodic/ui/CategoryLegend.js.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.js +2 -2
- package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -1
- package/lib/seo/vite/ogCard.d.ts.map +1 -1
- package/lib/seo/vite/ogCard.js +1 -0
- package/lib/seo/vite/ogCard.js.map +1 -1
- package/lib/share/ui/ShareDialogContent.d.ts.map +1 -1
- package/lib/share/ui/ShareDialogContent.js +5 -2
- package/lib/share/ui/ShareDialogContent.js.map +1 -1
- package/lib/share/ui/SharePartOptions.js +1 -1
- package/lib/share/ui/SharePartOptions.js.map +1 -1
- package/lib/slides/core/demoLinks.d.ts +43 -0
- package/lib/slides/core/demoLinks.d.ts.map +1 -0
- package/lib/slides/core/demoLinks.js +104 -0
- package/lib/slides/core/demoLinks.js.map +1 -0
- package/lib/slides/core/index.d.ts +13 -0
- package/lib/slides/core/index.d.ts.map +1 -0
- package/lib/slides/core/index.js +7 -0
- package/lib/slides/core/index.js.map +1 -0
- package/lib/slides/core/sectionHeading.d.ts +19 -0
- package/lib/slides/core/sectionHeading.d.ts.map +1 -0
- package/lib/slides/core/sectionHeading.js +19 -0
- package/lib/slides/core/sectionHeading.js.map +1 -0
- package/lib/slides/core/slideNavigation.d.ts +38 -0
- package/lib/slides/core/slideNavigation.d.ts.map +1 -0
- package/lib/slides/core/slideNavigation.js +65 -0
- package/lib/slides/core/slideNavigation.js.map +1 -0
- package/lib/slides/core/talk.d.ts +82 -0
- package/lib/slides/core/talk.d.ts.map +1 -0
- package/lib/slides/core/talk.js +134 -0
- package/lib/slides/core/talk.js.map +1 -0
- package/lib/slides/core/talkManifest.d.ts +90 -0
- package/lib/slides/core/talkManifest.d.ts.map +1 -0
- package/lib/slides/core/talkManifest.js +109 -0
- package/lib/slides/core/talkManifest.js.map +1 -0
- package/lib/slides/core/talkOrigin.d.ts +50 -0
- package/lib/slides/core/talkOrigin.d.ts.map +1 -0
- package/lib/slides/core/talkOrigin.js +62 -0
- package/lib/slides/core/talkOrigin.js.map +1 -0
- package/lib/slides/ui/BackToSlides.d.ts +26 -0
- package/lib/slides/ui/BackToSlides.d.ts.map +1 -0
- package/lib/slides/ui/BackToSlides.js +24 -0
- package/lib/slides/ui/BackToSlides.js.map +1 -0
- package/lib/slides/ui/DemoLink.d.ts +42 -0
- package/lib/slides/ui/DemoLink.d.ts.map +1 -0
- package/lib/slides/ui/DemoLink.js +17 -0
- package/lib/slides/ui/DemoLink.js.map +1 -0
- package/lib/slides/ui/EmbedSlide.d.ts +19 -0
- package/lib/slides/ui/EmbedSlide.d.ts.map +1 -0
- package/lib/slides/ui/EmbedSlide.js +56 -0
- package/lib/slides/ui/EmbedSlide.js.map +1 -0
- package/lib/slides/ui/SectionSlide.d.ts +18 -0
- package/lib/slides/ui/SectionSlide.d.ts.map +1 -0
- package/lib/slides/ui/SectionSlide.js +18 -0
- package/lib/slides/ui/SectionSlide.js.map +1 -0
- package/lib/slides/ui/Slide.d.ts +52 -0
- package/lib/slides/ui/Slide.d.ts.map +1 -0
- package/lib/slides/ui/Slide.js +58 -0
- package/lib/slides/ui/Slide.js.map +1 -0
- package/lib/slides/ui/SlideBody.d.ts +32 -0
- package/lib/slides/ui/SlideBody.d.ts.map +1 -0
- package/lib/slides/ui/SlideBody.js +27 -0
- package/lib/slides/ui/SlideBody.js.map +1 -0
- package/lib/slides/ui/Slideshow.d.ts +93 -0
- package/lib/slides/ui/Slideshow.d.ts.map +1 -0
- package/lib/slides/ui/Slideshow.js +122 -0
- package/lib/slides/ui/Slideshow.js.map +1 -0
- package/lib/slides/ui/SlideshowBar.d.ts +33 -0
- package/lib/slides/ui/SlideshowBar.d.ts.map +1 -0
- package/lib/slides/ui/SlideshowBar.js +20 -0
- package/lib/slides/ui/SlideshowBar.js.map +1 -0
- package/lib/slides/ui/TalkList.d.ts +37 -0
- package/lib/slides/ui/TalkList.d.ts.map +1 -0
- package/lib/slides/ui/TalkList.js +68 -0
- package/lib/slides/ui/TalkList.js.map +1 -0
- package/lib/slides/ui/index.d.ts +19 -0
- package/lib/slides/ui/index.d.ts.map +1 -0
- package/lib/slides/ui/index.js +10 -0
- package/lib/slides/ui/index.js.map +1 -0
- package/lib/slides/vite/index.d.ts +3 -0
- package/lib/slides/vite/index.d.ts.map +1 -0
- package/lib/slides/vite/index.js +2 -0
- package/lib/slides/vite/index.js.map +1 -0
- package/lib/slides/vite/talks.d.ts +50 -0
- package/lib/slides/vite/talks.d.ts.map +1 -0
- package/lib/slides/vite/talks.js +87 -0
- package/lib/slides/vite/talks.js.map +1 -0
- package/lib/slides.d.ts +3 -0
- package/lib/slides.d.ts.map +1 -0
- package/lib/slides.js +3 -0
- package/lib/slides.js.map +1 -0
- package/lib/structure/ui/StructureEditor.js +2 -2
- package/lib/structure/ui/StructureEditor.js.map +1 -1
- package/lib/structure/ui/StructurePlaceholder.js +1 -1
- package/lib/structure/ui/StructurePlaceholder.js.map +1 -1
- package/lib/tokens/core/checkTokens.d.ts +51 -0
- package/lib/tokens/core/checkTokens.d.ts.map +1 -0
- package/lib/tokens/core/checkTokens.js +188 -0
- package/lib/tokens/core/checkTokens.js.map +1 -0
- package/lib/tokens/core/colors.d.ts +42 -0
- package/lib/tokens/core/colors.d.ts.map +1 -0
- package/lib/tokens/core/colors.js +119 -0
- package/lib/tokens/core/colors.js.map +1 -0
- package/lib/tokens/core/index.d.ts +3 -0
- package/lib/tokens/core/index.d.ts.map +1 -0
- package/lib/tokens/core/index.js +2 -0
- package/lib/tokens/core/index.js.map +1 -0
- package/lib/tokens/core/rules.d.ts +23 -0
- package/lib/tokens/core/rules.d.ts.map +1 -0
- package/lib/tokens/core/rules.js +90 -0
- package/lib/tokens/core/rules.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/lib/vite.d.ts +1 -0
- package/lib/vite.d.ts.map +1 -1
- package/lib/vite.js +1 -0
- package/lib/vite.js.map +1 -1
- package/package.json +11 -3
- package/src/about/core/about.ts +176 -0
- package/src/about/core/index.ts +2 -0
- package/src/about/ui/AboutCitations.tsx +79 -0
- package/src/about/ui/AboutPage.tsx +177 -0
- package/src/about/ui/AboutSection.tsx +56 -0
- package/src/about/ui/index.ts +6 -0
- package/src/chrome/ui/index.ts +3 -0
- package/src/clipboard/ui/CodeBlock.tsx +4 -1
- package/src/color/ui/ColorScaleLegend.tsx +1 -1
- package/src/core.ts +5 -0
- package/src/credits/core/credits.ts +42 -0
- package/src/credits/ui/CreditsList.tsx +1 -1
- package/src/delimited/ui/DelimitedTextPanel.tsx +1 -1
- package/src/ecosystem/core/sites.ts +12 -0
- package/src/ecosystem/core/tokens.ts +1 -0
- package/src/ecosystem/ui/EcosystemLinks.tsx +2 -2
- package/src/ecosystem/ui/EcosystemMenu.tsx +1 -1
- package/src/ecosystem/ui/SiteTile.tsx +7 -5
- package/src/ecosystem/ui/glyphs.tsx +40 -0
- package/src/orbital/core/index.ts +4 -1
- package/src/orbital/core/realHarmonics.ts +5 -2
- package/src/orbital/ui/AtomicOrbitalCanvas.tsx +126 -4
- package/src/orbital/ui/AtomicOrbitalViewer.tsx +14 -1
- package/src/orbital/ui/camera.ts +81 -0
- package/src/orbital/ui/renderVolume.ts +8 -1
- package/src/orbital/ui/serial.ts +35 -0
- package/src/orbital/ui/viewer.ts +72 -13
- package/src/pedagogy/ui/ExerciseProgressHeader.tsx +1 -1
- package/src/pedagogy/ui/GlossaryText.tsx +2 -2
- package/src/pedagogy/ui/ReferenceSectionBlock.tsx +5 -2
- package/src/pedagogy/ui/SyntaxTooltip.tsx +2 -2
- package/src/pedagogy/ui/TutorialStepStrip.tsx +4 -1
- package/src/periodic/ui/CategoryLegend.tsx +1 -1
- package/src/periodic/ui/PeriodicTableChrome.tsx +2 -2
- package/src/seo/vite/ogCard.ts +1 -0
- package/src/share/ui/ShareDialogContent.tsx +5 -2
- package/src/share/ui/SharePartOptions.tsx +1 -1
- package/src/slides/core/demoLinks.ts +113 -0
- package/src/slides/core/index.ts +22 -0
- package/src/slides/core/sectionHeading.ts +29 -0
- package/src/slides/core/slideNavigation.ts +77 -0
- package/src/slides/core/talk.ts +203 -0
- package/src/slides/core/talkManifest.ts +158 -0
- package/src/slides/core/talkOrigin.ts +83 -0
- package/src/slides/ui/BackToSlides.tsx +49 -0
- package/src/slides/ui/DemoLink.tsx +67 -0
- package/src/slides/ui/EmbedSlide.tsx +85 -0
- package/src/slides/ui/SectionSlide.tsx +44 -0
- package/src/slides/ui/Slide.tsx +143 -0
- package/src/slides/ui/SlideBody.tsx +64 -0
- package/src/slides/ui/Slideshow.tsx +282 -0
- package/src/slides/ui/SlideshowBar.tsx +83 -0
- package/src/slides/ui/TalkList.tsx +146 -0
- package/src/slides/ui/index.ts +18 -0
- package/src/slides/vite/index.ts +2 -0
- package/src/slides/vite/talks.ts +126 -0
- package/src/slides.ts +2 -0
- package/src/structure/ui/StructureEditor.tsx +2 -2
- package/src/structure/ui/StructurePlaceholder.tsx +1 -1
- package/src/tokens/core/checkTokens.ts +242 -0
- package/src/tokens/core/colors.ts +122 -0
- package/src/tokens/core/index.ts +6 -0
- package/src/tokens/core/rules.ts +103 -0
- package/src/ui.ts +1 -0
- package/src/vite.ts +1 -0
- package/styles/chrome.css +1 -0
- package/styles/slides.css +667 -0
package/lib/vite.d.ts
CHANGED
package/lib/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
package/lib/vite.js
CHANGED
package/lib/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cheminfo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Assembled React components shared by the cheminfo sites: a Cite button and an ecosystem menu",
|
|
6
6
|
"author": "Luc Patiny",
|
|
@@ -14,18 +14,24 @@
|
|
|
14
14
|
"exports": {
|
|
15
15
|
"./core": "./lib/core.js",
|
|
16
16
|
"./orbital": "./lib/orbital.js",
|
|
17
|
+
"./slides": "./lib/slides.js",
|
|
17
18
|
"./structure": "./lib/structure.js",
|
|
18
19
|
"./ui": "./lib/ui.js",
|
|
19
20
|
"./vite": "./lib/vite.js",
|
|
20
21
|
"./styles/*.css": "./styles/*.css"
|
|
21
22
|
},
|
|
23
|
+
"bin": {
|
|
24
|
+
"cheminfo-check-tokens": "bin/check-tokens.mjs"
|
|
25
|
+
},
|
|
22
26
|
"files": [
|
|
27
|
+
"bin",
|
|
23
28
|
"lib",
|
|
24
29
|
"src",
|
|
25
30
|
"styles"
|
|
26
31
|
],
|
|
27
32
|
"scripts": {
|
|
28
33
|
"build-storybook": "storybook build",
|
|
34
|
+
"check-tokens": "node bin/check-tokens.mjs styles src",
|
|
29
35
|
"check-types": "tsc --noEmit",
|
|
30
36
|
"clean": "rimraf coverage lib storybook-static",
|
|
31
37
|
"dev": "storybook dev -p 10815",
|
|
@@ -34,7 +40,7 @@
|
|
|
34
40
|
"prepack": "npm run tsc",
|
|
35
41
|
"prettier": "prettier --check .",
|
|
36
42
|
"prettier-write": "prettier --write .",
|
|
37
|
-
"test": "npm run test-only && npm run check-types && npm run eslint && npm run prettier",
|
|
43
|
+
"test": "npm run test-only && npm run check-types && npm run check-tokens && npm run eslint && npm run prettier",
|
|
38
44
|
"test-e2e": "playwright test",
|
|
39
45
|
"test-e2e-ui": "playwright test --ui",
|
|
40
46
|
"test-only": "vitest run --coverage",
|
|
@@ -42,7 +48,9 @@
|
|
|
42
48
|
"tsc-build": "tsc --project tsconfig.build.json"
|
|
43
49
|
},
|
|
44
50
|
"dependencies": {
|
|
45
|
-
"cheminfo-font": "^1.28.0"
|
|
51
|
+
"cheminfo-font": "^1.28.0",
|
|
52
|
+
"react-markdown": "^10.1.0",
|
|
53
|
+
"rehype-raw": "^7.0.0"
|
|
46
54
|
},
|
|
47
55
|
"devDependencies": {
|
|
48
56
|
"@blueprintjs/core": "^6.18.0",
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { CitedWork } from '../../citation/core/works.ts';
|
|
2
|
+
import type { CreditEntry, CreditId } from '../../credits/core/credits.ts';
|
|
3
|
+
import { credits } from '../../credits/core/credits.ts';
|
|
4
|
+
import { siteById } from '../../ecosystem/core/lookup.ts';
|
|
5
|
+
import type { EcosystemSite, SiteId } from '../../ecosystem/core/sites.ts';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What a site says about itself: the one page a visitor opens to find out what
|
|
9
|
+
* the tool is, what it stands on, and who to tell when it breaks.
|
|
10
|
+
*
|
|
11
|
+
* Every field is content, never markup. A site writes this record and the page
|
|
12
|
+
* is drawn from it, which is what keeps fourteen About pages in one order and
|
|
13
|
+
* one voice — the shape they were in before was fourteen hand-written pages,
|
|
14
|
+
* each crediting a different half of what it runs on.
|
|
15
|
+
*/
|
|
16
|
+
export interface AboutContent {
|
|
17
|
+
/** The site the page belongs to. */
|
|
18
|
+
siteId: SiteId;
|
|
19
|
+
/** One sentence: what this tool is. */
|
|
20
|
+
what: string;
|
|
21
|
+
/**
|
|
22
|
+
* At most two short paragraphs of context — what the site replaces, where
|
|
23
|
+
* its numbers come from, what it deliberately does not do.
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
paragraphs?: readonly string[];
|
|
27
|
+
/** Three to six one-line entries: what a visitor can do here. */
|
|
28
|
+
can: readonly string[];
|
|
29
|
+
/** Ids into the shared credits registry, in display order. */
|
|
30
|
+
credits: readonly CreditId[];
|
|
31
|
+
/**
|
|
32
|
+
* Works to cite, from the citation module.
|
|
33
|
+
* @default undefined — the site asks for no citation of its own
|
|
34
|
+
*/
|
|
35
|
+
cite?: readonly CitedWork[];
|
|
36
|
+
/**
|
|
37
|
+
* Licence the site itself is published under.
|
|
38
|
+
* @default 'MIT'
|
|
39
|
+
*/
|
|
40
|
+
license?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Where the sources live.
|
|
43
|
+
* @default the repository of the ECOSYSTEM_SITES record
|
|
44
|
+
*/
|
|
45
|
+
repository?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The running version, when the site knows it.
|
|
48
|
+
* @default undefined
|
|
49
|
+
*/
|
|
50
|
+
version?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Where a problem is reported.
|
|
53
|
+
* @default the repository's /issues
|
|
54
|
+
*/
|
|
55
|
+
issues?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The same record with nothing left to look up: every default filled in, and
|
|
60
|
+
* every credit id replaced by the entry it names.
|
|
61
|
+
*/
|
|
62
|
+
export interface ResolvedAbout {
|
|
63
|
+
/** The site's own record, which carries its name, tagline and colours. */
|
|
64
|
+
site: EcosystemSite;
|
|
65
|
+
what: string;
|
|
66
|
+
/** The context paragraphs, empty when the site writes none. */
|
|
67
|
+
paragraphs: readonly string[];
|
|
68
|
+
can: readonly string[];
|
|
69
|
+
/** The borrowed works themselves, in the order the site names them. */
|
|
70
|
+
credits: CreditEntry[];
|
|
71
|
+
/** The works to cite, empty when the site asks for none. */
|
|
72
|
+
cite: readonly CitedWork[];
|
|
73
|
+
license: string;
|
|
74
|
+
repository: string;
|
|
75
|
+
/** The running version, or `undefined` when the site does not know it. */
|
|
76
|
+
version: string | undefined;
|
|
77
|
+
issues: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Fill in what a site left to the family, and resolve what it named.
|
|
82
|
+
* @param content - What the site wrote about itself.
|
|
83
|
+
* @returns The record the About page is drawn from.
|
|
84
|
+
* @throws {Error} When the site is not one of the family, or when a credit id
|
|
85
|
+
* is not in the registry: an About page that silently drops a borrowed work
|
|
86
|
+
* credits nobody.
|
|
87
|
+
*/
|
|
88
|
+
export function resolveAbout(content: AboutContent): ResolvedAbout {
|
|
89
|
+
const site = siteById(content.siteId);
|
|
90
|
+
const repository = content.repository ?? site.repository;
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
site,
|
|
94
|
+
what: content.what,
|
|
95
|
+
paragraphs: content.paragraphs ?? [],
|
|
96
|
+
can: content.can,
|
|
97
|
+
credits: credits(content.credits),
|
|
98
|
+
cite: content.cite ?? [],
|
|
99
|
+
license: content.license ?? DEFAULT_LICENSE,
|
|
100
|
+
repository,
|
|
101
|
+
version: content.version,
|
|
102
|
+
issues: content.issues ?? `${withoutTrailingSlash(repository)}/issues`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* What is wrong with a record before anyone reads the page it draws.
|
|
108
|
+
*
|
|
109
|
+
* Short and efficient prose is the house style, and prose is exactly what no
|
|
110
|
+
* test, lint rule or type ever checks: a `what` that runs to a paragraph and a
|
|
111
|
+
* `can` list of a dozen lines both compile. This is where that is caught, so a
|
|
112
|
+
* site can assert it in its own suite rather than discover it in review.
|
|
113
|
+
* @param content - What the site wrote about itself.
|
|
114
|
+
* @returns One line per problem, in reading order; empty when there is none.
|
|
115
|
+
*/
|
|
116
|
+
export function aboutProblems(content: AboutContent): string[] {
|
|
117
|
+
const problems: string[] = [];
|
|
118
|
+
|
|
119
|
+
if (content.what.length > WHAT_LIMIT) {
|
|
120
|
+
problems.push(
|
|
121
|
+
`\`what\` is ${content.what.length} characters: one sentence of at most ${WHAT_LIMIT} says what the tool is.`,
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const can = content.can;
|
|
126
|
+
if (can.length < CAN_MIN || can.length > CAN_MAX) {
|
|
127
|
+
problems.push(
|
|
128
|
+
`\`can\` lists ${can.length} entries: between ${CAN_MIN} and ${CAN_MAX} is what a visitor reads before deciding to stay.`,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
for (let index = 0; index < can.length; index++) {
|
|
132
|
+
const line = can[index] ?? '';
|
|
133
|
+
if (line.length > CAN_LINE_LIMIT) {
|
|
134
|
+
problems.push(
|
|
135
|
+
`\`can\` entry ${index + 1} is ${line.length} characters: one line of at most ${CAN_LINE_LIMIT}, not a sentence about it.`,
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const paragraphs = content.paragraphs ?? [];
|
|
141
|
+
if (paragraphs.length > PARAGRAPH_MAX) {
|
|
142
|
+
problems.push(
|
|
143
|
+
`\`paragraphs\` holds ${paragraphs.length}: at most ${PARAGRAPH_MAX} short paragraphs of context, and the rest belongs in the README.`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
for (let index = 0; index < paragraphs.length; index++) {
|
|
147
|
+
const paragraph = paragraphs[index] ?? '';
|
|
148
|
+
if (paragraph.length > PARAGRAPH_LIMIT) {
|
|
149
|
+
problems.push(
|
|
150
|
+
`paragraph ${index + 1} is ${paragraph.length} characters: at most ${PARAGRAPH_LIMIT}, or it is documentation rather than context.`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (content.credits.length === 0) {
|
|
156
|
+
problems.push(
|
|
157
|
+
'`credits` is empty: every page of ours stands on borrowed work, and naming it is what the section is for.',
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return problems;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** What a site is published under unless it says otherwise. */
|
|
165
|
+
const DEFAULT_LICENSE = 'MIT';
|
|
166
|
+
|
|
167
|
+
const WHAT_LIMIT = 160;
|
|
168
|
+
const CAN_MIN = 3;
|
|
169
|
+
const CAN_MAX = 6;
|
|
170
|
+
const CAN_LINE_LIMIT = 90;
|
|
171
|
+
const PARAGRAPH_MAX = 2;
|
|
172
|
+
const PARAGRAPH_LIMIT = 400;
|
|
173
|
+
|
|
174
|
+
function withoutTrailingSlash(url: string): string {
|
|
175
|
+
return url.endsWith('/') ? url.slice(0, -1) : url;
|
|
176
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_CITATION_STYLE } from '../../citation/core/formats.ts';
|
|
4
|
+
import { doiUrl } from '../../citation/core/reference.ts';
|
|
5
|
+
import type { CitedWork } from '../../citation/core/works.ts';
|
|
6
|
+
import { CitationPreview } from '../../citation/ui/CitationPreview.tsx';
|
|
7
|
+
|
|
8
|
+
export interface AboutCitationsProps {
|
|
9
|
+
/** The works the site asks for, in the order it names them. */
|
|
10
|
+
works: readonly CitedWork[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* What to cite, and what citing each work credits: a reader handed two
|
|
15
|
+
* references has to be told which is which before they can pick one.
|
|
16
|
+
* @param props - See {@link AboutCitationsProps}.
|
|
17
|
+
* @returns The works, each with its reference and its DOI.
|
|
18
|
+
*/
|
|
19
|
+
export function AboutCitations(props: AboutCitationsProps): ReactElement {
|
|
20
|
+
const { works } = props;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div className="about-citations" style={LIST_STYLE}>
|
|
24
|
+
{works.map((work) => (
|
|
25
|
+
<div key={work.reference.doi} className="about-citation">
|
|
26
|
+
<div style={WHAT_STYLE}>{work.what}</div>
|
|
27
|
+
{work.note === undefined ? null : (
|
|
28
|
+
<p style={NOTE_STYLE}>{work.note}</p>
|
|
29
|
+
)}
|
|
30
|
+
<div style={PLATE_STYLE}>
|
|
31
|
+
<CitationPreview
|
|
32
|
+
reference={work.reference}
|
|
33
|
+
format="text"
|
|
34
|
+
style={DEFAULT_CITATION_STYLE}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
<a
|
|
38
|
+
href={doiUrl(work.reference)}
|
|
39
|
+
target="_blank"
|
|
40
|
+
rel="noopener noreferrer"
|
|
41
|
+
style={DOI_STYLE}
|
|
42
|
+
>
|
|
43
|
+
doi:{work.reference.doi}
|
|
44
|
+
</a>
|
|
45
|
+
</div>
|
|
46
|
+
))}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const LIST_STYLE = {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
flexDirection: 'column',
|
|
54
|
+
gap: 14,
|
|
55
|
+
} as const satisfies CSSProperties;
|
|
56
|
+
|
|
57
|
+
const WHAT_STYLE = { fontWeight: 600 } as const satisfies CSSProperties;
|
|
58
|
+
|
|
59
|
+
const NOTE_STYLE = {
|
|
60
|
+
margin: '2px 0 6px',
|
|
61
|
+
color: 'var(--text-muted)',
|
|
62
|
+
fontSize: 13,
|
|
63
|
+
} as const satisfies CSSProperties;
|
|
64
|
+
|
|
65
|
+
// The preview is set in the light ink of the tooltip it was drawn for, so it
|
|
66
|
+
// is given the dark plate that ink is legible on.
|
|
67
|
+
const PLATE_STYLE = {
|
|
68
|
+
padding: '8px 10px',
|
|
69
|
+
borderRadius: 'var(--radius)',
|
|
70
|
+
background: 'var(--text)',
|
|
71
|
+
overflow: 'auto',
|
|
72
|
+
} as const satisfies CSSProperties;
|
|
73
|
+
|
|
74
|
+
const DOI_STYLE = {
|
|
75
|
+
display: 'inline-block',
|
|
76
|
+
marginTop: 6,
|
|
77
|
+
color: 'var(--accent)',
|
|
78
|
+
fontSize: 12,
|
|
79
|
+
} as const satisfies CSSProperties;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { CreditsList } from '../../credits/ui/CreditsList.tsx';
|
|
4
|
+
import { Wordmark } from '../../ecosystem/ui/Wordmark.tsx';
|
|
5
|
+
import { SiteMark } from '../../ecosystem/ui/marks.tsx';
|
|
6
|
+
import type { AboutContent } from '../core/about.ts';
|
|
7
|
+
import { resolveAbout } from '../core/about.ts';
|
|
8
|
+
|
|
9
|
+
import { AboutCitations } from './AboutCitations.tsx';
|
|
10
|
+
import { AboutSection } from './AboutSection.tsx';
|
|
11
|
+
|
|
12
|
+
export interface AboutPageProps {
|
|
13
|
+
/** What the site says about itself. */
|
|
14
|
+
content: AboutContent;
|
|
15
|
+
/**
|
|
16
|
+
* Class the page carries, in addition to `about-page`.
|
|
17
|
+
* @default undefined
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The one section a site adds of its own — where its numbers come from, the
|
|
22
|
+
* limitation it wants named. It lands under the context paragraphs, so the
|
|
23
|
+
* credits, the citation and the licence keep the place a reader expects.
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The About page of a site of the family: what the tool is, what a visitor can
|
|
31
|
+
* do with it, what it is built on, how to cite it, and where to report a
|
|
32
|
+
* problem — always in that order.
|
|
33
|
+
*
|
|
34
|
+
* The order is the point. A reader who has read one of our About pages knows
|
|
35
|
+
* where the credits are on the other thirteen, and a site that writes its own
|
|
36
|
+
* page is a site that will forget one of these sections.
|
|
37
|
+
* @param props - See {@link AboutPageProps}.
|
|
38
|
+
* @returns The page.
|
|
39
|
+
* @throws {Error} When the record names a site or a credit that does not exist.
|
|
40
|
+
*/
|
|
41
|
+
export function AboutPage(props: AboutPageProps): ReactElement {
|
|
42
|
+
const { content, className, children } = props;
|
|
43
|
+
const about = resolveAbout(content);
|
|
44
|
+
const site = about.site;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
className={
|
|
49
|
+
className === undefined ? 'about-page' : `about-page ${className}`
|
|
50
|
+
}
|
|
51
|
+
style={PAGE_STYLE}
|
|
52
|
+
>
|
|
53
|
+
<header className="about-hero" style={HERO_STYLE}>
|
|
54
|
+
<SiteMark siteId={site.id} size={56} />
|
|
55
|
+
<div>
|
|
56
|
+
<h1 style={NAME_STYLE}>
|
|
57
|
+
<Wordmark siteId={site.id} size={26} />
|
|
58
|
+
</h1>
|
|
59
|
+
<p style={TAGLINE_STYLE}>{site.tagline}</p>
|
|
60
|
+
<p style={WHAT_STYLE}>{about.what}</p>
|
|
61
|
+
</div>
|
|
62
|
+
</header>
|
|
63
|
+
|
|
64
|
+
<AboutSection title="What you can do here" className="about-can">
|
|
65
|
+
<ul style={CAN_LIST_STYLE}>
|
|
66
|
+
{about.can.map((line) => (
|
|
67
|
+
<li key={line}>{line}</li>
|
|
68
|
+
))}
|
|
69
|
+
</ul>
|
|
70
|
+
</AboutSection>
|
|
71
|
+
|
|
72
|
+
{about.paragraphs.length === 0 ? null : (
|
|
73
|
+
<AboutSection className="about-context">
|
|
74
|
+
{about.paragraphs.map((paragraph, index) => (
|
|
75
|
+
<p
|
|
76
|
+
key={paragraph}
|
|
77
|
+
style={index === 0 ? FIRST_PARAGRAPH_STYLE : PARAGRAPH_STYLE}
|
|
78
|
+
>
|
|
79
|
+
{paragraph}
|
|
80
|
+
</p>
|
|
81
|
+
))}
|
|
82
|
+
</AboutSection>
|
|
83
|
+
)}
|
|
84
|
+
|
|
85
|
+
{children}
|
|
86
|
+
|
|
87
|
+
<AboutSection title="Built on" className="about-credits">
|
|
88
|
+
<CreditsList entries={about.credits} />
|
|
89
|
+
</AboutSection>
|
|
90
|
+
|
|
91
|
+
{about.cite.length === 0 ? null : (
|
|
92
|
+
<AboutSection title="How to cite" className="about-cite">
|
|
93
|
+
<AboutCitations works={about.cite} />
|
|
94
|
+
</AboutSection>
|
|
95
|
+
)}
|
|
96
|
+
|
|
97
|
+
<AboutSection title="Licence and source" className="about-licence">
|
|
98
|
+
<p style={FIRST_PARAGRAPH_STYLE}>
|
|
99
|
+
{about.license}, © cheminfo. Use it in a course, fork it, or lift a
|
|
100
|
+
piece of it into something else. The sources are at{' '}
|
|
101
|
+
<ExternalLink href={about.repository} />.
|
|
102
|
+
</p>
|
|
103
|
+
{about.version === undefined ? null : (
|
|
104
|
+
<p style={PARAGRAPH_STYLE}>
|
|
105
|
+
This page is running version {about.version}.
|
|
106
|
+
</p>
|
|
107
|
+
)}
|
|
108
|
+
</AboutSection>
|
|
109
|
+
|
|
110
|
+
<AboutSection title="Found a problem?" className="about-issues">
|
|
111
|
+
<p style={FIRST_PARAGRAPH_STYLE}>
|
|
112
|
+
Tell us: a report naming what you typed and what came back is the
|
|
113
|
+
fastest fix there is. <ExternalLink href={about.issues} />.
|
|
114
|
+
</p>
|
|
115
|
+
</AboutSection>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function ExternalLink(props: { href: string }): ReactElement {
|
|
121
|
+
const { href } = props;
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<a href={href} target="_blank" rel="noopener noreferrer" style={LINK_STYLE}>
|
|
125
|
+
{href.replace(/^https?:\/\//, '')}
|
|
126
|
+
</a>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const PAGE_STYLE = {
|
|
131
|
+
display: 'flex',
|
|
132
|
+
flexDirection: 'column',
|
|
133
|
+
maxWidth: 980,
|
|
134
|
+
// Centred, because the About is read on its own rather than beside a tool.
|
|
135
|
+
marginInline: 'auto',
|
|
136
|
+
gap: 10,
|
|
137
|
+
} as const satisfies CSSProperties;
|
|
138
|
+
|
|
139
|
+
const HERO_STYLE = {
|
|
140
|
+
display: 'flex',
|
|
141
|
+
alignItems: 'flex-start',
|
|
142
|
+
padding: 16,
|
|
143
|
+
border: '1px solid var(--border)',
|
|
144
|
+
borderRadius: 'var(--radius)',
|
|
145
|
+
background: 'var(--surface)',
|
|
146
|
+
gap: 16,
|
|
147
|
+
lineHeight: 1.55,
|
|
148
|
+
} as const satisfies CSSProperties;
|
|
149
|
+
|
|
150
|
+
const NAME_STYLE = {
|
|
151
|
+
margin: 0,
|
|
152
|
+
fontSize: 26,
|
|
153
|
+
fontWeight: 700,
|
|
154
|
+
} as const satisfies CSSProperties;
|
|
155
|
+
|
|
156
|
+
const TAGLINE_STYLE = {
|
|
157
|
+
margin: '2px 0 8px',
|
|
158
|
+
color: 'var(--text-muted)',
|
|
159
|
+
fontSize: 14,
|
|
160
|
+
} as const satisfies CSSProperties;
|
|
161
|
+
|
|
162
|
+
const WHAT_STYLE = { margin: 0 } as const satisfies CSSProperties;
|
|
163
|
+
|
|
164
|
+
const CAN_LIST_STYLE = {
|
|
165
|
+
margin: 0,
|
|
166
|
+
paddingLeft: 20,
|
|
167
|
+
} as const satisfies CSSProperties;
|
|
168
|
+
|
|
169
|
+
const FIRST_PARAGRAPH_STYLE = {
|
|
170
|
+
margin: 0,
|
|
171
|
+
} as const satisfies CSSProperties;
|
|
172
|
+
|
|
173
|
+
const PARAGRAPH_STYLE = {
|
|
174
|
+
margin: '8px 0 0',
|
|
175
|
+
} as const satisfies CSSProperties;
|
|
176
|
+
|
|
177
|
+
const LINK_STYLE = { color: 'var(--accent)' } as const satisfies CSSProperties;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AboutSectionProps {
|
|
4
|
+
/**
|
|
5
|
+
* What the section is called, written as its heading.
|
|
6
|
+
* @default undefined — the section carries no heading
|
|
7
|
+
*/
|
|
8
|
+
title?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Class the section carries, in addition to `about-section`.
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/** What the section holds. */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* One block of the About page: a heading and what sits under it, on the
|
|
20
|
+
* family's own surface rather than on a component library's card.
|
|
21
|
+
* @param props - See {@link AboutSectionProps}.
|
|
22
|
+
* @returns The section.
|
|
23
|
+
*/
|
|
24
|
+
export function AboutSection(props: AboutSectionProps): ReactElement {
|
|
25
|
+
const { title, className, children } = props;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<section
|
|
29
|
+
className={
|
|
30
|
+
className === undefined ? 'about-section' : `about-section ${className}`
|
|
31
|
+
}
|
|
32
|
+
style={SECTION_STYLE}
|
|
33
|
+
>
|
|
34
|
+
{title === undefined ? null : <h2 style={TITLE_STYLE}>{title}</h2>}
|
|
35
|
+
{children}
|
|
36
|
+
</section>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const SECTION_STYLE = {
|
|
41
|
+
padding: 16,
|
|
42
|
+
border: '1px solid var(--border)',
|
|
43
|
+
borderRadius: 'var(--radius)',
|
|
44
|
+
background: 'var(--surface)',
|
|
45
|
+
// An About page is printed as often as it is read, and a section split over
|
|
46
|
+
// two pages loses the heading that says what its list is.
|
|
47
|
+
breakInside: 'avoid',
|
|
48
|
+
lineHeight: 1.55,
|
|
49
|
+
} as const satisfies CSSProperties;
|
|
50
|
+
|
|
51
|
+
const TITLE_STYLE = {
|
|
52
|
+
margin: '0 0 8px',
|
|
53
|
+
color: 'var(--accent)',
|
|
54
|
+
fontSize: 16,
|
|
55
|
+
fontWeight: 600,
|
|
56
|
+
} as const satisfies CSSProperties;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { AboutCitationsProps } from './AboutCitations.tsx';
|
|
2
|
+
export { AboutCitations } from './AboutCitations.tsx';
|
|
3
|
+
export type { AboutPageProps } from './AboutPage.tsx';
|
|
4
|
+
export { AboutPage } from './AboutPage.tsx';
|
|
5
|
+
export type { AboutSectionProps } from './AboutSection.tsx';
|
|
6
|
+
export { AboutSection } from './AboutSection.tsx';
|
package/src/chrome/ui/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export type { NavItem } from './navItem.ts';
|
|
2
|
+
// A site drawing its own link needs the same reading of a click the shared nav
|
|
3
|
+
// items use: a middle click or a modified one belongs to the browser.
|
|
4
|
+
export { isModifiedClick } from './navItem.ts';
|
|
2
5
|
export type { NavLinkProps } from './NavLink.tsx';
|
|
3
6
|
export { NavLink } from './NavLink.tsx';
|
|
4
7
|
export type { NavMenuButtonProps } from './NavMenuButton.tsx';
|
|
@@ -19,7 +19,10 @@ const BASE_PRE_STYLE: CSSProperties = {
|
|
|
19
19
|
|
|
20
20
|
const TONE_STYLE: Record<CodeBlockTone, CSSProperties> = {
|
|
21
21
|
default: {},
|
|
22
|
-
muted: {
|
|
22
|
+
muted: {
|
|
23
|
+
background: 'var(--surface-sunken, #f6f7f9)',
|
|
24
|
+
border: '1px solid var(--border, #d3d8de)',
|
|
25
|
+
},
|
|
23
26
|
dark: {
|
|
24
27
|
background: '#1e293b',
|
|
25
28
|
border: '1px solid #1e293b',
|
package/src/core.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './about/core/index.ts';
|
|
1
2
|
export * from './citation/core/index.ts';
|
|
2
3
|
export * from './clipboard/core/index.ts';
|
|
3
4
|
export * from './color/core/index.ts';
|
|
@@ -12,4 +13,8 @@ export * from './periodic/core/index.ts';
|
|
|
12
13
|
export * from './router/core/index.ts';
|
|
13
14
|
export * from './seo/core/index.ts';
|
|
14
15
|
export * from './share/core/index.ts';
|
|
16
|
+
// The deck format and its navigation are framework-free, so a backend can read
|
|
17
|
+
// a manifest without loading React: `react-cheminfo/slides` is the player.
|
|
18
|
+
export * from './slides/core/index.ts';
|
|
19
|
+
export * from './tokens/core/index.ts';
|
|
15
20
|
export * from './worker/core/index.ts';
|
|
@@ -166,6 +166,48 @@ export const CREDITS = [
|
|
|
166
166
|
description: 'typesets the mathematics, from LaTeX to what you read.',
|
|
167
167
|
license: 'Apache-2.0',
|
|
168
168
|
},
|
|
169
|
+
{
|
|
170
|
+
id: 'lexical',
|
|
171
|
+
name: 'Lexical',
|
|
172
|
+
href: 'https://lexical.dev/',
|
|
173
|
+
description: 'the editor a written page is composed and stored in.',
|
|
174
|
+
license: 'MIT',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: 'katex',
|
|
178
|
+
name: 'KaTeX',
|
|
179
|
+
href: 'https://katex.org/',
|
|
180
|
+
description: 'typesets the mathematics inside a written page.',
|
|
181
|
+
license: 'MIT',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 'dnd-kit',
|
|
185
|
+
name: 'dnd kit',
|
|
186
|
+
href: 'https://dndkit.com/',
|
|
187
|
+
description: 'the dragging that arranges things into an order.',
|
|
188
|
+
license: 'MIT',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: 'preact-signals',
|
|
192
|
+
name: 'Preact Signals',
|
|
193
|
+
href: 'https://preactjs.com/guide/v10/signals/',
|
|
194
|
+
description: 'the state the pages read, without a store around it.',
|
|
195
|
+
license: 'MIT',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: 'fastify',
|
|
199
|
+
name: 'Fastify',
|
|
200
|
+
href: 'https://fastify.dev/',
|
|
201
|
+
description: 'the server that answers the API and serves the page.',
|
|
202
|
+
license: 'MIT',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: 'sqlite',
|
|
206
|
+
name: 'SQLite',
|
|
207
|
+
href: 'https://sqlite.org/',
|
|
208
|
+
description: 'the database, one file, read through the Node built-in.',
|
|
209
|
+
license: 'Public domain',
|
|
210
|
+
},
|
|
169
211
|
{
|
|
170
212
|
id: 'react',
|
|
171
213
|
name: 'React',
|
|
@@ -76,7 +76,7 @@ const ITEM_STYLE = {
|
|
|
76
76
|
const NAME_STYLE = { fontWeight: 600 } as const satisfies CSSProperties;
|
|
77
77
|
|
|
78
78
|
const LICENSE_STYLE = {
|
|
79
|
-
color: '#5f6b7c',
|
|
79
|
+
color: 'var(--text-muted, #5f6b7c)',
|
|
80
80
|
fontSize: 11,
|
|
81
81
|
margin: '0 6px',
|
|
82
82
|
} as const satisfies CSSProperties;
|