Skip to content

Commit

Permalink
prep build 1/27
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Jan 27, 2025
2 parents af6cc2a + ad2a39d commit adaf858
Show file tree
Hide file tree
Showing 23 changed files with 109 additions and 98 deletions.
6 changes: 3 additions & 3 deletions docs/reference-guides/slotfills/main-dashboard-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ registerPlugin( 'main-dashboard-button-test', {

### Change the icon and link

This example will change the icon in the header to indicate an external link that will take the user to http://wordpress.org when clicked.
This example will change the icon in the header to indicate an external link that will take the user to https://wordpress.org when clicked.

```js
import { registerPlugin } from '@wordpress/plugins';
Expand All @@ -45,7 +45,7 @@ import { external } from '@wordpress/icons';

const MainDashboardButtonIconTest = () => (
<MainDashboardButton>
<FullscreenModeClose icon={ external } href="http://wordpress.org" />
<FullscreenModeClose icon={ external } href="https://wordpress.org" />
</MainDashboardButton>
);

Expand All @@ -54,4 +54,4 @@ registerPlugin( 'main-dashboard-button-icon-test', {
} );
```

![The edit post screen in fullscreen mode displaying an external link icon instead of the default W](https://developer.wordpress.org/files/2024/08/main-dashboard-button-external-link-example.png 'Change the icon in the header to indicate an external link that will take the user to http://wordpress.org when clicked')
![The edit post screen in fullscreen mode displaying an external link icon instead of the default W](https://developer.wordpress.org/files/2024/08/main-dashboard-button-external-link-example.png 'Change the icon in the header to indicate an external link that will take the user to https://wordpress.org when clicked')
2 changes: 1 addition & 1 deletion lib/class-wp-theme-json-resolver-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public static function get_theme_data( $deprecated = array(), $options = array()
}
if ( current_theme_supports( 'experimental-link-color' ) ) {
_doing_it_wrong(
current_theme_supports( 'experimental-link-color' ),
"add_theme_support( 'experimental-link-color' )",
__( '`experimental-link-color` is no longer supported. Use `link-color` instead.', 'gutenberg' ),
'6.3.0'
);
Expand Down
4 changes: 2 additions & 2 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ function gutenberg_enqueue_stored_styles( $options = array() ) {

// Combines Core styles.
if ( ! empty( $compiled_core_stylesheet ) ) {
wp_register_style( $style_tag_id, false, array(), true, true );
wp_register_style( $style_tag_id, false, array(), true );
wp_add_inline_style( $style_tag_id, $compiled_core_stylesheet );
wp_enqueue_style( $style_tag_id );
}
Expand All @@ -562,7 +562,7 @@ function gutenberg_enqueue_stored_styles( $options = array() ) {
$styles = gutenberg_style_engine_get_stylesheet_from_context( $store_name, $options );
if ( ! empty( $styles ) ) {
$key = "wp-style-engine-$store_name";
wp_register_style( $key, false, array(), true, true );
wp_register_style( $key, false, array(), true );
wp_add_inline_style( $key, $styles );
wp_enqueue_style( $key );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private static function handle_read_pending_messages( $subscriber_to_messages_pa
if ( ! $fd ) {
$retries = isset( $_COOKIE['signaling_server_retries'] ) ? intval( $_COOKIE['signaling_server_retries'] ) : 0;
$secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );
setcookie( 'signaling_server_retries', $retries + 1, time() + DAY_IN_SECONDS, SITECOOKIEPATH, '', $secure );
setcookie( 'signaling_server_retries', (string) ( $retries + 1 ), time() + DAY_IN_SECONDS, SITECOOKIEPATH, '', $secure );
echo 'id: ' . time() . PHP_EOL;
echo 'event: error' . PHP_EOL;
echo 'data: ' . 'Could not open required file.' . PHP_EOL . PHP_EOL;
Expand All @@ -183,7 +183,7 @@ private static function handle_read_pending_messages( $subscriber_to_messages_pa
if ( isset( $_COOKIE['signaling_server_retries'] ) ) {
$secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );
// unset the cookie using a past expiration date.
setcookie( 'signaling_server_retries', 0, time() - DAY_IN_SECONDS, SITECOOKIEPATH, '', $secure );
setcookie( 'signaling_server_retries', '0', time() - DAY_IN_SECONDS, SITECOOKIEPATH, '', $secure );
}

echo 'retry: 3000' . PHP_EOL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
/**
* WordPress dependencies
*/
import { Button, Tooltip } from '@wordpress/components';
import { Button } from '@wordpress/components';
import { link, linkOff } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';

export default function LinkedButton( { isLinked, ...props } ) {
const label = isLinked ? __( 'Unlink sides' ) : __( 'Link sides' );

return (
<Tooltip text={ label }>
<Button
{ ...props }
size="small"
icon={ isLinked ? link : linkOff }
iconSize={ 24 }
aria-label={ label }
/>
</Tooltip>
<Button
{ ...props }
size="small"
icon={ isLinked ? link : linkOff }
iconSize={ 24 }
label={ label }
/>
);
}
7 changes: 7 additions & 0 deletions packages/block-library/src/navigation-submenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* WordPress dependencies
*/
import { page, addSubmenu } from '@wordpress/icons';
import { _x } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -37,6 +38,12 @@ export const settings = {
return label;
},
edit,
example: {
attributes: {
label: _x( 'About', 'Example link text for Navigation Submenu' ),
type: 'page',
},
},
save,
transforms,
};
Expand Down
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Enhancements

- `BorderBoxControl`, `BoxControl`: Remove `Tooltip` component from linked button ([#68498](https://github.com/WordPress/gutenberg/pull/68498)).

### Internal

- `BoxControl`: Add runtime check for presets and presetKey ([#68385](https://github.com/WordPress/gutenberg/pull/68385)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import Button from '../../button';
import Tooltip from '../../tooltip';
import { View } from '../../view';
import type { WordPressComponentProps } from '../../context';
import { contextConnect } from '../../context';
import { useBorderBoxControlLinkedButton } from './hook';
Expand All @@ -25,18 +23,15 @@ const BorderBoxControlLinkedButton = (
const label = isLinked ? __( 'Unlink sides' ) : __( 'Link sides' );

return (
<Tooltip text={ label }>
<View className={ className }>
<Button
{ ...buttonProps }
size="small"
icon={ isLinked ? link : linkOff }
iconSize={ 24 }
aria-label={ label }
ref={ forwardedRef }
/>
</View>
</Tooltip>
<Button
{ ...buttonProps }
size="small"
icon={ isLinked ? link : linkOff }
iconSize={ 24 }
label={ label }
ref={ forwardedRef }
className={ className }
/>
);
};

Expand Down
19 changes: 8 additions & 11 deletions packages/components/src/box-control/linked-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import Button from '../button';
import Tooltip from '../tooltip';

export default function LinkedButton( {
isLinked,
Expand All @@ -17,15 +16,13 @@ export default function LinkedButton( {
const label = isLinked ? __( 'Unlink sides' ) : __( 'Link sides' );

return (
<Tooltip text={ label }>
<Button
{ ...props }
className="component-box-control__linked-button"
size="small"
icon={ isLinked ? link : linkOff }
iconSize={ 24 }
aria-label={ label }
/>
</Tooltip>
<Button
{ ...props }
className="component-box-control__linked-button"
size="small"
icon={ isLinked ? link : linkOff }
iconSize={ 24 }
label={ label }
/>
);
}
8 changes: 8 additions & 0 deletions packages/edit-site/src/components/page-patterns/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@

.page-patterns-preview-field {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100%;
border-radius: $radius-medium;

.dataviews-view-grid & {
.block-editor-block-preview__container {
height: 100%;
}
}

.dataviews-view-table & {
width: 96px;
flex-grow: 0;
Expand Down
2 changes: 2 additions & 0 deletions packages/edit-site/src/components/page-templates/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.page-templates-preview-field {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100%;
width: 100%;
Expand Down
38 changes: 19 additions & 19 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ Component check if there are any headings (core/heading blocks) present in the d
_Parameters_

- _props_ `Object`: Props.
- _props.children_ `React.ReactElement`: Children to be rendered.
- _props.children_ `React.ReactNode`: Children to be rendered.

_Returns_

- `React.ReactElement`: The component to be rendered or null if there are headings.
- `React.ReactNode`: The component to be rendered or null if there are headings.

### EditorHistoryRedo

Expand Down Expand Up @@ -524,11 +524,11 @@ Wrapper component that renders its children only if the post type supports page
_Parameters_

- _props_ `Object`: - The component props.
- _props.children_ `React.ReactElement`: - The child components to render.
- _props.children_ `React.ReactNode`: - The child components to render.

_Returns_

- `React.ReactElement`: The rendered child components or null if page attributes are not supported.
- `React.ReactNode`: The rendered child components or null if page attributes are not supported.

### PageAttributesOrder

Expand Down Expand Up @@ -1211,11 +1211,11 @@ This component checks the publishing status of the current post. If the post is
_Parameters_

- _props_ `Object`: Component properties.
- _props.children_ `React.ReactElement`: Children to be rendered.
- _props.children_ `React.ReactNode`: Children to be rendered.

_Returns_

- `React.ReactElement`: The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.
- `React.ReactNode`: The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.

### PostPingbacks

Expand Down Expand Up @@ -1287,11 +1287,11 @@ Wrapper component that renders its children only if post has a publish action.
_Parameters_

- _props_ `Object`: Props.
- _props.children_ `React.ReactElement`: Children to be rendered.
- _props.children_ `React.ReactNode`: Children to be rendered.

_Returns_

- `React.ReactElement`: - The component to be rendered or null if there is no publish action.
- `React.ReactNode`: - The component to be rendered or null if there is no publish action.

### PostScheduleLabel

Expand Down Expand Up @@ -1328,11 +1328,11 @@ Wrapper component that renders its children only if post has a sticky action.
_Parameters_

- _props_ `Object`: Props.
- _props.children_ `React.ReactElement`: Children to be rendered.
- _props.children_ `React.ReactNode`: Children to be rendered.

_Returns_

- `React.ReactElement`: The component to be rendered or null if post type is not 'post' or hasStickyAction is false.
- `React.ReactNode`: The component to be rendered or null if post type is not 'post' or hasStickyAction is false.

### PostSwitchToDraftButton

Expand Down Expand Up @@ -1374,7 +1374,7 @@ _Parameters_

_Returns_

- `React.ReactElement`: The rendered children components or null if the current post type has no taxonomies.
- `React.ReactNode`: The rendered children components or null if the current post type has no taxonomies.

### PostTaxonomiesFlatTermSelector

Expand Down Expand Up @@ -1463,11 +1463,11 @@ Wrapper component that renders its children only if the post can be trashed.
_Parameters_

- _props_ `Object`: The component props.
- _props.children_ `React.ReactElement`: The child components.
- _props.children_ `React.ReactNode`: The child components.

_Returns_

- `React.ReactElement | null`: The rendered child components or null if the post can't be trashed.
- `React.ReactNode`: The rendered child components or null if the post can't be trashed.

### PostTypeSupportCheck

Expand All @@ -1476,12 +1476,12 @@ A component which renders its own children only if the current editor post type
_Parameters_

- _props_ `Object`: Props.
- _props.children_ `React.ReactElement`: Children to be rendered if post type supports.
- _props.children_ `React.ReactNode`: Children to be rendered if post type supports.
- _props.supportKeys_ `(string|string[])`: String or string array of keys to test.

_Returns_

- `React.ReactElement`: The component to be rendered.
- `React.ReactNode`: The component to be rendered.

### PostURL

Expand Down Expand Up @@ -1509,11 +1509,11 @@ Check if the post URL is valid and visible.
_Parameters_

- _props_ `Object`: The component props.
- _props.children_ `React.ReactElement`: The child components.
- _props.children_ `React.ReactNode`: The child components.

_Returns_

- `React.ReactElement`: The child components if the post URL is valid and visible, otherwise null.
- `React.ReactNode`: The child components if the post URL is valid and visible, otherwise null.

### PostURLLabel

Expand Down Expand Up @@ -1657,12 +1657,12 @@ Checks if the current theme supports specific features and renders the children
_Parameters_

- _props_ `Object`: The component props.
- _props.children_ `React.ReactElement`: The children to render if the theme supports the specified features.
- _props.children_ `React.ReactNode`: The children to render if the theme supports the specified features.
- _props.supportKeys_ `string|string[]`: The key(s) of the theme support(s) to check.

_Returns_

- `React.ReactElement`: The rendered children if the theme supports the specified features, otherwise null.
- `React.ReactNode`: The rendered children if the theme supports the specified features, otherwise null.

### TimeToRead

Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/components/document-outline/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
/**
* Component check if there are any headings (core/heading blocks) present in the document.
*
* @param {Object} props Props.
* @param {React.ReactElement} props.children Children to be rendered.
* @param {Object} props Props.
* @param {React.ReactNode} props.children Children to be rendered.
*
* @return {React.ReactElement} The component to be rendered or null if there are headings.
* @return {React.ReactNode} The component to be rendered or null if there are headings.
*/
export default function DocumentOutlineCheck( { children } ) {
const hasHeadings = useSelect( ( select ) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/components/page-attributes/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { store as editorStore } from '../../store';
/**
* Wrapper component that renders its children only if the post type supports page attributes.
*
* @param {Object} props - The component props.
* @param {React.ReactElement} props.children - The child components to render.
* @param {Object} props - The component props.
* @param {React.ReactNode} props.children - The child components to render.
*
* @return {React.ReactElement} The rendered child components or null if page attributes are not supported.
* @return {React.ReactNode} The rendered child components or null if page attributes are not supported.
*/
export function PageAttributesCheck( { children } ) {
const supportsPageAttributes = useSelect( ( select ) => {
Expand Down
Loading

0 comments on commit adaf858

Please sign in to comment.