@automattic/newspack-blocks 1.69.0-alpha.2 → 1.69.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.
- package/.cache/babel/5e61542a274dd468fcf9badfff45147d.json.gz +0 -0
- package/CHANGELOG.md +22 -0
- 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 +32 -0
- package/newspack-blocks.php +2 -2
- package/package.json +1 -1
- package/src/modal-checkout/modal.js +6 -3
- package/src/modal-checkout/modal.scss +11 -1
- 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/6444da3051780011261cc12e796a6e36.json.gz +0 -0
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
# [1.69.0](https://github.com/Automattic/newspack-blocks/compare/v1.68.2...v1.69.0) (2023-06-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **checkout-button:** overlay class for modal stacking ([#1461](https://github.com/Automattic/newspack-blocks/issues/1461)) ([21b6a44](https://github.com/Automattic/newspack-blocks/commit/21b6a4465d6182ad64f36d065cf7c35241dd5d5e))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* adding link to the author bio avatar ([#1449](https://github.com/Automattic/newspack-blocks/issues/1449)) ([60d9f1c](https://github.com/Automattic/newspack-blocks/commit/60d9f1c61306b9c76be3f487d56f95a04a4565f0))
|
|
12
|
+
* **checkout-button:** front-end product variation selection ([#1459](https://github.com/Automattic/newspack-blocks/issues/1459)) ([d492a9a](https://github.com/Automattic/newspack-blocks/commit/d492a9ade4ef5030fbda6e2b156e3d823813383d))
|
|
13
|
+
* **checkout-button:** support product variations ([#1442](https://github.com/Automattic/newspack-blocks/issues/1442)) ([aa70495](https://github.com/Automattic/newspack-blocks/commit/aa70495940a6c85e9eb9747eb91a989df97e9921))
|
|
14
|
+
* **modal-checkout:** always use donation billing fields ([#1463](https://github.com/Automattic/newspack-blocks/issues/1463)) ([de674c7](https://github.com/Automattic/newspack-blocks/commit/de674c7732f2dccd4e508efb6fabde0816a01fb7))
|
|
15
|
+
|
|
16
|
+
# [1.69.0-alpha.3](https://github.com/Automattic/newspack-blocks/compare/v1.69.0-alpha.2...v1.69.0-alpha.3) (2023-06-01)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **checkout-button:** overlay class for modal stacking ([#1461](https://github.com/Automattic/newspack-blocks/issues/1461)) ([21b6a44](https://github.com/Automattic/newspack-blocks/commit/21b6a4465d6182ad64f36d065cf7c35241dd5d5e))
|
|
22
|
+
|
|
1
23
|
# [1.69.0-alpha.2](https://github.com/Automattic/newspack-blocks/compare/v1.69.0-alpha.1...v1.69.0-alpha.2) (2023-05-31)
|
|
2
24
|
|
|
3
25
|
|
package/dist/modal.asset.php
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '
|
|
1
|
+
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'bd6d5bf001380ea51ce34f55c1156a66');
|
package/dist/modal.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@-webkit-keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}to{transform:rotate(1turn)}}.newspack-blocks-checkout-modal,.newspack-blocks-variation-modal{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);z-index:99999}.newspack-blocks-checkout-modal__content,.newspack-blocks-variation-modal__content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:calc(100vw - 32px);max-width:580px;min-height:200px;max-height:calc(100vh - 32px);background:#fff;border-radius:5px}.newspack-blocks-checkout-modal__content>:not(.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close),.newspack-blocks-variation-modal__content>:not(.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close){width:100%;height:100%;border:0;border-radius:5px}.newspack-blocks-checkout-modal__spinner,.newspack-blocks-variation-modal__spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:5px}.newspack-blocks-checkout-modal__spinner>span,.newspack-blocks-variation-modal__spinner>span{width:25px;height:25px;border:2px solid #fff;border-top-color:#767676;border-radius:50%;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close{position:absolute;top:0;right:0;padding:8px;border:0;background:transparent;color:#111;cursor:pointer}.newspack-blocks-checkout-modal__close:focus,.newspack-blocks-checkout-modal__close:hover,.newspack-blocks-variation-modal__close:focus,.newspack-blocks-variation-modal__close:hover{color:#767676}.newspack-blocks-checkout-modal__close svg,.newspack-blocks-variation-modal__close svg{display:block}.newspack-blocks-variation-modal__content{padding:32px}.newspack-blocks-variation-modal__content h3{margin:0 0 1em}.newspack-blocks-variation-modal__content p{font-size:.8em}.newspack-blocks-variation-modal__content form{margin:0 0 .5em}.newspack-blocks-variation-modal__content form:last-child{margin:0}.newspack-blocks-variation-modal__content form button{display:block;width:100%;padding:16px;margin:0;border:1px solid #ccc;background:transparent;color:#111;text-align:inherit;font-weight:inherit}.newspack-blocks-variation-modal__content form button>span{display:block}.newspack-blocks-variation-modal__content form button .summary{width:100%;display:flex;justify-content:space-between;align-items:
|
|
1
|
+
@-webkit-keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}to{transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}to{transform:rotate(1turn)}}.newspack-blocks-checkout-modal,.newspack-blocks-variation-modal{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);z-index:99999}.newspack-blocks-checkout-modal__content,.newspack-blocks-variation-modal__content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:calc(100vw - 32px);max-width:580px;min-height:200px;max-height:calc(100vh - 32px);background:#fff;border-radius:5px}.newspack-blocks-checkout-modal__content>:not(.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close),.newspack-blocks-variation-modal__content>:not(.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close){width:100%;height:100%;border:0;border-radius:5px}.newspack-blocks-checkout-modal__spinner,.newspack-blocks-variation-modal__spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:5px}.newspack-blocks-checkout-modal__spinner>span,.newspack-blocks-variation-modal__spinner>span{width:25px;height:25px;border:2px solid #fff;border-top-color:#767676;border-radius:50%;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close{position:absolute;top:0;right:0;padding:8px;border:0;background:transparent;color:#111;cursor:pointer}.newspack-blocks-checkout-modal__close:focus,.newspack-blocks-checkout-modal__close:hover,.newspack-blocks-variation-modal__close:focus,.newspack-blocks-variation-modal__close:hover{color:#767676}.newspack-blocks-checkout-modal__close svg,.newspack-blocks-variation-modal__close svg{display:block}.newspack-blocks-variation-modal__content{padding:32px}.newspack-blocks-variation-modal__content h3{margin:0 0 1em}.newspack-blocks-variation-modal__content p{font-size:.8em}.newspack-blocks-variation-modal__content form{margin:0 0 .5em}.newspack-blocks-variation-modal__content form:last-child{margin:0}.newspack-blocks-variation-modal__content form button{display:block;width:100%;padding:16px;margin:0;border:1px solid #ccc;background:transparent;color:#111;text-align:inherit;font-weight:inherit}.newspack-blocks-variation-modal__content form button>span{display:block}.newspack-blocks-variation-modal__content form button .summary{width:100%;display:flex;justify-content:space-between;align-items:flex-end}.newspack-blocks-variation-modal__content form button .summary .subscription-details bdi{font-size:inherit}.newspack-blocks-variation-modal__content form button .price{max-width:65%}.newspack-blocks-variation-modal__content form button .variation_name{font-weight:600;font-size:.9em;margin-left:.5em}.newspack-blocks-variation-modal__content form button .description{padding-top:1em;margin-top:1em;font-size:.9em;border-top:1px solid #ccc}.newspack-blocks-variation-modal__content form button bdi{font-weight:600;font-size:1.8em}@media(max-width:600px){.newspack-blocks-checkout-modal__content,.newspack-blocks-variation-modal__content{max-width:100%;width:100%;border-radius:0;top:auto;bottom:0;left:0;transform:none}.newspack-blocks-checkout-modal__content>:not(.newspack-blocks-variation-modal__close,.newspack-blocks-checkout-modal__close),.newspack-blocks-variation-modal__content>:not(.newspack-blocks-variation-modal__close,.newspack-blocks-checkout-modal__close){border-radius:0}}
|
package/dist/modal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function o(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.r(t);var r,
|
|
1
|
+
(()=>{"use strict";var e={r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function o(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.r(t);var r,c;function a(e){var t=e.querySelector("iframe");t&&(t.src="about:blank"),document.body.classList.remove("newspack-modal-checkout-open"),r&&r.disconnect(),e.style.display="none"}c=function(){var e=document.querySelector(".newspack-blocks-checkout-modal");if(e){var t=document.querySelector(".newspack-blocks-checkout-modal__spinner"),n="newspack_modal_checkout",c=document.createElement("input");c.type="hidden",c.name="modal_checkout",c.value="1";var i=e.querySelector(".newspack-blocks-checkout-modal__content"),l=document.createElement("iframe");l.name=n,i.appendChild(l),e.addEventListener("click",(function(t){t.target===e&&a(e)})),e.querySelectorAll(".newspack-blocks-checkout-modal__close").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault(),a(e)}))}));var d=document.querySelectorAll(".newspack-blocks-variation-modal");d.forEach((function(e){e.addEventListener("click",(function(t){t.target===e&&a(e)})),e.querySelectorAll(".newspack-blocks-variation-modal__close").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault(),a(e)}))}))})),document.querySelectorAll(".wpbnbd.wpbnbd--platform-wc,.wp-block-newspack-blocks-checkout-button,.newspack-blocks-variation-modal").forEach((function(a){a.querySelectorAll("form").forEach((function(a){a.appendChild(c.cloneNode()),a.target=n,a.addEventListener("submit",(function(n){var c=new FormData(a);if(d.forEach((function(e){return e.style.display="none"})),c.get("is_variable")&&!c.get("variation_id")){var u=o(d).find((function(e){return e.dataset.productId===c.get("product_id")}));if(u)return n.preventDefault(),document.body.classList.add("newspack-modal-checkout-open"),void(u.style.display="block")}t.style.display="flex",e.style.display="block",document.body.classList.add("newspack-modal-checkout-open"),r=new ResizeObserver((function(e){if(e&&e.length){var t=e[0].contentRect;t&&(i.style.height=t.top+t.bottom+"px")}})),l.addEventListener("load",(function(){var e=l.contentWindow.location;if(window.newspackReaderActivation&&e.href.indexOf("order-received")>-1){var n=window.newspackReaderActivation,o=new Proxy(new URLSearchParams(e.search),{get:function(e,t){return e.get(t)}});o.email&&(n.setReaderEmail(o.email),n.setAuthenticated(!0))}var c=l.contentWindow.document.querySelector("#newspack_modal_checkout");c&&r.observe(c),t.style.display="none"}))}))}))}))}},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",c):c());var i=window;for(var l in t)i[l]=t[l];t.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
|
package/dist/modal.rtl.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@-webkit-keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(-180deg)}to{transform:rotate(-1turn)}}@keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(-180deg)}to{transform:rotate(-1turn)}}.newspack-blocks-checkout-modal,.newspack-blocks-variation-modal{position:fixed;top:0;right:0;width:100%;height:100%;background:rgba(0,0,0,.75);z-index:99999}.newspack-blocks-checkout-modal__content,.newspack-blocks-variation-modal__content{position:absolute;top:50%;right:50%;transform:translate(50%,-50%);width:calc(100vw - 32px);max-width:580px;min-height:200px;max-height:calc(100vh - 32px);background:#fff;border-radius:5px}.newspack-blocks-checkout-modal__content>:not(.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close),.newspack-blocks-variation-modal__content>:not(.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close){width:100%;height:100%;border:0;border-radius:5px}.newspack-blocks-checkout-modal__spinner,.newspack-blocks-variation-modal__spinner{position:absolute;top:50%;right:50%;transform:translate(50%,-50%);width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:5px}.newspack-blocks-checkout-modal__spinner>span,.newspack-blocks-variation-modal__spinner>span{width:25px;height:25px;border:2px solid #fff;border-top-color:#767676;border-radius:50%;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close{position:absolute;top:0;left:0;padding:8px;border:0;background:transparent;color:#111;cursor:pointer}.newspack-blocks-checkout-modal__close:focus,.newspack-blocks-checkout-modal__close:hover,.newspack-blocks-variation-modal__close:focus,.newspack-blocks-variation-modal__close:hover{color:#767676}.newspack-blocks-checkout-modal__close svg,.newspack-blocks-variation-modal__close svg{display:block}.newspack-blocks-variation-modal__content{padding:32px}.newspack-blocks-variation-modal__content h3{margin:0 0 1em}.newspack-blocks-variation-modal__content p{font-size:.8em}.newspack-blocks-variation-modal__content form{margin:0 0 .5em}.newspack-blocks-variation-modal__content form:last-child{margin:0}.newspack-blocks-variation-modal__content form button{display:block;width:100%;padding:16px;margin:0;border:1px solid #ccc;background:transparent;color:#111;text-align:inherit;font-weight:inherit}.newspack-blocks-variation-modal__content form button>span{display:block}.newspack-blocks-variation-modal__content form button .summary{width:100%;display:flex;justify-content:space-between;align-items:
|
|
1
|
+
@-webkit-keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(-180deg)}to{transform:rotate(-1turn)}}@keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(-180deg)}to{transform:rotate(-1turn)}}.newspack-blocks-checkout-modal,.newspack-blocks-variation-modal{position:fixed;top:0;right:0;width:100%;height:100%;background:rgba(0,0,0,.75);z-index:99999}.newspack-blocks-checkout-modal__content,.newspack-blocks-variation-modal__content{position:absolute;top:50%;right:50%;transform:translate(50%,-50%);width:calc(100vw - 32px);max-width:580px;min-height:200px;max-height:calc(100vh - 32px);background:#fff;border-radius:5px}.newspack-blocks-checkout-modal__content>:not(.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close),.newspack-blocks-variation-modal__content>:not(.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close){width:100%;height:100%;border:0;border-radius:5px}.newspack-blocks-checkout-modal__spinner,.newspack-blocks-variation-modal__spinner{position:absolute;top:50%;right:50%;transform:translate(50%,-50%);width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:5px}.newspack-blocks-checkout-modal__spinner>span,.newspack-blocks-variation-modal__spinner>span{width:25px;height:25px;border:2px solid #fff;border-top-color:#767676;border-radius:50%;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.newspack-blocks-checkout-modal__close,.newspack-blocks-variation-modal__close{position:absolute;top:0;left:0;padding:8px;border:0;background:transparent;color:#111;cursor:pointer}.newspack-blocks-checkout-modal__close:focus,.newspack-blocks-checkout-modal__close:hover,.newspack-blocks-variation-modal__close:focus,.newspack-blocks-variation-modal__close:hover{color:#767676}.newspack-blocks-checkout-modal__close svg,.newspack-blocks-variation-modal__close svg{display:block}.newspack-blocks-variation-modal__content{padding:32px}.newspack-blocks-variation-modal__content h3{margin:0 0 1em}.newspack-blocks-variation-modal__content p{font-size:.8em}.newspack-blocks-variation-modal__content form{margin:0 0 .5em}.newspack-blocks-variation-modal__content form:last-child{margin:0}.newspack-blocks-variation-modal__content form button{display:block;width:100%;padding:16px;margin:0;border:1px solid #ccc;background:transparent;color:#111;text-align:inherit;font-weight:inherit}.newspack-blocks-variation-modal__content form button>span{display:block}.newspack-blocks-variation-modal__content form button .summary{width:100%;display:flex;justify-content:space-between;align-items:flex-end}.newspack-blocks-variation-modal__content form button .summary .subscription-details bdi{font-size:inherit}.newspack-blocks-variation-modal__content form button .price{max-width:65%}.newspack-blocks-variation-modal__content form button .variation_name{font-weight:600;font-size:.9em;margin-right:.5em}.newspack-blocks-variation-modal__content form button .description{padding-top:1em;margin-top:1em;font-size:.9em;border-top:1px solid #ccc}.newspack-blocks-variation-modal__content form button bdi{font-weight:600;font-size:1.8em}@media(max-width:600px){.newspack-blocks-checkout-modal__content,.newspack-blocks-variation-modal__content{max-width:100%;width:100%;border-radius:0;top:auto;bottom:0;right:0;transform:none}.newspack-blocks-checkout-modal__content>:not(.newspack-blocks-variation-modal__close,.newspack-blocks-checkout-modal__close),.newspack-blocks-variation-modal__content>:not(.newspack-blocks-variation-modal__close,.newspack-blocks-checkout-modal__close){border-radius:0}}
|
|
@@ -41,6 +41,7 @@ final class Modal_Checkout {
|
|
|
41
41
|
add_filter( 'woocommerce_get_checkout_order_received_url', [ __CLASS__, 'woocommerce_get_return_url' ], 10, 2 );
|
|
42
42
|
add_filter( 'wc_get_template', [ __CLASS__, 'wc_get_template' ], 10, 2 );
|
|
43
43
|
add_filter( 'woocommerce_checkout_get_value', [ __CLASS__, 'woocommerce_checkout_get_value' ], 10, 2 );
|
|
44
|
+
add_filter( 'woocommerce_checkout_fields', [ __CLASS__, 'woocommerce_checkout_fields' ] );
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -392,6 +393,37 @@ final class Modal_Checkout {
|
|
|
392
393
|
return $value;
|
|
393
394
|
}
|
|
394
395
|
|
|
396
|
+
/**
|
|
397
|
+
* Modify fields for modal checkout.
|
|
398
|
+
*
|
|
399
|
+
* @param array $fields Checkout fields.
|
|
400
|
+
*
|
|
401
|
+
* @return array
|
|
402
|
+
*/
|
|
403
|
+
public static function woocommerce_checkout_fields( $fields ) {
|
|
404
|
+
if ( ! isset( $_REQUEST['modal_checkout'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
|
405
|
+
return $fields;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Temporarily use the same fields as the donation checkout.
|
|
409
|
+
*
|
|
410
|
+
* This should soon be replaced with a logic that allows the customization
|
|
411
|
+
* at the Checkout Button Block level.
|
|
412
|
+
*/
|
|
413
|
+
$billing_fields = apply_filters( 'newspack_blocks_donate_billing_fields_keys', [] );
|
|
414
|
+
if ( empty( $billing_fields ) ) {
|
|
415
|
+
return $fields;
|
|
416
|
+
}
|
|
417
|
+
$billing_keys = array_keys( $fields['billing'] );
|
|
418
|
+
foreach ( $billing_keys as $key ) {
|
|
419
|
+
if ( in_array( $key, $billing_fields, true ) ) {
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
unset( $fields['billing'][ $key ] );
|
|
423
|
+
}
|
|
424
|
+
return $fields;
|
|
425
|
+
}
|
|
426
|
+
|
|
395
427
|
/**
|
|
396
428
|
* Get the prefilled values for billing fields.
|
|
397
429
|
*
|
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.69.0
|
|
10
|
+
* Version: 1.69.0
|
|
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.69.0
|
|
18
|
+
define( 'NEWSPACK_BLOCKS__VERSION', '1.69.0' );
|
|
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
|
@@ -36,7 +36,9 @@ function closeCheckout( element ) {
|
|
|
36
36
|
iframe.src = 'about:blank';
|
|
37
37
|
}
|
|
38
38
|
document.body.classList.remove( 'newspack-modal-checkout-open' );
|
|
39
|
-
iframeResizeObserver
|
|
39
|
+
if ( iframeResizeObserver ) {
|
|
40
|
+
iframeResizeObserver.disconnect();
|
|
41
|
+
}
|
|
40
42
|
element.style.display = 'none';
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -78,7 +80,7 @@ domReady( () => {
|
|
|
78
80
|
variationModals.forEach( variationModal => {
|
|
79
81
|
variationModal.addEventListener( 'click', ev => {
|
|
80
82
|
if ( ev.target === variationModal ) {
|
|
81
|
-
variationModal
|
|
83
|
+
closeCheckout( variationModal );
|
|
82
84
|
}
|
|
83
85
|
} );
|
|
84
86
|
variationModal
|
|
@@ -86,7 +88,7 @@ domReady( () => {
|
|
|
86
88
|
.forEach( button => {
|
|
87
89
|
button.addEventListener( 'click', ev => {
|
|
88
90
|
ev.preventDefault();
|
|
89
|
-
variationModal
|
|
91
|
+
closeCheckout( variationModal );
|
|
90
92
|
} );
|
|
91
93
|
} );
|
|
92
94
|
} );
|
|
@@ -111,6 +113,7 @@ domReady( () => {
|
|
|
111
113
|
);
|
|
112
114
|
if ( variationModal ) {
|
|
113
115
|
ev.preventDefault();
|
|
116
|
+
document.body.classList.add( 'newspack-modal-checkout-open' );
|
|
114
117
|
variationModal.style.display = 'block';
|
|
115
118
|
return;
|
|
116
119
|
}
|
|
@@ -111,10 +111,20 @@
|
|
|
111
111
|
width: 100%;
|
|
112
112
|
display: flex;
|
|
113
113
|
justify-content: space-between;
|
|
114
|
-
align-items:
|
|
114
|
+
align-items: flex-end;
|
|
115
|
+
.subscription-details {
|
|
116
|
+
bdi {
|
|
117
|
+
font-size: inherit;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.price {
|
|
122
|
+
max-width: 65%;
|
|
115
123
|
}
|
|
116
124
|
.variation_name {
|
|
117
125
|
font-weight: 600;
|
|
126
|
+
font-size: 0.9em;
|
|
127
|
+
margin-left: 0.5em;
|
|
118
128
|
}
|
|
119
129
|
.description {
|
|
120
130
|
padding-top: 1em;
|
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 ComposerAutoloaderInitf29693c46abc4c2490d10d0fd49977ef
|
|
6
6
|
{
|
|
7
7
|
private static $loader;
|
|
8
8
|
|
|
@@ -22,12 +22,12 @@ class ComposerAutoloaderInitdd12b31d9a939bc935225798a66afbb8
|
|
|
22
22
|
return self::$loader;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
spl_autoload_register(array('
|
|
25
|
+
spl_autoload_register(array('ComposerAutoloaderInitf29693c46abc4c2490d10d0fd49977ef', 'loadClassLoader'), true, true);
|
|
26
26
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
|
27
|
-
spl_autoload_unregister(array('
|
|
27
|
+
spl_autoload_unregister(array('ComposerAutoloaderInitf29693c46abc4c2490d10d0fd49977ef', 'loadClassLoader'));
|
|
28
28
|
|
|
29
29
|
require __DIR__ . '/autoload_static.php';
|
|
30
|
-
call_user_func(\Composer\Autoload\
|
|
30
|
+
call_user_func(\Composer\Autoload\ComposerStaticInitf29693c46abc4c2490d10d0fd49977ef::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 ComposerStaticInitf29693c46abc4c2490d10d0fd49977ef
|
|
8
8
|
{
|
|
9
9
|
public static $classMap = array (
|
|
10
10
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
@@ -13,7 +13,7 @@ class ComposerStaticInitdd12b31d9a939bc935225798a66afbb8
|
|
|
13
13
|
public static function getInitializer(ClassLoader $loader)
|
|
14
14
|
{
|
|
15
15
|
return \Closure::bind(function () use ($loader) {
|
|
16
|
-
$loader->classMap =
|
|
16
|
+
$loader->classMap = ComposerStaticInitf29693c46abc4c2490d10d0fd49977ef::$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' => '4f1ff36c401ee92e06449fef516c53642f6638e0',
|
|
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' => '4f1ff36c401ee92e06449fef516c53642f6638e0',
|
|
17
17
|
'type' => 'wordpress-plugin',
|
|
18
18
|
'install_path' => __DIR__ . '/../../',
|
|
19
19
|
'aliases' => array(),
|
|
Binary file
|