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

Cherry pick commits for WP 6.5 Beta 3 #59394

Merged
merged 48 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
475fad1
Search block: use font size for search icon (#59159)
ramonjd Feb 22, 2024
266b4d2
Add missing empty space to print out valid HTML. (#59255)
juanfra Feb 22, 2024
12436cb
Featured Image & Post Title: Hide non content controls when block edi…
noisysocks Feb 23, 2024
83ef19f
Style Book: should persist when browsing global styles panels (#59261)
ramonjd Feb 23, 2024
52c4570
Shadows: Improve accessibility of shadows dropdown (#58828)
madhusudhand Feb 23, 2024
0086001
Fix query loop with block bindings not working in the editor as expec…
SantosGuillamot Feb 23, 2024
d59ab95
Update pages dataview icons, add 'drafts' icon (#59285)
jameskoster Feb 23, 2024
57030d3
Display all checkboxes when a single item is selected (#59233)
jameskoster Feb 23, 2024
5d4028f
Revert removal of Nav fallback auto embed (#59220)
getdave Feb 23, 2024
d56a480
update schema to accommodate the changes made in wp_register_font_col…
matiasbenedetto Feb 23, 2024
eadfe88
Update filter control position (#59231)
jameskoster Feb 23, 2024
900a55b
Fix: Multi line comment format on footnotes format. (#59312)
jorgefilipecosta Feb 23, 2024
56c8292
Disable selection checkbox if no bulk actions are eligible (#58950)
jorgefilipecosta Feb 23, 2024
6198eb0
Shadow: Fix layout collapse when indicator is selected (#59309)
t-hamano Feb 24, 2024
5191efd
Cover block: Clear aspect ratio value when toggling full height (#59296)
andrewserong Feb 25, 2024
a446441
Disable core shadow presets by default, let themes opt-in (#58766)
madhusudhand Feb 26, 2024
a3ab0c7
Block Hooks: Take controlled blocks into account for toggle state (#5…
ockham Feb 26, 2024
698ec96
Block Hooks: Add help text to Plugins panel. (#59371)
ockham Feb 26, 2024
3c1c03a
Update sidebar titles for Template and Page management data views (#5…
jameskoster Feb 26, 2024
8646cd1
Updates isEditingTemplate to check for `wp_template` post type instea…
mattgrshaw Feb 26, 2024
b9020fa
Fix `DisableNonPageContentBlocks` (#59297)
noisysocks Feb 27, 2024
d9a49b4
Cover Block: Restore overflow: clip rule to allow border radius again…
andrewserong Feb 27, 2024
65a8496
set border panel label based on the controls available (#59358)
madhusudhand Feb 27, 2024
709a7ae
Reposition pattern detail icon (#59363)
jameskoster Feb 27, 2024
6a04d6f
Font Library: add option to revoke access to Google Fonts (#59205)
carolinan Feb 23, 2024
915c75e
Use NavigatorProvider in Font Library Modal (#59036)
pbking Feb 23, 2024
ba6f31c
Editor: Limit spotlight mode to the editor. (#58817)
juanfra Feb 14, 2024
6dca770
DataViews: Fix pages list back path (#59201)
ntsekouras Feb 20, 2024
6912e21
Interactivity API: Only add proxies to plain objects inside the store…
cbravobernal Feb 20, 2024
1fa7012
Cover block: clear the min height field when aspect ratio is set (#59…
andrewserong Feb 21, 2024
c515c6c
Block Mover: Unify visual separator when show button label is on (#59…
t-hamano Feb 21, 2024
36237f0
Fix resetting individual blocks to empty values for Pattern Overrides…
kevin940726 Feb 21, 2024
c87e94c
Patterns: disable image caption if part of synced pattern (#58916)
glendaviesnz Feb 21, 2024
71746c4
Remove unneeded pattern overrides translation strings (#59269)
kevin940726 Feb 22, 2024
667797e
Fix Navigation link control overlapping issue (#59065)
akasunil Feb 22, 2024
6a8bf9d
Preserve bindings metadata in block transforms (#59179)
SantosGuillamot Feb 22, 2024
8374560
Interactivity API: Improve context merges using proxies (#59187)
DAreRodz Feb 22, 2024
ed1e641
Top Toolbar: Fix 'collapsed' state synchronization (#59267)
Mamaduka Feb 22, 2024
a51059c
Interactivity API: Prevent unwanted subscriptions to inherited contex…
DAreRodz Feb 22, 2024
eddf324
URLPopover: restore min-width style (#59274)
t-hamano Feb 22, 2024
3bf1514
Apply hover styles to filter chip while being configured (#59236)
jameskoster Feb 22, 2024
afff734
Update page selector (#59284)
jameskoster Feb 22, 2024
ae25e5a
Block bindings: fix Enter on disabled rich text (#59320)
ellatrix Feb 24, 2024
78a4740
Fixed the font family modal to open in state when a font is already …
pbking Feb 27, 2024
914e64e
Font collection pagination: add min height to avoid infinite number (…
matiasbenedetto Feb 22, 2024
3d08702
Interactivity API: Fix `navigate()` issues related to initial state m…
DAreRodz Feb 26, 2024
fb06a14
Fix failing Dropdown Menu e2e tests (#59356)
Mamaduka Feb 26, 2024
41d6af5
Remove the tests that no longer test the code in Gutenberg but the co…
matiasbenedetto Feb 27, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Settings related to shadows.

| Property | Type | Default | Props |
| --- | --- | --- |--- |
| defaultPresets | boolean | true | |
| defaultPresets | boolean | false | |
| presets | array | | name, shadow, slug |

---
Expand Down
1 change: 1 addition & 0 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ public static function get_element_class_name( $element ) {
array( 'spacing', 'margin' ),
array( 'spacing', 'padding' ),
array( 'typography', 'lineHeight' ),
array( 'shadow', 'defaultPresets' ),
);

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"text": true
},
"shadow": {
"defaultPresets": true,
"defaultPresets": false,
"presets": [
{
"name": "Natural",
Expand Down
10 changes: 10 additions & 0 deletions packages/base-styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,16 @@
}
}
}

&[aria-disabled="true"],
&:disabled {
background: $gray-100;
border-color: $gray-300;
cursor: default;

// Override style inherited from wp-admin. Required to avoid degraded appearance on different backgrounds.
opacity: 1;
}
}

@mixin radio-control {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createContext, useContext } from '@wordpress/element';
export const mayDisplayControlsKey = Symbol( 'mayDisplayControls' );
export const mayDisplayParentControlsKey = Symbol( 'mayDisplayParentControls' );
export const blockEditingModeKey = Symbol( 'blockEditingMode' );
export const blockBindingsKey = Symbol( 'blockBindings' );

export const DEFAULT_BLOCK_EDIT_CONTEXT = {
name: '',
Expand Down
6 changes: 5 additions & 1 deletion packages/block-editor/src/components/block-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
mayDisplayControlsKey,
mayDisplayParentControlsKey,
blockEditingModeKey,
blockBindingsKey,
} from './context';

/**
Expand Down Expand Up @@ -41,7 +42,8 @@ export default function BlockEdit( {
attributes = {},
__unstableLayoutClassNames,
} = props;
const { layout = null } = attributes;
const { layout = null, metadata = {} } = attributes;
const { bindings } = metadata;
const layoutSupport =
hasBlockSupport( name, 'layout', false ) ||
hasBlockSupport( name, '__experimentalLayout', false );
Expand All @@ -62,6 +64,7 @@ export default function BlockEdit( {
[ mayDisplayControlsKey ]: mayDisplayControls,
[ mayDisplayParentControlsKey ]: mayDisplayParentControls,
[ blockEditingModeKey ]: blockEditingMode,
[ blockBindingsKey ]: bindings,
} ),
[
name,
Expand All @@ -73,6 +76,7 @@ export default function BlockEdit( {
mayDisplayControls,
mayDisplayParentControls,
blockEditingMode,
bindings,
]
) }
>
Expand Down
12 changes: 7 additions & 5 deletions packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import PositionControls from '../inspector-controls-tabs/position-controls-panel
import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
import BlockInfo from '../block-info-slot-fill';
import BlockQuickNavigation from '../block-quick-navigation';
import { getBorderPanelLabel } from '../../hooks/border';
import { useBorderPanelLabel } from '../../hooks/border';

function BlockInspectorLockedBlocks( { topLevelLockedBlock } ) {
const contentClientIds = useSelect(
Expand Down Expand Up @@ -116,6 +116,10 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
selectedBlockClientId
);

const borderPanelLabel = useBorderPanelLabel( {
blockName: selectedBlockName,
} );

if ( count > 1 ) {
return (
<div className="block-editor-block-inspector">
Expand All @@ -140,9 +144,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
/>
<InspectorControls.Slot
group="border"
label={ getBorderPanelLabel( {
blockName: selectedBlockName,
} ) }
label={ borderPanelLabel }
/>
<InspectorControls.Slot group="styles" />
</>
Expand Down Expand Up @@ -251,7 +253,7 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
[ blockName ]
);
const blockInformation = useBlockDisplayInformation( clientId );
const borderPanelLabel = getBorderPanelLabel( { blockName } );
const borderPanelLabel = useBorderPanelLabel( { blockName } );

return (
<div className="block-editor-block-inspector">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export function BlockPreview( {
[]
);
const settings = useMemo(
() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),
() => ( {
...originalSettings,
focusMode: false, // Disable "Spotlight mode".
__unstableIsPreviewMode: true,
} ),
[ originalSettings ]
);
const renderedBlocks = useMemo(
Expand Down Expand Up @@ -117,6 +121,7 @@ export function useBlockPreview( { blocks, props = {}, layout } ) {
() => ( {
...originalSettings,
styles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.
focusMode: false, // Disable "Spotlight mode".
__unstableIsPreviewMode: true,
} ),
[ originalSettings ]
Expand Down
17 changes: 11 additions & 6 deletions packages/block-editor/src/components/block-toolbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,18 @@
}
}

.block-editor-block-mover .block-editor-block-mover__move-button-container {
width: auto;

@include break-small() {
.block-editor-block-mover {
.block-editor-block-mover__move-button-container {
width: auto;
position: relative;
}

&::before {
&:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
@include break-small() {
content: "";
height: $border-width;
width: 100%;
background: $gray-900;
background: $gray-200;
position: absolute;
top: 50%;
left: 50%;
Expand All @@ -226,6 +227,10 @@
transform: translate(-50%, 0);
margin-top: -$border-width * 0.5;
}

@include break-medium {
background: $gray-900;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ import { useColorsPerOrigin } from './hooks';
import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
import { overrideOrigins } from '../../store/get-block-settings';
import { setImmutably } from '../../utils/object';
import { getBorderPanelLabel } from '../../hooks/border';
import { ShadowPopover } from './shadow-panel-components';
import { useBorderPanelLabel } from '../../hooks/border';
import { ShadowPopover, useShadowPresets } from './shadow-panel-components';

function useHasShadowControl( settings ) {
return !! settings?.shadow;
export function useHasBorderPanel( settings ) {
const controls = Object.values( useHasBorderPanelControls( settings ) );
return controls.some( Boolean );
}

export function useHasBorderPanel( settings ) {
const controls = [
useHasBorderColorControl( settings ),
useHasBorderRadiusControl( settings ),
useHasBorderStyleControl( settings ),
useHasBorderWidthControl( settings ),
useHasShadowControl( settings ),
];
export function useHasBorderPanelControls( settings ) {
const controls = {
hasBorderColor: useHasBorderColorControl( settings ),
hasBorderRadius: useHasBorderRadiusControl( settings ),
hasBorderStyle: useHasBorderStyleControl( settings ),
hasBorderWidth: useHasBorderWidthControl( settings ),
hasShadow: useHasShadowControl( settings ),
};

return controls.some( Boolean );
return controls;
}

function useHasBorderColorControl( settings ) {
Expand All @@ -56,6 +57,11 @@ function useHasBorderWidthControl( settings ) {
return settings?.border?.width;
}

function useHasShadowControl( settings ) {
const shadows = useShadowPresets( settings );
return !! settings?.shadow && shadows.length > 0;
}

function BorderToolsPanel( {
resetAllFilter,
onChange,
Expand Down Expand Up @@ -215,14 +221,16 @@ export default function BorderPanel( {
const showBorderByDefault =
defaultControls?.color || defaultControls?.width;

const label = getBorderPanelLabel( {
const hasBorderControl =
showBorderColor ||
showBorderStyle ||
showBorderWidth ||
showBorderRadius;

const label = useBorderPanelLabel( {
blockName: name,
hasShadowControl,
hasBorderControl:
showBorderColor ||
showBorderStyle ||
showBorderWidth ||
showBorderRadius,
hasBorderControl,
} );

return (
Expand Down Expand Up @@ -280,9 +288,12 @@ export default function BorderPanel( {
isShownByDefault={ defaultControls.shadow }
panelId={ panelId }
>
<BaseControl.VisualLabel as="legend">
{ __( 'Shadow' ) }
</BaseControl.VisualLabel>
{ hasBorderControl ? (
<BaseControl.VisualLabel as="legend">
{ __( 'Shadow' ) }
</BaseControl.VisualLabel>
) : null }

<ItemGroup isBordered isSeparated>
<ShadowPopover
shadow={ shadow }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export {
default as DimensionsPanel,
useHasDimensionsPanel,
} from './dimensions-panel';
export { default as BorderPanel, useHasBorderPanel } from './border-panel';
export {
default as BorderPanel,
useHasBorderPanel,
useHasBorderPanelControls,
} from './border-panel';
export { default as ColorPanel, useHasColorPanel } from './color-panel';
export { default as FiltersPanel, useHasFiltersPanel } from './filters-panel';
export {
Expand Down
Loading
Loading