Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 1 addition & 54 deletions src/Drawd.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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,
Expand Down Expand Up @@ -238,7 +236,6 @@ export default function Drawd() {
const {
hotspotInteraction, setHotspotInteraction,
selectedHotspots, setSelectedHotspots,
hotspotClipboard,
cancelHotspotInteraction,
onHotspotMouseDown, onImageAreaMouseDown,
onResizeHandleMouseDown, onHotspotDragHandleMouseDown,
Expand Down Expand Up @@ -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 });
Expand Down Expand Up @@ -949,41 +931,6 @@ export default function Drawd() {
)}

{showShortcuts && <ShortcutsPanel onClose={() => setShowShortcuts(false)} />}

{canvasSelection.length > 0 && (
<BatchSelectionBar
count={canvasSelection.length}
onDelete={onDeleteSelection}
onGroup={onGroupSelection}
onCancel={clearSelection}
/>
)}

{selectedHotspots.length > 0 && canvasSelection.length === 0 && (
<BatchHotspotBar
count={selectedHotspots.length}
hasClipboard={!!hotspotClipboard.current}
onCopy={() => {
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([])}
/>
)}
</div>
);
}
67 changes: 0 additions & 67 deletions src/components/BatchHotspotBar.jsx

This file was deleted.

58 changes: 0 additions & 58 deletions src/components/BatchSelectionBar.jsx

This file was deleted.

4 changes: 1 addition & 3 deletions src/hooks/useHotspotInteraction.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useRef, useCallback } from "react";
import { useState, useCallback } from "react";

export function useHotspotInteraction({
screens,
Expand All @@ -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);
Expand Down Expand Up @@ -143,7 +142,6 @@ export function useHotspotInteraction({
return {
hotspotInteraction, setHotspotInteraction,
selectedHotspots, setSelectedHotspots,
hotspotClipboard,
cancelHotspotInteraction,
onHotspotMouseDown,
onImageAreaMouseDown,
Expand Down
Loading