Merge pull request #203 from presenton/refactor/layout-group-to-template
chore: updates presentation-layouts to presentation-templates
This commit is contained in:
commit
fda3890f0d
71 changed files with 60 additions and 45 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -16,3 +16,4 @@ generated_models
|
|||
nltk
|
||||
chroma
|
||||
container.db
|
||||
.next-build
|
||||
|
|
@ -171,7 +171,7 @@ export const LayoutProvider: React.FC<{
|
|||
const file = fileName.replace(".tsx", "").replace(".ts", "");
|
||||
|
||||
const module = await import(
|
||||
`@/presentation-layouts/${groupData.groupName}/${file}`
|
||||
`@/presentation-templates/${groupData.groupName}/${file}`
|
||||
);
|
||||
|
||||
if (!module.default) {
|
||||
|
|
@ -503,7 +503,7 @@ export const LayoutProvider: React.FC<{
|
|||
// Create and cache layout if not available
|
||||
const file = fileInfo.fileName.replace(".tsx", "").replace(".ts", "");
|
||||
const Layout = dynamic(
|
||||
() => import(`@/presentation-layouts/${fileInfo.groupName}/${file}`),
|
||||
() => import(`@/presentation-templates/${fileInfo.groupName}/${file}`),
|
||||
{
|
||||
loading: () => (
|
||||
<div className="w-full aspect-[16/9] bg-gray-100 animate-pulse rounded-lg" />
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ export const useGroupLayoutLoader = (
|
|||
try {
|
||||
const layoutName = fileName.replace(".tsx", "").replace(".ts", "");
|
||||
const module = await import(
|
||||
`@/presentation-layouts/${targetGroupData.groupName}/${layoutName}`
|
||||
`@/presentation-templates/${targetGroupData.groupName}/${layoutName}`
|
||||
);
|
||||
|
||||
if (!module.default) {
|
||||
|
|
@ -280,7 +280,7 @@ export const useGroupLayoutLoader = (
|
|||
try {
|
||||
const layoutName = fileName.replace(".tsx", "").replace(".ts", "");
|
||||
const module = await import(
|
||||
`@/presentation-layouts/${targetGroupData.groupName}/${layoutName}`
|
||||
`@/presentation-templates/${targetGroupData.groupName}/${layoutName}`
|
||||
);
|
||||
|
||||
if (module.default && module.Schema) {
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import { GroupSetting } from '@/app/(presentation-generator)/template-preview/ty
|
|||
|
||||
export async function GET() {
|
||||
try {
|
||||
// Get the path to the presentation-layouts directory
|
||||
const layoutsDirectory = path.join(process.cwd(), 'presentation-layouts')
|
||||
// Get the path to the presentation-templates directory
|
||||
const layoutsDirectory = path.join(process.cwd(), 'presentation-templates')
|
||||
|
||||
// Read all directories in the presentation-layouts directory
|
||||
// Read all directories in the presentation-templates directory
|
||||
const items = await fs.readdir(layoutsDirectory, { withFileTypes: true })
|
||||
|
||||
// Filter for directories (layout groups) and exclude files
|
||||
|
|
@ -67,9 +67,9 @@ export async function GET() {
|
|||
|
||||
return NextResponse.json(allLayouts)
|
||||
} catch (error) {
|
||||
console.error('Error reading presentation-layouts directory:', error)
|
||||
console.error('Error reading presentation-templates directory:', error)
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to read presentation-layouts directory' },
|
||||
{ error: 'Failed to read presentation-templates directory' },
|
||||
{ status: 500 }
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { GroupSetting } from '@/app/(presentation-generator)/template-preview/ty
|
|||
|
||||
export async function GET() {
|
||||
try {
|
||||
const layoutsDirectory = path.join(process.cwd(), 'presentation-layouts')
|
||||
const layoutsDirectory = path.join(process.cwd(), 'presentation-templates')
|
||||
const items = await fs.readdir(layoutsDirectory, { withFileTypes: true })
|
||||
|
||||
const groupDirectories = items.filter(item => item.isDirectory()).map(dir => dir.name)
|
||||
|
|
@ -48,9 +48,9 @@ export async function GET() {
|
|||
|
||||
return NextResponse.json(allLayouts)
|
||||
} catch (error) {
|
||||
console.error('Error reading presentation-layouts directory:', error)
|
||||
console.error('Error reading presentation-templates directory:', error)
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to read presentation layouts directory' },
|
||||
{ error: 'Failed to read presentation-templates directory' },
|
||||
{ status: 500 }
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as z from "zod";
|
||||
import { ImageSchema, IconSchema } from "@/presentation-layouts/defaultSchemes";
|
||||
import { ImageSchema, IconSchema } from "@/presentation-templates/defaultSchemes";
|
||||
|
||||
export const Schema = z.object({
|
||||
title: z.string().min(5).max(50).default("Quarterly Business Review").meta({
|
||||
|
|
@ -2,7 +2,7 @@ import * as z from "zod";
|
|||
// Note:
|
||||
// If you want to use images and icons, you must use ImageSchema and IconSchema
|
||||
// Images and icons are the only media types supported for PDF and PPTX exports
|
||||
import { ImageSchema, IconSchema } from "./defaultSchemes";
|
||||
import { ImageSchema, IconSchema } from "@/presentation-templates/defaultSchemes";
|
||||
|
||||
|
||||
// Schema definition
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'classic-dark-title-slide'
|
||||
export const layoutName = 'Classic Dark Title Slide'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'classic-dark-comparison'
|
||||
export const layoutName = 'Classic Dark Comparison'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { IconSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { IconSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'classic-dark-metrics'
|
||||
export const layoutName = 'Classic Dark Metrics'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'classic-dark-bullet-point-with-description'
|
||||
export const layoutName = 'Classic Dark Bullet Point with Description'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'type1-slide'
|
||||
export const layoutName = 'Type1 Slide'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'type3-slide'
|
||||
export const layoutName = 'Type3 Slide'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { IconSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { IconSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'type6-slide'
|
||||
export const layoutName = 'Type6 Slide'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { IconSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { IconSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'type7-slide'
|
||||
export const layoutName = 'Type7 Slide'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { IconSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { IconSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'type8-slide'
|
||||
export const layoutName = 'Type8 Slide'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'basic-info-slide'
|
||||
export const layoutName = 'Basic Info'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema, IconSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema, IconSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'bullet-icons-only-slide'
|
||||
export const layoutName = 'Bullet Icons Only'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema, IconSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema, IconSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'bullet-with-icons-slide'
|
||||
export const layoutName = 'Bullet with Icons'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { IconSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { IconSchema } from '@/presentation-templates/defaultSchemes';
|
||||
import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent } from "@/components/ui/chart";
|
||||
import { BarChart, Bar, LineChart, Line, PieChart, Pie, AreaChart, Area, ScatterChart, Scatter, XAxis, YAxis, CartesianGrid, Cell, ResponsiveContainer } from "recharts";
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'general-intro-slide'
|
||||
export const layoutName = 'Intro Slide'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'metrics-with-image-slide'
|
||||
export const layoutName = 'Metrics with Image'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'numbered-bullets-slide'
|
||||
export const layoutName = 'Numbered Bullets'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'quote-slide'
|
||||
export const layoutName = 'Quote'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from '@/presentation-layouts/defaultSchemes';
|
||||
import { ImageSchema } from '@/presentation-templates/defaultSchemes';
|
||||
|
||||
export const layoutId = 'team-slide'
|
||||
export const layoutName = 'Team Slide'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import * as z from "zod";
|
||||
import { ImageSchema, IconSchema } from "@/presentation-layouts/defaultSchemes";
|
||||
import { ImageSchema, IconSchema } from "@/presentation-templates/defaultSchemes";
|
||||
|
||||
export const layoutId = "about-company-slide";
|
||||
export const layoutName = "About Our Company Slide";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import * as z from "zod";
|
||||
import { ImageSchema, IconSchema } from "@/presentation-layouts/defaultSchemes";
|
||||
import { ImageSchema, IconSchema } from "@/presentation-templates/defaultSchemes";
|
||||
|
||||
export const layoutId = "problem-statement-slide";
|
||||
export const layoutName = "Problem Statement Slide";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import * as z from "zod";
|
||||
import { IconSchema } from "@/presentation-layouts/defaultSchemes";
|
||||
import { IconSchema } from "@/presentation-templates/defaultSchemes";
|
||||
|
||||
export const layoutId = "solution-slide";
|
||||
export const layoutName = "Solution Slide";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from "@/presentation-layouts/defaultSchemes";
|
||||
import { ImageSchema } from "@/presentation-templates/defaultSchemes";
|
||||
|
||||
export const layoutId = "product-overview-slide";
|
||||
export const layoutName = "Product Overview Slide";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from "@/presentation-layouts/defaultSchemes";
|
||||
import { ImageSchema } from "@/presentation-templates/defaultSchemes";
|
||||
|
||||
export const layoutId = "market-size-pitchdeck-slide";
|
||||
export const layoutName = "Market Size Pitch Deck Slide";
|
||||
|
|
@ -3,7 +3,7 @@ import * as z from "zod";
|
|||
import { Card } from "@/components/ui/card";
|
||||
import { Table, TableHeader, TableBody } from "@/components/ui/table";
|
||||
import { ChartContainer } from "@/components/ui/chart";
|
||||
import { ImageSchema } from "@/presentation-layouts/defaultSchemes";
|
||||
import { ImageSchema } from "@/presentation-templates/defaultSchemes";
|
||||
import { BarChart, Bar, XAxis, YAxis, Tooltip, Cell } from "recharts";
|
||||
|
||||
export const layoutId = "market-validation-slide";
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import * as z from "zod";
|
||||
import { ImageSchema } from "@/presentation-layouts/defaultSchemes";
|
||||
import { ImageSchema } from "@/presentation-templates/defaultSchemes";
|
||||
|
||||
export const layoutId = "modern-team-slide";
|
||||
export const layoutName = "Modern Team Slide";
|
||||
|
|
@ -8,7 +8,7 @@ const config: Config = {
|
|||
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"!./app/privacy-policy/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./presentation-layouts/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./presentation-templates/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"target": "esnext",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
|
|
@ -20,9 +24,19 @@
|
|||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": ["./*"]
|
||||
"@/*": [
|
||||
"./*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
".next-build/types/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue