@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,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { processSteps } from './rehype-steps';
|
|
3
|
+
|
|
4
|
+
const content = await Astro.slots.render('default');
|
|
5
|
+
const { html } = processSteps(content);
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<Fragment set:html={html} />
|
|
9
|
+
|
|
10
|
+
<style is:global>
|
|
11
|
+
@layer starlight.components {
|
|
12
|
+
.sl-steps {
|
|
13
|
+
--bullet-size: calc(var(--sl-line-height) * 1rem);
|
|
14
|
+
--bullet-margin: 0.375rem;
|
|
15
|
+
|
|
16
|
+
list-style: none;
|
|
17
|
+
counter-reset: steps-counter var(--sl-steps-start, 0);
|
|
18
|
+
padding-inline-start: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.sl-steps > li {
|
|
22
|
+
counter-increment: steps-counter;
|
|
23
|
+
position: relative;
|
|
24
|
+
padding-inline-start: calc(var(--bullet-size) + 1rem);
|
|
25
|
+
/* HACK: Keeps any `margin-bottom` inside the `<li>`’s padding box to avoid gaps in the hairline border. */
|
|
26
|
+
padding-bottom: 1px;
|
|
27
|
+
/* Prevent bullets from touching in short list items. */
|
|
28
|
+
min-height: calc(var(--bullet-size) + var(--bullet-margin));
|
|
29
|
+
}
|
|
30
|
+
.sl-steps > li + li {
|
|
31
|
+
/* Remove margin between steps. */
|
|
32
|
+
margin-top: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Custom list marker element. */
|
|
36
|
+
.sl-steps > li::before {
|
|
37
|
+
content: counter(steps-counter);
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 0;
|
|
40
|
+
inset-inline-start: 0;
|
|
41
|
+
width: var(--bullet-size);
|
|
42
|
+
height: var(--bullet-size);
|
|
43
|
+
line-height: var(--bullet-size);
|
|
44
|
+
|
|
45
|
+
font-size: var(--sl-text-xs);
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
text-align: center;
|
|
48
|
+
color: var(--sl-color-white);
|
|
49
|
+
background-color: var(--sl-color-gray-6);
|
|
50
|
+
border-radius: 99rem;
|
|
51
|
+
box-shadow: inset 0 0 0 1px var(--sl-color-gray-5);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Vertical guideline linking list numbers. */
|
|
55
|
+
.sl-steps > li::after {
|
|
56
|
+
--guide-width: 1px;
|
|
57
|
+
content: '';
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: calc(var(--bullet-size) + var(--bullet-margin));
|
|
60
|
+
bottom: var(--bullet-margin);
|
|
61
|
+
inset-inline-start: calc((var(--bullet-size) - var(--guide-width)) / 2);
|
|
62
|
+
width: var(--guide-width);
|
|
63
|
+
background-color: var(--sl-color-hairline-light);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@layer starlight.content {
|
|
68
|
+
/* Adjust first item inside a step so that it aligns vertically with the number
|
|
69
|
+
even if using a larger font size (e.g. a heading) */
|
|
70
|
+
.sl-steps > li > :first-child {
|
|
71
|
+
/*
|
|
72
|
+
The `lh` unit is not yet supported by all browsers in our support matrix
|
|
73
|
+
— see https://caniuse.com/mdn-css_types_length_lh
|
|
74
|
+
In unsupported browsers we approximate this using our known line-heights.
|
|
75
|
+
*/
|
|
76
|
+
--lh: calc(1em * var(--sl-line-height));
|
|
77
|
+
--shift-y: calc(0.5 * (var(--bullet-size) - var(--lh)));
|
|
78
|
+
transform: translateY(var(--shift-y));
|
|
79
|
+
margin-bottom: var(--shift-y);
|
|
80
|
+
}
|
|
81
|
+
.sl-steps > li > :first-child:where(h1, h2, h3, h4, h5, h6) {
|
|
82
|
+
--lh: calc(1em * var(--sl-line-height-headings));
|
|
83
|
+
}
|
|
84
|
+
@supports (--prop: 1lh) {
|
|
85
|
+
.sl-steps > li > :first-child {
|
|
86
|
+
--lh: 1lh;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { TabItemTagname } from './rehype-tabs';
|
|
3
|
+
import type { StarlightIcon } from '../components/Icons';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
icon?: StarlightIcon;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { icon, label } = Astro.props;
|
|
11
|
+
|
|
12
|
+
if (!label) {
|
|
13
|
+
throw new Error('Missing prop `label` on `<TabItem>` component.');
|
|
14
|
+
}
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<TabItemTagname data-label={label} data-icon={icon}>
|
|
18
|
+
<slot />
|
|
19
|
+
</TabItemTagname>
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Icon from './Icon.astro';
|
|
3
|
+
import { processPanels } from './rehype-tabs';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
syncKey?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { syncKey } = Astro.props;
|
|
10
|
+
const panelHtml = await Astro.slots.render('default');
|
|
11
|
+
const { html, panels } = processPanels(panelHtml);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Synced tabs are persisted across page using `localStorage`. The script used to restore the
|
|
15
|
+
* active tab for a given sync key has a few requirements:
|
|
16
|
+
*
|
|
17
|
+
* - The script should only be included when at least one set of synced tabs is present on the page.
|
|
18
|
+
* - The script should be inlined to avoid a flash of invalid active tab.
|
|
19
|
+
* - The script should only be included once per page.
|
|
20
|
+
*
|
|
21
|
+
* To do so, we keep track of whether the script has been rendered using a variable stored using
|
|
22
|
+
* `Astro.locals` which will be reset for each new page. The value is tracked using an untyped
|
|
23
|
+
* symbol on purpose to avoid Starlight users to get autocomplete for it and avoid potential
|
|
24
|
+
* clashes with user-defined variables.
|
|
25
|
+
*
|
|
26
|
+
* The restore script defines a custom element `starlight-tabs-restore` that will be included in
|
|
27
|
+
* each set of synced tabs to restore the active tab based on the persisted value using the
|
|
28
|
+
* `connectedCallback` lifecycle method. To ensure this callback can access all tabs and panels for
|
|
29
|
+
* the current set of tabs, the script should be rendered before the tabs themselves.
|
|
30
|
+
*/
|
|
31
|
+
const isSynced = syncKey !== undefined;
|
|
32
|
+
const didRenderSyncedTabsRestoreScriptSymbol = Symbol.for('starlight:did-render-synced-tabs-restore-script');
|
|
33
|
+
// @ts-expect-error - See above
|
|
34
|
+
const shouldRenderSyncedTabsRestoreScript = isSynced && Astro.locals[didRenderSyncedTabsRestoreScriptSymbol] !== true;
|
|
35
|
+
|
|
36
|
+
if (isSynced) {
|
|
37
|
+
// @ts-expect-error - See above
|
|
38
|
+
Astro.locals[didRenderSyncedTabsRestoreScriptSymbol] = true
|
|
39
|
+
}
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
{/* Inlined to avoid a flash of invalid active tab. */}
|
|
43
|
+
{shouldRenderSyncedTabsRestoreScript && <script is:inline>
|
|
44
|
+
(() => {
|
|
45
|
+
class StarlightTabsRestore extends HTMLElement {
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
const starlightTabs = this.closest('starlight-tabs');
|
|
48
|
+
if (!(starlightTabs instanceof HTMLElement) || typeof localStorage === 'undefined') return;
|
|
49
|
+
const syncKey = starlightTabs.dataset.syncKey;
|
|
50
|
+
if (!syncKey) return;
|
|
51
|
+
const label = localStorage.getItem(`starlight-synced-tabs__${syncKey}`);
|
|
52
|
+
if (!label) return;
|
|
53
|
+
const tabs = [...starlightTabs?.querySelectorAll('[role="tab"]')];
|
|
54
|
+
const tabIndexToRestore = tabs.findIndex(
|
|
55
|
+
(tab) => tab instanceof HTMLAnchorElement && tab.textContent?.trim() === label
|
|
56
|
+
);
|
|
57
|
+
const panels = starlightTabs?.querySelectorAll(':scope > [role="tabpanel"]');
|
|
58
|
+
const newTab = tabs[tabIndexToRestore];
|
|
59
|
+
const newPanel = panels[tabIndexToRestore];
|
|
60
|
+
if (tabIndexToRestore < 1 || !newTab || !newPanel) return;
|
|
61
|
+
tabs[0]?.setAttribute('aria-selected', 'false');
|
|
62
|
+
tabs[0]?.setAttribute('tabindex', '-1');
|
|
63
|
+
panels?.[0]?.setAttribute('hidden', 'true');
|
|
64
|
+
newTab.removeAttribute('tabindex');
|
|
65
|
+
newTab.setAttribute('aria-selected', 'true');
|
|
66
|
+
newPanel.removeAttribute('hidden');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
customElements.define('starlight-tabs-restore', StarlightTabsRestore);
|
|
70
|
+
})()
|
|
71
|
+
</script>}
|
|
72
|
+
|
|
73
|
+
<starlight-tabs data-sync-key={syncKey}>
|
|
74
|
+
{
|
|
75
|
+
panels && (
|
|
76
|
+
<div class="tablist-wrapper not-content">
|
|
77
|
+
<ul role="tablist">
|
|
78
|
+
{panels.map(({ icon, label, panelId, tabId }, idx) => (
|
|
79
|
+
<li role="presentation" class="tab">
|
|
80
|
+
<a
|
|
81
|
+
role="tab"
|
|
82
|
+
href={'#' + panelId}
|
|
83
|
+
id={tabId}
|
|
84
|
+
aria-selected={idx === 0 ? 'true' : 'false'}
|
|
85
|
+
tabindex={idx !== 0 ? -1 : 0}
|
|
86
|
+
>
|
|
87
|
+
{icon && <Icon name={icon} />}
|
|
88
|
+
{label}
|
|
89
|
+
</a>
|
|
90
|
+
</li>
|
|
91
|
+
))}
|
|
92
|
+
</ul>
|
|
93
|
+
</div>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
<Fragment set:html={html} />
|
|
97
|
+
{isSynced && <starlight-tabs-restore />}
|
|
98
|
+
</starlight-tabs>
|
|
99
|
+
|
|
100
|
+
<style>
|
|
101
|
+
@layer starlight.components {
|
|
102
|
+
starlight-tabs {
|
|
103
|
+
display: block;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.tablist-wrapper {
|
|
107
|
+
overflow-x: auto;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[role='tablist'] {
|
|
111
|
+
display: flex;
|
|
112
|
+
list-style: none;
|
|
113
|
+
border-bottom: 2px solid var(--sl-color-gray-5);
|
|
114
|
+
padding: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.tab {
|
|
118
|
+
display: flex;
|
|
119
|
+
}
|
|
120
|
+
.tab > [role='tab'] {
|
|
121
|
+
--sl-tab-color-border: var(--sl-color-gray-5);
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
gap: 0.5rem;
|
|
125
|
+
line-height: var(--sl-line-height-headings);
|
|
126
|
+
padding: 0.275rem 1.25rem;
|
|
127
|
+
text-decoration: none;
|
|
128
|
+
box-shadow: 0 2px 0 var(--sl-tab-color-border);
|
|
129
|
+
color: var(--sl-color-gray-3);
|
|
130
|
+
outline-offset: var(--sl-outline-offset-inside);
|
|
131
|
+
overflow-wrap: initial;
|
|
132
|
+
}
|
|
133
|
+
.tab [role='tab'][aria-selected='true'] {
|
|
134
|
+
--sl-tab-color-border: var(--sl-color-text-accent);
|
|
135
|
+
color: var(--sl-color-white);
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.tablist-wrapper ~ :global([role='tabpanel']) {
|
|
140
|
+
margin-top: 1rem;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
144
|
+
|
|
145
|
+
<script>
|
|
146
|
+
class StarlightTabs extends HTMLElement {
|
|
147
|
+
// A map of sync keys to all tabs that are synced to that key.
|
|
148
|
+
static #syncedTabs = new Map<string, StarlightTabs[]>();
|
|
149
|
+
|
|
150
|
+
tabs: HTMLAnchorElement[];
|
|
151
|
+
panels: HTMLElement[];
|
|
152
|
+
#syncKey: string | undefined;
|
|
153
|
+
// The storage key prefix should be in sync with the one used in the restore script.
|
|
154
|
+
#storageKeyPrefix = 'starlight-synced-tabs__';
|
|
155
|
+
|
|
156
|
+
constructor() {
|
|
157
|
+
super();
|
|
158
|
+
const tablist = this.querySelector<HTMLUListElement>('[role="tablist"]')!;
|
|
159
|
+
this.tabs = [...tablist.querySelectorAll<HTMLAnchorElement>('[role="tab"]')];
|
|
160
|
+
this.panels = [...this.querySelectorAll<HTMLElement>(':scope > [role="tabpanel"]')];
|
|
161
|
+
this.#syncKey = this.dataset.syncKey;
|
|
162
|
+
|
|
163
|
+
if (this.#syncKey) {
|
|
164
|
+
const syncedTabs = StarlightTabs.#syncedTabs.get(this.#syncKey) ?? [];
|
|
165
|
+
syncedTabs.push(this);
|
|
166
|
+
StarlightTabs.#syncedTabs.set(this.#syncKey, syncedTabs);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
this.tabs.forEach((tab, i) => {
|
|
170
|
+
// Handle clicks for mouse users
|
|
171
|
+
tab.addEventListener('click', (e) => {
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
const currentTab = tablist.querySelector('[aria-selected="true"]');
|
|
174
|
+
if (e.currentTarget !== currentTab) {
|
|
175
|
+
this.switchTab(e.currentTarget as HTMLAnchorElement, i);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// Handle keyboard input
|
|
180
|
+
tab.addEventListener('keydown', (e) => {
|
|
181
|
+
const index = this.tabs.indexOf(e.currentTarget as any);
|
|
182
|
+
// Work out which key the user is pressing and
|
|
183
|
+
// Calculate the new tab's index where appropriate
|
|
184
|
+
const nextIndex =
|
|
185
|
+
e.key === 'ArrowLeft'
|
|
186
|
+
? index - 1
|
|
187
|
+
: e.key === 'ArrowRight'
|
|
188
|
+
? index + 1
|
|
189
|
+
: e.key === 'Home'
|
|
190
|
+
? 0
|
|
191
|
+
: e.key === 'End'
|
|
192
|
+
? this.tabs.length - 1
|
|
193
|
+
: null;
|
|
194
|
+
if (nextIndex === null) return;
|
|
195
|
+
if (this.tabs[nextIndex]) {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
this.switchTab(this.tabs[nextIndex], nextIndex);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
switchTab(newTab: HTMLAnchorElement | null | undefined, index: number, shouldSync = true) {
|
|
204
|
+
if (!newTab) return;
|
|
205
|
+
|
|
206
|
+
// If tabs should be synced, we store the current position so we can restore it after
|
|
207
|
+
// switching tabs to prevent the page from jumping when the new tab content is of a different
|
|
208
|
+
// height than the previous tab.
|
|
209
|
+
const previousTabsOffset = shouldSync ? this.getBoundingClientRect().top : 0;
|
|
210
|
+
|
|
211
|
+
// Mark all tabs as unselected and hide all tab panels.
|
|
212
|
+
this.tabs.forEach((tab) => {
|
|
213
|
+
tab.setAttribute('aria-selected', 'false');
|
|
214
|
+
tab.setAttribute('tabindex', '-1');
|
|
215
|
+
});
|
|
216
|
+
this.panels.forEach((oldPanel) => {
|
|
217
|
+
oldPanel.hidden = true;
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// Show new panel and mark new tab as selected.
|
|
221
|
+
const newPanel = this.panels[index];
|
|
222
|
+
if (newPanel) newPanel.hidden = false;
|
|
223
|
+
// Restore active tab to the default tab order.
|
|
224
|
+
newTab.removeAttribute('tabindex');
|
|
225
|
+
newTab.setAttribute('aria-selected', 'true');
|
|
226
|
+
if (shouldSync) {
|
|
227
|
+
newTab.focus();
|
|
228
|
+
StarlightTabs.#syncTabs(this, newTab);
|
|
229
|
+
window.scrollTo({
|
|
230
|
+
top: window.scrollY + (this.getBoundingClientRect().top - previousTabsOffset),
|
|
231
|
+
behavior: 'instant',
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
#persistSyncedTabs(label: string) {
|
|
237
|
+
if (!this.#syncKey || typeof localStorage === 'undefined') return;
|
|
238
|
+
localStorage.setItem(this.#storageKeyPrefix + this.#syncKey, label);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
static #syncTabs(emitter: StarlightTabs, newTab: HTMLAnchorElement) {
|
|
242
|
+
const syncKey = emitter.#syncKey;
|
|
243
|
+
const label = StarlightTabs.#getTabLabel(newTab);
|
|
244
|
+
if (!syncKey || !label) return;
|
|
245
|
+
const syncedTabs = StarlightTabs.#syncedTabs.get(syncKey);
|
|
246
|
+
if (!syncedTabs) return;
|
|
247
|
+
|
|
248
|
+
for (const receiver of syncedTabs) {
|
|
249
|
+
if (receiver === emitter) continue;
|
|
250
|
+
const labelIndex = receiver.tabs.findIndex((tab) => StarlightTabs.#getTabLabel(tab) === label);
|
|
251
|
+
if (labelIndex === -1) continue;
|
|
252
|
+
receiver.switchTab(receiver.tabs[labelIndex], labelIndex, false);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
emitter.#persistSyncedTabs(label);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
static #getTabLabel(tab: HTMLAnchorElement) {
|
|
259
|
+
// `textContent` returns the content of all elements. In the case of a tab with an icon, this
|
|
260
|
+
// could potentially include extra spaces due to the presence of the SVG icon.
|
|
261
|
+
// To sync tabs with the same sync key and label, no matter the presence of an icon, we trim
|
|
262
|
+
// these extra spaces.
|
|
263
|
+
return tab.textContent?.trim();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
customElements.define('starlight-tabs', StarlightTabs);
|
|
268
|
+
</script>
|