feat: 骨架——Vite + Vue3 + Fabric v7,左工作区右侧栏

共享外壳与类型契约,四条并行开发线在此之上各自填空:
- types.ts 是唯一的跨线接口,并行期间冻结
- editor/ 画布单例、选中态、尺寸预设与比例锁
- Sidebar 按选中对象切换面板,五个面板位已接好
- fonts/ filters/ sources/ io/ 留桩,各线只改自己目录

导出定 WebP:实测 540x287 PNG 134KB vs 1200x630 WebP 23KB。
字体接口挂在 Vite 中间件上,工具只在 dev 下完整可用。
This commit is contained in:
Jz0ojiang
2026-09-04 15:42:27 +08:00
commit 95eeb69ff8
26 changed files with 1390 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import type { BackgroundAsset } from "@/types";
/**
* 【T4 待实现 — 背景来源】
*
* 三个来源各写一个模块,都返回 BackgroundAsset:
* - upload.ts 本地文件 -> object URL
* - geometry.ts 预设几何底纹,程序生成(画到离屏 canvas 再 toDataURL)
* - unsplash.ts Unsplash 搜索。Access Key 从 import.meta.env.VITE_UNSPLASH_KEY 读,
* 放 .env.local(已 gitignore)。条款强制署名,返回时填 attribution。
*/
export async function fromUpload(_file: File): Promise<BackgroundAsset> {
throw new Error("T4 未实现:fromUpload");
}
export async function searchUnsplash(_query: string): Promise<BackgroundAsset[]> {
throw new Error("T4 未实现:searchUnsplash");
}