From 7746f8c16eef447163fa0d1b7424a792a8016060 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Wed, 20 Apr 2022 13:59:05 +0200 Subject: [PATCH] Add constants file to Spacer block (#40446) --- packages/block-library/src/spacer/constants.js | 1 + packages/block-library/src/spacer/controls.js | 2 +- packages/block-library/src/spacer/controls.native.js | 2 +- packages/block-library/src/spacer/edit.js | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 packages/block-library/src/spacer/constants.js diff --git a/packages/block-library/src/spacer/constants.js b/packages/block-library/src/spacer/constants.js new file mode 100644 index 00000000000000..8067cf57957cbb --- /dev/null +++ b/packages/block-library/src/spacer/constants.js @@ -0,0 +1 @@ +export const MIN_SPACER_SIZE = 0; diff --git a/packages/block-library/src/spacer/controls.js b/packages/block-library/src/spacer/controls.js index 7f0d1e74320e33..4a2ce658e95557 100644 --- a/packages/block-library/src/spacer/controls.js +++ b/packages/block-library/src/spacer/controls.js @@ -15,7 +15,7 @@ import { useInstanceId } from '@wordpress/compose'; /** * Internal dependencies */ -import { MIN_SPACER_SIZE } from './edit'; +import { MIN_SPACER_SIZE } from './constants'; function DimensionInput( { label, onChange, isResizing, value = '' } ) { const inputId = useInstanceId( UnitControl, 'block-spacer-height-input' ); diff --git a/packages/block-library/src/spacer/controls.native.js b/packages/block-library/src/spacer/controls.native.js index 7c48be32a2d5c1..49cfd92a3029e1 100644 --- a/packages/block-library/src/spacer/controls.native.js +++ b/packages/block-library/src/spacer/controls.native.js @@ -14,7 +14,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { MIN_SPACER_SIZE } from './edit.js'; +import { MIN_SPACER_SIZE } from './constants'; import styles from './style.scss'; const DEFAULT_VALUES = { px: 100, em: 10, rem: 10, vw: 10, vh: 25 }; diff --git a/packages/block-library/src/spacer/edit.js b/packages/block-library/src/spacer/edit.js index 29f4f33c375e32..bdda226fdf9277 100644 --- a/packages/block-library/src/spacer/edit.js +++ b/packages/block-library/src/spacer/edit.js @@ -15,8 +15,7 @@ import { View } from '@wordpress/primitives'; * Internal dependencies */ import SpacerControls from './controls'; - -export const MIN_SPACER_SIZE = 0; +import { MIN_SPACER_SIZE } from './constants'; const ResizableSpacer = ( { orientation,