ynotsoft-dynamic-form 1.0.80 → 1.0.81

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.
@@ -4677,12 +4677,8 @@ const Df = ({ editor: e, error: t }) => {
4677
4677
  const [, n] = fe(0);
4678
4678
  if (Ze(() => {
4679
4679
  if (!e) return;
4680
- const s = () => {
4681
- n((i) => i + 1);
4682
- };
4683
- return e.on("transaction", s), () => {
4684
- e.off("transaction", s);
4685
- };
4680
+ const s = () => n((i) => i + 1);
4681
+ return e.on("transaction", s), () => e.off("transaction", s);
4686
4682
  }, [e]), !e) return null;
4687
4683
  const o = (s) => `p-2 rounded-sm transition-colors duration-200 focus-visible:ring-1 focus-visible:ring-ring/40 focus-visible:outline-none ${s ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground text-muted-foreground"}`.trim(), r = () => /* @__PURE__ */ c("div", { className: "w-px h-4 bg-border mx-1 self-center", "aria-hidden": "true" });
4688
4684
  return /* @__PURE__ */ M(
@@ -59,7 +59,7 @@
59
59
  data-[state=checked]:bg-blue-50
60
60
  data-[state=checked]:text-blue-600
61
61
  `,children:l.jsx(xu,{children:c.label})},c.value)),e.separator&&l.jsx(Cu,{className:"my-1 h-px bg-gray-200"})]}),l.jsx(Bs,{className:"fill-white stroke-gray-200"})]})})]}),r&&l.jsx("p",{className:"mt-1 text-sm text-red-500",children:r})]})}function Au({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,type:"email",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>o(e.name),disabled:a,name:e.name,placeholder:e.placeholder,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-background"}`})})}function Us({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,id:e.name,type:e.type||"",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>o(e.name),disabled:a,name:e.name,placeholder:e.placeholder||"",min:e.minLength,max:e.maxLength,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-50 text-gray-500":"bg-background"}`})})}function Nu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=s;return l.jsx(l.Fragment,{children:l.jsx("input",{...e.props,id:e.name,type:"number",value:t[e.name]||"",onChange:i=>n(e.name,i.target.value),onBlur:()=>o(e.name),disabled:a,name:e.name,placeholder:e.placeholder||"",min:e.min,max:e.max,step:e.step,className:`flex h-10 w-full rounded-md border px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${r?"border-red-500 focus-visible:ring-red-500":"border-input focus-visible:ring-blue-500"} ${a?"bg-gray-50 text-gray-500":"bg-background"}`})})}const{entries:Hs,setPrototypeOf:Ws,isFrozen:ku,getPrototypeOf:Tu,getOwnPropertyDescriptor:_u}=Object;let{freeze:be,seal:Ae,create:wo}=Object,{apply:xo,construct:So}=typeof Reflect<"u"&&Reflect;be||(be=function(t){return t}),Ae||(Ae=function(t){return t}),xo||(xo=function(t,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),s=2;s<o;s++)r[s-2]=arguments[s];return t.apply(n,r)}),So||(So=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return new t(...o)});const mn=ye(Array.prototype.forEach),Pu=ye(Array.prototype.lastIndexOf),js=ye(Array.prototype.pop),Mt=ye(Array.prototype.push),Ou=ye(Array.prototype.splice),hn=ye(String.prototype.toLowerCase),Co=ye(String.prototype.toString),Eo=ye(String.prototype.match),Lt=ye(String.prototype.replace),Iu=ye(String.prototype.indexOf),Mu=ye(String.prototype.trim),Oe=ye(Object.prototype.hasOwnProperty),ve=ye(RegExp.prototype.test),Dt=Lu(TypeError);function ye(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return xo(e,t,o)}}function Lu(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return So(e,n)}}function q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hn;Ws&&Ws(e,null);let o=t.length;for(;o--;){let r=t[o];if(typeof r=="string"){const s=n(r);s!==r&&(ku(t)||(t[o]=s),r=s)}e[r]=!0}return e}function Du(e){for(let t=0;t<e.length;t++)Oe(e,t)||(e[t]=null);return e}function ze(e){const t=wo(null);for(const[n,o]of Hs(e))Oe(e,n)&&(Array.isArray(o)?t[n]=Du(o):o&&typeof o=="object"&&o.constructor===Object?t[n]=ze(o):t[n]=o);return t}function Ft(e,t){for(;e!==null;){const o=_u(e,t);if(o){if(o.get)return ye(o.get);if(typeof o.value=="function")return ye(o.value)}e=Tu(e)}function n(){return null}return n}const Vs=be(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ao=be(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),No=be(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Fu=be(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ko=be(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$u=be(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Gs=be(["#text"]),Ys=be(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),To=be(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),qs=be(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),gn=be(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zu=Ae(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ru=Ae(/<%[\w\W]*|[\w\W]*%>/gm),Bu=Ae(/\$\{[\w\W]*/gm),Uu=Ae(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hu=Ae(/^aria-[\-\w]+$/),Ks=Ae(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wu=Ae(/^(?:\w+script|data):/i),ju=Ae(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xs=Ae(/^html$/i),Vu=Ae(/^[a-z][.\w]*(-[.\w]+)+$/i);var Zs=Object.freeze({__proto__:null,ARIA_ATTR:Hu,ATTR_WHITESPACE:ju,CUSTOM_ELEMENT:Vu,DATA_ATTR:Uu,DOCTYPE_NAME:Xs,ERB_EXPR:Ru,IS_ALLOWED_URI:Ks,IS_SCRIPT_OR_DATA:Wu,MUSTACHE_EXPR:zu,TMPLIT_EXPR:Bu});const $t={element:1,text:3,progressingInstruction:7,comment:8,document:9},Gu=function(){return typeof window>"u"?null:window},Yu=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(o=n.getAttribute(r));const s="dompurify"+(o?"#"+o:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Qs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Js(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gu();const t=R=>Js(R);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==$t.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const o=n,r=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:i,Element:c,NodeFilter:d,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:g,trustedTypes:m}=e,w=c.prototype,h=Ft(w,"cloneNode"),y=Ft(w,"remove"),C=Ft(w,"nextSibling"),E=Ft(w,"childNodes"),A=Ft(w,"parentNode");if(typeof a=="function"){const R=n.createElement("template");R.content&&R.content.ownerDocument&&(n=R.content.ownerDocument)}let x,T="";const{implementation:L,createNodeIterator:I,createDocumentFragment:P,getElementsByTagName:H}=n,{importNode:W}=o;let B=Qs();t.isSupported=typeof Hs=="function"&&typeof A=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:V,ERB_EXPR:b,TMPLIT_EXPR:S,DATA_ATTR:k,ARIA_ATTR:_,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:K}=Zs;let{IS_ALLOWED_URI:te}=Zs,j=null;const Ne=q({},[...Vs,...Ao,...No,...ko,...Gs]);let Y=null;const oe=q({},[...Ys,...To,...qs,...gn]);let Q=Object.seal(wo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,D=null;const J=Object.seal(wo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ie=!0,Z=!0,ee=!1,ne=!0,ue=!1,ke=!0,Ie=!1,at=!1,it=!1,St=!1,Pn=!1,On=!1,ei=!0,ti=!1;const sm="user-content-";let zo=!0,Ut=!1,Ct={},Re=null;const Ro=q({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ni=null;const oi=q({},["audio","video","img","source","image","track"]);let Bo=null;const ri=q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),In="http://www.w3.org/1998/Math/MathML",Mn="http://www.w3.org/2000/svg",je="http://www.w3.org/1999/xhtml";let Et=je,Uo=!1,Ho=null;const am=q({},[In,Mn,je],Co);let Ln=q({},["mi","mo","mn","ms","mtext"]),Dn=q({},["annotation-xml"]);const im=q({},["title","style","font","a","script"]);let Ht=null;const lm=["application/xhtml+xml","text/html"],cm="text/html";let fe=null,At=null;const dm=n.createElement("form"),si=function(v){return v instanceof RegExp||v instanceof Function},Wo=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(At&&At===v)){if((!v||typeof v!="object")&&(v={}),v=ze(v),Ht=lm.indexOf(v.PARSER_MEDIA_TYPE)===-1?cm:v.PARSER_MEDIA_TYPE,fe=Ht==="application/xhtml+xml"?Co:hn,j=Oe(v,"ALLOWED_TAGS")?q({},v.ALLOWED_TAGS,fe):Ne,Y=Oe(v,"ALLOWED_ATTR")?q({},v.ALLOWED_ATTR,fe):oe,Ho=Oe(v,"ALLOWED_NAMESPACES")?q({},v.ALLOWED_NAMESPACES,Co):am,Bo=Oe(v,"ADD_URI_SAFE_ATTR")?q(ze(ri),v.ADD_URI_SAFE_ATTR,fe):ri,ni=Oe(v,"ADD_DATA_URI_TAGS")?q(ze(oi),v.ADD_DATA_URI_TAGS,fe):oi,Re=Oe(v,"FORBID_CONTENTS")?q({},v.FORBID_CONTENTS,fe):Ro,he=Oe(v,"FORBID_TAGS")?q({},v.FORBID_TAGS,fe):ze({}),D=Oe(v,"FORBID_ATTR")?q({},v.FORBID_ATTR,fe):ze({}),Ct=Oe(v,"USE_PROFILES")?v.USE_PROFILES:!1,ie=v.ALLOW_ARIA_ATTR!==!1,Z=v.ALLOW_DATA_ATTR!==!1,ee=v.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ue=v.SAFE_FOR_TEMPLATES||!1,ke=v.SAFE_FOR_XML!==!1,Ie=v.WHOLE_DOCUMENT||!1,St=v.RETURN_DOM||!1,Pn=v.RETURN_DOM_FRAGMENT||!1,On=v.RETURN_TRUSTED_TYPE||!1,it=v.FORCE_BODY||!1,ei=v.SANITIZE_DOM!==!1,ti=v.SANITIZE_NAMED_PROPS||!1,zo=v.KEEP_CONTENT!==!1,Ut=v.IN_PLACE||!1,te=v.ALLOWED_URI_REGEXP||Ks,Et=v.NAMESPACE||je,Ln=v.MATHML_TEXT_INTEGRATION_POINTS||Ln,Dn=v.HTML_INTEGRATION_POINTS||Dn,Q=v.CUSTOM_ELEMENT_HANDLING||{},v.CUSTOM_ELEMENT_HANDLING&&si(v.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=v.CUSTOM_ELEMENT_HANDLING.tagNameCheck),v.CUSTOM_ELEMENT_HANDLING&&si(v.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=v.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),v.CUSTOM_ELEMENT_HANDLING&&typeof v.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=v.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ue&&(Z=!1),Pn&&(St=!0),Ct&&(j=q({},Gs),Y=[],Ct.html===!0&&(q(j,Vs),q(Y,Ys)),Ct.svg===!0&&(q(j,Ao),q(Y,To),q(Y,gn)),Ct.svgFilters===!0&&(q(j,No),q(Y,To),q(Y,gn)),Ct.mathMl===!0&&(q(j,ko),q(Y,qs),q(Y,gn))),v.ADD_TAGS&&(typeof v.ADD_TAGS=="function"?J.tagCheck=v.ADD_TAGS:(j===Ne&&(j=ze(j)),q(j,v.ADD_TAGS,fe))),v.ADD_ATTR&&(typeof v.ADD_ATTR=="function"?J.attributeCheck=v.ADD_ATTR:(Y===oe&&(Y=ze(Y)),q(Y,v.ADD_ATTR,fe))),v.ADD_URI_SAFE_ATTR&&q(Bo,v.ADD_URI_SAFE_ATTR,fe),v.FORBID_CONTENTS&&(Re===Ro&&(Re=ze(Re)),q(Re,v.FORBID_CONTENTS,fe)),v.ADD_FORBID_CONTENTS&&(Re===Ro&&(Re=ze(Re)),q(Re,v.ADD_FORBID_CONTENTS,fe)),zo&&(j["#text"]=!0),Ie&&q(j,["html","head","body"]),j.table&&(q(j,["tbody"]),delete he.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Dt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Dt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=v.TRUSTED_TYPES_POLICY,T=x.createHTML("")}else x===void 0&&(x=Yu(m,r)),x!==null&&typeof T=="string"&&(T=x.createHTML(""));be&&be(v),At=v}},ai=q({},[...Ao,...No,...Fu]),ii=q({},[...ko,...$u]),um=function(v){let M=A(v);(!M||!M.tagName)&&(M={namespaceURI:Et,tagName:"template"});const z=hn(v.tagName),ae=hn(M.tagName);return Ho[v.namespaceURI]?v.namespaceURI===Mn?M.namespaceURI===je?z==="svg":M.namespaceURI===In?z==="svg"&&(ae==="annotation-xml"||Ln[ae]):!!ai[z]:v.namespaceURI===In?M.namespaceURI===je?z==="math":M.namespaceURI===Mn?z==="math"&&Dn[ae]:!!ii[z]:v.namespaceURI===je?M.namespaceURI===Mn&&!Dn[ae]||M.namespaceURI===In&&!Ln[ae]?!1:!ii[z]&&(im[z]||!ai[z]):!!(Ht==="application/xhtml+xml"&&Ho[v.namespaceURI]):!1},Be=function(v){Mt(t.removed,{element:v});try{A(v).removeChild(v)}catch{y(v)}},lt=function(v,M){try{Mt(t.removed,{attribute:M.getAttributeNode(v),from:M})}catch{Mt(t.removed,{attribute:null,from:M})}if(M.removeAttribute(v),v==="is")if(St||Pn)try{Be(M)}catch{}else try{M.setAttribute(v,"")}catch{}},li=function(v){let M=null,z=null;if(it)v="<remove></remove>"+v;else{const le=Eo(v,/^[\r\n\t ]+/);z=le&&le[0]}Ht==="application/xhtml+xml"&&Et===je&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const ae=x?x.createHTML(v):v;if(Et===je)try{M=new g().parseFromString(ae,Ht)}catch{}if(!M||!M.documentElement){M=L.createDocument(Et,"template",null);try{M.documentElement.innerHTML=Uo?T:ae}catch{}}const ge=M.body||M.documentElement;return v&&z&&ge.insertBefore(n.createTextNode(z),ge.childNodes[0]||null),Et===je?H.call(M,Ie?"html":"body")[0]:Ie?M.documentElement:ge},ci=function(v){return I.call(v.ownerDocument||v,v,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},jo=function(v){return v instanceof p&&(typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||!(v.attributes instanceof f)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function")},di=function(v){return typeof i=="function"&&v instanceof i};function Ve(R,v,M){mn(R,z=>{z.call(t,v,M,At)})}const ui=function(v){let M=null;if(Ve(B.beforeSanitizeElements,v,null),jo(v))return Be(v),!0;const z=fe(v.nodeName);if(Ve(B.uponSanitizeElement,v,{tagName:z,allowedTags:j}),ke&&v.hasChildNodes()&&!di(v.firstElementChild)&&ve(/<[/\w!]/g,v.innerHTML)&&ve(/<[/\w!]/g,v.textContent)||v.nodeType===$t.progressingInstruction||ke&&v.nodeType===$t.comment&&ve(/<[/\w]/g,v.data))return Be(v),!0;if(!(J.tagCheck instanceof Function&&J.tagCheck(z))&&(!j[z]||he[z])){if(!he[z]&&pi(z)&&(Q.tagNameCheck instanceof RegExp&&ve(Q.tagNameCheck,z)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(z)))return!1;if(zo&&!Re[z]){const ae=A(v)||v.parentNode,ge=E(v)||v.childNodes;if(ge&&ae){const le=ge.length;for(let xe=le-1;xe>=0;--xe){const Ge=h(ge[xe],!0);Ge.__removalCount=(v.__removalCount||0)+1,ae.insertBefore(Ge,C(v))}}}return Be(v),!0}return v instanceof c&&!um(v)||(z==="noscript"||z==="noembed"||z==="noframes")&&ve(/<\/no(script|embed|frames)/i,v.innerHTML)?(Be(v),!0):(ue&&v.nodeType===$t.text&&(M=v.textContent,mn([V,b,S],ae=>{M=Lt(M,ae," ")}),v.textContent!==M&&(Mt(t.removed,{element:v.cloneNode()}),v.textContent=M)),Ve(B.afterSanitizeElements,v,null),!1)},fi=function(v,M,z){if(ei&&(M==="id"||M==="name")&&(z in n||z in dm))return!1;if(!(Z&&!D[M]&&ve(k,M))){if(!(ie&&ve(_,M))){if(!(J.attributeCheck instanceof Function&&J.attributeCheck(M,v))){if(!Y[M]||D[M]){if(!(pi(v)&&(Q.tagNameCheck instanceof RegExp&&ve(Q.tagNameCheck,v)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(v))&&(Q.attributeNameCheck instanceof RegExp&&ve(Q.attributeNameCheck,M)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(M,v))||M==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&ve(Q.tagNameCheck,z)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(z))))return!1}else if(!Bo[M]){if(!ve(te,Lt(z,N,""))){if(!((M==="src"||M==="xlink:href"||M==="href")&&v!=="script"&&Iu(z,"data:")===0&&ni[v])){if(!(ee&&!ve(O,Lt(z,N,"")))){if(z)return!1}}}}}}}return!0},pi=function(v){return v!=="annotation-xml"&&Eo(v,K)},mi=function(v){Ve(B.beforeSanitizeAttributes,v,null);const{attributes:M}=v;if(!M||jo(v))return;const z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let ae=M.length;for(;ae--;){const ge=M[ae],{name:le,namespaceURI:xe,value:Ge}=ge,Nt=fe(le),Vo=Ge;let pe=le==="value"?Vo:Mu(Vo);if(z.attrName=Nt,z.attrValue=pe,z.keepAttr=!0,z.forceKeepAttr=void 0,Ve(B.uponSanitizeAttribute,v,z),pe=z.attrValue,ti&&(Nt==="id"||Nt==="name")&&(lt(le,v),pe=sm+pe),ke&&ve(/((--!?|])>)|<\/(style|title|textarea)/i,pe)){lt(le,v);continue}if(Nt==="attributename"&&Eo(pe,"href")){lt(le,v);continue}if(z.forceKeepAttr)continue;if(!z.keepAttr){lt(le,v);continue}if(!ne&&ve(/\/>/i,pe)){lt(le,v);continue}ue&&mn([V,b,S],gi=>{pe=Lt(pe,gi," ")});const hi=fe(v.nodeName);if(!fi(hi,Nt,pe)){lt(le,v);continue}if(x&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!xe)switch(m.getAttributeType(hi,Nt)){case"TrustedHTML":{pe=x.createHTML(pe);break}case"TrustedScriptURL":{pe=x.createScriptURL(pe);break}}if(pe!==Vo)try{xe?v.setAttributeNS(xe,le,pe):v.setAttribute(le,pe),jo(v)?Be(v):js(t.removed)}catch{lt(le,v)}}Ve(B.afterSanitizeAttributes,v,null)},fm=function R(v){let M=null;const z=ci(v);for(Ve(B.beforeSanitizeShadowDOM,v,null);M=z.nextNode();)Ve(B.uponSanitizeShadowNode,M,null),ui(M),mi(M),M.content instanceof s&&R(M.content);Ve(B.afterSanitizeShadowDOM,v,null)};return t.sanitize=function(R){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=null,z=null,ae=null,ge=null;if(Uo=!R,Uo&&(R="<!-->"),typeof R!="string"&&!di(R))if(typeof R.toString=="function"){if(R=R.toString(),typeof R!="string")throw Dt("dirty is not a string, aborting")}else throw Dt("toString is not a function");if(!t.isSupported)return R;if(at||Wo(v),t.removed=[],typeof R=="string"&&(Ut=!1),Ut){if(R.nodeName){const Ge=fe(R.nodeName);if(!j[Ge]||he[Ge])throw Dt("root node is forbidden and cannot be sanitized in-place")}}else if(R instanceof i)M=li("<!---->"),z=M.ownerDocument.importNode(R,!0),z.nodeType===$t.element&&z.nodeName==="BODY"||z.nodeName==="HTML"?M=z:M.appendChild(z);else{if(!St&&!ue&&!Ie&&R.indexOf("<")===-1)return x&&On?x.createHTML(R):R;if(M=li(R),!M)return St?null:On?T:""}M&&it&&Be(M.firstChild);const le=ci(Ut?R:M);for(;ae=le.nextNode();)ui(ae),mi(ae),ae.content instanceof s&&fm(ae.content);if(Ut)return R;if(St){if(Pn)for(ge=P.call(M.ownerDocument);M.firstChild;)ge.appendChild(M.firstChild);else ge=M;return(Y.shadowroot||Y.shadowrootmode)&&(ge=W.call(o,ge,!0)),ge}let xe=Ie?M.outerHTML:M.innerHTML;return Ie&&j["!doctype"]&&M.ownerDocument&&M.ownerDocument.doctype&&M.ownerDocument.doctype.name&&ve(Xs,M.ownerDocument.doctype.name)&&(xe="<!DOCTYPE "+M.ownerDocument.doctype.name+`>
62
- `+xe),ue&&mn([V,b,S],Ge=>{xe=Lt(xe,Ge," ")}),x&&On?x.createHTML(xe):xe},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wo(R),at=!0},t.clearConfig=function(){At=null,at=!1},t.isValidAttribute=function(R,v,M){At||Wo({});const z=fe(R),ae=fe(v);return fi(z,ae,M)},t.addHook=function(R,v){typeof v=="function"&&Mt(B[R],v)},t.removeHook=function(R,v){if(v!==void 0){const M=Pu(B[R],v);return M===-1?void 0:Ou(B[R],M,1)[0]}return js(B[R])},t.removeHooks=function(R){B[R]=[]},t.removeAllHooks=function(){B=Qs()},t}var qu=Js();const Ku=({editor:e,error:t})=>{const[,n]=U.useState(0);if(U.useEffect(()=>{if(!e)return;const s=()=>{n(a=>a+1)};return e.on("transaction",s),()=>{e.off("transaction",s)}},[e]),!e)return null;const o=s=>`p-2 rounded-sm transition-colors duration-200 focus-visible:ring-1 focus-visible:ring-ring/40 focus-visible:outline-none ${s?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground text-muted-foreground"}`.trim(),r=()=>l.jsx("div",{className:"w-px h-4 bg-border mx-1 self-center","aria-hidden":"true"});return l.jsxs("div",{className:`flex flex-wrap gap-1 p-1.5 border-b bg-muted/30 rounded-t-lg transition-colors ${t?"border-red-500/50":"border-input"}`,role:"toolbar","aria-label":"Text formatting options",children:[l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBold().run(),className:o(e.isActive("bold")),"aria-label":"Bold","aria-pressed":e.isActive("bold"),children:l.jsx(_i,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleItalic().run(),className:o(e.isActive("italic")),"aria-label":"Italic","aria-pressed":e.isActive("italic"),children:l.jsx(Ui,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleUnderline().run(),className:o(e.isActive("underline")),"aria-label":"Underline","aria-pressed":e.isActive("underline"),children:l.jsx(Ki,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleStrike().run(),className:o(e.isActive("strike")),"aria-label":"Strikethrough","aria-pressed":e.isActive("strike"),children:l.jsx(qi,{size:14})})]}),l.jsx(r,{}),l.jsx("div",{className:"flex gap-1",children:[1,2,3].map(s=>l.jsxs("button",{type:"button",onClick:()=>e.chain().focus().toggleHeading({level:s}).run(),className:o(e.isActive("heading",{level:s})),"aria-label":`Heading level ${s}`,"aria-pressed":e.isActive("heading",{level:s}),children:[s===1&&l.jsx($i,{size:16}),s===2&&l.jsx(zi,{size:16}),s===3&&l.jsx(Ri,{size:14})]},s))}),l.jsx(r,{}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBulletList().run(),className:o(e.isActive("bulletList")),"aria-label":"Bullet list","aria-pressed":e.isActive("bulletList"),children:l.jsx(Wi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleOrderedList().run(),className:o(e.isActive("orderedList")),"aria-label":"Numbered list","aria-pressed":e.isActive("orderedList"),children:l.jsx(Hi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBlockquote().run(),className:o(e.isActive("blockquote")),"aria-label":"Quote","aria-pressed":e.isActive("blockquote"),children:l.jsx(Vi,{size:14})})]}),l.jsx(r,{}),l.jsx("div",{className:"flex gap-1",children:l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleCodeBlock().run(),className:o(e.isActive("codeBlock")),"aria-label":"Code block","aria-pressed":e.isActive("codeBlock"),children:l.jsx(Fi,{size:14})})}),l.jsxs("div",{className:"flex gap-1 ml-auto",children:[l.jsx(r,{}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().undo().run(),className:o(!1),"aria-label":"Undo",children:l.jsx(Xi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().redo().run(),className:o(!1),"aria-label":"Redo",children:l.jsx(Gi,{size:14})})]})]})};function Xu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=!!s,i=t[e.name],c=typeof i=="string"?i:e.content||"",d=Yo.useEditor({extensions:[yi.configure({heading:{levels:[1,2,3]},codeBlock:!0,blockquote:!0,strike:!0}),wi,xi.configure({limit:e.maxLength||null})],content:qu.sanitize(c),editable:!a,onUpdate:({editor:f})=>{const p=f.getHTML(),g=f.getText().trim().length===0;n(e.name,g?"":p)},onBlur:()=>{o(e.name)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[150px] p-4 text-foreground",role:"textbox","aria-multiline":"true","aria-label":e.label||"Rich text editor","aria-readonly":a?"true":"false","aria-invalid":r?"true":"false",id:e.name}}});return U.useEffect(()=>{d&&t[e.name]!==d.getHTML()&&d.commands.setContent(t[e.name]||"")},[t[e.name],d]),U.useEffect(()=>{d&&d.setEditable(!a)},[a,d]),l.jsxs("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,id:`${e.name}_id`,children:[e.label&&l.jsx("label",{htmlFor:e.name,className:`block text-sm font-medium mb-1.5 ${r?"text-red-500":"text-foreground"}`,children:e.label}),l.jsxs("div",{className:`w-full border rounded-lg overflow-hidden transition-all duration-200 ${r?"border-red-500 focus-within:ring-1 focus-within:ring-red-500":"border-input focus-within:border-ring/40 focus-within:shadow-[0_0_0_1px_rgba(var(--ring),0.1)]"} ${a?"opacity-70 bg-muted cursor-not-allowed":"bg-background"}`,children:[!a&&l.jsx(Ku,{editor:d,error:r}),l.jsx(Yo.EditorContent,{editor:d}),l.jsx("div",{className:`flex justify-end px-4 py-2 text-[10px] uppercase tracking-wider ${r?"bg-red-50/50 border-red-500/50 text-red-500":"bg-muted/20 border-input/50 text-muted-foreground"}`,children:d&&l.jsxs("div",{"aria-live":"polite",children:[d.storage.characterCount.characters(),e.maxLength?` / ${e.maxLength}`:""," characters"]})})]})]})}function Zu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r}){const s=typeof e.disabled=="function"?e.disabled(t):e.disabled,a=e.options||[],i=e.inline||e.layout==="inline";if(a.length>0){const c=Array.isArray(t[e.name])?t[e.name]:[],d=(p,g)=>{let m;g?m=[...c,p]:m=c.filter(w=>w!==p),n(e.name,m)},f=r&&e.required&&c.length===0;return l.jsx(l.Fragment,{children:l.jsx("div",{className:i?"grid grid-cols-4 gap-3 mt-3":"space-y-3 mt-3",children:a.map(p=>{const g=typeof p=="object"?p.value:p,m=typeof p=="object"?p.label:p,w=typeof p=="object"?p.description:null,h=`${e.name}-${g}`,y=c.includes(g);return l.jsxs("div",{className:"relative flex items-start",children:[l.jsx("div",{className:"flex h-6 items-center",children:l.jsx("input",{...e.props,type:"checkbox",id:h,checked:y,onChange:C=>d(g,C.target.checked),onBlur:()=>o(e.name),disabled:s,className:`
62
+ `+xe),ue&&mn([V,b,S],Ge=>{xe=Lt(xe,Ge," ")}),x&&On?x.createHTML(xe):xe},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wo(R),at=!0},t.clearConfig=function(){At=null,at=!1},t.isValidAttribute=function(R,v,M){At||Wo({});const z=fe(R),ae=fe(v);return fi(z,ae,M)},t.addHook=function(R,v){typeof v=="function"&&Mt(B[R],v)},t.removeHook=function(R,v){if(v!==void 0){const M=Pu(B[R],v);return M===-1?void 0:Ou(B[R],M,1)[0]}return js(B[R])},t.removeHooks=function(R){B[R]=[]},t.removeAllHooks=function(){B=Qs()},t}var qu=Js();const Ku=({editor:e,error:t})=>{const[,n]=U.useState(0);if(U.useEffect(()=>{if(!e)return;const s=()=>n(a=>a+1);return e.on("transaction",s),()=>e.off("transaction",s)},[e]),!e)return null;const o=s=>`p-2 rounded-sm transition-colors duration-200 focus-visible:ring-1 focus-visible:ring-ring/40 focus-visible:outline-none ${s?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground text-muted-foreground"}`.trim(),r=()=>l.jsx("div",{className:"w-px h-4 bg-border mx-1 self-center","aria-hidden":"true"});return l.jsxs("div",{className:`flex flex-wrap gap-1 p-1.5 border-b bg-muted/30 rounded-t-lg transition-colors ${t?"border-red-500/50":"border-input"}`,role:"toolbar","aria-label":"Text formatting options",children:[l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBold().run(),className:o(e.isActive("bold")),"aria-label":"Bold","aria-pressed":e.isActive("bold"),children:l.jsx(_i,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleItalic().run(),className:o(e.isActive("italic")),"aria-label":"Italic","aria-pressed":e.isActive("italic"),children:l.jsx(Ui,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleUnderline().run(),className:o(e.isActive("underline")),"aria-label":"Underline","aria-pressed":e.isActive("underline"),children:l.jsx(Ki,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleStrike().run(),className:o(e.isActive("strike")),"aria-label":"Strikethrough","aria-pressed":e.isActive("strike"),children:l.jsx(qi,{size:14})})]}),l.jsx(r,{}),l.jsx("div",{className:"flex gap-1",children:[1,2,3].map(s=>l.jsxs("button",{type:"button",onClick:()=>e.chain().focus().toggleHeading({level:s}).run(),className:o(e.isActive("heading",{level:s})),"aria-label":`Heading level ${s}`,"aria-pressed":e.isActive("heading",{level:s}),children:[s===1&&l.jsx($i,{size:16}),s===2&&l.jsx(zi,{size:16}),s===3&&l.jsx(Ri,{size:14})]},s))}),l.jsx(r,{}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBulletList().run(),className:o(e.isActive("bulletList")),"aria-label":"Bullet list","aria-pressed":e.isActive("bulletList"),children:l.jsx(Wi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleOrderedList().run(),className:o(e.isActive("orderedList")),"aria-label":"Numbered list","aria-pressed":e.isActive("orderedList"),children:l.jsx(Hi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleBlockquote().run(),className:o(e.isActive("blockquote")),"aria-label":"Quote","aria-pressed":e.isActive("blockquote"),children:l.jsx(Vi,{size:14})})]}),l.jsx(r,{}),l.jsx("div",{className:"flex gap-1",children:l.jsx("button",{type:"button",onClick:()=>e.chain().focus().toggleCodeBlock().run(),className:o(e.isActive("codeBlock")),"aria-label":"Code block","aria-pressed":e.isActive("codeBlock"),children:l.jsx(Fi,{size:14})})}),l.jsxs("div",{className:"flex gap-1 ml-auto",children:[l.jsx(r,{}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().undo().run(),className:o(!1),"aria-label":"Undo",children:l.jsx(Xi,{size:14})}),l.jsx("button",{type:"button",onClick:()=>e.chain().focus().redo().run(),className:o(!1),"aria-label":"Redo",children:l.jsx(Gi,{size:14})})]})]})};function Xu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r,disabled:s}){const a=!!s,i=t[e.name],c=typeof i=="string"?i:e.content||"",d=Yo.useEditor({extensions:[yi.configure({heading:{levels:[1,2,3]},codeBlock:!0,blockquote:!0,strike:!0}),wi,xi.configure({limit:e.maxLength||null})],content:qu.sanitize(c),editable:!a,onUpdate:({editor:f})=>{const p=f.getHTML(),g=f.getText().trim().length===0;n(e.name,g?"":p)},onBlur:()=>{o(e.name)},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[150px] p-4 text-foreground",role:"textbox","aria-multiline":"true","aria-label":e.label||"Rich text editor","aria-readonly":a?"true":"false","aria-invalid":r?"true":"false",id:e.name}}});return U.useEffect(()=>{d&&t[e.name]!==d.getHTML()&&d.commands.setContent(t[e.name]||"")},[t[e.name],d]),U.useEffect(()=>{d&&d.setEditable(!a)},[a,d]),l.jsxs("div",{className:`mb-4 ${e.fieldClass||"col-span-full"}`,id:`${e.name}_id`,children:[e.label&&l.jsx("label",{htmlFor:e.name,className:`block text-sm font-medium mb-1.5 ${r?"text-red-500":"text-foreground"}`,children:e.label}),l.jsxs("div",{className:`w-full border rounded-lg overflow-hidden transition-all duration-200 ${r?"border-red-500 focus-within:ring-1 focus-within:ring-red-500":"border-input focus-within:border-ring/40 focus-within:shadow-[0_0_0_1px_rgba(var(--ring),0.1)]"} ${a?"opacity-70 bg-muted cursor-not-allowed":"bg-background"}`,children:[!a&&l.jsx(Ku,{editor:d,error:r}),l.jsx(Yo.EditorContent,{editor:d}),l.jsx("div",{className:`flex justify-end px-4 py-2 text-[10px] uppercase tracking-wider ${r?"bg-red-50/50 border-red-500/50 text-red-500":"bg-muted/20 border-input/50 text-muted-foreground"}`,children:d&&l.jsxs("div",{"aria-live":"polite",children:[d.storage.characterCount.characters(),e.maxLength?` / ${e.maxLength}`:""," characters"]})})]})]})}function Zu({field:e,formValues:t,handleChange:n,handleBlur:o,error:r}){const s=typeof e.disabled=="function"?e.disabled(t):e.disabled,a=e.options||[],i=e.inline||e.layout==="inline";if(a.length>0){const c=Array.isArray(t[e.name])?t[e.name]:[],d=(p,g)=>{let m;g?m=[...c,p]:m=c.filter(w=>w!==p),n(e.name,m)},f=r&&e.required&&c.length===0;return l.jsx(l.Fragment,{children:l.jsx("div",{className:i?"grid grid-cols-4 gap-3 mt-3":"space-y-3 mt-3",children:a.map(p=>{const g=typeof p=="object"?p.value:p,m=typeof p=="object"?p.label:p,w=typeof p=="object"?p.description:null,h=`${e.name}-${g}`,y=c.includes(g);return l.jsxs("div",{className:"relative flex items-start",children:[l.jsx("div",{className:"flex h-6 items-center",children:l.jsx("input",{...e.props,type:"checkbox",id:h,checked:y,onChange:C=>d(g,C.target.checked),onBlur:()=>o(e.name),disabled:s,className:`
63
63
  size-4 rounded border-gray-300 text-blue-600 transition-all
64
64
  focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
65
65
  ${s?"opacity-50 cursor-not-allowed bg-gray-100":"cursor-pointer hover:border-blue-400"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ynotsoft-dynamic-form",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "description": "DynamicForm React component library",
5
5
  "type": "module",
6
6
  "main": "./dist/dynamic-form.umd.cjs",
@@ -30,10 +30,12 @@
30
30
  "preview": "vite preview"
31
31
  },
32
32
  "peerDependencies": {
33
- "@tiptap/react": "^2.0.0",
34
- "@tiptap/starter-kit": "^2.0.0",
35
- "@tiptap/extension-underline": "^2.0.0",
36
- "@tiptap/extension-character-count": "^2.0.0",
33
+ "@tiptap/react": "^3.0.0",
34
+ "@tiptap/core": "^3.0.0",
35
+ "@tiptap/pm": "^3.0.0",
36
+ "@tiptap/starter-kit": "^3.0.0",
37
+ "@tiptap/extension-underline": "^3.0.0",
38
+ "@tiptap/extension-character-count": "^3.0.0",
37
39
  "dayjs": "^1.11.0",
38
40
  "react": "^18.2.0 || ^19.0.0",
39
41
  "react-day-picker": "^8.0.0 || ^9.0.0",