import type { EditorView } from '@milkdown/prose' ; import type { InputMap } from '../item' ; export const filterInput = ( currentView , inputMap , div , input , button ) => { const target = Object . values ( inputMap ) . find ( ( input ) => input . display ( currentView ) ) ; if ( ! target ) { div . classList . add ( 'hide' ) ; return ; } div . classList . remove ( 'hide' ) ; if ( target . bind ) { button . classList . add ( 'hide' ) ; } else { button . classList . remove ( 'hide' ) ; button . textContent = target . buttonText ; } input . placeholder = target . placeholder ; target . update ( currentView , div ) ; return target ; } ;