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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/moleculesClient/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EACV,eAAe,EACf,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/moleculesClient/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MoleculesClient, MoleculesClientOptions } from './moleculesClientApi.ts';
|
|
2
|
+
/**
|
|
3
|
+
* A client of the routes a source writes through on molecules.cheminfo.org,
|
|
4
|
+
* retrying while the server is busy (503), throttling (429), being restarted
|
|
5
|
+
* (502, 504) or out of reach. Each attempt has its own deadline, the pauses
|
|
6
|
+
* double with a spread and honour `Retry-After`, and bodies travel gzipped.
|
|
7
|
+
* Browser-safe: it reads no Node module.
|
|
8
|
+
* @param options - Where it answers, the token, and how hard to insist.
|
|
9
|
+
* @returns The client.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createMoleculesClient(options: MoleculesClientOptions): MoleculesClient;
|
|
12
|
+
//# sourceMappingURL=moleculesClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moleculesClient.d.ts","sourceRoot":"","sources":["../../../src/moleculesClient/core/moleculesClient.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AA0CjC;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,sBAAsB,GAC9B,eAAe,CAkHjB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { XSadd } from 'ml-xsadd';
|
|
2
|
+
import { trimTrailingSlash } from "../../router/core/address.js";
|
|
3
|
+
import { MoleculesError } from "./moleculesClientApi.js";
|
|
4
|
+
import { causeOf, gzipBody, messageOf, pause, requestSignal, retryAfter, } from "./requestRetry.js";
|
|
5
|
+
/** Statuses a request is tried again on: the server is busy or in between. */
|
|
6
|
+
const RETRIED_STATUSES = new Set([429, 502, 503, 504]);
|
|
7
|
+
/** The doublings of the pause, after which it stays where it is. */
|
|
8
|
+
const MAX_DOUBLINGS = 20;
|
|
9
|
+
/**
|
|
10
|
+
* A client of the routes a source writes through on molecules.cheminfo.org,
|
|
11
|
+
* retrying while the server is busy (503), throttling (429), being restarted
|
|
12
|
+
* (502, 504) or out of reach. Each attempt has its own deadline, the pauses
|
|
13
|
+
* double with a spread and honour `Retry-After`, and bodies travel gzipped.
|
|
14
|
+
* Browser-safe: it reads no Node module.
|
|
15
|
+
* @param options - Where it answers, the token, and how hard to insist.
|
|
16
|
+
* @returns The client.
|
|
17
|
+
*/
|
|
18
|
+
export function createMoleculesClient(options) {
|
|
19
|
+
const { token, maxRetryMs = 1_800_000, initialDelayMs = 1000, maxDelayMs = 60_000, requestTimeoutMs = 600_000, signal, onRetry, fetch: fetchImplementation = globalThis.fetch, random = new XSadd().random, } = options;
|
|
20
|
+
const baseUrl = trimTrailingSlash(options.baseUrl);
|
|
21
|
+
async function attemptOnce(call) {
|
|
22
|
+
let response;
|
|
23
|
+
try {
|
|
24
|
+
response = await fetchImplementation(`${baseUrl}${call.path}`, {
|
|
25
|
+
method: call.method,
|
|
26
|
+
headers: {
|
|
27
|
+
authorization: `Bearer ${token}`,
|
|
28
|
+
...(call.payload === undefined
|
|
29
|
+
? {}
|
|
30
|
+
: {
|
|
31
|
+
'content-type': 'application/json',
|
|
32
|
+
'content-encoding': 'gzip',
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
body: call.payload,
|
|
36
|
+
signal: requestSignal(signal, requestTimeoutMs),
|
|
37
|
+
});
|
|
38
|
+
if (response.ok) {
|
|
39
|
+
return { answered: true, value: (await response.json()) };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (signal?.aborted)
|
|
44
|
+
throw signal.reason;
|
|
45
|
+
return {
|
|
46
|
+
answered: false,
|
|
47
|
+
status: undefined,
|
|
48
|
+
reason: causeOf(error),
|
|
49
|
+
retryAfterMs: undefined,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const text = await response.text();
|
|
53
|
+
const reason = messageOf(text) ?? response.statusText;
|
|
54
|
+
if (!RETRIED_STATUSES.has(response.status)) {
|
|
55
|
+
throw new MoleculesError(`${call.method} ${call.path} answered ${response.status}: ${reason}`, response.status, text);
|
|
56
|
+
}
|
|
57
|
+
const asked = retryAfter(response.headers.get('retry-after'), Date.now());
|
|
58
|
+
return {
|
|
59
|
+
answered: false,
|
|
60
|
+
status: response.status,
|
|
61
|
+
reason,
|
|
62
|
+
retryAfterMs: asked,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async function attempt(call, number) {
|
|
66
|
+
signal?.throwIfAborted();
|
|
67
|
+
const outcome = await attemptOnce(call);
|
|
68
|
+
if (outcome.answered)
|
|
69
|
+
return outcome.value;
|
|
70
|
+
const backoff = initialDelayMs *
|
|
71
|
+
2 ** Math.min(number - 1, MAX_DOUBLINGS) *
|
|
72
|
+
(0.5 + random() * 0.5);
|
|
73
|
+
const delayMs = Math.min(maxDelayMs, outcome.retryAfterMs ?? backoff);
|
|
74
|
+
const elapsed = Date.now() - call.started;
|
|
75
|
+
if (elapsed + delayMs > maxRetryMs) {
|
|
76
|
+
throw new MoleculesError(`${call.method} ${call.path} kept failing for ${Math.round(elapsed / 1000)} s: ${outcome.reason}`, outcome.status ?? 0, outcome.reason);
|
|
77
|
+
}
|
|
78
|
+
onRetry?.({
|
|
79
|
+
method: call.method,
|
|
80
|
+
path: call.path,
|
|
81
|
+
attempt: number,
|
|
82
|
+
status: outcome.status,
|
|
83
|
+
reason: outcome.reason,
|
|
84
|
+
delayMs,
|
|
85
|
+
});
|
|
86
|
+
await pause(delayMs, signal);
|
|
87
|
+
return attempt(call, number + 1);
|
|
88
|
+
}
|
|
89
|
+
async function request(method, path, body) {
|
|
90
|
+
const started = Date.now();
|
|
91
|
+
const payload = body === undefined ? undefined : await gzipBody(JSON.stringify(body));
|
|
92
|
+
return attempt({ method, path, payload, started }, 1);
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
startImport: () => request('POST', '/v1/imports'),
|
|
96
|
+
importState: () => request('GET', '/v1/imports'),
|
|
97
|
+
submit: (molecules, { returnInfo = false } = {}) => request('POST', '/v1/submit', { molecules, returnInfo }),
|
|
98
|
+
lookup: (queries, kind) => request('POST', '/v1/batch', { queries, kind }),
|
|
99
|
+
purge: (importKey, { dryRun = false, force = false } = {}) => request('POST', `/v1/imports/${importKey}/purge`, {
|
|
100
|
+
dryRun,
|
|
101
|
+
force,
|
|
102
|
+
}),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=moleculesClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moleculesClient.js","sourceRoot":"","sources":["../../../src/moleculesClient/core/moleculesClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAMjE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAQzD,OAAO,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC;AAE3B,8EAA8E;AAC9E,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEvD,oEAAoE;AACpE,MAAM,aAAa,GAAG,EAAE,CAAC;AAoBzB;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAA+B;IAE/B,MAAM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aAAa,CAAC;QAC7D,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,UAAU,GAAG,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CACjD,OAAO,CAAiB,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;QAC1E,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CACxB,OAAO,CAAiB,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACjE,KAAK,EAAE,CAAC,SAAS,EAAE,EAAE,MAAM,GAAG,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAC3D,OAAO,CAAgB,MAAM,EAAE,eAAe,SAAS,QAAQ,EAAE;YAC/D,MAAM;YACN,KAAK;SACN,CAAC;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { ImportStarted, ImportState, LookupResponse, MoleculeInput, PurgeResponse, RetryDetails, SubmitResponse } from './moleculesTypes.ts';
|
|
2
|
+
/** How a client reaches molecules.cheminfo.org, and how hard it insists. */
|
|
3
|
+
export interface MoleculesClientOptions {
|
|
4
|
+
/** Where molecules.cheminfo.org answers, e.g. `https://molecules.cheminfo.org`. */
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
/** The token issued for the source the client writes for. */
|
|
7
|
+
token: string;
|
|
8
|
+
/**
|
|
9
|
+
* How long one request may keep being retried while the server is busy or
|
|
10
|
+
* unreachable, in milliseconds.
|
|
11
|
+
* @default 1_800_000 - half an hour
|
|
12
|
+
*/
|
|
13
|
+
maxRetryMs?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The first pause before a retry; each next one doubles, up to `maxDelayMs`.
|
|
16
|
+
* @default 1000
|
|
17
|
+
*/
|
|
18
|
+
initialDelayMs?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The longest pause between two attempts, a `Retry-After` included.
|
|
21
|
+
* @default 60_000
|
|
22
|
+
*/
|
|
23
|
+
maxDelayMs?: number;
|
|
24
|
+
/**
|
|
25
|
+
* How long one attempt may take before it is given up and retried.
|
|
26
|
+
* @default 600_000
|
|
27
|
+
*/
|
|
28
|
+
requestTimeoutMs?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Stops every request, and every pause between two attempts.
|
|
31
|
+
* @default undefined - nothing stops them
|
|
32
|
+
*/
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
/**
|
|
35
|
+
* Told about every retry, e.g. to log it.
|
|
36
|
+
* @default undefined - retries are silent
|
|
37
|
+
*/
|
|
38
|
+
onRetry?: (details: RetryDetails) => void;
|
|
39
|
+
/**
|
|
40
|
+
* The fetch to use, for tests.
|
|
41
|
+
* @default globalThis.fetch
|
|
42
|
+
*/
|
|
43
|
+
fetch?: typeof fetch;
|
|
44
|
+
/**
|
|
45
|
+
* A number from 0 to 1 that spreads the pauses, so clients that failed
|
|
46
|
+
* together do not all come back at the same instant.
|
|
47
|
+
* @default an unseeded `XSadd`
|
|
48
|
+
*/
|
|
49
|
+
random?: () => number;
|
|
50
|
+
}
|
|
51
|
+
/** The routes a source writes through on molecules.cheminfo.org. */
|
|
52
|
+
export interface MoleculesClient {
|
|
53
|
+
/** Take the source's next import key: the start of a full import. */
|
|
54
|
+
startImport: () => Promise<ImportStarted>;
|
|
55
|
+
/** Where the source's import stands. */
|
|
56
|
+
importState: () => Promise<ImportState>;
|
|
57
|
+
/**
|
|
58
|
+
* Send up to 1000 molecules for the source, under its current import key.
|
|
59
|
+
* @param molecules - Each with its identifier and exactly one notation.
|
|
60
|
+
* @param options - Whether every answer carries the molecule's properties.
|
|
61
|
+
* @param options.returnInfo - Ask for them; `false` by default.
|
|
62
|
+
*/
|
|
63
|
+
submit: (molecules: MoleculeInput[], options?: {
|
|
64
|
+
returnInfo?: boolean;
|
|
65
|
+
}) => Promise<SubmitResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Compute up to 1000 molecules without storing anything, for a source
|
|
68
|
+
* molecules.cheminfo.org imports itself.
|
|
69
|
+
* @param queries - The structures, all in one notation.
|
|
70
|
+
* @param kind - The notation.
|
|
71
|
+
*/
|
|
72
|
+
lookup: (queries: string[], kind: 'smiles' | 'molfile' | 'idCode') => Promise<LookupResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Remove the entries an import did not send again.
|
|
75
|
+
* @param importKey - The key the import took.
|
|
76
|
+
* @param options - Only count, or remove even more than half.
|
|
77
|
+
* @param options.dryRun - Only count; `false` by default.
|
|
78
|
+
* @param options.force - Remove even when that is more than half; `false` by
|
|
79
|
+
* default.
|
|
80
|
+
*/
|
|
81
|
+
purge: (importKey: number, options?: {
|
|
82
|
+
dryRun?: boolean;
|
|
83
|
+
force?: boolean;
|
|
84
|
+
}) => Promise<PurgeResponse>;
|
|
85
|
+
}
|
|
86
|
+
/** A request molecules.cheminfo.org refused, or that kept failing. */
|
|
87
|
+
export declare class MoleculesError extends Error {
|
|
88
|
+
/** The status answered, or 0 when nothing was. */
|
|
89
|
+
readonly status: number;
|
|
90
|
+
/** What the server said, as text. */
|
|
91
|
+
readonly body: string;
|
|
92
|
+
/**
|
|
93
|
+
* A failed request, with what the server answered.
|
|
94
|
+
* @param message - What failed, and why.
|
|
95
|
+
* @param status - The status answered, or 0 when nothing was.
|
|
96
|
+
* @param body - What the server said.
|
|
97
|
+
*/
|
|
98
|
+
constructor(message: string, status: number, body: string);
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=moleculesClientApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moleculesClientApi.d.ts","sourceRoot":"","sources":["../../../src/moleculesClient/core/moleculesClientApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,4EAA4E;AAC5E,MAAM,WAAW,sBAA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AAC;CAC7B;AAED,sEAAsE;AACtE,qBAAa,cAAe,SAAQ,KAAK;IACvC,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;gBACS,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAM1D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** A request molecules.cheminfo.org refused, or that kept failing. */
|
|
2
|
+
export class MoleculesError extends Error {
|
|
3
|
+
/** The status answered, or 0 when nothing was. */
|
|
4
|
+
status;
|
|
5
|
+
/** What the server said, as text. */
|
|
6
|
+
body;
|
|
7
|
+
/**
|
|
8
|
+
* A failed request, with what the server answered.
|
|
9
|
+
* @param message - What failed, and why.
|
|
10
|
+
* @param status - The status answered, or 0 when nothing was.
|
|
11
|
+
* @param body - What the server said.
|
|
12
|
+
*/
|
|
13
|
+
constructor(message, status, body) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = 'MoleculesError';
|
|
16
|
+
this.status = status;
|
|
17
|
+
this.body = body;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=moleculesClientApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moleculesClientApi.js","sourceRoot":"","sources":["../../../src/moleculesClient/core/moleculesClientApi.ts"],"names":[],"mappings":"AAoGA,sEAAsE;AACtE,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,kDAAkD;IACzC,MAAM,CAAS;IACxB,qCAAqC;IAC5B,IAAI,CAAS;IAEtB;;;;;OAKG;IACH,YAAY,OAAe,EAAE,MAAc,EAAE,IAAY;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/** One molecule a source sends: its identifier, and exactly one notation. */
|
|
2
|
+
export interface MoleculeInput {
|
|
3
|
+
/** The source's identifier for it, which its address is written with. */
|
|
4
|
+
id: string;
|
|
5
|
+
/**
|
|
6
|
+
* The structure as SMILES.
|
|
7
|
+
* @default undefined - another notation is given
|
|
8
|
+
*/
|
|
9
|
+
smiles?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The structure as a molfile.
|
|
12
|
+
* @default undefined - another notation is given
|
|
13
|
+
*/
|
|
14
|
+
molfile?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The structure as an OpenChemLib idCode.
|
|
17
|
+
* @default undefined - another notation is given
|
|
18
|
+
*/
|
|
19
|
+
idCode?: string;
|
|
20
|
+
}
|
|
21
|
+
/** What molecules.cheminfo.org computed for a structure. */
|
|
22
|
+
export interface MoleculeInfo {
|
|
23
|
+
mf: string;
|
|
24
|
+
mw: number;
|
|
25
|
+
em: number;
|
|
26
|
+
charge: number;
|
|
27
|
+
idCode: string;
|
|
28
|
+
noStereoID: string;
|
|
29
|
+
noStereoTautomerID: string;
|
|
30
|
+
failedTautomerID: number;
|
|
31
|
+
/** The 512-bit FragFp, sixteen signed 32-bit words. */
|
|
32
|
+
ssIndex: number[];
|
|
33
|
+
logS: number;
|
|
34
|
+
logP: number;
|
|
35
|
+
acceptorCount: number;
|
|
36
|
+
donorCount: number;
|
|
37
|
+
stereoCenterCount: number;
|
|
38
|
+
rotatableBondCount: number;
|
|
39
|
+
polarSurfaceArea: number;
|
|
40
|
+
nbFragments: number;
|
|
41
|
+
/**
|
|
42
|
+
* The degree of unsaturation, when the formula has one.
|
|
43
|
+
* @default undefined
|
|
44
|
+
*/
|
|
45
|
+
unsaturation?: number;
|
|
46
|
+
atoms: Record<string, number>;
|
|
47
|
+
/** The hashes, as 16 hex digits: never JSON numbers, which would round them. */
|
|
48
|
+
idCodeHash: string;
|
|
49
|
+
noStereoHash: string;
|
|
50
|
+
noStereoTautomerHash: string;
|
|
51
|
+
createdAt: number | null;
|
|
52
|
+
}
|
|
53
|
+
/** What became of one molecule a source sent. */
|
|
54
|
+
export interface SubmitResult {
|
|
55
|
+
id: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The structure it was read as.
|
|
58
|
+
* @default undefined - it could not be read
|
|
59
|
+
*/
|
|
60
|
+
idCode?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Whether molecules.cheminfo.org held the structure already.
|
|
63
|
+
* @default undefined - it could not be read
|
|
64
|
+
*/
|
|
65
|
+
molecule?: 'created' | 'existing';
|
|
66
|
+
/**
|
|
67
|
+
* What became of the source's entry.
|
|
68
|
+
* @default undefined - it could not be read
|
|
69
|
+
*/
|
|
70
|
+
link?: 'added' | 'unchanged' | 'moved';
|
|
71
|
+
/**
|
|
72
|
+
* The computed properties, when they were asked for.
|
|
73
|
+
* @default undefined
|
|
74
|
+
*/
|
|
75
|
+
info?: MoleculeInfo;
|
|
76
|
+
/**
|
|
77
|
+
* Why the molecule was refused.
|
|
78
|
+
* @default undefined - it was taken
|
|
79
|
+
*/
|
|
80
|
+
error?: string;
|
|
81
|
+
}
|
|
82
|
+
/** How a batch was taken. */
|
|
83
|
+
export interface SubmitSummary {
|
|
84
|
+
total: number;
|
|
85
|
+
/** Molecules new to molecules.cheminfo.org. */
|
|
86
|
+
created: number;
|
|
87
|
+
/** Entries new to the source. */
|
|
88
|
+
added: number;
|
|
89
|
+
/** Identifiers moved to another structure. */
|
|
90
|
+
moved: number;
|
|
91
|
+
unchanged: number;
|
|
92
|
+
failed: number;
|
|
93
|
+
}
|
|
94
|
+
/** What `POST /v1/submit` answers: one result per molecule, in their order. */
|
|
95
|
+
export interface SubmitResponse {
|
|
96
|
+
source: string;
|
|
97
|
+
results: SubmitResult[];
|
|
98
|
+
summary: SubmitSummary;
|
|
99
|
+
}
|
|
100
|
+
/** What `POST /v1/imports` answers: the start of a full import. */
|
|
101
|
+
export interface ImportStarted {
|
|
102
|
+
source: string;
|
|
103
|
+
importKey: number;
|
|
104
|
+
importStartedAt: number;
|
|
105
|
+
}
|
|
106
|
+
/** What `GET /v1/imports` answers: where the source's import stands. */
|
|
107
|
+
export interface ImportState {
|
|
108
|
+
source: string;
|
|
109
|
+
importKey: number;
|
|
110
|
+
importStartedAt: number | null;
|
|
111
|
+
updatedAt: number | null;
|
|
112
|
+
entries: number;
|
|
113
|
+
stale: number;
|
|
114
|
+
}
|
|
115
|
+
/** What a purge answers. */
|
|
116
|
+
export interface PurgeResponse {
|
|
117
|
+
source: string;
|
|
118
|
+
importKey: number;
|
|
119
|
+
dryRun: boolean;
|
|
120
|
+
/** The entries the import did not send again, removed or to be removed. */
|
|
121
|
+
removed: number;
|
|
122
|
+
/** The entries the source holds after. */
|
|
123
|
+
remaining: number;
|
|
124
|
+
}
|
|
125
|
+
/** One answer of `POST /v1/batch`: the molecule a query reads as, or why not. */
|
|
126
|
+
export interface LookupResult {
|
|
127
|
+
query: string;
|
|
128
|
+
result: MoleculeInfo | null;
|
|
129
|
+
/** Whether molecules.cheminfo.org lists it, rather than computing it now. */
|
|
130
|
+
cached: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Why the query could not be read.
|
|
133
|
+
* @default undefined - it was read
|
|
134
|
+
*/
|
|
135
|
+
error?: string;
|
|
136
|
+
}
|
|
137
|
+
/** What `POST /v1/batch` answers: one result per query, in their order. */
|
|
138
|
+
export interface LookupResponse {
|
|
139
|
+
results: LookupResult[];
|
|
140
|
+
}
|
|
141
|
+
/** Why a request is tried again, and when. */
|
|
142
|
+
export interface RetryDetails {
|
|
143
|
+
method: string;
|
|
144
|
+
path: string;
|
|
145
|
+
attempt: number;
|
|
146
|
+
/**
|
|
147
|
+
* The status that was answered.
|
|
148
|
+
* @default undefined - nothing was answered
|
|
149
|
+
*/
|
|
150
|
+
status?: number;
|
|
151
|
+
reason: string;
|
|
152
|
+
delayMs: number;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=moleculesTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moleculesTypes.d.ts","sourceRoot":"","sources":["../../../src/moleculesClient/core/moleculesTypes.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,4DAA4D;AAC5D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAA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,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,6EAA6E;IAC7E,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,8CAA8C;AAC9C,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moleculesTypes.js","sourceRoot":"","sources":["../../../src/moleculesClient/core/moleculesTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pieces of a request that is tried again: its deadline, the pause the
|
|
3
|
+
* server asks for, what an error answer says, and what a failed fetch says.
|
|
4
|
+
* Browser-safe: no Node module is read.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The signal one attempt runs under: the caller's, and its own deadline.
|
|
8
|
+
* @param signal - The caller's, if any.
|
|
9
|
+
* @param timeoutMs - How long the attempt may take.
|
|
10
|
+
* @returns The signal.
|
|
11
|
+
*/
|
|
12
|
+
export declare function requestSignal(signal: AbortSignal | undefined, timeoutMs: number): AbortSignal;
|
|
13
|
+
/**
|
|
14
|
+
* How long a `Retry-After` header asks to wait.
|
|
15
|
+
* @param header - Its value: seconds, or an HTTP date.
|
|
16
|
+
* @param now - The current instant, in epoch milliseconds.
|
|
17
|
+
* @returns The pause in milliseconds, or `undefined` when there is none to read.
|
|
18
|
+
*/
|
|
19
|
+
export declare function retryAfter(header: string | null, now: number): number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The message of an error body Fastify wrote, or the body itself.
|
|
22
|
+
* @param text - The body.
|
|
23
|
+
* @returns The message, or `undefined` when the body is empty.
|
|
24
|
+
*/
|
|
25
|
+
export declare function messageOf(text: string): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* What a failed fetch says, its cause included: undici reports a refused
|
|
28
|
+
* connection as `fetch failed` with the reason in `cause` — and when several
|
|
29
|
+
* addresses were tried, in the first error of an AggregateError whose own
|
|
30
|
+
* message is empty.
|
|
31
|
+
* @param error - What was thrown.
|
|
32
|
+
* @returns The message, e.g. `fetch failed: connect ECONNREFUSED 127.0.0.1:11980`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function causeOf(error: unknown): string;
|
|
35
|
+
/**
|
|
36
|
+
* A request body gzipped, as HTTP's `Content-Encoding: gzip` carries it: a
|
|
37
|
+
* batch of molfiles shrinks several times over.
|
|
38
|
+
* @param text - The body, written out.
|
|
39
|
+
* @returns The gzipped bytes.
|
|
40
|
+
*/
|
|
41
|
+
export declare function gzipBody(text: string): Promise<Uint8Array<ArrayBuffer>>;
|
|
42
|
+
/**
|
|
43
|
+
* Wait, unless the signal stops the wait first.
|
|
44
|
+
* @param milliseconds - How long.
|
|
45
|
+
* @param signal - What stops it, if anything.
|
|
46
|
+
* @returns When the time has passed.
|
|
47
|
+
* @throws {unknown} The signal's reason, when it aborts first.
|
|
48
|
+
*/
|
|
49
|
+
export declare function pause(milliseconds: number, signal: AbortSignal | undefined): Promise<void>;
|
|
50
|
+
//# sourceMappingURL=requestRetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestRetry.d.ts","sourceRoot":"","sources":["../../../src/moleculesClient/core/requestRetry.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,SAAS,EAAE,MAAM,GAChB,WAAW,CAGb;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,SAAS,CAMpB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS1D;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAa9C;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAK7E;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,WAAW,GAAG,SAAS,GAC9B,OAAO,CAAC,IAAI,CAAC,CAgBf"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { toError } from "../../error/core/toError.js";
|
|
2
|
+
/**
|
|
3
|
+
* The pieces of a request that is tried again: its deadline, the pause the
|
|
4
|
+
* server asks for, what an error answer says, and what a failed fetch says.
|
|
5
|
+
* Browser-safe: no Node module is read.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The signal one attempt runs under: the caller's, and its own deadline.
|
|
9
|
+
* @param signal - The caller's, if any.
|
|
10
|
+
* @param timeoutMs - How long the attempt may take.
|
|
11
|
+
* @returns The signal.
|
|
12
|
+
*/
|
|
13
|
+
export function requestSignal(signal, timeoutMs) {
|
|
14
|
+
const timeout = AbortSignal.timeout(timeoutMs);
|
|
15
|
+
return signal === undefined ? timeout : AbortSignal.any([signal, timeout]);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* How long a `Retry-After` header asks to wait.
|
|
19
|
+
* @param header - Its value: seconds, or an HTTP date.
|
|
20
|
+
* @param now - The current instant, in epoch milliseconds.
|
|
21
|
+
* @returns The pause in milliseconds, or `undefined` when there is none to read.
|
|
22
|
+
*/
|
|
23
|
+
export function retryAfter(header, now) {
|
|
24
|
+
if (header === null || header.trim() === '')
|
|
25
|
+
return undefined;
|
|
26
|
+
const seconds = Number(header);
|
|
27
|
+
if (Number.isFinite(seconds))
|
|
28
|
+
return Math.max(0, seconds * 1000);
|
|
29
|
+
const date = Date.parse(header);
|
|
30
|
+
return Number.isNaN(date) ? undefined : Math.max(0, date - now);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The message of an error body Fastify wrote, or the body itself.
|
|
34
|
+
* @param text - The body.
|
|
35
|
+
* @returns The message, or `undefined` when the body is empty.
|
|
36
|
+
*/
|
|
37
|
+
export function messageOf(text) {
|
|
38
|
+
if (text.trim() === '')
|
|
39
|
+
return undefined;
|
|
40
|
+
try {
|
|
41
|
+
const body = JSON.parse(text);
|
|
42
|
+
if (typeof body?.message === 'string')
|
|
43
|
+
return body.message;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return text.slice(0, 500);
|
|
47
|
+
}
|
|
48
|
+
return text.slice(0, 500);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* What a failed fetch says, its cause included: undici reports a refused
|
|
52
|
+
* connection as `fetch failed` with the reason in `cause` — and when several
|
|
53
|
+
* addresses were tried, in the first error of an AggregateError whose own
|
|
54
|
+
* message is empty.
|
|
55
|
+
* @param error - What was thrown.
|
|
56
|
+
* @returns The message, e.g. `fetch failed: connect ECONNREFUSED 127.0.0.1:11980`.
|
|
57
|
+
*/
|
|
58
|
+
export function causeOf(error) {
|
|
59
|
+
if (!(error instanceof Error))
|
|
60
|
+
return String(error);
|
|
61
|
+
const { cause, message } = error;
|
|
62
|
+
if (!(cause instanceof Error))
|
|
63
|
+
return message;
|
|
64
|
+
const first = cause instanceof AggregateError ? cause.errors[0] : undefined;
|
|
65
|
+
const code = cause.code;
|
|
66
|
+
const detail = cause.message ||
|
|
67
|
+
(first instanceof Error ? first.message : '') ||
|
|
68
|
+
(typeof code === 'string' ? code : '') ||
|
|
69
|
+
cause.name;
|
|
70
|
+
return `${message}: ${detail}`;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A request body gzipped, as HTTP's `Content-Encoding: gzip` carries it: a
|
|
74
|
+
* batch of molfiles shrinks several times over.
|
|
75
|
+
* @param text - The body, written out.
|
|
76
|
+
* @returns The gzipped bytes.
|
|
77
|
+
*/
|
|
78
|
+
export async function gzipBody(text) {
|
|
79
|
+
const stream = new Blob([text])
|
|
80
|
+
.stream()
|
|
81
|
+
.pipeThrough(new CompressionStream('gzip'));
|
|
82
|
+
return new Uint8Array(await new Response(stream).arrayBuffer());
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Wait, unless the signal stops the wait first.
|
|
86
|
+
* @param milliseconds - How long.
|
|
87
|
+
* @param signal - What stops it, if anything.
|
|
88
|
+
* @returns When the time has passed.
|
|
89
|
+
* @throws {unknown} The signal's reason, when it aborts first.
|
|
90
|
+
*/
|
|
91
|
+
export function pause(milliseconds, signal) {
|
|
92
|
+
return new Promise((done, fail) => {
|
|
93
|
+
if (signal?.aborted) {
|
|
94
|
+
fail(toError(signal.reason));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const abort = () => {
|
|
98
|
+
clearTimeout(timer);
|
|
99
|
+
fail(toError(signal?.reason));
|
|
100
|
+
};
|
|
101
|
+
const timer = setTimeout(() => {
|
|
102
|
+
signal?.removeEventListener('abort', abort);
|
|
103
|
+
done();
|
|
104
|
+
}, milliseconds);
|
|
105
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=requestRetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestRetry.js","sourceRoot":"","sources":["../../../src/moleculesClient/core/requestRetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,MAA+B,EAC/B,SAAiB;IAEjB,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/C,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,MAAqB,EACrB,GAAW;IAEX,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAC9D,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,CAAC;IACjE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,SAAS,C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CAAC,CAAC,IAAI,CAAC,CAAC;SAC5B,MAAM,EAAE;SACR,WAAW,CAAC,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,OAAO,IAAI,UAAU,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CACnB,YAAoB,EACpB,MAA+B;IAE/B,OAAO,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAChC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAC7B,OAAO;QACT,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,EAAE;YACjB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC5C,IAAI,EAAE,CAAC;QACT,CAAC,EAAE,YAAY,CAAC,CAAC;QACjB,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -24,9 +24,10 @@ export declare const MINIMUM_FRAMING_RADIUS = 0.5;
|
|
|
24
24
|
* measured against — so reading a camera and applying it are the same move in
|
|
25
25
|
* opposite directions.
|
|
26
26
|
* @param radius - Radius of the scene's visible bounding sphere.
|
|
27
|
+
* @param margin - Fraction of the radius kept as breathing room.
|
|
27
28
|
* @returns The framed radius.
|
|
28
29
|
*/
|
|
29
|
-
export declare function framedRadius(radius: number): number;
|
|
30
|
+
export declare function framedRadius(radius: number, margin?: number): number;
|
|
30
31
|
/**
|
|
31
32
|
* Turn the automatic spin on or off. It moves the camera, never the object.
|
|
32
33
|
* @param plugin - The molstar context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/camera.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAK1C
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/camera.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAK1C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,SAAiB,GAAG,MAAM,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,OAAO,EACjB,KAAK,SAAqB,GACzB,IAAI,CAQN"}
|
|
@@ -26,10 +26,11 @@ const SPIN_AXIS = Vec3.create(0, 1, 0);
|
|
|
26
26
|
* measured against — so reading a camera and applying it are the same move in
|
|
27
27
|
* opposite directions.
|
|
28
28
|
* @param radius - Radius of the scene's visible bounding sphere.
|
|
29
|
+
* @param margin - Fraction of the radius kept as breathing room.
|
|
29
30
|
* @returns The framed radius.
|
|
30
31
|
*/
|
|
31
|
-
export function framedRadius(radius) {
|
|
32
|
-
return Math.max(radius * (1 +
|
|
32
|
+
export function framedRadius(radius, margin = FRAMING_MARGIN) {
|
|
33
|
+
return Math.max(radius * (1 + margin), MINIMUM_FRAMING_RADIUS);
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* Turn the automatic spin on or off. It moves the camera, never the object.
|