@gechiui/block-editor
Version:
64 lines (53 loc) • 1.56 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _element = require("@gechiui/element");
var _lodash = require("lodash");
var _data = require("@gechiui/data");
var _menu = _interopRequireDefault(require("./menu"));
var _store = require("../../store");
/**
* External dependencies
*/
/**
* GeChiUI dependencies
*/
/**
* Internal dependencies
*/
function InserterLibrary(_ref) {
let {
rootClientId,
clientId,
isAppender,
showInserterHelpPanel,
showMostUsedBlocks = false,
__experimentalInsertionIndex,
__experimentalFilterValue,
onSelect = _lodash.noop,
shouldFocusBlock = false
} = _ref;
const destinationRootClientId = (0, _data.useSelect)(select => {
const {
getBlockRootClientId
} = select(_store.store);
return rootClientId || getBlockRootClientId(clientId) || undefined;
}, [clientId, rootClientId]);
return (0, _element.createElement)(_menu.default, {
onSelect: onSelect,
rootClientId: destinationRootClientId,
clientId: clientId,
isAppender: isAppender,
showInserterHelpPanel: showInserterHelpPanel,
showMostUsedBlocks: showMostUsedBlocks,
__experimentalInsertionIndex: __experimentalInsertionIndex,
__experimentalFilterValue: __experimentalFilterValue,
shouldFocusBlock: shouldFocusBlock
});
}
var _default = InserterLibrary;
exports.default = _default;
//# sourceMappingURL=library.js.map