Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popover: stabilize __unstableShift prop to shift #43845

Merged
merged 7 commits into from
Sep 5, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor __unstableShift to shift prop across the repo
ciampo committed Sep 5, 2022
commit 5b9892adbaf1a4ecc9cac4282a9e762ce06f0d6c
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ function BlockPopover(
__unstableSlotName={ __unstablePopoverSlot || null }
resize={ false }
flip={ false }
__unstableShift
shift
{ ...props }
className={ classnames(
'block-editor-block-popover',
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-
// top of the viewport.
const DEFAULT_PROPS = {
flip: false,
__unstableShift: true,
shift: true,
};

// When there isn't enough height between the top of the block and the editor
@@ -26,7 +26,7 @@ const DEFAULT_PROPS = {
// otherwise the toolbar will be off-screen.
const RESTRICTED_HEIGHT_PROPS = {
flip: true,
__unstableShift: false,
shift: false,
};

/**
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ export default function ColorGradientSettingsDropdown( {
popoverProps = {
placement: 'left-start',
offset: 36,
__unstableShift: true,
shift: true,
};
}

Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ function URLPopover( {
className="block-editor-url-popover"
focusOnMount={ focusOnMount }
position={ position }
__unstableShift
shift
{ ...popoverProps }
>
<div className="block-editor-url-popover__input-container">
2 changes: 1 addition & 1 deletion packages/block-library/src/button/edit.js
Original file line number Diff line number Diff line change
@@ -221,7 +221,7 @@ function ButtonEdit( props ) {
anchorRef={ ref?.current }
focusOnMount={ isEditingURL ? 'firstElement' : false }
__unstableSlotName={ '__unstable-block-tools-after' }
__unstableShift
shift
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we intentionally keeping the legacy prop here:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, just a miss in my find-and-replace 🙈

Done in a8421c5

>
<LinkControl
className="wp-block-navigation-link__inline-link-input"
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-submenu/edit.js
Original file line number Diff line number Diff line change
@@ -630,7 +630,7 @@ export default function NavigationSubmenuEdit( {
position="bottom center"
onClose={ () => setIsLinkOpen( false ) }
anchorRef={ listItemRef.current }
__unstableShift
shift
>
<LinkControl
className="wp-block-navigation-link__inline-link-input"
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ const BorderBoxControlSplitControls = (
placement: popoverPlacement,
offset: popoverOffset,
anchorRef: containerRef,
__unstableShift: true,
shift: true,
}
: undefined;

Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ const BorderBoxControl = (
placement: popoverPlacement,
offset: popoverOffset,
anchorRef: containerRef,
__unstableShift: true,
shift: true,
}
: undefined;

2 changes: 1 addition & 1 deletion packages/components/src/color-palette/index.js
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ export function CustomColorPickerDropdown( {
} ) {
const popoverProps = useMemo(
() => ( {
__unstableShift: true,
shift: true,
...( isRenderedInSidebar
? {
// When in the sidebar: open to the left (stacking),
2 changes: 1 addition & 1 deletion packages/components/src/tooltip/index.js
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ const addPopoverToGrandchildren = ( {
animate={ false }
offset={ offset }
anchorRef={ anchorRef }
__unstableShift
shift
>
{ text }
<Shortcut
2 changes: 1 addition & 1 deletion packages/format-library/src/link/inline.js
Original file line number Diff line number Diff line change
@@ -227,7 +227,7 @@ function InlineLinkUI( {
focusOnMount={ focusOnMount.current }
onClose={ stopAddingLink }
position="bottom center"
__unstableShift
shift
>
<LinkControl
key={ forceRemountKey }
2 changes: 1 addition & 1 deletion packages/widgets/src/blocks/legacy-widget/edit/form.js
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ export default function Form( {
offset={ 32 }
resize={ false }
flip={ false }
__unstableShift
shift
>
<div
ref={ ref }