Skip to content

Commit a313214

Browse files
Merge branch 'trunk' into update/modal-heading-labels-missing-text-color
2 parents d911eb9 + c3f4b72 commit a313214

File tree

45 files changed

+2455
-220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2455
-220
lines changed

backport-changelog/6.9/9600.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/9600
2+
3+
* https://github.com/WordPress/gutenberg/pull/70378

docs/reference-guides/core-blocks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Displays a section of content in an accordion, including a header and expandable
2828
- **Category:** design
2929
- **Parent:** core/accordion
3030
- **Allowed Blocks:** core/accordion-header, core/accordion-panel
31-
- **Supports:** color (background, gradient, text), interactivity, shadow, spacing (blockGap, margin)
31+
- **Supports:** color (background, gradient, text), interactivity, layout, shadow, spacing (blockGap, margin)
3232
- **Attributes:** openByDefault
3333

3434
## Accordion Header
@@ -50,7 +50,7 @@ Displays an accordion panel. ([Source](https://github.com/WordPress/gutenberg/tr
5050
- **Experimental:** true
5151
- **Category:** design
5252
- **Parent:** core/accordion-content
53-
- **Supports:** color (background, gradient, text), interactivity, shadow, spacing (blockGap, margin, padding), typography (fontSize, lineHeight)
53+
- **Supports:** color (background, gradient, text), interactivity, layout, shadow, spacing (blockGap, margin, padding), typography (fontSize, lineHeight)
5454
- **Attributes:** allowedBlocks, isSelected, openByDefault, templateLock
5555

5656
## Archives

lib/class-wp-theme-json-gutenberg.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -598,20 +598,21 @@ class WP_Theme_JSON_Gutenberg {
598598
* @var string[]
599599
*/
600600
const ELEMENTS = array(
601-
'link' => 'a:where(:not(.wp-element-button))', // The `where` is needed to lower the specificity.
602-
'heading' => 'h1, h2, h3, h4, h5, h6',
603-
'h1' => 'h1',
604-
'h2' => 'h2',
605-
'h3' => 'h3',
606-
'h4' => 'h4',
607-
'h5' => 'h5',
608-
'h6' => 'h6',
601+
'link' => 'a:where(:not(.wp-element-button))', // The `where` is needed to lower the specificity.
602+
'heading' => 'h1, h2, h3, h4, h5, h6',
603+
'h1' => 'h1',
604+
'h2' => 'h2',
605+
'h3' => 'h3',
606+
'h4' => 'h4',
607+
'h5' => 'h5',
608+
'h6' => 'h6',
609609
// We have the .wp-block-button__link class so that this will target older buttons that have been serialized.
610-
'button' => '.wp-element-button, .wp-block-button__link',
610+
'button' => '.wp-element-button, .wp-block-button__link',
611611
// The block classes are necessary to target older content that won't use the new class names.
612-
'caption' => '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption',
613-
'cite' => 'cite',
614-
'select' => 'select',
612+
'caption' => '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption',
613+
'cite' => 'cite',
614+
'select' => 'select',
615+
'textInput' => 'textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=text],[type=tel],[type=url])',
615616
);
616617

617618
const __EXPERIMENTAL_ELEMENT_CLASS_NAMES = array(

packages/block-editor/src/components/inserter/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,7 @@ export default compose( [
386386
);
387387

388388
if ( onSelectOrClose ) {
389-
onSelectOrClose( {
390-
clientId: blockToInsert?.clientId,
391-
} );
389+
onSelectOrClose( blockToInsert );
392390
}
393391

394392
const message = sprintf(

packages/block-editor/src/components/list-view/appender.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,20 @@ export const Appender = forwardRef(
2222
const { insertedBlock, setInsertedBlock } = useListViewContext();
2323

2424
const instanceId = useInstanceId( Appender );
25-
const hideInserter = useSelect(
25+
const { directInsert, hideInserter } = useSelect(
2626
( select ) => {
27-
const { getTemplateLock, isZoomOut } = unlock(
28-
select( blockEditorStore )
29-
);
27+
const { getBlockListSettings, getTemplateLock, isZoomOut } =
28+
unlock( select( blockEditorStore ) );
3029

31-
return !! getTemplateLock( clientId ) || isZoomOut();
30+
const settings = getBlockListSettings( clientId );
31+
const directInsertValue = settings?.directInsert || false;
32+
const hideInserterValue =
33+
!! getTemplateLock( clientId ) || isZoomOut();
34+
35+
return {
36+
directInsert: directInsertValue,
37+
hideInserter: hideInserterValue,
38+
};
3239
},
3340
[ clientId ]
3441
);
@@ -79,7 +86,7 @@ export const Appender = forwardRef(
7986
position="bottom right"
8087
isAppender
8188
selectBlockOnInsert={ false }
82-
shouldDirectInsert={ false }
89+
shouldDirectInsert={ directInsert }
8390
__experimentalIsQuick
8491
{ ...props }
8592
toggleProps={ { 'aria-describedby': descriptionId } }

packages/block-library/src/accordion-content/block.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"width": true
3131
}
3232
},
33-
"shadow": true
33+
"shadow": true,
34+
"layout": true
3435
},
3536
"attributes": {
3637
"openByDefault": {

packages/block-library/src/accordion-content/edit.js

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ import clsx from 'clsx';
2525
*/
2626
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
2727

28-
export default function Edit( {
29-
attributes: { openByDefault },
30-
clientId,
31-
setAttributes,
32-
} ) {
28+
export default function Edit( { attributes, clientId, setAttributes } ) {
29+
const { openByDefault } = attributes;
3330
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
3431

3532
const { isSelected, getBlockOrder } = useSelect(
@@ -67,29 +64,26 @@ export default function Edit( {
6764
updateBlockAttributes,
6865
] );
6966

70-
const blockProps = useBlockProps();
71-
const innerBlocksProps = useInnerBlocksProps(
72-
{
73-
...blockProps,
74-
className: clsx( blockProps.className, {
75-
'is-open': openByDefault || isSelected,
76-
} ),
77-
},
78-
{
79-
template: [
80-
[ 'core/accordion-header', {} ],
81-
[
82-
'core/accordion-panel',
83-
{
84-
openByDefault,
85-
},
86-
],
67+
const blockProps = useBlockProps( {
68+
className: clsx( {
69+
'is-open': openByDefault || isSelected,
70+
} ),
71+
} );
72+
73+
const innerBlocksProps = useInnerBlocksProps( blockProps, {
74+
template: [
75+
[ 'core/accordion-header', {} ],
76+
[
77+
'core/accordion-panel',
78+
{
79+
openByDefault,
80+
},
8781
],
88-
templateLock: 'all',
89-
directInsert: true,
90-
templateInsertUpdatesSelection: true,
91-
}
92-
);
82+
],
83+
templateLock: 'all',
84+
directInsert: true,
85+
templateInsertUpdatesSelection: true,
86+
} );
9387

9488
return (
9589
<>

packages/block-library/src/accordion-panel/block.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"fontSize": true
4848
}
4949
},
50-
"shadow": true
50+
"shadow": true,
51+
"layout": true
5152
},
5253
"attributes": {
5354
"allowedBlocks": {

packages/block-library/src/accordion/style.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
}
1414
}
1515

16-
.accordion-content__heading {
17-
margin-block-start: 0;
18-
margin-block-end: 0;
19-
}
20-
2116
.accordion-content__toggle {
2217
font-family: inherit;
2318
font-size: inherit;
@@ -48,7 +43,12 @@
4843
.is-layout-flow > .wp-block-accordion-panel,
4944
.wp-block-accordion-panel {
5045
overflow: hidden;
51-
margin: 0;
46+
}
47+
48+
// Prevent blockGap from Accordion Content block from adding extra margin between accordions.
49+
.wp-block-accordion-panel[inert],
50+
.wp-block-accordion-panel[aria-hidden="true"] {
51+
margin-block-start: 0;
5252
}
5353

5454
.accordion-panel__wrapper {

packages/block-library/src/form-input/style.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
width: fit-content;
3535
}
3636

37-
.wp-block-form-input__input {
37+
:where(.wp-block-form-input__input) {
3838
padding: 0 0.5em;
3939
font-size: 1em;
4040
margin-bottom: 0.5em;
@@ -54,7 +54,8 @@
5454
&[type="week"] {
5555
min-height: 2em;
5656
line-height: 2;
57-
border: 1px solid;
57+
border-width: 1px;
58+
border-style: solid;
5859
}
5960
}
6061

0 commit comments

Comments
 (0)