Skip to content

Commit

Permalink
feat: compatibility with WP 6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dkjensen committed Aug 1, 2024
1 parent d2e0c55 commit 564d12e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
InspectorControls,
__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
useSetting,
useSettings,
store as blockEditorStore,
} from '@wordpress/block-editor';
import { useEffect, useRef, useState } from '@wordpress/element';
Expand Down Expand Up @@ -78,14 +78,9 @@ export function Edit( props ) {
setOpen( false );
};

const [ availableUnits ] = useSettings( 'spacing.units' );
const units = useCustomUnits( {
availableUnits: useSetting( 'spacing.units' ) || [
'%',
'px',
'em',
'rem',
'vw',
],
availableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ],
} );

const widthWithUnit = Number.isFinite( width ) ? width + '%' : width;
Expand Down
2 changes: 1 addition & 1 deletion src/sidebar/render.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { __ } from '@wordpress/i18n';
import { PluginSidebar } from '@wordpress/edit-post';
import { PluginSidebar } from '@wordpress/editor';
import { useSelect, useDispatch } from '@wordpress/data';
import { store as blockEditorStore } from '@wordpress/block-editor';
import {
Expand Down

0 comments on commit 564d12e

Please sign in to comment.