import Inline from "../components/inline" ; import getSelection from "./get-selection" ; import deleteSelection from "../operator/delete-selection" ; import input from "../operator/input" ; import Editor from "../editor" ; const insertInline = ( editor , component ) => { let selection = getSelection ( editor ) ; if ( ! selection . isCollapsed ) { deleteSelection ( editor , selection . range [ 0 ] , selection . range [ 1 ] ) ; selection = getSelection ( editor ) ; } input ( editor , component , selection . range [ 0 ] ) ; } ; export default insertInline ;