UNPKG

@atlaskit/editor-plugin-caption

Version:

Caption plugin for @atlaskit/editor-core

32 lines (31 loc) 2.03 kB
import React from 'react'; import { type IntlShape } from 'react-intl'; import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher'; import type { PortalProviderAPI } from '@atlaskit/editor-common/portal'; import type { ForwardRef, ReactComponentProps, shouldUpdate } from '@atlaskit/editor-common/react-node-view'; import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view'; import type { ExtractInjectionAPI, getPosHandler } from '@atlaskit/editor-common/types'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import type { EditorView } from '@atlaskit/editor-prosemirror/view'; import type { CaptionPlugin } from '../captionPluginType'; export declare class CaptionNodeView extends SelectionBasedNodeView { private selected; private cleanupEditorDisabledListener?; pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>; private intl?; constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps: ReactComponentProps, reactComponent?: React.ComponentType<React.PropsWithChildren<unknown>>, viewShouldUpdate?: shouldUpdate, pluginInjectionApi?: ExtractInjectionAPI<CaptionPlugin>, intl?: IntlShape); createDomRef(): HTMLElement; getContentDOM(): { dom: HTMLDivElement; }; ignoreMutation(mutation: MutationRecord | { target: Node; type: 'selection'; }): boolean; handleEditorDisabledChanged(): void; render(_props: never, forwardRef: ForwardRef): React.JSX.Element; viewShouldUpdate(nextNode: PMNode): boolean; destroy(): void; } /** Creates a caption node view for use with ProseMirror. */ export default function captionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<CaptionPlugin> | undefined, intl?: IntlShape): (node: PMNode, view: EditorView, getPos: getPosHandler) => CaptionNodeView;