var a=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(a==null||a.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var t=a.modules["@tiptap/core"];if(t==null)throw new Error('leptos-tiptap bridge module "@tiptap/core" is unavailable');var O=t.CommandManager,N=t.Editor,m=t.Extension,B=t.InputRule,v=t.Mark,D=t.Node,I=t.NodePos,F=t.NodeView,M=t.PasteRule,j=t.Tracker,L=t.callOrReturn,K=t.canInsertNode,G=t.combineTransactionSteps,q=t.createChainableState,H=t.createDocument,z=t.createNodeFromContent,J=t.createStyleTag,V=t.defaultBlockAt,W=t.deleteProps,U=t.elementFromString,Y=t.escapeForRegEx,Q=t.extensions,X=t.findChildren,Z=t.findChildrenInRange,$=t.findDuplicates,tt=t.findParentNode,et=t.findParentNodeClosestToPos,nt=t.fromString,ot=t.generateHTML,it=t.generateJSON,rt=t.generateText,st=t.getAttributes,lt=t.getAttributesFromExtensions,at=t.getChangedRanges,pt=t.getDebugJSON,dt=t.getExtensionField,ct=t.getHTMLFromFragment,ut=t.getMarkAttributes,gt=t.getMarkRange,_t=t.getMarkType,xt=t.getMarksBetween,mt=t.getNodeAtPosition,kt=t.getNodeAttributes,bt=t.getNodeType,yt=t.getRenderedAttributes,ht=t.getSchema,Et=t.getSchemaByResolvedExtensions,Pt=t.getSchemaTypeByName,ft=t.getSchemaTypeNameByName,St=t.getSplittedAttributes,Rt=t.getText,Ct=t.getTextBetween,Tt=t.getTextContentFromNodes,At=t.getTextSerializersFromSchema,wt=t.injectExtensionAttributesToParseRule,Ot=t.inputRulesPlugin,Nt=t.isActive,Bt=t.isAtEndOfNode,vt=t.isAtStartOfNode,Dt=t.isEmptyObject,It=t.isExtensionRulesEnabled,Ft=t.isFunction,Mt=t.isList,jt=t.isMacOS,Lt=t.isMarkActive,Kt=t.isNodeActive,k=t.isNodeEmpty,Gt=t.isNodeSelection,qt=t.isNumber,Ht=t.isPlainObject,zt=t.isRegExp,Jt=t.isSafari,Vt=t.isString,Wt=t.isTextSelection,Ut=t.isiOS,Yt=t.markInputRule,Qt=t.markPasteRule,Xt=t.mergeAttributes,Zt=t.mergeDeep,$t=t.minMax,te=t.nodeInputRule,ee=t.nodePasteRule,ne=t.objectIncludes,oe=t.pasteRulesPlugin,ie=t.posToDOMRect,re=t.removeDuplicates,se=t.resolveFocusPosition,le=t.rewriteUnknownContent,ae=t.selectionToInsertionEnd,pe=t.splitExtensions,de=t.textInputRule,ce=t.textPasteRule,ue=t.textblockTypeInputRule,ge=t.wrappingInputRule;var p=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(p==null||p.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var n=p.modules["@tiptap/pm/state"];if(n==null)throw new Error('leptos-tiptap bridge module "@tiptap/pm/state" is unavailable');var xe=n.AllSelection,me=n.EditorState,ke=n.NodeSelection,b=n.Plugin,y=n.PluginKey,be=n.Selection,ye=n.SelectionRange,he=n.TextSelection,Ee=n.Transaction;var d=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(d==null||d.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var o=d.modules["@tiptap/pm/view"];if(o==null)throw new Error('leptos-tiptap bridge module "@tiptap/pm/view" is unavailable');var h=o.Decoration,E=o.DecorationSet,fe=o.EditorView,Se=o.__endComposition,Re=o.__parseFromClipboard;var c=m.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new b({key:new y("placeholder"),props:{decorations:({doc:e,selection:s})=>{let l=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:u}=s,g=[];if(!l)return null;let R=this.editor.isEmpty;return e.descendants((i,r)=>{let _=u>=r&&u<=r+i.nodeSize,C=!i.isLeaf&&k(i);if((_||!this.options.showOnlyCurrent)&&C){let x=[this.options.emptyNodeClass];R&&x.push(this.options.emptyEditorClass);let T=h.node(r,r+i.nodeSize,{class:x.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:r,hasAnchor:_}):this.options.placeholder});g.push(T)}return this.options.includeChildren}),E.create(e,g)}}})]}});var P="__LEPTOS_TIPTAP_BRIDGE__";function A(){let e=globalThis,s=e[P];if(s!=null)return s;let l={modules:{},registerExtension:()=>{throw new Error("leptos-tiptap bridge runtime is not initialized")}};return e[P]=l,l}function f(){return A()}function S(e){f().registerExtension(e)}var w={name:"placeholder",create:({placeholder:e})=>e==null?c:c.configure({placeholder:e})};function Fe(){S(w)}export{Fe as register_placeholder};
