react-cheminfo 0.64.1 → 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/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/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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { splitAddress, splitPath, trimTrailingSlash } from "./address.js";
|
|
2
2
|
import { joinBasePath, normalizeBasePath, stripBasePath } from "./basePath.js";
|
|
3
|
+
import { adoptLanguageParam, readRouteLanguage, writeRouteLanguage, } from "./languageRoute.js";
|
|
3
4
|
import { adoptLegacyHashAddress, pathFromLegacyHash } from "./legacyHash.js";
|
|
4
5
|
import { formatQueryString, parseQueryString } from "./query.js";
|
|
5
6
|
/**
|
|
@@ -16,6 +17,7 @@ export function createTabRouter(options) {
|
|
|
16
17
|
const mode = options.mode ?? 'path';
|
|
17
18
|
const basePath = normalizeBasePath(options.basePath ?? '');
|
|
18
19
|
const adoptLegacyHash = options.adoptLegacyHash ?? false;
|
|
20
|
+
const siteLanguages = options.languages;
|
|
19
21
|
const queryOptions = {
|
|
20
22
|
literalPlus: options.literalPlus ?? true,
|
|
21
23
|
keepEmptyValues: options.keepEmptyValues ?? false,
|
|
@@ -40,8 +42,14 @@ export function createTabRouter(options) {
|
|
|
40
42
|
}
|
|
41
43
|
function parse(address) {
|
|
42
44
|
const parts = readAddress(address, mode, basePath, adoptLegacyHash);
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
+
const query = parseQueryString(parts.search, queryOptions);
|
|
46
|
+
if (siteLanguages === undefined)
|
|
47
|
+
return routeOf(parts.path, query);
|
|
48
|
+
const read = readRouteLanguage(parts.path, query, siteLanguages);
|
|
49
|
+
return { ...routeOf(read.path, read.params), language: read.language };
|
|
50
|
+
}
|
|
51
|
+
function routeOf(path, params) {
|
|
52
|
+
const segments = splitPath(path);
|
|
45
53
|
const first = segments[0];
|
|
46
54
|
const tab = first === undefined ? undefined : tabBySegment.get(first);
|
|
47
55
|
if (tab === undefined)
|
|
@@ -55,7 +63,10 @@ export function createTabRouter(options) {
|
|
|
55
63
|
const definition = definitions.get(tab);
|
|
56
64
|
const base = tab === options.home ? '/' : (definition?.path ?? '/');
|
|
57
65
|
const id = definition?.takesId === true ? (route.id ?? null) : null;
|
|
58
|
-
const
|
|
66
|
+
const page = id === null || base === '/' ? base : `${base}/${encodeURIComponent(id)}`;
|
|
67
|
+
const path = siteLanguages === undefined
|
|
68
|
+
? page
|
|
69
|
+
: writeRouteLanguage(route.language, page, siteLanguages);
|
|
59
70
|
const search = formatQueryString(route.params ?? {}, queryOptions);
|
|
60
71
|
const address = mode === 'hash' ? `#${path}` : joinBasePath(basePath, path);
|
|
61
72
|
return search === '' ? address : `${address}?${search}`;
|
|
@@ -67,11 +78,33 @@ export function createTabRouter(options) {
|
|
|
67
78
|
if (adopted === null)
|
|
68
79
|
return null;
|
|
69
80
|
const route = parse(adopted);
|
|
70
|
-
const path = format({
|
|
81
|
+
const path = format({
|
|
82
|
+
tab: route.tab,
|
|
83
|
+
id: route.id,
|
|
84
|
+
language: route.language,
|
|
85
|
+
});
|
|
71
86
|
const { search } = splitAddress(adopted);
|
|
72
87
|
return search === '' ? path : `${path}?${search}`;
|
|
73
88
|
}
|
|
74
|
-
|
|
89
|
+
function languageAddress(address) {
|
|
90
|
+
if (mode !== 'path' || siteLanguages === undefined)
|
|
91
|
+
return null;
|
|
92
|
+
return adoptLanguageParam(address, {
|
|
93
|
+
basePath,
|
|
94
|
+
languages: siteLanguages,
|
|
95
|
+
queryOptions,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
mode,
|
|
100
|
+
parse,
|
|
101
|
+
format,
|
|
102
|
+
isTab,
|
|
103
|
+
legacyAddress,
|
|
104
|
+
languageAddress,
|
|
105
|
+
basePath,
|
|
106
|
+
languages: siteLanguages,
|
|
107
|
+
};
|
|
75
108
|
}
|
|
76
109
|
function readAddress(address, mode, basePath, adoptLegacyHash) {
|
|
77
110
|
if (mode === 'hash') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabRouter.js","sourceRoot":"","sources":["../../../src/router/core/tabRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,M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AE,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;AACxC,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { Language } from '../../i18n/core/languages.ts';
|
|
2
|
+
/** A tab whose address carries more than the tab's own name. */
|
|
3
|
+
export interface TabDefinition<Tab extends string = string> {
|
|
4
|
+
/** Identifier of the tab, as the state and the components name it. */
|
|
5
|
+
id: Tab;
|
|
6
|
+
/**
|
|
7
|
+
* The address of the tab, from the site's own root. The home tab is always
|
|
8
|
+
* written as `/`, whatever it declares here, so the site has one address for
|
|
9
|
+
* it instead of two holding the same thing.
|
|
10
|
+
* @default `/${id}`
|
|
11
|
+
*/
|
|
12
|
+
path?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the tab addresses one of its items in a second path segment — a
|
|
15
|
+
* tutorial step, an exercise, an element — so a lecturer can hand out a deep
|
|
16
|
+
* link and a crawler indexes each item as a page of its own.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
takesId?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** How the addresses of a site's tabs are read and written. */
|
|
22
|
+
export interface TabRouterOptions<Tab extends string> {
|
|
23
|
+
/** Every tab of the site, named on its own or described in full. */
|
|
24
|
+
tabs: ReadonlyArray<Tab | TabDefinition<Tab>>;
|
|
25
|
+
/**
|
|
26
|
+
* The tab living at the root, and the one an address the site does not know
|
|
27
|
+
* opens — a link written before a rename still lands somewhere.
|
|
28
|
+
*/
|
|
29
|
+
home: Tab;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the address is the path or the fragment. A public tool must use
|
|
32
|
+
* `'path'`: a `#` is dropped by half the tools that pass links around, the
|
|
33
|
+
* server never sees it, and a crawler indexes the whole site as one page.
|
|
34
|
+
* `'hash'` exists only so a site already routing that way can adopt this
|
|
35
|
+
* router before it moves.
|
|
36
|
+
* @default 'path'
|
|
37
|
+
*/
|
|
38
|
+
mode?: 'path' | 'hash';
|
|
39
|
+
/**
|
|
40
|
+
* The path the site is served under: nothing on a host of its own, `/surge`
|
|
41
|
+
* as one tool among several on a shared one.
|
|
42
|
+
* @default ''
|
|
43
|
+
*/
|
|
44
|
+
basePath?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Read a `+` in a value as the character it is rather than as a space.
|
|
47
|
+
* Without it a shared SMILES breaks.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
literalPlus?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Write a parameter carrying nothing back as the bare key, so a hand-typed
|
|
53
|
+
* `?embed` survives the round trip.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
keepEmptyValues?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Also read an address whose page is named by an old `#/tab/item` fragment,
|
|
59
|
+
* so links handed out before the site routed by path keep working.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
adoptLegacyHash?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The languages the site is written in, the default one included. Given,
|
|
65
|
+
* every route carries its `language`: a prefix between the mount and the
|
|
66
|
+
* tab — `/fr/tutorial` — with English written bare, so every link handed out
|
|
67
|
+
* before the site was translated still opens the page it names. A `?lang=` a
|
|
68
|
+
* sibling site handed the language over in is read when the prefix names
|
|
69
|
+
* none, and dropped from the parameters whenever it names a language of the
|
|
70
|
+
* site, since the route then says it once.
|
|
71
|
+
* @default undefined — the site speaks one language and its routes carry none
|
|
72
|
+
*/
|
|
73
|
+
languages?: readonly Language[];
|
|
74
|
+
}
|
|
75
|
+
/** Where the app is: which tab, what it has open, and how it is set up. */
|
|
76
|
+
export interface TabRoute<Tab extends string = string> {
|
|
77
|
+
/** The tab the address opens. */
|
|
78
|
+
tab: Tab;
|
|
79
|
+
/** The item its second segment names, `null` on a tab that takes none. */
|
|
80
|
+
id: string | null;
|
|
81
|
+
/** Decoded query parameters, the tool's own and the share configuration's. */
|
|
82
|
+
params: Record<string, string>;
|
|
83
|
+
/**
|
|
84
|
+
* The language the page is read in, present only on a router given
|
|
85
|
+
* `languages`: the prefix of the address, else the `?lang=` it carries, else
|
|
86
|
+
* the default language.
|
|
87
|
+
* @default undefined
|
|
88
|
+
*/
|
|
89
|
+
language?: Language;
|
|
90
|
+
}
|
|
91
|
+
/** A route as a caller writes it, the parts it does not carry left out. */
|
|
92
|
+
export interface TabRouteInput<Tab extends string = string> {
|
|
93
|
+
/** The tab to open; one the router does not know falls back to the home tab. */
|
|
94
|
+
tab: Tab;
|
|
95
|
+
/**
|
|
96
|
+
* The item the tab has open, ignored by a tab that addresses none.
|
|
97
|
+
* @default null
|
|
98
|
+
*/
|
|
99
|
+
id?: string | null;
|
|
100
|
+
/**
|
|
101
|
+
* Query parameters to carry; an empty, `undefined` or `null` value is left out.
|
|
102
|
+
* @default {}
|
|
103
|
+
*/
|
|
104
|
+
params?: Record<string, string | undefined | null>;
|
|
105
|
+
/**
|
|
106
|
+
* The language to write the address in, ignored by a router given no
|
|
107
|
+
* `languages`; one the site does not speak is written as the default.
|
|
108
|
+
* `writeRoute` keeps the language on screen when the route names none.
|
|
109
|
+
* @default the default language, written with no prefix
|
|
110
|
+
*/
|
|
111
|
+
language?: Language;
|
|
112
|
+
}
|
|
113
|
+
/** The string ↔ route mapping of a site. */
|
|
114
|
+
export interface TabRouter<Tab extends string = string> {
|
|
115
|
+
/** Whether the route lives in the path or in the fragment. */
|
|
116
|
+
mode: 'path' | 'hash';
|
|
117
|
+
/**
|
|
118
|
+
* The route an address denotes. An unknown tab, a trailing slash, an empty
|
|
119
|
+
* address and an escape that does not decode all resolve to something
|
|
120
|
+
* sensible rather than throwing.
|
|
121
|
+
*/
|
|
122
|
+
parse: (address: string) => TabRoute<Tab>;
|
|
123
|
+
/** The address a route is reachable at, mount path and query included. */
|
|
124
|
+
format: (route: TabRouteInput<Tab>) => string;
|
|
125
|
+
/** Whether a string read out of an address names one of the site's tabs. */
|
|
126
|
+
isTab: (value: string) => value is Tab;
|
|
127
|
+
/**
|
|
128
|
+
* The address to put in the bar in place of a link written before the site
|
|
129
|
+
* routed by path: the page it names as this router writes it, with the query
|
|
130
|
+
* string kept as it was. `null` when the address is no such link, or when the
|
|
131
|
+
* router does not adopt them.
|
|
132
|
+
*/
|
|
133
|
+
legacyAddress: (address: string) => string | null;
|
|
134
|
+
/**
|
|
135
|
+
* The address to put in the bar in place of one carrying a `?lang=` the site
|
|
136
|
+
* speaks: the language moved into the path — unless the path already names
|
|
137
|
+
* one, which wins — and every other part of the address kept. `null` when
|
|
138
|
+
* there is nothing to adopt, on a hash router, or on a router given no
|
|
139
|
+
* `languages`.
|
|
140
|
+
* @default undefined — a router built by hand adopts nothing
|
|
141
|
+
*/
|
|
142
|
+
languageAddress?: (address: string) => string | null;
|
|
143
|
+
/**
|
|
144
|
+
* The path the site is served under, as the router normalised it.
|
|
145
|
+
* @default ''
|
|
146
|
+
*/
|
|
147
|
+
basePath?: string;
|
|
148
|
+
/**
|
|
149
|
+
* The languages the router writes, as it was given them.
|
|
150
|
+
* @default undefined — the router writes no language
|
|
151
|
+
*/
|
|
152
|
+
languages?: readonly Language[];
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=tabRouterTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabRouterTypes.d.ts","sourceRoot":"","sources":["../../../src/router/core/tabRouterTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,gEAAgE;AAChE,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,MA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,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC;IACnD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACpD,8DAA8D;IAC9D,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB;;;;OAIG;IACH,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC1C,0EAA0E;IAC1E,MAAM,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC;IAC9C,4EAA4E;IAC5E,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,IAAI,GAAG,CAAC;IACvC;;;;;OAKG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAClD;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACrD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabRouterTypes.js","sourceRoot":"","sources":["../../../src/router/core/tabRouterTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** The window {@link fitDescription} grows a description into. */
|
|
2
|
+
export interface FitDescriptionOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The length growing stops at: a description past it keeps what it has.
|
|
5
|
+
* @default 132
|
|
6
|
+
*/
|
|
7
|
+
target?: number;
|
|
8
|
+
/**
|
|
9
|
+
* The shortest description whole sentences of the base may stop at.
|
|
10
|
+
* @default 110
|
|
11
|
+
*/
|
|
12
|
+
minLength?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The longest description, a clause included: one that would run past it is
|
|
15
|
+
* not added.
|
|
16
|
+
* @default 160
|
|
17
|
+
*/
|
|
18
|
+
maxLength?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The sentence a page is indexed under, cut from its own prose and grown, when
|
|
22
|
+
* that prose is short, with what kind of page it is.
|
|
23
|
+
*
|
|
24
|
+
* The base is fitted first, as `plainDescription` fits it — markup resolved,
|
|
25
|
+
* whole sentences kept, a dot inside `C(=O)O` ending none. Each entry of
|
|
26
|
+
* `extras` is then one choice, written longest first: at most one of its
|
|
27
|
+
* clauses is added, the first that still fits, and growing stops once the text
|
|
28
|
+
* reaches `target`. So a page whose own prose fills a result keeps it, and only
|
|
29
|
+
* a short one is told it is "exercise 3 of 12".
|
|
30
|
+
*
|
|
31
|
+
* Nothing is refused here: a description still outside the window is what
|
|
32
|
+
* `routeProblems` reports, in the test every site asserts empty.
|
|
33
|
+
* @param base - The page's own prose, markup and all.
|
|
34
|
+
* @param extras - Clauses to grow it with, most worth reading first, each
|
|
35
|
+
* entry its alternatives from longest to shortest.
|
|
36
|
+
* @param options - The window the description is grown into.
|
|
37
|
+
* @returns The description.
|
|
38
|
+
*/
|
|
39
|
+
export declare function fitDescription(base: string, extras?: ReadonlyArray<readonly string[]>, options?: FitDescriptionOptions): string;
|
|
40
|
+
//# sourceMappingURL=fitDescription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fitDescription.d.ts","sourceRoot":"","sources":["../../../src/seo/core/fitDescription.ts"],"names":[],"mappings":"AAOA,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,aAAa,CAAC,SAAS,MAAM,EAAE,CAAM,EAC7C,OAAO,GAAE,qBAA0B,GAClC,MAAM,CAuBR"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DESCRIPTION_MAX, DESCRIPTION_MIN, DESCRIPTION_TARGET, } from "./limits.js";
|
|
2
|
+
import { plainDescription, plainProse } from "./plainDescription.js";
|
|
3
|
+
/**
|
|
4
|
+
* The sentence a page is indexed under, cut from its own prose and grown, when
|
|
5
|
+
* that prose is short, with what kind of page it is.
|
|
6
|
+
*
|
|
7
|
+
* The base is fitted first, as `plainDescription` fits it — markup resolved,
|
|
8
|
+
* whole sentences kept, a dot inside `C(=O)O` ending none. Each entry of
|
|
9
|
+
* `extras` is then one choice, written longest first: at most one of its
|
|
10
|
+
* clauses is added, the first that still fits, and growing stops once the text
|
|
11
|
+
* reaches `target`. So a page whose own prose fills a result keeps it, and only
|
|
12
|
+
* a short one is told it is "exercise 3 of 12".
|
|
13
|
+
*
|
|
14
|
+
* Nothing is refused here: a description still outside the window is what
|
|
15
|
+
* `routeProblems` reports, in the test every site asserts empty.
|
|
16
|
+
* @param base - The page's own prose, markup and all.
|
|
17
|
+
* @param extras - Clauses to grow it with, most worth reading first, each
|
|
18
|
+
* entry its alternatives from longest to shortest.
|
|
19
|
+
* @param options - The window the description is grown into.
|
|
20
|
+
* @returns The description.
|
|
21
|
+
*/
|
|
22
|
+
export function fitDescription(base, extras = [], options = {}) {
|
|
23
|
+
const { target = DESCRIPTION_TARGET, minLength = DESCRIPTION_MIN, maxLength = DESCRIPTION_MAX, } = options;
|
|
24
|
+
let text = plainDescription(base, { minLength, maxLength });
|
|
25
|
+
// Prose already cut mid-sentence is not grown: a clause after an ellipsis
|
|
26
|
+
// reads as two snippets.
|
|
27
|
+
if (text.endsWith('…'))
|
|
28
|
+
return text;
|
|
29
|
+
for (const choice of extras) {
|
|
30
|
+
if (text.length >= target)
|
|
31
|
+
break;
|
|
32
|
+
for (const clause of choice) {
|
|
33
|
+
const words = plainProse(clause);
|
|
34
|
+
if (words === '')
|
|
35
|
+
continue;
|
|
36
|
+
const grown = text === '' ? words : `${text} ${words}`;
|
|
37
|
+
if (grown.length <= maxLength) {
|
|
38
|
+
text = grown;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return text;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=fitDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fitDescription.js","sourceRoot":"","sources":["../../../src/seo/core/fitDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAsBrE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,SAA2C,EAAE,EAC7C,UAAiC,EAAE;IAEnC,MAAM,EACJ,MAAM,GAAG,kBAAkB,EAC3B,SAAS,GAAG,eAAe,EAC3B,SAAS,GAAG,eAAe,GAC5B,GAAG,OAAO,CAAC;IACZ,IAAI,IAAI,GAAG,gBAAgB,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5D,0EAA0E;IAC1E,yBAAyB;IACzB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,KAAK,MAAM,MAAM,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM;YAAE,MAAM;QACjC,KAAK,MAAM,MAAM,IAAI,MAAM,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;YACjC,IAAI,KAAK,KAAK,EAAE;gBAAE,SAAS;YAC3B,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC;YACvD,IAAI,KAAK,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;gBAC9B,IAAI,GAAG,KAAK,CAAC;gBACb,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/lib/seo/core/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type { AlternateOptions } from './alternates.ts';
|
|
2
2
|
export { alternateLinkTags } from './alternates.ts';
|
|
3
3
|
export type { DocumentMeta } from './documentMeta.ts';
|
|
4
|
+
export type { FitDescriptionOptions } from './fitDescription.ts';
|
|
5
|
+
export { fitDescription } from './fitDescription.ts';
|
|
6
|
+
export { DESCRIPTION_MAX, DESCRIPTION_MIN, DESCRIPTION_TARGET, TITLE_LIMIT, } from './limits.ts';
|
|
4
7
|
export { writeDocumentMeta } from './documentMeta.ts';
|
|
5
8
|
export type { NoscriptEcosystem, NoscriptHrefs, NoscriptOptions, NoscriptRoute, NoscriptText, } from './noscript.ts';
|
|
6
9
|
export { noscriptIndex } from './noscript.ts';
|
|
@@ -13,6 +16,8 @@ export { plainDescription, plainProse } from './plainDescription.ts';
|
|
|
13
16
|
export type { RobotsDisallow } from './robots.ts';
|
|
14
17
|
export { robotsTxt } from './robots.ts';
|
|
15
18
|
export { routeProblems, withheldPhrase } from './routeProblems.ts';
|
|
19
|
+
export type { RouteField } from './routeTable.ts';
|
|
20
|
+
export { ROUTE_FIELDS, ROUTE_TABLE_FILE, parseRouteTable, serializeRouteTable, } from './routeTable.ts';
|
|
16
21
|
export type { RouteMeta } from './routes.ts';
|
|
17
22
|
export { assertRoutes, homeRoute, pageMetaFor, routeFor } from './routes.ts';
|
|
18
23
|
export type { SiteFilesOptions } from './siteFiles.ts';
|
|
@@ -23,4 +28,6 @@ export type { StructuredDataOptions } from './structuredData.ts';
|
|
|
23
28
|
export { structuredDataScript } from './structuredData.ts';
|
|
24
29
|
export { PAGE_BODY_MARKER, PAGE_HEAD_MARKER, fill } from './template.ts';
|
|
25
30
|
export { injectTrackingScript } from './trackingScript.ts';
|
|
31
|
+
export type { PageContentRecord } from './pageContent.ts';
|
|
32
|
+
export { pageContentOf } from './pageContent.ts';
|
|
26
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seo/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,YAAY,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA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AAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
package/lib/seo/core/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { alternateLinkTags } from "./alternates.js";
|
|
2
|
+
export { fitDescription } from "./fitDescription.js";
|
|
3
|
+
export { DESCRIPTION_MAX, DESCRIPTION_MIN, DESCRIPTION_TARGET, TITLE_LIMIT, } from "./limits.js";
|
|
2
4
|
export { writeDocumentMeta } from "./documentMeta.js";
|
|
3
5
|
export { noscriptIndex } from "./noscript.js";
|
|
4
6
|
export { injectPageMeta, pageDocumentMeta, pageHeadTags, pageLanguage, } from "./pageMeta.js";
|
|
@@ -6,10 +8,12 @@ export { pageProseHtml } from "./pageProse.js";
|
|
|
6
8
|
export { plainDescription, plainProse } from "./plainDescription.js";
|
|
7
9
|
export { robotsTxt } from "./robots.js";
|
|
8
10
|
export { routeProblems, withheldPhrase } from "./routeProblems.js";
|
|
11
|
+
export { ROUTE_FIELDS, ROUTE_TABLE_FILE, parseRouteTable, serializeRouteTable, } from "./routeTable.js";
|
|
9
12
|
export { assertRoutes, homeRoute, pageMetaFor, routeFor } from "./routes.js";
|
|
10
13
|
export { sitemapXml } from "./siteFiles.js";
|
|
11
14
|
export { startDocumentMeta } from "./startDocumentMeta.js";
|
|
12
15
|
export { structuredDataScript } from "./structuredData.js";
|
|
13
16
|
export { PAGE_BODY_MARKER, PAGE_HEAD_MARKER, fill } from "./template.js";
|
|
14
17
|
export { injectTrackingScript } from "./trackingScript.js";
|
|
18
|
+
export { pageContentOf } from "./pageContent.js";
|
|
15
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seo/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seo/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAQtD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The room a search result gives the words a page is indexed under. They are
|
|
3
|
+
* checked by `routeProblems` and fitted by `plainDescription` and
|
|
4
|
+
* `fitDescription`, so a site that composes its own prose reads them here
|
|
5
|
+
* rather than re-typing them.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The longest title that survives a search result whole, before the site name
|
|
9
|
+
* is appended to it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const TITLE_LIMIT = 60;
|
|
12
|
+
/**
|
|
13
|
+
* The shortest description that says anything: under it a result pads the
|
|
14
|
+
* snippet with whatever text the crawler found on the page.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DESCRIPTION_MIN = 110;
|
|
17
|
+
/** The longest description a result shows without clipping it. */
|
|
18
|
+
export declare const DESCRIPTION_MAX = 160;
|
|
19
|
+
/**
|
|
20
|
+
* What a grown description aims for. It sits above {@link DESCRIPTION_MIN}
|
|
21
|
+
* because the floor is not the goal: a clause that fits is one the reader gets.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DESCRIPTION_TARGET = 132;
|
|
24
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/seo/core/limits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,kEAAkE;AAClE,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The room a search result gives the words a page is indexed under. They are
|
|
3
|
+
* checked by `routeProblems` and fitted by `plainDescription` and
|
|
4
|
+
* `fitDescription`, so a site that composes its own prose reads them here
|
|
5
|
+
* rather than re-typing them.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The longest title that survives a search result whole, before the site name
|
|
9
|
+
* is appended to it.
|
|
10
|
+
*/
|
|
11
|
+
export const TITLE_LIMIT = 60;
|
|
12
|
+
/**
|
|
13
|
+
* The shortest description that says anything: under it a result pads the
|
|
14
|
+
* snippet with whatever text the crawler found on the page.
|
|
15
|
+
*/
|
|
16
|
+
export const DESCRIPTION_MIN = 110;
|
|
17
|
+
/** The longest description a result shows without clipping it. */
|
|
18
|
+
export const DESCRIPTION_MAX = 160;
|
|
19
|
+
/**
|
|
20
|
+
* What a grown description aims for. It sits above {@link DESCRIPTION_MIN}
|
|
21
|
+
* because the floor is not the goal: a clause that fits is one the reader gets.
|
|
22
|
+
*/
|
|
23
|
+
export const DESCRIPTION_TARGET = 132;
|
|
24
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../src/seo/core/limits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAE9B;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC,kEAAkE;AAClE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The text each address says for itself, read from one record of the pages a
|
|
3
|
+
* site has written for.
|
|
4
|
+
*/
|
|
5
|
+
import type { Language } from '../../i18n/core/languages.ts';
|
|
6
|
+
import type { PageContent } from './pageProse.ts';
|
|
7
|
+
import type { RouteMeta } from './routes.ts';
|
|
8
|
+
/**
|
|
9
|
+
* The pages a site has written for, by path, or a function giving them in
|
|
10
|
+
* each language.
|
|
11
|
+
*/
|
|
12
|
+
export type PageContentRecord = Readonly<Record<string, PageContent>> | ((language: Language) => Readonly<Record<string, PageContent>>);
|
|
13
|
+
/**
|
|
14
|
+
* What each address says for itself: the page written for its path when there
|
|
15
|
+
* is one, and otherwise the name and the sentence the route is already indexed
|
|
16
|
+
* under.
|
|
17
|
+
*
|
|
18
|
+
* The fallback repeats the snippet rather than adding to it, which is thin —
|
|
19
|
+
* but the route table writes those distinctly per page, so a thin page is never
|
|
20
|
+
* a duplicate of its neighbour, and no address ships the bare menu.
|
|
21
|
+
* @param pages - The pages written for, by path.
|
|
22
|
+
* @returns The function `cheminfoPrerender` calls once per route and language.
|
|
23
|
+
*/
|
|
24
|
+
export declare function pageContentOf(pages: PageContentRecord): (route: RouteMeta, language: Language) => PageContent;
|
|
25
|
+
//# sourceMappingURL=pageContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageContent.d.ts","sourceRoot":"","sources":["../../../src/seo/core/pageContent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GACrC,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;AAEpE;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,iBAAiB,GACvB,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,KAAK,WAAW,CAUvD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The text each address says for itself, read from one record of the pages a
|
|
3
|
+
* site has written for.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* What each address says for itself: the page written for its path when there
|
|
7
|
+
* is one, and otherwise the name and the sentence the route is already indexed
|
|
8
|
+
* under.
|
|
9
|
+
*
|
|
10
|
+
* The fallback repeats the snippet rather than adding to it, which is thin —
|
|
11
|
+
* but the route table writes those distinctly per page, so a thin page is never
|
|
12
|
+
* a duplicate of its neighbour, and no address ships the bare menu.
|
|
13
|
+
* @param pages - The pages written for, by path.
|
|
14
|
+
* @returns The function `cheminfoPrerender` calls once per route and language.
|
|
15
|
+
*/
|
|
16
|
+
export function pageContentOf(pages) {
|
|
17
|
+
return (route, language) => {
|
|
18
|
+
const written = typeof pages === 'function' ? pages(language) : pages;
|
|
19
|
+
return (written[route.path] ?? {
|
|
20
|
+
heading: route.title,
|
|
21
|
+
paragraphs: [route.description],
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=pageContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageContent.js","sourceRoot":"","sources":["../../../src/seo/core/pageContent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAwB;IAExB,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QACzB,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACtE,OAAO,CACL,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI;YACrB,OAAO,EAAE,KAAK,CAAC,KAAK;YACpB,UAAU,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC;SAChC,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plainDescription.d.ts","sourceRoot":"","sources":["../../../src/seo/core/plainDescription.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plainDescription.d.ts","sourceRoot":"","sources":["../../../src/seo/core/plainDescription.ts"],"names":[],"mappings":"AAKA,oDAAoD;AACpD,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,uBAA4B,GACpC,MAAM,CAQR;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseInlineMarks } from "../../pedagogy/core/inlineMarks.js";
|
|
2
|
+
import { DESCRIPTION_MAX, DESCRIPTION_MIN } from "./limits.js";
|
|
2
3
|
/**
|
|
3
4
|
* Fit a page's authored prose into the description of its route.
|
|
4
5
|
*
|
|
@@ -13,8 +14,8 @@ import { parseInlineMarks } from "../../pedagogy/core/inlineMarks.js";
|
|
|
13
14
|
* @returns The description.
|
|
14
15
|
*/
|
|
15
16
|
export function plainDescription(prose, options = {}) {
|
|
16
|
-
const maxLength = options.maxLength ??
|
|
17
|
-
const minLength = options.minLength ??
|
|
17
|
+
const maxLength = options.maxLength ?? DESCRIPTION_MAX;
|
|
18
|
+
const minLength = options.minLength ?? DESCRIPTION_MIN;
|
|
18
19
|
const text = plainProse(prose);
|
|
19
20
|
if (text.length <= maxLength)
|
|
20
21
|
return text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plainDescription.js","sourceRoot":"","sources":["../../../src/seo/core/plainDescription.ts"],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AG,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC;AACzC,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACzB,QAAQ,GAAG,IAAI,CAAC;QAChB,IAAI,GAAG,IAAI;aACR,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC;aACjC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeProblems.d.ts","sourceRoot":"","sources":["../../../src/seo/core/routeProblems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"routeProblems.d.ts","sourceRoot":"","sources":["../../../src/seo/core/routeProblems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAU7C;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,EAAE,CA2DpE"}
|
|
@@ -10,12 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* The paths are `assertRoutes`' business; this is about the words.
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
const TITLE_LIMIT = 60;
|
|
15
|
-
/** The shortest description that says anything. */
|
|
16
|
-
const DESCRIPTION_MIN = 110;
|
|
17
|
-
/** The longest description a result shows without clipping it. */
|
|
18
|
-
const DESCRIPTION_MAX = 160;
|
|
13
|
+
import { DESCRIPTION_MAX, DESCRIPTION_MIN, TITLE_LIMIT } from "./limits.js";
|
|
19
14
|
/**
|
|
20
15
|
* What a site never says about itself, in the words it would say it in. A
|
|
21
16
|
* snippet naming a repository, a tracker or a licence is both a promise the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeProblems.js","sourceRoot":"","sources":["../../../src/seo/core/routeProblems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"routeProblems.js","sourceRoot":"","sources":["../../../src/seo/core/routeProblems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG5E;;;;GAIG;AACH,MAAM,QAAQ,GACZ,+HAA+H,CAAC;AAElI;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4B;IACxD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;QACxE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE/C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;QAEtB,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;QAC9C,CAAC;aAAM,IAAI,KAAK,CAAC,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