Lexical: Revamped image node resize method

Changed from using a decorator to using a helper that watches for image
selections to then display a resize helper.
Also changes resizer to use a ghost and apply changes on end instead of
continuosly during resize.
This commit is contained in:
Dan Brown
2024-09-07 18:39:58 +01:00
parent 1c9afcb84e
commit e5b6d28bca
10 changed files with 251 additions and 192 deletions

View File

@@ -13,6 +13,7 @@ import {registerTaskListHandler} from "./ui/framework/helpers/task-list-handler"
import {registerTableSelectionHandler} from "./ui/framework/helpers/table-selection-handler";
import {el} from "./utils/dom";
import {registerShortcuts} from "./services/shortcuts";
import {registerImageResizer} from "./ui/framework/helpers/image-resizer";
export function createPageEditorInstance(container: HTMLElement, htmlContent: string, options: Record<string, any> = {}): SimpleWysiwygEditorInterface {
const config: CreateEditorArgs = {
@@ -55,6 +56,7 @@ export function createPageEditorInstance(container: HTMLElement, htmlContent: st
registerTableSelectionHandler(editor),
registerTaskListHandler(editor, editArea),
registerDropPasteHandling(context),
registerImageResizer(context),
);
listenToCommonEvents(editor);