{"version":3,"file":"HighlightedText.DDN5-hmJ.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/K9V0dgorGyPZmlEm5Som/1huAeGE5OtvOkGBsUlls/HighlightedText.js"],"sourcesContent":["// Text component with stroke highlight for selected words\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function HighlightedText(props){const{text='As a product designer, I designed the experience that helped groups move from \"maybe\" to \"let\\'s go.\"',highlightWords=\"helped groups move\",strokeColor=\"#7ED321\",strokeWidth=4,font,textColor=\"#000000\",style}=props;const processedText=useMemo(()=>{if(!highlightWords.trim()){return[{text,highlighted:false}];}const wordsToHighlight=highlightWords.split(\",\").map(w=>w.trim()).filter(w=>w.length>0);let result=[{text,highlighted:false}];wordsToHighlight.forEach(word=>{const newResult=[];result.forEach(segment=>{if(segment.highlighted){newResult.push(segment);return;}const regex=new RegExp(`(${word})`,\"gi\");const parts=segment.text.split(regex);parts.forEach((part,index)=>{if(part){const isMatch=regex.test(part);regex.lastIndex=0;newResult.push({text:part,highlighted:isMatch});}});});result=newResult;});return result;},[text,highlightWords]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"auto\"},children:/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:textColor,...font,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\"},children:processedText.map((segment,index)=>{if(segment.highlighted){return /*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",display:\"inline\",background:strokeColor,padding:`${strokeWidth}px ${strokeWidth*1.5}px`,margin:`0 ${strokeWidth/2}px`,boxDecorationBreak:\"clone\",WebkitBoxDecorationBreak:\"clone\"},children:segment.text},index);}return /*#__PURE__*/_jsx(\"span\",{children:segment.text},index);})})});}addPropertyControls(HighlightedText,{text:{type:ControlType.String,title:\"Text\",defaultValue:'As a product designer, I designed the experience that helped groups move from \"maybe\" to \"let\\'s go.\"',displayTextArea:true},highlightWords:{type:ControlType.String,title:\"Highlight Words\",defaultValue:\"helped groups move\",placeholder:\"Enter words separated by commas\",displayTextArea:true},strokeColor:{type:ControlType.Color,title:\"Stroke Color\",defaultValue:\"#7ED321\"},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:4,min:1,max:20,step:1,unit:\"px\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlightedText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HighlightedText.map"],"mappings":"0KAIG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,uGAAwG,iBAAe,qBAAqB,cAAY,UAAU,cAAY,EAAE,OAAK,YAAU,UAAU,SAAO,EAAY,EAAcA,MAAY,CAAC,GAAG,CAAC,EAAe,MAAM,CAAE,MAAM,CAAC,CAAC,OAAK,YAAY,GAAM,CAAC,CAAE,IAAM,EAAiB,EAAe,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,CAAK,EAAO,CAAC,CAAC,OAAK,YAAY,GAAM,CAAC,CAAsX,OAArX,EAAiB,QAAQ,GAAM,CAAC,IAAM,EAAU,EAAE,CAAC,EAAO,QAAQ,GAAS,CAAC,GAAG,EAAQ,YAAY,CAAC,EAAU,KAAK,EAAQ,CAAC,OAAQ,IAAM,EAAU,OAAO,IAAI,EAAK,GA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