diff --git a/apps/studio/assets/ai-icon.riv b/apps/studio/assets/ai-icon.riv deleted file mode 100644 index fbea1ed558..0000000000 Binary files a/apps/studio/assets/ai-icon.riv and /dev/null differ diff --git a/apps/studio/electron.vite.config.ts b/apps/studio/electron.vite.config.ts index 0b9d6560e8..e922c2ea5f 100644 --- a/apps/studio/electron.vite.config.ts +++ b/apps/studio/electron.vite.config.ts @@ -82,14 +82,6 @@ export default defineConfig( { wasm(), viteStaticCopy( { targets: [ - { - src: normalizePath( require.resolve( '@rive-app/canvas/rive.wasm' ) ), - dest: 'assets', - }, - { - src: normalizePath( require.resolve( '@rive-app/canvas/rive_fallback.wasm' ) ), - dest: 'assets', - }, { src: normalizePath( resolve( __dirname, 'src/about-menu/about-menu.html' ) ), dest: '.', @@ -119,9 +111,9 @@ export default defineConfig( { devSourcemap: true, postcss: resolve( __dirname, 'postcss.config.js' ), }, - assetsInclude: [ '**/*.riv', '**/*.wasm' ], + assetsInclude: [ '**/*.wasm' ], optimizeDeps: { - include: [ '@wordpress/i18n', '@rive-app/react-canvas', '@rive-app/canvas' ], + include: [ '@wordpress/i18n' ], rolldownOptions: { output: { sourcemap: false, diff --git a/apps/studio/package.json b/apps/studio/package.json index b3d23d9b3c..b6c4d29024 100644 --- a/apps/studio/package.json +++ b/apps/studio/package.json @@ -69,7 +69,6 @@ "@electron-forge/plugin-auto-unpack-natives": "^7.11.2", "@inquirer/prompts": "^8.5.2", "@reduxjs/toolkit": "^2.12.0", - "@rive-app/react-canvas": "^4.18.0", "@sentry/react": "^10.56.0", "@sentry/vite-plugin": "^5.3.0", "@tanstack/react-query": "^5.75.5", diff --git a/apps/studio/src/components/icons/execute.tsx b/apps/studio/src/components/icons/execute.tsx deleted file mode 100644 index dbf783c742..0000000000 --- a/apps/studio/src/components/icons/execute.tsx +++ /dev/null @@ -1,8 +0,0 @@ -export const ExecuteIcon = () => ( - - - -); diff --git a/apps/studio/src/custom-package-definitions.d.ts b/apps/studio/src/custom-package-definitions.d.ts index 661e8a9fe2..394b2575c7 100644 --- a/apps/studio/src/custom-package-definitions.d.ts +++ b/apps/studio/src/custom-package-definitions.d.ts @@ -30,16 +30,6 @@ declare module '*.svg' { export default dataUri; } -declare module '*.riv' { - const dataUri: string; - export default dataUri; -} - -declare module '*.riv?url' { - const url: string; - export default url; -} - declare module '*.css'; declare module '*.css?url' { diff --git a/apps/studio/src/hooks/use-ai-icon.ts b/apps/studio/src/hooks/use-ai-icon.ts deleted file mode 100644 index 50d8b2b886..0000000000 --- a/apps/studio/src/hooks/use-ai-icon.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { RuntimeLoader } from '@rive-app/canvas'; -import { useRive, useStateMachineInput } from '@rive-app/react-canvas'; -import { useEffect } from '@wordpress/element'; -import aiImage from '../../assets/ai-icon.riv'; - -interface AiIconStates { - inactive?: boolean; - thinking?: boolean; - typing?: boolean; -} - -const useAiIcon = ( states: AiIconStates = {} ) => { - const stateMachineName = 'State Machine A'; - - // Configure Rive to use local WASM files - useEffect( () => { - RuntimeLoader.setWasmUrl( './assets/rive.wasm' ); - }, [] ); - - const { rive, RiveComponent } = useRive( { - src: aiImage, - stateMachines: stateMachineName, - autoplay: false, - } ); - - const inactiveInput = useStateMachineInput( rive, stateMachineName, 'inactive', false ); - const thinkingInput = useStateMachineInput( rive, stateMachineName, 'thinking', false ); - const typingInput = useStateMachineInput( rive, stateMachineName, 'typing', false ); - - useEffect( () => { - rive?.play( stateMachineName ); - - return () => { - rive?.cleanup(); - }; - }, [ rive ] ); - - useEffect( () => { - if ( inactiveInput ) { - // eslint-disable-next-line react-hooks/immutability - inactiveInput.value = states.inactive ?? false; - } - }, [ inactiveInput, states.inactive ] ); - - useEffect( () => { - if ( thinkingInput ) { - // eslint-disable-next-line react-hooks/immutability - thinkingInput.value = states.thinking ?? false; - } - }, [ thinkingInput, states.thinking ] ); - - useEffect( () => { - if ( typingInput ) { - // eslint-disable-next-line react-hooks/immutability - typingInput.value = states.typing ?? false; - } - }, [ typingInput, states.typing ] ); - - return { - rive, - RiveComponent, - }; -}; - -export default useAiIcon; diff --git a/apps/studio/vitest.setup.ts b/apps/studio/vitest.setup.ts index 74fd54aaa4..d9eeb3938e 100644 --- a/apps/studio/vitest.setup.ts +++ b/apps/studio/vitest.setup.ts @@ -114,15 +114,6 @@ vi.mock( 'src/hooks/use-offline', () => ( { useOffline: vi.fn().mockReturnValue( false ), } ) ); -vi.mock( 'src/hooks/use-ai-icon', () => ( { - __esModule: true, - default: () => ( { - rive: null, - RiveComponent: () => null, - setInputState: vi.fn(), - } ), -} ) ); - global.ResizeObserver = require( 'resize-observer-polyfill' ); vi.mock( '@sentry/electron/main', () => ( { diff --git a/package-lock.json b/package-lock.json index 0bdb1c5bea..3a6542112f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -553,7 +553,6 @@ "@electron-forge/plugin-auto-unpack-natives": "^7.11.2", "@inquirer/prompts": "^8.5.2", "@reduxjs/toolkit": "^2.12.0", - "@rive-app/react-canvas": "^4.18.0", "@sentry/react": "^10.56.0", "@sentry/vite-plugin": "^5.3.0", "@tanstack/react-query": "^5.75.5", @@ -4772,9 +4771,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4791,9 +4787,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -4810,9 +4803,6 @@ "cpu": [ "riscv64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4829,9 +4819,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -4848,9 +4835,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -11166,22 +11150,6 @@ } } }, - "node_modules/@rive-app/canvas": { - "version": "2.37.8", - "dev": true, - "license": "MIT" - }, - "node_modules/@rive-app/react-canvas": { - "version": "4.28.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@rive-app/canvas": "2.37.8" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0" - } - }, "node_modules/@roberts_lando/vfs": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@roberts_lando/vfs/-/vfs-0.3.3.tgz",