Skip to content

Commit 9115a7d

Browse files
authored
Merge branch 'develop' into feature/439-theme-url
2 parents c4ac09c + 3475994 commit 9115a7d

File tree

85 files changed

+174127
-8712
lines changed

Some content is hidden

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

85 files changed

+174127
-8712
lines changed

.env.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ MYSQL_USER=wordpress
55
MYSQL_PASSWORD=wordpress
66

77
# WordPress
8-
WP_VERSION=5.5.1
8+
WP_VERSION=5.6
99
WP_DB_USER=wordpress
1010
WP_DB_PASSWORD=wordpress

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ jobs:
9494
- echo "Running E2E tests with code coverage ..."
9595
script:
9696
- npm run env:start
97-
- npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password --admin_email=admin@example.com --skip-email --url=http://localhost:8088 --quiet
97+
- docker-compose exec wordpress bash -c "chown -R www-data:www-data /var/www/html/wp-content/" # ensure WP folders have correct permissions
98+
- docker-compose exec mysql bash -c "chown -R mysql:mysql /var/lib/mysql"
99+
- npm run wp -- wp core install --title=WordPress --admin_user=admin --admin_password=password --admin_email=admin@example.com --skip-email --url=http://localhost:8088
98100
- npm run wp -- wp plugin activate material-design
99-
- npm run build:js
101+
- sudo chown -R travis:travis tests # ensure coverage folder can be created
100102
- npm run test:e2e:coveralls
101103

102104
- name: JS unit tests (7.4, WordPress latest, with code coverage)

assets/css/src/block-editor.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
}
3333

