@automattic/newspack-blocks 1.66.0 → 1.66.1
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/a46463b55ff02a8600edfde4e0e8207e.json.gz +0 -0
- package/.cache/babel/fe99fe0bebf3e9d74bb240487620bdd4.json.gz +0 -0
- package/CHANGELOG.md +7 -0
- package/dist/carousel/view.asset.php +1 -1
- package/dist/carousel/view.js +1 -1
- package/dist/editor.asset.php +1 -1
- package/dist/editor.js +3 -3
- package/newspack-blocks.php +2 -2
- package/package.json +1 -1
- package/src/blocks/carousel/edit.js +2 -2
- package/src/blocks/carousel/view.js +29 -18
- 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/8873287208a39ceacc6e9b47d9649dff.json.gz +0 -0
- package/.cache/babel/adbaeb5ddf5612b3dcd233a3f6f17bf2.json.gz +0 -0
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.66.
|
|
10
|
+
* Version: 1.66.1
|
|
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.66.
|
|
18
|
+
define( 'NEWSPACK_BLOCKS__VERSION', '1.66.1' );
|
|
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
|
@@ -99,6 +99,7 @@ class Edit extends Component {
|
|
|
99
99
|
if ( latestPosts && this.swiperInstance.realIndex < latestPosts.length ) {
|
|
100
100
|
initialSlide = this.swiperInstance.realIndex;
|
|
101
101
|
}
|
|
102
|
+
this.setState( { swiperInitialized: false } );
|
|
102
103
|
this.swiperInstance.destroy( true, true );
|
|
103
104
|
}
|
|
104
105
|
|
|
@@ -115,7 +116,6 @@ class Edit extends Component {
|
|
|
115
116
|
|
|
116
117
|
if ( latestPosts && latestPosts.length ) {
|
|
117
118
|
const { aspectRatio, autoplay, delay, slidesPerView } = this.props.attributes;
|
|
118
|
-
|
|
119
119
|
const swiperInstance = createSwiper(
|
|
120
120
|
{
|
|
121
121
|
block: this.carouselRef.current, // Editor uses the same wrapper for block and swiper container.
|
|
@@ -240,7 +240,7 @@ class Edit extends Component {
|
|
|
240
240
|
<div style={ { margin: 'auto' } }>{ __( 'Sorry, no posts were found.' ) }</div>
|
|
241
241
|
</Placeholder>
|
|
242
242
|
) }
|
|
243
|
-
{ ! latestPosts && (
|
|
243
|
+
{ ( ! this.state.swiperInitialized || ! latestPosts ) && (
|
|
244
244
|
<Placeholder icon={ <Spinner /> } className="component-placeholder__align-center" />
|
|
245
245
|
) }
|
|
246
246
|
{ latestPosts && (
|
|
@@ -15,26 +15,37 @@ if ( typeof window !== 'undefined' ) {
|
|
|
15
15
|
document.querySelectorAll( '.wp-block-newspack-blocks-carousel' )
|
|
16
16
|
);
|
|
17
17
|
blocksArray.forEach( block => {
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
// Initialize Swiper only when the carousel becomes visible.
|
|
19
|
+
const observer = new IntersectionObserver(
|
|
20
|
+
entries => {
|
|
21
|
+
entries.forEach( entry => {
|
|
22
|
+
if ( entry.isIntersecting ) {
|
|
23
|
+
const slidesPerView = parseInt( block.dataset.slidesPerView );
|
|
24
|
+
const slideCount = parseInt( block.dataset.slideCount );
|
|
25
|
+
createSwiper(
|
|
26
|
+
{
|
|
27
|
+
block,
|
|
28
|
+
container: block.querySelector( '.swiper' ),
|
|
29
|
+
prev: block.querySelector( '.swiper-button-prev' ),
|
|
30
|
+
next: block.querySelector( '.swiper-button-next' ),
|
|
31
|
+
pagination: block.querySelector( '.swiper-pagination-bullets' ),
|
|
32
|
+
pause: block.querySelector( '.swiper-button-pause' ),
|
|
33
|
+
play: block.querySelector( '.swiper-button-play' ),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
aspectRatio: parseFloat( block.dataset.aspectRatio ),
|
|
37
|
+
autoplay: !! parseInt( block.dataset.autoplay ),
|
|
38
|
+
delay: parseInt( block.dataset.autoplay_delay ) * 1000,
|
|
39
|
+
slidesPerView: slidesPerView <= slideCount ? slidesPerView : slideCount,
|
|
40
|
+
spaceBetween: 16,
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
} );
|
|
29
45
|
},
|
|
30
|
-
{
|
|
31
|
-
aspectRatio: parseFloat( block.dataset.aspectRatio ),
|
|
32
|
-
autoplay: !! parseInt( block.dataset.autoplay ),
|
|
33
|
-
delay: parseInt( block.dataset.autoplay_delay ) * 1000,
|
|
34
|
-
slidesPerView: slidesPerView <= slideCount ? slidesPerView : slideCount,
|
|
35
|
-
spaceBetween: 16,
|
|
36
|
-
}
|
|
46
|
+
{ threshold: 0.25 }
|
|
37
47
|
);
|
|
48
|
+
observer.observe( block );
|
|
38
49
|
} );
|
|
39
50
|
} );
|
|
40
51
|
}
|
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 ComposerAutoloaderInita284b8440ce7cae45448aa4583a3feee
|
|
6
6
|
{
|
|
7
7
|
private static $loader;
|
|
8
8
|
|
|
@@ -22,12 +22,12 @@ class ComposerAutoloaderInitba98d80c961f6c191c5abfe2b7fcd260
|
|
|
22
22
|
return self::$loader;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
spl_autoload_register(array('
|
|
25
|
+
spl_autoload_register(array('ComposerAutoloaderInita284b8440ce7cae45448aa4583a3feee', 'loadClassLoader'), true, true);
|
|
26
26
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
|
27
|
-
spl_autoload_unregister(array('
|
|
27
|
+
spl_autoload_unregister(array('ComposerAutoloaderInita284b8440ce7cae45448aa4583a3feee', 'loadClassLoader'));
|
|
28
28
|
|
|
29
29
|
require __DIR__ . '/autoload_static.php';
|
|
30
|
-
call_user_func(\Composer\Autoload\
|
|
30
|
+
call_user_func(\Composer\Autoload\ComposerStaticInita284b8440ce7cae45448aa4583a3feee::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 ComposerStaticInita284b8440ce7cae45448aa4583a3feee
|
|
8
8
|
{
|
|
9
9
|
public static $classMap = array (
|
|
10
10
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
@@ -13,7 +13,7 @@ class ComposerStaticInitba98d80c961f6c191c5abfe2b7fcd260
|
|
|
13
13
|
public static function getInitializer(ClassLoader $loader)
|
|
14
14
|
{
|
|
15
15
|
return \Closure::bind(function () use ($loader) {
|
|
16
|
-
$loader->classMap =
|
|
16
|
+
$loader->classMap = ComposerStaticInita284b8440ce7cae45448aa4583a3feee::$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' => '24f3c8000d251f2272fc09d8ba7837108751506d',
|
|
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' => '24f3c8000d251f2272fc09d8ba7837108751506d',
|
|
17
17
|
'type' => 'wordpress-plugin',
|
|
18
18
|
'install_path' => __DIR__ . '/../../',
|
|
19
19
|
'aliases' => array(),
|
|
Binary file
|
|
Binary file
|