var a=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(a==null||a.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var e=a.modules["@tiptap/core"];if(e==null)throw new Error('leptos-tiptap bridge module "@tiptap/core" is unavailable');var O=e.CommandManager,N=e.Editor,m=e.Extension,B=e.InputRule,v=e.Mark,D=e.Node,I=e.NodePos,F=e.NodeView,M=e.PasteRule,j=e.Tracker,L=e.callOrReturn,K=e.canInsertNode,G=e.combineTransactionSteps,q=e.createChainableState,H=e.createDocument,z=e.createNodeFromContent,J=e.createStyleTag,V=e.defaultBlockAt,W=e.deleteProps,U=e.elementFromString,Y=e.escapeForRegEx,Q=e.extensions,X=e.findChildren,Z=e.findChildrenInRange,$=e.findDuplicates,ee=e.findParentNode,te=e.findParentNodeClosestToPos,ne=e.fromString,oe=e.generateHTML,ie=e.generateJSON,re=e.generateText,se=e.getAttributes,le=e.getAttributesFromExtensions,ae=e.getChangedRanges,de=e.getDebugJSON,pe=e.getExtensionField,ce=e.getHTMLFromFragment,ue=e.getMarkAttributes,ge=e.getMarkRange,_e=e.getMarkType,xe=e.getMarksBetween,me=e.getNodeAtPosition,be=e.getNodeAttributes,ke=e.getNodeType,ye=e.getRenderedAttributes,he=e.getSchema,Ee=e.getSchemaByResolvedExtensions,fe=e.getSchemaTypeByName,Pe=e.getSchemaTypeNameByName,Se=e.getSplittedAttributes,Re=e.getText,Ce=e.getTextBetween,Te=e.getTextContentFromNodes,we=e.getTextSerializersFromSchema,Ae=e.injectExtensionAttributesToParseRule,Oe=e.inputRulesPlugin,Ne=e.isActive,Be=e.isAtEndOfNode,ve=e.isAtStartOfNode,De=e.isEmptyObject,Ie=e.isExtensionRulesEnabled,Fe=e.isFunction,Me=e.isList,je=e.isMacOS,Le=e.isMarkActive,Ke=e.isNodeActive,b=e.isNodeEmpty,Ge=e.isNodeSelection,qe=e.isNumber,He=e.isPlainObject,ze=e.isRegExp,Je=e.isSafari,Ve=e.isString,We=e.isTextSelection,Ue=e.isiOS,Ye=e.markInputRule,Qe=e.markPasteRule,Xe=e.mergeAttributes,Ze=e.mergeDeep,$e=e.minMax,et=e.nodeInputRule,tt=e.nodePasteRule,nt=e.objectIncludes,ot=e.pasteRulesPlugin,it=e.posToDOMRect,rt=e.removeDuplicates,st=e.resolveFocusPosition,lt=e.rewriteUnknownContent,at=e.selectionToInsertionEnd,dt=e.splitExtensions,pt=e.textInputRule,ct=e.textPasteRule,ut=e.textblockTypeInputRule,gt=e.wrappingInputRule;var d=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(d==null||d.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var n=d.modules["@tiptap/pm/state"];if(n==null)throw new Error('leptos-tiptap bridge module "@tiptap/pm/state" is unavailable');var xt=n.AllSelection,mt=n.EditorState,bt=n.NodeSelection,k=n.Plugin,y=n.PluginKey,kt=n.Selection,yt=n.SelectionRange,ht=n.TextSelection,Et=n.Transaction;var p=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(p==null||p.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var o=p.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,Pt=o.EditorView,St=o.__endComposition,Rt=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 k({key:new y("placeholder"),props:{decorations:({doc:t,selection:s})=>{let l=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:u}=s,g=[];if(!l)return null;let R=this.editor.isEmpty;return t.descendants((i,r)=>{let _=u>=r&&u<=r+i.nodeSize,C=!i.isLeaf&&b(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(t,g)}}})]}});var f="__LEPTOS_TIPTAP_BRIDGE__";function w(){let t=globalThis,s=t[f];if(s!=null)return s;let l={modules:{},registerExtension:()=>{throw new Error("leptos-tiptap bridge runtime is not initialized")}};return t[f]=l,l}function P(){return w()}function S(t){P().registerExtension(t)}var A={name:"placeholder",create:({placeholder:t})=>t==null?c:c.configure({placeholder:t})};function Ft(){S(A)}export{Ft as register_placeholder};
