@automattic/newspack-blocks 2.0.0-alpha.2 → 2.0.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/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ # [2.0.0](https://github.com/Automattic/newspack-blocks/compare/v1.75.6...v2.0.0) (2023-10-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **donate:** allow "once" in tiers-based layout ([ad7268a](https://github.com/Automattic/newspack-blocks/commit/ad7268a320b70a85189cc36055744c3b6aca712f))
7
+ * **homepage-posts:** check existing "specific posts" recursively for deduplication ([#1541](https://github.com/Automattic/newspack-blocks/issues/1541)) ([9755e40](https://github.com/Automattic/newspack-blocks/commit/9755e4090ce645c56ff26183684a07503c92fc65))
8
+ * newspack.pub > newspack.com ([#1552](https://github.com/Automattic/newspack-blocks/issues/1552)) ([343b80b](https://github.com/Automattic/newspack-blocks/commit/343b80b49ac5516cb8ca877b1ca4a6ce6bcaaedf))
9
+ * update WC's variation methods ([860f9fa](https://github.com/Automattic/newspack-blocks/commit/860f9fa2c8b5cda48c9310c958abcf8a3567d5ad))
10
+
11
+
12
+ ### Features
13
+
14
+ * add option for a button after checkout ([#1521](https://github.com/Automattic/newspack-blocks/issues/1521)) ([bdfb3c2](https://github.com/Automattic/newspack-blocks/commit/bdfb3c2cceeb52097494884935546655a4a1650e))
15
+ * **homepage-posts:** support deduplication toggling ([#1543](https://github.com/Automattic/newspack-blocks/issues/1543)) ([6acc719](https://github.com/Automattic/newspack-blocks/commit/6acc71959a28d213e1f9064a28a84ebeda44f636))
16
+ * **modal checkout:** post-checkout newsletter signup ([#1561](https://github.com/Automattic/newspack-blocks/issues/1561)) ([092007a](https://github.com/Automattic/newspack-blocks/commit/092007a59ed89ce8ea3ef309851c26fde88b7e9f))
17
+ * **modal-checkout:** implement ras overlay ([#1562](https://github.com/Automattic/newspack-blocks/issues/1562)) ([8270c9b](https://github.com/Automattic/newspack-blocks/commit/8270c9be4dc513ec317c0c256063cf12c936a0a7))
18
+ * remove AMP compatibility ([27ecf88](https://github.com/Automattic/newspack-blocks/commit/27ecf88abecaa935ec931df397c340cba19de978))
19
+
20
+
21
+ ### BREAKING CHANGES
22
+
23
+ * AMP will not be supported anymore by this plugin.
24
+
25
+ # [2.0.0-alpha.3](https://github.com/Automattic/newspack-blocks/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2023-10-20)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * update WC's variation methods ([860f9fa](https://github.com/Automattic/newspack-blocks/commit/860f9fa2c8b5cda48c9310c958abcf8a3567d5ad))
31
+
32
+
33
+ ### Features
34
+
35
+ * **modal checkout:** post-checkout newsletter signup ([#1561](https://github.com/Automattic/newspack-blocks/issues/1561)) ([092007a](https://github.com/Automattic/newspack-blocks/commit/092007a59ed89ce8ea3ef309851c26fde88b7e9f))
36
+ * **modal-checkout:** implement ras overlay ([#1562](https://github.com/Automattic/newspack-blocks/issues/1562)) ([8270c9b](https://github.com/Automattic/newspack-blocks/commit/8270c9be4dc513ec317c0c256063cf12c936a0a7))
37
+
1
38
  # [2.0.0-alpha.2](https://github.com/Automattic/newspack-blocks/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2023-10-19)
2
39
 
3
40
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => '7f05b6213180a3ba920a7b9d0b857cbd');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => '9d3099a89de627e950e7627d00dad08e');
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{align-items:center;background:#fff;border-radius:5px;display:flex;height:100%;justify-content:center;left:50%;opacity:.5;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}.newspack-blocks-checkout-modal__spinner>span,.newspack-blocks-variation-modal__spinner>span{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:2px solid #fff;border-top-color:#767676;border-radius:50%;height:25px;width:25px}.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;overflow:auto;border-radius:5px}.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}}
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-modal{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);z-index:99999}.newspack-blocks-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-modal__content>:not(.newspack-blocks-modal__close){width:100%;height:100%;border:0;border-radius:5px}.newspack-blocks-modal__spinner{align-items:center;background:#fff;border-radius:5px;display:flex;height:100%;justify-content:center;left:50%;opacity:.5;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}.newspack-blocks-modal__spinner>span{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:2px solid #fff;border-top-color:#767676;border-radius:50%;height:25px;width:25px}.newspack-blocks-modal__close{position:absolute;top:0;right:0;padding:8px;border:0;background:transparent;color:#111;cursor:pointer}.newspack-blocks-modal__close:focus,.newspack-blocks-modal__close:hover{color:#767676}.newspack-blocks-modal__close svg{display:block}.newspack-blocks-variation-modal .newspack-blocks-modal__content{padding:32px;overflow:auto;border-radius:5px}.newspack-blocks-variation-modal .newspack-blocks-modal__content h3{margin:0 0 1em}.newspack-blocks-variation-modal .newspack-blocks-modal__content p{font-size:.8em}.newspack-blocks-variation-modal .newspack-blocks-modal__content form{margin:0 0 .5em}.newspack-blocks-variation-modal .newspack-blocks-modal__content form:last-child{margin:0}.newspack-blocks-variation-modal .newspack-blocks-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 .newspack-blocks-modal__content form button>span{display:block}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .summary{width:100%;display:flex;justify-content:space-between;align-items:flex-end}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .summary .subscription-details bdi{font-size:inherit}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .price{max-width:65%}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .variation_name{font-weight:600;font-size:.9em;margin-left:.5em}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .description{padding-top:1em;margin-top:1em;font-size:.9em;border-top:1px solid #ccc}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button bdi{font-weight:600;font-size:1.8em}@media(max-width:600px){.newspack-blocks-modal__content{max-width:100%;width:100%;border-radius:0;top:auto;bottom:0;left:0;transform:none}.newspack-blocks-modal__content>:not(.newspack-blocks-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,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=i.clientHeight+"px",u=document.createElement("iframe");u.name=n,i.appendChild(u),e.addEventListener("click",(function(t){t.target===e&&a(e)})),e.querySelectorAll(".newspack-blocks-checkout-modal__close").forEach((function(n){n.addEventListener("click",(function(n){n.preventDefault(),i.style.height=l,t.style.display="flex",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;var l=a.querySelector('input[name="after_success_url"]'),s=a.querySelector('input[name="after_success_behavior"]');s&&l&&"referrer"===s.getAttribute("value")&&l.setAttribute("value",document.referrer||window.location.href),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 l=o(d).find((function(e){return e.dataset.productId===c.get("product_id")}));if(l)return n.preventDefault(),document.body.classList.add("newspack-modal-checkout-open"),void(l.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 n=e[0].contentRect;n&&(i.style.height=n.top+n.bottom+"px",t.style.display="none")}})),u.addEventListener("load",(function(){var e=u.contentWindow.location;if(window.newspackReaderActivation&&e.href.indexOf("order-received")>-1){var n=window.newspackReaderActivation,c=new Proxy(new URLSearchParams(e.search),{get:function(e,t){return e.get(t)}});c.email&&(n.setReaderEmail(c.email),n.setAuthenticated(!0))}var a=u.contentDocument.querySelector("#newspack_modal_checkout");a&&r.observe(a),o(u.contentDocument.querySelectorAll(".modal-continue, .edit-billing-link")).forEach((function(e){e.addEventListener("click",(function(){return t.style.display="flex"}))}));var i=u.contentDocument.querySelector(".checkout");i&&o(i.querySelectorAll(".woocommerce-billing-fields input")).forEach((function(e){e.addEventListener("keyup",(function(e){"Enter"===e.key&&(t.style.display="flex",i.submit())}))}))}))}))}))}))}},"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})})();
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;function a(){var e=document.querySelector('iframe[name="newspack_modal_checkout"]');e&&(e.src="about:blank"),document.body.classList.remove("newspack-modal-checkout-open"),r&&r.disconnect(),Array.from(document.querySelectorAll(".newspack-blocks-modal")).forEach((function(e){var t,n;(e.style.display="none",e.overlayId&&null!==(t=window.newspackReaderActivation)&&void 0!==t&&t.overlays)&&(null===(n=window.newspackReaderActivation)||void 0===n||n.overlays.remove(e.overlayId))}))}window.newspackCloseModalCheckout=a;var c,l=".newspack-blocks-modal";c=function(){var e=document.querySelector(".newspack-blocks-checkout-modal");if(e){var t=document.querySelector("".concat(l,"__spinner")),n="newspack_modal_checkout",c=document.createElement("input");c.type="hidden",c.name="modal_checkout",c.value="1";var i=e.querySelector("".concat(l,"__content")),d=i.clientHeight+"px",u=document.createElement("iframe");u.name=n,i.appendChild(u),e.addEventListener("click",(function(t){t.target===e&&a()})),e.querySelectorAll("".concat(l,"__close")).forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),i.style.height=d,t.style.display="flex",a()}))}));var s=document.querySelectorAll(".newspack-blocks-variation-modal");s.forEach((function(e){e.addEventListener("click",(function(t){t.target===e&&a()})),e.querySelectorAll(".newspack-blocks-modal__close").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),a()}))}))})),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;var l=a.querySelector('input[name="after_success_url"]'),d=a.querySelector('input[name="after_success_behavior"]');d&&l&&"referrer"===d.getAttribute("value")&&l.setAttribute("value",document.referrer||window.location.href),a.addEventListener("submit",(function(n){var c,l,d=new FormData(a);if(s.forEach((function(e){return e.style.display="none"})),d.get("is_variable")&&!d.get("variation_id")){var f=o(s).find((function(e){return e.dataset.productId===d.get("product_id")}));if(f)return n.preventDefault(),document.body.classList.add("newspack-modal-checkout-open"),void(f.style.display="block")}t.style.display="flex",e.style.display="block",document.body.classList.add("newspack-modal-checkout-open"),null!==(c=window.newspackReaderActivation)&&void 0!==c&&c.overlays&&(e.overlayId=null===(l=window.newspackReaderActivation)||void 0===l?void 0:l.overlays.add()),r=new ResizeObserver((function(e){if(e&&e.length){var n=e[0].contentRect;n&&(i.style.height=n.top+n.bottom+"px",t.style.display="none")}})),u.addEventListener("load",(function(){var e=u.contentWindow.location;if(window.newspackReaderActivation&&e.href.indexOf("order-received")>-1){var n=window.newspackReaderActivation,a=new Proxy(new URLSearchParams(e.search),{get:function(e,t){return e.get(t)}});a.email&&(n.setReaderEmail(a.email),n.setAuthenticated(!0))}var c=u.contentDocument.querySelector("#newspack_modal_checkout");c&&r.observe(c),o(u.contentDocument.querySelectorAll(".modal-continue, .edit-billing-link")).forEach((function(e){e.addEventListener("click",(function(){return t.style.display="flex"}))}));var l=u.contentDocument.querySelector(".checkout");l&&o(l.querySelectorAll(".woocommerce-billing-fields input")).forEach((function(e){e.addEventListener("keyup",(function(e){"Enter"===e.key&&(t.style.display="flex",l.submit())}))}))}))}))}))}))}},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",c):c());var i=window;for(var d in t)i[d]=t[d];t.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
@@ -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{align-items:center;background:#fff;border-radius:5px;display:flex;height:100%;justify-content:center;right:50%;opacity:.5;position:absolute;top:50%;transform:translate(50%,-50%);width:100%}.newspack-blocks-checkout-modal__spinner>span,.newspack-blocks-variation-modal__spinner>span{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:2px solid #fff;border-top-color:#767676;border-radius:50%;height:25px;width:25px}.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;overflow:auto;border-radius:5px}.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}}
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-modal{position:fixed;top:0;right:0;width:100%;height:100%;background:rgba(0,0,0,.75);z-index:99999}.newspack-blocks-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-modal__content>:not(.newspack-blocks-modal__close){width:100%;height:100%;border:0;border-radius:5px}.newspack-blocks-modal__spinner{align-items:center;background:#fff;border-radius:5px;display:flex;height:100%;justify-content:center;right:50%;opacity:.5;position:absolute;top:50%;transform:translate(50%,-50%);width:100%}.newspack-blocks-modal__spinner>span{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:2px solid #fff;border-top-color:#767676;border-radius:50%;height:25px;width:25px}.newspack-blocks-modal__close{position:absolute;top:0;left:0;padding:8px;border:0;background:transparent;color:#111;cursor:pointer}.newspack-blocks-modal__close:focus,.newspack-blocks-modal__close:hover{color:#767676}.newspack-blocks-modal__close svg{display:block}.newspack-blocks-variation-modal .newspack-blocks-modal__content{padding:32px;overflow:auto;border-radius:5px}.newspack-blocks-variation-modal .newspack-blocks-modal__content h3{margin:0 0 1em}.newspack-blocks-variation-modal .newspack-blocks-modal__content p{font-size:.8em}.newspack-blocks-variation-modal .newspack-blocks-modal__content form{margin:0 0 .5em}.newspack-blocks-variation-modal .newspack-blocks-modal__content form:last-child{margin:0}.newspack-blocks-variation-modal .newspack-blocks-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 .newspack-blocks-modal__content form button>span{display:block}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .summary{width:100%;display:flex;justify-content:space-between;align-items:flex-end}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .summary .subscription-details bdi{font-size:inherit}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .price{max-width:65%}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .variation_name{font-weight:600;font-size:.9em;margin-right:.5em}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button .description{padding-top:1em;margin-top:1em;font-size:.9em;border-top:1px solid #ccc}.newspack-blocks-variation-modal .newspack-blocks-modal__content form button bdi{font-weight:600;font-size:1.8em}@media(max-width:600px){.newspack-blocks-modal__content{max-width:100%;width:100%;border-radius:0;top:auto;bottom:0;right:0;transform:none}.newspack-blocks-modal__content>:not(.newspack-blocks-modal__close){border-radius:0}}
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => '19ab2e7294a2c4c06e391ff7dc1117ca');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'b1f62d78326801157cf83d3b15ba6ff2');
@@ -1 +1 @@
1
- #newspack_modal_checkout{padding:32px;font-size:1rem}#newspack_modal_checkout .order-details-summary{border:2px solid;border-radius:3px;padding:16px}#newspack_modal_checkout .order-details-summary h4{font-size:1rem;margin:0}#newspack_modal_checkout .order-details-summary h4>span{color:inherit;font-size:clamp(1.75rem,1.75rem + (1vw - .48rem)*.962,2.25rem);font-weight:700;line-height:1.434}#newspack_modal_checkout .order-details-summary h4 .subscription-details{font-size:1rem;font-weight:400}#newspack_modal_checkout #order-details-wrapper.hidden{display:none}#newspack_modal_checkout .woocommerce-checkout-review-order-table,#newspack_modal_checkout .woocommerce-NoticeGroup{margin-top:16px}#newspack_modal_checkout .woocommerce-checkout-review-order-table td,#newspack_modal_checkout .woocommerce-checkout-review-order-table th{font-size:.8rem}#newspack_modal_checkout .woocommerce-checkout-review-order-table.empty{display:none;margin:0;padding:0}#newspack_modal_checkout .woocommerce-billing-fields{margin-bottom:16px}#newspack_modal_checkout .checkout-billing-summary{border-bottom:1px solid #ccc;padding-bottom:32px}#newspack_modal_checkout .checkout-billing-summary__grid{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}#newspack_modal_checkout .checkout-billing-summary p{font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);margin:16px 0 0}#newspack_modal_checkout .checkout-billing-summary .edit-billing-link{color:#767676;font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);display:inline-block;text-decoration:underline}#newspack_modal_checkout .checkout-billing-summary .edit-billing-link:focus,#newspack_modal_checkout .checkout-billing-summary .edit-billing-link:hover{color:inherit}#newspack_modal_checkout .woocommerce-account-fields .create-account{border-bottom:1px solid #ccc;padding-bottom:32px}#newspack_modal_checkout .woocommerce-account-fields .create-account .woocommerce-password-hint,#newspack_modal_checkout .woocommerce-account-fields .create-account .woocommerce-password-strength{color:#cc1818;margin-top:16px}#newspack_modal_checkout form,#newspack_modal_checkout form #wc-stripe-payment-request-button-separator{margin:0}#newspack_modal_checkout form .woocommerce-terms-and-conditions-wrapper{margin:16px 0}#newspack_modal_checkout form h3{font-size:1.37rem;margin:32px 0 0}#newspack_modal_checkout form p{margin:16px 0}#newspack_modal_checkout form .select2-container .select2-selection--single{margin:0}#newspack_modal_checkout form #payment button#place_order{margin-bottom:0}#newspack_modal_checkout form .checkout-billing button[type=submit],#newspack_modal_checkout form button.modal-continue{display:block;width:100%}#newspack_modal_checkout .form-row-first,#newspack_modal_checkout .form-row-last{width:calc(50% - 8px)}#newspack_modal_checkout .form-row-last+.form-row-first,#newspack_modal_checkout .form-row-wide+.form-row-first,#newspack_modal_checkout .form-row-wide+.form-row-first+.form-row-last{margin-top:0}#newspack_modal_checkout .select2-container--default .select2-selection--single{border-color:#ccc;border-radius:0;height:44px}#newspack_modal_checkout .select2-container--default .select2-selection--single .select2-selection__rendered{color:inherit;line-height:44px}#newspack_modal_checkout .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px}#newspack_modal_checkout .wc_payment_method .payment_box{background:#f0f0f0;border-radius:3px;padding:16px}#newspack_modal_checkout .wc_payment_method .payment_box p{margin-top:0}#newspack_modal_checkout .wc-saved-payment-methods{padding:0}#newspack_modal_checkout .woocommerce-error{border-radius:3px;margin:0}#newspack_modal_checkout .woocommerce-notices-wrapper:not(:empty){margin-bottom:32px}#newspack_modal_checkout .woocommerce-privacy-policy-text{color:#767676}#newspack_modal_checkout .woocommerce-privacy-policy-text p{font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);margin:0}#newspack_modal_checkout .woocommerce-thankyou-order-received{align-items:center;border-bottom:1px solid #ccc;display:flex;flex-direction:column;justify-content:center;margin:0 0 32px;padding:0 0 32px}#newspack_modal_checkout .woocommerce-thankyou-order-received:before{-webkit-animation:bounce .25s ease-in;animation:bounce .25s ease-in;-webkit-animation-delay:1s;animation-delay:1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;background-color:#4ab866;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z' fill='%23fff'/%3E%3C/svg%3E");background-position:50% 50%;background-repeat:no-repeat;background-size:24px;border-radius:50%;content:"";display:block;height:40px;margin-bottom:16px;padding:8px;transform:scale(0);width:40px}#newspack_modal_checkout .woocommerce-form-login-toggle,#newspack_modal_checkout .woocommerce-thankyou-order-received+.woocommerce-info{display:none}#newspack_modal_checkout .woocommerce-order-overview{color:#767676;list-style:none;margin:16px 0 0;padding:0}#newspack_modal_checkout .blockOverlay{align-items:center;display:flex;inset:0;justify-content:center;position:fixed!important}#newspack_modal_checkout .blockOverlay:after{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:2px solid #fff;border-top-color:#767676;border-radius:50%;content:"";display:block;height:25px;width:25px}@-webkit-keyframes bounce{0%{transform:scale(0)}90%{transform:scale(1.4)}to{transform:scale(1)}}@keyframes bounce{0%{transform:scale(0)}90%{transform:scale(1.4)}to{transform:scale(1)}}
1
+ #newspack_modal_checkout{padding:32px;font-size:1rem}#newspack_modal_checkout .order-details-summary{border:2px solid;border-radius:3px;padding:16px}#newspack_modal_checkout .order-details-summary h4{font-size:1rem;margin:0}#newspack_modal_checkout .order-details-summary h4>span{color:inherit;font-size:clamp(1.75rem,1.75rem + (1vw - .48rem)*.962,2.25rem);font-weight:700;line-height:1.434}#newspack_modal_checkout .order-details-summary h4 .subscription-details{font-size:1rem;font-weight:400}#newspack_modal_checkout #order-details-wrapper.hidden{display:none}#newspack_modal_checkout .woocommerce-checkout-review-order-table,#newspack_modal_checkout .woocommerce-NoticeGroup{margin-top:16px}#newspack_modal_checkout .woocommerce-checkout-review-order-table td,#newspack_modal_checkout .woocommerce-checkout-review-order-table th{font-size:.8rem}#newspack_modal_checkout .woocommerce-checkout-review-order-table.empty{display:none;margin:0;padding:0}#newspack_modal_checkout .woocommerce-billing-fields{margin-bottom:16px}#newspack_modal_checkout .checkout-billing-summary{border-bottom:1px solid #ccc;padding-bottom:32px}#newspack_modal_checkout .checkout-billing-summary__grid{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}#newspack_modal_checkout .checkout-billing-summary p{font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);margin:16px 0 0}#newspack_modal_checkout .checkout-billing-summary .edit-billing-link{color:#767676;font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);display:inline-block;text-decoration:underline}#newspack_modal_checkout .checkout-billing-summary .edit-billing-link:focus,#newspack_modal_checkout .checkout-billing-summary .edit-billing-link:hover{color:inherit}#newspack_modal_checkout .woocommerce-account-fields .create-account{border-bottom:1px solid #ccc;padding-bottom:32px}#newspack_modal_checkout .woocommerce-account-fields .create-account .woocommerce-password-hint,#newspack_modal_checkout .woocommerce-account-fields .create-account .woocommerce-password-strength{color:#cc1818;margin-top:16px}#newspack_modal_checkout form,#newspack_modal_checkout form #wc-stripe-payment-request-button-separator{margin:0}#newspack_modal_checkout form .woocommerce-terms-and-conditions-wrapper{margin:16px 0}#newspack_modal_checkout form h3{font-size:1.37rem;margin:32px 0 0}#newspack_modal_checkout form p{margin:16px 0}#newspack_modal_checkout form .select2-container .select2-selection--single{margin:0}#newspack_modal_checkout form #payment button#place_order{margin-bottom:0}#newspack_modal_checkout form .checkout-billing button[type=submit],#newspack_modal_checkout form button.modal-continue{display:block;width:100%}#newspack_modal_checkout .form-row-first,#newspack_modal_checkout .form-row-last{width:calc(50% - 8px)}#newspack_modal_checkout .form-row-last+.form-row-first,#newspack_modal_checkout .form-row-wide+.form-row-first,#newspack_modal_checkout .form-row-wide+.form-row-first+.form-row-last{margin-top:0}#newspack_modal_checkout .select2-container--default .select2-selection--single{border-color:#ccc;border-radius:0;height:44px}#newspack_modal_checkout .select2-container--default .select2-selection--single .select2-selection__rendered{color:inherit;line-height:44px}#newspack_modal_checkout .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px}#newspack_modal_checkout .wc_payment_method .payment_box{background:#f0f0f0;border-radius:3px;padding:16px}#newspack_modal_checkout .wc_payment_method .payment_box p{margin-top:0}#newspack_modal_checkout .wc-saved-payment-methods{padding:0}#newspack_modal_checkout .woocommerce-error{border-radius:3px;margin:0}#newspack_modal_checkout .woocommerce-notices-wrapper:not(:empty){margin-bottom:32px}#newspack_modal_checkout .woocommerce-privacy-policy-text{color:#767676}#newspack_modal_checkout .woocommerce-privacy-policy-text p{font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);margin:0}#newspack_modal_checkout .woocommerce-thankyou-order-received{align-items:center;border-bottom:1px solid #ccc;display:flex;flex-direction:column;justify-content:center;margin:0 0 32px;padding:0 0 32px}#newspack_modal_checkout .woocommerce-thankyou-order-received:before{-webkit-animation:bounce .25s ease-in;animation:bounce .25s ease-in;-webkit-animation-delay:1s;animation-delay:1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;background-color:#4ab866;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z' fill='%23fff'/%3E%3C/svg%3E");background-position:50% 50%;background-repeat:no-repeat;background-size:24px;border-radius:50%;content:"";display:block;height:40px;margin-bottom:16px;padding:8px;transform:scale(0);width:40px}#newspack_modal_checkout .woocommerce-form-login-toggle,#newspack_modal_checkout .woocommerce-thankyou-order-received+.woocommerce-info{display:none}#newspack_modal_checkout .woocommerce-order-overview{color:#767676;list-style:none;margin:16px 0 0;padding:0}#newspack_modal_checkout .blockOverlay{align-items:center;display:flex;inset:0;justify-content:center;position:fixed!important}#newspack_modal_checkout .blockOverlay:after{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:2px solid #fff;border-top-color:#767676;border-radius:50%;content:"";display:block;height:25px;width:25px}.newspack-modal-newsletters{margin-top:20px;padding-top:22px;border-top:1px solid #ccc}.newspack-modal-newsletters__info{margin-bottom:35px}.newspack-modal-newsletters__info span{color:#767676}.newspack-modal-newsletters__list-item{display:flex;margin-bottom:18px;border:1px solid #ccc;border-radius:6px}.newspack-modal-newsletters__list-item b{display:block;margin-bottom:2px}.newspack-modal-newsletters label{flex:1;padding:12px;cursor:pointer}.newspack-modal-newsletters input[type=checkbox]{padding:10px;margin-top:18px;margin-right:19px;margin-left:20px;border-radius:5px}.newspack-modal-newsletters__button,.newspack-modal-newsletters input[type=submit]{margin-top:25px;width:100%;padding:22px;font-size:1em}@-webkit-keyframes bounce{0%{transform:scale(0)}90%{transform:scale(1.4)}to{transform:scale(1)}}@keyframes bounce{0%{transform:scale(0)}90%{transform:scale(1.4)}to{transform:scale(1)}}
@@ -1 +1 @@
1
- #newspack_modal_checkout{padding:32px;font-size:1rem}#newspack_modal_checkout .order-details-summary{border:2px solid;border-radius:3px;padding:16px}#newspack_modal_checkout .order-details-summary h4{font-size:1rem;margin:0}#newspack_modal_checkout .order-details-summary h4>span{color:inherit;font-size:clamp(1.75rem,1.75rem + (1vw - .48rem)*.962,2.25rem);font-weight:700;line-height:1.434}#newspack_modal_checkout .order-details-summary h4 .subscription-details{font-size:1rem;font-weight:400}#newspack_modal_checkout #order-details-wrapper.hidden{display:none}#newspack_modal_checkout .woocommerce-checkout-review-order-table,#newspack_modal_checkout .woocommerce-NoticeGroup{margin-top:16px}#newspack_modal_checkout .woocommerce-checkout-review-order-table td,#newspack_modal_checkout .woocommerce-checkout-review-order-table th{font-size:.8rem}#newspack_modal_checkout .woocommerce-checkout-review-order-table.empty{display:none;margin:0;padding:0}#newspack_modal_checkout .woocommerce-billing-fields{margin-bottom:16px}#newspack_modal_checkout .checkout-billing-summary{border-bottom:1px solid #ccc;padding-bottom:32px}#newspack_modal_checkout .checkout-billing-summary__grid{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}#newspack_modal_checkout .checkout-billing-summary p{font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);margin:16px 0 0}#newspack_modal_checkout .checkout-billing-summary .edit-billing-link{color:#767676;font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);display:inline-block;text-decoration:underline}#newspack_modal_checkout .checkout-billing-summary .edit-billing-link:focus,#newspack_modal_checkout .checkout-billing-summary .edit-billing-link:hover{color:inherit}#newspack_modal_checkout .woocommerce-account-fields .create-account{border-bottom:1px solid #ccc;padding-bottom:32px}#newspack_modal_checkout .woocommerce-account-fields .create-account .woocommerce-password-hint,#newspack_modal_checkout .woocommerce-account-fields .create-account .woocommerce-password-strength{color:#cc1818;margin-top:16px}#newspack_modal_checkout form,#newspack_modal_checkout form #wc-stripe-payment-request-button-separator{margin:0}#newspack_modal_checkout form .woocommerce-terms-and-conditions-wrapper{margin:16px 0}#newspack_modal_checkout form h3{font-size:1.37rem;margin:32px 0 0}#newspack_modal_checkout form p{margin:16px 0}#newspack_modal_checkout form .select2-container .select2-selection--single{margin:0}#newspack_modal_checkout form #payment button#place_order{margin-bottom:0}#newspack_modal_checkout form .checkout-billing button[type=submit],#newspack_modal_checkout form button.modal-continue{display:block;width:100%}#newspack_modal_checkout .form-row-first,#newspack_modal_checkout .form-row-last{width:calc(50% - 8px)}#newspack_modal_checkout .form-row-last+.form-row-first,#newspack_modal_checkout .form-row-wide+.form-row-first,#newspack_modal_checkout .form-row-wide+.form-row-first+.form-row-last{margin-top:0}#newspack_modal_checkout .select2-container--default .select2-selection--single{border-color:#ccc;border-radius:0;height:44px}#newspack_modal_checkout .select2-container--default .select2-selection--single .select2-selection__rendered{color:inherit;line-height:44px}#newspack_modal_checkout .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px}#newspack_modal_checkout .wc_payment_method .payment_box{background:#f0f0f0;border-radius:3px;padding:16px}#newspack_modal_checkout .wc_payment_method .payment_box p{margin-top:0}#newspack_modal_checkout .wc-saved-payment-methods{padding:0}#newspack_modal_checkout .woocommerce-error{border-radius:3px;margin:0}#newspack_modal_checkout .woocommerce-notices-wrapper:not(:empty){margin-bottom:32px}#newspack_modal_checkout .woocommerce-privacy-policy-text{color:#767676}#newspack_modal_checkout .woocommerce-privacy-policy-text p{font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);margin:0}#newspack_modal_checkout .woocommerce-thankyou-order-received{align-items:center;border-bottom:1px solid #ccc;display:flex;flex-direction:column;justify-content:center;margin:0 0 32px;padding:0 0 32px}#newspack_modal_checkout .woocommerce-thankyou-order-received:before{-webkit-animation:bounce .25s ease-in;animation:bounce .25s ease-in;-webkit-animation-delay:1s;animation-delay:1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;background-color:#4ab866;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z' fill='%23fff'/%3E%3C/svg%3E");background-position:50% 50%;background-repeat:no-repeat;background-size:24px;border-radius:50%;content:"";display:block;height:40px;margin-bottom:16px;padding:8px;transform:scale(0);width:40px}#newspack_modal_checkout .woocommerce-form-login-toggle,#newspack_modal_checkout .woocommerce-thankyou-order-received+.woocommerce-info{display:none}#newspack_modal_checkout .woocommerce-order-overview{color:#767676;list-style:none;margin:16px 0 0;padding:0}#newspack_modal_checkout .blockOverlay{align-items:center;display:flex;inset:0;justify-content:center;position:fixed!important}#newspack_modal_checkout .blockOverlay:after{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:2px solid #fff;border-top-color:#767676;border-radius:50%;content:"";display:block;height:25px;width:25px}@-webkit-keyframes bounce{0%{transform:scale(0)}90%{transform:scale(1.4)}to{transform:scale(1)}}@keyframes bounce{0%{transform:scale(0)}90%{transform:scale(1.4)}to{transform:scale(1)}}
1
+ #newspack_modal_checkout{padding:32px;font-size:1rem}#newspack_modal_checkout .order-details-summary{border:2px solid;border-radius:3px;padding:16px}#newspack_modal_checkout .order-details-summary h4{font-size:1rem;margin:0}#newspack_modal_checkout .order-details-summary h4>span{color:inherit;font-size:clamp(1.75rem,1.75rem + (1vw - .48rem)*.962,2.25rem);font-weight:700;line-height:1.434}#newspack_modal_checkout .order-details-summary h4 .subscription-details{font-size:1rem;font-weight:400}#newspack_modal_checkout #order-details-wrapper.hidden{display:none}#newspack_modal_checkout .woocommerce-checkout-review-order-table,#newspack_modal_checkout .woocommerce-NoticeGroup{margin-top:16px}#newspack_modal_checkout .woocommerce-checkout-review-order-table td,#newspack_modal_checkout .woocommerce-checkout-review-order-table th{font-size:.8rem}#newspack_modal_checkout .woocommerce-checkout-review-order-table.empty{display:none;margin:0;padding:0}#newspack_modal_checkout .woocommerce-billing-fields{margin-bottom:16px}#newspack_modal_checkout .checkout-billing-summary{border-bottom:1px solid #ccc;padding-bottom:32px}#newspack_modal_checkout .checkout-billing-summary__grid{align-items:baseline;display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}#newspack_modal_checkout .checkout-billing-summary p{font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);margin:16px 0 0}#newspack_modal_checkout .checkout-billing-summary .edit-billing-link{color:#767676;font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);display:inline-block;text-decoration:underline}#newspack_modal_checkout .checkout-billing-summary .edit-billing-link:focus,#newspack_modal_checkout .checkout-billing-summary .edit-billing-link:hover{color:inherit}#newspack_modal_checkout .woocommerce-account-fields .create-account{border-bottom:1px solid #ccc;padding-bottom:32px}#newspack_modal_checkout .woocommerce-account-fields .create-account .woocommerce-password-hint,#newspack_modal_checkout .woocommerce-account-fields .create-account .woocommerce-password-strength{color:#cc1818;margin-top:16px}#newspack_modal_checkout form,#newspack_modal_checkout form #wc-stripe-payment-request-button-separator{margin:0}#newspack_modal_checkout form .woocommerce-terms-and-conditions-wrapper{margin:16px 0}#newspack_modal_checkout form h3{font-size:1.37rem;margin:32px 0 0}#newspack_modal_checkout form p{margin:16px 0}#newspack_modal_checkout form .select2-container .select2-selection--single{margin:0}#newspack_modal_checkout form #payment button#place_order{margin-bottom:0}#newspack_modal_checkout form .checkout-billing button[type=submit],#newspack_modal_checkout form button.modal-continue{display:block;width:100%}#newspack_modal_checkout .form-row-first,#newspack_modal_checkout .form-row-last{width:calc(50% - 8px)}#newspack_modal_checkout .form-row-last+.form-row-first,#newspack_modal_checkout .form-row-wide+.form-row-first,#newspack_modal_checkout .form-row-wide+.form-row-first+.form-row-last{margin-top:0}#newspack_modal_checkout .select2-container--default .select2-selection--single{border-color:#ccc;border-radius:0;height:44px}#newspack_modal_checkout .select2-container--default .select2-selection--single .select2-selection__rendered{color:inherit;line-height:44px}#newspack_modal_checkout .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px}#newspack_modal_checkout .wc_payment_method .payment_box{background:#f0f0f0;border-radius:3px;padding:16px}#newspack_modal_checkout .wc_payment_method .payment_box p{margin-top:0}#newspack_modal_checkout .wc-saved-payment-methods{padding:0}#newspack_modal_checkout .woocommerce-error{border-radius:3px;margin:0}#newspack_modal_checkout .woocommerce-notices-wrapper:not(:empty){margin-bottom:32px}#newspack_modal_checkout .woocommerce-privacy-policy-text{color:#767676}#newspack_modal_checkout .woocommerce-privacy-policy-text p{font-size:clamp(.75rem,.75rem + (1vw - .48rem)*.481,1rem);margin:0}#newspack_modal_checkout .woocommerce-thankyou-order-received{align-items:center;border-bottom:1px solid #ccc;display:flex;flex-direction:column;justify-content:center;margin:0 0 32px;padding:0 0 32px}#newspack_modal_checkout .woocommerce-thankyou-order-received:before{-webkit-animation:bounce .25s ease-in;animation:bounce .25s ease-in;-webkit-animation-delay:1s;animation-delay:1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;background-color:#4ab866;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z' fill='%23fff'/%3E%3C/svg%3E");background-position:50% 50%;background-repeat:no-repeat;background-size:24px;border-radius:50%;content:"";display:block;height:40px;margin-bottom:16px;padding:8px;transform:scale(0);width:40px}#newspack_modal_checkout .woocommerce-form-login-toggle,#newspack_modal_checkout .woocommerce-thankyou-order-received+.woocommerce-info{display:none}#newspack_modal_checkout .woocommerce-order-overview{color:#767676;list-style:none;margin:16px 0 0;padding:0}#newspack_modal_checkout .blockOverlay{align-items:center;display:flex;inset:0;justify-content:center;position:fixed!important}#newspack_modal_checkout .blockOverlay:after{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:2px solid #fff;border-top-color:#767676;border-radius:50%;content:"";display:block;height:25px;width:25px}.newspack-modal-newsletters{margin-top:20px;padding-top:22px;border-top:1px solid #ccc}.newspack-modal-newsletters__info{margin-bottom:35px}.newspack-modal-newsletters__info span{color:#767676}.newspack-modal-newsletters__list-item{display:flex;margin-bottom:18px;border:1px solid #ccc;border-radius:6px}.newspack-modal-newsletters__list-item b{display:block;margin-bottom:2px}.newspack-modal-newsletters label{flex:1;padding:12px;cursor:pointer}.newspack-modal-newsletters input[type=checkbox]{padding:10px;margin-top:18px;margin-left:19px;margin-right:20px;border-radius:5px}.newspack-modal-newsletters__button,.newspack-modal-newsletters input[type=submit]{margin-top:25px;width:100%;padding:22px;font-size:1em}@-webkit-keyframes bounce{0%{transform:scale(0)}90%{transform:scale(1.4)}to{transform:scale(1)}}@keyframes bounce{0%{transform:scale(0)}90%{transform:scale(1.4)}to{transform:scale(1)}}
@@ -43,8 +43,6 @@ final class Modal_Checkout {
43
43
  add_filter( 'woocommerce_checkout_get_value', [ __CLASS__, 'woocommerce_checkout_get_value' ], 10, 2 );
44
44
  add_filter( 'woocommerce_checkout_fields', [ __CLASS__, 'woocommerce_checkout_fields' ] );
45
45
  add_filter( 'woocommerce_update_order_review_fragments', [ __CLASS__, 'order_review_fragments' ] );
46
- add_action( 'woocommerce_thankyou', [ __CLASS__, 'woocommerce_thankyou' ] ); // Core Woo, not present in Newspack theme custom template.
47
- add_action( 'newspack_woocommerce_thankyou', [ __CLASS__, 'woocommerce_thankyou' ] ); // Newspack Theme.
48
46
  }
