{"version":3,"file":"Character_limit.spnDMji3.mjs","names":[],"sources":["https:/framerusercontent.com/modules/7hoW8N4kOnHor1k5VpXm/ki7YwCDvO6AM4oQ1Lg1o/Character_limit.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";// Setting Maximum Text Character Limit in Framer CMS by Doruk Kavcioglu\n// Framer.guide | Framer Course - Coming Soon\nexport function withCharacterLimit(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=120// Set character limit\n;// Check if text is longer than limit, if so, trim it\nlet trimmedText=text;if((text===null||text===void 0?void 0:text.length)>limit){// Trim text to the limit\ntrimmedText=text.slice(0,limit);// Find the last space within the trimmed text to ensure it ends with a full word\nconst lastSpaceIndex=trimmedText.lastIndexOf(\" \");// Trim the text at the last space index to ensure it ends with a full word\nif(lastSpaceIndex!==-1){trimmedText=trimmedText.slice(0,lastSpaceIndex).trim();}trimmedText+=\"... v\\xedce\"// Add three dots\n;}return /*#__PURE__*/_jsx(Component,{...otherProps,text:trimmedText});};}export function withCharacterLimit300(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=300// Set character limit\n;// Check if text is longer than limit, if so, trim it\nlet trimmedText=text;if((text===null||text===void 0?void 0:text.length)>limit){// Trim text to the limit\ntrimmedText=text.slice(0,limit);// Find the last space within the trimmed text to ensure it ends with a full word\nconst lastSpaceIndex=trimmedText.lastIndexOf(\" \");// Trim the text at the last space index to ensure it ends with a full word\nif(lastSpaceIndex!==-1){trimmedText=trimmedText.slice(0,lastSpaceIndex).trim();}trimmedText+=\"... v\\xedce\"// Add three dots\n;}return /*#__PURE__*/_jsx(Component,{...otherProps,text:trimmedText});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCharacterLimit300\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit300\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimit\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Character_limit.map"],"mappings":"oGAEA,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAC5D,GAAK,CAAC,OAAK,GAAG,GAAY,EAEtB,EAAY,EAAK,GAAI,GAAuC,OAAQ,IAAM,CAC9E,EAAY,EAAK,MAAM,EAAE,IAAM,CAC/B,IAAM,EAAe,EAAY,YAAY,IAAI,CAC9C,IAAiB,KAAI,EAAY,EAAY,MAAM,EAAE,EAAe,CAAC,MAAM,EAAE,GAAa,WAC3F,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAW,KAAK,EAAY,CAAC,EAAI,SAAgB,EAAsB,EAAU,CAAC,MAAO,IAAO,CACzI,GAAK,CAAC,OAAK,GAAG,GAAY,EAEtB,EAAY,EAAK,GAAI,GAAuC,OAAQ,IAAM,CAC9E,EAAY,EAAK,MAAM,EAAE,IAAM,CAC/B,IAAM,EAAe,EAAY,YAAY,IAAI,CAC9C,IAAiB,KAAI,EAAY,EAAY,MAAM,EAAE,EAAe,CAAC,MAAM,EAAE,GAAa,WAC3F,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAW,KAAK,EAAY,CAAC,mBAhB3B"}