Skip to content

Commit

Permalink
refactor(PastePlugin): rename selection type from RangeSelection to S…
Browse files Browse the repository at this point in the history
…election for clarity and consistency in handling editor selections
  • Loading branch information
olafsulich committed Jan 15, 2025
1 parent 8aae236 commit 3b7bd80
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<Element>, availableUsers: User[]) => {
(selection: Selection, mentions: NodeListOf<Element>, availableUsers: User[]) => {
if (!selection) {
return;
}
Expand Down

0 comments on commit 3b7bd80

Please sign in to comment.