@atlaskit/editor-plugin-layout
Version:
Layout plugin for @atlaskit/editor-core
84 lines (83 loc) • 2.45 kB
TypeScript
import React from 'react';
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
import type { ExtractInjectionAPI, getPosHandlerNode } 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 { LayoutPlugin } from '../layoutPluginType';
import type { LayoutPluginOptions } from '../types';
type LayoutSectionViewProps = {
eventDispatcher: EventDispatcher;
getPos: getPosHandlerNode;
node: PMNode;
options: LayoutPluginOptions;
pluginInjectionApi?: ExtractInjectionAPI<LayoutPlugin>;
portalProviderAPI: PortalProviderAPI;
view: EditorView;
};
type ForwardRef = (ref: HTMLElement | null) => void;
/**
*
*/
export declare class LayoutSectionView extends ReactNodeView<LayoutSectionViewProps> {
options: LayoutPluginOptions;
layoutDOM?: HTMLElement;
isEmpty?: boolean;
/**
* constructor
* @param props
* @param props.node
* @param props.view
* @param props.getPos
* @param props.portalProviderAPI
* @param props.eventDispatcher
* @param props.pluginInjectionApi
* @param props.options
* @example
*/
constructor(props: {
eventDispatcher: EventDispatcher;
getPos: getPosHandlerNode;
node: PMNode;
options: LayoutPluginOptions;
pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>;
portalProviderAPI: PortalProviderAPI;
view: EditorView;
});
/**
* getContentDOM
* @example
* @returns
*/
getContentDOM(): {
contentDOM: HTMLElement | undefined;
dom: HTMLElement;
};
/**
* setDomAttrs
* @param node
* @param element
* @example
*/
setDomAttrs(node: PMNode, _element: HTMLElement): void;
/**
* render
* @param props
* @param forwardRef
* @example
* @returns
*/
render(props: LayoutSectionViewProps, forwardRef: ForwardRef): React.JSX.Element | null;
/**
* ignoreMutation
* @param mutation
* @example
* @returns
*/
ignoreMutation(mutation: MutationRecord | {
target: Node;
type: 'selection';
}): boolean;
}
export {};