@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
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# @treeseed/core
|
|
2
|
+
|
|
3
|
+
`@treeseed/core` is the Treeseed runtime package for Astro/Starlight sites. It contains the published runtime, shared components and styles, forms and deploy helpers, plugin runtime wiring, and agent-facing utilities used by Treeseed tenants.
|
|
4
|
+
|
|
5
|
+
This repository is the package root. Run package commands from [`core`](./), not from the top-level `treeseed` workspace.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Node `>=20`
|
|
10
|
+
- npm `>=10`
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
For package contributors:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git submodule update --init --recursive
|
|
18
|
+
npm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This creates `package-lock.json`, installs dependencies, and runs the package `prepare` step to build `dist/`.
|
|
22
|
+
|
|
23
|
+
For CI or any fresh reproducible checkout:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm ci
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Package Layout
|
|
30
|
+
|
|
31
|
+
- `src/`: package source
|
|
32
|
+
- `scripts/`: build, release, and verification scripts
|
|
33
|
+
- `test/`: unit tests run by Vitest
|
|
34
|
+
- `.fixtures/treeseed-fixtures/`: pinned shared fixtures submodule
|
|
35
|
+
- `.github/workflows/`: CI and publish workflows for this package repo
|
|
36
|
+
- `templates/github/deploy.workflow.yml`: downstream tenant deploy workflow template
|
|
37
|
+
|
|
38
|
+
The package builds directly against the canonical working-site fixture in `treeseed-fixtures`.
|
|
39
|
+
|
|
40
|
+
## Commands
|
|
41
|
+
|
|
42
|
+
### Core development
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm run fixtures:check
|
|
46
|
+
npm run build:dist
|
|
47
|
+
npm run test:unit
|
|
48
|
+
npm run check
|
|
49
|
+
npm run build
|
|
50
|
+
npm run test:smoke
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
What they do:
|
|
54
|
+
|
|
55
|
+
- `fixtures:check`: verifies that the pinned shared fixture is initialized and usable
|
|
56
|
+
- `build:dist`: builds the publishable `dist/` package output
|
|
57
|
+
- `test:unit`: runs package unit tests with Vitest
|
|
58
|
+
- `check`: runs `astro check` against the internal fixture app
|
|
59
|
+
- `build`: builds the internal fixture app in production-like mode
|
|
60
|
+
- `test:smoke`: runs the packed-install smoke test
|
|
61
|
+
|
|
62
|
+
### Full verification
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm run verify
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`npm run verify` is an alias for `npm run release:verify`. The verification chain is:
|
|
69
|
+
|
|
70
|
+
1. `npm run build:dist`
|
|
71
|
+
2. `npm run test:unit`
|
|
72
|
+
3. `npm run check`
|
|
73
|
+
4. `npm run build`
|
|
74
|
+
5. `npm run test:smoke`
|
|
75
|
+
|
|
76
|
+
If this command passes, the package is in the same state expected by CI and the publish workflow.
|
|
77
|
+
|
|
78
|
+
### Release commands
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm run release:check-tag -- 0.0.1
|
|
82
|
+
npm run release:publish
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- `release:check-tag` validates that a git tag matches the version in [`package.json`](./package.json)
|
|
86
|
+
- `release:publish` publishes the package to npm
|
|
87
|
+
|
|
88
|
+
## GitHub Actions
|
|
89
|
+
|
|
90
|
+
This repo ships two package workflows:
|
|
91
|
+
|
|
92
|
+
- [`ci.yml`](./.github/workflows/ci.yml): runs on push and pull request, installs with `npm ci`, then runs `npm run verify`
|
|
93
|
+
- [`publish.yml`](./.github/workflows/publish.yml): runs on `workflow_dispatch` and on plain semver tags like `0.1.0`; it installs with `npm ci`, validates the tag with `release:check-tag`, runs `npm run verify`, and publishes with `NPM_TOKEN`
|
|
94
|
+
|
|
95
|
+
The deploy workflow template at [`templates/github/deploy.workflow.yml`](./templates/github/deploy.workflow.yml) is for downstream Treeseed site repositories, not for publishing this package.
|
|
96
|
+
|
|
97
|
+
## Consumer Contract
|
|
98
|
+
|
|
99
|
+
The package publishes built artifacts from `dist/` and exposes runtime entrypoints through [`package.json`](./package.json) `exports`.
|
|
100
|
+
|
|
101
|
+
The published package includes:
|
|
102
|
+
|
|
103
|
+
- `dist/`
|
|
104
|
+
- `tsconfigs/`
|
|
105
|
+
- `templates/`
|
|
106
|
+
- `style/`
|
|
107
|
+
- `utils/`
|
|
108
|
+
- `README.md`
|
|
109
|
+
|
|
110
|
+
The package currently depends on:
|
|
111
|
+
|
|
112
|
+
- `@treeseed/sdk`
|
|
113
|
+
- Astro and Starlight runtime packages
|
|
114
|
+
- Tailwind/Vite integration used by the site runtime
|
|
115
|
+
- Wrangler for Cloudflare-oriented runtime and deploy support
|
|
116
|
+
|
|
117
|
+
## Contributor Workflow
|
|
118
|
+
|
|
119
|
+
Typical local workflow:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npm install
|
|
123
|
+
npm run verify
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If you only need one stage:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm run test:unit
|
|
130
|
+
npm run check
|
|
131
|
+
npm run build
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
When changing exported package code, rerun `npm run build:dist` and then `npm run verify`.
|
|
135
|
+
|
|
136
|
+
## Publishing
|
|
137
|
+
|
|
138
|
+
Release flow for this repo:
|
|
139
|
+
|
|
140
|
+
1. Update the package version in [`package.json`](./package.json).
|
|
141
|
+
2. Run `npm run verify`.
|
|
142
|
+
3. Create a matching tag: `<version>` such as `0.1.0`.
|
|
143
|
+
4. Push the tag or run the publish workflow manually.
|
|
144
|
+
|
|
145
|
+
The publish workflow expects the npm auth token in `NPM_TOKEN`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function defineAgentHandlerRegistry(registry) {
|
|
2
|
+
return registry;
|
|
3
|
+
}
|
|
4
|
+
function resolveAgentHandlerFromRegistry(registry, kind) {
|
|
5
|
+
const handler = registry[kind];
|
|
6
|
+
if (!handler) {
|
|
7
|
+
throw new Error(`No runtime handler is registered for agent handler "${kind}".`);
|
|
8
|
+
}
|
|
9
|
+
return handler;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
defineAgentHandlerRegistry,
|
|
13
|
+
resolveAgentHandlerFromRegistry
|
|
14
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { resolveTreeseedTenantRoot } from "../tenant/config.js";
|
|
5
|
+
import { resolveAgentRuntimeProviders } from "../utils/plugin-runtime.js";
|
|
6
|
+
import { getTreeseedAgentProviderSelections } from "../deploy/runtime.js";
|
|
7
|
+
const BUILTIN_HANDLER_KINDS = [
|
|
8
|
+
"planner",
|
|
9
|
+
"architect",
|
|
10
|
+
"engineer",
|
|
11
|
+
"notifier",
|
|
12
|
+
"researcher",
|
|
13
|
+
"reviewer",
|
|
14
|
+
"releaser"
|
|
15
|
+
];
|
|
16
|
+
const HANDLER_EXPORT_NAMES = {
|
|
17
|
+
planner: "plannerHandler",
|
|
18
|
+
architect: "architectHandler",
|
|
19
|
+
engineer: "engineerHandler",
|
|
20
|
+
notifier: "notifierHandler",
|
|
21
|
+
researcher: "researcherHandler",
|
|
22
|
+
reviewer: "reviewerHandler",
|
|
23
|
+
releaser: "releaserHandler"
|
|
24
|
+
};
|
|
25
|
+
function getTenantAgentHandlerModulePath(kind, tenantRoot = resolveTreeseedTenantRoot()) {
|
|
26
|
+
return resolve(tenantRoot, "src/agents", `${kind}.ts`);
|
|
27
|
+
}
|
|
28
|
+
async function loadTenantAgentHandlerRegistry(tenantRoot = resolveTreeseedTenantRoot()) {
|
|
29
|
+
const registry = {};
|
|
30
|
+
for (const kind of BUILTIN_HANDLER_KINDS) {
|
|
31
|
+
const modulePath = getTenantAgentHandlerModulePath(kind, tenantRoot);
|
|
32
|
+
if (!existsSync(modulePath)) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
let moduleExports;
|
|
36
|
+
try {
|
|
37
|
+
moduleExports = await import(
|
|
38
|
+
/* @vite-ignore */
|
|
39
|
+
pathToFileURL(modulePath).href
|
|
40
|
+
);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
43
|
+
throw new Error(`Failed to import tenant agent handler "${kind}" from ${modulePath}: ${reason}`);
|
|
44
|
+
}
|
|
45
|
+
const exportName = HANDLER_EXPORT_NAMES[kind];
|
|
46
|
+
const handler = moduleExports[exportName];
|
|
47
|
+
if (!handler) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`Tenant agent handler module "${modulePath}" must export "${exportName}" for handler kind "${kind}".`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
const normalizedHandler = handler;
|
|
53
|
+
if (normalizedHandler.kind !== kind) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Tenant agent handler "${exportName}" from "${modulePath}" declares kind "${normalizedHandler.kind}", but "${kind}" was expected.`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
registry[kind] = normalizedHandler;
|
|
59
|
+
}
|
|
60
|
+
return registry;
|
|
61
|
+
}
|
|
62
|
+
const AGENT_HANDLER_REGISTRY = await loadTenantAgentHandlerRegistry();
|
|
63
|
+
function listRegisteredAgentHandlers() {
|
|
64
|
+
const runtimeProviders = resolveAgentRuntimeProviders(resolveTreeseedTenantRoot(), getTreeseedAgentProviderSelections());
|
|
65
|
+
return [.../* @__PURE__ */ new Set([...Object.keys(AGENT_HANDLER_REGISTRY), ...runtimeProviders.handlers.keys()])];
|
|
66
|
+
}
|
|
67
|
+
function resolveAgentHandler(kind) {
|
|
68
|
+
const runtimeProviders = resolveAgentRuntimeProviders(resolveTreeseedTenantRoot(), getTreeseedAgentProviderSelections());
|
|
69
|
+
const handler = AGENT_HANDLER_REGISTRY[kind] ?? runtimeProviders.handlers.get(kind);
|
|
70
|
+
if (!handler) {
|
|
71
|
+
if (BUILTIN_HANDLER_KINDS.includes(kind)) {
|
|
72
|
+
const expectedPath = getTenantAgentHandlerModulePath(kind);
|
|
73
|
+
const expectedExport = HANDLER_EXPORT_NAMES[kind];
|
|
74
|
+
throw new Error(
|
|
75
|
+
`No runtime handler is registered for agent handler "${kind}". Expected tenant file "${expectedPath}" exporting "${expectedExport}" or a plugin contribution.`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
throw new Error(`No runtime handler is registered for agent handler "${kind}".`);
|
|
79
|
+
}
|
|
80
|
+
return handler;
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
AGENT_HANDLER_REGISTRY,
|
|
84
|
+
getTenantAgentHandlerModulePath,
|
|
85
|
+
listRegisteredAgentHandlers,
|
|
86
|
+
loadTenantAgentHandlerRegistry,
|
|
87
|
+
resolveAgentHandler
|
|
88
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
const enabled = import.meta.env.TREESEED_PUBLIC_DEV_WATCH_RELOAD;
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
{
|
|
6
|
+
enabled && (
|
|
7
|
+
<script is:inline>
|
|
8
|
+
(() => {
|
|
9
|
+
const endpoint = '/__treeseed/dev-reload.json';
|
|
10
|
+
let currentBuildId = null;
|
|
11
|
+
|
|
12
|
+
async function poll() {
|
|
13
|
+
try {
|
|
14
|
+
const response = await fetch(`${endpoint}?t=${Date.now()}`, {
|
|
15
|
+
cache: 'no-store',
|
|
16
|
+
credentials: 'same-origin',
|
|
17
|
+
});
|
|
18
|
+
if (!response.ok) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const payload = await response.json();
|
|
23
|
+
if (!payload || typeof payload.buildId !== 'string') {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!currentBuildId) {
|
|
28
|
+
currentBuildId = payload.buildId;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (payload.buildId !== currentBuildId) {
|
|
33
|
+
window.location.reload();
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
// Ignore transient polling failures while the local worker rebuilds.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
poll();
|
|
41
|
+
window.setInterval(poll, 1200);
|
|
42
|
+
})();
|
|
43
|
+
</script>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { SITE } from '../utils/seo';
|
|
3
|
+
|
|
4
|
+
const { siteTitleHref } = Astro.locals.starlightRoute;
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<a href={siteTitleHref} class="site-header-custom sl-flex" aria-label={SITE.name}>
|
|
8
|
+
<img src={SITE.logo.src} alt={SITE.logo.alt} class="site-header-logo" />
|
|
9
|
+
<span class="site-header-copy">
|
|
10
|
+
<span class="site-header-name" translate="no">{SITE.name}</span>
|
|
11
|
+
<span class="site-header-statement">{SITE.statement}</span>
|
|
12
|
+
</span>
|
|
13
|
+
</a>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
@layer starlight.core {
|
|
17
|
+
.site-header-custom {
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 0.85rem;
|
|
20
|
+
color: var(--sl-color-white);
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.site-header-logo {
|
|
26
|
+
width: 2.5rem;
|
|
27
|
+
height: 2.5rem;
|
|
28
|
+
object-fit: contain;
|
|
29
|
+
flex: 0 0 auto;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.site-header-copy {
|
|
33
|
+
display: grid;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.site-header-name {
|
|
38
|
+
font-size: var(--sl-text-h4);
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
line-height: 1.1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.site-header-statement {
|
|
44
|
+
font-size: var(--sl-text-xs);
|
|
45
|
+
color: var(--sl-color-gray-3);
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { CONTENT_STATUSES, CONTENT_STATUS_META } from '../../utils/content-status';
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<section class="border-t border-[color:var(--site-border-strong)] pt-8">
|
|
6
|
+
<p class="text-sm font-semibold uppercase tracking-[0.18em] text-[color:var(--site-accent-strong)]">Content status legend</p>
|
|
7
|
+
<div class="mt-5 grid gap-3 md:grid-cols-2 xl:grid-cols-5">
|
|
8
|
+
{CONTENT_STATUSES.map((status) => {
|
|
9
|
+
const meta = CONTENT_STATUS_META[status];
|
|
10
|
+
return (
|
|
11
|
+
<div class:list={['border-l-4 bg-[color:var(--site-bg-soft)] px-4 py-4', meta.tone]}>
|
|
12
|
+
<p class="font-semibold">{meta.label}</p>
|
|
13
|
+
<p class="mt-2 text-sm leading-7 text-[color:var(--site-text-muted)]">{meta.description}</p>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
})}
|
|
17
|
+
</div>
|
|
18
|
+
</section>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ContentStatus } from '../../utils/content-status';
|
|
3
|
+
import { CONTENT_STATUS_META } from '../../utils/content-status';
|
|
4
|
+
|
|
5
|
+
const { status } = Astro.props as { status: ContentStatus };
|
|
6
|
+
const meta = CONTENT_STATUS_META[status];
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<span class:list={['inline-flex items-center rounded-sm border px-3 py-1 text-[0.72rem] font-bold uppercase tracking-[0.18em]', meta.tone]}>
|
|
10
|
+
{meta.label}
|
|
11
|
+
</span>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { getBookForPath } from '../../utils/starlight-nav';
|
|
3
|
+
|
|
4
|
+
const isBookPage = Boolean(getBookForPath(Astro.url.pathname));
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
{
|
|
8
|
+
isBookPage && (
|
|
9
|
+
<div class="book-font-controls print:hidden" data-book-font-controls>
|
|
10
|
+
<div class="book-font-controls__buttons" role="group" aria-label="Book text size">
|
|
11
|
+
<button
|
|
12
|
+
type="button"
|
|
13
|
+
class="book-font-controls__button"
|
|
14
|
+
data-book-font-action="decrease"
|
|
15
|
+
data-book-font-tooltip="Text size"
|
|
16
|
+
aria-label="Decrease book text size"
|
|
17
|
+
>
|
|
18
|
+
-
|
|
19
|
+
</button>
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
class="book-font-controls__button"
|
|
23
|
+
data-book-font-action="increase"
|
|
24
|
+
data-book-font-tooltip="Text size"
|
|
25
|
+
aria-label="Increase book text size"
|
|
26
|
+
>
|
|
27
|
+
+
|
|
28
|
+
</button>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
<script is:inline>
|
|
35
|
+
const storageKey = 'docs.book-font-scale';
|
|
36
|
+
const cssVariableName = '--docs-book-font-scale';
|
|
37
|
+
const defaultScale = 1;
|
|
38
|
+
const step = 0.1;
|
|
39
|
+
const minScale = 0.85;
|
|
40
|
+
const maxScale = 1.35;
|
|
41
|
+
|
|
42
|
+
const clampScale = (value) => Math.min(maxScale, Math.max(minScale, value));
|
|
43
|
+
|
|
44
|
+
const readScale = () => {
|
|
45
|
+
try {
|
|
46
|
+
const rawValue = localStorage.getItem(storageKey);
|
|
47
|
+
const parsedValue = rawValue === null ? defaultScale : Number(rawValue);
|
|
48
|
+
return Number.isFinite(parsedValue) ? clampScale(parsedValue) : defaultScale;
|
|
49
|
+
} catch {
|
|
50
|
+
return defaultScale;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const writeScale = (value) => {
|
|
55
|
+
try {
|
|
56
|
+
localStorage.setItem(storageKey, String(value));
|
|
57
|
+
} catch {
|
|
58
|
+
// Ignore storage failures and keep the reader controls functional.
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const updateButtons = (controls, value) => {
|
|
63
|
+
const decreaseButton = controls.querySelector('[data-book-font-action="decrease"]');
|
|
64
|
+
const increaseButton = controls.querySelector('[data-book-font-action="increase"]');
|
|
65
|
+
|
|
66
|
+
if (decreaseButton instanceof HTMLButtonElement) {
|
|
67
|
+
decreaseButton.disabled = value <= minScale;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (increaseButton instanceof HTMLButtonElement) {
|
|
71
|
+
increaseButton.disabled = value >= maxScale;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const applyScale = (controls, value) => {
|
|
76
|
+
const normalizedValue = clampScale(value);
|
|
77
|
+
document.documentElement.style.setProperty(cssVariableName, String(normalizedValue));
|
|
78
|
+
updateButtons(controls, normalizedValue);
|
|
79
|
+
return normalizedValue;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const bindControls = () => {
|
|
83
|
+
for (const controls of document.querySelectorAll('[data-book-font-controls]')) {
|
|
84
|
+
if (!(controls instanceof HTMLElement) || controls.dataset.bookFontBound === 'true') continue;
|
|
85
|
+
controls.dataset.bookFontBound = 'true';
|
|
86
|
+
|
|
87
|
+
const currentValue = applyScale(controls, readScale());
|
|
88
|
+
controls.dataset.bookFontScale = String(currentValue);
|
|
89
|
+
|
|
90
|
+
for (const button of controls.querySelectorAll('[data-book-font-action]')) {
|
|
91
|
+
if (!(button instanceof HTMLButtonElement)) continue;
|
|
92
|
+
button.addEventListener('click', () => {
|
|
93
|
+
const direction = button.dataset.bookFontAction === 'decrease' ? -1 : 1;
|
|
94
|
+
const nextValue = applyScale(controls, readScale() + direction * step);
|
|
95
|
+
writeScale(nextValue);
|
|
96
|
+
controls.dataset.bookFontScale = String(nextValue);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
bindControls();
|
|
103
|
+
document.addEventListener('astro:page-load', bindControls);
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<style>
|
|
107
|
+
.book-font-controls {
|
|
108
|
+
display: inline-flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
color: var(--sl-color-text);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.book-font-controls__buttons {
|
|
114
|
+
display: inline-flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
border: 1px solid var(--site-border-strong);
|
|
117
|
+
border-radius: 999px;
|
|
118
|
+
background: color-mix(in srgb, var(--site-bg-elevated) 78%, white 22%);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.book-font-controls__button {
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
width: 2rem;
|
|
126
|
+
height: 2rem;
|
|
127
|
+
border: 0;
|
|
128
|
+
background: transparent;
|
|
129
|
+
color: var(--site-text);
|
|
130
|
+
font-size: 1rem;
|
|
131
|
+
font-weight: 700;
|
|
132
|
+
line-height: 1;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
position: relative;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.book-font-controls__button + .book-font-controls__button {
|
|
138
|
+
border-inline-start: 1px solid var(--site-border-strong);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.book-font-controls__button:hover,
|
|
142
|
+
.book-font-controls__button:focus-visible {
|
|
143
|
+
background: color-mix(in srgb, var(--site-blue-soft) 66%, white 34%);
|
|
144
|
+
color: var(--site-blue-strong);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.book-font-controls__button::after {
|
|
148
|
+
content: attr(data-book-font-tooltip);
|
|
149
|
+
position: absolute;
|
|
150
|
+
inset-inline-start: 50%;
|
|
151
|
+
inset-block-start: calc(100% + 0.45rem);
|
|
152
|
+
transform: translateX(-50%) translateY(-0.2rem);
|
|
153
|
+
padding: 0.3rem 0.5rem;
|
|
154
|
+
border: 1px solid var(--site-border-strong);
|
|
155
|
+
border-radius: 0.45rem;
|
|
156
|
+
background: color-mix(in srgb, var(--site-bg-elevated) 88%, white 12%);
|
|
157
|
+
color: var(--site-text);
|
|
158
|
+
font-size: 0.76rem;
|
|
159
|
+
font-weight: 700;
|
|
160
|
+
letter-spacing: 0.04em;
|
|
161
|
+
text-transform: uppercase;
|
|
162
|
+
white-space: nowrap;
|
|
163
|
+
opacity: 0;
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
transition:
|
|
166
|
+
opacity 140ms ease,
|
|
167
|
+
transform 140ms ease;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.book-font-controls__button:hover::after,
|
|
171
|
+
.book-font-controls__button:focus-visible::after {
|
|
172
|
+
opacity: 1;
|
|
173
|
+
transform: translateX(-50%) translateY(0);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.book-font-controls__button:disabled {
|
|
177
|
+
opacity: 0.45;
|
|
178
|
+
cursor: not-allowed;
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
side: 'left' | 'right';
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const { side, label } = Astro.props;
|
|
8
|
+
|
|
9
|
+
const sidebarId = side === 'left' ? 'starlight__sidebar' : 'starlight__page-toc';
|
|
10
|
+
const iconPath =
|
|
11
|
+
side === 'left'
|
|
12
|
+
? 'M15.75 19.5 8.25 12l7.5-7.5'
|
|
13
|
+
: 'M8.25 4.5 15.75 12l-7.5 7.5';
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<button
|
|
17
|
+
type="button"
|
|
18
|
+
class="desktop-sidebar-toggle"
|
|
19
|
+
data-docs-sidebar-toggle={side}
|
|
20
|
+
data-label={label}
|
|
21
|
+
aria-controls={sidebarId}
|
|
22
|
+
aria-expanded="false"
|
|
23
|
+
>
|
|
24
|
+
<span class="desktop-sidebar-toggle__icon" aria-hidden="true">
|
|
25
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
26
|
+
<path d={iconPath} />
|
|
27
|
+
</svg>
|
|
28
|
+
</span>
|
|
29
|
+
<span class="desktop-sidebar-toggle__text">{label}</span>
|
|
30
|
+
</button>
|
|
31
|
+
|
|
32
|
+
<style>
|
|
33
|
+
@layer starlight.components {
|
|
34
|
+
.desktop-sidebar-toggle {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (min-width: 72rem) {
|
|
39
|
+
.desktop-sidebar-toggle {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 0.45rem;
|
|
43
|
+
border: 1px solid var(--sl-color-hairline);
|
|
44
|
+
border-radius: 999px;
|
|
45
|
+
padding: 0.45rem 0.8rem;
|
|
46
|
+
background: color-mix(in srgb, var(--site-bg-soft) 84%, white 16%);
|
|
47
|
+
color: var(--site-text-muted);
|
|
48
|
+
font-size: 0.85rem;
|
|
49
|
+
line-height: 1;
|
|
50
|
+
transition:
|
|
51
|
+
background-color 160ms ease,
|
|
52
|
+
border-color 160ms ease,
|
|
53
|
+
color 160ms ease;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.desktop-sidebar-toggle:hover,
|
|
57
|
+
.desktop-sidebar-toggle:focus-visible {
|
|
58
|
+
background: color-mix(in srgb, var(--site-blue-soft) 52%, white 48%);
|
|
59
|
+
border-color: var(--site-blue);
|
|
60
|
+
color: var(--site-text);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.desktop-sidebar-toggle[aria-expanded='true'] {
|
|
64
|
+
background: color-mix(in srgb, var(--site-blue-soft) 68%, white 32%);
|
|
65
|
+
border-color: var(--site-blue);
|
|
66
|
+
color: var(--site-text);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.desktop-sidebar-toggle__icon {
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
width: 1rem;
|
|
74
|
+
height: 1rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.desktop-sidebar-toggle__icon svg {
|
|
78
|
+
width: 1rem;
|
|
79
|
+
height: 1rem;
|
|
80
|
+
fill: none;
|
|
81
|
+
stroke: currentColor;
|
|
82
|
+
stroke-width: 1.8;
|
|
83
|
+
stroke-linecap: round;
|
|
84
|
+
stroke-linejoin: round;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { getDocsDownloadForPath } from '../../utils/starlight-nav';
|
|
3
|
+
|
|
4
|
+
const download = getDocsDownloadForPath(Astro.url.pathname);
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
{
|
|
8
|
+
download && (
|
|
9
|
+
<a
|
|
10
|
+
href={download.downloadHref}
|
|
11
|
+
download={download.downloadFileName}
|
|
12
|
+
aria-label={download.downloadTitle}
|
|
13
|
+
class="download-button docs-download-button print:hidden"
|
|
14
|
+
>
|
|
15
|
+
<svg
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
width="16"
|
|
18
|
+
height="16"
|
|
19
|
+
viewBox="0 0 24 24"
|
|
20
|
+
fill="none"
|
|
21
|
+
stroke="currentColor"
|
|
22
|
+
stroke-width="2"
|
|
23
|
+
stroke-linecap="round"
|
|
24
|
+
stroke-linejoin="round"
|
|
25
|
+
aria-hidden="true"
|
|
26
|
+
>
|
|
27
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
|
28
|
+
<polyline points="7 10 12 15 17 10" />
|
|
29
|
+
<line x1="12" x2="12" y1="15" y2="3" />
|
|
30
|
+
</svg>
|
|
31
|
+
<span>Download Book</span>
|
|
32
|
+
</a>
|
|
33
|
+
)
|
|
34
|
+
}
|