{"version":3,"file":"Character_Limit.-OGPptTL.mjs","names":[],"sources":["https:/framerusercontent.com/modules/pUYbD4fwNW5XCztucAux/6Ripf12uO1nfJnI4ENK9/Character_Limit.js"],"sourcesContent":["// Setting Maximum Text Character Limit in Framer CMS by Doruk Kavcioglu\n// Framer.guide | Framer Course - Coming Soon\nimport{jsx as _jsx}from\"react/jsx-runtime\";export 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){trimmedText=text.slice(0,limit).trim()// Trim extra spaces\n;// Check if trimmed text ends with dot\nif(trimmedText.endsWith(\".\")){trimmedText=trimmedText.slice(0,-1).trim()// Remove extra dot if it ends with a dot\n;}trimmedText+=\"...\"// Add three dots\n;}return /*#__PURE__*/_jsx(Component,{...otherProps,text:trimmedText});};}export function withCharacterLimit2(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=100// 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){trimmedText=text.slice(0,limit).trim()// Trim extra spaces\n;// Check if trimmed text ends with dot\nif(trimmedText.endsWith(\".\")){trimmedText=trimmedText.slice(0,-1).trim()// Remove extra dot if it ends with a dot\n;}trimmedText+=\"...\"// Add three dots\n;}return /*#__PURE__*/_jsx(Component,{...otherProps,text:trimmedText});};}export function withCharacterLimitBlogTitle(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=35// 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){trimmedText=text.slice(0,limit).trim()// Trim extra spaces\n;// Check if trimmed text ends with dot\nif(trimmedText.endsWith(\".\")){trimmedText=trimmedText.slice(0,-1).trim()// Remove extra dot if it ends with a dot\n;}trimmedText+=\"...\"// Add three dots\n;}return /*#__PURE__*/_jsx(Component,{...otherProps,text:trimmedText});};}export function withCharacterLimitBlogSubtitle(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=60// 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){trimmedText=text.slice(0,limit).trim()// Trim extra spaces\n;// Check if trimmed text ends with dot\nif(trimmedText.endsWith(\".\")){trimmedText=trimmedText.slice(0,-1).trim()// Remove extra dot if it ends with a dot\n;}trimmedText+=\"...\"// Add three dots\n;}return /*#__PURE__*/_jsx(Component,{...otherProps,text:trimmedText});};}export function withCharacterLimitBlogAuthor(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=20// 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){trimmedText=text.slice(0,limit).trim()// Trim extra spaces\n;// Check if trimmed text ends with dot\nif(trimmedText.endsWith(\".\")){trimmedText=trimmedText.slice(0,-1).trim()// Remove extra dot if it ends with a dot\n;}trimmedText+=\"...\"// Add three dots\n;}return /*#__PURE__*/_jsx(Component,{...otherProps,text:trimmedText});};}export function withLineClamp(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{overflow:\"hidden\",display:\"-webkit-box\",\"-webkit-box-orient\":\"vertical\",\"-webkit-line-clamp\":\"2\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCharacterLimit2\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimitBlogTitle\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimitBlogTitle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimitBlogAuthor\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimitBlogAuthor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimit\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimitBlogSubtitle\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimitBlogSubtitle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLineClamp\":{\"type\":\"reactHoc\",\"name\":\"withLineClamp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Character_Limit.map"],"mappings":"oGAS0E,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CACvI,GAAK,CAAC,OAAK,GAAG,GAAY,EAEtB,EAAY,EAId,OAJuB,GAAuC,OAAQ,MAAO,EAAY,EAAK,MAAM,EAAE,GAAK,CAAC,CAAC,KAAK,EAEjH,EAAY,SAAS,GAAG,IAAG,EAAY,EAAY,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,GACrE,GAAa,OACO,EAAK,EAAU,CAAC,GAAG,EAAW,KAAK,CAAW,CAAC,CAAE,CAAE,CAOC,SAAgB,EAA+B,EAAU,CAAC,MAAO,IAAO,CAClJ,GAAK,CAAC,OAAK,GAAG,GAAY,EAEtB,EAAY,EAId,OAJuB,GAAuC,OAAQ,KAAO,EAAY,EAAK,MAAM,EAAE,EAAK,CAAC,CAAC,KAAK,EAEjH,EAAY,SAAS,GAAG,IAAG,EAAY,EAAY,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,GACrE,GAAa,OACO,EAAK,EAAU,CAAC,GAAG,EAAW,KAAK,CAAW,CAAC,CAAE,CAAE,iBA5B/B"}