{"version":3,"file":"SelectiveText.o7xPfAOT.mjs","names":["text"],"sources":["https:/framerusercontent.com/modules/K9g0klQumLRJlcD5FrfB/51N2llKzyHmXf78UeoCp/SelectiveText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Selective Gradient Text Component for Framer\n * Wrap words in {{word}} to apply gradient\n * Supports:\n * - \\n (typed) as line breaks\n * - actual newlines (Enter)\n * - newlines inside gradient: {{Loved \\nby enterprises}}\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function SelectiveGradientText(props){const{text,tag,gradientAngle,fontSize,fontWeight,textAlign,lineHeight,fontColor}=props;const Tag=tag;// Parse text into:\n// - gradient chunks wrapped in {{ }}\n// - normal text\n// - line breaks (both \\n and real newlines)\nconst parseText=inputText=>{const parts=[];// 1) Normalize: turn \"\\n\" sequences into actual newlines\nconst normalized=inputText.replace(/\\\\n/g,\"\\n\");// 2) Regex to find gradient blocks, allowing newlines inside\nconst regex=/\\{\\{([\\s\\S]*?)\\}\\}/g;let lastIndex=0;let match;const pushWithLineBreaks=(text,gradient)=>{// Split by actual newline characters\nconst segments=text.split(\"\\n\");segments.forEach((segment,index)=>{if(segment.length>0){parts.push({type:\"text\",text:segment,gradient});}// Add a line break between segments (not after the last one)\nif(index<segments.length-1){parts.push({type:\"break\"});}});};while((match=regex.exec(normalized))!==null){// Text before this gradient block\nif(match.index>lastIndex){const before=normalized.substring(lastIndex,match.index);pushWithLineBreaks(before,false);}// The gradient content inside {{ }}\nconst gradientContent=match[1];pushWithLineBreaks(gradientContent,true);lastIndex=regex.lastIndex;}// Remaining text after the last gradient block\nif(lastIndex<normalized.length){const remaining=normalized.substring(lastIndex);pushWithLineBreaks(remaining,false);}return parts;};// Fixed 3-stop gradient\nconst gradientStyle={background:`linear-gradient(${gradientAngle}deg, #E3BB57 0%, #C46DD2 45%, #2E1959 100%)`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\",display:\"inline\"};const containerStyle={fontFamily:\"Inter Display, Inter, sans-serif\",fontSize:`${fontSize}px`,fontWeight:fontWeight,textAlign:textAlign,color:fontColor||\"#13171F\",margin:0,lineHeight:lineHeight,padding:0,whiteSpace:\"pre-wrap\"};const parsedText=parseText(text);return /*#__PURE__*/_jsx(Tag,{style:containerStyle,children:parsedText.map((part,index)=>{if(part.type===\"break\"){return /*#__PURE__*/_jsx(\"br\",{},index);}return /*#__PURE__*/_jsx(\"span\",{style:part.gradient?gradientStyle:{},children:part.text},index);})});}// Framer property controls\naddPropertyControls(SelectiveGradientText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Built for creators.{{Loved \\\\nby enterprises}}\",displayTextArea:true},tag:{type:ControlType.Enum,title:\"HTML Tag\",options:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\",\"span\",\"div\"],optionTitles:[\"Heading 1\",\"Heading 2\",\"Heading 3\",\"Heading 4\",\"Heading 5\",\"Heading 6\",\"Paragraph\",\"Span\",\"Div\"],defaultValue:\"h1\"},gradientAngle:{type:ControlType.Number,title:\"Gradient Angle\",min:0,max:360,step:1,defaultValue:90,unit:\"\\xb0\"},fontSize:{type:ControlType.Number,title:\"Font Size\",min:8,max:200,step:1,defaultValue:56,unit:\"px\"},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"],optionTitles:[\"Light\",\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\",\"Black\"],defaultValue:\"600\"},textAlign:{type:ControlType.Enum,title:\"Text Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",min:.5,max:3,step:.1,defaultValue:1},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#13171F\"}});SelectiveGradientText.defaultProps={text:\"Built for creators.{{Loved \\\\nby enterprises}}\",tag:\"h2\",gradientAngle:105,fontSize:56,fontWeight:\"600\",textAlign:\"left\",lineHeight:1,fontColor:\"#13171F\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SelectiveGradientText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SelectiveText.map"],"mappings":"4JASG,SAAwB,EAAsB,EAAM,CAAC,GAAK,CAAC,OAAK,MAAI,gBAAc,WAAS,aAAW,YAAU,aAAW,aAAW,EAAY,EAAI,EAInJ,EAAU,GAAW,CAAC,IAAM,EAAM,EAAE,CACpC,EAAW,EAAU,QAAQ,OAAO;EAAK,CACzC,EAAM,sBAA0B,EAAU,EAAM,EAAY,GAAoB,EAAK,IAAW,CACtG,IAAM,EAASA,EAAK,MAAM;EAAK,CAAC,EAAS,SAAS,EAAQ,IAAQ,CAAI,EAAQ,OAAO,GAAG,EAAM,KAAK,CAAC,KAAK,OAAO,KAAK,EAAQ,WAAS,CAAC,CACpI,EAAM,EAAS,OAAO,GAAG,EAAM,KAAK,CAAC,KAAK,QAAQ,CAAC,EAAI,EAAG,MAAO,EAAM,EAAM,KAAK,EAAW,IAAI,MAAK,CACtG,EAAM,MAAM,GAAoE,EAA5C,EAAW,UAAU,EAAU,EAAM,MAAM,CAA2B,GAAM,CACnH,IAAM,EAAgB,EAAM,GAAG,EAAmB,EAAgB,GAAK,CAAC,EAAU,EAAM,UAC6B,OAAlH,EAAU,EAAW,QAAwD,EAAhC,EAAW,UAAU,EAAU,CAA8B,GAAM,CAAS,GACtH,EAAc,CAAC,WAAW,mBAAmB,EAAc,6CAA6C,qBAAqB,OAAO,oBAAoB,cAAc,eAAe,OAAO,QAAQ,SAAS,CAAoQ,OAAoB,EAAK,EAAI,CAAC,MAA5Q,CAA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