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,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the work a student did is kept, and how it is read back.
|
|
3
|
+
*
|
|
4
|
+
* The browser is the only binding there is by default; a course hosting its own
|
|
5
|
+
* service implements the same two calls and is plugged in instead, without
|
|
6
|
+
* anything else in the page knowing where the work went.
|
|
7
|
+
*/
|
|
8
|
+
import type { ExerciseStatus } from './types.ts';
|
|
9
|
+
/** What is remembered about one exercise. */
|
|
10
|
+
export interface ExerciseProgress {
|
|
11
|
+
status: ExerciseStatus;
|
|
12
|
+
/** What the student last wrote or drew, exactly as they left it. */
|
|
13
|
+
answer: string;
|
|
14
|
+
/**
|
|
15
|
+
* How many hints of the ladder were opened. A count, not a flag per hint:
|
|
16
|
+
* the ladder grows, and "solved with two hints" is what a student reads.
|
|
17
|
+
*/
|
|
18
|
+
hintsRevealed: number;
|
|
19
|
+
/** Whether the sample answer is on screen. */
|
|
20
|
+
showSolution: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Everything a student has done, keyed by exercise id. */
|
|
23
|
+
export type ProgressRecords<TProgress = ExerciseProgress> = Record<string, TProgress>;
|
|
24
|
+
/**
|
|
25
|
+
* Where the results of the exercises are kept.
|
|
26
|
+
*
|
|
27
|
+
* A binding that answers over the network returns a promise from either call;
|
|
28
|
+
* what {@link ProgressStore.load} resolves to replaces whatever the page
|
|
29
|
+
* started from.
|
|
30
|
+
*/
|
|
31
|
+
export interface ProgressStore<TProgress = ExerciseProgress> {
|
|
32
|
+
/** How the binding names itself, for a sentence about it on the page. */
|
|
33
|
+
readonly name: string;
|
|
34
|
+
/** Give back everything that was stored. */
|
|
35
|
+
load: () => ProgressRecords<TProgress> | Promise<ProgressRecords<TProgress>>;
|
|
36
|
+
/** Keep everything, as it stands after a change. */
|
|
37
|
+
save: (records: ProgressRecords<TProgress>) => void | Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The record an exercise nobody has touched starts from.
|
|
41
|
+
* @returns A blank record.
|
|
42
|
+
*/
|
|
43
|
+
export declare function emptyProgress(): ExerciseProgress;
|
|
44
|
+
/**
|
|
45
|
+
* Read one stored record over its defaults, field by field.
|
|
46
|
+
*
|
|
47
|
+
* A stored field is taken only when it has the same shape as its default, so a
|
|
48
|
+
* payload written by an older version of the page, or a corrupted one, falls
|
|
49
|
+
* back field by field rather than wholesale — and a field added after the last
|
|
50
|
+
* save simply keeps its default. A `null` default accepts anything.
|
|
51
|
+
* @param stored - Whatever came out of the store for this exercise.
|
|
52
|
+
* @param defaults - The record a fresh exercise starts from.
|
|
53
|
+
* @returns A complete record, with nothing unreadable carried over.
|
|
54
|
+
*/
|
|
55
|
+
export declare function mergeProgressRecord<TProgress extends object>(stored: unknown, defaults: TProgress): TProgress;
|
|
56
|
+
/**
|
|
57
|
+
* Read one stored {@link ExerciseProgress}, with its two constrained fields
|
|
58
|
+
* checked rather than merely shape-matched: a status outside the three the
|
|
59
|
+
* page knows reads as `idle`, and a hint count that is negative or fractional
|
|
60
|
+
* reads as none revealed.
|
|
61
|
+
* @param stored - Whatever came out of the store for this exercise.
|
|
62
|
+
* @returns A record the page can trust.
|
|
63
|
+
*/
|
|
64
|
+
export declare function mergeExerciseProgress(stored: unknown): ExerciseProgress;
|
|
65
|
+
/** What {@link localStorageProgressStore} is built from. */
|
|
66
|
+
export interface LocalStorageProgressStoreOptions<TProgress> {
|
|
67
|
+
/** Namespace of the entry, without the version: `smiles:exercises`. */
|
|
68
|
+
key: string;
|
|
69
|
+
/**
|
|
70
|
+
* Bumped when the shape of a record changes, so a future shape can ignore
|
|
71
|
+
* today's entries instead of misreading them.
|
|
72
|
+
* @default 1
|
|
73
|
+
*/
|
|
74
|
+
version?: number;
|
|
75
|
+
/**
|
|
76
|
+
* The record a fresh exercise starts from. When given, every stored record is
|
|
77
|
+
* read over it with {@link mergeProgressRecord}; when left out, a stored
|
|
78
|
+
* record is handed back as it was written.
|
|
79
|
+
* @default undefined
|
|
80
|
+
*/
|
|
81
|
+
defaults?: TProgress;
|
|
82
|
+
/**
|
|
83
|
+
* How the binding names itself on the page.
|
|
84
|
+
* @default 'this browser'
|
|
85
|
+
*/
|
|
86
|
+
name?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Keep the work in `localStorage`, under one namespaced and versioned entry.
|
|
90
|
+
* @param options - Which entry to use, and what a fresh record looks like.
|
|
91
|
+
* @returns The binding, ready to be handed to the page.
|
|
92
|
+
*/
|
|
93
|
+
export declare function localStorageProgressStore<TProgress extends object>(options: LocalStorageProgressStoreOptions<TProgress>): ProgressStore<TProgress>;
|
|
94
|
+
/** How far through a set of exercises a student is. */
|
|
95
|
+
export interface ProgressSummary {
|
|
96
|
+
/** How many are right. */
|
|
97
|
+
solved: number;
|
|
98
|
+
/** How many were handed in and are not right yet. */
|
|
99
|
+
attempted: number;
|
|
100
|
+
/** How many there are to do. */
|
|
101
|
+
total: number;
|
|
102
|
+
/** `solved / total`, and 0 when there is nothing to do. */
|
|
103
|
+
ratio: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Count where a student stands, for the progress bar over a set.
|
|
107
|
+
* @param records - What the store gave back.
|
|
108
|
+
* @param ids - The exercises of the set being counted. Pass them whenever the
|
|
109
|
+
* bar must read against the whole set: without them only the exercises that
|
|
110
|
+
* were touched are counted, and the bar would sit at 100% on the first answer.
|
|
111
|
+
* @returns The counts and the ratio the bar is drawn from.
|
|
112
|
+
*/
|
|
113
|
+
export declare function progressSummary<TProgress extends {
|
|
114
|
+
status: ExerciseStatus;
|
|
115
|
+
}>(records: ProgressRecords<TProgress>, ids?: readonly string[]): ProgressSummary;
|
|
116
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/pedagogy/core/progress.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,2DAA2D;AAC3D,MAAM,MAAM,eAAe,CAAC,SAAS,GAAG,gBAAgB,IAAI,MAAM,CAChE,MAAM,EACN,SAAS,CACV,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,aAAa,CAAC,SAAS,GAAG,gBAAgB;IACzD,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,eAAe,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7E,oDAAoD;IACpD,IAAI,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,gBAAgB,CAEhD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,SAAS,MAAM,EAC1D,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,GAClB,SAAS,CAUX;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,gBAAgB,CAQvE;AAED,4DAA4D;AAC5D,MAAM,WAAW,gCAAgC,CAAC,SAAS;IACzD,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,SAAS,MAAM,EAChE,OAAO,EAAE,gCAAgC,CAAC,SAAS,CAAC,GACnD,aAAa,CAAC,SAAS,CAAC,CAsB1B;AAED,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,SAAS;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,EAC1E,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,EACnC,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,GACtB,eAAe,CAWjB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the work a student did is kept, and how it is read back.
|
|
3
|
+
*
|
|
4
|
+
* The browser is the only binding there is by default; a course hosting its own
|
|
5
|
+
* service implements the same two calls and is plugged in instead, without
|
|
6
|
+
* anything else in the page knowing where the work went.
|
|
7
|
+
*/
|
|
8
|
+
import { readJsonEntry, writeJsonEntry } from "./jsonStorage.js";
|
|
9
|
+
/**
|
|
10
|
+
* The record an exercise nobody has touched starts from.
|
|
11
|
+
* @returns A blank record.
|
|
12
|
+
*/
|
|
13
|
+
export function emptyProgress() {
|
|
14
|
+
return { status: 'idle', answer: '', hintsRevealed: 0, showSolution: false };
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Read one stored record over its defaults, field by field.
|
|
18
|
+
*
|
|
19
|
+
* A stored field is taken only when it has the same shape as its default, so a
|
|
20
|
+
* payload written by an older version of the page, or a corrupted one, falls
|
|
21
|
+
* back field by field rather than wholesale — and a field added after the last
|
|
22
|
+
* save simply keeps its default. A `null` default accepts anything.
|
|
23
|
+
* @param stored - Whatever came out of the store for this exercise.
|
|
24
|
+
* @param defaults - The record a fresh exercise starts from.
|
|
25
|
+
* @returns A complete record, with nothing unreadable carried over.
|
|
26
|
+
*/
|
|
27
|
+
export function mergeProgressRecord(stored, defaults) {
|
|
28
|
+
const merged = { ...defaults };
|
|
29
|
+
if (!isPlainRecord(stored))
|
|
30
|
+
return merged;
|
|
31
|
+
for (const [field, fallback] of Object.entries(defaults)) {
|
|
32
|
+
const value = stored[field];
|
|
33
|
+
if (value !== undefined && isSameShape(fallback, value)) {
|
|
34
|
+
merged[field] = value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return merged;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Read one stored {@link ExerciseProgress}, with its two constrained fields
|
|
41
|
+
* checked rather than merely shape-matched: a status outside the three the
|
|
42
|
+
* page knows reads as `idle`, and a hint count that is negative or fractional
|
|
43
|
+
* reads as none revealed.
|
|
44
|
+
* @param stored - Whatever came out of the store for this exercise.
|
|
45
|
+
* @returns A record the page can trust.
|
|
46
|
+
*/
|
|
47
|
+
export function mergeExerciseProgress(stored) {
|
|
48
|
+
const merged = mergeProgressRecord(stored, emptyProgress());
|
|
49
|
+
return {
|
|
50
|
+
...merged,
|
|
51
|
+
status: STATUSES.has(merged.status) ? merged.status : 'idle',
|
|
52
|
+
hintsRevealed: merged.hintsRevealed > 0 ? Math.floor(merged.hintsRevealed) : 0,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Keep the work in `localStorage`, under one namespaced and versioned entry.
|
|
57
|
+
* @param options - Which entry to use, and what a fresh record looks like.
|
|
58
|
+
* @returns The binding, ready to be handed to the page.
|
|
59
|
+
*/
|
|
60
|
+
export function localStorageProgressStore(options) {
|
|
61
|
+
const { key, version = 1, defaults, name = 'this browser' } = options;
|
|
62
|
+
const storageKey = `${key}:v${version}`;
|
|
63
|
+
return {
|
|
64
|
+
name,
|
|
65
|
+
load() {
|
|
66
|
+
const records = {};
|
|
67
|
+
const stored = readJsonEntry(storageKey);
|
|
68
|
+
if (!isPlainRecord(stored))
|
|
69
|
+
return records;
|
|
70
|
+
for (const [id, value] of Object.entries(stored)) {
|
|
71
|
+
if (!isPlainRecord(value))
|
|
72
|
+
continue;
|
|
73
|
+
records[id] =
|
|
74
|
+
defaults === undefined
|
|
75
|
+
? value
|
|
76
|
+
: mergeProgressRecord(value, defaults);
|
|
77
|
+
}
|
|
78
|
+
return records;
|
|
79
|
+
},
|
|
80
|
+
save(records) {
|
|
81
|
+
writeJsonEntry(storageKey, records);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Count where a student stands, for the progress bar over a set.
|
|
87
|
+
* @param records - What the store gave back.
|
|
88
|
+
* @param ids - The exercises of the set being counted. Pass them whenever the
|
|
89
|
+
* bar must read against the whole set: without them only the exercises that
|
|
90
|
+
* were touched are counted, and the bar would sit at 100% on the first answer.
|
|
91
|
+
* @returns The counts and the ratio the bar is drawn from.
|
|
92
|
+
*/
|
|
93
|
+
export function progressSummary(records, ids) {
|
|
94
|
+
const keys = ids ?? Object.keys(records);
|
|
95
|
+
let solved = 0;
|
|
96
|
+
let attempted = 0;
|
|
97
|
+
for (const id of keys) {
|
|
98
|
+
const status = records[id]?.status;
|
|
99
|
+
if (status === 'solved')
|
|
100
|
+
solved++;
|
|
101
|
+
else if (status === 'attempted')
|
|
102
|
+
attempted++;
|
|
103
|
+
}
|
|
104
|
+
const total = keys.length;
|
|
105
|
+
return { solved, attempted, total, ratio: total === 0 ? 0 : solved / total };
|
|
106
|
+
}
|
|
107
|
+
const STATUSES = new Set([
|
|
108
|
+
'idle',
|
|
109
|
+
'attempted',
|
|
110
|
+
'solved',
|
|
111
|
+
]);
|
|
112
|
+
function isPlainRecord(value) {
|
|
113
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
114
|
+
}
|
|
115
|
+
function isSameShape(fallback, stored) {
|
|
116
|
+
if (fallback === null)
|
|
117
|
+
return true;
|
|
118
|
+
if (Array.isArray(fallback) !== Array.isArray(stored))
|
|
119
|
+
return false;
|
|
120
|
+
return typeof fallback === typeof stored && stored !== null;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/pedagogy/core/progress.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuCjE;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AAC/E,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAe,EACf,QAAmB;IAEnB,MAAM,MAAM,GAAG,EAAE,GAAG,QAAQ,EAA6B,CAAC;IAC1D,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;QAAE,OAAO,MAAmB,CAAC;IACvD,KAAK,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,KAAK,KAAK,SAAS,IAAI,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;YACxD,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,MAAmB,CAAC;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAe;IACnD,MAAM,MAAM,GAAG,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;IAC5D,OAAO;QACL,GAAG,MAAM;QACT,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QAC5D,aAAa,EACX,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;KAClE,CAAC;AACJ,CAAC;AA0BD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAoD;IAEpD,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,cAAc,EAAE,GAAG,OAAO,CAAC;IACtE,MAAM,UAAU,GAAG,GAAG,GAAG,KAAK,OAAO,EAAE,CAAC;IACxC,OAAO;QACL,IAAI;QACJ,IAAI;YACF,MAAM,OAAO,GAA+B,EAAE,CAAC;YAC/C,MAAM,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;YACzC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;gBAAE,OAAO,OAAO,CAAC;YAC3C,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;oBAAE,SAAS;gBACpC,OAAO,CAAC,EAAE,CAAC;oBACT,QAAQ,KAAK,SAAS;wBACpB,CAAC,CAAE,KAAmB;wBACtB,CAAC,CAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC7C,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,OAAmC;YACtC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC;AAcD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAmC,EACnC,GAAuB;IAEvB,MAAM,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QACnC,IAAI,MAAM,KAAK,QAAQ;YAAE,MAAM,EAAE,CAAC;aAC7B,IAAI,MAAM,KAAK,WAAW;YAAE,SAAS,EAAE,CAAC;IAC/C,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;AAC/E,CAAC;AAED,MAAM,QAAQ,GAAgC,IAAI,GAAG,CAAC;IACpD,MAAM;IACN,WAAW;IACX,QAAQ;CACT,CAAC,CAAC;AAEH,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,WAAW,CAAC,QAAiB,EAAE,MAAe;IACrD,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACpE,OAAO,OAAO,QAAQ,KAAK,OAAO,MAAM,IAAI,MAAM,KAAK,IAAI,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The spine every pedagogic tool shares: a level, a status, an exercise, a set
|
|
3
|
+
* of them, and one stop of a guided tour. What a given tool asks of a student
|
|
4
|
+
* differs — a regex, a SMILES, a formula — so those parts stay generic and the
|
|
5
|
+
* site adds them.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* How hard a step or an exercise is, which is also how it is coloured: green
|
|
9
|
+
* for a beginner, yellow for an intermediate, pink for an advanced one.
|
|
10
|
+
*/
|
|
11
|
+
export type ExerciseLevel = 'beginner' | 'intermediate' | 'advanced';
|
|
12
|
+
/**
|
|
13
|
+
* Where a student stands on one exercise: never handed in, handed in and not
|
|
14
|
+
* right yet, or right. The three are exclusive — a solved exercise is no longer
|
|
15
|
+
* an attempted one.
|
|
16
|
+
*/
|
|
17
|
+
export type ExerciseStatus = 'idle' | 'attempted' | 'solved';
|
|
18
|
+
/**
|
|
19
|
+
* What every exercise carries, whatever it asks for.
|
|
20
|
+
*
|
|
21
|
+
* A tool extends it with the shape of its own question and its own test cases.
|
|
22
|
+
*/
|
|
23
|
+
export interface BaseExercise {
|
|
24
|
+
/** Stable and URL-safe: it is what `/exercises/<id>` carries. */
|
|
25
|
+
id: string;
|
|
26
|
+
/** How the exercise is listed. */
|
|
27
|
+
title: string;
|
|
28
|
+
level: ExerciseLevel;
|
|
29
|
+
/** What to do, in a few sentences; may carry `[[term]]` markers. */
|
|
30
|
+
description: string;
|
|
31
|
+
/**
|
|
32
|
+
* Ordered from a nudge to almost the answer, revealed one at a time. Two to
|
|
33
|
+
* four is the useful range: never one, never six.
|
|
34
|
+
*/
|
|
35
|
+
hints: string[];
|
|
36
|
+
/** A sample answer, shown only when the student asks to see it. */
|
|
37
|
+
solution: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A named list of exercises, which is what a link hands out.
|
|
41
|
+
*
|
|
42
|
+
* The exercise type is the tool's own, so a set of SMARTS questions and a set
|
|
43
|
+
* of LaTeX formulas are the same structure holding different questions.
|
|
44
|
+
*/
|
|
45
|
+
export interface ExerciseSet<TExercise = BaseExercise> {
|
|
46
|
+
/** Stable and URL-safe. */
|
|
47
|
+
id: string;
|
|
48
|
+
title: string;
|
|
49
|
+
/** One line on what the set drills. */
|
|
50
|
+
description: string;
|
|
51
|
+
/**
|
|
52
|
+
* The level of the set as a whole, when it has one. A set whose level is read
|
|
53
|
+
* off its questions rather than written down leaves it out.
|
|
54
|
+
* @default undefined
|
|
55
|
+
*/
|
|
56
|
+
level?: ExerciseLevel;
|
|
57
|
+
exercises: TExercise[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* One stop in the guided tour, plus whatever the tool preloads into its live
|
|
61
|
+
* playground — a pattern and its flags, a SMILES, a structure and a layer.
|
|
62
|
+
*
|
|
63
|
+
* A step is a working configuration the student is free to edit, never a slide.
|
|
64
|
+
*/
|
|
65
|
+
export type TutorialStep<TPayload = unknown> = {
|
|
66
|
+
/** Stable and URL-safe: it is what a link to the step carries. */
|
|
67
|
+
id: string;
|
|
68
|
+
title: string;
|
|
69
|
+
/** One short paragraph; may carry `[[term]]` markers. */
|
|
70
|
+
description: string;
|
|
71
|
+
/** Which coloured group the step is listed under. */
|
|
72
|
+
level: ExerciseLevel;
|
|
73
|
+
} & TPayload;
|
|
74
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/pedagogy/core/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,cAAc,GAAG,UAAU,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW,CAAC,SAAS,GAAG,YAAY;IACnD,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,SAAS,EAAE,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,GAAG,OAAO,IAAI;IAC7C,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,KAAK,EAAE,aAAa,CAAC;CACtB,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The spine every pedagogic tool shares: a level, a status, an exercise, a set
|
|
3
|
+
* of them, and one stop of a guided tour. What a given tool asks of a student
|
|
4
|
+
* differs — a regex, a SMILES, a formula — so those parts stay generic and the
|
|
5
|
+
* site adds them.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/pedagogy/core/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The verdict on an answer, in the shape every tool reports it.
|
|
3
|
+
*
|
|
4
|
+
* An exercise is marked by running the answer against test cases, never by
|
|
5
|
+
* comparing it to a string: two people write one molecule, one regex or one
|
|
6
|
+
* formula the same way far less often than they write it differently.
|
|
7
|
+
*/
|
|
8
|
+
/** How one test case came out. */
|
|
9
|
+
export interface TestCaseResult {
|
|
10
|
+
passed: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* What happened, written the way a tutor would say it — `match was "cat",
|
|
13
|
+
* expected "cats"`, `not matched, but this one should be found`. It is the
|
|
14
|
+
* sentence the student reads when a case fails, so it names the value and
|
|
15
|
+
* what was wanted; never `assertion failed`.
|
|
16
|
+
*/
|
|
17
|
+
reason: string;
|
|
18
|
+
/** What the answer actually produced, or `null` when it produced nothing. */
|
|
19
|
+
actual: string | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The verdict on one answer: whether it is right, and everything the page needs
|
|
23
|
+
* to say why not.
|
|
24
|
+
*
|
|
25
|
+
* A tool that carries more per case — which test case it was, whether it was a
|
|
26
|
+
* match or a replacement — extends {@link TestCaseResult} and passes its own
|
|
27
|
+
* type through.
|
|
28
|
+
*/
|
|
29
|
+
export interface ValidationResult<TCase extends TestCaseResult = TestCaseResult> {
|
|
30
|
+
passed: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The one thing that stopped the cases from running at all: an answer that
|
|
33
|
+
* does not compile, or an empty one. `null` when the answer ran, however
|
|
34
|
+
* badly it did.
|
|
35
|
+
*/
|
|
36
|
+
error: string | null;
|
|
37
|
+
cases: TCase[];
|
|
38
|
+
/**
|
|
39
|
+
* The options the exercise requires and the answer does not carry — a regex
|
|
40
|
+
* flag, a stereo descriptor. Reported apart from the cases, because a student
|
|
41
|
+
* staring at half-passing tests has no way of guessing which one is missing.
|
|
42
|
+
*/
|
|
43
|
+
missingOptions: string[];
|
|
44
|
+
}
|
|
45
|
+
/** What {@link finishValidation} needs beyond the cases themselves. */
|
|
46
|
+
export interface FinishValidationOptions {
|
|
47
|
+
/**
|
|
48
|
+
* A message that stopped the cases from being meaningful.
|
|
49
|
+
* @default null
|
|
50
|
+
*/
|
|
51
|
+
error?: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Required options the answer does not carry.
|
|
54
|
+
* @default []
|
|
55
|
+
*/
|
|
56
|
+
missingOptions?: string[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Turn the cases a validator ran into the verdict on the answer.
|
|
60
|
+
*
|
|
61
|
+
* The answer is right only when nothing failed: no error, no missing option,
|
|
62
|
+
* and every case passed. A list with no cases in it has nothing failing in it
|
|
63
|
+
* and therefore passes — a validator that could not run its cases reports
|
|
64
|
+
* {@link failedValidation} instead of an empty list.
|
|
65
|
+
* @param cases - Every case that was run, in the order the page lists them.
|
|
66
|
+
* @param options - The error and the missing options, when there are any.
|
|
67
|
+
* @returns The verdict.
|
|
68
|
+
*/
|
|
69
|
+
export declare function finishValidation<TCase extends TestCaseResult>(cases: TCase[], options?: FinishValidationOptions): ValidationResult<TCase>;
|
|
70
|
+
/**
|
|
71
|
+
* The verdict on an answer that never ran — it does not compile, or there is
|
|
72
|
+
* nothing to mark yet.
|
|
73
|
+
* @param error - What to tell the student, in their words rather than the
|
|
74
|
+
* engine's whenever the engine's can be improved on.
|
|
75
|
+
* @param cases - The cases, when the page still lists them as not evaluated.
|
|
76
|
+
* @returns The verdict.
|
|
77
|
+
*/
|
|
78
|
+
export declare function failedValidation<TCase extends TestCaseResult>(error: string, cases?: TCase[]): ValidationResult<TCase>;
|
|
79
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/pedagogy/core/validation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,kCAAkC;AAClC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAC/B,KAAK,SAAS,cAAc,GAAG,cAAc;IAE7C,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,KAAK,EAAE,CAAC;IACf;;;;OAIG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,uEAAuE;AACvE,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,cAAc,EAC3D,KAAK,EAAE,KAAK,EAAE,EACd,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CAAC,KAAK,CAAC,CASzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,cAAc,EAC3D,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,KAAK,EAAO,GAClB,gBAAgB,CAAC,KAAK,CAAC,CAEzB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The verdict on an answer, in the shape every tool reports it.
|
|
3
|
+
*
|
|
4
|
+
* An exercise is marked by running the answer against test cases, never by
|
|
5
|
+
* comparing it to a string: two people write one molecule, one regex or one
|
|
6
|
+
* formula the same way far less often than they write it differently.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Turn the cases a validator ran into the verdict on the answer.
|
|
10
|
+
*
|
|
11
|
+
* The answer is right only when nothing failed: no error, no missing option,
|
|
12
|
+
* and every case passed. A list with no cases in it has nothing failing in it
|
|
13
|
+
* and therefore passes — a validator that could not run its cases reports
|
|
14
|
+
* {@link failedValidation} instead of an empty list.
|
|
15
|
+
* @param cases - Every case that was run, in the order the page lists them.
|
|
16
|
+
* @param options - The error and the missing options, when there are any.
|
|
17
|
+
* @returns The verdict.
|
|
18
|
+
*/
|
|
19
|
+
export function finishValidation(cases, options = {}) {
|
|
20
|
+
const error = options.error ?? null;
|
|
21
|
+
const missingOptions = options.missingOptions ?? [];
|
|
22
|
+
return {
|
|
23
|
+
passed: error === null && missingOptions.length === 0 && allPassed(cases),
|
|
24
|
+
error,
|
|
25
|
+
cases,
|
|
26
|
+
missingOptions,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The verdict on an answer that never ran — it does not compile, or there is
|
|
31
|
+
* nothing to mark yet.
|
|
32
|
+
* @param error - What to tell the student, in their words rather than the
|
|
33
|
+
* engine's whenever the engine's can be improved on.
|
|
34
|
+
* @param cases - The cases, when the page still lists them as not evaluated.
|
|
35
|
+
* @returns The verdict.
|
|
36
|
+
*/
|
|
37
|
+
export function failedValidation(error, cases = []) {
|
|
38
|
+
return { passed: false, error, cases, missingOptions: [] };
|
|
39
|
+
}
|
|
40
|
+
function allPassed(cases) {
|
|
41
|
+
for (const testCase of cases) {
|
|
42
|
+
if (!testCase.passed)
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/pedagogy/core/validation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyDH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,UAAmC,EAAE;IAErC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC;IACpC,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC;IACpD,OAAO;QACL,MAAM,EAAE,KAAK,KAAK,IAAI,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC;QACzE,KAAK;QACL,KAAK;QACL,cAAc;KACf,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAa,EACb,QAAiB,EAAE;IAEnB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;AAC7D,CAAC;AAED,SAAS,SAAS,CAAC,KAAgC;IACjD,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;IACrC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export interface ExerciseActionsProps {
|
|
3
|
+
/**
|
|
4
|
+
* Records the attempt. Grading itself runs on every keystroke, so this
|
|
5
|
+
* button commits the verdict rather than producing it.
|
|
6
|
+
* @default undefined — no Check button
|
|
7
|
+
*/
|
|
8
|
+
onCheck?: () => void;
|
|
9
|
+
/**
|
|
10
|
+
* Text of the Check button.
|
|
11
|
+
* @default 'Check'
|
|
12
|
+
*/
|
|
13
|
+
checkLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether checking is impossible yet — nothing typed, nothing drawn.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
checkDisabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Opens the next hint.
|
|
21
|
+
* @default undefined — no hint button; the ladder may carry its own
|
|
22
|
+
*/
|
|
23
|
+
onRevealHint?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* How many hints are already open, for the button's count.
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
28
|
+
hintsRevealed?: number;
|
|
29
|
+
/**
|
|
30
|
+
* How many hints the exercise has, for the button's count.
|
|
31
|
+
* @default 0
|
|
32
|
+
*/
|
|
33
|
+
hintCount?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Shows or hides the sample answer. Never gated behind anything: getting
|
|
36
|
+
* stuck and reading the answer is part of how the intuition is built.
|
|
37
|
+
* @default undefined — no solution button
|
|
38
|
+
*/
|
|
39
|
+
onToggleSolution?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the sample answer is on screen, which is what the button offers to
|
|
42
|
+
* undo.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
showSolution?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Puts the exercise back to a blank answer, no hints and no solution.
|
|
48
|
+
* @default undefined — no Reset button
|
|
49
|
+
*/
|
|
50
|
+
onReset?: () => void;
|
|
51
|
+
/**
|
|
52
|
+
* The buttons this tool adds — show the diagram, show the 3D view — rendered
|
|
53
|
+
* after the four standard ones.
|
|
54
|
+
* @default undefined
|
|
55
|
+
*/
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Class the row carries, so a site can reach it from its stylesheet.
|
|
59
|
+
* @default undefined
|
|
60
|
+
*/
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The row of controls under an exercise: Check, Reveal hint, the solution, and
|
|
65
|
+
* Reset.
|
|
66
|
+
*
|
|
67
|
+
* Every one of them is optional, because a tool that grades live has no Check
|
|
68
|
+
* and a tool with a single-field answer has no Reset — what matters is that the
|
|
69
|
+
* ones a tool does offer read the same and sit in the same order everywhere.
|
|
70
|
+
* @param props - The actions the exercise offers.
|
|
71
|
+
* @returns The row.
|
|
72
|
+
*/
|
|
73
|
+
export declare function ExerciseActions(props: ExerciseActionsProps): ReactElement;
|
|
74
|
+
//# sourceMappingURL=ExerciseActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExerciseActions.d.ts","sourceRoot":"","sources":["../../../src/pedagogy/ui/ExerciseActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA+CzE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@blueprintjs/core';
|
|
3
|
+
/**
|
|
4
|
+
* The row of controls under an exercise: Check, Reveal hint, the solution, and
|
|
5
|
+
* Reset.
|
|
6
|
+
*
|
|
7
|
+
* Every one of them is optional, because a tool that grades live has no Check
|
|
8
|
+
* and a tool with a single-field answer has no Reset — what matters is that the
|
|
9
|
+
* ones a tool does offer read the same and sit in the same order everywhere.
|
|
10
|
+
* @param props - The actions the exercise offers.
|
|
11
|
+
* @returns The row.
|
|
12
|
+
*/
|
|
13
|
+
export function ExerciseActions(props) {
|
|
14
|
+
const { onCheck, checkLabel = 'Check', checkDisabled = false, onRevealHint, hintsRevealed = 0, hintCount = 0, onToggleSolution, showSolution = false, onReset, children, className, } = props;
|
|
15
|
+
return (_jsxs("div", { className: className, style: ROW_STYLE, children: [onCheck !== undefined && (_jsx(Button, { intent: "primary", icon: "tick", text: checkLabel, disabled: checkDisabled, onClick: onCheck })), onRevealHint !== undefined && (_jsx(Button, { icon: "lightbulb", text: `Reveal hint (${Math.min(hintsRevealed, hintCount)}/${hintCount})`, disabled: hintsRevealed >= hintCount, onClick: onRevealHint })), onToggleSolution !== undefined && (_jsx(Button, { icon: showSolution ? 'eye-off' : 'key', text: showSolution ? 'Hide solution' : 'Reveal solution', onClick: onToggleSolution })), onReset !== undefined && (_jsx(Button, { icon: "reset", text: "Reset", onClick: onReset })), children] }));
|
|
16
|
+
}
|
|
17
|
+
const ROW_STYLE = {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexWrap: 'wrap',
|
|
20
|
+
gap: 6,
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=ExerciseActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExerciseActions.js","sourceRoot":"","sources":["../../../src/pedagogy/ui/ExerciseActions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAiE3C;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EACJ,OAAO,EACP,UAAU,GAAG,OAAO,EACpB,aAAa,GAAG,KAAK,EACrB,YAAY,EACZ,aAAa,GAAG,CAAC,EACjB,SAAS,GAAG,CAAC,EACb,gBAAgB,EAChB,YAAY,GAAG,KAAK,EACpB,OAAO,EACP,QAAQ,EACR,SAAS,GACV,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,aACxC,OAAO,KAAK,SAAS,IAAI,CACxB,KAAC,MAAM,IACL,MAAM,EAAC,SAAS,EAChB,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,OAAO,GAChB,CACH,EACA,YAAY,KAAK,SAAS,IAAI,CAC7B,KAAC,MAAM,IACL,IAAI,EAAC,WAAW,EAChB,IAAI,EAAE,gBAAgB,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,SAAS,CAAC,IAAI,SAAS,GAAG,EACxE,QAAQ,EAAE,aAAa,IAAI,SAAS,EACpC,OAAO,EAAE,YAAY,GACrB,CACH,EACA,gBAAgB,KAAK,SAAS,IAAI,CACjC,KAAC,MAAM,IACL,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACtC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,EACxD,OAAO,EAAE,gBAAgB,GACzB,CACH,EACA,OAAO,KAAK,SAAS,IAAI,CACxB,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,GAAI,CACvD,EACA,QAAQ,IACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAkB;IAC/B,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,MAAM;IAChB,GAAG,EAAE,CAAC;CACP,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { ProgressSummary } from '../core/progress.ts';
|
|
3
|
+
export interface ExerciseProgressHeaderProps {
|
|
4
|
+
/** Where the student stands, as `progressSummary` counted it. */
|
|
5
|
+
summary: ProgressSummary;
|
|
6
|
+
/**
|
|
7
|
+
* Throws away every answer, every revealed hint and every solved exercise.
|
|
8
|
+
* Guarded by a dialog the student has to confirm.
|
|
9
|
+
* @default undefined — the header only reports, and offers no way to wipe
|
|
10
|
+
*/
|
|
11
|
+
onClearAll?: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Text of the button that wipes the work.
|
|
14
|
+
* @default 'Clear all answers'
|
|
15
|
+
*/
|
|
16
|
+
clearLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* What the confirmation dialog says before the work is thrown away.
|
|
19
|
+
* @default a sentence saying what is lost and that there is no undo
|
|
20
|
+
*/
|
|
21
|
+
clearWarning?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the button is dead — there is nothing stored to wipe.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
clearDisabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Class the header carries, so a site can reach it from its stylesheet.
|
|
29
|
+
* @default undefined
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* How much of a set is solved, its bar, and the one way to wipe it.
|
|
35
|
+
*
|
|
36
|
+
* Wiping goes through a real dialog rather than `confirm()`: the button throws
|
|
37
|
+
* away a week of somebody's work, and a native prompt is both unstyled and
|
|
38
|
+
* dismissed by reflex.
|
|
39
|
+
* @param props - The counts, and what clearing does.
|
|
40
|
+
* @returns The header.
|
|
41
|
+
*/
|
|
42
|
+
export declare function ExerciseProgressHeader(props: ExerciseProgressHeaderProps): ReactElement;
|
|
43
|
+
//# sourceMappingURL=ExerciseProgressHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExerciseProgressHeader.d.ts","sourceRoot":"","sources":["../../../src/pedagogy/ui/ExerciseProgressHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,2BAA2B;IAC1C,iEAAiE;IACjE,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,2BAA2B,GACjC,YAAY,CA+Dd"}
|