{"version":3,"file":"RichTextMarkdown.Dt6KQLKA.mjs","names":[],"sources":["https:/framerusercontent.com/modules/muSOWL1ZsdSvMDgNOTy6/lEiYr6aaHSoZ5gsDyGpx/RichTextMarkdown.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";function renderInline(text,boldColor,boldWeight,keyPrefix){const parts=text.split(/(\\*\\*[^*]+\\*\\*)/g);return parts.map((part,i)=>{if(part.startsWith(\"**\")&&part.endsWith(\"**\")){const inner=part.slice(2,-2);return /*#__PURE__*/_jsx(\"strong\",{style:{fontWeight:boldWeight,color:boldColor},children:inner},`${keyPrefix}-${i}`);}return /*#__PURE__*/_jsx(\"span\",{children:part},`${keyPrefix}-${i}`);});}function renderContent(content,boldColor,boldWeight,paragraphSpacing){if(!content)return null;// Split on double newlines (paragraphs) — also handle \\n\\n as literal input\nconst paragraphs=content.split(/\\n\\n+/);return paragraphs.map((para,i)=>/*#__PURE__*/_jsx(\"p\",{style:{margin:0,marginBottom:i<paragraphs.length-1?`${paragraphSpacing}px`:0},children:renderInline(para.trim(),boldColor,boldWeight,`p-${i}`)},`p-${i}`));}const defaultProps={content:\"Exemple de texte avec **un passage en gras** pour montrer le rendu inline.\\n\\nDeuxi\\xe8me paragraphe apr\\xe8s un saut de ligne.\",fontSize:20,lineHeight:\"140%\",letterSpacing:\"-0.02em\",color:\"rgb(255, 255, 255)\",boldColor:\"rgb(255, 255, 255)\",fontWeight:500,boldWeight:700,textAlign:\"left\",maxWidth:\"\",paragraphSpacing:16};export default function RichTextMarkdown(props){const{content,fontSize,lineHeight,letterSpacing,color,boldColor,fontWeight,boldWeight,textAlign,maxWidth,paragraphSpacing}=props;const style={fontFamily:\"Satoshi, sans-serif\",fontSize:`${fontSize}px`,lineHeight,letterSpacing,color,fontWeight,textAlign,width:\"100%\",maxWidth:maxWidth||undefined,margin:0};return /*#__PURE__*/_jsx(\"div\",{style:style,children:renderContent(content,boldColor,boldWeight,paragraphSpacing)});}RichTextMarkdown.defaultProps=defaultProps;addPropertyControls(RichTextMarkdown,{content:{type:ControlType.String,title:\"Content\",displayTextArea:true,description:\"Use **text** for bold. Use blank line for paragraph break.\"},fontSize:{type:ControlType.Number,title:\"Font size\",min:8,max:200,step:1,displayStepper:true},lineHeight:{type:ControlType.String,title:\"Line height\"},letterSpacing:{type:ControlType.String,title:\"Letter spacing\"},paragraphSpacing:{type:ControlType.Number,title:\"Paragraph gap\",min:0,max:80,step:1,unit:\"px\"},color:{type:ControlType.Color,title:\"Color\"},boldColor:{type:ControlType.Color,title:\"Bold color\"},fontWeight:{type:ControlType.Number,title:\"Weight\",min:100,max:900,step:100},boldWeight:{type:ControlType.Number,title:\"Bold weight\",min:100,max:900,step:100},textAlign:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\",\"justify\"],optionTitles:[\"Left\",\"Center\",\"Right\",\"Justify\"],displaySegmentedControl:true},maxWidth:{type:ControlType.String,title:\"Max width\",placeholder:\"e.g. 960px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RichTextMarkdown\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RichTextMarkdown.map"],"mappings":"4JAA+F,SAAS,EAAa,EAAK,EAAU,EAAW,EAAU,CAA4C,OAA/B,EAAK,MAAM,mBAAmB,CAAc,KAAK,EAAK,IAAI,CAAC,GAAG,EAAK,WAAW,KAAK,EAAE,EAAK,SAAS,KAAK,CAAC,CAAC,IAAM,EAAM,EAAK,MAAM,EAAE,GAAG,CAAC,OAAoB,EAAK,SAAS,CAAC,MAAM,CAAC,WAAW,EAAW,MAAM,EAAU,CAAC,SAAS,EAAM,CAAC,GAAG,EAAU,GAAG,IAAI,CAAE,OAAoB,EAAK,OAAO,CAAC,SAAS,EAAK,CAAC,GAAG,EAAU,GAAG,IAAI,EAAG,CAAE,SAA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