diff --git a/.github/workflows/web-quality.yml b/.github/workflows/web-quality.yml new file mode 100644 index 0000000..51113f3 --- /dev/null +++ b/.github/workflows/web-quality.yml @@ -0,0 +1,30 @@ +name: Web Quality + +on: + pull_request: + push: + branches: + - main + - master + - "codex/**" + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "24" + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Verify + run: npm run verify diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..52eac84 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,10 @@ +dist +node_modules +coverage +tmp +.codex-tmp +.codex-logs +screenshots +*.log +*.tmp +package-lock.json diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..5bfc577 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,77 @@ +import js from "@eslint/js"; +import reactHooks from "eslint-plugin-react-hooks"; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + { + ignores: [ + "dist/**", + "node_modules/**", + "coverage/**", + "tmp/**", + ".codex-tmp/**", + ".codex-logs/**", + "screenshots/**", + "*.log", + "*.tmp", + "vite-*.log", + ], + }, + js.configs.recommended, + ...tseslint.configs.recommended, + { + files: [ + "src/**/*.{ts,tsx}", + "scripts/**/*.mjs", + "vite.config.ts", + "eslint.config.js", + ], + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + globals: { + AbortController: "readonly", + AbortSignal: "readonly", + Blob: "readonly", + clearInterval: "readonly", + clearTimeout: "readonly", + console: "readonly", + crypto: "readonly", + document: "readonly", + File: "readonly", + fetch: "readonly", + FormData: "readonly", + Headers: "readonly", + HTMLTextAreaElement: "readonly", + localStorage: "readonly", + navigator: "readonly", + process: "readonly", + React: "readonly", + RequestInit: "readonly", + Response: "readonly", + setInterval: "readonly", + setTimeout: "readonly", + URL: "readonly", + URLSearchParams: "readonly", + window: "readonly", + }, + }, + plugins: { + "react-hooks": reactHooks, + }, + rules: { + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "warn", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-unused-vars": [ + "warn", + { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, + ], + "@typescript-eslint/no-unused-expressions": "warn", + "no-empty": ["error", { allowEmptyCatch: true }], + "no-undef": "off", + "no-useless-escape": "warn", + "prefer-const": "warn", + }, + }, +); diff --git a/package-lock.json b/package-lock.json index 90c5b9b..e1b08fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,13 +15,18 @@ "zustand": "5.0.13" }, "devDependencies": { + "@eslint/js": "^10.0.1", "@types/react": "18.2.0", "@types/react-dom": "18.2.0", "@vitejs/plugin-react": "4.2.1", + "eslint": "^10.4.1", + "eslint-plugin-react-hooks": "^7.1.1", "playwright": "1.60.0", + "prettier": "^3.8.3", "sharp": "0.34.5", "typescript": "5.3.3", - "vite": "5.1.0", + "typescript-eslint": "^8.60.1", + "vite": "5.4.21", "vite-plugin-compression2": "2.5.3" } }, @@ -103,6 +108,7 @@ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -375,9 +381,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": [ "ppc64" ], @@ -392,9 +398,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], @@ -409,9 +415,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], @@ -426,9 +432,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], @@ -443,9 +449,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], @@ -460,9 +466,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], @@ -477,9 +483,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], @@ -494,9 +500,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], @@ -511,9 +517,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], @@ -528,9 +534,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], @@ -545,9 +551,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], @@ -562,9 +568,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], @@ -579,9 +585,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], @@ -596,9 +602,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], @@ -613,9 +619,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], @@ -630,9 +636,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], @@ -647,9 +653,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], @@ -664,9 +670,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], @@ -681,9 +687,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], @@ -698,9 +704,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], @@ -715,9 +721,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], @@ -732,9 +738,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], @@ -749,9 +755,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], @@ -765,6 +771,200 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz", + "integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", + "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@img/colour": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", @@ -1772,6 +1972,13 @@ "@types/d3-selection": "*" } }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.8.tgz", @@ -1779,6 +1986,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/prop-types": { "version": "15.7.15", "resolved": "https://registry.npmmirror.com/@types/prop-types/-/prop-types-15.7.15.tgz", @@ -1792,6 +2006,7 @@ "integrity": "sha512-0FLj93y5USLHdnhIhABk83rm8XEGA7kH3cr+YUlvxoUGp1xNt/DINUMvqPxLyOQMzLmZe8i4RTHbvb8MC7NmrA==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -1815,6 +2030,250 @@ "devOptional": true, "license": "MIT" }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.60.1.tgz", + "integrity": "sha512-JQ4S5GB0tfjO8BuJ4fcX+HodkzJjYBV+7OJ+wLygaX7OGQ7FudyHL4NSCA6ob+w3Yn+5MkKIozOwQhXeM7opVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.60.1", + "@typescript-eslint/type-utils": "8.60.1", + "@typescript-eslint/utils": "8.60.1", + "@typescript-eslint/visitor-keys": "8.60.1", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.60.1", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.60.1.tgz", + "integrity": "sha512-A0M6ua6H252bVjPvvtSgl2QA4+ET9S5Mtkb2GDyTxIhH/C4qDItT7RQNO5PhMC6NXGYXOR9dIalcDDgBKT7oFA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.60.1", + "@typescript-eslint/types": "8.60.1", + "@typescript-eslint/typescript-estree": "8.60.1", + "@typescript-eslint/visitor-keys": "8.60.1", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.60.1.tgz", + "integrity": "sha512-eXkTH2bxmXlqD1RnOPmLZ9ZM9D3VwSx04JOwBnP9RQ+yUA5a2Mu7SfW8uaV2Aon53NJzZlZYuX7tn91Izf+xaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.60.1", + "@typescript-eslint/types": "^8.60.1", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.60.1.tgz", + "integrity": "sha512-gvI5OQoptnxQnchOirukCuQ55svJSTuD/4k5+pC267xyBtYry748R9/c3tYUzb/iE6RZfllRz2lVulLCHkTm4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.60.1", + "@typescript-eslint/visitor-keys": "8.60.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.60.1.tgz", + "integrity": "sha512-nh8w4qAteiKuZu3pSSzG/yGKpw0OlkrKnzFmbVRenKaD4qc+7i1GrmZaLVkr8rk4uipiPGMOW4YsM6WmKZ5CvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.60.1.tgz", + "integrity": "sha512-sdwTrpjosW7ANQYJ39ZBF1ZyEMEGVB2UsikrserVM/30a/F1dTLnu9bGxEdosugyu5caigjLrR2qiD11asjI1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.60.1", + "@typescript-eslint/typescript-estree": "8.60.1", + "@typescript-eslint/utils": "8.60.1", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.60.1.tgz", + "integrity": "sha512-4h0tY8ppCkdCzcrl2YM5M3my0xsE1Tf8om3owEu5oPWmXwkKRmk0j0LGDzYBGUcAlesEbxBhazqu/K4cu3Ug7w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.60.1.tgz", + "integrity": "sha512-alpRkfG8hlVE5kdJW2GkfgDgXxold3e8e4l6EnmhRmRLbekgAPCCGDVD++sABy9FcgPFroq+uFcCSM1vR57Cew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.60.1", + "@typescript-eslint/tsconfig-utils": "8.60.1", + "@typescript-eslint/types": "8.60.1", + "@typescript-eslint/visitor-keys": "8.60.1", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.3.tgz", + "integrity": "sha512-wnilbGyMxzbY7dNOl7jpKbLSjcfeweJWU5j4+u5qW+6/wuGD9KzIGOyZnQVSBM9E7DtWaaH3CyHkppYrKYoxwg==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.60.1.tgz", + "integrity": "sha512-h2MPBLoNtjc3qZWfY3Tl51yPorQ2McHn8pJfcMNTcIvrrZrr90Ykffit0yjrPFWQcRcUxzH20+6OcVdW4yHtUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.60.1", + "@typescript-eslint/types": "8.60.1", + "@typescript-eslint/typescript-estree": "8.60.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.60.1.tgz", + "integrity": "sha512-EbGRQg4FhrmwLodl+t3JNAnXHWVr9Vp+Zl1QBZVPY4ByfkzIT8cX3K6QWODHtkIZqqJVEWvhHSx3v5PDHsaQag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.60.1", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@vitejs/plugin-react": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.1.tgz", @@ -1895,6 +2354,57 @@ "d3-zoom": "^3.0.0" } }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, "node_modules/baseline-browser-mapping": { "version": "2.10.29", "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.29.tgz", @@ -1908,6 +2418,19 @@ "node": ">=6.0.0" } }, + "node_modules/brace-expansion": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, "node_modules/browserslist": { "version": "4.28.2", "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.28.2.tgz", @@ -1928,6 +2451,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.10.12", "caniuse-lite": "^1.0.30001782", @@ -1982,6 +2506,21 @@ "dev": true, "license": "MIT" }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", @@ -2046,6 +2585,7 @@ "resolved": "https://registry.npmmirror.com/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -2112,6 +2652,13 @@ } } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -2130,9 +2677,9 @@ "license": "ISC" }, "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2143,29 +2690,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/escalade": { @@ -2178,6 +2725,182 @@ "node": ">=6" } }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.4.1.tgz", + "integrity": "sha512-AyIKhnOBuOAdueD7RB3xB+YeAWScb9jHsJBgH2Hcde8InP5JYhqrRR6iTMHyTEwgENK54Cp44e4v8BwNhsuHuw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.6.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.2", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.1.1.tgz", + "integrity": "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -2185,6 +2908,106 @@ "dev": true, "license": "MIT" }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "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/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", @@ -2210,6 +3033,86 @@ "node": ">=6.9.0" } }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", @@ -2229,6 +3132,27 @@ "node": ">=6" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", @@ -2242,6 +3166,46 @@ "node": ">=6" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmmirror.com/loose-envify/-/loose-envify-1.4.0.tgz", @@ -2264,6 +3228,22 @@ "yallist": "^3.0.2" } }, + "node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", @@ -2290,6 +3270,13 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, "node_modules/node-releases": { "version": "2.0.44", "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.44.tgz", @@ -2297,6 +3284,76 @@ "dev": true, "license": "MIT" }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", @@ -2310,6 +3367,7 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -2393,6 +3451,42 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", + "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/rc-util": { "version": "5.44.4", "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.44.4.tgz", @@ -2412,6 +3506,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -2424,6 +3519,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.0" @@ -2570,6 +3666,29 @@ "node": ">=10" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", @@ -2587,6 +3706,36 @@ "dev": true, "license": "MIT" }, + "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/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -2595,12 +3744,26 @@ "license": "0BSD", "optional": true }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/typescript": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -2609,6 +3772,30 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.60.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.60.1.tgz", + "integrity": "sha512-6m5hkkRAp8lKvhVpcprAIn5KkehQEh+47oHH2VGnExEh7dhNxXlg6GPAOIu6TxbVQxhebrJDvjl3020ooiWCMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.60.1", + "@typescript-eslint/parser": "8.60.1", + "@typescript-eslint/typescript-estree": "8.60.1", + "@typescript-eslint/utils": "8.60.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, "node_modules/update-browserslist-db": { "version": "1.2.3", "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", @@ -2640,6 +3827,16 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/use-sync-external-store": { "version": "1.6.0", "resolved": "https://registry.npmmirror.com/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", @@ -2650,15 +3847,16 @@ } }, "node_modules/vite": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.0.tgz", - "integrity": "sha512-STmSFzhY4ljuhz14bg9LkMTk3d98IO6DIArnTY6MeBwiD1Za2StcQtz7fzOUnRCqrHSD5+OS2reg4HOz1eoLnw==", + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -2677,6 +3875,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -2694,6 +3893,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, @@ -2716,6 +3918,32 @@ "tar-mini": "^0.2.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz", @@ -2723,6 +3951,43 @@ "dev": true, "license": "ISC" }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + }, "node_modules/zustand": { "version": "5.0.13", "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.13.tgz", diff --git a/package.json b/package.json index 9cdec5e..ec9de60 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,11 @@ "dev": "vite --host 127.0.0.1", "build": "vite build", "preview": "vite preview --host 127.0.0.1", + "test": "node scripts/run-unit-tests.mjs", "type-check": "tsc -p tsconfig.json --noEmit", + "lint": "eslint .", + "format:check": "prettier --check .github/workflows/web-quality.yml eslint.config.js scripts/run-unit-tests.mjs src/test src/api/generationConcurrency.test.ts src/utils/enterpriseVideoPolicy.test.ts src/utils/taskLifecycle.test.ts", + "verify": "npm run test && npm run type-check && npm run lint && npm run format:check && npm run governance:check && npm run style:check && npm run build", "governance:check": "node scripts/check-governance.mjs", "style:check": "node scripts/check-style-governance.mjs", "smoke:generation:mocked": "node scripts/smoke-generation-mocked.mjs" @@ -20,13 +24,18 @@ "zustand": "5.0.13" }, "devDependencies": { + "@eslint/js": "^10.0.1", "@types/react": "18.2.0", "@types/react-dom": "18.2.0", "@vitejs/plugin-react": "4.2.1", + "eslint": "^10.4.1", + "eslint-plugin-react-hooks": "^7.1.1", "playwright": "1.60.0", + "prettier": "^3.8.3", "sharp": "0.34.5", "typescript": "5.3.3", - "vite": "5.1.0", + "typescript-eslint": "^8.60.1", + "vite": "5.4.21", "vite-plugin-compression2": "2.5.3" } } diff --git a/scripts/dynamic-analysis-v2.mjs b/scripts/dynamic-analysis-v2.mjs index 5d43054..92a5216 100644 --- a/scripts/dynamic-analysis-v2.mjs +++ b/scripts/dynamic-analysis-v2.mjs @@ -27,7 +27,6 @@ console.log(' 1. MODULE DEPENDENCY GRAPH ANALYSIS'); console.log('═══════════════════════════════════════════════'); const importMap = new Map(); // file -> [imports] -const importedBy = new Map(); // file -> [importers] for (const r of results) { const imports = []; @@ -71,10 +70,13 @@ function findCircular(file, visited = new Set(), path = []) { } } } +for (const file of importMap.keys()) { + findCircular(file); +} // Check high-fanin files (imported by many) const fanIn = new Map(); -for (const [file, imports] of importMap) { +for (const imports of importMap.values()) { for (const imp of imports) { const key = imp.replace(/\[dynamic\]/, ''); fanIn.set(key, (fanIn.get(key) || 0) + 1); @@ -101,7 +103,7 @@ for (const [file, count] of sortedFanOut) { // Dynamic imports analysis (lazy loading effectiveness) console.log('\n--- Lazy Loading (Dynamic Imports) ---'); let dynamicImports = 0, staticImports = 0; -for (const [file, imports] of importMap) { +for (const imports of importMap.values()) { for (const imp of imports) { if (imp.startsWith('[dynamic]')) dynamicImports++; else staticImports++; @@ -177,6 +179,9 @@ for (const r of results) { if (noDeps > 0) { console.log(` [RENDER-COST] ${r.file}: ${noDeps} useEffect(s) run EVERY render`); } + if (emptyDeps > 0) { + console.log(` [MOUNT-EFFECT] ${r.file}: ${emptyDeps} useEffect(s) run on mount only`); + } } // ─── 4. Zustand Store Analysis ─── diff --git a/scripts/dynamic-analysis.mjs b/scripts/dynamic-analysis.mjs index ae8106e..7a9e873 100644 --- a/scripts/dynamic-analysis.mjs +++ b/scripts/dynamic-analysis.mjs @@ -3,7 +3,7 @@ * Measures: page load, bundle sizes, memory, rendering, network. */ import { chromium } from 'playwright'; -import { readFileSync, readdirSync, statSync } from 'fs'; +import { readdirSync, statSync } from 'fs'; import { join } from 'path'; const DIST = join(import.meta.dirname, '..', 'dist'); @@ -187,7 +187,7 @@ async function runtimeAnalysis() { const allElements = document.querySelectorAll('*'); const tagCounts = {}; let maxDepth = 0; - let totalNodes = allElements.length; + const totalNodes = allElements.length; allElements.forEach(el => { const tag = el.tagName.toLowerCase(); @@ -297,7 +297,7 @@ console.log('╔═════════════════════ console.log('║ OmniAI Web Preview - Performance Analysis ║'); console.log('╚═══════════════════════════════════════════════╝'); -const bundleResult = analyzeBundles(); +analyzeBundles(); await runtimeAnalysis(); console.log('\n═══════════════════════════════════════════════'); diff --git a/scripts/run-unit-tests.mjs b/scripts/run-unit-tests.mjs new file mode 100644 index 0000000..978c2c4 --- /dev/null +++ b/scripts/run-unit-tests.mjs @@ -0,0 +1,55 @@ +import fs from "node:fs"; +import path from "node:path"; +import process from "node:process"; +import { createServer } from "vite"; + +const repoRoot = process.cwd(); + +function normalizePath(value) { + return value.replace(/\\/g, "/"); +} + +function findTestFiles(dir) { + const result = []; + if (!fs.existsSync(dir)) return result; + for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { + if (entry.name === "node_modules" || entry.name === "dist") continue; + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + result.push(...findTestFiles(fullPath)); + continue; + } + if (/\.test\.tsx?$/.test(entry.name)) result.push(fullPath); + } + return result.sort(); +} + +const server = await createServer({ + configFile: path.join(repoRoot, "vite.config.ts"), + appType: "custom", + logLevel: "silent", + server: { middlewareMode: true }, +}); + +try { + const harness = await server.ssrLoadModule("/src/test/testHarness"); + const testFiles = findTestFiles(path.join(repoRoot, "src")); + + if (testFiles.length === 0) { + console.error("No test files found."); + process.exitCode = 1; + } else { + console.log(`Running ${testFiles.length} test files`); + + for (const file of testFiles) { + const modulePath = `/${normalizePath(path.relative(repoRoot, file))}`; + await server.ssrLoadModule(modulePath); + } + + const result = await harness.runRegisteredTests(); + console.log(`Unit test result: ${result.passed}/${result.total} passed`); + if (result.failed > 0) process.exitCode = 1; + } +} finally { + await server.close(); +} diff --git a/scripts/static-analysis.mjs b/scripts/static-analysis.mjs index afa32f9..220c574 100644 --- a/scripts/static-analysis.mjs +++ b/scripts/static-analysis.mjs @@ -1,4 +1,4 @@ -import { readdirSync, readFileSync, statSync } from 'fs'; +import { readdirSync, readFileSync } from 'fs'; import { join, relative } from 'path'; const SRC = join(import.meta.dirname, '..', 'src'); @@ -114,7 +114,6 @@ for (const r of results) { console.log('\n=== HIGH COMPLEXITY: Deep nesting ==='); for (const r of results) { const lines = r.content.split('\n'); - let maxIndent = 0; for (let i = 0; i < lines.length; i++) { const line = lines[i]; if (line.trim() === '') continue; diff --git a/src/App.tsx b/src/App.tsx index 8b62cc9..e107f40 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -295,7 +295,6 @@ function App() { openDeleteProject: openDeleteProjectModal, closeDeleteProject: closeDeleteProjectModal, setDeleteProjectSubmitting, - clearProjectState, } = useProjectStore(useShallow((s) => ({ projects: s.projects, projectsLoaded: s.projectsLoaded, @@ -310,7 +309,6 @@ function App() { openDeleteProject: s.openDeleteProject, closeDeleteProject: s.closeDeleteProject, setDeleteProjectSubmitting: s.setDeleteProjectSubmitting, - clearProjectState: s.clearProjectState, }))); // Task store @@ -349,7 +347,6 @@ function App() { setBackendHealth, markNotificationRead, markAllNotificationsRead, - clearAppState, } = useAppStore(useShallow((s) => ({ usage: s.usage, runtimeNotifications: s.runtimeNotifications, @@ -370,7 +367,6 @@ function App() { setBackendHealth: s.setBackendHealth, markNotificationRead: s.markNotificationRead, markAllNotificationsRead: s.markAllNotificationsRead, - clearAppState: s.clearAppState, }))); const [ecommerceEverMounted, setEcommerceEverMounted] = useState(false); @@ -1104,28 +1100,6 @@ function App() { [handleSetView, setImageWorkbenchTool], ); - const renderAdminOnlyPage = useCallback( - (content: React.ReactNode) => { - if (isAdminAccount(session)) return content; - - return ( -
- -
-
- 功能内测中 -

