@treeseed/core 0.1.2
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 +145 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/registry-helper.js +14 -0
- package/dist/agents/registry.js +88 -0
- package/dist/components/DevWatchReload.astro +45 -0
- package/dist/components/SiteTitle.astro +51 -0
- package/dist/components/content/ContentStatusLegend.astro +18 -0
- package/dist/components/content/StatusBadge.astro +11 -0
- package/dist/components/docs/BookFontControls.astro +180 -0
- package/dist/components/docs/DesktopSidebarToggle.astro +88 -0
- package/dist/components/docs/DownloadBook.astro +34 -0
- package/dist/components/docs/Footer.astro +196 -0
- package/dist/components/docs/Header.astro +150 -0
- package/dist/components/docs/PageFrame.astro +260 -0
- package/dist/components/docs/PageSidebar.astro +63 -0
- package/dist/components/docs/PageTitle.astro +39 -0
- package/dist/components/docs/Sidebar.astro +41 -0
- package/dist/components/docs/ThemeSelect.astro +3 -0
- package/dist/components/forms/ContactForm.astro +234 -0
- package/dist/components/forms/FooterSubscribeForm.astro +189 -0
- package/dist/components/site/BookList.astro +27 -0
- package/dist/components/site/CTASection.astro +24 -0
- package/dist/components/site/ChronicleList.astro +33 -0
- package/dist/components/site/Hero.astro +18 -0
- package/dist/components/site/NotesList.astro +18 -0
- package/dist/components/site/PathCard.astro +16 -0
- package/dist/components/site/ProfileList.astro +30 -0
- package/dist/components/site/SectionIntro.astro +9 -0
- package/dist/components/site/StageBanner.astro +8 -0
- package/dist/components/site/TrustCallout.astro +9 -0
- package/dist/components/starlight.js +6 -0
- package/dist/config.js +8 -0
- package/dist/content-config.js +9 -0
- package/dist/content.js +230 -0
- package/dist/contracts.d.ts +130 -0
- package/dist/contracts.js +0 -0
- package/dist/deploy/config.d.ts +4 -0
- package/dist/deploy/config.js +154 -0
- package/dist/deploy/runtime.js +77 -0
- package/dist/env.yaml +322 -0
- package/dist/environment.d.ts +130 -0
- package/dist/environment.js +324 -0
- package/dist/index.js +81 -0
- package/dist/layouts/AuthoredEntryLayout.astro +87 -0
- package/dist/layouts/BookLayout.astro +35 -0
- package/dist/layouts/BridgeLayout.astro +11 -0
- package/dist/layouts/ContentLayout.astro +24 -0
- package/dist/layouts/MainLayout.astro +203 -0
- package/dist/layouts/NoteLayout.astro +26 -0
- package/dist/layouts/ProfileLayout.astro +81 -0
- package/dist/middleware/starlightRouteData.js +45 -0
- package/dist/pages/404.astro +29 -0
- package/dist/pages/[slug].astro +30 -0
- package/dist/pages/agents/[slug].astro +29 -0
- package/dist/pages/agents/index.astro +27 -0
- package/dist/pages/api/form/submit.js +14 -0
- package/dist/pages/books/[slug].astro +19 -0
- package/dist/pages/books/index.astro +28 -0
- package/dist/pages/contact.astro +27 -0
- package/dist/pages/feed.xml.js +34 -0
- package/dist/pages/index.astro +290 -0
- package/dist/pages/notes/[slug].astro +19 -0
- package/dist/pages/notes/index.astro +21 -0
- package/dist/pages/objectives/[slug].astro +31 -0
- package/dist/pages/objectives/index.astro +30 -0
- package/dist/pages/people/[slug].astro +29 -0
- package/dist/pages/people/index.astro +28 -0
- package/dist/pages/questions/[slug].astro +31 -0
- package/dist/pages/questions/index.astro +30 -0
- package/dist/plugin-default.js +4 -0
- package/dist/plugins/builtin/default-plugin.d.ts +21 -0
- package/dist/plugins/builtin/default-plugin.js +32 -0
- package/dist/plugins/constants.d.ts +21 -0
- package/dist/plugins/constants.js +28 -0
- package/dist/plugins/plugin.d.ts +42 -0
- package/dist/plugins/plugin.js +6 -0
- package/dist/plugins/runtime.d.ts +31 -0
- package/dist/plugins/runtime.js +120 -0
- package/dist/scripts/aggregate-book.js +112 -0
- package/dist/scripts/assert-release-tag-version.js +21 -0
- package/dist/scripts/build-dist.js +384 -0
- package/dist/scripts/build-tenant-worker.js +36 -0
- package/dist/scripts/package-tools.js +88 -0
- package/dist/scripts/patch-starlight-content-path.js +172 -0
- package/dist/scripts/paths.js +11 -0
- package/dist/scripts/publish-package.js +20 -0
- package/dist/scripts/release-verify.js +52 -0
- package/dist/scripts/run-fixture-astro-command.js +21 -0
- package/dist/scripts/tenant-astro-command.js +3 -0
- package/dist/scripts/tenant-build.js +16 -0
- package/dist/scripts/tenant-check.js +7 -0
- package/dist/scripts/test-smoke.js +105 -0
- package/dist/server.js +53 -0
- package/dist/site-resources.d.ts +29 -0
- package/dist/site-resources.js +127 -0
- package/dist/site.js +313 -0
- package/dist/styles/global.css +683 -0
- package/dist/styles/prose.css +89 -0
- package/dist/styles/tokens.css +24 -0
- package/dist/tenant/bridge.js +5 -0
- package/dist/tenant/config.d.ts +9 -0
- package/dist/tenant/config.js +124 -0
- package/dist/tenant/runtime-config.js +20 -0
- package/dist/tsconfigs/strict.json +3 -0
- package/dist/types/agents.d.ts +1 -0
- package/dist/types/agents.js +1 -0
- package/dist/types/astro-build.d.js +0 -0
- package/dist/types/cloudflare-sockets.d.js +0 -0
- package/dist/types/cloudflare.d.ts +1 -0
- package/dist/types/cloudflare.js +1 -0
- package/dist/types/forms.js +4 -0
- package/dist/utils/agents/adapters/execution.js +90 -0
- package/dist/utils/agents/adapters/mutations.js +30 -0
- package/dist/utils/agents/adapters/notification.js +16 -0
- package/dist/utils/agents/adapters/repository.js +61 -0
- package/dist/utils/agents/adapters/research.js +25 -0
- package/dist/utils/agents/adapters/verification.js +62 -0
- package/dist/utils/agents/cli-tools.js +5 -0
- package/dist/utils/agents/contracts/messages.d.ts +88 -0
- package/dist/utils/agents/contracts/messages.js +138 -0
- package/dist/utils/agents/contracts/run.d.ts +20 -0
- package/dist/utils/agents/contracts/run.js +0 -0
- package/dist/utils/agents/runtime-types.d.ts +117 -0
- package/dist/utils/agents/runtime-types.js +4 -0
- package/dist/utils/books-data.js +82 -0
- package/dist/utils/content-status.js +38 -0
- package/dist/utils/forms/config.js +87 -0
- package/dist/utils/forms/constants.js +27 -0
- package/dist/utils/forms/contact-submissions-local.js +19 -0
- package/dist/utils/forms/contact-submissions.js +72 -0
- package/dist/utils/forms/crypto.js +64 -0
- package/dist/utils/forms/guard.js +76 -0
- package/dist/utils/forms/http.js +51 -0
- package/dist/utils/forms/provider-core.js +88 -0
- package/dist/utils/forms/routing-core.js +7 -0
- package/dist/utils/forms/routing.js +13 -0
- package/dist/utils/forms/runtime-core.js +17 -0
- package/dist/utils/forms/runtime.js +27 -0
- package/dist/utils/forms/service-core.js +256 -0
- package/dist/utils/forms/service.js +55 -0
- package/dist/utils/forms/session.js +57 -0
- package/dist/utils/forms/smtp-cloudflare.js +107 -0
- package/dist/utils/forms/smtp-node.js +27 -0
- package/dist/utils/forms/smtp.js +10 -0
- package/dist/utils/forms/subscribers-local.js +21 -0
- package/dist/utils/forms/subscribers.js +53 -0
- package/dist/utils/forms/turnstile.js +31 -0
- package/dist/utils/forms/validation.js +58 -0
- package/dist/utils/hub-content.js +28 -0
- package/dist/utils/plugin-runtime.js +158 -0
- package/dist/utils/routes.js +17 -0
- package/dist/utils/seo.js +4 -0
- package/dist/utils/site-config-schema.js +282 -0
- package/dist/utils/site-config.js +122 -0
- package/dist/utils/starlight-nav.js +62 -0
- package/dist/utils/theme.js +49 -0
- package/dist/vendor/starlight/components/AnchorHeading.astro +53 -0
- package/dist/vendor/starlight/components/Banner.astro +23 -0
- package/dist/vendor/starlight/components/ContentNotice.astro +33 -0
- package/dist/vendor/starlight/components/ContentPanel.astro +27 -0
- package/dist/vendor/starlight/components/DraftContentNotice.astro +5 -0
- package/dist/vendor/starlight/components/EditLink.astro +28 -0
- package/dist/vendor/starlight/components/FallbackContentNotice.astro +5 -0
- package/dist/vendor/starlight/components/Footer.astro +61 -0
- package/dist/vendor/starlight/components/Head.astro +5 -0
- package/dist/vendor/starlight/components/Header.astro +94 -0
- package/dist/vendor/starlight/components/Hero.astro +143 -0
- package/dist/vendor/starlight/components/Icons.js +121 -0
- package/dist/vendor/starlight/components/LanguageSelect.astro +57 -0
- package/dist/vendor/starlight/components/LastUpdated.astro +14 -0
- package/dist/vendor/starlight/components/MarkdownContent.astro +5 -0
- package/dist/vendor/starlight/components/MobileMenuFooter.astro +35 -0
- package/dist/vendor/starlight/components/MobileMenuToggle.astro +107 -0
- package/dist/vendor/starlight/components/MobileTableOfContents.astro +151 -0
- package/dist/vendor/starlight/components/Page.astro +126 -0
- package/dist/vendor/starlight/components/PageFrame.astro +97 -0
- package/dist/vendor/starlight/components/PageSidebar.astro +59 -0
- package/dist/vendor/starlight/components/PageTitle.astro +17 -0
- package/dist/vendor/starlight/components/Pagination.astro +79 -0
- package/dist/vendor/starlight/components/Search.astro +488 -0
- package/dist/vendor/starlight/components/Select.astro +99 -0
- package/dist/vendor/starlight/components/Sidebar.astro +15 -0
- package/dist/vendor/starlight/components/SidebarPersistState.js +43 -0
- package/dist/vendor/starlight/components/SidebarPersister.astro +78 -0
- package/dist/vendor/starlight/components/SidebarRestorePoint.astro +12 -0
- package/dist/vendor/starlight/components/SidebarSublist.astro +154 -0
- package/dist/vendor/starlight/components/SiteTitle.astro +59 -0
- package/dist/vendor/starlight/components/SkipLink.astro +26 -0
- package/dist/vendor/starlight/components/SocialIcons.astro +32 -0
- package/dist/vendor/starlight/components/StarlightPage.astro +17 -0
- package/dist/vendor/starlight/components/TableOfContents/TableOfContentsList.astro +79 -0
- package/dist/vendor/starlight/components/TableOfContents/starlight-toc.js +93 -0
- package/dist/vendor/starlight/components/TableOfContents.astro +18 -0
- package/dist/vendor/starlight/components/ThemeProvider.astro +38 -0
- package/dist/vendor/starlight/components/ThemeSelect.astro +73 -0
- package/dist/vendor/starlight/components/TwoColumnContent.astro +54 -0
- package/dist/vendor/starlight/components.js +26 -0
- package/dist/vendor/starlight/constants.js +4 -0
- package/dist/vendor/starlight/expressive-code.d.js +1 -0
- package/dist/vendor/starlight/global.d.js +0 -0
- package/dist/vendor/starlight/i18n.d.js +1 -0
- package/dist/vendor/starlight/index.js +119 -0
- package/dist/vendor/starlight/integrations/asides-error.js +12 -0
- package/dist/vendor/starlight/integrations/asides.js +179 -0
- package/dist/vendor/starlight/integrations/code-rtl-support.js +21 -0
- package/dist/vendor/starlight/integrations/expressive-code/hast.d.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/index.js +63 -0
- package/dist/vendor/starlight/integrations/expressive-code/preprocessor.js +92 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc +1796 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-light.jsonc +1695 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-light.jsonc.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/theming.js +62 -0
- package/dist/vendor/starlight/integrations/expressive-code/translations.js +29 -0
- package/dist/vendor/starlight/integrations/heading-links.js +61 -0
- package/dist/vendor/starlight/integrations/pagefind.js +43 -0
- package/dist/vendor/starlight/integrations/remark-rehype.js +68 -0
- package/dist/vendor/starlight/integrations/shared/absolutePathToLang.js +15 -0
- package/dist/vendor/starlight/integrations/shared/localeToLang.js +9 -0
- package/dist/vendor/starlight/integrations/shared/slugToLocale.js +10 -0
- package/dist/vendor/starlight/integrations/sitemap.js +20 -0
- package/dist/vendor/starlight/integrations/virtual-user-config.js +110 -0
- package/dist/vendor/starlight/integrations/vite-layer-order.js +42 -0
- package/dist/vendor/starlight/internal.js +6 -0
- package/dist/vendor/starlight/loaders.js +36 -0
- package/dist/vendor/starlight/locals.d.js +0 -0
- package/dist/vendor/starlight/locals.js +30 -0
- package/dist/vendor/starlight/package.json +231 -0
- package/dist/vendor/starlight/package.json.js +248 -0
- package/dist/vendor/starlight/props.js +0 -0
- package/dist/vendor/starlight/route-data.js +6 -0
- package/dist/vendor/starlight/routes/common.astro +23 -0
- package/dist/vendor/starlight/routes/ssr/404.astro +7 -0
- package/dist/vendor/starlight/routes/ssr/index.astro +14 -0
- package/dist/vendor/starlight/routes/static/404.astro +7 -0
- package/dist/vendor/starlight/routes/static/index.astro +12 -0
- package/dist/vendor/starlight/schema.js +102 -0
- package/dist/vendor/starlight/schemas/badge.js +26 -0
- package/dist/vendor/starlight/schemas/components.js +235 -0
- package/dist/vendor/starlight/schemas/expressiveCode.js +12 -0
- package/dist/vendor/starlight/schemas/favicon.js +33 -0
- package/dist/vendor/starlight/schemas/head.js +32 -0
- package/dist/vendor/starlight/schemas/hero.js +57 -0
- package/dist/vendor/starlight/schemas/i18n.js +101 -0
- package/dist/vendor/starlight/schemas/icon.js +7 -0
- package/dist/vendor/starlight/schemas/logo.js +24 -0
- package/dist/vendor/starlight/schemas/pagefind.js +108 -0
- package/dist/vendor/starlight/schemas/prevNextLink.js +14 -0
- package/dist/vendor/starlight/schemas/sidebar.js +80 -0
- package/dist/vendor/starlight/schemas/site-title.js +19 -0
- package/dist/vendor/starlight/schemas/social.js +19 -0
- package/dist/vendor/starlight/schemas/tableOfContents.js +16 -0
- package/dist/vendor/starlight/style/anchor-links.css +131 -0
- package/dist/vendor/starlight/style/asides.css +51 -0
- package/dist/vendor/starlight/style/layers.css +1 -0
- package/dist/vendor/starlight/style/markdown.css +253 -0
- package/dist/vendor/starlight/style/print.css +175 -0
- package/dist/vendor/starlight/style/props.css +188 -0
- package/dist/vendor/starlight/style/reset.css +52 -0
- package/dist/vendor/starlight/style/util.css +63 -0
- package/dist/vendor/starlight/translations/ar.json +30 -0
- package/dist/vendor/starlight/translations/ar.json.js +32 -0
- package/dist/vendor/starlight/translations/ca.json +43 -0
- package/dist/vendor/starlight/translations/ca.json.js +45 -0
- package/dist/vendor/starlight/translations/cs.json +43 -0
- package/dist/vendor/starlight/translations/cs.json.js +45 -0
- package/dist/vendor/starlight/translations/da.json +30 -0
- package/dist/vendor/starlight/translations/da.json.js +32 -0
- package/dist/vendor/starlight/translations/de.json +30 -0
- package/dist/vendor/starlight/translations/de.json.js +32 -0
- package/dist/vendor/starlight/translations/el.json +30 -0
- package/dist/vendor/starlight/translations/el.json.js +32 -0
- package/dist/vendor/starlight/translations/en.json +30 -0
- package/dist/vendor/starlight/translations/en.json.js +32 -0
- package/dist/vendor/starlight/translations/es.json +43 -0
- package/dist/vendor/starlight/translations/es.json.js +45 -0
- package/dist/vendor/starlight/translations/fa.json +30 -0
- package/dist/vendor/starlight/translations/fa.json.js +32 -0
- package/dist/vendor/starlight/translations/fi.json +30 -0
- package/dist/vendor/starlight/translations/fi.json.js +32 -0
- package/dist/vendor/starlight/translations/fr.json +33 -0
- package/dist/vendor/starlight/translations/fr.json.js +35 -0
- package/dist/vendor/starlight/translations/gl.json +43 -0
- package/dist/vendor/starlight/translations/gl.json.js +45 -0
- package/dist/vendor/starlight/translations/he.json +30 -0
- package/dist/vendor/starlight/translations/he.json.js +32 -0
- package/dist/vendor/starlight/translations/hi.json +30 -0
- package/dist/vendor/starlight/translations/hi.json.js +32 -0
- package/dist/vendor/starlight/translations/hu.json +43 -0
- package/dist/vendor/starlight/translations/hu.json.js +45 -0
- package/dist/vendor/starlight/translations/id.json +30 -0
- package/dist/vendor/starlight/translations/id.json.js +32 -0
- package/dist/vendor/starlight/translations/index.js +77 -0
- package/dist/vendor/starlight/translations/it.json +30 -0
- package/dist/vendor/starlight/translations/it.json.js +32 -0
- package/dist/vendor/starlight/translations/ja.json +30 -0
- package/dist/vendor/starlight/translations/ja.json.js +32 -0
- package/dist/vendor/starlight/translations/ko.json +30 -0
- package/dist/vendor/starlight/translations/ko.json.js +32 -0
- package/dist/vendor/starlight/translations/lv.json +30 -0
- package/dist/vendor/starlight/translations/lv.json.js +32 -0
- package/dist/vendor/starlight/translations/nb.json +30 -0
- package/dist/vendor/starlight/translations/nb.json.js +32 -0
- package/dist/vendor/starlight/translations/nl.json +30 -0
- package/dist/vendor/starlight/translations/nl.json.js +32 -0
- package/dist/vendor/starlight/translations/pl.json +33 -0
- package/dist/vendor/starlight/translations/pl.json.js +35 -0
- package/dist/vendor/starlight/translations/pt.json +30 -0
- package/dist/vendor/starlight/translations/pt.json.js +32 -0
- package/dist/vendor/starlight/translations/ro.json +30 -0
- package/dist/vendor/starlight/translations/ro.json.js +32 -0
- package/dist/vendor/starlight/translations/ru.json +33 -0
- package/dist/vendor/starlight/translations/ru.json.js +35 -0
- package/dist/vendor/starlight/translations/sk.json +30 -0
- package/dist/vendor/starlight/translations/sk.json.js +32 -0
- package/dist/vendor/starlight/translations/sv.json +30 -0
- package/dist/vendor/starlight/translations/sv.json.js +32 -0
- package/dist/vendor/starlight/translations/th.json +30 -0
- package/dist/vendor/starlight/translations/th.json.js +32 -0
- package/dist/vendor/starlight/translations/tr.json +30 -0
- package/dist/vendor/starlight/translations/tr.json.js +32 -0
- package/dist/vendor/starlight/translations/uk.json +30 -0
- package/dist/vendor/starlight/translations/uk.json.js +32 -0
- package/dist/vendor/starlight/translations/vi.json +30 -0
- package/dist/vendor/starlight/translations/vi.json.js +32 -0
- package/dist/vendor/starlight/translations/zh-CN.json +30 -0
- package/dist/vendor/starlight/translations/zh-CN.json.js +32 -0
- package/dist/vendor/starlight/translations/zh-TW.json +30 -0
- package/dist/vendor/starlight/translations/zh-TW.json.js +32 -0
- package/dist/vendor/starlight/types.js +0 -0
- package/dist/vendor/starlight/user-components/Aside.astro +40 -0
- package/dist/vendor/starlight/user-components/Badge.astro +148 -0
- package/dist/vendor/starlight/user-components/Card.astro +68 -0
- package/dist/vendor/starlight/user-components/CardGrid.astro +38 -0
- package/dist/vendor/starlight/user-components/FileTree.astro +137 -0
- package/dist/vendor/starlight/user-components/Icon.astro +42 -0
- package/dist/vendor/starlight/user-components/LinkButton.astro +78 -0
- package/dist/vendor/starlight/user-components/LinkCard.astro +78 -0
- package/dist/vendor/starlight/user-components/Steps.astro +90 -0
- package/dist/vendor/starlight/user-components/TabItem.astro +19 -0
- package/dist/vendor/starlight/user-components/Tabs.astro +268 -0
- package/dist/vendor/starlight/user-components/file-tree-icons.js +608 -0
- package/dist/vendor/starlight/user-components/rehype-file-tree.js +160 -0
- package/dist/vendor/starlight/user-components/rehype-steps.js +53 -0
- package/dist/vendor/starlight/user-components/rehype-tabs.js +73 -0
- package/dist/vendor/starlight/utils/base.js +14 -0
- package/dist/vendor/starlight/utils/canonical.js +13 -0
- package/dist/vendor/starlight/utils/collection-fs.js +13 -0
- package/dist/vendor/starlight/utils/collection.js +16 -0
- package/dist/vendor/starlight/utils/createPathFormatter.js +39 -0
- package/dist/vendor/starlight/utils/createTranslationSystem.js +60 -0
- package/dist/vendor/starlight/utils/error-map.js +110 -0
- package/dist/vendor/starlight/utils/format-path.js +9 -0
- package/dist/vendor/starlight/utils/generateToC.js +18 -0
- package/dist/vendor/starlight/utils/git.js +92 -0
- package/dist/vendor/starlight/utils/gitInlined.js +13 -0
- package/dist/vendor/starlight/utils/head.js +156 -0
- package/dist/vendor/starlight/utils/i18n.js +121 -0
- package/dist/vendor/starlight/utils/localizedUrl.js +37 -0
- package/dist/vendor/starlight/utils/navigation.js +320 -0
- package/dist/vendor/starlight/utils/path.js +52 -0
- package/dist/vendor/starlight/utils/plugins.js +355 -0
- package/dist/vendor/starlight/utils/routing/data.js +116 -0
- package/dist/vendor/starlight/utils/routing/index.js +107 -0
- package/dist/vendor/starlight/utils/routing/middleware.js +40 -0
- package/dist/vendor/starlight/utils/routing/types.js +0 -0
- package/dist/vendor/starlight/utils/routing.js +1 -0
- package/dist/vendor/starlight/utils/slugs.js +70 -0
- package/dist/vendor/starlight/utils/starlight-page.js +123 -0
- package/dist/vendor/starlight/utils/translations-fs.js +31 -0
- package/dist/vendor/starlight/utils/translations.js +31 -0
- package/dist/vendor/starlight/utils/types.js +0 -0
- package/dist/vendor/starlight/utils/url.js +5 -0
- package/dist/vendor/starlight/utils/user-config.js +255 -0
- package/dist/vendor/starlight/utils/validateLogoImports.js +22 -0
- package/dist/vendor/starlight/virtual-internal.d.js +0 -0
- package/dist/vendor/starlight/virtual.d.js +0 -0
- package/dist/worker/forms-worker.js +141 -0
- package/package.json +156 -0
- package/style/anchor-links.css +131 -0
- package/templates/github/deploy.workflow.yml +47 -0
- package/tsconfigs/strict.json +3 -0
- package/utils/git.ts +121 -0
- package/utils/gitInlined.ts +20 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Icon from '../user-components/Icon.astro';
|
|
3
|
+
import project from 'virtual:starlight/project-context';
|
|
4
|
+
|
|
5
|
+
const pagefindTranslations = {
|
|
6
|
+
placeholder: Astro.locals.t('search.label'),
|
|
7
|
+
...Object.fromEntries(
|
|
8
|
+
Object.entries(Astro.locals.t.all())
|
|
9
|
+
.filter(([key]) => key.startsWith('pagefind.'))
|
|
10
|
+
.map(([key, value]) => [key.replace('pagefind.', ''), value])
|
|
11
|
+
),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const dataAttributes: DOMStringMap = { 'data-translations': JSON.stringify(pagefindTranslations) };
|
|
15
|
+
if (project.trailingSlash === 'never') dataAttributes['data-strip-trailing-slash'] = '';
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<site-search class={Astro.props.class} {...dataAttributes}>
|
|
19
|
+
<button
|
|
20
|
+
data-open-modal
|
|
21
|
+
disabled
|
|
22
|
+
aria-label={Astro.locals.t('search.label')}
|
|
23
|
+
aria-keyshortcuts="Control+K"
|
|
24
|
+
>
|
|
25
|
+
<Icon name="magnifier" />
|
|
26
|
+
<span class="sl-hidden md:sl-block" aria-hidden="true">{Astro.locals.t('search.label')}</span>
|
|
27
|
+
<kbd class="sl-hidden md:sl-flex" style="display: none;">
|
|
28
|
+
<kbd>{Astro.locals.t('search.ctrlKey')}</kbd><kbd>K</kbd>
|
|
29
|
+
</kbd>
|
|
30
|
+
</button>
|
|
31
|
+
|
|
32
|
+
<dialog style="padding:0" aria-label={Astro.locals.t('search.label')}>
|
|
33
|
+
<div class="dialog-frame sl-flex">
|
|
34
|
+
{
|
|
35
|
+
/* TODO: Make the layout of this button flexible to accommodate different word lengths. Currently hard-coded for English: “Cancel” */
|
|
36
|
+
}
|
|
37
|
+
<button data-close-modal class="sl-flex md:sl-hidden">
|
|
38
|
+
{Astro.locals.t('search.cancelLabel')}
|
|
39
|
+
</button>
|
|
40
|
+
{
|
|
41
|
+
import.meta.env.DEV ? (
|
|
42
|
+
<div style="margin: auto; text-align: center; white-space: pre-line;" dir="ltr">
|
|
43
|
+
<p>{Astro.locals.t('search.devWarning')}</p>
|
|
44
|
+
</div>
|
|
45
|
+
) : (
|
|
46
|
+
<div class="search-container">
|
|
47
|
+
<div id="starlight__search" />
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
</div>
|
|
52
|
+
</dialog>
|
|
53
|
+
</site-search>
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
/**
|
|
57
|
+
* This is intentionally inlined to avoid briefly showing an invalid shortcut.
|
|
58
|
+
* Purposely using the deprecated `navigator.platform` property to detect Apple devices, as the
|
|
59
|
+
* user agent is spoofed by some browsers when opening the devtools.
|
|
60
|
+
*/
|
|
61
|
+
}
|
|
62
|
+
<script is:inline>
|
|
63
|
+
(() => {
|
|
64
|
+
const openBtn = document.querySelector('button[data-open-modal]');
|
|
65
|
+
const shortcut = openBtn?.querySelector('kbd');
|
|
66
|
+
if (!openBtn || !(shortcut instanceof HTMLElement)) return;
|
|
67
|
+
const platformKey = shortcut.querySelector('kbd');
|
|
68
|
+
if (platformKey && /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)) {
|
|
69
|
+
platformKey.textContent = '⌘';
|
|
70
|
+
openBtn.setAttribute('aria-keyshortcuts', 'Meta+K');
|
|
71
|
+
}
|
|
72
|
+
shortcut.style.display = '';
|
|
73
|
+
})();
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<script>
|
|
77
|
+
import { pagefindUserConfig } from 'virtual:starlight/pagefind-config';
|
|
78
|
+
|
|
79
|
+
class SiteSearch extends HTMLElement {
|
|
80
|
+
constructor() {
|
|
81
|
+
super();
|
|
82
|
+
const openBtn = this.querySelector<HTMLButtonElement>('button[data-open-modal]')!;
|
|
83
|
+
const closeBtn = this.querySelector<HTMLButtonElement>('button[data-close-modal]')!;
|
|
84
|
+
const dialog = this.querySelector('dialog')!;
|
|
85
|
+
const dialogFrame = this.querySelector('.dialog-frame')!;
|
|
86
|
+
|
|
87
|
+
/** Close the modal if a user clicks on a link or outside of the modal. */
|
|
88
|
+
const onClick = (event: MouseEvent) => {
|
|
89
|
+
const isLink = 'href' in (event.target || {});
|
|
90
|
+
if (
|
|
91
|
+
isLink ||
|
|
92
|
+
(document.body.contains(event.target as Node) &&
|
|
93
|
+
!dialogFrame.contains(event.target as Node))
|
|
94
|
+
) {
|
|
95
|
+
closeModal();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const openModal = (event?: MouseEvent) => {
|
|
100
|
+
dialog.showModal();
|
|
101
|
+
document.body.toggleAttribute('data-search-modal-open', true);
|
|
102
|
+
this.querySelector('input')?.focus();
|
|
103
|
+
event?.stopPropagation();
|
|
104
|
+
window.addEventListener('click', onClick);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const closeModal = () => dialog.close();
|
|
108
|
+
|
|
109
|
+
openBtn.addEventListener('click', openModal);
|
|
110
|
+
openBtn.disabled = false;
|
|
111
|
+
closeBtn.addEventListener('click', closeModal);
|
|
112
|
+
|
|
113
|
+
dialog.addEventListener('close', () => {
|
|
114
|
+
document.body.toggleAttribute('data-search-modal-open', false);
|
|
115
|
+
window.removeEventListener('click', onClick);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Listen for `ctrl + k` and `cmd + k` keyboard shortcuts.
|
|
119
|
+
window.addEventListener('keydown', (e) => {
|
|
120
|
+
if ((e.metaKey === true || e.ctrlKey === true) && e.key === 'k') {
|
|
121
|
+
dialog.open ? closeModal() : openModal();
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
let translations = {};
|
|
127
|
+
try {
|
|
128
|
+
translations = JSON.parse(this.dataset.translations || '{}');
|
|
129
|
+
} catch {}
|
|
130
|
+
|
|
131
|
+
const shouldStrip = this.dataset.stripTrailingSlash !== undefined;
|
|
132
|
+
const stripTrailingSlash = (path: string) => path.replace(/(.)\/(#.*)?$/, '$1$2');
|
|
133
|
+
const formatURL = shouldStrip ? stripTrailingSlash : (path: string) => path;
|
|
134
|
+
|
|
135
|
+
window.addEventListener('DOMContentLoaded', () => {
|
|
136
|
+
if (import.meta.env.DEV) return;
|
|
137
|
+
const onIdle = window.requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
138
|
+
onIdle(async () => {
|
|
139
|
+
// @ts-expect-error — Missing types for @pagefind/default-ui package.
|
|
140
|
+
const { PagefindUI } = await import('@pagefind/default-ui');
|
|
141
|
+
new PagefindUI({
|
|
142
|
+
...pagefindUserConfig,
|
|
143
|
+
element: '#starlight__search',
|
|
144
|
+
baseUrl: import.meta.env.BASE_URL,
|
|
145
|
+
bundlePath: import.meta.env.BASE_URL.replace(/\/$/, '') + '/pagefind/',
|
|
146
|
+
showImages: false,
|
|
147
|
+
translations,
|
|
148
|
+
showSubResults: true,
|
|
149
|
+
processResult: (result: { url: string; sub_results: Array<{ url: string }> }) => {
|
|
150
|
+
result.url = formatURL(result.url);
|
|
151
|
+
result.sub_results = result.sub_results.map((sub_result) => {
|
|
152
|
+
sub_result.url = formatURL(sub_result.url);
|
|
153
|
+
return sub_result;
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
customElements.define('site-search', SiteSearch);
|
|
162
|
+
</script>
|
|
163
|
+
|
|
164
|
+
<style>
|
|
165
|
+
@layer starlight.core {
|
|
166
|
+
site-search {
|
|
167
|
+
display: contents;
|
|
168
|
+
}
|
|
169
|
+
button[data-open-modal] {
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
gap: 0.5rem;
|
|
173
|
+
border: 0;
|
|
174
|
+
background-color: transparent;
|
|
175
|
+
color: var(--sl-color-gray-1);
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
height: 2.5rem;
|
|
178
|
+
font-size: var(--sl-text-xl);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@media (min-width: 50rem) {
|
|
182
|
+
button[data-open-modal] {
|
|
183
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
184
|
+
border-radius: 0.5rem;
|
|
185
|
+
padding-inline-start: 0.75rem;
|
|
186
|
+
padding-inline-end: 0.5rem;
|
|
187
|
+
background-color: var(--sl-color-black);
|
|
188
|
+
color: var(--sl-color-gray-2);
|
|
189
|
+
font-size: var(--sl-text-sm);
|
|
190
|
+
width: 100%;
|
|
191
|
+
max-width: 22rem;
|
|
192
|
+
}
|
|
193
|
+
button[data-open-modal]:hover {
|
|
194
|
+
border-color: var(--sl-color-gray-2);
|
|
195
|
+
color: var(--sl-color-white);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
button[data-open-modal] > :last-child {
|
|
199
|
+
margin-inline-start: auto;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
button > kbd {
|
|
204
|
+
border-radius: 0.25rem;
|
|
205
|
+
font-size: var(--sl-text-2xs);
|
|
206
|
+
gap: 0.25em;
|
|
207
|
+
padding-inline: 0.375rem;
|
|
208
|
+
background-color: var(--sl-color-gray-6);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
kbd {
|
|
212
|
+
font-family: var(--__sl-font);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
dialog {
|
|
216
|
+
margin: 0;
|
|
217
|
+
background-color: var(--sl-color-gray-6);
|
|
218
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
219
|
+
width: 100%;
|
|
220
|
+
max-width: 100%;
|
|
221
|
+
height: 100%;
|
|
222
|
+
max-height: 100%;
|
|
223
|
+
box-shadow: var(--sl-shadow-lg);
|
|
224
|
+
}
|
|
225
|
+
dialog[open] {
|
|
226
|
+
display: flex;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
dialog::backdrop {
|
|
230
|
+
background-color: var(--sl-color-backdrop-overlay);
|
|
231
|
+
-webkit-backdrop-filter: blur(0.25rem);
|
|
232
|
+
backdrop-filter: blur(0.25rem);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.dialog-frame {
|
|
236
|
+
position: relative;
|
|
237
|
+
overflow: auto;
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
flex-grow: 1;
|
|
240
|
+
gap: 1rem;
|
|
241
|
+
padding: 1rem;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
button[data-close-modal] {
|
|
245
|
+
position: absolute;
|
|
246
|
+
z-index: 1;
|
|
247
|
+
align-items: center;
|
|
248
|
+
align-self: flex-end;
|
|
249
|
+
height: calc(64px * var(--pagefind-ui-scale));
|
|
250
|
+
padding: 0.25rem;
|
|
251
|
+
border: 0;
|
|
252
|
+
background: transparent;
|
|
253
|
+
cursor: pointer;
|
|
254
|
+
color: var(--sl-color-text-accent);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
#starlight__search {
|
|
258
|
+
--pagefind-ui-primary: var(--sl-color-text);
|
|
259
|
+
--pagefind-ui-text: var(--sl-color-gray-2);
|
|
260
|
+
--pagefind-ui-font: var(--__sl-font);
|
|
261
|
+
--pagefind-ui-background: var(--sl-color-black);
|
|
262
|
+
--pagefind-ui-border: var(--sl-color-gray-5);
|
|
263
|
+
--pagefind-ui-border-width: 1px;
|
|
264
|
+
--pagefind-ui-tag: var(--sl-color-gray-5);
|
|
265
|
+
--sl-search-cancel-space: 5rem;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
:root[data-theme='light'] #starlight__search {
|
|
269
|
+
--pagefind-ui-tag: var(--sl-color-gray-6);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@media (min-width: 50rem) {
|
|
273
|
+
#starlight__search {
|
|
274
|
+
--sl-search-cancel-space: 0px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
dialog {
|
|
278
|
+
margin: 4rem auto auto;
|
|
279
|
+
border-radius: 0.5rem;
|
|
280
|
+
width: 90%;
|
|
281
|
+
max-width: 40rem;
|
|
282
|
+
height: max-content;
|
|
283
|
+
min-height: 15rem;
|
|
284
|
+
max-height: calc(100% - 8rem);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.dialog-frame {
|
|
288
|
+
padding: 1.5rem;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
</style>
|
|
293
|
+
|
|
294
|
+
<style is:global>
|
|
295
|
+
@import url('@pagefind/default-ui/css/ui.css') layer(starlight.core);
|
|
296
|
+
|
|
297
|
+
@layer starlight.core {
|
|
298
|
+
[data-search-modal-open] {
|
|
299
|
+
overflow: hidden;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
#starlight__search {
|
|
303
|
+
--sl-search-result-spacing: calc(1.25rem * var(--pagefind-ui-scale));
|
|
304
|
+
--sl-search-result-pad-inline-start: calc(3.75rem * var(--pagefind-ui-scale));
|
|
305
|
+
--sl-search-result-pad-inline-end: calc(1.25rem * var(--pagefind-ui-scale));
|
|
306
|
+
--sl-search-result-pad-block: calc(0.9375rem * var(--pagefind-ui-scale));
|
|
307
|
+
--sl-search-result-nested-pad-block: calc(0.625rem * var(--pagefind-ui-scale));
|
|
308
|
+
--sl-search-corners: calc(0.3125rem * var(--pagefind-ui-scale));
|
|
309
|
+
--sl-search-page-icon-size: calc(1.875rem * var(--pagefind-ui-scale));
|
|
310
|
+
--sl-search-page-icon-inline-start: calc(
|
|
311
|
+
(var(--sl-search-result-pad-inline-start) - var(--sl-search-page-icon-size)) / 2
|
|
312
|
+
);
|
|
313
|
+
--sl-search-tree-diagram-size: calc(2.5rem * var(--pagefind-ui-scale));
|
|
314
|
+
--sl-search-tree-diagram-inline-start: calc(
|
|
315
|
+
(var(--sl-search-result-pad-inline-start) - var(--sl-search-tree-diagram-size)) / 2
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
#starlight__search .pagefind-ui__form::before {
|
|
320
|
+
--pagefind-ui-text: var(--sl-color-gray-1);
|
|
321
|
+
opacity: 1;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
#starlight__search .pagefind-ui__search-input {
|
|
325
|
+
color: var(--sl-color-white);
|
|
326
|
+
font-weight: 400;
|
|
327
|
+
width: calc(100% - var(--sl-search-cancel-space));
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
#starlight__search input:focus {
|
|
331
|
+
--pagefind-ui-border: var(--sl-color-accent);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
#starlight__search .pagefind-ui__search-clear {
|
|
335
|
+
inset-inline-end: var(--sl-search-cancel-space);
|
|
336
|
+
width: calc(60px * var(--pagefind-ui-scale));
|
|
337
|
+
padding: 0;
|
|
338
|
+
background-color: transparent;
|
|
339
|
+
overflow: hidden;
|
|
340
|
+
}
|
|
341
|
+
#starlight__search .pagefind-ui__search-clear:focus {
|
|
342
|
+
outline: 1px solid var(--sl-color-accent);
|
|
343
|
+
}
|
|
344
|
+
#starlight__search .pagefind-ui__search-clear::before {
|
|
345
|
+
content: '';
|
|
346
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m13.41 12 6.3-6.29a1 1 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1 1 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 .33 1.64 1 1 0 0 0 1.09-.22l6.29-6.3 6.29 6.3a1 1 0 0 0 1.64-.33 1 1 0 0 0-.22-1.09L13.41 12Z'/%3E%3C/svg%3E")
|
|
347
|
+
center / 50% no-repeat;
|
|
348
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m13.41 12 6.3-6.29a1 1 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1 1 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 .33 1.64 1 1 0 0 0 1.09-.22l6.29-6.3 6.29 6.3a1 1 0 0 0 1.64-.33 1 1 0 0 0-.22-1.09L13.41 12Z'/%3E%3C/svg%3E")
|
|
349
|
+
center / 50% no-repeat;
|
|
350
|
+
background-color: var(--sl-color-text-accent);
|
|
351
|
+
display: block;
|
|
352
|
+
width: 100%;
|
|
353
|
+
height: 100%;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
#starlight__search .pagefind-ui__results > * + * {
|
|
357
|
+
margin-top: var(--sl-search-result-spacing);
|
|
358
|
+
}
|
|
359
|
+
#starlight__search .pagefind-ui__result {
|
|
360
|
+
border: 0;
|
|
361
|
+
padding: 0;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
#starlight__search .pagefind-ui__result-nested {
|
|
365
|
+
position: relative;
|
|
366
|
+
padding: var(--sl-search-result-nested-pad-block) var(--sl-search-result-pad-inline-end);
|
|
367
|
+
padding-inline-start: var(--sl-search-result-pad-inline-start);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
#starlight__search .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)),
|
|
371
|
+
#starlight__search .pagefind-ui__result-nested {
|
|
372
|
+
position: relative;
|
|
373
|
+
background-color: var(--sl-color-black);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
#starlight__search .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)):hover,
|
|
377
|
+
#starlight__search
|
|
378
|
+
.pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)):focus-within,
|
|
379
|
+
#starlight__search .pagefind-ui__result-nested:hover,
|
|
380
|
+
#starlight__search .pagefind-ui__result-nested:focus-within {
|
|
381
|
+
outline: 1px solid var(--sl-color-accent-high);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
#starlight__search
|
|
385
|
+
.pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)):focus-within,
|
|
386
|
+
#starlight__search .pagefind-ui__result-nested:focus-within {
|
|
387
|
+
background-color: var(--sl-color-accent-low);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
#starlight__search .pagefind-ui__result-thumb,
|
|
391
|
+
#starlight__search .pagefind-ui__result-inner {
|
|
392
|
+
margin-top: 0;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
#starlight__search .pagefind-ui__result-inner > :first-child {
|
|
396
|
+
border-radius: var(--sl-search-corners) var(--sl-search-corners) 0 0;
|
|
397
|
+
}
|
|
398
|
+
#starlight__search .pagefind-ui__result-inner > :last-child {
|
|
399
|
+
border-radius: 0 0 var(--sl-search-corners) var(--sl-search-corners);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
#starlight__search .pagefind-ui__result-inner > .pagefind-ui__result-title {
|
|
403
|
+
padding: var(--sl-search-result-pad-block) var(--sl-search-result-pad-inline-end);
|
|
404
|
+
padding-inline-start: var(--sl-search-result-pad-inline-start);
|
|
405
|
+
}
|
|
406
|
+
#starlight__search .pagefind-ui__result-inner > .pagefind-ui__result-title::before {
|
|
407
|
+
content: '';
|
|
408
|
+
position: absolute;
|
|
409
|
+
inset-block: 0;
|
|
410
|
+
inset-inline-start: var(--sl-search-page-icon-inline-start);
|
|
411
|
+
width: var(--sl-search-page-icon-size);
|
|
412
|
+
background: var(--sl-color-gray-3);
|
|
413
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E%3Cpath d='M9 10h1a1 1 0 1 0 0-2H9a1 1 0 0 0 0 2Zm0 2a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9Zm11-3V8l-6-6a1 1 0 0 0-1 0H7a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V9Zm-6-4 3 3h-2a1 1 0 0 1-1-1V5Zm4 14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5v3a3 3 0 0 0 3 3h3v9Zm-3-3H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2Z'/%3E%3C/svg%3E")
|
|
414
|
+
center no-repeat;
|
|
415
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E%3Cpath d='M9 10h1a1 1 0 1 0 0-2H9a1 1 0 0 0 0 2Zm0 2a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2H9Zm11-3V8l-6-6a1 1 0 0 0-1 0H7a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V9Zm-6-4 3 3h-2a1 1 0 0 1-1-1V5Zm4 14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5v3a3 3 0 0 0 3 3h3v9Zm-3-3H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2Z'/%3E%3C/svg%3E")
|
|
416
|
+
center no-repeat;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
#starlight__search .pagefind-ui__result-inner {
|
|
420
|
+
align-items: stretch;
|
|
421
|
+
gap: 1px;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
#starlight__search .pagefind-ui__result-link {
|
|
425
|
+
position: unset;
|
|
426
|
+
--pagefind-ui-text: var(--sl-color-white);
|
|
427
|
+
font-weight: 600;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
#starlight__search .pagefind-ui__result-link:hover {
|
|
431
|
+
text-decoration: none;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
#starlight__search .pagefind-ui__result-nested .pagefind-ui__result-link::before {
|
|
435
|
+
content: unset;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
#starlight__search .pagefind-ui__result-nested::before {
|
|
439
|
+
content: '';
|
|
440
|
+
position: absolute;
|
|
441
|
+
inset-block: 0;
|
|
442
|
+
inset-inline-start: var(--sl-search-tree-diagram-inline-start);
|
|
443
|
+
width: var(--sl-search-tree-diagram-size);
|
|
444
|
+
background: var(--sl-color-gray-4);
|
|
445
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E")
|
|
446
|
+
0% 0% / 100% no-repeat;
|
|
447
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' viewBox='0 0 16 1000' preserveAspectRatio='xMinYMin slice'%3E%3Cpath d='M8 0v1000m6-988H8'/%3E%3C/svg%3E")
|
|
448
|
+
0% 0% / 100% no-repeat;
|
|
449
|
+
}
|
|
450
|
+
#starlight__search .pagefind-ui__result-nested:last-of-type::before {
|
|
451
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='M8 0v12m6 0H8'/%3E%3C/svg%3E");
|
|
452
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='M8 0v12m6 0H8'/%3E%3C/svg%3E");
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/* Flip page and tree icons around the vertical axis when in an RTL layout. */
|
|
456
|
+
[dir='rtl'] .pagefind-ui__result-title::before,
|
|
457
|
+
[dir='rtl'] .pagefind-ui__result-nested::before {
|
|
458
|
+
transform: matrix(-1, 0, 0, 1, 0, 0);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
#starlight__search .pagefind-ui__result-link::after {
|
|
462
|
+
content: '';
|
|
463
|
+
position: absolute;
|
|
464
|
+
inset: 0;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
#starlight__search .pagefind-ui__result-excerpt {
|
|
468
|
+
font-size: calc(1rem * var(--pagefind-ui-scale));
|
|
469
|
+
overflow-wrap: anywhere;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
#starlight__search mark {
|
|
473
|
+
color: var(--sl-color-gray-2);
|
|
474
|
+
background-color: transparent;
|
|
475
|
+
font-weight: 600;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
#starlight__search .pagefind-ui__filter-value::before {
|
|
479
|
+
border-color: var(--sl-color-text-invert);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
#starlight__search .pagefind-ui__result-tags {
|
|
483
|
+
background-color: var(--sl-color-black);
|
|
484
|
+
margin-top: 0;
|
|
485
|
+
padding: var(--sl-search-result-nested-pad-block) var(--sl-search-result-pad-inline-end);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
</style>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Icon from '../user-components/Icon.astro';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
label: string;
|
|
6
|
+
icon: Parameters<typeof Icon>[0]['name'];
|
|
7
|
+
width?: string;
|
|
8
|
+
options: Array<{
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The `autocomplete="off"` attribute is used to prevent the browser from automatically selecting a
|
|
17
|
+
* value for this input, e.g. based on the user's previous selections, as this could lead to
|
|
18
|
+
* incorrect values being selected for example when the user switches between languages and uses
|
|
19
|
+
* the back button.
|
|
20
|
+
* Note that this attribute is only useful when a value is not restored at a later stage, e.g. the
|
|
21
|
+
* bfcache that ignores this attribute when restoring the value.
|
|
22
|
+
*/
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<label style={`--sl-select-width: ${Astro.props.width}`}>
|
|
26
|
+
<span class="sr-only">{Astro.props.label}</span>
|
|
27
|
+
<Icon name={Astro.props.icon} class="icon label-icon" />
|
|
28
|
+
<select autocomplete="off">
|
|
29
|
+
{
|
|
30
|
+
Astro.props.options.map(({ value, selected, label }) => (
|
|
31
|
+
<option value={value} selected={selected} set:html={label} />
|
|
32
|
+
))
|
|
33
|
+
}
|
|
34
|
+
</select>
|
|
35
|
+
<Icon name="down-caret" class="icon caret" />
|
|
36
|
+
</label>
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
@layer starlight.core {
|
|
40
|
+
label {
|
|
41
|
+
--sl-label-icon-size: 0.875rem;
|
|
42
|
+
--sl-caret-size: 1.25rem;
|
|
43
|
+
--sl-inline-padding: 0.5rem;
|
|
44
|
+
position: relative;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: 0.25rem;
|
|
48
|
+
color: var(--sl-color-gray-1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
label:hover {
|
|
52
|
+
color: var(--sl-color-gray-2);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.icon {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 50%;
|
|
58
|
+
transform: translateY(-50%);
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
select {
|
|
63
|
+
border: 0;
|
|
64
|
+
padding-block: 0.625rem;
|
|
65
|
+
padding-inline: calc(var(--sl-label-icon-size) + var(--sl-inline-padding) + 0.25rem)
|
|
66
|
+
calc(var(--sl-caret-size) + var(--sl-inline-padding) + 0.25rem);
|
|
67
|
+
margin-inline: calc(var(--sl-inline-padding) * -1);
|
|
68
|
+
width: calc(var(--sl-select-width) + var(--sl-inline-padding) * 2);
|
|
69
|
+
background-color: transparent;
|
|
70
|
+
text-overflow: ellipsis;
|
|
71
|
+
color: inherit;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
appearance: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
option {
|
|
77
|
+
background-color: var(--sl-color-bg-nav);
|
|
78
|
+
color: var(--sl-color-gray-1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (min-width: 50rem) {
|
|
82
|
+
select {
|
|
83
|
+
font-size: var(--sl-text-sm);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@layer starlight.components {
|
|
89
|
+
.label-icon {
|
|
90
|
+
font-size: var(--sl-label-icon-size);
|
|
91
|
+
inset-inline-start: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.caret {
|
|
95
|
+
font-size: var(--sl-caret-size);
|
|
96
|
+
inset-inline-end: 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import MobileMenuFooter from 'virtual:starlight/components/MobileMenuFooter';
|
|
3
|
+
import SidebarPersister from './SidebarPersister.astro';
|
|
4
|
+
import SidebarSublist from './SidebarSublist.astro';
|
|
5
|
+
|
|
6
|
+
const { sidebar } = Astro.locals.starlightRoute;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<SidebarPersister>
|
|
10
|
+
<SidebarSublist sublist={sidebar} />
|
|
11
|
+
</SidebarPersister>
|
|
12
|
+
|
|
13
|
+
<div class="md:sl-hidden">
|
|
14
|
+
<MobileMenuFooter />
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const scroller = document.getElementById("starlight__sidebar");
|
|
2
|
+
const target = scroller?.querySelector("sl-sidebar-state-persist");
|
|
3
|
+
const storageKey = "sl-sidebar-state";
|
|
4
|
+
const getState = () => {
|
|
5
|
+
let open = [];
|
|
6
|
+
const hash = target?.dataset.hash || "";
|
|
7
|
+
try {
|
|
8
|
+
const rawStoredState = sessionStorage.getItem(storageKey);
|
|
9
|
+
const storedState = JSON.parse(rawStoredState || "{}");
|
|
10
|
+
if (Array.isArray(storedState.open) && storedState.hash === hash) open = storedState.open;
|
|
11
|
+
} catch {
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
hash,
|
|
15
|
+
open,
|
|
16
|
+
scroll: scroller?.scrollTop || 0
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const storeState = (state) => {
|
|
20
|
+
try {
|
|
21
|
+
sessionStorage.setItem(storageKey, JSON.stringify(state));
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const updateState = () => storeState(getState());
|
|
26
|
+
const setToggleState = (open, detailsIndex) => {
|
|
27
|
+
const state = getState();
|
|
28
|
+
state.open[detailsIndex] = open;
|
|
29
|
+
storeState(state);
|
|
30
|
+
};
|
|
31
|
+
target?.addEventListener("click", (event) => {
|
|
32
|
+
if (!(event.target instanceof Element)) return;
|
|
33
|
+
const toggledDetails = event.target.closest("summary")?.closest("details");
|
|
34
|
+
if (!toggledDetails) return;
|
|
35
|
+
const restoreElement = toggledDetails.querySelector("sl-sidebar-restore");
|
|
36
|
+
const index = parseInt(restoreElement?.dataset.index || "");
|
|
37
|
+
if (isNaN(index)) return;
|
|
38
|
+
setToggleState(!toggledDetails.open, index);
|
|
39
|
+
});
|
|
40
|
+
addEventListener("visibilitychange", () => {
|
|
41
|
+
if (document.visibilityState === "hidden") updateState();
|
|
42
|
+
});
|
|
43
|
+
addEventListener("pageHide", updateState);
|