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 • 1.99 kB
import type { NodeEntry } from 'slate'; import { Path } from 'slate'; import type { SlateEditor, SlateElement, YooEditor } from '../editor/types'; import type { Plugin, PluginElement, PluginElementProps, PluginElementsMap } from '../plugins/types'; export declare function getRootBlockElementType(elems: PluginElementsMap<string, unknown> | undefined): string | undefined; export declare function getRootBlockElement(elems: PluginElementsMap<string, unknown> | undefined): PluginElement<string, unknown> | undefined; export declare function isRootElementVoid(elems: PluginElementsMap<string, unknown> | undefined): boolean; export type GetBlockElementNodeOptions = { at?: Path; elementType?: string; }; export declare function getBlockElementNode(slate: SlateEditor, options?: GetBlockElementNodeOptions): NodeEntry<SlateElement> | undefined; export declare function buildSlateNodeElement(type: string, props?: PluginElementProps<unknown>): SlateElement<any>; type ElementsMapWithTextContent = Record<string, string>; export declare function buildBlockElementsStructure(editor: YooEditor, blockType: string, elementsMapWithTextContent?: ElementsMapWithTextContent): SlateElement; export declare function getPluginByInlineElement(plugins: YooEditor['plugins'], elementType: string): Plugin<Record<string, SlateElement>, unknown> | undefined; /** * Checks if the current selection is inside an element with injectElementsFromPlugins * Returns injectElementsFromPlugins array if found, null otherwise */ /** * Find injectElementsFromPlugins from current element OR nearest parent element with injectElementsFromPlugins * This is important for nested structures like Steps > blockquote, * where blockquote doesn't have injectElementsFromPlugins but its parent step-list-item-content does */ export declare function getAllowedPluginsFromElement(editor: YooEditor, slate: SlateEditor): string[] | null; export {}; //# sourceMappingURL=block-elements.d.ts.map