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

@@ -11,6 +11,11 @@ export interface IWysiwygComponent {
blocks: IBlock[];
selectedBlockId: string | null;
shadowRoot: ShadowRoot | null;
editorContentRef: HTMLDivElement;
draggedBlockId: string | null;
dragOverBlockId: string | null;
dragOverPosition: 'before' | 'after' | null;
isComposing: boolean;
// Menus
slashMenu: DeesSlashMenu;
@@ -18,12 +23,16 @@ export interface IWysiwygComponent {
// Methods
updateValue(): void;
requestUpdate(): Promise<void>;
requestUpdate(): void;
updateComplete: Promise<boolean>;
insertBlock(type: string): Promise<void>;
closeSlashMenu(clearSlash?: boolean): void;
applyFormat(command: string): Promise<void>;
handleSlashMenuKeyboard(e: KeyboardEvent): void;
createBlockElement(block: IBlock): HTMLElement;
updateBlockElement(blockId: string): void;
handleDrop(e: DragEvent, targetBlock: IBlock): void;
renderBlocksProgrammatically(): void;
// Handlers
blockOperations: IBlockOperations;
@@ -44,7 +53,6 @@ export interface IBlockOperations {
moveBlock(blockId: string, targetIndex: number): void;
getPreviousBlock(blockId: string): IBlock | null;
getNextBlock(blockId: string): IBlock | null;
splitBlock(blockId: string, splitPosition: number): Promise<IBlock>;
}
/**