@atlaskit/editor-plugin-extension
Version:
editor-plugin-extension plugin for @atlaskit/editor-core
42 lines (41 loc) • 2.39 kB
TypeScript
import type { IntlShape } from 'react-intl';
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions/extension-provider';
import type { Command } from '@atlaskit/editor-common/types/command';
import type { FloatingToolbarHandler } from '@atlaskit/editor-common/types/floating-toolbar';
import type { PublicPluginAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics/analyticsPluginType';
import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity/connectivityPluginType';
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel/contextPanelPluginType';
import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button/copyButtonPluginType';
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations/decorationsPluginType';
import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions/mentions-plugin-type';
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
import type { ExtensionPluginOptions } from '../extensionPluginType';
/**
* Creates a function that copies the text content of the unsupported content extension to the clipboard
* if the current selected extension is an unsupported content extension.
*/
export declare const createOnClickCopyButton: ({ formatMessage, extensionApi, extensionProvider, getUnsupportedContent, state, locale, }: {
extensionApi: GetToolbarConfigProps['extensionApi'];
extensionProvider?: ExtensionProvider;
formatMessage: IntlShape['formatMessage'];
getUnsupportedContent?: ExtensionPluginOptions['getUnsupportedContent'];
locale: string;
state: EditorState;
}) => Command | undefined;
interface GetToolbarConfigProps {
breakoutEnabled: boolean | undefined;
copyEnabled?: boolean | undefined;
deleteEnabled?: boolean | undefined;
extensionApi?: PublicPluginAPI<[
ContextPanelPlugin,
AnalyticsPlugin,
DecorationsPlugin,
ConnectivityPlugin,
MentionsPlugin,
CopyButtonPlugin
]> | undefined;
getUnsupportedContent?: ExtensionPluginOptions['getUnsupportedContent'];
}
export declare const getToolbarConfig: ({ breakoutEnabled, copyEnabled, deleteEnabled, extensionApi, getUnsupportedContent, }: GetToolbarConfigProps) => FloatingToolbarHandler;
export {};