@gechiui/block-editor
Version:
42 lines (39 loc) • 1.02 kB
JavaScript
import { createElement } from "@gechiui/element";
/**
* External dependencies
*/
import { last } from 'lodash';
/**
* GeChiUI dependencies
*/
import { compose } from '@gechiui/compose';
import { withSelect } from '@gechiui/data';
/**
* Internal dependencies
*/
import BaseDefaultBlockAppender from '../default-block-appender';
import withClientId from './with-client-id';
import { store as blockEditorStore } from '../../store';
export const DefaultBlockAppender = _ref => {
let {
clientId,
lastBlockClientId
} = _ref;
return createElement(BaseDefaultBlockAppender, {
rootClientId: clientId,
lastBlockClientId: lastBlockClientId
});
};
export default compose([withClientId, withSelect((select, _ref2) => {
let {
clientId
} = _ref2;
const {
getBlockOrder
} = select(blockEditorStore);
const blockClientIds = getBlockOrder(clientId);
return {
lastBlockClientId: last(blockClientIds)
};
})])(DefaultBlockAppender);
//# sourceMappingURL=default-block-appender.js.map