{"version":3,"file":"Highlight.C6d5nRnS.mjs","names":["text"],"sources":["https:/framerusercontent.com/modules/v5mmJogmg5mv82O2rPwk/RyJ8FxZmvfliOXVsMGEV/Highlight.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{Frame,addPropertyControls,ControlType,useInvertedScale}from\"framer\";export function HighlightText(props){const{text,highlightWords,highlightColor,fontSize,fontWeight,fontFamily,textColor}=props;const invertedScale=useInvertedScale();const highlightText=(text,words)=>{let result=text;words.forEach(word=>{// Traiter le mot comme une chaîne littérale\nconst literalWord=word.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\").replace(/\\s+/g,\"\\\\s+\");// Créer plusieurs variantes pour l'apostrophe\nconst apostropheVariants=\"['''']\";const wordWithApostropheVariants=literalWord.replace(/'/g,apostropheVariants);// Créer les variantes pour les accents\nconst accentVariants=wordWithApostropheVariants.replace(/e/g,\"[e\\xe9\\xe8\\xea\\xebĕ]\").replace(/a/g,\"[a\\xe0\\xe2\\xe4ā]\").replace(/i/g,\"[i\\xec\\xee\\xefī]\").replace(/o/g,\"[o\\xf2\\xf4\\xf6ō]\").replace(/u/g,\"[u\\xf9\\xfb\\xfcū]\").replace(/y/g,\"[y\\xffŷ]\").replace(/c/g,\"[c\\xe7]\").replace(/n/g,\"[n\\xf1]\");const regex=new RegExp(accentVariants,\"gi\");result=result.replace(regex,match=>`<span style=\"background-color: ${highlightColor}; display: inline-block; transform: rotate(1deg); border-radius: 4px; padding: 0 2px;\">${match}</span>`);});return result;};return /*#__PURE__*/_jsx(Frame,{background:\"none\",size:\"auto\",position:\"relative\",style:{...invertedScale,fontSize:`${fontSize}px`,fontWeight:fontWeight,fontFamily:fontFamily,color:textColor,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",padding:\"1px 0\",minHeight:\"auto\",overflow:\"visible\"},layoutId:\"highlight-text-container\",children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"auto\"},dangerouslySetInnerHTML:{__html:highlightText(text,highlightWords)}})});}HighlightText.defaultProps={text:\"Ceci est un exemple de texte avec des mots \\xe0 mettre en \\xe9vidence.\",highlightWords:[\"exemple\",\"mots\",\"\\xe9vidence\"],highlightColor:\"#FFFF00\",fontSize:16,fontWeight:400,fontFamily:\"Arial, sans-serif\",textColor:\"#000000\"};addPropertyControls(HighlightText,{text:{type:ControlType.String,title:\"Text\"},highlightWords:{type:ControlType.Array,title:\"Highlight Words\",control:{type:ControlType.String}},highlightColor:{type:ControlType.Color,title:\"Highlight Color\"},fontSize:{type:ControlType.Number,title:\"Font Size\",min:8,max:72,step:1},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[100,200,300,400,500,600,700,800,900],optionTitles:[\"Thin\",\"Extra Light\",\"Light\",\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\",\"Black\"]},fontFamily:{type:ControlType.String,title:\"Font Family\"},textColor:{type:ControlType.Color,title:\"Text Color\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"HighlightText\":{\"type\":\"reactComponent\",\"name\":\"HighlightText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Highlight.map"],"mappings":"wMAAsH,SAAgB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,iBAAe,iBAAe,WAAS,aAAW,aAAW,aAAW,EAAY,EAAc,GAAkB,CAAO,GAAe,EAAK,IAAQ,CAAC,IAAI,EAAOA,EAGqM,OAHhM,EAAM,QAAQ,GAAM,CAGlW,IAAM,EAFY,EAAK,QAAQ,yBAAyB,OAAO,CAAC,QAAQ,OAAO,OAAO,CACP,QAAQ,KAA9D,SAAsF,CAC/D,QAAQ,KAAK,WAAuB,CAAC,QAAQ,KAAK,UAAmB,CAAC,QAAQ,KAAK,UAAmB,CAAC,QAAQ,KAAK,UAAmB,CAAC,QAAQ,KAAK,UAAmB,CAAC,QAAQ,KAAK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