UNPKG

@atlaskit/editor-plugin-table

Version:

Table plugin for the @atlaskit/editor

22 lines (21 loc) 1.03 kB
/** * A plugin for handle table custom widths * Has login to scan the document, add width value to table's width attribute when necessary * Also holds resizing state to hide / show table controls */ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics'; import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher'; import { SafePlugin } from '@atlaskit/editor-common/safe-plugin'; import { PluginKey } from '@atlaskit/editor-prosemirror/state'; type TableWidthPluginState = { resizing: boolean; tableLocalId: string; tableRef: HTMLTableElement | null; }; export declare const pluginKey: PluginKey<TableWidthPluginState>; declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean, maxWidthEnabled: boolean, isTableScalingEnabled: boolean, isTableAlignmentEnabled: boolean, isCommentEditor: boolean) => SafePlugin<{ resizing: boolean; tableLocalId: string; tableRef: null; }>; export { createPlugin };