@automattic/newspack-blocks 4.5.0-alpha.1 → 4.5.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/CHANGELOG.md CHANGED
@@ -1,19 +1,9 @@
1
- # [4.5.0-alpha.1](https://github.com/Automattic/newspack-blocks/compare/v4.4.0...v4.5.0-alpha.1) (2024-11-29)
1
+ # [4.5.0-alpha.2](https://github.com/Automattic/newspack-blocks/compare/v4.5.0-alpha.1...v4.5.0-alpha.2) (2024-12-04)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * also search for coauthor posts by term slug ([#1954](https://github.com/Automattic/newspack-blocks/issues/1954)) ([49357ff](https://github.com/Automattic/newspack-blocks/commit/49357ffa12bd2197d08379db0cd084f1cc5deb2a))
7
- * **ras-acc:** correct spacing issue around saved credit cards ([#1980](https://github.com/Automattic/newspack-blocks/issues/1980)) ([52a5c57](https://github.com/Automattic/newspack-blocks/commit/52a5c57ffe037b3de9471c9a4587a2c62c917712))
8
- * **ras-acc:** fix display issues with Additional Fields ([#1979](https://github.com/Automattic/newspack-blocks/issues/1979)) ([b9390ef](https://github.com/Automattic/newspack-blocks/commit/b9390effc8096fc9faea48b49e90efdeabbe1513))
9
- * **ras-acc:** remove space caused by empty divs ([#1978](https://github.com/Automattic/newspack-blocks/issues/1978)) ([8cb6ead](https://github.com/Automattic/newspack-blocks/commit/8cb6ead13aaa86743bb83ba9afb859277394d1df))
10
-
11
-
12
- ### Features
13
-
14
- * add Bluesky support to the Author Profile, List blocks ([#1969](https://github.com/Automattic/newspack-blocks/issues/1969)) ([d26a7e4](https://github.com/Automattic/newspack-blocks/commit/d26a7e4001e0645cba031143e2fbb18d4749def6))
15
- * add support for Newspack Guest Contributor in HPP blocks ([#1934](https://github.com/Automattic/newspack-blocks/issues/1934)) ([c16849e](https://github.com/Automattic/newspack-blocks/commit/c16849e2cf62236b55a99fe63c72f68d727b3437))
16
- * merge RAS-ACC work into trunk ([#1977](https://github.com/Automattic/newspack-blocks/issues/1977)) ([2eeaa89](https://github.com/Automattic/newspack-blocks/commit/2eeaa8933cd4ac877389362aa0815e36d50bc729))
6
+ * remove reCaptcha for WooCommere code from modal checkout ([#1984](https://github.com/Automattic/newspack-blocks/issues/1984)) ([8e250eb](https://github.com/Automattic/newspack-blocks/commit/8e250eb8ef95ca960509beba9dcd6e7526aa9dc6))
17
7
 
18
8
  # [4.4.0](https://github.com/Automattic/newspack-blocks/compare/v4.3.7...v4.4.0) (2024-11-25)
19
9
 
package/composer.lock CHANGED
@@ -2469,16 +2469,16 @@
2469
2469
  },
2470
2470
  {
2471
2471
  "name": "sirbrillig/phpcs-variable-analysis",
2472
- "version": "v2.11.19",
2472
+ "version": "v2.11.21",
2473
2473
  "source": {
2474
2474
  "type": "git",
2475
2475
  "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git",
2476
- "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1"
2476
+ "reference": "eb2b351927098c24860daa7484e290d3eed693be"
2477
2477
  },
2478
2478
  "dist": {
2479
2479
  "type": "zip",
2480
- "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1",
2481
- "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1",
2480
+ "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/eb2b351927098c24860daa7484e290d3eed693be",
2481
+ "reference": "eb2b351927098c24860daa7484e290d3eed693be",
2482
2482
  "shasum": ""
2483
2483
  },
2484
2484
  "require": {
@@ -2489,9 +2489,9 @@
2489
2489
  "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0",
2490
2490
  "phpcsstandards/phpcsdevcs": "^1.1",
2491
2491
  "phpstan/phpstan": "^1.7",
2492
- "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0",
2492
+ "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3",
2493
2493
  "sirbrillig/phpcs-import-detection": "^1.1",
2494
- "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta"
2494
+ "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0"
2495
2495
  },
2496
2496
  "type": "phpcodesniffer-standard",
2497
2497
  "autoload": {
@@ -2523,20 +2523,20 @@
2523
2523
  "source": "https://github.com/sirbrillig/phpcs-variable-analysis",
2524
2524
  "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki"
2525
2525
  },
2526
- "time": "2024-06-26T20:08:34+00:00"
2526
+ "time": "2024-12-02T16:37:49+00:00"
2527
2527
  },
2528
2528
  {
2529
2529
  "name": "squizlabs/php_codesniffer",
2530
- "version": "3.10.1",
2530
+ "version": "3.11.1",
2531
2531
  "source": {
2532
2532
  "type": "git",
2533
2533
  "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
2534
- "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877"
2534
+ "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87"
2535
2535
  },
2536
2536
  "dist": {
2537
2537
  "type": "zip",
2538
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877",
2539
- "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877",
2538
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/19473c30efe4f7b3cd42522d0b2e6e7f243c6f87",
2539
+ "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87",
2540
2540
  "shasum": ""
2541
2541
  },
2542
2542
  "require": {
@@ -2603,7 +2603,7 @@
2603
2603
  "type": "open_collective"
2604
2604
  }
2605
2605
  ],
2606
- "time": "2024-05-22T21:24:41+00:00"
2606
+ "time": "2024-11-16T12:02:36+00:00"
2607
2607
  },
2608
2608
  {
2609
2609
  "name": "symfony/console",
@@ -132,6 +132,9 @@ final class Modal_Checkout {
132
132
  }
133
133
  add_filter( 'woocommerce_subscriptions_product_limited_for_user', [ __CLASS__, 'subscriptions_product_limited_for_user' ], 10, 3 );
134
134
  add_filter( 'woocommerce_get_privacy_policy_text', [ __CLASS__, 'woocommerce_get_privacy_policy_text' ], 10, 2 );
135
+
136
+ // Remove any hooks that aren't supported by the modal checkout.
137
+ add_action( 'plugins_loaded', [ __CLASS__, 'remove_hooks' ] );
135
138
  }
136
139
 
137
140
  /**
@@ -731,6 +734,7 @@ final class Modal_Checkout {
731
734
  'newspack-ui',
732
735
  'newspack-style',
733
736
  'newspack-recaptcha',
737
+ 'newspack-woocommerce-style',
734
738
  // Woo.
735
739
  'woocommerce',
736
740
  'WCPAY',
@@ -740,6 +744,7 @@ final class Modal_Checkout {
740
744
  'wcs-',
741
745
  'stripe',
742
746
  'select2',
747
+ 'selectWoo',
743
748
  // Metorik.
744
749
  'metorik',
745
750
  ];
@@ -756,7 +761,7 @@ final class Modal_Checkout {
756
761
  foreach ( $wp_scripts->queue as $handle ) {
757
762
  $allowed = false;
758
763
  foreach ( $allowed_assets as $allowed_asset ) {
759
- if ( false !== strpos( $handle, $allowed_asset ) ) {
764
+ if ( 0 === strpos( $handle, $allowed_asset ) ) {
760
765
  $allowed = true;
761
766
  break;
762
767
  }
@@ -768,7 +773,7 @@ final class Modal_Checkout {
768
773
  foreach ( $wp_styles->queue as $handle ) {
769
774
  $allowed = false;
770
775
  foreach ( $allowed_assets as $allowed_asset ) {
771
- if ( false !== strpos( $handle, $allowed_asset ) ) {
776
+ if ( 0 === strpos( $handle, $allowed_asset ) ) {
772
777
  $allowed = true;
773
778
  break;
774
779
  }
@@ -779,6 +784,64 @@ final class Modal_Checkout {
779
784
  }
780
785
  }
781
786
 
787
+ /**
788
+ * Remove any hooks that may not work nicely with the modal checkout.
789
+ */
790
+ public static function remove_hooks() {
791
+ if ( ! self::is_modal_checkout() ) {
792
+ return;
793
+ }
794
+
795
+ $remove_list = [];
796
+
797
+ // reCaptcha for WooCommerce.
798
+ if ( class_exists( 'I13_Woo_Recpatcha' ) ) {
799
+ global $i13_woo_recpatcha;
800
+ array_push(
801
+ $remove_list,
802
+ [
803
+ 'hook' => 'woocommerce_review_order_before_payment',
804
+ 'callback' => array( $i13_woo_recpatcha, 'i13woo_extra_checkout_fields' ),
805
+ ],
806
+ [
807
+ 'hook' => 'woocommerce_after_checkout_validation',
808
+ 'callback' => array( $i13_woo_recpatcha, 'i13_woocomm_validate_checkout_captcha' ),
809
+ ],
810
+ [
811
+ 'hook' => 'woocommerce_pay_order_before_submit',
812
+ 'callback' => array( $i13_woo_recpatcha, 'i13woo_extra_checkout_fields' ),
813
+ ],
814
+ [
815
+ 'hook' => 'woocommerce_review_order_before_submit',
816
+ 'callback' => array( $i13_woo_recpatcha, 'i13woo_extra_checkout_fields' ),
817
+ ],
818
+ [
819
+ 'hook' => 'woocommerce_pay_order_before_submit',
820
+ 'callback' => array( $i13_woo_recpatcha, 'i13woo_extra_checkout_fields_pay_order' ),
821
+ ],
822
+ [
823
+ 'hook' => 'woocommerce_proceed_to_checkout',
824
+ 'callback' => array( $i13_woo_recpatcha, 'i13_woocommerce_payment_request_btn_captcha' ),
825
+ ],
826
+ [
827
+ 'hook' => 'wp_head',
828
+ 'callback' => array( $i13_woo_recpatcha, 'i13_add_header_metadata' ),
829
+ ]
830
+ );
831
+ }
832
+ /**
833
+ * Filters the hooks to remove from the modal checkout.
834
+ *
835
+ * @param string[] $remove_list Array of hooks to remove.
836
+ */
837
+ $remove_list = apply_filters( 'newspack_blocks_modal_checkout_remove_hooks', $remove_list );
838
+
839
+ foreach ( $remove_list as $remove ) {
840
+ $priority = has_action( $remove['hook'], $remove['callback'] );
841
+ remove_action( $remove['hook'], $remove['callback'], $priority );
842
+ }
843
+ }
844
+
782
845
  /**
783
846
  * Enqueue script for triggering modal checkout.
784
847
  *
@@ -7,7 +7,7 @@
7
7
  * Author URI: https://newspack.com/
8
8
  * Text Domain: newspack-blocks
9
9
  * Domain Path: /languages
10
- * Version: 4.5.0-alpha.1
10
+ * Version: 4.5.0-alpha.2
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', '4.5.0-alpha.1' );
18
+ define( 'NEWSPACK_BLOCKS__VERSION', '4.5.0-alpha.2' );
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,13 +1,13 @@
1
1
  {
2
2
  "name": "@automattic/newspack-blocks",
3
- "version": "4.5.0-alpha.1",
3
+ "version": "4.5.0-alpha.2",
4
4
  "author": "Automattic",
5
5
  "devDependencies": {
6
6
  "@rushstack/eslint-patch": "^1.10.4",
7
7
  "@testing-library/dom": "^10.4.0",
8
8
  "@testing-library/user-event": "^14.5.2",
9
9
  "@types/lodash": "^4.17.13",
10
- "@wordpress/browserslist-config": "^6.12.0",
10
+ "@wordpress/browserslist-config": "^6.13.0",
11
11
  "eslint": "^8.57.0",
12
12
  "fetch-mock-jest": "^1.5.1",
13
13
  "html-entities": "^2.5.2",
@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
22
22
 
23
23
  require_once __DIR__ . '/composer/autoload_real.php';
24
24
 
25
- return ComposerAutoloaderInitf94ddc2ae56c5564144708d848ad7102::getLoader();
25
+ return ComposerAutoloaderInit9cf72cc5e9f4758dc4883197b4537854::getLoader();
@@ -2,7 +2,7 @@
2
2
 
3
3
  // autoload_real.php @generated by Composer
4
4
 
5
- class ComposerAutoloaderInitf94ddc2ae56c5564144708d848ad7102
5
+ class ComposerAutoloaderInit9cf72cc5e9f4758dc4883197b4537854
6
6
  {
7
7
  private static $loader;
8
8
 
@@ -22,12 +22,12 @@ class ComposerAutoloaderInitf94ddc2ae56c5564144708d848ad7102
22
22
  return self::$loader;
23
23
  }
24
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitf94ddc2ae56c5564144708d848ad7102', 'loadClassLoader'), true, true);
25
+ spl_autoload_register(array('ComposerAutoloaderInit9cf72cc5e9f4758dc4883197b4537854', 'loadClassLoader'), true, true);
26
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27
- spl_autoload_unregister(array('ComposerAutoloaderInitf94ddc2ae56c5564144708d848ad7102', 'loadClassLoader'));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit9cf72cc5e9f4758dc4883197b4537854', 'loadClassLoader'));
28
28
 
29
29
  require __DIR__ . '/autoload_static.php';
30
- call_user_func(\Composer\Autoload\ComposerStaticInitf94ddc2ae56c5564144708d848ad7102::getInitializer($loader));
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit9cf72cc5e9f4758dc4883197b4537854::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 ComposerStaticInitf94ddc2ae56c5564144708d848ad7102
7
+ class ComposerStaticInit9cf72cc5e9f4758dc4883197b4537854
8
8
  {
9
9
  public static $classMap = array (
10
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
@@ -13,7 +13,7 @@ class ComposerStaticInitf94ddc2ae56c5564144708d848ad7102
13
13
  public static function getInitializer(ClassLoader $loader)
14
14
  {
15
15
  return \Closure::bind(function () use ($loader) {
16
- $loader->classMap = ComposerStaticInitf94ddc2ae56c5564144708d848ad7102::$classMap;
16
+ $loader->classMap = ComposerStaticInit9cf72cc5e9f4758dc4883197b4537854::$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-trunk',
5
5
  'version' => 'dev-trunk',
6
- 'reference' => '450e4e39144615404442794868b5c1f314a9daa7',
6
+ 'reference' => '80e5b3c53b60702a44395bd1d3326267a250caae',
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-trunk',
15
15
  'version' => 'dev-trunk',
16
- 'reference' => '450e4e39144615404442794868b5c1f314a9daa7',
16
+ 'reference' => '80e5b3c53b60702a44395bd1d3326267a250caae',
17
17
  'type' => 'wordpress-plugin',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),