UNPKG

@atlaskit/editor-plugin-media

Version:

Media plugin for @atlaskit/editor-core

21 lines (20 loc) 1.5 kB
import type { MediaADFAttrs } from '@atlaskit/adf-schema'; import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model'; import type { EditorState } from '@atlaskit/editor-prosemirror/state'; import type { EditorView } from '@atlaskit/editor-prosemirror/view'; import type { MediaState, getPosHandler as ProsemirrorGetPosHandler } from '../types'; export declare const isMediaBlobUrlFromAttrs: (attrs: MediaADFAttrs) => boolean; export declare const posOfMediaGroupNearby: (state: EditorState) => number | undefined; export declare const isSelectionNonMediaBlockNode: (state: EditorState) => boolean; export declare const isSelectionMediaSingleNode: (state: EditorState) => boolean; export declare const posOfPrecedingMediaGroup: (state: EditorState) => number | undefined; /** * Determine whether the cursor is inside empty paragraph * or the selection is the entire paragraph */ export declare const isInsidePotentialEmptyParagraph: (state: EditorState) => boolean; export declare const posOfParentMediaGroup: (state: EditorState, $pos?: ResolvedPos, prepend?: boolean) => number | undefined; export declare const removeMediaNode: (view: EditorView, node: PMNode, getPos: ProsemirrorGetPosHandler) => void; export declare const splitMediaGroup: (view: EditorView) => boolean; export declare const copyOptionalAttrsFromMediaState: (mediaState: MediaState, node: PMNode) => void; export declare const getMediaNodeFromSelection: (state: EditorState) => PMNode | null;