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,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keep the head in step with the page on screen after an in-app move.
|
|
3
|
+
*
|
|
4
|
+
* The server, or the build that wrote one file per address, already titled the
|
|
5
|
+
* page it handed out; this is what a click inside the app changes, and what a
|
|
6
|
+
* crawler that renders the page reads afterwards. Every access to the document
|
|
7
|
+
* is guarded, so a prerender script importing this under Node does nothing
|
|
8
|
+
* rather than throwing.
|
|
9
|
+
* @param meta - What the page on screen is called and where it is indexed.
|
|
10
|
+
*/
|
|
11
|
+
export function writeDocumentMeta(meta: DocumentMeta): void {
|
|
12
|
+
if (typeof document === 'undefined') return;
|
|
13
|
+
documentTitle(meta.title);
|
|
14
|
+
if (meta.description !== undefined) metaDescription(meta.description);
|
|
15
|
+
if (meta.canonical !== undefined) canonicalLink(meta.canonical);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Name the browser tab.
|
|
20
|
+
* @param title - The title of the page, site name included.
|
|
21
|
+
*/
|
|
22
|
+
export function documentTitle(title: string): void {
|
|
23
|
+
if (typeof document === 'undefined') return;
|
|
24
|
+
document.title = title;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Point the canonical link at the address the page is indexed under, creating
|
|
29
|
+
* the tag when the served page carries none.
|
|
30
|
+
*
|
|
31
|
+
* The query string is dropped, and so is any fragment: the structure being
|
|
32
|
+
* edited and the configuration a shared link carries are not pages of their
|
|
33
|
+
* own, and indexing them as such splits one result into hundreds.
|
|
34
|
+
* @param href - The address of the page, absolute so a crawler can resolve it.
|
|
35
|
+
*/
|
|
36
|
+
export function canonicalLink(href: string): void {
|
|
37
|
+
if (typeof document === 'undefined') return;
|
|
38
|
+
const address = withoutQuery(href);
|
|
39
|
+
if (address === '') return;
|
|
40
|
+
|
|
41
|
+
const existing = document.querySelector<HTMLLinkElement>(
|
|
42
|
+
'link[rel="canonical"]',
|
|
43
|
+
);
|
|
44
|
+
if (existing) {
|
|
45
|
+
existing.href = address;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const link = document.createElement('link');
|
|
50
|
+
link.rel = 'canonical';
|
|
51
|
+
document.head.append(link);
|
|
52
|
+
link.href = address;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** What a page is called and where it is indexed. */
|
|
56
|
+
export interface DocumentMeta {
|
|
57
|
+
/** The title of the tab, the search result and the shared card. */
|
|
58
|
+
title: string;
|
|
59
|
+
/**
|
|
60
|
+
* One sentence describing this page, in the words someone would search for.
|
|
61
|
+
* Left out, the description the page was served with stays as it is — which
|
|
62
|
+
* is what every crawler but a rendering one has already read.
|
|
63
|
+
* @default undefined
|
|
64
|
+
*/
|
|
65
|
+
description?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The absolute address the page is indexed under. Left out, the canonical
|
|
68
|
+
* link the page was served with stays as it is.
|
|
69
|
+
* @default undefined
|
|
70
|
+
*/
|
|
71
|
+
canonical?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function metaDescription(content: string): void {
|
|
75
|
+
const existing = document.querySelector<HTMLMetaElement>(
|
|
76
|
+
'meta[name="description"]',
|
|
77
|
+
);
|
|
78
|
+
if (existing) {
|
|
79
|
+
existing.content = content;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const meta = document.createElement('meta');
|
|
84
|
+
meta.name = 'description';
|
|
85
|
+
document.head.append(meta);
|
|
86
|
+
meta.content = content;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function withoutQuery(href: string): string {
|
|
90
|
+
const cut = href.search(/[?#]/);
|
|
91
|
+
return cut === -1 ? href : href.slice(0, cut);
|
|
92
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { QueryEntry } from './query.ts';
|
|
2
|
+
import { firstValues, parseQuery, serializeQuery } from './query.ts';
|
|
3
|
+
import type {
|
|
4
|
+
HideablePart,
|
|
5
|
+
ShareParamCodecs,
|
|
6
|
+
ShareParamValues,
|
|
7
|
+
ShareVocabulary,
|
|
8
|
+
} from './vocabulary.ts';
|
|
9
|
+
|
|
10
|
+
/** The parameter that drops the site chrome. */
|
|
11
|
+
export const EMBED_PARAM = 'embed';
|
|
12
|
+
|
|
13
|
+
/** The parameter listing the parts a link switches off. */
|
|
14
|
+
export const HIDE_PARAM = 'hide';
|
|
15
|
+
|
|
16
|
+
/** What one link says about the page it opens, beyond the tool's own inputs. */
|
|
17
|
+
export interface ShareConfig<
|
|
18
|
+
Codecs extends ShareParamCodecs = Record<string, never>,
|
|
19
|
+
> {
|
|
20
|
+
/** Drop the site chrome, so the page can be framed in someone else's site. */
|
|
21
|
+
embed: boolean;
|
|
22
|
+
/** The parts switched off, in the order the vocabulary lists them. */
|
|
23
|
+
hidden: readonly string[];
|
|
24
|
+
/** The tool's own parameters, each at the value the link carries or its default. */
|
|
25
|
+
params: ShareParamValues<Codecs>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Read the configuration a link carries.
|
|
30
|
+
*
|
|
31
|
+
* Everything here is untrusted: a `hide` key the vocabulary does not list is
|
|
32
|
+
* ignored, a malformed number falls back to its default, and every number is
|
|
33
|
+
* clamped to what the tool can serve, so a link written two years ago still
|
|
34
|
+
* opens.
|
|
35
|
+
* @param search - The query string, with or without its leading `?`.
|
|
36
|
+
* @param vocabulary - What this site's links can say.
|
|
37
|
+
* @returns The configuration in force.
|
|
38
|
+
*/
|
|
39
|
+
export function parseShareConfig<
|
|
40
|
+
Codecs extends ShareParamCodecs = Record<string, never>,
|
|
41
|
+
>(search: string, vocabulary: ShareVocabulary<Codecs>): ShareConfig<Codecs> {
|
|
42
|
+
const values = firstValues(parseQuery(search));
|
|
43
|
+
const embed = values.get(EMBED_PARAM);
|
|
44
|
+
return {
|
|
45
|
+
embed: embed !== undefined && embed !== '0',
|
|
46
|
+
hidden: orderHidden(splitHidden(values.get(HIDE_PARAM)), vocabulary.parts),
|
|
47
|
+
params: readParams(values, vocabulary.params) as ShareParamValues<Codecs>,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Write a configuration into an address, leaving the tool's own inputs as they
|
|
53
|
+
* were. A parameter left at its default is deleted rather than written, so an
|
|
54
|
+
* unconfigured link stays a plain link.
|
|
55
|
+
* @param search - The address as it stands, with or without its leading `?`.
|
|
56
|
+
* @param config - The configuration to write.
|
|
57
|
+
* @param vocabulary - What this site's links can say.
|
|
58
|
+
* @returns The new query string, without its leading `?`.
|
|
59
|
+
*/
|
|
60
|
+
export function applyShareConfig<
|
|
61
|
+
Codecs extends ShareParamCodecs = Record<string, never>,
|
|
62
|
+
>(
|
|
63
|
+
search: string,
|
|
64
|
+
config: ShareConfig<Codecs>,
|
|
65
|
+
vocabulary: ShareVocabulary<Codecs>,
|
|
66
|
+
): string {
|
|
67
|
+
const codecs: ShareParamCodecs = vocabulary.params ?? {};
|
|
68
|
+
const owned = new Set<string>([
|
|
69
|
+
EMBED_PARAM,
|
|
70
|
+
HIDE_PARAM,
|
|
71
|
+
...Object.keys(codecs),
|
|
72
|
+
]);
|
|
73
|
+
const entries: QueryEntry[] = [];
|
|
74
|
+
for (const entry of parseQuery(search)) {
|
|
75
|
+
if (!owned.has(entry[0])) entries.push(entry);
|
|
76
|
+
}
|
|
77
|
+
if (config.embed) entries.push([EMBED_PARAM, '1']);
|
|
78
|
+
const hidden = orderHidden(new Set(config.hidden), vocabulary.parts);
|
|
79
|
+
if (hidden.length > 0) entries.push([HIDE_PARAM, hidden.join(',')]);
|
|
80
|
+
const values = config.params as Readonly<Record<string, unknown>>;
|
|
81
|
+
for (const [key, codec] of Object.entries(codecs)) {
|
|
82
|
+
const raw = codec.serialize(values[key]);
|
|
83
|
+
if (raw !== null) entries.push([key, raw]);
|
|
84
|
+
}
|
|
85
|
+
return serializeQuery(entries);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Whether the link switches a part of the page off.
|
|
90
|
+
*
|
|
91
|
+
* Hidden means hidden, not disabled: the value a hidden control carries still
|
|
92
|
+
* applies, so an embedder can preset what a visitor may not change.
|
|
93
|
+
* @param config - The configuration in force.
|
|
94
|
+
* @param key - The part to test.
|
|
95
|
+
* @returns True when the part must not be rendered.
|
|
96
|
+
*/
|
|
97
|
+
export function isHidden(
|
|
98
|
+
config: Pick<ShareConfig, 'hidden'>,
|
|
99
|
+
key: string,
|
|
100
|
+
): boolean {
|
|
101
|
+
return config.hidden.includes(key);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Whether a configuration differs from an unconfigured link.
|
|
106
|
+
* @param config - The configuration to test.
|
|
107
|
+
* @param vocabulary - What this site's links can say.
|
|
108
|
+
* @returns True when the link configures anything at all.
|
|
109
|
+
*/
|
|
110
|
+
export function isShareConfigured<
|
|
111
|
+
Codecs extends ShareParamCodecs = Record<string, never>,
|
|
112
|
+
>(config: ShareConfig<Codecs>, vocabulary: ShareVocabulary<Codecs>): boolean {
|
|
113
|
+
return applyShareConfig('', config, vocabulary) !== '';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The configuration a share dialog opens on: framed, with the parts a host
|
|
118
|
+
* page has no use for already switched off. Someone who wants the whole site
|
|
119
|
+
* is one click away; someone building a course tile should not have to tick
|
|
120
|
+
* five boxes every time.
|
|
121
|
+
* @param vocabulary - What this site's links can say.
|
|
122
|
+
* @returns The configuration to start from.
|
|
123
|
+
*/
|
|
124
|
+
export function suggestedShareConfig<
|
|
125
|
+
Codecs extends ShareParamCodecs = Record<string, never>,
|
|
126
|
+
>(vocabulary: ShareVocabulary<Codecs>): ShareConfig<Codecs> {
|
|
127
|
+
const hidden: string[] = [];
|
|
128
|
+
for (const part of vocabulary.parts) {
|
|
129
|
+
if (part.hiddenByDefault === true) hidden.push(part.key);
|
|
130
|
+
}
|
|
131
|
+
return { ...parseShareConfig('', vocabulary), embed: true, hidden };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function splitHidden(raw: string | undefined): ReadonlySet<string> {
|
|
135
|
+
const asked = new Set<string>();
|
|
136
|
+
if (raw === undefined) return asked;
|
|
137
|
+
for (const entry of raw.split(',')) {
|
|
138
|
+
const key = entry.trim();
|
|
139
|
+
if (key !== '') asked.add(key);
|
|
140
|
+
}
|
|
141
|
+
return asked;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function orderHidden(
|
|
145
|
+
asked: ReadonlySet<string>,
|
|
146
|
+
parts: readonly HideablePart[],
|
|
147
|
+
): readonly string[] {
|
|
148
|
+
const hidden: string[] = [];
|
|
149
|
+
for (const part of parts) {
|
|
150
|
+
if (asked.has(part.key)) hidden.push(part.key);
|
|
151
|
+
}
|
|
152
|
+
return hidden;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function readParams(
|
|
156
|
+
values: ReadonlyMap<string, string>,
|
|
157
|
+
codecs: ShareParamCodecs | undefined,
|
|
158
|
+
): Record<string, unknown> {
|
|
159
|
+
const params: Record<string, unknown> = {};
|
|
160
|
+
if (codecs === undefined) return params;
|
|
161
|
+
for (const [key, codec] of Object.entries(codecs)) {
|
|
162
|
+
params[key] = codec.parse(values.get(key) ?? null);
|
|
163
|
+
}
|
|
164
|
+
return params;
|
|
165
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape a value written into HTML text, so a formula, a title or an address
|
|
3
|
+
* a link carries cannot close the element it sits in.
|
|
4
|
+
* @param value - The untrusted value.
|
|
5
|
+
* @returns The value with `&`, `<` and `>` replaced by their entities.
|
|
6
|
+
*/
|
|
7
|
+
export function escapeText(value: string): string {
|
|
8
|
+
return value
|
|
9
|
+
.replaceAll('&', '&')
|
|
10
|
+
.replaceAll('<', '<')
|
|
11
|
+
.replaceAll('>', '>');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Escape a value written into a double-quoted HTML attribute, so an address
|
|
16
|
+
* carrying an ampersand or a quote cannot break out of it.
|
|
17
|
+
* @param value - The untrusted value.
|
|
18
|
+
* @returns The value with `&`, `<`, `>` and `"` replaced by their entities.
|
|
19
|
+
*/
|
|
20
|
+
export function escapeAttribute(value: string): string {
|
|
21
|
+
return escapeText(value).replaceAll('"', '"');
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type { ShareConfig } from './config.ts';
|
|
2
|
+
export {
|
|
3
|
+
EMBED_PARAM,
|
|
4
|
+
HIDE_PARAM,
|
|
5
|
+
applyShareConfig,
|
|
6
|
+
isHidden,
|
|
7
|
+
isShareConfigured,
|
|
8
|
+
parseShareConfig,
|
|
9
|
+
suggestedShareConfig,
|
|
10
|
+
} from './config.ts';
|
|
11
|
+
export { escapeAttribute, escapeText } from './escape.ts';
|
|
12
|
+
export type {
|
|
13
|
+
BooleanParamOptions,
|
|
14
|
+
IntegerParamOptions,
|
|
15
|
+
ShareParamCodec,
|
|
16
|
+
StringParamOptions,
|
|
17
|
+
} from './params.ts';
|
|
18
|
+
export {
|
|
19
|
+
booleanParam,
|
|
20
|
+
enumParam,
|
|
21
|
+
integerParam,
|
|
22
|
+
stringParam,
|
|
23
|
+
} from './params.ts';
|
|
24
|
+
export type { EmbedCodeOptions, ShareUrlOptions } from './url.ts';
|
|
25
|
+
export { buildEmbedCode, buildShareUrl } from './url.ts';
|
|
26
|
+
export type {
|
|
27
|
+
HideablePart,
|
|
28
|
+
ShareParamCodecs,
|
|
29
|
+
ShareParamValues,
|
|
30
|
+
ShareVocabulary,
|
|
31
|
+
} from './vocabulary.ts';
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads one of a tool's own parameters out of a link and writes it back.
|
|
3
|
+
*
|
|
4
|
+
* `parse` is handed the raw value, or `null` when the link does not carry the
|
|
5
|
+
* key at all, and always answers: anything absent or malformed falls back to
|
|
6
|
+
* the default. `serialize` answers `null` for a value that is already the
|
|
7
|
+
* default, which deletes the key rather than writing it, so an unconfigured
|
|
8
|
+
* link stays a plain link.
|
|
9
|
+
*/
|
|
10
|
+
export interface ShareParamCodec<Value> {
|
|
11
|
+
/**
|
|
12
|
+
* Read the value a link carries.
|
|
13
|
+
* @param raw - The raw parameter, `null` when the link omits it.
|
|
14
|
+
* @returns The value, or the default when it is absent or malformed.
|
|
15
|
+
*/
|
|
16
|
+
parse(raw: string | null): Value;
|
|
17
|
+
/**
|
|
18
|
+
* Write the value into a link.
|
|
19
|
+
* @param value - The value to write.
|
|
20
|
+
* @returns The raw parameter, or `null` to delete the key.
|
|
21
|
+
*/
|
|
22
|
+
serialize(value: Value): string | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** What {@link booleanParam} is configured with. */
|
|
26
|
+
export interface BooleanParamOptions {
|
|
27
|
+
/**
|
|
28
|
+
* The value an absent parameter reads as, and the one deleted rather than
|
|
29
|
+
* written.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
default?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A flag a link switches on by naming it. `?flag`, `?flag=` and `?flag=1` all
|
|
37
|
+
* read as on, because these addresses are retyped by hand out of a course
|
|
38
|
+
* page; only `0` and `false` read as off.
|
|
39
|
+
* @param options - The value the flag takes when the link says nothing.
|
|
40
|
+
* @returns The codec.
|
|
41
|
+
*/
|
|
42
|
+
export function booleanParam(
|
|
43
|
+
options: BooleanParamOptions = {},
|
|
44
|
+
): ShareParamCodec<boolean> {
|
|
45
|
+
const { default: fallback = false } = options;
|
|
46
|
+
return {
|
|
47
|
+
parse(raw) {
|
|
48
|
+
if (raw === null) return fallback;
|
|
49
|
+
const text = raw.trim().toLowerCase();
|
|
50
|
+
return text !== '0' && text !== 'false';
|
|
51
|
+
},
|
|
52
|
+
serialize(value) {
|
|
53
|
+
if (value === fallback) return null;
|
|
54
|
+
return value ? '1' : '0';
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** What {@link integerParam} is configured with. */
|
|
60
|
+
export interface IntegerParamOptions<Fallback extends number | null> {
|
|
61
|
+
/** The smallest value a link may ask for. */
|
|
62
|
+
min: number;
|
|
63
|
+
/** The largest value a link may ask for, so a link cannot hang the page. */
|
|
64
|
+
max: number;
|
|
65
|
+
/**
|
|
66
|
+
* The value an absent or malformed parameter falls back to, and the one
|
|
67
|
+
* deleted rather than written. `null` means the tool has no value of its own
|
|
68
|
+
* until a link names one.
|
|
69
|
+
*/
|
|
70
|
+
default: Fallback;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A whole number a link carries, rounded and clamped to the range the tool can
|
|
75
|
+
* actually serve. A value outside the range is brought back inside it rather
|
|
76
|
+
* than rejected: a link written when the maximum was higher must still open.
|
|
77
|
+
* @param options - The range and the default.
|
|
78
|
+
* @returns The codec.
|
|
79
|
+
*/
|
|
80
|
+
export function integerParam<Fallback extends number | null>(
|
|
81
|
+
options: IntegerParamOptions<Fallback>,
|
|
82
|
+
): ShareParamCodec<number | Fallback> {
|
|
83
|
+
const { min, max, default: fallback } = options;
|
|
84
|
+
return {
|
|
85
|
+
parse(raw) {
|
|
86
|
+
if (raw === null) return fallback;
|
|
87
|
+
const text = raw.trim();
|
|
88
|
+
if (text === '') return fallback;
|
|
89
|
+
const parsed = Number(text);
|
|
90
|
+
if (Number.isNaN(parsed)) return fallback;
|
|
91
|
+
return clamp(parsed, min, max);
|
|
92
|
+
},
|
|
93
|
+
serialize(value) {
|
|
94
|
+
if (typeof value !== 'number' || value === fallback) return null;
|
|
95
|
+
return String(clamp(value, min, max));
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** What {@link stringParam} is configured with. */
|
|
101
|
+
export interface StringParamOptions {
|
|
102
|
+
/**
|
|
103
|
+
* The value an absent parameter reads as, and the one deleted rather than
|
|
104
|
+
* written.
|
|
105
|
+
* @default ''
|
|
106
|
+
*/
|
|
107
|
+
default?: string;
|
|
108
|
+
/**
|
|
109
|
+
* The longest value accepted; anything beyond it is cut, so a link cannot
|
|
110
|
+
* hand the tool a megabyte of text.
|
|
111
|
+
* @default undefined
|
|
112
|
+
*/
|
|
113
|
+
maxLength?: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* A free-text parameter, taken as written. The value is not trimmed: a
|
|
118
|
+
* leading space can be part of what the tool is showing.
|
|
119
|
+
* @param options - The default and the length limit.
|
|
120
|
+
* @returns The codec.
|
|
121
|
+
*/
|
|
122
|
+
export function stringParam(
|
|
123
|
+
options: StringParamOptions = {},
|
|
124
|
+
): ShareParamCodec<string> {
|
|
125
|
+
const { default: fallback = '', maxLength } = options;
|
|
126
|
+
return {
|
|
127
|
+
parse(raw) {
|
|
128
|
+
if (raw === null) return fallback;
|
|
129
|
+
return cut(raw, maxLength);
|
|
130
|
+
},
|
|
131
|
+
serialize(value) {
|
|
132
|
+
const text = cut(value, maxLength);
|
|
133
|
+
return text === fallback ? null : text;
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* One of a fixed set of names — a difficulty, a display mode, a format.
|
|
140
|
+
* A name the tool does not know falls back rather than throwing, so a link
|
|
141
|
+
* written before the set changed still opens.
|
|
142
|
+
* @param values - Every name the tool understands.
|
|
143
|
+
* @param fallback - The name an absent or unknown parameter reads as.
|
|
144
|
+
* @returns The codec.
|
|
145
|
+
*/
|
|
146
|
+
export function enumParam<Value extends string>(
|
|
147
|
+
values: readonly Value[],
|
|
148
|
+
fallback: Value,
|
|
149
|
+
): ShareParamCodec<Value> {
|
|
150
|
+
return {
|
|
151
|
+
parse(raw) {
|
|
152
|
+
if (raw === null) return fallback;
|
|
153
|
+
const text = raw.trim();
|
|
154
|
+
for (const value of values) {
|
|
155
|
+
if (value === text) return value;
|
|
156
|
+
}
|
|
157
|
+
return fallback;
|
|
158
|
+
},
|
|
159
|
+
serialize(value) {
|
|
160
|
+
if (value === fallback) return null;
|
|
161
|
+
for (const candidate of values) {
|
|
162
|
+
if (candidate === value) return value;
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function clamp(value: number, min: number, max: number): number {
|
|
170
|
+
return Math.min(max, Math.max(min, Math.round(value)));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function cut(value: string, maxLength: number | undefined): string {
|
|
174
|
+
if (maxLength === undefined || value.length <= maxLength) return value;
|
|
175
|
+
return value.slice(0, maxLength);
|
|
176
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** One `key=value` pair of a query string, already decoded. */
|
|
2
|
+
export type QueryEntry = readonly [key: string, value: string];
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Read a query string into its pairs, in the order it wrote them.
|
|
6
|
+
*
|
|
7
|
+
* A `+` is a plus, not a space: a link carries structures such as
|
|
8
|
+
* `CC[N+](C)(C)C`, and the form-urlencoded reading of `+` would turn one into
|
|
9
|
+
* a different molecule without anything failing. A malformed escape is kept as
|
|
10
|
+
* written rather than throwing, so a link somebody retyped still opens.
|
|
11
|
+
* @param search - The query string, with or without its leading `?`, and without a fragment.
|
|
12
|
+
* @returns The pairs, decoded.
|
|
13
|
+
*/
|
|
14
|
+
export function parseQuery(search: string): QueryEntry[] {
|
|
15
|
+
const text = search.startsWith('?') ? search.slice(1) : search;
|
|
16
|
+
const entries: QueryEntry[] = [];
|
|
17
|
+
if (text === '') return entries;
|
|
18
|
+
for (const chunk of text.split('&')) {
|
|
19
|
+
if (chunk === '') continue;
|
|
20
|
+
const separator = chunk.indexOf('=');
|
|
21
|
+
const key = separator === -1 ? chunk : chunk.slice(0, separator);
|
|
22
|
+
const value = separator === -1 ? '' : chunk.slice(separator + 1);
|
|
23
|
+
entries.push([decodeComponent(key), decodeComponent(value)]);
|
|
24
|
+
}
|
|
25
|
+
return entries;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Write pairs back into a query string, keeping the two characters a reader
|
|
30
|
+
* of these links cares about legible: a comma stays a comma rather than
|
|
31
|
+
* `%2C`, and a plus stays a plus rather than `%2B`. Both parse back
|
|
32
|
+
* identically through {@link parseQuery}.
|
|
33
|
+
* @param entries - The pairs to write, in the order they should appear.
|
|
34
|
+
* @returns The query string, without its leading `?`.
|
|
35
|
+
*/
|
|
36
|
+
export function serializeQuery(entries: readonly QueryEntry[]): string {
|
|
37
|
+
const chunks: string[] = [];
|
|
38
|
+
for (const [key, value] of entries) {
|
|
39
|
+
chunks.push(`${encodeComponent(key)}=${encodeComponent(value)}`);
|
|
40
|
+
}
|
|
41
|
+
return chunks.join('&');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The first value each key carries, which is what a link means when it names
|
|
46
|
+
* the same parameter twice.
|
|
47
|
+
* @param entries - The pairs of a query string.
|
|
48
|
+
* @returns One value per key.
|
|
49
|
+
*/
|
|
50
|
+
export function firstValues(
|
|
51
|
+
entries: readonly QueryEntry[],
|
|
52
|
+
): ReadonlyMap<string, string> {
|
|
53
|
+
const values = new Map<string, string>();
|
|
54
|
+
for (const [key, value] of entries) {
|
|
55
|
+
if (!values.has(key)) values.set(key, value);
|
|
56
|
+
}
|
|
57
|
+
return values;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function decodeComponent(value: string): string {
|
|
61
|
+
try {
|
|
62
|
+
return decodeURIComponent(value);
|
|
63
|
+
} catch {
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function encodeComponent(value: string): string {
|
|
69
|
+
return encodeURIComponent(value)
|
|
70
|
+
.replaceAll('%2C', ',')
|
|
71
|
+
.replaceAll('%2B', '+');
|
|
72
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ShareConfig } from './config.ts';
|
|
2
|
+
import { applyShareConfig } from './config.ts';
|
|
3
|
+
import { escapeAttribute } from './escape.ts';
|
|
4
|
+
import type { ShareParamCodecs, ShareVocabulary } from './vocabulary.ts';
|
|
5
|
+
|
|
6
|
+
/** What {@link buildShareUrl} needs to write a link. */
|
|
7
|
+
export interface ShareUrlOptions<
|
|
8
|
+
Codecs extends ShareParamCodecs = Record<string, never>,
|
|
9
|
+
> {
|
|
10
|
+
/**
|
|
11
|
+
* Where the page is served from — origin and path. Anything from the first
|
|
12
|
+
* `?` or `#` is dropped, so the current address can be handed over as it is.
|
|
13
|
+
*/
|
|
14
|
+
base: string;
|
|
15
|
+
/**
|
|
16
|
+
* The address as it stands, so the tool's own inputs travel with the link.
|
|
17
|
+
* @default ''
|
|
18
|
+
*/
|
|
19
|
+
search?: string;
|
|
20
|
+
/** The configuration the link carries. */
|
|
21
|
+
config: ShareConfig<Codecs>;
|
|
22
|
+
/** What this site's links can say. */
|
|
23
|
+
vocabulary: ShareVocabulary<Codecs>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The absolute link the share dialog hands out: the page, the tool's own
|
|
28
|
+
* inputs, and the configuration written over whatever the address carried.
|
|
29
|
+
* @param options - Where the page is, what it is showing, and how it is configured.
|
|
30
|
+
* @returns An absolute URL.
|
|
31
|
+
*/
|
|
32
|
+
export function buildShareUrl<
|
|
33
|
+
Codecs extends ShareParamCodecs = Record<string, never>,
|
|
34
|
+
>(options: ShareUrlOptions<Codecs>): string {
|
|
35
|
+
const { base, search = '', config, vocabulary } = options;
|
|
36
|
+
const query = applyShareConfig(search, config, vocabulary);
|
|
37
|
+
const address = trimAddress(base);
|
|
38
|
+
return query === '' ? address : `${address}?${query}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** What {@link buildEmbedCode} needs to write the snippet. */
|
|
42
|
+
export interface EmbedCodeOptions {
|
|
43
|
+
/** The link the frame loads. */
|
|
44
|
+
url: string;
|
|
45
|
+
/** What a screen reader announces the frame as; a frame without one is unreadable. */
|
|
46
|
+
title: string;
|
|
47
|
+
/**
|
|
48
|
+
* Height of the frame, in pixels.
|
|
49
|
+
* @default 700
|
|
50
|
+
*/
|
|
51
|
+
height?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Width of the frame; a number is taken as pixels.
|
|
54
|
+
* @default '100%'
|
|
55
|
+
*/
|
|
56
|
+
width?: number | string;
|
|
57
|
+
/**
|
|
58
|
+
* The CSS border the frame is drawn with.
|
|
59
|
+
* @default '1px solid #ddd'
|
|
60
|
+
*/
|
|
61
|
+
border?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The snippet to paste into a course page: one iframe loading the shared link.
|
|
66
|
+
* Every value is escaped, so an address carrying an ampersand or a title
|
|
67
|
+
* carrying a quote cannot break out of its attribute.
|
|
68
|
+
* @param options - The link, its accessible name and the frame's dimensions.
|
|
69
|
+
* @returns One line of HTML.
|
|
70
|
+
*/
|
|
71
|
+
export function buildEmbedCode(options: EmbedCodeOptions): string {
|
|
72
|
+
const {
|
|
73
|
+
url,
|
|
74
|
+
title,
|
|
75
|
+
height = DEFAULT_HEIGHT,
|
|
76
|
+
width = '100%',
|
|
77
|
+
border = '1px solid #ddd',
|
|
78
|
+
} = options;
|
|
79
|
+
const style = `border: ${border}; border-radius: 8px`;
|
|
80
|
+
return [
|
|
81
|
+
`<iframe src="${escapeAttribute(url)}"`,
|
|
82
|
+
`title="${escapeAttribute(title)}"`,
|
|
83
|
+
`width="${escapeAttribute(formatWidth(width))}"`,
|
|
84
|
+
`height="${formatHeight(height)}"`,
|
|
85
|
+
`style="${escapeAttribute(style)}"`,
|
|
86
|
+
'loading="lazy"></iframe>',
|
|
87
|
+
].join(' ');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const DEFAULT_HEIGHT = 700;
|
|
91
|
+
|
|
92
|
+
function trimAddress(base: string): string {
|
|
93
|
+
const cut = base.search(/[#?]/);
|
|
94
|
+
return cut === -1 ? base : base.slice(0, cut);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function formatWidth(width: number | string): string {
|
|
98
|
+
if (typeof width !== 'number') return width;
|
|
99
|
+
return String(Math.max(1, Math.round(width)));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function formatHeight(height: number): string {
|
|
103
|
+
if (!Number.isFinite(height)) return String(DEFAULT_HEIGHT);
|
|
104
|
+
return String(Math.max(1, Math.round(height)));
|
|
105
|
+
}
|