@automattic/newspack-blocks 1.61.0 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cache/babel/{6d58c3cff70fc3403def6dc49787b3fe.json.gz → 8873287208a39ceacc6e9b47d9649dff.json.gz} +0 -0
- package/.cache/babel/a1dde270d38efa30dfbbfe2b97be9e51.json.gz +0 -0
- package/.cache/babel/ae0944270a644af5be09780d8243f357.json.gz +0 -0
- package/CHANGELOG.md +24 -0
- package/composer.lock +21 -21
- package/dist/carousel/view.asset.php +1 -1
- package/dist/carousel/view.css +1 -1
- package/dist/carousel/view.rtl.css +1 -1
- package/dist/editor.asset.php +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.js +1 -1
- package/dist/editor.rtl.css +1 -1
- package/includes/class-newspack-blocks-api.php +1 -0
- package/newspack-blocks.php +2 -2
- package/package.json +3 -3
- package/src/blocks/carousel/edit.js +1 -1
- package/src/blocks/homepage-articles/block.json +172 -168
- package/src/blocks/homepage-articles/edit.js +1 -16
- package/src/blocks/homepage-articles/templates/article.php +4 -1
- package/vendor/autoload.php +1 -1
- package/vendor/composer/autoload_real.php +4 -4
- package/vendor/composer/autoload_static.php +2 -2
- package/vendor/composer/installed.php +2 -2
- package/.cache/babel/8eefb50c58e953f25296f07c07c40445.json.gz +0 -0
- package/.cache/babel/dd70bbfe108da5e2fc7bd73bc688a05a.json.gz +0 -0
|
@@ -301,6 +301,7 @@ class Newspack_Blocks_API {
|
|
|
301
301
|
'rendered' => post_password_required( $post ) ? '' : $content,
|
|
302
302
|
],
|
|
303
303
|
'date_gmt' => mysql_to_rfc3339( $post_date_gmt ),
|
|
304
|
+
'date' => mysql_to_rfc3339( $post->post_date ),
|
|
304
305
|
'excerpt' => [
|
|
305
306
|
'rendered' => post_password_required( $post ) ? '' : $excerpt,
|
|
306
307
|
],
|
package/newspack-blocks.php
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Author URI: https://newspack.blog/
|
|
8
8
|
* Text Domain: newspack-blocks
|
|
9
9
|
* Domain Path: /languages
|
|
10
|
-
* Version: 1.
|
|
10
|
+
* Version: 1.62.0
|
|
11
11
|
*
|
|
12
12
|
* @package Newspack_Blocks
|
|
13
13
|
*/
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
define( 'NEWSPACK_BLOCKS__PLUGIN_FILE', __FILE__ );
|
|
16
16
|
define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
|
|
17
17
|
define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( NEWSPACK_BLOCKS__PLUGIN_FILE ) );
|
|
18
|
-
define( 'NEWSPACK_BLOCKS__VERSION', '1.
|
|
18
|
+
define( 'NEWSPACK_BLOCKS__VERSION', '1.62.0' );
|
|
19
19
|
|
|
20
20
|
require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks.php';
|
|
21
21
|
require_once NEWSPACK_BLOCKS__PLUGIN_DIR . 'includes/class-newspack-blocks-api.php';
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/newspack-blocks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.62.0",
|
|
4
4
|
"author": "Automattic",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@rushstack/eslint-patch": "^1.2.0",
|
|
7
|
-
"@testing-library/dom": "^8.
|
|
7
|
+
"@testing-library/dom": "^8.20.0",
|
|
8
8
|
"@testing-library/user-event": "^14.4.3",
|
|
9
9
|
"@types/lodash": "^4.14.191",
|
|
10
10
|
"@types/lodash.debounce": "^4.0.7",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"redux": "^4.2.0",
|
|
29
29
|
"redux-saga": "^1.2.2",
|
|
30
30
|
"regenerator-runtime": "^0.13.11",
|
|
31
|
-
"swiper": "8.4.
|
|
31
|
+
"swiper": "8.4.6"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"cm": "newspack-scripts commit",
|
|
@@ -331,7 +331,7 @@ class Edit extends Component {
|
|
|
331
331
|
formatByline( post.newspack_author_info ) }
|
|
332
332
|
{ showDate && (
|
|
333
333
|
<time className="entry-date published" key="pub-date">
|
|
334
|
-
{ dateI18n( dateFormat, post.
|
|
334
|
+
{ dateI18n( dateFormat, post.date ) }
|
|
335
335
|
</time>
|
|
336
336
|
) }
|
|
337
337
|
</div>
|
|
@@ -1,170 +1,174 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
2
|
+
"name": "homepage-articles",
|
|
3
|
+
"category": "newspack",
|
|
4
|
+
"attributes": {
|
|
5
|
+
"className": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"default": ""
|
|
8
|
+
},
|
|
9
|
+
"showExcerpt": {
|
|
10
|
+
"type": "boolean",
|
|
11
|
+
"default": true
|
|
12
|
+
},
|
|
13
|
+
"excerptLength": {
|
|
14
|
+
"type": "number",
|
|
15
|
+
"default": 55
|
|
16
|
+
},
|
|
17
|
+
"showReadMore": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": false
|
|
20
|
+
},
|
|
21
|
+
"readMoreLabel": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"default": "Keep reading"
|
|
24
|
+
},
|
|
25
|
+
"showDate": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": true
|
|
28
|
+
},
|
|
29
|
+
"showImage": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"default": true
|
|
32
|
+
},
|
|
33
|
+
"showCaption": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"default": false
|
|
36
|
+
},
|
|
37
|
+
"disableImageLazyLoad": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"default": false
|
|
40
|
+
},
|
|
41
|
+
"fetchPriority": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"default": ""
|
|
44
|
+
},
|
|
45
|
+
"imageShape": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"default": "landscape"
|
|
48
|
+
},
|
|
49
|
+
"minHeight": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"default": 0
|
|
52
|
+
},
|
|
53
|
+
"moreButton": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"default": false
|
|
56
|
+
},
|
|
57
|
+
"moreButtonText": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"default": ""
|
|
60
|
+
},
|
|
61
|
+
"showAuthor": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"default": true
|
|
64
|
+
},
|
|
65
|
+
"showAvatar": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"default": true
|
|
68
|
+
},
|
|
69
|
+
"showCategory": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"default": false
|
|
72
|
+
},
|
|
73
|
+
"postLayout": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"default": "list"
|
|
76
|
+
},
|
|
77
|
+
"columns": {
|
|
78
|
+
"type": "integer",
|
|
79
|
+
"default": 3
|
|
80
|
+
},
|
|
81
|
+
"colGap": {
|
|
82
|
+
"type": "integer",
|
|
83
|
+
"default": 3
|
|
84
|
+
},
|
|
85
|
+
"postsToShow": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"default": 3
|
|
88
|
+
},
|
|
89
|
+
"mediaPosition": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"default": "top"
|
|
92
|
+
},
|
|
93
|
+
"authors": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"default": [],
|
|
96
|
+
"items": { "type": "integer" }
|
|
97
|
+
},
|
|
98
|
+
"categories": {
|
|
99
|
+
"type": "array",
|
|
100
|
+
"default": [],
|
|
101
|
+
"items": { "type": "integer" }
|
|
102
|
+
},
|
|
103
|
+
"tags": {
|
|
104
|
+
"type": "array",
|
|
105
|
+
"default": [],
|
|
106
|
+
"items": { "type": "integer" }
|
|
107
|
+
},
|
|
108
|
+
"tagExclusions": {
|
|
109
|
+
"type": "array",
|
|
110
|
+
"default": [],
|
|
111
|
+
"items": { "type": "integer" }
|
|
112
|
+
},
|
|
113
|
+
"categoryExclusions": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"default": [],
|
|
116
|
+
"items": { "type": "integer" }
|
|
117
|
+
},
|
|
118
|
+
"specificPosts": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"default": [],
|
|
121
|
+
"items": { "type": "integer" }
|
|
122
|
+
},
|
|
123
|
+
"typeScale": {
|
|
124
|
+
"type": "integer",
|
|
125
|
+
"default": 4
|
|
126
|
+
},
|
|
127
|
+
"imageScale": {
|
|
128
|
+
"type": "integer",
|
|
129
|
+
"default": 3
|
|
130
|
+
},
|
|
131
|
+
"mobileStack": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"default": false
|
|
134
|
+
},
|
|
135
|
+
"sectionHeader": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"default": ""
|
|
138
|
+
},
|
|
139
|
+
"specificMode": {
|
|
140
|
+
"type": "boolean",
|
|
141
|
+
"default": false
|
|
142
|
+
},
|
|
143
|
+
"textColor": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"default": ""
|
|
146
|
+
},
|
|
147
|
+
"customTextColor": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"default": ""
|
|
150
|
+
},
|
|
151
|
+
"singleMode": {
|
|
152
|
+
"type": "boolean",
|
|
153
|
+
"default": false
|
|
154
|
+
},
|
|
155
|
+
"showSubtitle": {
|
|
156
|
+
"type": "boolean",
|
|
157
|
+
"default": false
|
|
158
|
+
},
|
|
159
|
+
"postType": {
|
|
160
|
+
"type": "array",
|
|
161
|
+
"default": [ "post" ],
|
|
162
|
+
"items": { "type": "string" }
|
|
163
|
+
},
|
|
164
|
+
"textAlign": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"default": "left"
|
|
167
|
+
},
|
|
168
|
+
"includedPostStatuses": {
|
|
169
|
+
"type": "array",
|
|
170
|
+
"default": [ "publish" ],
|
|
171
|
+
"items": { "type": "string" }
|
|
172
|
+
}
|
|
173
|
+
}
|
|
170
174
|
}
|
|
@@ -237,7 +237,7 @@ class Edit extends Component {
|
|
|
237
237
|
|
|
238
238
|
{ showDate && ! post.newspack_listings_hide_publish_date && (
|
|
239
239
|
<time className="entry-date published" key="pub-date">
|
|
240
|
-
{ dateI18n( dateFormat, post.
|
|
240
|
+
{ dateI18n( dateFormat, post.date ) }
|
|
241
241
|
</time>
|
|
242
242
|
) }
|
|
243
243
|
</div>
|
|
@@ -271,7 +271,6 @@ class Edit extends Component {
|
|
|
271
271
|
postType,
|
|
272
272
|
showImage,
|
|
273
273
|
showCaption,
|
|
274
|
-
disableImageLazyLoad,
|
|
275
274
|
imageScale,
|
|
276
275
|
mobileStack,
|
|
277
276
|
minHeight,
|
|
@@ -450,20 +449,6 @@ class Edit extends Component {
|
|
|
450
449
|
</PanelRow>
|
|
451
450
|
) }
|
|
452
451
|
|
|
453
|
-
{ showImage && (
|
|
454
|
-
<PanelRow>
|
|
455
|
-
<ToggleControl
|
|
456
|
-
label={ __( 'Disable Featured Image Lazy Loading', 'newspack-blocks' ) }
|
|
457
|
-
help={ __(
|
|
458
|
-
'Improve Largest Contentful Paint (LCP) score if the block is on initial viewport.',
|
|
459
|
-
'newspack-blocks'
|
|
460
|
-
) }
|
|
461
|
-
checked={ disableImageLazyLoad }
|
|
462
|
-
onChange={ () => setAttributes( { disableImageLazyLoad: ! disableImageLazyLoad } ) }
|
|
463
|
-
/>
|
|
464
|
-
</PanelRow>
|
|
465
|
-
) }
|
|
466
|
-
|
|
467
452
|
{ showImage && mediaPosition !== 'top' && mediaPosition !== 'behind' && (
|
|
468
453
|
<Fragment>
|
|
469
454
|
<PanelRow>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
call_user_func(
|
|
10
10
|
function( $data ) {
|
|
11
|
-
$attributes = $data['attributes'];
|
|
11
|
+
$attributes = apply_filters( 'newspack_blocks_homepage_posts_block_attributes', $data['attributes'] );
|
|
12
12
|
$authors = Newspack_Blocks::prepare_authors();
|
|
13
13
|
$classes = array();
|
|
14
14
|
$styles = '';
|
|
@@ -53,6 +53,9 @@ call_user_func(
|
|
|
53
53
|
if ( $attributes['disableImageLazyLoad'] ) {
|
|
54
54
|
$thumbnail_args['loading'] = 'none';
|
|
55
55
|
}
|
|
56
|
+
if ( $attributes['fetchPriority'] && in_array( $attributes['fetchPriority'], [ 'high', 'low', 'auto' ], true ) ) {
|
|
57
|
+
$thumbnail_args['fetchpriority'] = $attributes['fetchPriority'];
|
|
58
|
+
}
|
|
56
59
|
$category = false;
|
|
57
60
|
// Use Yoast primary category if set.
|
|
58
61
|
if ( class_exists( 'WPSEO_Primary_Term' ) ) {
|
package/vendor/autoload.php
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// autoload_real.php @generated by Composer
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class ComposerAutoloaderInitfed483a0b27a6f9cec5c9b8bf07b0858
|
|
6
6
|
{
|
|
7
7
|
private static $loader;
|
|
8
8
|
|
|
@@ -22,12 +22,12 @@ class ComposerAutoloaderInit6c48257b500dde261f28a2d07827bdd6
|
|
|
22
22
|
return self::$loader;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
spl_autoload_register(array('
|
|
25
|
+
spl_autoload_register(array('ComposerAutoloaderInitfed483a0b27a6f9cec5c9b8bf07b0858', 'loadClassLoader'), true, true);
|
|
26
26
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
|
27
|
-
spl_autoload_unregister(array('
|
|
27
|
+
spl_autoload_unregister(array('ComposerAutoloaderInitfed483a0b27a6f9cec5c9b8bf07b0858', 'loadClassLoader'));
|
|
28
28
|
|
|
29
29
|
require __DIR__ . '/autoload_static.php';
|
|
30
|
-
call_user_func(\Composer\Autoload\
|
|
30
|
+
call_user_func(\Composer\Autoload\ComposerStaticInitfed483a0b27a6f9cec5c9b8bf07b0858::getInitializer($loader));
|
|
31
31
|
|
|
32
32
|
$loader->register(true);
|
|
33
33
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
namespace Composer\Autoload;
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class ComposerStaticInitfed483a0b27a6f9cec5c9b8bf07b0858
|
|
8
8
|
{
|
|
9
9
|
public static $classMap = array (
|
|
10
10
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
@@ -13,7 +13,7 @@ class ComposerStaticInit6c48257b500dde261f28a2d07827bdd6
|
|
|
13
13
|
public static function getInitializer(ClassLoader $loader)
|
|
14
14
|
{
|
|
15
15
|
return \Closure::bind(function () use ($loader) {
|
|
16
|
-
$loader->classMap =
|
|
16
|
+
$loader->classMap = ComposerStaticInitfed483a0b27a6f9cec5c9b8bf07b0858::$classMap;
|
|
17
17
|
|
|
18
18
|
}, null, ClassLoader::class);
|
|
19
19
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
'name' => 'automattic/newspack-blocks',
|
|
4
4
|
'pretty_version' => 'dev-master',
|
|
5
5
|
'version' => 'dev-master',
|
|
6
|
-
'reference' => '
|
|
6
|
+
'reference' => '1ea783a6c7ffb2adb5360c6ea9b5619888683ebb',
|
|
7
7
|
'type' => 'wordpress-plugin',
|
|
8
8
|
'install_path' => __DIR__ . '/../../',
|
|
9
9
|
'aliases' => array(),
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
'automattic/newspack-blocks' => array(
|
|
14
14
|
'pretty_version' => 'dev-master',
|
|
15
15
|
'version' => 'dev-master',
|
|
16
|
-
'reference' => '
|
|
16
|
+
'reference' => '1ea783a6c7ffb2adb5360c6ea9b5619888683ebb',
|
|
17
17
|
'type' => 'wordpress-plugin',
|
|
18
18
|
'install_path' => __DIR__ . '/../../',
|
|
19
19
|
'aliases' => array(),
|
|
Binary file
|
|
Binary file
|