@atlaskit/editor-plugin-list
Version:
List plugin for @atlaskit/editor-core
7 lines • 311 B
JavaScript
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
export const isFirstChildOfParent = state => {
const {
$from
} = state.selection;
return $from.depth > 1 ? state.selection instanceof GapCursorSelection && $from.parentOffset === 0 || $from.index($from.depth - 1) === 0 : true;
};