Skip to content

Commit 9468fa3

Browse files
authored
Merge pull request #495 from xwp/feature/wp-52-min
Update minimum WP version to 5.2
2 parents 073ef8e + 2383cb6 commit 9468fa3

File tree

28 files changed

+11083
-3174
lines changed

28 files changed

+11083
-3174
lines changed

.stylelintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"no-descending-specificity": null,
88
"no-duplicate-selectors": null,
99
"number-leading-zero": null,
10+
"selector-class-pattern": null,
1011
"selector-type-no-unknown": [ true, { "ignore": ["custom-elements"] } ],
1112
"at-rule-no-unknown": [ true, { "ignoreAtRules": ["mixin"] } ]
1213
}

.travis.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ jobs:
8686
php: "7.4"
8787
env: NODE_ENV=teste2e COVERALLS_REPO_TOKEN=$CR_TOKEN
8888
before_install:
89+
- unset PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
8990
- nvm install
9091
- nvm use
91-
- unset PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
92+
- set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
9293
before_script:
9394
- sudo service mysql stop
9495
- echo "Running E2E tests with code coverage ..."
@@ -98,7 +99,7 @@ jobs:
9899
- docker-compose exec mysql bash -c "chown -R mysql:mysql /var/lib/mysql"
99100
- 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
100101
- npm run wp -- wp plugin activate material-design
101-
- sudo chown -R travis:travis tests # ensure coverage folder can be created
102+
- sudo chown -R travis:travis tests node_modules # ensure coverage folder can be created
102103
- npm run test:e2e:coveralls
103104

104105
- name: JS unit tests (7.4, WordPress latest, with code coverage)
@@ -130,13 +131,13 @@ jobs:
130131
php: "7.1"
131132
env: WP_VERSION=latest DEV_LIB_ONLY=phpunit
132133

133-
- name: PHP unit tests (7.0, WordPress 5.1)
134+
- name: PHP unit tests (7.0, WordPress 5.3)
134135
php: "7.0"
135-
env: WP_VERSION=5.1 DEV_LIB_ONLY=phpunit
136+
env: WP_VERSION=5.3 DEV_LIB_ONLY=phpunit
136137

137-
- name: PHP unit tests (5.6, WordPress 5.0)
138+
- name: PHP unit tests (5.6, WordPress 5.2)
138139
php: "5.6"
139-
env: WP_VERSION=5.0 DEV_LIB_ONLY=phpunit
140+
env: WP_VERSION=5.2 DEV_LIB_ONLY=phpunit
140141

141142
- name: PHP unit tests (7.4, WordPress trunk)
142143
php: "7.4"

assets/css/src/customize-controls.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325

326326
& span {
327327
font-size: 13px;
328+
329+
&.dashicons {
330+
font-size: 20px;
331+
}
328332
}
329333

330334
&.control-settings-expanded {

assets/css/src/overrides.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,22 @@ html {
6262
@mixin typography body1, 1, 1.5, 400, *;
6363
@mixin typography body2, 0.875, 1.25, 400, *;
6464

65-
/* Additional selectors requiring typoghraphy styles */
65+
/* Additional selectors requiring typography styles */
66+
@mixin selector-typography .mdc-button, button, 0.875, 2.25, 500;
67+
@mixin selector-typography .mdc-button .mdc-button__label, button, 0.875, 2.25, 500;
6668
@mixin selector-typography .mdc-list-item__primary-text, body1, 1, 1.5, 400;
6769
@mixin selector-typography .mdc-list-item__secondary-text, body2, 0.875, 1.25, 400;
6870

71+
/* Material Design Icons */
72+
.material-icons {
73+
font-family: var(--mdc-icons-font-family) !important;
74+
font-weight: normal;
75+
font-size: 24px;
76+
font-style: normal;
77+
line-height: 1 !important;
78+
letter-spacing: normal;
79+
}
80+
6981
/* Button */
7082
.mdc-button {
7183
box-shadow: none !important;
@@ -90,6 +102,10 @@ html {
90102
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12) !important;
91103
transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
92104
}
105+
106+
& .mdc-button__icon {
107+
font-size: 18px !important;
108+
}
93109
}
94110

95111
.mdc-button--outlined:not(:disabled) {

assets/src/block-editor/blocks/list/components/list-item.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
* WordPress dependencies
1919
*/
2020
import { findDOMNode, useEffect, useRef } from '@wordpress/element';
21-
import { create, insert } from '@wordpress/rich-text';
21+
import {
22+
create,
23+
insert,
24+
__experimentalRichText as RichText,
25+
} from '@wordpress/rich-text';
2226
import { __ } from '@wordpress/i18n';
2327

2428
/**
2529
* Internal dependencies
2630
*/
27-
import {
28-
RichText,
29-
isExperimentalRichText,
30-
} from '../../../components/polyfills';
3131
import { useStateCallback } from '../../../helpers/hooks';
3232

3333
/**
@@ -246,14 +246,6 @@ const ListItem = ( {
246246
// Noop function.
247247
const noop = () => {};
248248

249-
const richTextProps = ! isExperimentalRichText
250-
? {
251-
selectionStart: rangeStartRef.current,
252-
selectionEnd: rangeStartRef.current,
253-
onSelectionChange,
254-
}
255-
: { onSelectionChange: noop };
256-
257249
return (
258250
<li className="mdc-list-item">
259251
{ 'leading' === iconPosition && (
@@ -273,7 +265,7 @@ const ListItem = ( {
273265
unstableOnFocus={ () => onFocus( index ) }
274266
className="rich-text block-editor-rich-text__editable"
275267
__unstableIsSelected={ isPrimarySelected }
276-
{ ...richTextProps }
268+
onSelectionChange={ onSelectionChange }
277269
/>
278270
</span>
279271

@@ -293,7 +285,7 @@ const ListItem = ( {
293285
className="rich-text block-editor-rich-text__editable"
294286
placeholder={ __( 'Secondary text…', 'material-design' ) }
295287
__unstableIsSelected={ isSecondarySelected }
296-
{ ...richTextProps }
288+
onSelectionChange={ onSelectionChange }
297289
/>
298290
</span>
299291
) }

assets/src/block-editor/blocks/tab-bar/components/tab.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const Tab = ( {
7070
tagName={ 'span' }
7171
placeholder={ __( 'Tab Title', 'material-design' ) }
7272
value={ label }
73+
onFocus={ onChange }
7374
onChange={ value => onInput( value, index ) }
7475
withoutInteractiveFormatting
7576
allowedFormats={ [] }

assets/src/block-editor/blocks/tab-bar/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
min-width: 50px !important;
4545
}
4646

47-
&__delete {
47+
&__delete.material-icons {
4848
position: absolute;
4949
top: calc(50% - 7.5px);
5050
display: none;
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
export {
2-
default as RichText,
3-
isExperimental as isExperimentalRichText,
4-
} from './rich-text';
51
export { default as ToolbarGroup } from './toolbar-group';

assets/src/block-editor/components/polyfills/rich-text.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

assets/src/customizer/components/google-fonts-control/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ const GoogleFontsControl = props => {
157157
isLink
158158
label={ __( 'View more options', 'material-design' ) }
159159
showTooltip={ true }
160-
icon="admin-settings"
161160
className="control-settings-expanded google-fonts-control-settings-expanded"
162161
onClick={ handleClick }
163-
/>
162+
>
163+
<span className="dashicons dashicons-admin-settings"></span>
164+
</Button>
164165
</span>
165166
</div>
166167

0 commit comments

Comments
 (0)