react-cheminfo 0.25.0 → 0.27.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 +73 -2
- package/bin/check-deploy.mjs +14 -4
- package/bin/check-messages.mjs +229 -0
- package/lib/about/ui/AboutBuild.d.ts.map +1 -1
- package/lib/about/ui/AboutBuild.js +15 -4
- package/lib/about/ui/AboutBuild.js.map +1 -1
- package/lib/about/ui/AboutCitations.d.ts.map +1 -1
- package/lib/about/ui/AboutCitations.js +3 -1
- package/lib/about/ui/AboutCitations.js.map +1 -1
- package/lib/about/ui/AboutPage.d.ts.map +1 -1
- package/lib/about/ui/AboutPage.js +9 -1
- package/lib/about/ui/AboutPage.js.map +1 -1
- package/lib/about/ui/AboutProvidedBy.d.ts.map +1 -1
- package/lib/about/ui/AboutProvidedBy.js +8 -3
- package/lib/about/ui/AboutProvidedBy.js.map +1 -1
- package/lib/capsule/ui/Capsule.d.ts +30 -0
- package/lib/capsule/ui/Capsule.d.ts.map +1 -0
- package/lib/capsule/ui/Capsule.js +12 -0
- package/lib/capsule/ui/Capsule.js.map +1 -0
- package/lib/capsule/ui/CapsuleFilter.d.ts +19 -3
- package/lib/capsule/ui/CapsuleFilter.d.ts.map +1 -1
- package/lib/capsule/ui/CapsuleFilter.js +14 -44
- package/lib/capsule/ui/CapsuleFilter.js.map +1 -1
- package/lib/capsule/ui/capsuleFilterCapsules.d.ts +15 -0
- package/lib/capsule/ui/capsuleFilterCapsules.d.ts.map +1 -0
- package/lib/capsule/ui/capsuleFilterCapsules.js +47 -0
- package/lib/capsule/ui/capsuleFilterCapsules.js.map +1 -0
- package/lib/chart/ui/ChartTrackingLayer.d.ts.map +1 -1
- package/lib/chart/ui/ChartTrackingLayer.js +4 -2
- package/lib/chart/ui/ChartTrackingLayer.js.map +1 -1
- package/lib/chrome/ui/SiteHeader.d.ts +1 -1
- package/lib/chrome/ui/SiteHeader.d.ts.map +1 -1
- package/lib/chrome/ui/SiteHeader.js +4 -2
- package/lib/chrome/ui/SiteHeader.js.map +1 -1
- package/lib/citation/ui/CitationMenu.d.ts +1 -1
- package/lib/citation/ui/CitationMenu.d.ts.map +1 -1
- package/lib/citation/ui/CitationMenu.js +7 -3
- package/lib/citation/ui/CitationMenu.js.map +1 -1
- package/lib/citation/ui/CiteButton.d.ts +1 -1
- package/lib/citation/ui/CiteButton.d.ts.map +1 -1
- package/lib/citation/ui/CiteButton.js +3 -1
- package/lib/citation/ui/CiteButton.js.map +1 -1
- package/lib/citation/ui/CopyFormatEntries.d.ts.map +1 -1
- package/lib/citation/ui/CopyFormatEntries.js +3 -1
- package/lib/citation/ui/CopyFormatEntries.js.map +1 -1
- package/lib/citation/ui/WorkEntry.d.ts.map +1 -1
- package/lib/citation/ui/WorkEntry.js +3 -1
- package/lib/citation/ui/WorkEntry.js.map +1 -1
- package/lib/citation/ui/entries.d.ts.map +1 -1
- package/lib/citation/ui/entries.js +8 -2
- package/lib/citation/ui/entries.js.map +1 -1
- package/lib/citation/ui/useCopyFeedback.d.ts.map +1 -1
- package/lib/citation/ui/useCopyFeedback.js +9 -4
- package/lib/citation/ui/useCopyFeedback.js.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.d.ts.map +1 -1
- package/lib/clipboard/ui/ClickToCopy.js +12 -6
- package/lib/clipboard/ui/ClickToCopy.js.map +1 -1
- package/lib/clipboard/ui/CopyButton.d.ts +3 -3
- package/lib/clipboard/ui/CopyButton.d.ts.map +1 -1
- package/lib/clipboard/ui/CopyButton.js +7 -4
- package/lib/clipboard/ui/CopyButton.js.map +1 -1
- package/lib/color/ui/ColorScaleEditor.d.ts.map +1 -1
- package/lib/color/ui/ColorScaleEditor.js +15 -10
- package/lib/color/ui/ColorScaleEditor.js.map +1 -1
- package/lib/color/ui/ColorScaleEntry.d.ts.map +1 -1
- package/lib/color/ui/ColorScaleEntry.js +4 -2
- package/lib/color/ui/ColorScaleEntry.js.map +1 -1
- package/lib/color/ui/ColorScaleLegend.d.ts.map +1 -1
- package/lib/color/ui/ColorScaleLegend.js +7 -1
- package/lib/color/ui/ColorScaleLegend.js.map +1 -1
- package/lib/color/ui/ColorScaleSelect.d.ts.map +1 -1
- package/lib/color/ui/ColorScaleSelect.js +8 -4
- package/lib/color/ui/ColorScaleSelect.js.map +1 -1
- package/lib/confirm/ui/ConfirmButton.d.ts +2 -2
- package/lib/confirm/ui/ConfirmButton.d.ts.map +1 -1
- package/lib/confirm/ui/ConfirmButton.js +4 -2
- package/lib/confirm/ui/ConfirmButton.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/credits/ui/CreditsList.d.ts.map +1 -1
- package/lib/credits/ui/CreditsList.js +3 -1
- package/lib/credits/ui/CreditsList.js.map +1 -1
- package/lib/delimited/ui/DelimitedTextDialog.d.ts.map +1 -1
- package/lib/delimited/ui/DelimitedTextDialog.js +5 -2
- package/lib/delimited/ui/DelimitedTextDialog.js.map +1 -1
- package/lib/delimited/ui/DelimitedTextPanel.d.ts.map +1 -1
- package/lib/delimited/ui/DelimitedTextPanel.js +8 -8
- package/lib/delimited/ui/DelimitedTextPanel.js.map +1 -1
- package/lib/deploy/core/checkDeploy.d.ts +3 -1
- package/lib/deploy/core/checkDeploy.d.ts.map +1 -1
- package/lib/deploy/core/checkDeploy.js +7 -1
- package/lib/deploy/core/checkDeploy.js.map +1 -1
- package/lib/deploy/core/index.d.ts +1 -0
- package/lib/deploy/core/index.d.ts.map +1 -1
- package/lib/deploy/core/index.js +1 -0
- package/lib/deploy/core/index.js.map +1 -1
- package/lib/deploy/core/pageCache.d.ts +24 -0
- package/lib/deploy/core/pageCache.d.ts.map +1 -0
- package/lib/deploy/core/pageCache.js +91 -0
- package/lib/deploy/core/pageCache.js.map +1 -0
- package/lib/deploy/core/types.d.ts +1 -1
- package/lib/deploy/core/types.d.ts.map +1 -1
- package/lib/deploy/core/types.js.map +1 -1
- package/lib/download/ui/FigureDownload.d.ts +2 -2
- package/lib/download/ui/FigureDownload.d.ts.map +1 -1
- package/lib/download/ui/FigureDownload.js +4 -2
- package/lib/download/ui/FigureDownload.js.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
- package/lib/download/ui/FigureDownloadPanel.js +24 -18
- package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemButton.d.ts +1 -1
- package/lib/ecosystem/ui/EcosystemButton.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemButton.js +4 -2
- package/lib/ecosystem/ui/EcosystemButton.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.d.ts +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemLinks.js +5 -2
- package/lib/ecosystem/ui/EcosystemLinks.js.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.d.ts.map +1 -1
- package/lib/ecosystem/ui/EcosystemMenu.js +3 -1
- package/lib/ecosystem/ui/EcosystemMenu.js.map +1 -1
- package/lib/ecosystem/ui/SiteGroupSection.d.ts.map +1 -1
- package/lib/ecosystem/ui/SiteGroupSection.js +3 -1
- package/lib/ecosystem/ui/SiteGroupSection.js.map +1 -1
- package/lib/ecosystem/ui/SiteTile.d.ts.map +1 -1
- package/lib/ecosystem/ui/SiteTile.js +3 -1
- package/lib/ecosystem/ui/SiteTile.js.map +1 -1
- package/lib/error/ui/ErrorFallback.d.ts +2 -2
- package/lib/error/ui/ErrorFallback.d.ts.map +1 -1
- package/lib/error/ui/ErrorFallback.js +4 -2
- package/lib/error/ui/ErrorFallback.js.map +1 -1
- package/lib/help/ui/HelpBody.d.ts.map +1 -1
- package/lib/help/ui/HelpBody.js +3 -1
- package/lib/help/ui/HelpBody.js.map +1 -1
- package/lib/help/ui/HelpIcon.d.ts +2 -1
- package/lib/help/ui/HelpIcon.d.ts.map +1 -1
- package/lib/help/ui/HelpIcon.js +4 -2
- package/lib/help/ui/HelpIcon.js.map +1 -1
- package/lib/help/ui/HelpToolbarButton.d.ts.map +1 -1
- package/lib/help/ui/HelpToolbarButton.js +3 -1
- package/lib/help/ui/HelpToolbarButton.js.map +1 -1
- package/lib/help/ui/helpName.d.ts +5 -1
- package/lib/help/ui/helpName.d.ts.map +1 -1
- package/lib/help/ui/helpName.js +4 -2
- package/lib/help/ui/helpName.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +21 -0
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -0
- package/lib/i18n/core/chromeCatalog.js +29 -0
- package/lib/i18n/core/chromeCatalog.js.map +1 -0
- package/lib/i18n/core/index.d.ts +12 -0
- package/lib/i18n/core/index.d.ts.map +1 -0
- package/lib/i18n/core/index.js +6 -0
- package/lib/i18n/core/index.js.map +1 -0
- package/lib/i18n/core/languages.d.ts +32 -0
- package/lib/i18n/core/languages.d.ts.map +1 -0
- package/lib/i18n/core/languages.js +41 -0
- package/lib/i18n/core/languages.js.map +1 -0
- package/lib/i18n/core/messageCatalog.d.ts +113 -0
- package/lib/i18n/core/messageCatalog.d.ts.map +1 -0
- package/lib/i18n/core/messageCatalog.js +135 -0
- package/lib/i18n/core/messageCatalog.js.map +1 -0
- package/lib/i18n/core/messageValues.d.ts +3 -0
- package/lib/i18n/core/messageValues.d.ts.map +1 -0
- package/lib/i18n/core/messageValues.js +2 -0
- package/lib/i18n/core/messageValues.js.map +1 -0
- package/lib/i18n/core/session.d.ts +51 -0
- package/lib/i18n/core/session.d.ts.map +1 -0
- package/lib/i18n/core/session.js +64 -0
- package/lib/i18n/core/session.js.map +1 -0
- package/lib/i18n/core/translateSetup.d.ts +28 -0
- package/lib/i18n/core/translateSetup.d.ts.map +1 -0
- package/lib/i18n/core/translateSetup.js +30 -0
- package/lib/i18n/core/translateSetup.js.map +1 -0
- package/lib/i18n/ui/LanguageSelect.d.ts +37 -0
- package/lib/i18n/ui/LanguageSelect.d.ts.map +1 -0
- package/lib/i18n/ui/LanguageSelect.js +27 -0
- package/lib/i18n/ui/LanguageSelect.js.map +1 -0
- package/lib/i18n/ui/index.d.ts +6 -0
- package/lib/i18n/ui/index.d.ts.map +1 -0
- package/lib/i18n/ui/index.js +4 -0
- package/lib/i18n/ui/index.js.map +1 -0
- package/lib/i18n/ui/useLanguage.d.ts +23 -0
- package/lib/i18n/ui/useLanguage.d.ts.map +1 -0
- package/lib/i18n/ui/useLanguage.js +36 -0
- package/lib/i18n/ui/useLanguage.js.map +1 -0
- package/lib/i18n/ui/useT.d.ts +47 -0
- package/lib/i18n/ui/useT.d.ts.map +1 -0
- package/lib/i18n/ui/useT.js +51 -0
- package/lib/i18n/ui/useT.js.map +1 -0
- package/lib/locales/de.json +442 -0
- package/lib/locales/en.json +442 -0
- package/lib/locales/es.json +442 -0
- package/lib/locales/fr.json +442 -0
- package/lib/molecule3d/core/gestures.d.ts +10 -0
- package/lib/molecule3d/core/gestures.d.ts.map +1 -1
- package/lib/molecule3d/core/gestures.js +39 -7
- package/lib/molecule3d/core/gestures.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DExport.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DExport.js +3 -1
- package/lib/molecule3d/ui/Molecule3DExport.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DHelp.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DHelp.js +7 -2
- package/lib/molecule3d/ui/Molecule3DHelp.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DOptions.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DOptions.js +9 -9
- package/lib/molecule3d/ui/Molecule3DOptions.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DSurfaceColors.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DSurfaceColors.js +8 -8
- package/lib/molecule3d/ui/Molecule3DSurfaceColors.js.map +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.d.ts.map +1 -1
- package/lib/molecule3d/ui/Molecule3DToolbar.js +15 -10
- package/lib/molecule3d/ui/Molecule3DToolbar.js.map +1 -1
- package/lib/molecule3d/ui/MoleculeViewer3D.d.ts.map +1 -1
- package/lib/molecule3d/ui/MoleculeViewer3D.js +6 -3
- package/lib/molecule3d/ui/MoleculeViewer3D.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.js +3 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalControls.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalControls.js +12 -15
- package/lib/orbital/ui/AtomicOrbitalControls.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.js +6 -3
- package/lib/orbital/ui/AtomicOrbitalViewer.js.map +1 -1
- package/lib/orbital/ui/capability.d.ts +4 -0
- package/lib/orbital/ui/capability.d.ts.map +1 -1
- package/lib/orbital/ui/capability.js +4 -0
- package/lib/orbital/ui/capability.js.map +1 -1
- package/lib/overlay/ui/OverlayBar.d.ts +1 -1
- package/lib/overlay/ui/OverlayBar.d.ts.map +1 -1
- package/lib/overlay/ui/OverlayBar.js +6 -3
- package/lib/overlay/ui/OverlayBar.js.map +1 -1
- package/lib/overlay/ui/OverlayInfo.d.ts +1 -1
- package/lib/overlay/ui/OverlayInfo.d.ts.map +1 -1
- package/lib/overlay/ui/OverlayInfo.js +5 -2
- package/lib/overlay/ui/OverlayInfo.js.map +1 -1
- package/lib/overlay/ui/OverlayPanel.d.ts +9 -2
- package/lib/overlay/ui/OverlayPanel.d.ts.map +1 -1
- package/lib/overlay/ui/OverlayPanel.js +5 -11
- package/lib/overlay/ui/OverlayPanel.js.map +1 -1
- package/lib/overlay/ui/OverlayReadout.d.ts.map +1 -1
- package/lib/overlay/ui/OverlayReadout.js +3 -1
- package/lib/overlay/ui/OverlayReadout.js.map +1 -1
- package/lib/pedagogy/ui/ExerciseActions.d.ts +1 -1
- package/lib/pedagogy/ui/ExerciseActions.d.ts.map +1 -1
- package/lib/pedagogy/ui/ExerciseActions.js +9 -2
- package/lib/pedagogy/ui/ExerciseActions.js.map +1 -1
- package/lib/pedagogy/ui/ExerciseProgressHeader.d.ts +1 -1
- package/lib/pedagogy/ui/ExerciseProgressHeader.d.ts.map +1 -1
- package/lib/pedagogy/ui/ExerciseProgressHeader.js +9 -5
- package/lib/pedagogy/ui/ExerciseProgressHeader.js.map +1 -1
- package/lib/pedagogy/ui/GlossaryIndex.d.ts +1 -1
- package/lib/pedagogy/ui/GlossaryIndex.d.ts.map +1 -1
- package/lib/pedagogy/ui/GlossaryIndex.js +6 -8
- package/lib/pedagogy/ui/GlossaryIndex.js.map +1 -1
- package/lib/pedagogy/ui/HintLadder.d.ts +2 -2
- package/lib/pedagogy/ui/HintLadder.d.ts.map +1 -1
- package/lib/pedagogy/ui/HintLadder.js +8 -2
- package/lib/pedagogy/ui/HintLadder.js.map +1 -1
- package/lib/pedagogy/ui/SyntaxTooltip.d.ts +4 -4
- package/lib/pedagogy/ui/SyntaxTooltip.d.ts.map +1 -1
- package/lib/pedagogy/ui/SyntaxTooltip.js +4 -2
- package/lib/pedagogy/ui/SyntaxTooltip.js.map +1 -1
- package/lib/pedagogy/ui/TutorialStepStrip.d.ts.map +1 -1
- package/lib/pedagogy/ui/TutorialStepStrip.js +7 -2
- package/lib/pedagogy/ui/TutorialStepStrip.js.map +1 -1
- package/lib/periodic/ui/CategoryLegend.d.ts.map +1 -1
- package/lib/periodic/ui/CategoryLegend.js +3 -1
- package/lib/periodic/ui/CategoryLegend.js.map +1 -1
- package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
- package/lib/periodic/ui/ElementCell.js +7 -1
- 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 +3 -1
- package/lib/periodic/ui/PeriodicTable.js.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.js +4 -2
- package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -1
- package/lib/share/ui/ShareButton.d.ts +2 -2
- package/lib/share/ui/ShareButton.d.ts.map +1 -1
- package/lib/share/ui/ShareButton.js +5 -2
- package/lib/share/ui/ShareButton.js.map +1 -1
- package/lib/share/ui/ShareConfigOptions.d.ts.map +1 -1
- package/lib/share/ui/ShareConfigOptions.js +4 -2
- package/lib/share/ui/ShareConfigOptions.js.map +1 -1
- package/lib/share/ui/ShareDialog.d.ts.map +1 -1
- package/lib/share/ui/ShareDialog.js +3 -1
- package/lib/share/ui/ShareDialog.js.map +1 -1
- package/lib/share/ui/ShareDialogContent.d.ts.map +1 -1
- package/lib/share/ui/ShareDialogContent.js +10 -1
- package/lib/share/ui/ShareDialogContent.js.map +1 -1
- package/lib/share/ui/SharePresetTabs.d.ts.map +1 -1
- package/lib/share/ui/SharePresetTabs.js +3 -1
- package/lib/share/ui/SharePresetTabs.js.map +1 -1
- package/lib/slides/ui/BackToSlides.d.ts.map +1 -1
- package/lib/slides/ui/BackToSlides.js +4 -2
- package/lib/slides/ui/BackToSlides.js.map +1 -1
- package/lib/slides/ui/EmbedSlide.d.ts.map +1 -1
- package/lib/slides/ui/EmbedSlide.js +3 -1
- package/lib/slides/ui/EmbedSlide.js.map +1 -1
- package/lib/slides/ui/Slide.d.ts.map +1 -1
- package/lib/slides/ui/Slide.js +3 -1
- package/lib/slides/ui/Slide.js.map +1 -1
- package/lib/slides/ui/SlideshowBar.d.ts.map +1 -1
- package/lib/slides/ui/SlideshowBar.js +5 -3
- package/lib/slides/ui/SlideshowBar.js.map +1 -1
- package/lib/slides/ui/TalkList.d.ts +1 -1
- package/lib/slides/ui/TalkList.d.ts.map +1 -1
- package/lib/slides/ui/TalkList.js +4 -2
- package/lib/slides/ui/TalkList.js.map +1 -1
- package/lib/structure/core/editorGuide.d.ts +14 -0
- package/lib/structure/core/editorGuide.d.ts.map +1 -1
- package/lib/structure/core/editorGuide.js +117 -19
- package/lib/structure/core/editorGuide.js.map +1 -1
- package/lib/structure/core/editorToolbar.d.ts +3 -1
- package/lib/structure/core/editorToolbar.d.ts.map +1 -1
- package/lib/structure/core/editorToolbar.js +44 -23
- package/lib/structure/core/editorToolbar.js.map +1 -1
- package/lib/structure/ui/EditorHelpButton.d.ts.map +1 -1
- package/lib/structure/ui/EditorHelpButton.js +3 -2
- package/lib/structure/ui/EditorHelpButton.js.map +1 -1
- package/lib/structure/ui/StructureEditor.d.ts.map +1 -1
- package/lib/structure/ui/StructureEditor.js +3 -1
- package/lib/structure/ui/StructureEditor.js.map +1 -1
- package/lib/structure/ui/StructureEditorHelp.d.ts.map +1 -1
- package/lib/structure/ui/StructureEditorHelp.js +12 -3
- package/lib/structure/ui/StructureEditorHelp.js.map +1 -1
- package/lib/structure/ui/ToolbarTooltip.d.ts.map +1 -1
- package/lib/structure/ui/ToolbarTooltip.js +5 -3
- package/lib/structure/ui/ToolbarTooltip.js.map +1 -1
- 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 +4 -2
- package/src/about/ui/AboutBuild.tsx +23 -16
- package/src/about/ui/AboutCitations.tsx +3 -1
- package/src/about/ui/AboutPage.tsx +38 -12
- package/src/about/ui/AboutProvidedBy.tsx +13 -3
- package/src/capsule/ui/Capsule.tsx +48 -0
- package/src/capsule/ui/CapsuleFilter.tsx +38 -114
- package/src/capsule/ui/capsuleFilterCapsules.tsx +110 -0
- package/src/chart/ui/ChartTrackingLayer.tsx +4 -2
- package/src/chrome/ui/SiteHeader.tsx +5 -3
- package/src/citation/ui/CitationMenu.tsx +9 -5
- package/src/citation/ui/CiteButton.tsx +4 -2
- package/src/citation/ui/CopyFormatEntries.tsx +3 -1
- package/src/citation/ui/WorkEntry.tsx +5 -3
- package/src/citation/ui/entries.tsx +9 -2
- package/src/citation/ui/useCopyFeedback.ts +11 -4
- package/src/clipboard/ui/ClickToCopy.tsx +15 -5
- package/src/clipboard/ui/CopyButton.tsx +14 -10
- package/src/color/ui/ColorScaleEditor.tsx +17 -15
- package/src/color/ui/ColorScaleEntry.tsx +7 -3
- package/src/color/ui/ColorScaleLegend.tsx +7 -1
- package/src/color/ui/ColorScaleSelect.tsx +12 -6
- package/src/confirm/ui/ConfirmButton.tsx +9 -11
- package/src/core.ts +1 -0
- package/src/credits/ui/CreditsList.tsx +5 -1
- package/src/delimited/ui/DelimitedTextDialog.tsx +10 -10
- package/src/delimited/ui/DelimitedTextPanel.tsx +19 -12
- package/src/deploy/core/checkDeploy.ts +7 -1
- package/src/deploy/core/index.ts +1 -0
- package/src/deploy/core/pageCache.ts +120 -0
- package/src/deploy/core/types.ts +2 -1
- package/src/download/ui/FigureDownload.tsx +7 -5
- package/src/download/ui/FigureDownloadPanel.tsx +31 -25
- package/src/ecosystem/ui/EcosystemButton.tsx +5 -3
- package/src/ecosystem/ui/EcosystemLinks.tsx +10 -10
- package/src/ecosystem/ui/EcosystemMenu.tsx +3 -1
- package/src/ecosystem/ui/SiteGroupSection.tsx +6 -2
- package/src/ecosystem/ui/SiteTile.tsx +6 -2
- package/src/error/ui/ErrorFallback.tsx +13 -12
- package/src/help/ui/HelpBody.tsx +4 -2
- package/src/help/ui/HelpIcon.tsx +6 -3
- package/src/help/ui/HelpToolbarButton.tsx +4 -1
- package/src/help/ui/helpName.ts +10 -2
- package/src/i18n/core/chromeCatalog.ts +35 -0
- package/src/i18n/core/index.ts +26 -0
- package/src/i18n/core/languages.ts +46 -0
- package/src/i18n/core/messageCatalog.ts +202 -0
- package/src/i18n/core/messageValues.ts +2 -0
- package/src/i18n/core/session.ts +82 -0
- package/src/i18n/core/translateSetup.ts +47 -0
- package/src/i18n/ui/LanguageSelect.tsx +72 -0
- package/src/i18n/ui/index.ts +9 -0
- package/src/i18n/ui/useLanguage.ts +48 -0
- package/src/i18n/ui/useT.ts +90 -0
- package/src/locales/de.json +442 -0
- package/src/locales/en.json +442 -0
- package/src/locales/es.json +442 -0
- package/src/locales/fr.json +442 -0
- package/src/molecule3d/core/gestures.ts +44 -7
- package/src/molecule3d/ui/Molecule3DExport.tsx +3 -1
- package/src/molecule3d/ui/Molecule3DHelp.tsx +17 -6
- package/src/molecule3d/ui/Molecule3DOptions.tsx +13 -13
- package/src/molecule3d/ui/Molecule3DSurfaceColors.tsx +16 -13
- package/src/molecule3d/ui/Molecule3DToolbar.tsx +29 -18
- package/src/molecule3d/ui/MoleculeViewer3D.tsx +13 -8
- package/src/orbital/ui/AtomicOrbitalCanvas.tsx +3 -1
- package/src/orbital/ui/AtomicOrbitalControls.tsx +15 -20
- package/src/orbital/ui/AtomicOrbitalViewer.tsx +13 -13
- package/src/orbital/ui/capability.ts +10 -0
- package/src/overlay/ui/OverlayBar.tsx +7 -4
- package/src/overlay/ui/OverlayInfo.tsx +6 -3
- package/src/overlay/ui/OverlayPanel.tsx +10 -7
- package/src/overlay/ui/OverlayReadout.tsx +3 -1
- package/src/pedagogy/ui/ExerciseActions.tsx +16 -6
- package/src/pedagogy/ui/ExerciseProgressHeader.tsx +13 -11
- package/src/pedagogy/ui/GlossaryIndex.tsx +11 -12
- package/src/pedagogy/ui/HintLadder.tsx +15 -12
- package/src/pedagogy/ui/SyntaxTooltip.tsx +9 -7
- package/src/pedagogy/ui/TutorialStepStrip.tsx +8 -3
- package/src/periodic/ui/CategoryLegend.tsx +6 -1
- package/src/periodic/ui/ElementCell.tsx +7 -1
- package/src/periodic/ui/PeriodicTable.tsx +3 -1
- package/src/periodic/ui/PeriodicTableChrome.tsx +4 -2
- package/src/share/ui/ShareButton.tsx +8 -5
- package/src/share/ui/ShareConfigOptions.tsx +6 -7
- package/src/share/ui/ShareDialog.tsx +3 -1
- package/src/share/ui/ShareDialogContent.tsx +20 -10
- package/src/share/ui/SharePresetTabs.tsx +3 -1
- package/src/slides/ui/BackToSlides.tsx +4 -2
- package/src/slides/ui/EmbedSlide.tsx +3 -3
- package/src/slides/ui/Slide.tsx +3 -1
- package/src/slides/ui/SlideshowBar.tsx +12 -4
- package/src/slides/ui/TalkList.tsx +8 -10
- package/src/structure/core/editorGuide.ts +126 -19
- package/src/structure/core/editorToolbar.ts +52 -24
- package/src/structure/ui/EditorHelpButton.tsx +9 -4
- package/src/structure/ui/StructureEditor.tsx +7 -1
- package/src/structure/ui/StructureEditorHelp.tsx +34 -11
- package/src/structure/ui/ToolbarTooltip.tsx +8 -4
- package/src/ui.ts +1 -0
package/src/deploy/core/types.ts
CHANGED
|
@@ -9,7 +9,8 @@ export type DeployProblemKind =
|
|
|
9
9
|
| 'floating-sidecar'
|
|
10
10
|
| 'missing-healthcheck'
|
|
11
11
|
| 'missing-env-example'
|
|
12
|
-
| 'missing-deploy-ignore'
|
|
12
|
+
| 'missing-deploy-ignore'
|
|
13
|
+
| 'cacheable-page';
|
|
13
14
|
|
|
14
15
|
/** One way a repository would fail, or silently mis-deploy, on the server. */
|
|
15
16
|
export interface DeployProblem {
|
|
@@ -3,6 +3,7 @@ import { PopoverNext } from '@blueprintjs/core';
|
|
|
3
3
|
import type { ReactElement } from 'react';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
|
|
6
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
6
7
|
import { OverlayIconButton } from '../../overlay/ui/OverlayIconButton.tsx';
|
|
7
8
|
import type { FigureFormat } from '../core/downloadFigure.ts';
|
|
8
9
|
import { downloadFigure } from '../core/downloadFigure.ts';
|
|
@@ -50,12 +51,12 @@ export interface FigureDownloadProps {
|
|
|
50
51
|
background?: string;
|
|
51
52
|
/**
|
|
52
53
|
* What the glyph is called, for the pointer and for a screen reader.
|
|
53
|
-
* @default '
|
|
54
|
+
* @default the chrome's own line, in the language of the page
|
|
54
55
|
*/
|
|
55
56
|
label?: string;
|
|
56
57
|
/**
|
|
57
58
|
* What the panel behind it is called.
|
|
58
|
-
* @default '
|
|
59
|
+
* @default the chrome's own line, in the language of the page
|
|
59
60
|
*/
|
|
60
61
|
title?: string;
|
|
61
62
|
/**
|
|
@@ -92,9 +93,10 @@ export interface FigureDownloadProps {
|
|
|
92
93
|
export function FigureDownload(props: FigureDownloadProps): ReactElement {
|
|
93
94
|
const { targetId, fileName, background, scales = FIGURE_SCALES } = props;
|
|
94
95
|
const { defaultFormat = 'png', defaultScale = DEFAULT_FIGURE_SCALE } = props;
|
|
95
|
-
const { label
|
|
96
|
+
const { label, title } = props;
|
|
96
97
|
const { icon = 'download', testId } = props;
|
|
97
98
|
|
|
99
|
+
const t = useChromeT();
|
|
98
100
|
const [open, setOpen] = useState(false);
|
|
99
101
|
const [format, setFormat] = useState<FigureFormat>(defaultFormat);
|
|
100
102
|
const [scale, setScale] = useState(defaultScale);
|
|
@@ -132,7 +134,7 @@ export function FigureDownload(props: FigureDownloadProps): ReactElement {
|
|
|
132
134
|
onInteraction={interact}
|
|
133
135
|
content={
|
|
134
136
|
<FigureDownloadPanel
|
|
135
|
-
title={title}
|
|
137
|
+
title={title ?? t('download.saveFigure')}
|
|
136
138
|
format={format}
|
|
137
139
|
scale={scale}
|
|
138
140
|
scales={scales}
|
|
@@ -147,7 +149,7 @@ export function FigureDownload(props: FigureDownloadProps): ReactElement {
|
|
|
147
149
|
>
|
|
148
150
|
<OverlayIconButton
|
|
149
151
|
icon={icon}
|
|
150
|
-
label={label}
|
|
152
|
+
label={label ?? t('download.saveThisFigure')}
|
|
151
153
|
value={format.toUpperCase()}
|
|
152
154
|
active={open}
|
|
153
155
|
testId={testId}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChromeKey } from '../../i18n/core/chromeCatalog.ts';
|
|
4
|
+
import type { Translate } from '../../i18n/ui/useT.ts';
|
|
5
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
4
6
|
import { OverlayAction } from '../../overlay/ui/OverlayAction.tsx';
|
|
5
7
|
import { OverlayPanel } from '../../overlay/ui/OverlayPanel.tsx';
|
|
6
8
|
import type { OverlayOption } from '../../overlay/ui/OverlayRow.tsx';
|
|
@@ -66,16 +68,17 @@ export function FigureDownloadPanel(
|
|
|
66
68
|
): ReactElement {
|
|
67
69
|
const { title, format, scale, scales, size, failure, saving } = props;
|
|
68
70
|
const { onFormatChange, onScaleChange, onSave, rasterSvg = false } = props;
|
|
71
|
+
const t = useChromeT();
|
|
69
72
|
|
|
70
73
|
const vector = format === 'svg' && !rasterSvg;
|
|
71
74
|
|
|
72
75
|
return (
|
|
73
76
|
<OverlayPanel
|
|
74
77
|
title={title}
|
|
75
|
-
hint={hintOf(format, size, scale, failure, rasterSvg)}
|
|
78
|
+
hint={hintOf(format, size, scale, failure, rasterSvg, t)}
|
|
76
79
|
actions={
|
|
77
80
|
<OverlayAction
|
|
78
|
-
text=
|
|
81
|
+
text={t('download.save')}
|
|
79
82
|
icon="download"
|
|
80
83
|
intent="primary"
|
|
81
84
|
disabled={saving || size === null}
|
|
@@ -84,15 +87,25 @@ export function FigureDownloadPanel(
|
|
|
84
87
|
}
|
|
85
88
|
>
|
|
86
89
|
<OverlaySegmented<FigureFormat>
|
|
87
|
-
label=
|
|
88
|
-
help={
|
|
90
|
+
label={t('download.format')}
|
|
91
|
+
help={{
|
|
92
|
+
title: t('download.format'),
|
|
93
|
+
body: t('download.formatHelp'),
|
|
94
|
+
}}
|
|
89
95
|
value={format}
|
|
90
96
|
options={FORMAT_CHOICES}
|
|
91
97
|
onChange={onFormatChange}
|
|
92
98
|
/>
|
|
93
99
|
<OverlaySegmented
|
|
94
|
-
label=
|
|
95
|
-
help={
|
|
100
|
+
label={t('download.resolution')}
|
|
101
|
+
help={{
|
|
102
|
+
title: t('download.resolution'),
|
|
103
|
+
body: t('download.resolutionHelp'),
|
|
104
|
+
example: {
|
|
105
|
+
code: '2×',
|
|
106
|
+
note: t('download.resolutionExample'),
|
|
107
|
+
},
|
|
108
|
+
}}
|
|
96
109
|
value={String(scale)}
|
|
97
110
|
options={scaleChoices(scales, size)}
|
|
98
111
|
disabled={vector}
|
|
@@ -108,20 +121,6 @@ const FORMAT_CHOICES: ReadonlyArray<OverlayOption<FigureFormat>> = [
|
|
|
108
121
|
{ value: 'svg', label: 'SVG' },
|
|
109
122
|
];
|
|
110
123
|
|
|
111
|
-
const FORMAT_HELP: HelpContent = {
|
|
112
|
-
title: 'Format',
|
|
113
|
-
body: 'A PNG is a picture of the figure, which is what a slide, a chat window or an issue accepts. An SVG is the figure itself: every line stays sharp however far it is enlarged, and it can still be edited afterwards.',
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const RESOLUTION_HELP: HelpContent = {
|
|
117
|
-
title: 'Resolution',
|
|
118
|
-
body: 'How many pixels are painted for each pixel of the figure on screen. Two is right for a slide, three or four for print. An SVG carries no resolution of its own, so it is saved sharp at every size.',
|
|
119
|
-
example: {
|
|
120
|
-
code: '2×',
|
|
121
|
-
note: 'A figure 640 pixels wide on screen is saved 1280 pixels wide.',
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
|
|
125
124
|
/**
|
|
126
125
|
* The multiples offered, each saying what it would actually produce.
|
|
127
126
|
*
|
|
@@ -155,6 +154,8 @@ function scaleChoices(
|
|
|
155
154
|
* @param scale - The multiple it is painted at.
|
|
156
155
|
* @param failure - What went wrong last time, if anything.
|
|
157
156
|
* @param rasterSvg - Whether the SVG embeds a rendered picture.
|
|
157
|
+
* @param t - The chrome's formatter, so the sentence is in the language of
|
|
158
|
+
* the page.
|
|
158
159
|
* @returns The sentence.
|
|
159
160
|
*/
|
|
160
161
|
function hintOf(
|
|
@@ -163,14 +164,19 @@ function hintOf(
|
|
|
163
164
|
scale: number,
|
|
164
165
|
failure: string | null,
|
|
165
166
|
rasterSvg: boolean,
|
|
167
|
+
t: Translate<ChromeKey>,
|
|
166
168
|
): string {
|
|
167
169
|
if (failure !== null) return failure;
|
|
168
|
-
if (size === null) return '
|
|
170
|
+
if (size === null) return t('download.noFigure');
|
|
169
171
|
if (format === 'svg' && rasterSvg) {
|
|
170
|
-
return
|
|
172
|
+
return t('download.hintRasterSvg', {
|
|
173
|
+
pixels: formatFigurePixels(figurePixels(size, scale)),
|
|
174
|
+
});
|
|
171
175
|
}
|
|
172
176
|
if (format === 'svg') {
|
|
173
|
-
return
|
|
177
|
+
return t('download.hintSvg', { pixels: formatFigurePixels(size) });
|
|
174
178
|
}
|
|
175
|
-
return
|
|
179
|
+
return t('download.hintPng', {
|
|
180
|
+
pixels: formatFigurePixels(figurePixels(size, scale)),
|
|
181
|
+
});
|
|
176
182
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
|
|
3
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
3
4
|
import type { HeaderButtonProps } from '../../shared/ui/MenuButton.tsx';
|
|
4
5
|
import { MenuButton } from '../../shared/ui/MenuButton.tsx';
|
|
5
6
|
import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
|
|
@@ -17,7 +18,7 @@ export interface EcosystemButtonProps extends HeaderButtonProps {
|
|
|
17
18
|
/**
|
|
18
19
|
* Text of the button. In a compact bar it is not written, but it stays what
|
|
19
20
|
* the pointer and a screen reader are told.
|
|
20
|
-
* @default '
|
|
21
|
+
* @default the chrome's own word for it, in the language of the page
|
|
21
22
|
*/
|
|
22
23
|
label?: string;
|
|
23
24
|
/**
|
|
@@ -34,14 +35,15 @@ export interface EcosystemButtonProps extends HeaderButtonProps {
|
|
|
34
35
|
* @returns The button and its menu.
|
|
35
36
|
*/
|
|
36
37
|
export function EcosystemButton(props: EcosystemButtonProps): ReactElement {
|
|
37
|
-
const { currentSiteId, label
|
|
38
|
+
const { currentSiteId, label, className, ...rest } = props;
|
|
39
|
+
const t = useChromeT();
|
|
38
40
|
|
|
39
41
|
return (
|
|
40
42
|
<MenuButton
|
|
41
43
|
{...rest}
|
|
42
44
|
className={joinClassNames('ecosystem-button', className)}
|
|
43
45
|
icon="grid-view"
|
|
44
|
-
label={label}
|
|
46
|
+
label={label ?? t('ecosystem.tools')}
|
|
45
47
|
menu={<EcosystemMenu currentSiteId={currentSiteId} />}
|
|
46
48
|
/>
|
|
47
49
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement } from 'react';
|
|
2
2
|
|
|
3
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
3
4
|
import { useSiteLanguage } from '../../language/ui/siteLanguageContext.ts';
|
|
4
5
|
import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
|
|
5
6
|
import { TOKEN } from '../../tokens/core/familyTokens.ts';
|
|
@@ -60,7 +61,7 @@ export interface EcosystemLinksProps {
|
|
|
60
61
|
currentSiteId?: SiteId;
|
|
61
62
|
/**
|
|
62
63
|
* What introduces the section.
|
|
63
|
-
* @default '
|
|
64
|
+
* @default the chrome's own line, in the language of the page
|
|
64
65
|
*/
|
|
65
66
|
heading?: string;
|
|
66
67
|
/**
|
|
@@ -89,27 +90,26 @@ export interface EcosystemLinksProps {
|
|
|
89
90
|
*/
|
|
90
91
|
export function EcosystemLinks(props: EcosystemLinksProps): ReactElement {
|
|
91
92
|
const language = useSiteLanguage();
|
|
92
|
-
const {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
heading = 'Our other tools',
|
|
96
|
-
layout = 'grid',
|
|
97
|
-
} = props;
|
|
93
|
+
const { className, currentSiteId, heading, layout = 'grid' } = props;
|
|
94
|
+
const t = useChromeT();
|
|
95
|
+
const title = heading ?? t('ecosystem.otherTools');
|
|
98
96
|
|
|
99
97
|
return (
|
|
100
98
|
<nav
|
|
101
99
|
className={joinClassNames('ecosystem-links', className)}
|
|
102
100
|
style={SECTION_STYLE}
|
|
103
|
-
aria-label={
|
|
101
|
+
aria-label={title}
|
|
104
102
|
>
|
|
105
|
-
<h2 style={ECOSYSTEM_HEADING_STYLE}>{
|
|
103
|
+
<h2 style={ECOSYSTEM_HEADING_STYLE}>{title}</h2>
|
|
106
104
|
{layout === 'grid' ? (
|
|
107
105
|
<SiteGroupGrid currentSiteId={currentSiteId} />
|
|
108
106
|
) : (
|
|
109
107
|
<div style={ROWS_STYLE}>
|
|
110
108
|
{groupedSites().map(({ group, sites }) => (
|
|
111
109
|
<div key={group.id} style={ROW_STYLE}>
|
|
112
|
-
<span style={ROW_LABEL_STYLE}>
|
|
110
|
+
<span style={ROW_LABEL_STYLE}>
|
|
111
|
+
{t.or(`ecosystem.group.${group.id}.label`, group.label)}
|
|
112
|
+
</span>
|
|
113
113
|
{sites.map((site) =>
|
|
114
114
|
site.id === currentSiteId ? (
|
|
115
115
|
<span key={site.id} style={CURRENT_STYLE}>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement } from 'react';
|
|
2
2
|
|
|
3
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
3
4
|
import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
|
|
4
5
|
import type { SiteId } from '../core/sites.ts';
|
|
5
6
|
|
|
@@ -44,13 +45,14 @@ export interface EcosystemMenuProps {
|
|
|
44
45
|
*/
|
|
45
46
|
export function EcosystemMenu(props: EcosystemMenuProps): ReactElement {
|
|
46
47
|
const { className, currentSiteId } = props;
|
|
48
|
+
const t = useChromeT();
|
|
47
49
|
|
|
48
50
|
return (
|
|
49
51
|
<div
|
|
50
52
|
className={joinClassNames('ecosystem-menu', className)}
|
|
51
53
|
style={PANEL_STYLE}
|
|
52
54
|
>
|
|
53
|
-
<div style={ECOSYSTEM_HEADING_STYLE}>
|
|
55
|
+
<div style={ECOSYSTEM_HEADING_STYLE}>{t('ecosystem.menuHeading')}</div>
|
|
54
56
|
<SiteGroupGrid currentSiteId={currentSiteId} lit newTab />
|
|
55
57
|
</div>
|
|
56
58
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
|
|
4
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
4
5
|
import { TOKEN } from '../../tokens/core/familyTokens.ts';
|
|
5
6
|
import type { SiteGroup } from '../core/groups.ts';
|
|
6
7
|
|
|
@@ -50,14 +51,17 @@ interface SiteGroupSectionProps {
|
|
|
50
51
|
*/
|
|
51
52
|
export function SiteGroupSection(props: SiteGroupSectionProps): ReactElement {
|
|
52
53
|
const { group, children } = props;
|
|
54
|
+
const t = useChromeT();
|
|
53
55
|
const headingId = `${useId()}ecosystem-${group.id}`;
|
|
54
56
|
|
|
55
57
|
return (
|
|
56
58
|
<section style={SECTION_STYLE} aria-labelledby={headingId}>
|
|
57
59
|
<h3 id={headingId} style={LABEL_STYLE}>
|
|
58
|
-
{group.label}
|
|
60
|
+
{t.or(`ecosystem.group.${group.id}.label`, group.label)}
|
|
59
61
|
</h3>
|
|
60
|
-
<p style={BLURB_STYLE}>
|
|
62
|
+
<p style={BLURB_STYLE}>
|
|
63
|
+
{t.or(`ecosystem.group.${group.id}.blurb`, group.blurb)}
|
|
64
|
+
</p>
|
|
61
65
|
<div style={BODY_STYLE}>{children}</div>
|
|
62
66
|
</section>
|
|
63
67
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement } from 'react';
|
|
2
2
|
|
|
3
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
3
4
|
import { useSiteLanguage } from '../../language/ui/siteLanguageContext.ts';
|
|
4
5
|
import { TOKEN } from '../../tokens/core/familyTokens.ts';
|
|
5
6
|
import { siteNameColors } from '../core/nameColors.ts';
|
|
@@ -95,6 +96,7 @@ export function SiteTile(props: SiteTileProps): ReactElement {
|
|
|
95
96
|
onHover,
|
|
96
97
|
newTab = false,
|
|
97
98
|
} = props;
|
|
99
|
+
const t = useChromeT();
|
|
98
100
|
const lit = isHovered && !isCurrent;
|
|
99
101
|
const colors = siteNameColors(site);
|
|
100
102
|
|
|
@@ -119,11 +121,13 @@ export function SiteTile(props: SiteTileProps): ReactElement {
|
|
|
119
121
|
</span>
|
|
120
122
|
{isCurrent ? (
|
|
121
123
|
<span style={{ ...HERE_STYLE, color: site.brandAlt }}>
|
|
122
|
-
|
|
124
|
+
{t('ecosystem.youAreHere')}
|
|
123
125
|
</span>
|
|
124
126
|
) : null}
|
|
125
127
|
</div>
|
|
126
|
-
<div style={TAGLINE_STYLE}>
|
|
128
|
+
<div style={TAGLINE_STYLE}>
|
|
129
|
+
{t.or(`site.${site.id}.tagline`, site.tagline)}
|
|
130
|
+
</div>
|
|
127
131
|
</div>
|
|
128
132
|
</>
|
|
129
133
|
);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Button, NonIdealState } from '@blueprintjs/core';
|
|
2
2
|
import type { ReactElement } from 'react';
|
|
3
3
|
|
|
4
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
5
|
+
|
|
4
6
|
/** What the page shows in place of the part that failed. */
|
|
5
7
|
export interface ErrorFallbackProps {
|
|
6
8
|
/** What was thrown, whose message is what the visitor is told. */
|
|
@@ -13,12 +15,12 @@ export interface ErrorFallbackProps {
|
|
|
13
15
|
onRetry?: () => void;
|
|
14
16
|
/**
|
|
15
17
|
* First line, above the message.
|
|
16
|
-
* @default '
|
|
18
|
+
* @default the chrome's own line, in the language of the page
|
|
17
19
|
*/
|
|
18
20
|
title?: string;
|
|
19
21
|
/**
|
|
20
22
|
* Text of the retry button.
|
|
21
|
-
* @default '
|
|
23
|
+
* @default the chrome's own words for it, in the language of the page
|
|
22
24
|
*/
|
|
23
25
|
retryLabel?: string;
|
|
24
26
|
/**
|
|
@@ -38,27 +40,26 @@ export interface ErrorFallbackProps {
|
|
|
38
40
|
* @returns The non-ideal state.
|
|
39
41
|
*/
|
|
40
42
|
export function ErrorFallback(props: ErrorFallbackProps): ReactElement {
|
|
41
|
-
const {
|
|
42
|
-
|
|
43
|
-
onRetry,
|
|
44
|
-
title = 'Something went wrong',
|
|
45
|
-
retryLabel = 'Try again',
|
|
46
|
-
className,
|
|
47
|
-
} = props;
|
|
43
|
+
const { error, onRetry, title, retryLabel, className } = props;
|
|
44
|
+
const t = useChromeT();
|
|
48
45
|
|
|
49
46
|
return (
|
|
50
47
|
<NonIdealState
|
|
51
48
|
className={className}
|
|
52
49
|
icon="error"
|
|
53
|
-
title={title}
|
|
50
|
+
title={title ?? t('error.title')}
|
|
54
51
|
description={
|
|
55
52
|
<span className="error-fallback__message">
|
|
56
|
-
{error.message === '' ? '
|
|
53
|
+
{error.message === '' ? t('error.noMessage') : error.message}
|
|
57
54
|
</span>
|
|
58
55
|
}
|
|
59
56
|
action={
|
|
60
57
|
onRetry === undefined ? undefined : (
|
|
61
|
-
<Button
|
|
58
|
+
<Button
|
|
59
|
+
icon="refresh"
|
|
60
|
+
text={retryLabel ?? t('error.tryAgain')}
|
|
61
|
+
onClick={onRetry}
|
|
62
|
+
/>
|
|
62
63
|
)
|
|
63
64
|
}
|
|
64
65
|
/>
|
package/src/help/ui/HelpBody.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
3
4
|
import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
|
|
4
5
|
|
|
5
6
|
/** A worked example under a piece of help: the construct, and what it does. */
|
|
@@ -72,6 +73,7 @@ export interface HelpBodyProps {
|
|
|
72
73
|
*/
|
|
73
74
|
export function HelpBody(props: HelpBodyProps): ReactElement {
|
|
74
75
|
const { className, content, width = DEFAULT_WIDTH } = props;
|
|
76
|
+
const t = useChromeT();
|
|
75
77
|
const { title, body, example, link } = content;
|
|
76
78
|
|
|
77
79
|
return (
|
|
@@ -86,7 +88,7 @@ export function HelpBody(props: HelpBodyProps): ReactElement {
|
|
|
86
88
|
<code style={CODE_STYLE}>{item.code}</code>
|
|
87
89
|
{item.input === undefined ? null : (
|
|
88
90
|
<div style={INPUT_STYLE}>
|
|
89
|
-
on <code style={CODE_STYLE}>{item.input}</code>
|
|
91
|
+
{t('help.on')} <code style={CODE_STYLE}>{item.input}</code>
|
|
90
92
|
</div>
|
|
91
93
|
)}
|
|
92
94
|
{item.note === undefined ? null : (
|
|
@@ -101,7 +103,7 @@ export function HelpBody(props: HelpBodyProps): ReactElement {
|
|
|
101
103
|
rel="noopener noreferrer"
|
|
102
104
|
style={LINK_STYLE}
|
|
103
105
|
>
|
|
104
|
-
|
|
106
|
+
{t('help.learnMore')}
|
|
105
107
|
</a>
|
|
106
108
|
)}
|
|
107
109
|
</div>
|
package/src/help/ui/HelpIcon.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import type { IconName } from '@blueprintjs/core';
|
|
|
2
2
|
import { Icon } from '@blueprintjs/core';
|
|
3
3
|
import type { ReactElement } from 'react';
|
|
4
4
|
|
|
5
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
5
6
|
import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
|
|
6
7
|
|
|
7
8
|
import type { HelpContent } from './HelpBody.tsx';
|
|
@@ -17,7 +18,8 @@ export interface HelpIconProps {
|
|
|
17
18
|
content: HelpContent;
|
|
18
19
|
/**
|
|
19
20
|
* What a screen reader calls the glyph.
|
|
20
|
-
* @default the help's title, or
|
|
21
|
+
* @default the help's title, or the chrome's own word for help when it has
|
|
22
|
+
* none
|
|
21
23
|
*/
|
|
22
24
|
label?: string;
|
|
23
25
|
/**
|
|
@@ -54,12 +56,13 @@ export interface HelpIconProps {
|
|
|
54
56
|
export function HelpIcon(props: HelpIconProps): ReactElement {
|
|
55
57
|
const {
|
|
56
58
|
content,
|
|
57
|
-
label
|
|
59
|
+
label,
|
|
58
60
|
icon = 'help',
|
|
59
61
|
size = 13,
|
|
60
62
|
placement = 'right',
|
|
61
63
|
className,
|
|
62
64
|
} = props;
|
|
65
|
+
const t = useChromeT();
|
|
63
66
|
|
|
64
67
|
return (
|
|
65
68
|
<HelpTooltip content={content} placement={placement}>
|
|
@@ -67,7 +70,7 @@ export function HelpIcon(props: HelpIconProps): ReactElement {
|
|
|
67
70
|
icon={icon}
|
|
68
71
|
size={size}
|
|
69
72
|
tabIndex={0}
|
|
70
|
-
aria-label={label}
|
|
73
|
+
aria-label={label ?? helpName(content, t)}
|
|
71
74
|
className={joinClassNames('help-icon', className)}
|
|
72
75
|
/>
|
|
73
76
|
</HelpTooltip>
|
|
@@ -2,6 +2,8 @@ import type { IconName } from '@blueprintjs/core';
|
|
|
2
2
|
import { Button } from '@blueprintjs/core';
|
|
3
3
|
import type { ReactElement } from 'react';
|
|
4
4
|
|
|
5
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
6
|
+
|
|
5
7
|
import type { HelpContent } from './HelpBody.tsx';
|
|
6
8
|
import { HelpTooltip } from './HelpTooltip.tsx';
|
|
7
9
|
import { helpName } from './helpName.ts';
|
|
@@ -56,6 +58,7 @@ export function HelpToolbarButton(props: HelpToolbarButtonProps): ReactElement {
|
|
|
56
58
|
small = false,
|
|
57
59
|
className,
|
|
58
60
|
} = props;
|
|
61
|
+
const t = useChromeT();
|
|
59
62
|
|
|
60
63
|
return (
|
|
61
64
|
<HelpTooltip content={content} placement="bottom">
|
|
@@ -64,7 +67,7 @@ export function HelpToolbarButton(props: HelpToolbarButtonProps): ReactElement {
|
|
|
64
67
|
size={small ? 'small' : 'medium'}
|
|
65
68
|
icon={icon}
|
|
66
69
|
text={label}
|
|
67
|
-
aria-label={label ?? helpName(content)}
|
|
70
|
+
aria-label={label ?? helpName(content, t)}
|
|
68
71
|
className={className}
|
|
69
72
|
onClick={onClick}
|
|
70
73
|
/>
|
package/src/help/ui/helpName.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import type { ChromeKey } from '../../i18n/core/chromeCatalog.ts';
|
|
2
|
+
import type { Translate } from '../../i18n/ui/useT.ts';
|
|
3
|
+
|
|
1
4
|
import type { HelpContent } from './HelpBody.tsx';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* The name a glyph or a button carries for a screen reader: the help's own
|
|
5
8
|
* title, or a plain "Help" when the help has none.
|
|
6
9
|
* @param content - The help being named.
|
|
10
|
+
* @param t - The chrome's formatter, so the plain name is in the language of
|
|
11
|
+
* the page.
|
|
7
12
|
* @returns The accessible name.
|
|
8
13
|
*/
|
|
9
|
-
export function helpName(
|
|
10
|
-
|
|
14
|
+
export function helpName(
|
|
15
|
+
content: HelpContent,
|
|
16
|
+
t: Translate<ChromeKey>,
|
|
17
|
+
): string {
|
|
18
|
+
return content.title ?? t('help.label');
|
|
11
19
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The text this library puts on the page.
|
|
3
|
+
*
|
|
4
|
+
* Every site of the family shows the same header, footer, Tools menu, Cite
|
|
5
|
+
* menu, share dialog and About page, so those words are translated once here
|
|
6
|
+
* rather than re-typed into eighteen catalogs of their own: one merged pull
|
|
7
|
+
* request writes every site in a new language.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import en from '../../locales/en.json' with { type: 'json' };
|
|
11
|
+
|
|
12
|
+
import { MessageCatalog } from './messageCatalog.ts';
|
|
13
|
+
|
|
14
|
+
/** The name the page knows the chrome's own catalog by. */
|
|
15
|
+
export const CHROME_CATALOG_ID = 'react-cheminfo';
|
|
16
|
+
|
|
17
|
+
/** Every key the chrome declares. */
|
|
18
|
+
export type ChromeKey = keyof typeof en;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The chrome's messages. English is part of the page because it is what a
|
|
22
|
+
* missing message falls back to; the other three arrive as a chunk of their
|
|
23
|
+
* own, so a site read only in English downloads none of them.
|
|
24
|
+
*/
|
|
25
|
+
export const CHROME_CATALOG = new MessageCatalog<ChromeKey>({
|
|
26
|
+
id: CHROME_CATALOG_ID,
|
|
27
|
+
repository: 'cheminfo/react-cheminfo',
|
|
28
|
+
directory: 'src/locales',
|
|
29
|
+
source: en,
|
|
30
|
+
translations: {
|
|
31
|
+
fr: () => import('../../locales/fr.json', { with: { type: 'json' } }),
|
|
32
|
+
de: () => import('../../locales/de.json', { with: { type: 'json' } }),
|
|
33
|
+
es: () => import('../../locales/es.json', { with: { type: 'json' } }),
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type { ChromeKey } from './chromeCatalog.ts';
|
|
2
|
+
export { CHROME_CATALOG, CHROME_CATALOG_ID } from './chromeCatalog.ts';
|
|
3
|
+
export type { Language } from './languages.ts';
|
|
4
|
+
export {
|
|
5
|
+
DEFAULT_LANGUAGE,
|
|
6
|
+
LANGUAGES,
|
|
7
|
+
LANGUAGE_LABELS,
|
|
8
|
+
isLanguage,
|
|
9
|
+
} from './languages.ts';
|
|
10
|
+
export type {
|
|
11
|
+
LooseKey,
|
|
12
|
+
MessageCatalogOptions,
|
|
13
|
+
MessagesLoader,
|
|
14
|
+
TranslateOptions,
|
|
15
|
+
} from './messageCatalog.ts';
|
|
16
|
+
export { MessageCatalog } from './messageCatalog.ts';
|
|
17
|
+
export type { MessageValues } from './messageValues.ts';
|
|
18
|
+
export type { MessageSession } from './session.ts';
|
|
19
|
+
export {
|
|
20
|
+
messageSession,
|
|
21
|
+
messagesVersion,
|
|
22
|
+
setMessageSession,
|
|
23
|
+
subscribeToMessages,
|
|
24
|
+
} from './session.ts';
|
|
25
|
+
export type { LoadedCatalogs } from './translateSetup.ts';
|
|
26
|
+
export { loadCatalogs } from './translateSetup.ts';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The languages the family speaks.
|
|
3
|
+
*
|
|
4
|
+
* Four, decided together rather than site by site: a visitor who switches to
|
|
5
|
+
* German on one tool and follows a link to the next must land in German there
|
|
6
|
+
* too, and a list that differs between two sites makes that impossible.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Every language a site of the family is written in. */
|
|
10
|
+
export const LANGUAGES = ['en', 'fr', 'de', 'es'] as const;
|
|
11
|
+
|
|
12
|
+
/** One of {@link LANGUAGES}. */
|
|
13
|
+
export type Language = (typeof LANGUAGES)[number];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The language the catalogs are written in first, and the one every site opens
|
|
17
|
+
* in: an address naming it carries nothing, and a message a translation does
|
|
18
|
+
* not hold falls back to it.
|
|
19
|
+
*/
|
|
20
|
+
export const DEFAULT_LANGUAGE: Language = 'en';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* What a language switch writes behind each entry.
|
|
24
|
+
*
|
|
25
|
+
* A language names itself, in its own words: `Deutsch`, never `German`. A
|
|
26
|
+
* reader looking for their own language recognises it written their way, and
|
|
27
|
+
* would have to know English to find it written the other.
|
|
28
|
+
*/
|
|
29
|
+
export const LANGUAGE_LABELS: Record<Language, string> = {
|
|
30
|
+
en: 'English',
|
|
31
|
+
fr: 'Français',
|
|
32
|
+
de: 'Deutsch',
|
|
33
|
+
es: 'Español',
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Whether a string is one of the languages the family speaks.
|
|
38
|
+
* @param value - Candidate tag, typically read off an address.
|
|
39
|
+
* @returns True when a catalog can be written in it.
|
|
40
|
+
*/
|
|
41
|
+
export function isLanguage(value: string): value is Language {
|
|
42
|
+
for (const language of LANGUAGES) {
|
|
43
|
+
if (language === value) return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|