1
Some checks failed
build / Build (push) Failing after 14s
test / Run tests (push) Failing after 14s
Some checks failed
build / Build (push) Failing after 14s
test / Run tests (push) Failing after 14s
This commit is contained in:
parent
c8a8d136c8
commit
98c86d61f1
21
package.json
21
package.json
@ -46,16 +46,6 @@
|
|||||||
"@rspack/cli": "^1.2.3",
|
"@rspack/cli": "^1.2.3",
|
||||||
"@rspack/core": "^1.2.3",
|
"@rspack/core": "^1.2.3",
|
||||||
"@rspack/plugin-react-refresh": "^1.0.1",
|
"@rspack/plugin-react-refresh": "^1.0.1",
|
||||||
"cross-env": "^7.0.3",
|
|
||||||
"eslint": "^9.19.0",
|
|
||||||
"eslint-plugin-react": "^7.37.4",
|
|
||||||
"eslint-plugin-react-hooks": "^5.1.0",
|
|
||||||
"globals": "^15.14.0",
|
|
||||||
"prettier": "^3.4.2",
|
|
||||||
"react-refresh": "^0.16.0",
|
|
||||||
"ts-node": "^10.9.2",
|
|
||||||
"typescript": "^5.7.3",
|
|
||||||
"typescript-eslint": "^8.22.0",
|
|
||||||
"@types/chrome": "^0.0.279",
|
"@types/chrome": "^0.0.279",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/node": "^22.10.2",
|
"@types/node": "^22.10.2",
|
||||||
@ -67,9 +57,20 @@
|
|||||||
"@unocss/postcss": "0.65.0-beta.2",
|
"@unocss/postcss": "0.65.0-beta.2",
|
||||||
"@vitest/coverage-v8": "2.1.4",
|
"@vitest/coverage-v8": "2.1.4",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
|
"compression-webpack-plugin": "^11.1.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"eslint": "^9.19.0",
|
||||||
|
"eslint-plugin-react": "^7.37.4",
|
||||||
|
"eslint-plugin-react-hooks": "^5.1.0",
|
||||||
|
"globals": "^15.14.0",
|
||||||
"jsdom": "^25.0.1",
|
"jsdom": "^25.0.1",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
"postcss-loader": "^8.1.1",
|
"postcss-loader": "^8.1.1",
|
||||||
|
"prettier": "^3.4.2",
|
||||||
|
"react-refresh": "^0.16.0",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "^5.7.3",
|
||||||
|
"typescript-eslint": "^8.22.0",
|
||||||
"unocss": "0.65.0-beta.2",
|
"unocss": "0.65.0-beta.2",
|
||||||
"vitest": "^2.1.4"
|
"vitest": "^2.1.4"
|
||||||
}
|
}
|
||||||
|
111
pnpm-lock.yaml
generated
111
pnpm-lock.yaml
generated
@ -126,6 +126,9 @@ importers:
|
|||||||
autoprefixer:
|
autoprefixer:
|
||||||
specifier: ^10.4.20
|
specifier: ^10.4.20
|
||||||
version: 10.4.20(postcss@8.4.49)
|
version: 10.4.20(postcss@8.4.49)
|
||||||
|
compression-webpack-plugin:
|
||||||
|
specifier: ^11.1.0
|
||||||
|
version: 11.1.0(webpack@5.96.1(esbuild@0.23.1))
|
||||||
cross-env:
|
cross-env:
|
||||||
specifier: ^7.0.3
|
specifier: ^7.0.3
|
||||||
version: 7.0.3
|
version: 7.0.3
|
||||||
@ -920,55 +923,46 @@ packages:
|
|||||||
resolution: {integrity: sha512-10ICosOwYChROdQoQo589N5idQIisxjaFE/PAnX2i0Zr84mY0k9zul1ArH0rnJ/fpgiqfu13TFZR5A5YJLOYZA==}
|
resolution: {integrity: sha512-10ICosOwYChROdQoQo589N5idQIisxjaFE/PAnX2i0Zr84mY0k9zul1ArH0rnJ/fpgiqfu13TFZR5A5YJLOYZA==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm-musleabihf@4.24.4':
|
'@rollup/rollup-linux-arm-musleabihf@4.24.4':
|
||||||
resolution: {integrity: sha512-ySAfWs69LYC7QhRDZNKqNhz2UKN8LDfbKSMAEtoEI0jitwfAG2iZwVqGACJT+kfYvvz3/JgsLlcBP+WWoKCLcw==}
|
resolution: {integrity: sha512-ySAfWs69LYC7QhRDZNKqNhz2UKN8LDfbKSMAEtoEI0jitwfAG2iZwVqGACJT+kfYvvz3/JgsLlcBP+WWoKCLcw==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-gnu@4.24.4':
|
'@rollup/rollup-linux-arm64-gnu@4.24.4':
|
||||||
resolution: {integrity: sha512-uHYJ0HNOI6pGEeZ/5mgm5arNVTI0nLlmrbdph+pGXpC9tFHFDQmDMOEqkmUObRfosJqpU8RliYoGz06qSdtcjg==}
|
resolution: {integrity: sha512-uHYJ0HNOI6pGEeZ/5mgm5arNVTI0nLlmrbdph+pGXpC9tFHFDQmDMOEqkmUObRfosJqpU8RliYoGz06qSdtcjg==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-musl@4.24.4':
|
'@rollup/rollup-linux-arm64-musl@4.24.4':
|
||||||
resolution: {integrity: sha512-38yiWLemQf7aLHDgTg85fh3hW9stJ0Muk7+s6tIkSUOMmi4Xbv5pH/5Bofnsb6spIwD5FJiR+jg71f0CH5OzoA==}
|
resolution: {integrity: sha512-38yiWLemQf7aLHDgTg85fh3hW9stJ0Muk7+s6tIkSUOMmi4Xbv5pH/5Bofnsb6spIwD5FJiR+jg71f0CH5OzoA==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-powerpc64le-gnu@4.24.4':
|
'@rollup/rollup-linux-powerpc64le-gnu@4.24.4':
|
||||||
resolution: {integrity: sha512-q73XUPnkwt9ZNF2xRS4fvneSuaHw2BXuV5rI4cw0fWYVIWIBeDZX7c7FWhFQPNTnE24172K30I+dViWRVD9TwA==}
|
resolution: {integrity: sha512-q73XUPnkwt9ZNF2xRS4fvneSuaHw2BXuV5rI4cw0fWYVIWIBeDZX7c7FWhFQPNTnE24172K30I+dViWRVD9TwA==}
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-gnu@4.24.4':
|
'@rollup/rollup-linux-riscv64-gnu@4.24.4':
|
||||||
resolution: {integrity: sha512-Aie/TbmQi6UXokJqDZdmTJuZBCU3QBDA8oTKRGtd4ABi/nHgXICulfg1KI6n9/koDsiDbvHAiQO3YAUNa/7BCw==}
|
resolution: {integrity: sha512-Aie/TbmQi6UXokJqDZdmTJuZBCU3QBDA8oTKRGtd4ABi/nHgXICulfg1KI6n9/koDsiDbvHAiQO3YAUNa/7BCw==}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-s390x-gnu@4.24.4':
|
'@rollup/rollup-linux-s390x-gnu@4.24.4':
|
||||||
resolution: {integrity: sha512-P8MPErVO/y8ohWSP9JY7lLQ8+YMHfTI4bAdtCi3pC2hTeqFJco2jYspzOzTUB8hwUWIIu1xwOrJE11nP+0JFAQ==}
|
resolution: {integrity: sha512-P8MPErVO/y8ohWSP9JY7lLQ8+YMHfTI4bAdtCi3pC2hTeqFJco2jYspzOzTUB8hwUWIIu1xwOrJE11nP+0JFAQ==}
|
||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-gnu@4.24.4':
|
'@rollup/rollup-linux-x64-gnu@4.24.4':
|
||||||
resolution: {integrity: sha512-K03TljaaoPK5FOyNMZAAEmhlyO49LaE4qCsr0lYHUKyb6QacTNF9pnfPpXnFlFD3TXuFbFbz7tJ51FujUXkXYA==}
|
resolution: {integrity: sha512-K03TljaaoPK5FOyNMZAAEmhlyO49LaE4qCsr0lYHUKyb6QacTNF9pnfPpXnFlFD3TXuFbFbz7tJ51FujUXkXYA==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-musl@4.24.4':
|
'@rollup/rollup-linux-x64-musl@4.24.4':
|
||||||
resolution: {integrity: sha512-VJYl4xSl/wqG2D5xTYncVWW+26ICV4wubwN9Gs5NrqhJtayikwCXzPL8GDsLnaLU3WwhQ8W02IinYSFJfyo34Q==}
|
resolution: {integrity: sha512-VJYl4xSl/wqG2D5xTYncVWW+26ICV4wubwN9Gs5NrqhJtayikwCXzPL8GDsLnaLU3WwhQ8W02IinYSFJfyo34Q==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rollup/rollup-win32-arm64-msvc@4.24.4':
|
'@rollup/rollup-win32-arm64-msvc@4.24.4':
|
||||||
resolution: {integrity: sha512-ku2GvtPwQfCqoPFIJCqZ8o7bJcj+Y54cZSr43hHca6jLwAiCbZdBUOrqE6y29QFajNAzzpIOwsckaTFmN6/8TA==}
|
resolution: {integrity: sha512-ku2GvtPwQfCqoPFIJCqZ8o7bJcj+Y54cZSr43hHca6jLwAiCbZdBUOrqE6y29QFajNAzzpIOwsckaTFmN6/8TA==}
|
||||||
@ -1033,7 +1027,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-K2u/fPUmKujlKSWL3q2zaUu8/6ZK/bOGKcqJSib8jdanQQ/GFKwKtPAFOOa/vvqbzhDocqKOobFR10FhgJqCHg==}
|
resolution: {integrity: sha512-K2u/fPUmKujlKSWL3q2zaUu8/6ZK/bOGKcqJSib8jdanQQ/GFKwKtPAFOOa/vvqbzhDocqKOobFR10FhgJqCHg==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rspack/binding-linux-arm64-musl@1.0.14':
|
'@rspack/binding-linux-arm64-musl@1.0.14':
|
||||||
resolution: {integrity: sha512-qgybhxI/nnoa8CUz7zKTC0Oh37NZt9uRxsSV7+ZYrfxqbrVCoNVuutPpY724uUHy1M6W34kVEm1uT1N4Ka5cZg==}
|
resolution: {integrity: sha512-qgybhxI/nnoa8CUz7zKTC0Oh37NZt9uRxsSV7+ZYrfxqbrVCoNVuutPpY724uUHy1M6W34kVEm1uT1N4Ka5cZg==}
|
||||||
@ -1045,7 +1038,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-mgovdzGb6cH9hQsjTyzDbfZWCPhTcoHcLro1P7UbiqcLPMDJp/k3Io9xV2/EJhaDA1aynIdq7XfY0fuk4+6Irw==}
|
resolution: {integrity: sha512-mgovdzGb6cH9hQsjTyzDbfZWCPhTcoHcLro1P7UbiqcLPMDJp/k3Io9xV2/EJhaDA1aynIdq7XfY0fuk4+6Irw==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rspack/binding-linux-x64-gnu@1.0.14':
|
'@rspack/binding-linux-x64-gnu@1.0.14':
|
||||||
resolution: {integrity: sha512-5vzaDRw3/sGKo3ax/1cU3/cxqNjajwlt2LU288vXNe1/n8oe/pcDfYcTugpOe/A1DqzadanudJszLpFcKsaFtQ==}
|
resolution: {integrity: sha512-5vzaDRw3/sGKo3ax/1cU3/cxqNjajwlt2LU288vXNe1/n8oe/pcDfYcTugpOe/A1DqzadanudJszLpFcKsaFtQ==}
|
||||||
@ -1057,7 +1049,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-542lwJzB1RMGuVdBdA3cOWTlmL9okpOppHUBWcNCjmJM+9zTI+0jwjVe8HaqOqtuR8XzNsoCwT9QonU/GLcuhg==}
|
resolution: {integrity: sha512-542lwJzB1RMGuVdBdA3cOWTlmL9okpOppHUBWcNCjmJM+9zTI+0jwjVe8HaqOqtuR8XzNsoCwT9QonU/GLcuhg==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [glibc]
|
|
||||||
|
|
||||||
'@rspack/binding-linux-x64-musl@1.0.14':
|
'@rspack/binding-linux-x64-musl@1.0.14':
|
||||||
resolution: {integrity: sha512-4U6QD9xVS1eGme52DuJr6Fg/KdcUfJ+iKwH49Up460dZ/fLvGylnVGA+V0mzPlKi8gfy7NwFuYXZdu3Pwi1YYg==}
|
resolution: {integrity: sha512-4U6QD9xVS1eGme52DuJr6Fg/KdcUfJ+iKwH49Up460dZ/fLvGylnVGA+V0mzPlKi8gfy7NwFuYXZdu3Pwi1YYg==}
|
||||||
@ -1069,7 +1060,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-dJromiREDcTWqzfCOI5y1IVoYmUnCv7vCp63AEq0+13fJJdk7+pcNN3VV2jOKpk9VECSvjg1c01wl+UzXAXFMw==}
|
resolution: {integrity: sha512-dJromiREDcTWqzfCOI5y1IVoYmUnCv7vCp63AEq0+13fJJdk7+pcNN3VV2jOKpk9VECSvjg1c01wl+UzXAXFMw==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
libc: [musl]
|
|
||||||
|
|
||||||
'@rspack/binding-win32-arm64-msvc@1.0.14':
|
'@rspack/binding-win32-arm64-msvc@1.0.14':
|
||||||
resolution: {integrity: sha512-SjeYw7qqRHYZ5RPClu+ffKZsShQdU3amA1OwC3M0AS6dbfEcji8482St3Y8Z+QSzYRapCEZij9LMM/9ypEhISg==}
|
resolution: {integrity: sha512-SjeYw7qqRHYZ5RPClu+ffKZsShQdU3amA1OwC3M0AS6dbfEcji8482St3Y8Z+QSzYRapCEZij9LMM/9ypEhISg==}
|
||||||
@ -1902,6 +1892,12 @@ packages:
|
|||||||
resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==}
|
resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==}
|
||||||
engines: {node: '>= 0.6'}
|
engines: {node: '>= 0.6'}
|
||||||
|
|
||||||
|
compression-webpack-plugin@11.1.0:
|
||||||
|
resolution: {integrity: sha512-zDOQYp10+upzLxW+VRSjEpRRwBXJdsb5lBMlRxx1g8hckIFBpe3DTI0en2w7h+beuq89576RVzfiXrkdPGrHhA==}
|
||||||
|
engines: {node: '>= 18.12.0'}
|
||||||
|
peerDependencies:
|
||||||
|
webpack: ^5.1.0
|
||||||
|
|
||||||
compression@1.7.4:
|
compression@1.7.4:
|
||||||
resolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==}
|
resolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==}
|
||||||
engines: {node: '>= 0.8.0'}
|
engines: {node: '>= 0.8.0'}
|
||||||
@ -4886,7 +4882,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@jridgewell/gen-mapping': 0.3.5
|
'@jridgewell/gen-mapping': 0.3.5
|
||||||
'@jridgewell/trace-mapping': 0.3.25
|
'@jridgewell/trace-mapping': 0.3.25
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@jridgewell/sourcemap-codec@1.5.0': {}
|
'@jridgewell/sourcemap-codec@1.5.0': {}
|
||||||
|
|
||||||
@ -5292,13 +5287,11 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@types/eslint': 9.6.1
|
'@types/eslint': 9.6.1
|
||||||
'@types/estree': 1.0.6
|
'@types/estree': 1.0.6
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@types/eslint@9.6.1':
|
'@types/eslint@9.6.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/estree': 1.0.6
|
'@types/estree': 1.0.6
|
||||||
'@types/json-schema': 7.0.15
|
'@types/json-schema': 7.0.15
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@types/estree@1.0.6': {}
|
'@types/estree@1.0.6': {}
|
||||||
|
|
||||||
@ -5855,26 +5848,20 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@webassemblyjs/helper-numbers': 1.13.2
|
'@webassemblyjs/helper-numbers': 1.13.2
|
||||||
'@webassemblyjs/helper-wasm-bytecode': 1.13.2
|
'@webassemblyjs/helper-wasm-bytecode': 1.13.2
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/floating-point-hex-parser@1.13.2':
|
'@webassemblyjs/floating-point-hex-parser@1.13.2': {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/helper-api-error@1.13.2':
|
'@webassemblyjs/helper-api-error@1.13.2': {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/helper-buffer@1.14.1':
|
'@webassemblyjs/helper-buffer@1.14.1': {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/helper-numbers@1.13.2':
|
'@webassemblyjs/helper-numbers@1.13.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@webassemblyjs/floating-point-hex-parser': 1.13.2
|
'@webassemblyjs/floating-point-hex-parser': 1.13.2
|
||||||
'@webassemblyjs/helper-api-error': 1.13.2
|
'@webassemblyjs/helper-api-error': 1.13.2
|
||||||
'@xtuc/long': 4.2.2
|
'@xtuc/long': 4.2.2
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/helper-wasm-bytecode@1.13.2':
|
'@webassemblyjs/helper-wasm-bytecode@1.13.2': {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/helper-wasm-section@1.14.1':
|
'@webassemblyjs/helper-wasm-section@1.14.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -5882,20 +5869,16 @@ snapshots:
|
|||||||
'@webassemblyjs/helper-buffer': 1.14.1
|
'@webassemblyjs/helper-buffer': 1.14.1
|
||||||
'@webassemblyjs/helper-wasm-bytecode': 1.13.2
|
'@webassemblyjs/helper-wasm-bytecode': 1.13.2
|
||||||
'@webassemblyjs/wasm-gen': 1.14.1
|
'@webassemblyjs/wasm-gen': 1.14.1
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/ieee754@1.13.2':
|
'@webassemblyjs/ieee754@1.13.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@xtuc/ieee754': 1.2.0
|
'@xtuc/ieee754': 1.2.0
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/leb128@1.13.2':
|
'@webassemblyjs/leb128@1.13.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@xtuc/long': 4.2.2
|
'@xtuc/long': 4.2.2
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/utf8@1.13.2':
|
'@webassemblyjs/utf8@1.13.2': {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/wasm-edit@1.14.1':
|
'@webassemblyjs/wasm-edit@1.14.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -5907,7 +5890,6 @@ snapshots:
|
|||||||
'@webassemblyjs/wasm-opt': 1.14.1
|
'@webassemblyjs/wasm-opt': 1.14.1
|
||||||
'@webassemblyjs/wasm-parser': 1.14.1
|
'@webassemblyjs/wasm-parser': 1.14.1
|
||||||
'@webassemblyjs/wast-printer': 1.14.1
|
'@webassemblyjs/wast-printer': 1.14.1
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/wasm-gen@1.14.1':
|
'@webassemblyjs/wasm-gen@1.14.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -5916,7 +5898,6 @@ snapshots:
|
|||||||
'@webassemblyjs/ieee754': 1.13.2
|
'@webassemblyjs/ieee754': 1.13.2
|
||||||
'@webassemblyjs/leb128': 1.13.2
|
'@webassemblyjs/leb128': 1.13.2
|
||||||
'@webassemblyjs/utf8': 1.13.2
|
'@webassemblyjs/utf8': 1.13.2
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/wasm-opt@1.14.1':
|
'@webassemblyjs/wasm-opt@1.14.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -5924,7 +5905,6 @@ snapshots:
|
|||||||
'@webassemblyjs/helper-buffer': 1.14.1
|
'@webassemblyjs/helper-buffer': 1.14.1
|
||||||
'@webassemblyjs/wasm-gen': 1.14.1
|
'@webassemblyjs/wasm-gen': 1.14.1
|
||||||
'@webassemblyjs/wasm-parser': 1.14.1
|
'@webassemblyjs/wasm-parser': 1.14.1
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/wasm-parser@1.14.1':
|
'@webassemblyjs/wasm-parser@1.14.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -5934,19 +5914,15 @@ snapshots:
|
|||||||
'@webassemblyjs/ieee754': 1.13.2
|
'@webassemblyjs/ieee754': 1.13.2
|
||||||
'@webassemblyjs/leb128': 1.13.2
|
'@webassemblyjs/leb128': 1.13.2
|
||||||
'@webassemblyjs/utf8': 1.13.2
|
'@webassemblyjs/utf8': 1.13.2
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@webassemblyjs/wast-printer@1.14.1':
|
'@webassemblyjs/wast-printer@1.14.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@webassemblyjs/ast': 1.14.1
|
'@webassemblyjs/ast': 1.14.1
|
||||||
'@xtuc/long': 4.2.2
|
'@xtuc/long': 4.2.2
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@xtuc/ieee754@1.2.0':
|
'@xtuc/ieee754@1.2.0': {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
'@xtuc/long@4.2.2':
|
'@xtuc/long@4.2.2': {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
accepts@1.3.8:
|
accepts@1.3.8:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -5982,7 +5958,6 @@ snapshots:
|
|||||||
ajv-keywords@3.5.2(ajv@6.12.6):
|
ajv-keywords@3.5.2(ajv@6.12.6):
|
||||||
dependencies:
|
dependencies:
|
||||||
ajv: 6.12.6
|
ajv: 6.12.6
|
||||||
optional: true
|
|
||||||
|
|
||||||
ajv-keywords@5.1.0(ajv@8.17.1):
|
ajv-keywords@5.1.0(ajv@8.17.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -6174,8 +6149,7 @@ snapshots:
|
|||||||
node-releases: 2.0.18
|
node-releases: 2.0.18
|
||||||
update-browserslist-db: 1.1.1(browserslist@4.24.2)
|
update-browserslist-db: 1.1.1(browserslist@4.24.2)
|
||||||
|
|
||||||
buffer-from@1.1.2:
|
buffer-from@1.1.2: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
bundle-name@4.1.0:
|
bundle-name@4.1.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -6248,8 +6222,7 @@ snapshots:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
chrome-trace-event@1.0.4:
|
chrome-trace-event@1.0.4: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
cliui@8.0.1:
|
cliui@8.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -6287,8 +6260,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
delayed-stream: 1.0.0
|
delayed-stream: 1.0.0
|
||||||
|
|
||||||
commander@2.20.3:
|
commander@2.20.3: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
commander@7.2.0: {}
|
commander@7.2.0: {}
|
||||||
|
|
||||||
@ -6296,6 +6268,12 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
mime-db: 1.53.0
|
mime-db: 1.53.0
|
||||||
|
|
||||||
|
compression-webpack-plugin@11.1.0(webpack@5.96.1(esbuild@0.23.1)):
|
||||||
|
dependencies:
|
||||||
|
schema-utils: 4.2.0
|
||||||
|
serialize-javascript: 6.0.2
|
||||||
|
webpack: 5.96.1(esbuild@0.23.1)
|
||||||
|
|
||||||
compression@1.7.4:
|
compression@1.7.4:
|
||||||
dependencies:
|
dependencies:
|
||||||
accepts: 1.3.8
|
accepts: 1.3.8
|
||||||
@ -6524,7 +6502,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
tapable: 2.2.1
|
tapable: 2.2.1
|
||||||
optional: true
|
|
||||||
|
|
||||||
entities@4.5.0: {}
|
entities@4.5.0: {}
|
||||||
|
|
||||||
@ -6685,8 +6662,7 @@ snapshots:
|
|||||||
iterator.prototype: 1.1.5
|
iterator.prototype: 1.1.5
|
||||||
safe-array-concat: 1.1.3
|
safe-array-concat: 1.1.3
|
||||||
|
|
||||||
es-module-lexer@1.5.4:
|
es-module-lexer@1.5.4: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
es-object-atoms@1.0.0:
|
es-object-atoms@1.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -6836,7 +6812,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
esrecurse: 4.3.0
|
esrecurse: 4.3.0
|
||||||
estraverse: 4.3.0
|
estraverse: 4.3.0
|
||||||
optional: true
|
|
||||||
|
|
||||||
eslint-scope@8.1.0:
|
eslint-scope@8.1.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -6955,8 +6930,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
estraverse: 5.3.0
|
estraverse: 5.3.0
|
||||||
|
|
||||||
estraverse@4.3.0:
|
estraverse@4.3.0: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
estraverse@5.3.0: {}
|
estraverse@5.3.0: {}
|
||||||
|
|
||||||
@ -6974,8 +6948,7 @@ snapshots:
|
|||||||
|
|
||||||
eventemitter3@5.0.1: {}
|
eventemitter3@5.0.1: {}
|
||||||
|
|
||||||
events@3.3.0:
|
events@3.3.0: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
execa@5.1.1:
|
execa@5.1.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -7195,8 +7168,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
|
|
||||||
glob-to-regexp@0.4.1:
|
glob-to-regexp@0.4.1: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
glob@10.4.5:
|
glob@10.4.5:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -7637,7 +7609,6 @@ snapshots:
|
|||||||
'@types/node': 22.10.2
|
'@types/node': 22.10.2
|
||||||
merge-stream: 2.0.0
|
merge-stream: 2.0.0
|
||||||
supports-color: 8.1.1
|
supports-color: 8.1.1
|
||||||
optional: true
|
|
||||||
|
|
||||||
jiti@1.21.6: {}
|
jiti@1.21.6: {}
|
||||||
|
|
||||||
@ -7714,8 +7685,7 @@ snapshots:
|
|||||||
|
|
||||||
load-tsconfig@0.2.5: {}
|
load-tsconfig@0.2.5: {}
|
||||||
|
|
||||||
loader-runner@4.3.0:
|
loader-runner@4.3.0: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
local-pkg@0.5.1:
|
local-pkg@0.5.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -7834,8 +7804,7 @@ snapshots:
|
|||||||
|
|
||||||
negotiator@0.6.3: {}
|
negotiator@0.6.3: {}
|
||||||
|
|
||||||
neo-async@2.6.2:
|
neo-async@2.6.2: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
node-fetch-native@1.6.4: {}
|
node-fetch-native@1.6.4: {}
|
||||||
|
|
||||||
@ -8074,7 +8043,6 @@ snapshots:
|
|||||||
randombytes@2.1.0:
|
randombytes@2.1.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer: 5.2.1
|
safe-buffer: 5.2.1
|
||||||
optional: true
|
|
||||||
|
|
||||||
range-parser@1.2.1: {}
|
range-parser@1.2.1: {}
|
||||||
|
|
||||||
@ -8384,7 +8352,6 @@ snapshots:
|
|||||||
'@types/json-schema': 7.0.15
|
'@types/json-schema': 7.0.15
|
||||||
ajv: 6.12.6
|
ajv: 6.12.6
|
||||||
ajv-keywords: 3.5.2(ajv@6.12.6)
|
ajv-keywords: 3.5.2(ajv@6.12.6)
|
||||||
optional: true
|
|
||||||
|
|
||||||
schema-utils@4.2.0:
|
schema-utils@4.2.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -8433,7 +8400,6 @@ snapshots:
|
|||||||
serialize-javascript@6.0.2:
|
serialize-javascript@6.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
randombytes: 2.1.0
|
randombytes: 2.1.0
|
||||||
optional: true
|
|
||||||
|
|
||||||
serve-index@1.9.1:
|
serve-index@1.9.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -8563,10 +8529,8 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
buffer-from: 1.1.2
|
buffer-from: 1.1.2
|
||||||
source-map: 0.6.1
|
source-map: 0.6.1
|
||||||
optional: true
|
|
||||||
|
|
||||||
source-map@0.6.1:
|
source-map@0.6.1: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
spdy-transport@3.0.0:
|
spdy-transport@3.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -8710,14 +8674,12 @@ snapshots:
|
|||||||
supports-color@8.1.1:
|
supports-color@8.1.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
has-flag: 4.0.0
|
has-flag: 4.0.0
|
||||||
optional: true
|
|
||||||
|
|
||||||
supports-preserve-symlinks-flag@1.0.0: {}
|
supports-preserve-symlinks-flag@1.0.0: {}
|
||||||
|
|
||||||
symbol-tree@3.2.4: {}
|
symbol-tree@3.2.4: {}
|
||||||
|
|
||||||
tapable@2.2.1:
|
tapable@2.2.1: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
terser-webpack-plugin@5.3.10(esbuild@0.23.1)(webpack@5.96.1(esbuild@0.23.1)):
|
terser-webpack-plugin@5.3.10(esbuild@0.23.1)(webpack@5.96.1(esbuild@0.23.1)):
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -8729,7 +8691,6 @@ snapshots:
|
|||||||
webpack: 5.96.1(esbuild@0.23.1)
|
webpack: 5.96.1(esbuild@0.23.1)
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
esbuild: 0.23.1
|
esbuild: 0.23.1
|
||||||
optional: true
|
|
||||||
|
|
||||||
terser@5.36.0:
|
terser@5.36.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -8737,7 +8698,6 @@ snapshots:
|
|||||||
acorn: 8.14.0
|
acorn: 8.14.0
|
||||||
commander: 2.20.3
|
commander: 2.20.3
|
||||||
source-map-support: 0.5.21
|
source-map-support: 0.5.21
|
||||||
optional: true
|
|
||||||
|
|
||||||
test-exclude@7.0.1:
|
test-exclude@7.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -9215,7 +9175,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
glob-to-regexp: 0.4.1
|
glob-to-regexp: 0.4.1
|
||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
optional: true
|
|
||||||
|
|
||||||
wbuf@1.7.3:
|
wbuf@1.7.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -9336,8 +9295,7 @@ snapshots:
|
|||||||
- supports-color
|
- supports-color
|
||||||
- utf-8-validate
|
- utf-8-validate
|
||||||
|
|
||||||
webpack-sources@3.2.3:
|
webpack-sources@3.2.3: {}
|
||||||
optional: true
|
|
||||||
|
|
||||||
webpack-virtual-modules@0.6.2:
|
webpack-virtual-modules@0.6.2:
|
||||||
optional: true
|
optional: true
|
||||||
@ -9371,7 +9329,6 @@ snapshots:
|
|||||||
- '@swc/core'
|
- '@swc/core'
|
||||||
- esbuild
|
- esbuild
|
||||||
- uglify-js
|
- uglify-js
|
||||||
optional: true
|
|
||||||
|
|
||||||
websocket-driver@0.7.4:
|
websocket-driver@0.7.4:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -2,10 +2,13 @@ import * as path from "path";
|
|||||||
import { defineConfig } from "@rspack/cli";
|
import { defineConfig } from "@rspack/cli";
|
||||||
import { rspack } from "@rspack/core";
|
import { rspack } from "@rspack/core";
|
||||||
import { version } from "./package.json";
|
import { version } from "./package.json";
|
||||||
|
import CompressionPlugin from "compression-webpack-plugin";
|
||||||
|
|
||||||
const isDev = process.env.NODE_ENV === "development";
|
const isDev = process.env.NODE_ENV === "development";
|
||||||
const isBeta = version.includes("-");
|
const isBeta = version.includes("-");
|
||||||
|
|
||||||
|
console.log(CompressionPlugin);
|
||||||
|
|
||||||
// Target browsers, see: https://github.com/browserslist/browserslist
|
// Target browsers, see: https://github.com/browserslist/browserslist
|
||||||
const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
|
const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
|
||||||
|
|
||||||
@ -29,6 +32,8 @@ export default defineConfig({
|
|||||||
popup: `${src}/pages/popup/main.tsx`,
|
popup: `${src}/pages/popup/main.tsx`,
|
||||||
install: `${src}/pages/install/main.tsx`,
|
install: `${src}/pages/install/main.tsx`,
|
||||||
options: `${src}/pages/options/main.tsx`,
|
options: `${src}/pages/options/main.tsx`,
|
||||||
|
"editor.worker": "monaco-editor/esm/vs/editor/editor.worker.js",
|
||||||
|
"ts.worker": "monaco-editor/esm/vs/language/typescript/ts.worker.js",
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: `${dist}/ext/src`,
|
path: `${dist}/ext/src`,
|
||||||
@ -168,6 +173,11 @@ export default defineConfig({
|
|||||||
minify: true,
|
minify: true,
|
||||||
chunks: ["sandbox"],
|
chunks: ["sandbox"],
|
||||||
}),
|
}),
|
||||||
|
new CompressionPlugin({
|
||||||
|
test: /ts.worker.js$/,
|
||||||
|
filename: () => "ts.worker.js",
|
||||||
|
deleteOriginalAssets: true,
|
||||||
|
}),
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
optimization: {
|
optimization: {
|
||||||
minimizer: [
|
minimizer: [
|
||||||
|
@ -2,7 +2,7 @@ import Cache from "@App/app/cache";
|
|||||||
import { LinterWorker } from "@App/pkg/utils/monaco-editor";
|
import { LinterWorker } from "@App/pkg/utils/monaco-editor";
|
||||||
import { useAppSelector } from "@App/pages/store/hooks";
|
import { useAppSelector } from "@App/pages/store/hooks";
|
||||||
import { editor, Range } from "monaco-editor";
|
import { editor, Range } from "monaco-editor";
|
||||||
import React, { useEffect, useImperativeHandle, useState } from "react";
|
import React, { useEffect, useImperativeHandle, useRef, useState } from "react";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -18,20 +18,19 @@ const CodeEditor: React.ForwardRefRenderFunction<{ editor: editor.ICodeEditor |
|
|||||||
) => {
|
) => {
|
||||||
const settings = useAppSelector((state) => state.setting);
|
const settings = useAppSelector((state) => state.setting);
|
||||||
const [monacoEditor, setEditor] = useState<editor.ICodeEditor>();
|
const [monacoEditor, setEditor] = useState<editor.ICodeEditor>();
|
||||||
|
const div = useRef<HTMLDivElement>(null);
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
editor: monacoEditor,
|
editor: monacoEditor,
|
||||||
}));
|
}));
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (diffCode === undefined || code === undefined) {
|
if (diffCode === undefined || code === undefined || !div.current) {
|
||||||
return () => {};
|
return () => {};
|
||||||
}
|
}
|
||||||
let edit: editor.IStandaloneDiffEditor | editor.IStandaloneCodeEditor;
|
let edit: editor.IStandaloneDiffEditor | editor.IStandaloneCodeEditor;
|
||||||
|
const inlineDiv = document.getElementById(id) as HTMLDivElement;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const ts = window.tsUrl ? 0 : 200;
|
|
||||||
setTimeout(() => {
|
|
||||||
const div = document.getElementById(id) as HTMLDivElement;
|
|
||||||
if (diffCode) {
|
if (diffCode) {
|
||||||
edit = editor.createDiffEditor(div, {
|
edit = editor.createDiffEditor(inlineDiv, {
|
||||||
enableSplitViewResizing: false,
|
enableSplitViewResizing: false,
|
||||||
renderSideBySide: false,
|
renderSideBySide: false,
|
||||||
folding: true,
|
folding: true,
|
||||||
@ -48,7 +47,7 @@ const CodeEditor: React.ForwardRefRenderFunction<{ editor: editor.ICodeEditor |
|
|||||||
modified: editor.createModel(code, "javascript"),
|
modified: editor.createModel(code, "javascript"),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
edit = editor.create(div, {
|
edit = editor.create(inlineDiv, {
|
||||||
language: "javascript",
|
language: "javascript",
|
||||||
theme: document.body.getAttribute("arco-theme") === "dark" ? "vs-dark" : "vs",
|
theme: document.body.getAttribute("arco-theme") === "dark" ? "vs-dark" : "vs",
|
||||||
folding: true,
|
folding: true,
|
||||||
@ -63,15 +62,15 @@ const CodeEditor: React.ForwardRefRenderFunction<{ editor: editor.ICodeEditor |
|
|||||||
|
|
||||||
setEditor(edit);
|
setEditor(edit);
|
||||||
}
|
}
|
||||||
}, ts);
|
|
||||||
return () => {
|
return () => {
|
||||||
if (edit) {
|
if (edit) {
|
||||||
edit.dispose();
|
edit.dispose();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [code, diffCode, editable, id]);
|
}, [div, code, diffCode, editable, id]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
return () => {};
|
||||||
if (!settings.eslint.enable) {
|
if (!settings.eslint.enable) {
|
||||||
return () => {};
|
return () => {};
|
||||||
}
|
}
|
||||||
@ -218,6 +217,7 @@ const CodeEditor: React.ForwardRefRenderFunction<{ editor: editor.ICodeEditor |
|
|||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
className={className}
|
className={className}
|
||||||
|
ref={div}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -12,9 +12,11 @@ import migrate from "@App/app/migrate.ts";
|
|||||||
import LoggerCore from "@App/app/logger/core.ts";
|
import LoggerCore from "@App/app/logger/core.ts";
|
||||||
import { LoggerDAO } from "@App/app/repo/logger.ts";
|
import { LoggerDAO } from "@App/app/repo/logger.ts";
|
||||||
import DBWriter from "@App/app/logger/db_writer.ts";
|
import DBWriter from "@App/app/logger/db_writer.ts";
|
||||||
|
import registerEditor from "@App/pkg/utils/monaco-editor.ts";
|
||||||
|
|
||||||
// 初始化数据库
|
// 初始化数据库
|
||||||
migrate();
|
migrate();
|
||||||
|
registerEditor();
|
||||||
// 初始化日志组件
|
// 初始化日志组件
|
||||||
const loggerCore = new LoggerCore({
|
const loggerCore = new LoggerCore({
|
||||||
writer: new DBWriter(new LoggerDAO()),
|
writer: new DBWriter(new LoggerDAO()),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Script, ScriptCodeDAO, ScriptDAO } from "@App/app/repo/scripts";
|
import { Script, ScriptAndCode, ScriptCodeDAO, ScriptDAO } from "@App/app/repo/scripts";
|
||||||
import CodeEditor from "@App/pages/components/CodeEditor";
|
import CodeEditor from "@App/pages/components/CodeEditor";
|
||||||
import React, { useEffect, useRef, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
||||||
@ -30,7 +30,7 @@ type HotKey = {
|
|||||||
|
|
||||||
const Editor: React.FC<{
|
const Editor: React.FC<{
|
||||||
id: string;
|
id: string;
|
||||||
script: Script;
|
script: ScriptAndCode;
|
||||||
hotKeys: HotKey[];
|
hotKeys: HotKey[];
|
||||||
callbackEditor: (e: editor.IStandaloneCodeEditor) => void;
|
callbackEditor: (e: editor.IStandaloneCodeEditor) => void;
|
||||||
onChange: (code: string) => void;
|
onChange: (code: string) => void;
|
||||||
@ -41,11 +41,9 @@ const Editor: React.FC<{
|
|||||||
ScriptMap.set(script.uuid, script);
|
ScriptMap.set(script.uuid, script);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!codeEditor.current || !codeEditor.current.editor) {
|
if (!codeEditor.current || !codeEditor.current.editor) {
|
||||||
setTimeout(() => {
|
|
||||||
setInit(true);
|
|
||||||
}, 200);
|
|
||||||
return () => {};
|
return () => {};
|
||||||
}
|
}
|
||||||
|
console.log(codeEditor);
|
||||||
// 初始化editor时将Script的uuid绑定到editor上
|
// 初始化editor时将Script的uuid绑定到editor上
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (!codeEditor.current.editor.uuid) {
|
if (!codeEditor.current.editor.uuid) {
|
||||||
@ -72,7 +70,7 @@ const Editor: React.FC<{
|
|||||||
});
|
});
|
||||||
callbackEditor(codeEditor.current.editor);
|
callbackEditor(codeEditor.current.editor);
|
||||||
return () => {};
|
return () => {};
|
||||||
}, [init]);
|
}, []);
|
||||||
|
|
||||||
return <CodeEditor id={id} ref={codeEditor} code={script.code} diffCode="" editable />;
|
return <CodeEditor id={id} ref={codeEditor} code={script.code} diffCode="" editable />;
|
||||||
};
|
};
|
||||||
@ -150,8 +148,7 @@ function ScriptEditor() {
|
|||||||
const [visible, setVisible] = useState<{ [key: string]: boolean }>({});
|
const [visible, setVisible] = useState<{ [key: string]: boolean }>({});
|
||||||
const [editors, setEditors] = useState<
|
const [editors, setEditors] = useState<
|
||||||
{
|
{
|
||||||
script: Script;
|
script: ScriptAndCode;
|
||||||
code: string;
|
|
||||||
active: boolean;
|
active: boolean;
|
||||||
hotKeys: HotKey[];
|
hotKeys: HotKey[];
|
||||||
editor?: editor.IStandaloneCodeEditor;
|
editor?: editor.IStandaloneCodeEditor;
|
||||||
@ -378,7 +375,6 @@ function ScriptEditor() {
|
|||||||
return prev.map((item) => {
|
return prev.map((item) => {
|
||||||
if (item.script.uuid === scripts[i].uuid) {
|
if (item.script.uuid === scripts[i].uuid) {
|
||||||
item.active = true;
|
item.active = true;
|
||||||
item.code = code!.code;
|
|
||||||
} else {
|
} else {
|
||||||
item.active = false;
|
item.active = false;
|
||||||
}
|
}
|
||||||
@ -386,8 +382,7 @@ function ScriptEditor() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
prev.push({
|
prev.push({
|
||||||
script: scripts[i],
|
script: Object.assign(scripts[i], code),
|
||||||
code: code!.code,
|
|
||||||
active: true,
|
active: true,
|
||||||
hotKeys,
|
hotKeys,
|
||||||
isChanged: false,
|
isChanged: false,
|
||||||
@ -870,7 +865,7 @@ function ScriptEditor() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
onChange={(code) => {
|
onChange={(code) => {
|
||||||
const isChanged = !(item.code === code);
|
const isChanged = !(item.script.code === code);
|
||||||
if (isChanged !== item.isChanged) {
|
if (isChanged !== item.isChanged) {
|
||||||
setEditors((prev) => {
|
setEditors((prev) => {
|
||||||
prev.forEach((v) => {
|
prev.forEach((v) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user