{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/LmM8cXITihYjBAxcIzgJ/AiIaMslwAUlSIqAFb9IL/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 */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\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextHighlighter.map"],
  "mappings": "gGAGkB,SAARA,EAAiCC,EAAM,CAAC,QAAQ,IAAIA,CAAK,EAGqF,IAAMC,GAHjEC,GAAM,CACnG,IAAMC,EAAQ,aAAa,OAAOD,EAAK,MAAMC,CAAO,EAAE,IAAI,CAACC,EAAKC,IAAQ,CACxE,GAAGD,EAAK,WAAW,GAAG,GAAGA,EAAK,SAAS,GAAG,EAAE,CAC5C,IAAME,EAAQF,EAAK,MAAM,EAAE,EAAE,EAAE,OAAoBG,EAAK,OAAO,CAAC,MAAM,CAAC,MAAMP,EAAM,cAAc,EAAE,SAAS,IAAIM,CAAO,EAAED,CAAK,CAAE,KAAM,QAAOD,CAAM,CAAC,CAAE,GAA+CJ,EAAM,IAAI,EACzMQ,EAAcR,EAAM,mBAAgCO,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,SAASP,EAAM,MAAM,CAAC,EAAEA,EAAM,OAAaS,EAAcT,EAAM,mBAAgCO,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,KAAK,EAAE,SAASP,EAAM,MAAM,CAAC,EAAEA,EAAM,OAAO,OAAoBU,EAAM,MAAM,CAAC,MAAM,CAAC,GAAGV,EAAM,KAAK,MAAMA,EAAM,SAAS,EAAE,SAAS,CAACQ,EAAcP,EAAqBQ,CAAa,CAAC,CAAC,CAAE,CAACE,EAAoBZ,EAAgB,CAAC,KAAK,CAAC,MAAM,OAAO,KAAKa,EAAY,OAAO,aAAa,0EAA0E,EAAE,OAAO,CAAC,MAAM,SAAS,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,OAAO,CAAC,MAAM,SAAS,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,mBAAmB,CAAC,MAAM,sBAAsB,KAAKA,EAAY,QAAQ,aAAa,GAAK,YAAY,2DAA2D,EAAE,KAAK,CAAC,KAAKA,EAAY,KAAK,SAAS,UAAU,EAAE,UAAU,CAAC,MAAM,aAAa,KAAKA,EAAY,MAAM,aAAa,SAAS,EAAE,eAAe,CAAC,MAAM,kBAAkB,KAAKA,EAAY,MAAM,aAAa,SAAS,CAAC,CAAC",
  "names": ["WordHighlighter", "props", "highlightedParagraph", "text", "pattern", "part", "index", "content", "p", "prefixContent", "suffixContent", "u", "addPropertyControls", "ControlType"]
}