49
47
 
50
48
  /**
@@ -168,15 +166,15 @@ final class Modal_Checkout {
168
166
  return;
169
167
  }
170
168
  ?>
171
- <div class="newspack-blocks-checkout-modal" style="display: none;">
172
- <div class="newspack-blocks-checkout-modal__content">
173
- <a href="#" class="newspack-blocks-checkout-modal__close">
169
+ <div class="newspack-blocks-checkout-modal newspack-blocks-modal" style="display: none;">
170
+ <div class="newspack-blocks-modal__content">
171
+ <a href="#" class="newspack-blocks-modal__close">
174
172
  <span class="screen-reader-text"><?php esc_html_e( 'Close', 'newspack-blocks' ); ?></span>
175
173
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false">
176
174
  <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>
177
175
  </svg>
178
176
  </a>
179
- <div class="newspack-blocks-checkout-modal__spinner">
177
+ <div class="newspack-blocks-modal__spinner">
180
178
  <span></span>
181
179
  </div>
182
180
  </div>
@@ -195,9 +193,9 @@ final class Modal_Checkout {
195
193
  continue;
196
194
  }
197
195
  ?>
198
- <div class="newspack-blocks-variation-modal" data-product-id="<?php echo esc_attr( $product_id ); ?>" style="display:none;">
199
- <div class="newspack-blocks-variation-modal__content">
200
- <a href="#" class="newspack-blocks-variation-modal__close">
196
+ <div class="newspack-blocks-variation-modal newspack-blocks-modal" data-product-id="<?php echo esc_attr( $product_id ); ?>" style="display:none;">
197
+ <div class="newspack-blocks-modal__content">
198
+ <a href="#" class="newspack-blocks-modal__close">
201
199
  <span class="screen-reader-text"><?php esc_html_e( 'Close', 'newspack-blocks' ); ?></span>
202
200
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false">
203
201
  <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>
@@ -209,9 +207,9 @@ final class Modal_Checkout {
209
207
  <?php
210
208
  $variations = $product->get_available_variations( 'objects' );
211
209
  foreach ( $variations as $variation ) {
212
- $name = $variation->get_formatted_variation_attributes( true );
210
+ $name = wc_get_formatted_variation( $variation, true );
213
211
  $price = $variation->get_price_html();
214
- $description = $variation->get_variation_description();
212
+ $description = $variation->get_description();
215
213
  ?>
216
214
  <form>
217
215
  <input type="hidden" name="newspack_checkout" value="1" />
@@ -365,7 +363,10 @@ final class Modal_Checkout {
365
363
  $custom_templates = [
366
364
  'checkout/form-checkout.php' => 'src/modal-checkout/templates/checkout-form.php',
367
365
  'checkout/form-billing.php' => 'src/modal-checkout/templates/billing-form.php',
368
- 'global/form-login.php' => 'src/modal-checkout/templates/form-login.php',
366
+ 'checkout/thankyou.php' => 'src/modal-checkout/templates/thankyou.php',
367
+ // Replace the login form with the order summary if using the modal checkout. This is
368
+ // for the case where the reader used an existing email address.
369
+ 'global/form-login.php' => 'src/modal-checkout/templates/thankyou.php',
369
370
  ];
370
371
 
371
372
  foreach ( $custom_templates as $original_template => $custom_template ) {
@@ -565,7 +566,7 @@ final class Modal_Checkout {
565
566
  *
566
567
  * @return void
567
568
  */
