react-cheminfo 0.34.0 → 0.36.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 +28 -28
- package/bin/check-seo.mjs +333 -0
- package/lib/about/core/about.d.ts +1 -30
- package/lib/about/core/about.d.ts.map +1 -1
- package/lib/about/core/about.js +0 -16
- package/lib/about/core/about.js.map +1 -1
- package/lib/about/core/index.d.ts +0 -1
- package/lib/about/core/index.d.ts.map +1 -1
- package/lib/about/core/index.js +0 -1
- package/lib/about/core/index.js.map +1 -1
- package/lib/about/ui/AboutBuild.d.ts +2 -5
- package/lib/about/ui/AboutBuild.d.ts.map +1 -1
- package/lib/about/ui/AboutBuild.js +7 -19
- package/lib/about/ui/AboutBuild.js.map +1 -1
- package/lib/about/ui/AboutPage.d.ts +2 -2
- package/lib/about/ui/AboutPage.d.ts.map +1 -1
- package/lib/about/ui/AboutPage.js +3 -14
- package/lib/about/ui/AboutPage.js.map +1 -1
- package/lib/about/ui/AboutVersion.d.ts +0 -4
- package/lib/about/ui/AboutVersion.d.ts.map +1 -1
- package/lib/about/ui/AboutVersion.js +3 -31
- package/lib/about/ui/AboutVersion.js.map +1 -1
- package/lib/download/core/index.d.ts +0 -5
- package/lib/download/core/index.d.ts.map +1 -1
- package/lib/download/core/index.js +0 -3
- package/lib/download/core/index.js.map +1 -1
- package/lib/download/ui/FigureDownload.d.ts +4 -55
- package/lib/download/ui/FigureDownload.d.ts.map +1 -1
- package/lib/download/ui/FigureDownload.js +6 -66
- package/lib/download/ui/FigureDownload.js.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.d.ts +16 -2
- package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.js +11 -30
- package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
- package/lib/download/ui/figureDownloadHint.d.ts +30 -0
- package/lib/download/ui/figureDownloadHint.d.ts.map +1 -0
- package/lib/download/ui/figureDownloadHint.js +33 -0
- package/lib/download/ui/figureDownloadHint.js.map +1 -0
- package/lib/download/ui/index.d.ts +3 -10
- package/lib/download/ui/index.d.ts.map +1 -1
- package/lib/download/ui/index.js +1 -5
- package/lib/download/ui/index.js.map +1 -1
- package/lib/download/ui/useFigureActions.d.ts +50 -0
- package/lib/download/ui/useFigureActions.d.ts.map +1 -0
- package/lib/download/ui/useFigureActions.js +58 -0
- package/lib/download/ui/useFigureActions.js.map +1 -0
- package/lib/download/ui/useFigureDownload.d.ts +85 -0
- package/lib/download/ui/useFigureDownload.d.ts.map +1 -0
- package/lib/download/ui/useFigureDownload.js +75 -0
- package/lib/download/ui/useFigureDownload.js.map +1 -0
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +0 -40
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/types.d.ts +0 -10
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/ir/core/irCommands.d.ts +2 -2
- package/lib/ir/core/irCommands.js +2 -2
- package/lib/ir/core/irCommands.js.map +1 -1
- package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
- package/lib/ir/ui/IrAboutDialog.js +1 -1
- package/lib/ir/ui/IrAboutDialog.js.map +1 -1
- package/lib/ir/ui/IrCanvas.d.ts +6 -0
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
- package/lib/ir/ui/IrCanvas.js +2 -2
- package/lib/ir/ui/IrCanvas.js.map +1 -1
- package/lib/ir/ui/IrShell.d.ts.map +1 -1
- package/lib/ir/ui/IrShell.js +16 -11
- package/lib/ir/ui/IrShell.js.map +1 -1
- package/lib/ir/ui/IrToolbar.d.ts +11 -1
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
- package/lib/ir/ui/IrToolbar.js +12 -2
- package/lib/ir/ui/IrToolbar.js.map +1 -1
- package/lib/ir/ui/index.d.ts +1 -0
- package/lib/ir/ui/index.d.ts.map +1 -1
- package/lib/ir/ui/index.js.map +1 -1
- package/lib/language/core/index.d.ts +2 -0
- package/lib/language/core/index.d.ts.map +1 -1
- package/lib/language/core/index.js +1 -0
- package/lib/language/core/index.js.map +1 -1
- package/lib/language/core/languagePath.d.ts +52 -0
- package/lib/language/core/languagePath.d.ts.map +1 -0
- package/lib/language/core/languagePath.js +65 -0
- package/lib/language/core/languagePath.js.map +1 -0
- package/lib/locales/de.json +2 -4
- package/lib/locales/en.json +2 -4
- package/lib/locales/es.json +2 -4
- package/lib/locales/fr.json +2 -4
- package/lib/locales/it.json +2 -4
- package/lib/overlay/ui/OverlayPanel.d.ts +6 -0
- package/lib/overlay/ui/OverlayPanel.d.ts.map +1 -1
- package/lib/overlay/ui/OverlayPanel.js +2 -2
- package/lib/overlay/ui/OverlayPanel.js.map +1 -1
- package/lib/overlay/ui/overlayPanelStyles.d.ts +2 -1
- package/lib/overlay/ui/overlayPanelStyles.d.ts.map +1 -1
- package/lib/overlay/ui/overlayPanelStyles.js +3 -1
- package/lib/overlay/ui/overlayPanelStyles.js.map +1 -1
- package/lib/periodic/ui/ElementCell.d.ts +0 -6
- package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
- package/lib/periodic/ui/ElementCell.js +34 -30
- package/lib/periodic/ui/ElementCell.js.map +1 -1
- package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTable.js +12 -15
- package/lib/periodic/ui/PeriodicTable.js.map +1 -1
- package/lib/seo/core/alternates.d.ts +40 -0
- package/lib/seo/core/alternates.d.ts.map +1 -0
- package/lib/seo/core/alternates.js +42 -0
- package/lib/seo/core/alternates.js.map +1 -0
- package/lib/seo/core/index.d.ts +3 -0
- package/lib/seo/core/index.d.ts.map +1 -1
- package/lib/seo/core/index.js +2 -0
- package/lib/seo/core/index.js.map +1 -1
- package/lib/seo/core/noscript.d.ts +9 -0
- package/lib/seo/core/noscript.d.ts.map +1 -1
- package/lib/seo/core/noscript.js +7 -2
- package/lib/seo/core/noscript.js.map +1 -1
- package/lib/seo/core/pageMeta.d.ts +23 -0
- package/lib/seo/core/pageMeta.d.ts.map +1 -1
- package/lib/seo/core/pageMeta.js +52 -3
- package/lib/seo/core/pageMeta.js.map +1 -1
- package/lib/seo/core/pageProse.d.ts +76 -0
- package/lib/seo/core/pageProse.d.ts.map +1 -0
- package/lib/seo/core/pageProse.js +92 -0
- package/lib/seo/core/pageProse.js.map +1 -0
- package/lib/seo/core/routeProblems.d.ts +33 -0
- package/lib/seo/core/routeProblems.d.ts.map +1 -0
- package/lib/seo/core/routeProblems.js +89 -0
- package/lib/seo/core/routeProblems.js.map +1 -0
- package/lib/seo/core/routes.d.ts +14 -0
- package/lib/seo/core/routes.d.ts.map +1 -1
- package/lib/seo/core/routes.js.map +1 -1
- package/lib/seo/core/siteFiles.d.ts.map +1 -1
- package/lib/seo/core/siteFiles.js +2 -1
- package/lib/seo/core/siteFiles.js.map +1 -1
- package/lib/seo/vite/prerender.d.ts +13 -0
- package/lib/seo/vite/prerender.d.ts.map +1 -1
- package/lib/seo/vite/prerender.js +17 -10
- package/lib/seo/vite/prerender.js.map +1 -1
- package/package.json +2 -1
- package/src/about/core/about.ts +1 -51
- package/src/about/core/index.ts +0 -1
- package/src/about/ui/AboutBuild.tsx +8 -37
- package/src/about/ui/AboutPage.tsx +8 -64
- package/src/about/ui/AboutVersion.tsx +5 -45
- package/src/download/core/index.ts +0 -25
- package/src/download/ui/FigureDownload.tsx +11 -148
- package/src/download/ui/FigureDownloadPanel.tsx +46 -45
- package/src/download/ui/figureDownloadHint.ts +52 -0
- package/src/download/ui/index.ts +6 -10
- package/src/download/ui/useFigureActions.ts +113 -0
- package/src/download/ui/useFigureDownload.tsx +191 -0
- package/src/ecosystem/core/sites.ts +0 -40
- package/src/ecosystem/core/types.ts +0 -10
- package/src/ir/core/irCommands.ts +2 -2
- package/src/ir/ui/IrAboutDialog.tsx +0 -13
- package/src/ir/ui/IrCanvas.tsx +8 -2
- package/src/ir/ui/IrShell.tsx +23 -25
- package/src/ir/ui/IrToolbar.tsx +36 -6
- package/src/ir/ui/index.ts +1 -0
- package/src/language/core/index.ts +2 -0
- package/src/language/core/languagePath.ts +78 -0
- package/src/locales/de.json +2 -4
- package/src/locales/en.json +2 -4
- package/src/locales/es.json +2 -4
- package/src/locales/fr.json +2 -4
- package/src/locales/it.json +2 -4
- package/src/overlay/ui/OverlayPanel.tsx +8 -2
- package/src/overlay/ui/overlayPanelStyles.ts +3 -0
- package/src/periodic/ui/ElementCell.tsx +34 -37
- package/src/periodic/ui/PeriodicTable.tsx +12 -17
- package/src/seo/core/alternates.ts +65 -0
- package/src/seo/core/index.ts +3 -0
- package/src/seo/core/noscript.ts +18 -2
- package/src/seo/core/pageMeta.ts +74 -3
- package/src/seo/core/pageProse.ts +146 -0
- package/src/seo/core/routeProblems.ts +111 -0
- package/src/seo/core/routes.ts +14 -0
- package/src/seo/core/siteFiles.ts +2 -1
- package/src/seo/vite/prerender.ts +30 -11
- package/lib/about/core/repository.d.ts +0 -14
- package/lib/about/core/repository.d.ts.map +0 -1
- package/lib/about/core/repository.js +0 -21
- package/lib/about/core/repository.js.map +0 -1
- package/lib/download/core/exportStyles.d.ts +0 -22
- package/lib/download/core/exportStyles.d.ts.map +0 -1
- package/lib/download/core/exportStyles.js +0 -19
- package/lib/download/core/exportStyles.js.map +0 -1
- package/lib/download/core/imageResolution.d.ts +0 -88
- package/lib/download/core/imageResolution.d.ts.map +0 -1
- package/lib/download/core/imageResolution.js +0 -77
- package/lib/download/core/imageResolution.js.map +0 -1
- package/lib/download/core/pictureExport.d.ts +0 -93
- package/lib/download/core/pictureExport.d.ts.map +0 -1
- package/lib/download/core/pictureExport.js +0 -116
- package/lib/download/core/pictureExport.js.map +0 -1
- package/lib/download/ui/ExportDialogFrame.d.ts +0 -46
- package/lib/download/ui/ExportDialogFrame.d.ts.map +0 -1
- package/lib/download/ui/ExportDialogFrame.js +0 -24
- package/lib/download/ui/ExportDialogFrame.js.map +0 -1
- package/lib/download/ui/ExportImageDialog.d.ts +0 -47
- package/lib/download/ui/ExportImageDialog.d.ts.map +0 -1
- package/lib/download/ui/ExportImageDialog.js +0 -25
- package/lib/download/ui/ExportImageDialog.js.map +0 -1
- package/lib/download/ui/ExportNameField.d.ts +0 -29
- package/lib/download/ui/ExportNameField.d.ts.map +0 -1
- package/lib/download/ui/ExportNameField.js +0 -99
- package/lib/download/ui/ExportNameField.js.map +0 -1
- package/lib/download/ui/ExportPictureSection.d.ts +0 -38
- package/lib/download/ui/ExportPictureSection.d.ts.map +0 -1
- package/lib/download/ui/ExportPictureSection.js +0 -48
- package/lib/download/ui/ExportPictureSection.js.map +0 -1
- package/lib/download/ui/useDrawingBox.d.ts +0 -23
- package/lib/download/ui/useDrawingBox.d.ts.map +0 -1
- package/lib/download/ui/useDrawingBox.js +0 -21
- package/lib/download/ui/useDrawingBox.js.map +0 -1
- package/src/about/core/repository.ts +0 -22
- package/src/download/core/exportStyles.ts +0 -20
- package/src/download/core/imageResolution.ts +0 -118
- package/src/download/core/pictureExport.ts +0 -207
- package/src/download/ui/ExportDialogFrame.tsx +0 -86
- package/src/download/ui/ExportImageDialog.tsx +0 -91
- package/src/download/ui/ExportNameField.tsx +0 -148
- package/src/download/ui/ExportPictureSection.tsx +0 -142
- package/src/download/ui/useDrawingBox.ts +0 -37
package/README.md
CHANGED
|
@@ -85,34 +85,34 @@ through a wildcard subpath exactly as `react-science` serves its own.
|
|
|
85
85
|
|
|
86
86
|
## What is in it
|
|
87
87
|
|
|
88
|
-
| Area | `…/core`
|
|
89
|
-
| -------------------------- |
|
|
90
|
-
| **Site identity** | `siteById`, `findSiteByHost`, `siteTokensCss`
|
|
91
|
-
| **Chrome** | —
|
|
92
|
-
| **Languages** | `LANGUAGES`, `DEFAULT_LANGUAGE`, `LANGUAGE_LABELS`, `isLanguage`, `MessageCatalog`, `CHROME_CATALOG`, `setMessageSession`, `loadCatalogs`, `LANGUAGE_PARAM`, `withLanguageParam`
|
|
93
|
-
| **Citation** | `formatCitation`, `formatCitations`, `citationSegments`, `downloadCitation`, `citedReferences`, `doiUrl`
|
|
94
|
-
| **Share & embed** | `parseShareConfig`, `applyShareConfig`, `buildShareUrl`, `buildEmbedCode`, `isHidden`, `visibleShareParts`, `applySharePreset`, `findSharePreset`, the param codecs, `syncPreferencesWithUrl`, `applyPreferencesFromSearch`, `writePreferencesToSearch`
|
|
95
|
-
| **Routing & head** | `createTabRouter`, `readRoute`, `writeRoute`, `subscribeToRoute`, `adoptLegacyHashAddress`, `writeDocumentMeta`
|
|
96
|
-
| **Indexing** | `injectPageMeta`, `pageHeadTags`, `pageDocumentMeta`, `fill`, `PAGE_HEAD_MARKER`, `PAGE_BODY_MARKER`, `robotsTxt`, `sitemapXml`, `noscriptIndex`, `structuredDataScript`, `assertRoutes`, `routeFor`, `homeRoute`
|
|
97
|
-
| **Pedagogy** | `parseGlossaryMarkers`, `localStorageProgressStore`, `progressSummary`, `finishValidation`
|
|
98
|
-
| **Clipboard & files** | `writeToClipboard`, `downloadBlob`, `downloadText`, `sanitizeFileName`, `toDelimited`, `readDelimited`, `downloadFigure`, `figureSvg`, `figurePng`, `figureSize`
|
|
99
|
-
| **Formatting & colour** | `formatInteger`, `formatDecimal`, `formatBytes`, `pluralize`, `readableInk`, `contrastRatio`, `COLOR_SCALES`, `resolveColorScale`, `formatColorScale`, `colorAt`, `swatchAt`, `sampleScale`, `colorScaleGradient`, `rgbToHsv`
|
|
100
|
-
| **Number entry** | `readNumber`, `numberText`, `isPartialNumber`, `stepNumber`
|
|
101
|
-
| **Widgets** | `CREDITS`, `credits`
|
|
102
|
-
| **Hooks & state** | `createWorkerChannel`, `persistBucket`, `persistSignalBucket`
|
|
103
|
-
| **Chemistry** | `atomicOrbitalsOf`, `configurationOf`, `classifyMolfile`, `readStructure`, `toMolfileExport`
|
|
104
|
-
| **Conformers** | `generateConformers`, `continueConformers`, `refineConformers`, `conformerShape`, `isSameMinimum`, `rankByEnergy`, `minimiseConformer`, `DEFAULT_CONFORMER_OPTIONS`, `CONFORMER_STRATEGIES` (all `/conformers`); `GeometryRelaxer`, `readRelaxableGeometry`, `centredRmsd`
|
|
105
|
-
| **Spectrum charts** | `chartScale`, `chartAxisScale`, `plotRect`, `zoomDomain`, `zoomSelection`, `labelStackBaselines`, `layoutAnnotationBoxes`, `profilePath`, `stickPath`, `guidePlacement`, `readoutPlacement`, `stackCapacity`, `nextSpectrumColor`, `panelStyles`, `statusBar
|
|
106
|
-
| **Infrared** | `loadIrSpectra`, `toIrSpectrum`, `pickBands`, `assignBands`, `BAND_ASSIGNMENTS`, `irSpectrumToJcamp`, `IR_MODE_RULES`, `nearestBandAt`, `planBandLabels`, `irReducer` (all `/ir`)
|
|
107
|
-
| **Spectra** | `FILTER_CATALOG`, `filterMenu`, `settingsProblems`, `normalizationFilters`, `addFilter`, `moveFilter`, `setFilterOption`, `principalComponentChoices`, `clampPrincipalComponents`, `EMPTY_SETTINGS` (all `/spectra`)
|
|
108
|
-
| **About** | `resolveAbout`, `aboutProblems`
|
|
109
|
-
| **Which build is running** | `formatBuiltAt`, `shortCommit`, `BuildInfo`
|
|
110
|
-
| **Slideshows** | `parseTalk`, `splitDemoLinks`, `slideActionForKey`, `parseTalkOrigin`, `buildTalkManifest` (all `/slides`)
|
|
111
|
-
| **Token guard** | `findTokenViolations`
|
|
112
|
-
| **Figures** | `chartScale`, `chartAxisScale`, `chartAxisTitle`, `chartShare`, `chartColumnExtent`, `chartBinCounts`, `chartSeriesColor`, `rowMatrix`, `stackedMatrix`, `emptiestCorner`, `placeOverlayCard`, `overlayMetrics`
|
|
113
|
-
| **Projections** | `pcaResult`, `embeddingResult`, `projectionTabs`, `loadingProfiles`, `explainedShares`, `confidenceEllipse`, `projectEllipse`, `pointsInPolygon`, `resolveProjectionGroups`, `resolveProjectionShapes`, `PROJECTION_COPY`
|
|
114
|
-
| **Parallel coordinates** | `parallelAxisOf`, `parallelAxisLayouts`, `parallelIncludedMask`, `parallelKeptCount`, `parallelNearestRow`, `parallelSegmentAt`, `parallelBandAt`, `parallelRangeOf`, `parallelPalette`, `parallelColorSteps`, `paintParallelLines`
|
|
115
|
-
| **Periodic table** | `PERIODIC_ELEMENTS`, `elementBySymbol`, `elementByAtomicNumber`, `cellOf`, `placedElements`, `elementByArrowKey`, `EMPTY_BLOCK`, `categorySwatch`, `CATEGORY_LABELS`
|
|
88
|
+
| Area | `…/core` | `…/ui` |
|
|
89
|
+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
90
|
+
| **Site identity** | `siteById`, `findSiteByHost`, `siteTokensCss` | `SiteMark`, `Wordmark`, `SiteTheme`, `SiteTile`, `EcosystemButton`, `EcosystemLinks` |
|
|
91
|
+
| **Chrome** | — | `SiteHeader`, `SiteFooter`, `NavLink`, `NavMenuButton`, `MenuButton`, `AccountButton`, `useCompactHeader` |
|
|
92
|
+
| **Languages** | `LANGUAGES`, `DEFAULT_LANGUAGE`, `LANGUAGE_LABELS`, `isLanguage`, `MessageCatalog`, `CHROME_CATALOG`, `setMessageSession`, `loadCatalogs`, `LANGUAGE_PARAM`, `withLanguageParam` | `useT`, `useChromeT`, `useLanguage`, `LanguageSelect`, `SiteLanguage` |
|
|
93
|
+
| **Citation** | `formatCitation`, `formatCitations`, `citationSegments`, `downloadCitation`, `citedReferences`, `doiUrl` | `CiteButton`, `CitationMenu`, `CitationPreview` |
|
|
94
|
+
| **Share & embed** | `parseShareConfig`, `applyShareConfig`, `buildShareUrl`, `buildEmbedCode`, `isHidden`, `visibleShareParts`, `applySharePreset`, `findSharePreset`, the param codecs, `syncPreferencesWithUrl`, `applyPreferencesFromSearch`, `writePreferencesToSearch` | `ShareDialog`, `ShareButton`, `HiddenPartsProvider`, `PagePart`, `useIsHidden` |
|
|
95
|
+
| **Routing & head** | `createTabRouter`, `readRoute`, `writeRoute`, `subscribeToRoute`, `adoptLegacyHashAddress`, `writeDocumentMeta` | `useTabRoute` |
|
|
96
|
+
| **Indexing** | `injectPageMeta`, `pageHeadTags`, `pageDocumentMeta`, `fill`, `PAGE_HEAD_MARKER`, `PAGE_BODY_MARKER`, `robotsTxt`, `sitemapXml`, `noscriptIndex`, `structuredDataScript`, `assertRoutes`, `routeFor`, `homeRoute` | `cheminfoPrerender`, `ogCardHtml`, `OG_WIDTH`, `OG_HEIGHT` (all `/vite`) |
|
|
97
|
+
| **Pedagogy** | `parseGlossaryMarkers`, `localStorageProgressStore`, `progressSummary`, `finishValidation` | `GlossaryText`, `SyntaxTooltip`, `HintLadder`, `ExerciseActions`, `ExerciseProgressHeader`, `TutorialStepStrip`, `ReferenceGrid`, `TestCaseList` |
|
|
98
|
+
| **Clipboard & files** | `writeToClipboard`, `downloadBlob`, `downloadText`, `sanitizeFileName`, `toDelimited`, `readDelimited`, `downloadFigure`, `figureSvg`, `figurePng`, `figureSize` | `ClickToCopy`, `CopyButton`, `CopyableValue`, `CodeBlock`, `DelimitedTextDialog`, `FigureDownload` |
|
|
99
|
+
| **Formatting & colour** | `formatInteger`, `formatDecimal`, `formatBytes`, `pluralize`, `readableInk`, `contrastRatio`, `COLOR_SCALES`, `resolveColorScale`, `formatColorScale`, `colorAt`, `swatchAt`, `sampleScale`, `colorScaleGradient`, `rgbToHsv` | `ColorScaleLegend`, `ColorScaleSelect`, `ColorScaleEditor`, `ColorScaleBar` |
|
|
100
|
+
| **Number entry** | `readNumber`, `numberText`, `isPartialNumber`, `stepNumber` | `NumberInput` |
|
|
101
|
+
| **Widgets** | `CREDITS`, `credits` | `ErrorBoundary`, `CollapsibleSection`, `CapsuleFilter`, `HelpTooltip`, `CreditsList` |
|
|
102
|
+
| **Hooks & state** | `createWorkerChannel`, `persistBucket`, `persistSignalBucket` | `useDebouncedValue`, `useContainerSize`, `useListKeyboardNavigation`, `useDisclosure` |
|
|
103
|
+
| **Chemistry** | `atomicOrbitalsOf`, `configurationOf`, `classifyMolfile`, `readStructure`, `toMolfileExport` | `AtomicOrbitalViewer` (`/orbital`), `StructureEditor`, `Structure` (`/structure`) |
|
|
104
|
+
| **Conformers** | `generateConformers`, `continueConformers`, `refineConformers`, `conformerShape`, `isSameMinimum`, `rankByEnergy`, `minimiseConformer`, `DEFAULT_CONFORMER_OPTIONS`, `CONFORMER_STRATEGIES` (all `/conformers`); `GeometryRelaxer`, `readRelaxableGeometry`, `centredRmsd` | — |
|
|
105
|
+
| **Spectrum charts** | `chartScale`, `chartAxisScale`, `plotRect`, `zoomDomain`, `zoomSelection`, `labelStackBaselines`, `layoutAnnotationBoxes`, `profilePath`, `stickPath`, `guidePlacement`, `readoutPlacement`, `stackCapacity`, `nextSpectrumColor`, `panelStyles`, `statusBar` | `Axes`, `AxisGuide`, `ChartTracker`, `ChartStack`, `SelectionRect`, `TraceLegend`, `PlotCaption`, `useChartZoom`, `useChartPointer`, `useChartSize`, `SidePanelStack`, `PanelRail`, `Section`, `FilterInput`, `AboutDialogFrame`, `DocumentationDialogFrame`, `FigureDownload`, `useFigureDownload` |
|
|
106
|
+
| **Infrared** | `loadIrSpectra`, `toIrSpectrum`, `pickBands`, `assignBands`, `BAND_ASSIGNMENTS`, `irSpectrumToJcamp`, `IR_MODE_RULES`, `nearestBandAt`, `planBandLabels`, `irReducer` (all `/ir`) | `IrEditor`, `IrChart`, `BandsPanel`, `SpectraPanel`, `MetadataPanel`, `useIrEditor` (all `/ir`) |
|
|
107
|
+
| **Spectra** | `FILTER_CATALOG`, `filterMenu`, `settingsProblems`, `normalizationFilters`, `addFilter`, `moveFilter`, `setFilterOption`, `principalComponentChoices`, `clampPrincipalComponents`, `EMPTY_SETTINGS` (all `/spectra`) | `SpectraSettingsEditor`, `FilterChainEditor`, `PrincipalComponentSelect` (all `/spectra`) |
|
|
108
|
+
| **About** | `resolveAbout`, `aboutProblems` | `AboutPage` |
|
|
109
|
+
| **Which build is running** | `formatBuiltAt`, `shortCommit`, `BuildInfo` | `AboutBuild`, `cheminfoBuildInfo` (`/vite`) |
|
|
110
|
+
| **Slideshows** | `parseTalk`, `splitDemoLinks`, `slideActionForKey`, `parseTalkOrigin`, `buildTalkManifest` (all `/slides`) | `Slideshow`, `SlideView`, `TalkList`, `BackToSlides` (all `/slides`), `cheminfoTalks` (`/vite`) |
|
|
111
|
+
| **Token guard** | `findTokenViolations` | `cheminfo-check-tokens`, `cheminfo-check-messages`, `cheminfo-check-deploy` (the bins) |
|
|
112
|
+
| **Figures** | `chartScale`, `chartAxisScale`, `chartAxisTitle`, `chartShare`, `chartColumnExtent`, `chartBinCounts`, `chartSeriesColor`, `rowMatrix`, `stackedMatrix`, `emptiestCorner`, `placeOverlayCard`, `overlayMetrics` | `ChartFrame`, `ChartAxis`, `TrackedLineChart`, `OverlayBar`, `OverlaySelect`, `OverlaySegmented`, `OverlayToggle`, `OverlayNumber`, `OverlayLegend`, `OverlayCaption`, `OverlayReadout` |
|
|
113
|
+
| **Projections** | `pcaResult`, `embeddingResult`, `projectionTabs`, `loadingProfiles`, `explainedShares`, `confidenceEllipse`, `projectEllipse`, `pointsInPolygon`, `resolveProjectionGroups`, `resolveProjectionShapes`, `PROJECTION_COPY` | `PcaViewer`, `ProjectionViewer`, `ScatterPlot`, `ScatterMatrix` |
|
|
114
|
+
| **Parallel coordinates** | `parallelAxisOf`, `parallelAxisLayouts`, `parallelIncludedMask`, `parallelKeptCount`, `parallelNearestRow`, `parallelSegmentAt`, `parallelBandAt`, `parallelRangeOf`, `parallelPalette`, `parallelColorSteps`, `paintParallelLines` | `ParallelCoordinates` |
|
|
115
|
+
| **Periodic table** | `PERIODIC_ELEMENTS`, `elementBySymbol`, `elementByAtomicNumber`, `cellOf`, `placedElements`, `elementByArrowKey`, `EMPTY_BLOCK`, `categorySwatch`, `CATEGORY_LABELS` | `PeriodicTable`, `ElementCell`, `CategoryLegend` |
|
|
116
116
|
|
|
117
117
|
Everything in that table is exported from `./core`, `./ui`, `./slides`,
|
|
118
118
|
`./vite` or `./structure` and nothing else is: the sub-components a component is built
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* Report every page of a build a search engine cannot tell apart from the rest
|
|
4
|
+
* of the site: a missing or repeated title, a description outside the room a
|
|
5
|
+
* result gives it, an absent canonical, card or crawl path, a sitemap naming a
|
|
6
|
+
* page the build never wrote, and a social card pointing at a file that is not
|
|
7
|
+
* there.
|
|
8
|
+
*
|
|
9
|
+
* It reads the build rather than the route table, because the defects that
|
|
10
|
+
* actually cost us ranking were never in the prose — they were a site whose
|
|
11
|
+
* head injector was never wired, which writes one generic page for every
|
|
12
|
+
* address and looks entirely correct in the source. `routeProblems` from
|
|
13
|
+
* `react-cheminfo/core` checks the prose; this checks that it arrived.
|
|
14
|
+
*
|
|
15
|
+
* Wire it as an npm script, after the build:
|
|
16
|
+
* "check-seo": "node node_modules/react-cheminfo/bin/check-seo.mjs dist"
|
|
17
|
+
*
|
|
18
|
+
* Usage: check-seo.mjs [directory] [--quiet]
|
|
19
|
+
* directory the build output, `dist` when none is given
|
|
20
|
+
* --quiet say nothing when the build is clean
|
|
21
|
+
*
|
|
22
|
+
* A page carrying `<!--cheminfo:head-->` has its head written per request by a
|
|
23
|
+
* server, so its own tags are that server's business and are reported as
|
|
24
|
+
* deferred rather than missing. Everything the build still owns is checked.
|
|
25
|
+
*
|
|
26
|
+
* Exits 1 when anything is reported, 2 when it was called wrongly, 0 otherwise.
|
|
27
|
+
*/
|
|
28
|
+
import { readFileSync, readdirSync, statSync } from 'node:fs';
|
|
29
|
+
import { join, relative } from 'node:path';
|
|
30
|
+
import process from 'node:process';
|
|
31
|
+
|
|
32
|
+
import { PAGE_HEAD_MARKER, withheldPhrase } from '../lib/core.js';
|
|
33
|
+
|
|
34
|
+
import { countOf, usageError } from './cli.mjs';
|
|
35
|
+
|
|
36
|
+
const TOOL = 'check-seo';
|
|
37
|
+
const SKIPPED = new Set(['assets', 'node_modules']);
|
|
38
|
+
const DESCRIPTION_MIN = 110;
|
|
39
|
+
const DESCRIPTION_MAX = 160;
|
|
40
|
+
|
|
41
|
+
const roots = [];
|
|
42
|
+
let quiet = false;
|
|
43
|
+
|
|
44
|
+
for (const argument of process.argv.slice(2)) {
|
|
45
|
+
if (argument === '--quiet') {
|
|
46
|
+
quiet = true;
|
|
47
|
+
} else if (argument.startsWith('-')) {
|
|
48
|
+
process.exit(usageError(TOOL, `unknown option: ${argument}`));
|
|
49
|
+
} else {
|
|
50
|
+
roots.push(argument);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const root = roots[0] ?? 'dist';
|
|
54
|
+
if (roots.length > 1) {
|
|
55
|
+
process.exit(usageError(TOOL, 'one directory at a time'));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const stats = statSync(root, { throwIfNoEntry: false });
|
|
59
|
+
if (stats === undefined || !stats.isDirectory()) {
|
|
60
|
+
process.exit(usageError(TOOL, `no such build directory: ${root}`));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const pages = [];
|
|
64
|
+
collect(root, pages);
|
|
65
|
+
if (pages.length === 0) {
|
|
66
|
+
process.exit(usageError(TOOL, `no index.html under ${root}`));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const problems = [];
|
|
70
|
+
const deferred = [];
|
|
71
|
+
const excluded = [];
|
|
72
|
+
const titles = new Map();
|
|
73
|
+
const descriptions = new Map();
|
|
74
|
+
|
|
75
|
+
for (const page of pages) {
|
|
76
|
+
const html = readFileSync(page.file, 'utf8');
|
|
77
|
+
const at = page.address;
|
|
78
|
+
|
|
79
|
+
// A page that takes itself out of the index has nothing to be indexed under,
|
|
80
|
+
// and an admin site is right to do it. Saying its head is wrong would be
|
|
81
|
+
// reporting a decision as a defect.
|
|
82
|
+
if (/<meta\s+name="robots"\s+content="[^"]*noindex/i.test(html)) {
|
|
83
|
+
excluded.push(at);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (html.includes(PAGE_HEAD_MARKER)) {
|
|
88
|
+
deferred.push(at);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
checkHead(at, html);
|
|
92
|
+
|
|
93
|
+
if (!/<html[^>]*\slang="[^"]+"/i.test(html)) {
|
|
94
|
+
problems.push(`${at}: no lang on <html>.`);
|
|
95
|
+
}
|
|
96
|
+
if (!html.includes('application/ld+json')) {
|
|
97
|
+
problems.push(`${at}: no structured-data block.`);
|
|
98
|
+
}
|
|
99
|
+
if (!/<noscript[\s>]/i.test(html)) {
|
|
100
|
+
problems.push(
|
|
101
|
+
`${at}: no <noscript> crawl path — a crawler that does not render sees an empty page.`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
const keywords = tag(html, /<meta\s+name="keywords"\s+content="([^"]*)"/i);
|
|
105
|
+
if (keywords !== undefined) {
|
|
106
|
+
problems.push(
|
|
107
|
+
`${at}: a keywords meta tag — no search engine has read one since 2009.`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// A build whose every page defers its head is the shell of a site a server
|
|
113
|
+
// writes the head of: the sitemap it serves names addresses this build was
|
|
114
|
+
// never going to write, and the card, the structured data and the crawl path
|
|
115
|
+
// arrive with the page rather than with the file. There is nothing here to
|
|
116
|
+
// check, and checking it anyway would report a correct site as broken — that
|
|
117
|
+
// server's own route tests are what covers it.
|
|
118
|
+
const served = deferred.length + excluded.length === pages.length;
|
|
119
|
+
if (!served) checkSiteFiles();
|
|
120
|
+
|
|
121
|
+
let report = '';
|
|
122
|
+
for (const problem of problems) report += `${problem}\n`;
|
|
123
|
+
|
|
124
|
+
if (problems.length > 0) {
|
|
125
|
+
report += `${countOf(problems.length, 'problem')} in ${countOf(pages.length, 'page')}\n`;
|
|
126
|
+
process.stdout.write(report);
|
|
127
|
+
process.exit(1);
|
|
128
|
+
}
|
|
129
|
+
if (!quiet) {
|
|
130
|
+
if (served && deferred.length === 0) {
|
|
131
|
+
process.stdout.write(
|
|
132
|
+
`${countOf(pages.length, 'page')} answering noindex: deliberately out of the index\n`,
|
|
133
|
+
);
|
|
134
|
+
} else if (served) {
|
|
135
|
+
process.stdout.write(
|
|
136
|
+
`${countOf(pages.length, 'page')} writing its head per request: covered by the server's own route tests, not here\n`,
|
|
137
|
+
);
|
|
138
|
+
} else {
|
|
139
|
+
const note =
|
|
140
|
+
deferred.length === 0
|
|
141
|
+
? ''
|
|
142
|
+
: `, ${countOf(deferred.length, 'page')} writing its head per request`;
|
|
143
|
+
process.stdout.write(
|
|
144
|
+
`no indexing problem in ${countOf(pages.length, 'page')}${note}\n`,
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Check the tags a result, a card and a canonical are built from.
|
|
151
|
+
* @param {string} at - The address the page was written at.
|
|
152
|
+
* @param {string} html - The page.
|
|
153
|
+
*/
|
|
154
|
+
function checkHead(at, html) {
|
|
155
|
+
const title = tag(html, /<title>([\s\S]*?)<\/title>/i);
|
|
156
|
+
if (title === undefined || title.trim() === '') {
|
|
157
|
+
problems.push(`${at}: no title.`);
|
|
158
|
+
} else {
|
|
159
|
+
const first = titles.get(title);
|
|
160
|
+
if (first === undefined) titles.set(title, at);
|
|
161
|
+
else problems.push(`${at}: the title repeats the one at ${first}.`);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const description = tag(
|
|
165
|
+
html,
|
|
166
|
+
/<meta\s+name="description"\s+content="([^"]*)"/i,
|
|
167
|
+
);
|
|
168
|
+
if (description === undefined || description === '') {
|
|
169
|
+
problems.push(`${at}: no description.`);
|
|
170
|
+
} else {
|
|
171
|
+
if (description.length < DESCRIPTION_MIN) {
|
|
172
|
+
problems.push(
|
|
173
|
+
`${at}: the description is ${description.length} characters — at least ${DESCRIPTION_MIN}.`,
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
if (description.length > DESCRIPTION_MAX) {
|
|
177
|
+
problems.push(
|
|
178
|
+
`${at}: the description is ${description.length} characters — at most ${DESCRIPTION_MAX}.`,
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
const first = descriptions.get(description);
|
|
182
|
+
if (first === undefined) descriptions.set(description, at);
|
|
183
|
+
else problems.push(`${at}: the description repeats the one at ${first}.`);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const withheld =
|
|
187
|
+
withheldPhrase(title ?? '') ?? withheldPhrase(description ?? '');
|
|
188
|
+
if (withheld !== undefined) {
|
|
189
|
+
problems.push(
|
|
190
|
+
`${at}: the snippet says "${withheld}" — a site names no repository, tracker or licence of ours.`,
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const canonical = tag(html, /<link\s+rel="canonical"\s+href="([^"]*)"/i);
|
|
195
|
+
if (canonical === undefined) {
|
|
196
|
+
problems.push(`${at}: no canonical address.`);
|
|
197
|
+
} else if (canonical.includes('?')) {
|
|
198
|
+
problems.push(`${at}: the canonical carries a query string.`);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
for (const property of ['og:title', 'og:description', 'og:url']) {
|
|
202
|
+
const pattern = new RegExp(
|
|
203
|
+
String.raw`<meta\s+property="${property}"\s+content="[^"]`,
|
|
204
|
+
'i',
|
|
205
|
+
);
|
|
206
|
+
if (!pattern.test(html)) problems.push(`${at}: no ${property}.`);
|
|
207
|
+
}
|
|
208
|
+
if (!/<meta\s+name="twitter:card"/i.test(html)) {
|
|
209
|
+
problems.push(`${at}: no twitter:card, so a shared link unfurls bare.`);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const image = tag(html, /<meta\s+property="og:image"\s+content="([^"]*)"/i);
|
|
213
|
+
if (image === undefined) {
|
|
214
|
+
problems.push(`${at}: no og:image.`);
|
|
215
|
+
} else {
|
|
216
|
+
const own = ownPath(image);
|
|
217
|
+
if (own !== undefined && !exists(join(root, own))) {
|
|
218
|
+
problems.push(
|
|
219
|
+
`${at}: og:image names ${own}, which the build never wrote.`,
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** Check the two files a crawler asks for before it reads any page. */
|
|
226
|
+
function checkSiteFiles() {
|
|
227
|
+
const robots = join(root, 'robots.txt');
|
|
228
|
+
const sitemap = join(root, 'sitemap.xml');
|
|
229
|
+
|
|
230
|
+
if (!exists(robots)) {
|
|
231
|
+
problems.push('robots.txt: not in the build.');
|
|
232
|
+
} else {
|
|
233
|
+
const named = /^\s*Sitemap:\s*(\S+)\s*$/im.exec(
|
|
234
|
+
readFileSync(robots, 'utf8'),
|
|
235
|
+
);
|
|
236
|
+
if (named !== null && !exists(sitemap)) {
|
|
237
|
+
problems.push(
|
|
238
|
+
`robots.txt names ${named[1]}, which the build never wrote — a sitemap that answers 404 is reported on every fetch.`,
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (!exists(sitemap)) {
|
|
244
|
+
problems.push('sitemap.xml: not in the build.');
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const xml = readFileSync(sitemap, 'utf8');
|
|
248
|
+
const written = new Set(pages.map((page) => page.address));
|
|
249
|
+
const claimed = new Set();
|
|
250
|
+
let listed = 0;
|
|
251
|
+
for (const match of xml.matchAll(/<loc>([^<]+)<\/loc>/g)) {
|
|
252
|
+
listed++;
|
|
253
|
+
const own = ownPath(match[1] ?? '');
|
|
254
|
+
if (own !== undefined) claimed.add(own === '' ? '/' : own);
|
|
255
|
+
if (own !== undefined && !written.has(own === '' ? '/' : own)) {
|
|
256
|
+
problems.push(
|
|
257
|
+
`sitemap.xml lists ${match[1]}, which the build never wrote.`,
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (listed === 0) problems.push('sitemap.xml lists no address.');
|
|
262
|
+
|
|
263
|
+
// The other direction, which is the one that quietly costs traffic: a page
|
|
264
|
+
// the build wrote and the sitemap never named is a page nothing links a
|
|
265
|
+
// crawler to but the crawl path, and it is the long tail — an element, a
|
|
266
|
+
// space group, an exercise — that goes missing first.
|
|
267
|
+
for (const page of pages) {
|
|
268
|
+
if (deferred.includes(page.address) || excluded.includes(page.address)) {
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (!claimed.has(page.address)) {
|
|
272
|
+
problems.push(
|
|
273
|
+
`${page.address}: written by the build and named in no sitemap entry.`,
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* The part of an address this build is answerable for.
|
|
281
|
+
* @param {string} target - An absolute address, or a path.
|
|
282
|
+
* @returns {string | undefined} Its path, or `undefined` when it is somebody
|
|
283
|
+
* else's host.
|
|
284
|
+
*/
|
|
285
|
+
function ownPath(target) {
|
|
286
|
+
if (!URL.canParse(target)) {
|
|
287
|
+
return target.startsWith('/') ? trimSlash(target) : undefined;
|
|
288
|
+
}
|
|
289
|
+
return trimSlash(new URL(target).pathname);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @param {string} path - A path.
|
|
294
|
+
* @returns {string} The same path without its trailing slash, `/` kept.
|
|
295
|
+
*/
|
|
296
|
+
function trimSlash(path) {
|
|
297
|
+
return path.length > 1 && path.endsWith('/') ? path.slice(0, -1) : path;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* @param {string} html - The page.
|
|
302
|
+
* @param {RegExp} pattern - A pattern whose first group is the value.
|
|
303
|
+
* @returns {string | undefined} The value, or `undefined` when it is absent.
|
|
304
|
+
*/
|
|
305
|
+
function tag(html, pattern) {
|
|
306
|
+
return pattern.exec(html)?.[1];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* @param {string} path - A path.
|
|
311
|
+
* @returns {boolean} Whether anything is there.
|
|
312
|
+
*/
|
|
313
|
+
function exists(path) {
|
|
314
|
+
return statSync(path, { throwIfNoEntry: false }) !== undefined;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Add every built page under a path to the list, with the address it answers.
|
|
319
|
+
* @param {string} path - A directory of the build.
|
|
320
|
+
* @param {Array<{ file: string, address: string }>} pages - Collected so far.
|
|
321
|
+
*/
|
|
322
|
+
function collect(path, pages) {
|
|
323
|
+
for (const entry of readdirSync(path, { withFileTypes: true })) {
|
|
324
|
+
if (entry.name.startsWith('.') || SKIPPED.has(entry.name)) continue;
|
|
325
|
+
const next = join(path, entry.name);
|
|
326
|
+
if (entry.isDirectory()) {
|
|
327
|
+
collect(next, pages);
|
|
328
|
+
} else if (entry.name === 'index.html') {
|
|
329
|
+
const address = `/${relative(root, next).replace(/index\.html$/, '')}`;
|
|
330
|
+
pages.push({ file: next, address: trimSlash(address) });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
@@ -5,7 +5,7 @@ import type { SiteId, SiteRecord } from '../../ecosystem/core/sites.ts';
|
|
|
5
5
|
import type { ProviderEntry, ProviderId } from './providers.ts';
|
|
6
6
|
/**
|
|
7
7
|
* What a site says about itself: the one page a visitor opens to find out what
|
|
8
|
-
* the tool is,
|
|
8
|
+
* the tool is, who provides it, and what it stands on.
|
|
9
9
|
*
|
|
10
10
|
* Every field is content, never markup. A site writes this record and the page
|
|
11
11
|
* is drawn from it, which is what keeps fourteen About pages in one order and
|
|
@@ -48,35 +48,12 @@ export interface AboutContent {
|
|
|
48
48
|
* @default undefined
|
|
49
49
|
*/
|
|
50
50
|
providedBy?: readonly ProviderId[];
|
|
51
|
-
/**
|
|
52
|
-
* Licence the site itself is published under.
|
|
53
|
-
* @default 'MIT'
|
|
54
|
-
*/
|
|
55
|
-
license?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Where the sources live.
|
|
58
|
-
* @default the repository of the ECOSYSTEM_SITES record
|
|
59
|
-
*/
|
|
60
|
-
repository?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Whether a visitor can open that repository. A site naming a repository of
|
|
63
|
-
* its own says so here too, since the family's record then describes another
|
|
64
|
-
* one.
|
|
65
|
-
* @default the `publicRepository` of the ECOSYSTEM_SITES record
|
|
66
|
-
*/
|
|
67
|
-
publicRepository?: boolean;
|
|
68
51
|
/**
|
|
69
52
|
* Which build is running, from `react-cheminfo/build-info` — never written
|
|
70
53
|
* by hand, which is what keeps it true after the next release.
|
|
71
54
|
* @default undefined — the site's build does not publish one
|
|
72
55
|
*/
|
|
73
56
|
build?: BuildInfo;
|
|
74
|
-
/**
|
|
75
|
-
* Where a problem is reported: an address a visitor can actually open, so a
|
|
76
|
-
* site whose sources are private names one of its own or says nothing.
|
|
77
|
-
* @default the repository's /issues, and none at all when it is private
|
|
78
|
-
*/
|
|
79
|
-
issues?: string;
|
|
80
57
|
}
|
|
81
58
|
/** One person who made a site. */
|
|
82
59
|
export interface AboutPerson {
|
|
@@ -107,14 +84,8 @@ export interface ResolvedAbout {
|
|
|
107
84
|
people: readonly AboutPerson[];
|
|
108
85
|
/** The institutions providing the site, empty when the site names none. */
|
|
109
86
|
providedBy: ProviderEntry[];
|
|
110
|
-
license: string;
|
|
111
|
-
repository: string;
|
|
112
|
-
/** Whether a visitor can open the repository, and so whether it is named. */
|
|
113
|
-
publicRepository: boolean;
|
|
114
87
|
/** Which build is running, or `undefined` when the site does not say. */
|
|
115
88
|
build: BuildInfo | undefined;
|
|
116
|
-
/** Where a problem is reported, or `undefined` when there is nowhere open. */
|
|
117
|
-
issues: string | undefined;
|
|
118
89
|
}
|
|
119
90
|
/**
|
|
120
91
|
* Fill in what a site left to the family, and resolve what it named.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about.d.ts","sourceRoot":"","sources":["../../../src/about/core/about.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,E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,OAAO,EAAE,YAAY,GAAG,aAAa,CAgBjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CA8C7D"}
|
package/lib/about/core/about.js
CHANGED
|
@@ -13,8 +13,6 @@ export function resolveAbout(content) {
|
|
|
13
13
|
const site = typeof content.siteId === 'string'
|
|
14
14
|
? siteById(content.siteId)
|
|
15
15
|
: content.siteId;
|
|
16
|
-
const repository = content.repository ?? site.repository;
|
|
17
|
-
const publicRepository = content.publicRepository ?? site.publicRepository ?? false;
|
|
18
16
|
return {
|
|
19
17
|
site,
|
|
20
18
|
what: content.what,
|
|
@@ -24,16 +22,7 @@ export function resolveAbout(content) {
|
|
|
24
22
|
cite: content.cite ?? [],
|
|
25
23
|
people: content.people ?? [],
|
|
26
24
|
providedBy: providers(content.providedBy ?? []),
|
|
27
|
-
license: content.license ?? DEFAULT_LICENSE,
|
|
28
|
-
repository,
|
|
29
|
-
publicRepository,
|
|
30
25
|
build: content.build,
|
|
31
|
-
// A tracker behind a private repository answers 404 to every visitor, so
|
|
32
|
-
// a site that names none of its own asks for a report nowhere.
|
|
33
|
-
issues: content.issues ??
|
|
34
|
-
(publicRepository
|
|
35
|
-
? `${withoutTrailingSlash(repository)}/issues`
|
|
36
|
-
: undefined),
|
|
37
26
|
};
|
|
38
27
|
}
|
|
39
28
|
/**
|
|
@@ -76,15 +65,10 @@ export function aboutProblems(content) {
|
|
|
76
65
|
}
|
|
77
66
|
return problems;
|
|
78
67
|
}
|
|
79
|
-
/** What a site is published under unless it says otherwise. */
|
|
80
|
-
const DEFAULT_LICENSE = 'MIT';
|
|
81
68
|
const WHAT_LIMIT = 160;
|
|
82
69
|
const CAN_MIN = 3;
|
|
83
70
|
const CAN_MAX = 6;
|
|
84
71
|
const CAN_LINE_LIMIT = 90;
|
|
85
72
|
const PARAGRAPH_MAX = 2;
|
|
86
73
|
const PARAGRAPH_LIMIT = 400;
|
|
87
|
-
function withoutTrailingSlash(url) {
|
|
88
|
-
return url.endsWith('/') ? url.slice(0, -1) : url;
|
|
89
|
-
}
|
|
90
74
|
//# sourceMappingURL=about.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about.js","sourceRoot":"","sources":["../../../src/about/core/about.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"about.js","sourceRoot":"","sources":["../../../src/about/core/about.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAyF3C;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,OAAqB;IAChD,MAAM,IAAI,GACR,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ;QAChC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;QAC1B,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACrB,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QACjC,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;QAC5B,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;QAC/C,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;AACJ,CAAC;AAED;;;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AAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC1C,IAAI,SAAS,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;YACvC,QAAQ,CAAC,IAAI,CACX,aAAa,KAAK,GAAG,CAAC,OAAO,SAAS,CAAC,MAAM,wBAAwB,eAAe,+CAA+C,CACpI,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,QAAQ,CAAC,IAAI,CACX,2GAA2G,CAC5G,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,GAAG,GAAG,CAAC;AACvB,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,eAAe,GAAG,GAAG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/about/core/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/about/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/lib/about/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/about/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/about/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -3,17 +3,14 @@ import type { BuildInfo } from '../../build/core/buildInfo.ts';
|
|
|
3
3
|
export interface AboutBuildProps {
|
|
4
4
|
/** What the build published about itself. */
|
|
5
5
|
build: BuildInfo;
|
|
6
|
-
/** Where the sources live, which is what the version and commit link into. */
|
|
7
|
-
repository: string;
|
|
8
6
|
}
|
|
9
7
|
/**
|
|
10
8
|
* The one line that says when the build a visitor has open was made.
|
|
11
9
|
*
|
|
12
10
|
* A report of something going wrong is worth answering only when we know what
|
|
13
11
|
* was running. The version itself is in the hero, where a reader is asked to
|
|
14
|
-
* quote it from; this line carries the rest,
|
|
15
|
-
*
|
|
16
|
-
* that shows it.
|
|
12
|
+
* quote it from; this line carries the rest, so a report can name the exact
|
|
13
|
+
* build the problem was seen on.
|
|
17
14
|
* @param props - See {@link AboutBuildProps}.
|
|
18
15
|
* @returns The line.
|
|
19
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutBuild.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutBuild.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,
|
|
1
|
+
{"version":3,"file":"AboutBuild.d.ts","sourceRoot":"","sources":["../../../src/about/ui/AboutBuild.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAI/D,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAqB/D"}
|