feat: Add WYSIWYG editor components and utilities
- Implemented WysiwygModalManager for managing modals related to code blocks and block settings. - Created WysiwygSelection for handling text selection across Shadow DOM boundaries. - Introduced WysiwygShortcuts for managing keyboard shortcuts and slash menu items. - Developed wysiwygStyles for consistent styling of the WYSIWYG editor. - Defined types for blocks, slash menu items, and shortcut patterns in wysiwyg.types.ts.
This commit is contained in:
17
ts_web/elements/dees-input-wysiwyg/blocks/block.registry.ts
Normal file
17
ts_web/elements/dees-input-wysiwyg/blocks/block.registry.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { IBlockHandler } from './block.base.js';
|
||||
|
||||
export class BlockRegistry {
|
||||
private static handlers = new Map<string, IBlockHandler>();
|
||||
|
||||
static register(type: string, handler: IBlockHandler): void {
|
||||
this.handlers.set(type, handler);
|
||||
}
|
||||
|
||||
static getHandler(type: string): IBlockHandler | undefined {
|
||||
return this.handlers.get(type);
|
||||
}
|
||||
|
||||
static getAllTypes(): string[] {
|
||||
return Array.from(this.handlers.keys());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user