{"version":3,"file":"TextHighlighter.DyoQJhWD.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":"oKAIG,SAAwB,EAAgB,EAAM,CAAC,QAAQ,IAAI,CAAK,EAGqF,IAAM,GAHjE,GAC3D,EAAK,MAAM,YAAO,CAAC,CAAC,KAAK,EAAK,IAAQ,CACxE,GAAG,EAAK,WAAW,GAAG,GAAG,EAAK,SAAS,GAAG,EAAE,CAC5C,IAAM,EAAQ,EAAK,MAAM,EAAE,EAAE,EAAE,OAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAM,cAAc,EAAE,SAAS,IAAI,CAAO,EAAE,CAAK,CAAE,MAAM,OAAO,CAAM,CAAC,EAA+B,CAAkB,EAAM,IAAI,EACzM,EAAc,EAAM,mBAAgC,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,SAAS,EAAM,MAAM,CAAC,EAAE,EAAM,OAAa,EAAc,EAAM,mBAAgC,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,SAAS,EAAM,MAAM,CAAC,EAAE,EAAM,OAAO,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,KAAK,MAAM,EAAM,SAAS,EAAE,SAAS,CAAC,EAAc,EAAqB,CAAa,CAAC,CAAC,CAAE,iBAR7V,IAAoD,EAQ0S,EAAoB,EAAgB,CAAC,KAAK,CAAC,MAAM,OAAO,KAAK,EAAY,OAAO,aAAa,0EAA0E,EAAE,OAAO,CAAC,MAAM,SAAS,KAAK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