@automattic/newspack-blocks 1.68.2 → 1.69.0-alpha.2
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/15387cb771ffa80b113069531d7dbf2a.json.gz +0 -0
- package/.cache/babel/20e776cde824c2a3cb901dca6977367b.json.gz +0 -0
- package/.cache/babel/56046f06a99a61b7847b604a58062e17.json.gz +0 -0
- package/.cache/babel/6444da3051780011261cc12e796a6e36.json.gz +0 -0
- package/.cache/babel/764469c94d0f935d0d48d3b8ca9964ff.json.gz +0 -0
- package/.cache/babel/845433093cc647521f9ed7aada6399c5.json.gz +0 -0
- package/.cache/babel/acff6371a410845f5da464cb4e237aaf.json.gz +0 -0
- package/.cache/babel/f5dc184121cc109a8bc4f20364bd68b5.json.gz +0 -0
- package/CHANGELOG.md +15 -0
- package/composer.lock +12 -12
- package/dist/block_styles.asset.php +1 -1
- package/dist/block_styles.css +1 -1
- package/dist/block_styles.rtl.css +1 -1
- package/dist/carousel/view.asset.php +1 -1
- package/dist/carousel/view.js +1 -1
- package/dist/donate/view.asset.php +1 -1
- package/dist/donate/view.css +1 -1
- package/dist/donate/view.rtl.css +1 -1
- package/dist/donateStreamlined.asset.php +1 -1
- package/dist/donateStreamlined.js +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/dist/homepage-articles/view.asset.php +1 -1
- package/dist/homepage-articles/view.css +1 -1
- package/dist/homepage-articles/view.rtl.css +1 -1
- package/dist/modal.asset.php +1 -1
- package/dist/modal.css +1 -1
- package/dist/modal.js +1 -1
- package/dist/modal.rtl.css +1 -1
- package/includes/class-modal-checkout.php +70 -1
- package/newspack-blocks.php +2 -2
- package/package.json +5 -5
- package/src/block-styles/core/columns/view.scss +2 -8
- package/src/blocks/checkout-button/block.json +7 -0
- package/src/blocks/checkout-button/edit.js +99 -12
- package/src/blocks/checkout-button/save.js +3 -1
- package/src/blocks/checkout-button/view.php +8 -1
- package/src/blocks/donate/styles/style-variations.scss +1 -4
- package/src/blocks/homepage-articles/view.scss +2 -8
- package/src/blocks/video-playlist/editor.scss +1 -4
- package/src/modal-checkout/modal.js +57 -14
- package/src/modal-checkout/modal.scss +57 -4
- package/src/templates/author-profile-card.php +26 -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/0988afa42fd3fe14da7ae43c9d02661e.json.gz +0 -0
- package/.cache/babel/0fc85d33d9c79c26521df1d74d37473e.json.gz +0 -0
- package/.cache/babel/1f75e279f33d30dace0c18b21b746178.json.gz +0 -0
- package/.cache/babel/5ee469cfff0fc7181d9e0db8e1d58cf0.json.gz +0 -0
- package/.cache/babel/6170ac021bca94b65aaf9d91313c47a9.json.gz +0 -0
- package/.cache/babel/66c747a8bdec1ed403f703e47256fa03.json.gz +0 -0
- package/.cache/babel/6b02d0502dfcd8c011a2ba4381ab01f4.json.gz +0 -0
- package/.cache/babel/91e706536d45a88f098e9394344dbeb9.json.gz +0 -0
|
@@ -25,7 +25,8 @@ function domReady( callback ) {
|
|
|
25
25
|
document.addEventListener( 'DOMContentLoaded', callback );
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const triggers =
|
|
28
|
+
const triggers =
|
|
29
|
+
'.wpbnbd.wpbnbd--platform-wc,.wp-block-newspack-blocks-checkout-button,.newspack-blocks-variation-modal';
|
|
29
30
|
|
|
30
31
|
let iframeResizeObserver;
|
|
31
32
|
|
|
@@ -40,6 +41,9 @@ function closeCheckout( element ) {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
domReady( () => {
|
|
44
|
+
/**
|
|
45
|
+
* Initialize modal checkout.
|
|
46
|
+
*/
|
|
43
47
|
const modalCheckout = document.querySelector( '.newspack-blocks-checkout-modal' );
|
|
44
48
|
if ( ! modalCheckout ) {
|
|
45
49
|
return;
|
|
@@ -54,13 +58,64 @@ domReady( () => {
|
|
|
54
58
|
const iframe = document.createElement( 'iframe' );
|
|
55
59
|
iframe.name = iframeName;
|
|
56
60
|
modalContent.appendChild( iframe );
|
|
61
|
+
modalCheckout.addEventListener( 'click', ev => {
|
|
62
|
+
if ( ev.target === modalCheckout ) {
|
|
63
|
+
closeCheckout( modalCheckout );
|
|
64
|
+
}
|
|
65
|
+
} );
|
|
66
|
+
const closeButtons = modalCheckout.querySelectorAll( '.newspack-blocks-checkout-modal__close' );
|
|
67
|
+
closeButtons.forEach( button => {
|
|
68
|
+
button.addEventListener( 'click', ev => {
|
|
69
|
+
ev.preventDefault();
|
|
70
|
+
closeCheckout( modalCheckout );
|
|
71
|
+
} );
|
|
72
|
+
} );
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Variation modals.
|
|
76
|
+
*/
|
|
77
|
+
const variationModals = document.querySelectorAll( '.newspack-blocks-variation-modal' );
|
|
78
|
+
variationModals.forEach( variationModal => {
|
|
79
|
+
variationModal.addEventListener( 'click', ev => {
|
|
80
|
+
if ( ev.target === variationModal ) {
|
|
81
|
+
variationModal.style.display = 'none';
|
|
82
|
+
}
|
|
83
|
+
} );
|
|
84
|
+
variationModal
|
|
85
|
+
.querySelectorAll( '.newspack-blocks-variation-modal__close' )
|
|
86
|
+
.forEach( button => {
|
|
87
|
+
button.addEventListener( 'click', ev => {
|
|
88
|
+
ev.preventDefault();
|
|
89
|
+
variationModal.style.display = 'none';
|
|
90
|
+
} );
|
|
91
|
+
} );
|
|
92
|
+
} );
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Handle triggers.
|
|
96
|
+
*/
|
|
57
97
|
const elements = document.querySelectorAll( triggers );
|
|
58
98
|
elements.forEach( element => {
|
|
59
99
|
const forms = element.querySelectorAll( 'form' );
|
|
60
100
|
forms.forEach( form => {
|
|
61
101
|
form.appendChild( modalCheckoutInput.cloneNode() );
|
|
62
102
|
form.target = iframeName;
|
|
63
|
-
form.addEventListener( 'submit',
|
|
103
|
+
form.addEventListener( 'submit', ev => {
|
|
104
|
+
const formData = new FormData( form );
|
|
105
|
+
// Clear any open variation modal.
|
|
106
|
+
variationModals.forEach( variationModal => ( variationModal.style.display = 'none' ) );
|
|
107
|
+
// Trigger variation modal if variation is not selected.
|
|
108
|
+
if ( formData.get( 'is_variable' ) && ! formData.get( 'variation_id' ) ) {
|
|
109
|
+
const variationModal = [ ...variationModals ].find(
|
|
110
|
+
modal => modal.dataset.productId === formData.get( 'product_id' )
|
|
111
|
+
);
|
|
112
|
+
if ( variationModal ) {
|
|
113
|
+
ev.preventDefault();
|
|
114
|
+
variationModal.style.display = 'block';
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Continue with checkout modal.
|
|
64
119
|
spinner.style.display = 'flex';
|
|
65
120
|
modalCheckout.style.display = 'block';
|
|
66
121
|
document.body.classList.add( 'newspack-modal-checkout-open' );
|
|
@@ -95,16 +150,4 @@ domReady( () => {
|
|
|
95
150
|
} );
|
|
96
151
|
} );
|
|
97
152
|
} );
|
|
98
|
-
modalCheckout.addEventListener( 'click', ev => {
|
|
99
|
-
if ( ev.target === modalCheckout ) {
|
|
100
|
-
closeCheckout( modalCheckout );
|
|
101
|
-
}
|
|
102
|
-
} );
|
|
103
|
-
const closeButtons = modalCheckout.querySelectorAll( '.newspack-blocks-checkout-modal__close' );
|
|
104
|
-
closeButtons.forEach( button => {
|
|
105
|
-
button.addEventListener( 'click', ev => {
|
|
106
|
-
ev.preventDefault();
|
|
107
|
-
closeCheckout( modalCheckout );
|
|
108
|
-
} );
|
|
109
|
-
} );
|
|
110
153
|
} );
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.newspack-blocks-checkout-modal
|
|
16
|
+
.newspack-blocks-checkout-modal,
|
|
17
|
+
.newspack-blocks-variation-modal {
|
|
17
18
|
position: fixed;
|
|
18
19
|
top: 0;
|
|
19
20
|
left: 0;
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
max-height: calc( 100vh - 32px );
|
|
33
34
|
background: colors.$color__background-body;
|
|
34
35
|
border-radius: 5px;
|
|
35
|
-
> *:not( .newspack-blocks-checkout-modal__close ) {
|
|
36
|
+
> *:not( .newspack-blocks-checkout-modal__close, .newspack-blocks-variation-modal__close ) {
|
|
36
37
|
width: 100%;
|
|
37
38
|
height: 100%;
|
|
38
39
|
border: 0;
|
|
@@ -79,8 +80,60 @@
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
.newspack-blocks-variation-modal {
|
|
84
|
+
&__content {
|
|
85
|
+
padding: 32px;
|
|
86
|
+
h3 {
|
|
87
|
+
margin: 0 0 1em;
|
|
88
|
+
}
|
|
89
|
+
p {
|
|
90
|
+
font-size: 0.8em;
|
|
91
|
+
}
|
|
92
|
+
form {
|
|
93
|
+
margin: 0 0 0.5em;
|
|
94
|
+
&:last-child {
|
|
95
|
+
margin: 0;
|
|
96
|
+
}
|
|
97
|
+
button {
|
|
98
|
+
display: block;
|
|
99
|
+
width: 100%;
|
|
100
|
+
padding: 16px;
|
|
101
|
+
margin: 0;
|
|
102
|
+
border: 1px solid colors.$color__border;
|
|
103
|
+
background: transparent;
|
|
104
|
+
color: colors.$color__text-main;
|
|
105
|
+
text-align: inherit;
|
|
106
|
+
font-weight: inherit;
|
|
107
|
+
> span {
|
|
108
|
+
display: block;
|
|
109
|
+
}
|
|
110
|
+
.summary {
|
|
111
|
+
width: 100%;
|
|
112
|
+
display: flex;
|
|
113
|
+
justify-content: space-between;
|
|
114
|
+
align-items: baseline;
|
|
115
|
+
}
|
|
116
|
+
.variation_name {
|
|
117
|
+
font-weight: 600;
|
|
118
|
+
}
|
|
119
|
+
.description {
|
|
120
|
+
padding-top: 1em;
|
|
121
|
+
margin-top: 1em;
|
|
122
|
+
font-size: 0.9em;
|
|
123
|
+
border-top: 1px solid colors.$color__border;
|
|
124
|
+
}
|
|
125
|
+
bdi {
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
font-size: 1.8em;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
82
134
|
@media ( max-width: 600px ) {
|
|
83
|
-
.newspack-blocks-checkout-modal
|
|
135
|
+
.newspack-blocks-checkout-modal,
|
|
136
|
+
.newspack-blocks-variation-modal {
|
|
84
137
|
&__content {
|
|
85
138
|
max-width: 100%;
|
|
86
139
|
width: 100%;
|
|
@@ -89,7 +142,7 @@
|
|
|
89
142
|
bottom: 0;
|
|
90
143
|
left: 0;
|
|
91
144
|
transform: none;
|
|
92
|
-
> *:not( .newspack-blocks-checkout-modal__close ) {
|
|
145
|
+
> *:not( .newspack-blocks-variation-modal__close, .newspack-blocks-checkout-modal__close ) {
|
|
93
146
|
border-radius: 0;
|
|
94
147
|
}
|
|
95
148
|
}
|
|
@@ -53,25 +53,33 @@ call_user_func(
|
|
|
53
53
|
<?php if ( $attributes['showAvatar'] && isset( $author['avatar'] ) ) : ?>
|
|
54
54
|
<div class="wp-block-newspack-blocks-author-profile__avatar">
|
|
55
55
|
<figure style="border-radius: <?php echo esc_attr( $attributes['avatarBorderRadius'] ); ?>; height: <?php echo esc_attr( $attributes['avatarSize'] ); ?>px; width: <?php echo esc_attr( $attributes['avatarSize'] ); ?>px;">
|
|
56
|
+
<?php if ( $show_archive_link ) : ?>
|
|
57
|
+
<a href="<?php echo esc_url( $author['url'] ); ?>">
|
|
56
58
|
<?php
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
endif;
|
|
60
|
+
|
|
61
|
+
echo wp_kses(
|
|
62
|
+
$author['avatar'],
|
|
63
|
+
[
|
|
64
|
+
'img' => [
|
|
65
|
+
'alt' => true,
|
|
66
|
+
'class' => true,
|
|
67
|
+
'data-*' => true,
|
|
68
|
+
'decoding' => true,
|
|
69
|
+
'height' => true,
|
|
70
|
+
'loading' => true,
|
|
71
|
+
'sizes' => true,
|
|
72
|
+
'src' => true,
|
|
73
|
+
'srcset' => true,
|
|
74
|
+
'width' => true,
|
|
75
|
+
],
|
|
76
|
+
]
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
if ( $show_archive_link ) :
|
|
80
|
+
?>
|
|
81
|
+
</a>
|
|
82
|
+
<?php endif; ?>
|
|
75
83
|
</figure>
|
|
76
84
|
</div>
|
|
77
85
|
<?php endif; ?>
|
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 ComposerAutoloaderInitdd12b31d9a939bc935225798a66afbb8
|
|
6
6
|
{
|
|
7
7
|
private static $loader;
|
|
8
8
|
|
|
@@ -22,12 +22,12 @@ class ComposerAutoloaderInit067c69477f130fb41bc11474ba74f7ca
|
|
|
22
22
|
return self::$loader;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
spl_autoload_register(array('
|
|
25
|
+
spl_autoload_register(array('ComposerAutoloaderInitdd12b31d9a939bc935225798a66afbb8', 'loadClassLoader'), true, true);
|
|
26
26
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
|
27
|
-
spl_autoload_unregister(array('
|
|
27
|
+
spl_autoload_unregister(array('ComposerAutoloaderInitdd12b31d9a939bc935225798a66afbb8', 'loadClassLoader'));
|
|
28
28
|
|
|
29
29
|
require __DIR__ . '/autoload_static.php';
|
|
30
|
-
call_user_func(\Composer\Autoload\
|
|
30
|
+
call_user_func(\Composer\Autoload\ComposerStaticInitdd12b31d9a939bc935225798a66afbb8::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 ComposerStaticInitdd12b31d9a939bc935225798a66afbb8
|
|
8
8
|
{
|
|
9
9
|
public static $classMap = array (
|
|
10
10
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
@@ -13,7 +13,7 @@ class ComposerStaticInit067c69477f130fb41bc11474ba74f7ca
|
|
|
13
13
|
public static function getInitializer(ClassLoader $loader)
|
|
14
14
|
{
|
|
15
15
|
return \Closure::bind(function () use ($loader) {
|
|
16
|
-
$loader->classMap =
|
|
16
|
+
$loader->classMap = ComposerStaticInitdd12b31d9a939bc935225798a66afbb8::$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' => 'd492a9ade4ef5030fbda6e2b156e3d823813383d',
|
|
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' => 'd492a9ade4ef5030fbda6e2b156e3d823813383d',
|
|
17
17
|
'type' => 'wordpress-plugin',
|
|
18
18
|
'install_path' => __DIR__ . '/../../',
|
|
19
19
|
'aliases' => array(),
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|