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
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { toError } from "../../error/core/toError.js";
|
|
2
|
+
/**
|
|
3
|
+
* The pieces of a request that is tried again: its deadline, the pause the
|
|
4
|
+
* server asks for, what an error answer says, and what a failed fetch says.
|
|
5
|
+
* Browser-safe: no Node module is read.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The signal one attempt runs under: the caller's, and its own deadline.
|
|
9
|
+
* @param signal - The caller's, if any.
|
|
10
|
+
* @param timeoutMs - How long the attempt may take.
|
|
11
|
+
* @returns The signal.
|
|
12
|
+
*/
|
|
13
|
+
export function requestSignal(signal, timeoutMs) {
|
|
14
|
+
const timeout = AbortSignal.timeout(timeoutMs);
|
|
15
|
+
return signal === undefined ? timeout : AbortSignal.any([signal, timeout]);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* How long a `Retry-After` header asks to wait.
|
|
19
|
+
* @param header - Its value: seconds, or an HTTP date.
|
|
20
|
+
* @param now - The current instant, in epoch milliseconds.
|
|
21
|
+
* @returns The pause in milliseconds, or `undefined` when there is none to read.
|
|
22
|
+
*/
|
|
23
|
+
export function retryAfter(header, now) {
|
|
24
|
+
if (header === null || header.trim() === '')
|
|
25
|
+
return undefined;
|
|
26
|
+
const seconds = Number(header);
|
|
27
|
+
if (Number.isFinite(seconds))
|
|
28
|
+
return Math.max(0, seconds * 1000);
|
|
29
|
+
const date = Date.parse(header);
|
|
30
|
+
return Number.isNaN(date) ? undefined : Math.max(0, date - now);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The message of an error body Fastify wrote, or the body itself.
|
|
34
|
+
* @param text - The body.
|
|
35
|
+
* @returns The message, or `undefined` when the body is empty.
|
|
36
|
+
*/
|
|
37
|
+
export function messageOf(text) {
|
|
38
|
+
if (text.trim() === '')
|
|
39
|
+
return undefined;
|
|
40
|
+
try {
|
|
41
|
+
const body = JSON.parse(text);
|
|
42
|
+
if (typeof body?.message === 'string')
|
|
43
|
+
return body.message;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return text.slice(0, 500);
|
|
47
|
+
}
|
|
48
|
+
return text.slice(0, 500);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* What a failed fetch says, its cause included: undici reports a refused
|
|
52
|
+
* connection as `fetch failed` with the reason in `cause` — and when several
|
|
53
|
+
* addresses were tried, in the first error of an AggregateError whose own
|
|
54
|
+
* message is empty.
|
|
55
|
+
* @param error - What was thrown.
|
|
56
|
+
* @returns The message, e.g. `fetch failed: connect ECONNREFUSED 127.0.0.1:11980`.
|
|
57
|
+
*/
|
|
58
|
+
export function causeOf(error) {
|
|
59
|
+
if (!(error instanceof Error))
|
|
60
|
+
return String(error);
|
|
61
|
+
const { cause, message } = error;
|
|
62
|
+
if (!(cause instanceof Error))
|
|
63
|
+
return message;
|
|
64
|
+
const first = cause instanceof AggregateError ? cause.errors[0] : undefined;
|
|
65
|
+
const code = cause.code;
|
|
66
|
+
const detail = cause.message ||
|
|
67
|
+
(first instanceof Error ? first.message : '') ||
|
|
68
|
+
(typeof code === 'string' ? code : '') ||
|
|
69
|
+
cause.name;
|
|
70
|
+
return `${message}: ${detail}`;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A request body gzipped, as HTTP's `Content-Encoding: gzip` carries it: a
|
|
74
|
+
* batch of molfiles shrinks several times over.
|
|
75
|
+
* @param text - The body, written out.
|
|
76
|
+
* @returns The gzipped bytes.
|
|
77
|
+
*/
|
|
78
|
+
export async function gzipBody(text) {
|
|
79
|
+
const stream = new Blob([text])
|
|
80
|
+
.stream()
|
|
81
|
+
.pipeThrough(new CompressionStream('gzip'));
|
|
82
|
+
return new Uint8Array(await new Response(stream).arrayBuffer());
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Wait, unless the signal stops the wait first.
|
|
86
|
+
* @param milliseconds - How long.
|
|
87
|
+
* @param signal - What stops it, if anything.
|
|
88
|
+
* @returns When the time has passed.
|
|
89
|
+
* @throws {unknown} The signal's reason, when it aborts first.
|
|
90
|
+
*/
|
|
91
|
+
export function pause(milliseconds, signal) {
|
|
92
|
+
return new Promise((done, fail) => {
|
|
93
|
+
if (signal?.aborted) {
|
|
94
|
+
fail(toError(signal.reason));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const abort = () => {
|
|
98
|
+
clearTimeout(timer);
|
|
99
|
+
fail(toError(signal?.reason));
|
|
100
|
+
};
|
|
101
|
+
const timer = setTimeout(() => {
|
|
102
|
+
signal?.removeEventListener('abort', abort);
|
|
103
|
+
done();
|
|
104
|
+
}, milliseconds);
|
|
105
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=requestRetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestRetry.js","sourceRoot":"","sources":["../../../src/moleculesClient/core/requestRetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,MAA+B,EAC/B,SAAiB;IAEjB,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/C,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,MAAqB,EACrB,GAAW;IAEX,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAC9D,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC,CAAC;IACjE,MAAM,IAAI,GAAG,IAAI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C;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -24,9 +24,10 @@ export declare const MINIMUM_FRAMING_RADIUS = 0.5;
|
|
|
24
24
|
* measured against — so reading a camera and applying it are the same move in
|
|
25
25
|
* opposite directions.
|
|
26
26
|
* @param radius - Radius of the scene's visible bounding sphere.
|
|
27
|
+
* @param margin - Fraction of the radius kept as breathing room.
|
|
27
28
|
* @returns The framed radius.
|
|
28
29
|
*/
|
|
29
|
-
export declare function framedRadius(radius: number): number;
|
|
30
|
+
export declare function framedRadius(radius: number, margin?: number): number;
|
|
30
31
|
/**
|
|
31
32
|
* Turn the automatic spin on or off. It moves the camera, never the object.
|
|
32
33
|
* @param plugin - The molstar context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/camera.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAK1C
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/camera.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAK1C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,SAAiB,GAAG,MAAM,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,OAAO,EACjB,KAAK,SAAqB,GACzB,IAAI,CAQN"}
|
|
@@ -26,10 +26,11 @@ const SPIN_AXIS = Vec3.create(0, 1, 0);
|
|
|
26
26
|
* measured against — so reading a camera and applying it are the same move in
|
|
27
27
|
* opposite directions.
|
|
28
28
|
* @param radius - Radius of the scene's visible bounding sphere.
|
|
29
|
+
* @param margin - Fraction of the radius kept as breathing room.
|
|
29
30
|
* @returns The framed radius.
|
|
30
31
|
*/
|
|
31
|
-
export function framedRadius(radius) {
|
|
32
|
-
return Math.max(radius * (1 +
|
|
32
|
+
export function framedRadius(radius, margin = FRAMING_MARGIN) {
|
|
33
|
+
return Math.max(radius * (1 + margin), MINIMUM_FRAMING_RADIUS);
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* Turn the automatic spin on or off. It moves the camera, never the object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../../../src/molstar/core/camera.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;AAG9D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,gFAAgF;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,uEAAuE;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C,sDAAsD;AACtD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../../../src/molstar/core/camera.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;AAG9D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,gFAAgF;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,uEAAuE;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C,sDAAsD;AACtD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,MAAM,GAAG,cAAc;IAClE,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,sBAAsB,CAAC,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CACrB,MAAqB,EACrB,QAAiB,EACjB,KAAK,GAAG,kBAAkB;IAE1B,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC;QACxB,SAAS,EAAE;YACT,OAAO,EAAE,QAAQ;gBACf,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;gBACtD,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;SAChC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framing a scene: the sphere everything on screen fits in, the camera moved
|
|
3
|
+
* to show it whole, and the zoom onto one point of it.
|
|
4
|
+
*
|
|
5
|
+
* What is on screen is measured rather than read off molstar: a canvas's own
|
|
6
|
+
* `boundingSphereVisible` is read once when the canvas is built, a
|
|
7
|
+
* ball-and-stick representation pads its sphere by the largest ball it could
|
|
8
|
+
* ever draw, and an isosurface reports the whole sampled box. So a site hands
|
|
9
|
+
* the spheres it measured itself, and names which render objects are worth
|
|
10
|
+
* their own sphere — a mesh it built, whose sphere is exactly its vertices.
|
|
11
|
+
*/
|
|
12
|
+
import type { GraphicsRenderObject } from 'molstar/lib/mol-gl/render-object.js';
|
|
13
|
+
import { Sphere3D } from 'molstar/lib/mol-math/geometry.js';
|
|
14
|
+
import type { PluginContext } from 'molstar/lib/mol-plugin/context.js';
|
|
15
|
+
/**
|
|
16
|
+
* Frame everything on screen.
|
|
17
|
+
*
|
|
18
|
+
* Without an orientation the camera keeps the direction it already points in,
|
|
19
|
+
* which is what a reframe after a reader turned the scene must do. A scene with
|
|
20
|
+
* nothing measured is framed by molstar's own reset.
|
|
21
|
+
* @param plugin - The molstar context.
|
|
22
|
+
* @param options - What to frame, from where, and how fast.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resetCamera(plugin: PluginContext, options?: ResetCameraOptions): void;
|
|
25
|
+
/**
|
|
26
|
+
* Frame one ball of the scene: an atom picked, the centre of a bond, the
|
|
27
|
+
* whole scene.
|
|
28
|
+
*
|
|
29
|
+
* The canvas is committed first — `add()` only queues, and a queued object
|
|
30
|
+
* belongs to no bounding sphere yet — and the ball is framed with no padding
|
|
31
|
+
* of molstar's own, whose 4 Å default leaves water a twentieth of the canvas.
|
|
32
|
+
* @param plugin - The molstar context.
|
|
33
|
+
* @param centre - What to frame, Cartesian ångström.
|
|
34
|
+
* @param radius - Radius of the ball to fit, ångström.
|
|
35
|
+
* @param options - From where, and how fast.
|
|
36
|
+
*/
|
|
37
|
+
export declare function focusPoint(plugin: PluginContext, centre: Point3, radius: number, options?: FocusOptions): void;
|
|
38
|
+
/**
|
|
39
|
+
* The one sphere everything worth framing fits in: the spheres a site
|
|
40
|
+
* measured itself, and those of the render objects it names.
|
|
41
|
+
* @param plugin - The molstar context.
|
|
42
|
+
* @param options - The measured spheres, and which render objects count.
|
|
43
|
+
* @returns The sphere, or `null` when nothing was measured.
|
|
44
|
+
*/
|
|
45
|
+
export declare function sceneSphere(plugin: PluginContext, options?: SceneSphereOptions): Sphere3D | null;
|
|
46
|
+
/**
|
|
47
|
+
* The smallest sphere holding a set of spheres, as molstar's own camera
|
|
48
|
+
* manager computes it.
|
|
49
|
+
* @param spheres - The spheres to hold.
|
|
50
|
+
* @returns It, the one sphere itself when there is one, `null` when there is none.
|
|
51
|
+
*/
|
|
52
|
+
export declare function unionSphere(spheres: readonly Sphere3D[]): Sphere3D | null;
|
|
53
|
+
/** A point in Cartesian ångström. */
|
|
54
|
+
export type Point3 = readonly [x: number, y: number, z: number];
|
|
55
|
+
/** Where the camera stands to look at a scene. */
|
|
56
|
+
export interface ViewOrientation {
|
|
57
|
+
/** The direction from what is looked at to the eye. */
|
|
58
|
+
eye: Point3;
|
|
59
|
+
/** The direction that is up on screen. */
|
|
60
|
+
up: Point3;
|
|
61
|
+
}
|
|
62
|
+
/** How {@link focusPoint} moves the camera. */
|
|
63
|
+
export interface FocusOptions {
|
|
64
|
+
/**
|
|
65
|
+
* Transition length, in milliseconds; 0 jumps.
|
|
66
|
+
* @default 250
|
|
67
|
+
*/
|
|
68
|
+
durationMs?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Where to look from.
|
|
71
|
+
* @default undefined — the direction the camera already points in
|
|
72
|
+
*/
|
|
73
|
+
orientation?: ViewOrientation;
|
|
74
|
+
}
|
|
75
|
+
/** What {@link sceneSphere} measures. */
|
|
76
|
+
export interface SceneSphereOptions {
|
|
77
|
+
/**
|
|
78
|
+
* Spheres the site measured itself: a model from its own atoms, a part of
|
|
79
|
+
* the scene registered as it was drawn.
|
|
80
|
+
* @default []
|
|
81
|
+
*/
|
|
82
|
+
spheres?: readonly Sphere3D[];
|
|
83
|
+
/**
|
|
84
|
+
* Which render objects of the canvas count with their own sphere.
|
|
85
|
+
* @default undefined — none does
|
|
86
|
+
*/
|
|
87
|
+
include?: (object: GraphicsRenderObject) => boolean;
|
|
88
|
+
}
|
|
89
|
+
/** What {@link resetCamera} frames, and how. */
|
|
90
|
+
export interface ResetCameraOptions extends SceneSphereOptions, FocusOptions {
|
|
91
|
+
/**
|
|
92
|
+
* The sphere to frame, measured by the caller, instead of the scene's.
|
|
93
|
+
* @default undefined — the sphere `sceneSphere` measures
|
|
94
|
+
*/
|
|
95
|
+
sphere?: Sphere3D | null;
|
|
96
|
+
/**
|
|
97
|
+
* Fraction of the radius kept as breathing room around the scene.
|
|
98
|
+
* @default 0.08
|
|
99
|
+
*/
|
|
100
|
+
margin?: number;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=framing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/framing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AASvE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,kBAAuB,GAC/B,IAAI,CAgBN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,YAAiB,GACzB,IAAI,CAyBN;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,kBAAuB,GAC/B,QAAQ,GAAG,IAAI,CAgBjB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,SAAS,QAAQ,EAAE,GAAG,QAAQ,GAAG,IAAI,CASzE;AAED,qCAAqC;AACrC,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAEhE,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,yCAAyC;AACzC,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC;CACrD;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB,EAAE,YAAY;IAC1E;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framing a scene: the sphere everything on screen fits in, the camera moved
|
|
3
|
+
* to show it whole, and the zoom onto one point of it.
|
|
4
|
+
*
|
|
5
|
+
* What is on screen is measured rather than read off molstar: a canvas's own
|
|
6
|
+
* `boundingSphereVisible` is read once when the canvas is built, a
|
|
7
|
+
* ball-and-stick representation pads its sphere by the largest ball it could
|
|
8
|
+
* ever draw, and an isosurface reports the whole sampled box. So a site hands
|
|
9
|
+
* the spheres it measured itself, and names which render objects are worth
|
|
10
|
+
* their own sphere — a mesh it built, whose sphere is exactly its vertices.
|
|
11
|
+
*/
|
|
12
|
+
import { BoundaryHelper } from 'molstar/lib/mol-math/geometry/boundary-helper.js';
|
|
13
|
+
import { Sphere3D } from 'molstar/lib/mol-math/geometry.js';
|
|
14
|
+
import { Vec3 } from 'molstar/lib/mol-math/linear-algebra.js';
|
|
15
|
+
import { DEFAULT_CAMERA_DURATION, FRAMING_MARGIN, MINIMUM_FRAMING_RADIUS, framedRadius, } from "./camera.js";
|
|
16
|
+
/**
|
|
17
|
+
* Frame everything on screen.
|
|
18
|
+
*
|
|
19
|
+
* Without an orientation the camera keeps the direction it already points in,
|
|
20
|
+
* which is what a reframe after a reader turned the scene must do. A scene with
|
|
21
|
+
* nothing measured is framed by molstar's own reset.
|
|
22
|
+
* @param plugin - The molstar context.
|
|
23
|
+
* @param options - What to frame, from where, and how fast.
|
|
24
|
+
*/
|
|
25
|
+
export function resetCamera(plugin, options = {}) {
|
|
26
|
+
const { durationMs = DEFAULT_CAMERA_DURATION, margin = FRAMING_MARGIN } = options;
|
|
27
|
+
const { sphere, orientation } = options;
|
|
28
|
+
plugin.canvas3d?.commit(true);
|
|
29
|
+
const scene = sphere === undefined ? sceneSphere(plugin, options) : sphere;
|
|
30
|
+
if (scene === null || scene.radius <= 0) {
|
|
31
|
+
plugin.managers.camera.reset(undefined, durationMs);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const { center, radius } = scene;
|
|
35
|
+
const [x = 0, y = 0, z = 0] = center;
|
|
36
|
+
focusPoint(plugin, [x, y, z], framedRadius(radius, margin), {
|
|
37
|
+
durationMs,
|
|
38
|
+
orientation,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Frame one ball of the scene: an atom picked, the centre of a bond, the
|
|
43
|
+
* whole scene.
|
|
44
|
+
*
|
|
45
|
+
* The canvas is committed first — `add()` only queues, and a queued object
|
|
46
|
+
* belongs to no bounding sphere yet — and the ball is framed with no padding
|
|
47
|
+
* of molstar's own, whose 4 Å default leaves water a twentieth of the canvas.
|
|
48
|
+
* @param plugin - The molstar context.
|
|
49
|
+
* @param centre - What to frame, Cartesian ångström.
|
|
50
|
+
* @param radius - Radius of the ball to fit, ångström.
|
|
51
|
+
* @param options - From where, and how fast.
|
|
52
|
+
*/
|
|
53
|
+
export function focusPoint(plugin, centre, radius, options = {}) {
|
|
54
|
+
const { durationMs = DEFAULT_CAMERA_DURATION, orientation } = options;
|
|
55
|
+
plugin.canvas3d?.commit(true);
|
|
56
|
+
const target = Vec3.create(centre[0], centre[1], centre[2]);
|
|
57
|
+
const camera = plugin.canvas3d?.camera;
|
|
58
|
+
if (orientation !== undefined && camera !== undefined) {
|
|
59
|
+
// `getFocus` only matches the sign of a direction against the current
|
|
60
|
+
// camera; `getInvariantFocus` takes the direction and the up as given.
|
|
61
|
+
const { eye, up } = orientation;
|
|
62
|
+
plugin.managers.camera.setSnapshot(camera.getInvariantFocus(target, Math.max(radius, MINIMUM_FRAMING_RADIUS), Vec3.create(up[0], up[1], up[2]), Vec3.create(-eye[0], -eye[1], -eye[2])), durationMs);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
plugin.managers.camera.focusSphere(Sphere3D.create(target, radius), {
|
|
66
|
+
extraRadius: 0,
|
|
67
|
+
minRadius: MINIMUM_FRAMING_RADIUS,
|
|
68
|
+
durationMs,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The one sphere everything worth framing fits in: the spheres a site
|
|
73
|
+
* measured itself, and those of the render objects it names.
|
|
74
|
+
* @param plugin - The molstar context.
|
|
75
|
+
* @param options - The measured spheres, and which render objects count.
|
|
76
|
+
* @returns The sphere, or `null` when nothing was measured.
|
|
77
|
+
*/
|
|
78
|
+
export function sceneSphere(plugin, options = {}) {
|
|
79
|
+
const spheres = [];
|
|
80
|
+
for (const sphere of options.spheres ?? []) {
|
|
81
|
+
if (sphere.radius > 0)
|
|
82
|
+
spheres.push(sphere);
|
|
83
|
+
}
|
|
84
|
+
const { include } = options;
|
|
85
|
+
const canvas3d = plugin.canvas3d;
|
|
86
|
+
if (include !== undefined && canvas3d !== undefined) {
|
|
87
|
+
canvas3d.commit(true);
|
|
88
|
+
for (const object of canvas3d.getRenderObjects()) {
|
|
89
|
+
if (!include(object))
|
|
90
|
+
continue;
|
|
91
|
+
const sphere = object.values.boundingSphere.ref.value;
|
|
92
|
+
if (sphere.radius > 0)
|
|
93
|
+
spheres.push(sphere);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return unionSphere(spheres);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The smallest sphere holding a set of spheres, as molstar's own camera
|
|
100
|
+
* manager computes it.
|
|
101
|
+
* @param spheres - The spheres to hold.
|
|
102
|
+
* @returns It, the one sphere itself when there is one, `null` when there is none.
|
|
103
|
+
*/
|
|
104
|
+
export function unionSphere(spheres) {
|
|
105
|
+
const first = spheres[0];
|
|
106
|
+
if (first === undefined)
|
|
107
|
+
return null;
|
|
108
|
+
if (spheres.length === 1)
|
|
109
|
+
return first;
|
|
110
|
+
boundary.reset();
|
|
111
|
+
for (const sphere of spheres)
|
|
112
|
+
boundary.includeSphere(sphere);
|
|
113
|
+
boundary.finishedIncludeStep();
|
|
114
|
+
for (const sphere of spheres)
|
|
115
|
+
boundary.radiusSphere(sphere);
|
|
116
|
+
return boundary.getSphere();
|
|
117
|
+
}
|
|
118
|
+
// Reused across calls, as molstar's own camera manager does.
|
|
119
|
+
const boundary = new BoundaryHelper('98');
|
|
120
|
+
//# sourceMappingURL=framing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framing.js","sourceRoot":"","sources":["../../../src/molstar/core/framing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;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QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5D,OAAO,QAAQ,CAAC,SAAS,EAAE,CAAC;AAC9B,CAAC;AAwDD,6DAA6D;AAC7D,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -17,6 +17,22 @@ import type { PluginContext } from 'molstar/lib/mol-plugin/context.js';
|
|
|
17
17
|
* @returns The unsubscribe function.
|
|
18
18
|
*/
|
|
19
19
|
export declare function subscribeHover(plugin: PluginContext, listener: (loci: Loci | null) => void): () => void;
|
|
20
|
+
/** What the pointer rests on, in a line, and the loci it names. */
|
|
21
|
+
export interface HoverLabel {
|
|
22
|
+
/** `O 1`, `Si 4 — O 8`, or the label a drawing of the site carries. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** The loci, for a site that wants more of it — the atom it holds, say. */
|
|
25
|
+
loci: Loci;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Report the label of whatever the pointer rests on: an atom named as a
|
|
29
|
+
* reader would name it, anything else by the label it was drawn with.
|
|
30
|
+
* @param plugin - The molstar context.
|
|
31
|
+
* @param listener - Called with the label and its loci, or `null` when the
|
|
32
|
+
* pointer leaves everything or rests on something with nothing to say.
|
|
33
|
+
* @returns The unsubscribe function.
|
|
34
|
+
*/
|
|
35
|
+
export declare function subscribeHoverLabel(plugin: PluginContext, listener: (hover: HoverLabel | null) => void): () => void;
|
|
20
36
|
/**
|
|
21
37
|
* The one line a loci is worth, in molstar's own words.
|
|
22
38
|
* @param loci - What the pointer is over.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/hover.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAO1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGvE;;;;;;;GAOG;AAC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C,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAiBlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI/D"}
|
|
@@ -26,6 +26,20 @@ export function subscribeHover(plugin, listener) {
|
|
|
26
26
|
subscription.unsubscribe();
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Report the label of whatever the pointer rests on: an atom named as a
|
|
31
|
+
* reader would name it, anything else by the label it was drawn with.
|
|
32
|
+
* @param plugin - The molstar context.
|
|
33
|
+
* @param listener - Called with the label and its loci, or `null` when the
|
|
34
|
+
* pointer leaves everything or rests on something with nothing to say.
|
|
35
|
+
* @returns The unsubscribe function.
|
|
36
|
+
*/
|
|
37
|
+
export function subscribeHoverLabel(plugin, listener) {
|
|
38
|
+
return subscribeHover(plugin, (loci) => {
|
|
39
|
+
const label = loci === null ? null : (atomText(loci) ?? lociText(loci));
|
|
40
|
+
listener(label === null || loci === null ? null : { label, loci });
|
|
41
|
+
});
|
|
42
|
+
}
|
|
29
43
|
/**
|
|
30
44
|
* The one line a loci is worth, in molstar's own words.
|
|
31
45
|
* @param loci - What the pointer is over.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.js","sourceRoot":"","sources":["../../../src/molstar/core/hover.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAqB,EACrB,QAAqC;IAErC,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK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AAO,EAAE,GAAG,CAAC;SACxB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC;SACvB,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -17,8 +17,11 @@
|
|
|
17
17
|
export type { CameraPose, CameraReference, PoseOptions } from './cameraPose.ts';
|
|
18
18
|
export { cameraToPose, poseToCamera } from './cameraPose.ts';
|
|
19
19
|
export { DEFAULT_CAMERA_DURATION, DEFAULT_SPIN_SPEED, FRAMING_MARGIN, MINIMUM_FRAMING_RADIUS, framedRadius, setSpin, } from './camera.ts';
|
|
20
|
+
export type { FocusOptions, Point3, ResetCameraOptions, SceneSphereOptions, ViewOrientation, } from './framing.ts';
|
|
21
|
+
export { focusPoint, resetCamera, sceneSphere, unionSphere, } from './framing.ts';
|
|
20
22
|
export { HighlightPainter, highlightOverpaint } from './highlights.ts';
|
|
21
|
-
export {
|
|
23
|
+
export type { HoverLabel } from './hover.ts';
|
|
24
|
+
export { atomName, atomText, lociText, subscribeHover, subscribeHoverLabel, } from './hover.ts';
|
|
22
25
|
export type { MolstarPluginOptions } from './plugin.ts';
|
|
23
26
|
export { MolstarPlugin } from './plugin.ts';
|
|
24
27
|
export { captureScene } from './captureScene.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,OAAO,GACR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACvE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molstar/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,OAAO,GACR,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export { cameraToPose, poseToCamera } from "./cameraPose.js";
|
|
18
18
|
export { DEFAULT_CAMERA_DURATION, DEFAULT_SPIN_SPEED, FRAMING_MARGIN, MINIMUM_FRAMING_RADIUS, framedRadius, setSpin, } from "./camera.js";
|
|
19
|
+
export { focusPoint, resetCamera, sceneSphere, unionSphere, } from "./framing.js";
|
|
19
20
|
export { HighlightPainter, highlightOverpaint } from "./highlights.js";
|
|
20
|
-
export { atomName, atomText, lociText, subscribeHover } from "./hover.js";
|
|
21
|
+
export { atomName, atomText, lociText, subscribeHover, subscribeHoverLabel, } from "./hover.js";
|
|
21
22
|
export { MolstarPlugin } from "./plugin.js";
|
|
22
23
|
export { captureScene } from "./captureScene.js";
|
|
23
24
|
export { MeasurementPicker, atomReferenceOf, clearMeasurements, renderMeasurements, } from "./measurements.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molstar/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,OAAO,GACR,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molstar/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,OAAO,GACR,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading what a student typed into an answer box, and the verdicts a grader
|
|
3
|
+
* gives a box it cannot grade.
|
|
4
|
+
*/
|
|
5
|
+
import type { Language } from '../../i18n/core/languages.ts';
|
|
6
|
+
import type { FieldCase } from './series.ts';
|
|
7
|
+
/**
|
|
8
|
+
* Read a number the way a student types it: `42`, `+5`, `−3` with a real minus
|
|
9
|
+
* sign, `1,5` with a decimal comma, `75.8 %`, `1 000`.
|
|
10
|
+
*
|
|
11
|
+
* What a typed answer carries beyond a number box — a typographic minus, a
|
|
12
|
+
* percent sign, a space between thousands — is taken off first; the number
|
|
13
|
+
* itself is read by `readNumber`, as every box of the family reads one.
|
|
14
|
+
* @param text - What was typed.
|
|
15
|
+
* @param integer - Whether only a whole number is an answer.
|
|
16
|
+
* @default integer false
|
|
17
|
+
* @returns The number, or undefined when the text is not one.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readAnswerNumber(text: string, integer?: boolean): number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Write a signed whole number the way an oxidation state or a charge is
|
|
22
|
+
* written: `+5`, `−2`, `0`.
|
|
23
|
+
* @param value - The number.
|
|
24
|
+
* @returns The number with its sign, and a true minus sign.
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatSigned(value: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* The verdict on a field left empty.
|
|
29
|
+
* @param label - The field, as its box labels it.
|
|
30
|
+
* @param what - What the box asks for, e.g. `a number of electrons`.
|
|
31
|
+
* @param language - The language the reason is written in.
|
|
32
|
+
* @default language 'en'
|
|
33
|
+
* @returns A failed case that says what to type.
|
|
34
|
+
*/
|
|
35
|
+
export declare function emptyCase(label: string, what: string, language?: Language): FieldCase;
|
|
36
|
+
/**
|
|
37
|
+
* The verdict on a field that does not read as the kind of value it asks for.
|
|
38
|
+
* @param label - The field, as its box labels it.
|
|
39
|
+
* @param typed - What was typed.
|
|
40
|
+
* @param what - What the box asks for, e.g. `a whole number`.
|
|
41
|
+
* @param language - The language the reason is written in.
|
|
42
|
+
* @default language 'en'
|
|
43
|
+
* @returns A failed case quoting what was typed.
|
|
44
|
+
*/
|
|
45
|
+
export declare function unreadableCase(label: string, typed: string, what: string, language?: Language): FieldCase;
|
|
46
|
+
//# sourceMappingURL=answers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answers.d.ts","sourceRoot":"","sources":["../../../src/pedagogy/core/answers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAK7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,UAAQ,GACd,MAAM,GAAG,SAAS,CAOpB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,QAA2B,GACpC,SAAS,CAQX;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,QAA2B,GACpC,SAAS,CAQX"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading what a student typed into an answer box, and the verdicts a grader
|
|
3
|
+
* gives a box it cannot grade.
|
|
4
|
+
*/
|
|
5
|
+
import { CHROME_CATALOG } from "../../i18n/core/chromeCatalog.js";
|
|
6
|
+
import { DEFAULT_LANGUAGE } from "../../i18n/core/languages.js";
|
|
7
|
+
import { catalogTranslate } from "../../i18n/core/translate.js";
|
|
8
|
+
import { readNumber } from "../../number/core/numberText.js";
|
|
9
|
+
/**
|
|
10
|
+
* Read a number the way a student types it: `42`, `+5`, `−3` with a real minus
|
|
11
|
+
* sign, `1,5` with a decimal comma, `75.8 %`, `1 000`.
|
|
12
|
+
*
|
|
13
|
+
* What a typed answer carries beyond a number box — a typographic minus, a
|
|
14
|
+
* percent sign, a space between thousands — is taken off first; the number
|
|
15
|
+
* itself is read by `readNumber`, as every box of the family reads one.
|
|
16
|
+
* @param text - What was typed.
|
|
17
|
+
* @param integer - Whether only a whole number is an answer.
|
|
18
|
+
* @default integer false
|
|
19
|
+
* @returns The number, or undefined when the text is not one.
|
|
20
|
+
*/
|
|
21
|
+
export function readAnswerNumber(text, integer = false) {
|
|
22
|
+
const cleaned = text
|
|
23
|
+
.trim()
|
|
24
|
+
.replaceAll(/[−–]/gu, '-')
|
|
25
|
+
.replace(/\s*%$/u, '')
|
|
26
|
+
.replaceAll(/\s/gu, '');
|
|
27
|
+
return readNumber(cleaned, integer);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Write a signed whole number the way an oxidation state or a charge is
|
|
31
|
+
* written: `+5`, `−2`, `0`.
|
|
32
|
+
* @param value - The number.
|
|
33
|
+
* @returns The number with its sign, and a true minus sign.
|
|
34
|
+
*/
|
|
35
|
+
export function formatSigned(value) {
|
|
36
|
+
if (value > 0)
|
|
37
|
+
return `+${value}`;
|
|
38
|
+
if (value < 0)
|
|
39
|
+
return `−${-value}`;
|
|
40
|
+
return '0';
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The verdict on a field left empty.
|
|
44
|
+
* @param label - The field, as its box labels it.
|
|
45
|
+
* @param what - What the box asks for, e.g. `a number of electrons`.
|
|
46
|
+
* @param language - The language the reason is written in.
|
|
47
|
+
* @default language 'en'
|
|
48
|
+
* @returns A failed case that says what to type.
|
|
49
|
+
*/
|
|
50
|
+
export function emptyCase(label, what, language = DEFAULT_LANGUAGE) {
|
|
51
|
+
const t = catalogTranslate(CHROME_CATALOG, language);
|
|
52
|
+
return {
|
|
53
|
+
label,
|
|
54
|
+
passed: false,
|
|
55
|
+
reason: t('pedagogy.answerEmpty', { what }),
|
|
56
|
+
actual: null,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The verdict on a field that does not read as the kind of value it asks for.
|
|
61
|
+
* @param label - The field, as its box labels it.
|
|
62
|
+
* @param typed - What was typed.
|
|
63
|
+
* @param what - What the box asks for, e.g. `a whole number`.
|
|
64
|
+
* @param language - The language the reason is written in.
|
|
65
|
+
* @default language 'en'
|
|
66
|
+
* @returns A failed case quoting what was typed.
|
|
67
|
+
*/
|
|
68
|
+
export function unreadableCase(label, typed, what, language = DEFAULT_LANGUAGE) {
|
|
69
|
+
const t = catalogTranslate(CHROME_CATALOG, language);
|
|
70
|
+
return {
|
|
71
|
+
label,
|
|
72
|
+
passed: false,
|
|
73
|
+
reason: t('pedagogy.answerUnreadable', { typed: typed.trim(), what }),
|
|
74
|
+
actual: typed,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=answers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answers.js","sourceRoot":"","sources":["../../../src/pedagogy/core/answers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAI7D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAY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