@atlaskit/editor-plugin-context-panel
Version:
Context panel plugin for @atlaskit/editor-core
29 lines (28 loc) • 1.1 kB
TypeScript
import type { FC } from 'react';
import type { MessageDescriptor } from 'react-intl-next';
export type ObjectSidebarBehavior = 'push' | 'cover';
export type ObjectSidebarPanelCloseOptions = {
canClosePanel?: () => Promise<boolean>;
onPanelClose?: () => void;
};
type PanelElement = FC | (() => React.ReactElement<any, any> | null);
export type ObjectSidebarPanel = {
BodyComponent: PanelElement;
closeOptions?: ObjectSidebarPanelCloseOptions;
FooterComponent?: PanelElement;
headerComponentElements: {
HeaderAfterIconElement?: PanelElement;
HeaderBeforeIconElement?: PanelElement;
HeaderIcon?: PanelElement;
headerLabel?: MessageDescriptor;
HeaderRightAlignedElement?: PanelElement;
headerStyles?: {
setGrayBackground?: boolean;
};
};
id: string;
};
export type ShowObjectSidebar = (panel: ObjectSidebarPanel, behavior?: ObjectSidebarBehavior, panelWidth?: number) => void;
export type HideObjectSidebar = () => void;
export type HideObjectSidebarById = (id: ObjectSidebarPanel['id']) => void;
export {};