var T=Object.defineProperty,y=Object.defineProperties;var h=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var f=(r,t,o)=>t in r?T(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,m=(r,t)=>{for(var o in t||(t={}))b.call(t,o)&&f(r,o,t[o]);if(l)for(var o of l(t))g.call(t,o)&&f(r,o,t[o]);return r},a=(r,t)=>y(r,h(t));import{jsx as A}from"react/jsx-runtime";import{c as N}from"./ui-components-B24mpb8o.js";import{useEditor as j}from"./use-editor-D8T8wKX0.js";import{f as w}from"./format-text-Bn-rZ97T.js";import d from"react";import{E as C}from"./element-wrapper-Dx7uKeuw.js";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"lucide-react";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./editor-provider-CwMLJaUa.js";import"uuid";import"./index-B_TQB0Un.js";import"./ActionsWrapper-B0x6l4Ay.js";import"@dnd-kit/sortable";import"@dnd-kit/utilities";const Et=({element:r})=>{const{dispatch:t,editor:o}=j(),{editor:s}=o,{styles:u,content:e}=r,E=Array.isArray(e),p=d.useRef(null),i=!E&&typeof e=="object"&&"innerText"in e?e.innerText:"Paragraph text";d.useEffect(()=>{p.current&&p.current.innerText!==i&&(p.current.innerText=i)},[i]);const x=n=>{w(n,s,t)};return A(C,{tag:"p",element:r,wrapperClassName:"relative",htmlAttributes:{ref:p,style:u,className:N("outline-none",r.className)},contentEditable:!s.liveMode,onKeyDown:x,suppressContentEditableWarning:!0,onBlur:n=>{const c=n.target.innerText;c!==i&&t({type:"UPDATE_ELEMENT",payload:{elementDetails:a(m({},r),{content:a(m({},typeof e=="object"?e:{}),{innerText:c})})}})},children:i})};export{Et as default};
