create-nextblock 0.2.33 → 0.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/nextblock-template/app/[slug]/PageClientContent.tsx +67 -67
- package/templates/nextblock-template/app/[slug]/page.tsx +4 -4
- package/templates/nextblock-template/app/cms/blocks/actions.ts +5 -5
- package/templates/nextblock-template/app/cms/blocks/components/BackgroundSelector.tsx +348 -350
- package/templates/nextblock-template/app/cms/blocks/components/BlockEditorArea.tsx +13 -16
- package/templates/nextblock-template/app/cms/blocks/components/BlockEditorModal.tsx +1 -1
- package/templates/nextblock-template/app/cms/blocks/components/ColumnEditor.tsx +24 -42
- package/templates/nextblock-template/app/cms/blocks/components/EditableBlock.tsx +6 -6
- package/templates/nextblock-template/app/cms/blocks/editors/SectionBlockEditor.tsx +35 -56
- package/templates/nextblock-template/app/cms/blocks/editors/TextBlockEditor.tsx +81 -81
- package/templates/nextblock-template/app/cms/media/actions.ts +12 -12
- package/templates/nextblock-template/app/cms/media/components/MediaGridClient.tsx +3 -3
- package/templates/nextblock-template/app/cms/media/components/MediaUploadForm.tsx +1 -1
- package/templates/nextblock-template/app/cms/media/page.tsx +120 -120
- package/templates/nextblock-template/app/cms/revisions/JsonDiffView.tsx +86 -87
- package/templates/nextblock-template/app/cms/revisions/RevisionHistoryButton.tsx +10 -16
- package/templates/nextblock-template/app/cms/revisions/service.ts +344 -344
- package/templates/nextblock-template/app/cms/settings/extra-translations/actions.ts +1 -1
- package/templates/nextblock-template/app/cms/settings/logos/[id]/edit/page.tsx +0 -1
- package/templates/nextblock-template/app/providers.tsx +2 -2
- package/templates/nextblock-template/components/BlockRenderer.tsx +9 -9
- package/templates/nextblock-template/components/ResponsiveNav.tsx +22 -22
- package/templates/nextblock-template/components/blocks/PostsGridBlock.tsx +12 -12
- package/templates/nextblock-template/components/blocks/renderers/ClientTextBlockRenderer.tsx +26 -26
- package/templates/nextblock-template/components/blocks/renderers/HeroBlockRenderer.tsx +41 -41
- package/templates/nextblock-template/components/blocks/renderers/ImageBlockRenderer.tsx +7 -7
- package/templates/nextblock-template/components/theme-switcher.tsx +78 -78
- package/templates/nextblock-template/eslint.config.mjs +35 -37
- package/templates/nextblock-template/lib/blocks/blockRegistry.ts +10 -10
- package/templates/nextblock-template/next-env.d.ts +6 -6
- package/templates/nextblock-template/package.json +1 -1
|
@@ -149,7 +149,7 @@ export interface SectionBlockContent {
|
|
|
149
149
|
/** Array of blocks within columns - 2D array where each index represents a column */
|
|
150
150
|
column_blocks: Array<Array<{
|
|
151
151
|
block_type: BlockType;
|
|
152
|
-
content: Record<string,
|
|
152
|
+
content: Record<string, any>;
|
|
153
153
|
temp_id?: string; // For client-side management before save
|
|
154
154
|
}>>;
|
|
155
155
|
}
|
|
@@ -211,7 +211,7 @@ export interface ContentPropertyDefinition {
|
|
|
211
211
|
/** Human-readable description of the property */
|
|
212
212
|
description?: string;
|
|
213
213
|
/** Default value for the property */
|
|
214
|
-
default?:
|
|
214
|
+
default?: any;
|
|
215
215
|
/** For union types, the possible values */
|
|
216
216
|
unionValues?: readonly string[];
|
|
217
217
|
/** For array types, the type of array elements */
|
|
@@ -221,7 +221,7 @@ export interface ContentPropertyDefinition {
|
|
|
221
221
|
min?: number;
|
|
222
222
|
max?: number;
|
|
223
223
|
pattern?: string;
|
|
224
|
-
enum?: readonly
|
|
224
|
+
enum?: readonly any[];
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
|
|
@@ -229,7 +229,7 @@ export interface ContentPropertyDefinition {
|
|
|
229
229
|
* Enhanced block definition interface with generic type parameter
|
|
230
230
|
* Links the TypeScript interface to the block definition for better type safety
|
|
231
231
|
*/
|
|
232
|
-
export interface BlockDefinition<T =
|
|
232
|
+
export interface BlockDefinition<T = any> {
|
|
233
233
|
/** The unique identifier for the block type */
|
|
234
234
|
type: BlockType;
|
|
235
235
|
/** User-friendly display name for the block */
|
|
@@ -799,7 +799,7 @@ export function getBlockDefinition(blockType: BlockType): BlockDefinition | unde
|
|
|
799
799
|
* @param blockType - The type of block to get initial content for
|
|
800
800
|
* @returns The initial content object or undefined if block type not found
|
|
801
801
|
*/
|
|
802
|
-
export function getInitialContent(blockType: BlockType):
|
|
802
|
+
export function getInitialContent(blockType: BlockType): object | undefined {
|
|
803
803
|
return blockRegistry[blockType]?.initialContent;
|
|
804
804
|
}
|
|
805
805
|
|
|
@@ -870,7 +870,7 @@ export type AllBlockContent =
|
|
|
870
870
|
*/
|
|
871
871
|
export function validateBlockContent(
|
|
872
872
|
blockType: BlockType,
|
|
873
|
-
content: Record<string,
|
|
873
|
+
content: Record<string, any>
|
|
874
874
|
): {
|
|
875
875
|
isValid: boolean;
|
|
876
876
|
errors: string[];
|
|
@@ -984,13 +984,13 @@ export function getRequiredProperties(blockType: BlockType): string[] {
|
|
|
984
984
|
* @param blockType - The type of block
|
|
985
985
|
* @returns Complete default content object
|
|
986
986
|
*/
|
|
987
|
-
export function generateDefaultContent(blockType: BlockType): Record<string,
|
|
987
|
+
export function generateDefaultContent(blockType: BlockType): Record<string, any> {
|
|
988
988
|
const schema = getContentSchema(blockType);
|
|
989
|
-
const initialContent = getInitialContent(blockType) ||
|
|
989
|
+
const initialContent = getInitialContent(blockType) || {};
|
|
990
990
|
|
|
991
|
-
if (!schema) return initialContent
|
|
991
|
+
if (!schema) return initialContent;
|
|
992
992
|
|
|
993
|
-
const defaultContent: Record<string,
|
|
993
|
+
const defaultContent: Record<string, any> = { ...initialContent };
|
|
994
994
|
|
|
995
995
|
for (const [propertyName, propertyDef] of Object.entries(schema)) {
|
|
996
996
|
if (defaultContent[propertyName] === undefined && propertyDef.default !== undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="next" />
|
|
2
|
-
/// <reference types="next/image-types/global" />
|
|
3
|
-
import "./.next/dev/types/routes.d.ts";
|
|
4
|
-
|
|
5
|
-
// NOTE: This file should not be edited
|
|
6
|
-
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
|
1
|
+
/// <reference types="next" />
|
|
2
|
+
/// <reference types="next/image-types/global" />
|
|
3
|
+
import "./.next/dev/types/routes.d.ts";
|
|
4
|
+
|
|
5
|
+
// NOTE: This file should not be edited
|
|
6
|
+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|