暂未开放

-

敬请期待,该功能还在开发中。

-
-
-
- ); - }, - [session], - ); - const PUBLIC_VIEWS = PUBLIC_VIEW_SET; useEffect(() => { diff --git a/src/api/adVideoPlanClient.ts b/src/api/adVideoPlanClient.ts index f767d95..b0e7706 100644 --- a/src/api/adVideoPlanClient.ts +++ b/src/api/adVideoPlanClient.ts @@ -3,6 +3,19 @@ import { buildApiUrl, buildAuthHeaders } from "./serverConnection"; const TEXT_MODELS = ["qwen-max", "qwen-plus", "qwen-turbo"]; const VISION_MODELS = ["qwen3.7-plus", "qwen-vl-plus", "qwen-vl-max"]; +function combineAbortSignals(signal: AbortSignal | undefined, timeoutSignal: AbortSignal): AbortSignal { + if (!signal) return timeoutSignal; + const controller = new AbortController(); + const abort = () => controller.abort(); + if (signal.aborted || timeoutSignal.aborted) { + abort(); + return controller.signal; + } + signal.addEventListener("abort", abort, { once: true }); + timeoutSignal.addEventListener("abort", abort, { once: true }); + return controller.signal; +} + export interface AdVideoUserConfig { platform: string; aspectRatio: string; @@ -162,9 +175,7 @@ async function chat( { role: "user", content: userContent }, ]; const timeoutSignal = AbortSignal.timeout(CHAT_TIMEOUT_MS); - const combinedSignal = options?.signal - ? AbortSignal.any([options.signal, timeoutSignal]) - : timeoutSignal; + const combinedSignal = combineAbortSignals(options?.signal, timeoutSignal); const res = await fetch(buildApiUrl("ai/chat"), { method: "POST", headers: buildAuthHeaders(), @@ -210,9 +221,7 @@ async function visionChat( let lastError: Error | null = null; for (const model of VISION_MODELS) { const timeoutSignal = AbortSignal.timeout(CHAT_TIMEOUT_MS); - const combinedSignal = signal - ? AbortSignal.any([signal, timeoutSignal]) - : timeoutSignal; + const combinedSignal = combineAbortSignals(signal, timeoutSignal); try { const out = await retryOnTransient(async () => { const res = await fetch(buildApiUrl("ai/chat"), { diff --git a/src/api/aiGenerationClient.ts b/src/api/aiGenerationClient.ts index 5e78c26..6fdfe29 100644 --- a/src/api/aiGenerationClient.ts +++ b/src/api/aiGenerationClient.ts @@ -4,6 +4,7 @@ import { isRecord, readJsonResponse, serverRequest, + isServerRequestError, throwResponseError, } from "./serverConnection"; import { isOptionalApiRouteMissing } from "./apiErrorUtils"; @@ -247,6 +248,46 @@ let taskHistoryRouteMissing = false; const TASK_SUBMIT_TIMEOUT_MS = 90_000; const TASK_STATUS_TIMEOUT_MS = 20_000; const NON_RETRYING_REQUEST = { maxRetries: 0 }; +const PENDING_CANCEL_TASKS_KEY = "omniai:pending-task-cancellations"; + +function readPendingCancelTaskIds(): string[] { + if (typeof window === "undefined") return []; + try { + const raw = window.localStorage.getItem(PENDING_CANCEL_TASKS_KEY); + const parsed = raw ? JSON.parse(raw) : []; + return Array.isArray(parsed) ? parsed.filter((id): id is string => typeof id === "string" && id.trim().length > 0) : []; + } catch { + return []; + } +} + +function writePendingCancelTaskIds(taskIds: string[]): void { + if (typeof window === "undefined") return; + try { + const uniqueIds = Array.from(new Set(taskIds.filter(Boolean))); + if (uniqueIds.length) { + window.localStorage.setItem(PENDING_CANCEL_TASKS_KEY, JSON.stringify(uniqueIds)); + } else { + window.localStorage.removeItem(PENDING_CANCEL_TASKS_KEY); + } + } catch { + // Pending cancellation recovery is best-effort. + } +} + +function markTaskCancelPending(taskId: string): void { + writePendingCancelTaskIds([...readPendingCancelTaskIds(), taskId]); +} + +function clearPendingTaskCancel(taskId: string): void { + writePendingCancelTaskIds(readPendingCancelTaskIds().filter((id) => id !== taskId)); +} + +function shouldRetryTaskCancel(error: unknown): boolean { + if (!isServerRequestError(error)) return true; + const status = error.status; + return status === 429 || status === undefined || status >= 500; +} export const aiGenerationClient = { async createImageTask(input: ImageGenInput): Promise { @@ -335,18 +376,48 @@ export const aiGenerationClient = { }, async cancelTask(taskId: string): Promise { + markTaskCancelPending(taskId); try { await serverRequest(`ai/tasks/${taskId}/cancel`, { method: "PATCH", maxRetries: NON_RETRYING_REQUEST.maxRetries, fallbackMessage: "Task cancel failed", }); + clearPendingTaskCancel(taskId); } catch (error) { - if (isOptionalApiRouteMissing(error)) return; + if (isOptionalApiRouteMissing(error) || !shouldRetryTaskCancel(error)) { + clearPendingTaskCancel(taskId); + return; + } throw error; } }, + cancelTaskOnUnload(taskId: string): void { + markTaskCancelPending(taskId); + const url = buildApiUrl(`ai/tasks/${encodeURIComponent(taskId)}/cancel`); + const headers = buildAuthHeaders(); + const body = JSON.stringify({ reason: "page_unload" }); + + try { + void fetch(url, { + method: "PATCH", + headers, + body, + credentials: "include", + keepalive: true, + }); + } catch { + // Page unload cancellation is best-effort. + } + }, + + flushPendingTaskCancellations(): void { + readPendingCancelTaskIds().forEach((taskId) => { + this.cancelTask(taskId).catch(() => {}); + }); + }, + async getTaskStatus(taskId: string): Promise { return serverRequest(`ai/tasks/${taskId}`, { timeoutMs: TASK_STATUS_TIMEOUT_MS, diff --git a/src/api/generationConcurrency.test.ts b/src/api/generationConcurrency.test.ts new file mode 100644 index 0000000..afea031 --- /dev/null +++ b/src/api/generationConcurrency.test.ts @@ -0,0 +1,63 @@ +import { afterEach, describe, expect, it } from "../test/testHarness"; + +import { + __resetGenerationConcurrencyForTests, + claimGenerationSlot, + getActiveGenerationTaskCount, + getEffectiveGenerationLimit, + getGenerationUserKey, + releaseGenerationSlot, + setUserMaxConcurrency, +} from "./generationConcurrency"; + +describe("generationConcurrency", () => { + afterEach(() => { + __resetGenerationConcurrencyForTests(); + }); + + it("uses the default generation limit until the server provides a user-specific limit", () => { + expect(getEffectiveGenerationLimit()).toBe(3); + + setUserMaxConcurrency(5); + expect(getEffectiveGenerationLimit()).toBe(5); + + setUserMaxConcurrency(0); + expect(getEffectiveGenerationLimit()).toBe(3); + }); + + it("claims and releases local generation slots so the submit button can recover", () => { + const userKey = getGenerationUserKey("user-1"); + + const releaseFirst = claimGenerationSlot({ + userKey, + kind: "image", + id: "slot-1", + }); + claimGenerationSlot({ userKey, kind: "video", id: "slot-2" }); + + expect(getActiveGenerationTaskCount(userKey)).toBe(2); + + releaseFirst(); + expect(getActiveGenerationTaskCount(userKey)).toBe(1); + + releaseGenerationSlot("slot-2"); + expect(getActiveGenerationTaskCount(userKey)).toBe(0); + }); + + it("enforces per-user limits without blocking other users", () => { + setUserMaxConcurrency(1); + + claimGenerationSlot({ userKey: "alice", kind: "image", id: "alice-slot" }); + + expect(() => + claimGenerationSlot({ + userKey: "alice", + kind: "video", + id: "alice-slot-2", + }), + ).toThrow("最多生成 1 个图片/视频任务"); + expect(() => + claimGenerationSlot({ userKey: "bob", kind: "video", id: "bob-slot" }), + ).not.toThrow(); + }); +}); diff --git a/src/api/generationConcurrency.ts b/src/api/generationConcurrency.ts index a4e3b56..f513db1 100644 --- a/src/api/generationConcurrency.ts +++ b/src/api/generationConcurrency.ts @@ -21,6 +21,10 @@ function getEffectiveLimit(): number { return userMaxConcurrency ?? DEFAULT_MAX_ACTIVE_GENERATION_TASKS; } +export function getEffectiveGenerationLimit(): number { + return getEffectiveLimit(); +} + export function getGenerationUserKey(userId?: string | number | null): string { return userId === undefined || userId === null || userId === "" ? "anonymous" : String(userId); } @@ -71,3 +75,8 @@ export function releaseGenerationSlot(id: string | undefined | null): void { if (!id) return; activeSlots.delete(id); } + +export function __resetGenerationConcurrencyForTests(): void { + activeSlots.clear(); + userMaxConcurrency = null; +} diff --git a/src/components/AppShell.tsx b/src/components/AppShell.tsx index a130343..8efa584 100644 --- a/src/components/AppShell.tsx +++ b/src/components/AppShell.tsx @@ -10,7 +10,6 @@ import NotificationCenter from "./NotificationCenter"; import BetaApplicationModal from "./BetaApplicationModal"; import { AnimatedPanel } from "./AnimatedPanel"; import AdminMonitor from "./AdminMonitor"; -import CookieConsentBanner from "./CookieConsentBanner"; import { loadRechargeModal, type RechargeModalComponent } from "./RechargeModal/loadRechargeModal"; import { ShellIcon } from "./ShellIcon"; import { loadDarkGreenTheme } from "../styles/loadDarkGreenTheme"; @@ -76,7 +75,6 @@ function AppShell({ session, usage, notifications, - backendHealth, workspaceExpanded, onSelectView, onLogout, @@ -85,7 +83,6 @@ function AppShell({ onMarkAllNotificationsRead, children, }: AppShellProps) { - const activePackage = session?.user.activePackages?.[0]; const profileRef = useRef(null); const submenuHideTimerRef = useRef(null); const [profileOpen, setProfileOpen] = useState(false); diff --git a/src/components/NotFoundPage.tsx b/src/components/NotFoundPage.tsx index 0d57245..0912cdb 100644 --- a/src/components/NotFoundPage.tsx +++ b/src/components/NotFoundPage.tsx @@ -1,5 +1,4 @@ import { HomeOutlined } from "@ant-design/icons"; -import { useCallback } from "react"; import "../styles/pages/not-found.css"; interface NotFoundPageProps { diff --git a/src/components/OnboardingTour.tsx b/src/components/OnboardingTour.tsx index 2e6703c..0e79782 100644 --- a/src/components/OnboardingTour.tsx +++ b/src/components/OnboardingTour.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useRef, useState, type CSSProperties } from "react"; +import { useCallback, useEffect, useRef, useState } from "react"; import { createPortal } from "react-dom"; import { CloseOutlined, LeftOutlined, RightOutlined } from "@ant-design/icons"; import "../styles/components/onboarding.css"; diff --git a/src/components/toast/toastStore.ts b/src/components/toast/toastStore.ts index f014179..f0e418a 100644 --- a/src/components/toast/toastStore.ts +++ b/src/components/toast/toastStore.ts @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useRef, useState } from "react"; +import { useEffect, useState } from "react"; export type ToastType = "success" | "error" | "info"; diff --git a/src/features/assets/AssetsPage.tsx b/src/features/assets/AssetsPage.tsx index 7956c0d..f74b66a 100644 --- a/src/features/assets/AssetsPage.tsx +++ b/src/features/assets/AssetsPage.tsx @@ -10,7 +10,7 @@ import { SearchOutlined, UserOutlined, } from "@ant-design/icons"; -import { useCallback, useEffect, useMemo, useRef, useState, type ChangeEvent, type DragEvent, type JSX } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState, type DragEvent, type ReactElement } from "react"; import "../../styles/pages/assets.css"; import { assetClient, type ServerAssetItem } from "../../api/assetClient"; import { aiGenerationClient } from "../../api/aiGenerationClient"; @@ -36,7 +36,7 @@ interface AssetsPageProps { onOpenLogin: () => void; } -const typeTabs: Array<{ key: AssetTypeFilter; label: string; icon: JSX.Element | null }> = [ +const typeTabs: Array<{ key: AssetTypeFilter; label: string; icon: ReactElement | null }> = [ { key: "all", label: "全部", icon: null }, { key: "character", label: "人物", icon: }, { key: "scene", label: "场景", icon: }, diff --git a/src/features/canvas/CanvasPage.tsx b/src/features/canvas/CanvasPage.tsx index 50ee0b2..c424ba6 100644 --- a/src/features/canvas/CanvasPage.tsx +++ b/src/features/canvas/CanvasPage.tsx @@ -12,15 +12,11 @@ FileImageOutlined, FileTextOutlined, FolderOpenOutlined, - MutedOutlined, - PauseCircleOutlined, PictureOutlined, - PlayCircleOutlined, ReloadOutlined, SaveOutlined, SearchOutlined, SendOutlined, - SoundOutlined, ThunderboltOutlined, UploadOutlined, VideoCameraOutlined, @@ -37,10 +33,7 @@ import { communityClient } from "../../api/communityClient"; import { modelCapabilitiesClient } from "../../api/modelCapabilitiesClient"; import type { CreatePreviewTaskInput } from "../../api/webGenerationGateway"; import WorkspacePageShell from "../../components/WorkspacePageShell"; -import type { - WebCanvasWorkflow, - WebCanvasWorkflowNodePackage, -} from "../../types"; +import type { WebCanvasWorkflow } from "../../types"; import type { AssetLibraryCategory } from "../assets/localAssetStore"; import { buildCanvasCommunityCaseInput, @@ -64,7 +57,6 @@ import { ENTERPRISE_VIDEO_MODEL_OPTIONS } from "../../utils/enterpriseVideoPolic import { filterImageModelOptionsForSession } from "../../utils/imageModelVisibility"; import { translateTaskError } from "../../utils/translateTaskError"; import type { - CanvasAlignGuide, CanvasAssetSaveSource, CanvasCopiedNode, CanvasConnectorDrag, @@ -72,37 +64,25 @@ import type { CanvasFloatingMenuPosition, CanvasImageFocusDrag, CanvasImageFocusSelection, - CanvasImageGenerationState, CanvasImageNode, - CanvasImageNodeDrag, CanvasImageReferenceItem, CanvasManualLink, CanvasNodeBounds, CanvasNodeKind, CanvasNodePackage, - CanvasNodePackageDrag, CanvasNodePort, - CanvasNodeResizeDrag, CanvasNodeSize, CanvasOption, CanvasPageProps, - CanvasPanDrag, CanvasPoint, CanvasProjectSaveState, CanvasSelectedNode, - CanvasSelectionDrag, CanvasStyleCase, CanvasStylePickerTab, - CanvasStyleReference, - CanvasTextGenerationState, CanvasPromptMentionOption, CanvasPromptMentionState, CanvasTextNode, - CanvasTextNodeDrag, - CanvasVideoGenerationState, - CanvasVideoMode, CanvasVideoNode, - CanvasVideoNodeDrag, CanvasViewport, } from "./canvasTypes"; import { @@ -110,7 +90,6 @@ import { canvasAutoSaveDebounceMs, canvasAutoSaveIdleTimeoutMs, canvasNodeClickMoveThreshold, - canvasNodeDefaultSizes, canvasStylePickerCategories, canvasStylePickerTabs, connectorAnchorOutset, @@ -120,22 +99,17 @@ import { defaultImageModel, defaultTextModelId, defaultVideoModel, - image4kCapableModels, imageFocusRatioOptions, imageModelOptions as fallbackCanvasImageModelOptions, imageRatioOptions, - textModelOptions, videoDurationOptions, videoRatioOptions, } from "./canvasConstants"; import { applyImageFocusRatioFromTopLeft, blobToDataUrl, - buildCanvasStyleKeywords, buildCopyTitle, clampCanvasPercent, - buildReversePromptFromAsset, - canvasGenerationProgressStyle, clampCanvasNodeSize, clampCanvasViewportZoom, communityCaseToCanvasStyleCase, @@ -150,15 +124,8 @@ import { getDefaultImageQuality, getDefaultVideoQuality, getImageQualityOptions, - getOptionLabel, getVideoQualityOptions, - getWorkflowImageNodeFileName, - getWorkflowImageNodePrompt, - getWorkflowNodeFocusSelection, - getWorkflowNodeMetadataString, - getWorkflowNodeStyleReference, hasCanvasOptionValue, - moveCanvasNodesForPackageDrag, normalizeCanvasGenerationProgress, normalizeCanvasLinkPorts, normalizeCanvasSelectionRect, @@ -166,10 +133,6 @@ import { positionFloatingMenu, resolveImageQuality, resolveVideoQuality, - resolveWorkflowImageModel, - resolveWorkflowRatio, - resolveWorkflowVideoMode, - resolveWorkflowVideoModel, waitForImageTaskResult, waitForVideoTaskResult, } from "./canvasUtils"; @@ -181,11 +144,9 @@ import { createVideoNodesFromWorkflow, createWorkflowPackagesFromCanvasPackages, formatCanvasProjectUpdatedAt, - formatCanvasVideoTime, resolveAssetCategory, } from "./canvasWorkflowDeserialize"; import { CanvasNodeToolbar, CanvasNodeVideoPlayer, CanvasSelectChip } from "./canvasComponents"; -import type { CanvasNodeToolbarAction } from "./canvasComponents"; import { CanvasMarkingPopover } from "./CanvasMarkingPopover"; import { CanvasPromptMentionTextarea, CanvasTextPromptComposer } from "./CanvasTextPromptComposer"; import { CanvasMultiGridPanel, CanvasUpscalePanel, CanvasInpaintPanel } from "./canvasToolPanels"; @@ -396,8 +357,6 @@ function CanvasPage({ const canvasUploadInputRef = useRef(null); const imageNodeInputRef = useRef(null); const canvasRef = useRef(null); - const videoGenerationInFlightRef = useRef(new Set()); - const canvasReferenceUploadPromisesRef = useRef(new Map>()); const canvasDragCounterRef = useRef(0); const [isCanvasDragging, setIsCanvasDragging] = useState(false); const suppressNextPaneClickRef = useRef(false); @@ -413,11 +372,11 @@ function CanvasPage({ const imageNodeIdRef = useRef(1); const videoNodeIdRef = useRef(1); - const { pushSnapshot, undo, redo, canUndo, canRedo } = useCanvasHistory(); + const { pushSnapshot, undo, redo } = useCanvasHistory(); const { textGenerationState, imageGenerationState, videoGenerationState, generationToast, setGenerationToast, - imageGenerationInFlightRef, textGenerationInFlightRef, textGenerationAbortControllersRef, + imageGenerationInFlightRef, videoGenerationInFlightRef, textGenerationInFlightRef, textGenerationAbortControllersRef, canvasGenKeepaliveRestoredRef, setTextGenerationStatus, setImageGenerationStatus, setVideoGenerationStatus, restoreKeepaliveTasks, resetGenerationState, @@ -1887,13 +1846,14 @@ function CanvasPage({ setVideoGenerationStatus(nodeId, { status: "submitting", message: "正在提交视频生成", progress: 8 }); setGenerationToast("视频正在生成"); + let task: Awaited> | null = null; try { const referenceUrls = await resolveConnectedImageReferenceUrls("video", nodeId); if (videoNode.videoMode === "img2video" && referenceUrls.length === 0) { throw new Error("图生视频需要先连接至少一个可用的图片节点"); } - let requestModel = resolveVideoRequestModel({ model, referenceUrls }); - const task = await onCreateTask({ + const requestModel = resolveVideoRequestModel({ model, referenceUrls }); + task = await onCreateTask({ title: videoNode.title || "视频节点生成", type: "video", prompt: prompt || "根据参考图片生成视频", @@ -1916,10 +1876,12 @@ function CanvasPage({ if (task.status === "completed" && !task.outputUrl) { throw new Error("视频生成任务已完成,但服务器没有返回结果地址,请稍后重试"); } + const taskId = task.id; + addCanvasGenKeepalive(taskId, nodeId, "video", projectId || ""); setVideoGenerationStatus(nodeId, { status: "running", message: "视频生成中", progress: Math.max(18, Number(task.progress || 0)) }); const outputUrl = task.outputUrl || - (await waitForImageTaskResult(task.id, (status) => { + (await waitForVideoTaskResult(taskId, (status) => { const progress = Math.max(18, Math.min(status.status === "completed" ? 100 : 96, Math.trunc(status.progress || 0))); const statusLabel = status.status === "pending" @@ -1932,11 +1894,12 @@ function CanvasPage({ setVideoGenerationStatus(nodeId, { status: "running", message: statusLabel, progress }); })); setVideoGenerationStatus(nodeId, { status: "success", message: "视频生成完成", progress: 100 }); + removeCanvasGenKeepalive(taskId); const immediateAssetRef = createCanvasAssetRefFromGeneratedResult({ url: outputUrl, mediaType: "video/mp4", resultType: "video", - taskId: task.id, + taskId, originalUrl: outputUrl, }); setVideoNodes((currentNodes) => @@ -1947,7 +1910,7 @@ function CanvasPage({ videoUrl: outputUrl, assetRef: immediateAssetRef, taskRef: { - taskId: task.id, + taskId, status: "completed", resultUrl: outputUrl, updatedAt: new Date().toISOString(), @@ -1961,7 +1924,7 @@ function CanvasPage({ url: outputUrl, mediaType: "video/mp4", resultType: "video", - taskId: task.id, + taskId, originalUrl: outputUrl, }); await delay(420); @@ -1974,7 +1937,7 @@ function CanvasPage({ videoUrl: assetRef.url, assetRef, taskRef: { - taskId: task.id, + taskId, status: "completed", resultUrl: assetRef.url, updatedAt: new Date().toISOString(), @@ -1991,6 +1954,7 @@ function CanvasPage({ }); } finally { videoGenerationInFlightRef.current.delete(nodeId); + if (task?.id) removeCanvasGenKeepalive(task.id); } }; diff --git a/src/features/canvas/canvasAssetPersistence.ts b/src/features/canvas/canvasAssetPersistence.ts index 12e9079..115e328 100644 --- a/src/features/canvas/canvasAssetPersistence.ts +++ b/src/features/canvas/canvasAssetPersistence.ts @@ -106,7 +106,11 @@ function blobToDataUrl(blob: Blob): Promise { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onload = () => { - typeof reader.result === "string" ? resolve(reader.result) : reject(new Error("Unable to read canvas result")); + if (typeof reader.result === "string") { + resolve(reader.result); + } else { + reject(new Error("Unable to read canvas result")); + } }; reader.onerror = () => reject(reader.error || new Error("Unable to read canvas result")); reader.readAsDataURL(blob); diff --git a/src/features/canvas/canvasComponents.tsx b/src/features/canvas/canvasComponents.tsx index 5f9cd98..0902272 100644 --- a/src/features/canvas/canvasComponents.tsx +++ b/src/features/canvas/canvasComponents.tsx @@ -1,17 +1,10 @@ import { - CopyOutlined, - DeleteOutlined, - DownloadOutlined, DownOutlined, ExpandOutlined, MutedOutlined, PauseCircleOutlined, - PictureOutlined, PlayCircleOutlined, - ReloadOutlined, - SaveOutlined, SoundOutlined, - ThunderboltOutlined, } from "@ant-design/icons"; import { useEffect, useRef, useState, type ChangeEvent, type MouseEvent } from "react"; import type { CanvasOption } from "./canvasTypes"; diff --git a/src/features/canvas/canvasToolPanels.tsx b/src/features/canvas/canvasToolPanels.tsx index 02afbf7..0d08086 100644 --- a/src/features/canvas/canvasToolPanels.tsx +++ b/src/features/canvas/canvasToolPanels.tsx @@ -146,26 +146,6 @@ export function CanvasInpaintPanel({ imageUrl, onComplete }: CanvasToolPanelProp ctx.fill(); }; - const getMaskDataUrl = (): string => { - const canvas = canvasRef.current!; - const maskCanvas = document.createElement("canvas"); - maskCanvas.width = canvas.width; - maskCanvas.height = canvas.height; - const srcCtx = canvas.getContext("2d")!; - const maskCtx = maskCanvas.getContext("2d")!; - const imgData = srcCtx.getImageData(0, 0, canvas.width, canvas.height); - const maskData = maskCtx.createImageData(canvas.width, canvas.height); - for (let i = 0; i < imgData.data.length; i += 4) { - const hasColor = imgData.data[i + 3] > 10; - maskData.data[i] = hasColor ? 255 : 0; - maskData.data[i + 1] = hasColor ? 255 : 0; - maskData.data[i + 2] = hasColor ? 255 : 0; - maskData.data[i + 3] = 255; - } - maskCtx.putImageData(maskData, 0, 0); - return maskCanvas.toDataURL("image/png"); - }; - const handleInpaint = useCallback(async () => { if (!imageUrl || !prompt) { toast.error("请输入重绘提示词"); @@ -174,7 +154,6 @@ export function CanvasInpaintPanel({ imageUrl, onComplete }: CanvasToolPanelProp setLoading(true); cancelRef.current = false; try { - const maskDataUrl = getMaskDataUrl(); const { taskId } = await aiGenerationClient.createImageEditTask({ imageUrl, function: "inpaint", @@ -218,4 +197,4 @@ export function CanvasInpaintPanel({ imageUrl, onComplete }: CanvasToolPanelProp ); -} \ No newline at end of file +} diff --git a/src/features/canvas/canvasUtils.ts b/src/features/canvas/canvasUtils.ts index 3161984..08a2ab6 100644 --- a/src/features/canvas/canvasUtils.ts +++ b/src/features/canvas/canvasUtils.ts @@ -1,5 +1,5 @@ import type { CSSProperties } from "react"; -import { aiGenerationClient, type AiTaskStatus } from "../../api/aiGenerationClient"; +import type { AiTaskStatus } from "../../api/aiGenerationClient"; import type { ServerCommunityCase } from "../../api/communityClient"; import { waitForTask } from "../../api/taskSubscription"; import type { WebCanvasWorkflow } from "../../types"; @@ -22,7 +22,6 @@ import type { CanvasVideoMode, } from "./canvasTypes"; import { - assetLibraryCategories, assetTypePromptLabel, canvasNodeDefaultSizes, canvasNodeMaxSizes, @@ -194,7 +193,7 @@ export function resolveWorkflowImageModel(node: WebCanvasWorkflow["nodes"][numbe return defaultImageModel; } -export function resolveWorkflowVideoModel(node: WebCanvasWorkflow["nodes"][number], workflowModel: string) { +export function resolveWorkflowVideoModel(node: WebCanvasWorkflow["nodes"][number], _workflowModel: string) { const raw = getWorkflowNodeMetadataString(node, "model"); const storedModel = toPixverseDisplayModel(toViduDisplayModel(toHappyHorseDisplayModel(raw))); if (hasCanvasOptionValue(videoModelOptions, storedModel)) return storedModel; @@ -242,7 +241,11 @@ export function blobToDataUrl(blob: Blob) { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onload = () => { - typeof reader.result === "string" ? resolve(reader.result) : reject(new Error("Unable to read canvas image")); + if (typeof reader.result === "string") { + resolve(reader.result); + } else { + reject(new Error("Unable to read canvas image")); + } }; reader.onerror = () => reject(reader.error || new Error("Unable to read canvas image")); reader.readAsDataURL(blob); @@ -253,7 +256,9 @@ export async function waitForImageTaskResult(taskId: string, onStatus?: (status: const resultUrl = await waitForTask(taskId, { kind: "image", onProgress: (e) => { - onStatus?.({ taskId, status: e.status, progress: e.progress, resultUrl: e.resultUrl ?? undefined, error: e.error ?? undefined } as AiTaskStatus); + if (onStatus) { + onStatus({ taskId, status: e.status, progress: e.progress, resultUrl: e.resultUrl ?? undefined, error: e.error ?? undefined } as AiTaskStatus); + } }, }); if (!resultUrl) throw new Error("生成任务已完成,但服务器没有返回结果地址,请稍后重试"); @@ -264,7 +269,9 @@ export async function waitForVideoTaskResult(taskId: string, onStatus?: (status: const resultUrl = await waitForTask(taskId, { kind: "video", onProgress: (e) => { - onStatus?.({ taskId, status: e.status, progress: e.progress, resultUrl: e.resultUrl ?? undefined, error: e.error ?? undefined } as AiTaskStatus); + if (onStatus) { + onStatus({ taskId, status: e.status, progress: e.progress, resultUrl: e.resultUrl ?? undefined, error: e.error ?? undefined } as AiTaskStatus); + } }, }); if (!resultUrl) throw new Error("视频生成任务已完成,但服务器没有返回结果地址,请稍后重试"); diff --git a/src/features/canvas/canvasWorkflowExecution.ts b/src/features/canvas/canvasWorkflowExecution.ts index 5f40bab..211509a 100644 --- a/src/features/canvas/canvasWorkflowExecution.ts +++ b/src/features/canvas/canvasWorkflowExecution.ts @@ -90,7 +90,7 @@ export function buildCanvasVideoTaskInput(workflow: WebCanvasWorkflow, nodeId: s const params = context.node.params || {}; const referenceUrls = context.imageReferences.map((item) => item.url); const displayModel = toHappyHorseDisplayModel(String(params.model || workflow.settings.model || "happyhorse-1.0")); - let model = resolveVideoRequestModel({ model: displayModel, referenceUrls }); + const model = resolveVideoRequestModel({ model: displayModel, referenceUrls }); return { title: context.node.label || "视频节点生成", type: "video", diff --git a/src/features/canvas/useCanvasGeneration.ts b/src/features/canvas/useCanvasGeneration.ts index 61c2e85..5f5b135 100644 --- a/src/features/canvas/useCanvasGeneration.ts +++ b/src/features/canvas/useCanvasGeneration.ts @@ -1,4 +1,4 @@ -import { type Dispatch, type MutableRefObject, type SetStateAction, useEffect, useRef, useState } from "react"; +import { type Dispatch, type SetStateAction, useEffect, useRef, useState } from "react"; import type { CanvasImageGenerationState, CanvasImageNode, @@ -6,6 +6,7 @@ import type { CanvasVideoGenerationState, CanvasVideoNode, } from "./canvasTypes"; +import { aiGenerationClient } from "../../api/aiGenerationClient"; import { createCanvasAssetRefFromGeneratedResult, persistCanvasGeneratedResultAsset } from "./canvasAssetPersistence"; import { waitForImageTaskResult, waitForVideoTaskResult } from "./canvasUtils"; @@ -41,6 +42,13 @@ export function removeCanvasGenKeepalive(taskId: string): void { saveCanvasGenKeepalive(loadCanvasGenKeepalive().filter((e) => e.taskId !== taskId)); } +export function cancelCanvasGenKeepaliveOnUnload(): void { + const entries = loadCanvasGenKeepalive(); + if (!entries.length) return; + entries.forEach((entry) => aiGenerationClient.cancelTaskOnUnload(entry.taskId)); + saveCanvasGenKeepalive([]); +} + export interface UseCanvasGenerationParams { setImageNodes: Dispatch>; setVideoNodes: Dispatch>; @@ -55,6 +63,7 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) { const [generationToast, setGenerationToast] = useState(null); const imageGenerationInFlightRef = useRef(new Set()); + const videoGenerationInFlightRef = useRef(new Set()); const textGenerationInFlightRef = useRef(new Set()); const textGenerationAbortControllersRef = useRef(new Map()); const canvasGenKeepaliveRestoredRef = useRef(false); @@ -125,7 +134,7 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) { imageGenerationInFlightRef.current.delete(entry.nodeId); }); } else if (entry.nodeKind === "video") { - imageGenerationInFlightRef.current.add(entry.nodeId); + videoGenerationInFlightRef.current.add(entry.nodeId); setVideoGenerationStatus(entry.nodeId, { status: "running", message: "正在恢复视频生成", progress: 20 }); void waitForVideoTaskResult(entry.taskId, (status) => { const progress = Math.max(18, Math.min(status.status === "completed" ? 100 : 96, Math.trunc(status.progress || 0))); @@ -154,7 +163,7 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) { removeCanvasGenKeepalive(entry.taskId); setVideoGenerationStatus(entry.nodeId, { status: "error", message: "视频生成失败" }); }).finally(() => { - imageGenerationInFlightRef.current.delete(entry.nodeId); + videoGenerationInFlightRef.current.delete(entry.nodeId); }); } } @@ -165,11 +174,36 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) { textGenerationAbortControllersRef.current.clear(); textGenerationInFlightRef.current.clear(); imageGenerationInFlightRef.current.clear(); + videoGenerationInFlightRef.current.clear(); setTextGenerationState({}); setImageGenerationState({}); setVideoGenerationState({}); }; + useEffect(() => { + const handlePageHide = () => { + cancelCanvasGenKeepaliveOnUnload(); + textGenerationAbortControllersRef.current.forEach((controller) => controller.abort()); + textGenerationAbortControllersRef.current.clear(); + textGenerationInFlightRef.current.clear(); + imageGenerationInFlightRef.current.clear(); + videoGenerationInFlightRef.current.clear(); + setTextGenerationState({}); + setImageGenerationState({}); + setVideoGenerationState({}); + }; + const handleOnline = () => { + aiGenerationClient.flushPendingTaskCancellations(); + }; + window.addEventListener("pagehide", handlePageHide); + window.addEventListener("online", handleOnline); + aiGenerationClient.flushPendingTaskCancellations(); + return () => { + window.removeEventListener("pagehide", handlePageHide); + window.removeEventListener("online", handleOnline); + }; + }, []); + return { textGenerationState, imageGenerationState, @@ -177,6 +211,7 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) { generationToast, setGenerationToast, imageGenerationInFlightRef, + videoGenerationInFlightRef, textGenerationInFlightRef, textGenerationAbortControllersRef, canvasGenKeepaliveRestoredRef, diff --git a/src/features/canvas/useCanvasNodeDrag.ts b/src/features/canvas/useCanvasNodeDrag.ts index eb27cb5..308f0fe 100644 --- a/src/features/canvas/useCanvasNodeDrag.ts +++ b/src/features/canvas/useCanvasNodeDrag.ts @@ -1,4 +1,4 @@ -import { type Dispatch, type MouseEvent, type MutableRefObject, type SetStateAction, useEffect, useRef, useState } from "react"; +import { type Dispatch, type MouseEvent, type MutableRefObject, type SetStateAction, useEffect, useState } from "react"; import { canvasNodeClickMoveThreshold } from "./canvasConstants"; import type { CanvasAlignGuide, diff --git a/src/features/character-mix/CharacterMixPage.tsx b/src/features/character-mix/CharacterMixPage.tsx index 05a8802..6a5121a 100644 --- a/src/features/character-mix/CharacterMixPage.tsx +++ b/src/features/character-mix/CharacterMixPage.tsx @@ -13,7 +13,6 @@ import { RightOutlined, ScissorOutlined, SwapOutlined, - ThunderboltOutlined, VideoCameraOutlined, } from "@ant-design/icons"; import { useCallback, useEffect, useRef, useState, type DragEvent } from "react"; diff --git a/src/features/compliance/CompliancePage.tsx b/src/features/compliance/CompliancePage.tsx index ec5e543..4290221 100644 --- a/src/features/compliance/CompliancePage.tsx +++ b/src/features/compliance/CompliancePage.tsx @@ -7,61 +7,213 @@ interface CompliancePageProps { kind: ComplianceKind; } -const companyName = "OmniAI"; +const companyName = "南京万物可爱文化传媒有限公司"; +const platformName = "Omniai平台"; +const contactEmail = "system@omniai.net.cn"; const contactPhone = "15155073618"; -const address = "江苏省南京市江北新区扬子江数字视听产业园9栋A楼501"; +const address = "江苏省南京市江北新区扬子江数字视听产业园9栋A楼9A-501"; +const icpRecord = "苏ICP备2026021747号-1"; +const effectiveDate = "2026年06月8日"; -const agreementSections = [ - { - title: "服务范围", - body: "平台提供 AI 图片、视频、脚本、数字人及相关创作辅助服务。具体功能、模型能力、消耗规则以页面展示和平台公告为准。", - }, - { - title: "账号与使用", - body: "用户应保证注册信息真实有效,妥善保管账号与登录凭证,不得出租、转让账号或以自动化方式恶意占用平台资源。", - }, - { - title: "内容合规", - body: "用户不得上传、生成、发布违法违规、侵权、涉政敏感、暴恐、色情、赌博、诈骗或侵犯他人合法权益的内容。平台有权对违规内容采取删除、限制功能、封禁账号等措施。", - }, - { - title: "积分与付费", - body: "积分仅限平台内消费,不支持提现、转让或折现。充值、套餐、赠送积分的有效期、消耗顺序和退费规则以充值页面展示为准。", - }, - { - title: "责任限制", - body: "AI 生成结果可能存在偏差,用户应自行审核输出内容并承担使用后果。因不可抗力、第三方服务异常、网络故障造成的服务中断,平台将在合理范围内修复。", - }, -]; +const privacyPolicyText = ` +隐私政策 +更新日期:2026年06月8日 +生效日期:2026年06月8日 +欢迎您使用本平台服务! +南京万物可爱文化传媒有限公司(以下简称“我们”或“平台”)是Omniai平台的运营者。我们非常重视用户的隐私和个人信息保护。您在使用我们的产品与/或服务时,我们可能会收集和使用您的相关信息。我们希望通过本《隐私政策》(以下简称“本政策”)向您说明,在您使用我们的产品与/或服务时,我们如何收集、使用、保存、共享和转让您的个人信息,以及您所享有的个人信息权利。 +本政策与您所使用的我们的产品与/或服务息息相关,请您务必仔细阅读并确认您已经充分理解本政策的内容。一旦您开始使用我们的产品与/或服务,即表示您已充分理解并同意本政策。 +本政策将帮助您了解以下内容: +一、本政策的适用范围 +二、我们如何收集和使用您的个人信息 +三、我们如何使用Cookie和同类技术 +四、我们如何共享、转让、公开披露您的个人信息 +五、我们如何保护和存储您的个人信息 +六、您如何管理您的个人信息 +七、我们如何保护未成年人的个人信息 +八、本政策如何更新 +九、其他声明与责任限制 +十、如何联系我们 +一、本政策的适用范围 +1. 本政策适用于您通过我们的网站、客户端应用程序、小程序以及其他技术形态(包括但不限于SDK、API等方式)访问和使用我们的产品与/或服务。 +2. 本政策不适用于以下情况: +(1)我们的产品与/或服务中包含的或链接至第三方提供的信息与/或服务(包括任何第三方应用、网站、产品、服务等)。这些服务由第三方负责运营,您使用该服务适用第三方另行向您说明的个人信息处理规则。 +(2)其他非我们向您提供的产品与/或服务。 +(3)特别提示:用户间交易。您通过平台社区与其他用户进行作品、素材、版权等交易时,您主动向交易对方提供的个人信息(如联系方式、交付地址等)不适用本政策。我们建议您在交易过程中谨慎保护您的个人信息,并充分了解交易对方的信用状况。 +二、我们如何收集和使用您的个人信息 +我们会遵循合法、正当、必要、诚信的原则,基于本政策所述的目的,收集和使用您的个人信息。如果我们将您的个人信息用于本政策未载明的其他用途,我们将以合理方式另行向您告知并征得您的同意。 +(一)注册、登录与认证 +1. 必要信息:当您注册平台账号时,您需要提供您的手机号码及验证码/登录密码。手机号码是履行国家法律法规对网络实名制(真实身份信息认证)要求所需的必要信息,若您不提供,您将无法完成注册,仅能使用浏览、搜索等基本功能。 +2. 企业用户:如您以企业身份注册,您还需提供企业名称、营业执照、法定代表人/联系人信息等,以便我们核验您的企业身份,为您提供企业级服务。 +3. 第三方账号登录:您可以使用我们认可的第三方账号(如微信、QQ等)进行登录。我们会收集您在该第三方账号下的唯一标识、昵称、头像等信息,用于创建您在本平台的账号。 +4. 账号信息完善:您可以选择填写或修改您的昵称、头像、个人简介、所在地区等信息。此类信息非必要,但有助于提升您的社区交互体验。 +(二)浏览、搜索与内容发布 +1. 内容浏览:当您浏览平台上的模型、素材、作品、文章等内容时,我们会收集您的设备信息、日志信息,包括IP地址、浏览器类型、操作系统版本、访问时间、点击记录、浏览记录、下载记录等。此类信息用于为您提供内容展示、优化推荐算法以及保障服务安全稳定运行。 +2. 搜索功能:当您使用搜索服务时,我们会收集您的搜索关键字信息,用于向您展示搜索结果。 +3. 内容发布与社区交互:当您在平台社区上传模型、发布作品、发表评论、点赞、收藏、分享时,我们会收集您主动发布的内容(包括但不限于文字、图片、视频、模型文件等)。您发布的内容中会展示您的昵称、头像等信息。 +(三)SaaS软件服务 +1. 使用SaaS工具:当您使用我们提供的SaaS软件工具(如图片编辑、模型训练、设计工具等)时,您主动上传、输入或导入的内容及指令将被收集,以便为您提供服务。 +2. 生成内容:您通过SaaS工具生成的内容,其所有权归您所有。我们会保存该生成内容的记录,以便您进行查看、下载、管理或再次编辑。 +3. 模型优化:在经过安全加密技术处理、严格去标识化且无法重新识别特定个人的前提下,我们可能会将您使用SaaS软件过程中产生的脱敏数据用于模型优化和改进服务。您可以通过平台设置选择是否允许我们将您的内容用于此目的。 +(四)付费订阅与交易服务 +1. 会员订阅:当您购买会员服务(软件订阅费)或充值积分时,我们会收集您的订单信息(包括商品/服务名称、金额、交易时间)和支付信息。支付信息(如银行卡号、第三方支付账号)由第三方支付机构直接收集,我们不会获取您完整的支付敏感信息。 +2. 积分消耗:当您使用积分消耗大模型算力或兑换服务时,我们会记录您的积分变动情况。 +3. 用户间交易: +(1)当您作为卖方(发布作品/素材进行售卖)时,我们需要收集您的实名认证信息(个人或企业)、收款账户信息(银行卡号或第三方支付账号),以便向您结算交易款项。 +(2)当您作为买方(购买作品/素材)时,我们需要收集您的订单信息,并可能向卖方提供您的平台账号信息,以便卖方完成交付。您的真实联系方式(如手机号、地址)不会直接提供给卖方,除非您主动通过平台沟通工具披露。 +(五)运营与安全保障 +为了维护相关产品或服务的正常稳定运行,保护您或其他用户或公众的安全及合法利益,我们会收集如下必要信息: +1. 设备信息:包括设备型号、操作系统版本、唯一设备标识符、IP地址、MAC地址、WLAN接入点、蓝牙、基站、软件版本号、网络接入方式/类型/状态等。 +2. 日志信息:包括您的操作日志、服务日志,例如您对平台功能的点击、使用情况、崩溃数据、异常信息等。 +3. 应用信息:用于预防恶意程序、保障运营质量,我们会收集安装的应用列表、软件列表或正在运行的进程信息。 +4. IP归属地:根据相关法律法规要求,我们可能会在您的个人主页、作品发布等页面展示您的IP地址归属地信息。 +(六)系统权限 +为实现特定功能,我们可能会向您申请相机/摄像头、相册/存储、麦克风、通知、剪贴板等系统权限。您可以在设备设置中自主选择开启或关闭这些权限。关闭权限将可能导致对应功能无法使用,但不影响其他功能。 +(七)征得授权同意的例外 +根据相关法律法规,以下情形中收集您的个人信息无需征得您的授权同意:为订立、履行您作为一方当事人的合同所必需;为履行法定职责或者法定义务所必需;为应对突发公共卫生事件,或者紧急情况下为保护自然人的生命健康和财产安全所必需;为公共利益实施新闻报道、舆论监督等行为,在合理的范围内处理个人信息;依照法律规定在合理的范围内处理您自行公开或者其他已经合法公开的个人信息;法律、行政法规规定的其他情形。 +三、我们如何使用Cookie和同类技术 +1. Cookie:为使您获得更轻松的访问体验,我们可能会使用Cookie技术收集和存储您的登录状态、浏览偏好、使用习惯等信息。您可以根据自己的偏好管理或删除Cookie,但请注意,禁用Cookie可能会导致您无法正常使用平台的某些功能。 +2. 同类技术:我们可能会使用网站信标、像素标签等其他同类技术,用于分析您对我们服务的使用情况、评估广告效果等。 +四、我们如何共享、转让、公开披露您的个人信息 +(一)共享 +我们不会与任何公司、组织和个人共享您的个人信息,但获得您的明确同意、履行法定义务、与授权合作伙伴共享、用户间交易、关联公司共享等情况除外。授权合作伙伴包括支付服务提供商、实名认证服务商、云服务提供商、推送服务提供商、安全与风控服务商等,我们仅共享实现目的所必要的信息。 +(二)转让 +我们不会将您的个人信息转让给任何公司、组织和个人,但获得您的明确同意后,或在涉及合并、收购、破产清算等情形时除外。如涉及个人信息转让,我们会要求新的持有您个人信息的公司、组织继续受本政策约束,否则将要求其重新向您征求授权同意。 +(三)公开披露 +我们不会公开披露您的个人信息,但获得您的明确同意后、基于法律司法或行政程序要求、对违规账号或侵权行为进行必要公示等情况除外。 +(四)共享、转让、公开披露的例外 +在为订立或履行合同所必需、履行法定义务所必需、应对紧急情况、公共利益新闻报道或舆论监督、处理您自行公开或其他已合法公开信息、法律行政法规规定的其他情形中,共享、转让、公开披露您的个人信息无需事先征得您的授权同意。 +五、我们如何保护和存储您的个人信息 +1. 存储地点:我们在中华人民共和国境内运营中收集和产生的个人信息,将存储在中华人民共和国境内。我们不会将您的个人信息传输至境外。 +2. 存储期限:我们仅在为实现本政策所述目的所必需的最短期限内保留您的个人信息,除非法律法规有更强的存留要求。超出存储期限后,我们将对您的个人信息进行删除或匿名化处理。 +3. 保护措施:我们采用SSL加密、数据脱敏、访问控制、入侵检测等符合行业标准的安全技术措施,保护您的个人信息免遭泄露、篡改、毁损或未经授权的访问。我们建立数据安全管理制度,与员工签署保密协议,定期开展安全审计。一旦发生个人信息安全事件,我们将依法及时告知您,并向监管部门报告。 +六、您如何管理您的个人信息 +您可以通过平台账号功能或联系我们,访问、更正、补充、删除您的个人信息,撤回同意或申请注销账号。账号注销后,我们将删除或匿名化处理您的个人信息(法律法规另有规定的除外),您将无法再使用该账号登录平台。对于合理的请求,我们原则上不收取费用;对于无端重复、超出合理限度的请求,我们可能会拒绝或收取合理成本费用。 +七、我们如何保护未成年人的个人信息 +1. 平台主要面向成年人。如您为18周岁以下的未成年人,应在您的父母或其他监护人监护、指导下共同阅读并同意本政策。 +2. 如您为14周岁以下的儿童,请务必在监护人明确同意的前提下使用我们的服务。我们将只会在法律法规允许、监护人明确同意或保护儿童所必要的情况下收集、使用儿童的个人信息。 +3. 如我们发现未经监护人同意收集了儿童个人信息,我们将尽快删除相关数据。 +八、本政策如何更新 +我们可能会根据法律法规变化、产品功能调整或业务发展需要适时修订本政策。本政策更新后,我们会在平台显著位置发布更新版本,并在生效前通过公告、站内信、弹窗等方式通知您。如您继续使用我们的服务,即表示您同意受修订后的本政策约束。 +九、其他声明与责任限制 +为提供更好的服务,我们的产品中可能包含第三方SDK。第三方SDK可能会收集您的设备信息、网络信息等,具体请查阅我们在平台公示的《第三方信息共享清单》。本政策适用中华人民共和国大陆地区法律。因本政策引起的任何争议,双方应友好协商解决;协商不成的,任何一方均有权将争议提交至本平台运营主体所在地有管辖权的人民法院诉讼解决。 +十、如何联系我们 +如您对本政策有任何疑问、意见或建议,或需要进行投诉、举报,您可以通过以下方式与我们联系: +客服邮箱:system@omniai.net.cn +客服电话:15155073618 +邮寄地址:江苏省南京市江北新区扬子江数字视听产业园9栋A楼9A-501 +我们将在15个工作日内回复您的请求。 +`.trim(); -const privacySections = [ - { - title: "收集的信息", - body: "我们会收集账号信息、登录状态、联系方式、创作输入、生成结果、用量记录、设备与网络日志,用于提供服务、安全审计和问题排查。", - }, - { - title: "Cookie 与本地存储", - body: "我们使用 Cookie、localStorage 和 sessionStorage 保存登录状态、偏好设置、Cookie 同意状态、创作草稿和断点续传数据。", - }, - { - title: "信息使用", - body: "信息用于身份验证、生成任务处理、资产管理、积分计费、客服支持、风控合规、服务优化和法律法规要求的备案审计。", - }, - { - title: "第三方处理", - body: "为完成 AI 生成、对象存储、短信邮件、支付或错误监控,我们可能向必要的第三方服务提供最小范围数据,并要求其按约定保护数据安全。", - }, - { - title: "用户权利", - body: "你可以通过平台账号功能或联系方式申请访问、更正、删除个人信息,或撤回非必要授权。法律法规另有要求的记录可能需按规定保留。", - }, -]; +const agreementText = ` +Omniai平台用户协议 +更新日期:2026年06月8日 +生效日期:2026年06月8日 +欢迎您使用本平台服务。 +本平台向您提供SaaS软件服务、社区交流、素材及作品交易等相关服务。欢迎您与南京万物可爱文化传媒有限公司(以下简称“我们”或“平台”)共同签署本《用户服务协议》(下称“本协议”),并使用Omniai平台服务! +在您注册成为平台用户前,请您务必审慎阅读、充分理解本协议的全部内容,特别是免除或限制责任、法律适用和争议解决条款。如您对本协议内容有任何疑问,可通过平台客服进行咨询。如您未满18周岁,请在法定监护人陪同下仔细阅读并充分理解本协议,并征得监护人的同意后使用本平台服务。 +当您点击“同意”本协议、完成注册程序,或实际开始使用平台服务时,即表示您已充分阅读、理解并接受本协议的全部内容,并与我们达成一致,本协议即对您产生法律约束力。如您不同意本协议的任何条款,请立即停止注册或使用行为。 +我们可能不时修改本协议及相关平台规则,并通过网站公告、站内信等方式进行通知。若您在本协议修改后继续使用服务,即视为您已接受修改后的协议。 +第一章 定义 +1. 本平台:指由南京万物可爱文化传媒有限公司拥有并运营的,向用户提供SaaS软件工具、社区互动、内容上传、展示、分享、付费下载及交易等功能的网站、客户端应用程序及其他技术服务平台。 +2. SaaS服务:指我们基于软件即服务模式,向您提供的在线软件工具及相关技术服务,您可能需要支付软件订阅费(会员费)后方可使用全部或部分功能。 +3. 社区服务:指我们在平台上为用户提供的,用于发布、展示、交流、分享及交易作品、素材、版权等内容的空间与功能。 +4. 平台规则:指我们已经发布或后续可能发布、修改的与本平台相关的所有协议、政策、活动规则、公告、说明、站内信通知等,以及《隐私政策》等,均构成本协议不可分割的组成部分。 +5. 用户:指使用本平台服务的任何自然人或组织,包括企业用户与个人用户,合称“您”。 +6. 内容:指用户通过本平台上传、发布、生成、展示、交易的全部信息,包括但不限于模型、软件、素材、图片、视频、音频、文字、代码、设计图、评论等。 +第二章 账号的注册、使用与管理 +1. 账号注册 +(1)您在使用本平台服务前,需通过实名手机号或我们认可的第三方账号进行注册。企业用户还应提供真实、有效的企业营业执照等信息。您在注册或使用Omniai平台服务时可能需要提供一些必要的信息,为保证您享用的平台服务安全有效且不断优化,您同意授权我们对您的必要个人信息进行验证和合理使用。您须保证所填写及提供的资料真实、准确、完整、合法有效。 +(2)您注册成功的账号仅限您本人/本企业自身正当使用,禁止以任何形式赠与、借用、出租、转让、售卖或授权他人使用该账号。 +(3)特别提示:禁止恶意注册。您不得恶意批量注册账号,不得利用多个账号或其他技术手段实施干扰平台运营、规避平台规则、获取不当利益的行为。一经发现,我们有权立即冻结或收回相关账号,并追究您的违约责任。 +(4)如您提供任何违法、不实或我们认为不适合的资料,或我们有理由怀疑您的行为属于恶意操作,我们有权暂停或终止您的账号。 +(5)我们及Omniai平台无须对任何用户的任何登记资料承担任何责任,包括但不限于鉴别、核实任何登记资料的真实性、正确性、完整性、适用性及是否为最新资料的责任。 +2. 账号安全 +(1)您应对账号及密码/验证码的安全性负完全责任,并对该账号下进行的所有活动承担责任。您应高度重视对账号与验证码的保密,在任何情况下不向他人透露账号及验证码。您的账号遭到未获授权的使用,或者发生其它任何安全问题时,您应立即通知我们。 +(2)我们发现或合理认为使用者并非账号初始注册人,为保障账号安全,有权立即暂停或终止提供服务,并永久禁用该账号。 +3. 账号注销与回收 +(1)您可以按照平台公示的方式申请注销账号。账号注销后,我们将对账号内信息进行删除或匿名化处理,法律法规另有规定的除外。 +(2)如您的账号连续六个月以上未登录,我们有权冻结、收回或者注销该账号。 +第三章 平台服务与使用规范 +1. 服务内容 +(1)SaaS软件服务:我们向您提供在线SaaS软件工具,您可按需选择免费版或付费版(会员费)。使用部分高级功能或消耗大模型算力时,可能需要消耗积分,积分可通过充值等方式获得。 +(2)社区服务:平台提供作品、素材、版权的上传、展示、付费下载、互动交流等服务。用户间可通过平台进行相关版权或素材的交易。 +(3)交易手续费:为维持平台运营,对于用户间通过平台达成的交易,我们可能会向卖方或买方收取一定比例的交易手续费,具体费率以平台页面公示为准。 +2. 用户行为规范:严禁侵权与违法内容 +(1)您承诺,您在使用平台SaaS软件创作、或上传、发布、交易的所有内容,均由您原创或已获得合法、完整的授权,不存在侵犯任何第三方知识产权、肖像权、名誉权、隐私权等合法权益的情形。 +(2)高风险警示:您不得使用本平台创作、上传、发布、传播任何违反中华人民共和国法律法规、社会主义制度、国家利益、社会公序良俗或包含淫秽、色情、暴力、赌博、恐怖、侮辱、诽谤、虚假信息、扰乱社会秩序等任何不良内容的信息或作品。 +(3)您不得利用本平台进行任何危害网络安全的行为,包括但不限于使用插件、外挂、爬虫、病毒、反向工程、干扰系统正常运行等。 +(4)您不得利用本平台实施洗钱、套现、诈骗、赌博等违法活动。 +3. 禁止恶意“薅羊毛”与不正当竞争 +您不得通过批量注册账号、使用外挂程序、虚构交易、虚假评价、套取平台补贴或奖励等方式,获取不当商业利益或损害平台及其他用户的权益。一经发现,平台有权扣划不当得利、限制或封禁账号、追究违约责任。 +AI内容生成特别提示:您理解并同意,本平台提供的SaaS软件中可能包含基于人工智能技术的内容生成功能。鉴于AI技术的局限性,生成内容可能存在不确定性或不准确性。您应自行对生成内容进行审核和判断,并对其使用承担全部责任。我们不对生成内容的合法性、准确性、完整性、不侵权性作任何保证。 +第四章 知识产权 +1. 平台的知识产权 +本平台软件、代码、界面设计、商标、标识等知识产权归我们所有,未经书面许可,您不得进行复制、修改、反向编译或用于任何商业目的。 +2. 您的内容的知识产权 +(1)权利归属:您通过本平台上传、发布的内容及使用SaaS软件独立创作生成的内容,其知识产权归您或原权利人所有。您对您的内容承担全部责任。 +(2)授权许可:为了使您的内容能够在平台上进行展示、传播、交易,并为了我们能够持续改进SaaS软件和社区服务,您授予我们一项全球范围内、免费的、非排他性的、可分许可的权利,允许我们在平台及相关业务中使用、复制、修改、改编、分发您公开发布的内容。如果您不希望我们使用您的内容用于模型训练或改进,您可以通过平台设置或联系客服关闭此选项。对于您设置为非公开或仅用于交易的内容,我们将采取更严格的保护措施。 +(3)交易授权:您通过平台社区进行作品、素材、版权的付费下载或交易,即授予购买方一项按照交易约定范围使用该内容的许可。您作为卖方,应清晰标识授权范围,并对授权内容的真实性和合法性承担全部责任。 +3. 侵权内容处理 +我们尊重他人知识产权,并已建立侵权投诉处理机制。任何第三方认为平台上的内容侵犯其合法权益的,可按照平台公示的投诉渠道提交书面通知及初步侵权证据。我们将在收到合格通知后,依法采取删除、屏蔽、断开链接等必要措施,并通知相关用户。对于重复侵权、恶意侵权或情节严重的用户,我们有权直接终止向其提供服务,并永久封禁其账号。 +第五章 社区交易与责任限制 +1. 交易主体与责任承担 +(1)您充分理解并同意,本平台仅为用户提供作品、素材、版权的信息发布、展示、下载、支付结算等交易技术支持服务。平台不是交易合同的任何一方当事人,也并非作品的卖方或买方。 +(2)核心免责声明:平台对于用户发布、展示、交易的内容的合法性、真实性、准确性、完整性、安全性、质量、是否侵权以及交易的履行等,不承担任何事先审查或担保责任。您与其他用户之间因内容交易产生的任何纠纷,均由交易双方自行协商解决,或通过司法、行政途径解决。 +(3)如我们收到司法机关或行政机关的有效法律文书,或认为确有必要时,我们可以采取临时性措施以维护各方权益。 +2. 社区内容的管理权利 +我们有权依据法律法规、本协议及平台规则,对平台社区内的内容进行主动巡查。如发现或收到举报证明内容涉嫌侵权、违法或违反本协议,我们有权在不事先通知的情况下,直接删除、屏蔽相关内容,并对相关用户采取警示、限制功能、暂停服务或封禁账号等措施。 +第六章 费用与支付 +1. 软件订阅费(会员费):您购买会员服务时,应按照平台页面公示的价格和期限支付费用。会员服务为虚拟产品,一经开通,除法律另有规定或平台规则另有说明外,原则上不予退款。 +2. 积分充值:积分用于消耗平台算力或兑换特定服务。充值后积分有效期以平台公示为准。平台有权根据运营情况调整积分获取或消耗规则,但会提前公告。 +3. 交易手续费:平台有权就用户间通过平台达成的交易收取手续费,费率在交易前明确告知。平台有权根据市场情况调整手续费率,通过公告方式通知后生效。 +4. 税费:您使用本平台所获得的收入(如售卖素材所得),根据中国法律规定,您应自行申报并缴纳相关税费。平台按照法律规定履行代扣代缴义务(如适用)。 +第七章 违约与处理 +1. 违约认定:发生违反本协议或平台规则、侵犯第三方权益、恶意批量注册、虚假交易、套取利益或其他违反法律法规并造成损害的行为,视为您违约。 +2. 处理措施:我们有权独立判断并采取警告、拒绝发布、删除内容、限制使用功能、暂停服务、扣划不当得利、冻结或永久封禁账号、追究赔偿等一项或多项措施。 +3. 赔偿责任:如因您的行为导致我们或第三方遭受任何损失,您应足额赔偿。 +第八章 免责声明与责任限制 +1. 服务现状:我们的服务按“现状”和“可得到”的状态提供,我们不作出任何明示或暗示的保证,包括但不限于服务无间断、无错误、安全可靠、适用于特定目的等。 +2. AI生成内容免责:鉴于人工智能技术的局限性,我们无法保证通过SaaS软件生成内容的真实性、准确性、独创性及不侵权性。您应当对生成内容自行加以判断和验证,并承担使用该等内容所产生的全部风险与责任。 +3. 不可抗力及第三方原因:因自然灾害、战争、政府行为、电力或通讯故障、第三方攻击等不可抗力或非我们故意或重大过失的原因导致的损失,我们不承担责任。 +4. 服务中断与变更:我们可能会对平台进行升级、维护或修改,由此导致的服务中断或功能变更,我们将提前通过合理方式通知您。但我们不对因上述必要维护导致的任何损失承担责任,法律另有强制性规定的除外。 +5. 第三方链接与内容:平台可能包含指向第三方网站或资源的链接。我们不对这些第三方网站或资源的可用性、内容、产品或服务承担任何责任。您访问第三方网站或使用第三方服务所产生的一切风险由您自行承担。 +6. 责任上限:在法律允许的最大范围内,我们对于您因使用平台服务而遭受的任何间接、附带、特殊、惩罚性损失,即使已被告知可能发生该等损失,也不承担任何责任。我们的全部赔偿责任总额,不超过您在过去十二个月内向平台支付的费用总额。 +第九章 个人信息保护 +1. 我们非常重视您的个人信息保护。我们将按照平台公布的《隐私政策》收集、使用、存储、共享和保护您的个人信息。请您务必仔细阅读《隐私政策》。 +2. 您同意我们根据《隐私政策》以及相关法律法规的要求处理您的个人信息。 +3. 您知悉并同意,为方便您使用Omniai相关服务,我们有权在遵守法律法规的前提下,以明示的方式获取、使用、储存和分享您的个人信息。我们不会在未经您授权时,公开、编辑或透露您的个人信息及您保存在Omniai的非公开内容。 +4. 您知悉并同意,我们有权通过cookie等技术收集您的产品或服务使用、行为数据,并在经过数据脱敏使之不再指向或关联到您个人身份信息时,自由使用脱敏后的纯商业数据。 +第十章 协议的修改与终止 +1. 协议的修改:我们有权根据法律法规变化或业务需要修改本协议。修改后的协议将在平台公示或以其他方式通知您。如您不接受修改后的协议,您应停止使用平台服务;如您继续使用,则视为同意接受修改后的协议。 +2. 协议的终止:您可以申请注销账号终止本协议。我们有权在您违约或出现其他法定、约定情形时终止本协议。协议终止后,您仍需对协议终止前的行为承担责任。 +第十一章 法律适用与争议解决 +1. 本协议的订立、生效、履行、解释及争议解决,均适用中华人民共和国大陆地区法律。 +2. 凡因本协议引起的或与本协议有关的任何争议,双方应首先友好协商解决;协商不成的,任何一方均有权将争议提交至本平台运营主体所在地南京市浦口区有管辖权的人民法院通过诉讼解决。 +第十二章 其他 +1. 本协议条款标题仅为方便阅读而设,不影响条款含义的解释。 +2. 本协议任何条款被认定为无效或不可执行,不影响其他条款的效力。 +3. 如您对本协议有任何疑问、意见或建议,或需要投诉举报,您可以通过system@omniai.net.cn与我们联系。 +4. 兜底免责声明:在法律法规允许的最大范围内,本协议未明确列明的、或因超出我们合理预见或控制范围所产生的任何直接或间接损失、责任或风险,我们均不承担责任,除非相关法律另有强制性规定。您理解并同意,使用本平台服务的风险由您自行承担,我们仅以普通注意义务对平台进行管理,不对任何未明确约定的商业成果或安全性作出保证。 +(以下无正文) +`.trim(); + +function getDocumentLines(text: string) { + return text.split(/\n+/).map((line) => line.trim()).filter(Boolean); +} + +function getLineClassName(line: string, index: number) { + if (index === 0) return "compliance-document__title"; + if (/^(第[一二三四五六七八九十]+章|[一二三四五六七八九十]+、)/.test(line)) return "compliance-document__heading"; + if (/^([一二三四五六七八九十]+)/.test(line)) return "compliance-document__subheading"; + if (/^[0-9]+\./.test(line) || /^([0-9]+)/.test(line) || /^·/.test(line)) return "compliance-document__clause"; + return "compliance-document__paragraph"; +} export default function CompliancePage({ kind }: CompliancePageProps) { const isPrivacy = kind === "privacy"; - const sections = isPrivacy ? privacySections : agreementSections; const title = isPrivacy ? "隐私政策" : "用户协议"; const Icon = isPrivacy ? SafetyOutlined : FileTextOutlined; + const lines = getDocumentLines(isPrivacy ? privacyPolicyText : agreementText); return (
@@ -71,27 +223,26 @@ export default function CompliancePage({ kind }: CompliancePageProps) {
合规文件

{title}

-

{companyName} 平台服务合规说明。更新日期:2026 年 6 月 3 日。

+

{companyName}({platformName})服务合规说明。生效日期:{effectiveDate}

-
- {sections.map((section, index) => ( -
- {String(index + 1).padStart(2, "0")} -
-

{section.title}

-

{section.body}

-
-
- ))} -
+
+ {lines.map((line, index) => { + const className = getLineClassName(line, index); + if (className === "compliance-document__title") return

{line}

; + if (className === "compliance-document__heading") return

{line}

; + if (className === "compliance-document__subheading") return

{line}

; + return

{line}

; + })} +
联系我们 + 邮箱:{contactEmail} 地址:{address} 电话:{contactPhone} - 备案号:苏ICP备2026021747号-1 + 备案号:{icpRecord}
diff --git a/src/features/digital-human/DigitalHumanPage.tsx b/src/features/digital-human/DigitalHumanPage.tsx index c2e1925..abe7d34 100644 --- a/src/features/digital-human/DigitalHumanPage.tsx +++ b/src/features/digital-human/DigitalHumanPage.tsx @@ -14,7 +14,6 @@ import { RightOutlined, ScissorOutlined, SwapOutlined, - ThunderboltOutlined, UserOutlined, } from "@ant-design/icons"; import { useCallback, useEffect, useRef, useState, type DragEvent } from "react"; @@ -100,7 +99,6 @@ function DigitalHumanPage({ const [isDragging, setIsDragging] = useState(false); const imageInputRef = useRef(null); const audioInputRef = useRef(null); - const canvasDragCounterRef = useRef(0); const [isCanvasDragging, setIsCanvasDragging] = useState(false); useEffect(() => { diff --git a/src/features/ecommerce/EcommercePage.tsx b/src/features/ecommerce/EcommercePage.tsx index 40fc8d4..6742575 100644 --- a/src/features/ecommerce/EcommercePage.tsx +++ b/src/features/ecommerce/EcommercePage.tsx @@ -1,6 +1,5 @@ import { AppstoreOutlined, - CloudUploadOutlined, CloseOutlined, FileImageOutlined, FrownOutlined, @@ -9,7 +8,6 @@ import { MenuUnfoldOutlined, QuestionCircleOutlined, ReloadOutlined, - SettingOutlined, SkinOutlined, } from "@ant-design/icons"; import { useEffect, useMemo, useRef, useState, type CSSProperties, type ChangeEvent, type DragEvent, type ReactNode } from "react"; @@ -624,11 +622,6 @@ const tryOnModelOptions = { ethnicity: ["欧美白人", "亚洲人", "拉美裔", "非洲裔"], body: ["标准", "高挑", "微胖", "运动"], }; -const sampleResults = [ - ossAssets.ecommerce.slides.slide4, - ossAssets.ecommerce.generated, - ossAssets.ecommerce.slides.slide5, -]; const productSetAssets = ossAssets.ecommerce.productSet; const productSetPreviewCards = [ { id: "main", label: "01 主图 (白底/合规)", src: productSetAssets.main }, @@ -701,21 +694,13 @@ function readImageDimensions(src: string): Promise<{ width: number; height: numb }); } -const blobToDataUrl = (blob: Blob): Promise => - new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.onload = () => resolve(String(reader.result || "")); - reader.onerror = () => reject(reader.error || new Error("文件读取失败")); - reader.readAsDataURL(blob); - }); - async function createUploadedImageItems(files: File[], limit: number, prefix: string): Promise { const selectedFiles = Array.from(files).slice(0, limit); const stamp = Date.now(); const items = await Promise.all(selectedFiles.map(async (file, index) => { const localPreviewUrl = URL.createObjectURL(file); - let dimensions: { width?: number; height?: number } = {}; + let dimensions: { width?: number; height?: number }; try { dimensions = await readImageDimensions(localPreviewUrl); } catch { @@ -1702,7 +1687,6 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { } const generatedUrls: string[] = []; - const stamp = Date.now(); for (const countKey of cloneSetCountKeys) { if (imageAbortRef.current.current) break; @@ -2039,7 +2023,7 @@ function ProductClonePage(_props: ProductClonePageProps = {}) { ); }; - const resetTask = () => { + const _resetTask = () => { setSetImages([]); setProductSetRequirement(""); setProductSetOutput("video"); diff --git a/src/features/ecommerce/EcommerceVideoWorkspace.tsx b/src/features/ecommerce/EcommerceVideoWorkspace.tsx index efc1dfd..bf69688 100644 --- a/src/features/ecommerce/EcommerceVideoWorkspace.tsx +++ b/src/features/ecommerce/EcommerceVideoWorkspace.tsx @@ -1,4 +1,4 @@ -import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import "../../styles/pages/ecommerce-video.css"; import { CloseOutlined, @@ -14,7 +14,6 @@ import { import { runVideoPlan, renderSceneImage, renderScene, buildSceneTasks, saveVideoHistory } from "./ecommerceVideoService"; import { PLAN_STEP_LABELS, - PLAN_STEPS_DISPLAY, type EcommerceVideoStage, type EcommerceVideoSceneTask, type EcommerceVideoPlanProgress, @@ -29,7 +28,6 @@ import { useGenerationTasks } from "../../hooks/useGenerationTasks"; import { saveEcommerceVideoState, loadEcommerceVideoState, - clearEcommerceVideoState, } from "./ecommerceVideoKeepalive"; interface EcommerceVideoWorkspaceProps { @@ -298,7 +296,7 @@ export default function EcommerceVideoWorkspace({ }, 3000); }; - const handleDownload = async (url: string) => { + const _handleDownload = async (url: string) => { try { await saveToolResultToLocal({ url, name: `ecommerce-video-${Date.now()}`, type: "video", @@ -310,7 +308,7 @@ export default function EcommerceVideoWorkspace({ } }; - const handleSaveAsset = async (url: string) => { + const _handleSaveAsset = async (url: string) => { try { const result = await addToolResultToAssetLibrary({ url, name: `电商短视频-${Date.now()}.mp4`, description: "电商广告视频生成结果", @@ -596,9 +594,6 @@ export default function EcommerceVideoWorkspace({ const sourceImage = sourceImageUrls[0] || planResult?.imageUrls[0] || productImageDataUrls[0] || ""; const flowHasStarted = stage !== "idle" || completedSteps.length > 0; const flowMeta = `${platform} / ${aspectRatio} / ${durationSeconds}s / ${resolution}`; - const hasImaging = stage === "imaging" || stage === "imaged" || stage === "rendering" || stage === "completed" || stage === "partial_failed"; - const hasRendering = stage === "rendering" || stage === "completed" || stage === "partial_failed"; - const visiblePlanSteps = PLAN_STEPS_DISPLAY.filter((s) => completedSteps.includes(s)); return (
diff --git a/src/features/ecommerce/ecommerceTemplates.ts b/src/features/ecommerce/ecommerceTemplates.ts index 6f96ea9..b186961 100644 --- a/src/features/ecommerce/ecommerceTemplates.ts +++ b/src/features/ecommerce/ecommerceTemplates.ts @@ -19,7 +19,7 @@ const [ ecommerceCarouselImage2, ecommerceCarouselImage3, ecommerceCarouselImage4, - ecommerceCarouselImage5, + , ecommerceCarouselImage6, ] = ossAssets.ecommerce.templateCases; const ecommerceCarouselGenerated = ossAssets.ecommerce.generated; diff --git a/src/features/home/HomePage.tsx b/src/features/home/HomePage.tsx index bffbe73..fa60aa9 100644 --- a/src/features/home/HomePage.tsx +++ b/src/features/home/HomePage.tsx @@ -1,6 +1,5 @@ import { ArrowRightOutlined, - DashboardOutlined, FileSearchOutlined, PlayCircleOutlined, PlusOutlined, @@ -9,7 +8,6 @@ import { } from "@ant-design/icons"; import { Fragment, useCallback, useEffect, useMemo, useRef, useState, type CSSProperties } from "react"; import type { WebViewKey, WebImageWorkbenchTool } from "../../types"; -import { useScrollEntrance } from "../../hooks/useScrollEntrance"; import { ossAssets } from "../../data/ossAssets"; import "../../styles/pages/home.css"; import WelcomeSplash from "./WelcomeSplash"; @@ -17,15 +15,6 @@ import ToolboxSection from "./ToolboxSection"; import ScriptReviewShowcase from "./ScriptReviewShowcase"; import ModelGenerationShowcase from "./ModelGenerationShowcase"; -function ScrollEntrance({ children, className, ...rest }: { children: React.ReactNode; className?: string } & React.HTMLAttributes) { - const { ref, isVisible } = useScrollEntrance(); - return ( -
- {children} -
- ); -} - const [heroImage1, heroImage2, heroImage3] = ossAssets.home.heroSlides; const { ecommerce: featureEcommerceImage, @@ -477,7 +466,7 @@ function EcommerceFeatureShowcase() { ); } -function HomePage({ onOpenGenerate, onStartOnboarding, onOpenCanvas, onOpenEcommerce, onOpenScriptReview, onOpenTokenMonitor, onSelectView, onOpenImageTool }: HomePageProps) { +function HomePage({ onOpenGenerate, onStartOnboarding, onOpenCanvas, onOpenEcommerce, onOpenScriptReview, onSelectView, onOpenImageTool }: HomePageProps) { const [splashDismissed, setSplashDismissed] = useState(() => sessionStorage.getItem("omniai:splash-seen") === "1"); const [activeSlideIndex, setActiveSlideIndex] = useState(0); const [carouselMotion, setCarouselMotion] = useState(null); diff --git a/src/features/home/ScriptReviewVisual.tsx b/src/features/home/ScriptReviewVisual.tsx index ed03861..8929fd0 100644 --- a/src/features/home/ScriptReviewVisual.tsx +++ b/src/features/home/ScriptReviewVisual.tsx @@ -14,7 +14,6 @@ function ScriptReviewVisual() { const [animated, setAnimated] = useState(false); const [activeDim, setActiveDim] = useState(null); const [score, setScore] = useState(0); - const scoreRef = useRef(0); const frameRef = useRef(null); useEffect(() => { diff --git a/src/features/home/ToolboxSection.tsx b/src/features/home/ToolboxSection.tsx index ac23134..b70a696 100644 --- a/src/features/home/ToolboxSection.tsx +++ b/src/features/home/ToolboxSection.tsx @@ -145,7 +145,7 @@ const CARDS = [ }, ]; -function ToolboxSection({ onSelectView, onOpenImageTool }: ToolboxSectionProps) { +function ToolboxSection({ onSelectView }: ToolboxSectionProps) { const handleCardClick = (targetView: WebViewKey) => { onSelectView(targetView); }; diff --git a/src/features/image-workbench/ImageWorkbenchPage.tsx b/src/features/image-workbench/ImageWorkbenchPage.tsx index 488e600..ebd74e1 100644 --- a/src/features/image-workbench/ImageWorkbenchPage.tsx +++ b/src/features/image-workbench/ImageWorkbenchPage.tsx @@ -21,7 +21,6 @@ import { ScissorOutlined, SwapOutlined, TableOutlined, - ThunderboltOutlined, } from "@ant-design/icons"; import { useCallback, useEffect, useRef, useState, type DragEvent } from "react"; import "../../styles/pages/more-tools.css"; @@ -30,7 +29,6 @@ import type { WebImageWorkbenchTool, WebViewKey } from "../../types"; import { aiGenerationClient } from "../../api/aiGenerationClient"; import { waitForTask } from "../../api/taskSubscription"; import { saveToolTaskState, loadToolTaskState, clearToolTaskState } from "../workbench/toolKeepalive"; -import { translateTaskError } from "../../utils/translateTaskError"; import { addToolResultToAssetLibrary, saveToolResultToLocal } from "../workbench/toolResultActions"; import { useCanvasDrawing } from "./useCanvasDrawing"; import CameraViewport3D from "./CameraViewport3D"; @@ -40,7 +38,6 @@ type OutputSize = "9:16" | "16:9" | "4:3" | "3:4" | "1:1"; type OutputCount = 1 | 2 | 3 | 4; const OUTPUT_SIZE_OPTIONS: OutputSize[] = ["9:16", "16:9", "4:3", "3:4", "1:1"]; -const OUTPUT_COUNT_OPTIONS: OutputCount[] = [1, 2, 3, 4]; const SIZE_TO_RATIO: Record = { "9:16": "9:16", diff --git a/src/features/profile/ProfilePage.tsx b/src/features/profile/ProfilePage.tsx index e6411e8..6eb58a9 100644 --- a/src/features/profile/ProfilePage.tsx +++ b/src/features/profile/ProfilePage.tsx @@ -1488,6 +1488,32 @@ function ProfilePage({ ) : null} + {mode === "register" ? ( + + ) : null} ) : null} diff --git a/src/features/resolution-upscale/ResolutionUpscalePage.tsx b/src/features/resolution-upscale/ResolutionUpscalePage.tsx index 5559199..5044bc4 100644 --- a/src/features/resolution-upscale/ResolutionUpscalePage.tsx +++ b/src/features/resolution-upscale/ResolutionUpscalePage.tsx @@ -21,9 +21,8 @@ import "../../styles/pages/image-workbench.css"; import { aiGenerationClient } from "../../api/aiGenerationClient"; import { waitForTask } from "../../api/taskSubscription"; import { saveToolTaskState, loadToolTaskState, clearToolTaskState } from "../workbench/toolKeepalive"; -import { translateTaskError } from "../../utils/translateTaskError"; import { getServerBaseUrl, isServerRequestError } from "../../api/serverConnection"; -import { summarizeUrl, formatFileSize, fileToDataUrl, wait } from "../../utils/toolPageUtils"; +import { summarizeUrl, formatFileSize, fileToDataUrl } from "../../utils/toolPageUtils"; import TaskStatusBar from "../../components/TaskStatusBar"; import BeforeAfterCompare from "../../components/BeforeAfterCompare"; import { addToolResultToAssetLibrary, saveToolResultToLocal } from "../workbench/toolResultActions"; diff --git a/src/features/script-tokens/ScriptTokensPage.tsx b/src/features/script-tokens/ScriptTokensPage.tsx index 52a8ec6..55591d8 100644 --- a/src/features/script-tokens/ScriptTokensPage.tsx +++ b/src/features/script-tokens/ScriptTokensPage.tsx @@ -1,12 +1,6 @@ import { - BarChartOutlined, CheckCircleFilled, CloseOutlined, - CopyOutlined, - DownloadOutlined, - FileTextOutlined, - LoadingOutlined, - ThunderboltOutlined, UploadOutlined, } from "@ant-design/icons"; import { useEffect, useRef, useState, type ChangeEvent, type DragEvent, type KeyboardEvent } from "react"; @@ -264,7 +258,7 @@ function getDimensionEvidence(result: EvalResult, dim: ScoreDimension): string[] return normalizeEvidenceItems(evidence, 3); } -function formatReportMarkdown(result: EvalResult, script: string): string { +function formatReportMarkdown(result: EvalResult): string { const lines: string[] = []; lines.push(`# 剧本评测报告`); lines.push(""); @@ -438,7 +432,7 @@ function ScriptTokensPage() { const handleCopyReport = async () => { if (!result) return; - const text = formatReportMarkdown(result, script); + const text = formatReportMarkdown(result); try { await navigator.clipboard.writeText(text); setCopied(true); @@ -459,7 +453,7 @@ function ScriptTokensPage() { const handleExportMarkdown = () => { if (!result) return; - const md = formatReportMarkdown(result, script); + const md = formatReportMarkdown(result); const blob = new Blob([md], { type: "text/markdown;charset=utf-8" }); const url = URL.createObjectURL(blob); const a = document.createElement("a"); diff --git a/src/features/script-tokens/TokenUsagePage.tsx b/src/features/script-tokens/TokenUsagePage.tsx index 33dec5d..e119757 100644 --- a/src/features/script-tokens/TokenUsagePage.tsx +++ b/src/features/script-tokens/TokenUsagePage.tsx @@ -130,8 +130,6 @@ function TokenUsagePage({ loadEnterpriseUsage, loadPersonalUsage, onOpenMore, - onOpenImageTool, - onSelectView, }: TokenUsagePageProps) { const [enterpriseUsage, setEnterpriseUsage] = useState(null); const [enterpriseUsageLoading, setEnterpriseUsageLoading] = useState(false); diff --git a/src/features/size-template/SizeTemplatePage.tsx b/src/features/size-template/SizeTemplatePage.tsx index cc32122..6d156c8 100644 --- a/src/features/size-template/SizeTemplatePage.tsx +++ b/src/features/size-template/SizeTemplatePage.tsx @@ -947,7 +947,6 @@ function SizeTemplatePage({ onOpenEcommerce }: SizeTemplatePageProps) { ); const selectedPreset = filteredTemplates.find((item) => item.title === activePresetTitle) ?? filteredTemplates[0] ?? sizeTemplatePresets[0]!; - const activeGroupLabel = sizeTemplateGroups.find((item) => item.key === selectedPreset.group)?.label ?? "尺寸模板"; const platformOptions = activeGroup === "socialCn" ? socialContentPlatformOptions diff --git a/src/features/workbench/ConversationSidebar.tsx b/src/features/workbench/ConversationSidebar.tsx index 12d701d..64ec94e 100644 --- a/src/features/workbench/ConversationSidebar.tsx +++ b/src/features/workbench/ConversationSidebar.tsx @@ -1,5 +1,4 @@ import { - CloseOutlined, DeleteOutlined, EditOutlined, MenuFoldOutlined, diff --git a/src/features/workbench/WorkbenchPage.tsx b/src/features/workbench/WorkbenchPage.tsx index c070246..a7c5967 100644 --- a/src/features/workbench/WorkbenchPage.tsx +++ b/src/features/workbench/WorkbenchPage.tsx @@ -2,24 +2,18 @@ import { AppstoreOutlined, ArrowDownOutlined, ArrowUpOutlined, - CaretRightOutlined, ClockCircleOutlined, CloseOutlined, CopyOutlined, DeleteOutlined, - DownloadOutlined, - FullscreenOutlined, LoadingOutlined, MessageOutlined, - MutedOutlined, PictureOutlined, - PauseOutlined, PlusOutlined, ReloadOutlined, SendOutlined, SettingOutlined, StopOutlined, - ThunderboltOutlined, VideoCameraOutlined, } from "@ant-design/icons"; import { @@ -35,10 +29,10 @@ import { type SyntheticEvent, } from "react"; import "../../styles/pages/workbench.css"; -import type { WebGenerationPreviewTask, WebUserSession } from "../../types"; +import type { WebUserSession } from "../../types"; import { aiGenerationClient } from "../../api/aiGenerationClient"; -import { claimGenerationSlot, getActiveGenerationTaskCount, getGenerationUserKey, releaseGenerationSlot } from "../../api/generationConcurrency"; -import { preUploadReference, resolvePreUploadedUrl } from "../../api/referenceUploadService"; +import { claimGenerationSlot, getActiveGenerationTaskCount, getEffectiveGenerationLimit, getGenerationUserKey, releaseGenerationSlot } from "../../api/generationConcurrency"; +import { preUploadReference } from "../../api/referenceUploadService"; import { assetClient } from "../../api/assetClient"; import { communityClient } from "../../api/communityClient"; import { loadRechargeModal, type RechargeModalComponent } from "../../components/RechargeModal/loadRechargeModal"; @@ -46,7 +40,6 @@ import { useGenerationTasks } from "../../hooks/useGenerationTasks"; import { conversationClient, type ConversationSummary } from "../../api/conversationClient"; import { modelCapabilitiesClient } from "../../api/modelCapabilitiesClient"; -import { buildApiUrl, buildAuthHeaders } from "../../api/serverConnection"; import type { CreatePreviewTaskInput } from "../../api/webGenerationGateway"; import type { WebProjectSummary } from "../../types"; import { @@ -62,8 +55,6 @@ import { MarkdownMessage, ResultCard, } from "./components/WorkbenchChatCards"; -import { renderMarkdownBlocks } from "./markdownRenderer"; -import { downloadResultAsset } from "./workbenchDownload"; import { translateTaskError } from "../../utils/translateTaskError"; import { buildLocalTimeoutMessage, @@ -80,7 +71,6 @@ import { isPixverseModel } from "../../utils/pixverseRouting"; import { resolveVideoRequestModel } from "../../utils/resolveVideoModel"; import { calculateEnterpriseVideoCredits, ENTERPRISE_DEFAULT_VIDEO_MODEL } from "../../utils/enterpriseVideoPolicy"; import { - getImageQualityOptions, getImageQualityOptionsForContext, getDefaultImageQuality, getDefaultImageQualityForContext, @@ -90,8 +80,6 @@ import { } from "../../utils/modelOptions"; import { filterImageModelOptionsForSession } from "../../utils/imageModelVisibility"; import { persistWorkbenchResultAsset, type PersistedWorkbenchResultAsset } from "./workbenchResultPersistence"; -import { SmoothedProgressBar } from "./SmoothedProgressBar"; -import { useSmoothedProgress } from "../../hooks/useSmoothedProgress"; import { type WorkbenchMode, type ToolbarMenuId, @@ -99,8 +87,6 @@ import { type WorkbenchOption, type WorkbenchFieldGroup, type ReferenceItem, - type PromptMentionItem, - type PromptMentionTokenRange, type ChatAttachment, type ChatMessage, type DeleteDialogState, @@ -117,33 +103,18 @@ import { GRID_SUPPORTED_MODELS, VIDEO_FRAME_OPTIONS, VIDEO_DURATION_OPTIONS, - MESSAGE_STORAGE_KEY, - ACTIVE_CONVERSATION_STORAGE_KEY, - PROMPT_HISTORY_STORAGE_KEY, - TASK_KEEPALIVE_STORAGE_KEY, - WORKBENCH_TASK_STALE_MS, WORKBENCH_TASK_MAX_POLL_FAILURES, - REFERENCE_IMAGE_COMPRESS_THRESHOLD, - REFERENCE_IMAGE_MAX_DIMENSION, - REFERENCE_IMAGE_INITIAL_QUALITY, - REFERENCE_IMAGE_MIN_QUALITY, - CHAT_MODEL, CHAT_NATURAL_SYSTEM_PROMPT, CHAT_TURN_STYLE_REMINDER, - NON_CONVERSATIONAL_ASSISTANT_TEXT, getCachedRole, - getSessionUserId, - userKey, createId, formatWorkbenchTimestamp, - parseWorkbenchTimestampValue, buildChatAttachments, buildNaturalChatHistoryMessages, getErrorText, isAuthFailure, isInsufficientBalance, isInsufficientBalanceMessage, - isTransientMessage, getPersistableMessages, shouldPersistPatch, buildAssistantResult, @@ -156,25 +127,18 @@ import { persistMessages, clearWorkbenchLocalState, persistPromptHistory, - buildRecoverableTaskFromMessage, readStoredKeepaliveTasks, persistKeepaliveTasks, } from "./workbenchStorage"; import { - getRatioOptionClassName, - getSettingsGridColumnsClassName, getReferenceAccept, getReferenceUploadLabel, getReferenceLimit, getReferenceKindLabel, - getReferenceEmptyCopy, hexToRgbTriplet, inferReferenceKind, disposeReferencePreview, - fileToDataUrl, - bytesToHex, buildReferenceFingerprint, - canCompressReferenceImage, compressReferenceImageIfNeeded, buildReferenceToken, resolveReferenceUrls, @@ -188,7 +152,6 @@ import { import { findPromptMentionRangeInside, findPromptMentionRangeOverlap, - ReferenceInlinePreview, ReferencePreview, PromptPreviewLayer, } from "./WorkbenchPromptPreview"; @@ -495,7 +458,6 @@ function WorkbenchPage({ const workbenchAccent = "#00ff88"; const hasConversationRecords = activeConversationId !== null || messages.length > 0; const hasActivatedWorkspace = !effectiveOnboarding && (workspaceStarted || isGenerating || hasConversationRecords); - const referenceCount = referenceItems.length; const activeVideoModelValue = toHappyHorseDisplayModel(videoModel); const activeModelValue = activeMode === "image" ? imageModel : activeMode === "video" ? activeVideoModelValue : chatModel; @@ -522,7 +484,6 @@ function WorkbenchPage({ [conversations], ); const hasSidebarRecords = conversationRecords.length > 0; - const hasActivatedWorkspace = workspaceStarted || isGenerating || hasConversationRecords; const activeConversationTitle = useMemo(() => { if (!activeConversationId) return ""; @@ -1008,7 +969,7 @@ function WorkbenchPage({ const patchConversationMessage = useCallback( async (conversationId: number, messageId: string, patch: Partial) => { - let sourceMessages = + const sourceMessages = activeConversationIdRef.current === conversationId ? messagesRef.current : conversationMessagesCacheRef.current.get(conversationId); @@ -1056,6 +1017,54 @@ function WorkbenchPage({ persistKeepaliveTasks(rest); }; + const releaseKeepaliveTaskLocally = useCallback((taskId: string, options?: { cancelServer?: boolean }) => { + const task = keepaliveTasksRef.current[taskId]; + taskAbortControllersRef.current.get(taskId)?.abort(); + taskAbortControllersRef.current.delete(taskId); + removeKeepaliveTask(taskId); + if (task && options?.cancelServer) { + aiGenerationClient.cancelTask(task.taskId).catch(() => {}); + } + syncActiveGenerationUi(); + }, [syncActiveGenerationUi]); + + const releaseKeepaliveTaskAfterNetworkLoss = useCallback((task: WorkbenchKeepaliveTask, progress: number) => { + const latestTask = { + ...task, + progress, + statusLabel: "网络中断,已释放提交按钮", + }; + void patchConversationMessage(task.conversationId, task.assistantMessageId, { + status: "failed", + taskProgress: Math.max(progress, 100), + taskStatusLabel: "网络中断", + body: "网络中断,当前任务已停止等待并释放提交按钮。请确认网络恢复后重新提交任务。", + }); + upsertKeepaliveTask(latestTask); + releaseKeepaliveTaskLocally(task.taskId, { cancelServer: true }); + if (activeConversationIdRef.current === task.conversationId) { + setIsGenerating(false); + setGenerationStatus("网络中断,已释放提交按钮"); + setGenerationProgress(0); + } + }, [patchConversationMessage, releaseKeepaliveTaskLocally]); + + const cancelActiveKeepaliveTasksOnPageExit = useCallback(() => { + const tasks = Object.values(keepaliveTasksRef.current); + if (!tasks.length) return; + tasks.forEach((task) => { + taskAbortControllersRef.current.get(task.taskId)?.abort(); + taskAbortControllersRef.current.delete(task.taskId); + releaseGenerationSlot(task.concurrencySlotId); + aiGenerationClient.cancelTaskOnUnload(task.taskId); + }); + keepaliveTasksRef.current = {}; + persistKeepaliveTasks({}); + setIsGenerating(false); + setGenerationStatus("已释放未完成任务"); + setGenerationProgress(0); + }, []); + const runKeepalivePoll = useCallback( (task: WorkbenchKeepaliveTask) => { if (taskAbortControllersRef.current.has(task.taskId)) return; @@ -1082,6 +1091,10 @@ function WorkbenchPage({ if (abortController.signal.aborted) return; if (attempt > 0) await sleep(3000); if (abortController.signal.aborted) return; + if (typeof navigator !== "undefined" && navigator.onLine === false) { + releaseKeepaliveTaskAfterNetworkLoss(task, lastKnownProgress); + return; + } let status; try { @@ -1095,7 +1108,8 @@ function WorkbenchPage({ taskProgress: 100, taskStatusLabel: "任务异常", }); - removeKeepaliveTask(task.taskId); + releaseKeepaliveTaskLocally(task.taskId, { cancelServer: true }); + onRefreshUsage?.(); return; } continue; @@ -1323,6 +1337,24 @@ function WorkbenchPage({ }; }, [runKeepalivePoll]); + useEffect(() => { + const handlePageHide = () => { + cancelActiveKeepaliveTasksOnPageExit(); + }; + const handleOnline = () => { + Object.values(keepaliveTasksRef.current).forEach((task) => runKeepalivePoll(task)); + syncActiveGenerationUi(); + }; + + window.addEventListener("pagehide", handlePageHide); + window.addEventListener("online", handleOnline); + aiGenerationClient.flushPendingTaskCancellations(); + return () => { + window.removeEventListener("pagehide", handlePageHide); + window.removeEventListener("online", handleOnline); + }; + }, [cancelActiveKeepaliveTasksOnPageExit, runKeepalivePoll, syncActiveGenerationUi]); + useEffect(() => { persistPromptHistory(promptHistory); }, [promptHistory]); @@ -1987,7 +2019,7 @@ function WorkbenchPage({ const trimmedPrompt = (promptOverride ?? inputValue).trim(); if (!trimmedPrompt) return; const userKey = getGenerationUserKey(session?.user.id); - if (activeMode !== "chat" && getActiveGenerationTaskCount(userKey) >= 3) return; + if (activeMode !== "chat" && getActiveGenerationTaskCount(userKey) >= getEffectiveGenerationLimit()) return; setReferencePreviewOpen(false); let conversationId = activeConversationIdRef.current ?? activeConversationId; @@ -2166,7 +2198,7 @@ function WorkbenchPage({ taskId = result.taskId; genTracker.submitTask({ title: trimmedPrompt.slice(0, 60), type: "image", status: "running", progress: 5, prompt: trimmedPrompt, sourceView: "workbench", taskId }); } else { - let requestModel = resolveVideoRequestModel({ + const requestModel = resolveVideoRequestModel({ model: taskInput.params?.model || ENTERPRISE_DEFAULT_VIDEO_MODEL, referenceUrls: refUrls, }); @@ -2466,8 +2498,11 @@ function WorkbenchPage({ setProjectError("仅支持对视频结果进行超分"); return; } - if (getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id)) >= 3) { - setProjectError(`当前已有 ${getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id))} 个任务进行中(上限3个),请等待任一任务完成后再提交新任务`); + const userKey = getGenerationUserKey(session?.user.id); + const activeCount = getActiveGenerationTaskCount(userKey); + const limit = getEffectiveGenerationLimit(); + if (activeCount >= limit) { + setProjectError(`当前已有 ${activeCount} 个任务进行中(上限${limit}个),请等待任一任务完成后再提交新任务`); return; } if (!isAuthenticated) { @@ -2588,8 +2623,11 @@ function WorkbenchPage({ setProjectError("仅支持对图片结果进行超分"); return; } - if (getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id)) >= 3) { - setProjectError(`当前已有 ${getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id))} 个任务进行中(上限3个),请等待任一任务完成后再提交新任务`); + const userKey = getGenerationUserKey(session?.user.id); + const activeCount = getActiveGenerationTaskCount(userKey); + const limit = getEffectiveGenerationLimit(); + if (activeCount >= limit) { + setProjectError(`当前已有 ${activeCount} 个任务进行中(上限${limit}个),请等待任一任务完成后再提交新任务`); return; } if (!isAuthenticated) { @@ -2762,13 +2800,14 @@ function WorkbenchPage({ }; const activeGenerationCount = getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id)); - const generationLimitReached = activeMode !== "chat" && activeGenerationCount >= 3; + const activeGenerationLimit = getEffectiveGenerationLimit(); + const generationLimitReached = activeMode !== "chat" && activeGenerationCount >= activeGenerationLimit; const promptIsEmpty = !inputValue.trim(); const sendDisabled = promptIsEmpty || generationLimitReached; const sendButtonTitle = promptIsEmpty ? "输入内容后可发送" : generationLimitReached - ? `当前已有 ${activeGenerationCount} 个任务进行中,请等待任一任务完成` + ? `当前已有 ${activeGenerationCount} 个任务进行中(上限 ${activeGenerationLimit} 个),请等待任一任务完成` : billingEstimate.title; const suggestedPrompts = [ @@ -2954,7 +2993,7 @@ function WorkbenchPage({
); - const renderComposerToolbar = (disabled = false, showStop = false) => ( + const renderComposerToolbar = (disabled = false, _showStop = false) => (
diff --git a/src/features/workbench/workbenchReferenceUtils.ts b/src/features/workbench/workbenchReferenceUtils.ts index 016e240..42f6efb 100644 --- a/src/features/workbench/workbenchReferenceUtils.ts +++ b/src/features/workbench/workbenchReferenceUtils.ts @@ -6,7 +6,6 @@ import { type WorkbenchMode, type ReferenceKind, type ReferenceItem, - type WorkbenchOption, } from "./workbenchConstants"; import { resolvePreUploadedUrl } from "../../api/referenceUploadService"; @@ -82,7 +81,11 @@ export function fileToDataUrl(file: File) { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onload = () => { - typeof reader.result === "string" ? resolve(reader.result) : reject(new Error("Unable to read reference file")); + if (typeof reader.result === "string") { + resolve(reader.result); + } else { + reject(new Error("Unable to read reference file")); + } }; reader.onerror = () => reject(reader.error || new Error("Unable to read reference file")); reader.readAsDataURL(file); @@ -208,4 +211,4 @@ export async function resolveReferenceUrls(items: ReferenceItem[]): Promise url !== null); -} \ No newline at end of file +} diff --git a/src/stores/useGenerationStore.ts b/src/stores/useGenerationStore.ts index 711aa7c..ad20197 100644 --- a/src/stores/useGenerationStore.ts +++ b/src/stores/useGenerationStore.ts @@ -1,5 +1,4 @@ import { create } from "zustand"; -import type { WebGenerationPreviewTask } from "../types"; export type QueueItemStatus = "pending" | "running" | "completed" | "failed" | "cancelled"; @@ -63,17 +62,6 @@ interface GenerationStoreState { clearTerminal: () => void; } -function hashUserId(): string { - try { - const raw = localStorage.getItem("omniai-web-session"); - if (!raw) return "anon"; - const parsed = JSON.parse(raw) as { user?: { id?: number | string } }; - return String(parsed?.user?.id || "anon"); - } catch { - return "anon"; - } -} - const initialQueue = loadPersistedQueue(); export const useGenerationStore = create((set, get) => ({ diff --git a/src/styles/pages/compliance.css b/src/styles/pages/compliance.css index ab3e1f3..6774345 100644 --- a/src/styles/pages/compliance.css +++ b/src/styles/pages/compliance.css @@ -788,6 +788,65 @@ overflow: hidden; } +.compliance-document { + gap: 0; + padding: 30px 34px 34px; + overflow: visible; +} + +.compliance-document__title, +.compliance-document__heading, +.compliance-document__subheading, +.compliance-document__paragraph, +.compliance-document__clause { + margin: 0; + max-width: 100%; + color: var(--fg-body); + letter-spacing: 0; + overflow-wrap: anywhere; + word-break: break-word; +} + +.compliance-document__title { + margin-bottom: 18px; + padding-bottom: 16px; + border-bottom: 1px solid var(--border-subtle); + font-size: clamp(24px, 3vw, 32px); + line-height: 1.22; +} + +.compliance-document__heading { + margin: 26px 0 12px; + padding-top: 4px; + color: var(--accent); + font-size: 20px; + line-height: 1.35; +} + +.compliance-document__subheading { + margin: 18px 0 8px; + font-size: 16px; + line-height: 1.5; +} + +.compliance-document__paragraph, +.compliance-document__clause { + color: var(--fg-muted); + font-size: 14px; + line-height: 1.85; +} + +.compliance-document__paragraph + .compliance-document__paragraph, +.compliance-document__clause + .compliance-document__clause, +.compliance-document__paragraph + .compliance-document__clause, +.compliance-document__clause + .compliance-document__paragraph { + margin-top: 8px; +} + +.compliance-document__clause { + padding-left: 12px; +} + .compliance-section { display: grid; grid-template-columns: 52px minmax(0, 1fr); @@ -892,4 +951,12 @@ .compliance-section { grid-template-columns: 1fr; } + + .compliance-document { + padding: 22px 18px 26px; + } + + .compliance-document__clause { + padding-left: 0; + } } diff --git a/src/test/testHarness.ts b/src/test/testHarness.ts new file mode 100644 index 0000000..089d4ca --- /dev/null +++ b/src/test/testHarness.ts @@ -0,0 +1,150 @@ +type TestFn = () => unknown | Promise; + +interface TestCase { + name: string; + run: TestFn; + afterEachFns: TestFn[]; +} + +const tests: TestCase[] = []; +const suiteStack: string[] = []; +const afterEachStack: TestFn[][] = [[]]; + +function formatValue(value: unknown): string { + return typeof value === "string" ? `"${value}"` : JSON.stringify(value); +} + +function fail(message: string): never { + throw new Error(message); +} + +function assertThrows( + actual: unknown, + expectedMessage?: string, + inverted = false, +): void { + if (typeof actual !== "function") { + fail("Expected value to be a function"); + } + + let thrown: unknown; + try { + actual(); + } catch (error) { + thrown = error; + } + + if (inverted) { + if (thrown) + fail( + `Expected function not to throw, but it threw ${thrown instanceof Error ? thrown.message : String(thrown)}`, + ); + return; + } + + if (!thrown) fail("Expected function to throw"); + if (expectedMessage) { + const message = thrown instanceof Error ? thrown.message : String(thrown); + if (!message.includes(expectedMessage)) { + fail( + `Expected thrown message to include "${expectedMessage}", got "${message}"`, + ); + } + } +} + +export function describe(name: string, run: () => void): void { + suiteStack.push(name); + afterEachStack.push([]); + try { + run(); + } finally { + afterEachStack.pop(); + suiteStack.pop(); + } +} + +export function it(name: string, run: TestFn): void { + tests.push({ + name: [...suiteStack, name].join(" > "), + run, + afterEachFns: afterEachStack.flat(), + }); +} + +export function afterEach(run: TestFn): void { + afterEachStack[afterEachStack.length - 1].push(run); +} + +export function expect(actual: unknown) { + return { + toBe(expected: unknown): void { + if (!Object.is(actual, expected)) { + fail(`Expected ${formatValue(actual)} to be ${formatValue(expected)}`); + } + }, + toEqual(expected: unknown): void { + const actualJson = JSON.stringify(actual); + const expectedJson = JSON.stringify(expected); + if (actualJson !== expectedJson) { + fail(`Expected ${actualJson} to equal ${expectedJson}`); + } + }, + toThrow(expectedMessage?: string): void { + assertThrows(actual, expectedMessage); + }, + not: { + toThrow(): void { + assertThrows(actual, undefined, true); + }, + }, + }; +} + +export async function runRegisteredTests(): Promise<{ + passed: number; + failed: number; + total: number; +}> { + let passed = 0; + let failed = 0; + + for (const test of tests) { + let failure: unknown; + try { + await test.run(); + } catch (error) { + failure = error; + } + + for (const hook of [...test.afterEachFns].reverse()) { + try { + await hook(); + } catch (error) { + failure = failure || error; + } + } + + if (failure) { + failed += 1; + console.error(`FAIL ${test.name}`); + console.error( + failure instanceof Error + ? ` ${failure.message}` + : ` ${String(failure)}`, + ); + } else { + passed += 1; + console.log(`PASS ${test.name}`); + } + } + + const total = passed + failed; + if (total === 0) { + console.error("No unit tests were registered."); + return { passed, failed: 1, total }; + } + + console.log(`\n${passed} passed, ${failed} failed`); + return { passed, failed, total }; +} diff --git a/src/test/testHarness/index.ts b/src/test/testHarness/index.ts new file mode 100644 index 0000000..eddac1e --- /dev/null +++ b/src/test/testHarness/index.ts @@ -0,0 +1 @@ +export * from "../testHarness"; diff --git a/src/utils/enterpriseVideoPolicy.test.ts b/src/utils/enterpriseVideoPolicy.test.ts new file mode 100644 index 0000000..31e34e9 --- /dev/null +++ b/src/utils/enterpriseVideoPolicy.test.ts @@ -0,0 +1,48 @@ +import { describe, expect, it } from "../test/testHarness"; + +import { + calculateEnterpriseVideoCredits, + getEnterpriseVideoCreditRate, + normalizeEnterpriseResolution, +} from "./enterpriseVideoPolicy"; + +describe("enterpriseVideoPolicy", () => { + it("keeps video billing at 1 CNY to 100 credits", () => { + expect( + calculateEnterpriseVideoCredits({ + model: "happyhorse-1.0", + resolution: "1080P", + durationSeconds: 5, + }), + ).toBe(640); + + expect( + calculateEnterpriseVideoCredits({ + model: "wan2.7-i2v", + resolution: "720P", + durationSeconds: 5, + }), + ).toBe(300); + }); + + it("rounds duration up to the next second before billing", () => { + expect( + calculateEnterpriseVideoCredits({ + model: "vidu-q3-turbo", + resolution: "1080P", + durationSeconds: 5.2, + }), + ).toBe(600); + }); + + it("normalizes unsupported resolutions to 1080P", () => { + expect(normalizeEnterpriseResolution("4K")).toBe("1080P"); + expect( + getEnterpriseVideoCreditRate({ + model: "pixverse-c1", + resolution: "4K", + durationSeconds: 5, + }), + ).toBe(1); + }); +}); diff --git a/src/utils/errorReporting.ts b/src/utils/errorReporting.ts index c637853..a1499c3 100644 --- a/src/utils/errorReporting.ts +++ b/src/utils/errorReporting.ts @@ -10,7 +10,7 @@ interface ErrorReport { sessionId?: string; } -let reportQueue: ErrorReport[] = []; +const reportQueue: ErrorReport[] = []; let flushTimer: ReturnType | null = null; function getSessionId(): string | undefined { diff --git a/src/utils/mentionTrigger.ts b/src/utils/mentionTrigger.ts index ca74b42..3a4d3f1 100644 --- a/src/utils/mentionTrigger.ts +++ b/src/utils/mentionTrigger.ts @@ -38,7 +38,7 @@ export function detectMentionTrigger(textBeforeCursor: string): MentionTriggerMa const query = textBeforeCursor.slice(atIdx + 1); // Query must not contain spaces or punctuation that would break a mention token - if (/[\s,。、;:!??!.,;:(){}\[\]<>""''《》【】@]/.test(query)) { + if (/[\s,。、;:!??!.,;:(){}[\]<>""''《》【】@]/.test(query)) { return null; } diff --git a/src/utils/taskLifecycle.test.ts b/src/utils/taskLifecycle.test.ts new file mode 100644 index 0000000..6189d79 --- /dev/null +++ b/src/utils/taskLifecycle.test.ts @@ -0,0 +1,59 @@ +import { describe, expect, it } from "../test/testHarness"; + +import { + TEXT_INPUT_CREDITS_PER_MILLION, + TEXT_OUTPUT_CREDITS_PER_MILLION, + estimateTextTokenCredits, + getTaskTimeoutPolicy, + isTaskLocallyTimedOut, +} from "./taskLifecycle"; + +describe("taskLifecycle", () => { + it("keeps text token billing at 1 CNY to 100 credits", () => { + expect(TEXT_INPUT_CREDITS_PER_MILLION).toBe(200); + expect(TEXT_OUTPUT_CREDITS_PER_MILLION).toBe(500); + expect( + estimateTextTokenCredits({ + promptTokens: 1_000_000, + completionTokens: 1_000_000, + }), + ).toBe(700); + }); + + it("ignores negative token counts when estimating text billing", () => { + expect( + estimateTextTokenCredits({ + promptTokens: -100, + completionTokens: 500_000, + }), + ).toBe(250); + }); + + it("marks unstarted tasks locally timed out after submit timeout", () => { + const policy = getTaskTimeoutPolicy({ kind: "image" }); + + expect( + isTaskLocallyTimedOut({ + startedAt: 1_000, + lastProgressAt: 1_000, + now: 1_000 + policy.submitTimeoutMs, + policy, + progress: 0, + }), + ).toBe("no_progress"); + }); + + it("marks running tasks locally timed out when progress stops", () => { + const policy = getTaskTimeoutPolicy({ kind: "video", model: "wan2.7-i2v" }); + + expect( + isTaskLocallyTimedOut({ + startedAt: 1_000, + lastProgressAt: 2_000, + now: 2_000 + policy.noProgressTimeoutMs, + policy, + progress: 40, + }), + ).toBe("no_progress"); + }); +});