{"version":3,"file":"RichTextComponent.CDsF7eFU.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/1NgbRUjs9lMxx2IuuVZV/20PNhbtPKJOLSeVIEJlh/RichTextComponent.js"],"sourcesContent":["// Text component with indentation, text balance, and rich text support\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function RichTextComponent(props){const{text,font,textColor,highlightText,highlightColor,highlightPosition,textIndent,useTextBalance}=props;const processedText=useMemo(()=>{if(!highlightText||highlightText.trim()===\"\"){return text;}const highlightStyle=`color: ${highlightColor};`;const regex=new RegExp(`(${highlightText.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")})`,\"gi\");// Check if highlight text exists in main text\nif(text.toLowerCase().includes(highlightText.toLowerCase())){return text.replace(regex,`<span style=\"${highlightStyle}\">$1</span>`);}else{// If highlight text doesn't exist in main text, add it based on position\nconst highlightSpan=`<span style=\"${highlightStyle}\">${highlightText}</span>`;if(highlightPosition===\"start\"){return`${highlightSpan} ${text}`;}else{return`${text} ${highlightSpan}`;}}},[text,highlightText,highlightColor,highlightPosition]);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"block\",width:\"100%\",height:\"100%\",color:textColor,textIndent:`${textIndent}px`,...useTextBalance&&{textWrap:\"balance\"},...font},dangerouslySetInnerHTML:{__html:processedText}});}addPropertyControls(RichTextComponent,{highlightText:{type:ControlType.String,title:\"Key Text\",defaultValue:\"sample\",placeholder:\"Text to highlight...\"},highlightColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FF6B35\"},highlightPosition:{type:ControlType.Enum,title:\"Position\",options:[\"start\",\"end\"],optionTitles:[\"Beginning\",\"End\"],defaultValue:\"end\",displaySegmentedControl:true},text:{type:ControlType.String,title:\"Main Text\",defaultValue:\"This is a sample text with rich formatting support. You can style different words with different colors and weights.\",displayTextArea:true},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"16px\",variant:\"Regular\",letterSpacing:\"0em\",lineHeight:\"1.4em\",textAlign:\"left\"},controls:\"extended\",defaultFontType:\"sans-serif\",displayTextAlignment:true,displayFontSize:true},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},textIndent:{type:ControlType.Number,title:\"Indentation\",defaultValue:100,min:0,max:500,step:1,unit:\"px\"},useTextBalance:{type:ControlType.Boolean,title:\"Text Balance\",defaultValue:false,enabledTitle:\"Balanced\",disabledTitle:\"Normal\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RichTextComponent\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RichTextComponent.map"],"mappings":"0KAIG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,YAAU,gBAAc,iBAAe,oBAAkB,aAAW,kBAAgB,EAAY,EAAcA,MAAY,CAAC,GAAG,CAAC,GAAe,EAAc,MAAM,GAAG,GAAI,OAAO,EAAM,IAAM,EAAe,UAAU,EAAe,GAAS,EAAU,OAAO,IAAI,EAAc,QAAQ,sBAAsB,OAAO,CAAC,GAAG,KAAK,CAClY,GAAG,EAAK,aAAa,CAAC,SAAS,EAAc,aAAa,CAAC,CAAE,OAAO,EAAK,QAAQ,EAAM,gBAAgB,EAAe,aAAa,CAAM,CACzI,IAAM,EAAc,gBAAgB,EAAe,IAAI,EAAc,SAAgF,OAApE,IAAoB,QAAe,GAAG,EAAc,GAAG,IAAmB,GAAG,EAAK,GAAG,MAAoB,CAAC,EAAK,EAAc,EAAe,EAAkB,CAAC,CAAC,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,QAAQ,MA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