new interactive

This commit is contained in:
Biqoz
2025-09-15 19:05:59 +02:00
parent 130929b756
commit 050474e95b
16 changed files with 746 additions and 330 deletions

View File

@@ -5,7 +5,6 @@ import { useContextMenu } from "./hooks/useContextMenu";
import { useColorMapping } from "./hooks/useColorMapping";
import { TextDisplay } from "./TextDisplay";
import { ContextMenu } from "./ContextMenu";
import { InstructionsPanel } from "./InstructionsPanel";
interface InteractiveTextEditorProps {
text: string;
@@ -15,9 +14,11 @@ interface InteractiveTextEditorProps {
newLabel: string,
entityType: string,
applyToAllOccurrences?: boolean,
customColor?: string // Ajouter ce paramètre
customColor?: string,
wordStart?: number,
wordEnd?: number
) => void;
onRemoveMapping?: (originalValue: string) => void;
onRemoveMapping?: (originalValue: string, applyToAll?: boolean) => void;
}
export const InteractiveTextEditor: React.FC<InteractiveTextEditorProps> = ({
@@ -52,10 +53,10 @@ export const InteractiveTextEditor: React.FC<InteractiveTextEditorProps> = ({
(index: number, event: React.MouseEvent) => {
event.preventDefault();
event.stopPropagation();
// Support multi-sélection avec Ctrl, Cmd et Shift
const isMultiSelect = event.ctrlKey || event.metaKey || event.shiftKey;
if (isMultiSelect) {
setSelectedWords((prev) => {
const newSet = new Set(prev);
@@ -98,8 +99,6 @@ export const InteractiveTextEditor: React.FC<InteractiveTextEditorProps> = ({
return (
<div ref={containerRef} className="relative">
<InstructionsPanel />
<TextDisplay
words={words}
text={text}