reactjs-tiptap-editor
Version:
A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React
2 lines (1 loc) • 455 B
JavaScript
;const s=require("./index-Cs6cp0Y6.cjs"),a=require("./clsx-CXbNJWDD.cjs");function l(o,t){const e={getBoundingClientRect:()=>a.posToDOMRect(o.view,o.state.selection.from,o.state.selection.to)};s.computePosition(e,t,{placement:"bottom-start",strategy:"absolute",middleware:[s.shift(),s.flip()]}).then(({x:i,y:n,strategy:c})=>{t.style.width="max-content",t.style.position=c,t.style.left=`${i}px`,t.style.top=`${n}px`})}exports.updatePosition=l;