2025-06-24 22:45:50 +00:00
|
|
|
|
# WYSIWYG Editor Refactoring Plan
|
2025-06-22 20:32:59 +00:00
|
|
|
|
|
2025-06-24 22:45:50 +00:00
|
|
|
|
## Current Status
|
2025-06-22 20:32:59 +00:00
|
|
|
|
|
2025-06-24 22:45:50 +00:00
|
|
|
|
The `dees-wysiwyg-block.ts` file has grown to over 2100 lines and contains:
|
|
|
|
|
- Main component logic
|
|
|
|
|
- CSS styles for all block types
|
|
|
|
|
- Rendering logic for each block type
|
|
|
|
|
- Setup methods for each block type
|
|
|
|
|
- Helper methods for various functionality
|
2025-06-22 20:32:59 +00:00
|
|
|
|
|
2025-06-24 22:45:50 +00:00
|
|
|
|
This makes the file difficult to maintain and extend.
|
2025-06-22 20:32:59 +00:00
|
|
|
|
|
2025-06-24 22:45:50 +00:00
|
|
|
|
## Refactoring Goals
|
2025-06-22 20:32:59 +00:00
|
|
|
|
|
2025-06-24 22:45:50 +00:00
|
|
|
|
1. **Modularity**: Each block type should be self-contained
|
|
|
|
|
2. **Extensibility**: Adding new block types should be straightforward
|
|
|
|
|
3. **Maintainability**: Code should be organized by responsibility
|
|
|
|
|
4. **Type Safety**: Strong interfaces to ensure consistent implementation
|
|
|
|
|
5. **Performance**: Enable potential lazy loading of block types
|
2025-06-22 20:32:59 +00:00
|
|
|
|
|
2025-06-24 22:45:50 +00:00
|
|
|
|
## Proposed File Structure
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
ts_web/elements/wysiwyg/
|
|
|
|
|
|