Skip to content

Commit

Permalink
prep build 11/13
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Nov 13, 2024
2 parents ec9406e + 65c45a3 commit bd545e9
Show file tree
Hide file tree
Showing 52 changed files with 572 additions and 510 deletions.
4 changes: 4 additions & 0 deletions backport-changelog/6.8/7265.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
https://github.com/WordPress/wordpress-develop/pull/7265

* https://github.com/WordPress/gutenberg/pull/66850
* https://github.com/WordPress/gutenberg/pull/66947
35 changes: 35 additions & 0 deletions lib/compat/wordpress-6.8/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/**
* Adds the x-wav mime type to the list of mime types.
* This is necessary for Firefox as it uses the identifier for uploaded .wav files.
* Core backport should add the following to the default mime_types filters in
* `wp_get_mime_types()` in wp-includes/functions.php:
*
* `'wav|x-wav' => 'audio/wav'`
*
* @since 6.8.0
*
* @param string[] $mime_types Mime types.
* @return string[] Mime types keyed by the file extension regex corresponding to those types.
*/
function gutenberg_get_mime_types_6_8( $mime_types ) {
/*
* Only add support if there is existing support for 'wav'.
* Some plugins may have deliberately disabled it.
*/
if ( ! isset( $mime_types['wav'] ) && ! isset( $mime_types['wav|x-wav'] ) ) {
return $mime_types;
}
/*
* Also, given that other themes or plugins may have already
* tried to add x-wav type support, only
* add the mime type if it doesn't already exist
* to avoid overriding any customizations.
*/
if ( ! isset( $mime_types['x-wav'] ) && ! isset( $mime_types['wav|x-wav'] ) ) {
$mime_types['x-wav'] = 'audio/wav';
}
return $mime_types;
}
add_filter( 'mime_types', 'gutenberg_get_mime_types_6_8', 99 );
1 change: 1 addition & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function gutenberg_is_experiment_enabled( $name ) {
// WordPress 6.8 compat.
require __DIR__ . '/compat/wordpress-6.8/preload.php';
require __DIR__ . '/compat/wordpress-6.8/blocks.php';
require __DIR__ . '/compat/wordpress-6.8/functions.php';

// Experimental features.
require __DIR__ . '/experimental/block-editor-settings-mobile.php';
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ The aria label for the block patterns list.
- Required: No
- Default: `Block Patterns`

#### showTitlesAsTooltip

Whether to render the title of each pattern as a tooltip. User-defined patterns always show their visual title regardless of this prop.

- Type: `boolean`
- Required: No
- Default: `false`

## Related components

Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree.
40 changes: 14 additions & 26 deletions packages/block-editor/src/components/block-patterns-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ function BlockPattern( {
pattern,
onClick,
onHover,
showTitle = true,
showTooltip,
showTitlesAsTooltip,
category,
} ) {
const [ isDragging, setIsDragging ] = useState( false );
const { blocks, viewportWidth } = pattern;
const instanceId = useInstanceId( BlockPattern );
const descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;
const isUserPattern = pattern.type === INSERTER_PATTERN_TYPES.user;

// When we have a selected category and the pattern is draggable, we need to update the
// pattern's categories in metadata to only contain the selected category, and pass this to
Expand Down Expand Up @@ -94,10 +94,7 @@ function BlockPattern( {
} }
>
<WithToolTip
showTooltip={
showTooltip &&
! pattern.type !== INSERTER_PATTERN_TYPES.user
}
showTooltip={ showTitlesAsTooltip && ! isUserPattern }
title={ pattern.title }
>
<Composite.Item
Expand Down Expand Up @@ -142,29 +139,22 @@ function BlockPattern( {
viewportWidth={ viewportWidth }
/>
</BlockPreview.Async>

{ showTitle && (
{ ( ! showTitlesAsTooltip || isUserPattern ) && (
<HStack
className="block-editor-patterns__pattern-details"
spacing={ 2 }
>
{ pattern.type ===
INSERTER_PATTERN_TYPES.user &&
! pattern.syncStatus && (
<div className="block-editor-patterns__pattern-icon-wrapper">
<Icon
className="block-editor-patterns__pattern-icon"
icon={ symbol }
/>
</div>
) }
{ ( ! showTooltip ||
pattern.type ===
INSERTER_PATTERN_TYPES.user ) && (
<div className="block-editor-block-patterns-list__item-title">
{ pattern.title }
{ isUserPattern && ! pattern.syncStatus && (
<div className="block-editor-patterns__pattern-icon-wrapper">
<Icon
className="block-editor-patterns__pattern-icon"
icon={ symbol }
/>
</div>
) }
<div className="block-editor-block-patterns-list__item-title">
{ pattern.title }
</div>
</HStack>
) }

Expand Down Expand Up @@ -196,7 +186,6 @@ function BlockPatternsList(
orientation,
label = __( 'Block patterns' ),
category,
showTitle = true,
showTitlesAsTooltip,
pagingProps,
},
Expand Down Expand Up @@ -230,8 +219,7 @@ function BlockPatternsList(
onClick={ onClickPattern }
onHover={ onHover }
isDraggable={ isDraggable }
showTitle={ showTitle }
showTooltip={ showTitlesAsTooltip }
showTitlesAsTooltip={ showTitlesAsTooltip }
category={ category }
/>
) ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const Default = {
blockPatterns: patterns,
isDraggable: false,
label: 'Block patterns story',
showTitle: true,
showTitlesAsTooltip: false,
},
argTypes: {
Expand All @@ -40,18 +39,11 @@ export const Default = {
description:
'Usually this component is used with `useAsyncList` for performance reasons and you should provide the returned list from that hook. Alternatively it should have the same value with `blockPatterns`.',
},
showTitle: {
description: 'Whether to render the title of each pattern.',
table: {
defaultValue: { summary: true },
type: { summary: 'boolean' },
},
},
onClickPattern: { type: 'function' },
onHover: { type: 'function' },
showTitlesAsTooltip: {
description:
'Whether to render the title of each pattern as a tooltip. If enabled, it takes precedence over `showTitle` prop.',
'Whether to render the title of each pattern as a tooltip. If enabled',
},
orientation: {
description: 'Orientation for the underlying composite widget.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default function ChangeDesign( { clientId } ) {
<BlockPatternsList
blockPatterns={ sameCategoryPatternsWithSingleWrapper }
onClickPattern={ onClickPattern }
showTitle={ false }
showTitlesAsTooltip
/>
</DropdownContentWrapper>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ function PatternList( {
return true;
}
if ( selectedCategory === 'uncategorized' ) {
const hasKnownCategory = pattern.categories.some(
( category ) =>
const hasKnownCategory =
pattern.categories?.some( ( category ) =>
registeredPatternCategories.includes( category )
);
) ?? false;

return ! pattern.categories?.length || ! hasKnownCategory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function BlockPatternsTab( {
onInsert={ onInsert }
rootClientId={ rootClientId }
category={ category }
showTitlesAsTooltip={ false }
/>
</div>
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const myPatternsCategory = {

export const starterPatternsCategory = {
name: 'core/starter-content',
label: __( 'Starter Content' ),
label: __( 'Starter content' ),
};

export function isPatternFiltered( pattern, sourceFilter, syncFilter ) {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const settings = {
example: {
attributes: {
className: 'is-style-fill',
text: __( 'Call to Action' ),
text: __( 'Call to action' ),
},
},
edit,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/template-part/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function TemplatesList( { area, clientId, isEntityAvailable, onSelect } ) {
label={ __( 'Templates' ) }
blockPatterns={ blockPatterns }
onClickPattern={ onSelect }
showTitle={ false }
showTitlesAsTooltip
/>
</PanelBody>
);
Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bug Fixes

- `Popover`: Fix missing label of the headerTitle Close button ([#66813](https://github.com/WordPress/gutenberg/pull/66813)).
- `ToggleGroupControl`: Fix active background for `0` value ([#66855](https://github.com/WordPress/gutenberg/pull/66855)).

### Enhancements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import { ConfirmDialog } from '../component';

const meta: Meta< typeof ConfirmDialog > = {
component: ConfirmDialog,
title: 'Components (Experimental)/ConfirmDialog',
title: 'Components (Experimental)/Overlays/ConfirmDialog',
id: 'components-experimental-confirmdialog',
argTypes: {
isOpen: {
control: { type: null },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/dropdown/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import MenuItem from '../../menu-item';
import { DropdownContentWrapper } from '../dropdown-content-wrapper';

const meta: Meta< typeof Dropdown > = {
title: 'Components/Dropdown',
title: 'Components/Overlays/Dropdown',
id: 'components-dropdown',
component: Dropdown,
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
subcomponents: { DropdownContentWrapper },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/heading/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { Heading } from '..';

const meta: Meta< typeof Heading > = {
component: Heading,
title: 'Components (Experimental)/Heading',
title: 'Components (Experimental)/Typography/Heading',
id: 'components-experimental-heading',
argTypes: {
as: { control: { type: 'text' } },
color: { control: { type: 'color' } },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/menu/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill';
import { ContextSystemProvider } from '../../context';

const meta: Meta< typeof Menu > = {
title: 'Components (Experimental)/Menu',
id: 'components-experimental-menu',
title: 'Components (Experimental)/Actions/Menu',
component: Menu,
subcomponents: {
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/modal/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import type { ModalProps } from '../types';

const meta: Meta< typeof Modal > = {
component: Modal,
title: 'Components/Modal',
title: 'Components/Overlays/Modal',
id: 'components-modal',
argTypes: {
children: {
control: { type: null },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/popover/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const AVAILABLE_PLACEMENTS: PopoverProps[ 'placement' ][] = [
];

const meta: Meta< typeof Popover > = {
title: 'Components/Popover',
title: 'Components/Overlays/Popover',
id: 'components-popover',
component: Popover,
argTypes: {
anchor: { control: { type: null } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import TextHighlight from '..';

const meta: Meta< typeof TextHighlight > = {
component: TextHighlight,
title: 'Components/TextHighlight',
title: 'Components/Typography/TextHighlight',
id: 'components-texthighlight',
parameters: {
controls: {
expanded: true,
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/text/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { Text } from '../component';

const meta: Meta< typeof Text > = {
component: Text,
title: 'Components (Experimental)/Text',
title: 'Components (Experimental)/Typography/Text',
id: 'components-experimental-text',
argTypes: {
as: { control: { type: 'text' } },
color: { control: { type: 'color' } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function UnconnectedToggleGroupControl(
const [ controlElement, setControlElement ] = useState< HTMLElement >();
const refs = useMergeRefs( [ setControlElement, forwardedRef ] );
const selectedRect = useTrackElementOffsetRect(
value ? selectedElement : undefined
value || value === 0 ? selectedElement : undefined
);
useAnimatedOffsetRect( controlElement, selectedRect, {
prefix: 'selected',
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/tooltip/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import Tooltip from '..';
import Button from '../../button';

const meta: Meta< typeof Tooltip > = {
title: 'Components/Tooltip',
title: 'Components/Overlays/Tooltip',
id: 'components-tooltip',
component: Tooltip,
argTypes: {
children: { control: { type: null } },
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/truncate/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { Truncate } from '..';

const meta: Meta< typeof Truncate > = {
component: Truncate,
title: 'Components (Experimental)/Truncate',
title: 'Components (Experimental)/Typography/Truncate',
id: 'components-experimental-truncate',
argTypes: {
children: { control: { type: 'text' } },
as: { control: { type: 'text' } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { VisuallyHidden } from '..';

const meta: Meta< typeof VisuallyHidden > = {
component: VisuallyHidden,
title: 'Components/Utilities/VisuallyHidden',
title: 'Components/Typography/VisuallyHidden',
id: 'components-visuallyhidden',
argTypes: {
children: { control: { type: null } },
Expand Down
4 changes: 4 additions & 0 deletions packages/core-data/src/entity-types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ declare module './base-entity-records' {
* The ID of the page that should be displayed on the front page
*/
page_on_front: number;
/**
* The ID of the page that should display the latest posts
*/
page_for_posts: number;
/**
* Site title.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/date/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ _Parameters_

- _dateFormat_ `string`: PHP-style formatting string. See php.net/date.
- _dateValue_ `Moment | Date | string | undefined`: Date object or string, parsable by moment.js.
- _timezone_ `string | number | boolean | undefined`: Timezone to output result in or a UTC offset. Defaults to timezone from site. Notice: `boolean` is effectively deprecated, but still supported for backward compatibility reasons.
- _timezone_ `string | number | boolean | undefined=`: Timezone to output result in or a UTC offset. Defaults to timezone from site. Notice: `boolean` is effectively deprecated, but still supported for backward compatibility reasons.

_Returns_

Expand Down
Loading

0 comments on commit bd545e9

Please sign in to comment.