Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/components/src/renderers/layout/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ ComponentRegistry.register('card',
title: 'Card Title',
description: 'Card description goes here',
className: 'w-full'
},
isContainer: true,
resizable: true,
resizeConstraints: {
width: true,
height: true,
minWidth: 200,
minHeight: 100
}
}
);
8 changes: 8 additions & 0 deletions packages/components/src/renderers/layout/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ ComponentRegistry.register('container',
children: [
{ type: 'text', content: 'Container content goes here' }
]
},
isContainer: true,
resizable: true,
resizeConstraints: {
width: true,
height: true,
minWidth: 200,
minHeight: 100
}
}
);
8 changes: 8 additions & 0 deletions packages/components/src/renderers/layout/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ ComponentRegistry.register('grid',
{ type: 'card', title: 'Card 3', description: 'Third card' },
{ type: 'card', title: 'Card 4', description: 'Fourth card' }
]
},
isContainer: true,
resizable: true,
resizeConstraints: {
width: true,
height: true,
minWidth: 200,
minHeight: 100
}
}
);
10 changes: 10 additions & 0 deletions packages/core/src/registry/Registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ export type ComponentMeta = {
defaultProps?: Record<string, any>; // Default props when dropped
defaultChildren?: SchemaNode[]; // Default children when dropped
examples?: Record<string, any>; // Example configurations
isContainer?: boolean; // Whether the component can have children
resizable?: boolean; // Whether the component can be resized in the designer
resizeConstraints?: {
width?: boolean;
height?: boolean;
minWidth?: number;
maxWidth?: number;
minHeight?: number;
maxHeight?: number;
};
};

export type ComponentConfig<T = any> = ComponentMeta & {
Expand Down
Loading