react-cheminfo 0.2.0 → 0.4.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 +139 -10
- package/lib/capsule/ui/CapsuleFilter.d.ts +61 -0
- package/lib/capsule/ui/CapsuleFilter.d.ts.map +1 -0
- package/lib/capsule/ui/CapsuleFilter.js +33 -0
- package/lib/capsule/ui/CapsuleFilter.js.map +1 -0
- package/lib/capsule/ui/index.d.ts +3 -0
- package/lib/capsule/ui/index.d.ts.map +1 -0
- package/lib/capsule/ui/index.js +2 -0
- package/lib/capsule/ui/index.js.map +1 -0
- package/lib/chrome/ui/NavLink.d.ts +27 -0
- package/lib/chrome/ui/NavLink.d.ts.map +1 -0
- package/lib/chrome/ui/NavLink.js +36 -0
- package/lib/chrome/ui/NavLink.js.map +1 -0
- package/lib/chrome/ui/NavMenuButton.d.ts +40 -0
- package/lib/chrome/ui/NavMenuButton.d.ts.map +1 -0
- package/lib/chrome/ui/NavMenuButton.js +26 -0
- package/lib/chrome/ui/NavMenuButton.js.map +1 -0
- package/lib/chrome/ui/SiteFooter.d.ts +39 -0
- package/lib/chrome/ui/SiteFooter.d.ts.map +1 -0
- package/lib/chrome/ui/SiteFooter.js +17 -0
- package/lib/chrome/ui/SiteFooter.js.map +1 -0
- package/lib/chrome/ui/SiteHeader.d.ts +59 -0
- package/lib/chrome/ui/SiteHeader.d.ts.map +1 -0
- package/lib/chrome/ui/SiteHeader.js +28 -0
- package/lib/chrome/ui/SiteHeader.js.map +1 -0
- package/lib/chrome/ui/index.d.ts +12 -0
- package/lib/chrome/ui/index.d.ts.map +1 -0
- package/lib/chrome/ui/index.js +6 -0
- package/lib/chrome/ui/index.js.map +1 -0
- package/lib/chrome/ui/navItem.d.ts +57 -0
- package/lib/chrome/ui/navItem.d.ts.map +1 -0
- package/lib/chrome/ui/navItem.js +10 -0
- package/lib/chrome/ui/navItem.js.map +1 -0
- package/lib/chrome/ui/useCompactHeader.d.ts +31 -0
- package/lib/chrome/ui/useCompactHeader.d.ts.map +1 -0
- package/lib/chrome/ui/useCompactHeader.js +50 -0
- package/lib/chrome/ui/useCompactHeader.js.map +1 -0
- package/lib/citation/core/clipboard.d.ts +12 -3
- package/lib/citation/core/clipboard.d.ts.map +1 -1
- package/lib/citation/core/clipboard.js +21 -10
- package/lib/citation/core/clipboard.js.map +1 -1
- package/lib/citation/core/download.d.ts +11 -3
- package/lib/citation/core/download.d.ts.map +1 -1
- package/lib/citation/core/download.js +17 -13
- package/lib/citation/core/download.js.map +1 -1
- package/lib/citation/core/index.d.ts +4 -3
- package/lib/citation/core/index.d.ts.map +1 -1
- package/lib/citation/core/index.js +3 -3
- package/lib/citation/core/index.js.map +1 -1
- package/lib/citation/core/works.d.ts +44 -0
- package/lib/citation/core/works.d.ts.map +1 -0
- package/lib/citation/core/works.js +51 -0
- package/lib/citation/core/works.js.map +1 -0
- package/lib/citation/ui/CitationMenu.d.ts +20 -3
- package/lib/citation/ui/CitationMenu.d.ts.map +1 -1
- package/lib/citation/ui/CitationMenu.js +60 -49
- package/lib/citation/ui/CitationMenu.js.map +1 -1
- package/lib/citation/ui/CitationPreview.d.ts +5 -2
- package/lib/citation/ui/CitationPreview.d.ts.map +1 -1
- package/lib/citation/ui/CitationPreview.js +9 -4
- package/lib/citation/ui/CitationPreview.js.map +1 -1
- package/lib/citation/ui/CiteButton.d.ts +13 -6
- package/lib/citation/ui/CiteButton.d.ts.map +1 -1
- package/lib/citation/ui/CiteButton.js +5 -4
- package/lib/citation/ui/CiteButton.js.map +1 -1
- package/lib/citation/ui/CopyFormatEntries.d.ts +31 -0
- package/lib/citation/ui/CopyFormatEntries.d.ts.map +1 -0
- package/lib/citation/ui/CopyFormatEntries.js +29 -0
- package/lib/citation/ui/CopyFormatEntries.js.map +1 -0
- package/lib/citation/ui/WorkEntry.d.ts +18 -0
- package/lib/citation/ui/WorkEntry.d.ts.map +1 -0
- package/lib/citation/ui/WorkEntry.js +32 -0
- package/lib/citation/ui/WorkEntry.js.map +1 -0
- package/lib/citation/ui/entries.d.ts +7 -7
- package/lib/citation/ui/entries.d.ts.map +1 -1
- package/lib/citation/ui/entries.js +11 -13
- package/lib/citation/ui/entries.js.map +1 -1
- package/lib/citation/ui/index.d.ts +2 -2
- package/lib/citation/ui/index.d.ts.map +1 -1
- package/lib/citation/ui/index.js.map +1 -1
- package/lib/citation/ui/useCopyFeedback.d.ts +20 -0
- package/lib/citation/ui/useCopyFeedback.d.ts.map +1 -0
- package/lib/citation/ui/useCopyFeedback.js +49 -0
- package/lib/citation/ui/useCopyFeedback.js.map +1 -0
- package/lib/clipboard/core/index.d.ts +2 -0
- package/lib/clipboard/core/index.d.ts.map +1 -0
- package/lib/clipboard/core/index.js +2 -0
- package/lib/clipboard/core/index.js.map +1 -0
- package/lib/clipboard/core/writeToClipboard.d.ts +12 -0
- package/lib/clipboard/core/writeToClipboard.d.ts.map +1 -0
- package/lib/clipboard/core/writeToClipboard.js +49 -0
- package/lib/clipboard/core/writeToClipboard.js.map +1 -0
- package/lib/clipboard/ui/CodeBlock.d.ts +43 -0
- package/lib/clipboard/ui/CodeBlock.d.ts.map +1 -0
- package/lib/clipboard/ui/CodeBlock.js +49 -0
- package/lib/clipboard/ui/CodeBlock.js.map +1 -0
- package/lib/clipboard/ui/CopyButton.d.ts +64 -0
- package/lib/clipboard/ui/CopyButton.d.ts.map +1 -0
- package/lib/clipboard/ui/CopyButton.js +21 -0
- package/lib/clipboard/ui/CopyButton.js.map +1 -0
- package/lib/clipboard/ui/index.d.ts +7 -0
- package/lib/clipboard/ui/index.d.ts.map +1 -0
- package/lib/clipboard/ui/index.js +4 -0
- package/lib/clipboard/ui/index.js.map +1 -0
- package/lib/clipboard/ui/useCopyToClipboard.d.ts +24 -0
- package/lib/clipboard/ui/useCopyToClipboard.d.ts.map +1 -0
- package/lib/clipboard/ui/useCopyToClipboard.js +36 -0
- package/lib/clipboard/ui/useCopyToClipboard.js.map +1 -0
- package/lib/color/core/contrast.d.ts +43 -0
- package/lib/color/core/contrast.d.ts.map +1 -0
- package/lib/color/core/contrast.js +61 -0
- package/lib/color/core/contrast.js.map +1 -0
- package/lib/color/core/hex.d.ts +26 -0
- package/lib/color/core/hex.d.ts.map +1 -0
- package/lib/color/core/hex.js +44 -0
- package/lib/color/core/hex.js.map +1 -0
- package/lib/color/core/index.d.ts +5 -0
- package/lib/color/core/index.d.ts.map +1 -0
- package/lib/color/core/index.js +3 -0
- package/lib/color/core/index.js.map +1 -0
- package/lib/color/core/scale.d.ts +52 -0
- package/lib/color/core/scale.d.ts.map +1 -0
- package/lib/color/core/scale.js +96 -0
- package/lib/color/core/scale.js.map +1 -0
- package/lib/color/ui/ColorScaleLegend.d.ts +38 -0
- package/lib/color/ui/ColorScaleLegend.d.ts.map +1 -0
- package/lib/color/ui/ColorScaleLegend.js +68 -0
- package/lib/color/ui/ColorScaleLegend.js.map +1 -0
- package/lib/color/ui/index.d.ts +3 -0
- package/lib/color/ui/index.d.ts.map +1 -0
- package/lib/color/ui/index.js +2 -0
- package/lib/color/ui/index.js.map +1 -0
- package/lib/core.d.ts +12 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +12 -0
- package/lib/core.js.map +1 -1
- package/lib/credits/core/credits.d.ts +144 -0
- package/lib/credits/core/credits.d.ts.map +1 -0
- package/lib/credits/core/credits.js +156 -0
- package/lib/credits/core/credits.js.map +1 -0
- package/lib/credits/core/index.d.ts +3 -0
- package/lib/credits/core/index.d.ts.map +1 -0
- package/lib/credits/core/index.js +2 -0
- package/lib/credits/core/index.js.map +1 -0
- package/lib/credits/ui/CreditsList.d.ts +29 -0
- package/lib/credits/ui/CreditsList.d.ts.map +1 -0
- package/lib/credits/ui/CreditsList.js +33 -0
- package/lib/credits/ui/CreditsList.js.map +1 -0
- package/lib/credits/ui/index.d.ts +3 -0
- package/lib/credits/ui/index.d.ts.map +1 -0
- package/lib/credits/ui/index.js +2 -0
- package/lib/credits/ui/index.js.map +1 -0
- package/lib/delimited/core/delimiters.d.ts +31 -0
- package/lib/delimited/core/delimiters.d.ts.map +1 -0
- package/lib/delimited/core/delimiters.js +46 -0
- package/lib/delimited/core/delimiters.js.map +1 -0
- package/lib/delimited/core/index.d.ts +9 -0
- package/lib/delimited/core/index.d.ts.map +1 -0
- package/lib/delimited/core/index.js +5 -0
- package/lib/delimited/core/index.js.map +1 -0
- package/lib/delimited/core/readDelimited.d.ts +32 -0
- package/lib/delimited/core/readDelimited.d.ts.map +1 -0
- package/lib/delimited/core/readDelimited.js +122 -0
- package/lib/delimited/core/readDelimited.js.map +1 -0
- package/lib/delimited/core/rowsToDelimited.d.ts +59 -0
- package/lib/delimited/core/rowsToDelimited.d.ts.map +1 -0
- package/lib/delimited/core/rowsToDelimited.js +87 -0
- package/lib/delimited/core/rowsToDelimited.js.map +1 -0
- package/lib/delimited/core/toDelimited.d.ts +38 -0
- package/lib/delimited/core/toDelimited.d.ts.map +1 -0
- package/lib/delimited/core/toDelimited.js +45 -0
- package/lib/delimited/core/toDelimited.js.map +1 -0
- package/lib/delimited/ui/DelimitedTextDialog.d.ts +22 -0
- package/lib/delimited/ui/DelimitedTextDialog.d.ts.map +1 -0
- package/lib/delimited/ui/DelimitedTextDialog.js +17 -0
- package/lib/delimited/ui/DelimitedTextDialog.js.map +1 -0
- package/lib/delimited/ui/DelimitedTextPanel.d.ts +56 -0
- package/lib/delimited/ui/DelimitedTextPanel.d.ts.map +1 -0
- package/lib/delimited/ui/DelimitedTextPanel.js +55 -0
- package/lib/delimited/ui/DelimitedTextPanel.js.map +1 -0
- package/lib/delimited/ui/index.d.ts +5 -0
- package/lib/delimited/ui/index.d.ts.map +1 -0
- package/lib/delimited/ui/index.js +3 -0
- package/lib/delimited/ui/index.js.map +1 -0
- package/lib/disclosure/ui/CollapsibleSection.d.ts +57 -0
- package/lib/disclosure/ui/CollapsibleSection.d.ts.map +1 -0
- package/lib/disclosure/ui/CollapsibleSection.js +60 -0
- package/lib/disclosure/ui/CollapsibleSection.js.map +1 -0
- package/lib/disclosure/ui/index.d.ts +5 -0
- package/lib/disclosure/ui/index.d.ts.map +1 -0
- package/lib/disclosure/ui/index.js +3 -0
- package/lib/disclosure/ui/index.js.map +1 -0
- package/lib/disclosure/ui/useDisclosure.d.ts +22 -0
- package/lib/disclosure/ui/useDisclosure.d.ts.map +1 -0
- package/lib/disclosure/ui/useDisclosure.js +18 -0
- package/lib/disclosure/ui/useDisclosure.js.map +1 -0
- package/lib/download/core/downloadBlob.d.ts +10 -0
- package/lib/download/core/downloadBlob.d.ts.map +1 -0
- package/lib/download/core/downloadBlob.js +20 -0
- package/lib/download/core/downloadBlob.js.map +1 -0
- package/lib/download/core/downloadText.d.ts +9 -0
- package/lib/download/core/downloadText.d.ts.map +1 -0
- package/lib/download/core/downloadText.js +14 -0
- package/lib/download/core/downloadText.js.map +1 -0
- package/lib/download/core/index.d.ts +4 -0
- package/lib/download/core/index.d.ts.map +1 -0
- package/lib/download/core/index.js +4 -0
- package/lib/download/core/index.js.map +1 -0
- package/lib/download/core/sanitizeFileName.d.ts +15 -0
- package/lib/download/core/sanitizeFileName.d.ts.map +1 -0
- package/lib/download/core/sanitizeFileName.js +33 -0
- package/lib/download/core/sanitizeFileName.js.map +1 -0
- package/lib/ecosystem/core/index.d.ts +3 -0
- package/lib/ecosystem/core/index.d.ts.map +1 -1
- package/lib/ecosystem/core/index.js +3 -0
- package/lib/ecosystem/core/index.js.map +1 -1
- package/lib/ecosystem/core/links.d.ts +11 -0
- package/lib/ecosystem/core/links.d.ts.map +1 -0
- package/lib/ecosystem/core/links.js +28 -0
- package/lib/ecosystem/core/links.js.map +1 -0
- package/lib/ecosystem/core/lookup.d.ts +21 -0
- package/lib/ecosystem/core/lookup.d.ts.map +1 -0
- package/lib/ecosystem/core/lookup.js +40 -0
- package/lib/ecosystem/core/lookup.js.map +1 -0
- package/lib/ecosystem/core/sites.d.ts +3 -1
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +33 -0
- package/lib/ecosystem/core/sites.js.map +1 -1
- package/lib/ecosystem/core/tokens.d.ts +21 -0
- package/lib/ecosystem/core/tokens.d.ts.map +1 -0
- package/lib/ecosystem/core/tokens.js +42 -0
- package/lib/ecosystem/core/tokens.js.map +1 -0
- package/lib/ecosystem/ui/SiteTheme.d.ts +18 -0
- package/lib/ecosystem/ui/SiteTheme.d.ts.map +1 -0
- package/lib/ecosystem/ui/SiteTheme.js +16 -0
- package/lib/ecosystem/ui/SiteTheme.js.map +1 -0
- package/lib/ecosystem/ui/Wordmark.d.ts +30 -0
- package/lib/ecosystem/ui/Wordmark.d.ts.map +1 -0
- package/lib/ecosystem/ui/Wordmark.js +26 -0
- package/lib/ecosystem/ui/Wordmark.js.map +1 -0
- package/lib/ecosystem/ui/glyphs.d.ts +16 -0
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -0
- package/lib/ecosystem/ui/glyphs.js +41 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -0
- package/lib/ecosystem/ui/index.d.ts +4 -0
- package/lib/ecosystem/ui/index.d.ts.map +1 -1
- package/lib/ecosystem/ui/index.js +2 -0
- package/lib/ecosystem/ui/index.js.map +1 -1
- package/lib/ecosystem/ui/marks.d.ts +30 -4
- package/lib/ecosystem/ui/marks.d.ts.map +1 -1
- package/lib/ecosystem/ui/marks.js +15 -36
- package/lib/ecosystem/ui/marks.js.map +1 -1
- package/lib/error/ui/ErrorBoundary.d.ts +60 -0
- package/lib/error/ui/ErrorBoundary.d.ts.map +1 -0
- package/lib/error/ui/ErrorBoundary.js +59 -0
- package/lib/error/ui/ErrorBoundary.js.map +1 -0
- package/lib/error/ui/ErrorFallback.d.ts +38 -0
- package/lib/error/ui/ErrorFallback.d.ts.map +1 -0
- package/lib/error/ui/ErrorFallback.js +16 -0
- package/lib/error/ui/ErrorFallback.js.map +1 -0
- package/lib/error/ui/index.d.ts +5 -0
- package/lib/error/ui/index.d.ts.map +1 -0
- package/lib/error/ui/index.js +3 -0
- package/lib/error/ui/index.js.map +1 -0
- package/lib/error/ui/toError.d.ts +11 -0
- package/lib/error/ui/toError.d.ts.map +1 -0
- package/lib/error/ui/toError.js +35 -0
- package/lib/error/ui/toError.js.map +1 -0
- package/lib/format/core/index.d.ts +5 -0
- package/lib/format/core/index.d.ts.map +1 -0
- package/lib/format/core/index.js +5 -0
- package/lib/format/core/index.js.map +1 -0
- package/lib/format/core/missing.d.ts +7 -0
- package/lib/format/core/missing.d.ts.map +1 -0
- package/lib/format/core/missing.js +7 -0
- package/lib/format/core/missing.js.map +1 -0
- package/lib/format/core/numbers.d.ts +40 -0
- package/lib/format/core/numbers.d.ts.map +1 -0
- package/lib/format/core/numbers.js +81 -0
- package/lib/format/core/numbers.js.map +1 -0
- package/lib/format/core/units.d.ts +17 -0
- package/lib/format/core/units.d.ts.map +1 -0
- package/lib/format/core/units.js +54 -0
- package/lib/format/core/units.js.map +1 -0
- package/lib/format/core/words.d.ts +12 -0
- package/lib/format/core/words.d.ts.map +1 -0
- package/lib/format/core/words.js +14 -0
- package/lib/format/core/words.js.map +1 -0
- package/lib/help/ui/HelpBody.d.ts +57 -0
- package/lib/help/ui/HelpBody.d.ts.map +1 -0
- package/lib/help/ui/HelpBody.js +44 -0
- package/lib/help/ui/HelpBody.js.map +1 -0
- package/lib/help/ui/HelpIcon.d.ts +33 -0
- package/lib/help/ui/HelpIcon.d.ts.map +1 -0
- package/lib/help/ui/HelpIcon.js +16 -0
- package/lib/help/ui/HelpIcon.js.map +1 -0
- package/lib/help/ui/HelpToolbarButton.d.ts +45 -0
- package/lib/help/ui/HelpToolbarButton.d.ts.map +1 -0
- package/lib/help/ui/HelpToolbarButton.js +17 -0
- package/lib/help/ui/HelpToolbarButton.js.map +1 -0
- package/lib/help/ui/HelpTooltip.d.ts +36 -0
- package/lib/help/ui/HelpTooltip.d.ts.map +1 -0
- package/lib/help/ui/HelpTooltip.js +24 -0
- package/lib/help/ui/HelpTooltip.js.map +1 -0
- package/lib/help/ui/index.d.ts +9 -0
- package/lib/help/ui/index.d.ts.map +1 -0
- package/lib/help/ui/index.js +5 -0
- package/lib/help/ui/index.js.map +1 -0
- package/lib/hooks/ui/index.d.ts +7 -0
- package/lib/hooks/ui/index.d.ts.map +1 -0
- package/lib/hooks/ui/index.js +5 -0
- package/lib/hooks/ui/index.js.map +1 -0
- package/lib/hooks/ui/listNavigation.d.ts +54 -0
- package/lib/hooks/ui/listNavigation.d.ts.map +1 -0
- package/lib/hooks/ui/listNavigation.js +77 -0
- package/lib/hooks/ui/listNavigation.js.map +1 -0
- package/lib/hooks/ui/useContainerSize.d.ts +15 -0
- package/lib/hooks/ui/useContainerSize.d.ts.map +1 -0
- package/lib/hooks/ui/useContainerSize.js +24 -0
- package/lib/hooks/ui/useContainerSize.js.map +1 -0
- package/lib/hooks/ui/useDebouncedValue.d.ts +12 -0
- package/lib/hooks/ui/useDebouncedValue.d.ts.map +1 -0
- package/lib/hooks/ui/useDebouncedValue.js +24 -0
- package/lib/hooks/ui/useDebouncedValue.js.map +1 -0
- package/lib/hooks/ui/useListKeyboardNavigation.d.ts +17 -0
- package/lib/hooks/ui/useListKeyboardNavigation.d.ts.map +1 -0
- package/lib/hooks/ui/useListKeyboardNavigation.js +25 -0
- package/lib/hooks/ui/useListKeyboardNavigation.js.map +1 -0
- package/lib/hooks/ui/useResizeObserver.d.ts +20 -0
- package/lib/hooks/ui/useResizeObserver.d.ts.map +1 -0
- package/lib/hooks/ui/useResizeObserver.js +37 -0
- package/lib/hooks/ui/useResizeObserver.js.map +1 -0
- package/lib/orbital/core/atomicGrid.d.ts +85 -0
- package/lib/orbital/core/atomicGrid.d.ts.map +1 -0
- package/lib/orbital/core/atomicGrid.js +105 -0
- package/lib/orbital/core/atomicGrid.js.map +1 -0
- package/lib/orbital/core/atomicOrbitals.d.ts +97 -0
- package/lib/orbital/core/atomicOrbitals.d.ts.map +1 -0
- package/lib/orbital/core/atomicOrbitals.js +135 -0
- package/lib/orbital/core/atomicOrbitals.js.map +1 -0
- package/lib/orbital/core/constants.d.ts +33 -0
- package/lib/orbital/core/constants.d.ts.map +1 -0
- package/lib/orbital/core/constants.js +21 -0
- package/lib/orbital/core/constants.js.map +1 -0
- package/lib/orbital/core/electronConfiguration.d.ts +106 -0
- package/lib/orbital/core/electronConfiguration.d.ts.map +1 -0
- package/lib/orbital/core/electronConfiguration.js +207 -0
- package/lib/orbital/core/electronConfiguration.js.map +1 -0
- package/lib/orbital/core/grid.d.ts +60 -0
- package/lib/orbital/core/grid.d.ts.map +1 -0
- package/lib/orbital/core/grid.js +81 -0
- package/lib/orbital/core/grid.js.map +1 -0
- package/lib/orbital/core/hydrogenic.d.ts +99 -0
- package/lib/orbital/core/hydrogenic.d.ts.map +1 -0
- package/lib/orbital/core/hydrogenic.js +181 -0
- package/lib/orbital/core/hydrogenic.js.map +1 -0
- package/lib/orbital/core/index.d.ts +24 -0
- package/lib/orbital/core/index.d.ts.map +1 -0
- package/lib/orbital/core/index.js +13 -0
- package/lib/orbital/core/index.js.map +1 -0
- package/lib/orbital/core/isovalue.d.ts +60 -0
- package/lib/orbital/core/isovalue.d.ts.map +1 -0
- package/lib/orbital/core/isovalue.js +128 -0
- package/lib/orbital/core/isovalue.js.map +1 -0
- package/lib/orbital/core/numerics.d.ts +39 -0
- package/lib/orbital/core/numerics.d.ts.map +1 -0
- package/lib/orbital/core/numerics.js +75 -0
- package/lib/orbital/core/numerics.js.map +1 -0
- package/lib/orbital/core/occupancy.d.ts +44 -0
- package/lib/orbital/core/occupancy.d.ts.map +1 -0
- package/lib/orbital/core/occupancy.js +85 -0
- package/lib/orbital/core/occupancy.js.map +1 -0
- package/lib/orbital/core/palette.d.ts +36 -0
- package/lib/orbital/core/palette.d.ts.map +1 -0
- package/lib/orbital/core/palette.js +37 -0
- package/lib/orbital/core/palette.js.map +1 -0
- package/lib/orbital/core/realHarmonics.d.ts +57 -0
- package/lib/orbital/core/realHarmonics.d.ts.map +1 -0
- package/lib/orbital/core/realHarmonics.js +144 -0
- package/lib/orbital/core/realHarmonics.js.map +1 -0
- package/lib/orbital/core/sample.d.ts +66 -0
- package/lib/orbital/core/sample.d.ts.map +1 -0
- package/lib/orbital/core/sample.js +61 -0
- package/lib/orbital/core/sample.js.map +1 -0
- package/lib/orbital/core/screening.d.ts +46 -0
- package/lib/orbital/core/screening.d.ts.map +1 -0
- package/lib/orbital/core/screening.js +72 -0
- package/lib/orbital/core/screening.js.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts +62 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.js +115 -0
- package/lib/orbital/ui/AtomicOrbitalCanvas.js.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts +77 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts.map +1 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.js +49 -0
- package/lib/orbital/ui/AtomicOrbitalViewer.js.map +1 -0
- package/lib/orbital/ui/camera.d.ts +36 -0
- package/lib/orbital/ui/camera.d.ts.map +1 -0
- package/lib/orbital/ui/camera.js +98 -0
- package/lib/orbital/ui/camera.js.map +1 -0
- package/lib/orbital/ui/capability.d.ts +28 -0
- package/lib/orbital/ui/capability.d.ts.map +1 -0
- package/lib/orbital/ui/capability.js +77 -0
- package/lib/orbital/ui/capability.js.map +1 -0
- package/lib/orbital/ui/index.d.ts +17 -0
- package/lib/orbital/ui/index.d.ts.map +1 -0
- package/lib/orbital/ui/index.js +13 -0
- package/lib/orbital/ui/index.js.map +1 -0
- package/lib/orbital/ui/renderVolume.d.ts +60 -0
- package/lib/orbital/ui/renderVolume.d.ts.map +1 -0
- package/lib/orbital/ui/renderVolume.js +119 -0
- package/lib/orbital/ui/renderVolume.js.map +1 -0
- package/lib/orbital/ui/viewer.d.ts +88 -0
- package/lib/orbital/ui/viewer.d.ts.map +1 -0
- package/lib/orbital/ui/viewer.js +156 -0
- package/lib/orbital/ui/viewer.js.map +1 -0
- package/lib/orbital/ui/volumeField.d.ts +33 -0
- package/lib/orbital/ui/volumeField.d.ts.map +1 -0
- package/lib/orbital/ui/volumeField.js +68 -0
- package/lib/orbital/ui/volumeField.js.map +1 -0
- package/lib/orbital.d.ts +11 -0
- package/lib/orbital.d.ts.map +1 -0
- package/lib/orbital.js +11 -0
- package/lib/orbital.js.map +1 -0
- package/lib/pedagogy/core/glossary.d.ts +79 -0
- package/lib/pedagogy/core/glossary.d.ts.map +1 -0
- package/lib/pedagogy/core/glossary.js +71 -0
- package/lib/pedagogy/core/glossary.js.map +1 -0
- package/lib/pedagogy/core/index.d.ts +8 -0
- package/lib/pedagogy/core/index.d.ts.map +1 -0
- package/lib/pedagogy/core/index.js +4 -0
- package/lib/pedagogy/core/index.js.map +1 -0
- package/lib/pedagogy/core/jsonStorage.d.ts +21 -0
- package/lib/pedagogy/core/jsonStorage.d.ts.map +1 -0
- package/lib/pedagogy/core/jsonStorage.js +55 -0
- package/lib/pedagogy/core/jsonStorage.js.map +1 -0
- package/lib/pedagogy/core/progress.d.ts +116 -0
- package/lib/pedagogy/core/progress.d.ts.map +1 -0
- package/lib/pedagogy/core/progress.js +122 -0
- package/lib/pedagogy/core/progress.js.map +1 -0
- package/lib/pedagogy/core/types.d.ts +74 -0
- package/lib/pedagogy/core/types.d.ts.map +1 -0
- package/lib/pedagogy/core/types.js +8 -0
- package/lib/pedagogy/core/types.js.map +1 -0
- package/lib/pedagogy/core/validation.d.ts +79 -0
- package/lib/pedagogy/core/validation.d.ts.map +1 -0
- package/lib/pedagogy/core/validation.js +47 -0
- package/lib/pedagogy/core/validation.js.map +1 -0
- package/lib/pedagogy/ui/ExerciseActions.d.ts +74 -0
- package/lib/pedagogy/ui/ExerciseActions.d.ts.map +1 -0
- package/lib/pedagogy/ui/ExerciseActions.js +22 -0
- package/lib/pedagogy/ui/ExerciseActions.js.map +1 -0
- package/lib/pedagogy/ui/ExerciseProgressHeader.d.ts +43 -0
- package/lib/pedagogy/ui/ExerciseProgressHeader.d.ts.map +1 -0
- package/lib/pedagogy/ui/ExerciseProgressHeader.js +43 -0
- package/lib/pedagogy/ui/ExerciseProgressHeader.js.map +1 -0
- package/lib/pedagogy/ui/ExerciseTags.d.ts +49 -0
- package/lib/pedagogy/ui/ExerciseTags.d.ts.map +1 -0
- package/lib/pedagogy/ui/ExerciseTags.js +22 -0
- package/lib/pedagogy/ui/ExerciseTags.js.map +1 -0
- package/lib/pedagogy/ui/GlossaryProvider.d.ts +19 -0
- package/lib/pedagogy/ui/GlossaryProvider.d.ts.map +1 -0
- package/lib/pedagogy/ui/GlossaryProvider.js +16 -0
- package/lib/pedagogy/ui/GlossaryProvider.js.map +1 -0
- package/lib/pedagogy/ui/GlossaryText.d.ts +50 -0
- package/lib/pedagogy/ui/GlossaryText.d.ts.map +1 -0
- package/lib/pedagogy/ui/GlossaryText.js +79 -0
- package/lib/pedagogy/ui/GlossaryText.js.map +1 -0
- package/lib/pedagogy/ui/HintLadder.d.ts +38 -0
- package/lib/pedagogy/ui/HintLadder.d.ts.map +1 -0
- package/lib/pedagogy/ui/HintLadder.js +33 -0
- package/lib/pedagogy/ui/HintLadder.js.map +1 -0
- package/lib/pedagogy/ui/ReferenceGrid.d.ts +31 -0
- package/lib/pedagogy/ui/ReferenceGrid.d.ts.map +1 -0
- package/lib/pedagogy/ui/ReferenceGrid.js +25 -0
- package/lib/pedagogy/ui/ReferenceGrid.js.map +1 -0
- package/lib/pedagogy/ui/ReferenceSectionBlock.d.ts +64 -0
- package/lib/pedagogy/ui/ReferenceSectionBlock.d.ts.map +1 -0
- package/lib/pedagogy/ui/ReferenceSectionBlock.js +78 -0
- package/lib/pedagogy/ui/ReferenceSectionBlock.js.map +1 -0
- package/lib/pedagogy/ui/SyntaxTooltip.d.ts +94 -0
- package/lib/pedagogy/ui/SyntaxTooltip.d.ts.map +1 -0
- package/lib/pedagogy/ui/SyntaxTooltip.js +79 -0
- package/lib/pedagogy/ui/SyntaxTooltip.js.map +1 -0
- package/lib/pedagogy/ui/TestCaseList.d.ts +35 -0
- package/lib/pedagogy/ui/TestCaseList.d.ts.map +1 -0
- package/lib/pedagogy/ui/TestCaseList.js +63 -0
- package/lib/pedagogy/ui/TestCaseList.js.map +1 -0
- package/lib/pedagogy/ui/TutorialStepStrip.d.ts +42 -0
- package/lib/pedagogy/ui/TutorialStepStrip.d.ts.map +1 -0
- package/lib/pedagogy/ui/TutorialStepStrip.js +98 -0
- package/lib/pedagogy/ui/TutorialStepStrip.js.map +1 -0
- package/lib/pedagogy/ui/exerciseMeta.d.ts +24 -0
- package/lib/pedagogy/ui/exerciseMeta.d.ts.map +1 -0
- package/lib/pedagogy/ui/exerciseMeta.js +38 -0
- package/lib/pedagogy/ui/exerciseMeta.js.map +1 -0
- package/lib/pedagogy/ui/glossaryContext.d.ts +17 -0
- package/lib/pedagogy/ui/glossaryContext.d.ts.map +1 -0
- package/lib/pedagogy/ui/glossaryContext.js +19 -0
- package/lib/pedagogy/ui/glossaryContext.js.map +1 -0
- package/lib/pedagogy/ui/index.d.ts +27 -0
- package/lib/pedagogy/ui/index.d.ts.map +1 -0
- package/lib/pedagogy/ui/index.js +15 -0
- package/lib/pedagogy/ui/index.js.map +1 -0
- package/lib/pedagogy/ui/tutorialLevels.d.ts +18 -0
- package/lib/pedagogy/ui/tutorialLevels.d.ts.map +1 -0
- package/lib/pedagogy/ui/tutorialLevels.js +14 -0
- package/lib/pedagogy/ui/tutorialLevels.js.map +1 -0
- package/lib/router/core/address.d.ts +42 -0
- package/lib/router/core/address.d.ts.map +1 -0
- package/lib/router/core/address.js +64 -0
- package/lib/router/core/address.js.map +1 -0
- package/lib/router/core/basePath.d.ts +49 -0
- package/lib/router/core/basePath.d.ts.map +1 -0
- package/lib/router/core/basePath.js +78 -0
- package/lib/router/core/basePath.js.map +1 -0
- package/lib/router/core/index.d.ts +8 -0
- package/lib/router/core/index.d.ts.map +1 -0
- package/lib/router/core/index.js +5 -0
- package/lib/router/core/index.js.map +1 -0
- package/lib/router/core/legacyHash.d.ts +45 -0
- package/lib/router/core/legacyHash.d.ts.map +1 -0
- package/lib/router/core/legacyHash.js +50 -0
- package/lib/router/core/legacyHash.js.map +1 -0
- package/lib/router/core/pageAddresses.d.ts +50 -0
- package/lib/router/core/pageAddresses.d.ts.map +1 -0
- package/lib/router/core/pageAddresses.js +56 -0
- package/lib/router/core/pageAddresses.js.map +1 -0
- package/lib/router/core/query.d.ts +41 -0
- package/lib/router/core/query.d.ts.map +1 -0
- package/lib/router/core/query.js +64 -0
- package/lib/router/core/query.js.map +1 -0
- package/lib/router/core/tabRouter.d.ts +111 -0
- package/lib/router/core/tabRouter.d.ts.map +1 -0
- package/lib/router/core/tabRouter.js +87 -0
- package/lib/router/core/tabRouter.js.map +1 -0
- package/lib/seo/core/documentMeta.d.ts +45 -0
- package/lib/seo/core/documentMeta.d.ts.map +1 -0
- package/lib/seo/core/documentMeta.js +69 -0
- package/lib/seo/core/documentMeta.js.map +1 -0
- package/lib/seo/core/index.d.ts +3 -0
- package/lib/seo/core/index.d.ts.map +1 -0
- package/lib/seo/core/index.js +2 -0
- package/lib/seo/core/index.js.map +1 -0
- package/lib/share/core/config.d.ts +63 -0
- package/lib/share/core/config.d.ts.map +1 -0
- package/lib/share/core/config.js +125 -0
- package/lib/share/core/config.js.map +1 -0
- package/lib/share/core/escape.d.ts +15 -0
- package/lib/share/core/escape.d.ts.map +1 -0
- package/lib/share/core/escape.js +22 -0
- package/lib/share/core/escape.js.map +1 -0
- package/lib/share/core/index.d.ts +9 -0
- package/lib/share/core/index.d.ts.map +1 -0
- package/lib/share/core/index.js +5 -0
- package/lib/share/core/index.js.map +1 -0
- package/lib/share/core/params.d.ts +93 -0
- package/lib/share/core/params.d.ts.map +1 -0
- package/lib/share/core/params.js +111 -0
- package/lib/share/core/params.js.map +1 -0
- package/lib/share/core/query.d.ts +30 -0
- package/lib/share/core/query.d.ts.map +1 -0
- package/lib/share/core/query.js +68 -0
- package/lib/share/core/query.js.map +1 -0
- package/lib/share/core/url.d.ts +57 -0
- package/lib/share/core/url.d.ts.map +1 -0
- package/lib/share/core/url.js +49 -0
- package/lib/share/core/url.js.map +1 -0
- package/lib/share/core/vocabulary.d.ts +51 -0
- package/lib/share/core/vocabulary.d.ts.map +1 -0
- package/lib/share/core/vocabulary.js +2 -0
- package/lib/share/core/vocabulary.js.map +1 -0
- package/lib/share/ui/HiddenPartsProvider.d.ts +19 -0
- package/lib/share/ui/HiddenPartsProvider.d.ts.map +1 -0
- package/lib/share/ui/HiddenPartsProvider.js +15 -0
- package/lib/share/ui/HiddenPartsProvider.js.map +1 -0
- package/lib/share/ui/PagePart.d.ts +18 -0
- package/lib/share/ui/PagePart.d.ts.map +1 -0
- package/lib/share/ui/PagePart.js +16 -0
- package/lib/share/ui/PagePart.js.map +1 -0
- package/lib/share/ui/ShareButton.d.ts +42 -0
- package/lib/share/ui/ShareButton.d.ts.map +1 -0
- package/lib/share/ui/ShareButton.js +18 -0
- package/lib/share/ui/ShareButton.js.map +1 -0
- package/lib/share/ui/ShareDialog.d.ts +73 -0
- package/lib/share/ui/ShareDialog.d.ts.map +1 -0
- package/lib/share/ui/ShareDialog.js +19 -0
- package/lib/share/ui/ShareDialog.js.map +1 -0
- package/lib/share/ui/ShareDialogContent.d.ts +13 -0
- package/lib/share/ui/ShareDialogContent.d.ts.map +1 -0
- package/lib/share/ui/ShareDialogContent.js +71 -0
- package/lib/share/ui/ShareDialogContent.js.map +1 -0
- package/lib/share/ui/SharePartOptions.d.ts +18 -0
- package/lib/share/ui/SharePartOptions.d.ts.map +1 -0
- package/lib/share/ui/SharePartOptions.js +22 -0
- package/lib/share/ui/SharePartOptions.js.map +1 -0
- package/lib/share/ui/draft.d.ts +13 -0
- package/lib/share/ui/draft.d.ts.map +1 -0
- package/lib/share/ui/draft.js +16 -0
- package/lib/share/ui/draft.js.map +1 -0
- package/lib/share/ui/hiddenParts.d.ts +17 -0
- package/lib/share/ui/hiddenParts.d.ts.map +1 -0
- package/lib/share/ui/hiddenParts.js +21 -0
- package/lib/share/ui/hiddenParts.js.map +1 -0
- package/lib/share/ui/index.d.ts +10 -0
- package/lib/share/ui/index.d.ts.map +1 -0
- package/lib/share/ui/index.js +6 -0
- package/lib/share/ui/index.js.map +1 -0
- package/lib/shared/ui/index.d.ts +2 -1
- package/lib/shared/ui/index.d.ts.map +1 -1
- package/lib/shared/ui/index.js +1 -1
- package/lib/shared/ui/index.js.map +1 -1
- package/lib/state/ui/index.d.ts +3 -0
- package/lib/state/ui/index.d.ts.map +1 -0
- package/lib/state/ui/index.js +2 -0
- package/lib/state/ui/index.js.map +1 -0
- package/lib/state/ui/mergeStored.d.ts +27 -0
- package/lib/state/ui/mergeStored.d.ts.map +1 -0
- package/lib/state/ui/mergeStored.js +82 -0
- package/lib/state/ui/mergeStored.js.map +1 -0
- package/lib/state/ui/persistBucket.d.ts +65 -0
- package/lib/state/ui/persistBucket.d.ts.map +1 -0
- package/lib/state/ui/persistBucket.js +90 -0
- package/lib/state/ui/persistBucket.js.map +1 -0
- package/lib/structure/core/editorValue.d.ts +69 -0
- package/lib/structure/core/editorValue.d.ts.map +1 -0
- package/lib/structure/core/editorValue.js +72 -0
- package/lib/structure/core/editorValue.js.map +1 -0
- package/lib/structure/core/fragmentQuery.d.ts +33 -0
- package/lib/structure/core/fragmentQuery.d.ts.map +1 -0
- package/lib/structure/core/fragmentQuery.js +37 -0
- package/lib/structure/core/fragmentQuery.js.map +1 -0
- package/lib/structure/core/index.d.ts +11 -0
- package/lib/structure/core/index.d.ts.map +1 -0
- package/lib/structure/core/index.js +6 -0
- package/lib/structure/core/index.js.map +1 -0
- package/lib/structure/core/molfile.d.ts +42 -0
- package/lib/structure/core/molfile.d.ts.map +1 -0
- package/lib/structure/core/molfile.js +74 -0
- package/lib/structure/core/molfile.js.map +1 -0
- package/lib/structure/core/readStructure.d.ts +37 -0
- package/lib/structure/core/readStructure.d.ts.map +1 -0
- package/lib/structure/core/readStructure.js +59 -0
- package/lib/structure/core/readStructure.js.map +1 -0
- package/lib/structure/core/structureSource.d.ts +34 -0
- package/lib/structure/core/structureSource.d.ts.map +1 -0
- package/lib/structure/core/structureSource.js +32 -0
- package/lib/structure/core/structureSource.js.map +1 -0
- package/lib/structure/core/toolbarFloor.d.ts +16 -0
- package/lib/structure/core/toolbarFloor.d.ts.map +1 -0
- package/lib/structure/core/toolbarFloor.js +27 -0
- package/lib/structure/core/toolbarFloor.js.map +1 -0
- package/lib/structure/ui/EditorCanvas.d.ts +55 -0
- package/lib/structure/ui/EditorCanvas.d.ts.map +1 -0
- package/lib/structure/ui/EditorCanvas.js +41 -0
- package/lib/structure/ui/EditorCanvas.js.map +1 -0
- package/lib/structure/ui/Structure.d.ts +122 -0
- package/lib/structure/ui/Structure.d.ts.map +1 -0
- package/lib/structure/ui/Structure.js +28 -0
- package/lib/structure/ui/Structure.js.map +1 -0
- package/lib/structure/ui/StructureEditor.d.ts +75 -0
- package/lib/structure/ui/StructureEditor.d.ts.map +1 -0
- package/lib/structure/ui/StructureEditor.js +83 -0
- package/lib/structure/ui/StructureEditor.js.map +1 -0
- package/lib/structure/ui/StructurePlaceholder.d.ts +29 -0
- package/lib/structure/ui/StructurePlaceholder.d.ts.map +1 -0
- package/lib/structure/ui/StructurePlaceholder.js +19 -0
- package/lib/structure/ui/StructurePlaceholder.js.map +1 -0
- package/lib/structure/ui/StructureSvg.d.ts +58 -0
- package/lib/structure/ui/StructureSvg.d.ts.map +1 -0
- package/lib/structure/ui/StructureSvg.js +33 -0
- package/lib/structure/ui/StructureSvg.js.map +1 -0
- package/lib/structure/ui/index.d.ts +19 -0
- package/lib/structure/ui/index.d.ts.map +1 -0
- package/lib/structure/ui/index.js +15 -0
- package/lib/structure/ui/index.js.map +1 -0
- package/lib/structure/ui/useToolbarFloor.d.ts +26 -0
- package/lib/structure/ui/useToolbarFloor.d.ts.map +1 -0
- package/lib/structure/ui/useToolbarFloor.js +70 -0
- package/lib/structure/ui/useToolbarFloor.js.map +1 -0
- package/lib/structure.d.ts +3 -0
- package/lib/structure.d.ts.map +1 -0
- package/lib/structure.js +3 -0
- package/lib/structure.js.map +1 -0
- package/lib/ui.d.ts +13 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +13 -0
- package/lib/ui.js.map +1 -1
- package/lib/worker/core/errors.d.ts +15 -0
- package/lib/worker/core/errors.d.ts.map +1 -0
- package/lib/worker/core/errors.js +15 -0
- package/lib/worker/core/errors.js.map +1 -0
- package/lib/worker/core/index.d.ts +5 -0
- package/lib/worker/core/index.d.ts.map +1 -0
- package/lib/worker/core/index.js +3 -0
- package/lib/worker/core/index.js.map +1 -0
- package/lib/worker/core/messages.d.ts +48 -0
- package/lib/worker/core/messages.d.ts.map +1 -0
- package/lib/worker/core/messages.js +2 -0
- package/lib/worker/core/messages.js.map +1 -0
- package/lib/worker/core/workerChannel.d.ts +69 -0
- package/lib/worker/core/workerChannel.d.ts.map +1 -0
- package/lib/worker/core/workerChannel.js +121 -0
- package/lib/worker/core/workerChannel.js.map +1 -0
- package/package.json +25 -4
- package/src/capsule/ui/CapsuleFilter.tsx +119 -0
- package/src/capsule/ui/index.ts +2 -0
- package/src/chrome/ui/NavLink.tsx +88 -0
- package/src/chrome/ui/NavMenuButton.tsx +95 -0
- package/src/chrome/ui/SiteFooter.tsx +65 -0
- package/src/chrome/ui/SiteHeader.tsx +119 -0
- package/src/chrome/ui/index.ts +11 -0
- package/src/chrome/ui/navItem.ts +60 -0
- package/src/chrome/ui/useCompactHeader.ts +81 -0
- package/src/citation/core/clipboard.ts +27 -11
- package/src/citation/core/download.ts +25 -15
- package/src/citation/core/index.ts +8 -3
- package/src/citation/core/works.ts +81 -0
- package/src/citation/ui/CitationMenu.tsx +104 -89
- package/src/citation/ui/CitationPreview.tsx +18 -8
- package/src/citation/ui/CiteButton.tsx +24 -9
- package/src/citation/ui/CopyFormatEntries.tsx +84 -0
- package/src/citation/ui/WorkEntry.tsx +80 -0
- package/src/citation/ui/entries.tsx +18 -20
- package/src/citation/ui/index.ts +10 -2
- package/src/citation/ui/useCopyFeedback.ts +76 -0
- package/src/clipboard/core/index.ts +1 -0
- package/src/clipboard/core/writeToClipboard.ts +47 -0
- package/src/clipboard/ui/CodeBlock.tsx +110 -0
- package/src/clipboard/ui/CopyButton.tsx +111 -0
- package/src/clipboard/ui/index.ts +9 -0
- package/src/clipboard/ui/useCopyToClipboard.ts +57 -0
- package/src/color/core/contrast.ts +85 -0
- package/src/color/core/hex.ts +57 -0
- package/src/color/core/index.ts +4 -0
- package/src/color/core/scale.ts +132 -0
- package/src/color/ui/ColorScaleLegend.tsx +144 -0
- package/src/color/ui/index.ts +2 -0
- package/src/core.ts +12 -0
- package/src/credits/core/credits.ts +183 -0
- package/src/credits/core/index.ts +2 -0
- package/src/credits/ui/CreditsList.tsx +82 -0
- package/src/credits/ui/index.ts +2 -0
- package/src/delimited/core/delimiters.ts +64 -0
- package/src/delimited/core/index.ts +11 -0
- package/src/delimited/core/readDelimited.ts +132 -0
- package/src/delimited/core/rowsToDelimited.ts +135 -0
- package/src/delimited/core/toDelimited.ts +69 -0
- package/src/delimited/ui/DelimitedTextDialog.tsx +49 -0
- package/src/delimited/ui/DelimitedTextPanel.tsx +161 -0
- package/src/delimited/ui/index.ts +4 -0
- package/src/disclosure/ui/CollapsibleSection.tsx +150 -0
- package/src/disclosure/ui/index.ts +4 -0
- package/src/disclosure/ui/useDisclosure.ts +35 -0
- package/src/download/core/downloadBlob.ts +19 -0
- package/src/download/core/downloadText.ts +19 -0
- package/src/download/core/index.ts +3 -0
- package/src/download/core/sanitizeFileName.ts +33 -0
- package/src/ecosystem/core/index.ts +3 -0
- package/src/ecosystem/core/links.ts +29 -0
- package/src/ecosystem/core/lookup.ts +41 -0
- package/src/ecosystem/core/sites.ts +38 -1
- package/src/ecosystem/core/tokens.ts +47 -0
- package/src/ecosystem/ui/SiteTheme.tsx +23 -0
- package/src/ecosystem/ui/Wordmark.tsx +65 -0
- package/src/ecosystem/ui/glyphs.tsx +246 -0
- package/src/ecosystem/ui/index.ts +4 -0
- package/src/ecosystem/ui/marks.tsx +56 -214
- package/src/error/ui/ErrorBoundary.tsx +94 -0
- package/src/error/ui/ErrorFallback.tsx +64 -0
- package/src/error/ui/index.ts +4 -0
- package/src/error/ui/toError.ts +33 -0
- package/src/format/core/index.ts +9 -0
- package/src/format/core/missing.ts +6 -0
- package/src/format/core/numbers.ts +84 -0
- package/src/format/core/units.ts +60 -0
- package/src/format/core/words.ts +17 -0
- package/src/help/ui/HelpBody.tsx +130 -0
- package/src/help/ui/HelpIcon.tsx +53 -0
- package/src/help/ui/HelpToolbarButton.tsx +72 -0
- package/src/help/ui/HelpTooltip.tsx +72 -0
- package/src/help/ui/index.ts +8 -0
- package/src/hooks/ui/index.ts +6 -0
- package/src/hooks/ui/listNavigation.ts +116 -0
- package/src/hooks/ui/useContainerSize.ts +32 -0
- package/src/hooks/ui/useDebouncedValue.ts +29 -0
- package/src/hooks/ui/useListKeyboardNavigation.ts +37 -0
- package/src/hooks/ui/useResizeObserver.ts +50 -0
- package/src/orbital/core/atomicGrid.ts +167 -0
- package/src/orbital/core/atomicOrbitals.ts +212 -0
- package/src/orbital/core/constants.ts +36 -0
- package/src/orbital/core/electronConfiguration.ts +242 -0
- package/src/orbital/core/grid.ts +126 -0
- package/src/orbital/core/hydrogenic.ts +222 -0
- package/src/orbital/core/index.ts +63 -0
- package/src/orbital/core/isovalue.ts +146 -0
- package/src/orbital/core/numerics.ts +79 -0
- package/src/orbital/core/occupancy.ts +100 -0
- package/src/orbital/core/palette.ts +56 -0
- package/src/orbital/core/realHarmonics.ts +172 -0
- package/src/orbital/core/sample.ts +111 -0
- package/src/orbital/core/screening.ts +90 -0
- package/src/orbital/ui/AtomicOrbitalCanvas.tsx +197 -0
- package/src/orbital/ui/AtomicOrbitalViewer.tsx +154 -0
- package/src/orbital/ui/camera.ts +125 -0
- package/src/orbital/ui/capability.ts +102 -0
- package/src/orbital/ui/index.ts +17 -0
- package/src/orbital/ui/renderVolume.ts +203 -0
- package/src/orbital/ui/viewer.ts +191 -0
- package/src/orbital/ui/volumeField.ts +84 -0
- package/src/orbital.ts +11 -0
- package/src/pedagogy/core/glossary.ts +122 -0
- package/src/pedagogy/core/index.ts +28 -0
- package/src/pedagogy/core/jsonStorage.ts +51 -0
- package/src/pedagogy/core/progress.ts +205 -0
- package/src/pedagogy/core/types.ts +78 -0
- package/src/pedagogy/core/validation.ts +109 -0
- package/src/pedagogy/ui/ExerciseActions.tsx +129 -0
- package/src/pedagogy/ui/ExerciseProgressHeader.tsx +135 -0
- package/src/pedagogy/ui/ExerciseTags.tsx +85 -0
- package/src/pedagogy/ui/GlossaryProvider.tsx +31 -0
- package/src/pedagogy/ui/GlossaryText.tsx +164 -0
- package/src/pedagogy/ui/HintLadder.tsx +95 -0
- package/src/pedagogy/ui/ReferenceGrid.tsx +69 -0
- package/src/pedagogy/ui/ReferenceSectionBlock.tsx +175 -0
- package/src/pedagogy/ui/SyntaxTooltip.tsx +222 -0
- package/src/pedagogy/ui/TestCaseList.tsx +122 -0
- package/src/pedagogy/ui/TutorialStepStrip.tsx +230 -0
- package/src/pedagogy/ui/exerciseMeta.ts +45 -0
- package/src/pedagogy/ui/glossaryContext.ts +23 -0
- package/src/pedagogy/ui/index.ts +37 -0
- package/src/pedagogy/ui/tutorialLevels.ts +27 -0
- package/src/router/core/address.ts +74 -0
- package/src/router/core/basePath.ts +76 -0
- package/src/router/core/index.ts +26 -0
- package/src/router/core/legacyHash.ts +77 -0
- package/src/router/core/pageAddresses.ts +106 -0
- package/src/router/core/query.ts +87 -0
- package/src/router/core/tabRouter.ts +214 -0
- package/src/seo/core/documentMeta.ts +92 -0
- package/src/seo/core/index.ts +6 -0
- package/src/share/core/config.ts +165 -0
- package/src/share/core/escape.ts +22 -0
- package/src/share/core/index.ts +31 -0
- package/src/share/core/params.ts +176 -0
- package/src/share/core/query.ts +72 -0
- package/src/share/core/url.ts +105 -0
- package/src/share/core/vocabulary.ts +60 -0
- package/src/share/ui/HiddenPartsProvider.tsx +34 -0
- package/src/share/ui/PagePart.tsx +26 -0
- package/src/share/ui/ShareButton.tsx +84 -0
- package/src/share/ui/ShareDialog.tsx +114 -0
- package/src/share/ui/ShareDialogContent.tsx +189 -0
- package/src/share/ui/SharePartOptions.tsx +51 -0
- package/src/share/ui/draft.ts +19 -0
- package/src/share/ui/hiddenParts.ts +22 -0
- package/src/share/ui/index.ts +9 -0
- package/src/shared/ui/index.ts +2 -1
- package/src/state/ui/index.ts +6 -0
- package/src/state/ui/mergeStored.ts +87 -0
- package/src/state/ui/persistBucket.ts +147 -0
- package/src/structure/core/editorValue.ts +116 -0
- package/src/structure/core/fragmentQuery.ts +50 -0
- package/src/structure/core/index.ts +13 -0
- package/src/structure/core/molfile.ts +90 -0
- package/src/structure/core/readStructure.ts +73 -0
- package/src/structure/core/structureSource.ts +57 -0
- package/src/structure/core/toolbarFloor.ts +31 -0
- package/src/structure/ui/EditorCanvas.tsx +130 -0
- package/src/structure/ui/Structure.tsx +183 -0
- package/src/structure/ui/StructureEditor.tsx +196 -0
- package/src/structure/ui/StructurePlaceholder.tsx +48 -0
- package/src/structure/ui/StructureSvg.tsx +110 -0
- package/src/structure/ui/index.ts +22 -0
- package/src/structure/ui/useToolbarFloor.ts +93 -0
- package/src/structure.ts +2 -0
- package/src/ui.ts +13 -0
- package/src/worker/core/errors.ts +15 -0
- package/src/worker/core/index.ts +8 -0
- package/src/worker/core/messages.ts +47 -0
- package/src/worker/core/workerChannel.ts +218 -0
- package/styles/chrome.css +223 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signed isosurfaces of a scalar field the caller sampled itself.
|
|
3
|
+
*
|
|
4
|
+
* Molstar can collocate an orbital on the GPU from a Gaussian basis, but that
|
|
5
|
+
* path cannot draw an *atomic* orbital: a hydrogen-like radial function has
|
|
6
|
+
* nodes, and an f orbital an angular momentum, that a valence STO-3G basis
|
|
7
|
+
* simply does not carry. So `core/atomicGrid.ts` samples the wavefunction
|
|
8
|
+
* itself, in ångström, and this module wraps the result in the `Volume`
|
|
9
|
+
* molstar's isosurface renderer wants.
|
|
10
|
+
*
|
|
11
|
+
* The two phases come from one field and one isovalue, so they can never
|
|
12
|
+
* disagree about where the node is. The representations live outside the state
|
|
13
|
+
* tree and are tracked per plugin, because every change of orbital replaces
|
|
14
|
+
* them wholesale.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { Volume } from 'molstar/lib/mol-model/volume.js';
|
|
18
|
+
import type { PluginContext } from 'molstar/lib/mol-plugin/context.js';
|
|
19
|
+
import { createVolumeRepresentationParams } from 'molstar/lib/mol-plugin-state/helpers/volume-representation-params.js';
|
|
20
|
+
import type { Representation } from 'molstar/lib/mol-repr/representation.js';
|
|
21
|
+
import { Theme } from 'molstar/lib/mol-theme/theme.js';
|
|
22
|
+
import { Color } from 'molstar/lib/mol-util/color/color.js';
|
|
23
|
+
|
|
24
|
+
import type { OrbitalGrid } from '../core/grid.ts';
|
|
25
|
+
import type { OrbitalContour } from '../core/isovalue.ts';
|
|
26
|
+
|
|
27
|
+
import { DISPLAY_REACH, toVolume } from './volumeField.ts';
|
|
28
|
+
|
|
29
|
+
/** Colours and opacity of one signed isosurface pair. */
|
|
30
|
+
export interface VolumeStyle {
|
|
31
|
+
/**
|
|
32
|
+
* Lobe where the wavefunction is positive, as `#rrggbb`.
|
|
33
|
+
* @default '#2563eb'
|
|
34
|
+
*/
|
|
35
|
+
positiveColour?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Lobe where the wavefunction is negative, as `#rrggbb`.
|
|
38
|
+
* @default '#dc2626'
|
|
39
|
+
*/
|
|
40
|
+
negativeColour?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Isovalue as a multiple of the contour's own cutoff. Larger means a
|
|
43
|
+
* tighter, smaller surface.
|
|
44
|
+
* @default 1
|
|
45
|
+
*/
|
|
46
|
+
relativeIsovalue?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Surface opacity. Below 1 the far lobes show through the near ones.
|
|
49
|
+
* @default 0.72
|
|
50
|
+
*/
|
|
51
|
+
alpha?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Replace the isosurface pair drawn from a sampled field.
|
|
56
|
+
* @param plugin - The molstar context.
|
|
57
|
+
* @param field - The field, as `sampleAtomicOrbital` produced it.
|
|
58
|
+
* @param contour - The isovalue and reach measured on that field, as
|
|
59
|
+
* `runAtomicSample` returned them.
|
|
60
|
+
* @param style - See {@link VolumeStyle}.
|
|
61
|
+
* @returns How far the drawn surface reaches from the centre of the box,
|
|
62
|
+
* ångström — what a camera has to frame to fill the viewport with it.
|
|
63
|
+
* @throws {Error} When the canvas is not ready.
|
|
64
|
+
*/
|
|
65
|
+
export async function renderSampledVolume(
|
|
66
|
+
plugin: PluginContext,
|
|
67
|
+
field: OrbitalGrid,
|
|
68
|
+
contour: OrbitalContour,
|
|
69
|
+
style: VolumeStyle = {},
|
|
70
|
+
): Promise<number> {
|
|
71
|
+
const canvas3d = plugin.canvas3d;
|
|
72
|
+
if (canvas3d === undefined) {
|
|
73
|
+
throw new Error('renderSampledVolume: the molstar canvas is not ready.');
|
|
74
|
+
}
|
|
75
|
+
const {
|
|
76
|
+
positiveColour = '#2563eb',
|
|
77
|
+
negativeColour = '#dc2626',
|
|
78
|
+
relativeIsovalue = 1,
|
|
79
|
+
alpha = 0.72,
|
|
80
|
+
} = style;
|
|
81
|
+
clearSampledVolume(plugin);
|
|
82
|
+
|
|
83
|
+
const { cutoff, reach } = contour;
|
|
84
|
+
// Molstar's camera clamps both its target distance and its near plane, so it
|
|
85
|
+
// cannot get close to a small object: uranium's 4f reaches 0.35 Å and would
|
|
86
|
+
// stay a dot in the corner whatever the camera is asked to frame. Every
|
|
87
|
+
// orbital is therefore drawn at one canonical size, and the true extent is
|
|
88
|
+
// reported as ⟨r⟩ and on the radial plot instead of by the picture's scale.
|
|
89
|
+
const volume = toVolume(field, reach > 0 ? DISPLAY_REACH / reach : 1);
|
|
90
|
+
// A nodeless orbital — every 1s — has no negative lobe at all, and asking for
|
|
91
|
+
// its isosurface would draw an empty mesh at value 0.
|
|
92
|
+
const surfaces = await Promise.all([
|
|
93
|
+
maybeSurface(
|
|
94
|
+
plugin,
|
|
95
|
+
volume,
|
|
96
|
+
field.max >= cutoff ? cutoff : undefined,
|
|
97
|
+
relativeIsovalue,
|
|
98
|
+
{ colour: positiveColour, alpha },
|
|
99
|
+
),
|
|
100
|
+
maybeSurface(
|
|
101
|
+
plugin,
|
|
102
|
+
volume,
|
|
103
|
+
field.min <= -cutoff ? -cutoff : undefined,
|
|
104
|
+
relativeIsovalue,
|
|
105
|
+
{ colour: negativeColour, alpha },
|
|
106
|
+
),
|
|
107
|
+
]);
|
|
108
|
+
const drawn = surfaces.filter(
|
|
109
|
+
(surface): surface is Representation.Any => surface !== null,
|
|
110
|
+
);
|
|
111
|
+
representations.set(plugin, drawn);
|
|
112
|
+
for (const representation of drawn) canvas3d.add(representation);
|
|
113
|
+
// add() only queues; nothing appears until the queue is committed.
|
|
114
|
+
canvas3d.commit();
|
|
115
|
+
return reach > 0 ? DISPLAY_REACH : 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Remove the sampled isosurfaces, leaving anything else on the canvas.
|
|
120
|
+
* @param plugin - The molstar context.
|
|
121
|
+
*/
|
|
122
|
+
export function clearSampledVolume(plugin: PluginContext): void {
|
|
123
|
+
const previous = representations.get(plugin);
|
|
124
|
+
if (previous === undefined) return;
|
|
125
|
+
representations.delete(plugin);
|
|
126
|
+
for (const representation of previous) {
|
|
127
|
+
plugin.canvas3d?.remove(representation);
|
|
128
|
+
}
|
|
129
|
+
plugin.canvas3d?.commit();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* One phase's surface, or nothing when the field never reaches that sign.
|
|
134
|
+
* @param plugin - The molstar context.
|
|
135
|
+
* @param volume - The volume the surface is built from.
|
|
136
|
+
* @param isovalue - Absolute isovalue of the surface.
|
|
137
|
+
* @param relativeIsovalue - Multiplier applied to it.
|
|
138
|
+
* @param style - Colour and opacity of the surface.
|
|
139
|
+
* @param style.colour - Surface colour, as `#rrggbb`.
|
|
140
|
+
* @param style.alpha - Surface opacity.
|
|
141
|
+
* @returns The surface representation.
|
|
142
|
+
*/
|
|
143
|
+
async function maybeSurface(
|
|
144
|
+
plugin: PluginContext,
|
|
145
|
+
volume: Volume,
|
|
146
|
+
isovalue: number | undefined,
|
|
147
|
+
relativeIsovalue: number,
|
|
148
|
+
style: { colour: string; alpha: number },
|
|
149
|
+
): Promise<Representation.Any | null> {
|
|
150
|
+
if (isovalue === undefined || isovalue === 0) return null;
|
|
151
|
+
return createSurface(
|
|
152
|
+
plugin,
|
|
153
|
+
volume,
|
|
154
|
+
isovalue * relativeIsovalue,
|
|
155
|
+
style.colour,
|
|
156
|
+
style.alpha,
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
async function createSurface(
|
|
161
|
+
plugin: PluginContext,
|
|
162
|
+
volume: Volume,
|
|
163
|
+
isovalue: number,
|
|
164
|
+
colour: string,
|
|
165
|
+
alpha: number,
|
|
166
|
+
): Promise<Representation.Any> {
|
|
167
|
+
const params = createVolumeRepresentationParams(plugin, volume, {
|
|
168
|
+
type: 'isosurface',
|
|
169
|
+
typeParams: {
|
|
170
|
+
isoValue: { kind: 'absolute', absoluteValue: isovalue },
|
|
171
|
+
alpha,
|
|
172
|
+
xrayShaded: true,
|
|
173
|
+
// Molstar's GPU marching cubes pits the outer lobe of a diffuse orbital
|
|
174
|
+
// with voxel-sized dimples — caesium's 6s and every 7s, 6d and 7p above
|
|
175
|
+
// it — and quantises the field to 255 steps on upload unless told
|
|
176
|
+
// otherwise, which terraces xenon's 4p. The surface is a thin shell
|
|
177
|
+
// whatever the box holds, so the CPU path costs 13–44 ms and returns
|
|
178
|
+
// 27 k vertices even on the 152³ grid the highest quality asks for.
|
|
179
|
+
tryUseGpu: false,
|
|
180
|
+
},
|
|
181
|
+
color: 'uniform',
|
|
182
|
+
colorParams: { value: Color.fromHexStyle(colour) },
|
|
183
|
+
});
|
|
184
|
+
const provider = plugin.representation.volume.registry.get(params.type.name);
|
|
185
|
+
const representation = provider.factory(
|
|
186
|
+
{ webgl: plugin.canvas3d?.webgl, ...plugin.representation.volume.themes },
|
|
187
|
+
provider.getParams,
|
|
188
|
+
);
|
|
189
|
+
representation.setTheme(
|
|
190
|
+
Theme.create(plugin.representation.volume.themes, { volume }, params),
|
|
191
|
+
);
|
|
192
|
+
await plugin.runTask(
|
|
193
|
+
representation.createOrUpdate(params.type.params ?? {}, volume),
|
|
194
|
+
);
|
|
195
|
+
representation.setState({ pickable: false });
|
|
196
|
+
return representation;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* One pair of surfaces per plugin. They are outside the state tree, like the
|
|
201
|
+
* cartoon lobes, because every change of orbital replaces them entirely.
|
|
202
|
+
*/
|
|
203
|
+
const representations = new WeakMap<PluginContext, Representation.Any[]>();
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle of one molstar canvas, and the only object the components hold on
|
|
3
|
+
* to.
|
|
4
|
+
*
|
|
5
|
+
* `createOrbitalViewer` is **synchronous** on purpose. React 19 runs an effect,
|
|
6
|
+
* its cleanup and the effect again on every mount in development, so an
|
|
7
|
+
* `await`ed constructor hands the cleanup nothing to dispose and leaks a WebGL
|
|
8
|
+
* context per mount — browsers drop the oldest one after about sixteen, and the
|
|
9
|
+
* viewer silently goes blank. Returning the handle immediately means
|
|
10
|
+
* `dispose()` can always be called, even before initialisation has finished;
|
|
11
|
+
* the work is queued behind `ready`.
|
|
12
|
+
*
|
|
13
|
+
* molstar's own UI is not mounted: the surrounding site owns every control.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { PluginViewModel } from 'molstar/lib/extensions/plugin/view-model.js';
|
|
17
|
+
import type { PluginContext } from 'molstar/lib/mol-plugin/context.js';
|
|
18
|
+
// Lowercased on import: it is a factory, not a constructor.
|
|
19
|
+
import { DefaultPluginSpec as defaultPluginSpec } from 'molstar/lib/mol-plugin/spec.js';
|
|
20
|
+
import { Color } from 'molstar/lib/mol-util/color/color.js';
|
|
21
|
+
|
|
22
|
+
import type { OrbitalGrid } from '../core/grid.ts';
|
|
23
|
+
import type { OrbitalContour } from '../core/isovalue.ts';
|
|
24
|
+
|
|
25
|
+
import { DEFAULT_CAMERA_DURATION, frameOrbital, setSpin } from './camera.ts';
|
|
26
|
+
import type { VolumeStyle } from './renderVolume.ts';
|
|
27
|
+
import { clearSampledVolume, renderSampledVolume } from './renderVolume.ts';
|
|
28
|
+
|
|
29
|
+
/** Settings fixed for the life of a viewer. */
|
|
30
|
+
export interface OrbitalViewerOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Scene background, as `#rrggbb`.
|
|
33
|
+
* @default '#ffffff'
|
|
34
|
+
*/
|
|
35
|
+
background?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Create a viewer inside `container` and start initialising it.
|
|
40
|
+
* @param container - An element with `position: relative`; molstar inserts its
|
|
41
|
+
* own canvas into it.
|
|
42
|
+
* @param options - See {@link OrbitalViewerOptions}.
|
|
43
|
+
* @returns A handle that is safe to dispose immediately.
|
|
44
|
+
*/
|
|
45
|
+
export function createOrbitalViewer(
|
|
46
|
+
container: HTMLElement,
|
|
47
|
+
options: OrbitalViewerOptions = {},
|
|
48
|
+
): OrbitalViewer {
|
|
49
|
+
return new OrbitalViewer(container, options);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* One molstar canvas showing one atomic orbital.
|
|
54
|
+
*
|
|
55
|
+
* Every method resolves to nothing once `dispose` has been called, so a
|
|
56
|
+
* render started by an unmounting component cannot throw into React.
|
|
57
|
+
*/
|
|
58
|
+
export class OrbitalViewer {
|
|
59
|
+
readonly #model: PluginViewModel;
|
|
60
|
+
#disposed = false;
|
|
61
|
+
|
|
62
|
+
/** Resolves once the canvas exists; every method awaits it internally. */
|
|
63
|
+
readonly ready: Promise<void>;
|
|
64
|
+
|
|
65
|
+
constructor(container: HTMLElement, options: OrbitalViewerOptions = {}) {
|
|
66
|
+
const { background = '#ffffff' } = options;
|
|
67
|
+
const spec = defaultPluginSpec();
|
|
68
|
+
this.#model = new PluginViewModel({
|
|
69
|
+
spec: {
|
|
70
|
+
...spec,
|
|
71
|
+
canvas3d: {
|
|
72
|
+
...spec.canvas3d,
|
|
73
|
+
renderer: { backgroundColor: Color.fromHexStyle(background) },
|
|
74
|
+
camera: { helper: { axes: { name: 'off', params: {} } } },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
this.#model.mount(container);
|
|
79
|
+
this.ready = this.#model.initialized;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Whether `dispose` has been called.
|
|
84
|
+
* @returns True once the viewer has been disposed.
|
|
85
|
+
*/
|
|
86
|
+
get disposed(): boolean {
|
|
87
|
+
return this.#disposed;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Replace the isosurface pair with one drawn from a sampled field.
|
|
92
|
+
* @param field - The sampled wavefunction, in ångström.
|
|
93
|
+
* @param contour - The isovalue and reach measured on that field.
|
|
94
|
+
* @param style - See {@link VolumeStyle}.
|
|
95
|
+
* @returns How far the drawn surface reaches, in scene units, for the camera
|
|
96
|
+
* to frame; `undefined` once the viewer has been disposed.
|
|
97
|
+
*/
|
|
98
|
+
showOrbital(
|
|
99
|
+
field: OrbitalGrid,
|
|
100
|
+
contour: OrbitalContour,
|
|
101
|
+
style?: VolumeStyle,
|
|
102
|
+
): Promise<number | undefined> {
|
|
103
|
+
return this.#run((plugin) =>
|
|
104
|
+
renderSampledVolume(plugin, field, contour, style),
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Remove the isosurface pair.
|
|
110
|
+
* @returns Nothing, once the surfaces are gone.
|
|
111
|
+
*/
|
|
112
|
+
hideOrbital(): Promise<void> {
|
|
113
|
+
return this.#run((plugin) => {
|
|
114
|
+
clearSampledVolume(plugin);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Frame the scene from an oblique angle with z up — how a lone atom's
|
|
120
|
+
* orbital has to be seen for its lobes to be told apart.
|
|
121
|
+
* @param orbitalRadius - Extent of the drawn surface; the scene's own
|
|
122
|
+
* bounding sphere is used when omitted.
|
|
123
|
+
* @param durationMs - Transition length; 0 jumps.
|
|
124
|
+
* @returns Nothing, once the camera has been set.
|
|
125
|
+
*/
|
|
126
|
+
frame(
|
|
127
|
+
orbitalRadius?: number,
|
|
128
|
+
durationMs = DEFAULT_CAMERA_DURATION,
|
|
129
|
+
): Promise<void> {
|
|
130
|
+
return this.#run((plugin) => {
|
|
131
|
+
frameOrbital(plugin, orbitalRadius, durationMs);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Turn the automatic spin on or off.
|
|
137
|
+
* @param spinning - Whether the scene should keep turning.
|
|
138
|
+
* @param speed - molstar's own spin unit.
|
|
139
|
+
* @returns Nothing, once the spin has been switched.
|
|
140
|
+
*/
|
|
141
|
+
setSpin(spinning: boolean, speed = 1): Promise<void> {
|
|
142
|
+
return this.#run((plugin) => {
|
|
143
|
+
setSpin(plugin, spinning, speed);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** Re-read the container's size. Call from a `ResizeObserver`. */
|
|
148
|
+
handleResize(): void {
|
|
149
|
+
if (this.#disposed) return;
|
|
150
|
+
this.#model.plugin.handleResize();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Tear the viewer down and release its WebGL context. Idempotent, and safe to
|
|
155
|
+
* call before initialisation has finished.
|
|
156
|
+
*/
|
|
157
|
+
dispose(): void {
|
|
158
|
+
if (this.#disposed) return;
|
|
159
|
+
this.#disposed = true;
|
|
160
|
+
// `mount` creates the canvas synchronously, so the WebGL context exists
|
|
161
|
+
// even when initialisation went on to fail; releasing it is what stops the
|
|
162
|
+
// browser dropping an older viewer's context. A rejected `ready` must not
|
|
163
|
+
// escape here either — nobody is left to handle it.
|
|
164
|
+
void this.ready
|
|
165
|
+
.catch(() => undefined)
|
|
166
|
+
.then(() => {
|
|
167
|
+
this.#model.plugin.dispose();
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Wait for initialisation, then run `action` on the plugin. Resolves to
|
|
173
|
+
* `undefined` when the viewer was disposed, before the call or while `action`
|
|
174
|
+
* was still running; an initialisation failure still reaches the caller.
|
|
175
|
+
* @param action - What to run once the canvas is ready.
|
|
176
|
+
* @returns What `action` returned, or `undefined` when disposed.
|
|
177
|
+
*/
|
|
178
|
+
async #run<Result>(
|
|
179
|
+
action: (plugin: PluginContext) => Result | Promise<Result>,
|
|
180
|
+
): Promise<Result | undefined> {
|
|
181
|
+
if (this.#disposed) return undefined;
|
|
182
|
+
await this.ready;
|
|
183
|
+
if (this.#disposed) return undefined;
|
|
184
|
+
try {
|
|
185
|
+
return await action(this.#model.plugin);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
if (this.#disposed) return undefined;
|
|
188
|
+
throw error;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning a field the caller sampled into the `Volume` molstar's isosurface
|
|
3
|
+
* renderer wants.
|
|
4
|
+
*
|
|
5
|
+
* It is arithmetic over the samples, which is why it is here rather than in
|
|
6
|
+
* `renderVolume.ts` — that module is about representations. How far the
|
|
7
|
+
* surface inside the box reaches is measured in `core/isovalue.ts`, beside the
|
|
8
|
+
* isovalue it is measured against.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Mat4, Tensor, Vec3 } from 'molstar/lib/mol-math/linear-algebra.js';
|
|
12
|
+
import { CustomProperties } from 'molstar/lib/mol-model/custom-property.js';
|
|
13
|
+
import type { Grid, Volume } from 'molstar/lib/mol-model/volume.js';
|
|
14
|
+
|
|
15
|
+
import type { OrbitalGrid } from '../core/grid.ts';
|
|
16
|
+
|
|
17
|
+
// Lowercased on destructuring: both are factories, not constructors.
|
|
18
|
+
const { Space: createTensorSpace, Data1: asTensorData } = Tensor;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Radius, in scene units, every atomic orbital is drawn at.
|
|
22
|
+
*
|
|
23
|
+
* Comfortably clear of molstar's `minNear` of 5 and of the floor its camera
|
|
24
|
+
* puts under the target distance, both of which make a sub-ångström object
|
|
25
|
+
* impossible to fill the frame with.
|
|
26
|
+
*/
|
|
27
|
+
export const DISPLAY_REACH = 12;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Wrap a sampled field in molstar's `Volume`.
|
|
31
|
+
*
|
|
32
|
+
* The grid-to-cartesian transform is built here rather than through the
|
|
33
|
+
* alpha-orbitals helper, which expects its box in bohr and converts on the way
|
|
34
|
+
* out; our fields are already in ångström and a round trip through two slightly
|
|
35
|
+
* different bohr constants is a needless source of drift.
|
|
36
|
+
* @param field - The sampled field.
|
|
37
|
+
* @param displayScale - Factor applied to every coordinate, so a tight orbital
|
|
38
|
+
* can be drawn at a size the camera can actually frame.
|
|
39
|
+
* @returns The volume, ready for an isosurface representation.
|
|
40
|
+
*/
|
|
41
|
+
export function toVolume(field: OrbitalGrid, displayScale: number): Volume {
|
|
42
|
+
const { data, dimensions, origin, spacing, min, max, mean, sigma } = field;
|
|
43
|
+
const step = spacing * displayScale;
|
|
44
|
+
const scale = Mat4.fromScaling(Mat4.zero(), Vec3.create(step, step, step));
|
|
45
|
+
const translate = Mat4.fromTranslation(
|
|
46
|
+
Mat4.zero(),
|
|
47
|
+
Vec3.create(
|
|
48
|
+
origin.x * displayScale,
|
|
49
|
+
origin.y * displayScale,
|
|
50
|
+
origin.z * displayScale,
|
|
51
|
+
),
|
|
52
|
+
);
|
|
53
|
+
const grid: Grid = {
|
|
54
|
+
transform: {
|
|
55
|
+
kind: 'matrix',
|
|
56
|
+
matrix: Mat4.mul(Mat4.zero(), translate, scale),
|
|
57
|
+
},
|
|
58
|
+
// [0, 1, 2] is the axis order `evaluateGrid` writes: z varies fastest.
|
|
59
|
+
cells: Tensor.create(
|
|
60
|
+
createTensorSpace(dimensions, [0, 1, 2], Float32Array),
|
|
61
|
+
asTensorData(data),
|
|
62
|
+
),
|
|
63
|
+
stats: {
|
|
64
|
+
min,
|
|
65
|
+
max,
|
|
66
|
+
mean,
|
|
67
|
+
// molstar's `sigma` is the root mean square, not the standard deviation,
|
|
68
|
+
// and its volume themes read it that way.
|
|
69
|
+
sigma: Math.hypot(sigma, mean),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
grid,
|
|
74
|
+
instances: [{ transform: Mat4.identity() }],
|
|
75
|
+
sourceData: {
|
|
76
|
+
name: 'react-cheminfo sampled orbital',
|
|
77
|
+
kind: 'atomic-orbital-field',
|
|
78
|
+
data,
|
|
79
|
+
},
|
|
80
|
+
customProperties: new CustomProperties(),
|
|
81
|
+
_propertyData: Object.create(null) as Record<string, unknown>,
|
|
82
|
+
_localPropertyData: Object.create(null) as Record<string, unknown>,
|
|
83
|
+
};
|
|
84
|
+
}
|
package/src/orbital.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The molstar-backed orbital viewer.
|
|
3
|
+
*
|
|
4
|
+
* A third entry point, and not part of `react-cheminfo/ui`, because molstar is
|
|
5
|
+
* several megabytes: a site that only wants the Tools menu must never be made
|
|
6
|
+
* to carry it. Everything here is React; the maths these components draw is in
|
|
7
|
+
* `react-cheminfo/core` and needs neither React nor molstar, so a worker can
|
|
8
|
+
* import it on its own.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export * from './orbital/ui/index.ts';
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `[[term]]` marker language, parsed without a DOM.
|
|
3
|
+
*
|
|
4
|
+
* Authored prose — tutorial steps, exercise descriptions, hints — links its
|
|
5
|
+
* jargon by wrapping it in `[[double brackets]]`. A marker may be written
|
|
6
|
+
* `[[term|displayed text]]` when the sentence needs a different wording than
|
|
7
|
+
* the glossary key. Parsing and resolution live here, in plain TypeScript, so
|
|
8
|
+
* both are unit-tested without rendering anything.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** One worked example inside a glossary entry. */
|
|
12
|
+
export interface GlossaryExample {
|
|
13
|
+
/** The construct itself: a pattern, a SMILES, a LaTeX fragment, a layer. */
|
|
14
|
+
code: string;
|
|
15
|
+
/**
|
|
16
|
+
* What the construct is shown working on, for a term whose examples take an
|
|
17
|
+
* input. Left out when the example is about notation only.
|
|
18
|
+
* @default undefined
|
|
19
|
+
*/
|
|
20
|
+
input?: string;
|
|
21
|
+
/**
|
|
22
|
+
* What this example demonstrates, in one line.
|
|
23
|
+
* @default undefined
|
|
24
|
+
*/
|
|
25
|
+
note?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** One glossary term, shown wherever a `[[marker]]` names it. */
|
|
29
|
+
export interface GlossaryEntry {
|
|
30
|
+
/** The term, spelled out as the heading of the tooltip. */
|
|
31
|
+
title: string;
|
|
32
|
+
/** One short paragraph — the whole definition. */
|
|
33
|
+
summary: string;
|
|
34
|
+
/** Worked examples, shown under the summary. */
|
|
35
|
+
examples: GlossaryExample[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Every term a site defines, keyed by the lowercased text inside a `[[...]]`.
|
|
40
|
+
*
|
|
41
|
+
* A key that no marker names is simply never shown, and a marker naming no key
|
|
42
|
+
* renders as plain prose — so the two sides may be written in either order.
|
|
43
|
+
*/
|
|
44
|
+
export type Glossary = Record<string, GlossaryEntry>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* One piece of parsed prose: either a run of text, or one marker.
|
|
48
|
+
*
|
|
49
|
+
* `start` is the offset of the piece in the source string, which makes it a
|
|
50
|
+
* stable and unique React key — an array index is neither.
|
|
51
|
+
*/
|
|
52
|
+
export type GlossarySegment =
|
|
53
|
+
| { kind: 'text'; start: number; text: string }
|
|
54
|
+
| { kind: 'term'; start: number; term: string; text: string };
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Split authored prose into prose runs and markers.
|
|
58
|
+
*
|
|
59
|
+
* A marker yields the lowercased lookup `term` and the `text` to display, which
|
|
60
|
+
* are the same thing unless the marker used the `term|text` form. The term is
|
|
61
|
+
* never checked against any glossary here: an unknown term still produces a
|
|
62
|
+
* `term` segment, and the renderer falls back to showing its text as plain
|
|
63
|
+
* prose — an author may link a term months before it is written, and the page
|
|
64
|
+
* must never show the brackets. Text that never closes its brackets (`[[foo`)
|
|
65
|
+
* is not a marker at all and comes back verbatim inside a `text` segment.
|
|
66
|
+
* @param text - Authored prose, with or without markers.
|
|
67
|
+
* @returns The segments, in order, with no empty run between adjacent markers.
|
|
68
|
+
*/
|
|
69
|
+
export function parseGlossaryMarkers(text: string): GlossarySegment[] {
|
|
70
|
+
const segments: GlossarySegment[] = [];
|
|
71
|
+
// A fresh regexp per call: a /g/ literal carries `lastIndex` between calls.
|
|
72
|
+
const marker = new RegExp(MARKER_SOURCE, 'g');
|
|
73
|
+
let cursor = 0;
|
|
74
|
+
let match = marker.exec(text);
|
|
75
|
+
while (match !== null) {
|
|
76
|
+
if (match.index > cursor) {
|
|
77
|
+
segments.push({
|
|
78
|
+
kind: 'text',
|
|
79
|
+
start: cursor,
|
|
80
|
+
text: text.slice(cursor, match.index),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
segments.push(toTermSegment(match.groups?.term ?? '', match.index));
|
|
84
|
+
cursor = match.index + match[0].length;
|
|
85
|
+
match = marker.exec(text);
|
|
86
|
+
}
|
|
87
|
+
if (cursor < text.length) {
|
|
88
|
+
segments.push({ kind: 'text', start: cursor, text: text.slice(cursor) });
|
|
89
|
+
}
|
|
90
|
+
return segments;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Resolve a marker term against a glossary, case-insensitively.
|
|
95
|
+
* @param glossary - The terms the site defines.
|
|
96
|
+
* @param term - The text before the pipe of a `[[marker]]`, in any case.
|
|
97
|
+
* @returns The entry, or `undefined` when no such term has been written yet.
|
|
98
|
+
*/
|
|
99
|
+
export function lookupGlossaryTerm(
|
|
100
|
+
glossary: Glossary,
|
|
101
|
+
term: string,
|
|
102
|
+
): GlossaryEntry | undefined {
|
|
103
|
+
const key = term.trim().toLowerCase();
|
|
104
|
+
// `[[constructor]]` and `[[tostring]]` are prose, not inherited members.
|
|
105
|
+
return Object.hasOwn(glossary, key) ? glossary[key] : undefined;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const MARKER_SOURCE = String.raw`\[\[(?<term>[^\]]+)\]\]`;
|
|
109
|
+
|
|
110
|
+
function toTermSegment(inner: string, start: number): GlossarySegment {
|
|
111
|
+
const pipe = inner.indexOf('|');
|
|
112
|
+
const rawTerm = pipe === -1 ? inner : inner.slice(0, pipe);
|
|
113
|
+
const rawText = pipe === -1 ? inner : inner.slice(pipe + 1);
|
|
114
|
+
const term = rawTerm.trim().toLowerCase();
|
|
115
|
+
const text = rawText.trim();
|
|
116
|
+
return {
|
|
117
|
+
kind: 'term',
|
|
118
|
+
start,
|
|
119
|
+
term,
|
|
120
|
+
text: text === '' ? rawTerm.trim() : text,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
Glossary,
|
|
3
|
+
GlossaryEntry,
|
|
4
|
+
GlossaryExample,
|
|
5
|
+
GlossarySegment,
|
|
6
|
+
} from './glossary.ts';
|
|
7
|
+
export { parseGlossaryMarkers } from './glossary.ts';
|
|
8
|
+
export type {
|
|
9
|
+
ExerciseProgress,
|
|
10
|
+
LocalStorageProgressStoreOptions,
|
|
11
|
+
ProgressRecords,
|
|
12
|
+
ProgressStore,
|
|
13
|
+
ProgressSummary,
|
|
14
|
+
} from './progress.ts';
|
|
15
|
+
export { localStorageProgressStore, progressSummary } from './progress.ts';
|
|
16
|
+
export type {
|
|
17
|
+
BaseExercise,
|
|
18
|
+
ExerciseLevel,
|
|
19
|
+
ExerciseSet,
|
|
20
|
+
ExerciseStatus,
|
|
21
|
+
TutorialStep,
|
|
22
|
+
} from './types.ts';
|
|
23
|
+
export type {
|
|
24
|
+
FinishValidationOptions,
|
|
25
|
+
TestCaseResult,
|
|
26
|
+
ValidationResult,
|
|
27
|
+
} from './validation.ts';
|
|
28
|
+
export { failedValidation, finishValidation } from './validation.ts';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Best-effort JSON access to `localStorage`.
|
|
3
|
+
*
|
|
4
|
+
* A page framed in a course may have no storage at all — third-party storage is
|
|
5
|
+
* partitioned in Chrome and blocked in Safari — and a full quota must never
|
|
6
|
+
* take the page down with it. So both calls swallow everything: an unreadable
|
|
7
|
+
* entry reads as nothing stored, and a refused write is simply lost.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Read one entry back as JSON.
|
|
12
|
+
* @param key - The storage key.
|
|
13
|
+
* @returns What was parsed, or `undefined` when there is nothing readable.
|
|
14
|
+
*/
|
|
15
|
+
export function readJsonEntry(key: string): unknown {
|
|
16
|
+
const storage = getStorage();
|
|
17
|
+
if (storage === null) return undefined;
|
|
18
|
+
try {
|
|
19
|
+
const raw = storage.getItem(key);
|
|
20
|
+
if (raw === null) return undefined;
|
|
21
|
+
return JSON.parse(raw) as unknown;
|
|
22
|
+
} catch {
|
|
23
|
+
// Corrupt JSON, or a store that refuses to be read.
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Write one entry as JSON.
|
|
30
|
+
* @param key - The storage key.
|
|
31
|
+
* @param value - What to store.
|
|
32
|
+
*/
|
|
33
|
+
export function writeJsonEntry(key: string, value: unknown): void {
|
|
34
|
+
const storage = getStorage();
|
|
35
|
+
if (storage === null) return;
|
|
36
|
+
try {
|
|
37
|
+
storage.setItem(key, JSON.stringify(value));
|
|
38
|
+
} catch {
|
|
39
|
+
// Quota exceeded, or a store that refuses to be written.
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getStorage(): Storage | null {
|
|
44
|
+
try {
|
|
45
|
+
const candidate = globalThis.localStorage as Storage | undefined;
|
|
46
|
+
return candidate ?? null;
|
|
47
|
+
} catch {
|
|
48
|
+
// Reading localStorage throws outright when storage is blocked.
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|