jodit
Version:
Jodit is an awesome and useful wysiwyg editor with filebrowser
72 lines (71 loc) • 1.97 kB
TypeScript
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
*/
import { Plugin } from "../../core/plugin/index";
import "./config";
/**
* Process drag and drop image or another element inside the editor
*/
export declare class dragAndDropElement extends Plugin {
private dragList;
private draggable;
private isCopyMode;
/**
* Shift in pixels after which we consider that the transfer of the element has begun
*/
private diffStep;
private startX;
private startY;
private state;
/** @override */
protected afterInit(): void;
/**
* Start dragging a specific element programmatically.
*
* Allows a separate UI element (for example a drag handle/anchor shown next
* to a block) to initiate the drag without the user pressing directly on the
* draggable element itself.
*
* @example
* ```js
* handle.addEventListener('mousedown', e => {
* editor.e.fire('startDragElement', preBlock, e);
* });
* ```
*/
private onStartDragElement;
/**
* Drag start handler
*/
private onDragStart;
/**
* Prepare the ghost element and switch to the waiting state.
* Shared by the native mousedown handler and the programmatic
* `startDragElement` event handler.
*/
private startDragging;
/**
* Mouse move handler handler
*/
private onDrag;
/**
* Mouseup handler in any place
*/
private onDragEnd;
/**
* Mouseup handler inside editor
*/
private onDrop;
/**
* Add global event listener after drag start
*/
private addDragListeners;
/**
* Remove global event listener after drag start
*/
private removeDragListeners;
/** @override */
protected beforeDestruct(): void;
}