slate-edit-table
Version:
A Slate plugin to handle keyboard events in tables.
21 lines (16 loc) • 435 B
Flow
// @flow
import { type Value } from 'slate';
import type Options from '../options';
import TablePosition from './TablePosition';
/**
* The position of the selection start block, in the current table
*/
function getPosition(
opts: Options,
// The current value
value: Value,
key: ?string = value.startKey
): TablePosition {
return TablePosition.create(opts, value.document, key);
}
export default getPosition;