{"version":3,"file":"TextHighlighter.HV9o1O2g.mjs","names":[],"sources":["https:/framerusercontent.com/modules/LmM8cXITihYjBAxcIzgJ/jvYhDFa081wuU2w5mtlk/TextHighlighter.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function WordHighlighter(props){console.log(props);const highlightBrackets=text=>{// Pattern to match text inside square brackets\nconst pattern=/(\\[.*?\\])/g;return text.split(pattern).map((part,index)=>{// Check if the part matches our pattern (starts with [ and ends with ])\nif(part.startsWith(\"[\")&&part.endsWith(\"]\")){// Remove the brackets and apply highlight\nconst content=part.slice(1,-1);return /*#__PURE__*/_jsx(\"span\",{style:{color:props.highlightColor},children:\" \"+content},index);}else{return part;}});};const highlightedParagraph=highlightBrackets(props.text);// Make sure the prefix and suffix preserve all whitespace\nconst prefixContent=props.preserveWhitespace?/*#__PURE__*/_jsx(\"span\",{style:{whiteSpace:\"pre\"},children:props.prefix}):props.prefix;const suffixContent=props.preserveWhitespace?/*#__PURE__*/_jsx(\"span\",{style:{whiteSpace:\"pre\"},children:props.suffix}):props.suffix;return /*#__PURE__*/_jsxs(\"div\",{style:{...props.font,color:props.textColor},children:[prefixContent,highlightedParagraph,suffixContent]});}addPropertyControls(WordHighlighter,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"This is[highlighted text] inside a paragraph. And[another example] here.\"},prefix:{title:\"Prefix\",type:ControlType.String,defaultValue:\"\"},suffix:{title:\"Suffix\",type:ControlType.String,defaultValue:\"\"},preserveWhitespace:{title:\"Preserve Whitespace\",type:ControlType.Boolean,defaultValue:true,description:\"If enabled, spaces in prefix and suffix will be preserved\"},font:{type:ControlType.Font,controls:\"extended\"},textColor:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#000000\"},highlightColor:{title:\"Highlight Color\",type:ControlType.Color,defaultValue:\"#1DA1F2\"}});// Styles are written in object syntax\n// https://react.dev/reference/react-dom/components/common#usage\nconst boxStyle={margin:25,width:125,height:125,borderRadius:25};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WordHighlighter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextHighlighter.map"],"mappings":"8JAIG,SAAwB,EAAgB,EAAM,CAAC,QAAQ,IAAI,EAAM,CAGoF,IAAM,GAHjE,GAC3D,EAAK,MAAzB,aAAuC,CAAC,KAAK,EAAK,IAAQ,CACxE,GAAG,EAAK,WAAW,IAAI,EAAE,EAAK,SAAS,IAAI,CAAC,CAC5C,IAAM,EAAQ,EAAK,MAAM,EAAE,GAAG,CAAC,OAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAM,eAAe,CAAC,SAAS,IAAI,EAAQ,CAAC,EAAM,MAAO,OAAO,GAAQ,EAAgD,EAAM,KAAK,CAC1M,EAAc,EAAM,mBAAgC,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,MAAM,CAAC,SAAS,EAAM,OAAO,CAAC,CAAC,EAAM,OAAa,EAAc,EAAM,mBAAgC,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,MAAM,CAAC,SAAS,EAAM,OAAO,CAAC,CAAC,EAAM,OAAO,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,KAAK,MAAM,EAAM,UAAU,CAAC,SAAS,CAAC,EAAc,EAAqB,EAAc,CAAC,CAAC,kBAR3V,IAAoD,CAQyS,EAAoB,EAAgB,CAAC,KAAK,CAAC,MAAM,OAAO,KAAK,EAAY,OAAO,aAAa,2EAA2E,CAAC,OAAO,CAAC,MAAM,SAAS,KAAK,EAAY,OAAO,aAAa,GAAG,C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