@automattic/newspack-blocks 1.37.0 → 1.48.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/00255e6096be9e31ec354db849dfefaa.json.gz +0 -0
- package/.cache/babel/0265bee20d709ac92f56456637727f4b.json.gz +0 -0
- package/.cache/babel/02986ba19dc461a152ea1c45f3f36a27.json.gz +0 -0
- package/.cache/babel/06a1700c1a4a989fc7886c86bf6223f7.json.gz +0 -0
- package/.cache/babel/07169c73863508b392f15022920bd0b6.json.gz +0 -0
- package/.cache/babel/0a5083e561829e3884cb5c71388adc3f.json.gz +0 -0
- package/.cache/babel/0a713997b6e4f45849ed6a4bff79cca5.json.gz +0 -0
- package/.cache/babel/0a9506bf649ffbe854e75459cf6b8972.json.gz +0 -0
- package/.cache/babel/0c12c4398bbbf2d771b13dd1d0e64097.json.gz +0 -0
- package/.cache/babel/0f8c18da204f4cc2777ca3191f10c309.json.gz +0 -0
- package/.cache/babel/0fced15ed787cc4239bb53c1d12892e6.json.gz +0 -0
- package/.cache/babel/10faf7c74a89e9aa4d8b9528a654913e.json.gz +0 -0
- package/.cache/babel/1353b411b65a123b5dc35012db11aa1d.json.gz +0 -0
- package/.cache/babel/1729336f326db1cf54b9c1671dc5e36c.json.gz +0 -0
- package/.cache/babel/17a433ab631a32d0712f3f75cf85ea99.json.gz +0 -0
- package/.cache/babel/1948e72d907f681ff771881ad6800ee1.json.gz +0 -0
- package/.cache/babel/1ab4bf44aa14d2eb7e6911900a3b2c12.json.gz +0 -0
- package/.cache/babel/1decfd137cac87a75bd83ffbd39c9106.json.gz +0 -0
- package/.cache/babel/2143ceff6d186bc13bc902e0f1f33dbf.json.gz +0 -0
- package/.cache/babel/23c63332718e167968a7c2a8a5f730eb.json.gz +0 -0
- package/.cache/babel/24bf53676e12293cbf88d01e649fd167.json.gz +0 -0
- package/.cache/babel/26ba0bb46844575022e54a8819fbf405.json.gz +0 -0
- package/.cache/babel/281ca171ce8947f87f574df11059e00b.json.gz +0 -0
- package/.cache/babel/28700b83434e4dbfb9a20d7ec0a7e7a4.json.gz +0 -0
- package/.cache/babel/29cf8eeea8630ade027e34459f2e49ee.json.gz +0 -0
- package/.cache/babel/2b0dd254a46223a93e6259d2b797a7e7.json.gz +0 -0
- package/.cache/babel/2da6786ede3ddda4c86eeac524a6a796.json.gz +0 -0
- package/.cache/babel/2e7ce10fdee94274b48d528f94c32b34.json.gz +0 -0
- package/.cache/babel/2f93fed1706a40d82122281cc3677074.json.gz +0 -0
- package/.cache/babel/3a59b710e9745ef93148d6d74ee7d16f.json.gz +0 -0
- package/.cache/babel/3b2c440027c793c8f7978d7622cbfca0.json.gz +0 -0
- package/.cache/babel/3ca939ace4af88e266942d93837ab37a.json.gz +0 -0
- package/.cache/babel/3e671670c4d395cd1804ef4be31955e4.json.gz +0 -0
- package/.cache/babel/3e69fe002d9973c0030152a51da9477a.json.gz +0 -0
- package/.cache/babel/3f5f8ea603fd57850c6683c750fe53d8.json.gz +0 -0
- package/.cache/babel/41abaaadb68b0657a95fa0c356873def.json.gz +0 -0
- package/.cache/babel/421ac952d6b472ba18e1cb95ef65f42a.json.gz +0 -0
- package/.cache/babel/424185dd50e91d8dee5fdae43086010e.json.gz +0 -0
- package/.cache/babel/427a6423ebde76bcb488747127e47351.json.gz +0 -0
- package/.cache/babel/43e800659f23430a181fb4fc328eb6ef.json.gz +0 -0
- package/.cache/babel/469651017a2b6f3b9f63fda034974b3a.json.gz +0 -0
- package/.cache/babel/480d26447b7ee019a37e4e18422403e9.json.gz +0 -0
- package/.cache/babel/4b58fad313d90a4c1577a2766e6c924c.json.gz +0 -0
- package/.cache/babel/4d2d42fea63650192d1a3a5648b621c5.json.gz +0 -0
- package/.cache/babel/4d8c26a76e77fa64d01f30a5f2d62f85.json.gz +0 -0
- package/.cache/babel/4f606ce6656565507a74aaac8dc21eea.json.gz +0 -0
- package/.cache/babel/505f37592f4c601ccdc1581ca89d9009.json.gz +0 -0
- package/.cache/babel/50aaf34aa54b2cd3058518e42850bb62.json.gz +0 -0
- package/.cache/babel/51fbf389462feb111228ba7ec64c631d.json.gz +0 -0
- package/.cache/babel/51fc90ae5fe129a095172032f304dc2c.json.gz +0 -0
- package/.cache/babel/53dbf5484c5601528c2fd8d7fe728b78.json.gz +0 -0
- package/.cache/babel/58e4535574062eb2d8fa56d002e7190d.json.gz +0 -0
- package/.cache/babel/5aa5e8d1492938c62999de022c4b220e.json.gz +0 -0
- package/.cache/babel/5d64e475284e52c104df17e26066b17b.json.gz +0 -0
- package/.cache/babel/6333c664d69f13036f42bcf575c8e65d.json.gz +0 -0
- package/.cache/babel/635c439786b8522888342779b28ee9ee.json.gz +0 -0
- package/.cache/babel/648cffdd5ec4a2446f8935a17b98080b.json.gz +0 -0
- package/.cache/babel/64b0dd478e6f2dd51de5ee20e311aee7.json.gz +0 -0
- package/.cache/babel/6531721abbc0b3906b28b268ed7914af.json.gz +0 -0
- package/.cache/babel/66bf5585c7901a76c7d4014fa9ffed40.json.gz +0 -0
- package/.cache/babel/6ef313cb6d3a59f73a6b78e1a729fb13.json.gz +0 -0
- package/.cache/babel/6f14eed506421f15710d3dfafe3dcd93.json.gz +0 -0
- package/.cache/babel/70f6c01d8c6bc3efc41c97eaf49f7617.json.gz +0 -0
- package/.cache/babel/72321dde68f0bb9c334d90d6f4584be8.json.gz +0 -0
- package/.cache/babel/76c815fab58595f57e01af6591791d57.json.gz +0 -0
- package/.cache/babel/7c10f4d554daa8efe1e0a4457fb6d27b.json.gz +0 -0
- package/.cache/babel/7dffccddd9780ab37fb79f809947c2cd.json.gz +0 -0
- package/.cache/babel/7e5162e3319cd5d6fca6c0db0516aaeb.json.gz +0 -0
- package/.cache/babel/803192c922f7d419648bab7e1201b22e.json.gz +0 -0
- package/.cache/babel/81f3f0f896d29cdf88f8543dedb77787.json.gz +0 -0
- package/.cache/babel/84c019d3d643195fb37d08110f15f8c9.json.gz +0 -0
- package/.cache/babel/853c31db7c4351f2f36d1021c667224d.json.gz +0 -0
- package/.cache/babel/88ec99735ea4f314937736f04360ff8c.json.gz +0 -0
- package/.cache/babel/8959ab8fcfa783cb56e9418b99c0951c.json.gz +0 -0
- package/.cache/babel/8b9624d721f8706682e33fe1853c8287.json.gz +0 -0
- package/.cache/babel/8de5c373bbc4b6fbeec373d582935887.json.gz +0 -0
- package/.cache/babel/8f24517cff634d2e91c19e51be8816cc.json.gz +0 -0
- package/.cache/babel/901e1bb823eca196b594baa35a35a81c.json.gz +0 -0
- package/.cache/babel/90dbc666ff9fa3b88f305fe90a9917bf.json.gz +0 -0
- package/.cache/babel/91b62dfd9475df7a39dc08fbd43847f9.json.gz +0 -0
- package/.cache/babel/956daf27323e3b87bf8bf9bbf58881ed.json.gz +0 -0
- package/.cache/babel/959e9b81103c539a9d85ac60955451b9.json.gz +0 -0
- package/.cache/babel/963b1e44be998c4dcc6845745c377369.json.gz +0 -0
- package/.cache/babel/966b41ac1317b3e03ca1e59f7eb57e8c.json.gz +0 -0
- package/.cache/babel/969d5992cc682e3b43761ef02c10b851.json.gz +0 -0
- package/.cache/babel/99df128bb528d0f95a56b311801d14c1.json.gz +0 -0
- package/.cache/babel/9b33e7d21f3fc4955a536a033cced71b.json.gz +0 -0
- package/.cache/babel/9c5ec84f77314a621c01ad77da7ccb58.json.gz +0 -0
- package/.cache/babel/9d325af12a88623602a5f8c2fce04847.json.gz +0 -0
- package/.cache/babel/a413e4d325543836d0800684bb26ed04.json.gz +0 -0
- package/.cache/babel/a5405f86b8d1485e62a125275507e60f.json.gz +0 -0
- package/.cache/babel/a7f7461321ca6fd4360df04bb894c106.json.gz +0 -0
- package/.cache/babel/a8a6812e1c7b65cc6d0bdebe2a35c8ca.json.gz +0 -0
- package/.cache/babel/aa89cfc4c88fcc465b8d74af824e7f6b.json.gz +0 -0
- package/.cache/babel/adbaeb5ddf5612b3dcd233a3f6f17bf2.json.gz +0 -0
- package/.cache/babel/ae18cd6ec42a3366c73435b62a9f5f70.json.gz +0 -0
- package/.cache/babel/aea149ee1ec6fa3ca7839c63f5edd78d.json.gz +0 -0
- package/.cache/babel/af1b34067a69854e109c0b0e45d90e43.json.gz +0 -0
- package/.cache/babel/b3a335ab950f502914013810b43b0ad5.json.gz +0 -0
- package/.cache/babel/b6cfba15cda3404d4b1041df448ed2b2.json.gz +0 -0
- package/.cache/babel/ba711530bd319618a0510d8361bebb45.json.gz +0 -0
- package/.cache/babel/ba77e682225df6126b636458055601d9.json.gz +0 -0
- package/.cache/babel/bab8189a74eee8d72702d1510b52b3b3.json.gz +0 -0
- package/.cache/babel/bd8741020db56bb5d999252812d1d717.json.gz +0 -0
- package/.cache/babel/beaa874c5e01203d9dbe23cb89405276.json.gz +0 -0
- package/.cache/babel/c196c9b8c21953c474acdaa9029b3cbf.json.gz +0 -0
- package/.cache/babel/c1e31e6c217023eb3d3fd5d3de486ac3.json.gz +0 -0
- package/.cache/babel/c3aa996443e7f377aa423bcc03ffc617.json.gz +0 -0
- package/.cache/babel/c481eae84d69b65405a44af442dbfea7.json.gz +0 -0
- package/.cache/babel/c4a817d6c4bf6eb3687ffccc5c2df801.json.gz +0 -0
- package/.cache/babel/c8b10cf6f706fb669d6dd7564385768d.json.gz +0 -0
- package/.cache/babel/caa2f98ba4af6eba0605543f690693c6.json.gz +0 -0
- package/.cache/babel/cada4b2cecb2c1fcc48b7a7ecda54907.json.gz +0 -0
- package/.cache/babel/d1bed5404789c427c32965ac6ecad0d9.json.gz +0 -0
- package/.cache/babel/d395e8c0a9c63680f2dcf90ca0e91d4a.json.gz +0 -0
- package/.cache/babel/d4672090e0dd9a73bfb00bd770b23643.json.gz +0 -0
- package/.cache/babel/d4c81f65fe6d78cdbdcf1ef901b7ba1b.json.gz +0 -0
- package/.cache/babel/d515ddc0797ea256ff7271507737e9ce.json.gz +0 -0
- package/.cache/babel/d742848d263503f79168f1a6b8a52097.json.gz +0 -0
- package/.cache/babel/d834b41d7028519ecd0cbc8c65d33dde.json.gz +0 -0
- package/.cache/babel/d9060b9162e7caf974db0b90b6134727.json.gz +0 -0
- package/.cache/babel/d946975b9beac51a39f600461e84b1b6.json.gz +0 -0
- package/.cache/babel/daf0af780cff2270b1ae0e4b97a5a4ab.json.gz +0 -0
- package/.cache/babel/db5215643b0737dc5245972a5c25f736.json.gz +0 -0
- package/.cache/babel/dd57b8d31664b147b9f1e3f5cd18cc2a.json.gz +0 -0
- package/.cache/babel/e0c78bdaae19f15e2dd4a773e842422b.json.gz +0 -0
- package/.cache/babel/e1a2c7e4fc3afe9cc6e03d60f4e4a23d.json.gz +0 -0
- package/.cache/babel/e210ff9aa99df972b8d81c4bda70f642.json.gz +0 -0
- package/.cache/babel/e259a73f84d5b92b94e6d094719264c3.json.gz +0 -0
- package/.cache/babel/e6ce03a9908c9c4dc2c723531f1073f6.json.gz +0 -0
- package/.cache/babel/e8a1501dd8e4b3389ecdc8f722622359.json.gz +0 -0
- package/.cache/babel/eb3bb371036da362c42db50248d0b180.json.gz +0 -0
- package/.cache/babel/eb854e03c810bdb969497b2a36119bfa.json.gz +0 -0
- package/.cache/babel/ec25bb53826070b7f301e64f02355b8c.json.gz +0 -0
- package/.cache/babel/edbaca20e4a65f850c3d8321c1945718.json.gz +0 -0
- package/.cache/babel/f059f1ca9e49d5c3e655d20339860dce.json.gz +0 -0
- package/.cache/babel/f24c559fb42ef906405966598baf5f80.json.gz +0 -0
- package/.cache/babel/f2f333c3c546ad711d722d782decd450.json.gz +0 -0
- package/.cache/babel/f42c854ce8f1dc1a6e6fe7c510b033a5.json.gz +0 -0
- package/.cache/babel/f5211608f22c2e12594eafdbc4e66aa5.json.gz +0 -0
- package/.cache/babel/f645b8c88a49718cd778e3595212d4eb.json.gz +0 -0
- package/.cache/babel/f66dda5c4e4e9d04eb6b7411fcb12a65.json.gz +0 -0
- package/.cache/babel/f9d5b6f3f5438342dba75c2ce6143eef.json.gz +0 -0
- package/.cache/babel/fc9c60ee1d2e8783ba4c08db5cf97d40.json.gz +0 -0
- package/.cache/babel/fd558798cea72d04fb826468a89d72aa.json.gz +0 -0
- package/.cache/babel/fe735cbd0f6e131e28d8b6eb1f39141b.json.gz +0 -0
- package/.eslintrc.js +3 -26
- package/.nvmrc +1 -0
- package/CHANGELOG.md +422 -0
- package/babel.config.js +6 -0
- package/block-list.json +1 -1
- package/composer.json +2 -2
- package/composer.lock +446 -161
- package/dist/author-list/view.asset.php +1 -0
- package/dist/author-list/view.css +1 -0
- package/dist/author-list/view.js +1 -0
- package/dist/author-list/view.rtl.css +1 -0
- package/dist/author-profile/view.asset.php +1 -0
- package/dist/author-profile/view.css +1 -0
- package/dist/author-profile/view.js +1 -0
- package/dist/author-profile/view.rtl.css +1 -0
- package/dist/block_styles.asset.php +1 -0
- package/dist/block_styles.css +1 -0
- package/dist/block_styles.js +1 -0
- package/dist/block_styles.rtl.css +1 -0
- package/dist/carousel/view.asset.php +1 -0
- package/dist/carousel/view.css +1 -0
- package/dist/carousel/view.js +1 -0
- package/dist/carousel/view.rtl.css +1 -0
- package/dist/donate/view.asset.php +1 -0
- package/dist/donate/view.css +1 -0
- package/dist/donate/view.js +1 -0
- package/dist/donate/view.rtl.css +1 -0
- package/dist/donateStreamlined.asset.php +1 -0
- package/dist/donateStreamlined.css +1 -0
- package/dist/donateStreamlined.js +1 -0
- package/dist/donateStreamlined.rtl.css +1 -0
- package/dist/editor.asset.php +1 -0
- package/dist/editor.css +1 -0
- package/dist/editor.js +41 -0
- package/dist/editor.rtl.css +1 -0
- package/dist/homepage-articles/view.asset.php +1 -0
- package/dist/homepage-articles/view.css +1 -0
- package/dist/homepage-articles/view.js +1 -0
- package/dist/homepage-articles/view.rtl.css +1 -0
- package/dist/iframe/view.asset.php +1 -0
- package/dist/iframe/view.css +1 -0
- package/dist/iframe/view.js +1 -0
- package/dist/iframe/view.rtl.css +1 -0
- package/includes/class-newspack-blocks-api.php +14 -69
- package/includes/class-newspack-blocks-patterns.php +4 -1
- package/includes/class-newspack-blocks.php +421 -95
- package/newspack-blocks.php +26 -2
- package/package.json +31 -129
- package/postcss.config.js +11 -0
- package/src/block-patterns/subscribe-2.php +1 -1
- package/src/block-patterns/subscribe-3.php +1 -1
- package/src/block-patterns/subscribe-7.php +12 -0
- package/src/block-patterns/subscribe-8.php +12 -0
- package/src/block-patterns/subscribe-9.php +12 -0
- package/src/block-styles/core/columns/editor.scss +5 -8
- package/src/block-styles/core/columns/view.scss +83 -42
- package/src/blocks/author-list/block.json +82 -0
- package/src/blocks/author-list/class-wp-rest-newspack-author-list-controller.php +387 -0
- package/src/blocks/author-list/edit.js +527 -0
- package/src/blocks/author-list/editor.js +7 -0
- package/src/blocks/author-list/editor.scss +1 -0
- package/src/blocks/author-list/index.js +45 -0
- package/src/blocks/author-list/view.js +5 -0
- package/src/blocks/author-list/view.php +175 -0
- package/src/blocks/author-list/view.scss +46 -0
- package/src/blocks/author-profile/block.json +8 -0
- package/src/blocks/author-profile/class-wp-rest-newspack-authors-controller.php +69 -14
- package/src/blocks/author-profile/edit.js +212 -189
- package/src/blocks/author-profile/editor.scss +1 -1
- package/src/blocks/author-profile/single-author.js +100 -0
- package/src/blocks/author-profile/view.php +38 -92
- package/src/blocks/author-profile/view.scss +120 -1
- package/src/blocks/carousel/create-swiper.js +14 -5
- package/src/blocks/carousel/edit.js +4 -2
- package/src/blocks/carousel/editor.scss +3 -12
- package/src/blocks/carousel/view.js +1 -1
- package/src/blocks/carousel/view.php +9 -5
- package/src/blocks/carousel/view.scss +29 -3
- package/src/blocks/donate/class-wp-rest-newspack-donate-controller.php +22 -24
- package/src/blocks/donate/edit.js +49 -42
- package/src/blocks/donate/editor.scss +27 -3
- package/src/blocks/donate/index.js +31 -4
- package/src/blocks/donate/streamlined/index.js +248 -0
- package/src/blocks/donate/streamlined/index.test.js +125 -0
- package/src/blocks/donate/streamlined/style.scss +324 -0
- package/src/blocks/donate/streamlined/utils.js +174 -0
- package/src/blocks/donate/streamlined/utils.test.js +18 -0
- package/src/blocks/donate/view.php +77 -36
- package/src/blocks/donate/view.scss +291 -0
- package/src/blocks/homepage-articles/block.json +8 -0
- package/src/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php +24 -78
- package/src/blocks/homepage-articles/edit.js +26 -0
- package/src/blocks/homepage-articles/store.js +11 -1
- package/src/blocks/homepage-articles/templates/article.php +31 -3
- package/src/blocks/homepage-articles/templates/articles-loop.php +6 -5
- package/src/blocks/homepage-articles/utils.js +11 -10
- package/src/blocks/homepage-articles/view.php +4 -1
- package/src/blocks/homepage-articles/view.scss +69 -24
- package/src/blocks/iframe/block.json +34 -0
- package/src/blocks/iframe/class-wp-rest-newspack-iframe-controller.php +345 -0
- package/src/blocks/iframe/edit.js +252 -0
- package/src/blocks/iframe/editor.js +7 -0
- package/src/blocks/iframe/editor.scss +84 -0
- package/src/blocks/iframe/icons.js +10 -0
- package/src/blocks/iframe/iframe-placeholder.js +180 -0
- package/src/blocks/iframe/index.js +48 -0
- package/src/blocks/iframe/view.js +5 -0
- package/src/blocks/iframe/view.php +130 -0
- package/src/blocks/iframe/view.scss +9 -0
- package/src/blocks/video-playlist/view.php +4 -3
- package/src/components/query-controls.js +5 -4
- package/src/setup/editor.js +0 -1
- package/src/shared/js/utils.js +1 -1
- package/src/templates/author-profile-card.php +99 -0
- package/vendor/autoload.php +7 -0
- package/vendor/composer/ClassLoader.php +572 -0
- package/vendor/composer/InstalledVersions.php +350 -0
- package/vendor/composer/LICENSE +21 -0
- package/vendor/composer/autoload_classmap.php +10 -0
- package/vendor/composer/autoload_namespaces.php +9 -0
- package/vendor/composer/autoload_psr4.php +9 -0
- package/vendor/composer/autoload_real.php +55 -0
- package/vendor/composer/autoload_static.php +20 -0
- package/vendor/composer/installed.json +5 -0
- package/vendor/composer/installed.php +23 -0
- package/webpack.config.js +2 -3
- package/.circleci/config.yml +0 -96
- package/.distignore +0 -36
- package/.editorconfig +0 -22
- package/.github/ISSUE_TEMPLATE/Bug_report.md +0 -21
- package/.github/ISSUE_TEMPLATE/Enhancement.md +0 -17
- package/.github/ISSUE_TEMPLATE/Feature_request.md +0 -17
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -29
- package/.github/workflows/main.yml +0 -15
- package/.phpcs.xml.dist +0 -55
- package/.prettierrc +0 -10
- package/.stylelintrc +0 -21
- package/.travis.yml +0 -67
- package/phpunit.xml.dist +0 -16
- package/src/blocks/author-profile/shared.scss +0 -95
- package/src/blocks/donate/streamlined.js +0 -180
- package/src/blocks/donate/streamlined.scss +0 -124
- package/src/setup/public-path.js +0 -13
- package/src/setup/view.js +0 -4
- package/tests/bootstrap.php +0 -31
- package/tests/test-sample.php +0 -20
|
@@ -284,3 +284,294 @@
|
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
+
|
|
288
|
+
/* Alternate Style */
|
|
289
|
+
|
|
290
|
+
.wpbnbd.is-style-alternate {
|
|
291
|
+
border-color: $color__background-screen;
|
|
292
|
+
border-radius: 5px;
|
|
293
|
+
|
|
294
|
+
.thanks {
|
|
295
|
+
margin: 1.12rem;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.money-input {
|
|
299
|
+
max-width: 100%;
|
|
300
|
+
|
|
301
|
+
input[type='number'] {
|
|
302
|
+
max-width: 100%;
|
|
303
|
+
width: 100%;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
&.untiered {
|
|
308
|
+
padding-top: calc( 3 * ( 1.14rem + 1.28em ) + 8px );
|
|
309
|
+
|
|
310
|
+
@include media( tablet ) {
|
|
311
|
+
padding-top: calc( 1.14rem + 1.28em + 4px );
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.input-container {
|
|
315
|
+
margin: 1.12rem;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
&.tiered {
|
|
320
|
+
.tiers {
|
|
321
|
+
.tier-label {
|
|
322
|
+
background: $color__background-screen;
|
|
323
|
+
border-color: $color__background-screen;
|
|
324
|
+
margin: 0;
|
|
325
|
+
text-align: center;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
input.other-input:checked + label {
|
|
329
|
+
margin-bottom: calc( 1.28rem + 1.6em + 2px );
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.money-input {
|
|
334
|
+
bottom: 0;
|
|
335
|
+
left: 0;
|
|
336
|
+
right: 0;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.frequencies {
|
|
341
|
+
padding-top: calc( 3 * ( 1.14rem + 1.6em ) + 8px );
|
|
342
|
+
|
|
343
|
+
@include media( tablet ) {
|
|
344
|
+
padding-top: calc( 1.14rem + 1.6em + 4px );
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.frequency {
|
|
349
|
+
.freq-label {
|
|
350
|
+
background: $color__background-screen;
|
|
351
|
+
border-color: $color__background-screen;
|
|
352
|
+
border-width: 1px;
|
|
353
|
+
padding: calc( 0.57rem + 1px ) 0.76rem;
|
|
354
|
+
|
|
355
|
+
&::before {
|
|
356
|
+
display: none;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
&:nth-of-type( 2 ) .freq-label {
|
|
361
|
+
top: calc( 1.14rem + 1.6em + 2px );
|
|
362
|
+
|
|
363
|
+
@include media( tablet ) {
|
|
364
|
+
top: 0;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
&:nth-of-type( 3 ) .freq-label {
|
|
369
|
+
top: calc( 2 * ( 1.14rem + 1.6em + 2px ) );
|
|
370
|
+
|
|
371
|
+
@include media( tablet ) {
|
|
372
|
+
top: 0;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
input[type='radio']:checked {
|
|
377
|
+
+ .freq-label {
|
|
378
|
+
&::after {
|
|
379
|
+
box-sizing: content-box;
|
|
380
|
+
background: white;
|
|
381
|
+
border-radius: 5px;
|
|
382
|
+
bottom: 0.19rem;
|
|
383
|
+
border: 0.19rem solid white;
|
|
384
|
+
box-shadow: 0 0 0 1px $color__border;
|
|
385
|
+
content: '';
|
|
386
|
+
display: block;
|
|
387
|
+
left: 0.19rem;
|
|
388
|
+
position: absolute;
|
|
389
|
+
right: 0.19rem;
|
|
390
|
+
top: 0.19rem;
|
|
391
|
+
z-index: -1;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
&:hover {
|
|
395
|
+
background: $color__background-screen;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
~ .tiers {
|
|
400
|
+
display: grid;
|
|
401
|
+
grid-gap: 0.28rem;
|
|
402
|
+
grid-template-columns: repeat( 4, 1fr );
|
|
403
|
+
margin: 1.12rem;
|
|
404
|
+
|
|
405
|
+
@include media( mobile ) {
|
|
406
|
+
grid-gap: 0.56rem;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
button {
|
|
413
|
+
border-top-left-radius: 0;
|
|
414
|
+
border-top-right-radius: 0;
|
|
415
|
+
margin: 0 -1px -1px;
|
|
416
|
+
width: calc( 100% + 2px );
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/* Minimal Style */
|
|
421
|
+
|
|
422
|
+
.wpbnbd.is-style-minimal {
|
|
423
|
+
border: none;
|
|
424
|
+
|
|
425
|
+
form {
|
|
426
|
+
text-align: center;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.thanks {
|
|
430
|
+
margin: 1.12rem 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.money-input {
|
|
434
|
+
max-width: 100%;
|
|
435
|
+
|
|
436
|
+
input[type='number'] {
|
|
437
|
+
max-width: 100%;
|
|
438
|
+
width: 100%;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
&.untiered {
|
|
443
|
+
padding-top: calc( 3 * ( 0.76rem + 1.28em + 4px ) );
|
|
444
|
+
|
|
445
|
+
@include media( tablet ) {
|
|
446
|
+
padding-top: calc( 0.76rem + 1.28em + 4px );
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.input-container {
|
|
450
|
+
margin: 0.56rem 0 1.12rem;
|
|
451
|
+
text-align: left;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
&.tiered {
|
|
456
|
+
.tiers {
|
|
457
|
+
.tier-label {
|
|
458
|
+
align-items: center;
|
|
459
|
+
display: grid;
|
|
460
|
+
background: transparent;
|
|
461
|
+
border: none;
|
|
462
|
+
color: $color__text-light;
|
|
463
|
+
font-family: inherit;
|
|
464
|
+
font-weight: inherit;
|
|
465
|
+
grid-gap: 0.25rem;
|
|
466
|
+
grid-template-columns: auto 1fr;
|
|
467
|
+
margin: 0;
|
|
468
|
+
padding: 0;
|
|
469
|
+
text-align: left;
|
|
470
|
+
|
|
471
|
+
&::before {
|
|
472
|
+
background: white;
|
|
473
|
+
border: 1px solid $color__border;
|
|
474
|
+
border-radius: 100%;
|
|
475
|
+
box-shadow: inset 0 0 0 3px white;
|
|
476
|
+
content: '';
|
|
477
|
+
display: block;
|
|
478
|
+
height: 20px;
|
|
479
|
+
padding: 3px;
|
|
480
|
+
width: 20px;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
&:hover {
|
|
484
|
+
color: inherit;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
input.other-input:checked + label {
|
|
489
|
+
margin-bottom: calc( 1.28rem + 1.6em + 2px );
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
input[type='radio']:checked + .tier-select-label {
|
|
493
|
+
background: none;
|
|
494
|
+
color: inherit;
|
|
495
|
+
|
|
496
|
+
&::before {
|
|
497
|
+
background: currentColor;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.money-input {
|
|
503
|
+
bottom: 0;
|
|
504
|
+
left: 0;
|
|
505
|
+
right: 0;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.frequencies {
|
|
510
|
+
padding-top: calc( 3 * ( 0.76rem + 1.6em + 4px ) );
|
|
511
|
+
|
|
512
|
+
@include media( tablet ) {
|
|
513
|
+
padding-top: calc( 0.76rem + 1.6em + 4px );
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.frequency {
|
|
518
|
+
.freq-label {
|
|
519
|
+
background: transparent;
|
|
520
|
+
border: none;
|
|
521
|
+
box-shadow: 0 3px 0 white, 0 4px 0 0 $color__border;
|
|
522
|
+
padding: 0.38rem 0;
|
|
523
|
+
transition: none;
|
|
524
|
+
|
|
525
|
+
@include media( tablet ) {
|
|
526
|
+
padding-left: 0.76rem;
|
|
527
|
+
padding-right: 0.76rem;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
&::before {
|
|
531
|
+
border-width: 1px;
|
|
532
|
+
border-color: $color__border;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
&:nth-of-type( 2 ) .freq-label {
|
|
537
|
+
top: calc( 0.76rem + 1.6em + 4px );
|
|
538
|
+
|
|
539
|
+
@include media( tablet ) {
|
|
540
|
+
top: 0;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
&:nth-of-type( 3 ) .freq-label {
|
|
545
|
+
top: calc( 2 * ( 0.76rem + 1.6em + 4px ) );
|
|
546
|
+
|
|
547
|
+
@include media( tablet ) {
|
|
548
|
+
top: 0;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
input[type='radio']:checked {
|
|
553
|
+
+ .freq-label {
|
|
554
|
+
box-shadow: 0 4px 0 currentColor;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
~ .tiers {
|
|
558
|
+
display: flex;
|
|
559
|
+
flex-wrap: wrap;
|
|
560
|
+
grid-gap: 1.12rem;
|
|
561
|
+
justify-content: center;
|
|
562
|
+
margin: 1.12rem 0;
|
|
563
|
+
|
|
564
|
+
@include media( mobile ) {
|
|
565
|
+
display: grid;
|
|
566
|
+
grid-gap: 0.56rem;
|
|
567
|
+
grid-template-columns: repeat( 4, 1fr );
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
button {
|
|
574
|
+
margin: 0 auto;
|
|
575
|
+
min-width: 50%;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
"type": "boolean",
|
|
35
35
|
"default": false
|
|
36
36
|
},
|
|
37
|
+
"disableImageLazyLoad": {
|
|
38
|
+
"type": "boolean",
|
|
39
|
+
"default": false
|
|
40
|
+
},
|
|
37
41
|
"imageShape": {
|
|
38
42
|
"type": "string",
|
|
39
43
|
"default": "landscape"
|
|
@@ -148,6 +152,10 @@
|
|
|
148
152
|
"type": "array",
|
|
149
153
|
"default": [ "post" ],
|
|
150
154
|
"items": { "type": "string" }
|
|
155
|
+
},
|
|
156
|
+
"textAlign": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"default": "left"
|
|
151
159
|
}
|
|
152
160
|
}
|
|
153
161
|
}
|
|
@@ -56,77 +56,25 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
|
|
|
56
56
|
[
|
|
57
57
|
'methods' => \WP_REST_Server::READABLE,
|
|
58
58
|
'callback' => [ 'Newspack_Blocks_API', 'posts_endpoint' ],
|
|
59
|
-
'args' =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
'
|
|
63
|
-
'type'
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'
|
|
70
|
-
'type'
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
),
|
|
79
|
-
'default' => array(),
|
|
80
|
-
],
|
|
81
|
-
'excerpt_length' => [
|
|
82
|
-
'type' => 'integer',
|
|
83
|
-
'default' => 55,
|
|
84
|
-
],
|
|
85
|
-
'exclude' => [
|
|
86
|
-
'type' => 'array',
|
|
87
|
-
'items' => array(
|
|
88
|
-
'type' => 'integer',
|
|
89
|
-
),
|
|
90
|
-
'default' => array(),
|
|
91
|
-
],
|
|
92
|
-
'include' => [
|
|
93
|
-
'type' => 'array',
|
|
94
|
-
'items' => array(
|
|
95
|
-
'type' => 'integer',
|
|
96
|
-
),
|
|
97
|
-
'default' => array(),
|
|
98
|
-
],
|
|
99
|
-
'orderby' => [
|
|
100
|
-
'sanitize_callback' => 'sanitize_text_field',
|
|
101
|
-
],
|
|
102
|
-
'per_page' => [
|
|
103
|
-
'sanitize_callback' => 'absint',
|
|
104
|
-
],
|
|
105
|
-
'show_excerpt' => [
|
|
106
|
-
'type' => 'boolean',
|
|
107
|
-
],
|
|
108
|
-
'tags' => [
|
|
109
|
-
'type' => 'array',
|
|
110
|
-
'items' => array(
|
|
111
|
-
'type' => 'integer',
|
|
112
|
-
),
|
|
113
|
-
'default' => array(),
|
|
114
|
-
],
|
|
115
|
-
'tags_exclude' => [
|
|
116
|
-
'type' => 'array',
|
|
117
|
-
'items' => array(
|
|
118
|
-
'type' => 'integer',
|
|
119
|
-
),
|
|
120
|
-
'default' => array(),
|
|
121
|
-
],
|
|
122
|
-
'post_type' => [
|
|
123
|
-
'type' => 'array',
|
|
124
|
-
'items' => array(
|
|
125
|
-
'type' => 'string',
|
|
126
|
-
),
|
|
127
|
-
'default' => array(),
|
|
128
|
-
],
|
|
129
|
-
],
|
|
59
|
+
'args' => array_merge(
|
|
60
|
+
$this->get_attribute_schema(),
|
|
61
|
+
[
|
|
62
|
+
'exclude' => [ // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
|
|
63
|
+
'type' => 'array',
|
|
64
|
+
'items' => array(
|
|
65
|
+
'type' => 'integer',
|
|
66
|
+
),
|
|
67
|
+
'default' => array(),
|
|
68
|
+
],
|
|
69
|
+
'include' => [
|
|
70
|
+
'type' => 'array',
|
|
71
|
+
'items' => array(
|
|
72
|
+
'type' => 'integer',
|
|
73
|
+
),
|
|
74
|
+
'default' => array(),
|
|
75
|
+
],
|
|
76
|
+
]
|
|
77
|
+
),
|
|
130
78
|
'permission_callback' => function() {
|
|
131
79
|
return current_user_can( 'edit_posts' );
|
|
132
80
|
},
|
|
@@ -141,13 +89,13 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
|
|
|
141
89
|
'methods' => \WP_REST_Server::READABLE,
|
|
142
90
|
'callback' => [ 'Newspack_Blocks_API', 'specific_posts_endpoint' ],
|
|
143
91
|
'args' => [
|
|
144
|
-
'search'
|
|
92
|
+
'search' => [
|
|
145
93
|
'sanitize_callback' => 'sanitize_text_field',
|
|
146
94
|
],
|
|
147
|
-
'
|
|
95
|
+
'postsToShow' => [
|
|
148
96
|
'sanitize_callback' => 'absint',
|
|
149
97
|
],
|
|
150
|
-
'
|
|
98
|
+
'postType' => [
|
|
151
99
|
'type' => 'array',
|
|
152
100
|
'items' => array(
|
|
153
101
|
'type' => 'string',
|
|
@@ -202,8 +150,7 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
|
|
|
202
150
|
$ids = [];
|
|
203
151
|
$next_url = '';
|
|
204
152
|
|
|
205
|
-
Newspack_Blocks::
|
|
206
|
-
Newspack_Blocks::filter_excerpt_more( $attributes );
|
|
153
|
+
Newspack_Blocks::filter_excerpt( $attributes );
|
|
207
154
|
|
|
208
155
|
// The Loop.
|
|
209
156
|
while ( $article_query->have_posts() ) {
|
|
@@ -222,8 +169,7 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
|
|
|
222
169
|
$ids[] = get_the_ID();
|
|
223
170
|
}
|
|
224
171
|
|
|
225
|
-
Newspack_Blocks::
|
|
226
|
-
Newspack_Blocks::remove_excerpt_more_filter();
|
|
172
|
+
Newspack_Blocks::remove_excerpt_filter();
|
|
227
173
|
|
|
228
174
|
// Provide next URL if there are more pages.
|
|
229
175
|
$show_next_button = ! empty( $exclude_ids ) ? $article_query->max_num_pages > 1 : $article_query->max_num_pages > $next_page;
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
PanelColorSettings,
|
|
31
31
|
RichText,
|
|
32
32
|
withColors,
|
|
33
|
+
AlignmentControl,
|
|
33
34
|
} from '@wordpress/block-editor';
|
|
34
35
|
import {
|
|
35
36
|
Button,
|
|
@@ -256,6 +257,7 @@ class Edit extends Component {
|
|
|
256
257
|
postType,
|
|
257
258
|
showImage,
|
|
258
259
|
showCaption,
|
|
260
|
+
disableImageLazyLoad,
|
|
259
261
|
imageScale,
|
|
260
262
|
mobileStack,
|
|
261
263
|
minHeight,
|
|
@@ -394,6 +396,20 @@ class Edit extends Component {
|
|
|
394
396
|
</PanelRow>
|
|
395
397
|
) }
|
|
396
398
|
|
|
399
|
+
{ showImage && (
|
|
400
|
+
<PanelRow>
|
|
401
|
+
<ToggleControl
|
|
402
|
+
label={ __( 'Disable Featured Image Lazy Loading', 'newspack-blocks' ) }
|
|
403
|
+
help={ __(
|
|
404
|
+
'Improve Largest Contentful Paint (LCP) score if the block is on initial viewport.',
|
|
405
|
+
'newspack-blocks'
|
|
406
|
+
) }
|
|
407
|
+
checked={ disableImageLazyLoad }
|
|
408
|
+
onChange={ () => setAttributes( { disableImageLazyLoad: ! disableImageLazyLoad } ) }
|
|
409
|
+
/>
|
|
410
|
+
</PanelRow>
|
|
411
|
+
) }
|
|
412
|
+
|
|
397
413
|
{ showImage && mediaPosition !== 'top' && mediaPosition !== 'behind' && (
|
|
398
414
|
<Fragment>
|
|
399
415
|
<PanelRow>
|
|
@@ -608,6 +624,7 @@ class Edit extends Component {
|
|
|
608
624
|
showCaption,
|
|
609
625
|
showCategory,
|
|
610
626
|
specificMode,
|
|
627
|
+
textAlign,
|
|
611
628
|
} = attributes;
|
|
612
629
|
|
|
613
630
|
const classes = classNames( className, {
|
|
@@ -622,6 +639,7 @@ class Edit extends Component {
|
|
|
622
639
|
'has-text-color': textColor.color !== '',
|
|
623
640
|
'show-caption': showCaption,
|
|
624
641
|
'show-category': showCategory,
|
|
642
|
+
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
625
643
|
wpnbha: true,
|
|
626
644
|
} );
|
|
627
645
|
|
|
@@ -748,6 +766,14 @@ class Edit extends Component {
|
|
|
748
766
|
) }
|
|
749
767
|
|
|
750
768
|
<BlockControls>
|
|
769
|
+
<Toolbar>
|
|
770
|
+
<AlignmentControl
|
|
771
|
+
value={ textAlign }
|
|
772
|
+
onChange={ nextAlign => {
|
|
773
|
+
setAttributes( { textAlign: nextAlign } );
|
|
774
|
+
} }
|
|
775
|
+
/>
|
|
776
|
+
</Toolbar>
|
|
751
777
|
<Toolbar controls={ blockControls } />
|
|
752
778
|
{ showImage && <Toolbar controls={ blockControlsImages } /> }
|
|
753
779
|
{ showImage && <Toolbar controls={ blockControlsImageShape } /> }
|
|
@@ -125,7 +125,17 @@ const createFetchPostsSaga = blockNames => {
|
|
|
125
125
|
|
|
126
126
|
yield put( { type: 'DISABLE_UI' } );
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
// Ensure innerBlocks are populated for widget area blocks.
|
|
129
|
+
// See https://github.com/WordPress/gutenberg/issues/32607#issuecomment-890728216.
|
|
130
|
+
const blocks = getBlocks().map( block => {
|
|
131
|
+
const innerBlocks = select( 'core/block-editor' ).getBlocks( block.clientId );
|
|
132
|
+
return {
|
|
133
|
+
...block,
|
|
134
|
+
innerBlocks,
|
|
135
|
+
};
|
|
136
|
+
} );
|
|
137
|
+
|
|
138
|
+
const blockQueries = getBlockQueries( blocks, blockNames );
|
|
129
139
|
|
|
130
140
|
// Use requested specific posts ids as the starting state of exclusion list.
|
|
131
141
|
const specificPostsId = blockQueries.reduce( ( acc, { postsQuery } ) => {
|
|
@@ -35,10 +35,17 @@ call_user_func(
|
|
|
35
35
|
if ( has_post_thumbnail() && 'uncropped' !== $attributes['imageShape'] ) {
|
|
36
36
|
$image_size = Newspack_Blocks::image_size_for_orientation( $attributes['imageShape'] );
|
|
37
37
|
}
|
|
38
|
-
$thumbnail_args =
|
|
38
|
+
$thumbnail_args = array(
|
|
39
|
+
'data-hero-candidate' => true,
|
|
40
|
+
);
|
|
39
41
|
// If the image position is behind, pass the object-fit setting to maintain styles with AMP.
|
|
40
42
|
if ( 'behind' === $attributes['mediaPosition'] ) {
|
|
41
|
-
$thumbnail_args
|
|
43
|
+
$thumbnail_args['object-fit'] = 'cover';
|
|
44
|
+
}
|
|
45
|
+
// Disable lazy loading by using an arbitraty `loading` attribute other than `lazy`.
|
|
46
|
+
// Empty string or `false` would still result in `lazy`.
|
|
47
|
+
if ( $attributes['disableImageLazyLoad'] ) {
|
|
48
|
+
$thumbnail_args['loading'] = 'none';
|
|
42
49
|
}
|
|
43
50
|
$category = false;
|
|
44
51
|
// Use Yoast primary category if set.
|
|
@@ -124,9 +131,30 @@ call_user_func(
|
|
|
124
131
|
?>
|
|
125
132
|
<?php
|
|
126
133
|
if ( $attributes['showSubtitle'] ) :
|
|
134
|
+
$subtitle = get_post_meta( $post_id, 'newspack_post_subtitle', true );
|
|
135
|
+
|
|
127
136
|
?>
|
|
128
137
|
<div class="newspack-post-subtitle newspack-post-subtitle--in-homepage-block">
|
|
129
|
-
<?php
|
|
138
|
+
<?php
|
|
139
|
+
$allowed_tags = array(
|
|
140
|
+
'b' => true,
|
|
141
|
+
'strong' => true,
|
|
142
|
+
'i' => true,
|
|
143
|
+
'em' => true,
|
|
144
|
+
'mark' => true,
|
|
145
|
+
'u' => true,
|
|
146
|
+
'small' => true,
|
|
147
|
+
'sub' => true,
|
|
148
|
+
'sup' => true,
|
|
149
|
+
'a' => array(
|
|
150
|
+
'href' => true,
|
|
151
|
+
'target' => true,
|
|
152
|
+
'rel' => true,
|
|
153
|
+
),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
echo wptexturize( wp_kses( $subtitle, $allowed_tags ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
157
|
+
?>
|
|
130
158
|
</div>
|
|
131
159
|
<?php endif; ?>
|
|
132
160
|
<?php
|
|
@@ -16,17 +16,18 @@ call_user_func(
|
|
|
16
16
|
global $newspack_blocks_post_id;
|
|
17
17
|
do_action( 'newspack_blocks_homepage_posts_before_render' );
|
|
18
18
|
|
|
19
|
-
Newspack_Blocks::
|
|
20
|
-
Newspack_Blocks::filter_excerpt_more( $attributes );
|
|
19
|
+
Newspack_Blocks::filter_excerpt( $attributes );
|
|
21
20
|
|
|
21
|
+
$enable_post_duplication = apply_filters( 'newspack_blocks_homepage_enable_duplication', false );
|
|
22
22
|
while ( $article_query->have_posts() ) {
|
|
23
23
|
$article_query->the_post();
|
|
24
|
-
|
|
24
|
+
if ( ! $enable_post_duplication ) {
|
|
25
|
+
$newspack_blocks_post_id[ get_the_ID() ] = true;
|
|
26
|
+
}
|
|
25
27
|
echo Newspack_Blocks::template_inc( __DIR__ . '/article.php', array( 'attributes' => $attributes ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
Newspack_Blocks::
|
|
29
|
-
Newspack_Blocks::remove_excerpt_more_filter();
|
|
30
|
+
Newspack_Blocks::remove_excerpt_filter();
|
|
30
31
|
|
|
31
32
|
do_action( 'newspack_blocks_homepage_posts_after_render' );
|
|
32
33
|
wp_reset_postdata();
|
|
@@ -81,22 +81,22 @@ export const queryCriteriaFromAttributes = attributes => {
|
|
|
81
81
|
isSpecificPostModeActive
|
|
82
82
|
? {
|
|
83
83
|
include: cleanPosts,
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
postsToShow: specificPosts.length,
|
|
85
|
+
postType,
|
|
86
86
|
}
|
|
87
87
|
: {
|
|
88
|
-
|
|
88
|
+
postsToShow,
|
|
89
89
|
categories,
|
|
90
|
-
|
|
90
|
+
authors,
|
|
91
91
|
tags,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
tagExclusions,
|
|
93
|
+
categoryExclusions,
|
|
94
|
+
postType,
|
|
95
95
|
},
|
|
96
96
|
value => ! isUndefined( value )
|
|
97
97
|
);
|
|
98
|
-
criteria.
|
|
99
|
-
criteria.
|
|
98
|
+
criteria.excerptLength = excerptLength;
|
|
99
|
+
criteria.showExcerpt = showExcerpt;
|
|
100
100
|
return criteria;
|
|
101
101
|
};
|
|
102
102
|
|
|
@@ -173,7 +173,8 @@ export const postsBlockSelector = ( select, { clientId, attributes } ) => {
|
|
|
173
173
|
const { getBlocks } = select( 'core/block-editor' );
|
|
174
174
|
const editorBlocksIds = getEditorBlocksIds( getEditorBlocks() );
|
|
175
175
|
// The block might be rendered in the block styles preview, not in the editor.
|
|
176
|
-
const
|
|
176
|
+
const isWidgetEditor = getBlocks().some( block => block.name === 'core/widget-area' );
|
|
177
|
+
const isEditorBlock = editorBlocksIds.indexOf( clientId ) >= 0 || isWidgetEditor;
|
|
177
178
|
|
|
178
179
|
const { getPosts, getError, isUIDisabled } = select( STORE_NAMESPACE );
|
|
179
180
|
const props = {
|
|
@@ -58,6 +58,9 @@ function newspack_blocks_render_block_homepage_articles( $attributes ) {
|
|
|
58
58
|
if ( isset( $attributes['className'] ) ) {
|
|
59
59
|
$classes .= ' ' . $attributes['className'];
|
|
60
60
|
}
|
|
61
|
+
if ( $attributes['textAlign'] ) {
|
|
62
|
+
$classes .= ' has-text-align-' . $attributes['textAlign'];
|
|
63
|
+
}
|
|
61
64
|
|
|
62
65
|
if ( '' !== $attributes['textColor'] || '' !== $attributes['customTextColor'] ) {
|
|
63
66
|
$classes .= ' has-text-color';
|
|
@@ -221,7 +224,7 @@ function newspack_blocks_format_byline( $author_info ) {
|
|
|
221
224
|
$index = -1;
|
|
222
225
|
$elements = array_merge(
|
|
223
226
|
[
|
|
224
|
-
'<span class="author-prefix">' . esc_html_x( 'by', 'post author', 'newspack-blocks' ) . '
|
|
227
|
+
'<span class="author-prefix">' . esc_html_x( 'by', 'post author', 'newspack-blocks' ) . '</span> ',
|
|
225
228
|
],
|
|
226
229
|
array_reduce(
|
|
227
230
|
$author_info,
|