568
- public static function woocommerce_thankyou() {
569
+ public static function render_checkout_after_success_markup() {
569
570
  // phpcs:disable WordPress.Security.NonceVerification.Recommended
570
571
  if (
571
572
  empty( $_REQUEST['modal_checkout'] ) ||
@@ -589,5 +590,165 @@ final class Modal_Checkout {
589
590
  <?php
590
591
  // phpcs:enable
591
592
  }
593
+
594
+ /**
595
+ * Renders newsletter signup form.
596
+ *
597
+ * @param WC_Order $order The order related to the transaction.
598
+ */
599
+ public static function render_newsletter_signup_form( $order ) {
600
+ if ( ! self::is_newsletter_signup_available() ) {
601
+ return false;
602
+ }
603
+ $email_address = $order->get_billing_email();
604
+ if ( ! $email_address ) {
605
+ return;
606
+ }
607
+ if ( ! method_exists( '\Newspack\Reader_Activation', 'get_registration_newsletter_lists' ) ) {
608
+ return;
609
+ }
610
+ $newsletters_lists = array_filter(
611
+ \Newspack\Reader_Activation::get_registration_newsletter_lists(),
612
+ function( $item ) {
613
+ return $item['active'];
614
+ }
615
+ );
616
+ if ( empty( $newsletters_lists ) ) {
617
+ return;
618
+ }
619
+ ?>
620
+ <div class="newspack-modal-newsletters">
621
+ <h4><?php esc_html_e( 'Sign up for newsletters', 'newspack-blocks' ); ?></h4>
622
+ <div class="newspack-modal-newsletters__info">
623
+ <?php
624
+ echo esc_html(
625
+ sprintf(
626
+ // Translators: %s is the site name.
627
+ __( 'Get the best of %s directly in your email inbox.', 'newspack-blocks' ),
628
+ get_bloginfo( 'name' )
629
+ )
630
+ );
631
+ ?>
632
+ <br>
633
+ <span>
634
+ <?php
635
+ echo esc_html(
636
+ sprintf(
637
+ // Translators: %s is the user's email address.
638
+ __( 'Sending to: %s', 'newspack-blocks' ),
639
+ $email_address
640
+ )
641
+ );
642
+ ?>
643
+ </span>
644
+ </div>
645
+ <form>
646
+ <input type="hidden" name="modal_checkout" value="1" />
647
+ <input type="hidden" name="newsletter_signup_email" value="<?php echo esc_html( $email_address ); ?>" />
648
+ <?php
649
+ foreach ( $newsletters_lists as $list ) {
650
+ $checkbox_id = sprintf( 'newspack-blocks-list-%s', $list['id'] );
651
+ ?>
652
+ <div class="newspack-modal-newsletters__list-item">
653
+ <input
654
+ type="checkbox"
655
+ name="lists[]"
656
+ value="<?php echo \esc_attr( $list['id'] ); ?>"
657
+ id="<?php echo \esc_attr( $checkbox_id ); ?>"
658
+ <?php
659
+ if ( isset( $list['checked'] ) && $list['checked'] ) {
660
+ echo 'checked';
661
+ }
662
+ ?>
663
+ >
664
+ <label for="<?php echo \esc_attr( $checkbox_id ); ?>">
665
+ <b><?php echo \esc_html( $list['title'] ); ?></b>
666
+ <?php if ( ! empty( $list['description'] ) ) : ?>
667
+ <span><?php echo \esc_html( $list['description'] ); ?></span>
668
+ <?php endif; ?>
669
+ </label>
670
+ </div>
671
+ <?php
672
+ }
673
+ ?>
674
+ <input type="submit" value="<?php esc_html_e( 'Continue', 'newspack-blocks' ); ?>">
675
+ </form>
676
+ </div>
677
+ <?php
678
+ }
679
+
680
+ /**
681
+ * Should post-chcekout newsletter signup be available?
682
+ */
683
+ private static function is_newsletter_signup_available() {
684
+ return defined( 'NEWSPACK_ENABLE_POST_CHECKOUT_NEWSLETTER_SIGNUP' ) && NEWSPACK_ENABLE_POST_CHECKOUT_NEWSLETTER_SIGNUP;
685
+ }
686
+
687
+ /**
688
+ * Should newsletter confirmation be rendered?
689
+ */
690
+ public static function confirm_newsletter_signup() {
691
+ if ( ! self::is_newsletter_signup_available() ) {
692
+ return false;
693
+ }
694
+ $signup_data = self::get_newsletter_signup_data();
695
+ if ( false !== $signup_data ) {
696
+ $result = \Newspack_Newsletters_Subscription::add_contact(
697
+ [
698
+ 'email' => $signup_data['email'],
699
+ 'metadata' => [
700
+ 'current_page_url' => home_url( add_query_arg( array(), \wp_get_referer() ) ),
701
+ 'newsletters_subscription_method' => 'post-checkout',
702
+ ],
703
+ ],
704
+ $signup_data['lists']
705
+ );
706
+ if ( \is_wp_error( $result ) ) {
707
+ return $result;
708
+ }
709
+ return true;
710
+ }
711
+ return false;
712
+ }
713
+
714
+ /**
715
+ * Should newsletter confirmation be rendered?
716
+ */
717
+ public static function get_newsletter_signup_data() {
718
+ $newsletter_signup_email = isset( $_GET['newsletter_signup_email'] ) ? \sanitize_text_field( \wp_unslash( $_GET['newsletter_signup_email'] ) ) : false; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
719
+ if ( $newsletter_signup_email && isset( $_SERVER['REQUEST_URI'] ) ) {
720
+ parse_str( \wp_parse_url( \wp_unslash( $_SERVER['REQUEST_URI'] ) )['query'], $query ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
721
+ if ( isset( $query['lists'] ) && count( $query['lists'] ) ) {
722
+ return [
723
+ 'email' => $newsletter_signup_email,
724
+ 'lists' => $query['lists'],
725
+ ];
726
+ }
727
+ }
728
+ return false;
729
+ }
730
+
731
+ /**
732
+ * Renders newsletter signup confirmation.
733
+ */
734
+ public static function render_newsletter_confirmation() {
735
+ ?>
736
+ <h4><?php esc_html_e( 'Signup successful!', 'newspack-blocks' ); ?></h4>
737
+ <p>
738
+ <?php
739
+ echo esc_html(
740
+ sprintf(
741
+ // Translators: %s is the site name.
742
+ __( 'Thanks for supporting %s.', 'newspack-blocks' ),
743
+ get_option( 'blogname' )
744
+ )
745
+ );
746
+ ?>
747
+ </p>
748
+ <button onclick="parent.newspackCloseModalCheckout(this);" class="newspack-modal-newsletters__button">
749
+ <?php esc_html_e( 'Close', 'newspack-blocks' ); ?>
750
+ </button>
751
+ <?php
752
+ }
592
753
  }
593
754
  Modal_Checkout::init();
@@ -7,7 +7,7 @@
7
7
  * Author URI: https://newspack.com/
8
8
  * Text Domain: newspack-blocks
9
9
  * Domain Path: /languages
10
- * Version: 2.0.0-alpha.2
10
+ * Version: 2.0.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', '2.0.0-alpha.2' );
18
+ define( 'NEWSPACK_BLOCKS__VERSION', '2.0.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
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@automattic/newspack-blocks",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0",
4
4
  "author": "Automattic",
5
5
  "devDependencies": {
6
- "@rushstack/eslint-patch": "^1.3.3",
6
+ "@rushstack/eslint-patch": "^1.5.1",
7
7
  "@testing-library/dom": "^8.20.0",
8
8
  "@testing-library/user-event": "^14.4.3",
9
9
  "@types/lodash": "^4.14.196",
@@ -14,7 +14,7 @@
14
14
  "identity-obj-proxy": "^3.0.0",
15
15
  "lint-staged": "^13.2.3",
16
16
  "newspack-scripts": "^5.1.0",
17
- "postcss-scss": "^4.0.6",
17
+ "postcss-scss": "^4.0.9",
18
18
  "prettier": "npm:wp-prettier@^2.6.2-beta-1",
19
19
  "stylelint": "^15.10.3"
20
20
  },
@@ -213,6 +213,47 @@
213
213
  }
214
214
  }
215
215
 
216
+ .newspack-modal-newsletters {
217
+ margin-top: 20px;
218
+ padding-top: 22px;
219
+ border-top: 1px solid colors.$color__border;
220
+ &__info {
221
+ margin-bottom: 35px;
222
+ span {
223
+ color: colors.$color__text-light;
224
+ }
225
+ }
226
+ &__list-item {
227
+ display: flex;
228
+ margin-bottom: 18px;
229
+ border: 1px solid colors.$color__border;
230
+ border-radius: 6px;
231
+ b {
232
+ display: block;
233
+ margin-bottom: 2px;
234
+ }
235
+ }
236
+ label {
237
+ flex: 1;
238
+ padding: 12px;
239
+ cursor: pointer;
240
+ }
241
+ input[type='checkbox'] {
242
+ padding: 10px;
243
+ margin-top: 18px;
244
+ margin-right: 19px;
245
+ margin-left: 20px;
246
+ border-radius: 5px;
247
+ }
248
+ input[type='submit'],
249
+ &__button {
250
+ margin-top: 25px;
251
+ width: 100%;
252
+ padding: 22px;
253
+ font-size: 1em;
254
+ }
255
+ }
256
+
216
257
  @keyframes bounce {
217
258
  0% {
218
259
  transform: scale( 0 );
@@ -30,8 +30,8 @@ const triggers =
30
30
 
31
31
  let iframeResizeObserver;
32
32
 
33
- function closeCheckout( element ) {
34
- const iframe = element.querySelector( 'iframe' );
33
+ function closeCheckout() {
34
+ const iframe = document.querySelector( 'iframe[name="newspack_modal_checkout"]' );
35
35
  if ( iframe ) {
36
36
  iframe.src = 'about:blank';
37
37
  }
@@ -39,9 +39,18 @@ function closeCheckout( element ) {
39
39
  if ( iframeResizeObserver ) {
40
40
  iframeResizeObserver.disconnect();
41
41
  }
42
- element.style.display = 'none';
42
+ Array.from( document.querySelectorAll( '.newspack-blocks-modal' ) ).forEach( el => {
43
+ el.style.display = 'none';
44
+ if ( el.overlayId && window.newspackReaderActivation?.overlays ) {
45
+ window.newspackReaderActivation?.overlays.remove( el.overlayId );
46
+ }
47
+ } );
43
48
  }
44
49
 
50
+ window.newspackCloseModalCheckout = closeCheckout;
51
+
52
+ const MODAL_CLASSNAME_BASE = '.newspack-blocks-modal';
53
+
45
54
  domReady( () => {
46
55
  /**
47
56
  * Initialize modal checkout.
@@ -50,29 +59,29 @@ domReady( () => {
50
59
  if ( ! modalCheckout ) {
51
60
  return;
52
61
  }
53
- const spinner = document.querySelector( '.newspack-blocks-checkout-modal__spinner' );
62
+ const spinner = document.querySelector( `${ MODAL_CLASSNAME_BASE }__spinner` );
54
63
  const iframeName = 'newspack_modal_checkout';
55
64
  const modalCheckoutInput = document.createElement( 'input' );
56
65
  modalCheckoutInput.type = 'hidden';
57
66
  modalCheckoutInput.name = 'modal_checkout';
58
67
  modalCheckoutInput.value = '1';
59
- const modalContent = modalCheckout.querySelector( '.newspack-blocks-checkout-modal__content' );
68
+ const modalContent = modalCheckout.querySelector( `${ MODAL_CLASSNAME_BASE }__content` );
60
69
  const initialHeight = modalContent.clientHeight + 'px';
61
70
  const iframe = document.createElement( 'iframe' );
62
71
  iframe.name = iframeName;
63
72
  modalContent.appendChild( iframe );
64
73
  modalCheckout.addEventListener( 'click', ev => {
65
74
  if ( ev.target === modalCheckout ) {
66
- closeCheckout( modalCheckout );
75
+ closeCheckout();
67
76
  }
68
77
  } );
69
- const closeButtons = modalCheckout.querySelectorAll( '.newspack-blocks-checkout-modal__close' );
78
+ const closeButtons = modalCheckout.querySelectorAll( `${ MODAL_CLASSNAME_BASE }__close` );
70
79
  closeButtons.forEach( button => {
71
80
  button.addEventListener( 'click', ev => {
72
81
  ev.preventDefault();
73
82
  modalContent.style.height = initialHeight;
74
83
  spinner.style.display = 'flex';
75
- closeCheckout( modalCheckout );
84
+ closeCheckout();
76
85
  } );
77
86
  } );
78
87
 
@@ -83,17 +92,15 @@ domReady( () => {
83
92
  variationModals.forEach( variationModal => {
84
93
  variationModal.addEventListener( 'click', ev => {
85
94
  if ( ev.target === variationModal ) {
86
- closeCheckout( variationModal );
95
+ closeCheckout();
87
96
  }
88
97
  } );
89
- variationModal
90
- .querySelectorAll( '.newspack-blocks-variation-modal__close' )
91
- .forEach( button => {
92
- button.addEventListener( 'click', ev => {
93
- ev.preventDefault();
94
- closeCheckout( variationModal );
95
- } );
98
+ variationModal.querySelectorAll( '.newspack-blocks-modal__close' ).forEach( button => {
99
+ button.addEventListener( 'click', ev => {
100
+ ev.preventDefault();
101
+ closeCheckout();
96
102
  } );
103
+ } );
97
104
  } );
98
105
 
99
106
  /**
@@ -139,6 +146,10 @@ domReady( () => {
139
146
  spinner.style.display = 'flex';
140
147
  modalCheckout.style.display = 'block';
141
148
  document.body.classList.add( 'newspack-modal-checkout-open' );
149
+ if ( window.newspackReaderActivation?.overlays ) {
150
+ modalCheckout.overlayId = window.newspackReaderActivation?.overlays.add();
151
+ }
152
+
142
153
  iframeResizeObserver = new ResizeObserver( entries => {
143
154
  if ( ! entries || ! entries.length ) {
144
155
  return;
@@ -13,8 +13,7 @@
13
13
  }
14
14
  }
15
15
 
16
- .newspack-blocks-checkout-modal,
17
- .newspack-blocks-variation-modal {
16
+ .newspack-blocks-modal {
18
17
  position: fixed;
19
18
  top: 0;
20
19
  left: 0;
@@ -33,7 +32,7 @@
33
32
  max-height: calc( 100vh - 32px );
34
33
  background: colors.$color__background-body;
35
34
  border-radius: 5px;
36
- > *:not( .newspack-blocks-checkout-modal__close, .newspack-blocks-variation-modal__close ) {
35
+ > *:not( .newspack-blocks-modal__close ) {
37
36
  width: 100%;
38
37
  height: 100%;
39
38
  border: 0;
@@ -82,62 +81,64 @@
82
81
  }
83
82
 
84
83
  .newspack-blocks-variation-modal {
85
- &__content {
86
- padding: 32px;
87
- overflow: auto;
88
- border-radius: 5px;
89
- h3 {
90
- margin: 0 0 1em;
91
- }
92
- p {
93
- font-size: 0.8em;
94
- }
95
- form {
96
- margin: 0 0 0.5em;
97
- &:last-child {
98
- margin: 0;
84
+ .newspack-blocks-modal {
85
+ &__content {
86
+ padding: 32px;
87
+ overflow: auto;
88
+ border-radius: 5px;
89
+ h3 {
90
+ margin: 0 0 1em;
99
91
  }
100
- button {
101
- display: block;
102
- width: 100%;
103
- padding: 16px;
104
- margin: 0;
105
- border: 1px solid colors.$color__border;
106
- background: transparent;
107
- color: colors.$color__text-main;
108
- text-align: inherit;
109
- font-weight: inherit;
110
- > span {
111
- display: block;
92
+ p {
93
+ font-size: 0.8em;
94
+ }
95
+ form {
96
+ margin: 0 0 0.5em;
97
+ &:last-child {
98
+ margin: 0;
112
99
  }
113
- .summary {
100
+ button {
101
+ display: block;
114
102
  width: 100%;
115
- display: flex;
116
- justify-content: space-between;
117
- align-items: flex-end;
118
- .subscription-details {
119
- bdi {
120
- font-size: inherit;
103
+ padding: 16px;
104
+ margin: 0;
105
+ border: 1px solid colors.$color__border;
106
+ background: transparent;
107
+ color: colors.$color__text-main;
108
+ text-align: inherit;
109
+ font-weight: inherit;
110
+ > span {
111
+ display: block;
112
+ }
113
+ .summary {
114
+ width: 100%;
115
+ display: flex;
116
+ justify-content: space-between;
117
+ align-items: flex-end;
118
+ .subscription-details {
119
+ bdi {
120
+ font-size: inherit;
121
+ }
121
122
  }
122
123
  }
123
- }
124
- .price {
125
- max-width: 65%;
126
- }
127
- .variation_name {
128
- font-weight: 600;
129
- font-size: 0.9em;
130
- margin-left: 0.5em;
131
- }
132
- .description {
133
- padding-top: 1em;
134
- margin-top: 1em;
135
- font-size: 0.9em;
136
- border-top: 1px solid colors.$color__border;
137
- }
138
- bdi {
139
- font-weight: 600;
140
- font-size: 1.8em;
124
+ .price {
125
+ max-width: 65%;
126
+ }
127
+ .variation_name {
128
+ font-weight: 600;
129
+ font-size: 0.9em;
130
+ margin-left: 0.5em;
131
+ }
132
+ .description {
133
+ padding-top: 1em;
134
+ margin-top: 1em;
135
+ font-size: 0.9em;
136
+ border-top: 1px solid colors.$color__border;
137
+ }
138
+ bdi {
139
+ font-weight: 600;
140
+ font-size: 1.8em;
141
+ }
141
142
  }
142
143
  }
143
144
  }
@@ -145,8 +146,7 @@
145
146
  }
146
147
 
147
148
  @media ( max-width: 600px ) {
148
- .newspack-blocks-checkout-modal,
149
- .newspack-blocks-variation-modal {
149
+ .newspack-blocks-modal {
150
150
  &__content {
151
151
  max-width: 100%;
152
152
  width: 100%;
@@ -155,7 +155,7 @@
155
155
  bottom: 0;
156
156
  left: 0;
157
157
  transform: none;
158
- > *:not( .newspack-blocks-variation-modal__close, .newspack-blocks-checkout-modal__close ) {
158
+ > *:not( .newspack-blocks-modal__close ) {
159
159
  border-radius: 0;
160
160
  }
161
161
  }
@@ -31,14 +31,24 @@ function newspack_blocks_replace_login_with_order_summary() {
31
31
  $key = isset( $_GET['key'] ) ? \wc_clean( \sanitize_text_field( \wp_unslash( $_GET['key'] ) ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
32
32
  $is_valid = $order && is_a( $order, 'WC_Order' ) && hash_equals( $order->get_order_key(), $key ); // Validate order key to prevent CSRF.
33
33
 
34
+ // Handle the newsletter signup form.
35
+ $newsletter_confirmation = \Newspack_Blocks\Modal_Checkout::confirm_newsletter_signup();
36
+ if ( true === $newsletter_confirmation ) {
37
+ echo \Newspack_Blocks\Modal_Checkout::render_newsletter_confirmation(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
38
+ return;
39
+ } elseif ( \is_wp_error( $newsletter_confirmation ) ) {
40
+ echo esc_html( $newsletter_confirmation->get_error_message() );
41
+ return;
42
+ }
43
+
34
44
  if ( ! $is_valid ) {
35
45
  return;
36
46
  }
47
+
37
48
  ?>
38
49
 
39
50
  <div class="woocommerce-order">
40
- <h4><?php esc_html_e( 'Summary', 'newspack-blocks' ); ?></h4>
41
-
51
+ <h4><?php esc_html_e( 'Transaction Successful', 'newspack-blocks' ); ?></h4>
42
52
  <ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
43
53
  <li class="woocommerce-order-overview__date date">
44
54
  <?php esc_html_e( 'Date:', 'newspack-blocks' ); ?>
@@ -70,6 +80,15 @@ function newspack_blocks_replace_login_with_order_summary() {
70
80
  </li>
71
81
  </ul>
72
82
  </div>
83
+
84
+ <?php echo \Newspack_Blocks\Modal_Checkout::render_checkout_after_success_markup(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
85
+
86
+ <?php
87
+ if ( $order ) {
88
+ echo \Newspack_Blocks\Modal_Checkout::render_newsletter_signup_form( $order ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
89
+ }
90
+ ?>
91
+
73
92
  <?php
74
93
  }
75
94
 
@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
22
22
 
23
23
  require_once __DIR__ . '/composer/autoload_real.php';
24
24
 
25
- return ComposerAutoloaderInitf52ddb06dc7136613134cfd4647ad1e6::getLoader();
25
+ return ComposerAutoloaderInit232d6885e695e323ef57a5d5ea2f9d04::getLoader();
@@ -2,7 +2,7 @@
2
2
 
3
3
  // autoload_real.php @generated by Composer
4
4
 
5
- class ComposerAutoloaderInitf52ddb06dc7136613134cfd4647ad1e6
5
+ class ComposerAutoloaderInit232d6885e695e323ef57a5d5ea2f9d04
6
6
  {
7
7
  private static $loader;
8
8
 
@@ -22,12 +22,12 @@ class ComposerAutoloaderInitf52ddb06dc7136613134cfd4647ad1e6
22
22
  return self::$loader;
23
23
  }
24
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitf52ddb06dc7136613134cfd4647ad1e6', 'loadClassLoader'), true, true);
25
+ spl_autoload_register(array('ComposerAutoloaderInit232d6885e695e323ef57a5d5ea2f9d04', 'loadClassLoader'), true, true);
26
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27
- spl_autoload_unregister(array('ComposerAutoloaderInitf52ddb06dc7136613134cfd4647ad1e6', 'loadClassLoader'));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit232d6885e695e323ef57a5d5ea2f9d04', 'loadClassLoader'));
28
28
 
29
29
  require __DIR__ . '/autoload_static.php';
30
- call_user_func(\Composer\Autoload\ComposerStaticInitf52ddb06dc7136613134cfd4647ad1e6::getInitializer($loader));
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit232d6885e695e323ef57a5d5ea2f9d04::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 ComposerStaticInitf52ddb06dc7136613134cfd4647ad1e6
7
+ class ComposerStaticInit232d6885e695e323ef57a5d5ea2f9d04
8
8
  {
9
9
  public static $classMap = array (
10
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
@@ -13,7 +13,7 @@ class ComposerStaticInitf52ddb06dc7136613134cfd4647ad1e6
13
13
  public static function getInitializer(ClassLoader $loader)
14
14
  {
15
15
  return \Closure::bind(function () use ($loader) {
16
- $loader->classMap = ComposerStaticInitf52ddb06dc7136613134cfd4647ad1e6::$classMap;
16
+ $loader->classMap = ComposerStaticInit232d6885e695e323ef57a5d5ea2f9d04::$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' => '82cfb05790f13ba1e4515c51ca109e3cf3bc3232',
6
+ 'reference' => 'd1dbc48d4acdceaa97e4f945bf64ee8f55e3e764',
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' => '82cfb05790f13ba1e4515c51ca109e3cf3bc3232',
16
+ 'reference' => 'd1dbc48d4acdceaa97e4f945bf64ee8f55e3e764',
17
17
  'type' => 'wordpress-plugin',
18
18
  'install_path' => __DIR__ . '/../../',
19
19
  'aliases' => array(),