UNPKG

@yoopta/editor

Version:

<h2 align="center">Yoopta-Editor v1 🎉</h2> <p align="center">Yoopta-Editor - is an open source notion-like editor 💥</p> <div align="center"> <img width="574" alt="Screen Shot 2023-01-25 at 16 04 29" src="https://user-images.githubusercontent.com/2909311

28 lines • 819 B
import type { YooEditor } from '../types'; import type { GetElementRectOptions } from './types'; /** * Get the DOMRect of a Slate element * * @param editor - YooEditor instance * @param options - Get options * @returns DOMRect of the element or null if not found * * @example * ```typescript * // Get rect of element for positioning UI * const rect = editor.getElementRect({ * blockId: 'image-1', * element: imageElement * }); * * if (rect) { * console.log('Element position:', rect.x, rect.y); * console.log('Element size:', rect.width, rect.height); * } * ``` */ export declare function getElementRect(editor: YooEditor, options: GetElementRectOptions): { domRect: DOMRect; clientRects: DOMRectList; } | null; //# sourceMappingURL=getElementRect.d.ts.map