UNPKG

@atlaskit/editor-plugin-block-controls

Version:

Block controls plugin for @atlaskit/editor-core

20 lines (19 loc) • 1.9 kB
import type { IntlShape } from 'react-intl'; import type { PortalProviderAPI } from '@atlaskit/editor-common/common'; import { SafePlugin } from '@atlaskit/editor-common/safe-plugin'; import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin'; import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state'; import { PluginKey } from '@atlaskit/editor-prosemirror/state'; import { DecorationSet } from '@atlaskit/editor-prosemirror/view'; import type { BlockControlsMeta, BlockControlsPlugin, NodeDecorationFactory, PluginState } from '../blockControlsPluginType'; import { AnchorRectCache } from './utils/anchor-utils'; export declare const key: PluginKey<PluginState>; export interface FlagType { toolbarFlagsEnabled: boolean; } export declare const getDecorations: (state: EditorState) => DecorationSet | undefined; export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean, anchorRectCache?: AnchorRectCache, resizeObserverWidth?: ResizeObserver, pragmaticCleanup?: (() => void) | null, limitedModeTeardown?: { done: boolean; }) => PluginState; export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean) => SafePlugin<PluginState>; export declare const getBlockControlsMeta: (tr: Transaction | ReadonlyTransaction) => BlockControlsMeta | undefined;