react-cheminfo 0.3.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 +111 -23
- 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 +11 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +11 -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 +2 -0
- package/lib/ecosystem/core/sites.d.ts.map +1 -1
- package/lib/ecosystem/core/sites.js +15 -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/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 +13 -3
- 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 +27 -0
- package/lib/orbital/core/atomicGrid.d.ts.map +1 -1
- package/lib/orbital/core/atomicGrid.js +37 -1
- package/lib/orbital/core/atomicGrid.js.map +1 -1
- package/lib/orbital/core/index.d.ts +9 -7
- package/lib/orbital/core/index.d.ts.map +1 -1
- package/lib/orbital/core/index.js +7 -6
- package/lib/orbital/core/index.js.map +1 -1
- 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/sample.d.ts +15 -1
- package/lib/orbital/core/sample.d.ts.map +1 -1
- package/lib/orbital/core/sample.js +10 -3
- package/lib/orbital/core/sample.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts +6 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalCanvas.js +12 -2
- package/lib/orbital/ui/AtomicOrbitalCanvas.js.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts +5 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.d.ts.map +1 -1
- package/lib/orbital/ui/AtomicOrbitalViewer.js.map +1 -1
- package/lib/orbital/ui/renderVolume.d.ts +6 -3
- package/lib/orbital/ui/renderVolume.d.ts.map +1 -1
- package/lib/orbital/ui/renderVolume.js +14 -15
- package/lib/orbital/ui/renderVolume.js.map +1 -1
- package/lib/orbital/ui/viewer.d.ts +3 -1
- package/lib/orbital/ui/viewer.d.ts.map +1 -1
- package/lib/orbital/ui/viewer.js +3 -2
- package/lib/orbital/ui/viewer.js.map +1 -1
- package/lib/orbital/ui/volumeField.d.ts +5 -21
- package/lib/orbital/ui/volumeField.d.ts.map +1 -1
- package/lib/orbital/ui/volumeField.js +5 -45
- package/lib/orbital/ui/volumeField.js.map +1 -1
- 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 +18 -5
- 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 +11 -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 +17 -0
- 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/index.ts +4 -0
- package/src/ecosystem/ui/marks.tsx +54 -15
- 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 +53 -1
- package/src/orbital/core/index.ts +7 -16
- package/src/orbital/core/isovalue.ts +146 -0
- package/src/orbital/core/sample.ts +25 -5
- package/src/orbital/ui/AtomicOrbitalCanvas.tsx +19 -3
- package/src/orbital/ui/AtomicOrbitalViewer.tsx +5 -1
- package/src/orbital/ui/renderVolume.ts +29 -16
- package/src/orbital/ui/viewer.ts +6 -1
- package/src/orbital/ui/volumeField.ts +5 -49
- 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,49 @@
|
|
|
1
|
+
import { Button, Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
2
|
+
import type { CSSProperties, ReactElement } from 'react';
|
|
3
|
+
|
|
4
|
+
import type { DelimitedTextPanelProps } from './DelimitedTextPanel.tsx';
|
|
5
|
+
import { DelimitedTextPanel } from './DelimitedTextPanel.tsx';
|
|
6
|
+
|
|
7
|
+
/** What the dialog hands over, and how. */
|
|
8
|
+
export interface DelimitedTextDialogProps extends DelimitedTextPanelProps {
|
|
9
|
+
/** Whether the dialog is open. */
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
/** Called when the dialog is dismissed. */
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Title of the dialog.
|
|
15
|
+
* @default 'Copy the table'
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The dialog every site rebuilt to hand a table over: the text, a choice of
|
|
22
|
+
* separator, and a way to copy or save it.
|
|
23
|
+
* @param props - See {@link DelimitedTextDialogProps}.
|
|
24
|
+
* @returns The dialog.
|
|
25
|
+
*/
|
|
26
|
+
export function DelimitedTextDialog(
|
|
27
|
+
props: DelimitedTextDialogProps,
|
|
28
|
+
): ReactElement {
|
|
29
|
+
const { isOpen, onClose, title = 'Copy the table', ...panel } = props;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Dialog
|
|
33
|
+
isOpen={isOpen}
|
|
34
|
+
onClose={onClose}
|
|
35
|
+
title={title}
|
|
36
|
+
icon="th"
|
|
37
|
+
style={DIALOG_STYLE}
|
|
38
|
+
>
|
|
39
|
+
<DialogBody>
|
|
40
|
+
<DelimitedTextPanel {...panel} label={panel.label ?? title} />
|
|
41
|
+
</DialogBody>
|
|
42
|
+
<DialogFooter actions={<Button text="Close" onClick={onClose} />} />
|
|
43
|
+
</Dialog>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const DIALOG_STYLE = {
|
|
48
|
+
width: 'min(900px, 92vw)',
|
|
49
|
+
} as const satisfies CSSProperties;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Button, Callout, SegmentedControl } from '@blueprintjs/core';
|
|
2
|
+
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { useMemo, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import { CopyButton } from '../../clipboard/ui/CopyButton.tsx';
|
|
6
|
+
import { downloadText } from '../../download/core/downloadText.ts';
|
|
7
|
+
import { sanitizeFileName } from '../../download/core/sanitizeFileName.ts';
|
|
8
|
+
import type { DelimiterId } from '../core/delimiters.ts';
|
|
9
|
+
import { DELIMITER_CHOICES, delimiterChoice } from '../core/delimiters.ts';
|
|
10
|
+
import { toDelimited } from '../core/toDelimited.ts';
|
|
11
|
+
|
|
12
|
+
/** What a table handed over as text needs. */
|
|
13
|
+
export interface DelimitedTextPanelProps {
|
|
14
|
+
/** The cells, one array per line. */
|
|
15
|
+
rows: ReadonlyArray<readonly string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Column names, written as the first line.
|
|
18
|
+
* @default undefined — the table is handed over without a header line
|
|
19
|
+
*/
|
|
20
|
+
header?: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* What the visitor is told above the text. A sentence naming what the table
|
|
23
|
+
* holds beats the generic one, which only counts the rows.
|
|
24
|
+
* @default a line saying how many rows there are and what to do with them
|
|
25
|
+
*/
|
|
26
|
+
description?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Base name of the saved file, without the extension — the extension follows
|
|
29
|
+
* the chosen separator.
|
|
30
|
+
* @default 'table'
|
|
31
|
+
*/
|
|
32
|
+
fileName?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Which separator the panel opens on.
|
|
35
|
+
* @default 'tab'
|
|
36
|
+
*/
|
|
37
|
+
defaultDelimiter?: DelimiterId;
|
|
38
|
+
/**
|
|
39
|
+
* Whether a save button is offered beside the copy one.
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
downloadable?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* What the text area is called, for a screen reader reaching it.
|
|
45
|
+
* @default 'The table, as text'
|
|
46
|
+
*/
|
|
47
|
+
label?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Height of the text area, in pixels.
|
|
50
|
+
* @default 320
|
|
51
|
+
*/
|
|
52
|
+
height?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A whole table as text: read it, copy it, or save it.
|
|
57
|
+
*
|
|
58
|
+
* The text is shown rather than only downloaded, because a visitor can read
|
|
59
|
+
* what is being copied and because a page framed in a course site often cannot
|
|
60
|
+
* start a download at all. Every cell is escaped for the separator in force, so
|
|
61
|
+
* the file a spreadsheet opens holds the columns the page shows.
|
|
62
|
+
* @param props - See {@link DelimitedTextPanelProps}.
|
|
63
|
+
* @returns The panel.
|
|
64
|
+
*/
|
|
65
|
+
export function DelimitedTextPanel(
|
|
66
|
+
props: DelimitedTextPanelProps,
|
|
67
|
+
): ReactElement {
|
|
68
|
+
const {
|
|
69
|
+
rows,
|
|
70
|
+
header,
|
|
71
|
+
description,
|
|
72
|
+
fileName = 'table',
|
|
73
|
+
defaultDelimiter = 'tab',
|
|
74
|
+
downloadable = true,
|
|
75
|
+
label = 'The table, as text',
|
|
76
|
+
height = 320,
|
|
77
|
+
} = props;
|
|
78
|
+
const [delimiterId, setDelimiterId] = useState<string>(defaultDelimiter);
|
|
79
|
+
|
|
80
|
+
const choice = delimiterChoice(delimiterId);
|
|
81
|
+
const text = useMemo(
|
|
82
|
+
() => toDelimited(rows, { delimiter: choice.delimiter, header }),
|
|
83
|
+
[rows, header, choice.delimiter],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div className="delimited-text">
|
|
88
|
+
<Callout intent="primary" compact icon="info-sign">
|
|
89
|
+
{description ?? defaultDescription(rows.length)}
|
|
90
|
+
</Callout>
|
|
91
|
+
<div style={CONTROLS_STYLE}>
|
|
92
|
+
<span style={LABEL_STYLE}>Separator</span>
|
|
93
|
+
<SegmentedControl
|
|
94
|
+
size="small"
|
|
95
|
+
options={DELIMITER_CHOICES.map((option) => ({
|
|
96
|
+
label: option.label,
|
|
97
|
+
value: option.id,
|
|
98
|
+
}))}
|
|
99
|
+
value={choice.id}
|
|
100
|
+
onValueChange={setDelimiterId}
|
|
101
|
+
/>
|
|
102
|
+
<span style={SPACER_STYLE} />
|
|
103
|
+
{downloadable ? (
|
|
104
|
+
<Button
|
|
105
|
+
icon="download"
|
|
106
|
+
text="Save"
|
|
107
|
+
size="small"
|
|
108
|
+
onClick={() =>
|
|
109
|
+
downloadText(
|
|
110
|
+
text,
|
|
111
|
+
`${sanitizeFileName(fileName, 'table')}.${choice.extension}`,
|
|
112
|
+
`${choice.mimeType};charset=utf-8`,
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
/>
|
|
116
|
+
) : null}
|
|
117
|
+
<CopyButton content={text} label="Copy" icon="clipboard" small />
|
|
118
|
+
</div>
|
|
119
|
+
<textarea
|
|
120
|
+
readOnly
|
|
121
|
+
value={text}
|
|
122
|
+
spellCheck={false}
|
|
123
|
+
aria-label={label}
|
|
124
|
+
className="bp6-input"
|
|
125
|
+
style={{ ...TEXT_STYLE, height }}
|
|
126
|
+
onFocus={(event) => event.currentTarget.select()}
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function defaultDescription(rowCount: number): string {
|
|
133
|
+
const rows = rowCount === 1 ? '1 row' : `${rowCount.toLocaleString()} rows`;
|
|
134
|
+
return `${rows}, one per line. Copy them, then paste into a spreadsheet.`;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const CONTROLS_STYLE = {
|
|
138
|
+
display: 'flex',
|
|
139
|
+
flexWrap: 'wrap',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
gap: 8,
|
|
142
|
+
marginTop: 12,
|
|
143
|
+
} as const satisfies CSSProperties;
|
|
144
|
+
|
|
145
|
+
const LABEL_STYLE = {
|
|
146
|
+
color: '#5f6b7c',
|
|
147
|
+
fontSize: 12,
|
|
148
|
+
} as const satisfies CSSProperties;
|
|
149
|
+
|
|
150
|
+
const SPACER_STYLE = { flex: 1 } as const satisfies CSSProperties;
|
|
151
|
+
|
|
152
|
+
const TEXT_STYLE = {
|
|
153
|
+
width: '100%',
|
|
154
|
+
marginTop: 12,
|
|
155
|
+
boxSizing: 'border-box',
|
|
156
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',
|
|
157
|
+
fontSize: 12,
|
|
158
|
+
overflowX: 'auto',
|
|
159
|
+
overflowWrap: 'normal',
|
|
160
|
+
whiteSpace: 'pre',
|
|
161
|
+
} as const satisfies CSSProperties;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { DelimitedTextDialogProps } from './DelimitedTextDialog.tsx';
|
|
2
|
+
export { DelimitedTextDialog } from './DelimitedTextDialog.tsx';
|
|
3
|
+
export type { DelimitedTextPanelProps } from './DelimitedTextPanel.tsx';
|
|
4
|
+
export { DelimitedTextPanel } from './DelimitedTextPanel.tsx';
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { IconName } from '@blueprintjs/core';
|
|
2
|
+
import { Collapse, Icon } from '@blueprintjs/core';
|
|
3
|
+
import type { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
/** What a titled section that folds away needs. */
|
|
7
|
+
export interface CollapsibleSectionProps {
|
|
8
|
+
/** The heading, which is also what opens and closes the section. */
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
/** The body, shown only while the section is open. */
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Glyph before the title.
|
|
14
|
+
* @default undefined — only the chevron is drawn
|
|
15
|
+
*/
|
|
16
|
+
icon?: IconName;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the section starts open, when the caller does not drive it.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
defaultOpen?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Controls beside the heading — a count, a copy button, a menu. They sit
|
|
24
|
+
* outside the heading button, so pressing one does not fold the section.
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
27
|
+
rightElement?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the section is open, when a parent drives it — which is what an
|
|
30
|
+
* "expand all" button, or a badge that opens and scrolls to a section, needs.
|
|
31
|
+
* @default undefined — the section keeps its own state
|
|
32
|
+
*/
|
|
33
|
+
isOpen?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Called when the heading is pressed while a parent drives the section.
|
|
36
|
+
* @default undefined
|
|
37
|
+
*/
|
|
38
|
+
onToggle?: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Identifier of the section element, so a link can jump to it.
|
|
41
|
+
* @default undefined
|
|
42
|
+
*/
|
|
43
|
+
id?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Class the section carries, in addition to `collapsible-section`.
|
|
46
|
+
* @default undefined
|
|
47
|
+
*/
|
|
48
|
+
className?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A titled block of a page that folds away when its heading is pressed.
|
|
53
|
+
*
|
|
54
|
+
* It works on its own or under a parent: pass `isOpen` and `onToggle` and the
|
|
55
|
+
* caller owns the state, which is what a page needs to open every section at
|
|
56
|
+
* once.
|
|
57
|
+
* @param props - See {@link CollapsibleSectionProps}.
|
|
58
|
+
* @returns The section.
|
|
59
|
+
*/
|
|
60
|
+
export function CollapsibleSection(
|
|
61
|
+
props: CollapsibleSectionProps,
|
|
62
|
+
): ReactElement {
|
|
63
|
+
const {
|
|
64
|
+
title,
|
|
65
|
+
children,
|
|
66
|
+
icon,
|
|
67
|
+
defaultOpen = true,
|
|
68
|
+
rightElement,
|
|
69
|
+
isOpen: openProp,
|
|
70
|
+
onToggle,
|
|
71
|
+
id,
|
|
72
|
+
className,
|
|
73
|
+
} = props;
|
|
74
|
+
const [openState, setOpenState] = useState(defaultOpen);
|
|
75
|
+
|
|
76
|
+
const isControlled = openProp !== undefined;
|
|
77
|
+
const isOpen = isControlled ? openProp : openState;
|
|
78
|
+
|
|
79
|
+
function toggle(): void {
|
|
80
|
+
if (isControlled) onToggle?.();
|
|
81
|
+
else setOpenState((shown) => !shown);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<section
|
|
86
|
+
id={id}
|
|
87
|
+
className={
|
|
88
|
+
className === undefined
|
|
89
|
+
? 'collapsible-section'
|
|
90
|
+
: `collapsible-section ${className}`
|
|
91
|
+
}
|
|
92
|
+
>
|
|
93
|
+
<div style={HEADER_STYLE}>
|
|
94
|
+
<button
|
|
95
|
+
type="button"
|
|
96
|
+
style={BUTTON_STYLE}
|
|
97
|
+
aria-expanded={isOpen}
|
|
98
|
+
onClick={toggle}
|
|
99
|
+
>
|
|
100
|
+
<Icon icon={isOpen ? 'chevron-down' : 'chevron-right'} size={14} />
|
|
101
|
+
{icon === undefined ? null : <Icon icon={icon} size={14} />}
|
|
102
|
+
<span style={TITLE_STYLE}>{title}</span>
|
|
103
|
+
</button>
|
|
104
|
+
{rightElement === undefined ? null : (
|
|
105
|
+
<div style={RIGHT_STYLE}>{rightElement}</div>
|
|
106
|
+
)}
|
|
107
|
+
</div>
|
|
108
|
+
<Collapse isOpen={isOpen}>
|
|
109
|
+
<div style={BODY_STYLE}>{children}</div>
|
|
110
|
+
</Collapse>
|
|
111
|
+
</section>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const HEADER_STYLE = {
|
|
116
|
+
display: 'flex',
|
|
117
|
+
alignItems: 'center',
|
|
118
|
+
gap: 8,
|
|
119
|
+
} as const satisfies CSSProperties;
|
|
120
|
+
|
|
121
|
+
const BUTTON_STYLE = {
|
|
122
|
+
display: 'flex',
|
|
123
|
+
flex: '1 1 auto',
|
|
124
|
+
minWidth: 0,
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
padding: '4px 0',
|
|
127
|
+
border: 0,
|
|
128
|
+
background: 'none',
|
|
129
|
+
color: 'inherit',
|
|
130
|
+
font: 'inherit',
|
|
131
|
+
fontWeight: 600,
|
|
132
|
+
gap: 6,
|
|
133
|
+
textAlign: 'left',
|
|
134
|
+
cursor: 'pointer',
|
|
135
|
+
} as const satisfies CSSProperties;
|
|
136
|
+
|
|
137
|
+
const TITLE_STYLE = {
|
|
138
|
+
overflow: 'hidden',
|
|
139
|
+
textOverflow: 'ellipsis',
|
|
140
|
+
whiteSpace: 'nowrap',
|
|
141
|
+
} as const satisfies CSSProperties;
|
|
142
|
+
|
|
143
|
+
const RIGHT_STYLE = {
|
|
144
|
+
display: 'flex',
|
|
145
|
+
flex: '0 0 auto',
|
|
146
|
+
alignItems: 'center',
|
|
147
|
+
gap: 4,
|
|
148
|
+
} as const satisfies CSSProperties;
|
|
149
|
+
|
|
150
|
+
const BODY_STYLE = { paddingTop: 4 } as const satisfies CSSProperties;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Something that is either shown or not, and the three ways to change that. */
|
|
4
|
+
export interface Disclosure {
|
|
5
|
+
/** Whether the thing is currently shown. */
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
/** Show it, whatever it was doing. */
|
|
8
|
+
open: () => void;
|
|
9
|
+
/** Hide it, whatever it was doing. */
|
|
10
|
+
close: () => void;
|
|
11
|
+
/** Show it when it is hidden, hide it when it is shown. */
|
|
12
|
+
toggle: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The open state of a dialog, a menu, a panel or a section.
|
|
17
|
+
*
|
|
18
|
+
* The three actions keep the same identity for the life of the component, so
|
|
19
|
+
* passing `close` to a dialog or a keyboard handler does not re-subscribe it on
|
|
20
|
+
* every render.
|
|
21
|
+
* @param initialOpen - Whether it starts out shown.
|
|
22
|
+
* @returns The state and the three actions.
|
|
23
|
+
*/
|
|
24
|
+
export function useDisclosure(initialOpen = false): Disclosure {
|
|
25
|
+
const [isOpen, setIsOpen] = useState(initialOpen);
|
|
26
|
+
|
|
27
|
+
const open = useCallback(() => setIsOpen(true), []);
|
|
28
|
+
const close = useCallback(() => setIsOpen(false), []);
|
|
29
|
+
const toggle = useCallback(() => setIsOpen((shown) => !shown), []);
|
|
30
|
+
|
|
31
|
+
return useMemo(
|
|
32
|
+
() => ({ isOpen, open, close, toggle }),
|
|
33
|
+
[isOpen, open, close, toggle],
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand a blob to the browser as a file the visitor saves.
|
|
3
|
+
*
|
|
4
|
+
* The object URL is released as soon as the click is dispatched, so nothing a
|
|
5
|
+
* page ever downloads is kept alive in memory behind it.
|
|
6
|
+
* @param blob - The bytes to save.
|
|
7
|
+
* @param fileName - Name the browser gives the saved file, extension included.
|
|
8
|
+
*/
|
|
9
|
+
export function downloadBlob(blob: Blob, fileName: string): void {
|
|
10
|
+
const url = URL.createObjectURL(blob);
|
|
11
|
+
const anchor = document.createElement('a');
|
|
12
|
+
anchor.href = url;
|
|
13
|
+
anchor.download = fileName;
|
|
14
|
+
// Some browsers ignore a click on an anchor that is not in the document.
|
|
15
|
+
document.body.append(anchor);
|
|
16
|
+
anchor.click();
|
|
17
|
+
anchor.remove();
|
|
18
|
+
URL.revokeObjectURL(url);
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { downloadBlob } from './downloadBlob.ts';
|
|
2
|
+
|
|
3
|
+
/** What a file of text is taken to be when the caller does not say. */
|
|
4
|
+
const DEFAULT_MIME_TYPE = 'text/plain;charset=utf-8';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Hand a piece of text to the browser as a file the visitor saves.
|
|
8
|
+
* @param text - The content of the file.
|
|
9
|
+
* @param fileName - Name the browser gives the saved file, extension included.
|
|
10
|
+
* @param mimeType - What the content is, so the system opens it with the right
|
|
11
|
+
* application.
|
|
12
|
+
*/
|
|
13
|
+
export function downloadText(
|
|
14
|
+
text: string,
|
|
15
|
+
fileName: string,
|
|
16
|
+
mimeType: string = DEFAULT_MIME_TYPE,
|
|
17
|
+
): void {
|
|
18
|
+
downloadBlob(new Blob([text], { type: mimeType }), fileName);
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Windows refuses these outright, and they read as syntax in a shell.
|
|
2
|
+
const RESERVED = /["*:<>?|]/gu;
|
|
3
|
+
const PATH_SEPARATOR = /[/\\]/gu;
|
|
4
|
+
// Control characters that are not whitespace: a newline is folded into a space
|
|
5
|
+
// below rather than dropped, so a pasted two-line name stays readable.
|
|
6
|
+
const CONTROL = /[^\P{Cc}\s]/gu;
|
|
7
|
+
const WHITESPACE = /\s+/gu;
|
|
8
|
+
const LEADING = /^[\s.-]+/u;
|
|
9
|
+
const TRAILING = /[\s.]+$/u;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Turn whatever a molecule, a list or a page is called into a name a file
|
|
13
|
+
* system takes.
|
|
14
|
+
*
|
|
15
|
+
* The name usually comes from something the visitor typed or from a record
|
|
16
|
+
* that was downloaded, so it may carry a path, a newline, or nothing at all.
|
|
17
|
+
* Path separators become hyphens rather than disappearing, so the parts of the
|
|
18
|
+
* name stay readable, and a name left empty falls back rather than saving a
|
|
19
|
+
* file with no name at all.
|
|
20
|
+
* @param name - What the file should be called.
|
|
21
|
+
* @param fallback - Name used when nothing usable is left.
|
|
22
|
+
* @returns A file name safe to pass to a download.
|
|
23
|
+
*/
|
|
24
|
+
export function sanitizeFileName(name: string, fallback = 'download'): string {
|
|
25
|
+
const cleaned = name
|
|
26
|
+
.replaceAll(CONTROL, '')
|
|
27
|
+
.replaceAll(PATH_SEPARATOR, '-')
|
|
28
|
+
.replaceAll(RESERVED, '')
|
|
29
|
+
.replaceAll(WHITESPACE, ' ')
|
|
30
|
+
.replace(LEADING, '')
|
|
31
|
+
.replace(TRAILING, '');
|
|
32
|
+
return cleaned === '' ? fallback : cleaned;
|
|
33
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { renderEcosystemLinksHtml } from './links.ts';
|
|
2
|
+
export { findSiteByHost, siteById } from './lookup.ts';
|
|
1
3
|
export type {
|
|
2
4
|
EcosystemSite,
|
|
3
5
|
SiteId,
|
|
@@ -5,3 +7,4 @@ export type {
|
|
|
5
7
|
SiteName,
|
|
6
8
|
} from './sites.ts';
|
|
7
9
|
export { ECOSYSTEM_SITES, siteUrl } from './sites.ts';
|
|
10
|
+
export { siteThemeColor, siteTokensCss } from './tokens.ts';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ECOSYSTEM_SITES, siteUrl } from './sites.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Every site of the family as a plain list of links, for the `<noscript>` of a
|
|
5
|
+
* page whose body is an empty root element.
|
|
6
|
+
*
|
|
7
|
+
* A crawler that runs no script sees nothing else of the page, so this is the
|
|
8
|
+
* only path it has from one of our tools to the next — and each entry carries
|
|
9
|
+
* the line saying what it opens, as real text.
|
|
10
|
+
* @returns The `<ul>`, for the caller to place inside its own `<noscript>`.
|
|
11
|
+
*/
|
|
12
|
+
export function renderEcosystemLinksHtml(): string {
|
|
13
|
+
let html = '<ul class="ecosystem-links">\n';
|
|
14
|
+
for (const site of ECOSYSTEM_SITES) {
|
|
15
|
+
const href = escapeHtml(siteUrl(site));
|
|
16
|
+
const host = escapeHtml(site.host);
|
|
17
|
+
const tagline = escapeHtml(site.tagline);
|
|
18
|
+
html += `<li><a href="${href}">${host}</a> — ${tagline}</li>\n`;
|
|
19
|
+
}
|
|
20
|
+
return `${html}</ul>\n`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function escapeHtml(value: string): string {
|
|
24
|
+
return value
|
|
25
|
+
.replaceAll('&', '&')
|
|
26
|
+
.replaceAll('<', '<')
|
|
27
|
+
.replaceAll('>', '>')
|
|
28
|
+
.replaceAll('"', '"');
|
|
29
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { EcosystemSite, SiteId } from './sites.ts';
|
|
2
|
+
import { ECOSYSTEM_SITES } from './sites.ts';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One site of the family, by the identifier its entry carries.
|
|
6
|
+
* @param id - The site being asked for.
|
|
7
|
+
* @returns The site.
|
|
8
|
+
* @throws {Error} When no site of the family carries that identifier.
|
|
9
|
+
*/
|
|
10
|
+
export function siteById(id: SiteId): EcosystemSite {
|
|
11
|
+
for (const site of ECOSYSTEM_SITES) {
|
|
12
|
+
if (site.id === id) return site;
|
|
13
|
+
}
|
|
14
|
+
throw new Error(`unknown ecosystem site: ${id}`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The site a page is being served from, so a header can mark itself as the
|
|
19
|
+
* current one without being told which site it belongs to.
|
|
20
|
+
*
|
|
21
|
+
* The host is whatever the browser reports, so it may carry a port and may or
|
|
22
|
+
* may not carry the `www.` two of our sites are written with. Neither changes
|
|
23
|
+
* which site it is, and a host belonging to nobody — a development server, a
|
|
24
|
+
* preview deployment — is simply not one of ours.
|
|
25
|
+
* @param host - What `location.host` reads, or any host-shaped string.
|
|
26
|
+
* @returns The site served from that host, or undefined for any other host.
|
|
27
|
+
*/
|
|
28
|
+
export function findSiteByHost(host: string): EcosystemSite | undefined {
|
|
29
|
+
const wanted = normalizeHost(host);
|
|
30
|
+
if (wanted === '') return undefined;
|
|
31
|
+
|
|
32
|
+
for (const site of ECOSYSTEM_SITES) {
|
|
33
|
+
if (normalizeHost(site.host) === wanted) return site;
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function normalizeHost(host: string): string {
|
|
39
|
+
const withoutPort = host.trim().toLowerCase().split(':', 1)[0] ?? '';
|
|
40
|
+
return withoutPort.startsWith('www.') ? withoutPort.slice(4) : withoutPort;
|
|
41
|
+
}
|