{"version":3,"file":"Text_Wrap.Bj2NOmLp.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/GPifxW8wDdmxHUdOmbdC/ZcyZD65T2IwFoCtjGszw/Text_Wrap.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight auto\n */export default function Text_Wrap({layers=[],text,slot,font,color,layerGap,transform,layerAlign,decoration,balance,userSelect,tag,textAlign,style}){const Tag=tag;// Memoize content generation to avoid recalculation on every render\nconst content=useMemo(()=>{const parts=text.split(slot);const result=[];// Process text parts and layers in a single loop\nparts.forEach((part,i)=>{result.push(part);// Add layer if we're not at the last part\nif(i<parts.length-1){if(i<layers.length){result.push(/*#__PURE__*/_jsx(InlineLayer,{align:layerAlign,gap:layerGap,children:layers[i]},`layer-${i}`));}else{result.push(slot);}}});// Append remaining layers if any\nfor(let i=parts.length-1;i<layers.length;i++){result.push(/*#__PURE__*/_jsx(InlineLayer,{align:layerAlign,gap:layerGap,children:layers[i]},`extra-layer-${i}`));}return result;},[text,slot,layers,layerAlign,layerGap]);// Memoize style object to prevent unnecessary re-renders\nconst textStyle=useMemo(()=>{const baseStyle={color,margin:0,whiteSpace:style?.width?\"pre\":\"nowrap\",fontWeight:400,textAlign:textAlign,userSelect:userSelect?\"auto\":\"none\",textDecoration:decoration,textWrap:balance?\"balance\":undefined,textTransform:transform,...font,...style};// Apply color styling based on mode\nif(color.mode===\"solid\"){baseStyle.color=color.color;}else{// Generate gradient string from stops\nconst stopsString=color.stops?[...color.stops].sort((a,b)=>a.position-b.position).map(stop=>`${stop.color} ${stop.position}%`).join(\", \"):\"#000 0%, #FFF 100%\";// Fix angle direction\nconst cssAngle=color.angle+180;Object.assign(baseStyle,{WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundImage:`linear-gradient(${cssAngle}deg, ${stopsString})`});}return baseStyle;},[color,style,font,userSelect,decoration,balance,transform,textAlign]);return /*#__PURE__*/_jsx(Tag,{style:textStyle,children:content});}// Move InlineLayer outside and memoize it\nconst InlineLayer=({children,align=\"middle\",gap=0})=>{const inlineStyle=useMemo(()=>({display:\"inline-block\",verticalAlign:align,marginLeft:gap,marginRight:gap}),[align,gap]);return /*#__PURE__*/_jsx(\"span\",{style:inlineStyle,children:children});};Text_Wrap.displayName=\"Text_Wrap\";addPropertyControls(Text_Wrap,{text:{type:ControlType.String,defaultValue:\"Framer [] Is [] Goated\",displayTextArea:true},layers:{type:ControlType.Array,control:{type:ControlType.ComponentInstance}},slot:{type:ControlType.String,defaultValue:\"[]\"},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:32,lineHeight:1.4}},textAlign:{type:ControlType.Enum,title:\"Text Align\",defaultValue:\"center\",options:[\"left\",\"center\",\"right\",\"justify\"],optionTitles:[\"Left\",\"Center\",\"Right\",\"Justify\"]},color:{type:ControlType.Object,icon:\"color\",controls:{mode:{type:ControlType.Enum,defaultValue:\"solid\",options:[\"solid\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],displaySegmentedControl:true},color:{type:ControlType.Color,defaultValue:\"#999999\",hidden:props=>props.mode!==\"solid\"},stops:{type:ControlType.Array,title:\"Stops\",hidden:props=>props.mode!==\"gradient\",control:{type:ControlType.Object,controls:{position:{type:ControlType.Number,min:0,max:100,unit:\"%\",defaultValue:0},color:{type:ControlType.Color,defaultValue:\"#0099FF\"}}},defaultValue:[{position:0,color:\"#007BFF\"},{position:50,color:\"#D9C43C\"},{position:100,color:\"#78EEB3\"}]},angle:{type:ControlType.Number,defaultValue:0,min:0,max:360,unit:\"\\xb0\",hidden:props=>props.mode!==\"gradient\"}}},layerAlign:{type:ControlType.Enum,defaultValue:\"baseline\",options:[\"baseline\",\"middle\"],optionTitles:[\"Baseline\",\"Middle\"],displaySegmentedControl:true,title:\"Align\"},layerGap:{type:ControlType.Number,defaultValue:0,min:0,step:1},transform:{type:ControlType.Enum,defaultValue:\"none\",options:[\"none\",\"inherit\",\"capitalize\",\"uppercase\",\"lowercase\"],optionTitles:[\"None\",\"Inherit\",\"Capitalize\",\"Uppercase\",\"Lowercase\"]},decoration:{type:ControlType.Enum,defaultValue:\"none\",options:[\"none\",\"underline\",\"line-through\"],optionTitles:[\"None\",\"Underline\",\"Strikethrough\"]},balance:{type:ControlType.Boolean,defaultValue:false},userSelect:{type:ControlType.Boolean,defaultValue:true},tag:{type:ControlType.Enum,defaultValue:\"h1\",options:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\",\"span\"],description:\"Made by [Samyadeep](https://samyadeep.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Text_Wrap\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"* @framerIntrinsicWidth 400\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Wrap.map"],"mappings":"0KAMG,SAAwB,EAAU,CAAC,SAAO,EAAE,CAAC,OAAK,OAAK,OAAK,QAAM,WAAS,YAAU,aAAW,aAAW,UAAQ,aAAW,MAAI,YAAU,SAAO,CAAC,IAAM,EAAI,EAC3J,EAAQA,MAAY,CAAC,IAAM,EAAM,EAAK,MAAM,EAAK,CAAO,EAAO,EAAE,CACvE,EAAM,SAAS,EAAK,IAAI,CAAC,EAAO,KAAK,EAAK,CACvC,EAAE,EAAM,OAAO,IAAM,EAAE,EAAO,OAAQ,EAAO,KAAkB,EAAK,EAAY,CAAC,MAAM,EAAW,IAAI,EAAS,SAAS,EAAO,GAAG,CAAC,SAAS,IAAI,CAAC,CAAO,EAAO,KAAK,EAAK,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