/*! * Jodit Editor PRO (https://xdsoft.net/jodit/) * See LICENSE.md in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/ */ import type { IJodit } from "jodit/esm/types/index"; import { UIElement } from "jodit/esm/core/ui/index"; /** * Contextual UI for an existing code block: * - a drag anchor shown in the left gutter on hover (moves the whole block); * - a popup toolbar (language dropdown + edit / copy / delete) on click. * * The anchor is rendered `position: fixed` and appended to the document body so * it can sit outside the code block without being clipped by the editor * workplace (which hides horizontal overflow). */ export declare class UICodeTuner extends UIElement { private toolbar; private popup; private isShown; private __hideTimer; protected currentBlock: HTMLElement; className(): string; protected render(): string; /** * Handler: hovering a code block shows the drag anchor next to it. */ protected onEditorMouseMove(e: MouseEvent): void; /** * Handler: clicking a code block opens its popup toolbar; clicking anywhere * else in the editor closes the tuner. */ protected onEditorClick(e: MouseEvent): void; /** * Shows the anchor for the given code block. */ show(block: HTMLElement): void; /** * Soft hide — keeps the UI while the popup toolbar is open. */ hide(): void; /** * Handler: a click outside the editor closes the tuner — unless it landed on * the anchor/grip itself (which lives in the document body, so Jodit reports * it as an "outside" click). */ protected onOutsideClick(e: MouseEvent): void; /** * Hard hide — closes the popup and removes the anchor. */ forceHide(): void; /** * Global pointer tracking: keep the tuner shown while the pointer is within * the block + left gutter + grip region (one continuous hot zone, so there * is no seam between the block and the anchor), and hide it shortly after * the pointer leaves that region. */ private __onPointerMove; private __inActiveZone; private __scheduleHide; private __cancelHide; /** * Recalculates the anchor and popup position. Bound to everything that can * move the code block: editor/page scroll, resize and content changes. */ private __onReposition; protected onEditorChange(): void; /** * Places the anchor in the gutter to the left of the code block. */ private calcPosition; /** * Builds and shows the popup toolbar below the code block. */ private openToolbar; /** * The language dropdown control. Its list is built from * `pasteCode.languages` so it always reflects the editor configuration. */ private __languageControl; /** * Handler: start dragging the whole block by its anchor. The actual drag is * performed by the base `drag-and-drop-element` plugin. */ protected onAnchorMouseDown(e: MouseEvent): void; destruct(): void; }