import editorContainerStyles from "./EditorContainer.module.css" ; export function isCurrentTargetByClassName ( targetElement , currentElement ) { let element = targetElement ; while ( element ) { if ( element === currentElement ) { return true ; } if ( element . classList . contains ( editorContainerStyles . editorContainer ) && ! element . classList . contains ( editorContainerStyles . isTemplateInternalNode ) ) { return false ; } element = element . parentElement ; } return false ; }