Skip to content

Commit

Permalink
Swap v1 with v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Jul 4, 2024
1 parent 6dfaf0d commit 99a9b37
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
13 changes: 3 additions & 10 deletions packages/block-editor/src/hooks/position.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,22 @@ import { cleanEmptyObject, useStyleOverride } from './utils';
import { unlock } from '../lock-unlock';
import { store as blockEditorStore } from '../store';

const { CustomSelectControl } = unlock( componentsPrivateApis );
const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
componentsPrivateApis
);

const POSITION_SUPPORT_KEY = 'position';

const OPTION_CLASSNAME =
'block-editor-hooks__position-selection__select-control__option';

const DEFAULT_OPTION = {
key: 'default',
value: '',
name: __( 'Default' ),
className: OPTION_CLASSNAME,
};

const STICKY_OPTION = {
key: 'sticky',
value: 'sticky',
name: _x( 'Sticky', 'Name for the value of the CSS position property' ),
className: OPTION_CLASSNAME,
__experimentalHint: __(
'The block will stick to the top of the window instead of scrolling.'
),
Expand All @@ -54,7 +51,6 @@ const FIXED_OPTION = {
key: 'fixed',
value: 'fixed',
name: _x( 'Fixed', 'Name for the value of the CSS position property' ),
className: OPTION_CLASSNAME,
__experimentalHint: __(
'The block will not move when the page is scrolled.'
),
Expand Down Expand Up @@ -283,13 +279,11 @@ export function PositionPanelPure( {
options.length > 1 ? (
<InspectorControls group="position">
<BaseControl
className="block-editor-hooks__position-selection"
__nextHasNoMarginBottom
help={ stickyHelpText }
>
<CustomSelectControl
__next40pxDefaultSize
className="block-editor-hooks__position-selection__select-control"
label={ __( 'Position' ) }
hideLabelFromVision
describedBy={ sprintf(
Expand All @@ -299,7 +293,6 @@ export function PositionPanelPure( {
) }
options={ options }
value={ selectedOption }
__experimentalShowSelectedHint
onChange={ ( { selectedItem } ) => {
onChangeType( selectedItem.value );
} }
Expand Down
18 changes: 0 additions & 18 deletions packages/block-editor/src/hooks/position.scss

This file was deleted.

1 change: 0 additions & 1 deletion packages/block-editor/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
@import "./hooks/color.scss";
@import "./hooks/dimensions.scss";
@import "./hooks/layout.scss";
@import "./hooks/position.scss";
@import "./hooks/spacing.scss";
@import "./hooks/typography.scss";

Expand Down

0 comments on commit 99a9b37

Please sign in to comment.