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,33 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { HelpContent } from './HelpBody.tsx';
|
|
3
|
+
/** What {@link HelpIcon} explains, and how big the glyph is. */
|
|
4
|
+
export interface HelpIconProps {
|
|
5
|
+
/** The help the glyph reveals. */
|
|
6
|
+
content: HelpContent;
|
|
7
|
+
/**
|
|
8
|
+
* Size of the glyph in pixels, so it sits on the line of the label it
|
|
9
|
+
* follows.
|
|
10
|
+
* @default 13
|
|
11
|
+
*/
|
|
12
|
+
size?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Which side the help opens on.
|
|
15
|
+
* @default 'right'
|
|
16
|
+
*/
|
|
17
|
+
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
18
|
+
/**
|
|
19
|
+
* Class the glyph carries, in addition to `help-icon`.
|
|
20
|
+
* @default undefined
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The small question mark that sits beside a field label.
|
|
26
|
+
*
|
|
27
|
+
* It is reachable by tab, so the explanation is not reserved to whoever is
|
|
28
|
+
* holding a pointer.
|
|
29
|
+
* @param props - See {@link HelpIconProps}.
|
|
30
|
+
* @returns The glyph and its help.
|
|
31
|
+
*/
|
|
32
|
+
export declare function HelpIcon(props: HelpIconProps): ReactElement;
|
|
33
|
+
//# sourceMappingURL=HelpIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpIcon.d.ts","sourceRoot":"","sources":["../../../src/help/ui/HelpIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,CAgB3D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from '@blueprintjs/core';
|
|
3
|
+
import { HelpTooltip } from "./HelpTooltip.js";
|
|
4
|
+
/**
|
|
5
|
+
* The small question mark that sits beside a field label.
|
|
6
|
+
*
|
|
7
|
+
* It is reachable by tab, so the explanation is not reserved to whoever is
|
|
8
|
+
* holding a pointer.
|
|
9
|
+
* @param props - See {@link HelpIconProps}.
|
|
10
|
+
* @returns The glyph and its help.
|
|
11
|
+
*/
|
|
12
|
+
export function HelpIcon(props) {
|
|
13
|
+
const { content, size = 13, placement = 'right', className } = props;
|
|
14
|
+
return (_jsx(HelpTooltip, { content: content, placement: placement, children: _jsx(Icon, { icon: "help", size: size, tabIndex: 0, "aria-label": content.title, className: className === undefined ? 'help-icon' : `help-icon ${className}` }) }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=HelpIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpIcon.js","sourceRoot":"","sources":["../../../src/help/ui/HelpIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAIzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAwBhD;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,GAAG,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAErE,OAAO,CACL,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,YACjD,KAAC,IAAI,IACH,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,CAAC,gBACC,OAAO,CAAC,KAAK,EACzB,SAAS,EACP,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,SAAS,EAAE,GAElE,GACU,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { IconName } from '@blueprintjs/core';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { HelpContent } from './HelpBody.tsx';
|
|
4
|
+
/** What {@link HelpToolbarButton} explains, and what pressing it does. */
|
|
5
|
+
export interface HelpToolbarButtonProps {
|
|
6
|
+
/** The help the button reveals on hover. */
|
|
7
|
+
content: HelpContent;
|
|
8
|
+
/**
|
|
9
|
+
* What pressing the button does — usually opening the guide the tooltip
|
|
10
|
+
* summarises. Left out for a button that only explains itself.
|
|
11
|
+
* @default undefined — the button does nothing when pressed
|
|
12
|
+
*/
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Text beside the glyph. Left out for a toolbar that has run out of room.
|
|
16
|
+
* @default undefined — the button is reduced to its glyph
|
|
17
|
+
*/
|
|
18
|
+
label?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Glyph of the button.
|
|
21
|
+
* @default 'help'
|
|
22
|
+
*/
|
|
23
|
+
icon?: IconName;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the button is the small size a dense toolbar needs.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
small?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Class the button carries.
|
|
31
|
+
* @default undefined
|
|
32
|
+
*/
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The help entry of a toolbar: a glyph that explains itself on hover and opens
|
|
37
|
+
* the full guide when pressed.
|
|
38
|
+
*
|
|
39
|
+
* It shows the same body as the glyph beside a field and as any other mention
|
|
40
|
+
* of that help, so a construct is documented in one place.
|
|
41
|
+
* @param props - See {@link HelpToolbarButtonProps}.
|
|
42
|
+
* @returns The toolbar button and its help.
|
|
43
|
+
*/
|
|
44
|
+
export declare function HelpToolbarButton(props: HelpToolbarButtonProps): ReactElement;
|
|
45
|
+
//# sourceMappingURL=HelpToolbarButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpToolbarButton.d.ts","sourceRoot":"","sources":["../../../src/help/ui/HelpToolbarButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,4CAA4C;IAC5C,OAAO,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAuB7E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@blueprintjs/core';
|
|
3
|
+
import { HelpTooltip } from "./HelpTooltip.js";
|
|
4
|
+
/**
|
|
5
|
+
* The help entry of a toolbar: a glyph that explains itself on hover and opens
|
|
6
|
+
* the full guide when pressed.
|
|
7
|
+
*
|
|
8
|
+
* It shows the same body as the glyph beside a field and as any other mention
|
|
9
|
+
* of that help, so a construct is documented in one place.
|
|
10
|
+
* @param props - See {@link HelpToolbarButtonProps}.
|
|
11
|
+
* @returns The toolbar button and its help.
|
|
12
|
+
*/
|
|
13
|
+
export function HelpToolbarButton(props) {
|
|
14
|
+
const { content, onClick, label, icon = 'help', small = false, className, } = props;
|
|
15
|
+
return (_jsx(HelpTooltip, { content: content, placement: "bottom", children: _jsx(Button, { variant: "minimal", size: small ? 'small' : 'medium', icon: icon, text: label, "aria-label": label ?? content.title, className: className, onClick: onClick }) }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=HelpToolbarButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpToolbarButton.js","sourceRoot":"","sources":["../../../src/help/ui/HelpToolbarButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAkChD;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EACJ,OAAO,EACP,OAAO,EACP,KAAK,EACL,IAAI,GAAG,MAAM,EACb,KAAK,GAAG,KAAK,EACb,SAAS,GACV,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,QAAQ,YAC/C,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAChC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,KAAK,gBACC,KAAK,IAAI,OAAO,CAAC,KAAK,EAClC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,GAChB,GACU,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TooltipProps } from '@blueprintjs/core';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
|
+
import type { HelpContent } from './HelpBody.tsx';
|
|
4
|
+
/** What {@link HelpTooltip} wraps, and what it says about it. */
|
|
5
|
+
export interface HelpTooltipProps {
|
|
6
|
+
/** The help shown when the pointer rests on the target. */
|
|
7
|
+
content: HelpContent;
|
|
8
|
+
/** What the help is about. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Which side the tooltip opens on.
|
|
12
|
+
* @default 'top'
|
|
13
|
+
*/
|
|
14
|
+
placement?: TooltipProps['placement'];
|
|
15
|
+
/**
|
|
16
|
+
* How wide the body is allowed to be, in pixels.
|
|
17
|
+
* @default 280
|
|
18
|
+
*/
|
|
19
|
+
width?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Class the tooltip popover carries, in addition to `help-tooltip`.
|
|
22
|
+
* @default undefined
|
|
23
|
+
*/
|
|
24
|
+
popoverClassName?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A piece of help attached to whatever it explains.
|
|
28
|
+
*
|
|
29
|
+
* The delay before it opens is long enough that sweeping the pointer across a
|
|
30
|
+
* row of controls opens nothing, and help carrying a link stays open long
|
|
31
|
+
* enough for the pointer to reach the link.
|
|
32
|
+
* @param props - See {@link HelpTooltipProps}.
|
|
33
|
+
* @returns The target, with its help.
|
|
34
|
+
*/
|
|
35
|
+
export declare function HelpTooltip(props: HelpTooltipProps): ReactElement;
|
|
36
|
+
//# sourceMappingURL=HelpTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpTooltip.d.ts","sourceRoot":"","sources":["../../../src/help/ui/HelpTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,OAAO,EAAE,WAAW,CAAC;IACrB,8BAA8B;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CA2BjE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip } from '@blueprintjs/core';
|
|
3
|
+
import { HelpBody } from "./HelpBody.js";
|
|
4
|
+
/**
|
|
5
|
+
* A piece of help attached to whatever it explains.
|
|
6
|
+
*
|
|
7
|
+
* The delay before it opens is long enough that sweeping the pointer across a
|
|
8
|
+
* row of controls opens nothing, and help carrying a link stays open long
|
|
9
|
+
* enough for the pointer to reach the link.
|
|
10
|
+
* @param props - See {@link HelpTooltipProps}.
|
|
11
|
+
* @returns The target, with its help.
|
|
12
|
+
*/
|
|
13
|
+
export function HelpTooltip(props) {
|
|
14
|
+
const { content, children, placement = 'top', width, popoverClassName, } = props;
|
|
15
|
+
const hasLink = content.link !== undefined;
|
|
16
|
+
return (_jsx(Tooltip, { content: _jsx(HelpBody, { content: content, width: width }), placement: placement, hoverOpenDelay: HOVER_OPEN_DELAY, hoverCloseDelay: hasLink ? HOVER_CLOSE_DELAY : 0, interactionKind: hasLink ? 'hover' : 'hover-target', targetTagName: "span", popoverClassName: popoverClassName === undefined
|
|
17
|
+
? 'help-tooltip'
|
|
18
|
+
: `help-tooltip ${popoverClassName}`, children: children }));
|
|
19
|
+
}
|
|
20
|
+
// Long enough that sweeping the pointer across a row of controls opens nothing.
|
|
21
|
+
const HOVER_OPEN_DELAY = 250;
|
|
22
|
+
// Help carrying a link has to outlive the pointer leaving its target.
|
|
23
|
+
const HOVER_CLOSE_DELAY = 300;
|
|
24
|
+
//# sourceMappingURL=HelpTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpTooltip.js","sourceRoot":"","sources":["../../../src/help/ui/HelpTooltip.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAyB1C;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,gBAAgB,GACjB,GAAG,KAAK,CAAC;IACV,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC;IAE3C,OAAO,CACL,KAAC,OAAO,IACN,OAAO,EAAE,KAAC,QAAQ,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAI,EACrD,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,gBAAgB,EAChC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAChD,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,EACnD,aAAa,EAAC,MAAM,EACpB,gBAAgB,EACd,gBAAgB,KAAK,SAAS;YAC5B,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,gBAAgB,gBAAgB,EAAE,YAGvC,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,sEAAsE;AACtE,MAAM,iBAAiB,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { HelpBodyProps, HelpContent, HelpExample } from './HelpBody.tsx';
|
|
2
|
+
export { HelpBody } from './HelpBody.tsx';
|
|
3
|
+
export type { HelpIconProps } from './HelpIcon.tsx';
|
|
4
|
+
export { HelpIcon } from './HelpIcon.tsx';
|
|
5
|
+
export type { HelpToolbarButtonProps } from './HelpToolbarButton.tsx';
|
|
6
|
+
export { HelpToolbarButton } from './HelpToolbarButton.tsx';
|
|
7
|
+
export type { HelpTooltipProps } from './HelpTooltip.tsx';
|
|
8
|
+
export { HelpTooltip } from './HelpTooltip.tsx';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/help/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/help/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useContainerSize } from './useContainerSize.ts';
|
|
2
|
+
export { useDebouncedValue } from './useDebouncedValue.ts';
|
|
3
|
+
export type { ListKeyboardNavigationOptions } from './useListKeyboardNavigation.ts';
|
|
4
|
+
export { useListKeyboardNavigation } from './useListKeyboardNavigation.ts';
|
|
5
|
+
export type { ElementSize } from './useResizeObserver.ts';
|
|
6
|
+
export { useResizeObserver } from './useResizeObserver.ts';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useContainerSize } from "./useContainerSize.js";
|
|
2
|
+
export { useDebouncedValue } from "./useDebouncedValue.js";
|
|
3
|
+
export { useListKeyboardNavigation } from "./useListKeyboardNavigation.js";
|
|
4
|
+
export { useResizeObserver } from "./useResizeObserver.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** The default number of entries `PageUp` and `PageDown` move by. */
|
|
2
|
+
export declare const DEFAULT_PAGE_STEP = 10;
|
|
3
|
+
/** How a list stands when a key reaches it. */
|
|
4
|
+
export interface ListNavigationOptions {
|
|
5
|
+
/** Number of entries currently displayed. */
|
|
6
|
+
length: number;
|
|
7
|
+
/** Index of the selected entry, or `-1` when nothing is selected. */
|
|
8
|
+
selectedIndex: number;
|
|
9
|
+
/**
|
|
10
|
+
* How many entries `PageUp` and `PageDown` move by. A value below one, or
|
|
11
|
+
* one that is not a number, falls back to the default.
|
|
12
|
+
* @default 10
|
|
13
|
+
*/
|
|
14
|
+
pageStep?: number;
|
|
15
|
+
}
|
|
16
|
+
/** The subset of a keyboard event list navigation reads. */
|
|
17
|
+
export interface ListNavigationKeyEvent {
|
|
18
|
+
/** The key that was pressed. */
|
|
19
|
+
key: string;
|
|
20
|
+
/** What the event was aimed at, used to leave typing alone. */
|
|
21
|
+
target?: EventTarget | null;
|
|
22
|
+
/** Stops the browser scrolling the page under the list. */
|
|
23
|
+
preventDefault: () => void;
|
|
24
|
+
}
|
|
25
|
+
/** What {@link handleListNavigationKey} needs on top of the list's shape. */
|
|
26
|
+
export interface ListNavigationHandlerOptions extends ListNavigationOptions {
|
|
27
|
+
/** Called with the index the key moved the selection to. */
|
|
28
|
+
onSelect: (index: number) => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The entry a navigation key selects.
|
|
32
|
+
*
|
|
33
|
+
* `ArrowDown` and `ArrowUp` move one step, `PageDown` and `PageUp` move
|
|
34
|
+
* `pageStep`, `Home` and `End` jump to the ends, and every result is clamped
|
|
35
|
+
* into the list. With nothing selected, moving down enters at the top and
|
|
36
|
+
* moving up enters at the bottom.
|
|
37
|
+
* @param key - The `key` of the keyboard event.
|
|
38
|
+
* @param options - See {@link ListNavigationOptions}.
|
|
39
|
+
* @returns The index to select — which may be the current one — or `null` when
|
|
40
|
+
* the key means nothing to a list.
|
|
41
|
+
*/
|
|
42
|
+
export declare function nextSelectedIndex(key: string, options: ListNavigationOptions): number | null;
|
|
43
|
+
/**
|
|
44
|
+
* Move a list's selection from a keyboard event.
|
|
45
|
+
*
|
|
46
|
+
* A key that reaches a text field, a select or an editable region is left
|
|
47
|
+
* alone, so typing a filter inside the list never moves the selection. A key
|
|
48
|
+
* the list acts on has its default suppressed even when the selection does not
|
|
49
|
+
* move, so the page never scrolls out from under the last entry.
|
|
50
|
+
* @param event - The keyboard event, synthetic or native.
|
|
51
|
+
* @param options - See {@link ListNavigationHandlerOptions}.
|
|
52
|
+
*/
|
|
53
|
+
export declare function handleListNavigationKey(event: ListNavigationKeyEvent, options: ListNavigationHandlerOptions): void;
|
|
54
|
+
//# sourceMappingURL=listNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listNavigation.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/listNavigation.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,+CAA+C;AAC/C,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,4DAA4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,2DAA2D;IAC3D,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,6EAA6E;AAC7E,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,4DAA4D;IAC5D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,qBAAqB,GAC7B,MAAM,GAAG,IAAI,CAmCf;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,sBAAsB,EAC7B,OAAO,EAAE,4BAA4B,GACpC,IAAI,CAMN"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** The default number of entries `PageUp` and `PageDown` move by. */
|
|
2
|
+
export const DEFAULT_PAGE_STEP = 10;
|
|
3
|
+
/**
|
|
4
|
+
* The entry a navigation key selects.
|
|
5
|
+
*
|
|
6
|
+
* `ArrowDown` and `ArrowUp` move one step, `PageDown` and `PageUp` move
|
|
7
|
+
* `pageStep`, `Home` and `End` jump to the ends, and every result is clamped
|
|
8
|
+
* into the list. With nothing selected, moving down enters at the top and
|
|
9
|
+
* moving up enters at the bottom.
|
|
10
|
+
* @param key - The `key` of the keyboard event.
|
|
11
|
+
* @param options - See {@link ListNavigationOptions}.
|
|
12
|
+
* @returns The index to select — which may be the current one — or `null` when
|
|
13
|
+
* the key means nothing to a list.
|
|
14
|
+
*/
|
|
15
|
+
export function nextSelectedIndex(key, options) {
|
|
16
|
+
const { length, selectedIndex, pageStep } = options;
|
|
17
|
+
if (!Number.isFinite(length) || length <= 0)
|
|
18
|
+
return null;
|
|
19
|
+
const step = typeof pageStep === 'number' && Number.isFinite(pageStep) && pageStep >= 1
|
|
20
|
+
? Math.floor(pageStep)
|
|
21
|
+
: DEFAULT_PAGE_STEP;
|
|
22
|
+
const current = selectedIndex >= 0 && selectedIndex < length ? selectedIndex : -1;
|
|
23
|
+
let target;
|
|
24
|
+
switch (key) {
|
|
25
|
+
case 'ArrowDown':
|
|
26
|
+
target = current === -1 ? 0 : current + 1;
|
|
27
|
+
break;
|
|
28
|
+
case 'ArrowUp':
|
|
29
|
+
target = current === -1 ? length - 1 : current - 1;
|
|
30
|
+
break;
|
|
31
|
+
case 'PageDown':
|
|
32
|
+
target = Math.max(current, 0) + step;
|
|
33
|
+
break;
|
|
34
|
+
case 'PageUp':
|
|
35
|
+
target = (current === -1 ? length - 1 : current) - step;
|
|
36
|
+
break;
|
|
37
|
+
case 'Home':
|
|
38
|
+
target = 0;
|
|
39
|
+
break;
|
|
40
|
+
case 'End':
|
|
41
|
+
target = length - 1;
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return Math.min(length - 1, Math.max(0, target));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Move a list's selection from a keyboard event.
|
|
50
|
+
*
|
|
51
|
+
* A key that reaches a text field, a select or an editable region is left
|
|
52
|
+
* alone, so typing a filter inside the list never moves the selection. A key
|
|
53
|
+
* the list acts on has its default suppressed even when the selection does not
|
|
54
|
+
* move, so the page never scrolls out from under the last entry.
|
|
55
|
+
* @param event - The keyboard event, synthetic or native.
|
|
56
|
+
* @param options - See {@link ListNavigationHandlerOptions}.
|
|
57
|
+
*/
|
|
58
|
+
export function handleListNavigationKey(event, options) {
|
|
59
|
+
if (isTextEntryTarget(event.target))
|
|
60
|
+
return;
|
|
61
|
+
const next = nextSelectedIndex(event.key, options);
|
|
62
|
+
if (next === null)
|
|
63
|
+
return;
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
if (next !== options.selectedIndex)
|
|
66
|
+
options.onSelect(next);
|
|
67
|
+
}
|
|
68
|
+
const TEXT_ENTRY_TAGS = new Set(['INPUT', 'TEXTAREA', 'SELECT']);
|
|
69
|
+
function isTextEntryTarget(target) {
|
|
70
|
+
if (target === null || target === undefined)
|
|
71
|
+
return false;
|
|
72
|
+
const element = target;
|
|
73
|
+
if (element.isContentEditable === true)
|
|
74
|
+
return true;
|
|
75
|
+
return (typeof element.tagName === 'string' && TEXT_ENTRY_TAGS.has(element.tagName));
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=listNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listNavigation.js","sourceRoot":"","sources":["../../../src/hooks/ui/listNavigation.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAgCpC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAW,EACX,OAA8B;IAE9B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACpD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACzD,MAAM,IAAI,GACR,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,IAAI,CAAC;QACxE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACtB,CAAC,CAAC,iBAAiB,CAAC;IACxB,MAAM,OAAO,GACX,aAAa,IAAI,CAAC,IAAI,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpE,IAAI,MAAc,CAAC;IACnB,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,WAAW;YACd,MAAM,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;YAC1C,MAAM;QACR,KAAK,SAAS;YACZ,MAAM,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;YACnD,MAAM;QACR,KAAK,UAAU;YACb,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;YACrC,MAAM;QACR,KAAK,QAAQ;YACX,MAAM,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;YACxD,MAAM;QACR,KAAK,MAAM;YACT,MAAM,GAAG,CAAC,CAAC;YACX,MAAM;QACR,KAAK,KAAK;YACR,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC;YACpB,MAAM;QACR;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAA6B,EAC7B,OAAqC;IAErC,IAAI,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO;IAC5C,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACnD,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO;IAC1B,KAAK,CAAC,cAAc,EAAE,CAAC;IACvB,IAAI,IAAI,KAAK,OAAO,CAAC,aAAa;QAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEjE,SAAS,iBAAiB,CAAC,MAAsC;IAC/D,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC1D,MAAM,OAAO,GAAG,MAA4D,CAAC;IAC7E,IAAI,OAAO,CAAC,iBAAiB,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACpD,OAAO,CACL,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { ElementSize } from './useResizeObserver.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The current content-box size of an element, as state.
|
|
5
|
+
*
|
|
6
|
+
* The state form of {@link useResizeObserver}, for a chart or a canvas that
|
|
7
|
+
* has to be laid out from the measurement rather than told about it. Both
|
|
8
|
+
* numbers are zero until the element is first measured, and the state is left
|
|
9
|
+
* untouched when a resize reports the same numbers, so a component that sizes
|
|
10
|
+
* itself from the value cannot loop.
|
|
11
|
+
* @param ref - Ref holding the element to measure.
|
|
12
|
+
* @returns Its width and height in CSS pixels.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useContainerSize(ref: RefObject<Element | null>): ElementSize;
|
|
15
|
+
//# sourceMappingURL=useContainerSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContainerSize.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useContainerSize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1D;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,WAAW,CAY5E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useResizeObserver } from "./useResizeObserver.js";
|
|
3
|
+
const EMPTY_SIZE = { width: 0, height: 0 };
|
|
4
|
+
/**
|
|
5
|
+
* The current content-box size of an element, as state.
|
|
6
|
+
*
|
|
7
|
+
* The state form of {@link useResizeObserver}, for a chart or a canvas that
|
|
8
|
+
* has to be laid out from the measurement rather than told about it. Both
|
|
9
|
+
* numbers are zero until the element is first measured, and the state is left
|
|
10
|
+
* untouched when a resize reports the same numbers, so a component that sizes
|
|
11
|
+
* itself from the value cannot loop.
|
|
12
|
+
* @param ref - Ref holding the element to measure.
|
|
13
|
+
* @returns Its width and height in CSS pixels.
|
|
14
|
+
*/
|
|
15
|
+
export function useContainerSize(ref) {
|
|
16
|
+
const [size, setSize] = useState(EMPTY_SIZE);
|
|
17
|
+
useResizeObserver(ref, (next) => {
|
|
18
|
+
setSize((current) => current.width === next.width && current.height === next.height
|
|
19
|
+
? current
|
|
20
|
+
: next);
|
|
21
|
+
});
|
|
22
|
+
return size;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=useContainerSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContainerSize.js","sourceRoot":"","sources":["../../../src/hooks/ui/useContainerSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,UAAU,GAAgB,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAExD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAA8B;IAC7D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAc,UAAU,CAAC,CAAC;IAE1D,iBAAiB,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;QAC9B,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAClB,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;YAC5D,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,IAAI,CACT,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A debounced echo of a fast-changing value.
|
|
3
|
+
*
|
|
4
|
+
* The returned value only catches up once the source has been still for
|
|
5
|
+
* `delayMs`, so a memo, a request or a canvas redraw downstream runs when the
|
|
6
|
+
* user pauses instead of on every keystroke or slider step.
|
|
7
|
+
* @param value - The live value to follow.
|
|
8
|
+
* @param delayMs - Quiet period, in milliseconds, before the value settles. Defaults to `250`.
|
|
9
|
+
* @returns The value as it stood `delayMs` after the last change.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useDebouncedValue<TValue>(value: TValue, delayMs?: number): TValue;
|
|
12
|
+
//# sourceMappingURL=useDebouncedValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedValue.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useDebouncedValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EACtC,KAAK,EAAE,MAAM,EACb,OAAO,SAAM,GACZ,MAAM,CAaR"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A debounced echo of a fast-changing value.
|
|
4
|
+
*
|
|
5
|
+
* The returned value only catches up once the source has been still for
|
|
6
|
+
* `delayMs`, so a memo, a request or a canvas redraw downstream runs when the
|
|
7
|
+
* user pauses instead of on every keystroke or slider step.
|
|
8
|
+
* @param value - The live value to follow.
|
|
9
|
+
* @param delayMs - Quiet period, in milliseconds, before the value settles. Defaults to `250`.
|
|
10
|
+
* @returns The value as it stood `delayMs` after the last change.
|
|
11
|
+
*/
|
|
12
|
+
export function useDebouncedValue(value, delayMs = 250) {
|
|
13
|
+
const [debounced, setDebounced] = useState(value);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const handle = setTimeout(() => {
|
|
16
|
+
setDebounced(value);
|
|
17
|
+
}, delayMs);
|
|
18
|
+
return () => {
|
|
19
|
+
clearTimeout(handle);
|
|
20
|
+
};
|
|
21
|
+
}, [value, delayMs]);
|
|
22
|
+
return debounced;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=useDebouncedValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebouncedValue.js","sourceRoot":"","sources":["../../../src/hooks/ui/useDebouncedValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,OAAO,GAAG,GAAG;IAEb,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,EAAE;YAC7B,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,EAAE,OAAO,CAAC,CAAC;QACZ,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAErB,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KeyboardEvent } from 'react';
|
|
2
|
+
import type { ListNavigationHandlerOptions } from './listNavigation.ts';
|
|
3
|
+
/** See {@link ListNavigationHandlerOptions}. */
|
|
4
|
+
export type ListKeyboardNavigationOptions = ListNavigationHandlerOptions;
|
|
5
|
+
/**
|
|
6
|
+
* Keyboard navigation for a list or a table whose selection lives outside it.
|
|
7
|
+
*
|
|
8
|
+
* Put the returned handler on the scrolling container — which needs a
|
|
9
|
+
* `tabIndex` so it can hold the focus — and `ArrowUp` / `ArrowDown` move one
|
|
10
|
+
* entry, `PageUp` / `PageDown` move `pageStep`, and `Home` / `End` jump to the
|
|
11
|
+
* ends. Nothing is stored in the hook: the selection stays wherever the page
|
|
12
|
+
* already keeps it, and `onSelect` fires only when the index actually changes.
|
|
13
|
+
* @param options - See {@link ListNavigationHandlerOptions}.
|
|
14
|
+
* @returns The `onKeyDown` handler for the container.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useListKeyboardNavigation(options: ListKeyboardNavigationOptions): (event: KeyboardEvent<HTMLElement>) => void;
|
|
17
|
+
//# sourceMappingURL=useListKeyboardNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useListKeyboardNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAGxE,gDAAgD;AAChD,MAAM,MAAM,6BAA6B,GAAG,4BAA4B,CAAC;AAEzE;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,6BAA6B,GACrC,CAAC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAc7C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { handleListNavigationKey } from "./listNavigation.js";
|
|
3
|
+
/**
|
|
4
|
+
* Keyboard navigation for a list or a table whose selection lives outside it.
|
|
5
|
+
*
|
|
6
|
+
* Put the returned handler on the scrolling container — which needs a
|
|
7
|
+
* `tabIndex` so it can hold the focus — and `ArrowUp` / `ArrowDown` move one
|
|
8
|
+
* entry, `PageUp` / `PageDown` move `pageStep`, and `Home` / `End` jump to the
|
|
9
|
+
* ends. Nothing is stored in the hook: the selection stays wherever the page
|
|
10
|
+
* already keeps it, and `onSelect` fires only when the index actually changes.
|
|
11
|
+
* @param options - See {@link ListNavigationHandlerOptions}.
|
|
12
|
+
* @returns The `onKeyDown` handler for the container.
|
|
13
|
+
*/
|
|
14
|
+
export function useListKeyboardNavigation(options) {
|
|
15
|
+
const { length, selectedIndex, onSelect, pageStep } = options;
|
|
16
|
+
return useCallback((event) => {
|
|
17
|
+
handleListNavigationKey(event, {
|
|
18
|
+
length,
|
|
19
|
+
selectedIndex,
|
|
20
|
+
onSelect,
|
|
21
|
+
pageStep,
|
|
22
|
+
});
|
|
23
|
+
}, [length, selectedIndex, onSelect, pageStep]);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=useListKeyboardNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListKeyboardNavigation.js","sourceRoot":"","sources":["../../../src/hooks/ui/useListKeyboardNavigation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAK9D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAsC;IAEtC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE9D,OAAO,WAAW,CAChB,CAAC,KAAiC,EAAE,EAAE;QACpC,uBAAuB,CAAC,KAAK,EAAE;YAC7B,MAAM;YACN,aAAa;YACb,QAAQ;YACR,QAAQ;SACT,CAAC,CAAC;IACL,CAAC,EACD,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
/** The content-box size of an element, in CSS pixels. */
|
|
3
|
+
export interface ElementSize {
|
|
4
|
+
/** Content-box width. */
|
|
5
|
+
width: number;
|
|
6
|
+
/** Content-box height. */
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Call `callback` whenever the observed element's content box changes size.
|
|
11
|
+
*
|
|
12
|
+
* The callback is read through a ref, so an inline arrow function may be
|
|
13
|
+
* passed on every render without tearing the observer down and setting it up
|
|
14
|
+
* again. Nothing is observed where `ResizeObserver` is missing — a server
|
|
15
|
+
* render, or a test rendering to a string — so the hook is safe to call there.
|
|
16
|
+
* @param ref - Ref holding the element to watch.
|
|
17
|
+
* @param callback - Receives the new content-box size.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useResizeObserver(ref: RefObject<Element | null>, callback: (size: ElementSize) => void): void;
|
|
20
|
+
//# sourceMappingURL=useResizeObserver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useResizeObserver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,yDAAyD;AACzD,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,EAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GACpC,IAAI,CAyBN"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Call `callback` whenever the observed element's content box changes size.
|
|
4
|
+
*
|
|
5
|
+
* The callback is read through a ref, so an inline arrow function may be
|
|
6
|
+
* passed on every render without tearing the observer down and setting it up
|
|
7
|
+
* again. Nothing is observed where `ResizeObserver` is missing — a server
|
|
8
|
+
* render, or a test rendering to a string — so the hook is safe to call there.
|
|
9
|
+
* @param ref - Ref holding the element to watch.
|
|
10
|
+
* @param callback - Receives the new content-box size.
|
|
11
|
+
*/
|
|
12
|
+
export function useResizeObserver(ref, callback) {
|
|
13
|
+
const callbackRef = useRef(callback);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
callbackRef.current = callback;
|
|
16
|
+
});
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const element = ref.current;
|
|
19
|
+
const Observer = globalThis.ResizeObserver;
|
|
20
|
+
if (element === null || Observer === undefined)
|
|
21
|
+
return;
|
|
22
|
+
const observer = new Observer((entries) => {
|
|
23
|
+
const entry = entries.at(-1);
|
|
24
|
+
if (entry === undefined)
|
|
25
|
+
return;
|
|
26
|
+
callbackRef.current({
|
|
27
|
+
width: entry.contentRect.width,
|
|
28
|
+
height: entry.contentRect.height,
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
observer.observe(element);
|
|
32
|
+
return () => {
|
|
33
|
+
observer.disconnect();
|
|
34
|
+
};
|
|
35
|
+
}, [ref]);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=useResizeObserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizeObserver.js","sourceRoot":"","sources":["../../../src/hooks/ui/useResizeObserver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAU1C;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAA8B,EAC9B,QAAqC;IAErC,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAErC,SAAS,CAAC,GAAG,EAAE;QACb,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5B,MAAM,QAAQ,GAAG,UAAU,CAAC,cACO,CAAC;QACpC,IAAI,OAAO,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO;QACvD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE;YACxC,MAAM,KAAK,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO;YAChC,WAAW,CAAC,OAAO,CAAC;gBAClB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK;gBAC9B,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM;aACjC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC"}
|