Skip to content

Commit 775e1f1

Browse files
emeaguiarravichdev
authored andcommitted
Merge branch 'develop' into feature/5-curated-post-types
2 parents 2e29344 + 2c36f49 commit 775e1f1

File tree

19 files changed

+164
-47
lines changed

19 files changed

+164
-47
lines changed

.github/workflows/lint-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ jobs:
5656
- name: Build assets
5757
run: npm run build:js
5858

59+
- name: Sleep for 10 seconds
60+
uses: jakejarvis/wait-action@master
61+
with:
62+
time: '10s'
63+
5964
- name: Start docker local env
6065
run: |
6166
npm run env:start

Gruntfile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ module.exports = function( grunt ) {
3131
'!plugin/**/._.DS_Store',
3232
'!plugin/**/.DS_Store',
3333
'!plugin/assets/css/src/**',
34+
'!plugin/assets/css/*.map',
3435
'!plugin/assets/js/.gitignore',
36+
'!plugin/assets/js/*.css',
37+
'!plugin/assets/js/*.map',
3538
'!plugin/assets/src/**',
3639
'!plugin/assets/images/png/**',
3740
'!plugin/assets/images/jpg/**',
@@ -81,6 +84,7 @@ module.exports = function( grunt ) {
8184
'!theme/assets/js/.gitignore',
8285
'!theme/assets/js/*.php',
8386
'!theme/assets/js/*.map',
87+
'!theme/assets/js/editor*',
8488
'!theme/assets/src/**',
8589
'!theme/tests/**',
8690
'!theme/wp-assets/**',
@@ -194,6 +198,7 @@ module.exports = function( grunt ) {
194198
const iconArray = item.split( /\s/g );
195199

196200
icons.icons[ iconArray[ 1 ] ] = {
201+
id: iconArray[ 1 ],
197202
name: iconArray[ 0 ],
198203
};
199204
} );
@@ -208,7 +213,7 @@ module.exports = function( grunt ) {
208213

209214
grunt.registerTask( 'readme', [ 'shell:readme' ] );
210215

211-
grunt.registerTask( 'build', [ 'readme', 'copy', 'icon_mapping' ] );
216+
grunt.registerTask( 'build', [ 'readme', 'icon_mapping', 'copy' ] );
212217

213218
grunt.registerTask( 'create-build-zip', [
214219
'shell:create_plugin_zip',

package-lock.json

Lines changed: 35 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"devDependencies": {
2626
"@babel/cli": "7.8.4",
2727
"@babel/core": "7.8.4",
28-
"@babel/preset-env": "7.11.5",
2928
"@babel/plugin-proposal-optional-chaining": "7.8.3",
3029
"@babel/plugin-transform-react-jsx": "7.8.3",
30+
"@babel/preset-env": "7.11.5",
3131
"@material/button": "5.1.0",
3232
"@material/card": "5.1.0",
3333
"@material/checkbox": "5.1.0",
@@ -44,8 +44,8 @@
4444
"@material/switch": "6.0.0",
4545
"@material/tab-bar": "5.1.0",
4646
"@material/textfield": "5.1.0",
47-
"@material/top-app-bar": "5.1.0",
4847
"@material/tooltip": "8.0.0",
48+
"@material/top-app-bar": "5.1.0",
4949
"@material/typography": "5.1.0",
5050
"@sheerun/mutationobserver-shim": "0.3.3",
5151
"@testing-library/dom": "7.2.2",
@@ -123,7 +123,7 @@
123123
"postcss-import": "12.0.1",
124124
"postcss-loader": "3.0.0",
125125
"postcss-mixins": "6.2.3",
126-
"postcss-nested": "4.2.1",
126+
"postcss-nested": "4.2.3",
127127
"postcss-preset-env": "6.7.0",
128128
"postcss-simple-vars": "5.0.2",
129129
"prettier": "npm:[email protected]",
@@ -148,7 +148,7 @@
148148
"scripts": {
149149
"build": "npm-run-all build:*",
150150
"build:prepare": "grunt clean",
151-
"build:js": "wp-scripts build",
151+
"build:js": "NODE_ENV=dev wp-scripts build && wp-scripts build",
152152
"build:run": "grunt build",
153153
"build:zip": "grunt create-build-zip",
154154
"deploy": "npm run build && grunt deploy",

plugin/assets/fonts/icons.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

plugin/assets/src/block-editor/blocks/card/components/card-image-edit.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@ const CardImageEdit = ( {
116116
[ `material-design-card-with-${ contentLayout }` ]: contentLayout,
117117
}
118118
) }
119-
style={ { backgroundImage: `url(${ imageSourceUrl })` } }
120119
>
120+
<img
121+
src={ imageSourceUrl }
122+
alt={ cardPrimaryProps.title || '' }
123+
/>
121124
{ contentLayout === 'text-over-media' && (
122125
<div className="mdc-card__media-content">
123126
<CardPrimary { ...cardPrimaryProps } />

plugin/assets/src/block-editor/blocks/card/components/card-primary.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const CardPrimary = ( {
5353
value={ title }
5454
onChange={ value => setter( 'title', value, cardIndex ) }
5555
placeholder={ __( 'Title goes here', 'material-design' ) }
56-
place
5756
/>
5857
) }
5958
{ displaySecondaryText && (

plugin/assets/src/block-editor/blocks/common-posts-list/style.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,22 @@
8888
text-decoration: none !important;
8989
}
9090
text-decoration: none !important;
91-
9291
}
9392

9493
.mdc-button__comment-count {
9594
justify-content: left !important;
9695
min-width: 36px !important;
9796
}
97+
98+
.mdc-card__media {
99+
100+
& img {
101+
bottom: 0;
102+
height: 100%;
103+
left: 0;
104+
object-fit: cover;
105+
position: absolute;
106+
top: 0;
107+
width: 100%;
108+
}
109+
}

plugin/php/templates/partials/card-image.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@
4747

4848
if ( ! empty( $featured_image ) ) :
4949
?>
50-
<div
51-
class="<?php echo esc_attr( Template::classnames( $class_names ) ); ?>"
52-
style="background-image: url(<?php echo esc_url( $featured_image ); ?>)"
53-
>
50+
<div class="<?php echo esc_attr( Template::classnames( $class_names ) ); ?>">
51+
<?php echo get_the_post_thumbnail( get_the_ID(), 'list' === $style ? 'medium' : 'large' ); ?>
5452
<?php
5553
if ( 'text-over-media' === $layout ) {
5654
?>

plugin/tests/js/block-editor/blocks/card/__snapshots__/edit.test.js.snap

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,13 @@ Object {
574574
>
575575
<div
576576
class="mdc-card__media mdc-card__media--16-9 material-design-card__media material-design-card-with-text-under-media"
577-
style="background-image: url(http://test.loc/test.jpg);"
578577
tabindex="0"
579-
/>
578+
>
579+
<img
580+
alt="Test title"
581+
src="http://test.loc/test.jpg"
582+
/>
583+
</div>
580584
</div>
581585
<div
582586
class="material-design-card__primary"
@@ -1202,9 +1206,13 @@ Object {
12021206
>
12031207
<div
12041208
class="mdc-card__media mdc-card__media--16-9 material-design-card__media material-design-card-with-text-under-media"
1205-
style="background-image: url(http://test.loc/test.jpg);"
12061209
tabindex="0"
1207-
/>
1210+
>
1211+
<img
1212+
alt="Test title"
1213+
src="http://test.loc/test.jpg"
1214+
/>
1215+
</div>
12081216
</div>
12091217
<div
12101218
class="material-design-card__primary"
@@ -1911,9 +1919,13 @@ Object {
19111919
>
19121920
<div
19131921
class="mdc-card__media mdc-card__media--16-9 material-design-card__media material-design-card-with-text-under-media"
1914-
style="background-image: url(http://test.loc/test.jpg);"
19151922
tabindex="0"
1916-
/>
1923+
>
1924+
<img
1925+
alt="Test title"
1926+
src="http://test.loc/test.jpg"
1927+
/>
1928+
</div>
19171929
</div>
19181930
<div
19191931
class="material-design-card__primary"
@@ -2539,9 +2551,13 @@ Object {
25392551
>
25402552
<div
25412553
class="mdc-card__media mdc-card__media--16-9 material-design-card__media material-design-card-with-text-under-media"
2542-
style="background-image: url(http://test.loc/test.jpg);"
25432554
tabindex="0"
2544-
/>
2555+
>
2556+
<img
2557+
alt="Test title"
2558+
src="http://test.loc/test.jpg"
2559+
/>
2560+
</div>
25452561
</div>
25462562
<div
25472563
class="material-design-card__primary"
@@ -3248,9 +3264,13 @@ Object {
32483264
>
32493265
<div
32503266
class="mdc-card__media mdc-card__media--square material-design-card__media material-design-card-with-text-under-media"
3251-
style="background-image: url(http://test.loc/test.jpg);"
32523267
tabindex="0"
3253-
/>
3268+
>
3269+
<img
3270+
alt="Test title"
3271+
src="http://test.loc/test.jpg"
3272+
/>
3273+
</div>
32543274
</div>
32553275
<div
32563276
class="material-design-card__primary"
@@ -3867,9 +3887,13 @@ Object {
38673887
>
38683888
<div
38693889
class="mdc-card__media mdc-card__media--square material-design-card__media material-design-card-with-text-under-media"
3870-
style="background-image: url(http://test.loc/test.jpg);"
38713890
tabindex="0"
3872-
/>
3891+
>
3892+
<img
3893+
alt="Test title"
3894+
src="http://test.loc/test.jpg"
3895+
/>
3896+
</div>
38733897
</div>
38743898
<div
38753899
class="material-design-card__primary"

0 commit comments

Comments
 (0)