{"version":3,"file":"TextHighlighter.C6dcTo_K.mjs","names":["__esmMin","init_jsx_runtime","c","p","addPropertyControls","ControlType","init_framer_D1IzEvwH","WordHighlighter","props","highlightedParagraph","text","part","content","index","prefixContent","suffixContent","init_TextHighlighter"],"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":"A,oKAIG,SAAwBO,EAAgB,EAAM,CAAC,QAAQ,IAAIC,CAAK,EAGqF,IAAMC,GAHjE,GAC3DC,EAAK,MAAM,YAAO,CAAC,CAAC,KAAK,EAAK,IAAQ,CACxE,GAAGC,EAAK,WAAW,GAAG,GAAGA,EAAK,SAAS,GAAG,EAAE,CAC5C,IAAMC,EAAQD,EAAK,MAAM,EAAE,EAAE,EAAE,MAAoB,gBAAK,OAAO,CAAC,MAAM,CAAC,MAAMH,EAAM,cAAc,EAAE,SAAS,IAAII,CAAO,EAAEC,CAAK,CAAE,CAAM,OAAOF,CAAM,CAAC,EAA+B,CAAkBH,EAAM,IAAI,EACzMM,EAAcN,EAAM,mBAAgC,gBAAK,OAAO,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,SAASA,EAAM,MAAM,CAAC,EAAEA,EAAM,OAAaO,EAAcP,EAAM,mBAAgC,gBAAK,OAAO,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,SAASA,EAAM,MAAM,CAAC,EAAEA,EAAM,OAAO,MAAoB,gBAAM,MAAM,CAAC,MAAM,CAAC,GAAGA,EAAM,KAAK,MAAMA,EAAM,SAAS,EAAE,SAAS,CAACM,EAAcL,EAAqBM,CAAa,CAAC,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