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,72 @@
|
|
|
1
|
+
import type { SiteId } from '../ecosystem/core/sites.ts';
|
|
2
|
+
/** An environment, as `process.env` holds it. */
|
|
3
|
+
export type ServerEnvironment = Readonly<Record<string, string | undefined>>;
|
|
4
|
+
/** What a site's server knows before it reads its environment. */
|
|
5
|
+
export interface ServerConfigOptions {
|
|
6
|
+
/** The site, as `ECOSYSTEM_SITES` names it: its address is the default `SITE_URL`. */
|
|
7
|
+
siteId: SiteId;
|
|
8
|
+
/** The port derived from the site's creation date, the one compose publishes. */
|
|
9
|
+
port: number;
|
|
10
|
+
/**
|
|
11
|
+
* The build served when `SERVER_ROOT` names none, usually
|
|
12
|
+
* `join(import.meta.dirname, '../dist')`.
|
|
13
|
+
* @default 'dist' - resolved from the directory the process runs in
|
|
14
|
+
*/
|
|
15
|
+
root?: string;
|
|
16
|
+
}
|
|
17
|
+
/** What a site's server is started with, every default filled in. */
|
|
18
|
+
export interface ServerConfig {
|
|
19
|
+
/** Where it listens: `PORT`, or the site's own port. */
|
|
20
|
+
port: number;
|
|
21
|
+
/** The interface it listens on: `HOST`, or every interface, as a container needs. */
|
|
22
|
+
host: string;
|
|
23
|
+
/** `TRACKING_SCRIPT`, verbatim; `undefined` loads nothing. */
|
|
24
|
+
trackingScript: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* `SITE_URL`: the static site people share, which every answer links to,
|
|
27
|
+
* ending in `/`.
|
|
28
|
+
*/
|
|
29
|
+
siteUrl: string;
|
|
30
|
+
/**
|
|
31
|
+
* `PUBLIC_URL`: this server's own address, whose pages a chat frames, ending
|
|
32
|
+
* in `/`.
|
|
33
|
+
*/
|
|
34
|
+
publicUrl: string;
|
|
35
|
+
/** `TRUST_PROXY`: the reverse proxies whose `X-Forwarded-For` is believed. */
|
|
36
|
+
trustProxy: boolean | string;
|
|
37
|
+
/** `SERVER_ROOT`: the build it serves. */
|
|
38
|
+
root: string;
|
|
39
|
+
/**
|
|
40
|
+
* `BASE_PATH`: where the deployment is mounted behind a proxy that takes the
|
|
41
|
+
* path off, `/osiris`, or `''` on a host of its own.
|
|
42
|
+
*/
|
|
43
|
+
basePath: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Read a site's server configuration from its environment, once, at startup.
|
|
47
|
+
*
|
|
48
|
+
* A malformed value refuses to start rather than handing out links that lead
|
|
49
|
+
* nowhere. Both addresses keep their path — a site may be mounted under one,
|
|
50
|
+
* and its pages are written relative to it — and lose their query and their
|
|
51
|
+
* fragment; each ends in `/`.
|
|
52
|
+
*
|
|
53
|
+
* const config = readServerConfig(process.env, { siteId: 'osiris', port: 10_620 });
|
|
54
|
+
* @param env - The environment, e.g. `process.env`.
|
|
55
|
+
* @param options - The site and its port.
|
|
56
|
+
* @returns The configuration.
|
|
57
|
+
* @throws {Error} When `PORT`, `SITE_URL` or `PUBLIC_URL` cannot be read, or
|
|
58
|
+
* `TRUST_PROXY` is a hop count.
|
|
59
|
+
*/
|
|
60
|
+
export declare function readServerConfig(env: ServerEnvironment, options: ServerConfigOptions): ServerConfig;
|
|
61
|
+
/**
|
|
62
|
+
* Read an http or https address from the environment, the way a link is built
|
|
63
|
+
* on it: its path kept and ended with `/`, its query and its fragment dropped.
|
|
64
|
+
* @param env - The environment, e.g. `process.env`.
|
|
65
|
+
* @param name - The variable, e.g. `SITE_URL`.
|
|
66
|
+
* @param fallback - The address when the variable is unset or blank.
|
|
67
|
+
* @returns The address, ending in `/`.
|
|
68
|
+
* @throws {Error} When the value, or the fallback, is not an http or https
|
|
69
|
+
* address.
|
|
70
|
+
*/
|
|
71
|
+
export declare function readHttpAddress(env: ServerEnvironment, name: string, fallback: string): string;
|
|
72
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/server/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAOzD,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAE7E,kEAAkE;AAClE,MAAM,WAAW,mBAAmB;IAClC,sFAAsF;IACtF,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,mBAAmB,GAC3B,YAAY,CAoBd;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CAgBR"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { siteById } from "../ecosystem/core/lookup.js";
|
|
2
|
+
import { siteUrl } from "../ecosystem/core/sites.js";
|
|
3
|
+
import { normalizeBasePath } from "../router/core/basePath.js";
|
|
4
|
+
import { readEnvNumber } from "./envNumber.js";
|
|
5
|
+
import { parseTrustProxy } from "./trustProxy.js";
|
|
6
|
+
/**
|
|
7
|
+
* Read a site's server configuration from its environment, once, at startup.
|
|
8
|
+
*
|
|
9
|
+
* A malformed value refuses to start rather than handing out links that lead
|
|
10
|
+
* nowhere. Both addresses keep their path — a site may be mounted under one,
|
|
11
|
+
* and its pages are written relative to it — and lose their query and their
|
|
12
|
+
* fragment; each ends in `/`.
|
|
13
|
+
*
|
|
14
|
+
* const config = readServerConfig(process.env, { siteId: 'osiris', port: 10_620 });
|
|
15
|
+
* @param env - The environment, e.g. `process.env`.
|
|
16
|
+
* @param options - The site and its port.
|
|
17
|
+
* @returns The configuration.
|
|
18
|
+
* @throws {Error} When `PORT`, `SITE_URL` or `PUBLIC_URL` cannot be read, or
|
|
19
|
+
* `TRUST_PROXY` is a hop count.
|
|
20
|
+
*/
|
|
21
|
+
export function readServerConfig(env, options) {
|
|
22
|
+
const port = readEnvNumber(env, 'PORT', options.port, {
|
|
23
|
+
min: 1,
|
|
24
|
+
max: 65_535,
|
|
25
|
+
integer: true,
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
port,
|
|
29
|
+
host: env.HOST?.trim() || '0.0.0.0',
|
|
30
|
+
trackingScript: env.TRACKING_SCRIPT?.trim() || undefined,
|
|
31
|
+
siteUrl: readHttpAddress(env, 'SITE_URL', siteUrl(siteById(options.siteId))),
|
|
32
|
+
publicUrl: readHttpAddress(env, 'PUBLIC_URL', `http://localhost:${port}/`),
|
|
33
|
+
trustProxy: parseTrustProxy(env.TRUST_PROXY),
|
|
34
|
+
root: env.SERVER_ROOT?.trim() || options.root || 'dist',
|
|
35
|
+
basePath: normalizeBasePath(env.BASE_PATH ?? ''),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Read an http or https address from the environment, the way a link is built
|
|
40
|
+
* on it: its path kept and ended with `/`, its query and its fragment dropped.
|
|
41
|
+
* @param env - The environment, e.g. `process.env`.
|
|
42
|
+
* @param name - The variable, e.g. `SITE_URL`.
|
|
43
|
+
* @param fallback - The address when the variable is unset or blank.
|
|
44
|
+
* @returns The address, ending in `/`.
|
|
45
|
+
* @throws {Error} When the value, or the fallback, is not an http or https
|
|
46
|
+
* address.
|
|
47
|
+
*/
|
|
48
|
+
export function readHttpAddress(env, name, fallback) {
|
|
49
|
+
const text = env[name]?.trim() || fallback;
|
|
50
|
+
const message = `${name} must be an http(s) address, not "${text}".`;
|
|
51
|
+
let url;
|
|
52
|
+
try {
|
|
53
|
+
url = new URL(text);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw new Error(message, { cause: error });
|
|
57
|
+
}
|
|
58
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
59
|
+
throw new Error(message);
|
|
60
|
+
}
|
|
61
|
+
url.search = '';
|
|
62
|
+
url.hash = '';
|
|
63
|
+
if (!url.pathname.endsWith('/'))
|
|
64
|
+
url.pathname = `${url.pathname}/`;
|
|
65
|
+
return url.href;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAgDlD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAsB,EACtB,OAA4B;IAE5B,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE;QACpD,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,MAAM;QACX,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IACH,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,SAAS;QACnC,cAAc,EAAE,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,SAAS;QACxD,OAAO,EAAE,eAAe,CACtB,GAAG,EACH,UAAU,EACV,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAClC;QACD,SAAS,EAAE,eAAe,CAAC,GAAG,EAAE,YAAY,EAAE,oBAAoB,IAAI,GAAG,CAAC;QAC1E,UAAU,EAAE,eAAe,CAAC,GAAG,CAAC,WAAW,CAAC;QAC5C,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,IAAI,MAAM;QACvD,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;KACjD,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAsB,EACtB,IAAY,EACZ,QAAgB;IAEhB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,QAAQ,CAAC;IAC3C,MAAM,OAAO,GAAG,GAAG,IAAI,qCAAqC,IAAI,IAAI,CAAC;IACrE,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,GAAG,CAAC,QAAQ,GAAG,CAAC;IACnE,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** The bounds a number read from the environment must keep. */
|
|
2
|
+
export interface ReadEnvNumberOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The smallest value accepted.
|
|
5
|
+
* @default undefined - no lower bound
|
|
6
|
+
*/
|
|
7
|
+
min?: number;
|
|
8
|
+
/**
|
|
9
|
+
* The largest value accepted.
|
|
10
|
+
* @default undefined - no upper bound
|
|
11
|
+
*/
|
|
12
|
+
max?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the value must be a whole number.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
integer?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Read a number from the environment.
|
|
21
|
+
*
|
|
22
|
+
* The compose files forward every variable as `${NAME:-}`, so a deployment that
|
|
23
|
+
* sets nothing hands the process an empty string rather than no variable — and
|
|
24
|
+
* `Number('')` is 0, which turned an indexer's interval into a busy loop. Unset,
|
|
25
|
+
* empty and blank all mean the fallback here. A value that says something but is
|
|
26
|
+
* not an accepted number refuses to start rather than running on a guess.
|
|
27
|
+
* @param env - The environment, e.g. `process.env`.
|
|
28
|
+
* @param name - The variable, e.g. `INDEX_INTERVAL`.
|
|
29
|
+
* @param fallback - The value when the variable says nothing.
|
|
30
|
+
* @param options - The bounds the value must keep.
|
|
31
|
+
* @returns The number written, or the fallback.
|
|
32
|
+
* @throws {Error} When the value is not a finite number, or breaks a bound.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readEnvNumber(env: Readonly<Record<string, string | undefined>>, name: string, fallback: number, options?: ReadEnvNumberOptions): number;
|
|
35
|
+
//# sourceMappingURL=envNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envNumber.d.ts","sourceRoot":"","sources":["../../src/server/envNumber.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EACjD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAcR"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a number from the environment.
|
|
3
|
+
*
|
|
4
|
+
* The compose files forward every variable as `${NAME:-}`, so a deployment that
|
|
5
|
+
* sets nothing hands the process an empty string rather than no variable — and
|
|
6
|
+
* `Number('')` is 0, which turned an indexer's interval into a busy loop. Unset,
|
|
7
|
+
* empty and blank all mean the fallback here. A value that says something but is
|
|
8
|
+
* not an accepted number refuses to start rather than running on a guess.
|
|
9
|
+
* @param env - The environment, e.g. `process.env`.
|
|
10
|
+
* @param name - The variable, e.g. `INDEX_INTERVAL`.
|
|
11
|
+
* @param fallback - The value when the variable says nothing.
|
|
12
|
+
* @param options - The bounds the value must keep.
|
|
13
|
+
* @returns The number written, or the fallback.
|
|
14
|
+
* @throws {Error} When the value is not a finite number, or breaks a bound.
|
|
15
|
+
*/
|
|
16
|
+
export function readEnvNumber(env, name, fallback, options = {}) {
|
|
17
|
+
const text = env[name]?.trim();
|
|
18
|
+
if (!text)
|
|
19
|
+
return fallback;
|
|
20
|
+
const value = Number(text);
|
|
21
|
+
const { min, max, integer = false } = options;
|
|
22
|
+
if (!Number.isFinite(value) ||
|
|
23
|
+
(integer && !Number.isInteger(value)) ||
|
|
24
|
+
(min !== undefined && value < min) ||
|
|
25
|
+
(max !== undefined && value > max)) {
|
|
26
|
+
throw new Error(`${name} must be ${expected(options)}, not "${text}".`);
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
function expected(options) {
|
|
31
|
+
const { min, max, integer = false } = options;
|
|
32
|
+
const kind = integer ? 'an integer' : 'a number';
|
|
33
|
+
if (min !== undefined && max !== undefined) {
|
|
34
|
+
return `${kind} from ${min} to ${max}`;
|
|
35
|
+
}
|
|
36
|
+
if (min !== undefined)
|
|
37
|
+
return `${kind} of at least ${min}`;
|
|
38
|
+
if (max !== undefined)
|
|
39
|
+
return `${kind} of at most ${max}`;
|
|
40
|
+
return kind;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=envNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envNumber.js","sourceRoot":"","sources":["../../src/server/envNumber.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAiD,EACjD,IAAY,EACZ,QAAgB,EAChB,UAAgC,EAAE;IAElC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO,QAAQ,CAAC;IAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAC9C,IACE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QACvB,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,GAAG,GAAG,CAAC;QAClC,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,GAAG,GAAG,CAAC,EAClC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,YAAY,QAAQ,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,OAA6B;IAC7C,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAC9C,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC;IACjD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,GAAG,IAAI,SAAS,GAAG,OAAO,GAAG,EAAE,CAAC;IACzC,CAAC;IACD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,IAAI,gBAAgB,GAAG,EAAE,CAAC;IAC3D,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,IAAI,eAAe,GAAG,EAAE,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FastifyInstance } from 'fastify';
|
|
2
|
+
/** Options of {@link healthRoute}. */
|
|
3
|
+
export interface HealthRouteOptions {
|
|
4
|
+
/**
|
|
5
|
+
* More fields for the answer, read locally and cheaply: a probe every 30 s
|
|
6
|
+
* must never wait on another service, or a dependency that is down rolls back
|
|
7
|
+
* a good release. `status` is always `ok`, whatever this returns.
|
|
8
|
+
* @default undefined - the answer is `{ status: 'ok' }`
|
|
9
|
+
*/
|
|
10
|
+
extra?: () => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Answer `GET /health`, what the container's health check and the server's
|
|
14
|
+
* deploy script probe before they keep a new container.
|
|
15
|
+
*
|
|
16
|
+
* It is at the root, never versioned, because it probes the process rather than
|
|
17
|
+
* the API contract. It logs nothing, or a probe every 30 s fills the log; it is
|
|
18
|
+
* kept out of the API's documentation; and it is open to any origin, like
|
|
19
|
+
* everything else a site serves.
|
|
20
|
+
*
|
|
21
|
+
* await healthRoute(app);
|
|
22
|
+
* @param fastify - The server.
|
|
23
|
+
* @param options - Extra fields for the answer.
|
|
24
|
+
*/
|
|
25
|
+
export declare function healthRoute(fastify: FastifyInstance, options?: HealthRouteOptions): Promise<void>;
|
|
26
|
+
//# sourceMappingURL=healthRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healthRoute.d.ts","sourceRoot":"","sources":["../../src/server/healthRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI/C,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC1E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ALLOW_ORIGIN, HIDDEN } from "./routeOptions.js";
|
|
2
|
+
/**
|
|
3
|
+
* Answer `GET /health`, what the container's health check and the server's
|
|
4
|
+
* deploy script probe before they keep a new container.
|
|
5
|
+
*
|
|
6
|
+
* It is at the root, never versioned, because it probes the process rather than
|
|
7
|
+
* the API contract. It logs nothing, or a probe every 30 s fills the log; it is
|
|
8
|
+
* kept out of the API's documentation; and it is open to any origin, like
|
|
9
|
+
* everything else a site serves.
|
|
10
|
+
*
|
|
11
|
+
* await healthRoute(app);
|
|
12
|
+
* @param fastify - The server.
|
|
13
|
+
* @param options - Extra fields for the answer.
|
|
14
|
+
*/
|
|
15
|
+
export async function healthRoute(fastify, options = {}) {
|
|
16
|
+
const { extra } = options;
|
|
17
|
+
fastify.get('/health', { logLevel: 'silent', schema: HIDDEN }, async (_request, reply) => {
|
|
18
|
+
const fields = extra === undefined ? {} : await extra();
|
|
19
|
+
return reply.header(ALLOW_ORIGIN, '*').send({ ...fields, status: 'ok' });
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=healthRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healthRoute.js","sourceRoot":"","sources":["../../src/server/healthRoute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAazD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAwB,EACxB,UAA8B,EAAE;IAEhC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,GAAG,CACT,SAAS,EACT,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,EACtC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { FastifyInstance } from 'fastify';
|
|
2
|
+
/** Options of {@link listenSite}. */
|
|
3
|
+
export interface ListenSiteOptions {
|
|
4
|
+
/** The port to listen on. */
|
|
5
|
+
port: number;
|
|
6
|
+
/**
|
|
7
|
+
* The interface to listen on.
|
|
8
|
+
* @default '0.0.0.0' - every interface, as a container needs
|
|
9
|
+
*/
|
|
10
|
+
host?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Run once the server has closed on a signal: stop what the server does not
|
|
13
|
+
* own itself, such as a scheduler or a write queue started beside it.
|
|
14
|
+
* @default undefined - nothing more is stopped
|
|
15
|
+
*/
|
|
16
|
+
onClose?: () => void | Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* The signals that close the server.
|
|
19
|
+
* @default ['SIGTERM', 'SIGINT'] - what `docker stop` and a terminal send
|
|
20
|
+
*/
|
|
21
|
+
signals?: readonly NodeJS.Signals[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Listen, and close cleanly when the container is stopped.
|
|
25
|
+
*
|
|
26
|
+
* On the first signal the server closes — its `onClose` hooks stop the worker
|
|
27
|
+
* pools it owns — then `onClose` runs. A close that fails is logged and leaves
|
|
28
|
+
* `process.exitCode` at 1 rather than surfacing as an unhandled rejection, and
|
|
29
|
+
* the process ends on its own once nothing is left running. A server that
|
|
30
|
+
* cannot listen is logged, closed and reported the same way.
|
|
31
|
+
*
|
|
32
|
+
* await listenSite(app, { port: config.port, host: config.host });
|
|
33
|
+
* @param app - The server, built and not yet listening.
|
|
34
|
+
* @param options - Where to listen, and what else to stop.
|
|
35
|
+
* @throws {Error} When the server cannot listen, after it has been closed.
|
|
36
|
+
*/
|
|
37
|
+
export declare function listenSite(app: FastifyInstance, options: ListenSiteOptions): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=listenSite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listenSite.d.ts","sourceRoot":"","sources":["../../src/server/listenSite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,CAAC,OAAO,EAAE,CAAC;CACrC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listen, and close cleanly when the container is stopped.
|
|
3
|
+
*
|
|
4
|
+
* On the first signal the server closes — its `onClose` hooks stop the worker
|
|
5
|
+
* pools it owns — then `onClose` runs. A close that fails is logged and leaves
|
|
6
|
+
* `process.exitCode` at 1 rather than surfacing as an unhandled rejection, and
|
|
7
|
+
* the process ends on its own once nothing is left running. A server that
|
|
8
|
+
* cannot listen is logged, closed and reported the same way.
|
|
9
|
+
*
|
|
10
|
+
* await listenSite(app, { port: config.port, host: config.host });
|
|
11
|
+
* @param app - The server, built and not yet listening.
|
|
12
|
+
* @param options - Where to listen, and what else to stop.
|
|
13
|
+
* @throws {Error} When the server cannot listen, after it has been closed.
|
|
14
|
+
*/
|
|
15
|
+
export async function listenSite(app, options) {
|
|
16
|
+
const { port, host = '0.0.0.0', onClose, signals = ['SIGTERM', 'SIGINT'], } = options;
|
|
17
|
+
const stop = () => {
|
|
18
|
+
for (const signal of signals)
|
|
19
|
+
process.off(signal, stop);
|
|
20
|
+
void shutDown(app, onClose);
|
|
21
|
+
};
|
|
22
|
+
for (const signal of signals)
|
|
23
|
+
process.once(signal, stop);
|
|
24
|
+
try {
|
|
25
|
+
await app.listen({ port, host });
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
for (const signal of signals)
|
|
29
|
+
process.off(signal, stop);
|
|
30
|
+
app.log.error(error, `the server could not listen on ${host}:${port}`);
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
await shutDown(app, onClose);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Close the server, then run what else has to stop, reporting a failure of
|
|
38
|
+
* either through the log and the exit code.
|
|
39
|
+
* @param app - The server.
|
|
40
|
+
* @param onClose - What else to stop.
|
|
41
|
+
*/
|
|
42
|
+
async function shutDown(app, onClose) {
|
|
43
|
+
try {
|
|
44
|
+
await app.close();
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
app.log.error(error, 'the server did not close cleanly');
|
|
48
|
+
process.exitCode = 1;
|
|
49
|
+
}
|
|
50
|
+
if (onClose === undefined)
|
|
51
|
+
return;
|
|
52
|
+
try {
|
|
53
|
+
await onClose();
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
app.log.error(error, 'what runs beside the server did not stop cleanly');
|
|
57
|
+
process.exitCode = 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=listenSite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listenSite.js","sourceRoot":"","sources":["../../src/server/listenSite.ts"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,GAAoB,EACpB,OAA0B;IAE1B,MAAM,EACJ,IAAI,EACJ,IAAI,GAAG,SAAS,EAChB,OAAO,EACP,OAAO,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,GAChC,GAAG,OAAO,CAAC;IAEZ,MAAM,IAAI,GAAG,GAAG,EAAE;QAChB,KAAK,MAAM,MAAM,IAAI,OAAO;YAAE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxD,KAAK,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC;IACF,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEzD,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,KAAK,MAAM,MAAM,IAAI,OAAO;YAAE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,kCAAkC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QACvE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,MAAM,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC7B,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,QAAQ,CACrB,GAAoB,EACpB,OAAiD;IAEjD,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,kCAAkC,CAAC,CAAC;QACzD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO;IAClC,IAAI,CAAC;QACH,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,kDAAkD,CAAC,CAAC;QACzE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as McpServer from 'cheminfo-mcp-server';
|
|
2
|
+
/**
|
|
3
|
+
* `cheminfo-mcp-server`, an optional peer, loaded when a helper first needs
|
|
4
|
+
* it, so `react-cheminfo/server` imports on a site that serves no tools.
|
|
5
|
+
* @returns The module.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mcpServer(): typeof McpServer;
|
|
8
|
+
//# sourceMappingURL=mcpServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpServer.d.ts","sourceRoot":"","sources":["../../src/server/mcpServer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,SAAS,MAAM,qBAAqB,CAAC;AAItD;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,SAAS,CAE5C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
/**
|
|
4
|
+
* `cheminfo-mcp-server`, an optional peer, loaded when a helper first needs
|
|
5
|
+
* it, so `react-cheminfo/server` imports on a site that serves no tools.
|
|
6
|
+
* @returns The module.
|
|
7
|
+
*/
|
|
8
|
+
export function mcpServer() {
|
|
9
|
+
return require('cheminfo-mcp-server');
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=mcpServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpServer.js","sourceRoot":"","sources":["../../src/server/mcpServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,OAAO,CAAC,qBAAqB,CAAqB,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The release a server's repository is at, as release-please writes it.
|
|
3
|
+
*
|
|
4
|
+
* Read from the `package.json` at the repository root, found by the same
|
|
5
|
+
* climbing rule `cheminfoBuildInfo` follows: a `backend` or `server` directory
|
|
6
|
+
* keeps the `0.0.0` it was scaffolded with, or none at all, while the root is
|
|
7
|
+
* the manifest a release bumps. A manifest that cannot be read is not a reason
|
|
8
|
+
* to refuse to start, so it reads as unreleased instead.
|
|
9
|
+
*
|
|
10
|
+
* const version = readRepositoryVersion(import.meta.dirname);
|
|
11
|
+
* @param fromDirectory - Where to start climbing, usually the server's own
|
|
12
|
+
* directory.
|
|
13
|
+
* @returns The version, or `'0.0.0'` when the root manifest carries none.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readRepositoryVersion(fromDirectory: string): string;
|
|
16
|
+
//# sourceMappingURL=repositoryVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repositoryVersion.d.ts","sourceRoot":"","sources":["../../src/server/repositoryVersion.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAYnE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { UNRELEASED_VERSION } from "../build/core/buildInfo.js";
|
|
4
|
+
import { findRepositoryRoot } from "../build/vite/buildInfo.js";
|
|
5
|
+
/**
|
|
6
|
+
* The release a server's repository is at, as release-please writes it.
|
|
7
|
+
*
|
|
8
|
+
* Read from the `package.json` at the repository root, found by the same
|
|
9
|
+
* climbing rule `cheminfoBuildInfo` follows: a `backend` or `server` directory
|
|
10
|
+
* keeps the `0.0.0` it was scaffolded with, or none at all, while the root is
|
|
11
|
+
* the manifest a release bumps. A manifest that cannot be read is not a reason
|
|
12
|
+
* to refuse to start, so it reads as unreleased instead.
|
|
13
|
+
*
|
|
14
|
+
* const version = readRepositoryVersion(import.meta.dirname);
|
|
15
|
+
* @param fromDirectory - Where to start climbing, usually the server's own
|
|
16
|
+
* directory.
|
|
17
|
+
* @returns The version, or `'0.0.0'` when the root manifest carries none.
|
|
18
|
+
*/
|
|
19
|
+
export function readRepositoryVersion(fromDirectory) {
|
|
20
|
+
const root = findRepositoryRoot(fromDirectory);
|
|
21
|
+
let manifest;
|
|
22
|
+
try {
|
|
23
|
+
manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return UNRELEASED_VERSION;
|
|
27
|
+
}
|
|
28
|
+
const version = manifest?.version;
|
|
29
|
+
return typeof version === 'string' && version !== ''
|
|
30
|
+
? version
|
|
31
|
+
: UNRELEASED_VERSION;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=repositoryVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repositoryVersion.js","sourceRoot":"","sources":["../../src/server/repositoryVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB,CAAC,aAAqB;IACzD,MAAM,IAAI,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC/C,IAAI,QAAiB,CAAC;IACtB,IAAI,CAAC;QACH,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IACD,MAAM,OAAO,GAAI,QAAyC,EAAE,OAAO,CAAC;IACpE,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,EAAE;QAClD,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,kBAAkB,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every route the serving helpers register shares: how it is cached, who
|
|
3
|
+
* may read it, and that it stays out of the API's documentation.
|
|
4
|
+
*/
|
|
5
|
+
import type { FastifySchema } from 'fastify';
|
|
6
|
+
/** A page is checked on every visit: it names the bundles of its own build. */
|
|
7
|
+
export declare const PAGE_CACHE = "no-cache";
|
|
8
|
+
/** A bundle is named by its content, so it never changes under its name. */
|
|
9
|
+
export declare const BUNDLE_CACHE = "public, max-age=31536000, immutable";
|
|
10
|
+
/**
|
|
11
|
+
* The header that opens an answer to every origin. Every file of a build is
|
|
12
|
+
* public, and a page framed by a sandboxed view runs under an opaque origin,
|
|
13
|
+
* where everything it fetches from its own site is cross-origin: the static
|
|
14
|
+
* hosts open every response, and so do these servers.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ALLOW_ORIGIN = "access-control-allow-origin";
|
|
17
|
+
/** Kept out of the API's documentation (`@fastify/swagger` reads `hide`). */
|
|
18
|
+
export declare const HIDDEN: FastifySchema & {
|
|
19
|
+
hide: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** The addresses an API and its documentation answer, never a page. */
|
|
22
|
+
export declare const DEFAULT_RESERVED: readonly string[];
|
|
23
|
+
//# sourceMappingURL=routeOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routeOptions.d.ts","sourceRoot":"","sources":["../../src/server/routeOptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,+EAA+E;AAC/E,eAAO,MAAM,UAAU,aAAa,CAAC;AAErC,4EAA4E;AAC5E,eAAO,MAAM,YAAY,wCAAwC,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,gCAAgC,CAAC;AAE1D,6EAA6E;AAC7E,eAAO,MAAM,MAAM,EAAE,aAAa,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAmB,CAAC;AAExE,uEAAuE;AACvE,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAsB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every route the serving helpers register shares: how it is cached, who
|
|
3
|
+
* may read it, and that it stays out of the API's documentation.
|
|
4
|
+
*/
|
|
5
|
+
/** A page is checked on every visit: it names the bundles of its own build. */
|
|
6
|
+
export const PAGE_CACHE = 'no-cache';
|
|
7
|
+
/** A bundle is named by its content, so it never changes under its name. */
|
|
8
|
+
export const BUNDLE_CACHE = 'public, max-age=31536000, immutable';
|
|
9
|
+
/**
|
|
10
|
+
* The header that opens an answer to every origin. Every file of a build is
|
|
11
|
+
* public, and a page framed by a sandboxed view runs under an opaque origin,
|
|
12
|
+
* where everything it fetches from its own site is cross-origin: the static
|
|
13
|
+
* hosts open every response, and so do these servers.
|
|
14
|
+
*/
|
|
15
|
+
export const ALLOW_ORIGIN = 'access-control-allow-origin';
|
|
16
|
+
/** Kept out of the API's documentation (`@fastify/swagger` reads `hide`). */
|
|
17
|
+
export const HIDDEN = { hide: true };
|
|
18
|
+
/** The addresses an API and its documentation answer, never a page. */
|
|
19
|
+
export const DEFAULT_RESERVED = ['/v1/', '/docs'];
|
|
20
|
+
//# sourceMappingURL=routeOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routeOptions.js","sourceRoot":"","sources":["../../src/server/routeOptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;AAErC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,qCAAqC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,6BAA6B,CAAC;AAE1D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,MAAM,GAAsC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAExE,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RouteMeta } from '../seo/core/routes.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Every address the frontend routes itself, from the `routes.json` its build
|
|
4
|
+
* wrote beside the page (`cheminfoRouteTable` in `react-cheminfo/vite`).
|
|
5
|
+
*
|
|
6
|
+
* The pages that exist whatever the build wrote are the fallback, so a server
|
|
7
|
+
* started before the frontend was built, or against a build of an older shape,
|
|
8
|
+
* still titles them.
|
|
9
|
+
* @param root - The directory holding the built frontend.
|
|
10
|
+
* @param fallback - The routes when the build wrote no table this can read.
|
|
11
|
+
* @returns The routes, the home page first.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readRouteTable(root: string, fallback: readonly RouteMeta[]): RouteMeta[];
|
|
14
|
+
//# sourceMappingURL=routeTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routeTable.d.ts","sourceRoot":"","sources":["../../src/server/routeTable.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,SAAS,EAAE,GAC7B,SAAS,EAAE,CAcb"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { ROUTE_TABLE_FILE, parseRouteTable } from "../seo/core/routeTable.js";
|
|
4
|
+
/**
|
|
5
|
+
* Every address the frontend routes itself, from the `routes.json` its build
|
|
6
|
+
* wrote beside the page (`cheminfoRouteTable` in `react-cheminfo/vite`).
|
|
7
|
+
*
|
|
8
|
+
* The pages that exist whatever the build wrote are the fallback, so a server
|
|
9
|
+
* started before the frontend was built, or against a build of an older shape,
|
|
10
|
+
* still titles them.
|
|
11
|
+
* @param root - The directory holding the built frontend.
|
|
12
|
+
* @param fallback - The routes when the build wrote no table this can read.
|
|
13
|
+
* @returns The routes, the home page first.
|
|
14
|
+
*/
|
|
15
|
+
export function readRouteTable(root, fallback) {
|
|
16
|
+
let text;
|
|
17
|
+
try {
|
|
18
|
+
text = readFileSync(join(root, ROUTE_TABLE_FILE), 'utf8');
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return [...fallback];
|
|
22
|
+
}
|
|
23
|
+
let parsed;
|
|
24
|
+
try {
|
|
25
|
+
parsed = JSON.parse(text);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return [...fallback];
|
|
29
|
+
}
|
|
30
|
+
return parseRouteTable(parsed) ?? [...fallback];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=routeTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routeTable.js","sourceRoot":"","sources":["../../src/server/routeTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG9E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,QAA8B;IAE9B,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AppResource } from 'cheminfo-mcp-server';
|
|
2
|
+
import type { AnswerAddressesInput } from './answerAddresses.ts';
|
|
3
|
+
/** What {@link siteView} names, and where its pages come from. */
|
|
4
|
+
export interface SiteViewOptions {
|
|
5
|
+
/** Its address, which the tools name in `ui.resourceUri`: `ui://lcao/page`. */
|
|
6
|
+
uri: string;
|
|
7
|
+
/** For people: the site's host, `lcao.cheminfo.org`. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** For people: what the card shows inline, and the page over the screen. */
|
|
10
|
+
description: string;
|
|
11
|
+
/** Where the site and this server are: the view frames both, and no other. */
|
|
12
|
+
addresses: AnswerAddressesInput;
|
|
13
|
+
/**
|
|
14
|
+
* The height of the frame, in pixels, for a page that cannot report its
|
|
15
|
+
* own.
|
|
16
|
+
* @default undefined - the page reports its height, as `CardFrame` does
|
|
17
|
+
*/
|
|
18
|
+
height?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The MCP App showing an answer on the site's own page: inline the answer's
|
|
22
|
+
* card, the page itself over the full screen, framed from this server or from
|
|
23
|
+
* the static site. One per tool server, named by every tool whose answer
|
|
24
|
+
* carries a `meta` from `cardMeta` or `pageAnswer`.
|
|
25
|
+
* @param options - Its address, its name, and the two addresses it frames.
|
|
26
|
+
* @returns The resource, for `createToolRoutes({ resources })`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function siteView(options: SiteViewOptions): AppResource;
|
|
29
|
+
//# sourceMappingURL=siteView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siteView.d.ts","sourceRoot":"","sources":["../../src/server/siteView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,SAAS,EAAE,oBAAoB,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,WAAW,CAS9D"}
|