diff --git a/src/Drawd.jsx b/src/Drawd.jsx index 05d1664..456bb41 100644 --- a/src/Drawd.jsx +++ b/src/Drawd.jsx @@ -28,8 +28,6 @@ import { ConditionalPrompt } from "./components/ConditionalPrompt"; import { InlineConditionLabels } from "./components/InlineConditionLabels"; import { ShortcutsPanel } from "./components/ShortcutsPanel"; import { ScreensPanel } from "./components/ScreensPanel"; -import { BatchHotspotBar } from "./components/BatchHotspotBar"; -import { BatchSelectionBar } from "./components/BatchSelectionBar"; import { SelectionOverlay } from "./components/SelectionOverlay"; import { ToolBar } from "./components/ToolBar"; import { StickyNote } from "./components/StickyNote"; @@ -53,7 +51,7 @@ export default function Drawd() { handleImageUpload, onFileChange, handlePaste, handleCanvasDrop, saveHotspot, deleteHotspot, deleteHotspots, moveHotspot, resizeHotspot, updateScreenDimensions, updateScreenDescription, updateScreenNotes, updateScreenTbd, updateScreenRoles, updateScreenCodeRef, updateScreenCriteria, assignScreenImage, quickConnectHotspot, - updateConnection, deleteConnection, pasteHotspots, + updateConnection, deleteConnection, addConnection, convertToConditionalGroup, addToConditionalGroup, saveConnectionGroup, deleteConnectionGroup, addState, updateStateName, addDocument, updateDocument, deleteDocument, replaceAll, mergeAll, @@ -238,7 +236,6 @@ export default function Drawd() { const { hotspotInteraction, setHotspotInteraction, selectedHotspots, setSelectedHotspots, - hotspotClipboard, cancelHotspotInteraction, onHotspotMouseDown, onImageAreaMouseDown, onResizeHandleMouseDown, onHotspotDragHandleMouseDown, @@ -390,21 +387,6 @@ export default function Drawd() { handleMultiDragStart(e, canvasSelection, screens, stickyNotes); }, [activeTool, captureDragSnapshot, handleMultiDragStart, canvasSelection, screens, stickyNotes]); - const onGroupSelection = useCallback(() => { - const selectedScreenIds = canvasSelection.filter((i) => i.type === "screen").map((i) => i.id); - if (selectedScreenIds.length === 0) return; - addScreenGroup("Group", selectedScreenIds); - clearSelection(); - }, [canvasSelection, addScreenGroup, clearSelection]); - - const onDeleteSelection = useCallback(() => { - const screenIds = canvasSelection.filter((i) => i.type === "screen").map((i) => i.id); - const stickyIds = canvasSelection.filter((i) => i.type === "sticky").map((i) => i.id); - if (screenIds.length > 0) removeScreens(screenIds); - stickyIds.forEach((id) => deleteStickyNote(id)); - clearSelection(); - }, [canvasSelection, removeScreens, deleteStickyNote, clearSelection]); - const addHotspot = useCallback((screenId) => { const screen = screens.find((s) => s.id === screenId); setHotspotModal({ screen, hotspot: null }); @@ -949,41 +931,6 @@ export default function Drawd() { )} {showShortcuts && setShowShortcuts(false)} />} - - {canvasSelection.length > 0 && ( - - )} - - {selectedHotspots.length > 0 && canvasSelection.length === 0 && ( - { - const screenId = selectedHotspots[0].screenId; - const screen = screens.find((s) => s.id === screenId); - if (!screen) return; - const ids = new Set(selectedHotspots.map((h) => h.hotspotId)); - hotspotClipboard.current = screen.hotspots.filter((h) => ids.has(h.id)); - }} - onPaste={() => { - if (!hotspotClipboard.current || !selectedScreen) return; - pasteHotspots(selectedScreen, hotspotClipboard.current); - setSelectedHotspots([]); - }} - onDelete={() => { - const screenId = selectedHotspots[0].screenId; - const ids = selectedHotspots.map((h) => h.hotspotId); - deleteHotspots(screenId, ids); - setSelectedHotspots([]); - }} - onCancel={() => setSelectedHotspots([])} - /> - )} ); } diff --git a/src/components/BatchHotspotBar.jsx b/src/components/BatchHotspotBar.jsx deleted file mode 100644 index 79cf2dd..0000000 --- a/src/components/BatchHotspotBar.jsx +++ /dev/null @@ -1,67 +0,0 @@ -import { COLORS, FONTS, Z_INDEX } from "../styles/theme"; - -const barBtn = { - padding: "6px 14px", - border: "none", - borderRadius: 6, - fontSize: 12, - fontWeight: 600, - cursor: "pointer", - fontFamily: FONTS.mono, -}; - -export function BatchHotspotBar({ count, hasClipboard, onCopy, onPaste, onDelete, onCancel }) { - return ( -
- - {count} selected - - - - - {hasClipboard && ( - - )} - - - - -
- ); -} diff --git a/src/components/BatchSelectionBar.jsx b/src/components/BatchSelectionBar.jsx deleted file mode 100644 index 6909797..0000000 --- a/src/components/BatchSelectionBar.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import { COLORS, FONTS, Z_INDEX } from "../styles/theme"; - -const barBtn = { - padding: "6px 14px", - border: "none", - borderRadius: 6, - fontSize: 12, - fontWeight: 600, - cursor: "pointer", - fontFamily: FONTS.mono, -}; - -export function BatchSelectionBar({ count, onDelete, onGroup, onCancel }) { - return ( -
- - {count} selected - - - - - - - -
- ); -} diff --git a/src/hooks/useHotspotInteraction.js b/src/hooks/useHotspotInteraction.js index db00e49..d38fb66 100644 --- a/src/hooks/useHotspotInteraction.js +++ b/src/hooks/useHotspotInteraction.js @@ -1,4 +1,4 @@ -import { useState, useRef, useCallback } from "react"; +import { useState, useCallback } from "react"; export function useHotspotInteraction({ screens, @@ -17,7 +17,6 @@ export function useHotspotInteraction({ }) { const [hotspotInteraction, setHotspotInteraction] = useState(null); const [selectedHotspots, setSelectedHotspots] = useState([]); - const hotspotClipboard = useRef(null); const cancelHotspotInteraction = useCallback(() => { setHotspotInteraction(null); @@ -143,7 +142,6 @@ export function useHotspotInteraction({ return { hotspotInteraction, setHotspotInteraction, selectedHotspots, setSelectedHotspots, - hotspotClipboard, cancelHotspotInteraction, onHotspotMouseDown, onImageAreaMouseDown,