import{E as u,P as y,D as m,a as f}from"./tiptap-extension-underline.esm-1c1a172c.js";const C=u.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new y({props:{decorations:({doc:t,selection:l})=>{const c=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=l,i=[];if(!c)return null;const o=t.type.createAndFill(),d=(o==null?void 0:o.sameMarkup(t))&&o.content.findDiffStart(t.content)===null;return t.descendants((e,s)=>{const r=n>=s&&n<=s+e.nodeSize,h=!e.isLeaf&&!e.childCount;if((r||!this.options.showOnlyCurrent)&&h){const a=[this.options.emptyNodeClass];d&&a.push(this.options.emptyEditorClass);const p=m.node(s,s+e.nodeSize,{class:a.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:e,pos:s,hasAnchor:r}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),f.create(t,i)}}})]}});export{C as P}; //# sourceMappingURL=tiptap-extension-placeholder.esm-052ff1b1.js.map