UNPKG

@wordpress/block-editor

Version:
35 lines (32 loc) 897 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = useListViewClientIds; var _data = require("@wordpress/data"); var _store = require("../../store"); var _lockUnlock = require("../../lock-unlock"); /** * WordPress dependencies */ /** * Internal dependencies */ function useListViewClientIds({ blocks, rootClientId }) { return (0, _data.useSelect)(select => { const { getDraggedBlockClientIds, getSelectedBlockClientIds, getEnabledClientIdsTree } = (0, _lockUnlock.unlock)(select(_store.store)); return { selectedClientIds: getSelectedBlockClientIds(), draggedClientIds: getDraggedBlockClientIds(), clientIdsTree: blocks !== null && blocks !== void 0 ? blocks : getEnabledClientIdsTree(rootClientId) }; }, [blocks, rootClientId]); } //# sourceMappingURL=use-list-view-client-ids.js.map