This commit is contained in:
Juergen Kunz
2025-06-24 22:45:50 +00:00
parent 68b4e9ec8e
commit e9541da8ff
28 changed files with 4733 additions and 88 deletions

View File

@ -0,0 +1,47 @@
/**
* Block Registration Module
* Handles registration of all block handlers with the BlockRegistry
*
* Phase 2 Complete: Divider block has been successfully migrated
* to the new block handler architecture.
* Phase 3 Complete: Paragraph block has been successfully migrated
* to the new block handler architecture.
* Phase 4 Complete: All heading blocks (h1, h2, h3) have been successfully migrated
* to the new block handler architecture using a unified HeadingBlockHandler.
* Phase 5 Complete: Quote, Code, and List blocks have been successfully migrated
* to the new block handler architecture.
*/
import { BlockRegistry, DividerBlockHandler } from './blocks/index.js';
import { ParagraphBlockHandler } from './blocks/text/paragraph.block.js';
import { HeadingBlockHandler } from './blocks/text/heading.block.js';
import { QuoteBlockHandler } from './blocks/text/quote.block.js';
import { CodeBlockHandler } from './blocks/text/code.block.js';
import { ListBlockHandler } from './blocks/text/list.block.js';
// Initialize and register all block handlers
export function registerAllBlockHandlers(): void {
// Register content blocks
BlockRegistry.register('divider', new DividerBlockHandler());
// Register text blocks
BlockRegistry.register('paragraph', new ParagraphBlockHandler());
BlockRegistry.register('heading-1', new HeadingBlockHandler('heading-1'));
BlockRegistry.register('heading-2', new HeadingBlockHandler('heading-2'));
BlockRegistry.register('heading-3', new HeadingBlockHandler('heading-3'));
BlockRegistry.register('quote', new QuoteBlockHandler());
BlockRegistry.register('code', new CodeBlockHandler());
BlockRegistry.register('list', new ListBlockHandler());
// TODO: Register media blocks when implemented
// BlockRegistry.register('image', new ImageBlockHandler());
// BlockRegistry.register('youtube', new YoutubeBlockHandler());
// BlockRegistry.register('attachment', new AttachmentBlockHandler());
// TODO: Register other content blocks when implemented
// BlockRegistry.register('markdown', new MarkdownBlockHandler());
// BlockRegistry.register('html', new HtmlBlockHandler());
}
// Ensure blocks are registered when this module is imported
registerAllBlockHandlers();