From 12adbb2476f98429b06cb8956ba3e61509f8edfc Mon Sep 17 00:00:00 2001 From: Timon Schelling Date: Tue, 30 Sep 2025 16:49:04 +0000 Subject: [PATCH] extract icons to separate js file on desktop --- frontend/package.json | 10 +- frontend/src/components/views/Graph.svelte | 2 +- .../widgets/buttons/IconButton.svelte | 2 +- .../widgets/buttons/PopoverButton.svelte | 3 +- .../widgets/buttons/TextButton.svelte | 3 +- .../widgets/inputs/CheckboxInput.svelte | 2 +- .../widgets/labels/IconLabel.svelte | 2 +- .../widgets/labels/UserInputLabel.svelte | 3 +- frontend/src/{utility-functions => }/icons.ts | 0 frontend/src/messages.ts | 3 +- frontend/src/state-providers/dialog.ts | 2 +- frontend/vite.config.ts | 149 ++++++++++++++---- package.json | 6 +- 13 files changed, 137 insertions(+), 50 deletions(-) rename frontend/src/{utility-functions => }/icons.ts (100%) diff --git a/frontend/package.json b/frontend/package.json index 6c65a88fea..c69addbc2c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,16 +13,18 @@ "---------- BUILDS ----------": "", "build": "npm run wasm:build-production && vite build", "build-dev": "npm run wasm:build-dev && vite build", - "build-native": "npm run native:build-production && vite build", - "build-native-dev": "npm run native:build-dev && vite build", "build-profiling": "npm run wasm:build-profiling && vite build", + "build-desktop": "npm run desktop:build-production && vite build --mode desktop && vite build --mode icons", + "build-desktop-placeholder-icons": "npm run desktop:build-production && vite build --mode desktop && vite build --mode icons-placeholder", + "build-desktop-icons": "vite build --mode icons", + "build-desktop-dev": "npm run desktop:build-dev && vite build", "---------- UTILITIES ----------": "", "lint": "eslint . && tsc --noEmit", "lint-fix": "eslint . --fix && tsc --noEmit", "---------- INTERNAL ----------": "", "setup": "node package-installer.js", - "native:build-dev": "wasm-pack build ./wasm --dev --target=web --features native", - "native:build-production": "wasm-pack build ./wasm --release --target=web --features native", + "desktop:build-dev": "wasm-pack build ./wasm --dev --target=web --features native", + "desktop:build-production": "wasm-pack build ./wasm --release --target=web --features native", "wasm:build-dev": "wasm-pack build ./wasm --dev --target=web", "wasm:build-profiling": "wasm-pack build ./wasm --profiling --target=web", "wasm:build-production": "wasm-pack build ./wasm --release --target=web", diff --git a/frontend/src/components/views/Graph.svelte b/frontend/src/components/views/Graph.svelte index 7ac2d4f162..ca36b0c2ce 100644 --- a/frontend/src/components/views/Graph.svelte +++ b/frontend/src/components/views/Graph.svelte @@ -4,9 +4,9 @@ import { fade } from "svelte/transition"; import type { Editor } from "@graphite/editor"; + import type { IconName } from "@graphite/icons"; import type { FrontendGraphInput, FrontendGraphOutput } from "@graphite/messages"; import type { NodeGraphState } from "@graphite/state-providers/node-graph"; - import type { IconName } from "@graphite/utility-functions/icons"; import NodeCatalog from "@graphite/components/floating-menus/NodeCatalog.svelte"; import LayoutCol from "@graphite/components/layout/LayoutCol.svelte"; diff --git a/frontend/src/components/widgets/buttons/IconButton.svelte b/frontend/src/components/widgets/buttons/IconButton.svelte index 97fbc2c8c9..81ab288a2e 100644 --- a/frontend/src/components/widgets/buttons/IconButton.svelte +++ b/frontend/src/components/widgets/buttons/IconButton.svelte @@ -1,5 +1,5 @@