UNPKG

@atlaskit/editor-plugin-toolbar

Version:

Toolbar plugin for @atlaskit/editor-core

26 lines (25 loc) • 1.35 kB
import React from 'react'; import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin'; import type { Selection } from '@atlaskit/editor-prosemirror/state'; import type { EditorView } from '@atlaskit/editor-prosemirror/view'; import type { ToolbarPlugin } from '../toolbarPluginType'; /** * The selection toolbar owns non-empty text and all selections, and plain cell selections. A cell * selection made by clicking a drag handle has its own user intent, so the element toolbar stays. */ export declare const getActiveFloatingToolbar: (selection: Selection, userIntent?: string) => 'selection' | 'element'; type FloatingToolbarProps = { api?: ExtractInjectionAPI<ToolbarPlugin>; boundariesElement?: HTMLElement; disableSelectionToolbar?: boolean; disableSelectionToolbarWhenPinned: boolean; editorView: EditorView; mountPoint?: HTMLElement; onToolbarMouseUp?: (event: React.MouseEvent<HTMLDivElement>) => void; scrollableElement?: HTMLElement; }; /** * Renders either the selection toolbar or the element toolbar, never both. */ export declare const FloatingToolbar: ({ api, boundariesElement, disableSelectionToolbar, disableSelectionToolbarWhenPinned, editorView, mountPoint, onToolbarMouseUp, scrollableElement, }: FloatingToolbarProps) => React.JSX.Element | null; export {};