/*! * 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 */ /** * [[include:plugins/select/README.md]] * @packageDocumentation * @module plugins/select */ import type { IJodit } from "../../types/index"; import { Plugin } from "../../core/plugin/index"; import "./config"; /** * A utility plugin that allows you to subscribe to a click/mousedown/touchstart/mouseup on an element in DOM order * * @example * ```js * const editor = Jodit.make('#editor'); * editor.e.on('clickImg', (img) => { * console.log(img.src); * }) * ``` */ export declare class select extends Plugin { private proxyEventsList; protected afterInit(jodit: IJodit): void; protected beforeDestruct(jodit: IJodit): void; private __selectedMediaStyle; /** * The browsers shade an image in the selection, but Chrome doesn't shade * a video with controls, or one in a `jodit-media` wrapper, so a selection * that took one in didn't show it, and typing deleted it unseen (#1768). * The media gets the same shade from a filter, in place of the tint Safari * gives a block wrapper's whole line. It's a style in the editing * document, as selected cells get their border, so the content, and with * it the value, the history and a copy, doesn't change. Media a click * selected whole is left alone, as its resize frame shows it (#1528). A * change, read-only and the source mode redo or drop the style, as the * selection may not change with them, and the style's paths could then * fit other elements */ private __markSelectedMedia; private onStartSelection; /** * Where the last press started. Chrome reports a drag that begins in one * element and ends in another as a `click` on their common ancestor, so a * press inside a popup is remembered to tell such a drag from a real click. */ private __pressTarget; protected onOutsidePress(e: Event): void; /** * @event outsideClick(e) - when user clicked on the outside of editor */ protected onOutsideClick(e: MouseEvent): void; protected beforeCommandCut(): void | false; protected beforeCommandSelectAll(): false; /** * Fix caret position when clicking to the right of a list item that has a * nested list. Blink/WebKit place the caret at the start of the line instead * of the end (#1296); move it to the end of the item's own text. */ protected onClickRightOfNestedListItem(e: MouseEvent): void; /** * The row a press to its right was beside, and the caret it put there, * while the button is down */ private __pressBesideRow; /** * The table row the mouse is to the right of */ private __rowBeside; /** * A press to the right of a table row puts the caret where Word's typing * goes from there: the start of the next row's first cell, or of the block * after the table for the last row (#1770). The browsers put it after the * table, whichever row it's beside, so typing starts a new line below it. * Their own press is stopped, as its drag would start after the table and * take in the rows below first */ protected onMouseDownBesideTableRow(e: MouseEvent): void; /** * A drag from beside a row selects from the end of the row to the mouse, * and back beside the row it's the caret again */ private __onDragFromRow; /** * In iframe mode, a press in an editor without the focus puts the caret at * its end, so a release that selected nothing puts it back */ private __onReleaseFromRow; private __endPressBesideRow; /** * A double click beside a row is two clicks there, so add-new-line, * which adds a line on a double click with a caret, doesn't see it */ private __onDblClickBesideRow; private __putCaretBesideRow; /** * Keep pending inline formatting after a click. Toggling Bold/Italic/etc. on * a collapsed cursor leaves empty marker elements with the caret inside; a * click puts the caret right before them (outside), so they get cleaned up * and the formatting is lost. Move the caret back into the innermost marker * so the next typed character keeps every pending format (#1291). */ protected onClickKeepPendingFormat(): void; /** * Normalize selection after triple click */ protected onTripleClickNormalizeSelection(e: MouseEvent): void; /** * A double click past the end of a line selects only its line break, up * to the start of the next line a caret can go on. The browsers show no * caret for it, and typing replaces the break, joining the lines and * taking any video in between with it (#1768). Put the caret at the end * of the line instead */ protected onDblClickPastLineEnd(): void; /** * The browsers have no caret position beside an uneditable block alone * on its line, such as a video, so a drag that ends on its line runs on * past it, and typing deletes it (#1768). Until the pointer has passed * the block, the selection stops at the last caret place in the block * before its line, or for a drag upwards at the first in the block after */ protected onMouseUpOnUneditableLine(e: MouseEvent): void; protected onCopyNormalizeSelectionBound(e?: ClipboardEvent): void; }