react-creative-text
Version:
A powerful React component for creating beautiful, customizable text with SVG. Support for Google Fonts, strokes, shadows, 1000+ fonts families and more.
3 lines (2 loc) • 18.2 kB
JavaScript
import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRef as e,useState as i,useMemo as o,useCallback as a,useEffect as s}from"react";let r=0;function c(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var l,h={exports:{}};l=h,function(){function t(t,n,e){return t.call.apply(t.bind,arguments)}function n(t,n,e){if(!t)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(e,i),t.apply(n,e)}}return function(){return t.apply(n,arguments)}}function e(i,o,a){return(e=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?t:n).apply(null,arguments)}var i=Date.now||function(){return+new Date};function o(t,n){this.a=t,this.o=n||t,this.c=this.o.document}var a=!!window.FontFace;function s(t,n,e,i){if(n=t.c.createElement(n),e)for(var o in e)e.hasOwnProperty(o)&&("style"==o?n.style.cssText=e[o]:n.setAttribute(o,e[o]));return i&&n.appendChild(t.c.createTextNode(i)),n}function r(t,n,e){(t=t.c.getElementsByTagName(n)[0])||(t=document.documentElement),t.insertBefore(e,t.lastChild)}function c(t){t.parentNode&&t.parentNode.removeChild(t)}function h(t,n,e){n=n||[],e=e||[];for(var i=t.className.split(/\s+/),o=0;o<n.length;o+=1){for(var a=!1,s=0;s<i.length;s+=1)if(n[o]===i[s]){a=!0;break}a||i.push(n[o])}for(n=[],o=0;o<i.length;o+=1){for(a=!1,s=0;s<e.length;s+=1)if(i[o]===e[s]){a=!0;break}a||n.push(i[o])}t.className=n.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function f(t,n){for(var e=t.className.split(/\s+/),i=0,o=e.length;i<o;i++)if(e[i]==n)return!0;return!1}function u(t,n,e){function i(){h&&o&&c&&(h(l),h=null)}n=s(t,"link",{rel:"stylesheet",href:n,media:"all"});var o=!1,c=!0,l=null,h=e||null;a?(n.onload=function(){o=!0,i()},n.onerror=function(){o=!0,l=Error("Stylesheet failed to load"),i()}):setTimeout(function(){o=!0,i()},0),r(t,"head",n)}function d(t,n,e,i){var o=t.c.getElementsByTagName("head")[0];if(o){var a=s(t,"script",{src:n}),r=!1;return a.onload=a.onreadystatechange=function(){r||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(r=!0,e&&e(null),a.onload=a.onreadystatechange=null,"HEAD"==a.parentNode.tagName&&o.removeChild(a))},o.appendChild(a),setTimeout(function(){r||(r=!0,e&&e(Error("Script load timeout")))},i||5e3),a}return null}function p(){this.a=0,this.c=null}function g(t){return t.a++,function(){t.a--,w(t)}}function m(t,n){t.c=n,w(t)}function w(t){0==t.a&&t.c&&(t.c(),t.c=null)}function v(t){this.a=t||"-"}function y(t,n){this.c=t,this.f=4,this.a="n";var e=(n||"n4").match(/^([nio])([1-9])$/i);e&&(this.a=e[1],this.f=parseInt(e[2],10))}function x(t){var n=[];t=t.split(/,\s*/);for(var e=0;e<t.length;e++){var i=t[e].replace(/['"]/g,"");-1!=i.indexOf(" ")||/^\d/.test(i)?n.push("'"+i+"'"):n.push(i)}return n.join(",")}function b(t){return t.a+t.f}function k(t){var n="normal";return"o"===t.a?n="oblique":"i"===t.a&&(n="italic"),n}function $(t){var n=4,e="n",i=null;return t&&((i=t.match(/(normal|oblique|italic)/i))&&i[1]&&(e=i[1].substr(0,1).toLowerCase()),(i=t.match(/([1-9]00|normal|bold)/i))&&i[1]&&(/bold/i.test(i[1])?n=7:/[1-9]00/.test(i[1])&&(n=parseInt(i[1].substr(0,1),10)))),e+n}function j(t,n){this.c=t,this.f=t.o.document.documentElement,this.h=n,this.a=new v("-"),this.j=!1!==n.events,this.g=!1!==n.classes}function _(t){if(t.g){var n=f(t.f,t.a.c("wf","active")),e=[],i=[t.a.c("wf","loading")];n||e.push(t.a.c("wf","inactive")),h(t.f,e,i)}S(t,"inactive")}function S(t,n,e){t.j&&t.h[n]&&(e?t.h[n](e.c,b(e)):t.h[n]())}function T(){this.c={}}function C(t,n){this.c=t,this.f=n,this.a=s(this.c,"span",{"aria-hidden":"true"},this.f)}function M(t){r(t.c,"body",t.a)}function E(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+x(t.c)+";font-style:"+k(t)+";font-weight:"+t.f+"00;"}function W(t,n,e,i,o,a){this.g=t,this.j=n,this.a=i,this.c=e,this.f=o||3e3,this.h=a||void 0}function A(t,n,e,i,o,a,s){this.v=t,this.B=n,this.c=e,this.a=i,this.s=s||"BESbswy",this.f={},this.w=o||3e3,this.u=a||null,this.m=this.j=this.h=this.g=null,this.g=new C(this.c,this.s),this.h=new C(this.c,this.s),this.j=new C(this.c,this.s),this.m=new C(this.c,this.s),t=E(t=new y(this.a.c+",serif",b(this.a))),this.g.a.style.cssText=t,t=E(t=new y(this.a.c+",sans-serif",b(this.a))),this.h.a.style.cssText=t,t=E(t=new y("serif",b(this.a))),this.j.a.style.cssText=t,t=E(t=new y("sans-serif",b(this.a))),this.m.a.style.cssText=t,M(this.g),M(this.h),M(this.j),M(this.m)}v.prototype.c=function(t){for(var n=[],e=0;e<arguments.length;e++)n.push(arguments[e].replace(/[\W_]+/g,"").toLowerCase());return n.join(this.a)},W.prototype.start=function(){var t=this.c.o.document,n=this,e=i(),o=new Promise(function(o,a){!function s(){i()-e>=n.f?a():t.fonts.load(function(t){return k(t)+" "+t.f+"00 300px "+x(t.c)}(n.a),n.h).then(function(t){1<=t.length?o():setTimeout(s,25)},function(){a()})}()}),a=null,s=new Promise(function(t,e){a=setTimeout(e,n.f)});Promise.race([s,o]).then(function(){a&&(clearTimeout(a),a=null),n.g(n.a)},function(){n.j(n.a)})};var B={D:"serif",C:"sans-serif"},F=null;function N(){if(null===F){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);F=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return F}function O(t,n,e){for(var i in B)if(B.hasOwnProperty(i)&&n===t.f[B[i]]&&e===t.f[B[i]])return!0;return!1}function I(t){var n,o=t.g.a.offsetWidth,a=t.h.a.offsetWidth;(n=o===t.f.serif&&a===t.f["sans-serif"])||(n=N()&&O(t,o,a)),n?i()-t.A>=t.w?N()&&O(t,o,a)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?D(t,t.v):D(t,t.B):function(t){setTimeout(e(function(){I(this)},t),50)}(t):D(t,t.v)}function D(t,n){setTimeout(e(function(){c(this.g.a),c(this.h.a),c(this.j.a),c(this.m.a),n(this.a)},t),0)}function L(t,n,e){this.c=t,this.a=n,this.f=0,this.m=this.j=!1,this.s=e}A.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=i(),I(this)};var P=null;function z(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&h(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),S(t,"active")):_(t.a))}function H(t){this.j=t,this.a=new T,this.h=0,this.f=this.g=!0}function X(t,n,i,o,a){var s=0==--t.h;(t.f||t.g)&&setTimeout(function(){var t=a||null,r=o||{};if(0===i.length&&s)_(n.a);else{n.f+=i.length,s&&(n.j=s);var c,l=[];for(c=0;c<i.length;c++){var f=i[c],u=r[f.c],d=n.a,p=f;if(d.g&&h(d.f,[d.a.c("wf",p.c,b(p).toString(),"loading")]),S(d,"fontloading",p),d=null,null===P)if(window.FontFace){p=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var g=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);P=p?42<parseInt(p[1],10):!g}else P=!1;d=P?new W(e(n.g,n),e(n.h,n),n.c,f,n.s,u):new A(e(n.g,n),e(n.h,n),n.c,f,n.s,t,u),l.push(d)}for(c=0;c<l.length;c++)l[c].start()}},0)}function Y(t,n){this.c=t,this.a=n}function R(t,n){this.c=t,this.a=n}function q(t,n){this.c=t||G,this.a=[],this.f=[],this.g=n||""}L.prototype.g=function(t){var n=this.a;n.g&&h(n.f,[n.a.c("wf",t.c,b(t).toString(),"active")],[n.a.c("wf",t.c,b(t).toString(),"loading"),n.a.c("wf",t.c,b(t).toString(),"inactive")]),S(n,"fontactive",t),this.m=!0,z(this)},L.prototype.h=function(t){var n=this.a;if(n.g){var e=f(n.f,n.a.c("wf",t.c,b(t).toString(),"active")),i=[],o=[n.a.c("wf",t.c,b(t).toString(),"loading")];e||i.push(n.a.c("wf",t.c,b(t).toString(),"inactive")),h(n.f,i,o)}S(n,"fontinactive",t),z(this)},H.prototype.load=function(t){this.c=new o(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes,function(t,n,e){var i=[],o=e.timeout;!function(t){t.g&&h(t.f,[t.a.c("wf","loading")]),S(t,"loading")}(n),i=function(t,n,e){var i,o=[];for(i in n)if(n.hasOwnProperty(i)){var a=t.c[i];a&&o.push(a(n[i],e))}return o}(t.a,e,t.c);var a=new L(t.c,n,o);for(t.h=i.length,n=0,e=i.length;n<e;n++)i[n].load(function(n,e,i){X(t,a,n,e,i)})}(this,new j(this.c,t),t)},Y.prototype.load=function(t){function n(){if(a["__mti_fntLst"+i]){var e,o=a["__mti_fntLst"+i](),s=[];if(o)for(var r=0;r<o.length;r++){var c=o[r].fontfamily;null!=o[r].fontStyle&&null!=o[r].fontWeight?(e=o[r].fontStyle+o[r].fontWeight,s.push(new y(c,e))):s.push(new y(c))}t(s)}else setTimeout(function(){n()},50)}var e=this,i=e.a.projectId,o=e.a.version;if(i){var a=e.c.o;d(this.c,(e.a.api||"https://fast.fonts.net/jsapi")+"/"+i+".js"+(o?"?v="+o:""),function(o){o?t([]):(a["__MonotypeConfiguration__"+i]=function(){return e.a},n())}).id="__MonotypeAPIScript__"+i}else t([])},R.prototype.load=function(t){var n,e,i=this.a.urls||[],o=this.a.families||[],a=this.a.testStrings||{},s=new p;for(n=0,e=i.length;n<e;n++)u(this.c,i[n],g(s));var r=[];for(n=0,e=o.length;n<e;n++)if((i=o[n].split(":"))[1])for(var c=i[1].split(","),l=0;l<c.length;l+=1)r.push(new y(i[0],c[l]));else r.push(new y(i[0]));m(s,function(){t(r,a)})};var G="https://fonts.googleapis.com/css";function K(t){this.f=t,this.a=[],this.c={}}var U={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},V={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},J={i:"i",italic:"i",n:"n",normal:"n"},Q=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function Z(t,n){this.c=t,this.a=n}var tt={Arimo:!0,Cousine:!0,Tinos:!0};function nt(t,n){this.c=t,this.a=n}function et(t,n){this.c=t,this.f=n,this.a=[]}Z.prototype.load=function(t){var n=new p,e=this.c,i=new q(this.a.api,this.a.text),o=this.a.families;!function(t,n){for(var e=n.length,i=0;i<e;i++){var o=n[i].split(":");3==o.length&&t.f.push(o.pop());var a="";2==o.length&&""!=o[1]&&(a=":"),t.a.push(o.join(a))}}(i,o);var a=new K(o);!function(t){for(var n=t.f.length,e=0;e<n;e++){var i=t.f[e].split(":"),o=i[0].replace(/\+/g," "),a=["n4"];if(2<=i.length){var s;if(s=[],r=i[1])for(var r,c=(r=r.split(",")).length,l=0;l<c;l++){var h;if((h=r[l]).match(/^[\w-]+$/))if(null==(f=Q.exec(h.toLowerCase())))h="";else{if(h=null==(h=f[2])||""==h?"n":J[h],null==(f=f[1])||""==f)f="4";else var f=V[f]||(isNaN(f)?"4":f.substr(0,1));h=[h,f].join("")}else h="";h&&s.push(h)}0<s.length&&(a=s),3==i.length&&(s=[],0<(i=(i=i[2])?i.split(","):s).length&&(i=U[i[0]])&&(t.c[o]=i))}for(t.c[o]||(i=U[o])&&(t.c[o]=i),i=0;i<a.length;i+=1)t.a.push(new y(o,a[i]))}}(a),u(e,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var n=t.a.length,e=[],i=0;i<n;i++)e.push(t.a[i].replace(/ /g,"+"));return n=t.c+"?family="+e.join("%7C"),0<t.f.length&&(n+="&subset="+t.f.join(",")),0<t.g.length&&(n+="&text="+encodeURIComponent(t.g)),n}(i),g(n)),m(n,function(){t(a.a,a.c,tt)})},nt.prototype.load=function(t){var n=this.a.id,e=this.c.o;n?d(this.c,(this.a.api||"https://use.typekit.net")+"/"+n+".js",function(n){if(n)t([]);else if(e.Typekit&&e.Typekit.config&&e.Typekit.config.fn){n=e.Typekit.config.fn;for(var i=[],o=0;o<n.length;o+=2)for(var a=n[o],s=n[o+1],r=0;r<s.length;r++)i.push(new y(a,s[r]));try{e.Typekit.load({events:!1,classes:!1,async:!0})}catch(t){}t(i)}},2e3):t([])},et.prototype.load=function(t){var n=this.f.id,e=this.c.o,i=this;n?(e.__webfontfontdeckmodule__||(e.__webfontfontdeckmodule__={}),e.__webfontfontdeckmodule__[n]=function(n,e){for(var o=0,a=e.fonts.length;o<a;++o){var s=e.fonts[o];i.a.push(new y(s.name,$("font-weight:"+s.weight+";font-style:"+s.style)))}t(i.a)},d(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(t){return t.o.location.hostname||t.a.location.hostname}(this.c)+"/"+n+".js",function(n){n&&t([])})):t([])};var it=new H(window);it.a.c.custom=function(t,n){return new R(n,t)},it.a.c.fontdeck=function(t,n){return new et(n,t)},it.a.c.monotype=function(t,n){return new Y(n,t)},it.a.c.typekit=function(t,n){return new nt(n,t)},it.a.c.google=function(t,n){return new Z(n,t)};var ot={load:e(it.load,it)};l.exports?l.exports=ot:(window.WebFont=ot,window.WebFontConfig&&it.load(window.WebFontConfig))}();var f=c(h.exports);const u=new Set;const d=({children:c,fontFamily:l="Pacifico",fontSize:h="12px",color:d="white",strokeColor:p="black",strokeWidth:g=8,shadow:m=!0,gradient:w,animation:v="none",responsive:y=!0,maxWidth:x,className:b="",style:k={},onFontLoad:$,onFontError:j,fallbackFont:_="serif",letterSpacing:S="normal",lineHeight:T=1.2,opacity:C=1,rotation:M=0,skew:E={x:0,y:0},textTransform:W="none",...A})=>{const[B,F]=i(!1),[N,O]=i(!1),[I,D]=i({width:1e3,height:300}),[L,P]=i([]),[z,H]=i(!1),X=e(null),Y=function(t="ct"){const n=e();return n.current||(r+=1,n.current=`${t}-${r}`),n.current}(),R=`${Y}-gradient`,q=`${Y}-filter`,G=o(()=>"number"==typeof h?`${h}px`:h,[h]),K=o(()=>"number"==typeof x?`${x}px`:x,[x]),U=o(()=>"number"==typeof S?`${S}px`:S,[S]),V=o(()=>{const t=G.match(/(\d+)/);return t?parseInt(t[1],10):72},[G]),J=a((t,n)=>{try{X.current||(X.current=document.createElement("canvas"));const e=X.current.getContext("2d");if(e){e.font=`${G} "${n}", ${_}`;const i=e.measureText(t),o=i.width,a=i.actualBoundingBoxAscent+i.actualBoundingBoxDescent||i.fontBoundingBoxAscent+i.fontBoundingBoxDescent||V;if(o>0&&a>0)return{width:Math.ceil(o),height:Math.ceil(a)}}}catch{console.warn("Canvas text measurement failed, falling back to DOM.")}try{const e=document.createElement("span");e.style.cssText=`\n font: ${G} "${n}", ${_};\n visibility: hidden;\n position: absolute;\n top: -9999px;\n left: -9999px;\n white-space: nowrap;\n letter-spacing: ${U};\n line-height: 1;\n display: inline-block;\n `,e.textContent=t||"M",document.body.appendChild(e);const i=e.getBoundingClientRect(),o=i.width||e.offsetWidth||e.scrollWidth,a=i.height||e.offsetHeight||e.scrollHeight;return document.body.removeChild(e),{width:Math.ceil(o)||t.length*V*.6,height:Math.ceil(a)||V}}catch{console.warn("DOM text measurement failed, using rough estimate.")}return{width:Math.ceil(t.length*V*.6),height:V}},[G,_,U,V]),Q=a((t,n,e)=>{if(!t||!t.trim())return[""];const i=t.trim().split(/\s+/),o=[];let a="";for(let t=0;t<i.length;t++){const s=i[t],r=a?`${a} ${s}`:s,{width:c}=J(r,e);if(c>n&&a){o.push(a),a=s;if(J(s,e).width>n&&s.length>1){const t=s.split("");let i="";for(const a of t){const t=i+a;J(t+"-",e).width>n&&i?(o.push(i+"-"),i=a):i=t}i&&(a=i)}}else a=r}return a&&o.push(a),o.length>0?o:[""]},[J]),Z=a((t,n)=>{const e=Math.max(4*g,20)+40,i=300;let o;if(K&&"string"==typeof K){const t=parseInt(K,10)||800;o=Math.max(t-e,i)}else if(K&&"number"==typeof K)o=Math.max(K-e,i);else{const a=J(t,n).width,s=Math.min(a+e,20*V);o=Math.max(s,i)}const a=Q(t,o,n);let s=0,r=0;const c=[];a.forEach((t,e)=>{const{width:i,height:o}=J(t||" ",n);s=Math.max(s,i),c.push(o),r+=0===e?o:o*Number(T)});const l=Math.max(s+e,i),h=Math.max(r+e,1.5*V);return{lines:a,width:Math.ceil(l),height:Math.ceil(h),lineHeights:c}},[g,V,T,Q,J,K]);s(()=>{F(!1),O(!1),function(t,n,e){if(t)if(u.has(t))n?.();else try{f.load({google:{families:[t]},active:()=>{u.add(t),n?.()},inactive:()=>{e?.(new Error(`Failed to load font: ${t}`))},timeout:15e3})}catch(t){e?.(t)}else n?.()}(l,()=>{F(!0),O(!1),$?.()},t=>{O(!0),j?.(t)})},[l,$,j]),s(()=>{(B||N)&&(()=>{const t=Z(c,(N?_:l)||_);P(t.lines),D({width:t.width,height:t.height}),H(!0)})()},[c,l,_,B,N,Z]),s(()=>{if(!y)return;const t=()=>{const t=Z(c,(N?_:l)||_);P(t.lines),D({width:t.width,height:t.height})};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[y,N,_,l,c,Z]);const tt=(t,n)=>{if(1===n)return"50%";const e=V*Number(T),i=(n-1)*e+V;return((I.height-i)/2+.8*V+t*e)/I.height*100+"%"},nt=N?_:B?l:_,et=w?`url(#${R})`:d,it=m?`url(#${q})`:void 0;return t("div",z?{className:`creative-text-container ${(()=>{switch(v){case"fade":return"animate-fade-in";case"slide":return"animate-slide-in";case"bounce":return"animate-bounce";case"glow":return"animate-pulse";default:return""}})()} ${b}`,style:{maxWidth:K||"100%",width:y?"100%":K||I.width,transform:(()=>{const t=[];return M&&t.push(`rotate(${M}deg)`),E.x&&t.push(`skewX(${E.x}deg)`),E.y&&t.push(`skewY(${E.y}deg)`),t.length?t.join(" "):void 0})(),opacity:C,fontFamily:`'${nt}', ${_}`,textTransform:W,position:"relative",isolation:"isolate",...k},...A,children:n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${I.width} ${I.height}`,preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"auto",maxWidth:K||"100%",display:"block"},role:"img","aria-label":c,children:[n("defs",{children:[(()=>{if(!w)return null;const{colors:n,direction:e="horizontal"}=w,i=n?.length?n:[d];let o="100%",a="0%";"vertical"===e?(o="0%",a="100%"):"diagonal"===e&&(o="100%",a="100%");const s=Math.max(i.length-1,1);return t("linearGradient",{id:R,x1:"0%",y1:"0%",x2:o,y2:a,children:i.map((n,e)=>t("stop",{offset:e/s*100+"%",stopColor:n},e))})})(),(()=>{if(!m)return null;const n="boolean"==typeof m?{offsetX:6,offsetY:6,blur:0,color:"rgba(0,0,0,0.9)",opacity:1}:{offsetX:m.offsetX??6,offsetY:m.offsetY??6,blur:m.blur??0,color:m.color??"rgba(0,0,0,0.9)",opacity:m.opacity??1};return t("filter",{id:q,x:"-50%",y:"-50%",width:"200%",height:"200%",children:t("feDropShadow",{dx:n.offsetX,dy:n.offsetY,stdDeviation:n.blur,floodColor:n.color,floodOpacity:n.opacity})})})()]}),L.map((n,e)=>t("text",{x:"50%",y:tt(e,L.length),dominantBaseline:"middle",textAnchor:"middle",fontFamily:`${nt}, ${_}`,fontSize:G,fill:et,stroke:g>0?p:"none",strokeWidth:g,strokeLinejoin:"round",strokeLinecap:"round",paintOrder:"stroke fill",letterSpacing:U,filter:it,style:{fontWeight:"normal",userSelect:"none",fontFamily:`${nt}, ${_}`,textTransform:W},children:n},`${Y}-line-${e}`))]})}:{className:`creative-text-container ${b}`,style:{width:K||"auto",height:1.5*V,position:"relative",isolation:"isolate",...k},...A})};export{d as CreativeText};
//# sourceMappingURL=index.js.map