From 3b7bd80605b1931ca090882c2229a4708fcc2c08 Mon Sep 17 00:00:00 2001 From: Olaf Sulich Date: Wed, 15 Jan 2025 14:40:12 +0100 Subject: [PATCH] refactor(PastePlugin): rename selection type from RangeSelection to Selection for clarity and consistency in handling editor selections --- .../RichTextEditor/plugins/PastePlugin/PastePlugin.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/script/components/InputBar/components/RichTextEditor/plugins/PastePlugin/PastePlugin.tsx b/src/script/components/InputBar/components/RichTextEditor/plugins/PastePlugin/PastePlugin.tsx index 5608af48c0c..db124036b5f 100644 --- a/src/script/components/InputBar/components/RichTextEditor/plugins/PastePlugin/PastePlugin.tsx +++ b/src/script/components/InputBar/components/RichTextEditor/plugins/PastePlugin/PastePlugin.tsx @@ -40,7 +40,7 @@ interface PastePluginProps { getMentionCandidates: () => User[]; } -type RangeSelection = BaseSelection | null; +type Selection = BaseSelection | null; /** * PastePlugin handles pasting content into the editor while preserving formatting and special nodes. @@ -90,7 +90,7 @@ export const PastePlugin = ({getMentionCandidates}: PastePluginProps): JSX.Eleme * @returns boolean - True if mentions were handled successfully */ const handleLexicalMentions = useCallback( - (doc: Document, selection: RangeSelection | null, availableUsers: User[]): boolean => { + (doc: Document, selection: Selection, availableUsers: User[]): boolean => { if (!selection) { return false; } @@ -135,7 +135,7 @@ export const PastePlugin = ({getMentionCandidates}: PastePluginProps): JSX.Eleme * @returns boolean - True if formatted content was handled successfully */ const handleFormattedContent = useCallback( - (doc: Document, selection: RangeSelection | null): boolean => { + (doc: Document, selection: Selection): boolean => { if (!selection) { return false; } @@ -180,7 +180,7 @@ export const PastePlugin = ({getMentionCandidates}: PastePluginProps): JSX.Eleme * @param availableUsers - List of users that can be mentioned in current context */ const processMentions = useCallback( - (selection: RangeSelection | null, mentions: NodeListOf, availableUsers: User[]) => { + (selection: Selection, mentions: NodeListOf, availableUsers: User[]) => { if (!selection) { return; }