feat(templates): replace library with microfrontend app for templates

This commit is contained in:
Amruth Pillai
2023-11-07 16:37:16 +01:00
parent fca61543c5
commit 1aa8aa6900
87 changed files with 1512 additions and 1835 deletions

View File

@ -1,3 +1,5 @@
import { Template } from "./types";
export const pageSizeMap = {
a4: {
width: 210,
@ -8,3 +10,12 @@ export const pageSizeMap = {
height: 279,
},
};
export const templatesList: Template[] = [
{
id: "rhyhorn",
name: "Rhyhorn",
image:
"https://res.cloudinary.com/amruth-pillai/image/upload/v1699370067/reactive-resume/templates/482-2480x3508_vuf5ev.jpg",
},
];

View File

@ -15,6 +15,11 @@ export const isUrl = (string: string) => {
return urlRegex.test(string);
};
export const isEmptyString = (string: string) => {
if (string === "<p></p>") return true;
return string.trim().length === 0;
};
export const extractUrl = (string: string) => {
const urlRegex = /https?:\/\/[^ \n]+/i;

View File

@ -1,5 +1,7 @@
export type Json = Record<string, unknown>;
export type Template = { id: string; name: string; image: string };
export type LayoutLocator = { page: number; column: number; section: number };
export type DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T;