/** * [[include:plugins/resizer/README.md]] * @packageDocumentation * @module plugins/resizer */ import './resizer.less'; import type { HTMLTagNames, IBound, IJodit, Nullable } from 'jodit/types'; import * as consts from 'jodit/core/constants'; import { IS_IE, KEY_ALT } from 'jodit/core/constants'; import { Dom } from 'jodit/core/dom/dom'; import { $$, attr, css, dataBind, innerWidth, markOwner, offset } from 'jodit/core/helpers'; import { Plugin } from 'jodit/core/plugin/plugin'; import { eventEmitter, pluginSystem } from 'jodit/core/global'; import { autobind, debounce, watch } from 'jodit/core/decorators'; import './config'; const keyBInd = '__jodit-resizer_binded'; /** * The module creates a supporting frame for resizing of the elements img and table */ export class resizer extends Plugin { private LOCK_KEY = 'resizer'; private handle!: HTMLElement; private element: null | HTMLElement = null; private isResizeMode: boolean = false; private isShown: boolean = false; private startX: number = 0; private startY: number = 0; private width: number = 0; private height: number = 0; private ratio: number = 0; private rect = this.j.c.fromHTML( `