UNPKG

@gechiui/block-editor

Version:
35 lines (31 loc) 1.02 kB
import { createElement } from "@gechiui/element"; /** * GeChiUI dependencies */ import { useContext } from '@gechiui/element'; import { Disabled } from '@gechiui/components'; import deprecated from '@gechiui/deprecated'; /** * Internal dependencies */ import InsertionPoint, { InsertionPointOpenRef } from './insertion-point'; import BlockPopover from './block-popover'; export default function BlockToolsBackCompat(_ref) { let { children } = _ref; const openRef = useContext(InsertionPointOpenRef); const isDisabled = useContext(Disabled.Context); // If context is set, `BlockTools` is a parent component. if (openRef || isDisabled) { return children; } deprecated('gc.components.Popover.Slot name="block-toolbar"', { alternative: 'gc.blockEditor.BlockTools' }); return createElement(InsertionPoint, { __unstablePopoverSlot: "block-toolbar" }, createElement(BlockPopover, { __unstablePopoverSlot: "block-toolbar" }), children); } //# sourceMappingURL=back-compat.js.map