@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
43 lines (42 loc) • 1.75 kB
TypeScript
import { jsx } from '@emotion/react';
import type { IntlShape } from 'react-intl';
import type { Node } from '@atlaskit/editor-prosemirror/model';
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
import type { ButtonItemProps } from '@atlaskit/menu';
import type { ExtensionAPI, ExtensionProvider } from '../extensions';
import type { DropdownOptionT, FloatingToolbarOverflowDropdownOptions } from '../types';
export declare const menuItemDimensions: {
width: number;
height: number;
};
export interface Props {
dispatchCommand: Function;
editorView?: EditorView;
extensions?: ExtensionProps;
hide: Function;
items: Array<DropdownOptionT<Function>> | FloatingToolbarOverflowDropdownOptions<Function>;
showSelected?: boolean;
}
export type ExtensionProps = {
extensionApi?: ExtensionAPI;
extensionsProvider?: Promise<ExtensionProvider>;
node: Node;
};
export interface DropdownButtonItemProps extends ButtonItemProps {
onBlur?: (event: React.MouseEvent | React.KeyboardEvent) => void;
onFocus?: (event: React.MouseEvent | React.KeyboardEvent) => void;
onMouseEnter?: (event: React.MouseEvent | React.KeyboardEvent) => void;
onMouseLeave?: (event: React.MouseEvent | React.KeyboardEvent) => void;
onMouseOut?: (event: React.MouseEvent | React.KeyboardEvent) => void;
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
}
export type DropdownMenuItemProps = {
dispatchCommand: Function;
editorView?: EditorView;
hide: Function;
intl: IntlShape;
item: DropdownOptionT<Function>;
itemSelected?: boolean;
showSelected: boolean;
};
export declare const DropdownMenuItem: (props: DropdownMenuItemProps) => jsx.JSX.Element;