@abduljebar/text-editor 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../src/components/TextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AACD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqJhD,CAAC"}
1
+ {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../src/components/TextEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AACD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmJhD,CAAC"}
package/dist/index.js CHANGED
@@ -5683,7 +5683,7 @@ const Va = ({
5683
5683
  },
5684
5684
  [k]
5685
5685
  );
5686
- return console.log(" height : ", a), /* @__PURE__ */ x.jsxs("div", { className: "w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden", children: [
5686
+ return /* @__PURE__ */ x.jsxs("div", { className: "w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden", children: [
5687
5687
  s && /* @__PURE__ */ x.jsxs("div", { className: "p-6 border-b border-gray-200 bg-gray-50", children: [
5688
5688
  /* @__PURE__ */ x.jsx(
5689
5689
  "input",
@@ -73,4 +73,4 @@ React keys must be passed directly to JSX without using spread:
73
73
  ${k?.content}
74
74
  </div>
75
75
  </body>
76
- </html>`,m},[s]),d=A.useCallback(()=>{r({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1}),o.current&&(o.current.innerHTML="")},[]);return{editorState:t,editorRef:o,updateContent:n,updateTitle:i,executeCommand:a,getValidationResult:s,exportToHTML:c,clearEditor:d}};function lr(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=lr(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Da(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=lr(e))&&(o&&(o+=" "),o+=t);return o}const it="-",Fa=e=>{const t=Ga(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const s=a.split(it);return s[0]===""&&s.length!==1&&s.shift(),ur(s,t)||Va(a)},getConflictingClassGroupIds:(a,s)=>{const c=r[a]||[];return s&&o[a]?[...c,...o[a]]:c}}},ur=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),n=o?ur(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;const i=e.join(it);return t.validators.find(({validator:a})=>a(i))?.classGroupId},dr=/^\[(.+)\]$/,Va=e=>{if(dr.test(e)){const t=dr.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ga=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const n in r)at(r[n],o,n,t);return o},at=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){const i=n===""?t:pr(t,n);i.classGroupId=r;return}if(typeof n=="function"){if(Wa(n)){at(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([i,a])=>{at(a,pr(t,i),r,o)})})},pr=(e,t)=>{let r=e;return t.split(it).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Wa=e=>e.isThemeGetter,Ba=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,o=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=o.get(i))!==void 0)return n(i,a),a},set(i,a){r.has(i)?r.set(i,a):n(i,a)}}},st="!",ct=":",Ya=ct.length,Ja=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=n=>{const i=[];let a=0,s=0,c=0,d;for(let w=0;w<n.length;w++){let I=n[w];if(a===0&&s===0){if(I===ct){i.push(n.slice(c,w)),c=w+Ya;continue}if(I==="/"){d=w;continue}}I==="["?a++:I==="]"?a--:I==="("?s++:I===")"&&s--}const p=i.length===0?n:n.substring(c),_=Ha(p),k=_!==p,m=d&&d>c?d-c:void 0;return{modifiers:i,hasImportantModifier:k,baseClassName:_,maybePostfixModifierPosition:m}};if(t){const n=t+ct,i=o;o=a=>a.startsWith(n)?i(a.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(r){const n=o;o=i=>r({className:i,parseClassName:n})}return o},Ha=e=>e.endsWith(st)?e.substring(0,e.length-1):e.startsWith(st)?e.substring(1):e,Xa=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const n=[];let i=[];return o.forEach(a=>{a[0]==="["||t[a]?(n.push(...i.sort(),a),i=[]):i.push(a)}),n.push(...i.sort()),n}},Ka=e=>({cache:Ba(e.cacheSize),parseClassName:Ja(e),sortModifiers:Xa(e),...Fa(e)}),qa=/\s+/,Qa=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:i}=t,a=[],s=e.trim().split(qa);let c="";for(let d=s.length-1;d>=0;d-=1){const p=s[d],{isExternal:_,modifiers:k,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:I}=r(p);if(_){c=p+(c.length>0?" "+c:c);continue}let N=!!I,D=o(N?w.substring(0,I):w);if(!D){if(!N){c=p+(c.length>0?" "+c:c);continue}if(D=o(w),!D){c=p+(c.length>0?" "+c:c);continue}N=!1}const U=i(k).join(":"),M=m?U+st:U,R=M+D;if(a.includes(R))continue;a.push(R);const F=n(D,N);for(let J=0;J<F.length;++J){const $=F[J];a.push(M+$)}c=p+(c.length>0?" "+c:c)}return c};function es(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=mr(t))&&(o&&(o+=" "),o+=r);return o}const mr=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=mr(e[o]))&&(r&&(r+=" "),r+=t);return r};function ts(e,...t){let r,o,n,i=a;function a(c){const d=t.reduce((p,_)=>_(p),e());return r=Ka(d),o=r.cache.get,n=r.cache.set,i=s,s(c)}function s(c){const d=o(c);if(d)return d;const p=Qa(c,r);return n(c,p),p}return function(){return i(es.apply(null,arguments))}}const L=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},fr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rs=/^\d+\/\d+$/,os=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ns=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,is=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,as=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ss=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,me=e=>rs.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),oe=e=>!!e&&Number.isInteger(Number(e)),lt=e=>e.endsWith("%")&&z(e.slice(0,-1)),q=e=>os.test(e),cs=()=>!0,ls=e=>ns.test(e)&&!is.test(e),gr=()=>!1,us=e=>as.test(e),ds=e=>ss.test(e),ps=e=>!f(e)&&!h(e),ms=e=>fe(e,yr,gr),f=e=>fr.test(e),ue=e=>fe(e,_r,ls),ut=e=>fe(e,vs,z),br=e=>fe(e,wr,gr),fs=e=>fe(e,kr,ds),De=e=>fe(e,xr,us),h=e=>hr.test(e),xe=e=>he(e,_r),hs=e=>he(e,ws),vr=e=>he(e,wr),gs=e=>he(e,yr),bs=e=>he(e,kr),Fe=e=>he(e,xr,!0),fe=(e,t,r)=>{const o=fr.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},he=(e,t,r=!1)=>{const o=hr.exec(e);return o?o[1]?t(o[1]):r:!1},wr=e=>e==="position"||e==="percentage",kr=e=>e==="image"||e==="url",yr=e=>e==="length"||e==="size"||e==="bg-size",_r=e=>e==="length",vs=e=>e==="number",ws=e=>e==="family-name",xr=e=>e==="shadow",ks=ts(()=>{const e=L("color"),t=L("font"),r=L("text"),o=L("font-weight"),n=L("tracking"),i=L("leading"),a=L("breakpoint"),s=L("container"),c=L("spacing"),d=L("radius"),p=L("shadow"),_=L("inset-shadow"),k=L("text-shadow"),m=L("drop-shadow"),w=L("blur"),I=L("perspective"),N=L("aspect"),D=L("ease"),U=L("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...R(),h,f],J=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],b=()=>[h,f,c],G=()=>[me,"full","auto",...b()],H=()=>[oe,"none","subgrid",h,f],Ve=()=>["auto",{span:["full",oe,h,f]},oe,h,f],ne=()=>[oe,"auto",h,f],ze=()=>["auto","min","max","fr",h,f],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...b()],K=()=>[me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],v=()=>[e,h,f],Ze=()=>[...R(),vr,br,{position:[h,f]}],Ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],u=()=>["auto","cover","contain",gs,ms,{size:[h,f]}],x=()=>[lt,xe,ue],E=()=>["","none","full",d,h,f],C=()=>["",z,xe,ue],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[z,lt,vr,br],ee=()=>["","none",w,h,f],ie=()=>["none",z,h,f],be=()=>["none",z,h,f],dt=()=>[z,h,f],Ge=()=>[me,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[cs],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[ps],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",z],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",me,f,h,N]}],container:["container"],columns:[{columns:[z,f,h,s]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[oe,"auto",h,f]}],basis:[{basis:[me,"full","auto",s,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[z,me,"auto","initial","none",f]}],grow:[{grow:["",z,h,f]}],shrink:[{shrink:["",z,h,f]}],order:[{order:[oe,"first","last","none",h,f]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:Ve()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:Ve()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ze()}],"auto-rows":[{"auto-rows":ze()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[s,"screen",...K()]}],"min-w":[{"min-w":[s,"screen","none",...K()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,xe,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,h,ut]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lt,f]}],"font-family":[{font:[hs,f,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,h,f]}],"line-clamp":[{"line-clamp":[z,"none",h,ut]}],leading:[{leading:[i,...b()]}],"list-image":[{"list-image":["none",h,f]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",h,f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[z,"from-font","auto",h,ue]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[z,"auto",h,f]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h,f]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h,f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:Ce()}],"bg-size":[{bg:u()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oe,h,f],radial:["",h,f],conic:[oe,h,f]},bs,fs]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:x()}],"gradient-via-pos":[{via:x()}],"gradient-to-pos":[{to:x()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:C()}],"border-w-x":[{"border-x":C()}],"border-w-y":[{"border-y":C()}],"border-w-s":[{"border-s":C()}],"border-w-e":[{"border-e":C()}],"border-w-t":[{"border-t":C()}],"border-w-r":[{"border-r":C()}],"border-w-b":[{"border-b":C()}],"border-w-l":[{"border-l":C()}],"divide-x":[{"divide-x":C()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":C()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[z,h,f]}],"outline-w":[{outline:["",z,xe,ue]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",p,Fe,De]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",_,Fe,De]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[z,ue]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":C()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",k,Fe,De]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[z,h,f]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[h,f]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:Ce()}],"mask-size":[{mask:u()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",h,f]}],filter:[{filter:["","none",h,f]}],blur:[{blur:ee()}],brightness:[{brightness:[z,h,f]}],contrast:[{contrast:[z,h,f]}],"drop-shadow":[{"drop-shadow":["","none",m,Fe,De]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",z,h,f]}],"hue-rotate":[{"hue-rotate":[z,h,f]}],invert:[{invert:["",z,h,f]}],saturate:[{saturate:[z,h,f]}],sepia:[{sepia:["",z,h,f]}],"backdrop-filter":[{"backdrop-filter":["","none",h,f]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[z,h,f]}],"backdrop-contrast":[{"backdrop-contrast":[z,h,f]}],"backdrop-grayscale":[{"backdrop-grayscale":["",z,h,f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,h,f]}],"backdrop-invert":[{"backdrop-invert":["",z,h,f]}],"backdrop-opacity":[{"backdrop-opacity":[z,h,f]}],"backdrop-saturate":[{"backdrop-saturate":[z,h,f]}],"backdrop-sepia":[{"backdrop-sepia":["",z,h,f]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",h,f]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[z,"initial",h,f]}],ease:[{ease:["linear","initial",D,h,f]}],delay:[{delay:[z,h,f]}],animate:[{animate:["none",U,h,f]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,h,f]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[h,f,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h,f]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h,f]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[z,xe,ue,ut]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ys(...e){return ks(Da(e))}const _s=({initialContent:e="",onSave:t,onExport:r,onChange:o,showButtons:n=!1,showSaveTitle:i=!1,showStatusBar:a=!1,height:s="500px"})=>{const{editorState:c,editorRef:d,updateContent:p,updateTitle:_,executeCommand:k,getValidationResult:m,exportToHTML:w,clearEditor:I}=Ua(e),[N,D]=A.useState(!1);A.useEffect(()=>{if(o)try{const $=w({includeStyles:!1,includeMeta:!1});o(c.content,$,c.title)}catch{const b=`<!DOCTYPE html><html><body>${c.content}</body></html>`;o(c.content,b,c.title)}},[c.content,c.title,o,w]);const U=A.useCallback(()=>{if(m().success){const b=w();t?.(c.content,b)}else D(!0),setTimeout(()=>D(!1),3e3)},[c.content,m,w,t]),M=A.useCallback(()=>{try{const $=w();r?.($);const b=new Blob([$],{type:"text/html"}),G=URL.createObjectURL(b),H=document.createElement("a");H.href=G,H.download=`${c.title.replace(/\s+/g,"_")||"document"}.html`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(G)}catch($){alert("Export failed: "+($ instanceof Error?$.message:"Unknown error"))}},[w,c.title,r]),R=A.useCallback(()=>{confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.")&&I()},[I]),F=A.useCallback($=>{p($)},[p]),J=A.useCallback($=>{_($)},[_]);return console.log(" height : ",s),y.jsxs("div",{className:"w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden",children:[i&&y.jsxs("div",{className:"p-6 border-b border-gray-200 bg-gray-50",children:[y.jsx("input",{type:"text",className:"w-full bg-transparent text-2xl font-bold text-gray-800 outline-none placeholder-gray-400",value:c.title,onChange:$=>J($.target.value),placeholder:"Document Title"}),N&&y.jsx("div",{className:"text-red-600 text-sm mt-2 animate-fadeIn",children:"Please add content before saving"})]}),y.jsx(Cr,{onCommand:k,onSave:U,onExport:M,showButtons:n,onClear:R,hasUnsavedChanges:c.hasUnsavedChanges}),y.jsx("div",{ref:d,className:ys("editor-content p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none",s||"min-h-[500px]"),contentEditable:!0,onInput:$=>F($.currentTarget.innerHTML),onBlur:$=>F($.currentTarget.innerHTML),suppressContentEditableWarning:!0}),a&&y.jsx($r,{wordCount:c.wordCount,characterCount:c.characterCount,hasUnsavedChanges:c.hasUnsavedChanges})]})};te.TextEditor=_s,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})}));
76
+ </html>`,m},[s]),d=A.useCallback(()=>{r({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1}),o.current&&(o.current.innerHTML="")},[]);return{editorState:t,editorRef:o,updateContent:n,updateTitle:i,executeCommand:a,getValidationResult:s,exportToHTML:c,clearEditor:d}};function lr(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=lr(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Da(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=lr(e))&&(o&&(o+=" "),o+=t);return o}const it="-",Fa=e=>{const t=Ga(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const s=a.split(it);return s[0]===""&&s.length!==1&&s.shift(),ur(s,t)||Va(a)},getConflictingClassGroupIds:(a,s)=>{const c=r[a]||[];return s&&o[a]?[...c,...o[a]]:c}}},ur=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),n=o?ur(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;const i=e.join(it);return t.validators.find(({validator:a})=>a(i))?.classGroupId},dr=/^\[(.+)\]$/,Va=e=>{if(dr.test(e)){const t=dr.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ga=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const n in r)at(r[n],o,n,t);return o},at=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){const i=n===""?t:pr(t,n);i.classGroupId=r;return}if(typeof n=="function"){if(Wa(n)){at(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([i,a])=>{at(a,pr(t,i),r,o)})})},pr=(e,t)=>{let r=e;return t.split(it).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Wa=e=>e.isThemeGetter,Ba=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,o=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=o.get(i))!==void 0)return n(i,a),a},set(i,a){r.has(i)?r.set(i,a):n(i,a)}}},st="!",ct=":",Ya=ct.length,Ja=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=n=>{const i=[];let a=0,s=0,c=0,d;for(let w=0;w<n.length;w++){let I=n[w];if(a===0&&s===0){if(I===ct){i.push(n.slice(c,w)),c=w+Ya;continue}if(I==="/"){d=w;continue}}I==="["?a++:I==="]"?a--:I==="("?s++:I===")"&&s--}const p=i.length===0?n:n.substring(c),_=Ha(p),k=_!==p,m=d&&d>c?d-c:void 0;return{modifiers:i,hasImportantModifier:k,baseClassName:_,maybePostfixModifierPosition:m}};if(t){const n=t+ct,i=o;o=a=>a.startsWith(n)?i(a.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(r){const n=o;o=i=>r({className:i,parseClassName:n})}return o},Ha=e=>e.endsWith(st)?e.substring(0,e.length-1):e.startsWith(st)?e.substring(1):e,Xa=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const n=[];let i=[];return o.forEach(a=>{a[0]==="["||t[a]?(n.push(...i.sort(),a),i=[]):i.push(a)}),n.push(...i.sort()),n}},Ka=e=>({cache:Ba(e.cacheSize),parseClassName:Ja(e),sortModifiers:Xa(e),...Fa(e)}),qa=/\s+/,Qa=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:i}=t,a=[],s=e.trim().split(qa);let c="";for(let d=s.length-1;d>=0;d-=1){const p=s[d],{isExternal:_,modifiers:k,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:I}=r(p);if(_){c=p+(c.length>0?" "+c:c);continue}let N=!!I,D=o(N?w.substring(0,I):w);if(!D){if(!N){c=p+(c.length>0?" "+c:c);continue}if(D=o(w),!D){c=p+(c.length>0?" "+c:c);continue}N=!1}const U=i(k).join(":"),M=m?U+st:U,R=M+D;if(a.includes(R))continue;a.push(R);const F=n(D,N);for(let J=0;J<F.length;++J){const $=F[J];a.push(M+$)}c=p+(c.length>0?" "+c:c)}return c};function es(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=mr(t))&&(o&&(o+=" "),o+=r);return o}const mr=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=mr(e[o]))&&(r&&(r+=" "),r+=t);return r};function ts(e,...t){let r,o,n,i=a;function a(c){const d=t.reduce((p,_)=>_(p),e());return r=Ka(d),o=r.cache.get,n=r.cache.set,i=s,s(c)}function s(c){const d=o(c);if(d)return d;const p=Qa(c,r);return n(c,p),p}return function(){return i(es.apply(null,arguments))}}const L=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},fr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rs=/^\d+\/\d+$/,os=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ns=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,is=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,as=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ss=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,me=e=>rs.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),oe=e=>!!e&&Number.isInteger(Number(e)),lt=e=>e.endsWith("%")&&z(e.slice(0,-1)),q=e=>os.test(e),cs=()=>!0,ls=e=>ns.test(e)&&!is.test(e),gr=()=>!1,us=e=>as.test(e),ds=e=>ss.test(e),ps=e=>!f(e)&&!h(e),ms=e=>fe(e,yr,gr),f=e=>fr.test(e),ue=e=>fe(e,_r,ls),ut=e=>fe(e,vs,z),br=e=>fe(e,wr,gr),fs=e=>fe(e,kr,ds),De=e=>fe(e,xr,us),h=e=>hr.test(e),xe=e=>he(e,_r),hs=e=>he(e,ws),vr=e=>he(e,wr),gs=e=>he(e,yr),bs=e=>he(e,kr),Fe=e=>he(e,xr,!0),fe=(e,t,r)=>{const o=fr.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},he=(e,t,r=!1)=>{const o=hr.exec(e);return o?o[1]?t(o[1]):r:!1},wr=e=>e==="position"||e==="percentage",kr=e=>e==="image"||e==="url",yr=e=>e==="length"||e==="size"||e==="bg-size",_r=e=>e==="length",vs=e=>e==="number",ws=e=>e==="family-name",xr=e=>e==="shadow",ks=ts(()=>{const e=L("color"),t=L("font"),r=L("text"),o=L("font-weight"),n=L("tracking"),i=L("leading"),a=L("breakpoint"),s=L("container"),c=L("spacing"),d=L("radius"),p=L("shadow"),_=L("inset-shadow"),k=L("text-shadow"),m=L("drop-shadow"),w=L("blur"),I=L("perspective"),N=L("aspect"),D=L("ease"),U=L("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...R(),h,f],J=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],b=()=>[h,f,c],G=()=>[me,"full","auto",...b()],H=()=>[oe,"none","subgrid",h,f],Ve=()=>["auto",{span:["full",oe,h,f]},oe,h,f],ne=()=>[oe,"auto",h,f],ze=()=>["auto","min","max","fr",h,f],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...b()],K=()=>[me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],v=()=>[e,h,f],Ze=()=>[...R(),vr,br,{position:[h,f]}],Ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],u=()=>["auto","cover","contain",gs,ms,{size:[h,f]}],x=()=>[lt,xe,ue],E=()=>["","none","full",d,h,f],C=()=>["",z,xe,ue],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[z,lt,vr,br],ee=()=>["","none",w,h,f],ie=()=>["none",z,h,f],be=()=>["none",z,h,f],dt=()=>[z,h,f],Ge=()=>[me,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[cs],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[ps],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",z],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",me,f,h,N]}],container:["container"],columns:[{columns:[z,f,h,s]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[oe,"auto",h,f]}],basis:[{basis:[me,"full","auto",s,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[z,me,"auto","initial","none",f]}],grow:[{grow:["",z,h,f]}],shrink:[{shrink:["",z,h,f]}],order:[{order:[oe,"first","last","none",h,f]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:Ve()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:Ve()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ze()}],"auto-rows":[{"auto-rows":ze()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[s,"screen",...K()]}],"min-w":[{"min-w":[s,"screen","none",...K()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,xe,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,h,ut]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lt,f]}],"font-family":[{font:[hs,f,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,h,f]}],"line-clamp":[{"line-clamp":[z,"none",h,ut]}],leading:[{leading:[i,...b()]}],"list-image":[{"list-image":["none",h,f]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",h,f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[z,"from-font","auto",h,ue]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[z,"auto",h,f]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h,f]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h,f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:Ce()}],"bg-size":[{bg:u()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oe,h,f],radial:["",h,f],conic:[oe,h,f]},bs,fs]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:x()}],"gradient-via-pos":[{via:x()}],"gradient-to-pos":[{to:x()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:C()}],"border-w-x":[{"border-x":C()}],"border-w-y":[{"border-y":C()}],"border-w-s":[{"border-s":C()}],"border-w-e":[{"border-e":C()}],"border-w-t":[{"border-t":C()}],"border-w-r":[{"border-r":C()}],"border-w-b":[{"border-b":C()}],"border-w-l":[{"border-l":C()}],"divide-x":[{"divide-x":C()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":C()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[z,h,f]}],"outline-w":[{outline:["",z,xe,ue]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",p,Fe,De]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",_,Fe,De]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[z,ue]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":C()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",k,Fe,De]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[z,h,f]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[h,f]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:Ce()}],"mask-size":[{mask:u()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",h,f]}],filter:[{filter:["","none",h,f]}],blur:[{blur:ee()}],brightness:[{brightness:[z,h,f]}],contrast:[{contrast:[z,h,f]}],"drop-shadow":[{"drop-shadow":["","none",m,Fe,De]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",z,h,f]}],"hue-rotate":[{"hue-rotate":[z,h,f]}],invert:[{invert:["",z,h,f]}],saturate:[{saturate:[z,h,f]}],sepia:[{sepia:["",z,h,f]}],"backdrop-filter":[{"backdrop-filter":["","none",h,f]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[z,h,f]}],"backdrop-contrast":[{"backdrop-contrast":[z,h,f]}],"backdrop-grayscale":[{"backdrop-grayscale":["",z,h,f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,h,f]}],"backdrop-invert":[{"backdrop-invert":["",z,h,f]}],"backdrop-opacity":[{"backdrop-opacity":[z,h,f]}],"backdrop-saturate":[{"backdrop-saturate":[z,h,f]}],"backdrop-sepia":[{"backdrop-sepia":["",z,h,f]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",h,f]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[z,"initial",h,f]}],ease:[{ease:["linear","initial",D,h,f]}],delay:[{delay:[z,h,f]}],animate:[{animate:["none",U,h,f]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,h,f]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[h,f,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h,f]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h,f]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[z,xe,ue,ut]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ys(...e){return ks(Da(e))}const _s=({initialContent:e="",onSave:t,onExport:r,onChange:o,showButtons:n=!1,showSaveTitle:i=!1,showStatusBar:a=!1,height:s="500px"})=>{const{editorState:c,editorRef:d,updateContent:p,updateTitle:_,executeCommand:k,getValidationResult:m,exportToHTML:w,clearEditor:I}=Ua(e),[N,D]=A.useState(!1);A.useEffect(()=>{if(o)try{const $=w({includeStyles:!1,includeMeta:!1});o(c.content,$,c.title)}catch{const b=`<!DOCTYPE html><html><body>${c.content}</body></html>`;o(c.content,b,c.title)}},[c.content,c.title,o,w]);const U=A.useCallback(()=>{if(m().success){const b=w();t?.(c.content,b)}else D(!0),setTimeout(()=>D(!1),3e3)},[c.content,m,w,t]),M=A.useCallback(()=>{try{const $=w();r?.($);const b=new Blob([$],{type:"text/html"}),G=URL.createObjectURL(b),H=document.createElement("a");H.href=G,H.download=`${c.title.replace(/\s+/g,"_")||"document"}.html`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(G)}catch($){alert("Export failed: "+($ instanceof Error?$.message:"Unknown error"))}},[w,c.title,r]),R=A.useCallback(()=>{confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.")&&I()},[I]),F=A.useCallback($=>{p($)},[p]),J=A.useCallback($=>{_($)},[_]);return y.jsxs("div",{className:"w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden",children:[i&&y.jsxs("div",{className:"p-6 border-b border-gray-200 bg-gray-50",children:[y.jsx("input",{type:"text",className:"w-full bg-transparent text-2xl font-bold text-gray-800 outline-none placeholder-gray-400",value:c.title,onChange:$=>J($.target.value),placeholder:"Document Title"}),N&&y.jsx("div",{className:"text-red-600 text-sm mt-2 animate-fadeIn",children:"Please add content before saving"})]}),y.jsx(Cr,{onCommand:k,onSave:U,onExport:M,showButtons:n,onClear:R,hasUnsavedChanges:c.hasUnsavedChanges}),y.jsx("div",{ref:d,className:ys("editor-content p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none",s||"min-h-[500px]"),contentEditable:!0,onInput:$=>F($.currentTarget.innerHTML),onBlur:$=>F($.currentTarget.innerHTML),suppressContentEditableWarning:!0}),a&&y.jsx($r,{wordCount:c.wordCount,characterCount:c.characterCount,hasUnsavedChanges:c.hasUnsavedChanges})]})};te.TextEditor=_s,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abduljebar/text-editor",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "A professional React text editor with export, save, and validation features",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",