Merge branch 'feat/custom_schema_and_layout' of github.com:presenton/presenton into feat/custom_schema_and_layout
This commit is contained in:
commit
1f9853ceb2
13 changed files with 17 additions and 17 deletions
|
|
@ -16,7 +16,7 @@ export interface LayoutInfo {
|
|||
export interface GroupSetting {
|
||||
description: string;
|
||||
ordered: boolean;
|
||||
isDefault?: boolean;
|
||||
default?: boolean;
|
||||
}
|
||||
|
||||
export interface GroupedLayoutsResponse {
|
||||
|
|
@ -87,7 +87,7 @@ export const LayoutProvider: React.FC<{ children: ReactNode }> = ({ children })
|
|||
const settings = groupData.settings || {
|
||||
description: `${groupData.groupName} presentation layouts`,
|
||||
ordered: false,
|
||||
isDefault: false
|
||||
default: false
|
||||
};
|
||||
|
||||
groupSettingsMap.set(groupData.groupName, settings);
|
||||
|
|
|
|||
|
|
@ -32,14 +32,14 @@ const LayoutSelection: React.FC<LayoutSelectionProps> = ({
|
|||
name: groupName,
|
||||
description: settings?.description || `${groupName} presentation layouts`,
|
||||
ordered: settings?.ordered || false,
|
||||
isDefault: settings?.isDefault || false,
|
||||
default: settings?.default || false,
|
||||
};
|
||||
});
|
||||
|
||||
// Sort groups to put default first, then by name
|
||||
return Groups.sort((a, b) => {
|
||||
if (a.isDefault && !b.isDefault) return -1;
|
||||
if (!a.isDefault && b.isDefault) return 1;
|
||||
if (a.default && !b.default) return -1;
|
||||
if (!a.default && b.default) return 1;
|
||||
return a.name.localeCompare(b.name);
|
||||
});
|
||||
}, [getAllGroups, getLayoutsByGroup, getGroupSetting]);
|
||||
|
|
@ -47,7 +47,7 @@ const LayoutSelection: React.FC<LayoutSelectionProps> = ({
|
|||
// Auto-select first group when groups are loaded
|
||||
useEffect(() => {
|
||||
if (layoutGroups.length > 0 && !selectedLayoutGroup) {
|
||||
const defaultGroup = layoutGroups.find(g => g.isDefault) || layoutGroups[0];
|
||||
const defaultGroup = layoutGroups.find(g => g.default) || layoutGroups[0];
|
||||
const slides = getLayoutsByGroup(defaultGroup.id);
|
||||
|
||||
onSelectLayoutGroup({
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ export interface LayoutGroup {
|
|||
name: string;
|
||||
description: string;
|
||||
ordered: boolean;
|
||||
isDefault?: boolean;
|
||||
default?: boolean;
|
||||
slides?: any
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export async function GET() {
|
|||
settings = {
|
||||
description: `${groupName} presentation layouts`,
|
||||
ordered: false,
|
||||
isDefault: false
|
||||
default: false
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export const useGroupLayoutLoader = (groupSlug: string): UseGroupLayoutLoaderRet
|
|||
const groupSettings: GroupSetting = targetGroupData.settings ? targetGroupData.settings : {
|
||||
description: `${targetGroupData.groupName} presentation layouts`,
|
||||
ordered: false,
|
||||
isDefault: false
|
||||
default: false
|
||||
}
|
||||
for (const fileName of targetGroupData.files) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export const useLayoutLoader = (): UseLayoutLoaderReturn => {
|
|||
const groupSettings: GroupSetting = groupData.settings ? groupData.settings : {
|
||||
description: `${groupData.groupName} presentation layouts`,
|
||||
ordered: false,
|
||||
isDefault: false
|
||||
default: false
|
||||
}
|
||||
|
||||
for (const fileName of groupData.files) {
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ const LayoutPreview = () => {
|
|||
<span className="text-xs text-gray-500">
|
||||
{group.layouts.length} layout{group.layouts.length !== 1 ? 's' : ''}
|
||||
</span>
|
||||
{group.settings.isDefault && (
|
||||
{group.settings.default && (
|
||||
<span className="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800">
|
||||
Default
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export interface LayoutInfo {
|
|||
export interface GroupSetting {
|
||||
description: string;
|
||||
ordered: boolean;
|
||||
isDefault?: boolean;
|
||||
default?: boolean;
|
||||
}
|
||||
|
||||
export interface LayoutGroup {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"description": "Default layout for presentations",
|
||||
"ordered": false,
|
||||
"isDefault": true
|
||||
"default": true
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"description": "General purpose layouts for common presentation elements",
|
||||
"ordered": false,
|
||||
"isDefault": false
|
||||
"default": false
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ export const layoutName = "Intro Pitch Deck Slide";
|
|||
export const layoutDescription =
|
||||
"A visually appealing introduction slide for a pitch deck, featuring a large title, company name, date, and contact information with a modern design.";
|
||||
const introPitchDeckSchema = z.object({
|
||||
title: z.string().min(2).max(15).default("Pitch Deck and badu").meta({
|
||||
title: z.string().min(2).max(15).default("Pitch Deck").meta({
|
||||
description: "Main title of the slide",
|
||||
}),
|
||||
description: z.string().default("").meta({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"description": "Modern white and blue business pitch deck layouts with clean, professional design",
|
||||
"ordered": false,
|
||||
"isDefault": false
|
||||
"default": false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"description": "Professional presentation layouts with clean design and flexible content fields. Suitable for business pitches, organizational overviews, product presentations, and various corporate communications.",
|
||||
"ordered": false,
|
||||
"isDefault": false
|
||||
"default": false
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue