UNPKG

@wordpress/block-editor

Version:
51 lines (44 loc) 1.5 kB
import { createElement, Fragment } from "@wordpress/element"; /** * External dependencies */ import { View } from 'react-native'; /** * WordPress dependencies */ import { Children } from '@wordpress/element'; import { BottomSheetConsumer } from '@wordpress/components'; import warning from '@wordpress/warning'; import deprecated from '@wordpress/deprecated'; /** * Internal dependencies */ import groups from './groups'; import useDisplayBlockControls from '../use-display-block-controls'; import { BlockSettingsButton } from '../block-settings'; export default function InspectorControlsFill({ children, group = 'default', __experimentalGroup, ...props }) { if (__experimentalGroup) { deprecated('`__experimentalGroup` property in `InspectorControlsFill`', { since: '6.2', version: '6.4', alternative: '`group`' }); group = __experimentalGroup; } const isDisplayed = useDisplayBlockControls(); const Fill = groups[group]?.Fill; if (!Fill) { typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warning(`Unknown InspectorControls group "${group}" provided.`) : void 0; return null; } if (!isDisplayed) { return null; } return createElement(Fragment, null, createElement(Fill, props, createElement(BottomSheetConsumer, null, () => createElement(View, null, children))), Children.count(children) > 0 && createElement(BlockSettingsButton, null)); } //# sourceMappingURL=fill.native.js.map