ajout du bouton suppression
This commit is contained in:
BIN
.next/dev/cache/turbopack/23c46498/CURRENT
vendored
BIN
.next/dev/cache/turbopack/23c46498/CURRENT
vendored
Binary file not shown.
6
.next/dev/cache/turbopack/23c46498/LOG
vendored
6
.next/dev/cache/turbopack/23c46498/LOG
vendored
@@ -5828,3 +5828,9 @@ FAM | META SEQ | SST SEQ | RANGE
|
|||||||
2 | 00013383 | 00013377 SST | [================================================================================] | 20ff59e1772d8bcf-ef311d8b965c9633 (0 MiB, fresh)
|
2 | 00013383 | 00013377 SST | [================================================================================] | 20ff59e1772d8bcf-ef311d8b965c9633 (0 MiB, fresh)
|
||||||
4 | 00013384 | 00013380 SST | O | 20ff59e1772d8bcf-20ff59e1772d8bcf (0 MiB, fresh)
|
4 | 00013384 | 00013380 SST | O | 20ff59e1772d8bcf-20ff59e1772d8bcf (0 MiB, fresh)
|
||||||
3 | 00013385 | 00013379 SST | O | 7d92be8ee8c5a114-7d92be8ee8c5a114 (0 MiB, fresh)
|
3 | 00013385 | 00013379 SST | O | 7d92be8ee8c5a114-7d92be8ee8c5a114 (0 MiB, fresh)
|
||||||
|
Time 2026-03-05T09:11:40.4842923Z
|
||||||
|
Commit 00013505 4 keys in 7ms 949µs 500ns
|
||||||
|
FAM | META SEQ | SST SEQ | RANGE
|
||||||
|
0 | 00013503 | 00013502 SST | [=======================================================================] | 3aefa6fd5cf2deb4-f42f94001fcb5351 (0 MiB, fresh)
|
||||||
|
1 | 00013504 | 00013500 SST | O | 3ffdfb3b7d50fcf1-3ffdfb3b7d50fcf1 (0 MiB, fresh)
|
||||||
|
2 | 00013505 | 00013501 SST | O | 3ffdfb3b7d50fcf1-3ffdfb3b7d50fcf1 (0 MiB, fresh)
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ interface StoryNodeProps {
|
|||||||
onSetEditing: (id: string | null) => void;
|
onSetEditing: (id: string | null) => void;
|
||||||
onToggleColorPicker: (id: string) => void;
|
onToggleColorPicker: (id: string) => void;
|
||||||
onSaveColor: (color: string) => void;
|
onSaveColor: (color: string) => void;
|
||||||
|
onDelete: (id: string, e: React.MouseEvent) => void;
|
||||||
onNavigateToEntity: (id: string) => void;
|
onNavigateToEntity: (id: string) => void;
|
||||||
|
|
||||||
onInputFocus: (e: React.FocusEvent) => void;
|
onInputFocus: (e: React.FocusEvent) => void;
|
||||||
@@ -90,7 +91,7 @@ interface StoryNodeProps {
|
|||||||
const StoryNode = React.memo(({
|
const StoryNode = React.memo(({
|
||||||
node, isSelected, isEditing, isDragging, activeColorPickerId, entities, savedColors,
|
node, isSelected, isEditing, isDragging, activeColorPickerId, entities, savedColors,
|
||||||
onMouseDown, onMouseUp, onStartConnection, onUpdate, onSetEditing,
|
onMouseDown, onMouseUp, onStartConnection, onUpdate, onSetEditing,
|
||||||
onToggleColorPicker, onSaveColor, onNavigateToEntity,
|
onToggleColorPicker, onSaveColor, onDelete, onNavigateToEntity,
|
||||||
onInputFocus, onInputCheckAutocomplete, onKeyDownInInput
|
onInputFocus, onInputCheckAutocomplete, onKeyDownInInput
|
||||||
}: StoryNodeProps) => {
|
}: StoryNodeProps) => {
|
||||||
const { t } = useLanguage();
|
const { t } = useLanguage();
|
||||||
@@ -199,6 +200,16 @@ const StoryNode = React.memo(({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="absolute bottom-2 left-2 z-20">
|
||||||
|
<button
|
||||||
|
className="p-1.5 rounded-full bg-white/70 hover:bg-red-50 hover:text-red-500 shadow-sm border border-slate-100 hover:border-red-200 transition-all opacity-0 group-hover:opacity-100 text-slate-400"
|
||||||
|
onClick={(e) => onDelete(node.id, e)}
|
||||||
|
title={t('sw.delete')}
|
||||||
|
>
|
||||||
|
<Trash2 size={14} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="absolute bottom-2 right-2 z-20">
|
<div className="absolute bottom-2 right-2 z-20">
|
||||||
{showTypePicker && (
|
{showTypePicker && (
|
||||||
<div className="absolute bottom-full mb-2 right-0 bg-white shadow-xl border border-slate-200 rounded-lg p-1 flex gap-1 animate-in zoom-in-95 duration-100 w-max" onMouseDown={(e) => e.stopPropagation()}>
|
<div className="absolute bottom-full mb-2 right-0 bg-white shadow-xl border border-slate-200 rounded-lg p-1 flex gap-1 animate-in zoom-in-95 duration-100 w-max" onMouseDown={(e) => e.stopPropagation()}>
|
||||||
@@ -590,6 +601,19 @@ const StoryWorkflow: React.FC<StoryWorkflowProps> = ({ data, onUpdate, entities,
|
|||||||
setSelectedNodeIds(new Set());
|
setSelectedNodeIds(new Set());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleDeleteNode = (id: string, e: React.MouseEvent) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
pushHistory();
|
||||||
|
const newNodes = internalNodes.filter(n => n.id !== id);
|
||||||
|
const newConnections = data.connections.filter(c => c.source !== id && c.target !== id);
|
||||||
|
onUpdate({ nodes: newNodes, connections: newConnections });
|
||||||
|
setSelectedNodeIds(prev => {
|
||||||
|
const next = new Set(prev);
|
||||||
|
next.delete(id);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const handleAddNodeCenter = () => {
|
const handleAddNodeCenter = () => {
|
||||||
pushHistory();
|
pushHistory();
|
||||||
const scrollLeft = containerRef.current?.scrollLeft || 0;
|
const scrollLeft = containerRef.current?.scrollLeft || 0;
|
||||||
@@ -689,6 +713,7 @@ const StoryWorkflow: React.FC<StoryWorkflowProps> = ({ data, onUpdate, entities,
|
|||||||
onSetEditing={setEditingNodeId}
|
onSetEditing={setEditingNodeId}
|
||||||
onToggleColorPicker={handleToggleColorPicker}
|
onToggleColorPicker={handleToggleColorPicker}
|
||||||
onSaveColor={handleSaveColor}
|
onSaveColor={handleSaveColor}
|
||||||
|
onDelete={handleDeleteNode}
|
||||||
onNavigateToEntity={onNavigateToEntity}
|
onNavigateToEntity={onNavigateToEntity}
|
||||||
onInputFocus={handleInputFocus}
|
onInputFocus={handleInputFocus}
|
||||||
onInputCheckAutocomplete={handleInputWithAutocomplete}
|
onInputCheckAutocomplete={handleInputWithAutocomplete}
|
||||||
|
|||||||
Reference in New Issue
Block a user