fix(wysiwyg):Improve Wysiwyg editor

This commit is contained in:
2025-06-24 13:41:12 +00:00
parent 08a4c361fa
commit 4b2178cedd
13 changed files with 581 additions and 349 deletions

View File

@@ -1,14 +1,15 @@
import { type IBlock } from './wysiwyg.types.js';
import { type IWysiwygComponent } from './wysiwyg.interfaces.js';
import { WysiwygShortcuts } from './wysiwyg.shortcuts.js';
import { WysiwygBlocks } from './wysiwyg.blocks.js';
import { WysiwygBlockOperations } from './wysiwyg.blockoperations.js';
import { WysiwygModalManager } from './wysiwyg.modalmanager.js';
export class WysiwygInputHandler {
private component: any;
private component: IWysiwygComponent;
private saveTimeout: any = null;
constructor(component: any) {
constructor(component: IWysiwygComponent) {
this.component = component;
}
@@ -174,6 +175,11 @@ export class WysiwygInputHandler {
if (this.component.editorContentRef) {
this.component.updateBlockElement(block.id);
}
// Focus the code block
setTimeout(async () => {
await blockOps.focusBlock(block.id, 'start');
}, 50);
}
} else {
block.type = detectedType.type;
@@ -186,6 +192,11 @@ export class WysiwygInputHandler {
if (this.component.editorContentRef) {
this.component.updateBlockElement(block.id);
}
// Focus the transformed block
setTimeout(async () => {
await blockOps.focusBlock(block.id, 'start');
}, 50);
}
}