diff --git a/package-lock.json b/package-lock.json
index cafbfd7..8da97fc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,9 +7,11 @@
"": {
"name": "storyai-3d-director-desk-demo",
"version": "0.0.1",
+ "license": "MIT",
"dependencies": {
"@react-three/drei": "^9.122.0",
"@react-three/fiber": "^8.17.14",
+ "@sparkjsdev/spark": "^2.1.0",
"camera-controls": "^2.9.0",
"lucide-react": "^0.469.0",
"react": "^18.3.1",
@@ -1346,9 +1348,6 @@
"arm"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1363,9 +1362,6 @@
"arm"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1380,9 +1376,6 @@
"arm64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1397,9 +1390,6 @@
"arm64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1414,9 +1404,6 @@
"loong64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1431,9 +1418,6 @@
"loong64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1448,9 +1432,6 @@
"ppc64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1465,9 +1446,6 @@
"ppc64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1482,9 +1460,6 @@
"riscv64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1499,9 +1474,6 @@
"riscv64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1516,9 +1488,6 @@
"s390x"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1533,9 +1502,6 @@
"x64"
],
"dev": true,
- "libc": [
- "glibc"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1550,9 +1516,6 @@
"x64"
],
"dev": true,
- "libc": [
- "musl"
- ],
"license": "MIT",
"optional": true,
"os": [
@@ -1643,6 +1606,18 @@
"win32"
]
},
+ "node_modules/@sparkjsdev/spark": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmmirror.com/@sparkjsdev/spark/-/spark-2.1.0.tgz",
+ "integrity": "sha512-BRw+MuMzx0B3K8fDLQygt2OHEhYUV+41RX7btq9pZ3rCVrq42o57jW34VAIvC7JO/84DJh/1AutACV9ym6BfVg==",
+ "license": "MIT",
+ "dependencies": {
+ "fflate": "^0.8.2"
+ },
+ "peerDependencies": {
+ "three": ">=0.180.0"
+ }
+ },
"node_modules/@standard-schema/spec": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
diff --git a/package.json b/package.json
index 7dfbf9d..3c4b854 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"dependencies": {
"@react-three/drei": "^9.122.0",
"@react-three/fiber": "^8.17.14",
+ "@sparkjsdev/spark": "^2.1.0",
"camera-controls": "^2.9.0",
"lucide-react": "^0.469.0",
"react": "^18.3.1",
diff --git a/src/App.test.tsx b/src/App.test.tsx
index 2197792..76666b7 100644
--- a/src/App.test.tsx
+++ b/src/App.test.tsx
@@ -23,10 +23,40 @@ it("renders the director desk header and view mode switch", () => {
expect(screen.getByRole("button", { name: "导演视角" })).toBeInTheDocument();
expect(screen.getByRole("button", { name: "机位视角" })).toBeInTheDocument();
expect(container.querySelector(".top-bar-center .mode-toggle")).toBeInTheDocument();
- expect(screen.queryByLabelText("帮助")).not.toBeInTheDocument();
+ expect(screen.getByLabelText("帮助")).toBeInTheDocument();
expect(screen.getByLabelText("关闭")).toBeInTheDocument();
});
+it("opens the host-configured help page in a new tab", async () => {
+ const user = userEvent.setup();
+ const open = vi.spyOn(window, "open").mockImplementation(() => null);
+
+ render(