{"version":3,"file":"Examples.2OlOCdF5.mjs","names":[],"sources":["https:/framerusercontent.com/modules/8FRnDmEN5KSKXzD4CUFm/xG8EHJwHZDsZwxueX4Qk/Examples.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";// Learn more: https://www.framer.com/docs/guides/overrides/\n// Setting Maximum Text Character Limit in Framer CMS by Doruk Kavcioglu\n// Framer.guide | Framer Course - Coming Soon\nexport function withCharacterLimit30(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=30// 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 withCharacterLimit45(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=45// 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 withCharacterLimit60(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 withCharacterLimit75(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=75// 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 withCharacterLimit90(Component){return props=>{// Extract text property\nconst{text,...otherProps}=props;const limit=90// 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 withCharacterLimit120(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});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCharacterLimit30\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit30\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimit90\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit90\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimit75\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit75\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimit60\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit60\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimit45\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit45\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimit120\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit120\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"oGAGA,SAAgB,EAAqB,EAAU,CAAC,MAAO,IAAO,CAC9D,GAAK,CAAC,OAAK,GAAG,GAAY,EAEtB,EAAY,EAId,OAJuB,GAAuC,OAAQ,KAAO,EAAY,EAAK,MAAM,EAAE,GAAM,CAAC,MAAM,CAElH,EAAY,SAAS,IAAI,GAAE,EAAY,EAAY,MAAM,EAAE,GAAG,CAAC,MAAM,EACtE,GAAa,OACO,EAAK,EAAU,CAAC,GAAG,EAAW,KAAK,EAAY,CAAC,EAOI,SAAgB,EAAqB,EAAU,CAAC,MAAO,IAAO,CACxI,GAAK,CAAC,OAAK,GAAG,GAAY,EAEtB,EAAY,EAId,OAJuB,GAAuC,OAAQ,KAAO,EAAY,EAAK,MAAM,EAAE,GAAM,CAAC,MAAM,CAElH,EAAY,SAAS,IAAI,GAAE,EAAY,EAAY,MAAM,EAAE,GAAG,CAAC,MAAM,EACtE,GAAa,OACO,EAAK,EAAU,CAAC,GAAG,EAAW,KAAK,EAAY,CAAC,EAAI,SAAgB,EAAqB,EAAU,CAAC,MAAO,IAAO,CACxI,GAAK,CAAC,OAAK,GAAG,GAAY,EAEtB,EAAY,EAId,OAJuB,GAAuC,OAAQ,KAAO,EAAY,EAAK,MAAM,EAAE,GAAM,CAAC,MAAM,CAElH,EAAY,SAAS,IAAI,GAAE,EAAY,EAAY,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