From 0bce3afd657bd212d1f844617478c950936f6337 Mon Sep 17 00:00:00 2001 From: sHa Date: Thu, 15 May 2025 22:03:02 +0300 Subject: [PATCH] feat: simplify SVG source handling and improve preview layout; remove unused styles --- src/components/Preview.svelte | 104 +++++++++++----------------------- 1 file changed, 32 insertions(+), 72 deletions(-) diff --git a/src/components/Preview.svelte b/src/components/Preview.svelte index 1513912..a350180 100644 --- a/src/components/Preview.svelte +++ b/src/components/Preview.svelte @@ -21,13 +21,10 @@ // For SVG source code display let svgSource = ""; - let isFetchingSvgSource = false; - - // No event dispatching, parent is fully responsible for controlling the component function isSvgLogo(logo) { return logo && logo.format && logo.format.toLowerCase() === "svg"; - } // Function to copy SVG source from textarea + } function copySvgSourceFromTextarea() { if (svgSource) { try { @@ -35,7 +32,6 @@ return true; } catch (err) { console.error("Error copying from textarea:", err); - // Show content in prompt as fallback window.prompt("Copy the SVG source code:", svgSource); return false; } @@ -52,7 +48,6 @@ // Only fetch SVG source when displayed $: if (show && logo) { - // Fetch SVG source when logo is displayed and is an SVG if (logo.format === "SVG" && !svgSource) { isFetchingSvgSource = true; fetchSvgSource(logo.path) @@ -106,29 +101,23 @@
-