Skip to content

Commit

Permalink
prep build 11/26
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Nov 26, 2024
2 parents c7c667d + d2c2ed8 commit 2d5fe29
Show file tree
Hide file tree
Showing 201 changed files with 1,912 additions and 1,307 deletions.
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7848.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7848

* https://github.com/WordPress/gutenberg/pull/67154
1 change: 1 addition & 0 deletions docs/contributors/versions-in-wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ If anything looks incorrect here, please bring it up in #core-editor in [WordPre

| Gutenberg Versions | WordPress Version |
| ------------------ | ----------------- |
| 18.6-19.3 | 6.7.1 |
| 18.6-19.3 | 6.7 |
| 17.8-18.5 | 6.6.2 |
| 17.8-18.5 | 6.6.1 |
Expand Down
11 changes: 6 additions & 5 deletions docs/reference-guides/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,8 @@ Action that autosaves the current post. This includes server-side autosaving (de
_Parameters_
- _options_ `Object?`: Extra flags to identify the autosave.
- _options_ `[Object]`: Extra flags to identify the autosave.
- _options.local_ `[boolean]`: Whether to perform a local autosave.
### clearSelectedBlock
Expand Down Expand Up @@ -1204,7 +1205,7 @@ const getFeaturedMediaUrl = useSelect( ( select ) => {
_Parameters_
- _edits_ `Object`: Post attributes to edit.
- _options_ `Object`: Options for the edit.
- _options_ `[Object]`: Options for the edit.
_Returns_
Expand Down Expand Up @@ -1417,7 +1418,7 @@ Returns an action object used to signal that the blocks have been updated.
_Parameters_
- _blocks_ `Array`: Block Array.
- _options_ `?Object`: Optional options.
- _options_ `[Object]`: Optional options.
### resetPost
Expand All @@ -1431,7 +1432,7 @@ Action for saving the current post in the editor.
_Parameters_
- _options_ `Object`:
- _options_ `[Object]`:
### selectBlock
Expand Down Expand Up @@ -1519,7 +1520,7 @@ _Parameters_
- _post_ `Object`: Post object.
- _edits_ `Object`: Initial edited attributes object.
- _template_ `Array?`: Block Template.
- _template_ `[Array]`: Block Template.
### setupEditorState
Expand Down
2 changes: 2 additions & 0 deletions lib/compat/wordpress-6.8/preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ function gutenberg_block_editor_preload_paths_6_8( $paths, $context ) {
'site_logo',
'timezone_string',
'url',
'default_template_part_areas',
'default_template_types',
)
);
$paths[] = '/wp/v2/templates/lookup?slug=front-page';
Expand Down
67 changes: 67 additions & 0 deletions lib/compat/wordpress-6.8/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,70 @@ function gutenberg_add_post_type_rendering_mode() {
}
}
add_action( 'rest_api_init', 'gutenberg_add_post_type_rendering_mode' );

// When querying terms for a given taxonomy in the REST API, respect the default
// query arguments set for that taxonomy upon registration.
function gutenberg_respect_taxonomy_default_args_in_rest_api( $args ) {
// If a `post` argument is provided, the Terms controller will use
// `wp_get_object_terms`, which respects the default query arguments,
// so we don't need to do anything.
if ( ! empty( $args['post'] ) ) {
return $args;
}

$t = get_taxonomy( $args['taxonomy'] );
if ( isset( $t->args ) && is_array( $t->args ) ) {
$args = array_merge( $args, $t->args );
}
return $args;
}
add_action(
'registered_taxonomy',
function ( $taxonomy ) {
add_filter( "rest_{$taxonomy}_query", 'gutenberg_respect_taxonomy_default_args_in_rest_api' );
}
);
add_action(
'unregistered_taxonomy',
function ( $taxonomy ) {
remove_filter( "rest_{$taxonomy}_query", 'gutenberg_respect_taxonomy_default_args_in_rest_api' );
}
);

/**
* Adds the default template part areas to the REST API index.
*
* This function exposes the default template part areas through the WordPress REST API.
* Note: This function backports into the wp-includes/rest-api/class-wp-rest-server.php file.
*
* @param WP_REST_Response $response REST API response.
* @return WP_REST_Response Modified REST API response with default template part areas.
*/
function gutenberg_add_default_template_part_areas_to_index( WP_REST_Response $response ) {
$response->data['default_template_part_areas'] = get_allowed_block_template_part_areas();
return $response;
}

add_filter( 'rest_index', 'gutenberg_add_default_template_part_areas_to_index' );

/**
* Adds the default template types to the REST API index.
*
* This function exposes the default template types through the WordPress REST API.
* Note: This function backports into the wp-includes/rest-api/class-wp-rest-server.php file.
*
* @param WP_REST_Response $response REST API response.
* @return WP_REST_Response Modified REST API response with default template part areas.
*/
function gutenberg_add_default_template_types_to_index( WP_REST_Response $response ) {
$indexed_template_types = array();
foreach ( get_default_block_template_types() as $slug => $template_type ) {
$template_type['slug'] = (string) $slug;
$indexed_template_types[] = $template_type;
}

$response->data['default_template_types'] = $indexed_template_types;
return $response;
}

add_filter( 'rest_index', 'gutenberg_add_default_template_types_to_index' );
4 changes: 2 additions & 2 deletions packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ $z-layers: (
".components-resizable-box__corner-handle": 2,

// Make sure block manager sticky category titles appear above the options
".editor-block-manager__category-title": 1,
".block-editor-block-manager__category-title": 1,
// And block manager sticky disabled block count is higher still
".editor-block-manager__disabled-blocks-count": 2,
".block-editor-block-manager__disabled-blocks-count": 2,

// Needs to appear below other color circular picker related UI elements.
".components-circular-option-picker__option-wrapper::before": -1,
Expand Down
8 changes: 5 additions & 3 deletions packages/block-editor/src/components/block-controls/slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ export default function BlockControlsSlot( { group = 'default', ...props } ) {
[ toolbarState, contextState ]
);

const Slot = groups[ group ]?.Slot;
const fills = useSlotFills( Slot?.__unstableName );
if ( ! Slot ) {
const slotFill = groups[ group ];
const fills = useSlotFills( slotFill.name );

if ( ! slotFill ) {
warning( `Unknown BlockControls group "${ group }" provided.` );
return null;
}
Expand All @@ -42,6 +43,7 @@ export default function BlockControlsSlot( { group = 'default', ...props } ) {
return null;
}

const { Slot } = slotFill;
const slot = <Slot { ...props } bubblesVirtually fillProps={ fillProps } />;

if ( group === 'default' ) {
Expand Down
27 changes: 0 additions & 27 deletions packages/block-editor/src/components/block-info-slot-fill/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-c
import AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';
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 { useBorderPanelLabel } from '../../hooks/border';

Expand Down Expand Up @@ -253,7 +252,6 @@ const BlockInspectorSingleBlock = ( {
className={ blockInformation.isSynced && 'is-synced' }
/>
<BlockVariationTransforms blockClientId={ clientId } />
<BlockInfo.Slot />
{ showTabs && (
<InspectorControlsTabs
hasBlockStyles={ hasBlockStyles }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function BlockManagerCategory( {
)
);

const titleId = 'editor-block-manager__category-title-' + instanceId;
const titleId = 'block-editor-block-manager__category-title-' + instanceId;

const isAllChecked = checkedBlockNames.length === blockTypes.length;
const isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;
Expand All @@ -80,13 +80,13 @@ function BlockManagerCategory( {
<div
role="group"
aria-labelledby={ titleId }
className="editor-block-manager__category"
className="block-editor-block-manager__category"
>
<CheckboxControl
__nextHasNoMarginBottom
checked={ isAllChecked }
onChange={ toggleAllVisible }
className="editor-block-manager__category-title"
className="block-editor-block-manager__category-title"
indeterminate={ isIndeterminate }
label={ <span id={ titleId }>{ title }</span> }
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
/**
* WordPress dependencies
*/
import { BlockIcon } from '@wordpress/block-editor';
import { CheckboxControl } from '@wordpress/components';

/**
* Internal dependencies
*/
import BlockIcon from '../block-icon';

function BlockTypesChecklist( { blockTypes, value, onItemChange } ) {
return (
<ul className="editor-block-manager__checklist">
<ul className="block-editor-block-manager__checklist">
{ blockTypes.map( ( blockType ) => (
<li
key={ blockType.name }
className="editor-block-manager__checklist-item"
className="block-editor-block-manager__checklist-item"
>
<CheckboxControl
__nextHasNoMarginBottom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export default function BlockManager( {
}, [ filteredBlockTypes?.length, search, debouncedSpeak ] );

return (
<div className="editor-block-manager__content">
<div className="block-editor-block-manager__content">
{ !! numberOfHiddenBlocks && (
<div className="editor-block-manager__disabled-blocks-count">
<div className="block-editor-block-manager__disabled-blocks-count">
{ sprintf(
/* translators: %d: number of blocks. */
_n(
Expand All @@ -88,16 +88,16 @@ export default function BlockManager( {
placeholder={ __( 'Search for a block' ) }
value={ search }
onChange={ ( nextSearch ) => setSearch( nextSearch ) }
className="editor-block-manager__search"
className="block-editor-block-manager__search"
/>
<div
tabIndex="0"
role="region"
aria-label={ __( 'Available block types' ) }
className="editor-block-manager__results"
className="block-editor-block-manager__results"
>
{ filteredBlockTypes.length === 0 && (
<p className="editor-block-manager__no-results">
<p className="block-editor-block-manager__no-results">
{ __( 'No blocks found.' ) }
</p>
) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.editor-block-manager__no-results {
.block-editor-block-manager__no-results {
font-style: italic;
padding: $grid-unit-30 0;
text-align: center;
}

.editor-block-manager__search {
.block-editor-block-manager__search {
margin: $grid-unit-20 0;
}

.editor-block-manager__disabled-blocks-count {
.block-editor-block-manager__disabled-blocks-count {
border: $border-width solid $gray-300;
border-width: $border-width 0;
// Cover up horizontal areas off the sides of the box rectangle
Expand All @@ -19,43 +19,43 @@
position: sticky;
// When sticking, tuck the top border beneath the modal header border
top: ($grid-unit-05 + 1) * -1;
z-index: z-index(".editor-block-manager__disabled-blocks-count");
z-index: z-index(".block-editor-block-manager__disabled-blocks-count");

// Stick the category titles to the bottom
~ .editor-block-manager__results .editor-block-manager__category-title {
~ .block-editor-block-manager__results .block-editor-block-manager__category-title {
top: $grid-unit-40 - 1;
}
.is-link {
margin-left: 12px;
}
}

.editor-block-manager__category {
.block-editor-block-manager__category {
margin: 0 0 $grid-unit-30 0;
}

.editor-block-manager__category-title {
.block-editor-block-manager__category-title {
position: sticky;
top: - $grid-unit-05; // Offsets the top padding on the modal content container
padding: $grid-unit-20 0;
background-color: $white;
z-index: z-index(".editor-block-manager__category-title");
z-index: z-index(".block-editor-block-manager__category-title");

.components-checkbox-control__label {
font-weight: 600;
}
}

.editor-block-manager__checklist {
.block-editor-block-manager__checklist {
margin-top: 0;
}

.editor-block-manager__category-title,
.editor-block-manager__checklist-item {
.block-editor-block-manager__category-title,
.block-editor-block-manager__checklist-item {
border-bottom: 1px solid $gray-300;
}

.editor-block-manager__checklist-item {
.block-editor-block-manager__checklist-item {
display: flex;
justify-content: space-between;
align-items: center;
Expand All @@ -72,11 +72,11 @@
}
}

.editor-block-manager__results {
.block-editor-block-manager__results {
border-top: $border-width solid $gray-300;
}

// Remove the top border from results when adjacent to the disabled block count
.editor-block-manager__disabled-blocks-count + .editor-block-manager__results {
.block-editor-block-manager__disabled-blocks-count + .block-editor-block-manager__results {
border-top-width: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { pipe, useCopyToClipboard } from '@wordpress/compose';
* Internal dependencies
*/
import BlockActions from '../block-actions';
import __unstableCommentIconFill from '../../components/collab/block-comment-icon-slot';
import CommentIconSlotFill from '../../components/collab/block-comment-icon-slot';
import BlockHTMLConvertButton from './block-html-convert-button';
import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
import BlockSettingsMenuControls from '../block-settings-menu-controls';
Expand Down Expand Up @@ -295,7 +295,7 @@ export function BlockSettingsDropdown( {
</MenuItem>
</>
) }
<__unstableCommentIconFill.Slot
<CommentIconSlotFill.Slot
fillProps={ { onClose } }
/>
</MenuGroup>
Expand Down
Loading

0 comments on commit 2d5fe29

Please sign in to comment.