{"version":3,"file":"UncodeAdobe.Cj-ATTaf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/oBtoGBreIxUuwKEMyGb4/uYj05edT8FFDretqGq9h/UncodeAdobe.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useIsOnFramerCanvas,RenderTarget}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n */export default function UncodeAdobeText(props){const{adobeProjectCode,text,fontSize,color,fontWeight,lineHeight,textAlign,fontFamily,codeBy}=props;// Verifica se está no Canvas\nconst isOnFramerCanvas=useIsOnFramerCanvas();const[isFontLoaded,setIsFontLoaded]=useState(false);useEffect(()=>{// Se estivermos no Canvas, não carrega a fonte do Adobe\nif(isOnFramerCanvas){setIsFontLoaded(false);return;}if(adobeProjectCode&&RenderTarget.current()!==RenderTarget.Browser){const scriptId=\"adobe-fonts-script\";if(!document.getElementById(scriptId)){const script=document.createElement(\"script\");script.id=scriptId;script.src=`https://use.typekit.net/${adobeProjectCode}.js`;script.async=true;script.onload=()=>{try{if(window.Typekit){window.Typekit.load({async:true,active:()=>{setIsFontLoaded(true);},inactive:()=>{console.error(\"Adobe Fonts failed to load.\");setIsFontLoaded(false);}});}else{console.error(\"window.Typekit is not available.\");setIsFontLoaded(false);}}catch(e){console.error(\"Adobe Fonts load error:\",e);setIsFontLoaded(false);}};script.onerror=()=>{console.error(\"Failed to load the Adobe Fonts script.\");setIsFontLoaded(false);};document.head.appendChild(script);}else{// Caso o script já tenha sido carregado, assumimos a fonte como disponível\nsetIsFontLoaded(true);}}else{// Caso não tenha código do projeto Adobe, não carregamos\nsetIsFontLoaded(false);}},[adobeProjectCode,isOnFramerCanvas]);// Normalização automática do nome da fonte, se não estiver no Canvas\nconst normalizedFontFamily=fontFamily?fontFamily.toLowerCase().replace(/\\s+/g,\"-\"):\"inter\";// Definir família da fonte:\n// - No Canvas: sempre Instrument Sans\n// - Fora do Canvas: Se Adobe carregar, usar a fonte informada, senão fallback para Inter\nconst computedFontFamily=isOnFramerCanvas?\"Instrument Sans, sans-serif\":isFontLoaded&&normalizedFontFamily?normalizedFontFamily:\"Inter, sans-serif\";const style={fontFamily:computedFontFamily,fontSize:`${fontSize}px`,color:color,fontWeight:fontWeight,lineHeight:lineHeight,textAlign:textAlign,textWrap:\"balance\",width:\"100%\"};return /*#__PURE__*/_jsx(\"div\",{style:style,children:text||\"Your text here\"});}UncodeAdobeText.defaultProps={text:\"Your text here\",width:\"100%\",fontSize:24,color:\"#000000\",fontWeight:\"400\",lineHeight:\"1.5\",textAlign:\"left\",adobeProjectCode:\"\",fontFamily:\"\",textWrap:\"balance\",codeBy:\"Code by UncodeStack and @omatusaelhorch.\"};addPropertyControls(UncodeAdobeText,{adobeProjectCode:{type:ControlType.String,title:\"Adobe Project Code / C\\xf3digo do Projeto Adobe\",placeholder:\"abcd1234\",description:\"Insert your Adobe Fonts project code (e.g., abcd1234). / Insira o c\\xf3digo do projeto da Adobe Fonts (ex: abcd1234).\"},text:{type:ControlType.String,title:\"Text / Texto\",defaultValue:\"Your text here\",displayTextArea:true,description:\"The text content to display. / O conte\\xfado de texto a ser exibido.\"},fontFamily:{type:ControlType.String,title:\"Font Family / Fam\\xedlia da Fonte\",placeholder:\"Ex: proxima-nova\",description:\"Set the name of the font family in Adobe Fonts. If you insert a font other than the one you want, close the project and open it again. / Defina o nome da fam\\xedlia de fontes do Adobe Fonts, se ao inserir aparecer uma fonte diferente da que deseja feche o projeto e abra novamente.\"},fontSize:{type:ControlType.Number,title:\"Font Size / Tamanho da Fonte\",defaultValue:24,min:8,max:542,step:1,description:\"Adjust the font size of the text. / Ajuste o tamanho da fonte do texto.\"},color:{type:ControlType.Color,title:\"Color / Cor\",defaultValue:\"#000000\",description:\"Choose the text color. / Escolha a cor do texto.\"},fontWeight:{type:ControlType.String,title:\"Font Weight / Peso da Fonte\",defaultValue:\"400\",placeholder:\"Ex: 100, 200, 300, ... , light, bold\",description:\"Type the desired font weight (e.g., 400, 600, bold, light, 700, etc.) / Digite o peso da fonte (ex: 400, 600, bold, light, 700, etc.).\"},lineHeight:{type:ControlType.String,title:\"Line Height / Espa\\xe7amento entre Linhas\",defaultValue:\"1.5\",placeholder:\"1.2, 1.5, etc.\",description:\"Set the line height for the text. / Defina o espa\\xe7amento entre linhas do texto.\"},textAlign:{type:ControlType.Enum,title:\"Text Align / Alinhamento do Texto\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left / Esquerda\",\"Center / Centro\",\"Right / Direita\"],defaultValue:\"left\",description:\"Choose the alignment of the text. / Escolha o alinhamento do texto.\"},codeBy:{type:ControlType.String,title:\" \",defaultValue:\"Code by UncodeStack and @omatusaelhorch.\",readOnly:true,description:\"This component was created by UncodeStack and @omatusaelhorch. / Componente criado por UncodeStack e @omatusaelhorch.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UncodeAdobeText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UncodeAdobe.map"],"mappings":"+MAIG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,mBAAiB,OAAK,WAAS,QAAM,aAAW,aAAW,YAAU,aAAW,UAAQ,EAC1I,EAAiB,GAAqB,CAAM,CAAC,EAAa,GAAiBA,EAAS,GAAM,CAAC,MAAc,CAC/G,GAAG,EAAiB,CAAC,EAAgB,GAAM,CAAC,OAAQ,GAAG,GAAkB,EAAa,SAAS,GAAG,EAAa,QAAQ,CAAC,IAAM,EAAS,qBAAqB,GAAI,SAAS,eAAe,EAAS,CACjM,EAAgB,GAAK,KAD6K,CAAC,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,GAAG,EA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