@automattic/newspack-blocks 2.1.0 → 2.2.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.
Files changed (55) hide show
  1. package/.cache/babel/6aca28a6c4a1d89dde32fdeb4bda53d5.json.gz +0 -0
  2. package/.cache/babel/b69c05682a3bd6b8f597906127dab44e.json.gz +0 -0
  3. package/.cache/babel/c163868a7a55ba37b772721cb99ffc73.json.gz +0 -0
  4. package/.cache/babel/c7cfb8590e887722a3e715c72ee99bac.json.gz +0 -0
  5. package/CHANGELOG.md +34 -0
  6. package/composer.json +2 -2
  7. package/composer.lock +171 -19
  8. package/dist/checkout-button/view.asset.php +1 -1
  9. package/dist/checkout-button/view.css +1 -1
  10. package/dist/checkout-button/view.rtl.css +1 -1
  11. package/dist/donateStreamlined.asset.php +1 -1
  12. package/dist/donateStreamlined.js +1 -1
  13. package/dist/editor.asset.php +1 -1
  14. package/dist/editor.css +1 -1
  15. package/dist/editor.js +1 -1
  16. package/dist/editor.rtl.css +1 -1
  17. package/dist/homepage-articles/view.asset.php +1 -1
  18. package/dist/homepage-articles/view.css +1 -1
  19. package/dist/homepage-articles/view.rtl.css +1 -1
  20. package/includes/class-newspack-blocks-api.php +44 -30
  21. package/includes/class-newspack-blocks.php +2 -2
  22. package/newspack-blocks.php +2 -2
  23. package/package.json +5 -5
  24. package/src/block-patterns/subscribe-1.php +1 -1
  25. package/src/block-patterns/subscribe-10.php +1 -1
  26. package/src/block-patterns/subscribe-2.php +1 -1
  27. package/src/block-patterns/subscribe-3.php +1 -1
  28. package/src/block-patterns/subscribe-4.php +1 -1
  29. package/src/block-patterns/subscribe-5.php +1 -1
  30. package/src/block-patterns/subscribe-6.php +1 -1
  31. package/src/block-patterns/subscribe-7.php +1 -1
  32. package/src/block-patterns/subscribe-8.php +1 -1
  33. package/src/block-patterns/subscribe-9.php +1 -1
  34. package/src/blocks/author-list/class-wp-rest-newspack-author-list-controller.php +9 -11
  35. package/src/blocks/checkout-button/block.json +3 -0
  36. package/src/blocks/checkout-button/edit.js +35 -1
  37. package/src/blocks/checkout-button/save.js +3 -1
  38. package/src/blocks/checkout-button/view.scss +19 -6
  39. package/src/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php +13 -0
  40. package/src/blocks/homepage-articles/edit.js +1 -4
  41. package/src/blocks/homepage-articles/editor.js +16 -2
  42. package/src/blocks/homepage-articles/templates/article.php +10 -12
  43. package/src/blocks/homepage-articles/templates/articles-list.php +2 -2
  44. package/src/blocks/homepage-articles/view.php +177 -11
  45. package/src/blocks/homepage-articles/view.scss +0 -102
  46. package/src/modal-checkout/templates/thankyou.php +7 -1
  47. package/src/templates/author-profile-card.php +22 -12
  48. package/vendor/autoload.php +1 -1
  49. package/vendor/composer/autoload_real.php +4 -4
  50. package/vendor/composer/autoload_static.php +2 -2
  51. package/vendor/composer/installed.php +2 -2
  52. package/.cache/babel/39bcc541624feefe54d1493493ae1ce8.json.gz +0 -0
  53. package/.cache/babel/4d8c26a76e77fa64d01f30a5f2d62f85.json.gz +0 -0
  54. package/.cache/babel/6715650e6d89955011841839faac29f2.json.gz +0 -0
  55. package/.cache/babel/6d457f8985600b07d97aebc4e1a21855.json.gz +0 -0
@@ -47,7 +47,8 @@ function newspack_blocks_replace_login_with_order_summary() {
47
47
  return;
48
48
  }
49
49
 
50
- $is_success = ! $order->has_status( 'failed' );
50
+ $is_success = ! $order->has_status( 'failed' );
51
+ $order_item_name = array_values( $order->get_items() )[0]->get_name();
51
52
 
52
53
  ?>
53
54
 
