Skip to content
Open
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
70 changes: 70 additions & 0 deletions my-sonicjs-app/src/collections/page-blocks.collection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,74 @@
import type { CollectionConfig } from '@sonicjs-cms/core'

const heroBlock = {
label: 'Hero',
properties: {
heading: { type: 'string', title: 'Heading', required: true },
subheading: { type: 'textarea', title: 'Subheading', maxLength: 600 },
image: { type: 'media', title: 'Background/Image' },
imageAlt: { type: 'string', title: 'Image Alt' },

ctaPrimary: {
title: 'Primary CTA',
type: 'object',
properties: {
label: { type: 'string', title: 'Label' },
link: {
title: 'Link',
type: 'object',
properties: {
mode: {
type: 'select',
title: 'Link type',
enum: ['none', 'internal', 'external'],
enumLabels: ['None', 'Internal', 'External'],
default: 'none',
},
reference: { type: 'reference', title: 'Internal reference', collection: 'pages' },
url: { type: 'url', title: 'External URL' },
},
},
style: {
type: 'select',
title: 'Button style',
enum: ['primary', 'secondary'],
enumLabels: ['Primary', 'Secondary'],
default: 'primary',
},
},
},
ctaSecondary: {
title: 'Secondary CTA',
type: 'object',
properties: {
label: { type: 'string', title: 'Label' },
link: {
title: 'Link',
type: 'object',
properties: {
mode: {
type: 'select',
title: 'Type',
enum: ['none', 'internal', 'external'],
enumLabels: ['None', 'Internal', 'External'],
default: 'none',
},
reference: { type: 'reference', title: 'Internal reference', collection: 'pages' },
url: { type: 'url', title: 'External URL' },
},
},
style: {
type: 'select',
title: 'Button style',
enum: ['primary', 'secondary'],
enumLabels: ['Primary', 'Secondary'],
default: 'primary',
},
},
},
},
}

const pageBlocksCollection: CollectionConfig = {
name: 'page_blocks',
displayName: 'Page Blocks',
Expand Down Expand Up @@ -60,6 +129,7 @@ const pageBlocksCollection: CollectionConfig = {
type: 'object',
discriminator: 'blockType',
blocks: {
hero: heroBlock,
text: {
label: 'Text',
properties: {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ function buildQuery(table, filter) {
// package.json
var package_default = {
name: "@sonicjs-cms/core",
version: "2.7.0",
version: "2.8.0",
description: "Core framework for SonicJS headless CMS - Edge-first, TypeScript-native CMS built for Cloudflare Workers",
type: "module",
main: "./dist/index.cjs",
Expand Down Expand Up @@ -617,5 +617,5 @@ exports.renderTemplate = renderTemplate;
exports.sanitizeInput = sanitizeInput;
exports.sanitizeObject = sanitizeObject;
exports.templateRenderer = templateRenderer;
//# sourceMappingURL=chunk-DMZI7OU3.cjs.map
//# sourceMappingURL=chunk-DMZI7OU3.cjs.map
//# sourceMappingURL=chunk-5HMR2SJW.cjs.map
//# sourceMappingURL=chunk-5HMR2SJW.cjs.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/core/dist/chunk-5PH7K7YR.js.map

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/dist/chunk-5TO3OUFT.cjs.map

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/dist/chunk-6STHJAKU.cjs.map

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/dist/chunk-7DU5PUKL.js.map

This file was deleted.

Loading