Skip to content

Commit 5d58c49

Browse files
authored
Update newspack blocks 4.5.2 → 4.7.0 (#42223)
There are multiple changes here, including: * Renaming the carousel block: Post Carousel → Content Carousel * Reorganise the settings panel * Fix for issue with overlapping featured images (Automattic/newspack-blocks#1826) * Various other bugfixes
1 parent 1c7f35a commit 5d58c49

24 files changed

+937
-761
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Newspack Blocks: Updated from v4.5.2 → 4.7.0

projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', Jetpack_Mu_Wpcom::BASE_DIR . 'build/' );
1313
define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
14-
define( 'NEWSPACK_BLOCKS__VERSION', 'v4.5.2' );
14+
define( 'NEWSPACK_BLOCKS__VERSION', 'v4.7.0' );
1515

1616
require_once __DIR__ . '/../../utils.php';
1717
require_once __DIR__ . '/synced-newspack-blocks/class-newspack-blocks.php';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"name": "carousel",
3+
"category": "newspack",
4+
"apiVersion": 3,
5+
"attributes": {
6+
"className": {
7+
"type": "string",
8+
"default": ""
9+
},
10+
"imageFit": {
11+
"type": "string",
12+
"default": "cover"
13+
},
14+
"autoplay": {
15+
"type": "boolean",
16+
"default": false
17+
},
18+
"delay": {
19+
"type": "number",
20+
"default": 5
21+
},
22+
"postsToShow": {
23+
"type": "integer",
24+
"default": 3
25+
},
26+
"authors": {
27+
"type": "array"
28+
},
29+
"categories": {
30+
"type": "array"
31+
},
32+
"includeSubcategories": {
33+
"type": "boolean",
34+
"default": true
35+
},
36+
"tags": {
37+
"type": "array"
38+
},
39+
"customTaxonomies": {
40+
"type": "array"
41+
},
42+
"showDate": {
43+
"type": "boolean",
44+
"default": true
45+
},
46+
"showAuthor": {
47+
"type": "boolean",
48+
"default": true
49+
},
50+
"showAvatar": {
51+
"type": "boolean",
52+
"default": true
53+
},
54+
"showCaption": {
55+
"type": "boolean",
56+
"default": false
57+
},
58+
"showCredit": {
59+
"type": "boolean",
60+
"default": false
61+
},
62+
"showCategory": {
63+
"type": "boolean",
64+
"default": false
65+
},
66+
"showTitle": {
67+
"type": "boolean",
68+
"default": true
69+
},
70+
"postType": {
71+
"type": "array",
72+
"default": [
73+
"post"
74+
],
75+
"items": {
76+
"type": "string"
77+
}
78+
},
79+
"specificMode": {
80+
"type": "boolean",
81+
"default": false
82+
},
83+
"specificPosts": {
84+
"type": "array",
85+
"default": [],
86+
"items": {
87+
"type": "integer"
88+
}
89+
},
90+
"slidesPerView": {
91+
"type": "number",
92+
"default": 1
93+
},
94+
"hideControls": {
95+
"type": "boolean",
96+
"default": false
97+
},
98+
"aspectRatio": {
99+
"type": "number",
100+
"default": 0.75
101+
},
102+
"includedPostStatuses": {
103+
"type": "array",
104+
"default": [
105+
"publish"
106+
],
107+
"items": {
108+
"type": "string"
109+
}
110+
}
111+
},
112+
"textdomain": "jetpack-mu-wpcom"
113+
}

projects/packages/jetpack-mu-wpcom/src/features/newspack-blocks/synced-newspack-blocks/blocks/carousel/create-swiper.js

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ export default function createSwiper( els, config = {} ) {
135135
},
136136

137137
slideChange() {
138+
if ( this.slides.length < 1 ) {
139+
return; // No slides, no need to do anything.
140+
}
138141
const currentSlide = this.slides[ this.activeIndex ];
139142

140143
deactivateSlide( this.slides[ this.previousIndex ] );

0 commit comments

Comments
 (0)