@atlaskit/editor-plugin-floating-toolbar
Version:
Floating toolbar plugin for @atlaskit/editor-core
45 lines (44 loc) • 1.82 kB
TypeScript
/**
* @jsxRuntime classic
* @jsx jsx
*/
import React from 'react';
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
import type { Item } from '@atlaskit/editor-common/floating-toolbar';
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
import type { Node } from '@atlaskit/editor-prosemirror/model';
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
import type { FloatingToolbarPlugin } from '../floatingToolbarPluginType';
export interface Props {
api: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
className?: string;
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
dispatchCommand: (command?: Function) => void;
editorView?: EditorView;
extensionsProvider?: Promise<ExtensionProvider>;
focusEditor?: () => void;
groupLabel?: string;
items: Array<Item>;
mediaAssistiveMessage?: string;
node: Node;
popupsBoundariesElement?: HTMLElement;
popupsMountPoint?: HTMLElement;
popupsScrollableElement?: HTMLElement;
providerFactory?: ProviderFactory;
scrollable?: boolean;
shouldFitContainer?: boolean;
target?: HTMLElement;
}
type GroupedItems = (Item | Item[])[];
export declare function groupItems(items: Item[], areAnyNewToolbarFlagsEnabled: boolean): GroupedItems;
export interface State {
mounted: boolean;
scrollDisabled: boolean;
}
declare const _default_1: React.FC<WithIntlProps<Props & WrappedComponentProps>> & {
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
};
export default _default_1;