diff --git a/.drone.yml b/.drone.yml index fe6630b..9d2c794 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,6 +28,11 @@ steps: commands: - npm --prefix apps/admin ci --no-audit --no-fund - npm --prefix apps/admin run build + - name: build-pc + image: node:24-alpine + commands: + - npm --prefix apps/pc ci --no-audit --no-fund + - npm --prefix apps/pc run build trigger: event: [push, pull_request, tag] diff --git a/apps/README.md b/apps/README.md index f03d8ca..f7a6dd8 100644 --- a/apps/README.md +++ b/apps/README.md @@ -3,7 +3,7 @@ | 路径 | 构建目标 | 制品名 | | --- | --- | --- | | `h5/` | uni-app 移动网页 | `item-atlas-h5` | -| `pc/` | 桌面浏览器网页 | `item-atlas-pc` | +| [pc/](pc/README.md) | 桌面浏览器网页 | `item-atlas-pc` | | [admin/](admin/README.md) | 管理后台 | `item-atlas-admin` | | [ios/](ios/README.md) | iOS 原生应用 | 见物 | | `android/` | Android 原生应用 | 见物 | diff --git a/apps/pc/.dockerignore b/apps/pc/.dockerignore new file mode 100644 index 0000000..79416de --- /dev/null +++ b/apps/pc/.dockerignore @@ -0,0 +1,4 @@ +node_modules +dist +.env* +.gitignore diff --git a/apps/pc/.gitignore b/apps/pc/.gitignore new file mode 100644 index 0000000..f4650bb --- /dev/null +++ b/apps/pc/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +.env.local +.env.*.local diff --git a/apps/pc/Dockerfile b/apps/pc/Dockerfile new file mode 100644 index 0000000..de14394 --- /dev/null +++ b/apps/pc/Dockerfile @@ -0,0 +1,11 @@ +FROM node:24-alpine AS build +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --no-audit --no-fund +COPY . . +RUN npm run build + +FROM nginx:1.31-alpine +ENV ATLAS_GATEWAY_URL=http://item-atlas-gateway:8080 +COPY nginx.conf.template /etc/nginx/templates/default.conf.template +COPY --from=build /app/dist /usr/share/nginx/html diff --git a/apps/pc/README.md b/apps/pc/README.md new file mode 100644 index 0000000..4833450 --- /dev/null +++ b/apps/pc/README.md @@ -0,0 +1,25 @@ +# 见物桌面工作台 + +Vue 3、TypeScript、Vue Router 和 Vite。网页使用同源 `/api` 接现有网关,账号、物品和布局与 iOS 共享。 + +## 本地运行 + +使用 Node.js 24。在仓库根目录执行: + +```sh +npm --prefix apps/pc ci +npm --prefix apps/pc run dev -- --port 4173 +``` + +打开 `http://127.0.0.1:4173`。开发代理默认使用公网预览 API,可用 `ATLAS_GATEWAY_URL` 切换到其他网关。登录令牌只在当前页面内存中使用,刷新页面后重新登录。 + +## 构建与部署 + +```sh +npm --prefix apps/pc run build +docker build -t item-atlas-pc:0.1.0 apps/pc +``` + +镜像监听 8080。容器内 `ATLAS_GATEWAY_URL` 指向可达的网关;同一 Kubernetes 命名空间默认用 `http://item-atlas-gateway:8080`。就绪检查用 `/healthz`,Nginx 负责 SPA 路由和同源 API 转发。外部站点通过 HTTPS 接入。Drone 在现有流水线运行 `build-pc` 构建检查。 + +[产品交互](../../docs/ui/pc-workbench.md) · [域名与部署](../../docs/deployment/overview.md) diff --git a/apps/pc/index.html b/apps/pc/index.html new file mode 100644 index 0000000..1603561 --- /dev/null +++ b/apps/pc/index.html @@ -0,0 +1,13 @@ + + + + + + + 见物 · 桌面工作台 + + +
+ + + diff --git a/apps/pc/nginx.conf.template b/apps/pc/nginx.conf.template new file mode 100644 index 0000000..7293a6e --- /dev/null +++ b/apps/pc/nginx.conf.template @@ -0,0 +1,22 @@ +server { + listen 8080; + root /usr/share/nginx/html; + + location = /healthz { return 200; } + location /api/ { + proxy_pass ${ATLAS_GATEWAY_URL}; + proxy_ssl_server_name on; + proxy_set_header Host $proxy_host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 80s; + } + location /assets/ { + try_files $uri =404; + add_header Cache-Control "public, max-age=31536000, immutable"; + } + location / { + add_header Cache-Control "no-cache"; + add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'"; + try_files $uri /index.html; + } +} diff --git a/apps/pc/package-lock.json b/apps/pc/package-lock.json new file mode 100644 index 0000000..a1eaec9 --- /dev/null +++ b/apps/pc/package-lock.json @@ -0,0 +1,1252 @@ +{ + "name": "item-atlas-pc", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "item-atlas-pc", + "version": "0.1.0", + "dependencies": { + "@lucide/vue": "1.82.0", + "vue": "3.5.46", + "vue-router": "4.6.4" + }, + "devDependencies": { + "@vitejs/plugin-vue": "6.0.9", + "typescript": "5.9.3", + "vite": "8.3.8", + "vue-tsc": "3.2.5" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.15.tgz", + "integrity": "sha512-C2FuapQ2Kh1OnVHAoLi5rD3GBJ8COb9Q609T6HEpLqaBAo560PDP5OxBE5dCI/h951MBO/+bCUYU5SZ+8ZlV+w==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.15.tgz", + "integrity": "sha512-RpKWyisHoP81twtSCgmE02iU0RnPcq1DN5bBEbpUePrjA9Q3wXhufnCJrrayPpoZieqFh3zyZQqwtSK0gGccRA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.15" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.15", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.15.tgz", + "integrity": "sha512-/XKpKDakL//LZ66bq1XsZOswuqeI5MZqPLDu18o3XdkU1fNJ7bdPtzgnc4ZNS+bBGHV0FJG8jjb8SwcC3nNVQQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.15", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/core": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz", + "integrity": "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "2.2.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.2.tgz", + "integrity": "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz", + "integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@lucide/vue": { + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@lucide/vue/-/vue-1.82.0.tgz", + "integrity": "sha512-Wd9UJqVTF1Q0RxEseQfD/46dBXLAgbRXdx1LI0XZTcoIWSAkjQRz7OC7b+fhl8t+tMwlH9U24WYLG6hX/zKO3Q==", + "license": "ISC", + "peerDependencies": { + "vue": ">=3.0.1" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz", + "integrity": "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || 2.0.0-beta.2", + "@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz", + "integrity": "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.19.tgz", + "integrity": "sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.19.tgz", + "integrity": "sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.19.tgz", + "integrity": "sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.19.tgz", + "integrity": "sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.19.tgz", + "integrity": "sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.19.tgz", + "integrity": "sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.19.tgz", + "integrity": "sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.19.tgz", + "integrity": "sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.19.tgz", + "integrity": "sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.19.tgz", + "integrity": "sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.19.tgz", + "integrity": "sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.19.tgz", + "integrity": "sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.19.tgz", + "integrity": "sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "2.0.0-beta.2", + "@emnapi/runtime": "2.0.0-beta.2", + "@napi-rs/wasm-runtime": "1.2.6" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.19.tgz", + "integrity": "sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.19.tgz", + "integrity": "sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz", + "integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@vitejs/plugin-vue": { + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.0.9.tgz", + "integrity": "sha512-rD/MORlhaZMlXWW0rEn4FB4wMinWC0z/D7Ye160S5+Rs1mC8ZDAdcDp4SjKfUhG5t8q1ktcPVw4xuTkPRlzrSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@volar/language-core": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.28.tgz", + "integrity": "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/source-map": "2.4.28" + } + }, + "node_modules/@volar/source-map": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.28.tgz", + "integrity": "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@volar/typescript": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.28.tgz", + "integrity": "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.28", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.46.tgz", + "integrity": "sha512-yb+N8/mgBcoeqCJPVyJI/D3OphLrSMXnB3ZQUNmRLU/1fsMW4bFfdJWNi9oIj7+EA3ULKKkP7b/VCpcYQYeiuQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.12", + "@vue/shared": "3.5.46", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.3" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.46.tgz", + "integrity": "sha512-Bj3lCSw3DQnDRDxw115XqdLDd0+18Nftlgd8OXSGG+ud74hxJIE17eYrM+VWgQrTMsvJbLh9Hzf2MkwAzru36Q==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.46", + "@vue/shared": "3.5.46" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.46.tgz", + "integrity": "sha512-hjUvMxGh+QIgegwksfp6BRBYleE/a8veZHvTR6sa+o+bM4HU+WnrUZlhN0X+pDcsl8Lhwmbu72xPvLMk3XUwog==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.12", + "@vue/compiler-core": "3.5.46", + "@vue/compiler-dom": "3.5.46", + "@vue/compiler-ssr": "3.5.46", + "@vue/shared": "3.5.46", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.32", + "source-map-js": "^1.2.3" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.46.tgz", + "integrity": "sha512-qebChL3aP0m1k+TlSf+fZWvOwAf3flBCi5o+n01ykR3DX4mTIWheFltmoiQ12+z66/4cGeXqbB2P7sPWkGhQNQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.46", + "@vue/shared": "3.5.46" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, + "node_modules/@vue/language-core": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-3.2.5.tgz", + "integrity": "sha512-d3OIxN/+KRedeM5wQ6H6NIpwS3P5gC9nmyaHgBk+rO6dIsjY+tOh4UlPpiZbAh3YtLdCGEX4M16RmsBqPmJV+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.28", + "@vue/compiler-dom": "^3.5.0", + "@vue/shared": "^3.5.0", + "alien-signals": "^3.0.0", + "muggle-string": "^0.4.1", + "path-browserify": "^1.0.1", + "picomatch": "^4.0.2" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.46.tgz", + "integrity": "sha512-+FHtYTvGxgFoX3oRs7soz6JHizGv50Q26WJN6PWtXuTLXRfkfUpDUTRuoTA/kiZVVt8NMeMpsPQLh9h++ReUjQ==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.46" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.46.tgz", + "integrity": "sha512-eJUzKAUaHAmtnys/l9qduPzUnBrYMkmsCU7TN+vbSOSpm8kcETT7nacKxIO4MBej/XiOraVzq+lSeZv7o1//jQ==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.46", + "@vue/shared": "3.5.46" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.46.tgz", + "integrity": "sha512-6L7lbBvXTYBFFjIt25a0pgdpmn3Ns8RqUnNVibRzF4bgyiWJvqOhKEV5MXYWKlCttZE3aGeJN8mveo+6IrIKXA==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.46", + "@vue/runtime-core": "3.5.46", + "@vue/shared": "3.5.46", + "csstype": "^3.2.4" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.46.tgz", + "integrity": "sha512-4mc0YWREc6OZ5pDCigvKPDzIUV+aciiH92yvyTS6xaHHxW/80rMceQQn11pYe7OEEBt2YQgYWR9zF8QF30GJUQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.46", + "@vue/runtime-dom": "3.5.46", + "@vue/shared": "3.5.46" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.46.tgz", + "integrity": "sha512-P1WePbdzHrcIciWtmY2Im9EFhdakd3rZxYqvalOa3SfoxtF35Q8Uhmj1tKn6bWP4utcOpN8ao6BoJUItq0Uf+g==", + "license": "MIT" + }, + "node_modules/alien-signals": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/alien-signals/-/alien-signals-3.2.1.tgz", + "integrity": "sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g==", + "dev": true, + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.4.tgz", + "integrity": "sha512-PoKaoPzQapnEoqUSnHx1u6W6ku8CVEgKsnpmmzU3m1nwkidpPBQ8V/Zq2+bWNrsOKoKLwTGdbx6xF7BXP1zLVQ==", + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.34", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.34.tgz", + "integrity": "sha512-P1Qzj0XXZjMda74C7qiVnBG90UKNbyNUAOeQRBW8X63RsIMV57gevRqjnkELdwtZ/S2/uQFksJhmwuN8xShLPw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.4" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rolldown": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.19.tgz", + "integrity": "sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.19", + "@rolldown/binding-android-arm64": "1.2.19", + "@rolldown/binding-darwin-arm64": "1.2.19", + "@rolldown/binding-darwin-x64": "1.2.19", + "@rolldown/binding-freebsd-x64": "1.2.19", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.19", + "@rolldown/binding-linux-arm64-gnu": "1.2.19", + "@rolldown/binding-linux-arm64-musl": "1.2.19", + "@rolldown/binding-linux-ppc64-gnu": "1.2.19", + "@rolldown/binding-linux-s390x-gnu": "1.2.19", + "@rolldown/binding-linux-x64-gnu": "1.2.19", + "@rolldown/binding-linux-x64-musl": "1.2.19", + "@rolldown/binding-openharmony-arm64": "1.2.19", + "@rolldown/binding-wasm32-wasi": "1.2.19", + "@rolldown/binding-win32-arm64-msvc": "1.2.19", + "@rolldown/binding-win32-x64-msvc": "1.2.19" + } + }, + "node_modules/source-map-js": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz", + "integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/vite": { + "version": "8.3.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.8.tgz", + "integrity": "sha512-LzOn3h9rG/0vhLdXrV4yJ4QFA9eEoqCl+Yx+kGJd7aB9w6nfNgVHKSYwLPZUHrz4ZGa+t+kXjV9itvcHDLQouA==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.32", + "rolldown": "~1.2.18", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vscode-uri": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.2.0.tgz", + "integrity": "sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/vue": { + "version": "3.5.46", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.46.tgz", + "integrity": "sha512-0kW5CgfjMPBqmH158049SaE1muufp+K/ZyrwvSEwrwYky6QB7zL2y8kXfruneKb9O12eh0xAJL6CVSpzb9o0Kg==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.46", + "@vue/compiler-sfc": "3.5.46", + "@vue/runtime-dom": "3.5.46", + "@vue/server-renderer": "3.5.46", + "@vue/shared": "3.5.46" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.4.tgz", + "integrity": "sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/vue-tsc": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-3.2.5.tgz", + "integrity": "sha512-/htfTCMluQ+P2FISGAooul8kO4JMheOTCbCy4M6dYnYYjqLe3BExZudAua6MSIKSFYQtFOYAll7XobYwcpokGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/typescript": "2.4.28", + "@vue/language-core": "3.2.5" + }, + "bin": { + "vue-tsc": "bin/vue-tsc.js" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + } + } + } +} diff --git a/apps/pc/package.json b/apps/pc/package.json new file mode 100644 index 0000000..635d506 --- /dev/null +++ b/apps/pc/package.json @@ -0,0 +1,22 @@ +{ + "name": "item-atlas-pc", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "check": "vue-tsc --noEmit", + "build": "vue-tsc --noEmit && vite build" + }, + "dependencies": { + "@lucide/vue": "1.82.0", + "vue": "3.5.46", + "vue-router": "4.6.4" + }, + "devDependencies": { + "@vitejs/plugin-vue": "6.0.9", + "typescript": "5.9.3", + "vite": "8.3.8", + "vue-tsc": "3.2.5" + } +} diff --git a/apps/pc/public/brand.png b/apps/pc/public/brand.png new file mode 100644 index 0000000..bf8baec Binary files /dev/null and b/apps/pc/public/brand.png differ diff --git a/apps/pc/src/App.vue b/apps/pc/src/App.vue new file mode 100644 index 0000000..069648f --- /dev/null +++ b/apps/pc/src/App.vue @@ -0,0 +1,128 @@ + + + diff --git a/apps/pc/src/api.ts b/apps/pc/src/api.ts new file mode 100644 index 0000000..1d8ddcf --- /dev/null +++ b/apps/pc/src/api.ts @@ -0,0 +1,99 @@ +import { ref } from 'vue' + +type Grant = { accessToken: string; refreshToken: string; expiresIn: number } +type Session = Grant & { expiry: number } +type Options = { method?: string; body?: unknown; signal?: AbortSignal; idempotencyKey?: string } + +export class ApiError extends Error { + constructor(readonly status: number, message: string) { super(message) } +} + +export const signedIn = ref(false) +let session: Session | null = null +let generation = 0 +let renewing: Promise | null = null + +async function request(path: string, options: Options, access?: string): Promise { + const headers = new Headers({ Accept: 'application/json' }) + if (options.body !== undefined) headers.set('Content-Type', 'application/json') + if (access) headers.set('Authorization', 'Bearer ' + access) + if (options.idempotencyKey) headers.set('Idempotency-Key', options.idempotencyKey) + const response = await fetch(path, { + method: options.method, headers, signal: options.signal, cache: 'no-store', + body: options.body === undefined ? undefined : JSON.stringify(options.body), + }) + if (!response.ok) { + const issue = await response.json().catch(() => ({})) + throw new ApiError(response.status, issue.detail || issue.message || '请求失败(' + response.status + ')') + } + return response.status === 204 ? undefined as T : await response.json() as T +} + +function clear() { + generation++ + session = null + renewing = null + signedIn.value = false +} + +function install(grant: Grant) { + session = { ...grant, expiry: Date.now() + grant.expiresIn * 1000 } + signedIn.value = true + return session +} + +export async function login(username: string, password: string) { + const attempt = ++generation + const grant = await request('/api/session/login', { method: 'POST', body: { username, password } }) + if (attempt === generation) install(grant) +} + +export async function logout() { + const pending = renewing + const refreshToken = session?.refreshToken + clear() + // A completed refresh may have already rotated the token on the server. + await pending?.catch(() => {}) + if (refreshToken) await request('/api/session/logout', { method: 'POST', body: { refreshToken } }).catch(() => {}) +} + +function refresh(rejected?: string): Promise { + if (renewing) return renewing + if (!session) return Promise.reject(new ApiError(401, '请重新登录。')) + if (session.expiry > Date.now() + 30000 && session.accessToken !== rejected) return Promise.resolve(session) + const attempt = generation + const task = request('/api/session/refresh', { method: 'POST', body: { refreshToken: session.refreshToken } }) + .then(async (grant) => { + if (attempt !== generation) { + await request('/api/session/logout', { method: 'POST', body: { refreshToken: grant.refreshToken } }).catch(() => {}) + throw new DOMException('会话已结束', 'AbortError') + } + return install(grant) + }) + .catch((error) => { + if (attempt === generation && error instanceof ApiError && error.status === 401) clear() + throw error + }) + .finally(() => { if (renewing === task) renewing = null }) + renewing = task + return task +} + +export async function api(path: string, options: Options = {}): Promise { + const attempt = generation + const access = (await refresh()).accessToken + let result: T + try { + result = await request(path, options, access) + } catch (error) { + if (!(error instanceof ApiError) || error.status !== 401 || attempt !== generation) throw error + options.signal?.throwIfAborted() + result = await request(path, options, (await refresh(access)).accessToken) + } + if (attempt !== generation) throw new DOMException('会话已结束', 'AbortError') + return result +} + +export const message = (error: unknown) => error instanceof TypeError + ? '连接服务失败,请检查网络后重试。' + : error instanceof Error ? error.message : '请求失败,请重试。' diff --git a/apps/pc/src/items/IntakeDialog.vue b/apps/pc/src/items/IntakeDialog.vue new file mode 100644 index 0000000..572ec76 --- /dev/null +++ b/apps/pc/src/items/IntakeDialog.vue @@ -0,0 +1,147 @@ + + + diff --git a/apps/pc/src/items/Inventory.vue b/apps/pc/src/items/Inventory.vue new file mode 100644 index 0000000..b90bcc2 --- /dev/null +++ b/apps/pc/src/items/Inventory.vue @@ -0,0 +1,217 @@ + + + diff --git a/apps/pc/src/main.ts b/apps/pc/src/main.ts new file mode 100644 index 0000000..44c48a0 --- /dev/null +++ b/apps/pc/src/main.ts @@ -0,0 +1,17 @@ +import { createApp } from 'vue' +import { createRouter, createWebHistory } from 'vue-router' +import App from './App.vue' +import Inventory from './items/Inventory.vue' +import FloorPlan from './plan/FloorPlan.vue' +import './style.css' + +const router = createRouter({ + history: createWebHistory(), + routes: [ + { path: '/', redirect: '/items' }, + { path: '/items', name: 'items', component: Inventory }, + { path: '/floor-plan', name: 'plan', component: FloorPlan }, + { path: '/:pathMatch(.*)*', redirect: '/items' }, + ], +}) +createApp(App).use(router).mount('#app') diff --git a/apps/pc/src/plan/FloorPlan.vue b/apps/pc/src/plan/FloorPlan.vue new file mode 100644 index 0000000..8709457 --- /dev/null +++ b/apps/pc/src/plan/FloorPlan.vue @@ -0,0 +1,461 @@ + + + diff --git a/apps/pc/src/plan/PlanCanvas.vue b/apps/pc/src/plan/PlanCanvas.vue new file mode 100644 index 0000000..902c2f6 --- /dev/null +++ b/apps/pc/src/plan/PlanCanvas.vue @@ -0,0 +1,169 @@ + + + diff --git a/apps/pc/src/plan/geometry.ts b/apps/pc/src/plan/geometry.ts new file mode 100644 index 0000000..5ce5240 --- /dev/null +++ b/apps/pc/src/plan/geometry.ts @@ -0,0 +1,92 @@ +export const templates = { + LIVING_ROOM: ['客厅', 4000, 3400, 'room'], + BEDROOM: ['卧室', 3000, 2800, 'room'], + STUDY: ['书房', 3000, 2800, 'room'], + KITCHEN: ['厨房', 2600, 2400, 'room'], + BATHROOM: ['卫生间', 2100, 1900, 'room'], + ROOM: ['房间', 3000, 2800, 'room'], + ENTRY: ['玄关', 2200, 1500, 'area'], + BALCONY: ['阳台', 2200, 1500, 'area'], + AREA: ['开放区域', 2200, 1500, 'area'], + SOFA: ['沙发', 2300, 1400, 'furniture'], + BED: ['床', 1600, 2100, 'furniture'], + DESK: ['书桌', 1400, 620, 'furniture'], + TV_STAND: ['电视柜', 1400, 620, 'furniture'], + WARDROBE: ['衣柜', 1600, 650, 'furniture'], + BOOKCASE: ['书架', 1100, 450, 'furniture'], + SHELF: ['层架', 1100, 450, 'furniture'], + TABLE: ['边几', 600, 600, 'furniture'], + STORAGE_BOX: ['收纳箱', 500, 450, 'furniture'], +} as const + +export type Template = keyof typeof templates +export type Geometry = { + template: Template; xMm: number; yMm: number; widthMm: number; depthMm: number; rotation: number +} +export type Slot = { id: string; name: string; icon: string; geometry: Geometry | null } +export type Snapshot = { version: string; widthMm: number; depthMm: number; locations: Slot[] } +export type Placement = { id: string; name: string; newName?: string; geometry: Geometry } +export type Suggestion = { locationId: string | null; name: string; note: string; geometry: Geometry | null } +export type Bounds = Pick +export type Guides = { x?: number; y?: number } + +export const grid = 100 +export const kind = (template: Template) => templates[template][3] +export const overlap = (a: Geometry, b: Geometry) => a.xMm < b.xMm + b.widthMm && b.xMm < a.xMm + a.widthMm + && a.yMm < b.yMm + b.depthMm && b.yMm < a.yMm + a.depthMm +const limit = (value: number, min: number, max: number) => Math.max(min, Math.min(max, Math.round(value))) + +export function fit(shape: Geometry, board: Bounds): Geometry { + const widthMm = limit(shape.widthMm, 100, board.widthMm) + const depthMm = limit(shape.depthMm, 100, board.depthMm) + return { ...shape, widthMm, depthMm, xMm: limit(shape.xMm, 0, board.widthMm - widthMm), + yMm: limit(shape.yMm, 0, board.depthMm - depthMm) } +} + +export function roomConflict(placements: Placement[]) { + const rooms = placements.filter(({ geometry }) => kind(geometry.template) === 'room') + return rooms.find((room, index) => rooms.slice(0, index).some((other) => overlap(room.geometry, other.geometry))) +} + +export function defaultGeometry(template: Template, board: Bounds, placements: Placement[]) { + const shape = fit({ template, xMm: 0, yMm: 0, widthMm: templates[template][1], + depthMm: templates[template][2], rotation: 0 }, board) + for (let y = 200; y <= board.depthMm - shape.depthMm; y += 200) { + for (let x = 200; x <= board.widthMm - shape.widthMm; x += 200) { + const candidate = { ...shape, xMm: x, yMm: y } + if (placements.every(({ geometry }) => !overlap(candidate, geometry))) return candidate + } + } + return shape +} + +function alignment(start: number, size: number, bound: number, coordinates: number[], resize: boolean, tolerance: number) { + const anchors = resize ? [start + size] : [start, start + size / 2, start + size] + let guide: number | undefined + let adjustment = tolerance + 1 + for (const anchor of anchors) { + for (const line of coordinates) { + if (Math.abs(line - anchor) < Math.abs(adjustment)) { + adjustment = line - anchor + guide = line + } + } + } + if (Math.abs(adjustment) > tolerance) { + return { value: Math.round((resize ? size : start) / grid) * grid } + } + const value = resize ? size + adjustment : start + adjustment + if (value < (resize ? 100 : 0) || value > (resize ? bound - start : bound - size)) return { value } + return { value, guide } +} + +export function snap(shape: Geometry, board: Bounds, others: Geometry[], resize: boolean, tolerance: number) { + const x = alignment(shape.xMm, shape.widthMm, board.widthMm, + [0, board.widthMm, ...others.flatMap((g) => [g.xMm, g.xMm + g.widthMm / 2, g.xMm + g.widthMm])], resize, tolerance) + const y = alignment(shape.yMm, shape.depthMm, board.depthMm, + [0, board.depthMm, ...others.flatMap((g) => [g.yMm, g.yMm + g.depthMm / 2, g.yMm + g.depthMm])], resize, tolerance) + const geometry = fit(resize + ? { ...shape, widthMm: Math.min(x.value, board.widthMm - shape.xMm), depthMm: Math.min(y.value, board.depthMm - shape.yMm) } + : { ...shape, xMm: x.value, yMm: y.value }, board) + return { geometry, guides: { x: x.guide, y: y.guide } } +} diff --git a/apps/pc/src/style.css b/apps/pc/src/style.css new file mode 100644 index 0000000..d35a335 --- /dev/null +++ b/apps/pc/src/style.css @@ -0,0 +1,231 @@ +:root { + font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; + color: #172c36; + background: #f2f5f4; + font-synthesis: none; + --ink: #172c36; + --muted: #52676e; + --line: #dce5e3; + --paper: #fff; + --accent: #17624e; + --accent-soft: #e4f1ea; + --rail: #172d32; +} +* { box-sizing: border-box; } +body { margin: 0; min-width: 340px; } +button, input, select, textarea { font: inherit; color: inherit; } +button, .action { + display: inline-flex; align-items: center; justify-content: center; gap: 7px; + min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; + background: #fff; cursor: pointer; text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 580; +} +button:hover:not(:disabled), .action:hover { background: #f1f7f4; border-color: #a9c2b8; } +button:disabled { opacity: .47; cursor: default; } +button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #238766; outline-offset: 2px; } +.primary { background: var(--accent); color: white; border-color: var(--accent); font-weight: 650; } +.primary:hover:not(:disabled) { background: #104d3c; border-color: #104d3c; } +.quiet { border-color: transparent; background: transparent; } +.icon-button { padding: 0; width: 36px; flex-shrink: 0; } +.danger { color: #a02f39; } +.full { width: 100%; } +.secondary { color: var(--muted); } +.small { font-size: 13px; } +h1, h2, h3, p { margin: 0; } +h1 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 720; letter-spacing: -.035em; } +h2 { font-size: 16px; font-weight: 680; } +h3 { font-size: 14px; } +a { color: var(--accent); } +.notice { padding: 10px 13px; border-radius: 8px; background: #edf4f3; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; } +.notice.error { color: #902c35; background: #fff0ef; } +.notice.success { color: #1b5d42; background: #e7f4e9; } +.notice button { min-height: 26px; border: none; padding: 0 7px; margin-inline-start: 4px; } +.brand { display: flex; align-items: center; gap: 11px; } +.brand img { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: white; padding: 4px; } +.brand strong { font-size: 21px; font-weight: 760; letter-spacing: .1em; } +.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 26px; background: #eaf1ee; } +.sign-in-card { width: min(100%, 420px); padding: 39px; background: white; border: 1px solid #d8e4de; border-radius: 15px; box-shadow: 0 18px 70px #22463814; } +.sign-in-brand img { width: 49px; height: 49px; padding: 0; } +.sign-in-brand strong { font-size: 33px; } +.brand-line { color: var(--muted); margin: 12px 0 26px; font-size: 15px; letter-spacing: .09em; } +.sign-in-card .primary { min-height: 43px; margin-top: 6px; } +.shell { display: grid; grid-template-columns: 174px minmax(0, 1fr); min-height: 100dvh; } +.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 24px; padding: 23px 15px; background: var(--rail); color: #eef5ee; } +.rail .brand { padding-left: 6px; } +.space-control { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0 9px; min-height: 42px; border: 1px solid #456064; border-radius: 7px; } +.space-control svg { color: #b4c9c3; flex-shrink: 0; } +.space-control select { background: transparent; border: 0; appearance: none; min-width: 0; flex: 1; padding: 7px 0; color: white; } +.space-control option { color: var(--ink); } +.rail nav, .rail-footer { display: grid; gap: 5px; } +.rail nav a, .rail-footer button { display: flex; justify-content: start; align-items: center; gap: 10px; min-height: 42px; text-decoration: none; color: #c4d6d0; padding: 0 11px; border-radius: 7px; font-size: 14px; } +.rail nav a:hover, .rail-footer button:hover:not(:disabled) { background: #29464a; color: white; } +.rail nav .router-link-active { background: #31564e; color: #f2fff8; font-weight: 700; } +.rail-footer { margin-top: auto; } +.workspace { min-width: 0; padding: 0 clamp(16px, 2.5vw, 38px) 24px; } +.workspace-notice, .create-space { margin-top: 15px; } +.create-space { display: flex; align-items: end; gap: 9px; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; } +.create-space label { display: grid; gap: 5px; flex: 1; font-size: 13px; } +.page-header { display: flex; justify-content: space-between; align-items: end; gap: 15px; padding: 24px 0 20px; } +.page-header .primary { min-height: 39px; } +.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 6px; } +.header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; } +.save-status { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-right: 6px; } +.save-status i { width: 7px; height: 7px; border-radius: 50%; background: #bd7c2e; } +.panel, .plan-shell { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; min-width: 0; } +.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--muted); text-align: center; } +.workspace-empty { height: 75vh; } +.inventory-grid { display: grid; grid-template-columns: 192px minmax(0, 1fr); gap: 14px; align-items: start; } +.inventory-grid.has-detail { grid-template-columns: 192px minmax(0, 1fr) clamp(238px, 23vw, 320px); } +.location-tree { padding: 12px 8px; max-height: calc(100dvh - 128px); overflow: auto; } +.location-tree h2 { padding: 4px 10px 12px; } +.location-tree .small { padding: 8px 10px; } +.tree-row { display: flex; justify-content: start; width: 100%; min-width: 0; padding: 0 10px; border: 0; background: transparent; text-align: start; } +.tree-row svg { flex-shrink: 0; color: var(--muted); } +.tree-row span { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } +.tree-row.current { background: var(--accent-soft); color: var(--accent); font-weight: 700; } +.tree-divider { border-top: 1px solid var(--line); margin: 9px 5px; } +.tree-link { margin-top: 10px; } +.item-list { min-height: 375px; } +.list-toolbar { display: flex; align-items: center; gap: 11px; padding: 12px; } +.search-field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--muted); background: #f4f7f6; border: 1px solid #dbe5e1; border-radius: 7px; padding: 0 10px; } +.search-field input { border: none; background: transparent; min-width: 0; width: 100%; min-height: 38px; } +.search-field input:focus-visible { outline-offset: -2px; } +.check-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; } +input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; } +.table-wrap { overflow-x: auto; } +table { width: 100%; border-collapse: collapse; font-size: 13px; } +td, th { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eaf0ed; } +td:first-child, th:first-child { padding-left: 14px; } +th { color: var(--muted); font-weight: 550; background: #f5f8f7; white-space: nowrap; } +tr:hover td, tr.active-row td { background: #f1f8f4; } +td:last-child, th:last-child { text-align: right; white-space: nowrap; } +.item-cell, .table-path { background: none; border: 0; padding: 0; text-align: start; justify-content: start; } +.item-cell:hover:not(:disabled), .table-path:hover:not(:disabled) { background: transparent; color: var(--accent); } +.item-cell { gap: 9px; word-break: break-word; font-weight: 650; } +.table-path { color: var(--muted); } +.item-mark, .property-symbol { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 7px; color: #245d4b; background: #e8f3ec; } +.list-status { color: var(--muted); padding: 14px; text-align: center; font-size: 13px; } +.item-list > .notice { margin: 0 12px 10px; } +.item-detail { padding: 13px; } +.detail-header, .detail-hero, .detail-actions { display: flex; gap: 8px; align-items: center; } +.detail-header { justify-content: space-between; } +.detail-hero { margin-top: 12px; overflow-wrap: anywhere; } +.detail-hero .item-mark { width: 42px; height: 42px; } +.detail-hero h3 { font-size: 18px; } +.item-detail dt { font-size: 12px; color: var(--muted); margin-top: 10px; } +.item-detail dd { margin: 3px 0; font-size: 14px; overflow-wrap: anywhere; } +.plain-text { white-space: pre-wrap; } +.detail-actions { flex-wrap: wrap; } +.move-form, .move-history, .item-detail > .notice { margin-top: 12px; } +.move-history h3 { margin-bottom: 7px; } +.move-history p { display: grid; gap: 2px; padding: 5px 0; font-size: 12px; } +.move-history svg { vertical-align: middle; } +.move-history time { color: var(--muted); } +.item-detail > .danger { margin-top: 11px; } +.plan-page > .notice { margin-bottom: 10px; } +.plan-shell { overflow: hidden; } +.plan-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); } +.toolbar-group { display: flex; align-items: center; gap: 7px; color: var(--muted); } +.plan-toolbar select { min-height: 34px; min-width: 120px; max-width: 210px; background: white; } +.plan-edit-tools { padding-left: 12px; border-left: 1px solid var(--line); } +.snap-toggle { padding-left: 4px; } +.ai-button { margin-left: auto; border-color: #d5e4de; color: var(--accent); background: #f1f8f4; } +.plan-columns { display: grid; grid-template-columns: 171px minmax(0, 1fr) 211px; height: max(575px, calc(100dvh - 184px)); } +.plan-columns.readonly { grid-template-columns: minmax(0, 1fr) 211px; } +.plan-library, .plan-properties { overflow: auto; } +.plan-library { border-right: 1px solid var(--line); padding: 13px 10px; } +.plan-properties { border-left: 1px solid var(--line); padding: 13px 11px; } +.pane-title { padding: 2px 5px 12px; } +.pane-title h2 { font-size: 14px; } +.template-group { display: grid; gap: 2px; padding-bottom: 12px; } +.template-group h3 { font-weight: 540; font-size: 11px; color: var(--muted); padding: 7px 6px 4px; } +.library-option { width: 100%; text-align: left; justify-content: start; border: 0; min-height: 32px; padding: 0 6px; gap: 7px; } +.library-option svg { color: #467569; flex-shrink: 0; } +.library-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.library-option .append-icon { margin-left: auto; color: #69887f; } +.canvas-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; } +.canvas-stage { min-height: 0; flex: 1; position: relative; overflow: hidden; display: grid; background: #e6eeea; } +.plan-svg { width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; user-select: none; cursor: grab; } +.dragging .plan-svg { cursor: grabbing; } +.plan-shape { color: #52796f; cursor: pointer; outline: none; } +.plan-outline { fill: #d4e6de66; stroke: #55786f; stroke-width: 1.5; } +.furniture .plan-outline { fill: #d6ebe1; stroke: #438572; } +.area .plan-outline { fill: #e2ede7aa; stroke-dasharray: 5 4; } +.plan-shape:hover .plan-outline, .plan-shape:focus-visible .plan-outline, .plan-shape.focused .plan-outline { stroke: #147755; stroke-width: 2.4; } +.plan-shape.focused .plan-outline { fill: #b1d8c59c; } +.shape-name { fill: #1c423a; font-weight: 680; paint-order: stroke; stroke: #fcfdfa; stroke-width: 19; stroke-linejoin: round; } +.resize-grip { fill: #1c795e; stroke: white; stroke-width: 1.5; cursor: nwse-resize; } +.snap-guide { stroke: #0875ad; stroke-width: 1.2; stroke-dasharray: 5 5; pointer-events: none; } +.canvas-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; font-size: 14px; } +.canvas-zoom { position: absolute; display: flex; gap: 4px; align-items: center; right: 10px; bottom: 10px; border-radius: 8px; padding: 3px; background: white; box-shadow: 0 2px 7px #183a3526; } +.canvas-zoom span { min-width: 40px; text-align: center; font-size: 12px; color: var(--muted); } +.canvas-zoom button { border: 0; min-height: 32px; width: 32px; } +.canvas-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px; min-height: 31px; padding: 4px 10px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); } +.map-target { display: block; padding: 7px 10px; font-size: 12px; color: var(--accent); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; } +.shape-property { display: flex; align-items: center; gap: 7px; padding: 4px; margin-bottom: 12px; } +.shape-property input { min-width: 0; width: 100%; } +.shape-property h3 { overflow-wrap: anywhere; } +.property-fields { margin: 0; border: 0; padding: 0 4px; display: grid; gap: 7px; grid-template-columns: repeat(2,minmax(0,1fr)); } +.property-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; } +.property-fields label span { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; } +.property-fields input { min-width: 0; width: 100%; border: 0; padding: 4px; min-height: 32px; } +.property-fields small { padding-right: 4px; } +.property-actions { display: grid; gap: 6px; padding: 10px 4px 0; } +.property-empty { display: grid; justify-items: center; gap: 8px; padding: 29px 4px; text-align: center; color: var(--muted); font-size: 13px; } +.plan-loading { min-height: 350px; } +.modal { width: min(92vw, 590px); max-height: 89dvh; border: 1px solid #d5e2dd; border-radius: 12px; padding: 19px; color: var(--ink); box-shadow: 0 26px 90px #0b272944; } +.intake-modal { width: min(94vw, 685px); } +.modal::backdrop { background: #12272b85; } +.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 5px; } +.modal-header h2 { font-size: 19px; } +.modal .notice { margin-bottom: 9px; } +.fields { display: grid; gap: 11px; } +.fields > button { justify-self: start; } +.fields label { display: grid; gap: 6px; font-size: 13px; font-weight: 620; min-width: 0; } +.fields input, .fields textarea, .fields select, .create-space input, .shape-property input, .plan-toolbar select { + padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; min-height: 35px; font-weight: 450; +} +textarea { resize: vertical; } +.form-row { display: grid; grid-template-columns: minmax(82px, .32fr) minmax(0, 1fr); gap: 11px; } +.modal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px; } +.segmented { display: flex; align-items: center; gap: 3px; width: fit-content; padding: 3px; border-radius: 8px; background: #edf3ef; } +.segmented button { background: transparent; border-color: transparent; min-height: 32px; } +.segmented button[aria-pressed="true"] { background: white; color: var(--accent); border-color: #d7e5dd; } +.intake-tabs { margin-bottom: 12px; } +.candidate-list { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 0; min-width: 0; } +.candidate-list legend { font-size: 13px; color: var(--muted); padding: 0 5px; } +.candidate { display: grid; grid-template-columns: 18px minmax(75px, 1fr) 68px minmax(85px, 1fr); gap: 6px; align-items: center; margin: 4px; } +.candidate input, .candidate select { min-width: 0; } +.suggestion-list { margin: 0; padding: 0; list-style: none; } +.proposal-canvas { height: 245px; display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; } +.suggestion-list label { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 8px; } +.suggestion-list input { min-height: 0; } +.suggestion-list small { display: block; color: var(--muted); font-weight: 460; margin-top: 2px; } +@media (max-width: 1080px) { + .shell { grid-template-columns: 135px minmax(0, 1fr); } + .rail { padding: 16px 9px; } + .inventory-grid, .inventory-grid.has-detail { grid-template-columns: 151px minmax(0, 1fr); } + .item-detail { grid-column: 2; } + .plan-columns { grid-template-columns: 125px minmax(0, 1fr) 170px; } + .plan-columns.readonly { grid-template-columns: minmax(0, 1fr) 170px; } +} +@media (max-width: 760px) { + .shell { display: block; } + .rail { position: static; height: auto; flex-direction: row; align-items: center; gap: 7px; padding: 8px; flex-wrap: wrap; } + .rail .brand { padding: 0; } + .rail .brand strong { font-size: 16px; } + .rail .brand img { width: 26px; height: 26px; } + .rail nav, .rail-footer { display: flex; margin: 0; } + .rail nav a, .rail-footer button { padding: 0 7px; min-height: 35px; font-size: 12px; } + .rail-footer button svg { display: none; } + .space-control { max-width: 145px; min-height: 34px; } + .workspace { padding-inline: 10px; } + .page-header { align-items: start; padding-top: 15px; } + .inventory-grid, .inventory-grid.has-detail { grid-template-columns: 1fr; gap: 8px; } + .location-tree { max-height: 145px; } + .item-detail { grid-column: 1; } + .plan-columns, .plan-columns.readonly { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; } + .canvas-column { grid-row: 1; height: 45vh; min-height: 285px; } + .plan-library, .plan-properties { max-height: 190px; border: 0; border-top: 1px solid var(--line); } + .template-group { display: flex; flex-wrap: wrap; align-items: center; } + .library-option { width: auto; } +} diff --git a/apps/pc/src/types.ts b/apps/pc/src/types.ts new file mode 100644 index 0000000..06a0e1d --- /dev/null +++ b/apps/pc/src/types.ts @@ -0,0 +1,18 @@ +export type Space = { id: string; name: string; role: 'OWNER' | 'EDITOR' | 'VIEWER' } +export type Place = { id: string; parentId: string | null; name: string; path: string; depth: number; sortRank: number | null } +export type Item = { + id: string; name: string; quantity: number; notes: string; locationId: string | null; + locationPath: string; version: number; aliases: string[]; coverPhotoId: string | null; priceCents: number | null +} +export type ItemDetail = { + item: Item + moves: { fromPath: string; toPath: string; movedAt: string }[] + relations: { itemId: string; name: string; locationPath: string; kind: string }[] + preference: { favorite: boolean; rating: number | null; note: string } +} +export type Draft = { + id: string; version: number; status: string + candidates: { name: string; quantity: number | null; action: 'RECORD' | 'SKIP' | 'REVIEW'; location: string | null }[] +} +export type Operation = { id: string; status: string } +export const family = (space: string) => '/api/households/' + space diff --git a/apps/pc/tsconfig.json b/apps/pc/tsconfig.json new file mode 100644 index 0000000..aa8de62 --- /dev/null +++ b/apps/pc/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "noEmit": true, + "skipLibCheck": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "types": ["vite/client"] + }, + "include": ["src/**/*.ts", "src/**/*.vue"] +} diff --git a/apps/pc/vite.config.mjs b/apps/pc/vite.config.mjs new file mode 100644 index 0000000..3b7dc2e --- /dev/null +++ b/apps/pc/vite.config.mjs @@ -0,0 +1,16 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +export default defineConfig({ + plugins: [vue()], + server: { + host: '127.0.0.1', + proxy: { + '/api': { + target: process.env.ATLAS_GATEWAY_URL || 'https://api-atlas.tutudog.com', + changeOrigin: true, + proxyTimeout: 80000, + }, + }, + }, +}) diff --git a/docs/architecture/clients.md b/docs/architecture/clients.md index 67f89a0..49208ba 100644 --- a/docs/architecture/clients.md +++ b/docs/architecture/clients.md @@ -5,7 +5,7 @@ | 端 | 技术选型 | 使用与交付 | | --- | --- | --- | | H5 | uni-app(Vue 3、TypeScript、Vite),使用 DCloud 的 CLI 模板 | 面向临时找物、相机上传和快速录入。首版构建 H5 静态文件,由 Nginx 镜像托管。 | -| PC 网页 | Vue 3、TypeScript、Vite、Vue Router | 面向批量草稿、详情查看和浏览位置树。独立 Nginx 镜像。 | +| PC 网页 | Vue 3、TypeScript、Vite、Vue Router | [桌面工作台](../../apps/pc/README.md)支持搜索、物品录入、移位和两级平面图。独立 Nginx 镜像。 | | 管理后台 | Vue 3、TypeScript、Vite、Element Plus | 已有空间查询、删除及图片清理入口。独立 Nginx 镜像。其他管理模块有多页路由需求时接入 Vue Router。 | | iOS | Swift、SwiftUI,最低 iOS 17 | [iOS 应用](../../apps/ios/README.md)接入账号、空间、物品、草稿和相册上传。拍照和录音按后续原生端验收范围补齐。 | | Android | Kotlin、Jetpack Compose | Gradle 工程。相机、录音走 Android 平台能力,使用同一 HTTPS API。 | diff --git a/docs/testing/cases.md b/docs/testing/cases.md index a378458..7658fcd 100644 --- a/docs/testing/cases.md +++ b/docs/testing/cases.md @@ -62,5 +62,6 @@ R01–R10 对应[需求与验收](../product/requirements.md)。实现和当前 | TC-51 从物品查看平面图 | R04、R11 | 把一件物品放进「主卧 / 衣柜 / 抽屉」。从找物进详情,点「在平面图中查看」。依次取消衣柜和主卧在图上的摆放,下拉刷新。再用只读成员查看,并检查无位置的物品。 | 优先标出室内图的衣柜,回退时标出空间图的主卧,两处都未摆放时显示提示。完整存放路径始终可见。只读成员能查看,无位置的物品没有平面图入口。 | | TC-52 从平面图选存放位置 | R03、R06、R11 | 在手动添加、智能草稿或移位中打开位置选择,点「从平面图选择」。点房间,进入室内位置,再从家具进入抽屉。另选一次没有摆在图上的位置,并取消一次选择。 | 标记和底部路径随点选更新。可直接选房间或家具,也可进入抽屉。未摆放位置可从列表选。选中只回填表单,取消保留原位置。 | | TC-53 浏览下级位置的物品 | R04、R11 | 在主卧和主卧抽屉各放一件物品,另在其他房间和无位置各放一件。在主卧详情来回切换物品范围。用只读成员重试,移动或归档抽屉里的物品后刷新。 | 「仅此位置」只显示直接存放的物品。「含下级位置」也显示抽屉里的物品和完整路径,两种范围的分页和缓存独立。其他房间、无位置和归档物品不混入。 | +| TC-54 PC 建模和找物联动 | R03、R04、R11、R12 | 在桌面浏览器添加房间,拖动后撤回和重做,改右侧宽深并保存。在室内图添加书桌,再从书桌进入录入,按别名找物并回到平面图定位。另试放弃修改、AI 预览和保存版本冲突。 | 全屋与室内使用各自的布局。操作可撤销,确认保存后重读一致。录入沿用书桌位置,人工保存前 AI 草稿不落库,版本冲突仍保留本地修改。 | [测试与演示计划](plan.md) diff --git a/docs/ui/README.md b/docs/ui/README.md index a732a90..b036b8e 100644 --- a/docs/ui/README.md +++ b/docs/ui/README.md @@ -19,7 +19,7 @@ | 走查 | 要看的页面和状态 | | --- | --- | | H5 | 找物、详情、移位、位置树、手工与批量录入。补齐空结果、权限不足、模型不可用、确认中、失败重试。 | -| PC | 列表和详情、位置树导航、批量草稿表格。补键盘导航、窄窗口和长位置路径。 | +| PC | [桌面工作台](pc-workbench.md)包含位置树、物品详情、文字批量录入和两级平面图。 | | 管理后台 | 用户和家庭、模型状态、额度及异常操作。明确筛选、记录详情和角色权限。 | | iOS、Android | 从同一套术语和任务出发,单独画原生导航、相机、录音权限与返回后的状态。 | diff --git a/docs/ui/pc-workbench.md b/docs/ui/pc-workbench.md new file mode 100644 index 0000000..75d1efd --- /dev/null +++ b/docs/ui/pc-workbench.md @@ -0,0 +1,20 @@ +# PC 端桌面工作台 + +## 物品 + +左侧位置树负责缩小范围,中间列表显示名称、位置和数量。选中物品后在右侧查看和移位。位置有下级时可以展开全部后代范围,同名位置通过完整路径区分。录入优先支持手填,也可把一段文字交给现有模型服务,再逐条核对、修改位置并确认。 + +浏览器可以通过 HTTPS 和麦克风权限录音。录音数据与文字转写是两个步骤。不同浏览器的实时转写能力和处理地点不同,首版使用表单和文本草稿。后续接入录音时,可以用统一转写服务,再把文字交给现有草稿接口。 [W3C 媒体捕获](https://www.w3.org/TR/mediacapture-streams/) · [W3C 录音接口](https://www.w3.org/TR/mediastream-recording/) + +## 平面图 + +左侧是可添加的模板和已有位置,中间画布占主要面积,右侧修改坐标、宽度和进深。总图与室内图共用现有一级和二级布局;三级以下仍由位置树管理。房间和家具使用不同描边,同名物件选中后仍可由位置路径找到。 + +- 滚轮按指针位置缩放,拖空白平移,右下角可恢复适合画布的视图。 +- 拖动物件或拉右下角调整大小。默认吸附到 10 厘米网格、墙边及相邻物件边线和中心线。按住 Alt 可临时关闭吸附。方向键微调 1 厘米,Shift 加方向键微调 10 厘米。 +- Ctrl / ⌘ + Z 撤回,附加 Shift 重做。移出平面图只改摆放图,不删除位置。放弃整次修改会恢复已保存版本。 +- AI 建模按已保存的平面图生成建议。勾选后应用到当前草稿,保存才写入数据库。保存发生版本冲突时保留编辑状态。 + +## 后续 + +批量录入继续补交付重试与恢复,之后接相册和裁剪、成员管理与社区。浏览器录音和统一转写单独验收权限、设备和取消操作。