@atlaskit/editor-plugin-panel
Version:
Panel plugin for @atlaskit/editor-core.
42 lines (41 loc) • 2.03 kB
TypeScript
import React from 'react';
import type { PanelAttributes } from '@atlaskit/adf-schema';
import { PanelType } from '@atlaskit/adf-schema';
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
import type { PanelPlugin, PanelPluginOptions } from '../panelPluginType';
export declare const panelIcons: {
[key in PanelType]: React.ComponentType<{
label: string;
}>;
};
interface PanelIconAttributes {
allowCustomPanel?: boolean;
panelAttributes: PanelAttributes;
pluginInjectionApi: ExtractInjectionAPI<PanelPlugin> | undefined;
providerFactory?: ProviderFactory;
}
export declare const PanelIcon: (props: PanelIconAttributes) => React.JSX.Element | null;
declare class PanelNodeView {
node: PMNode;
dom: HTMLElement;
contentDOM: HTMLElement;
icon: HTMLElement;
getPos: getPosHandlerNode;
view: EditorView;
providerFactory?: ProviderFactory;
nodeViewPortalProviderAPI: PortalProviderAPI;
pluginOptions: PanelPluginOptions;
key: string;
constructor(node: PMNode, view: EditorView, getPos: getPosHandlerNode, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, providerFactory?: ProviderFactory);
ignoreMutation(mutation: MutationRecord | {
target: Node;
type: 'selection';
}): boolean;
destroy(): void;
}
export declare const getPanelNodeView: (pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, providerFactory?: ProviderFactory) => (node: PMNode, view: EditorView, getPos: getPosHandler) => PanelNodeView;
export {};