Skip to content

Commit

Permalink
prep build 07/27
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Jul 27, 2024
2 parents a3607b9 + 159d01a commit de3bfd2
Show file tree
Hide file tree
Showing 56 changed files with 1,269 additions and 652 deletions.
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.7/block-bindings.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Temporary compatibility code for new functionalitites/changes related to block bindings APIs present in Gutenberg.
* Temporary compatibility code for new functionalities/changes related to block bindings APIs present in Gutenberg.
*
* @package gutenberg
*/
Expand Down
9 changes: 6 additions & 3 deletions lib/experimental/script-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ function gutenberg_register_view_module_ids_rest_field() {
* Registers the module if no module with that module identifier has already
* been registered.
*
* @deprecated 17.6.0 gutenberg_register_module is deprecated. Please use wp_register_script_module instead.
*
* @param string $module_identifier The identifier of the module. Should be unique. It will be used in the final import map.
* @param string $src Full URL of the module, or path of the script relative to the WordPress root directory.
* @param array $dependencies Optional. An array of module identifiers of the dependencies of this module. The dependencies can be strings or arrays. If they are arrays, they need an `id` key with the module identifier, and can contain an `import` key with either `static` or `dynamic`. By default, dependencies that don't contain an import are considered static.
* @param string|false|null $version Optional. String specifying module version number. Defaults to false. It is added to the URL as a query string for cache busting purposes. If $version is set to false, the version number is the currently installed WordPress version. If $version is set to null, no version is added.
* @deprecated 17.6.0 gutenberg_register_module is deprecated. Please use wp_register_script_module instead.
*/
function gutenberg_register_module( $module_identifier, $src = '', $dependencies = array(), $version = false ) {
_deprecated_function( __FUNCTION__, 'Gutenberg 17.6.0', 'wp_register_script_module' );
Expand All @@ -179,8 +180,9 @@ function gutenberg_register_module( $module_identifier, $src = '', $dependencies
/**
* Marks the module to be enqueued in the page.
*
* @param string $module_identifier The identifier of the module.
* @deprecated 17.6.0 gutenberg_enqueue_module is deprecated. Please use wp_enqueue_script_module instead.
*
* @param string $module_identifier The identifier of the module.
*/
function gutenberg_enqueue_module( $module_identifier ) {
_deprecated_function( __FUNCTION__, 'Gutenberg 17.6.0', 'wp_enqueue_script_module' );
Expand All @@ -190,8 +192,9 @@ function gutenberg_enqueue_module( $module_identifier ) {
/**
* Unmarks the module so it is not longer enqueued in the page.
*
* @param string $module_identifier The identifier of the module.
* @deprecated 17.6.0 gutenberg_dequeue_module is deprecated. Please use wp_dequeue_script_module instead.
*
* @param string $module_identifier The identifier of the module.
*/
function gutenberg_dequeue_module( $module_identifier ) {
_deprecated_function( __FUNCTION__, 'Gutenberg 17.6.0', 'wp_dequeue_script_module' );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { useSelect, useDispatch } from '@wordpress/data';
import { useEffect, useState } from '@wordpress/element';

/**
Expand All @@ -16,32 +16,29 @@ function ZoomOutModeInserters() {
const [ isReady, setIsReady ] = useState( false );
const {
hasSelection,
blockInsertionPoint,
blockOrder,
insertionPoint,
blockInsertionPointVisible,
setInserterIsOpened,
sectionRootClientId,
selectedBlockClientId,
hoveredBlockClientId,
} = useSelect( ( select ) => {
const {
getSettings,
getBlockInsertionPoint,
getBlockOrder,
getSelectionStart,
getSelectedBlockClientId,
getHoveredBlockClientId,
isBlockInsertionPointVisible,
} = select( blockEditorStore );
const { sectionRootClientId: root } = unlock( getSettings() );
// To do: move ZoomOutModeInserters to core/editor.
// Or we perhaps we should move the insertion point state to the
// block-editor store. I'm not sure what it was ever moved to the editor
// store, because all the inserter components all live in the
// block-editor package.
// eslint-disable-next-line @wordpress/data-no-store-string-literals
const editor = select( 'core/editor' );
return {
hasSelection: !! getSelectionStart().clientId,
blockInsertionPoint: getBlockInsertionPoint(),
blockOrder: getBlockOrder( root ),
insertionPoint: unlock( editor ).getInsertionPoint(),
blockInsertionPointVisible: isBlockInsertionPointVisible(),
sectionRootClientId: root,
setInserterIsOpened:
getSettings().__experimentalSetIsInserterOpened,
Expand All @@ -50,6 +47,8 @@ function ZoomOutModeInserters() {
};
}, [] );

const { showInsertionPoint } = useDispatch( blockEditorStore );

// Defer the initial rendering to avoid the jumps due to the animation.
useEffect( () => {
const timeout = setTimeout( () => {
Expand All @@ -65,14 +64,8 @@ function ZoomOutModeInserters() {
}

return [ undefined, ...blockOrder ].map( ( clientId, index ) => {
const shouldRenderInserter = insertionPoint.insertionIndex !== index;

const shouldRenderInsertionPoint =
insertionPoint.insertionIndex === index;

if ( ! shouldRenderInserter && ! shouldRenderInsertionPoint ) {
return null;
}
blockInsertionPointVisible && blockInsertionPoint.index === index;

const previousClientId = clientId;
const nextClientId = blockOrder[ index ];
Expand Down Expand Up @@ -104,7 +97,7 @@ function ZoomOutModeInserters() {
className="block-editor-block-list__insertion-point-indicator"
/>
) }
{ shouldRenderInserter && (
{ ! shouldRenderInsertionPoint && (
<ZoomOutModeInserterButton
isVisible={ isSelected || isHovered }
onClick={ () => {
Expand All @@ -114,6 +107,9 @@ function ZoomOutModeInserters() {
tab: 'patterns',
category: 'all',
} );
showInsertionPoint( sectionRootClientId, index, {
operation: 'insert',
} );
} }
/>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ function FlexControls( {
} );
} }
value={ flexSize }
label={ flexResetLabel }
hideLabelFromVision
/>
) }
</VStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function GridItemResizerInner( {
<BlockPopoverCover
className="block-editor-grid-item-resizer"
clientId={ clientId }
__unstablePopoverSlot="block-toolbar"
__unstablePopoverSlot="__unstable-block-tools-after"
additionalStyles={ styles }
>
<ResizableBox
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Tips from './tips';
import InserterPreviewPanel from './preview-panel';
import BlockTypesTab from './block-types-tab';
import BlockPatternsTab from './block-patterns-tab';
import { PatternCategoryPreviewPanel } from './block-patterns-tab/pattern-category-preview-panel';
import { PatternCategoryPreviews } from './block-patterns-tab/pattern-category-previews';
import { MediaTab, MediaCategoryPanel } from './media-tab';
import InserterSearchResults from './search-results';
import useInsertionPoint from './hooks/use-insertion-point';
Expand Down Expand Up @@ -246,7 +246,7 @@ function InserterMenu(
selectedCategory={ selectedPatternCategory }
>
{ showPatternPanel && (
<PatternCategoryPreviewPanel
<PatternCategoryPreviews
rootClientId={ destinationRootClientId }
onInsert={ onInsertPattern }
onHover={ onHoverPattern }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ export default function SpacingInputControl( {
onChange={ handleCustomValueSliderChange }
className="spacing-sizes-control__custom-value-range"
__nextHasNoMarginBottom
label={ ariaLabel }
hideLabelFromVision
/>
</>
) }
Expand Down
3 changes: 2 additions & 1 deletion packages/block-editor/src/components/use-settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ export function useSettings( ...paths ) {
* It looks up the setting first in the block instance hierarchy.
* If none is found, it'll look it up in the block editor settings.
*
* @deprecated 6.5.0 Use useSettings instead.
*
* @param {string} path The path to the setting.
* @return {any} Returns the value defined for the setting.
* @deprecated 6.5.0 Use useSettings instead.
* @example
* ```js
* const isEnabled = useSetting( 'typography.dropCap' );
Expand Down
12 changes: 12 additions & 0 deletions packages/block-library/src/categories/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@
},
"interactivity": {
"clientNavigation": true
},
"__experimentalBorder": {
"radius": true,
"color": true,
"width": true,
"style": true,
"__experimentalDefaultControls": {
"radius": true,
"color": true,
"width": true,
"style": true
}
}
},
"editorStyle": "wp-block-categories-editor",
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/column/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@
},
"__experimentalBorder": {
"color": true,
"radius": true,
"style": true,
"width": true,
"__experimentalDefaultControls": {
"color": true,
"radius": true,
"style": true,
"width": true
}
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
@import "./social-links/editor.scss";
@import "./spacer/editor.scss";
@import "./table/editor.scss";
@import "./tag-cloud/editor.scss";
@import "./template-part/editor.scss";
@import "./text-columns/editor.scss";
@import "./video/editor.scss";
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/image/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const { state, actions, callbacks } = store(
},
callbacks: {
setOverlayStyles() {
if ( ! state.currentImage.imageRef ) {
if ( ! state.overlayEnabled ) {
return;
}

Expand Down
41 changes: 28 additions & 13 deletions packages/block-library/src/query/edit/inspector-controls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
TextControl,
SelectControl,
RangeControl,
ToggleControl,
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
Notice,
Expand Down Expand Up @@ -103,9 +102,9 @@ export default function QueryInspectorControls( props ) {
const showInheritControl = isControlAllowed( allowedControls, 'inherit' );
const showPostTypeControl =
! inherit && isControlAllowed( allowedControls, 'postType' );
const postTypeControlLabel = __( 'Content type' );
const postTypeControlLabel = __( 'Post type' );
const postTypeControlHelp = __(
'WordPress contains different types of content you can filter by. Posts and pages are the default types, but plugins could add more.'
'Select the type of content to display: posts, pages, or custom post types.'
);
const showColumnsControl = false;
const showOrderControl =
Expand Down Expand Up @@ -146,17 +145,33 @@ export default function QueryInspectorControls( props ) {
{ showSettingsPanel && (
<PanelBody title={ __( 'Settings' ) }>
{ showInheritControl && (
<ToggleControl
__nextHasNoMarginBottom
label={ __( 'Inherit query from template' ) }
help={ __(
'Enable to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'
) }
checked={ !! inherit }
onChange={ ( value ) =>
setQuery( { inherit: !! value } )
<ToggleGroupControl
__next40pxDefaultSize
label={ __( 'Query type' ) }
isBlock
onChange={ ( value ) => {
setQuery( { inherit: !! value } );
} }
help={
inherit
? __(
'Display a list of posts or custom post types based on the current template.'
)
: __(
'Display a list of posts or custom post types based on specific criteria.'
)
}
/>
value={ !! inherit }
>
<ToggleGroupControlOption
value
label={ __( 'Default' ) }
/>
<ToggleGroupControlOption
value={ false }
label={ __( 'Custom' ) }
/>
</ToggleGroupControl>
) }
{ showPostTypeControl &&
( postTypesSelectOptions.length > 2 ? (
Expand Down
23 changes: 10 additions & 13 deletions packages/block-library/src/spacer/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
privateApis as blockEditorPrivateApis,
} from '@wordpress/block-editor';
import {
BaseControl,
PanelBody,
__experimentalUseCustomUnits as useCustomUnits,
__experimentalUnitControl as UnitControl,
Expand Down Expand Up @@ -57,19 +56,17 @@ function DimensionInput( { label, onChange, isResizing, value = '' } ) {
return (
<>
{ ( ! spacingSizes || spacingSizes?.length === 0 ) && (
<BaseControl label={ label } id={ inputId }>
<UnitControl
id={ inputId }
isResetValueOnUnitChange
min={ MIN_SPACER_SIZE }
onChange={ handleOnChange }
style={ { maxWidth: 80 } }
value={ computedValue }
units={ units }
/>
</BaseControl>
<UnitControl
id={ inputId }
isResetValueOnUnitChange
min={ MIN_SPACER_SIZE }
onChange={ handleOnChange }
value={ computedValue }
units={ units }
label={ label }
__next40pxDefaultSize
/>
) }

{ spacingSizes?.length > 0 && (
<View className="tools-panel-item-spacing">
<SpacingSizesControl
Expand Down
9 changes: 9 additions & 0 deletions packages/block-library/src/tag-cloud/editor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// The following styles are to prevent duplicate spacing for the tag cloud
// block in the editor given it uses server side rendering. The specificity
// must be higher than `0-1-0` to override global styles. Targeting the
// inner use of the .wp-block-tag-cloud class should minimize impact on
// other 3rd party styles targeting the block.
.wp-block-tag-cloud .wp-block-tag-cloud {
margin: 0;
padding: 0;
}
Loading

0 comments on commit de3bfd2

Please sign in to comment.