3434
.block-editor-block-types-list__item[class*="editor-block-list-item-material-"],
35-
.editor-autocompleters__block {
35+
.editor-autocompleters__block,
36+
.components-autocomplete__popover {
3637

3738
& .material-icons-outlined,
3839
& .material-icons__button {

assets/src/block-editor/blocks/button/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"icon": {
4848
"type": "string",
4949
"default": "",
50-
"source": "html",
50+
"source": "text",
5151
"selector": ".material-icons"
5252
},
5353
"backgroundColor": {

assets/src/block-editor/blocks/button/edit.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,30 @@ const ButtonEdit = ( {
353353
};
354354

355355
export default withSelect( ( select, { clientId } ) => {
356-
const { getBlockParentsByBlockName } = select( 'core/block-editor' );
356+
const { getBlock, getBlockParentsByBlockName, getBlockRootClientId } = select(
357+
'core/block-editor'
358+
);
359+
let isSubmitButton = false;
360+
361+
if ( 'undefined' === typeof getBlockParentsByBlockName ) {
362+
let parentId = getBlockRootClientId( clientId );
363+
364+
while ( parentId ) {
365+
const parentBlock = getBlock( clientId );
366+
367+
if ( parentBlock && parentBlock.name === ContactFormBlockName ) {
368+
isSubmitButton = true;
369+
break;
370+
}
371+
372+
parentId = getBlockRootClientId( parentId );
373+
}
374+
} else {
375+
isSubmitButton =
376+
getBlockParentsByBlockName( clientId, ContactFormBlockName ).length > 0;
377+
}
357378

358379
return {
359-
isSubmitButton:
360-
getBlockParentsByBlockName( clientId, ContactFormBlockName ).length > 0,
380+
isSubmitButton,
361381
};
362382
} )( ButtonEdit );

assets/src/block-editor/blocks/card/components/card-action-button.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ const CardActionButton = ( {
7070
value={ label }
7171
onChange={ onChangeLabel }
7272
placeholder={ __( 'Button', 'material-design' ) }
73+
allowedFormats={ [
74+
'core/bold',
75+
'core/italic',
76+
'core/code',
77+
'core/image',
78+
'core/strikethrough',
79+
'core/underline',
80+
'core/text-color',
81+
'core/subscript',
82+
'core/superscript',
83+
] }
7384
/>
7485
</button>
7586
) : (
@@ -80,7 +91,10 @@ const CardActionButton = ( {
8091
className="mdc-button mdc-card__action mdc-card__action--button"
8192
>
8293
<div className="mdc-button__ripple"></div>
83-
<span className="mdc-button__label">{ label }</span>
94+
<span
95+
className="mdc-button__label"
96+
dangerouslySetInnerHTML={ { __html: label } }
97+
></span>
8498
</a>
8599
) }
86100
{ isFocused && isEditMode && (

assets/src/block-editor/blocks/card/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const settings = {
4141
'material-design'
4242
),
4343
keywords: [ __( 'Material Card', 'material-design' ) ],
44-
icon: <i className="material-icons-outlined">chrome_reader_mode</i>,
44+
icon: () => <i className="material-icons-outlined">chrome_reader_mode</i>,
4545
example,
4646
edit,
4747
save,

assets/src/block-editor/blocks/contact-form/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const settings = {
3838
),
3939
category: 'material',
4040
keywords: [ __( 'Material Contact Form', 'material-design' ) ],
41-
icon: <i className="material-icons-outlined">mail</i>,
41+
icon: () => <i className="material-icons-outlined">mail</i>,
4242
example: {
4343
attributes: {
4444
preview: true,

assets/src/block-editor/blocks/contact-form/inner-blocks/common/components/text-input-edit.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ const TextInputEdit = props => {
9090
textFields.forEach( textField => new MDCTextField( textField ) );
9191
}, [ outlined, displayLabel, fullWidth ] );
9292

93-
if ( ! id || id.length === 0 ) {
94-
setAttributes( { id: `material-design-${ inputRole }-${ instanceId }` } );
95-
return null;
96-
}
93+
useEffect( () => {
94+
if ( ! id || id.length === 0 ) {
95+
setAttributes( { id: `material-design-${ inputRole }-${ instanceId }` } );
96+
} // eslint-disable-next-line react-hooks/exhaustive-deps
97+
}, [ id ] );
9798

9899
const setter = genericAttributesSetter( setAttributes );
99100
const textInputProps = {
@@ -188,12 +189,10 @@ const TextInputEdit = props => {
188189
export default compose( [
189190
withInstanceId,
190191
withSelect( ( select, ownProps ) => {
191-
const parents = select( 'core/block-editor' ).getBlockParents(
192+
const parentId = select( 'core/block-editor' ).getBlockRootClientId(
192193
ownProps.clientId
193194
);
194195

195-
const parentId = parents[ parents.length - 1 ];
196-
197196
return {
198197
parentBlock: parentId
199198
? select( 'core/block-editor' ).getBlock( parentId )

assets/src/block-editor/blocks/contact-form/inner-blocks/common/components/textarea-input-edit.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ const TextAreaInputEdit = props => {
7373

7474
const setter = genericAttributesSetter( setAttributes );
7575

76-
if ( ! id || id.length === 0 ) {
77-
setAttributes( { id: `material-design-${ inputRole }-${ instanceId }` } );
78-
}
76+
useEffect( () => {
77+
if ( ! id || id.length === 0 ) {
78+
setAttributes( { id: `material-design-${ inputRole }-${ instanceId }` } );
79+
} // eslint-disable-next-line react-hooks/exhaustive-deps
80+
}, [ id ] );
7981

8082
const textareaInputProps = {
8183
inputValue,
@@ -187,12 +189,10 @@ const TextAreaInputEdit = props => {
187189
export default compose( [
188190
withInstanceId,
189191
withSelect( ( select, ownProps ) => {
190-
const parents = select( 'core/block-editor' ).getBlockParents(
192+
const parentId = select( 'core/block-editor' ).getBlockRootClientId(
191193
ownProps.clientId
192194
);
193195

194-
const parentId = parents[ parents.length - 1 ];
195-
196196
return {
197197
parentBlock: parentId
198198
? select( 'core/block-editor' ).getBlock( parentId )

0 commit comments

Comments
 (0)