@@ -79,6 +80,11 @@ function newspack_blocks_replace_login_with_order_summary() {
79
80
  </li>
80
81
  <?php endif; ?>
81
82
 
83
+ <li>
84
+ <?php esc_html_e( 'Item:', 'newspack-blocks' ); ?>
85
+ <strong><?php echo esc_html( $order_item_name ); ?></strong>
86
+ </li>
87
+
82
88
  <li class="woocommerce-order-overview__order order">
83
89
  <?php esc_html_e( 'Transaction:', 'newspack-blocks' ); ?>
84
90
  <strong><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
@@ -23,16 +23,20 @@ call_user_func(
23
23
  if ( $attributes['showEmail'] && ! empty( $author['email'] ) ) {
24
24
  $social_links['email'] = $author['email'];
25
25
  }
26
- if ( $attributes['shownewspack_phone_number'] && ! empty( $author['newspack_phone_number'] ) ) {
27
- $social_links['newspack_phone_number'] = $author['newspack_phone_number'];
26
+ if ( class_exists( '\Newspack\Authors_Custom_Fields' ) ) {
27
+ if ( $attributes['shownewspack_phone_number'] && ! empty( $author['newspack_phone_number'] ) ) {
28
+ $social_links['newspack_phone_number'] = $author['newspack_phone_number'];
29
+ }
28
30
  }
29
31
 
30
32
  $employment_values = [];
31
- if ( $attributes['shownewspack_role'] && ! empty( $author['newspack_role'] ) ) {
32
- $employment_values[] = $author['newspack_role'];
33
- }
34
- if ( $attributes['shownewspack_employer'] && ! empty( $author['newspack_employer'] ) ) {
35
- $employment_values[] = $author['newspack_employer'];
33
+ if ( class_exists( '\Newspack\Authors_Custom_Fields' ) ) {
34
+ if ( $attributes['shownewspack_role'] && ! empty( $author['newspack_role'] ) ) {
35
+ $employment_values[] = $author['newspack_role'];
36
+ }
37
+ if ( $attributes['shownewspack_employer'] && ! empty( $author['newspack_employer'] ) ) {
38
+ $employment_values[] = $author['newspack_employer'];
39
+ }
36
40
  }
37
41
  $employment = implode( ', ', $employment_values );
38
42
 
@@ -81,11 +85,17 @@ call_user_func(
81
85
  <?php endif; ?>
82
86
  </h3>
83
87
 
84
- <?php if ( $attributes['shownewspack_job_title'] && ! empty( $author['newspack_job_title'] ) ) : ?>
85
- <p class="wp-block-newspack-blocks-author-profile__job-title">
86
- <?php echo esc_html( $author['newspack_job_title'] ); ?>
87
- </p>
88
- <?php endif; ?>
88
+ <?php
89
+ if ( class_exists( '\Newspack\Authors_Custom_Fields' ) ) :
90
+ if ( $attributes['shownewspack_job_title'] && ! empty( $author['newspack_job_title'] ) ) :
91
+ ?>
92
+ <p class="wp-block-newspack-blocks-author-profile__job-title">
93
+ <?php echo esc_html( $author['newspack_job_title'] ); ?>
94
+ </p>
95
+ <?php
96
+ endif;
97
+ endif;
98
+ ?>
89
99
  <?php if ( ! empty( $employment ) ) : ?>
90
100
  <p class="wp-block-newspack-blocks-author-profile__employment">
91
101
  <?php echo esc_html( $employment ); ?>
@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
22
22
 
23
23
  require_once __DIR__ . '/composer/autoload_real.php';
24
24
 
25
- return ComposerAutoloaderInitaec483b8816e48daed1110b74d80afc8::getLoader();
25
+ return ComposerAutoloaderInit71572603e90630c212f3dbb0a10c0c16::getLoader();
@@ -2,7 +2,7 @@
2
2
 
3
3
  // autoload_real.php @generated by Composer
4
4
 
5
- class ComposerAutoloaderInitaec483b8816e48daed1110b74d80afc8
5
+ class ComposerAutoloaderInit71572603e90630c212f3dbb0a10c0c16
6
6
  {
7
7
  private static $loader;
8
8
 
@@ -22,12 +22,12 @@ class ComposerAutoloaderInitaec483b8816e48daed1110b74d80afc8
22
22
  return self::$loader;
23
23
  }
24
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitaec483b8816e48daed1110b74d80afc8', 'loadClassLoader'), true, true);
25
+ spl_autoload_register(array('ComposerAutoloaderInit71572603e90630c212f3dbb0a10c0c16', 'loadClassLoader'), true, true);
26
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27
- spl_autoload_unregister(array('ComposerAutoloaderInitaec483b8816e48daed1110b74d80afc8', 'loadClassLoader'));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit71572603e90630c212f3dbb0a10c0c16', 'loadClassLoader'));
28
28
 
29
29
  require __DIR__ . '/autoload_static.php';
30
- call_user_func(\Composer\Autoload\ComposerStaticInitaec483b8816e48daed1110b74d80afc8::getInitializer($loader));
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit71572603e90630c212f3dbb0a10c0c16::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 ComposerStaticInitaec483b8816e48daed1110b74d80afc8
7
+ class ComposerStaticInit71572603e90630c212f3dbb0a10c0c16
8
8
  {
9
9
  public static $classMap = array (
10
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
@@ -13,7 +13,7 @@ class ComposerStaticInitaec483b8816e48daed1110b74d80afc8
13
13
  public static function getInitializer(ClassLoader $loader)
14
14
  {
15
15
  return \Closure::bind(function () use ($loader) {
16
- $loader->classMap = ComposerStaticInitaec483b8816e48daed1110b74d80afc8::$classMap;
16
+ $loader->classMap = ComposerStaticInit71572603e90630c212f3dbb0a10c0c16::$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' => 'f1c339a33ceb9755df33eb032f54aaeea373c469',
6
+ 'reference' => '5a2c83bff83cfdcc95fe94c11a039ab718ef76ef',
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' => 'f1c339a33ceb9755df33eb032f54aaeea373c469',
16
+ 'reference' => '5a2c83bff83cfdcc95fe94c11a039ab718ef76ef',
17
17
  'type' => 'wordpress-plugin',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),