react-cheminfo 0.64.1 → 0.66.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 +293 -6
- package/lib/card/core/cardAddress.d.ts +70 -0
- package/lib/card/core/cardAddress.d.ts.map +1 -0
- package/lib/card/core/cardAddress.js +59 -0
- package/lib/card/core/cardAddress.js.map +1 -0
- package/lib/card/core/cardPageUrl.d.ts +49 -0
- package/lib/card/core/cardPageUrl.d.ts.map +1 -0
- package/lib/card/core/cardPageUrl.js +59 -0
- package/lib/card/core/cardPageUrl.js.map +1 -0
- package/lib/card/core/index.d.ts +7 -0
- package/lib/card/core/index.d.ts.map +1 -0
- package/lib/card/core/index.js +4 -0
- package/lib/card/core/index.js.map +1 -0
- package/lib/card/core/panelRoom.d.ts +40 -0
- package/lib/card/core/panelRoom.d.ts.map +1 -0
- package/lib/card/core/panelRoom.js +40 -0
- package/lib/card/core/panelRoom.js.map +1 -0
- package/lib/card/ui/CardDetailsButton.d.ts +38 -0
- package/lib/card/ui/CardDetailsButton.d.ts.map +1 -0
- package/lib/card/ui/CardDetailsButton.js +50 -0
- package/lib/card/ui/CardDetailsButton.js.map +1 -0
- package/lib/card/ui/CardFigure.d.ts +51 -0
- package/lib/card/ui/CardFigure.d.ts.map +1 -0
- package/lib/card/ui/CardFigure.js +27 -0
- package/lib/card/ui/CardFigure.js.map +1 -0
- package/lib/card/ui/CardFrame.d.ts +30 -0
- package/lib/card/ui/CardFrame.d.ts.map +1 -0
- package/lib/card/ui/CardFrame.js +20 -0
- package/lib/card/ui/CardFrame.js.map +1 -0
- package/lib/card/ui/CopyTableButton.d.ts +37 -0
- package/lib/card/ui/CopyTableButton.d.ts.map +1 -0
- package/lib/card/ui/CopyTableButton.js +19 -0
- package/lib/card/ui/CopyTableButton.js.map +1 -0
- package/lib/card/ui/cardTooltip.d.ts +14 -0
- package/lib/card/ui/cardTooltip.d.ts.map +1 -0
- package/lib/card/ui/cardTooltip.js +15 -0
- package/lib/card/ui/cardTooltip.js.map +1 -0
- package/lib/card/ui/embed.d.ts +15 -0
- package/lib/card/ui/embed.d.ts.map +1 -0
- package/lib/card/ui/embed.js +24 -0
- package/lib/card/ui/embed.js.map +1 -0
- package/lib/card/ui/fitCardToFrame.d.ts +31 -0
- package/lib/card/ui/fitCardToFrame.d.ts.map +1 -0
- package/lib/card/ui/fitCardToFrame.js +66 -0
- package/lib/card/ui/fitCardToFrame.js.map +1 -0
- package/lib/card/ui/holdRoomForPanels.d.ts +16 -0
- package/lib/card/ui/holdRoomForPanels.d.ts.map +1 -0
- package/lib/card/ui/holdRoomForPanels.js +76 -0
- package/lib/card/ui/holdRoomForPanels.js.map +1 -0
- package/lib/card/ui/index.d.ts +11 -0
- package/lib/card/ui/index.d.ts.map +1 -0
- package/lib/card/ui/index.js +7 -0
- package/lib/card/ui/index.js.map +1 -0
- package/lib/card/ui/openPanels.d.ts +25 -0
- package/lib/card/ui/openPanels.d.ts.map +1 -0
- package/lib/card/ui/openPanels.js +85 -0
- package/lib/card/ui/openPanels.js.map +1 -0
- package/lib/card.d.ts +13 -0
- package/lib/card.d.ts.map +1 -0
- package/lib/card.js +13 -0
- package/lib/card.js.map +1 -0
- package/lib/conformers.d.ts +1 -0
- package/lib/conformers.d.ts.map +1 -1
- package/lib/conformers.js +1 -0
- package/lib/conformers.js.map +1 -1
- package/lib/core.d.ts +4 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +5 -0
- package/lib/core.js.map +1 -1
- package/lib/fetch/core/apiError.d.ts +56 -0
- package/lib/fetch/core/apiError.d.ts.map +1 -0
- package/lib/fetch/core/apiError.js +43 -0
- package/lib/fetch/core/apiError.js.map +1 -0
- package/lib/fetch/core/fetchJson.d.ts +47 -0
- package/lib/fetch/core/fetchJson.d.ts.map +1 -0
- package/lib/fetch/core/fetchJson.js +109 -0
- package/lib/fetch/core/fetchJson.js.map +1 -0
- package/lib/fetch/core/index.d.ts +5 -0
- package/lib/fetch/core/index.d.ts.map +1 -0
- package/lib/fetch/core/index.js +3 -0
- package/lib/fetch/core/index.js.map +1 -0
- package/lib/formula/core/formulaText.d.ts +46 -0
- package/lib/formula/core/formulaText.d.ts.map +1 -0
- package/lib/formula/core/formulaText.js +74 -0
- package/lib/formula/core/formulaText.js.map +1 -0
- package/lib/formula/core/index.d.ts +6 -0
- package/lib/formula/core/index.d.ts.map +1 -0
- package/lib/formula/core/index.js +4 -0
- package/lib/formula/core/index.js.map +1 -0
- package/lib/formula/core/normalizeFormula.d.ts +22 -0
- package/lib/formula/core/normalizeFormula.d.ts.map +1 -0
- package/lib/formula/core/normalizeFormula.js +46 -0
- package/lib/formula/core/normalizeFormula.js.map +1 -0
- package/lib/formula/core/readFormula.d.ts +73 -0
- package/lib/formula/core/readFormula.d.ts.map +1 -0
- package/lib/formula/core/readFormula.js +132 -0
- package/lib/formula/core/readFormula.js.map +1 -0
- package/lib/formula/ui/CopyableFormula.d.ts +31 -0
- package/lib/formula/ui/CopyableFormula.d.ts.map +1 -0
- package/lib/formula/ui/CopyableFormula.js +19 -0
- package/lib/formula/ui/CopyableFormula.js.map +1 -0
- package/lib/formula/ui/FormulaInput.d.ts +29 -0
- package/lib/formula/ui/FormulaInput.d.ts.map +1 -0
- package/lib/formula/ui/FormulaInput.js +16 -0
- package/lib/formula/ui/FormulaInput.js.map +1 -0
- package/lib/formula/ui/QuestionFormula.d.ts +14 -0
- package/lib/formula/ui/QuestionFormula.d.ts.map +1 -0
- package/lib/formula/ui/QuestionFormula.js +13 -0
- package/lib/formula/ui/QuestionFormula.js.map +1 -0
- package/lib/formula/ui/index.d.ts +7 -0
- package/lib/formula/ui/index.d.ts.map +1 -0
- package/lib/formula/ui/index.js +4 -0
- package/lib/formula/ui/index.js.map +1 -0
- package/lib/formula.d.ts +11 -0
- package/lib/formula.d.ts.map +1 -0
- package/lib/formula.js +11 -0
- package/lib/formula.js.map +1 -0
- package/lib/hooks/ui/index.d.ts +1 -0
- package/lib/hooks/ui/index.d.ts.map +1 -1
- package/lib/hooks/ui/index.js.map +1 -1
- package/lib/hooks/ui/keyTargets.d.ts +4 -2
- package/lib/hooks/ui/keyTargets.d.ts.map +1 -1
- package/lib/hooks/ui/keyTargets.js +5 -3
- package/lib/hooks/ui/keyTargets.js.map +1 -1
- package/lib/hooks/ui/useAsync.d.ts +20 -5
- package/lib/hooks/ui/useAsync.d.ts.map +1 -1
- package/lib/hooks/ui/useAsync.js +29 -14
- package/lib/hooks/ui/useAsync.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/ir/core/analysisSpectra.d.ts +23 -6
- package/lib/ir/core/analysisSpectra.d.ts.map +1 -1
- package/lib/ir/core/analysisSpectra.js.map +1 -1
- package/lib/ir/core/bandLabelPlan.d.ts.map +1 -1
- package/lib/ir/core/bandLabelPlan.js +11 -6
- package/lib/ir/core/bandLabelPlan.js.map +1 -1
- package/lib/ir/core/index.d.ts +13 -9
- package/lib/ir/core/index.d.ts.map +1 -1
- package/lib/ir/core/index.js +9 -6
- package/lib/ir/core/index.js.map +1 -1
- package/lib/ir/core/irBand.d.ts +45 -14
- package/lib/ir/core/irBand.d.ts.map +1 -1
- package/lib/ir/core/irBand.js +28 -6
- package/lib/ir/core/irBand.js.map +1 -1
- package/lib/ir/core/irCommands.d.ts +11 -0
- package/lib/ir/core/irCommands.d.ts.map +1 -1
- package/lib/ir/core/irCommands.js +11 -1
- package/lib/ir/core/irCommands.js.map +1 -1
- package/lib/ir/core/irDomain.d.ts +4 -3
- package/lib/ir/core/irDomain.d.ts.map +1 -1
- package/lib/ir/core/irDomain.js +10 -7
- package/lib/ir/core/irDomain.js.map +1 -1
- package/lib/ir/core/irFormat.d.ts +14 -2
- package/lib/ir/core/irFormat.d.ts.map +1 -1
- package/lib/ir/core/irFormat.js +33 -4
- package/lib/ir/core/irFormat.js.map +1 -1
- package/lib/ir/core/irMode.d.ts +35 -8
- package/lib/ir/core/irMode.d.ts.map +1 -1
- package/lib/ir/core/irMode.js +38 -10
- package/lib/ir/core/irMode.js.map +1 -1
- package/lib/ir/core/irReducer.d.ts +0 -28
- package/lib/ir/core/irReducer.d.ts.map +1 -1
- package/lib/ir/core/irReducer.js +1 -24
- package/lib/ir/core/irReducer.js.map +1 -1
- package/lib/ir/core/irSpectrum.d.ts +52 -26
- package/lib/ir/core/irSpectrum.d.ts.map +1 -1
- package/lib/ir/core/irSpectrum.js +21 -15
- package/lib/ir/core/irSpectrum.js.map +1 -1
- package/lib/ir/core/irState.d.ts +40 -2
- package/lib/ir/core/irState.d.ts.map +1 -1
- package/lib/ir/core/irState.js +38 -1
- package/lib/ir/core/irState.js.map +1 -1
- package/lib/ir/core/irTechnique.d.ts +94 -0
- package/lib/ir/core/irTechnique.d.ts.map +1 -0
- package/lib/ir/core/irTechnique.js +87 -0
- package/lib/ir/core/irTechnique.js.map +1 -0
- package/lib/ir/core/irTechniqueCommands.d.ts +26 -0
- package/lib/ir/core/irTechniqueCommands.d.ts.map +1 -0
- package/lib/ir/core/irTechniqueCommands.js +68 -0
- package/lib/ir/core/irTechniqueCommands.js.map +1 -0
- package/lib/ir/core/pickBands.d.ts +6 -5
- package/lib/ir/core/pickBands.d.ts.map +1 -1
- package/lib/ir/core/pickBands.js +49 -26
- package/lib/ir/core/pickBands.js.map +1 -1
- package/lib/ir/core/ramanBands.d.ts +30 -0
- package/lib/ir/core/ramanBands.d.ts.map +1 -0
- package/lib/ir/core/ramanBands.js +83 -0
- package/lib/ir/core/ramanBands.js.map +1 -0
- package/lib/ir/core/spectrumJcamp.d.ts +10 -5
- package/lib/ir/core/spectrumJcamp.d.ts.map +1 -1
- package/lib/ir/core/spectrumJcamp.js +63 -15
- package/lib/ir/core/spectrumJcamp.js.map +1 -1
- package/lib/ir/core/toIrSpectrum.d.ts.map +1 -1
- package/lib/ir/core/toIrSpectrum.js +17 -2
- package/lib/ir/core/toIrSpectrum.js.map +1 -1
- package/lib/ir/ui/BandRow.d.ts +30 -0
- package/lib/ir/ui/BandRow.d.ts.map +1 -0
- package/lib/ir/ui/BandRow.js +42 -0
- package/lib/ir/ui/BandRow.js.map +1 -0
- package/lib/ir/ui/BandsPanel.d.ts +4 -0
- package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
- package/lib/ir/ui/BandsPanel.js +14 -59
- package/lib/ir/ui/BandsPanel.js.map +1 -1
- package/lib/ir/ui/IrAboutDialog.d.ts +7 -0
- package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
- package/lib/ir/ui/IrAboutDialog.js +16 -3
- package/lib/ir/ui/IrAboutDialog.js.map +1 -1
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
- package/lib/ir/ui/IrCanvas.js +2 -2
- package/lib/ir/ui/IrCanvas.js.map +1 -1
- package/lib/ir/ui/IrChart.d.ts +2 -1
- package/lib/ir/ui/IrChart.d.ts.map +1 -1
- package/lib/ir/ui/IrChart.js +18 -21
- package/lib/ir/ui/IrChart.js.map +1 -1
- package/lib/ir/ui/IrCommandProvider.d.ts +7 -0
- package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -1
- package/lib/ir/ui/IrCommandProvider.js +2 -2
- package/lib/ir/ui/IrCommandProvider.js.map +1 -1
- package/lib/ir/ui/IrCommandTooltip.d.ts +7 -0
- package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -1
- package/lib/ir/ui/IrCommandTooltip.js +3 -2
- package/lib/ir/ui/IrCommandTooltip.js.map +1 -1
- package/lib/ir/ui/IrDocumentationDialog.d.ts +8 -1
- package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -1
- package/lib/ir/ui/IrDocumentationDialog.js +30 -7
- package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
- package/lib/ir/ui/IrEditor.d.ts +3 -1
- package/lib/ir/ui/IrEditor.d.ts.map +1 -1
- package/lib/ir/ui/IrEditor.js +3 -20
- package/lib/ir/ui/IrEditor.js.map +1 -1
- package/lib/ir/ui/IrHeader.d.ts.map +1 -1
- package/lib/ir/ui/IrHeader.js +5 -1
- package/lib/ir/ui/IrHeader.js.map +1 -1
- package/lib/ir/ui/IrLogo.d.ts +11 -3
- package/lib/ir/ui/IrLogo.d.ts.map +1 -1
- package/lib/ir/ui/IrLogo.js +14 -5
- package/lib/ir/ui/IrLogo.js.map +1 -1
- package/lib/ir/ui/IrShell.d.ts.map +1 -1
- package/lib/ir/ui/IrShell.js +23 -56
- package/lib/ir/ui/IrShell.js.map +1 -1
- package/lib/ir/ui/IrStatusBar.d.ts +3 -2
- package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
- package/lib/ir/ui/IrStatusBar.js +14 -9
- package/lib/ir/ui/IrStatusBar.js.map +1 -1
- package/lib/ir/ui/IrToolbar.d.ts +3 -0
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
- package/lib/ir/ui/IrToolbar.js +10 -3
- package/lib/ir/ui/IrToolbar.js.map +1 -1
- package/lib/ir/ui/IrTraces.d.ts +4 -1
- package/lib/ir/ui/IrTraces.d.ts.map +1 -1
- package/lib/ir/ui/IrTraces.js +2 -0
- package/lib/ir/ui/IrTraces.js.map +1 -1
- package/lib/ir/ui/RamanEditor.d.ts +46 -0
- package/lib/ir/ui/RamanEditor.d.ts.map +1 -0
- package/lib/ir/ui/RamanEditor.js +17 -0
- package/lib/ir/ui/RamanEditor.js.map +1 -0
- package/lib/ir/ui/SpectraPanel.d.ts.map +1 -1
- package/lib/ir/ui/SpectraPanel.js +2 -2
- package/lib/ir/ui/SpectraPanel.js.map +1 -1
- package/lib/ir/ui/SpectrumRow.d.ts +7 -0
- package/lib/ir/ui/SpectrumRow.d.ts.map +1 -1
- package/lib/ir/ui/SpectrumRow.js +4 -5
- package/lib/ir/ui/SpectrumRow.js.map +1 -1
- package/lib/ir/ui/VibrationalEditor.d.ts +48 -0
- package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -0
- package/lib/ir/ui/VibrationalEditor.js +31 -0
- package/lib/ir/ui/VibrationalEditor.js.map +1 -0
- package/lib/ir/ui/bandsTsv.d.ts +19 -0
- package/lib/ir/ui/bandsTsv.d.ts.map +1 -0
- package/lib/ir/ui/bandsTsv.js +38 -0
- package/lib/ir/ui/bandsTsv.js.map +1 -0
- package/lib/ir/ui/irChartProps.d.ts +14 -4
- package/lib/ir/ui/irChartProps.d.ts.map +1 -1
- package/lib/ir/ui/irChartProps.js +3 -2
- package/lib/ir/ui/irChartProps.js.map +1 -1
- package/lib/ir/ui/irCommandContext.d.ts +8 -0
- package/lib/ir/ui/irCommandContext.d.ts.map +1 -1
- package/lib/ir/ui/irCommandContext.js +14 -3
- package/lib/ir/ui/irCommandContext.js.map +1 -1
- package/lib/ir/ui/useIrEditor.d.ts +3 -3
- package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
- package/lib/ir/ui/useIrEditor.js +13 -4
- package/lib/ir/ui/useIrEditor.js.map +1 -1
- package/lib/ir/ui/useIrHandle.d.ts +14 -0
- package/lib/ir/ui/useIrHandle.d.ts.map +1 -0
- package/lib/ir/ui/useIrHandle.js +39 -0
- package/lib/ir/ui/useIrHandle.js.map +1 -0
- package/lib/ir/ui/useIrText.d.ts +40 -0
- package/lib/ir/ui/useIrText.d.ts.map +1 -0
- package/lib/ir/ui/useIrText.js +118 -0
- package/lib/ir/ui/useIrText.js.map +1 -0
- package/lib/ir/ui/useIrZoom.d.ts +7 -0
- package/lib/ir/ui/useIrZoom.d.ts.map +1 -1
- package/lib/ir/ui/useIrZoom.js +5 -4
- package/lib/ir/ui/useIrZoom.js.map +1 -1
- package/lib/ir/ui/useValueAxisZoom.d.ts +20 -0
- package/lib/ir/ui/useValueAxisZoom.d.ts.map +1 -0
- package/lib/ir/ui/useValueAxisZoom.js +54 -0
- package/lib/ir/ui/useValueAxisZoom.js.map +1 -0
- package/lib/ir.d.ts +3 -0
- package/lib/ir.d.ts.map +1 -1
- package/lib/ir.js +3 -0
- package/lib/ir.js.map +1 -1
- package/lib/locales/de.json +57 -1
- package/lib/locales/en.json +57 -1
- package/lib/locales/es.json +57 -1
- package/lib/locales/fr.json +57 -1
- package/lib/locales/it.json +57 -1
- package/lib/moleculesClient/core/index.d.ts +5 -0
- package/lib/moleculesClient/core/index.d.ts.map +1 -0
- package/lib/moleculesClient/core/index.js +3 -0
- package/lib/moleculesClient/core/index.js.map +1 -0
- package/lib/moleculesClient/core/moleculesClient.d.ts +12 -0
- package/lib/moleculesClient/core/moleculesClient.d.ts.map +1 -0
- package/lib/moleculesClient/core/moleculesClient.js +105 -0
- package/lib/moleculesClient/core/moleculesClient.js.map +1 -0
- package/lib/moleculesClient/core/moleculesClientApi.d.ts +100 -0
- package/lib/moleculesClient/core/moleculesClientApi.d.ts.map +1 -0
- package/lib/moleculesClient/core/moleculesClientApi.js +20 -0
- package/lib/moleculesClient/core/moleculesClientApi.js.map +1 -0
- package/lib/moleculesClient/core/moleculesTypes.d.ts +154 -0
- package/lib/moleculesClient/core/moleculesTypes.d.ts.map +1 -0
- package/lib/moleculesClient/core/moleculesTypes.js +2 -0
- package/lib/moleculesClient/core/moleculesTypes.js.map +1 -0
- package/lib/moleculesClient/core/requestRetry.d.ts +50 -0
- package/lib/moleculesClient/core/requestRetry.d.ts.map +1 -0
- package/lib/moleculesClient/core/requestRetry.js +108 -0
- package/lib/moleculesClient/core/requestRetry.js.map +1 -0
- package/lib/molstar/core/camera.d.ts +2 -1
- package/lib/molstar/core/camera.d.ts.map +1 -1
- package/lib/molstar/core/camera.js +3 -2
- package/lib/molstar/core/camera.js.map +1 -1
- package/lib/molstar/core/framing.d.ts +102 -0
- package/lib/molstar/core/framing.d.ts.map +1 -0
- package/lib/molstar/core/framing.js +120 -0
- package/lib/molstar/core/framing.js.map +1 -0
- package/lib/molstar/core/hover.d.ts +16 -0
- package/lib/molstar/core/hover.d.ts.map +1 -1
- package/lib/molstar/core/hover.js +14 -0
- package/lib/molstar/core/hover.js.map +1 -1
- package/lib/molstar/core/index.d.ts +4 -1
- package/lib/molstar/core/index.d.ts.map +1 -1
- package/lib/molstar/core/index.js +2 -1
- package/lib/molstar/core/index.js.map +1 -1
- package/lib/pedagogy/core/answers.d.ts +46 -0
- package/lib/pedagogy/core/answers.d.ts.map +1 -0
- package/lib/pedagogy/core/answers.js +77 -0
- package/lib/pedagogy/core/answers.js.map +1 -0
- package/lib/pedagogy/core/attempts.d.ts +86 -0
- package/lib/pedagogy/core/attempts.d.ts.map +1 -0
- package/lib/pedagogy/core/attempts.js +117 -0
- package/lib/pedagogy/core/attempts.js.map +1 -0
- package/lib/pedagogy/core/index.d.ts +8 -0
- package/lib/pedagogy/core/index.d.ts.map +1 -1
- package/lib/pedagogy/core/index.js +4 -0
- package/lib/pedagogy/core/index.js.map +1 -1
- package/lib/pedagogy/core/progressController.d.ts +64 -0
- package/lib/pedagogy/core/progressController.d.ts.map +1 -0
- package/lib/pedagogy/core/progressController.js +56 -0
- package/lib/pedagogy/core/progressController.js.map +1 -0
- package/lib/pedagogy/core/seed.d.ts +96 -0
- package/lib/pedagogy/core/seed.d.ts.map +1 -0
- package/lib/pedagogy/core/seed.js +128 -0
- package/lib/pedagogy/core/seed.js.map +1 -0
- package/lib/pedagogy/core/series.d.ts +77 -0
- package/lib/pedagogy/core/series.d.ts.map +1 -0
- package/lib/pedagogy/core/series.js +10 -0
- package/lib/pedagogy/core/series.js.map +1 -0
- package/lib/pedagogy/ui/AnswerFields.d.ts +21 -0
- package/lib/pedagogy/ui/AnswerFields.d.ts.map +1 -0
- package/lib/pedagogy/ui/AnswerFields.js +24 -0
- package/lib/pedagogy/ui/AnswerFields.js.map +1 -0
- package/lib/pedagogy/ui/ExerciseList.d.ts +82 -0
- package/lib/pedagogy/ui/ExerciseList.d.ts.map +1 -0
- package/lib/pedagogy/ui/ExerciseList.js +53 -0
- package/lib/pedagogy/ui/ExerciseList.js.map +1 -0
- package/lib/pedagogy/ui/ExerciseSeries.d.ts +95 -0
- package/lib/pedagogy/ui/ExerciseSeries.d.ts.map +1 -0
- package/lib/pedagogy/ui/ExerciseSeries.js +74 -0
- package/lib/pedagogy/ui/ExerciseSeries.js.map +1 -0
- package/lib/pedagogy/ui/QuestionCard.d.ts +64 -0
- package/lib/pedagogy/ui/QuestionCard.d.ts.map +1 -0
- package/lib/pedagogy/ui/QuestionCard.js +73 -0
- package/lib/pedagogy/ui/QuestionCard.js.map +1 -0
- package/lib/pedagogy/ui/index.d.ts +10 -0
- package/lib/pedagogy/ui/index.d.ts.map +1 -1
- package/lib/pedagogy/ui/index.js +6 -0
- package/lib/pedagogy/ui/index.js.map +1 -1
- package/lib/pedagogy/ui/seriesCounts.d.ts +17 -0
- package/lib/pedagogy/ui/seriesCounts.d.ts.map +1 -0
- package/lib/pedagogy/ui/seriesCounts.js +27 -0
- package/lib/pedagogy/ui/seriesCounts.js.map +1 -0
- package/lib/pedagogy/ui/seriesParts.d.ts +55 -0
- package/lib/pedagogy/ui/seriesParts.d.ts.map +1 -0
- package/lib/pedagogy/ui/seriesParts.js +38 -0
- package/lib/pedagogy/ui/seriesParts.js.map +1 -0
- package/lib/pedagogy/ui/useAttemptRecords.d.ts +10 -0
- package/lib/pedagogy/ui/useAttemptRecords.d.ts.map +1 -0
- package/lib/pedagogy/ui/useAttemptRecords.js +11 -0
- package/lib/pedagogy/ui/useAttemptRecords.js.map +1 -0
- package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTable.js +6 -3
- package/lib/periodic/ui/PeriodicTable.js.map +1 -1
- package/lib/property/core/copyableText.d.ts +14 -0
- package/lib/property/core/copyableText.d.ts.map +1 -0
- package/lib/property/core/copyableText.js +21 -0
- package/lib/property/core/copyableText.js.map +1 -0
- package/lib/property/core/index.d.ts +2 -0
- package/lib/property/core/index.d.ts.map +1 -0
- package/lib/property/core/index.js +2 -0
- package/lib/property/core/index.js.map +1 -0
- package/lib/property/ui/PropertyTable.d.ts +43 -0
- package/lib/property/ui/PropertyTable.d.ts.map +1 -0
- package/lib/property/ui/PropertyTable.js +19 -0
- package/lib/property/ui/PropertyTable.js.map +1 -0
- package/lib/property/ui/index.d.ts +3 -0
- package/lib/property/ui/index.d.ts.map +1 -0
- package/lib/property/ui/index.js +2 -0
- package/lib/property/ui/index.js.map +1 -0
- package/lib/raman.d.ts +16 -0
- package/lib/raman.d.ts.map +1 -0
- package/lib/raman.js +12 -0
- package/lib/raman.js.map +1 -0
- package/lib/router/core/history.d.ts +24 -3
- package/lib/router/core/history.d.ts.map +1 -1
- package/lib/router/core/history.js +55 -7
- package/lib/router/core/history.js.map +1 -1
- package/lib/router/core/index.d.ts +3 -3
- package/lib/router/core/index.d.ts.map +1 -1
- package/lib/router/core/index.js +2 -2
- package/lib/router/core/index.js.map +1 -1
- package/lib/router/core/languageRoute.d.ts +61 -0
- package/lib/router/core/languageRoute.d.ts.map +1 -0
- package/lib/router/core/languageRoute.js +96 -0
- package/lib/router/core/languageRoute.js.map +1 -0
- package/lib/router/core/siteAddresses.d.ts +23 -0
- package/lib/router/core/siteAddresses.d.ts.map +1 -1
- package/lib/router/core/siteAddresses.js +26 -0
- package/lib/router/core/siteAddresses.js.map +1 -1
- package/lib/router/core/tabRouter.d.ts +2 -108
- package/lib/router/core/tabRouter.d.ts.map +1 -1
- package/lib/router/core/tabRouter.js +38 -5
- package/lib/router/core/tabRouter.js.map +1 -1
- package/lib/router/core/tabRouterTypes.d.ts +154 -0
- package/lib/router/core/tabRouterTypes.d.ts.map +1 -0
- package/lib/router/core/tabRouterTypes.js +2 -0
- package/lib/router/core/tabRouterTypes.js.map +1 -0
- package/lib/seo/core/fitDescription.d.ts +40 -0
- package/lib/seo/core/fitDescription.d.ts.map +1 -0
- package/lib/seo/core/fitDescription.js +45 -0
- package/lib/seo/core/fitDescription.js.map +1 -0
- package/lib/seo/core/index.d.ts +7 -0
- package/lib/seo/core/index.d.ts.map +1 -1
- package/lib/seo/core/index.js +4 -0
- package/lib/seo/core/index.js.map +1 -1
- package/lib/seo/core/limits.d.ts +24 -0
- package/lib/seo/core/limits.d.ts.map +1 -0
- package/lib/seo/core/limits.js +24 -0
- package/lib/seo/core/limits.js.map +1 -0
- package/lib/seo/core/pageContent.d.ts +25 -0
- package/lib/seo/core/pageContent.d.ts.map +1 -0
- package/lib/seo/core/pageContent.js +25 -0
- package/lib/seo/core/pageContent.js.map +1 -0
- package/lib/seo/core/plainDescription.d.ts.map +1 -1
- package/lib/seo/core/plainDescription.js +3 -2
- package/lib/seo/core/plainDescription.js.map +1 -1
- package/lib/seo/core/routeProblems.d.ts.map +1 -1
- package/lib/seo/core/routeProblems.js +1 -6
- package/lib/seo/core/routeProblems.js.map +1 -1
- package/lib/seo/core/routeTable.d.ts +31 -0
- package/lib/seo/core/routeTable.d.ts.map +1 -0
- package/lib/seo/core/routeTable.js +96 -0
- package/lib/seo/core/routeTable.js.map +1 -0
- package/lib/seo/vite/index.d.ts +2 -0
- package/lib/seo/vite/index.d.ts.map +1 -1
- package/lib/seo/vite/index.js +1 -0
- package/lib/seo/vite/index.js.map +1 -1
- package/lib/seo/vite/prerender.d.ts +10 -0
- package/lib/seo/vite/prerender.d.ts.map +1 -1
- package/lib/seo/vite/prerender.js +12 -1
- package/lib/seo/vite/prerender.js.map +1 -1
- package/lib/seo/vite/routeTable.d.ts +40 -0
- package/lib/seo/vite/routeTable.d.ts.map +1 -0
- package/lib/seo/vite/routeTable.js +44 -0
- package/lib/seo/vite/routeTable.js.map +1 -0
- package/lib/server/answerAddresses.d.ts +51 -0
- package/lib/server/answerAddresses.d.ts.map +1 -0
- package/lib/server/answerAddresses.js +72 -0
- package/lib/server/answerAddresses.js.map +1 -0
- package/lib/server/cardMeta.d.ts +57 -0
- package/lib/server/cardMeta.d.ts.map +1 -0
- package/lib/server/cardMeta.js +52 -0
- package/lib/server/cardMeta.js.map +1 -0
- package/lib/server/config.d.ts +72 -0
- package/lib/server/config.d.ts.map +1 -0
- package/lib/server/config.js +67 -0
- package/lib/server/config.js.map +1 -0
- package/lib/server/envNumber.d.ts +35 -0
- package/lib/server/envNumber.d.ts.map +1 -0
- package/lib/server/envNumber.js +42 -0
- package/lib/server/envNumber.js.map +1 -0
- package/lib/server/healthRoute.d.ts +26 -0
- package/lib/server/healthRoute.d.ts.map +1 -0
- package/lib/server/healthRoute.js +22 -0
- package/lib/server/healthRoute.js.map +1 -0
- package/lib/server/listenSite.d.ts +38 -0
- package/lib/server/listenSite.d.ts.map +1 -0
- package/lib/server/listenSite.js +60 -0
- package/lib/server/listenSite.js.map +1 -0
- package/lib/server/mcpServer.d.ts +8 -0
- package/lib/server/mcpServer.d.ts.map +1 -0
- package/lib/server/mcpServer.js +11 -0
- package/lib/server/mcpServer.js.map +1 -0
- package/lib/server/repositoryVersion.d.ts +16 -0
- package/lib/server/repositoryVersion.d.ts.map +1 -0
- package/lib/server/repositoryVersion.js +33 -0
- package/lib/server/repositoryVersion.js.map +1 -0
- package/lib/server/routeOptions.d.ts +23 -0
- package/lib/server/routeOptions.d.ts.map +1 -0
- package/lib/server/routeOptions.js +20 -0
- package/lib/server/routeOptions.js.map +1 -0
- package/lib/server/routeTable.d.ts +14 -0
- package/lib/server/routeTable.d.ts.map +1 -0
- package/lib/server/routeTable.js +32 -0
- package/lib/server/routeTable.js.map +1 -0
- package/lib/server/siteView.d.ts +29 -0
- package/lib/server/siteView.d.ts.map +1 -0
- package/lib/server/siteView.js +21 -0
- package/lib/server/siteView.js.map +1 -0
- package/lib/server/spaPages.d.ts +32 -0
- package/lib/server/spaPages.d.ts.map +1 -0
- package/lib/server/spaPages.js +126 -0
- package/lib/server/spaPages.js.map +1 -0
- package/lib/server/spaSite.d.ts +30 -0
- package/lib/server/spaSite.d.ts.map +1 -0
- package/lib/server/spaSite.js +170 -0
- package/lib/server/spaSite.js.map +1 -0
- package/lib/server/spaSiteOptions.d.ts +126 -0
- package/lib/server/spaSiteOptions.d.ts.map +1 -0
- package/lib/server/spaSiteOptions.js +2 -0
- package/lib/server/spaSiteOptions.js.map +1 -0
- package/lib/server/staticSite.d.ts +9 -0
- package/lib/server/staticSite.d.ts.map +1 -1
- package/lib/server/staticSite.js +41 -19
- package/lib/server/staticSite.js.map +1 -1
- package/lib/server/toolSiteServer.d.ts +77 -0
- package/lib/server/toolSiteServer.d.ts.map +1 -0
- package/lib/server/toolSiteServer.js +58 -0
- package/lib/server/toolSiteServer.js.map +1 -0
- package/lib/server/trustProxy.d.ts +20 -0
- package/lib/server/trustProxy.d.ts.map +1 -0
- package/lib/server/trustProxy.js +32 -0
- package/lib/server/trustProxy.js.map +1 -0
- package/lib/server/types.d.ts +13 -0
- package/lib/server/types.d.ts.map +1 -0
- package/lib/server/types.js +2 -0
- package/lib/server/types.js.map +1 -0
- package/lib/server.d.ts +22 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +12 -0
- package/lib/server.js.map +1 -1
- package/lib/share/core/config.d.ts +18 -0
- package/lib/share/core/config.d.ts.map +1 -1
- package/lib/share/core/config.js +33 -2
- package/lib/share/core/config.js.map +1 -1
- package/lib/share/core/index.d.ts +3 -1
- package/lib/share/core/index.d.ts.map +1 -1
- package/lib/share/core/index.js +2 -1
- package/lib/share/core/index.js.map +1 -1
- package/lib/share/core/keySetParam.d.ts +40 -0
- package/lib/share/core/keySetParam.d.ts.map +1 -0
- package/lib/share/core/keySetParam.js +60 -0
- package/lib/share/core/keySetParam.js.map +1 -0
- package/lib/share/core/vocabulary.d.ts +8 -0
- package/lib/share/core/vocabulary.d.ts.map +1 -1
- package/lib/shell/ui/ShareControl.d.ts +75 -0
- package/lib/shell/ui/ShareControl.d.ts.map +1 -0
- package/lib/shell/ui/ShareControl.js +40 -0
- package/lib/shell/ui/ShareControl.js.map +1 -0
- package/lib/shell/ui/ShellFrame.d.ts +14 -0
- package/lib/shell/ui/ShellFrame.d.ts.map +1 -0
- package/lib/shell/ui/ShellFrame.js +45 -0
- package/lib/shell/ui/ShellFrame.js.map +1 -0
- package/lib/shell/ui/SiteShell.d.ts +251 -0
- package/lib/shell/ui/SiteShell.d.ts.map +1 -0
- package/lib/shell/ui/SiteShell.js +39 -0
- package/lib/shell/ui/SiteShell.js.map +1 -0
- package/lib/shell/ui/index.d.ts +5 -0
- package/lib/shell/ui/index.d.ts.map +1 -0
- package/lib/shell/ui/index.js +3 -0
- package/lib/shell/ui/index.js.map +1 -0
- package/lib/state/core/index.d.ts +1 -0
- package/lib/state/core/index.d.ts.map +1 -1
- package/lib/state/core/index.js.map +1 -1
- package/lib/state/core/legacyEntries.d.ts +30 -0
- package/lib/state/core/legacyEntries.d.ts.map +1 -0
- package/lib/state/core/legacyEntries.js +51 -0
- package/lib/state/core/legacyEntries.js.map +1 -0
- package/lib/state/core/persistBucket.d.ts +26 -2
- package/lib/state/core/persistBucket.d.ts.map +1 -1
- package/lib/state/core/persistBucket.js +26 -9
- package/lib/state/core/persistBucket.js.map +1 -1
- package/lib/state/core/persistSignalBucket.d.ts +26 -0
- package/lib/state/core/persistSignalBucket.d.ts.map +1 -1
- package/lib/state/core/persistSignalBucket.js +31 -0
- package/lib/state/core/persistSignalBucket.js.map +1 -1
- package/lib/state/core/storageEntry.d.ts +15 -0
- package/lib/state/core/storageEntry.d.ts.map +1 -1
- package/lib/state/core/storageEntry.js +33 -0
- package/lib/state/core/storageEntry.js.map +1 -1
- package/lib/structure/ui/StructureExportButton.d.ts +27 -0
- package/lib/structure/ui/StructureExportButton.d.ts.map +1 -0
- package/lib/structure/ui/StructureExportButton.js +21 -0
- package/lib/structure/ui/StructureExportButton.js.map +1 -0
- package/lib/structure/ui/index.d.ts +4 -0
- package/lib/structure/ui/index.d.ts.map +1 -1
- package/lib/structure/ui/index.js +2 -0
- package/lib/structure/ui/index.js.map +1 -1
- package/lib/structure/ui/useStructureDraft.d.ts +32 -0
- package/lib/structure/ui/useStructureDraft.d.ts.map +1 -0
- package/lib/structure/ui/useStructureDraft.js +20 -0
- package/lib/structure/ui/useStructureDraft.js.map +1 -0
- package/lib/ui.d.ts +2 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +2 -0
- package/lib/ui.js.map +1 -1
- package/lib/worker/core/index.d.ts +1 -1
- package/lib/worker/core/index.d.ts.map +1 -1
- package/lib/worker/core/messages.d.ts +4 -2
- package/lib/worker/core/messages.d.ts.map +1 -1
- package/lib/worker/core/messages.js.map +1 -1
- package/lib/worker/core/oclResourcesUrl.d.ts +16 -0
- package/lib/worker/core/oclResourcesUrl.d.ts.map +1 -0
- package/lib/worker/core/oclResourcesUrl.js +19 -0
- package/lib/worker/core/oclResourcesUrl.js.map +1 -0
- package/lib/worker/core/serveWorkerRequests.d.ts +8 -0
- package/lib/worker/core/serveWorkerRequests.d.ts.map +1 -1
- package/lib/worker/core/serveWorkerRequests.js +15 -2
- package/lib/worker/core/serveWorkerRequests.js.map +1 -1
- package/lib/worker/core/workerChannel.d.ts +3 -4
- package/lib/worker/core/workerChannel.d.ts.map +1 -1
- package/lib/worker/core/workerChannel.js +72 -67
- package/lib/worker/core/workerChannel.js.map +1 -1
- package/lib/worker/core/workerChannelParts.d.ts +17 -6
- package/lib/worker/core/workerChannelParts.d.ts.map +1 -1
- package/lib/worker/core/workerChannelParts.js +20 -4
- package/lib/worker/core/workerChannelParts.js.map +1 -1
- package/lib/worker/core/workerChannelTypes.d.ts +46 -2
- package/lib/worker/core/workerChannelTypes.d.ts.map +1 -1
- package/lib/worker/core/workerSlot.d.ts +66 -0
- package/lib/worker/core/workerSlot.d.ts.map +1 -0
- package/lib/worker/core/workerSlot.js +107 -0
- package/lib/worker/core/workerSlot.js.map +1 -0
- package/package.json +17 -1
- package/src/card/core/cardAddress.ts +100 -0
- package/src/card/core/cardPageUrl.ts +97 -0
- package/src/card/core/index.ts +6 -0
- package/src/card/core/panelRoom.ts +66 -0
- package/src/card/ui/CardDetailsButton.tsx +104 -0
- package/src/card/ui/CardFigure.tsx +86 -0
- package/src/card/ui/CardFrame.tsx +46 -0
- package/src/card/ui/CopyTableButton.tsx +81 -0
- package/src/card/ui/cardTooltip.ts +18 -0
- package/src/card/ui/embed.ts +27 -0
- package/src/card/ui/fitCardToFrame.ts +76 -0
- package/src/card/ui/holdRoomForPanels.ts +83 -0
- package/src/card/ui/index.ts +14 -0
- package/src/card/ui/openPanels.ts +106 -0
- package/src/card.ts +13 -0
- package/src/conformers.ts +4 -0
- package/src/core.ts +5 -0
- package/src/fetch/core/apiError.ts +65 -0
- package/src/fetch/core/fetchJson.ts +129 -0
- package/src/fetch/core/index.ts +4 -0
- package/src/formula/core/formulaText.ts +96 -0
- package/src/formula/core/index.ts +20 -0
- package/src/formula/core/normalizeFormula.ts +50 -0
- package/src/formula/core/readFormula.ts +211 -0
- package/src/formula/ui/CopyableFormula.tsx +51 -0
- package/src/formula/ui/FormulaInput.tsx +50 -0
- package/src/formula/ui/QuestionFormula.tsx +20 -0
- package/src/formula/ui/index.ts +6 -0
- package/src/formula.ts +11 -0
- package/src/hooks/ui/index.ts +1 -0
- package/src/hooks/ui/keyTargets.ts +5 -3
- package/src/hooks/ui/useAsync.ts +50 -14
- package/src/ir/core/analysisSpectra.ts +26 -10
- package/src/ir/core/bandLabelPlan.ts +21 -10
- package/src/ir/core/index.ts +25 -5
- package/src/ir/core/irBand.ts +52 -14
- package/src/ir/core/irCommands.ts +15 -1
- package/src/ir/core/irDomain.ts +9 -7
- package/src/ir/core/irFormat.ts +39 -6
- package/src/ir/core/irMode.ts +42 -10
- package/src/ir/core/irReducer.ts +1 -49
- package/src/ir/core/irSpectrum.ts +59 -30
- package/src/ir/core/irState.ts +67 -2
- package/src/ir/core/irTechnique.ts +115 -0
- package/src/ir/core/irTechniqueCommands.ts +82 -0
- package/src/ir/core/pickBands.ts +63 -28
- package/src/ir/core/ramanBands.ts +105 -0
- package/src/ir/core/spectrumJcamp.ts +65 -16
- package/src/ir/core/toIrSpectrum.ts +20 -2
- package/src/ir/ui/BandRow.tsx +107 -0
- package/src/ir/ui/BandsPanel.tsx +32 -125
- package/src/ir/ui/IrAboutDialog.tsx +69 -28
- package/src/ir/ui/IrCanvas.tsx +2 -1
- package/src/ir/ui/IrChart.tsx +20 -24
- package/src/ir/ui/IrCommandProvider.tsx +10 -3
- package/src/ir/ui/IrCommandTooltip.tsx +11 -2
- package/src/ir/ui/IrDocumentationDialog.tsx +99 -55
- package/src/ir/ui/IrEditor.tsx +5 -36
- package/src/ir/ui/IrHeader.tsx +10 -3
- package/src/ir/ui/IrLogo.tsx +28 -9
- package/src/ir/ui/IrShell.tsx +27 -75
- package/src/ir/ui/IrStatusBar.tsx +17 -12
- package/src/ir/ui/IrToolbar.tsx +26 -15
- package/src/ir/ui/IrTraces.tsx +5 -1
- package/src/ir/ui/RamanEditor.tsx +53 -0
- package/src/ir/ui/SpectraPanel.tsx +2 -1
- package/src/ir/ui/SpectrumRow.tsx +14 -5
- package/src/ir/ui/VibrationalEditor.tsx +94 -0
- package/src/ir/ui/bandsTsv.ts +46 -0
- package/src/ir/ui/irChartProps.ts +14 -4
- package/src/ir/ui/irCommandContext.tsx +18 -3
- package/src/ir/ui/useIrEditor.ts +20 -8
- package/src/ir/ui/useIrHandle.ts +51 -0
- package/src/ir/ui/useIrText.ts +170 -0
- package/src/ir/ui/useIrZoom.ts +12 -3
- package/src/ir/ui/useValueAxisZoom.ts +67 -0
- package/src/ir.ts +3 -0
- package/src/locales/de.json +57 -1
- package/src/locales/en.json +57 -1
- package/src/locales/es.json +57 -1
- package/src/locales/fr.json +57 -1
- package/src/locales/it.json +57 -1
- package/src/moleculesClient/core/index.ts +19 -0
- package/src/moleculesClient/core/moleculesClient.ts +175 -0
- package/src/moleculesClient/core/moleculesClientApi.ts +120 -0
- package/src/moleculesClient/core/moleculesTypes.ts +163 -0
- package/src/moleculesClient/core/requestRetry.ts +118 -0
- package/src/molstar/core/camera.ts +3 -2
- package/src/molstar/core/framing.ts +200 -0
- package/src/molstar/core/hover.ts +26 -0
- package/src/molstar/core/index.ts +21 -1
- package/src/pedagogy/core/answers.ts +94 -0
- package/src/pedagogy/core/attempts.ts +205 -0
- package/src/pedagogy/core/index.ts +36 -0
- package/src/pedagogy/core/progressController.ts +116 -0
- package/src/pedagogy/core/seed.ts +177 -0
- package/src/pedagogy/core/series.ts +82 -0
- package/src/pedagogy/ui/AnswerFields.tsx +63 -0
- package/src/pedagogy/ui/ExerciseList.tsx +202 -0
- package/src/pedagogy/ui/ExerciseSeries.tsx +250 -0
- package/src/pedagogy/ui/QuestionCard.tsx +231 -0
- package/src/pedagogy/ui/index.ts +18 -0
- package/src/pedagogy/ui/seriesCounts.ts +34 -0
- package/src/pedagogy/ui/seriesParts.tsx +127 -0
- package/src/pedagogy/ui/useAttemptRecords.ts +16 -0
- package/src/periodic/ui/PeriodicTable.tsx +6 -3
- package/src/property/core/copyableText.ts +20 -0
- package/src/property/core/index.ts +1 -0
- package/src/property/ui/PropertyTable.tsx +83 -0
- package/src/property/ui/index.ts +2 -0
- package/src/raman.ts +19 -0
- package/src/router/core/history.ts +61 -7
- package/src/router/core/index.ts +3 -2
- package/src/router/core/languageRoute.ts +136 -0
- package/src/router/core/siteAddresses.ts +38 -0
- package/src/router/core/tabRouter.ts +59 -117
- package/src/router/core/tabRouterTypes.ts +158 -0
- package/src/seo/core/fitDescription.ts +74 -0
- package/src/seo/core/index.ts +17 -0
- package/src/seo/core/limits.ts +27 -0
- package/src/seo/core/pageContent.ts +42 -0
- package/src/seo/core/plainDescription.ts +4 -2
- package/src/seo/core/routeProblems.ts +1 -7
- package/src/seo/core/routeTable.ts +103 -0
- package/src/seo/vite/index.ts +2 -0
- package/src/seo/vite/prerender.ts +26 -1
- package/src/seo/vite/routeTable.ts +79 -0
- package/src/server/answerAddresses.ts +92 -0
- package/src/server/cardMeta.ts +88 -0
- package/src/server/config.ts +125 -0
- package/src/server/envNumber.ts +65 -0
- package/src/server/healthRoute.ts +42 -0
- package/src/server/listenSite.ts +90 -0
- package/src/server/mcpServer.ts +14 -0
- package/src/server/repositoryVersion.ts +33 -0
- package/src/server/routeOptions.ts +26 -0
- package/src/server/routeTable.ts +35 -0
- package/src/server/siteView.ts +42 -0
- package/src/server/spaPages.ts +179 -0
- package/src/server/spaSite.ts +216 -0
- package/src/server/spaSiteOptions.ts +133 -0
- package/src/server/staticSite.ts +65 -35
- package/src/server/toolSiteServer.ts +127 -0
- package/src/server/trustProxy.ts +32 -0
- package/src/server/types.ts +25 -0
- package/src/server.ts +40 -0
- package/src/share/core/config.ts +45 -2
- package/src/share/core/index.ts +4 -0
- package/src/share/core/keySetParam.ts +92 -0
- package/src/share/core/vocabulary.ts +8 -0
- package/src/shell/ui/ShareControl.tsx +150 -0
- package/src/shell/ui/ShellFrame.tsx +180 -0
- package/src/shell/ui/SiteShell.tsx +297 -0
- package/src/shell/ui/index.ts +9 -0
- package/src/state/core/index.ts +1 -0
- package/src/state/core/legacyEntries.ts +76 -0
- package/src/state/core/persistBucket.ts +50 -10
- package/src/state/core/persistSignalBucket.ts +52 -0
- package/src/state/core/storageEntry.ts +32 -0
- package/src/structure/ui/StructureExportButton.tsx +57 -0
- package/src/structure/ui/index.ts +4 -0
- package/src/structure/ui/useStructureDraft.ts +47 -0
- package/src/ui.ts +2 -0
- package/src/worker/core/index.ts +1 -0
- package/src/worker/core/messages.ts +4 -3
- package/src/worker/core/oclResourcesUrl.ts +21 -0
- package/src/worker/core/serveWorkerRequests.ts +30 -2
- package/src/worker/core/workerChannel.ts +74 -74
- package/src/worker/core/workerChannelParts.ts +33 -13
- package/src/worker/core/workerChannelTypes.ts +47 -2
- package/src/worker/core/workerSlot.ts +181 -0
- package/styles/card.css +145 -0
- package/styles/chrome.css +248 -0
|
@@ -40,3 +40,39 @@ export type {
|
|
|
40
40
|
ValidationResult,
|
|
41
41
|
} from './validation.ts';
|
|
42
42
|
export { failedValidation, finishValidation } from './validation.ts';
|
|
43
|
+
export {
|
|
44
|
+
emptyCase,
|
|
45
|
+
formatSigned,
|
|
46
|
+
readAnswerNumber,
|
|
47
|
+
unreadableCase,
|
|
48
|
+
} from './answers.ts';
|
|
49
|
+
export type { Attempt, AttemptStore, AttemptStoreOptions } from './attempts.ts';
|
|
50
|
+
export { attemptKey, createAttemptStore, emptyAttempt } from './attempts.ts';
|
|
51
|
+
export type {
|
|
52
|
+
ControlledProgress,
|
|
53
|
+
ProgressController,
|
|
54
|
+
ProgressControllerOptions,
|
|
55
|
+
ProgressSignal,
|
|
56
|
+
} from './progressController.ts';
|
|
57
|
+
export { createProgressController } from './progressController.ts';
|
|
58
|
+
export type {
|
|
59
|
+
PickSeededOptions,
|
|
60
|
+
SeedDraw,
|
|
61
|
+
SeedRange,
|
|
62
|
+
SeedValue,
|
|
63
|
+
} from './seed.ts';
|
|
64
|
+
export {
|
|
65
|
+
EACH_SEED,
|
|
66
|
+
LARGEST_SEED,
|
|
67
|
+
freshSeed,
|
|
68
|
+
parseSeed,
|
|
69
|
+
pickSeeded,
|
|
70
|
+
seedParam,
|
|
71
|
+
} from './seed.ts';
|
|
72
|
+
export type {
|
|
73
|
+
AnswerCheck,
|
|
74
|
+
AnswerField,
|
|
75
|
+
Answers,
|
|
76
|
+
FieldCase,
|
|
77
|
+
SeriesTool,
|
|
78
|
+
} from './series.ts';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The handful of actions every exercise page performs on the progress it keeps:
|
|
3
|
+
* read one record, mark it, open a hint, show the answer, forget it.
|
|
4
|
+
*
|
|
5
|
+
* The records live in whatever the page already holds its state in — a signal
|
|
6
|
+
* of `@preact/signals-react`, or anything with a writable `value` — and every
|
|
7
|
+
* action replaces that value rather than mutating it, so whatever renders from
|
|
8
|
+
* it is told.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ExerciseProgress, ProgressRecords } from './progress.ts';
|
|
12
|
+
import { emptyProgress } from './progress.ts';
|
|
13
|
+
import type { ExerciseStatus } from './types.ts';
|
|
14
|
+
|
|
15
|
+
/** A writable box holding the records, which a signal is. */
|
|
16
|
+
export interface ProgressSignal<TProgress> {
|
|
17
|
+
/** The records by exercise id; replaced, never mutated. */
|
|
18
|
+
value: ProgressRecords<TProgress>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The least a record has to carry for the controller to act on it. */
|
|
22
|
+
export interface ControlledProgress {
|
|
23
|
+
/** Where the student stands. */
|
|
24
|
+
status: ExerciseStatus;
|
|
25
|
+
/** How many hints are open. */
|
|
26
|
+
hintsRevealed: number;
|
|
27
|
+
/** Whether the sample answer is on screen. */
|
|
28
|
+
showSolution: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** What {@link createProgressController} is built with. */
|
|
32
|
+
export interface ProgressControllerOptions<TProgress> {
|
|
33
|
+
/**
|
|
34
|
+
* The record an exercise nobody has touched reads as.
|
|
35
|
+
* @default emptyProgress — status, answer, hints and solution
|
|
36
|
+
*/
|
|
37
|
+
empty?: () => TProgress;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The actions on one page's progress. */
|
|
41
|
+
export interface ProgressController<TProgress extends ControlledProgress> {
|
|
42
|
+
/** One exercise's record, defaults included; reads the signal. */
|
|
43
|
+
getExerciseProgress: (id: string) => TProgress;
|
|
44
|
+
/** Record an attempt or a success. */
|
|
45
|
+
setExerciseStatus: (id: string, status: ExerciseStatus) => void;
|
|
46
|
+
/** Change any fields of one record, the others kept. */
|
|
47
|
+
updateProgress: (id: string, patch: Partial<TProgress>) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Open the next hint, one at a time, stopping at the last when the count is
|
|
50
|
+
* given.
|
|
51
|
+
*/
|
|
52
|
+
revealNextHint: (id: string, hintCount?: number) => void;
|
|
53
|
+
/** Show or hide the sample answer. */
|
|
54
|
+
setShowSolution: (id: string, show: boolean) => void;
|
|
55
|
+
/** Forget one exercise. */
|
|
56
|
+
resetExercise: (id: string) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Forget every exercise. The page puts this behind a confirmation dialog,
|
|
59
|
+
* because it wipes a week of a student's work.
|
|
60
|
+
*/
|
|
61
|
+
clearAllProgress: () => void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The actions on the progress a page keeps in a signal.
|
|
66
|
+
* @param progress - The signal holding the records by exercise id.
|
|
67
|
+
* @param options - What an untouched exercise reads as.
|
|
68
|
+
* @returns The actions.
|
|
69
|
+
*/
|
|
70
|
+
export function createProgressController<
|
|
71
|
+
TProgress extends ControlledProgress = ExerciseProgress,
|
|
72
|
+
>(
|
|
73
|
+
progress: ProgressSignal<TProgress>,
|
|
74
|
+
options: ProgressControllerOptions<TProgress> = {},
|
|
75
|
+
): ProgressController<TProgress> {
|
|
76
|
+
const empty = options.empty ?? (emptyProgress as unknown as () => TProgress);
|
|
77
|
+
|
|
78
|
+
function getExerciseProgress(id: string): TProgress {
|
|
79
|
+
return { ...empty(), ...progress.value[id] };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function updateProgress(id: string, patch: Partial<TProgress>): void {
|
|
83
|
+
progress.value = {
|
|
84
|
+
...progress.value,
|
|
85
|
+
[id]: { ...getExerciseProgress(id), ...patch },
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
getExerciseProgress,
|
|
91
|
+
updateProgress,
|
|
92
|
+
setExerciseStatus(id, status) {
|
|
93
|
+
updateProgress(id, { status } as Partial<TProgress>);
|
|
94
|
+
},
|
|
95
|
+
revealNextHint(id, hintCount) {
|
|
96
|
+
const revealed = getExerciseProgress(id).hintsRevealed + 1;
|
|
97
|
+
updateProgress(id, {
|
|
98
|
+
hintsRevealed:
|
|
99
|
+
hintCount === undefined ? revealed : Math.min(revealed, hintCount),
|
|
100
|
+
} as Partial<TProgress>);
|
|
101
|
+
},
|
|
102
|
+
setShowSolution(id, show) {
|
|
103
|
+
updateProgress(id, { showSolution: show } as Partial<TProgress>);
|
|
104
|
+
},
|
|
105
|
+
resetExercise(id) {
|
|
106
|
+
const next: ProgressRecords<TProgress> = {};
|
|
107
|
+
for (const [key, value] of Object.entries(progress.value)) {
|
|
108
|
+
if (key !== id) next[key] = value;
|
|
109
|
+
}
|
|
110
|
+
progress.value = next;
|
|
111
|
+
},
|
|
112
|
+
clearAllProgress() {
|
|
113
|
+
progress.value = {};
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The seed a series is drawn from, and the drawing itself.
|
|
3
|
+
*
|
|
4
|
+
* A series is a link: `?seed=4271` hands the same questions, in the same order,
|
|
5
|
+
* to everybody who opens it, on every machine and in every browser. So the
|
|
6
|
+
* drawing goes through `ml-xsadd` and nothing else — a hand-rolled generator
|
|
7
|
+
* silently changes its sequence the day somebody improves it, and every link
|
|
8
|
+
* that pinned a seed then opens a different problem set.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { XSadd } from 'ml-xsadd';
|
|
12
|
+
|
|
13
|
+
import type { ShareParamCodec } from '../../share/core/params.ts';
|
|
14
|
+
|
|
15
|
+
/** The largest seed a link may carry: an unsigned 32-bit integer. */
|
|
16
|
+
export const LARGEST_SEED = 2 ** 32 - 1;
|
|
17
|
+
|
|
18
|
+
/** The seeds a link may pin, both ends included. */
|
|
19
|
+
export interface SeedRange {
|
|
20
|
+
/** The smallest seed. */
|
|
21
|
+
min: number;
|
|
22
|
+
/** The largest seed. */
|
|
23
|
+
max: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Which call of the generator a shuffle draws from. Both are reproducible; they
|
|
28
|
+
* are two different sequences, so a site keeps the one its links were written
|
|
29
|
+
* with.
|
|
30
|
+
*/
|
|
31
|
+
export type SeedDraw = 'getFloat' | 'getUint32';
|
|
32
|
+
|
|
33
|
+
/** How {@link pickSeeded} draws. */
|
|
34
|
+
export interface PickSeededOptions {
|
|
35
|
+
/**
|
|
36
|
+
* The generator call the shuffle is driven by: `getFloat`, scaled to the
|
|
37
|
+
* remaining positions, or `getUint32`, taken modulo them.
|
|
38
|
+
* @default 'getFloat'
|
|
39
|
+
*/
|
|
40
|
+
draw?: SeedDraw;
|
|
41
|
+
/**
|
|
42
|
+
* Whether a series longer than the pool goes round it again, so it is always
|
|
43
|
+
* exactly as long as asked. Otherwise it stops at the pool.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
wrap?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Pick `count` items out of a pool, the same ones in the same order for the
|
|
51
|
+
* same seed.
|
|
52
|
+
*
|
|
53
|
+
* The pool is shuffled by Fisher–Yates driven by XSadd and the series is the
|
|
54
|
+
* head of that shuffle, so asking for more questions from the same seed keeps
|
|
55
|
+
* the ones already on screen. The pool itself is never reordered.
|
|
56
|
+
* @param pool - Everything a series can draw from.
|
|
57
|
+
* @param count - How many to take; more than the pool holds takes them all,
|
|
58
|
+
* or goes round again with `wrap`.
|
|
59
|
+
* @param seed - An unsigned 32-bit integer.
|
|
60
|
+
* @param options - Which generator call drives the shuffle, and whether the
|
|
61
|
+
* series wraps.
|
|
62
|
+
* @returns The picked items, in drawn order.
|
|
63
|
+
*/
|
|
64
|
+
export function pickSeeded<T>(
|
|
65
|
+
pool: readonly T[],
|
|
66
|
+
count: number,
|
|
67
|
+
seed: number,
|
|
68
|
+
options: PickSeededOptions = {},
|
|
69
|
+
): T[] {
|
|
70
|
+
const { draw = 'getFloat', wrap = false } = options;
|
|
71
|
+
const order = shuffledOrder(pool.length, seed, draw);
|
|
72
|
+
const wanted = Math.max(0, Math.trunc(count));
|
|
73
|
+
const size =
|
|
74
|
+
pool.length === 0 ? 0 : wrap ? wanted : Math.min(wanted, pool.length);
|
|
75
|
+
const picked = new Array<T>(size);
|
|
76
|
+
for (let index = 0; index < size; index++) {
|
|
77
|
+
picked[index] = pool[order[index % order.length] as number] as T;
|
|
78
|
+
}
|
|
79
|
+
return picked;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A seed for a series nobody has asked for yet.
|
|
84
|
+
*
|
|
85
|
+
* `ml-xsadd` unseeded rather than `Math.random`, so the one generator the page
|
|
86
|
+
* draws from is the one every link pins.
|
|
87
|
+
* @param range - The seeds a link may carry, so a drawn one is one of them.
|
|
88
|
+
* @default range { min: 0, max: LARGEST_SEED }
|
|
89
|
+
* @returns A whole number inside the range.
|
|
90
|
+
*/
|
|
91
|
+
export function freshSeed(range?: SeedRange): number {
|
|
92
|
+
const drawn = new XSadd().getUint32();
|
|
93
|
+
if (range === undefined) return drawn;
|
|
94
|
+
const span = range.max - range.min + 1;
|
|
95
|
+
return range.min + (drawn % span);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Read a seed out of an address, strictly: anything that is not a whole number
|
|
100
|
+
* inside the range reads as no seed at all.
|
|
101
|
+
* @param raw - The `seed` parameter, as typed or as a link carries it.
|
|
102
|
+
* @param range - The seeds a link may carry.
|
|
103
|
+
* @default range { min: 0, max: LARGEST_SEED }
|
|
104
|
+
* @returns The seed, or null when the parameter is absent or not one.
|
|
105
|
+
*/
|
|
106
|
+
export function parseSeed(
|
|
107
|
+
raw: string | null | undefined,
|
|
108
|
+
range?: SeedRange,
|
|
109
|
+
): number | null {
|
|
110
|
+
if (raw === null || raw === undefined || !/^\d{1,10}$/u.test(raw)) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
const seed = Number(raw);
|
|
114
|
+
const { min = 0, max = LARGEST_SEED } = range ?? {};
|
|
115
|
+
return seed >= min && seed <= max ? seed : null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** What a link writes to ask for a series per student rather than one per class. */
|
|
119
|
+
export const EACH_SEED = 'each';
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* What `?seed=` can say: a pinned series, a series per student, or no series —
|
|
123
|
+
* `null` rather than a number for the last, because `0` is a seed somebody may
|
|
124
|
+
* pin.
|
|
125
|
+
*/
|
|
126
|
+
export type SeedValue = number | typeof EACH_SEED | null;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The codec of a `?seed=` that also understands `each`.
|
|
130
|
+
*
|
|
131
|
+
* A number is a problem set handed to a whole class; `each` is one link under
|
|
132
|
+
* which no two students work on the same set, the site drawing one seed per
|
|
133
|
+
* browser the first time it opens. A number outside the range is brought back
|
|
134
|
+
* inside it, and anything else reads as no series, so a hand-edited
|
|
135
|
+
* `?seed=today` still opens something.
|
|
136
|
+
* @param range - The seeds a link may pin.
|
|
137
|
+
* @returns The codec.
|
|
138
|
+
*/
|
|
139
|
+
export function seedParam(range: SeedRange): ShareParamCodec<SeedValue> {
|
|
140
|
+
return {
|
|
141
|
+
parse(raw) {
|
|
142
|
+
if (raw === null) return null;
|
|
143
|
+
const text = raw.trim();
|
|
144
|
+
if (text === '') return null;
|
|
145
|
+
if (text.toLowerCase() === EACH_SEED) return EACH_SEED;
|
|
146
|
+
const parsed = Number(text);
|
|
147
|
+
if (Number.isNaN(parsed)) return null;
|
|
148
|
+
return clampSeed(parsed, range);
|
|
149
|
+
},
|
|
150
|
+
serialize(value) {
|
|
151
|
+
if (value === EACH_SEED) return EACH_SEED;
|
|
152
|
+
if (typeof value !== 'number') return null;
|
|
153
|
+
return String(clampSeed(value, range));
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function clampSeed(value: number, range: SeedRange): number {
|
|
159
|
+
if (!Number.isFinite(value)) return range.min;
|
|
160
|
+
return Math.min(range.max, Math.max(range.min, Math.round(value)));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function shuffledOrder(length: number, seed: number, draw: SeedDraw): number[] {
|
|
164
|
+
const generator = new XSadd(seed);
|
|
165
|
+
const order = new Array<number>(length);
|
|
166
|
+
for (let index = 0; index < length; index++) order[index] = index;
|
|
167
|
+
for (let index = length - 1; index > 0; index--) {
|
|
168
|
+
const other =
|
|
169
|
+
draw === 'getUint32'
|
|
170
|
+
? generator.getUint32() % (index + 1)
|
|
171
|
+
: Math.floor(generator.getFloat() * (index + 1));
|
|
172
|
+
const kept = order[index] as number;
|
|
173
|
+
order[index] = order[other] as number;
|
|
174
|
+
order[other] = kept;
|
|
175
|
+
}
|
|
176
|
+
return order;
|
|
177
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A graded series: questions drawn from a tool's pool by a seed, each asking
|
|
3
|
+
* the student to fill a few boxes, each box graded as a test case.
|
|
4
|
+
*
|
|
5
|
+
* Nothing here knows what is asked — electrons, a formula, a mass — so a tool
|
|
6
|
+
* of any subject describes its questions with {@link SeriesTool} and the shared
|
|
7
|
+
* series components draw them.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { ExerciseLevel } from './types.ts';
|
|
11
|
+
import type { TestCaseResult, ValidationResult } from './validation.ts';
|
|
12
|
+
|
|
13
|
+
/** What a student has typed into a question, field by field. */
|
|
14
|
+
export type Answers = Readonly<Record<string, string>>;
|
|
15
|
+
|
|
16
|
+
/** One box a question asks the student to fill. */
|
|
17
|
+
export interface AnswerField {
|
|
18
|
+
/** Key of the value in {@link Answers}. */
|
|
19
|
+
key: string;
|
|
20
|
+
/** What the box is for, e.g. `Electrons` or `³⁵Cl (%)`. */
|
|
21
|
+
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* Placeholder written in the empty box.
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The keyboard a phone opens for the box: digits for a number, letters for
|
|
29
|
+
* a name or a formula.
|
|
30
|
+
* @default 'decimal'
|
|
31
|
+
*/
|
|
32
|
+
inputMode?: 'decimal' | 'text';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The verdict on one field of an answer. */
|
|
36
|
+
export interface FieldCase extends TestCaseResult {
|
|
37
|
+
/** The field the verdict is about, as the box labels it. */
|
|
38
|
+
label: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The verdict on a whole answer. */
|
|
42
|
+
export type AnswerCheck = ValidationResult<FieldCase>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* One tool's exercises: the pool a series is drawn from, what a question asks
|
|
46
|
+
* for, and how an answer is graded, hinted at and solved. Pure: nothing here
|
|
47
|
+
* renders, so every part is unit-tested.
|
|
48
|
+
*/
|
|
49
|
+
export interface SeriesTool<Question> {
|
|
50
|
+
/** Where the tool's progress and seed are kept. */
|
|
51
|
+
id: string;
|
|
52
|
+
/** Every question a series can draw. */
|
|
53
|
+
pool: readonly Question[];
|
|
54
|
+
/** A stable key for a question, unique in the pool. */
|
|
55
|
+
key: (question: Question) => string;
|
|
56
|
+
/**
|
|
57
|
+
* The level a question is tagged with.
|
|
58
|
+
* @default undefined
|
|
59
|
+
*/
|
|
60
|
+
level?: (question: Question) => ExerciseLevel;
|
|
61
|
+
/** The boxes the question asks the student to fill. */
|
|
62
|
+
fields: (question: Question) => AnswerField[];
|
|
63
|
+
/** Grade an answer, one case per field, each reason written as a tutor says it. */
|
|
64
|
+
grade: (question: Question, answers: Answers) => AnswerCheck;
|
|
65
|
+
/** Two to four hints, vague to nearly the answer. */
|
|
66
|
+
hints: (question: Question) => string[];
|
|
67
|
+
/** The worked answer, always revealable. */
|
|
68
|
+
solution: (question: Question) => string;
|
|
69
|
+
/**
|
|
70
|
+
* Draw the series itself, for a tool whose questions are generated from the
|
|
71
|
+
* seed rather than picked out of {@link SeriesTool.pool}. It must return the
|
|
72
|
+
* same questions in the same order for the same seed, since a series is a
|
|
73
|
+
* link.
|
|
74
|
+
* @default undefined — the series is `pickSeeded(pool, count, seed)`
|
|
75
|
+
*/
|
|
76
|
+
draw?: (count: number, seed: number) => readonly Question[];
|
|
77
|
+
/**
|
|
78
|
+
* The longest series the tool can serve, for the picker of its length.
|
|
79
|
+
* @default the size of the pool
|
|
80
|
+
*/
|
|
81
|
+
maxCount?: number;
|
|
82
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FormGroup, InputGroup } from '@blueprintjs/core';
|
|
2
|
+
import type { KeyboardEvent, ReactElement } from 'react';
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
|
|
5
|
+
import type { AnswerField, Answers } from '../core/series.ts';
|
|
6
|
+
|
|
7
|
+
/** What {@link AnswerFields} needs. */
|
|
8
|
+
export interface AnswerFieldsProps {
|
|
9
|
+
/** The boxes the question asks for, in the order they are filled. */
|
|
10
|
+
fields: readonly AnswerField[];
|
|
11
|
+
/** What is typed in them so far. */
|
|
12
|
+
answers: Answers;
|
|
13
|
+
/** Called with the key of a box and its new text on every keystroke. */
|
|
14
|
+
onChange: (key: string, value: string) => void;
|
|
15
|
+
/** Called on Enter, which checks the answer. */
|
|
16
|
+
onSubmit: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The boxes a question asks the student to fill, side by side, each with the
|
|
21
|
+
* keyboard its value wants on a phone and every autocorrection switched off.
|
|
22
|
+
* @param props - The fields, what is typed in them, and what to do on a change.
|
|
23
|
+
* @returns The boxes.
|
|
24
|
+
*/
|
|
25
|
+
export function AnswerFields(props: AnswerFieldsProps): ReactElement {
|
|
26
|
+
const { fields, answers, onChange, onSubmit } = props;
|
|
27
|
+
const prefix = useId();
|
|
28
|
+
|
|
29
|
+
function submitOnEnter(event: KeyboardEvent<HTMLInputElement>): void {
|
|
30
|
+
if (event.key === 'Enter') onSubmit();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div className="series-answers">
|
|
35
|
+
{fields.map((field) => {
|
|
36
|
+
const id = `${prefix}-${field.key}`;
|
|
37
|
+
return (
|
|
38
|
+
<FormGroup
|
|
39
|
+
key={field.key}
|
|
40
|
+
label={field.label}
|
|
41
|
+
labelFor={id}
|
|
42
|
+
className="series-answers__field"
|
|
43
|
+
>
|
|
44
|
+
<InputGroup
|
|
45
|
+
id={id}
|
|
46
|
+
value={answers[field.key] ?? ''}
|
|
47
|
+
placeholder={field.placeholder}
|
|
48
|
+
onValueChange={(value) => {
|
|
49
|
+
onChange(field.key, value);
|
|
50
|
+
}}
|
|
51
|
+
onKeyDown={submitOnEnter}
|
|
52
|
+
inputMode={field.inputMode ?? 'decimal'}
|
|
53
|
+
autoComplete="off"
|
|
54
|
+
autoCorrect="off"
|
|
55
|
+
autoCapitalize="off"
|
|
56
|
+
spellCheck={false}
|
|
57
|
+
/>
|
|
58
|
+
</FormGroup>
|
|
59
|
+
);
|
|
60
|
+
})}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Tag } from '@blueprintjs/core';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { useDocumentListNavigation } from '../../hooks/ui/useDocumentListNavigation.ts';
|
|
5
|
+
import type { ChromeKey } from '../../i18n/core/chromeCatalog.ts';
|
|
6
|
+
import { useChromeT } from '../../i18n/ui/useT.ts';
|
|
7
|
+
import { joinClassNames } from '../../shared/ui/joinClassNames.ts';
|
|
8
|
+
import type { ProgressRecords } from '../core/progress.ts';
|
|
9
|
+
import { progressSummary } from '../core/progress.ts';
|
|
10
|
+
import type { ExerciseLevel, ExerciseStatus } from '../core/types.ts';
|
|
11
|
+
|
|
12
|
+
import { ExerciseProgressHeader } from './ExerciseProgressHeader.tsx';
|
|
13
|
+
import { ExerciseLevelTag, ExerciseStatusIcon } from './ExerciseTags.tsx';
|
|
14
|
+
import { InlineText } from './InlineText.tsx';
|
|
15
|
+
|
|
16
|
+
/** What a row of the list reads off an exercise. */
|
|
17
|
+
export interface ExerciseListEntry {
|
|
18
|
+
/** Stable id, which is what is selected. */
|
|
19
|
+
id: string;
|
|
20
|
+
/** How the exercise is named; may carry the shared prose marks. */
|
|
21
|
+
title: string;
|
|
22
|
+
/**
|
|
23
|
+
* How hard it is, drawn as a coloured tag.
|
|
24
|
+
* @default undefined — no level tag
|
|
25
|
+
*/
|
|
26
|
+
level?: ExerciseLevel;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** What the list reads of the progress kept on one exercise. */
|
|
30
|
+
export interface ExerciseListProgress {
|
|
31
|
+
/** Where the student stands. */
|
|
32
|
+
status: ExerciseStatus;
|
|
33
|
+
/** How many hints were opened. */
|
|
34
|
+
hintsRevealed: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** What {@link ExerciseList} needs. */
|
|
38
|
+
export interface ExerciseListProps<TExercise extends ExerciseListEntry> {
|
|
39
|
+
/** The exercises, in the order they are worked through. */
|
|
40
|
+
exercises: readonly TExercise[];
|
|
41
|
+
/** The progress kept, by exercise id; an absent one reads as untouched. */
|
|
42
|
+
progress: ProgressRecords<ExerciseListProgress>;
|
|
43
|
+
/** The exercise on screen, or `null` for none. */
|
|
44
|
+
activeId: string | null;
|
|
45
|
+
/** Called with the id of the exercise to open. */
|
|
46
|
+
onSelect: (id: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Tags of the tool's own after the level — the kind of question, say.
|
|
49
|
+
* @default undefined
|
|
50
|
+
*/
|
|
51
|
+
tags?: (exercise: TExercise) => ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Draws the title the tool's own way.
|
|
54
|
+
* @default the title as inline prose, its marks drawn
|
|
55
|
+
*/
|
|
56
|
+
renderTitle?: (exercise: TExercise) => ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the bar of solved exercises heads the list.
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
progressHeader?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Throws away every answer, behind a dialog. Without it the header only
|
|
64
|
+
* reports.
|
|
65
|
+
* @default undefined
|
|
66
|
+
*/
|
|
67
|
+
onClearAll?: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* What the dialog says before the work is thrown away.
|
|
70
|
+
* @default the header's own sentence
|
|
71
|
+
*/
|
|
72
|
+
clearWarning?: ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* What a screen reader calls the list.
|
|
75
|
+
* @default the chrome's own word for it, in the language of the page
|
|
76
|
+
*/
|
|
77
|
+
label?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Class the list carries, in addition to `exercise-list`.
|
|
80
|
+
* @default undefined
|
|
81
|
+
*/
|
|
82
|
+
className?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const STATUS_TITLE: Record<ExerciseStatus, ChromeKey> = {
|
|
86
|
+
idle: 'pedagogy.statusIdle',
|
|
87
|
+
attempted: 'pedagogy.statusAttempted',
|
|
88
|
+
solved: 'pedagogy.statusSolved',
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The exercises of a set, each with where the student stands on it, under the
|
|
93
|
+
* bar of how many are solved.
|
|
94
|
+
*
|
|
95
|
+
* The hint count of a solved exercise is shown rather than hidden: it is the
|
|
96
|
+
* honest record of which ones were hard, which is what a student coming back a
|
|
97
|
+
* week later wants to know. `ArrowUp` and `ArrowDown` walk the list from
|
|
98
|
+
* anywhere on the page, unless a text field has the focus.
|
|
99
|
+
* @param props - The exercises, their progress, and the open one.
|
|
100
|
+
* @returns The list.
|
|
101
|
+
*/
|
|
102
|
+
export function ExerciseList<TExercise extends ExerciseListEntry>(
|
|
103
|
+
props: ExerciseListProps<TExercise>,
|
|
104
|
+
): ReactElement {
|
|
105
|
+
const {
|
|
106
|
+
exercises,
|
|
107
|
+
progress,
|
|
108
|
+
activeId,
|
|
109
|
+
onSelect,
|
|
110
|
+
tags,
|
|
111
|
+
renderTitle,
|
|
112
|
+
progressHeader = true,
|
|
113
|
+
onClearAll,
|
|
114
|
+
clearWarning,
|
|
115
|
+
label,
|
|
116
|
+
className,
|
|
117
|
+
} = props;
|
|
118
|
+
const t = useChromeT();
|
|
119
|
+
const activeIndex = exercises.findIndex(
|
|
120
|
+
(exercise) => exercise.id === activeId,
|
|
121
|
+
);
|
|
122
|
+
const listRef = useDocumentListNavigation<HTMLDivElement>({
|
|
123
|
+
length: exercises.length,
|
|
124
|
+
selectedIndex: activeIndex,
|
|
125
|
+
onSelect: (index) => {
|
|
126
|
+
const next = exercises[index];
|
|
127
|
+
if (next !== undefined) onSelect(next.id);
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<div className={joinClassNames('exercise-list', className)}>
|
|
133
|
+
{progressHeader ? (
|
|
134
|
+
<ExerciseProgressHeader
|
|
135
|
+
summary={progressSummary(
|
|
136
|
+
progress,
|
|
137
|
+
exercises.map((exercise) => exercise.id),
|
|
138
|
+
)}
|
|
139
|
+
onClearAll={onClearAll}
|
|
140
|
+
clearWarning={clearWarning}
|
|
141
|
+
clearDisabled={Object.keys(progress).length === 0}
|
|
142
|
+
/>
|
|
143
|
+
) : null}
|
|
144
|
+
<div
|
|
145
|
+
ref={listRef}
|
|
146
|
+
className="exercise-list__rows"
|
|
147
|
+
role="listbox"
|
|
148
|
+
aria-label={label ?? t('pedagogy.exercises')}
|
|
149
|
+
data-testid="exercise-list"
|
|
150
|
+
>
|
|
151
|
+
{exercises.map((exercise) => {
|
|
152
|
+
const record = progress[exercise.id];
|
|
153
|
+
const status = record?.status ?? 'idle';
|
|
154
|
+
const hints = record?.hintsRevealed ?? 0;
|
|
155
|
+
const active = exercise.id === activeId;
|
|
156
|
+
return (
|
|
157
|
+
<button
|
|
158
|
+
key={exercise.id}
|
|
159
|
+
type="button"
|
|
160
|
+
role="option"
|
|
161
|
+
aria-selected={active}
|
|
162
|
+
data-selected={active ? 'true' : undefined}
|
|
163
|
+
className={
|
|
164
|
+
active
|
|
165
|
+
? 'exercise-list__item exercise-list__item--active'
|
|
166
|
+
: 'exercise-list__item'
|
|
167
|
+
}
|
|
168
|
+
onClick={() => {
|
|
169
|
+
onSelect(exercise.id);
|
|
170
|
+
}}
|
|
171
|
+
>
|
|
172
|
+
<ExerciseStatusIcon
|
|
173
|
+
status={status}
|
|
174
|
+
title={t(STATUS_TITLE[status])}
|
|
175
|
+
/>
|
|
176
|
+
<span className="exercise-list__title">
|
|
177
|
+
{renderTitle === undefined ? (
|
|
178
|
+
<InlineText text={exercise.title} />
|
|
179
|
+
) : (
|
|
180
|
+
renderTitle(exercise)
|
|
181
|
+
)}
|
|
182
|
+
</span>
|
|
183
|
+
<span className="exercise-list__tags">
|
|
184
|
+
{exercise.level === undefined ? null : (
|
|
185
|
+
<ExerciseLevelTag level={exercise.level} active={active} />
|
|
186
|
+
)}
|
|
187
|
+
{tags?.(exercise)}
|
|
188
|
+
{status === 'solved' && hints > 0 ? (
|
|
189
|
+
<Tag minimal round intent="success">
|
|
190
|
+
{hints === 1
|
|
191
|
+
? t('pedagogy.solvedWithOneHint')
|
|
192
|
+
: t('pedagogy.solvedWithHints', { count: hints })}
|
|
193
|
+
</Tag>
|
|
194
|
+
) : null}
|
|
195
|
+
</span>
|
|
196
|
+
</button>
|
|
197
|
+
);
|
|
198
|
+
})}
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
);
|
|
202
|
+
}
|