diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index df1061e142fa5..3bad4041da73a 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -239,10 +239,8 @@ _Parameters_ - _$0_ `Object`: Props. - _$0.children_ `Object`: The block content and style container. - _$0.\_\_unstableContentRef_ `Object`: Ref holding the content scroll container. -- _$0.\_\_experimentalStickyBottom_ `number`: Bottom sticky position of floating toolbar. -- _$0.\_\_experimentalStickyTop_ `number`: Top sticky position of floating and top toolbar. -- _$0.\_\_experimentalStickyAreaBottom_ `number`: Offset of bottom side of sticky area. -- _$0.\_\_experimentalStickyAreaTop_ `number`: Offset of top side of sticky area. +- _$0.\_\_experimentalStickyTop_ `number`: Top sticky position offset of floating and top toolbar. +- _$0.\_\_experimentalStickier_ `boolean`: Favor sticky position even if the block is out of view. # **BlockVerticalAlignmentControl** diff --git a/packages/block-editor/src/components/block-tools/block-popover.js b/packages/block-editor/src/components/block-tools/block-popover.js index 5425151c66b0f..44ba6059bf721 100644 --- a/packages/block-editor/src/components/block-tools/block-popover.js +++ b/packages/block-editor/src/components/block-tools/block-popover.js @@ -54,10 +54,8 @@ function BlockPopover( { capturingClientId, __unstablePopoverSlot, __unstableContentRef, - __experimentalStickyBottom, __experimentalStickyTop, - __experimentalStickyAreaBottom, - __experimentalStickyAreaTop, + __experimentalStickier, } ) { const { isNavigationMode, @@ -197,10 +195,8 @@ function BlockPopover( { // Observe movement for block animations (especially horizontal). __unstableObserveElement={ node } shouldAnchorIncludePadding - __experimentalStickyBottom={ __experimentalStickyBottom } __experimentalStickyTop={ __experimentalStickyTop } - __experimentalStickyAreaBottom={ __experimentalStickyAreaBottom } - __experimentalStickyAreaTop={ __experimentalStickyAreaTop } + __experimentalStickier={ __experimentalStickier } > { ( shouldShowContextualToolbar || isToolbarForced ) && (
); } diff --git a/packages/block-editor/src/components/block-tools/index.js b/packages/block-editor/src/components/block-tools/index.js index 2a4c1cac33c25..1bc56f65e701b 100644 --- a/packages/block-editor/src/components/block-tools/index.js +++ b/packages/block-editor/src/components/block-tools/index.js @@ -19,21 +19,19 @@ import { usePopoverScroll } from './use-popover-scroll'; * insertion point and a slot for the inline rich text toolbar). Must be wrapped * around the block content and editor styles wrapper or iframe. * - * @param {Object} $0 Props. - * @param {Object} $0.children The block content and style container. - * @param {Object} $0.__unstableContentRef Ref holding the content scroll container. - * @param {number} $0.__experimentalStickyBottom Bottom sticky position of floating toolbar. - * @param {number} $0.__experimentalStickyTop Top sticky position of floating and top toolbar. - * @param {number} $0.__experimentalStickyAreaBottom Offset of bottom side of sticky area. - * @param {number} $0.__experimentalStickyAreaTop Offset of top side of sticky area. + * @param {Object} $0 Props. + * @param {Object} $0.children The block content and style container. + * @param {Object} $0.__unstableContentRef Ref holding the content scroll container. + * @param {number} $0.__experimentalStickyTop Top sticky position offset of floating and + * top toolbar. + * @param {boolean} $0.__experimentalStickier Favor sticky position even if the block is + out of view. */ export default function BlockTools( { children, __unstableContentRef, - __experimentalStickyBottom, __experimentalStickyTop, - __experimentalStickyAreaBottom: stickyAreaBottom, - __experimentalStickyAreaTop: stickyAreaTop, + __experimentalStickier, } ) { const isLargeViewport = useViewportMatch( 'medium' ); const hasFixedToolbar = useSelect( @@ -53,10 +51,8 @@ export default function BlockTools( { needed for navigation mode. */ }