import { createElement } from '@wordpress/element' import { expandOptionsFor } from './BuilderRoot' import { __ } from 'ct-i18n' import cls from 'classnames' import DraggableItems from './DraggableItems' const PrimaryPlacement = ({ placementName, bar, direction }) => { const placement = bar.placements.find(({ id }) => id === placementName) let placementsToRender = [placement] if (placementName !== 'middle') { const middle = bar.placements.find(({ id }) => id === 'middle') if (middle && middle.items.length > 0) { if (placementName === 'start') { const startMiddle = bar.placements.find( ({ id }) => id === 'start-middle' ) placementsToRender = [placement, startMiddle] } if (placementName === 'end') { const endMiddle = bar.placements.find(({ id }) => id === 'end-middle') placementsToRender = [endMiddle, placement] } } } return (
  • {placementsToRender.map(placement => ( -1 ? 'secondary' : 'primary' }-column` } draggableId={`${bar.id}:${placement.id}`} items={placement.items} /> ))}
  • ) } const Bar = ({ bar, direction = 'horizontal' }) => { return (
  • { { 'top-bar': __('Top Row', 'blocksy'), 'middle-bar': __('Middle Row', 'blocksy'), 'bottom-bar': __('Bottom Row', 'blocksy'), 'offcanvas-bar': __('Offcanvas', 'blocksy') }[bar.id] }
  • ) } const PlacementsBuilder = ({ view, builderValue }) => (
    {view === 'mobile' && ( )}
    ) export default PlacementsBuilder