UNPKG

@atlaskit/editor-plugin-table

Version:

Table plugin for the @atlaskit/editor

19 lines 711 B
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck import { pluginFactory } from '@atlaskit/editor-common/utils'; import { pluginKey } from './plugin-key'; import reducer from './reducer'; function mapping(tr, pluginState) { if (pluginState && pluginState.resizeHandlePos !== null) { return { ...pluginState, resizeHandlePos: tr.mapping.map(pluginState.resizeHandlePos) }; } return pluginState; } const factory = pluginFactory(pluginKey, reducer, { mapping }); export const createCommand = factory.createCommand; export const createPluginState = factory.createPluginState; export const getPluginState = factory.getPluginState;