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
78 changes: 78 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,82 @@
import type { CollectionConfig } from '@sonicjs-cms/core'

const heroBlock = {
label: 'Hero',
properties: {
heading: { type: 'string', title: 'Heading', required: true },
height: {
type: 'radio',
title: 'Height',
enum: ['small', 'medium', 'full'],
enumLabels: ['Small', 'Medium', 'Full'],
default: 'medium',
inline: 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 +137,7 @@ const pageBlocksCollection: CollectionConfig = {
type: 'object',
discriminator: 'blockType',
blocks: {
hero: heroBlock,
text: {
label: 'Text',
properties: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var chunkMPT5PA6U_cjs = require('./chunk-MPT5PA6U.cjs');
var chunk2YRNPIU4_cjs = require('./chunk-2YRNPIU4.cjs');
var chunkDYA6Q3RQ_cjs = require('./chunk-DYA6Q3RQ.cjs');
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
var jwt = require('hono/jwt');
var cookie = require('hono/cookie');
Expand All @@ -20,7 +20,7 @@ function bootstrapMiddleware(config = {}) {
try {
console.log("[Bootstrap] Starting system initialization...");
console.log("[Bootstrap] Running database migrations...");
const migrationService = new chunk2YRNPIU4_cjs.MigrationService(c.env.DB);
const migrationService = new chunkDYA6Q3RQ_cjs.MigrationService(c.env.DB);
await migrationService.runPendingMigrations();
console.log("[Bootstrap] Syncing collection configurations...");
try {
Expand Down Expand Up @@ -239,5 +239,5 @@ exports.requirePermission = requirePermission;
exports.requireRole = requireRole;
exports.securityHeaders = securityHeaders;
exports.securityLoggingMiddleware = securityLoggingMiddleware;
//# sourceMappingURL=chunk-6RABGLOO.cjs.map
//# sourceMappingURL=chunk-6RABGLOO.cjs.map
//# sourceMappingURL=chunk-2AIY75JA.cjs.map
//# sourceMappingURL=chunk-2AIY75JA.cjs.map

Large diffs are not rendered by default.

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