diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3bb497..4dffcfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,6 +94,7 @@ jobs: HUB_PROJECTS_DIR=tests/fixtures/projects-run \ HUB_META_CACHE=tests/.tmp/drill-cache.json \ HUB_META_REPORT=tests/.tmp/drill-report.json \ + HUB_SKIP_OG=1 \ pnpm build test -f dist/index.html grep -q '"degradedToEmpty": 2' tests/.tmp/drill-report.json diff --git a/.gitignore b/.gitignore index dd799c3..9dea0c7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ dist/ # 构建期生成的抓取报告(内容每次变化,不入库) github-meta-report.json +og-report.json # 本地环境变量与编辑器 .env diff --git a/README.md b/README.md index a0cc510..ff7eeb9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Cloudflare Workers 生态的中文精选应用目录:官方自研项目 + 经 **本站是纯静态站点**:无后端、无数据库、无鉴权、无站点级 secret(SPEC v1.4 §0 明示例外项)。构建产物是纯静态 HTML,同时发布到主站 `hub.oneboy.app`(Cloudflare Pages)与镜像 `workerhub.github.io`(GitHub Pages),canonical 恒写主域名。 -> 本仓库当前处于 S1-A + S2-B 阶段:脚手架、数据管线(schema 校验 + GitHub 自动字段抓取 + 缓存降级)、投稿基建(CONTRIBUTING / PR 模板 / 投稿数据校验)。正式页面与组件、内容数据、双线部署分属后续子单,见文末「范围」。 +> 当前进度:S1-A 脚手架与数据管线、S1-B 内容数据(官方 7 + 第三方 4)、S2-A 页面与组件(页面 / 统一卡片 / 搜索筛选排序 / 主题三档 / SEO)、S2-B 投稿基建(CONTRIBUTING / PR 模板 / 投稿数据校验)均已交付;双线部署(S3)分属后续子单,见文末「范围」。 ## 技术栈(SPEC §8.1) @@ -67,15 +67,19 @@ astro build 每项目详情页 / 列表页读「人工 生产构建无需任何变量。以下只用于本地调试、演练与 CI: -| 变量 | 默认 | 说明 | -| ------------------ | --------------------------------- | ---------------------------------------------------------------------------------- | -| `GITHUB_TOKEN` | 空 | CI 用工作流自带只读 token;本地缺省走未认证额度。**不要求、也不允许任何 PAT 入仓** | -| `GITHUB_API_BASE` | `https://api.github.com` | 演练时指向不可达地址即可模拟 API 故障 | -| `HUB_SKIP_FETCH` | 空 | 置 `1` 完全跳过抓取,只用缓存/空值 | -| `HUB_PROJECTS_DIR` | `src/data/projects` | 数据文件目录(演练/测试用) | -| `HUB_META_CACHE` | `src/data/cache/github-meta.json` | 自动字段缓存位置 | -| `HUB_META_REPORT` | `github-meta-report.json` | 本次抓取报告(未入库,CI 可取用) | -| `HUB_VERSION` | 空 | 覆盖页脚版本号;缺省现场取 `git describe --tags --always --dirty` | +| 变量 | 默认 | 说明 | +| ------------------------ | --------------------------------- | ---------------------------------------------------------------------------------- | +| `GITHUB_TOKEN` | 空 | CI 用工作流自带只读 token;本地缺省走未认证额度。**不要求、也不允许任何 PAT 入仓** | +| `GITHUB_API_BASE` | `https://api.github.com` | 演练时指向不可达地址即可模拟 API 故障 | +| `HUB_SKIP_FETCH` | 空 | 置 `1` 完全跳过抓取,只用缓存/空值 | +| `HUB_PROJECTS_DIR` | `src/data/projects` | 数据文件目录(演练/测试用) | +| `HUB_META_CACHE` | `src/data/cache/github-meta.json` | 自动字段缓存位置 | +| `HUB_META_REPORT` | `github-meta-report.json` | 本次抓取报告(未入库,CI 可取用) | +| `HUB_VERSION` | 空 | 覆盖页脚版本号;缺省现场取 `git describe --tags --always --dirty` | +| `HUB_SKIP_OG` | 空 | 置 `1` 跳过 OG 图本地化(离线构建/演练用;缺图自动回退首字图) | +| `HUB_OG_FORCE` | 空 | 置 `1` 强制重新抓取仓库 OG 图 | +| `HUB_OG_REPORT` | `og-report.json` | 本次 OG 图本地化报告(未入库) | +| `HUB_CF_ANALYTICS_TOKEN` | 空 | 配置后构建才注入 Cloudflare Web Analytics(无 cookie,§10);缺省不接统计 | ### 降级演练(SPEC §12 第 3 条) @@ -94,6 +98,25 @@ HUB_PROJECTS_DIR=<放了一个坏文件的目录> pnpm build `tests/fixtures/projects-run/` 是演练夹具(指向两个真实 public 仓库),`tests/fixtures/projects/` 是 schema 夹具。两者都不是正式内容。 +## 页面与组件(SPEC §2 / §4.3 / §8.2 / §8.3 / §10) + +| 路径 | 说明 | +| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `/` | Hero(搜索框 + 官方/第三方/总数统计)、官方项目区(waker 预告位置末位)、精选推荐(第三方 ≤6)、分类快捷入口、最新收录(≤8) | +| `/projects/` | 全量目录:搜索 + 六维筛选 + 五种排序,全部在浏览器本地完成 | +| `/p//` | 项目详情:截图、长介绍、特性、部署信息全表、自动元数据、入口按钮组、同类推荐 ≤4 | +| `/categories//` | 分类页:预置并锁定分类过滤,复用 `Explorer` 与卡片 | +| `/submit/` | 构建时读取仓库根 `CONTRIBUTING.md` 同源渲染(文件缺失时显示占位说明,合入后自动接线) | +| `/about/` | 定位、官方与第三方区别、三级验证等级定义与免责声明、异议/下架通道 | +| `404` | 回首页与全部项目 | +| `/sitemap.xml` `/robots.txt` | 构建时生成,绝对地址恒写 `https://hub.oneboy.app` | + +- **统一卡片**:`src/components/project/project-card.tsx` 一套组件同时用于首页 / 列表(island 内)/ 分类页 / 详情页推荐;静态页里由 Astro 在构建期渲染成 HTML(不下发该组件的 JS),因此三处徽章与入口不可能分叉。 +- **徽章**:`src/components/project/badges.tsx` 统一渲染来源+等级(金/绿/灰,均带文字)、资源(>3 折叠为 `+n`)、难度、免费层、长期未更新 / 即将推出。 +- **截图回退链**:项目截图 → 仓库 OG 图(构建期抓取并本地化到 `public/og/github/-.png`,页面只引用站内路径,绝不热链 GitHub)→ 按分类着色的名称首字图。 +- **搜索/筛选/排序**(`src/lib/project-filter.ts`,纯函数,单测覆盖):搜索命中名称 / tagline / 长介绍 / 标签;六维筛选(分类 / 来源 / 验证等级 / 所需资源 / 难度 / 免费层);排序 = 默认(官方置顶 → 精选 → 收录日期倒序)/ star 降序 / 最近更新 / 名称 / 收录日期倒序,自动字段缺失时降级为收录日期、不报错。筛选状态写入 URL query:勾选与排序用 `pushState`(浏览器后退可还原),搜索输入防抖后 `replaceState`(不刷历史记录)。 +- **主题三档**(`src/components/site/theme-toggle.tsx` + `BaseLayout` 内联脚本):亮 / 暗 / 自动,默认自动;偏好只存 `localStorage`(无登录、无后端);首屏绘制前由 `` 内联脚本应用 `dark` class,防闪烁。 + ## 投稿基建(SPEC §7) 投稿 = 向本仓库提 PR,只新增/修改 `src/data/projects/.yaml`(及可选截图)。相关文件: @@ -133,9 +156,19 @@ src/lib/submission-checks.ts 投稿校验(repo public / 外链可达性 / 截 src/lib/pr-scope.ts 投稿 PR 变更范围判定 src/lib/github-meta.ts 抓取、缓存、降级、异常清单 src/lib/projects.ts 页面侧取数入口(人工字段 + 自动字段合并、默认排序) +src/lib/project-view.ts 构建期视图模型(解析截图/OG 图是否存在、过期标记) +src/lib/project-types.ts 展示字典与视图类型(客户端 island 也能安全引用) +src/lib/project-filter.ts 搜索 / 六维筛选 / 五种排序 / URL 状态同步 +src/lib/project-entry.ts 卡片主入口与详情页部署按钮(唯一真源) +src/lib/site.ts 站点常量与绝对地址(canonical 恒写主域名) src/lib/build-info.ts 版本号 / 构建时间 -src/pages/index.astro 占位页(正式页面由 S2-A 替换) -scripts/ validate-data.ts / validate-submission.ts / check-pr-scope.ts / fetch-github-meta.ts +src/components/ui/ shadcn/ui 组件(Badge / Button / Input / Checkbox / Dialog / Dropdown / Separator) +src/components/project/ 统一卡片、徽章、截图回退 +src/components/site/ 页头页脚、主题切换 island、筛选 island +src/layouts/base-layout.astro SEO/OG/canonical、主题防闪烁、页头页脚 +src/pages/ 首页 / projects / p/ / categories/ / submit / about / 404 / sitemap.xml / robots.txt +public/og/github/ 构建期本地化的仓库 OG 图缓存(§8.3,抓取失败则走首字图) +scripts/ validate-data.ts / validate-submission.ts / check-pr-scope.ts / fetch-github-meta.ts / fetch-og-images.ts tests/ 单测 + 进程级集成测试 + 夹具 .github/PULL_REQUEST_TEMPLATE.md 投稿 PR 模板(五条门槛逐项勾选 + 证据栏) .github/workflows/ci.yml 校验与演练(不含发布) @@ -159,7 +192,6 @@ tests/ 单测 + 进程级集成测试 + 夹具 ## 范围(防止顺带扩大,SPEC §11) -- 本单(S1-A):脚手架、数据管线(schema + 抓取 + 缓存降级)、能让 `pnpm build` 跑通的占位页、CI 校验与演练。 -- 本单(S2-B):`CONTRIBUTING.md`、PR 模板、投稿数据校验(repo / 外链 / 截图 / PR 变更范围)与对应演练;`/submit/` 页面的引入由 S2-A 负责。 -- 不在本单:正式页面/组件与主题(S2-A)、官方与第三方内容数据(内容子单)、CONTRIBUTING 与 PR 模板、每日重建与双线发布(部署子单)、PR 合并与域名绑定(用户关口)。 +- 已交付:S1-A 脚手架与数据管线(schema + 抓取 + 缓存降级 + CI 校验与演练)、S1-B 内容数据(官方 7 + 第三方 4)、S2-A 页面与组件(页面、统一卡片、搜索筛选排序、主题三档、SEO/分享与 sitemap)、S2-B 投稿基建(CONTRIBUTING、PR 模板、投稿数据校验与演练)。 +- 不在这些单里:每日重建与双线发布(部署子单)、PR 合并与域名绑定(用户关口)。 - 本站不加后端、不加 D1/KV/DO/R2、不加登录鉴权、不引入任何 secret(SPEC §0)。 diff --git a/astro.config.mjs b/astro.config.mjs index aad2e60..9c719a1 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,15 +1,21 @@ // @ts-check import { defineConfig } from 'astro/config'; +import react from '@astrojs/react'; import tailwindcss from '@tailwindcss/vite'; /** * SPEC §8.1:Astro + TypeScript,纯静态输出(SSG)+ Tailwind CSS。 - * canonical / sitemap 绝对地址恒写主域名(§10),镜像站不得按访问域名动态生成。 + * 交互部分挂 React island(搜索/筛选/排序、主题切换),静态页面的卡片在构建期渲染为 HTML、零 JS。 + * canonical / sitemap 绝对地址恒写主域名(§10),镜像站不得按访问域名动态生成—— + * 由 `site` 固定为 https://hub.oneboy.app 保证,页面与 sitemap 都不读请求域名。 */ export default defineConfig({ site: 'https://hub.oneboy.app', output: 'static', trailingSlash: 'always', build: { format: 'directory' }, + // 说明:sitemap.xml 由 src/pages/sitemap.xml.ts 生成(§10 要求文件名恰为 sitemap.xml + // 且绝对地址恒写主域名;官方 sitemap 集成只产出 sitemap-index.xml + 分片,文件名对不上) + integrations: [react()], vite: { plugins: [tailwindcss()] }, }); diff --git a/package.json b/package.json index 9ed7cc9..00eee68 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "scripts": { "dev": "astro dev", - "build": "tsx scripts/fetch-github-meta.ts && astro build", + "build": "tsx scripts/fetch-github-meta.ts && tsx scripts/fetch-og-images.ts && astro build", "preview": "astro preview", "validate:data": "tsx scripts/validate-data.ts", "validate:submission": "tsx scripts/validate-submission.ts", @@ -23,10 +23,25 @@ "format": "prettier --write .", "test": "node --import tsx --test tests/*.test.ts", "lint:types": "astro check", - "lint:format": "prettier --check ." + "lint:format": "prettier --check .", + "fetch:og": "tsx scripts/fetch-og-images.ts" }, "dependencies": { + "@astrojs/react": "^7.1.1", + "@radix-ui/react-checkbox": "^1.4.1", + "@radix-ui/react-dialog": "^1.3.1", + "@radix-ui/react-dropdown-menu": "^2.2.1", + "@radix-ui/react-separator": "^1.2.0", + "@radix-ui/react-slot": "^1.5.0", "astro": "^7.4.2", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "lucide-react": "^1.61.0", + "marked": "^18.1.1", + "react": "^19.3.1", + "react-dom": "^19.3.1", + "tailwind-merge": "^3.7.0", + "tw-animate-css": "^1.4.0", "yaml": "^2.9.1", "zod": "^4.6.7" }, @@ -34,6 +49,8 @@ "@astrojs/check": "^0.9.12", "@tailwindcss/vite": "^4.3.3", "@types/node": "^26.6.5", + "@types/react": "^19.3.0", + "@types/react-dom": "^19.3.0", "image-size": "^2.0.4", "prettier": "^3.6.2", "prettier-plugin-astro": "^1.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d32abcc..ba0a108 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,51 @@ importers: .: dependencies: + '@astrojs/react': + specifier: ^7.1.1 + version: 7.1.1(@types/node@26.6.5)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(esbuild@0.28.2)(jiti@2.7.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(tsx@4.23.15)(yaml@2.9.1) + '@radix-ui/react-checkbox': + specifier: ^1.4.1 + version: 1.4.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-dialog': + specifier: ^1.3.1 + version: 1.3.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-dropdown-menu': + specifier: ^2.2.1 + version: 2.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-separator': + specifier: ^1.2.0 + version: 1.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-slot': + specifier: ^1.5.0 + version: 1.5.0(@types/react@19.3.0)(react@19.3.1) astro: specifier: ^7.4.2 version: 7.4.2(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1) + class-variance-authority: + specifier: ^0.7.1 + version: 0.7.1 + clsx: + specifier: ^2.1.1 + version: 2.1.1 + lucide-react: + specifier: ^1.61.0 + version: 1.61.0(@types/react@19.3.0)(react@19.3.1) + marked: + specifier: ^18.1.1 + version: 18.1.1 + react: + specifier: ^19.3.1 + version: 19.3.1 + react-dom: + specifier: ^19.3.1 + version: 19.3.1(react@19.3.1) + tailwind-merge: + specifier: ^3.7.0 + version: 3.7.0 + tw-animate-css: + specifier: ^1.4.0 + version: 1.4.0 yaml: specifier: ^2.9.1 version: 2.9.1 @@ -27,6 +69,12 @@ importers: '@types/node': specifier: ^26.6.5 version: 26.6.5 + '@types/react': + specifier: ^19.3.0 + version: 19.3.0 + '@types/react-dom': + specifier: ^19.3.0 + version: 19.3.0(@types/react@19.3.0) image-size: specifier: ^2.0.4 version: 2.0.4 @@ -151,6 +199,19 @@ packages: resolution: {integrity: sha512-sXlAXJX6t4QfuLg+CuCDzpg7NoxWcyb4paFprgtFppLeisCBmh935h+tJ5CWXfsXEoW2IDy/ihbRMtiu28Chjw==} engines: {node: '>=22.23.4'} + '@astrojs/react@7.1.1': + resolution: {integrity: sha512-jHan8UuXzFEbzcmsjCRrepm9Xc5XRz+Jt57MjfE568tbOEoDKVzeMuHf9YO0Y4hHwROX8iJmLzaiT3Yr5W0UbQ==} + engines: {node: '>=22.23.4'} + peerDependencies: + '@types/react': ^17.0.50 || ^18.0.21 || ^19.0.0 + '@types/react-dom': ^17.0.17 || ^18.0.6 || ^19.0.0 + oxc-transform-react: ^0.145.0 + react: ^17.0.2 || ^18.0.0 || ^19.0.0 + react-dom: ^17.0.2 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + oxc-transform-react: + optional: true + '@astrojs/telemetry@3.4.1': resolution: {integrity: sha512-SMkvMsGOpM0FMAoT5pzhgI3LZC0JSPWf7Evwop+fZ3N6UkusPM7lI+sOJjMNI5OJrVoiei1/AGo1cY7sikTc5A==} engines: {node: '>=22.23.4'} @@ -431,6 +492,21 @@ packages: cpu: [x64] os: [win32] + '@floating-ui/core@1.8.0': + resolution: {integrity: sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==} + + '@floating-ui/dom@1.8.0': + resolution: {integrity: sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==} + + '@floating-ui/react-dom@2.1.9': + resolution: {integrity: sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + + '@floating-ui/utils@0.2.12': + resolution: {integrity: sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==} + '@img/colour@1.1.0': resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==} engines: {node: '>=18'} @@ -632,6 +708,311 @@ packages: '@prettier/parse-srcset@3.1.0': resolution: {integrity: sha512-FIRv2rZotO9NP/r66taYqD1zICpPiBbrECqjKV/xqNotqDxF7fLzzUeK+1RSRx9Tenk0DajR/GcRmTJ2qtHaKQ==} + '@radix-ui/primitive@1.2.0': + resolution: {integrity: sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==} + + '@radix-ui/react-arrow@1.1.17': + resolution: {integrity: sha512-67jjcVvxjXCCStnTW3Z+M7jmaFMuMR7M2JgpDzH4w7JSRrikmzhjfYgP/09ECb8n7whnsgh1ifJ+Ie96qEj+pQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-checkbox@1.4.1': + resolution: {integrity: sha512-KWtwhh+98ML3seZ9vO9yRY2OwaQG90dCiDAxjpSNY2AaZ3Hik3B0dsk6m0ILywo/no3A9/SozadyPMNweVT8yw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-collection@1.2.0': + resolution: {integrity: sha512-+yiQzqcc7Sy7/5s0jrMCjpPRFB3538VNrXPWdTLZhE/SCfgEws4aI6lHWN/vvcnyhHndROWBzqmqB4QBrITZ9Q==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-compose-refs@1.1.5': + resolution: {integrity: sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-context@1.3.0': + resolution: {integrity: sha512-v5AYEocMISkbJ+1fTXzZpiFv7NRr3D2WiYbLIKf+FkmJ8VkP6d503eV2n34MFussHXY1pcoq3yfJiQH77dc4Mg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-dialog@1.3.1': + resolution: {integrity: sha512-+0E4qvVTwjAWra9sEhJ+9BTsvHE00zkUuNw1VGh7S+Gc13dfYk+S1PVQdchWDj+XYHhAai7Z7IpzXVDCGsDplg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-direction@1.2.0': + resolution: {integrity: sha512-FtRA52a/r+LKStFT+neLUm+8vSe7wbzkbQGGeU8ixFiwC8NU14Evoq9ATECqL3eGbcUzJR4fyfA4KkK/q6dfqg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-dismissable-layer@1.2.1': + resolution: {integrity: sha512-KIfDcAsx+oVylFZ4xryVKusJUrLLhTQmfnJW4kwk4Km5myvhHCrj04hnWWUC166+xD4DHdH8tQGylwYX1h6+Pg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-dropdown-menu@2.2.1': + resolution: {integrity: sha512-XsHcmYG2AcqnvTqrOXXWcMrhquEIlqucizuDH1MV/qMRW+DndpBCMvNeTRXOxqmG1H5j89M/+I0/34Zdd+zDcQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-focus-guards@1.2.0': + resolution: {integrity: sha512-MPm5R0iRGUDrDnPNxmLBkv+X7pN4XKzt+MbWJEuJQsH3NFH4omrbpXpucyYCCKTSt+na/ZxGhEWQrWTZ0285cA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-focus-scope@1.3.1': + resolution: {integrity: sha512-ugeMhbXt4y5S2T1GnIqbWDKEN962PDwnX1fN0eKOOgf5f63Dh2mn8F1FUySlgW0iF6GiVsRF32DzuDIWTUyQJg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-id@1.1.4': + resolution: {integrity: sha512-TMQp2llA+RYn7JcjnrMnz7wN4pcVttPZnRZo52PLQsoLVKzNlVwUeHmfePgTgRluXFvlD3GD5g5MOVVTJCO0qA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-menu@2.2.1': + resolution: {integrity: sha512-G34BsU90SBj5foYpz8pQqq/Q0Dlfyyl6KitWEfRwXC0QvfwhWNAwS49DWP2+rRJ0iwv20Z2Qx7Sk+T03bGo5JA==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-popper@1.4.0': + resolution: {integrity: sha512-yCWRvLeGv9Pz3+efwHqGPp70mZ56r3kfIgQVF56Oj2aAa4uP/Tb+IE59wNcc+758rctqbCKx4LbK8II/r7Bn0Q==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-portal@1.2.0': + resolution: {integrity: sha512-StX7xXnaRU41VvFtMm9zlhVGz8XF6GmWWTXftkQaY+tqVkbs/R9UmAp5mLzHHapk5hM9RMZQvO/3usyIP/g42g==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-presence@1.1.11': + resolution: {integrity: sha512-Z7/atlkab36Z8hm+V8zYc79r0W+tiOB1o0tun1By94JyadkekLQmtEAnBSP9XKXBNQsStoStS4+gX10JpS5akA==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-primitive@2.2.0': + resolution: {integrity: sha512-HCTSPMNqv55Qk0IX4geJbpyXazmqulcimwuyjxTkKi29v+QZbG2Zho9BnbBq4YS2PF+KlNb2CXoLz66uUmblkg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-roving-focus@1.2.1': + resolution: {integrity: sha512-UwraORzVUeEPMclhO1p0vz0qI+TbdDLO9i+FiOqhJyHKwdpCRCck9yVEscUnAMIzCiuNoQa8D4A9bIpOPXGt6Q==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-separator@1.2.0': + resolution: {integrity: sha512-1jUAap0wZEqVP05Ou7kJgRxe/W+Qftng+rUNWGa0qkKbv9r5pWTG3E7a3ELKo2eJoHKMECnzuYrZpSyO1YgcYQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-slot@1.5.0': + resolution: {integrity: sha512-tyYd9ddPXAysAbdbD9eYxgwpCSv6f3PncqVSNKQFSR5lcJVLz3cb/pANDoYrLiHBpXv7skortyUgGUWsYuPPFQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-callback-ref@1.1.5': + resolution: {integrity: sha512-Y5GBf4NKeADoXI1geiMlMuMoURT3k9MizzzKhGb/m55H94aGigZ01PIpkvsO6lML13BA6XYAXSJ6gza7vTn5nw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-controllable-state@1.3.0': + resolution: {integrity: sha512-TAcBI7bw2ljYCbv4+zuTSd6zICu8pRt6SDN2vJ/Z06K2MXh6I9WYFe/A9ovlFDtR5HVHGm5iDxDoABm/++dbKg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-effect-event@0.0.5': + resolution: {integrity: sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-is-hydrated@0.1.3': + resolution: {integrity: sha512-umO/aJ+82CpOnhDZUTbILCQf7kU/g0iv+oGs/Q8jw7IkhWBzaEP4sA268PhFAJTFetbwp3ICc6ktpI4TqtxcIw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-layout-effect@1.1.4': + resolution: {integrity: sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-rect@1.1.4': + resolution: {integrity: sha512-cSOCh6JlkmfjLyNcLiu2nB4v+nm+dkZ+Q5KHWk/soo4U7ZLiEQFKHK9/YmtBHjfCEaU43IBKQOc4/uJmCaiCTQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-size@1.1.5': + resolution: {integrity: sha512-V1McDQkMGzgivwqdu7u96APs7oi0Jvj9LTzgq3WWrDZqxWdAqU9yZnZQqk5OizGFR8badUQwZsrlao7MOlWYOA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/rect@1.1.3': + resolution: {integrity: sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw==} + '@rolldown/binding-android-arm-eabi@1.2.15': resolution: {integrity: sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -877,12 +1258,36 @@ packages: '@types/node@26.6.5': resolution: {integrity: sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==} + '@types/react-dom@19.3.0': + resolution: {integrity: sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==} + peerDependencies: + '@types/react': ^19.3.0 + + '@types/react@19.3.0': + resolution: {integrity: sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} '@ungap/structured-clone@1.4.0': resolution: {integrity: sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==} + '@vitejs/plugin-react@6.1.2': + resolution: {integrity: sha512-fhJNGUdscQa4HkI0xFxwonWyhnVReCPDbXI7FH7jmzpnVCrFQI7PRrhWecO263610vOrs9tr2Y4xcf8uAdFxbw==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@rolldown/plugin-babel': ^0.1.7 || ^0.2.0 + babel-plugin-react-compiler: ^1.0.0 + oxc-transform-react: ^0.152.0 + vite: ^8.0.0 + peerDependenciesMeta: + '@rolldown/plugin-babel': + optional: true + babel-plugin-react-compiler: + optional: true + oxc-transform-react: + optional: true + '@volar/kit@2.4.30': resolution: {integrity: sha512-VocLtumfXnqnPQEWc9Yx7uC1uOh9gyjVNlrn2+6Zx/z9aM6yTLhPK8lSqM9Ilu81XRa48I00lcYJWLi2BLxx8Q==} peerDependencies: @@ -956,6 +1361,10 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + aria-hidden@1.2.6: + resolution: {integrity: sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==} + engines: {node: '>=10'} + aria-query@5.3.2: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} @@ -997,6 +1406,9 @@ packages: resolution: {integrity: sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==} engines: {node: '>=8'} + class-variance-authority@0.7.1: + resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} + cliui@9.0.1: resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==} engines: {node: '>=20'} @@ -1045,6 +1457,9 @@ packages: resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + defu@6.1.7: resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} @@ -1059,6 +1474,9 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} + detect-node-es@1.1.0: + resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} + devalue@6.0.3: resolution: {integrity: sha512-3woMEITftG1wKeO/4d/QXH1DVKctTSZg3jNGPpjp9hNr5Hos8MCFF5McTML5ZtgKDObm2R591B0spRp2IVernA==} engines: {node: '>=18'} @@ -1170,6 +1588,10 @@ packages: resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} engines: {node: '>=18'} + get-nonce@1.0.1: + resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==} + engines: {node: '>=6'} + get-tsconfig@5.0.0-beta.6: resolution: {integrity: sha512-X6fBC0pmImC70gvX2zm56go9hx0MyoGVdG0tUCkg/D+Xnh5TJsOZ7iDbOdI3PvmtrDxnu1YdDufpK2QJX1Meqw==} engines: {node: '>=20.20.0'} @@ -1384,6 +1806,15 @@ packages: resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==} engines: {node: 20 || >=22} + lucide-react@1.61.0: + resolution: {integrity: sha512-v2SQPPPNjnr+BlhL9Spuzmo5yR+hLkftfuE4E3jaxdNPgSH0hJKPcLJBP7yAta87jQNPsSERS59PJjCJ/CorBA==} + peerDependencies: + '@types/react': '*' + react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -1393,6 +1824,11 @@ packages: magicast@0.5.5: resolution: {integrity: sha512-UicdXN8zQ3JHlxVq+28afMXPr1z7WNY6+7EJnzTdQWkTAlMLF5fNCCKxJHBQwGaNGR11581EiQmQzx73+MvszA==} + marked@18.1.1: + resolution: {integrity: sha512-zEGgrtUG8crk+TrMacJSVABU4DYDDkS8uqgU3ohrn/2fW9C2AEfUrO3m6IhpIpQpl7YcVpiXXC9cSMWDANT3dg==} + engines: {node: '>= 20'} + hasBin: true + mdast-util-to-hast@13.2.1: resolution: {integrity: sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==} @@ -1523,6 +1959,45 @@ packages: radix3@1.1.2: resolution: {integrity: sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==} + react-dom@19.3.1: + resolution: {integrity: sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==} + peerDependencies: + react: ^19.3.1 + + react-remove-scroll-bar@2.3.8: + resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==} + engines: {node: '>=10'} + peerDependencies: + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + + react-remove-scroll@2.7.2: + resolution: {integrity: sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==} + engines: {node: '>=10'} + peerDependencies: + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + react-style-singleton@2.2.3: + resolution: {integrity: sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==} + engines: {node: '>=10'} + peerDependencies: + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + react@19.3.1: + resolution: {integrity: sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==} + engines: {node: '>=0.10.0'} + readdirp@5.1.1: resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} engines: {node: '>= 20.19.0'} @@ -1571,6 +2046,9 @@ packages: resolution: {integrity: sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==} engines: {node: '>=11.0.0'} + scheduler@0.28.0: + resolution: {integrity: sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==} + semver@7.8.5: resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} engines: {node: '>=10'} @@ -1629,6 +2107,9 @@ packages: engines: {node: '>=16'} hasBin: true + tailwind-merge@3.7.0: + resolution: {integrity: sha512-XPPUyAc+cvspz3lHTcR/QgPfW2A0lv/xQNIjX3HGhLR+Nq2lHaLq5MtTesHn8GUr3W3DguT2KT5x3NVgRtYwmA==} + tailwindcss@4.3.3: resolution: {integrity: sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==} @@ -1668,6 +2149,9 @@ packages: engines: {node: '>=18.0.0'} hasBin: true + tw-animate-css@1.4.0: + resolution: {integrity: sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==} + typesafe-path@0.2.2: resolution: {integrity: sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==} @@ -1778,6 +2262,26 @@ packages: uploadthing: optional: true + use-callback-ref@1.3.3: + resolution: {integrity: sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==} + engines: {node: '>=10'} + peerDependencies: + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + use-sidecar@1.1.3: + resolution: {integrity: sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==} + engines: {node: '>=10'} + peerDependencies: + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + verkit@0.5.0: resolution: {integrity: sha512-u4J1hr6Y+C/hit34GwL3eIcUf3wngT8TlYUjK7tk0jxydKLAq3sYvifjdTDA6U3KCKRcQCQDGf/srjxfZF3l7g==} engines: {node: '>=18.12.0'} @@ -2104,6 +2608,33 @@ snapshots: dependencies: prismjs: 1.30.0 + '@astrojs/react@7.1.1(@types/node@26.6.5)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(esbuild@0.28.2)(jiti@2.7.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(tsx@4.23.15)(yaml@2.9.1)': + dependencies: + '@astrojs/internal-helpers': 0.13.0 + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + '@vitejs/plugin-react': 6.1.2(vite@8.3.5(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)) + devalue: 6.0.3 + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + ultrahtml: 1.7.0 + vite: 8.3.5(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1) + transitivePeerDependencies: + - '@rolldown/plugin-babel' + - '@types/node' + - '@vitejs/devtools' + - babel-plugin-react-compiler + - esbuild + - jiti + - less + - sass + - sass-embedded + - stylus + - sugarss + - terser + - tsx + - yaml + '@astrojs/telemetry@3.4.1': dependencies: ci-info: 4.4.0 @@ -2305,6 +2836,23 @@ snapshots: '@esbuild/win32-x64@0.28.2': optional: true + '@floating-ui/core@1.8.0': + dependencies: + '@floating-ui/utils': 0.2.12 + + '@floating-ui/dom@1.8.0': + dependencies: + '@floating-ui/core': 1.8.0 + '@floating-ui/utils': 0.2.12 + + '@floating-ui/react-dom@2.1.9(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@floating-ui/dom': 1.8.0 + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + + '@floating-ui/utils@0.2.12': {} + '@img/colour@1.1.0': optional: true @@ -2457,6 +3005,296 @@ snapshots: '@prettier/parse-srcset@3.1.0': {} + '@radix-ui/primitive@1.2.0': {} + + '@radix-ui/react-arrow@1.1.17(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-checkbox@1.4.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/primitive': 1.2.0 + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-context': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-presence': 1.1.11(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-use-controllable-state': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-size': 1.1.5(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-collection@1.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-context': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-slot': 1.5.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-compose-refs@1.1.5(@types/react@19.3.0)(react@19.3.1)': + dependencies: + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-context@1.3.0(@types/react@19.3.0)(react@19.3.1)': + dependencies: + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-dialog@1.3.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/primitive': 1.2.0 + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-context': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-dismissable-layer': 1.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-focus-guards': 1.2.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-focus-scope': 1.3.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-id': 1.1.4(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-portal': 1.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-presence': 1.1.11(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-slot': 1.5.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-controllable-state': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + aria-hidden: 1.2.6 + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + react-remove-scroll: 2.7.2(@types/react@19.3.0)(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-direction@1.2.0(@types/react@19.3.0)(react@19.3.1)': + dependencies: + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-dismissable-layer@1.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/primitive': 1.2.0 + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-use-callback-ref': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-effect-event': 0.0.5(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-dropdown-menu@2.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/primitive': 1.2.0 + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-context': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-id': 1.1.4(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-menu': 2.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-use-controllable-state': 1.3.0(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-focus-guards@1.2.0(@types/react@19.3.0)(react@19.3.1)': + dependencies: + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-focus-scope@1.3.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-use-callback-ref': 1.1.5(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-id@1.1.4(@types/react@19.3.0)(react@19.3.1)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-menu@2.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/primitive': 1.2.0 + '@radix-ui/react-collection': 1.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-context': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-direction': 1.2.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-dismissable-layer': 1.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-focus-guards': 1.2.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-focus-scope': 1.3.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-id': 1.1.4(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-popper': 1.4.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-portal': 1.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-presence': 1.1.11(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-roving-focus': 1.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-slot': 1.5.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-callback-ref': 1.1.5(@types/react@19.3.0)(react@19.3.1) + aria-hidden: 1.2.6 + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + react-remove-scroll: 2.7.2(@types/react@19.3.0)(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-popper@1.4.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@floating-ui/react-dom': 2.1.9(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-arrow': 1.1.17(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-context': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-use-callback-ref': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-rect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-size': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/rect': 1.1.3 + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-portal@1.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-presence@1.1.11(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-primitive@2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/react-slot': 1.5.0(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-roving-focus@1.2.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/primitive': 1.2.0 + '@radix-ui/react-collection': 1.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-context': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-direction': 1.2.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-id': 1.1.4(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + '@radix-ui/react-use-callback-ref': 1.1.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-controllable-state': 1.3.0(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-is-hydrated': 0.1.3(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-separator@1.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + dependencies: + '@radix-ui/react-primitive': 2.2.0(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + react: 19.3.1 + react-dom: 19.3.1(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + '@types/react-dom': 19.3.0(@types/react@19.3.0) + + '@radix-ui/react-slot@1.5.0(@types/react@19.3.0)(react@19.3.1)': + dependencies: + '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-use-callback-ref@1.1.5(@types/react@19.3.0)(react@19.3.1)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-use-controllable-state@1.3.0(@types/react@19.3.0)(react@19.3.1)': + dependencies: + '@radix-ui/primitive': 1.2.0 + '@radix-ui/react-use-effect-event': 0.0.5(@types/react@19.3.0)(react@19.3.1) + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-use-effect-event@0.0.5(@types/react@19.3.0)(react@19.3.1)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-use-is-hydrated@0.1.3(@types/react@19.3.0)(react@19.3.1)': + dependencies: + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-use-layout-effect@1.1.4(@types/react@19.3.0)(react@19.3.1)': + dependencies: + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-use-rect@1.1.4(@types/react@19.3.0)(react@19.3.1)': + dependencies: + '@radix-ui/rect': 1.1.3 + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/react-use-size@1.1.5(@types/react@19.3.0)(react@19.3.1)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.4(@types/react@19.3.0)(react@19.3.1) + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + + '@radix-ui/rect@1.1.3': {} + '@rolldown/binding-android-arm-eabi@1.2.15': optional: true @@ -2638,10 +3476,23 @@ snapshots: dependencies: undici-types: 8.9.0 + '@types/react-dom@19.3.0(@types/react@19.3.0)': + dependencies: + '@types/react': 19.3.0 + + '@types/react@19.3.0': + dependencies: + csstype: 3.2.3 + '@types/unist@3.0.3': {} '@ungap/structured-clone@1.4.0': {} + '@vitejs/plugin-react@6.1.2(vite@8.3.5(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1))': + dependencies: + '@rolldown/pluginutils': 1.0.1 + vite: 8.3.5(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1) + '@volar/kit@2.4.30(typescript@6.0.3)': dependencies: '@volar/language-service': 2.4.30(typescript@6.0.3) @@ -2727,6 +3578,10 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.2 + aria-hidden@1.2.6: + dependencies: + tslib: 2.8.1 + aria-query@5.3.2: {} astro@7.4.2(@types/node@26.6.5)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1): @@ -2836,6 +3691,10 @@ snapshots: ci-info@4.4.0: {} + class-variance-authority@0.7.1: + dependencies: + clsx: 2.1.1 + cliui@9.0.1: dependencies: string-width: 7.2.0 @@ -2882,6 +3741,8 @@ snapshots: dependencies: css-tree: 2.2.1 + csstype@3.2.3: {} + defu@6.1.7: {} dequal@2.0.3: {} @@ -2890,6 +3751,8 @@ snapshots: detect-libc@2.1.2: {} + detect-node-es@1.1.0: {} + devalue@6.0.3: {} devlop@1.1.0: @@ -3006,6 +3869,8 @@ snapshots: get-east-asian-width@1.7.0: {} + get-nonce@1.0.1: {} + get-tsconfig@5.0.0-beta.6: dependencies: resolve-pkg-maps: 1.0.0 @@ -3168,6 +4033,12 @@ snapshots: lru-cache@11.5.3: {} + lucide-react@1.61.0(@types/react@19.3.0)(react@19.3.1): + dependencies: + react: 19.3.1 + optionalDependencies: + '@types/react': 19.3.0 + magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.6.0 @@ -3182,6 +4053,8 @@ snapshots: '@babel/types': 7.29.11 source-map-js: 1.2.2 + marked@18.1.1: {} + mdast-util-to-hast@13.2.1: dependencies: '@types/hast': 3.0.5 @@ -3299,6 +4172,40 @@ snapshots: radix3@1.1.2: {} + react-dom@19.3.1(react@19.3.1): + dependencies: + react: 19.3.1 + scheduler: 0.28.0 + + react-remove-scroll-bar@2.3.8(@types/react@19.3.0)(react@19.3.1): + dependencies: + react: 19.3.1 + react-style-singleton: 2.2.3(@types/react@19.3.0)(react@19.3.1) + tslib: 2.8.1 + optionalDependencies: + '@types/react': 19.3.0 + + react-remove-scroll@2.7.2(@types/react@19.3.0)(react@19.3.1): + dependencies: + react: 19.3.1 + react-remove-scroll-bar: 2.3.8(@types/react@19.3.0)(react@19.3.1) + react-style-singleton: 2.2.3(@types/react@19.3.0)(react@19.3.1) + tslib: 2.8.1 + use-callback-ref: 1.3.3(@types/react@19.3.0)(react@19.3.1) + use-sidecar: 1.1.3(@types/react@19.3.0)(react@19.3.1) + optionalDependencies: + '@types/react': 19.3.0 + + react-style-singleton@2.2.3(@types/react@19.3.0)(react@19.3.1): + dependencies: + get-nonce: 1.0.1 + react: 19.3.1 + tslib: 2.8.1 + optionalDependencies: + '@types/react': 19.3.0 + + react@19.3.1: {} + readdirp@5.1.1: {} regex-recursion@6.0.2: @@ -3371,6 +4278,8 @@ snapshots: sax@1.6.1: {} + scheduler@0.28.0: {} + semver@7.8.5: {} sharp@0.35.5(@types/node@26.6.5): @@ -3462,6 +4371,8 @@ snapshots: picocolors: 1.1.1 sax: 1.6.1 + tailwind-merge@3.7.0: {} + tailwindcss@4.3.3: {} tapable@2.3.3: {} @@ -3491,6 +4402,8 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + tw-animate-css@1.4.0: {} + typesafe-path@0.2.2: {} typescript-auto-import-cache@0.3.6: @@ -3560,6 +4473,21 @@ snapshots: ofetch: 1.5.1 ufo: 1.6.4 + use-callback-ref@1.3.3(@types/react@19.3.0)(react@19.3.1): + dependencies: + react: 19.3.1 + tslib: 2.8.1 + optionalDependencies: + '@types/react': 19.3.0 + + use-sidecar@1.1.3(@types/react@19.3.0)(react@19.3.1): + dependencies: + detect-node-es: 1.1.0 + react: 19.3.1 + tslib: 2.8.1 + optionalDependencies: + '@types/react': 19.3.0 + verkit@0.5.0: {} vfile-message@4.0.3: diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..8d033cc --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,15 @@ + + + + W + + + diff --git a/public/og/github/aozorae-edgechat.png b/public/og/github/aozorae-edgechat.png new file mode 100644 index 0000000..de66fca Binary files /dev/null and b/public/og/github/aozorae-edgechat.png differ diff --git a/public/og/github/lyc8503-uptimeflare.png b/public/og/github/lyc8503-uptimeflare.png new file mode 100644 index 0000000..9b2f1ba Binary files /dev/null and b/public/og/github/lyc8503-uptimeflare.png differ diff --git a/public/og/github/maillab-cloud-mail.png b/public/og/github/maillab-cloud-mail.png new file mode 100644 index 0000000..2e804e0 Binary files /dev/null and b/public/og/github/maillab-cloud-mail.png differ diff --git a/public/og/github/tianma-if-edgeever.png b/public/og/github/tianma-if-edgeever.png new file mode 100644 index 0000000..5fe1540 Binary files /dev/null and b/public/og/github/tianma-if-edgeever.png differ diff --git a/public/og/github/workerhub-enotify.png b/public/og/github/workerhub-enotify.png new file mode 100644 index 0000000..ae91532 Binary files /dev/null and b/public/og/github/workerhub-enotify.png differ diff --git a/public/og/github/workerhub-hop.png b/public/og/github/workerhub-hop.png new file mode 100644 index 0000000..751c310 Binary files /dev/null and b/public/og/github/workerhub-hop.png differ diff --git a/public/og/github/workerhub-lx-music-server.png b/public/og/github/workerhub-lx-music-server.png new file mode 100644 index 0000000..3c49170 Binary files /dev/null and b/public/og/github/workerhub-lx-music-server.png differ diff --git a/public/og/github/workerhub-nav.png b/public/og/github/workerhub-nav.png new file mode 100644 index 0000000..ddb3063 Binary files /dev/null and b/public/og/github/workerhub-nav.png differ diff --git a/public/og/github/workerhub-post.png b/public/og/github/workerhub-post.png new file mode 100644 index 0000000..bae3896 Binary files /dev/null and b/public/og/github/workerhub-post.png differ diff --git a/public/og/github/workerhub-waker.png b/public/og/github/workerhub-waker.png new file mode 100644 index 0000000..7c7e34a Binary files /dev/null and b/public/og/github/workerhub-waker.png differ diff --git a/public/og/github/workerhub-zeta.png b/public/og/github/workerhub-zeta.png new file mode 100644 index 0000000..b1c383e Binary files /dev/null and b/public/og/github/workerhub-zeta.png differ diff --git a/public/og/og-default.png b/public/og/og-default.png new file mode 100644 index 0000000..e8a7fdf Binary files /dev/null and b/public/og/og-default.png differ diff --git a/scripts/fetch-og-images.ts b/scripts/fetch-og-images.ts new file mode 100644 index 0000000..93cc94f --- /dev/null +++ b/scripts/fetch-og-images.ts @@ -0,0 +1,147 @@ +#!/usr/bin/env tsx +/** + * 构建期把仓库 OG 图本地化(SPEC §8.3 截图回退链第 2 级)。 + * + * 「构建时抓取并本地化缓存」= 落盘到 public/og/github/-.png,随构建产物一起发布; + * 页面只引用本站路径,**禁止**详情页/卡片热链 GitHub(含 repository-images / opengraph 临时地址)。 + * + * 容错与 §9.2 一致:单张图下载失败不许让构建失败——已存在的旧图保留,没有就退到「分类着色首字图」。 + * 出于构建时长与礼貌,只在缺图时下载;`HUB_OG_FORCE=1` 可强制刷新。 + * + * 退出码:恒为 0(除数据文件非法,那由前面的 fetch-github-meta.ts 拦住)。 + */ +import { existsSync, mkdirSync, writeFileSync } from 'node:fs'; +import { dirname, resolve } from 'node:path'; + +import { loadProjects } from '../src/lib/load-projects.js'; +import { + GITHUB_TOKEN, + META_CACHE_PATH, + PROJECTS_DIR, + SKIP_FETCH, +} from '../src/lib/build-config.js'; +import { readMetaCache } from '../src/lib/github-meta.js'; +import { OG_IMAGE_PUBLIC_DIR, ogImageFileName } from '../src/lib/og-path.js'; + +const PUBLIC_DIR = resolve('public'); +const OG_DIR = resolve(PUBLIC_DIR, OG_IMAGE_PUBLIC_DIR); +const REPORT_PATH = resolve(process.env.HUB_OG_REPORT ?? 'og-report.json'); +const FORCE = process.env.HUB_OG_FORCE === '1'; +const SKIP = SKIP_FETCH || process.env.HUB_SKIP_OG === '1'; +const TIMEOUT_MS = 10_000; +const CONCURRENCY = 4; + +interface OgOutcome { + repo: string; + file: string; + status: 'downloaded' | 'cached' | 'failed' | 'skipped'; + source?: string; + reason?: string; +} + +const loaded = loadProjects(PROJECTS_DIR); +if (!loaded.ok) { + // 数据文件非法时由 fetch-github-meta.ts 先行失败并给出字段级报错;这里只提醒、不重复阻断 + console.warn('⚠ 数据文件校验未通过,跳过 OG 图本地化'); + process.exit(0); +} + +const repos = [...new Set(loaded.projects.map((project) => project.data.repo))]; +const cache = readMetaCache(META_CACHE_PATH); + +async function download(repo: string): Promise { + const fileName = ogImageFileName(repo); + const filePath = resolve(OG_DIR, fileName); + const publicPath = `/${OG_IMAGE_PUBLIC_DIR}/${fileName}`; + + if (existsSync(filePath) && !FORCE) { + return { repo, file: publicPath, status: 'cached' }; + } + if (SKIP) { + return existsSync(filePath) + ? { repo, file: publicPath, status: 'cached', reason: '抓取已禁用' } + : { repo, file: publicPath, status: 'skipped', reason: '抓取已禁用' }; + } + + // 优先用抓取结果里的 OG 地址;缓存里没有就按 §9.2 的规范地址拼(非临时 URL) + const source = + cache.repos[repo]?.openGraphImage ?? `https://opengraph.githubassets.com/1/${repo}`; + const headers: Record = { + 'user-agent': 'workerhub-hub-build (+https://hub.oneboy.app)', + }; + if (GITHUB_TOKEN) headers.authorization = `Bearer ${GITHUB_TOKEN}`; + + try { + const response = await fetch(source, { + headers, + redirect: 'follow', + signal: AbortSignal.timeout(TIMEOUT_MS), + }); + if (!response.ok) { + return { + repo, + file: publicPath, + status: 'failed', + source, + reason: `HTTP ${response.status}`, + }; + } + const contentType = response.headers.get('content-type') ?? ''; + if (!contentType.startsWith('image/')) { + return { + repo, + file: publicPath, + status: 'failed', + source, + reason: `内容类型异常:${contentType}`, + }; + } + const buffer = Buffer.from(await response.arrayBuffer()); + if (buffer.byteLength < 512) { + return { repo, file: publicPath, status: 'failed', source, reason: '图片体积异常' }; + } + mkdirSync(dirname(filePath), { recursive: true }); + writeFileSync(filePath, buffer); + return { repo, file: publicPath, status: 'downloaded', source }; + } catch (error) { + return { + repo, + file: publicPath, + status: 'failed', + source, + reason: (error as Error).message, + }; + } +} + +const outcomes: OgOutcome[] = []; +for (let index = 0; index < repos.length; index += CONCURRENCY) { + const batch = repos.slice(index, index + CONCURRENCY); + const results = await Promise.all(batch.map((repo) => download(repo))); + outcomes.push(...results); +} + +for (const outcome of outcomes) { + if (outcome.status === 'failed') { + console.warn(`⚠ ${outcome.repo} OG 图本地化失败(${outcome.reason});回退到分类着色首字图`); + } +} + +const report = { + generatedAt: new Date().toISOString(), + force: FORCE, + skipped: SKIP, + counts: { + repos: repos.length, + downloaded: outcomes.filter((outcome) => outcome.status === 'downloaded').length, + cached: outcomes.filter((outcome) => outcome.status === 'cached').length, + failed: outcomes.filter((outcome) => outcome.status === 'failed').length, + skipped: outcomes.filter((outcome) => outcome.status === 'skipped').length, + }, + outcomes, +}; +writeFileSync(REPORT_PATH, `${JSON.stringify(report, null, 2)}\n`); + +console.log( + `OG 图本地化完成:${report.counts.repos} 个仓库(新下载 ${report.counts.downloaded},已有 ${report.counts.cached},失败 ${report.counts.failed})`, +); diff --git a/src/components/project/badges.tsx b/src/components/project/badges.tsx new file mode 100644 index 0000000..f28de05 --- /dev/null +++ b/src/components/project/badges.tsx @@ -0,0 +1,216 @@ +/** + * 徽章体系(SPEC §4.3 / §6.2 / §8.3):来源+等级、资源、难度、免费层、状态。 + * + * 立规:卡片、列表、详情三处必须由这里同一套组件渲染,不许各页各写一套; + * 一律走 shadcn/ui `Badge` + Lucide 图标,且「不只靠颜色」——每个徽章都带文字。 + */ +import { + Archive, + BadgeCheck, + Cable, + CircleAlert, + CircleCheck, + CircleDollarSign, + Clock, + Clock4, + Crown, + Database, + ExternalLink, + Gauge, + KeyRound, + ListOrdered, + Mail, + Network, + PanelsTopLeft, + HardDrive, + Sparkles, + Star, + Tag, + Timer, + Zap, + Boxes, + type LucideIcon, +} from 'lucide-react'; + +import { Badge } from '@/components/ui/badge'; +import { cn } from '@/lib/utils'; +import { + DIFFICULTY_HINTS, + DIFFICULTY_LABELS, + FREE_TIER_META, + RESOURCE_BADGE_VISIBLE, + RESOURCE_LABELS, + TIER_META, + type ProjectView, +} from '@/lib/project-types'; +import type { Resource, VerificationTier } from '@/lib/project-schema'; + +/** 资源徽章图标(§4.1 resources 全枚举) */ +const RESOURCE_ICONS: Record = { + 'workers-only': Zap, + pages: PanelsTopLeft, + d1: Database, + kv: KeyRound, + r2: HardDrive, + 'durable-objects': Boxes, + queues: ListOrdered, + cron: Timer, + 'workers-ai': Sparkles, + vectorize: Network, + hyperdrive: Cable, + 'email-workers': Mail, + external: ExternalLink, +}; + +const TIER_ICONS: Record = { + official: Crown, + verified: BadgeCheck, + listed: Tag, +}; + +/** 来源 + 等级徽章:金(官方)/ 绿(已验证)/ 灰(已收录),文字写明来源与等级 */ +export function TierBadge({ + source, + tier, + className, +}: { + source: ProjectView['source']; + tier: VerificationTier; + className?: string; +}) { + const meta = TIER_META[tier]; + const Icon = TIER_ICONS[tier]; + const label = source === 'official' ? meta.label : `第三方 · ${meta.label}`; + + return ( + + + ); +} +TierBadge.displayName = 'TierBadge'; + +/** 资源徽章:图标 + 短名,超过 visible 个折叠为「+n」(§4.3) */ +export function ResourceBadges({ + resources, + visible = RESOURCE_BADGE_VISIBLE, + className, +}: { + resources: Resource[]; + visible?: number; + className?: string; +}) { + const shown = resources.slice(0, Math.max(visible, 0)); + const hidden = resources.slice(shown.length); + + return ( +
    + {shown.map((resource) => { + const Icon = RESOURCE_ICONS[resource]; + return ( +
  • + + +
  • + ); + })} + {hidden.length > 0 && ( +
  • + RESOURCE_LABELS[r]).join('、')}`} + aria-label={`还有 ${hidden.length} 项资源:${hidden.map((r) => RESOURCE_LABELS[r]).join('、')}`} + > + +{hidden.length} + +
  • + )} +
+ ); +} +ResourceBadges.displayName = 'ResourceBadges'; + +/** 难度(§4.3:文字「快速/标准/进阶」) */ +export function DifficultyBadge({ difficulty }: { difficulty: number }) { + const label = DIFFICULTY_LABELS[difficulty] ?? '标准'; + return ( + + + ); +} +DifficultyBadge.displayName = 'DifficultyBadge'; + +/** 免费层标记(§4.3) */ +export function FreeTierBadge({ freeTier }: { freeTier: ProjectView['freeTier'] }) { + const meta = FREE_TIER_META[freeTier]; + const Icon = + freeTier === 'yes' ? CircleCheck : freeTier === 'partial' ? CircleAlert : CircleDollarSign; + return ( + + + ); +} +FreeTierBadge.displayName = 'FreeTierBadge'; + +/** 即将推出(§3.1 waker 预告位) */ +export function ComingSoonBadge() { + return ( + + + ); +} +ComingSoonBadge.displayName = 'ComingSoonBadge'; + +/** 长期未更新 / 已归档标记(§6.3:只标记,不自动下架) */ +export function StaleBadge({ archived }: { archived: boolean }) { + return ( + + + ); +} +StaleBadge.displayName = 'StaleBadge'; + +/** 自动字段:star 数与最近更新时间(缺失时显示占位符,不许报错,§4.3/§8.2) */ +export function AutoMeta({ project }: { project: ProjectView }) { + return ( +
+ + + + +
+ ); +} +AutoMeta.displayName = 'AutoMeta'; diff --git a/src/components/project/project-card.tsx b/src/components/project/project-card.tsx new file mode 100644 index 0000000..61b702d --- /dev/null +++ b/src/components/project/project-card.tsx @@ -0,0 +1,91 @@ +/** + * 统一项目卡片(SPEC §2 / §4.3):首页、全部项目页、分类页、详情页底部推荐共用这一个组件。 + * + * 静态页面里由 Astro 在构建期渲染成 HTML(不挂 client 指令,零 JS); + * 列表页的 Explorer island 里复用同一个组件,因此三处徽章与入口不可能不一致。 + */ +import { ArrowUpRight, ChevronRight } from 'lucide-react'; + +import { + AutoMeta, + ComingSoonBadge, + DifficultyBadge, + FreeTierBadge, + ResourceBadges, + StaleBadge, + TierBadge, +} from '@/components/project/badges'; +import { ProjectThumb } from '@/components/project/project-thumb'; +import { Badge } from '@/components/ui/badge'; +import { Button } from '@/components/ui/button'; +import { primaryEntry } from '@/lib/project-entry'; +import { CATEGORY_LABELS, type ProjectView } from '@/lib/project-types'; +import { cn } from '@/lib/utils'; + +export function ProjectCard({ project, className }: { project: ProjectView; className?: string }) { + const entry = primaryEntry(project); + const detailHref = `/p/${project.slug}/`; + + return ( + + ); +} +export default ProjectCard; diff --git a/src/components/project/project-thumb.tsx b/src/components/project/project-thumb.tsx new file mode 100644 index 0000000..b24c790 --- /dev/null +++ b/src/components/project/project-thumb.tsx @@ -0,0 +1,72 @@ +/** + * 截图回退链(SPEC §8.3):项目截图 → 仓库 OG 图(已构建期本地化)→ 按分类着色的名称首字图。 + * + * 前两级由构建期 `project-view.ts` 判定文件是否真的存在,因此运行时不出现破图; + * 第三级是纯 CSS 渐变 + 首字,任何情况下都能渲染。禁止热链 GitHub 临时 URL。 + */ +import { cn } from '@/lib/utils'; +import { CATEGORY_LABELS, CATEGORY_THUMB_CLASSES, type ProjectView } from '@/lib/project-types'; + +export function ProjectThumb({ + project, + variant = 'card', + className, +}: { + project: ProjectView; + variant?: 'card' | 'detail'; + className?: string; +}) { + const src = project.screenshot ?? project.ogImage; + const isOg = !project.screenshot && project.ogImage !== null; + const alt = isOg + ? `${project.name} 的仓库预览图` + : project.screenshot + ? `${project.name} 项目截图` + : `${project.name}(${CATEGORY_LABELS[project.category]})占位图`; + + const frame = cn( + 'relative overflow-hidden rounded-lg border border-border bg-muted', + variant === 'card' ? 'aspect-[16/9]' : 'aspect-[2/1]', + className, + ); + + if (src) { + return ( +
+ {alt} +
+ ); + } + + const initial = [...project.name][0] ?? '?'; + return ( +
+ + + {CATEGORY_LABELS[project.category]} + +
+ ); +} +ProjectThumb.displayName = 'ProjectThumb'; diff --git a/src/components/site/explorer.tsx b/src/components/site/explorer.tsx new file mode 100644 index 0000000..fe0b813 --- /dev/null +++ b/src/components/site/explorer.tsx @@ -0,0 +1,423 @@ +/** + * 搜索 / 六维筛选 / 五种排序工具栏 + 结果网格(SPEC §8.2,Astro island)。 + * + * - 全部在浏览器本地完成,数据是构建时注入的 JSON 索引,无任何后端请求。 + * - 筛选状态写进 URL query:勾选/排序用 pushState(浏览器后退可还原上一步), + * 搜索输入 300ms 防抖后 replaceState(避免每敲一个字塞一条历史记录); + * popstate 时从 URL 还原状态。 + * - 卡片复用 `ProjectCard`(与首页 / 分类页 / 详情页推荐同一组件)。 + */ +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { ArrowUpDown, ChevronDown, Funnel, RotateCcw, Search, X } from 'lucide-react'; + +import { ProjectCard } from '@/components/project/project-card'; +import { Badge } from '@/components/ui/badge'; +import { Button } from '@/components/ui/button'; +import { Checkbox } from '@/components/ui/checkbox'; +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'; +import { + DropdownMenu, + DropdownMenuCheckboxItem, + DropdownMenuContent, + DropdownMenuLabel, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu'; +import { Input } from '@/components/ui/input'; +import { cn } from '@/lib/utils'; +import { + activeFilterCount, + isFilterEmpty, + parseFilters, + selectProjects, + toSearchParams, + type FilterOptions, +} from '@/lib/project-filter'; +import { + CATEGORY_ORDER, + CATEGORY_LABELS, + DIFFICULTY_LABELS, + FREE_TIER_META, + RESOURCE_LABELS, + SOURCE_LABELS, + SORT_OPTIONS, + TIER_META, + type FilterDimension, + type FilterState, + type ProjectView, + type SortKey, +} from '@/lib/project-types'; +import type { Category, Resource } from '@/lib/project-schema'; + +type Dimension = Exclude | 'category'; + +interface DimensionConfig { + key: Dimension; + label: string; + values: string[]; + labelOf: (value: string) => string; +} + +function buildDimensions(options: FilterOptions, lockedCategory: boolean): DimensionConfig[] { + const dimensions: DimensionConfig[] = [ + { + key: 'category', + label: '分类', + values: [...CATEGORY_ORDER].filter((slug) => options.category.includes(slug)), + labelOf: (value) => CATEGORY_LABELS[value as Category] ?? value, + }, + { + key: 'source', + label: '来源', + values: ['official', 'third-party'], + labelOf: (value) => SOURCE_LABELS[value as ProjectView['source']] ?? value, + }, + { + key: 'tier', + label: '验证等级', + values: ['official', 'verified', 'listed'], + labelOf: (value) => TIER_META[value as keyof typeof TIER_META]?.label ?? value, + }, + { + key: 'resources', + label: '所需资源', + values: options.resources, + labelOf: (value) => RESOURCE_LABELS[value as Resource] ?? value, + }, + { + key: 'difficulty', + label: '难度', + values: ['1', '2', '3'], + labelOf: (value) => `${DIFFICULTY_LABELS[Number(value)] ?? value}(${value})`, + }, + { + key: 'free', + label: '免费层', + values: ['yes', 'partial', 'no'], + labelOf: (value) => FREE_TIER_META[value as 'yes' | 'partial' | 'no']?.label ?? value, + }, + ]; + + return lockedCategory + ? dimensions.filter((dimension) => dimension.key !== 'category') + : dimensions; +} + +export interface ExplorerProps { + projects: ProjectView[]; + options: FilterOptions; + /** 分类页:预置并锁定分类过滤(§2 分类页复用列表筛选组件) */ + lockedCategory?: string; + /** 初始 query(服务端 `Astro.url.search`,含 `?`) */ + initialSearch?: string; +} + +export default function Explorer({ + projects, + options, + lockedCategory, + initialSearch = '', +}: ExplorerProps) { + const dimensions = useMemo( + () => buildDimensions(options, Boolean(lockedCategory)), + [options, lockedCategory], + ); + + const readFromUrl = useCallback( + () => + parseFilters(new URLSearchParams(initialSearch), { + lockedCategory: Boolean(lockedCategory), + }), + [initialSearch, options, lockedCategory], + ); + + const [filters, setFilters] = useState(readFromUrl); + const [mobileOpen, setMobileOpen] = useState(false); + const searchTimer = useRef(null); + + const results = useMemo(() => selectProjects(projects, filters), [projects, filters]); + const activeCount = activeFilterCount(filters); + + const syncUrl = useCallback((next: FilterState, mode: 'push' | 'replace') => { + const query = toSearchParams(next).toString(); + const url = `${window.location.pathname}${query ? `?${query}` : ''}`; + if (mode === 'push') window.history.pushState({ hubFilters: true }, '', url); + else window.history.replaceState({ hubFilters: true }, '', url); + }, []); + + // 静态站同一份 HTML 服务所有 query(构建期拿不到访客的 query): + // 挂载后按 window.location.search 还原一次,深链接与刷新都能保持筛选状态(§8.2 可分享) + useEffect(() => { + const fromUrl = parseFilters(new URLSearchParams(window.location.search), { + lockedCategory: Boolean(lockedCategory), + }); + setFilters(fromUrl); + }, [options, lockedCategory]); + + // 浏览器前进/后退 → 从 URL 还原筛选状态(可回退,§8.2) + useEffect(() => { + const onPopState = () => { + setFilters( + parseFilters(new URLSearchParams(window.location.search), { + lockedCategory: Boolean(lockedCategory), + }), + ); + }; + window.addEventListener('popstate', onPopState); + return () => window.removeEventListener('popstate', onPopState); + }, [options, lockedCategory]); + + useEffect( + () => () => { + if (searchTimer.current !== null) window.clearTimeout(searchTimer.current); + }, + [], + ); + + const commit = (next: FilterState) => { + setFilters(next); + syncUrl(next, 'push'); + }; + + const toggleValue = (dimension: Dimension, value: string) => { + const current = filters[dimension]; + const next = current.includes(value) + ? current.filter((item) => item !== value) + : [...current, value]; + commit({ ...filters, [dimension]: next }); + }; + + const handleSearch = (value: string) => { + const next: FilterState = { ...filters, q: value }; + setFilters(next); + if (searchTimer.current !== null) window.clearTimeout(searchTimer.current); + searchTimer.current = window.setTimeout(() => syncUrl(next, 'replace'), 300); + }; + + const handleSort = (value: string) => { + commit({ ...filters, sort: value as SortKey }); + }; + + const clearAll = () => { + const next = parseFilters(new URLSearchParams(), { + lockedCategory: Boolean(lockedCategory), + }); + setFilters(next); + syncUrl(next, 'push'); + }; + + const activeChips = dimensions.flatMap((dimension) => + filters[dimension.key].map((value) => ({ + dimension: dimension.key, + value, + label: `${dimension.label}:${dimension.labelOf(value)}`, + })), + ); + + const sortLabel = + SORT_OPTIONS.find((option) => option.value === filters.sort)?.label ?? SORT_OPTIONS[0].label; + + return ( +
+
+
+
+ +
+ + {/* 桌面端:六个筛选维度各一个下拉,键盘可达 */} +
+ {dimensions.map((dimension) => ( + + + + + + {dimension.label} + + {dimension.values.map((value) => ( + toggleValue(dimension.key, value)} + onSelect={(event) => event.preventDefault()} + > + {dimension.labelOf(value)} + + ))} + + + ))} +
+ +
+ {/* 移动端:全部筛选维度收进一个对话框 */} + + + + + + + + 排序 + + + {SORT_OPTIONS.map((option) => ( + + {option.label} + + ))} + + + +
+
+ + {activeChips.length > 0 && ( +
+ 已选: + {activeChips.map((chip) => ( + + ))} + +
+ )} +
+ +

+ 项目列表 +

+

+ {isFilterEmpty(filters) + ? `共 ${results.length} 个项目` + : `筛选出 ${results.length} / ${projects.length} 个项目`} +

+ + {results.length === 0 ? ( +
+

没有匹配的项目

+

试试减少筛选条件,或者换个关键词。

+ +
+ ) : ( +
    + {results.map((project) => ( +
  • + +
  • + ))} +
+ )} + + + + + 筛选项目 + +
+ {dimensions.map((dimension) => ( +
+ {dimension.label} +
+ {dimension.values.map((value) => { + const id = `mobile-${dimension.key}-${value}`; + const checked = filters[dimension.key].includes(value); + return ( +
+ toggleValue(dimension.key, value)} + /> + +
+ ); + })} +
+
+ ))} +
+
+ + +
+
+
+
+ ); +} diff --git a/src/components/site/site-footer.astro b/src/components/site/site-footer.astro new file mode 100644 index 0000000..540a4f5 --- /dev/null +++ b/src/components/site/site-footer.astro @@ -0,0 +1,95 @@ +--- +/** + * 页脚(SPEC §8.3):git describe 版本号 + 构建日期/时间(构建注入、源码不写死)、 + * GitHub 组织链接、关于链接、第三方版权与责任声明。 + */ +import { ExternalLink } from 'lucide-react'; + +import { getBuildInfo } from '@/lib/build-info'; +import { SITE, THIRD_PARTY_DISCLAIMER } from '@/lib/site'; + +const { version, builtAt } = getBuildInfo(); +const year = new Date().getUTCFullYear(); +--- + + diff --git a/src/components/site/site-header.astro b/src/components/site/site-header.astro new file mode 100644 index 0000000..619f05a --- /dev/null +++ b/src/components/site/site-header.astro @@ -0,0 +1,67 @@ +--- +/** + * 页头(全站导航 + 主题切换)。 + * 导航链接全部是站内静态页面;主题切换是唯一的常驻 island。 + */ +import { ExternalLink } from 'lucide-react'; + +import ThemeToggle from '@/components/site/theme-toggle'; +import { NAV_ITEMS, SITE } from '@/lib/site'; + +const pathname = Astro.url.pathname; +const isActive = (href: string) => pathname === href || (href !== '/' && pathname.startsWith(href)); +--- + +
+
+ + + WorkerHub + + + + + + +
+
diff --git a/src/components/site/theme-toggle.tsx b/src/components/site/theme-toggle.tsx new file mode 100644 index 0000000..d123226 --- /dev/null +++ b/src/components/site/theme-toggle.tsx @@ -0,0 +1,112 @@ +/** + * 主题三档切换(SPEC §3B / §8.3):亮 / 暗 / 自动,默认自动。 + * + * - 偏好只存浏览器本地(localStorage `hub-theme`),本站无登录、无后端。 + * - 首屏防闪烁由 BaseLayout `` 里的内联脚本完成(先于绘制应用 class); + * 本 island 只负责交互与「自动档跟随系统实时变化」。 + * - 三段用 shadcn/ui DropdownMenu 单选组,键盘可操作。 + */ +import { useEffect, useState } from 'react'; +import { Monitor, Moon, Sun } from 'lucide-react'; + +import { Button } from '@/components/ui/button'; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuLabel, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu'; + +export const THEME_STORAGE_KEY = 'hub-theme'; +export type ThemeMode = 'system' | 'light' | 'dark'; + +const MODES: { value: ThemeMode; label: string; icon: typeof Sun }[] = [ + { value: 'system', label: '自动(跟随系统)', icon: Monitor }, + { value: 'light', label: '亮色', icon: Sun }, + { value: 'dark', label: '暗色', icon: Moon }, +]; + +const FALLBACK_MODE = { value: 'system' as ThemeMode, label: '自动(跟随系统)', icon: Monitor }; + +function readStoredMode(): ThemeMode { + try { + const stored = window.localStorage.getItem(THEME_STORAGE_KEY); + if (stored === 'light' || stored === 'dark' || stored === 'system') return stored; + } catch { + // 隐私模式等场景禁用 localStorage:按自动处理,不报错 + } + return 'system'; +} + +/** 把模式应用到 (class + color-scheme),与 BaseLayout 内联脚本保持同一套规则 */ +export function applyTheme(mode: ThemeMode): void { + const dark = + mode === 'dark' || + (mode === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); + const root = document.documentElement; + root.classList.toggle('dark', dark); + root.style.colorScheme = dark ? 'dark' : 'light'; + root.dataset.themeMode = mode; +} + +export default function ThemeToggle() { + // 服务端与首次客户端渲染都按「自动」输出,读 localStorage 放到 effect 里,避免 hydration 不一致 + const [mode, setMode] = useState('system'); + + useEffect(() => { + const stored = readStoredMode(); + setMode(stored); + applyTheme(stored); + }, []); + + // 自动档:系统主题实时变化时立刻跟随 + useEffect(() => { + if (mode !== 'system') return; + const media = window.matchMedia('(prefers-color-scheme: dark)'); + const onChange = () => applyTheme('system'); + media.addEventListener('change', onChange); + return () => media.removeEventListener('change', onChange); + }, [mode]); + + const handleChange = (value: string) => { + const next = (value === 'light' || value === 'dark' ? value : 'system') as ThemeMode; + setMode(next); + try { + window.localStorage.setItem(THEME_STORAGE_KEY, next); + } catch { + // 存不了就只在本次会话生效,不阻塞交互 + } + applyTheme(next); + }; + + const current = MODES.find((item) => item.value === mode) ?? FALLBACK_MODE; + const Icon = current.icon; + + return ( + + + + + + 主题 + + + {MODES.map((item) => { + const ItemIcon = item.icon; + return ( + + + ); + })} + + + + ); +} diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx new file mode 100644 index 0000000..9bc93d8 --- /dev/null +++ b/src/components/ui/badge.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import { Slot } from '@radix-ui/react-slot'; +import { cva, type VariantProps } from 'class-variance-authority'; + +import { cn } from '@/lib/utils'; + +const badgeVariants = cva( + 'inline-flex items-center justify-center gap-1 rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', + { + variants: { + variant: { + default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90', + secondary: + 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90', + destructive: + 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60', + outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground', + }, + }, + defaultVariants: { + variant: 'default', + }, + }, +); + +function Badge({ + className, + variant, + asChild = false, + ...props +}: React.ComponentProps<'span'> & VariantProps & { asChild?: boolean }) { + const Comp = asChild ? Slot : 'span'; + + return ( + + ); +} + +export { Badge, badgeVariants }; diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx new file mode 100644 index 0000000..b579275 --- /dev/null +++ b/src/components/ui/button.tsx @@ -0,0 +1,56 @@ +import * as React from 'react'; +import { Slot } from '@radix-ui/react-slot'; +import { cva, type VariantProps } from 'class-variance-authority'; + +import { cn } from '@/lib/utils'; + +const buttonVariants = cva( + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", + { + variants: { + variant: { + default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90', + destructive: + 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60', + outline: + 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50', + secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80', + ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50', + link: 'text-primary underline-offset-4 hover:underline', + }, + size: { + default: 'h-9 px-4 py-2 has-[>svg]:px-3', + sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5', + lg: 'h-10 rounded-md px-6 has-[>svg]:px-4', + icon: 'size-9', + }, + }, + defaultVariants: { + variant: 'default', + size: 'default', + }, + }, +); + +function Button({ + className, + variant, + size, + asChild = false, + ...props +}: React.ComponentProps<'button'> & + VariantProps & { + asChild?: boolean; + }) { + const Comp = asChild ? Slot : 'button'; + + return ( + + ); +} + +export { Button, buttonVariants }; diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx new file mode 100644 index 0000000..9fb2996 --- /dev/null +++ b/src/components/ui/checkbox.tsx @@ -0,0 +1,27 @@ +import * as React from 'react'; +import * as CheckboxPrimitive from '@radix-ui/react-checkbox'; +import { CheckIcon } from 'lucide-react'; + +import { cn } from '@/lib/utils'; + +function Checkbox({ className, ...props }: React.ComponentProps) { + return ( + + + + + + ); +} + +export { Checkbox }; diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx new file mode 100644 index 0000000..cc39d6d --- /dev/null +++ b/src/components/ui/dialog.tsx @@ -0,0 +1,127 @@ +import * as React from 'react'; +import * as DialogPrimitive from '@radix-ui/react-dialog'; +import { XIcon } from 'lucide-react'; + +import { cn } from '@/lib/utils'; + +function Dialog({ ...props }: React.ComponentProps) { + return ; +} + +function DialogTrigger({ ...props }: React.ComponentProps) { + return ; +} + +function DialogPortal({ ...props }: React.ComponentProps) { + return ; +} + +function DialogClose({ ...props }: React.ComponentProps) { + return ; +} + +function DialogOverlay({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +function DialogContent({ + className, + children, + showCloseButton = true, + ...props +}: React.ComponentProps & { + showCloseButton?: boolean; +}) { + return ( + + + + {children} + {showCloseButton && ( + + + 关闭 + + )} + + + ); +} + +function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ); +} + +function DialogFooter({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ); +} + +function DialogTitle({ className, ...props }: React.ComponentProps) { + return ( + + ); +} + +function DialogDescription({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +export { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogOverlay, + DialogPortal, + DialogTitle, + DialogTrigger, +}; diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx new file mode 100644 index 0000000..c725774 --- /dev/null +++ b/src/components/ui/dropdown-menu.tsx @@ -0,0 +1,226 @@ +import * as React from 'react'; +import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'; +import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react'; + +import { cn } from '@/lib/utils'; + +function DropdownMenu({ ...props }: React.ComponentProps) { + return ; +} + +function DropdownMenuPortal({ + ...props +}: React.ComponentProps) { + return ; +} + +function DropdownMenuTrigger({ + ...props +}: React.ComponentProps) { + return ; +} + +function DropdownMenuContent({ + className, + sideOffset = 4, + ...props +}: React.ComponentProps) { + return ( + + + + ); +} + +function DropdownMenuGroup({ ...props }: React.ComponentProps) { + return ; +} + +function DropdownMenuItem({ + className, + inset, + variant = 'default', + ...props +}: React.ComponentProps & { + inset?: boolean; + variant?: 'default' | 'destructive'; +}) { + return ( + + ); +} + +function DropdownMenuCheckboxItem({ + className, + children, + checked, + ...props +}: React.ComponentProps) { + return ( + + + + + + + {children} + + ); +} + +function DropdownMenuRadioGroup({ + ...props +}: React.ComponentProps) { + return ; +} + +function DropdownMenuRadioItem({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + + + + + + {children} + + ); +} + +function DropdownMenuLabel({ + className, + inset, + ...props +}: React.ComponentProps & { + inset?: boolean; +}) { + return ( + + ); +} + +function DropdownMenuSeparator({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) { + return ( + + ); +} + +function DropdownMenuSub({ ...props }: React.ComponentProps) { + return ; +} + +function DropdownMenuSubTrigger({ + className, + inset, + children, + ...props +}: React.ComponentProps & { + inset?: boolean; +}) { + return ( + + {children} + + + ); +} + +function DropdownMenuSubContent({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +export { + DropdownMenu, + DropdownMenuPortal, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuLabel, + DropdownMenuItem, + DropdownMenuCheckboxItem, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuSub, + DropdownMenuSubTrigger, + DropdownMenuSubContent, +}; diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx new file mode 100644 index 0000000..3c1cfca --- /dev/null +++ b/src/components/ui/input.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; + +import { cn } from '@/lib/utils'; + +function Input({ className, type, ...props }: React.ComponentProps<'input'>) { + return ( + + ); +} + +export { Input }; diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx new file mode 100644 index 0000000..cf51fab --- /dev/null +++ b/src/components/ui/separator.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; +import * as SeparatorPrimitive from '@radix-ui/react-separator'; + +import { cn } from '@/lib/utils'; + +function Separator({ + className, + orientation = 'horizontal', + decorative = true, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +export { Separator }; diff --git a/src/layouts/base-layout.astro b/src/layouts/base-layout.astro new file mode 100644 index 0000000..f5a5493 --- /dev/null +++ b/src/layouts/base-layout.astro @@ -0,0 +1,117 @@ +--- +/** + * 全站基础布局:SEO/分享元数据、主题防闪烁、页头页脚、无障碍跳转。 + * + * SPEC §10 硬性:canonical / og:url 恒写主域名 `https://hub.oneboy.app`,镜像侧也不按访问域名动态生成 + * —— 这里只从 `src/lib/site.ts` 的常量拼绝对地址,从不读 `Astro.url.host`。 + */ +import '../styles/global.css'; + +import SiteFooter from '@/components/site/site-footer.astro'; +import SiteHeader from '@/components/site/site-header.astro'; +import { absoluteUrl, SITE } from '@/lib/site'; + +export interface Props { + /** 完整 (页面自己拼好,详情页模板见 §10) */ + title: string; + description: string; + /** OG/Twitter 分享图(主域名绝对地址);缺省用站点级 OG 图 */ + ogImage?: string; + ogType?: 'website' | 'article'; + /** 站内路径,缺省取当前页 pathname;用于 canonical / og:url */ + canonicalPath?: string; + noindex?: boolean; +} + +const { + title, + description, + ogImage = absoluteUrl('/og/og-default.png'), + ogType = 'website', + canonicalPath, + noindex = false, +} = Astro.props; + +const canonical = absoluteUrl(canonicalPath ?? Astro.url.pathname); + +// 统计默认不接入;仅当配置了 token 才注入 Cloudflare Web Analytics(无 cookie,§10) +const analyticsToken = import.meta.env.HUB_CF_ANALYTICS_TOKEN ?? process.env.HUB_CF_ANALYTICS_TOKEN; +--- + +<!doctype html> +<html lang="zh-CN"> + <head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + + {/* + 主题三档首屏防闪烁(§3B/§8.3):这段内联脚本必须同步执行、且早于样式与绘制。 + 与 ThemeToggle island 的 applyTheme() 规则完全一致:dark class + color-scheme。 + */} + <script is:inline> + (function () { + try { + var stored = window.localStorage.getItem('hub-theme'); + var mode = stored === 'light' || stored === 'dark' ? stored : 'system'; + var dark = + mode === 'dark' || + (mode === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); + var root = document.documentElement; + root.classList.toggle('dark', dark); + root.style.colorScheme = dark ? 'dark' : 'light'; + root.dataset.themeMode = mode; + } catch (error) { + /* localStorage 不可用时按自动档渲染,不阻塞首屏 */ + } + })(); + </script> + + <title>{title} + + + {noindex && } + + + + + + + + + + + + + + + + + + + + {analyticsToken && ( +