react-cheminfo 0.64.0 → 0.65.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 +282 -0
- 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/locales/de.json +37 -0
- package/lib/locales/en.json +37 -0
- package/lib/locales/es.json +37 -0
- package/lib/locales/fr.json +37 -0
- package/lib/locales/it.json +37 -0
- package/lib/molecule3d/core/highlight.d.ts.map +1 -1
- package/lib/molecule3d/core/highlight.js +2 -8
- package/lib/molecule3d/core/highlight.js.map +1 -1
- package/lib/molecule3d/core/index.d.ts +1 -1
- package/lib/molecule3d/core/index.d.ts.map +1 -1
- package/lib/molecule3d/core/index.js +1 -1
- package/lib/molecule3d/core/index.js.map +1 -1
- package/lib/molecule3d/core/measurement.d.ts +17 -0
- package/lib/molecule3d/core/measurement.d.ts.map +1 -1
- package/lib/molecule3d/core/measurement.js +43 -0
- package/lib/molecule3d/core/measurement.js.map +1 -1
- package/lib/molecule3d/ui/drawScene.d.ts +4 -2
- package/lib/molecule3d/ui/drawScene.d.ts.map +1 -1
- package/lib/molecule3d/ui/drawScene.js +1 -1
- package/lib/molecule3d/ui/drawScene.js.map +1 -1
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +3 -1
- package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
- package/lib/molecule3d/ui/sceneDrawer.d.ts +47 -0
- package/lib/molecule3d/ui/sceneDrawer.d.ts.map +1 -0
- package/lib/molecule3d/ui/sceneDrawer.js +103 -0
- package/lib/molecule3d/ui/sceneDrawer.js.map +1 -0
- package/lib/molecule3d/ui/useMoleculeScene.d.ts +2 -1
- package/lib/molecule3d/ui/useMoleculeScene.d.ts.map +1 -1
- package/lib/molecule3d/ui/useMoleculeScene.js +13 -22
- package/lib/molecule3d/ui/useMoleculeScene.js.map +1 -1
- package/lib/molecule3d/ui/useSharedCamera.d.ts +1 -3
- package/lib/molecule3d/ui/useSharedCamera.d.ts.map +1 -1
- package/lib/molecule3d/ui/useSharedCamera.js.map +1 -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/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 +16 -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/locales/de.json +37 -0
- package/src/locales/en.json +37 -0
- package/src/locales/es.json +37 -0
- package/src/locales/fr.json +37 -0
- package/src/locales/it.json +37 -0
- package/src/molecule3d/core/highlight.ts +2 -8
- package/src/molecule3d/core/index.ts +1 -0
- package/src/molecule3d/core/measurement.ts +47 -0
- package/src/molecule3d/ui/drawScene.ts +13 -2
- package/src/molecule3d/ui/moleculeViewer3DProps.ts +3 -1
- package/src/molecule3d/ui/sceneDrawer.ts +132 -0
- package/src/molecule3d/ui/useMoleculeScene.ts +16 -26
- package/src/molecule3d/ui/useSharedCamera.ts +1 -3
- 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/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
package/README.md
CHANGED
|
@@ -33,10 +33,12 @@ only when it drags a heavy dependency behind it.
|
|
|
33
33
|
| Import | Holds | Costs |
|
|
34
34
|
| ---------------------------------- | ----------------------------------------------------- | ------------------------------------------------ |
|
|
35
35
|
| `react-cheminfo/core` | every framework-free helper — 140 value exports | nothing |
|
|
36
|
+
| `react-cheminfo/formula` | formulas: read, compared, drawn and copied | mf-parser, react-mf; React on the components |
|
|
36
37
|
| `react-cheminfo/ui` | every React component and hook — 60 value exports | React |
|
|
37
38
|
| `react-cheminfo/vite` | the prerender plugin and the OG card | nothing; React on the card |
|
|
38
39
|
| `react-cheminfo/pages` | the Cloudflare Pages analytics middleware | nothing |
|
|
39
40
|
| `react-cheminfo/server` | the prerendered build, served from Node | fastify, @fastify/static; Node only |
|
|
41
|
+
| `react-cheminfo/card` | the card an answer is shown as in a chat | React; cheminfo-mcp-server, an optional peer |
|
|
40
42
|
| `react-cheminfo/orbital` | the 3D atomic-orbital viewer | React, molstar |
|
|
41
43
|
| `react-cheminfo/molecule3d` | the 3D molecule viewer and its toolbar | React, molstar |
|
|
42
44
|
| `react-cheminfo/structure` | the structure editor and renderer | React, react-ocl, OCL |
|
|
@@ -49,6 +51,7 @@ only when it drags a heavy dependency behind it.
|
|
|
49
51
|
| `react-cheminfo/host-testing` | a stand-in host and SciPeaks' messages, for e2e tests | nothing; Node only |
|
|
50
52
|
| `react-cheminfo/styles/chrome.css` | the shared tokens and site-header stylesheet | nothing |
|
|
51
53
|
| `react-cheminfo/styles/slides.css` | the deck stylesheet, themed on the site's colours | nothing |
|
|
54
|
+
| `react-cheminfo/styles/card.css` | the card’s stylesheet, on the family’s tokens | nothing |
|
|
52
55
|
|
|
53
56
|
A backend serving an RIS endpoint, a prerender script writing a sitemap, and
|
|
54
57
|
every unit test of that logic therefore load no React at all — and a worker
|
|
@@ -100,12 +103,17 @@ through a wildcard subpath exactly as `react-science` serves its own.
|
|
|
100
103
|
| **Routing & head** | `createTabRouter`, `readRoute`, `writeRoute`, `subscribeToRoute`, `adoptLegacyHashAddress`, `writeDocumentMeta`, `pageLocation`, `pageHistory` | `useTabRoute` |
|
|
101
104
|
| **Indexing** | `injectPageMeta`, `pageHeadTags`, `pageDocumentMeta`, `fill`, `PAGE_HEAD_MARKER`, `PAGE_BODY_MARKER`, `robotsTxt`, `sitemapXml`, `noscriptIndex`, `structuredDataScript`, `assertRoutes`, `routeFor`, `homeRoute` | `cheminfoPrerender`, `ogCardHtml`, `OG_WIDTH`, `OG_HEIGHT` (all `/vite`) |
|
|
102
105
|
| **Pedagogy** | `parseGlossaryMarkers`, `localStorageProgressStore`, `progressSummary`, `finishValidation` | `GlossaryText`, `SyntaxTooltip`, `HintLadder`, `ExerciseActions`, `ExerciseProgressHeader`, `TutorialStepStrip`, `ReferenceGrid`, `TestCaseList` |
|
|
106
|
+
| **Graded series** | `pickSeeded`, `freshSeed`, `parseSeed`, `seedParam`, `createAttemptStore`, `createProgressController`, `readAnswerNumber`, `emptyCase`, `unreadableCase` | `ExerciseSeries`, `QuestionCard`, `AnswerFields`, `ExerciseList`, `useAttemptRecords` |
|
|
107
|
+
| **Formulas** | `readFormula`, `normalizeFormula`, `canonicalFormula`, `atomCounts`, `formulaHtml`, `formulaText` (all `/formula`) | `CopyableFormula`, `QuestionFormula`, `FormulaInput` (all `/formula`) |
|
|
108
|
+
| **Site shell** | `pageContentOf`; the `pages` option of `cheminfoPrerender` (`/vite`) | `SiteShell`, `ShareControl` |
|
|
109
|
+
| **Properties** | `copyableText` | `PropertyTable` |
|
|
103
110
|
| **Clipboard & files** | `writeToClipboard`, `downloadBlob`, `downloadText`, `sanitizeFileName`, `toDelimited`, `readDelimited`, `downloadFigure`, `figureSvg`, `figurePng`, `figureSize` | `ClickToCopy`, `CopyButton`, `CopyableValue`, `CodeBlock`, `DelimitedTextDialog`, `FigureDownload` |
|
|
104
111
|
| **Formatting & colour** | `formatInteger`, `formatDecimal`, `formatBytes`, `pluralize`, `readableInk`, `contrastRatio`, `COLOR_SCALES`, `resolveColorScale`, `formatColorScale`, `colorAt`, `swatchAt`, `sampleScale`, `colorScaleGradient`, `rgbToHsv` | `ColorScaleLegend`, `ColorScaleSelect`, `ColorScaleEditor`, `ColorScaleBar` |
|
|
105
112
|
| **Number entry** | `readNumber`, `numberText`, `isPartialNumber`, `stepNumber`, `snapToStep` | `NumberInput` |
|
|
106
113
|
| **Range filter** | `isRangeBounded`, `isRangeDomain`, `rangeHandles`, `movedRange`, `settleHandles`, `sameRange`, `rangeHistogramPath`, `OPEN_RANGE` | `RangeSlider` |
|
|
107
114
|
| **Widgets** | `CREDITS`, `credits` | `ErrorBoundary`, `CollapsibleSection`, `CapsuleFilter`, `HelpTooltip`, `CreditsList` |
|
|
108
115
|
| **Hooks & state** | `createWorkerChannel`, `persistBucket`, `persistSignalBucket` | `useDebouncedValue`, `useContainerSize`, `useListKeyboardNavigation`, `useDisclosure` |
|
|
116
|
+
| **Requests** | `fetchJson`, `ApiError`, `readApiError`, `keySetParam`, `readHiddenParts`, `formatHiddenParts`, `fitDescription`, `DESCRIPTION_MIN`, `DESCRIPTION_MAX`, `openingRoute`, `anchorHref` | `useAsync` (signal, `pending`) |
|
|
109
117
|
| **Chemistry** | `atomicOrbitalsOf`, `configurationOf`, `classifyMolfile`, `readStructure`, `toMolfileExport` | `AtomicOrbitalViewer` (`/orbital`), `StructureEditor`, `Structure` (`/structure`) |
|
|
110
118
|
| **Conformers** | `generateConformers`, `continueConformers`, `refineConformers`, `conformerShape`, `isSameMinimum`, `rankByEnergy`, `minimiseConformer`, `DEFAULT_CONFORMER_OPTIONS`, `CONFORMER_STRATEGIES` (all `/conformers`); `GeometryRelaxer`, `readRelaxableGeometry`, `centredRmsd` | — |
|
|
111
119
|
| **Spectrum charts** | `chartScale`, `chartAxisScale`, `plotRect`, `zoomDomain`, `zoomSelection`, `labelStackBaselines`, `layoutAnnotationBoxes`, `profilePath`, `stickPath`, `guidePlacement`, `readoutPlacement`, `stackCapacity`, `nextSpectrumColor`, `panelStyles`, `statusBar` | `Axes`, `AxisGuide`, `ChartTracker`, `ChartStack`, `SelectionRect`, `TraceLegend`, `PlotCaption`, `useChartZoom`, `useChartPointer`, `useChartSize`, `SidePanelStack`, `PanelRail`, `Section`, `FilterInput`, `AboutDialogFrame`, `DocumentationDialogFrame`, `FigureDownload`, `useFigureDownload` |
|
|
@@ -121,6 +129,7 @@ through a wildcard subpath exactly as `react-science` serves its own.
|
|
|
121
129
|
| **Periodic table** | `PERIODIC_ELEMENTS`, `elementBySymbol`, `elementByAtomicNumber`, `cellOf`, `placedElements`, `elementByArrowKey`, `EMPTY_BLOCK`, `categorySwatch`, `CATEGORY_LABELS` | `PeriodicTable`, `ElementCell`, `CategoryLegend` |
|
|
122
130
|
| **Taxonomy** | `TAXON_RANKS`, `PRINCIPAL_RANKS`, `rankOrder`, `isPrincipalRank`, `isGenusOrBelow`, `isAboveGenus`, `principalLineage`, `lineageFromNodes`, `lineageFromRanks`, `genusOrBelow`, `ncbiTaxonomyUrl`, `splitOrganismName` | `TaxonLineage`, `OrganismName`, `useRankLabel` |
|
|
123
131
|
| **Framed by a host** | `hostStructureLoader`, `readHostMolecule`, `STRUCTURE_KINDS`, `connectHost`, `selectInputs`, `checkValue`, `kindAccepts`, `parseRequest` (all `/host`); `startStandInHost`, `SCIPEAKS_ETHYLBENZENE_LOAD` (`/host-testing`) | `useHostConnection` (`/host`) |
|
|
132
|
+
| **Answer cards** | `CARD_PARAM`, `isCardAddress`, `sitePageUrl`, `cardPageUrl`, `framedPageUrl`, `roomForPanels`; `answerAddresses`, `joinAddress`, `viewOrigins`, `cardMeta`, `pageAnswer`, `siteView` (all `/server`) | `CardFrame`, `CardDetailsButton`, `CardFigure`, `CopyTableButton`, `fitCardToFrame`, `useFitCardToFrame`, `useOverlayRoom`, `holdRoomForPanels` (all `/card`); `StructureExportButton`, `useStructureDraft` (`/structure`) |
|
|
124
133
|
|
|
125
134
|
Everything in that table is exported from `./core`, `./ui`, `./slides`,
|
|
126
135
|
`./vite` or `./structure` and nothing else is: the sub-components a component is built
|
|
@@ -854,6 +863,60 @@ const included = useMemo(
|
|
|
854
863
|
subject — a formula through `react-mf`, a structure, a name — and a readout of
|
|
855
864
|
strings cannot hold any of that.
|
|
856
865
|
|
|
866
|
+
## A graded series, and the shell around it
|
|
867
|
+
|
|
868
|
+
A pedagogic site that asks a series of questions writes its pool and its
|
|
869
|
+
grader, and nothing else. `SeriesTool` describes them; `ExerciseSeries` draws
|
|
870
|
+
the list beside the open question, the progress over the series, the length
|
|
871
|
+
picker and the new-series button. It reads no address: the page hands it the
|
|
872
|
+
seed, the length and the share of the row, and is told when one changes.
|
|
873
|
+
|
|
874
|
+
```tsx
|
|
875
|
+
import { createAttemptStore, parseSeed } from 'react-cheminfo/core';
|
|
876
|
+
import { ExerciseSeries } from 'react-cheminfo/ui';
|
|
877
|
+
|
|
878
|
+
const ATTEMPTS = createAttemptStore({ key: 'atoms' }); // atoms:attempts:v1
|
|
879
|
+
|
|
880
|
+
<ExerciseSeries
|
|
881
|
+
tool={ELECTRONS}
|
|
882
|
+
store={ATTEMPTS}
|
|
883
|
+
label={(ion) => <QuestionFormula formula={ion.formula} />}
|
|
884
|
+
prompt={(ion) => <p>How many electrons has {ion.name}?</p>}
|
|
885
|
+
seed={parseSeed(route.params.seed)}
|
|
886
|
+
onSeed={(seed, history) => writeSeed(tab, seed, history)}
|
|
887
|
+
count={questionCount}
|
|
888
|
+
onCount={setQuestionCount}
|
|
889
|
+
split={SERIES_SPLIT.parse(route.params.split ?? null)}
|
|
890
|
+
onSplit={(split) => writeSplit(tab, split)}
|
|
891
|
+
/>;
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
`pickSeeded` draws the series. Its `draw` option names the generator call a
|
|
895
|
+
site's links were written with — `getFloat` for atoms, inorganic and moles,
|
|
896
|
+
`getUint32` with `wrap` for dbe — so every `?seed=` already handed out opens
|
|
897
|
+
the same questions. `seedParam` reads a seed a link pins, and `?seed=each` for
|
|
898
|
+
one series per student. `createProgressController(signal)` is the handful of
|
|
899
|
+
actions an exercise page performs on progress kept in a signal.
|
|
900
|
+
|
|
901
|
+
Formulas come from their own door, because they are read by `mf-parser` and
|
|
902
|
+
drawn by `react-mf`: `readFormula` reads `NO3-`, `SO4--` and `CuSO4.5H2O` the
|
|
903
|
+
way a student types them, which the parser alone reads as neutral or as a
|
|
904
|
+
decimal; `CopyableFormula` copies a formula as text and as HTML, so a paste
|
|
905
|
+
keeps its subscripts.
|
|
906
|
+
|
|
907
|
+
`SiteShell` is the chrome around a page: the theme, the bar with About · Cite ·
|
|
908
|
+
Tools · Contact · Share, the page, and the footer, with nothing but the page
|
|
909
|
+
under `?embed`. A site fills the slots between the shared entries
|
|
910
|
+
(`actionsAfterAbout`, `actionsAfterCite`, `actions`, `language`, `account`) and
|
|
911
|
+
never re-orders them. Given the site's router, it marks the tab on show and
|
|
912
|
+
serves the About tab as `AboutPage`. Its `share` takes what `ShareControl`
|
|
913
|
+
takes — the Share entry and its dialog in one, which is also what a header's
|
|
914
|
+
own `share` prop takes.
|
|
915
|
+
|
|
916
|
+
A prerendered site that writes text for a few of its pages passes them as
|
|
917
|
+
`pages` to `cheminfoPrerender`; every other address then says the name and the
|
|
918
|
+
sentence its route is indexed under.
|
|
919
|
+
|
|
857
920
|
## Framed by a notebook
|
|
858
921
|
|
|
859
922
|
A page that frames a tool — an electronic lab notebook such as SciPeaks, a
|
|
@@ -1016,6 +1079,39 @@ Still English, with the runtime in place and no catalog yet: the spectra
|
|
|
1016
1079
|
settings editor and the projection panels (`react-cheminfo/spectra`, the
|
|
1017
1080
|
projection viewers), which no site of the family reads in a second language yet.
|
|
1018
1081
|
|
|
1082
|
+
## Routing a translated site
|
|
1083
|
+
|
|
1084
|
+
A router given `languages` reads the language off the prefix and writes it
|
|
1085
|
+
back, English bare, so the share vocabulary, the query and the mount stay where
|
|
1086
|
+
they were:
|
|
1087
|
+
|
|
1088
|
+
```ts
|
|
1089
|
+
const router = createTabRouter<Tab>({
|
|
1090
|
+
tabs: ['generator', 'exercises'],
|
|
1091
|
+
home: 'generator',
|
|
1092
|
+
languages: ['en', 'fr', 'de'],
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
router.parse('/fr/exercises?embed'); // { tab: 'exercises', language: 'fr', … }
|
|
1096
|
+
router.format({ tab: 'exercises', language: 'de' }); // '/de/exercises'
|
|
1097
|
+
```
|
|
1098
|
+
|
|
1099
|
+
`readRoute` moves a `?lang=` a sibling handed over into the path, once, in
|
|
1100
|
+
place; a prefix the address already carries always wins, so a deep link is
|
|
1101
|
+
never steered. `openingRoute(router, preferred)` opens a bare `/` in the
|
|
1102
|
+
language the reader last chose, and nothing else. `writeRoute` keeps the
|
|
1103
|
+
language on screen when the route names none.
|
|
1104
|
+
|
|
1105
|
+
Beside it: `persistSignalBucket` takes `legacyKeys` (adopted once, through a
|
|
1106
|
+
`migrate` when the shape changed) and `syncAcrossTabs`; `createSiteAddresses`
|
|
1107
|
+
answers `anchorHref` and `storedAssetSrc`; a vocabulary takes
|
|
1108
|
+
`legacyEmbedParts`, so `?hide=header` still opens framed; `keySetParam` writes
|
|
1109
|
+
`?flags=` with `none` for the empty set; `createWorkerChannel` takes a
|
|
1110
|
+
`failure` hook, `retryAfterWorkerFailure`, and runs in-process when a browser
|
|
1111
|
+
refuses the worker; `oclResourcesUrl()` comes from `./conformers`, and
|
|
1112
|
+
`resetCamera`, `focusPoint`, `sceneSphere` and `subscribeHoverLabel` from
|
|
1113
|
+
`./molstar/core`.
|
|
1114
|
+
|
|
1019
1115
|
## Carrying talks
|
|
1020
1116
|
|
|
1021
1117
|
A deck is one Markdown file in the repository of the site whose subject it
|
|
@@ -1253,6 +1349,192 @@ answers its own 404. Without a build, `staticSite` logs it and serves the API
|
|
|
1253
1349
|
alone. `fastify` (5) and `@fastify/static` (10) are optional peers, installed
|
|
1254
1350
|
by a site that has a server.
|
|
1255
1351
|
|
|
1352
|
+
`basePath` (`BASE_PATH`) serves one image at a mount chosen at startup, behind a
|
|
1353
|
+
proxy that takes the path off: it is written into the `<base href="/">` of every
|
|
1354
|
+
page when the build is read, and in front of every redirect.
|
|
1355
|
+
|
|
1356
|
+
### A tool site's server, from its environment
|
|
1357
|
+
|
|
1358
|
+
A site that serves its tools beside its pages has nothing of its own to write
|
|
1359
|
+
but the tools. `readServerConfig` reads the environment once and refuses a
|
|
1360
|
+
malformed value; `toolSiteServer` builds Fastify, registers the API the site
|
|
1361
|
+
passes, then `staticSite`; `startToolServer` listens and closes on `SIGTERM`
|
|
1362
|
+
and `SIGINT`, setting `process.exitCode = 1` when a close fails.
|
|
1363
|
+
|
|
1364
|
+
```ts
|
|
1365
|
+
// server/main.ts
|
|
1366
|
+
import { join } from 'node:path';
|
|
1367
|
+
|
|
1368
|
+
import {
|
|
1369
|
+
readServerConfig,
|
|
1370
|
+
startToolServer,
|
|
1371
|
+
toolSiteServer,
|
|
1372
|
+
} from 'react-cheminfo/server';
|
|
1373
|
+
|
|
1374
|
+
const config = readServerConfig(process.env, {
|
|
1375
|
+
siteId: 'osiris',
|
|
1376
|
+
port: 10_620,
|
|
1377
|
+
root: join(import.meta.dirname, '../dist'),
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1380
|
+
await startToolServer(
|
|
1381
|
+
(settings) =>
|
|
1382
|
+
toolSiteServer({
|
|
1383
|
+
siteId: 'osiris',
|
|
1384
|
+
config: settings,
|
|
1385
|
+
// name: 'osiris.cheminfo.org', version: the repository root's release
|
|
1386
|
+
registerApi: (app, { name, version }) =>
|
|
1387
|
+
registerTools(app, name, version),
|
|
1388
|
+
}),
|
|
1389
|
+
config,
|
|
1390
|
+
);
|
|
1391
|
+
```
|
|
1392
|
+
|
|
1393
|
+
| Variable | Read as | Default |
|
|
1394
|
+
| ----------------- | ------------------------------------------------------------------- | ---------------------------- |
|
|
1395
|
+
| `PORT` | an integer from 1 to 65535 | the site's own port |
|
|
1396
|
+
| `HOST` | the interface listened on | `0.0.0.0` |
|
|
1397
|
+
| `TRACKING_SCRIPT` | the analytics snippet, verbatim | nothing loaded |
|
|
1398
|
+
| `SITE_URL` | the address answers link to, path kept, ending in `/` | the site's own address |
|
|
1399
|
+
| `PUBLIC_URL` | this server's address, which a chat frames, ending in `/` | `http://localhost:<PORT>/` |
|
|
1400
|
+
| `TRUST_PROXY` | an address, a CIDR, a list of either, or `true`; a hop count throws | `false` |
|
|
1401
|
+
| `SERVER_ROOT` | the build served | the `root` option, or `dist` |
|
|
1402
|
+
| `BASE_PATH` | the mount, behind a proxy that takes it off | none |
|
|
1403
|
+
|
|
1404
|
+
The pieces are exported on their own for a backend that is not a tool site:
|
|
1405
|
+
`parseTrustProxy`, `readEnvNumber` (blank is unset, a malformed value throws),
|
|
1406
|
+
`readHttpAddress`, `readRepositoryVersion` (the root `package.json`, found as
|
|
1407
|
+
`cheminfoBuildInfo` finds it), `healthRoute` (`GET /health`, silent),
|
|
1408
|
+
`listenSite` (listen, and close on a signal, then run `onClose`), and the
|
|
1409
|
+
type-only `FastifyTyped` (`@fastify/type-provider-typebox` is an optional peer).
|
|
1410
|
+
|
|
1411
|
+
### A single-page app, served by its backend
|
|
1412
|
+
|
|
1413
|
+
A backend that serves a Vite single-page app answers every address the app
|
|
1414
|
+
routes with the built page, under the head of that address and a crawl path of
|
|
1415
|
+
its own. `spaSite` does that, and writes `sitemap.xml` and `robots.txt` from the
|
|
1416
|
+
route table at the address the site is served at; serves the build's files, with
|
|
1417
|
+
`assets/` kept for a year; leaves `/v1/` and `/docs` to the API; and answers
|
|
1418
|
+
`/health`.
|
|
1419
|
+
|
|
1420
|
+
```ts
|
|
1421
|
+
await app.register(spaSite, {
|
|
1422
|
+
root: join(import.meta.dirname, '../../frontend/dist'),
|
|
1423
|
+
site: 'wikidata',
|
|
1424
|
+
siteUrl: process.env.SITE_URL, // blank: the origin the request arrived on
|
|
1425
|
+
trackingScript: process.env.TRACKING_SCRIPT,
|
|
1426
|
+
noscript: { heading: 'wikidata.cheminfo.org', hrefs: 'relative' },
|
|
1427
|
+
// A compound under its own name; undefined falls back to the table.
|
|
1428
|
+
page: (url) => compoundPage(db, url),
|
|
1429
|
+
sitemapPaths: () => db.pageIds().map((id) => `/compound/${id}`),
|
|
1430
|
+
});
|
|
1431
|
+
```
|
|
1432
|
+
|
|
1433
|
+
The route table is the one the app reads, written beside the page at build time
|
|
1434
|
+
by `cheminfoRouteTable` from `react-cheminfo/vite`, which also runs
|
|
1435
|
+
`assertRoutes` when the build starts; `readRouteTable(root, fallback)` reads it
|
|
1436
|
+
back. `notFoundStatus: 404` with `knownRoute` answers an address the app does not
|
|
1437
|
+
route with a real 404, `structuredData` takes a function writing the whole block,
|
|
1438
|
+
and `indexed: false` keeps an admin site out of every index.
|
|
1439
|
+
|
|
1440
|
+
```ts
|
|
1441
|
+
// frontend/vite.config.ts
|
|
1442
|
+
plugins: [react(), cheminfoRouteTable({ routes: ROUTES })],
|
|
1443
|
+
```
|
|
1444
|
+
|
|
1445
|
+
### Writing to molecules.cheminfo.org
|
|
1446
|
+
|
|
1447
|
+
`createMoleculesClient` from `react-cheminfo/core` is the client a site writes
|
|
1448
|
+
its source through: `startImport`, `importState`, `submit`, `lookup` and
|
|
1449
|
+
`purge`, each attempt with its own deadline, retried on 429, 502, 503, 504 or no
|
|
1450
|
+
answer with doubling, spread pauses that honour `Retry-After`, bodies gzipped.
|
|
1451
|
+
It reads no Node module.
|
|
1452
|
+
|
|
1453
|
+
```ts
|
|
1454
|
+
const molecules = createMoleculesClient({
|
|
1455
|
+
baseUrl: 'https://molecules.cheminfo.org',
|
|
1456
|
+
token: process.env.MOLECULES_TOKEN_LOTUS,
|
|
1457
|
+
onRetry: (details) =>
|
|
1458
|
+
logger.warn(details, 'molecules.cheminfo.org: retrying'),
|
|
1459
|
+
});
|
|
1460
|
+
const { importKey } = await molecules.startImport();
|
|
1461
|
+
```
|
|
1462
|
+
|
|
1463
|
+
## Answers shown in a chat
|
|
1464
|
+
|
|
1465
|
+
A site's tool server answers mcp.cheminfo.org with a link to the page people
|
|
1466
|
+
share and a card: the same page on this server under `?embed=1&card=1`, which
|
|
1467
|
+
the chat frames inline, and the page itself over the full screen. The card and
|
|
1468
|
+
the page read the same parameters, so they never disagree about what was
|
|
1469
|
+
asked.
|
|
1470
|
+
|
|
1471
|
+
The server writes both addresses with `react-cheminfo/server`. `siteUrl` and
|
|
1472
|
+
`publicUrl` may be an origin or an origin and a mount, with or without a
|
|
1473
|
+
trailing slash, and a page is named from the site's own root: every helper
|
|
1474
|
+
joins them with exactly one slash.
|
|
1475
|
+
|
|
1476
|
+
```ts
|
|
1477
|
+
import {
|
|
1478
|
+
answerAddresses,
|
|
1479
|
+
cardMeta,
|
|
1480
|
+
pageAnswer,
|
|
1481
|
+
siteView,
|
|
1482
|
+
} from 'react-cheminfo/server';
|
|
1483
|
+
|
|
1484
|
+
const addresses = answerAddresses({ siteUrl, publicUrl });
|
|
1485
|
+
// { link: 'https://equilibrium.cheminfo.org/titration?ind=thymol', meta }
|
|
1486
|
+
const answer = pageAnswer(addresses, '/titration', { ind: 'thymol' });
|
|
1487
|
+
// A query written by the site's own codec, and what only the card reads.
|
|
1488
|
+
const meta = cardMeta(addresses, `/?${libraryQuery}`, {
|
|
1489
|
+
hide: ['editor'],
|
|
1490
|
+
extra: { rows: '10' },
|
|
1491
|
+
});
|
|
1492
|
+
const view = siteView({ uri: 'ui://vcl/page', name, description, addresses });
|
|
1493
|
+
```
|
|
1494
|
+
|
|
1495
|
+
A card address longer than `maxLength` (8000) is not carried: `meta` is then
|
|
1496
|
+
undefined and the chat draws the answer itself, while `link` still names the
|
|
1497
|
+
page. These helpers are built on `embedMeta` and `embedView`, so
|
|
1498
|
+
`cheminfo-mcp-server` (an optional peer) is installed by a site that imports
|
|
1499
|
+
`react-cheminfo/server`. The addresses alone — `CARD_PARAM`, `sitePageUrl`,
|
|
1500
|
+
`cardPageUrl`, `framedPageUrl` — are in `react-cheminfo/core`, for the page.
|
|
1501
|
+
|
|
1502
|
+
The card itself is drawn with `react-cheminfo/card` and
|
|
1503
|
+
`react-cheminfo/styles/card.css`:
|
|
1504
|
+
|
|
1505
|
+
```tsx
|
|
1506
|
+
import 'react-cheminfo/styles/card.css';
|
|
1507
|
+
import {
|
|
1508
|
+
CardDetailsButton,
|
|
1509
|
+
CardFigure,
|
|
1510
|
+
CardFrame,
|
|
1511
|
+
CopyTableButton,
|
|
1512
|
+
} from 'react-cheminfo/card';
|
|
1513
|
+
import { StructureExportButton } from 'react-cheminfo/structure';
|
|
1514
|
+
|
|
1515
|
+
<CardFrame>
|
|
1516
|
+
<p className="card__header card__title">pH 8.72 at equivalence</p>
|
|
1517
|
+
<CardFigure
|
|
1518
|
+
fileName="titration"
|
|
1519
|
+
tools={<StructureExportButton smiles={smiles} />}
|
|
1520
|
+
>
|
|
1521
|
+
<TitrationChart />
|
|
1522
|
+
</CardFigure>
|
|
1523
|
+
<div className="card__end">
|
|
1524
|
+
<CopyTableButton table={() => toDelimited(rows)} />
|
|
1525
|
+
<CardDetailsButton address={{ cardParams: ['scale', 'ph'] }} />
|
|
1526
|
+
</div>
|
|
1527
|
+
</CardFrame>;
|
|
1528
|
+
```
|
|
1529
|
+
|
|
1530
|
+
`CardFrame` reports the card's height to the frame and grows the card while a
|
|
1531
|
+
dialog or a popover it opened is open, so the frame holds it — only when the
|
|
1532
|
+
page is framed. A card that keeps its own root uses `ref={fitCardToFrame}`, or
|
|
1533
|
+
`useFitCardToFrame(ref)`. `CardDetailsButton` opens the card's address without
|
|
1534
|
+
`card`, `embed`, `hide` and the parameters only the card reads, in a new tab
|
|
1535
|
+
when framed and in place otherwise. Their words come from the chrome's
|
|
1536
|
+
catalog, in the language of the page.
|
|
1537
|
+
|
|
1256
1538
|
## Saying which build is running
|
|
1257
1539
|
|
|
1258
1540
|
A report of something going wrong is worth answering only when we know what was
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The card of an answer, as its address says it.
|
|
3
|
+
*
|
|
4
|
+
* A chat shows a tool's answer twice: inline, as a card drawing only what the
|
|
5
|
+
* question asked, and over the full screen, as the site's page. The card is
|
|
6
|
+
* that page with `card` in its query, always with `embed`, so the card and
|
|
7
|
+
* the page behind it read the same parameters and can never disagree about
|
|
8
|
+
* what was asked. `card` is read by its presence: `?card` and `?card=1` both
|
|
9
|
+
* ask for it.
|
|
10
|
+
*
|
|
11
|
+
* Pure string work: the page reads these addresses, and the tool server
|
|
12
|
+
* writes them, in Node.
|
|
13
|
+
*/
|
|
14
|
+
/** The parameter asking for the answer's card instead of the page. */
|
|
15
|
+
export declare const CARD_PARAM = "card";
|
|
16
|
+
/**
|
|
17
|
+
* Whether an address asks for a card.
|
|
18
|
+
* @param search - The query string, with or without its leading `?`.
|
|
19
|
+
* @returns True when it names `card`, with a value or bare.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isCardAddress(search: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The address a card is at: `globalThis.location`, a `URL`, or any record of
|
|
24
|
+
* the three parts.
|
|
25
|
+
*/
|
|
26
|
+
export interface CardLocation {
|
|
27
|
+
/** Its origin, e.g. `https://equilibrium.cheminfo.org`. */
|
|
28
|
+
readonly origin: string;
|
|
29
|
+
/** Its path, the mount and a language prefix included. */
|
|
30
|
+
readonly pathname: string;
|
|
31
|
+
/** Its query string, with or without its `?`. */
|
|
32
|
+
readonly search: string;
|
|
33
|
+
}
|
|
34
|
+
/** How {@link sitePageUrl} tells the card's parameters from the page's. */
|
|
35
|
+
export interface SitePageOptions {
|
|
36
|
+
/**
|
|
37
|
+
* The parameters only the site's card reads, beside `card` itself: what a
|
|
38
|
+
* card draws beyond the page, e.g. `['rows']`, `['scale', 'ph']`.
|
|
39
|
+
* @default []
|
|
40
|
+
*/
|
|
41
|
+
cardParams?: readonly string[];
|
|
42
|
+
/**
|
|
43
|
+
* Read a `+` in a key as a plus rather than as a space, as
|
|
44
|
+
* `parseQueryEntries` does. A key carries no `+` on any site of the family,
|
|
45
|
+
* so this only matters to a site that writes its own addresses with
|
|
46
|
+
* `URLSearchParams`.
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
literalPlus?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* A parameter the page at a given path does not read, though another page
|
|
52
|
+
* of the site does: a tutorial step reads no InChI, the converter does.
|
|
53
|
+
* @default undefined - nothing beyond `card`, `embed`, `hide` and
|
|
54
|
+
* `cardParams` is left out
|
|
55
|
+
*/
|
|
56
|
+
isCardOnly?: (key: string, pathname: string) => boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The site's own page a card stands for, with its chrome: the card's address
|
|
60
|
+
* without `card`, `embed`, `hide` and what only the card reads. Every other
|
|
61
|
+
* parameter is kept exactly as it was written, so the `+` of a charged atom
|
|
62
|
+
* stays a plus and the commas of a list stay commas. This is the address an
|
|
63
|
+
* answer's `link` names, and the one the card's Details button opens.
|
|
64
|
+
* @param location - The card's address: `globalThis.location`, or
|
|
65
|
+
* `new URL(href)` for an address held as text.
|
|
66
|
+
* @param options - What only the site's card reads.
|
|
67
|
+
* @returns The page's absolute address, without a fragment.
|
|
68
|
+
*/
|
|
69
|
+
export declare function sitePageUrl(location: CardLocation, options?: SitePageOptions): string;
|
|
70
|
+
//# sourceMappingURL=cardAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardAddress.d.ts","sourceRoot":"","sources":["../../../src/card/core/cardAddress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,sEAAsE;AACtE,eAAO,MAAM,UAAU,SAAS,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKrD;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,2EAA2E;AAC3E,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,eAAoB,GAC5B,MAAM,CAeR"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The card of an answer, as its address says it.
|
|
3
|
+
*
|
|
4
|
+
* A chat shows a tool's answer twice: inline, as a card drawing only what the
|
|
5
|
+
* question asked, and over the full screen, as the site's page. The card is
|
|
6
|
+
* that page with `card` in its query, always with `embed`, so the card and
|
|
7
|
+
* the page behind it read the same parameters and can never disagree about
|
|
8
|
+
* what was asked. `card` is read by its presence: `?card` and `?card=1` both
|
|
9
|
+
* ask for it.
|
|
10
|
+
*
|
|
11
|
+
* Pure string work: the page reads these addresses, and the tool server
|
|
12
|
+
* writes them, in Node.
|
|
13
|
+
*/
|
|
14
|
+
import { parseQueryEntries } from "../../router/core/query.js";
|
|
15
|
+
import { EMBED_PARAM, HIDE_PARAM } from "../../share/core/config.js";
|
|
16
|
+
/** The parameter asking for the answer's card instead of the page. */
|
|
17
|
+
export const CARD_PARAM = 'card';
|
|
18
|
+
/**
|
|
19
|
+
* Whether an address asks for a card.
|
|
20
|
+
* @param search - The query string, with or without its leading `?`.
|
|
21
|
+
* @returns True when it names `card`, with a value or bare.
|
|
22
|
+
*/
|
|
23
|
+
export function isCardAddress(search) {
|
|
24
|
+
for (const [key] of parseQueryEntries(search)) {
|
|
25
|
+
if (key === CARD_PARAM)
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The site's own page a card stands for, with its chrome: the card's address
|
|
32
|
+
* without `card`, `embed`, `hide` and what only the card reads. Every other
|
|
33
|
+
* parameter is kept exactly as it was written, so the `+` of a charged atom
|
|
34
|
+
* stays a plus and the commas of a list stay commas. This is the address an
|
|
35
|
+
* answer's `link` names, and the one the card's Details button opens.
|
|
36
|
+
* @param location - The card's address: `globalThis.location`, or
|
|
37
|
+
* `new URL(href)` for an address held as text.
|
|
38
|
+
* @param options - What only the site's card reads.
|
|
39
|
+
* @returns The page's absolute address, without a fragment.
|
|
40
|
+
*/
|
|
41
|
+
export function sitePageUrl(location, options = {}) {
|
|
42
|
+
const { cardParams = [], literalPlus = true, isCardOnly } = options;
|
|
43
|
+
const dropped = new Set([CARD_PARAM, EMBED_PARAM, HIDE_PARAM, ...cardParams]);
|
|
44
|
+
const kept = [];
|
|
45
|
+
const search = location.search.startsWith('?')
|
|
46
|
+
? location.search.slice(1)
|
|
47
|
+
: location.search;
|
|
48
|
+
for (const part of search.split('&')) {
|
|
49
|
+
const [entry] = parseQueryEntries(part, { literalPlus });
|
|
50
|
+
if (entry === undefined || dropped.has(entry[0]))
|
|
51
|
+
continue;
|
|
52
|
+
if (isCardOnly?.(entry[0], location.pathname))
|
|
53
|
+
continue;
|
|
54
|
+
kept.push(part);
|
|
55
|
+
}
|
|
56
|
+
const query = kept.join('&');
|
|
57
|
+
return `${location.origin}${location.pathname}${query === '' ? '' : `?${query}`}`;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=cardAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardAddress.js","sourceRoot":"","sources":["../../../src/card/core/cardAddress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAErE,sEAAsE;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,IAAI,GAAG,KAAK,UAAU;YAAE,OAAO,IAAI,CAAC;IACtC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAwCD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACzB,QAAsB,EACtB,UAA2B,EAAE;IAE7B,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,WAAW,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACpE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC;IAC9E,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;QAC5C,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QACzD,IAAI,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,SAAS;QAC3D,IAAI,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAAE,SAAS;QACxD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,QAAQ,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,EAAE,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two addresses a chat frames for one answer: the card, inline, and the
|
|
3
|
+
* page itself, over the full screen. Both are the site's page under `embed`,
|
|
4
|
+
* so neither carries the site's chrome; the card adds `card` and what only it
|
|
5
|
+
* reads.
|
|
6
|
+
*/
|
|
7
|
+
/** How {@link framedPageUrl} frames a page. */
|
|
8
|
+
export interface FramedPageOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The parts of the page left out, on the card and on the full page alike:
|
|
11
|
+
* keys of the site's `hide` vocabulary, written `hide=a,b`.
|
|
12
|
+
* @default []
|
|
13
|
+
*/
|
|
14
|
+
hide?: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/** What {@link cardPageUrl} adds to the framed page. */
|
|
17
|
+
export interface CardPageOptions extends FramedPageOptions {
|
|
18
|
+
/**
|
|
19
|
+
* What `card` carries, for a site whose page draws more than one card:
|
|
20
|
+
* wikidata's `card=infobox`.
|
|
21
|
+
* @default '1'
|
|
22
|
+
*/
|
|
23
|
+
card?: string;
|
|
24
|
+
/**
|
|
25
|
+
* What only the card reads, written after `card` in the order given, e.g.
|
|
26
|
+
* `{ rows: '10' }`. A value left `undefined` or empty is not written.
|
|
27
|
+
* @default {}
|
|
28
|
+
*/
|
|
29
|
+
extra?: Readonly<Record<string, string | undefined>>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The page under `embed=1`, and `hide` when parts are left out: what a chat
|
|
33
|
+
* shows over the full screen when the reader asks for more than the card.
|
|
34
|
+
* @param page - The site's page as people open it, with its own query and
|
|
35
|
+
* without `embed`, `hide` or `card`; absolute, or a path.
|
|
36
|
+
* @param options - The parts left out.
|
|
37
|
+
* @returns The framed page's address.
|
|
38
|
+
*/
|
|
39
|
+
export declare function framedPageUrl(page: string, options?: FramedPageOptions): string;
|
|
40
|
+
/**
|
|
41
|
+
* The card of an answer: the framed page with `card`, and what only the card
|
|
42
|
+
* reads after it.
|
|
43
|
+
* @param page - The site's page as people open it, with its own query and
|
|
44
|
+
* without `embed`, `hide` or `card`; absolute, or a path.
|
|
45
|
+
* @param options - The parts left out, and what the card draws.
|
|
46
|
+
* @returns The card's address.
|
|
47
|
+
*/
|
|
48
|
+
export declare function cardPageUrl(page: string, options?: CardPageOptions): string;
|
|
49
|
+
//# sourceMappingURL=cardPageUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardPageUrl.d.ts","sourceRoot":"","sources":["../../../src/card/core/cardPageUrl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED,wDAAwD;AACxD,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACtD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CAKR;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAoB,GAC5B,MAAM,CAOR"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two addresses a chat frames for one answer: the card, inline, and the
|
|
3
|
+
* page itself, over the full screen. Both are the site's page under `embed`,
|
|
4
|
+
* so neither carries the site's chrome; the card adds `card` and what only it
|
|
5
|
+
* reads.
|
|
6
|
+
*/
|
|
7
|
+
import { formatQueryEntries } from "../../router/core/query.js";
|
|
8
|
+
import { EMBED_PARAM, HIDE_PARAM } from "../../share/core/config.js";
|
|
9
|
+
import { CARD_PARAM } from "./cardAddress.js";
|
|
10
|
+
/**
|
|
11
|
+
* The page under `embed=1`, and `hide` when parts are left out: what a chat
|
|
12
|
+
* shows over the full screen when the reader asks for more than the card.
|
|
13
|
+
* @param page - The site's page as people open it, with its own query and
|
|
14
|
+
* without `embed`, `hide` or `card`; absolute, or a path.
|
|
15
|
+
* @param options - The parts left out.
|
|
16
|
+
* @returns The framed page's address.
|
|
17
|
+
*/
|
|
18
|
+
export function framedPageUrl(page, options = {}) {
|
|
19
|
+
const { hide = [] } = options;
|
|
20
|
+
const entries = [[EMBED_PARAM, '1']];
|
|
21
|
+
if (hide.length > 0)
|
|
22
|
+
entries.push([HIDE_PARAM, hide.join(',')]);
|
|
23
|
+
return withQueryEntries(page, entries);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The card of an answer: the framed page with `card`, and what only the card
|
|
27
|
+
* reads after it.
|
|
28
|
+
* @param page - The site's page as people open it, with its own query and
|
|
29
|
+
* without `embed`, `hide` or `card`; absolute, or a path.
|
|
30
|
+
* @param options - The parts left out, and what the card draws.
|
|
31
|
+
* @returns The card's address.
|
|
32
|
+
*/
|
|
33
|
+
export function cardPageUrl(page, options = {}) {
|
|
34
|
+
const { card = '1', extra = {} } = options;
|
|
35
|
+
const entries = [[CARD_PARAM, card]];
|
|
36
|
+
for (const [key, value] of Object.entries(extra)) {
|
|
37
|
+
if (value !== undefined && value !== '')
|
|
38
|
+
entries.push([key, value]);
|
|
39
|
+
}
|
|
40
|
+
return withQueryEntries(framedPageUrl(page, options), entries);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Append parameters to an address, before its fragment.
|
|
44
|
+
* @param address - The address, with or without a query.
|
|
45
|
+
* @param entries - The parameters, in the order they are written.
|
|
46
|
+
* @returns The address carrying them.
|
|
47
|
+
*/
|
|
48
|
+
function withQueryEntries(address, entries) {
|
|
49
|
+
const hashIndex = address.indexOf('#');
|
|
50
|
+
const head = hashIndex === -1 ? address : address.slice(0, hashIndex);
|
|
51
|
+
const fragment = hashIndex === -1 ? '' : address.slice(hashIndex);
|
|
52
|
+
const separator = head.includes('?')
|
|
53
|
+
? head.endsWith('?') || head.endsWith('&')
|
|
54
|
+
? ''
|
|
55
|
+
: '&'
|
|
56
|
+
: '?';
|
|
57
|
+
return `${head}${separator}${formatQueryEntries(entries)}${fragment}`;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=cardPageUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardPageUrl.js","sourceRoot":"","sources":["../../../src/card/core/cardPageUrl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA4B9C;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAY,EACZ,UAA6B,EAAE;IAE/B,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAC9B,MAAM,OAAO,GAAiB,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;IACnD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChE,OAAO,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,IAAY,EACZ,UAA2B,EAAE;IAE7B,MAAM,EAAE,IAAI,GAAG,GAAG,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAC3C,MAAM,OAAO,GAAiB,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;IACnD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,gBAAgB,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,SAAS,gBAAgB,CACvB,OAAe,EACf,OAA8B;IAE9B,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACtE,MAAM,QAAQ,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAClC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YACxC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,GAAG;QACP,CAAC,CAAC,GAAG,CAAC;IACR,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,QAAQ,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { CardLocation, SitePageOptions } from './cardAddress.ts';
|
|
2
|
+
export { CARD_PARAM, isCardAddress, sitePageUrl } from './cardAddress.ts';
|
|
3
|
+
export type { CardPageOptions, FramedPageOptions } from './cardPageUrl.ts';
|
|
4
|
+
export { cardPageUrl, framedPageUrl } from './cardPageUrl.ts';
|
|
5
|
+
export type { OpenPanel } from './panelRoom.ts';
|
|
6
|
+
export { roomForPanels } from './panelRoom.ts';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/card/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/card/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|