{"version":3,"file":"SentenceBuilder.BVkXO2cI.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/box5pywa8wCm0522SWJ2/929Wd3dNfF2PPSBVTgnL/SentenceBuilder.js"],"sourcesContent":["// Component for composing a sentence from text parts with a template\n// Template: Hey [t1], [t2] and [t3]\n// Inputs: t1, t2, t3, t4, t5 - text fields that form the template text\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * Sentence Builder Component\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 100\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function SentenceBuilder(props){const{template,t1,t2,t3,t4,t5,textColor,font,style,htmlTag=\"p\"}=props;const composedText=useMemo(()=>{let result=template;result=result.replace(/\\[([^\\]]*?t1[^\\]]*?)\\]/g,(match,content)=>{return t1?content.replace(/t1/,t1):\"\";});result=result.replace(/\\[([^\\]]*?t2[^\\]]*?)\\]/g,(match,content)=>{return t2?content.replace(/t2/,t2):\"\";});result=result.replace(/\\[([^\\]]*?t3[^\\]]*?)\\]/g,(match,content)=>{return t3?content.replace(/t3/,t3):\"\";});result=result.replace(/\\[([^\\]]*?t4[^\\]]*?)\\]/g,(match,content)=>{return t4?content.replace(/t4/,t4):\"\";});result=result.replace(/\\[([^\\]]*?t5[^\\]]*?)\\]/g,(match,content)=>{return t5?content.replace(/t5/,t5):\"\";});return result;},[template,t1,t2,t3,t4,t5]);const Tag=htmlTag;return /*#__PURE__*/_jsx(motion.div,{style:{...style,position:\"relative\",display:\"flex\",alignItems:\"center\",color:textColor},animate:{opacity:1,color:textColor},transition:props.transition,children:/*#__PURE__*/_jsx(Tag,{style:{margin:0,...font,width:\"max-content\",whiteSpace:\"pre-wrap\"},children:composedText})});}addPropertyControls(SentenceBuilder,{template:{type:ControlType.String,title:\"Template\",defaultValue:\"Hey [t1], [t2] and [t3]\",displayTextArea:true,description:\"Use [t1] through [t5] as variables. Supports prefixes and suffixes: [t1], [prefix t1], [t1 suffix], [prefix t1 suffix]\"},t1:{type:ControlType.String,title:\"t1\",defaultValue:\"Alice\"},t2:{type:ControlType.String,title:\"t2\",defaultValue:\"Bob\"},t3:{type:ControlType.String,title:\"t3\",defaultValue:\"Charlie\"},t4:{type:ControlType.String,title:\"t4\",defaultValue:\"\"},t5:{type:ControlType.String,title:\"t5\",defaultValue:\"\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},htmlTag:{type:ControlType.Enum,title:\"HTML Tag\",options:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\"],optionTitles:[\"H1\",\"H2\",\"H3\",\"H4\",\"H5\",\"H6\",\"Paragraph\"],defaultValue:\"p\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},transition:{type:ControlType.Transition,title:\"Transition\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SentenceBuilder\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"100\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SentenceBuilder.map"],"mappings":"4NAWG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,WAAS,KAAG,KAAG,KAAG,KAAG,KAAG,YAAU,OAAK,QAAM,UAAQ,KAAK,EAAY,EAAaA,MAAY,CAAC,IAAI,EAAO,EAAgiB,MAAvhB,GAAO,EAAO,QAAQ,2BAA2B,EAAM,IAAkB,EAAG,EAAQ,QAAQ,KAAK,EAAG,CAAC,GAAK,CAAC,EAAO,EAAO,QAAQ,2BAA2B,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