From 0142b31a38b1217ee103a6d24c502edb87ea3810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Fri, 21 Nov 2025 15:08:43 +0100 Subject: [PATCH] fix: remove deprecated text-dialog component causing build errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The text-dialog modal approach was replaced by the on-canvas text editor. This file referenced old TextStore properties (isDialogOpen, clickPosition) that no longer exist, causing TypeScript compilation errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- components/modals/text-dialog.tsx | 288 ------------------------------ 1 file changed, 288 deletions(-) delete mode 100644 components/modals/text-dialog.tsx diff --git a/components/modals/text-dialog.tsx b/components/modals/text-dialog.tsx deleted file mode 100644 index 5c1d3c5..0000000 --- a/components/modals/text-dialog.tsx +++ /dev/null @@ -1,288 +0,0 @@ -'use client'; - -import { useState, useEffect } from 'react'; -import { X, Type } from 'lucide-react'; -import { useTextStore } from '@/store/text-store'; -import { TextTool } from '@/tools/text-tool'; -import { WEB_SAFE_FONTS, GOOGLE_FONTS, loadGoogleFont } from '@/lib/text-utils'; -import type { FontStyle, FontWeight, TextAlign } from '@/types/text'; - -export function TextDialog() { - const { - settings, - isDialogOpen, - clickPosition, - setText, - setFontFamily, - setFontSize, - setFontStyle, - setFontWeight, - setColor, - setAlign, - setLineHeight, - setLetterSpacing, - closeDialog, - } = useTextStore(); - - const [text, setTextLocal] = useState(settings.text); - const [isLoadingFont, setIsLoadingFont] = useState(false); - - useEffect(() => { - if (isDialogOpen) { - setTextLocal(settings.text); - } - }, [isDialogOpen, settings.text]); - - if (!isDialogOpen || !clickPosition) return null; - - const handleInsert = async () => { - if (!text.trim()) { - closeDialog(); - return; - } - - // Update text in store - setText(text); - - // Load Google Font if needed - if (GOOGLE_FONTS.includes(settings.fontFamily as any)) { - try { - setIsLoadingFont(true); - await loadGoogleFont(settings.fontFamily); - } catch (error) { - console.error('Failed to load font:', error); - } finally { - setIsLoadingFont(false); - } - } - - // Render text on canvas - TextTool.renderTextOnCanvas(clickPosition.x, clickPosition.y); - - // Close dialog - closeDialog(); - setTextLocal(''); - }; - - const handleCancel = () => { - closeDialog(); - setTextLocal(''); - }; - - const allFonts = [...WEB_SAFE_FONTS, ...GOOGLE_FONTS]; - - return ( -
-
e.stopPropagation()} - > - {/* Header */} -
-
- -

Add Text

-
- -
- - {/* Content */} -
- {/* Text Input */} -
- -