Full Site Editing - Version 0.21

Version Description

  • Linting fixes and page layout selector improvements.
Download this release

Release Info

Developer noahtallen
Plugin Icon wp plugin Full Site Editing
Version 0.21
Comparing to
See all releases

Code changes from version 0.19 to 0.21

Files changed (153) hide show
  1. blog-posts-block/dist/editor.asset.php +1 -1
  2. blog-posts-block/dist/editor.css +1 -1
  3. blog-posts-block/dist/editor.js +6 -2
  4. blog-posts-block/dist/editor.js.LICENSE +0 -5
  5. blog-posts-block/dist/editor.rtl.css +1 -1
  6. blog-posts-block/dist/view.asset.php +1 -1
  7. blog-posts-block/dist/view.css +1 -1
  8. blog-posts-block/dist/view.js +1 -1
  9. blog-posts-block/dist/view.rtl.css +1 -1
  10. blog-posts-block/editor.js +3 -0
  11. blog-posts-block/index.php +1 -1
  12. blog-posts-block/newspack-homepage-articles/README.md +2 -2
  13. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/block.json +4 -0
  14. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php +59 -24
  15. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/edit.js +113 -91
  16. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/editor.js +2 -0
  17. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/editor.scss +6 -1
  18. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/store.js +154 -0
  19. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/templates/article.php +10 -0
  20. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/utils.js +51 -0
  21. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/view.js +41 -69
  22. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/view.php +77 -37
  23. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/view.scss +169 -57
  24. blog-posts-block/newspack-homepage-articles/class-newspack-blocks-api.php +33 -33
  25. blog-posts-block/newspack-homepage-articles/class-newspack-blocks.php +8 -8
  26. blog-posts-block/newspack-homepage-articles/components/autocomplete-tokenfield.js +57 -49
  27. blog-posts-block/newspack-homepage-articles/components/autocomplete-tokenfield.scss +10 -1
  28. blog-posts-block/newspack-homepage-articles/components/query-controls.js +12 -12
  29. blog-posts-block/newspack-homepage-articles/shared/sass/_legacy_colors.scss +1 -1
  30. blog-posts-block/newspack-homepage-articles/shared/sass/_mixins.scss +4 -5
  31. blog-posts-block/newspack-homepage-articles/shared/sass/_placeholder.scss +5 -0
  32. blog-posts-block/newspack-homepage-articles/shared/sass/_variables.scss +9 -10
  33. {full-site-editing → dotcom-fse}/blocks/navigation-menu/edit.js +0 -0
  34. {full-site-editing → dotcom-fse}/blocks/navigation-menu/index.js +0 -0
  35. {full-site-editing → dotcom-fse}/blocks/navigation-menu/index.php +0 -0
  36. {full-site-editing → dotcom-fse}/blocks/navigation-menu/style.scss +0 -0
  37. {full-site-editing → dotcom-fse}/blocks/post-content/edit.js +0 -0
  38. {full-site-editing → dotcom-fse}/blocks/post-content/index.js +0 -0
  39. {full-site-editing → dotcom-fse}/blocks/post-content/index.php +0 -0
  40. {full-site-editing → dotcom-fse}/blocks/post-content/save.js +0 -0
  41. {full-site-editing → dotcom-fse}/blocks/post-content/style.scss +0 -0
  42. {full-site-editing → dotcom-fse}/blocks/site-credit/edit.js +0 -0
  43. {full-site-editing → dotcom-fse}/blocks/site-credit/footer-credit-choices.js +0 -0
  44. {full-site-editing → dotcom-fse}/blocks/site-credit/index.js +0 -0
  45. {full-site-editing → dotcom-fse}/blocks/site-credit/index.php +0 -0
  46. {full-site-editing → dotcom-fse}/blocks/site-credit/style.scss +1 -1
  47. {full-site-editing → dotcom-fse}/blocks/site-description/edit.js +0 -0
  48. {full-site-editing → dotcom-fse}/blocks/site-description/index.js +0 -0
  49. {full-site-editing → dotcom-fse}/blocks/site-description/index.php +0 -0
  50. {full-site-editing → dotcom-fse}/blocks/site-description/style.scss +0 -0
  51. {full-site-editing → dotcom-fse}/blocks/site-title/edit.js +0 -0
  52. {full-site-editing → dotcom-fse}/blocks/site-title/index.js +0 -0
  53. {full-site-editing → dotcom-fse}/blocks/site-title/index.php +0 -0
  54. {full-site-editing → dotcom-fse}/blocks/site-title/style.scss +0 -0
  55. {full-site-editing → dotcom-fse}/blocks/template/edit.js +0 -0
  56. {full-site-editing → dotcom-fse}/blocks/template/index.js +0 -0
  57. {full-site-editing → dotcom-fse}/blocks/template/index.php +0 -0
  58. {full-site-editing → dotcom-fse}/blocks/template/site-logo.js +0 -0
  59. {full-site-editing → dotcom-fse}/blocks/template/style.scss +6 -6
  60. {full-site-editing → dotcom-fse}/class-full-site-editing.php +48 -48
  61. full-site-editing/dist/full-site-editing.asset.php → dotcom-fse/dist/dotcom-fse.asset.php +1 -1
  62. full-site-editing/dist/full-site-editing.css → dotcom-fse/dist/dotcom-fse.css +1 -1
  63. full-site-editing/dist/full-site-editing.js → dotcom-fse/dist/dotcom-fse.js +6 -2
  64. full-site-editing/dist/full-site-editing.rtl.css → dotcom-fse/dist/dotcom-fse.rtl.css +1 -1
  65. {full-site-editing → dotcom-fse}/editor/block-inserter/index.js +0 -0
  66. {full-site-editing → dotcom-fse}/editor/block-inserter/post-content-block-appender.js +0 -0
  67. {full-site-editing → dotcom-fse}/editor/image-block-keywords/index.js +0 -0
  68. {full-site-editing → dotcom-fse}/editor/index.js +0 -0
  69. {full-site-editing → dotcom-fse}/editor/remove-editor-panels/index.js +0 -0
  70. {full-site-editing → dotcom-fse}/editor/style.scss +0 -0
  71. {full-site-editing → dotcom-fse}/editor/suppress-draft-action/index.js +0 -0
  72. {full-site-editing → dotcom-fse}/editor/suppress-trash-action/index.js +0 -0
  73. {full-site-editing → dotcom-fse}/editor/template-validity-override/index.js +0 -0
  74. {full-site-editing → dotcom-fse}/helpers.php +0 -0
  75. {full-site-editing → dotcom-fse}/index.js +0 -0
  76. {full-site-editing → dotcom-fse}/lib/index.js +0 -0
  77. {full-site-editing → dotcom-fse}/lib/site-options/index.js +0 -0
  78. {full-site-editing → dotcom-fse}/lib/site-options/use-previous.js +0 -0
  79. {full-site-editing → dotcom-fse}/lib/site-options/use-site-options.js +0 -0
  80. {full-site-editing → dotcom-fse}/lib/site-options/with-site-options.js +0 -0
  81. {full-site-editing → dotcom-fse}/plugins/close-button-override/index.js +0 -0
  82. {full-site-editing → dotcom-fse}/plugins/close-button-override/style.scss +0 -0
  83. {full-site-editing → dotcom-fse}/plugins/editor-template-classes/index.js +0 -0
  84. {full-site-editing → dotcom-fse}/plugins/template-update-notice/index.js +0 -0
  85. {full-site-editing → dotcom-fse}/sass/_mixins.scss +0 -0
  86. {full-site-editing → dotcom-fse}/serialize-block-fallback.php +0 -0
  87. {full-site-editing → dotcom-fse}/templates/class-rest-templates-controller.php +0 -0
  88. {full-site-editing → dotcom-fse}/templates/class-template-image-inserter.php +0 -0
  89. {full-site-editing → dotcom-fse}/templates/class-wp-template-inserter.php +0 -0
  90. {full-site-editing → dotcom-fse}/templates/class-wp-template.php +0 -0
  91. dotcom-fse/tests/fse-back-button.spec.js +27 -0
  92. e2e-test-helpers/activate-theme.js +20 -0
  93. e2e-test-helpers/index.js +1 -0
  94. event-countdown-block/blocks/src/edit.js +75 -0
  95. event-countdown-block/blocks/src/icon.js +13 -0
  96. event-countdown-block/blocks/src/index.js +50 -0
  97. event-countdown-block/blocks/src/view.js +76 -0
  98. event-countdown-block/{index.asset.php → dist/event-countdown-block.asset.php} +1 -1
  99. event-countdown-block/dist/event-countdown-block.js +1 -0
  100. event-countdown-block/index.js +4 -294
  101. event-countdown-block/index.php +38 -33
  102. full-site-editing-plugin.php +19 -6
  103. full-site-editing/dist/full-site-editing.js.LICENSE +0 -5
  104. global-styles/dist/global-styles.asset.php +1 -1
  105. global-styles/dist/global-styles.css +1 -1
  106. global-styles/dist/global-styles.js +6 -2
  107. global-styles/dist/global-styles.js.LICENSE +0 -5
  108. global-styles/dist/global-styles.rtl.css +1 -1
  109. jetpack-timeline/blocks/src/block-appender.js +38 -0
  110. jetpack-timeline/blocks/src/icon.js +12 -0
  111. jetpack-timeline/blocks/src/index.js +8 -0
  112. jetpack-timeline/blocks/src/timeline-item.js +78 -0
  113. jetpack-timeline/blocks/src/timeline.js +103 -0
  114. jetpack-timeline/dist/jetpack-timeline.asset.php +1 -0
  115. jetpack-timeline/dist/jetpack-timeline.js +1 -0
  116. jetpack-timeline/index.asset.php +0 -1
  117. jetpack-timeline/index.js +4 -252
  118. jetpack-timeline/index.php +39 -33
  119. posts-list-block/dist/posts-list-block.asset.php +1 -1
  120. posts-list-block/dist/posts-list-block.css +1 -1
  121. posts-list-block/dist/posts-list-block.js +1 -1
  122. posts-list-block/dist/posts-list-block.rtl.css +1 -1
  123. posts-list-block/templates/post-item.php +1 -1
  124. readme.txt +8 -2
  125. starter-page-templates/class-starter-page-templates.php +4 -2
  126. starter-page-templates/dist/starter-page-templates.asset.php +1 -1
  127. starter-page-templates/dist/starter-page-templates.css +1 -1
  128. starter-page-templates/dist/starter-page-templates.js +6 -2
  129. starter-page-templates/dist/starter-page-templates.js.LICENSE +0 -5
  130. starter-page-templates/dist/starter-page-templates.rtl.css +1 -1
  131. starter-page-templates/page-template-modal/components/block-iframe-preview.js +214 -0
  132. starter-page-templates/page-template-modal/components/block-preview.js +15 -14
  133. starter-page-templates/page-template-modal/components/block-template-preview.js +0 -34
  134. starter-page-templates/page-template-modal/components/preview-template-title.js +0 -22
  135. starter-page-templates/page-template-modal/components/template-selector-item.js +7 -3
  136. starter-page-templates/page-template-modal/components/template-selector-preview.js +14 -124
  137. starter-page-templates/page-template-modal/components/test/__snapshots__/{template-selector-control-test.js.snap → template-selector-control.test.js.snap} +4 -28
  138. starter-page-templates/page-template-modal/components/test/__snapshots__/template-selector-preview-test.js.snap +0 -48
  139. starter-page-templates/page-template-modal/components/test/__snapshots__/template-selector-preview.test.js.snap +17 -0
  140. starter-page-templates/page-template-modal/components/test/{template-selector-control-test.js → template-selector-control.test.js} +5 -6
  141. starter-page-templates/page-template-modal/components/test/{template-selector-preview-test.js → template-selector-preview.test.js} +22 -10
  142. starter-page-templates/page-template-modal/index.js +64 -7
  143. starter-page-templates/page-template-modal/styles/starter-page-templates-editor.scss +108 -111
  144. starter-page-templates/page-template-modal/utils/ensure-assets.js +9 -3
  145. starter-page-templates/page-template-modal/utils/map-blocks-recursively.js +34 -0
  146. wpcom-block-editor-nux/class-wp-rest-wpcom-block-editor-nux-status-controller.php +94 -0
  147. wpcom-block-editor-nux/class-wpcom-block-editor-nux.php +65 -0
  148. wpcom-block-editor-nux/dist/wpcom-block-editor-nux.asset.php +1 -0
  149. wpcom-block-editor-nux/dist/wpcom-block-editor-nux.js +1 -0
  150. wpcom-block-editor-nux/index.js +6 -0
  151. wpcom-block-editor-nux/src/disable-core-nux.js +27 -0
  152. wpcom-block-editor-nux/src/store.js +36 -0
  153. wpcom-block-editor-nux/src/wpcom-nux.js +86 -0
blog-posts-block/dist/editor.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'moment', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'aa22b6322c09c33b4be0b543a1805fdf');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '1d0a23a57ccc0dfdca81c2ba5c67699d');
blog-posts-block/dist/editor.css CHANGED
@@ -1 +1 @@
1
- .autocomplete-tokenfield{position:relative}.autocomplete-tokenfield .components-spinner{position:absolute;top:2em;right:0}.type-scale-slider .dashicon{height:16px;width:16px}.type-scale-slider input+.dashicon{height:24px;margin-left:10px;margin-right:0;width:24px}.wpnbha .editor-rich-text{width:100%}.wpnbha .cat-links{font-size:.7em}.wpnbha span.avatar{display:inline-block;margin-right:.5em}.wpnbha span.avatar div{display:inline}.wpnbha .excerpt-contain p{margin:.5em 0}.wpnbha{margin-bottom:1em}.wpnbha article{margin-bottom:1.5em;word-break:break-word;overflow-wrap:break-word;position:relative}.wpnbha article:last-of-type{margin-bottom:0}.wpnbha .article-section-title{font-size:.8em;margin-bottom:.5em;width:100%}.wpnbha.is-grid>div{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0;list-style:none}.wpnbha.is-grid article{flex-basis:100%}@media only screen and (min-width:782px){.wpnbha.is-grid article,.wpnbha.is-grid article:last-child{margin-bottom:1em}}@media only screen and (min-width:600px){.wpnbha.columns-3 article,.wpnbha.columns-6 article{flex-basis:calc(33.333% - 16px)}.wpnbha.columns-2 article,.wpnbha.columns-4 article,.wpnbha.columns-5 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-5 article:last-of-type:nth-child(odd){flex-grow:1}}@media only screen and (min-width:782px){.wpnbha.columns-2 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-3 article{flex-basis:calc(33.33333% - 16px)}.wpnbha.columns-4 article{flex-basis:calc(25% - 16px)}.wpnbha.columns-5 article{flex-basis:calc(20% - 16px)}.wpnbha.columns-6 article{flex-basis:calc(16.66667% - 16px)}}.wpnbha .post-thumbnail{margin:0}.wpnbha .post-thumbnail img{height:auto;width:100%}.wpnbha figcaption{font-size:.6em}.wpnbha .post-thumbnail{margin-bottom:.25em}.wpnbha .post-thumbnail figcaption{margin-bottom:.5em}.wpnbha.image-alignleft .post-has-image,.wpnbha.image-alignright .post-has-image{display:flex}.wpnbha.image-alignleft .post-has-image .post-thumbnail,.wpnbha.image-alignright .post-has-image .post-thumbnail{flex-basis:33%}.wpnbha.image-alignleft .post-has-image .entry-wrapper,.wpnbha.image-alignright .post-has-image .entry-wrapper{flex-basis:67%}.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:block}@media only screen and (min-width:600px){.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:flex}}@media only screen and (min-width:600px){.wpnbha.image-alignleft.is-4 .post-thumbnail,.wpnbha.image-alignright.is-4 .post-thumbnail{flex-basis:75%}.wpnbha.image-alignleft.is-4 .entry-wrapper,.wpnbha.image-alignright.is-4 .entry-wrapper{flex-basis:25%}.wpnbha.image-alignleft.is-3 .entry-wrapper,.wpnbha.image-alignleft.is-3 .post-thumbnail,.wpnbha.image-alignright.is-3 .entry-wrapper,.wpnbha.image-alignright.is-3 .post-thumbnail{flex-basis:50%}}.wpnbha.image-alignleft.is-1 .post-thumbnail,.wpnbha.image-alignright.is-1 .post-thumbnail{flex-basis:25%}.wpnbha.image-alignleft.is-1 .entry-wrapper,.wpnbha.image-alignright.is-1 .entry-wrapper{flex-basis:75%}.wpnbha.image-alignleft .post-thumbnail{margin-right:1em}.wpnbha.image-alignright .post-thumbnail{margin-left:1em}.wpnbha.image-alignright .entry-wrapper{order:-1}.wpnbha.mobile-stack.image-alignleft .post-thumbnail,.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-left:0;margin-right:0}@media only screen and (min-width:600px){.wpnbha.mobile-stack.image-alignleft .post-thumbnail{margin-right:1em}.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-left:1em}}.wpnbha .entry-title{margin:0 0 .25em}.wpnbha .entry-title a{color:inherit;text-decoration:none}.wpnbha .cat-links{font-size:.6em;font-weight:700;margin:0 0 .5em}.wpnbha .cat-links a{text-decoration:none}.wpnbha .cat-links a:hover{text-decoration:underline}.wpnbha .entry-meta{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5em}.wpnbha .entry-meta .byline:not(:last-child){margin-right:1.5em}.wpnbha .entry-meta .updated:not(.published){display:none}.wpnbha .avatar{border-radius:100%;display:block;margin-right:.5em}.wpnbha p{margin:.5em 0}.wpnbha.has-text-color .article-section-title,.wpnbha.has-text-color .cat-links,.wpnbha.has-text-color .cat-links a,.wpnbha.has-text-color .cat-links a:visited,.wpnbha.has-text-color .entry-meta,.wpnbha.has-text-color .entry-meta .byline a,.wpnbha.has-text-color .entry-meta .byline a:visited,.wpnbha.has-text-color .entry-meta a,.wpnbha.has-text-color .entry-title,.wpnbha.has-text-color .entry-title a,.wpnbha.has-text-color .entry-title a:visited,.wpnbha.has-text-color figcaption{color:inherit}.wpnbha.has-text-color .entry-meta span:not(.avatar){opacity:.8}.wpnbha.image-alignbehind .post-has-image{display:flex;align-items:flex-end;position:relative}.wpnbha.image-alignbehind .post-has-image .post-thumbnail{bottom:0;left:0;margin:0;overflow:hidden;position:absolute;right:0;top:0}.wpnbha.image-alignbehind .post-has-image .post-thumbnail img{height:100%;-o-object-fit:cover;object-fit:cover;max-width:1000%;width:100%}.wpnbha.image-alignbehind .post-has-image .post-thumbnail figcaption{bottom:1em;-webkit-box-orient:vertical;color:hsla(0,0%,100%,.9);display:-webkit-box;font-style:italic;left:0;-webkit-line-clamp:1;margin:0;max-height:1.6em;overflow:hidden;padding:0 1em;position:absolute;right:0;text-align:right;text-overflow:ellipsis;z-index:2}.wpnbha.image-alignbehind .post-has-image .post-thumbnail:after{background:rgba(0,0,0,.5);bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em;position:relative;z-index:2}.wpnbha.image-alignbehind .post-has-image .cat-links a,.wpnbha.image-alignbehind .post-has-image .entry-meta,.wpnbha.image-alignbehind .post-has-image .entry-meta .byline a,.wpnbha.image-alignbehind .post-has-image .entry-title a,.wpnbha.image-alignbehind .post-has-image .entry-wrapper{color:#fff}.wpnbha article .entry-title{font-size:1.2em}.wpnbha article .entry-meta{font-size:.8em}.wpnbha article .avatar{height:25px;width:25px}@media only screen and (min-width:782px){.wpnbha article .entry-title{font-size:1.6em}.wpnbha article .avatar{height:40px;width:40px}}.wpnbha.ts-8 .entry-title,.wpnbha.ts-9 .entry-title,.wpnbha.ts-10 .entry-title{line-height:1.1em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .avatar,.wpnbha.ts-9 article .avatar,.wpnbha.ts-10 article .avatar{height:2.4em;width:2.4em}}.wpnbha.ts-10 article .entry-title{font-size:2.6em}@media only screen and (min-width:782px){.wpnbha.ts-10 article .entry-title{font-size:3.6em}}@media only screen and (min-width:1168px){.wpnbha.ts-10 article .entry-title{font-size:4.8em}}.wpnbha.ts-9 article .entry-title{font-size:2.4em}@media only screen and (min-width:782px){.wpnbha.ts-9 article .entry-title{font-size:3.4em}}@media only screen and (min-width:1168px){.wpnbha.ts-9 article .entry-title{font-size:4.2em}}.wpnbha.ts-8 article .entry-title{font-size:2.2em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .entry-title{font-size:3em}}@media only screen and (min-width:1168px){.wpnbha.ts-8 article .entry-title{font-size:3.6em}}.wpnbha.ts-7 article .entry-title{font-size:2em}@media only screen and (min-width:782px){.wpnbha.ts-7 article .entry-title{font-size:2.4em}.wpnbha.ts-7 article .avatar{height:48px;width:48px}}@media only screen and (min-width:1168px){.wpnbha.ts-7 article .entry-title{font-size:3em}}.wpnbha.ts-6 article .entry-title{font-size:1.7em}@media only screen and (min-width:782px){.wpnbha.ts-6 article .entry-title{font-size:2em}.wpnbha.ts-6 article .avatar{height:44px;width:44px}}@media only screen and (min-width:1168px){.wpnbha.ts-6 article .entry-title{font-size:2.4em}}.wpnbha.ts-5 article .entry-title{font-size:1.4em}@media only screen and (min-width:782px){.wpnbha.ts-5 article .entry-title{font-size:1.8em}.wpnbha.ts-5 article .avatar{height:40px;width:40px}}@media only screen and (min-width:1168px){.wpnbha.ts-5 article .entry-title{font-size:2em}}.wpnbha.ts-3 article .entry-title{font-size:1em}.wpnbha.ts-3 article .entry-wrapper p{font-size:.8em}.wpnbha.ts-3 article .entry-meta{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-3 article .entry-title{font-size:1.2em}.wpnbha.ts-3 article .avatar{height:32px;width:32px}}.wpnbha.ts-2 article .entry-title{font-size:.8em}.wpnbha.ts-2 article .entry-meta,.wpnbha.ts-2 article .entry-wrapper p{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-2 article .entry-title{font-size:.9em}.wpnbha.ts-2 article .avatar{height:28px;width:28px}}.wpnbha.ts-1 article .entry-title,.wpnbha.ts-1 article .entry-wrapper p{font-size:.7em}.wpnbha.ts-1 article .entry-meta{font-size:.6em}@media only screen and (min-width:782px){.wpnbha.ts-1 article .avatar{height:24px;width:24px}}.wpnbha.is-style-borders article{border:solid rgba(0,0,0,.2);border-width:0 0 1px;margin-bottom:1em;padding-bottom:1em}.wpnbha.is-style-borders article:last-of-type{margin-bottom:0}.wpnbha.is-style-borders article:last-of-type:not(:first-of-type){border-bottom:0}@media only screen and (min-width:782px){.wpnbha.is-style-borders.columns-2 article{padding-right:32px}.wpnbha.is-style-borders.columns-3 article{padding-right:24px}.wpnbha.is-style-borders.columns-4 article{padding-right:21.33333px}.wpnbha.is-style-borders.columns-5 article{padding-right:20px}.wpnbha.is-style-borders.columns-6 article{padding-right:19.2px}.wpnbha.is-style-borders.is-grid article{border-width:0 1px 0 0}.wpnbha.is-style-borders.columns-1 article,.wpnbha.is-style-borders.columns-2 article:nth-of-type(2n),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n),.wpnbha.is-style-borders.columns-4 article:nth-of-type(4n),.wpnbha.is-style-borders.columns-5 article:nth-of-type(5n),.wpnbha.is-style-borders.columns-6 article:nth-of-type(6n),.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}
1
+ .autocomplete-tokenfield{position:relative}.autocomplete-tokenfield .components-spinner{position:absolute;top:2em;right:0}.autocomplete-tokenfield .components-form-token-field>.components-form-token-field__help{display:none}.autocomplete-tokenfield .autocomplete-tokenfield__help{font-style:italic}.wp-block[data-type^="newspack-blocks/"] .component-placeholder__align-center{align-items:center}.type-scale-slider .dashicon{height:16px;width:16px}.type-scale-slider input+.dashicon{height:24px;margin-left:10px;margin-right:0;width:24px}.wpnbha .editor-rich-text{width:100%}.wpnbha .cat-links{font-size:.7em}.wpnbha span.avatar{display:inline-block;margin-right:.5em}.wpnbha span.avatar div{display:inline}.wpnbha .excerpt-contain p{margin:.5em 0}.editor-styles-wrapper.wpnbha__wp-block-button__wrapper{background-color:transparent}.wpnbha{margin-bottom:1em}.wpnbha article{margin-bottom:1.5em;word-break:break-word;overflow-wrap:break-word;position:relative}.wpnbha article:last-of-type{margin-bottom:0}.wpnbha .article-section-title{font-size:.8em;margin-bottom:.5em;width:100%}.wpnbha.is-grid>div{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0;list-style:none}.wpnbha.is-grid article{flex-basis:100%}@media only screen and (min-width:782px){.wpnbha.is-grid article,.wpnbha.is-grid article:last-child{margin-bottom:1em}}@media only screen and (min-width:600px){.wpnbha.columns-3 article,.wpnbha.columns-6 article{flex-basis:calc(33.333% - 16px)}.wpnbha.columns-2 article,.wpnbha.columns-4 article,.wpnbha.columns-5 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-5 article:last-of-type{flex-basis:100%}}@media only screen and (min-width:782px){.wpnbha.columns-2 article,.wpnbha.columns-2 article:last-of-type{flex-basis:calc(50% - 16px)}.wpnbha.columns-3 article,.wpnbha.columns-3 article:last-of-type{flex-basis:calc(33.33333% - 16px)}.wpnbha.columns-4 article,.wpnbha.columns-4 article:last-of-type{flex-basis:calc(25% - 16px)}.wpnbha.columns-5 article,.wpnbha.columns-5 article:last-of-type{flex-basis:calc(20% - 16px)}.wpnbha.columns-6 article,.wpnbha.columns-6 article:last-of-type{flex-basis:calc(16.66667% - 16px)}}.wpnbha .post-thumbnail{margin:0 0 .25em}.wpnbha .post-thumbnail img{height:auto;width:100%}.wpnbha .post-thumbnail figcaption{margin-bottom:.5em}.wpnbha figcaption{font-size:.6em}.wpnbha.image-alignleft .post-has-image,.wpnbha.image-alignright .post-has-image{display:flex}.wpnbha.image-alignleft .post-has-image .post-thumbnail,.wpnbha.image-alignright .post-has-image .post-thumbnail{flex-basis:33%}.wpnbha.image-alignleft .post-has-image .entry-wrapper,.wpnbha.image-alignright .post-has-image .entry-wrapper{flex-basis:67%}.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:block}@media only screen and (min-width:600px){.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:flex}}@media only screen and (min-width:600px){.wpnbha.image-alignleft.is-4 .post-thumbnail,.wpnbha.image-alignright.is-4 .post-thumbnail{flex-basis:75%}.wpnbha.image-alignleft.is-4 .entry-wrapper,.wpnbha.image-alignright.is-4 .entry-wrapper{flex-basis:25%}.wpnbha.image-alignleft.is-3 .entry-wrapper,.wpnbha.image-alignleft.is-3 .post-thumbnail,.wpnbha.image-alignright.is-3 .entry-wrapper,.wpnbha.image-alignright.is-3 .post-thumbnail{flex-basis:50%}}.wpnbha.image-alignleft.is-1 .post-thumbnail,.wpnbha.image-alignright.is-1 .post-thumbnail{flex-basis:25%}.wpnbha.image-alignleft.is-1 .entry-wrapper,.wpnbha.image-alignright.is-1 .entry-wrapper{flex-basis:75%}.wpnbha.image-alignleft .post-thumbnail{margin-right:1em}.wpnbha.image-alignright .post-thumbnail{margin-left:1em}.wpnbha.image-alignright .entry-wrapper{order:-1}.wpnbha.mobile-stack.image-alignleft .post-thumbnail,.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-left:0;margin-right:0}@media only screen and (min-width:600px){.wpnbha.mobile-stack.image-alignleft .post-thumbnail{margin-right:1em}.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-left:1em}}.wpnbha .entry-title{margin:0 0 .25em}.wpnbha .entry-title a{color:inherit;text-decoration:none}.wpnbha .cat-links{font-size:.6em;font-weight:700;margin:0 0 .5em}.wpnbha .cat-links a{text-decoration:none}.wpnbha .cat-links a:hover{text-decoration:underline}.wpnbha .entry-meta{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5em}.wpnbha .entry-meta .byline:not(:last-child){margin-right:1.5em}.wpnbha .entry-meta .updated:not(.published){display:none}.wpnbha .avatar{border-radius:100%;display:block;margin-right:.5em}.wpnbha p{margin:.5em 0}.wpnbha.has-text-color .article-section-title,.wpnbha.has-text-color .cat-links,.wpnbha.has-text-color .cat-links a,.wpnbha.has-text-color .cat-links a:visited,.wpnbha.has-text-color .entry-meta,.wpnbha.has-text-color .entry-meta .byline a,.wpnbha.has-text-color .entry-meta .byline a:visited,.wpnbha.has-text-color .entry-meta a,.wpnbha.has-text-color .entry-title,.wpnbha.has-text-color .entry-title a,.wpnbha.has-text-color .entry-title a:visited,.wpnbha.has-text-color figcaption{color:inherit}.wpnbha.has-text-color .entry-meta span:not(.avatar){opacity:.8}.wpnbha.image-alignbehind .post-has-image{display:flex;align-items:flex-end;position:relative}.wpnbha.image-alignbehind .post-has-image .post-thumbnail{bottom:0;left:0;margin:0;overflow:hidden;position:absolute;right:0;top:0}.wpnbha.image-alignbehind .post-has-image .post-thumbnail img{height:100%;-o-object-fit:cover;object-fit:cover;max-width:1000%;width:100%}.wpnbha.image-alignbehind .post-has-image .post-thumbnail figcaption{bottom:1em;-webkit-box-orient:vertical;color:hsla(0,0%,100%,.9);display:-webkit-box;font-style:italic;left:0;-webkit-line-clamp:1;margin:0;max-height:1.6em;overflow:hidden;padding:0 1em;position:absolute;right:0;text-align:right;text-overflow:ellipsis;z-index:2}.wpnbha.image-alignbehind .post-has-image .post-thumbnail:after{background:rgba(0,0,0,.5);bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em 1em;position:relative;z-index:2}@media only screen and (min-width:1168px){.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em 1.5em}}.wpnbha.image-alignbehind .post-has-image .cat-links a,.wpnbha.image-alignbehind .post-has-image .entry-meta,.wpnbha.image-alignbehind .post-has-image .entry-meta .byline a,.wpnbha.image-alignbehind .post-has-image .entry-title a,.wpnbha.image-alignbehind .post-has-image .entry-wrapper{color:#fff}.wpnbha .error,.wpnbha .loading,.wpnbha button{display:none}.wpnbha button{margin-top:1em}.wpnbha.has-more-button button{display:block}.wpnbha.has-more-button.is-loading button{display:none}.wpnbha.has-more-button.is-error .error,.wpnbha.has-more-button.is-error button,.wpnbha.has-more-button.is-loading .loading{display:block}.wpnbha article .entry-title{font-size:1.2em}.wpnbha article .entry-meta{font-size:.8em}.wpnbha article .avatar{height:25px;width:25px}@media only screen and (min-width:782px){.wpnbha article .entry-title{font-size:1.6em}.wpnbha article .avatar{height:40px;width:40px}}.wpnbha.ts-8 .entry-title,.wpnbha.ts-9 .entry-title,.wpnbha.ts-10 .entry-title{line-height:1.1em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .avatar,.wpnbha.ts-9 article .avatar,.wpnbha.ts-10 article .avatar{height:2.4em;width:2.4em}}.wpnbha.ts-7 .newspack-post-subtitle,.wpnbha.ts-8 .newspack-post-subtitle,.wpnbha.ts-9 .newspack-post-subtitle,.wpnbha.ts-10 .newspack-post-subtitle{font-size:1.4em}.wpnbha.ts-10 article .entry-title{font-size:2.6em}@media only screen and (min-width:782px){.wpnbha.ts-10 article .entry-title{font-size:3.6em}}@media only screen and (min-width:1168px){.wpnbha.ts-10 article .entry-title{font-size:4.8em}}.wpnbha.ts-9 article .entry-title{font-size:2.4em}@media only screen and (min-width:782px){.wpnbha.ts-9 article .entry-title{font-size:3.4em}}@media only screen and (min-width:1168px){.wpnbha.ts-9 article .entry-title{font-size:4.2em}}.wpnbha.ts-8 article .entry-title{font-size:2.2em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .entry-title{font-size:3em}}@media only screen and (min-width:1168px){.wpnbha.ts-8 article .entry-title{font-size:3.6em}}.wpnbha.ts-7 article .entry-title{font-size:2em}@media only screen and (min-width:782px){.wpnbha.ts-7 article .entry-title{font-size:2.4em}.wpnbha.ts-7 article .avatar{height:48px;width:48px}}@media only screen and (min-width:1168px){.wpnbha.ts-7 article .entry-title{font-size:3em}}.wpnbha.ts-6 article .entry-title{font-size:1.7em}.wpnbha.ts-6 article .newspack-post-subtitle{font-size:1.4em}@media only screen and (min-width:782px){.wpnbha.ts-6 article .entry-title{font-size:2em}.wpnbha.ts-6 article .avatar{height:44px;width:44px}}@media only screen and (min-width:1168px){.wpnbha.ts-6 article .entry-title{font-size:2.4em}}.wpnbha.ts-5 article .entry-title{font-size:1.4em}.wpnbha.ts-5 article .newspack-post-subtitle{font-size:1.2em}@media only screen and (min-width:782px){.wpnbha.ts-5 article .entry-title{font-size:1.8em}.wpnbha.ts-5 article .avatar{height:40px;width:40px}}@media only screen and (min-width:1168px){.wpnbha.ts-5 article .entry-title{font-size:2em}}.wpnbha.ts-3 article .entry-title{font-size:1em}.wpnbha.ts-3 article .entry-wrapper p,.wpnbha.ts-3 article .newspack-post-subtitle{font-size:.8em}.wpnbha.ts-3 article .entry-meta{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-3 article .entry-title{font-size:1.2em}.wpnbha.ts-3 article .avatar{height:32px;width:32px}}.wpnbha.ts-2 article .entry-title{font-size:.8em}.wpnbha.ts-2 article .entry-meta,.wpnbha.ts-2 article .entry-wrapper p,.wpnbha.ts-2 article .newspack-post-subtitle{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-2 article .entry-title{font-size:.9em}.wpnbha.ts-2 article .avatar{height:28px;width:28px}}.wpnbha.ts-1 article .entry-title,.wpnbha.ts-1 article .entry-wrapper p,.wpnbha.ts-1 article .newspack-post-subtitle{font-size:.7em}.wpnbha.ts-1 article .entry-meta{font-size:.6em}@media only screen and (min-width:782px){.wpnbha.ts-1 article .avatar{height:24px;width:24px}}.wpnbha.is-style-borders article{border:solid rgba(0,0,0,.2);border-width:0 0 1px;margin-bottom:1em;padding-bottom:1em}.wpnbha.is-style-borders article:last-of-type{margin-bottom:0}.wpnbha.is-style-borders article:last-of-type:not(:first-of-type){border-bottom:0}@media only screen and (min-width:600px){.wpnbha.is-style-borders.columns-2 article{padding-right:32px}.wpnbha.is-style-borders.columns-3 article{padding-right:24px}.wpnbha.is-style-borders.columns-4 article{padding-right:21.33333px}.wpnbha.is-style-borders.columns-5 article{padding-right:20px}.wpnbha.is-style-borders.columns-6 article{padding-right:19.2px}.wpnbha.is-style-borders.columns-2 article,.wpnbha.is-style-borders.columns-4 article,.wpnbha.is-style-borders.columns-5 article{border-width:0}.wpnbha.is-style-borders.columns-2 article:nth-of-type(odd),.wpnbha.is-style-borders.columns-4 article:nth-of-type(odd),.wpnbha.is-style-borders.columns-5 article:nth-of-type(odd){border-width:0 1px 0 0}.wpnbha.is-style-borders.columns-3 article,.wpnbha.is-style-borders.columns-6 article{border-width:0}.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n+1),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n+2),.wpnbha.is-style-borders.columns-6 article:nth-of-type(3n+1),.wpnbha.is-style-borders.columns-6 article:nth-of-type(3n+2){border-width:0 1px 0 0}.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}@media only screen and (min-width:782px){.wpnbha.is-style-borders.is-grid article{border-width:0 1px 0 0}.wpnbha.is-style-borders.columns-1 article,.wpnbha.is-style-borders.columns-2 article:nth-of-type(2n),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n),.wpnbha.is-style-borders.columns-4 article:nth-of-type(4n),.wpnbha.is-style-borders.columns-5 article:nth-of-type(5n),.wpnbha.is-style-borders.columns-6 article:nth-of-type(6n),.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}.newspack-post-subtitle--in-homepage-block{margin-top:.3em;margin-bottom:0;line-height:1.4em;font-style:italic}amp-script .wpnbha.has-more-button.is-loading button{display:none}amp-script .wpnbha.has-more-button.is-error .error,amp-script .wpnbha.has-more-button.is-error button,amp-script .wpnbha.has-more-button.is-loading .loading{display:block}
blog-posts-block/dist/editor.js CHANGED
@@ -1,2 +1,6 @@
1
- /*! For license information please see editor.js.LICENSE */
2
- !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(o){if(t[o])return t[o].exports;var c=t[o]={i:o,l:!1,exports:{}};return e[o].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(o,c,function(t){return e[t]}.bind(null,c));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=33)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var o=n(28),c=n(4);e.exports=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?c(e):t}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var o=n(29);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){var o=n(25),c=n(26),a=n(27);e.exports=function(e){return o(e)||c(e)||a()}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e}},function(e){e.exports=JSON.parse('{"name":"homepage-articles","category":"newspack","attributes":{"className":{"type":"string","default":""},"showExcerpt":{"type":"boolean","default":true},"showDate":{"type":"boolean","default":true},"showImage":{"type":"boolean","default":true},"showCaption":{"type":"boolean","default":false},"imageShape":{"type":"string","default":"landscape"},"minHeight":{"type":"integer","default":0},"moreButton":{"type":"boolean","default":false},"moreButtonText":{"type":"string","default":""},"showAuthor":{"type":"boolean","default":true},"showAvatar":{"type":"boolean","default":true},"showCategory":{"type":"boolean","default":false},"postLayout":{"type":"string","default":"list"},"columns":{"type":"integer","default":3},"postsToShow":{"type":"integer","default":3},"mediaPosition":{"type":"string","default":"top"},"authors":{"type":"array","default":[],"items":{"type":"integer"}},"categories":{"type":"array","default":[],"items":{"type":"integer"}},"tags":{"type":"array","default":[],"items":{"type":"integer"}},"tagExclusions":{"type":"array","default":[],"items":{"type":"integer"}},"specificPosts":{"type":"array","default":[],"items":{"type":"integer"}},"typeScale":{"type":"integer","default":4},"imageScale":{"type":"integer","default":3},"mobileStack":{"type":"boolean","default":false},"sectionHeader":{"type":"string","default":""},"specificMode":{"type":"boolean","default":false},"textColor":{"type":"string","default":""},"customTextColor":{"type":"string","default":""},"singleMode":{"type":"boolean","default":false}}}')},function(e,t,n){var o=n(3);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)&&o.length){var r=c.apply(null,o);r&&e.push(r)}else if("object"===a)for(var s in o)n.call(o,s)&&o[s]&&e.push(s)}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()},function(e,t){!function(){e.exports=this.moment}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){function n(t,o){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,o)}e.exports=n},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var o=n(19),c=n.n(o),a=n(13),r=n(1),s=n(15),i=n(0),l=n(2),u=n(16),p=n.n(u),b=n(9),h=n.n(b),f=n(17),g=n.n(f),d=n(10),m=n.n(d),w=n(11),O=n.n(w),k=n(4),j=n.n(k),y=n(12),v=n.n(y),_=n(3),E=n.n(_),S=n(20),C=n.n(S),x=n(7),P=n.n(x),A=n(6),T=n(5),M=n(14),H=(n(30),function(e){function t(e){var n;return h()(this,t),(n=m()(this,O()(t).call(this,e))).state={suggestions:[],validValues:{},loading:!1},n.debouncedUpdateSuggestions=Object(M.debounce)(n.updateSuggestions,500),n}return v()(t,e),g()(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.tokens,o=t.fetchSavedInfo;n.length&&o&&this.setState({loading:!0},(function(){o(n).then((function(t){var n=e.state.validValues;t.forEach((function(e){n[e.value]=e.label})),e.setState({validValues:n,loading:!1})}))}))}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest,this.debouncedUpdateSuggestions.cancel()}},{key:"getLabelsForValues",value:function(e){var t=this.state.validValues;return e.reduce((function(e,n){return t[n]?[].concat(p()(e),[t[n]]):e}),[])}},{key:"getValuesForLabels",value:function(e){var t=this.state.validValues;return e.map((function(e){return Object.keys(t).find((function(n){return t[n]===e}))}))}},{key:"updateSuggestions",value:function(e){var t=this,n=this.props.fetchSuggestions;n&&this.setState({loading:!0},(function(){var o=n(e);o.then((function(e){if(t.suggestionsRequest===o){var n=t.state.validValues,c=[];e.forEach((function(e){c.push(e.label),n[e.value]=e.label})),t.setState({suggestions:c,validValues:n,loading:!1})}})).catch((function(){t.suggestionsRequest===o&&t.setState({loading:!1})})),t.suggestionsRequest=o}))}},{key:"handleOnChange",value:function(e){(0,this.props.onChange)(this.getValuesForLabels(e))}},{key:"getTokens",value:function(){var e=this.props.tokens;return this.getLabelsForValues(e)}},{key:"render",value:function(){var e=this,t=this.props.label,n=void 0===t?"":t,o=this.state,c=o.suggestions,a=o.loading;return Object(i.createElement)("div",{className:"autocomplete-tokenfield"},Object(i.createElement)(l.FormTokenField,{value:this.getTokens(),suggestions:c,onChange:function(t){return e.handleOnChange(t)},onInputChange:function(t){return e.debouncedUpdateSuggestions(t)},label:n}),a&&Object(i.createElement)(l.Spinner,null))}}]),t}(i.Component)),V=function(e){function t(){var e,n;h()(this,t);for(var o=arguments.length,c=new Array(o),a=0;a<o;a++)c[a]=arguments[a];return n=m()(this,(e=O()(t)).call.apply(e,[this].concat(c))),E()(j()(n),"state",{showAdvancedFilters:!1}),E()(j()(n),"fetchPostSuggestions",(function(e){return P()({path:Object(A.addQueryArgs)("/wp/v2/search",{search:e,per_page:20,_fields:"id,title",type:"post"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.title)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),E()(j()(n),"fetchSavedPosts",(function(e){return P()({path:Object(A.addQueryArgs)("/wp/v2/posts",{per_page:100,include:e.join(","),_fields:"id,title"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.title.rendered)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),E()(j()(n),"fetchAuthorSuggestions",(function(e){return P()({path:Object(A.addQueryArgs)("/wp/v2/users",{search:e,per_page:20,_fields:"id,name"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no name)","newspack-blocks")}}))}))})),E()(j()(n),"fetchSavedAuthors",(function(e){return P()({path:Object(A.addQueryArgs)("/wp/v2/users",{per_page:100,include:e.join(","),_fields:"id,name"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no name)","newspack-blocks")}}))}))})),E()(j()(n),"fetchCategorySuggestions",(function(e){return P()({path:Object(A.addQueryArgs)("/wp/v2/categories",{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),E()(j()(n),"fetchSavedCategories",(function(e){return P()({path:Object(A.addQueryArgs)("/wp/v2/categories",{per_page:100,_fields:"id,name",include:e.join(",")})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),E()(j()(n),"fetchTagSuggestions",(function(e){return P()({path:Object(A.addQueryArgs)("/wp/v2/tags",{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),E()(j()(n),"fetchSavedTags",(function(e){return P()({path:Object(A.addQueryArgs)("/wp/v2/tags",{per_page:100,_fields:"id,name",include:e.join(",")})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),E()(j()(n),"render",(function(){var e=n.props,t=(e.numberOfItems,e.onNumberOfItemsChange,e.specificMode),o=e.onSpecificModeChange,c=e.specificPosts,a=e.onSpecificPostsChange,s=e.authors,u=e.onAuthorsChange,p=e.categories,b=e.onCategoriesChange,h=e.tags,f=e.onTagsChange,g=e.tagExclusions,d=e.onTagExclusionsChange,m=e.enableSpecific,w=n.state.showAdvancedFilters;return[m&&Object(i.createElement)(l.ToggleControl,{key:"specificMode",checked:t,onChange:o,label:Object(r.__)("Choose specific stories","newspack-blocks")}),t&&Object(i.createElement)(H,{key:"posts",tokens:c||[],onChange:a,fetchSuggestions:n.fetchPostSuggestions,fetchSavedInfo:n.fetchSavedPosts,label:Object(r.__)("Posts","newspack-blocks")}),!t&&Object(i.createElement)(l.QueryControls,C()({key:"queryControls"},n.props)),!t&&u&&Object(i.createElement)(H,{key:"authors",tokens:s||[],onChange:u,fetchSuggestions:n.fetchAuthorSuggestions,fetchSavedInfo:n.fetchSavedAuthors,label:Object(r.__)("Authors","newspack-blocks")}),!t&&b&&Object(i.createElement)(H,{key:"categories",tokens:p||[],onChange:b,fetchSuggestions:n.fetchCategorySuggestions,fetchSavedInfo:n.fetchSavedCategories,label:Object(r.__)("Categories","newspack-blocks")}),!t&&f&&Object(i.createElement)(H,{key:"tags",tokens:h||[],onChange:f,fetchSuggestions:n.fetchTagSuggestions,fetchSavedInfo:n.fetchSavedTags,label:Object(r.__)("Tags","newspack-blocks")}),!t&&d&&Object(i.createElement)("p",null,Object(i.createElement)(l.Button,{key:"toggle-advanced-filters",isLink:!0,onClick:function(){return n.setState({showAdvancedFilters:!w})}},w?Object(r.__)("Hide Advanced Filters","newspack-blocks"):Object(r.__)("Show Advanced Filters","newspack-blocks"))),!t&&d&&w&&Object(i.createElement)(H,{key:"tag-exclusion",tokens:g||[],onChange:d,fetchSuggestions:n.fetchTagSuggestions,fetchSavedInfo:n.fetchSavedTags,label:Object(r.__)("Excluded Tags","newspack-blocks")})]})),n}return v()(t,e),t}(i.Component);V.defaultProps={enableSpecific:!0,specificPosts:[],authors:[],categories:[],tags:[],tagExclusions:[]};var B=V,N=n(21),z=n.n(N),I=n(22),F=n.n(I),L=n(8),R=n(23),D=n(24),q=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H5V7h14v10z"})),Q=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M17 3H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7V5h10v14z"})),G=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H6V6h12v12z"})),U=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"})),W=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M4 4h7V2H4c-1.1 0-2 .9-2 2v7h2V4zm6 9l-4 5h12l-3-4-2.03 2.71L10 13zm7-4.5c0-.83-.67-1.5-1.5-1.5S14 7.67 14 8.5s.67 1.5 1.5 1.5S17 9.33 17 8.5zM20 2h-7v2h7v7h2V4c0-1.1-.9-2-2-2zm0 18h-7v2h7c1.1 0 2-.9 2-2v-7h-2v7zM4 13H2v7c0 1.1.9 2 2 2h7v-2H4v-7z"})),J=function(e){function t(){var e,n;h()(this,t);for(var o=arguments.length,c=new Array(o),a=0;a<o;a++)c[a]=arguments[a];return n=m()(this,(e=O()(t)).call.apply(e,[this].concat(c))),E()(j()(n),"renderPost",(function(e){var t=n.props.attributes,o=t.showImage,c=t.imageShape,a=t.mediaPosition,r=t.minHeight,s=t.showCaption,l=t.showExcerpt,u=t.showAuthor,p=t.showAvatar,b=t.showDate,h=t.showCategory,f=t.sectionHeader,g={minHeight:"behind"===a&&o&&e.newspack_featured_image_src&&r+"vh",paddingTop:"behind"===a&&o&&e.newspack_featured_image_src&&r/5+"vh"},d=(e.newspack_author_info.length,n.titleForPost(e));return Object(i.createElement)("article",{className:e.newspack_featured_image_src?"post-has-image":null,key:e.id,style:g},o&&e.newspack_featured_image_src&&Object(i.createElement)("figure",{className:"post-thumbnail",key:"thumbnail"},Object(i.createElement)("a",{href:"#"},"landscape"===c&&Object(i.createElement)("img",{src:e.newspack_featured_image_src.landscape}),"portrait"===c&&Object(i.createElement)("img",{src:e.newspack_featured_image_src.portrait}),"square"===c&&Object(i.createElement)("img",{src:e.newspack_featured_image_src.square}),"uncropped"===c&&Object(i.createElement)("img",{src:e.newspack_featured_image_src.uncropped})),s&&""!==e.newspack_featured_image_caption&&Object(i.createElement)("figcaption",null,e.newspack_featured_image_caption)),Object(i.createElement)("div",{className:"entry-wrapper"},h&&e.newspack_category_info.length&&Object(i.createElement)("div",{className:"cat-links"},Object(i.createElement)("a",{href:"#"},e.newspack_category_info)),L.RichText.isEmpty(f)?Object(i.createElement)("h2",{className:"entry-title",key:"title"},Object(i.createElement)("a",{href:"#"},d)):Object(i.createElement)("h3",{className:"entry-title",key:"title"},Object(i.createElement)("a",{href:"#"},d)),l&&Object(i.createElement)(i.RawHTML,{key:"excerpt",className:"excerpt-contain"},e.excerpt.rendered),Object(i.createElement)("div",{className:"entry-meta"},u&&p&&n.formatAvatars(e.newspack_author_info),u&&n.formatByline(e.newspack_author_info),b&&Object(i.createElement)("time",{className:"entry-date published",key:"pub-date"},F()(e.date_gmt).local().format("MMMM DD, Y")))))})),E()(j()(n),"titleForPost",(function(e){return e.title?"string"==typeof e.title?Object(T.decodeEntities)(e.title.trim()):"object"==typeof e.title&&e.title.rendered?Object(T.decodeEntities)(e.title.rendered.trim()):void 0:""})),E()(j()(n),"formatAvatars",(function(e){return e.map((function(e){return Object(i.createElement)("span",{className:"avatar author-avatar",key:e.id},Object(i.createElement)("a",{className:"url fn n",href:"#"},Object(i.createElement)(i.RawHTML,null,e.avatar)))}))})),E()(j()(n),"formatByline",(function(e){return Object(i.createElement)("span",{className:"byline"},Object(r.__)("by","newspack-blocks")," ",e.reduce((function(t,n,o){return[].concat(p()(t),[Object(i.createElement)("span",{className:"author vcard",key:n.id},Object(i.createElement)("a",{className:"url fn n",href:"#"},n.display_name)),o<e.length-2&&", ",e.length>1&&o===e.length-2&&Object(r.__)(" and ","newspack-blocks")])}),[]))})),E()(j()(n),"renderInspectorControls",(function(){var e=n.props,t=e.attributes,o=e.setAttributes,c=e.latestPosts,a=(e.isSelected,e.textColor),s=e.setTextColor,u=Array.isArray(c)&&c.length,p=t.authors,b=t.specificPosts,h=t.postsToShow,f=t.categories,g=(t.sectionHeader,t.columns),d=t.showImage,m=t.showCaption,w=t.imageScale,O=t.mobileStack,k=t.minHeight,j=t.moreButton,y=(t.moreButtonText,t.showExcerpt),v=t.typeScale,_=t.showDate,E=t.showAuthor,S=t.showAvatar,C=t.showCategory,x=t.postLayout,P=t.mediaPosition,A=t.specificMode,T=t.tags,M=t.tagExclusions,H=(t.url,[{value:1,label:Object(r.__)("Small","newspack-blocks"),shortName:Object(r.__)("S","newspack-blocks")},{value:2,label:Object(r.__)("Medium","newspack-blocks"),shortName:Object(r.__)("M","newspack-blocks")},{value:3,label:Object(r.__)("Large","newspack-blocks"),shortName:Object(r.__)("L","newspack-blocks")},{value:4,label:Object(r.__)("Extra Large","newspack-blocks"),shortName:Object(r.__)("XL","newspack-blocks")}]);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.PanelBody,{title:Object(r.__)("Display Settings","newspack-blocks"),initialOpen:!0},h&&Object(i.createElement)(B,{numberOfItems:h,onNumberOfItemsChange:function(e){return o({postsToShow:e})},specificMode:A,onSpecificModeChange:function(e){return o({specificMode:e})},specificPosts:b,onSpecificPostsChange:function(e){return o({specificPosts:e})},authors:p,onAuthorsChange:function(e){return o({authors:e})},categories:f,onCategoriesChange:function(e){return o({categories:e})},tags:T,onTagsChange:function(e){return o({tags:e})},tagExclusions:M,onTagExclusionsChange:function(e){return o({tagExclusions:e})}}),"grid"===x&&Object(i.createElement)(l.RangeControl,{label:Object(r.__)("Columns","newspack-blocks"),value:g,onChange:function(e){return o({columns:e})},min:2,max:u?Math.min(6,c.length):6,required:!0}),!A&&Object(i.createElement)(l.ToggleControl,{label:Object(r.__)('Show "More" Button',"newspack-blocks"),checked:j,onChange:function(){return o({moreButton:!j})},help:Object(r.__)("Only available for non-AMP requests.","newspack-blocks")})),Object(i.createElement)(l.PanelBody,{title:Object(r.__)("Featured Image Settings","newspack-blocks")},Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Featured Image","newspack-blocks"),checked:d,onChange:function(){return o({showImage:!d})}})),d&&Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Featured Image Caption","newspack-blocks"),checked:m,onChange:function(){return o({showCaption:!m})}})),d&&"top"!==P&&"behind"!==P&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Stack on mobile","newspack-blocks"),checked:O,onChange:function(){return o({mobileStack:!O})}})),Object(i.createElement)(l.BaseControl,{label:Object(r.__)("Featured Image Size","newspack-blocks")},Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ButtonGroup,{"aria-label":Object(r.__)("Featured Image Size","newspack-blocks")},H.map((function(e){var t=w===e.value;return Object(i.createElement)(l.Button,{isLarge:!0,isPrimary:t,"aria-pressed":t,"aria-label":e.label,key:e.value,onClick:function(){return o({imageScale:e.value})}},e.shortName)})))))),d&&"behind"===P&&Object(i.createElement)(l.RangeControl,{label:Object(r.__)("Minimum height","newspack-blocks"),help:Object(r.__)("Sets a minimum height for the block, using a percentage of the screen's current height.","newspack-blocks"),value:k,onChange:function(e){return o({minHeight:e})},min:0,max:100,required:!0})),Object(i.createElement)(l.PanelBody,{title:Object(r.__)("Post Control Settings","newspack-blocks")},Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Excerpt","newspack-blocks"),checked:y,onChange:function(){return o({showExcerpt:!y})}})),Object(i.createElement)(l.RangeControl,{className:"type-scale-slider",label:Object(r.__)("Type Scale","newspack-blocks"),value:v,onChange:function(e){return o({typeScale:e})},min:1,max:10,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",required:!0})),Object(i.createElement)(L.PanelColorSettings,{title:Object(r.__)("Color Settings","newspack-blocks"),initialOpen:!0,colorSettings:[{value:a.color,onChange:s,label:Object(r.__)("Text Color","newspack-blocks")}]}),Object(i.createElement)(l.PanelBody,{title:Object(r.__)("Post Meta Settings","newspack-blocks")},Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Date","newspack-blocks"),checked:_,onChange:function(){return o({showDate:!_})}})),Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Category","newspack-blocks"),checked:C,onChange:function(){return o({showCategory:!C})}})),Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Author","newspack-blocks"),checked:E,onChange:function(){return o({showAuthor:!E})}})),E&&Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Author Avatar","newspack-blocks"),checked:S,onChange:function(){return o({showAvatar:!S})}}))))})),n}return v()(t,e),g()(t,[{key:"render",value:function(){var e,t=this,n=this.props,o=n.attributes,c=n.className,a=n.setAttributes,s=n.isSelected,u=n.latestPosts,p=(n.hasPosts,n.textColor),b=(o.showExcerpt,o.showDate,o.showImage),h=o.imageShape,f=(o.showAuthor,o.showAvatar,o.postsToShow,o.postLayout),g=o.mediaPosition,d=o.moreButton,m=o.moreButtonText,w=o.columns,O=(o.categories,o.typeScale),k=o.imageScale,j=o.mobileStack,y=o.sectionHeader,v=o.showCaption,_=o.showCategory,S=o.specificMode,C=z()(c,(e={"is-grid":"grid"===f,"show-image":b},E()(e,"columns-".concat(w),"grid"===f),E()(e,"ts-".concat(O),"5"!==O),E()(e,"image-align".concat(g),b),E()(e,"is-".concat(k),"1"!==k&&b),E()(e,"mobile-stack",j),E()(e,"image-shape".concat(h),"landscape"!==h),E()(e,"has-text-color",""!==p.color),E()(e,"show-caption",v),E()(e,"show-category",_),E()(e,"wpnbha",!0),e)),x=[{icon:"list-view",title:Object(r.__)("List View","newspack-blocks"),onClick:function(){return a({postLayout:"list"})},isActive:"list"===f},{icon:"grid-view",title:Object(r.__)("Grid View","newspack-blocks"),onClick:function(){return a({postLayout:"grid"})},isActive:"grid"===f}],P=[{icon:"align-none",title:Object(r.__)("Show media on top","newspack-blocks"),isActive:"top"===g,onClick:function(){return a({mediaPosition:"top"})}},{icon:"align-pull-left",title:Object(r.__)("Show media on left","newspack-blocks"),isActive:"left"===g,onClick:function(){return a({mediaPosition:"left"})}},{icon:"align-pull-right",title:Object(r.__)("Show media on right","newspack-blocks"),isActive:"right"===g,onClick:function(){return a({mediaPosition:"right"})}},{icon:W,title:Object(r.__)("Show media behind","newspack-blocks"),isActive:"behind"===g,onClick:function(){return a({mediaPosition:"behind"})}}],A=[{icon:q,title:Object(r.__)("Landscape Image Shape","newspack-blocks"),isActive:"landscape"===h,onClick:function(){return a({imageShape:"landscape"})}},{icon:Q,title:Object(r.__)("portrait Image Shape","newspack-blocks"),isActive:"portrait"===h,onClick:function(){return a({imageShape:"portrait"})}},{icon:G,title:Object(r.__)("Square Image Shape","newspack-blocks"),isActive:"square"===h,onClick:function(){return a({imageShape:"square"})}},{icon:U,title:Object(r.__)("Uncropped","newspack-blocks"),isActive:"uncropped"===h,onClick:function(){return a({imageShape:"uncropped"})}}];return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:C,style:{color:p.color}},Object(i.createElement)("div",null,u&&(!L.RichText.isEmpty(y)||s)&&Object(i.createElement)(L.RichText,{onChange:function(e){return a({sectionHeader:e})},placeholder:Object(r.__)("Write header…","newspack-blocks"),value:y,tagName:"h2",className:"article-section-title"}),u&&!u.length&&Object(i.createElement)(l.Placeholder,null,Object(r.__)("Sorry, no posts were found.","newspack-blocks")),!u&&Object(i.createElement)(l.Placeholder,null,Object(i.createElement)(l.Spinner,null)),u&&u.map((function(e){return t.renderPost(e)})))),!S&&u&&d&&Object(i.createElement)("div",{className:"editor-styles-wrapper"},Object(i.createElement)("div",{className:"wp-block-button"},Object(i.createElement)(L.RichText,{placeholder:Object(r.__)("Load more posts","newspack-blocks"),value:m,onChange:function(e){return a({moreButtonText:e})},className:"wp-block-button__link",keepPlaceholderOnFocus:!0,allowedFormats:[]}))),Object(i.createElement)(L.BlockControls,null,Object(i.createElement)(l.Toolbar,{controls:x}),b&&Object(i.createElement)(l.Toolbar,{controls:P}),b&&Object(i.createElement)(l.Toolbar,{controls:A})),Object(i.createElement)(L.InspectorControls,null,this.renderInspectorControls()))}}]),t}(i.Component),X=Object(D.compose)([Object(L.withColors)({textColor:"color"}),Object(R.withSelect)((function(e,t){var n=t.attributes,o=n.postsToShow,c=n.authors,a=n.categories,r=n.tags,s=n.tagExclusions,i=n.specificPosts,l=n.specificMode,u=e("core");u.getAuthors;return{latestPosts:(0,u.getEntityRecords)("postType","post",Object(M.pickBy)(l&&i&&i.length?{include:i,orderby:"include"}:{per_page:o,categories:a,author:c,tags:r,tags_exclude:s},(function(e){return!Object(M.isUndefined)(e)})))}}))])(J),Y=(n(31),n(32),n(18)),K=(Y.name,Y.attributes),Z=Y.category,$={title:Object(r.__)("Homepage Posts","newspack-blocks"),icon:Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM10 9h8v2h-8zm0 3h4v2h-4zm0-6h8v2h-8z"})),attributes:K,category:Z,keywords:[Object(r.__)("posts","newspack-blocks"),Object(r.__)("articles","newspack-blocks"),Object(r.__)("latest","newspack-blocks")],description:Object(r.__)("A block for displaying homepage posts.","newspack-blocks"),styles:[{name:"default",label:Object(r._x)("Default","block style","newspack-blocks"),isDefault:!0},{name:"borders",label:Object(r._x)("Borders","block style","newspack-blocks")}],supports:{html:!1,align:["wide","full"],default:""},edit:X,save:function(){return null},transforms:{from:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.displayPostContent,n=e.displayPostDate,o=e.postLayout,c=e.columns,r=e.postsToShow,i=e.categories;return Object(a.createBlock)(Object(s.applyFilters)("blocks.transforms_from_name","newspack-blocks/homepage-articles"),{showExcerpt:t,showDate:n,postLayout:o,columns:c,postsToShow:r,showAuthor:!1,categories:i?[i]:[]})}}],to:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.showExcerpt,n=e.showDate,o=e.postLayout,c=e.columns,r=e.postsToShow,s=e.categories;return Object(a.createBlock)("core/latest-posts",{displayPostContent:t,displayPostDate:n,postLayout:o,columns:c,postsToShow:r,categories:s[0]||""})}}]}};Object(s.addFilter)("blocks.transforms_from_name","set-transformed-block-name",(function(e){return"newspack-blocks/homepage-articles"!==e?e:"a8c/blog-posts"})),Object(a.registerBlockType)("a8c/blog-posts",c()({},$,{title:Object(r.__)("Blog Posts","full-site-editing"),category:"layout",supports:c()({},$.supports,{multiple:!1})}))}]));
1
+ !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(o){if(t[o])return t[o].exports;var c=t[o]={i:o,l:!1,exports:{}};return e[o].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(o,c,function(t){return e[t]}.bind(null,c));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=33)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){var o=n(3);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var o=n(28),c=n(4);e.exports=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?c(e):t}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var o=n(29);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}},function(e){e.exports=JSON.parse('{"name":"homepage-articles","category":"newspack","attributes":{"className":{"type":"string","default":""},"showExcerpt":{"type":"boolean","default":true},"showDate":{"type":"boolean","default":true},"showImage":{"type":"boolean","default":true},"showCaption":{"type":"boolean","default":false},"imageShape":{"type":"string","default":"landscape"},"minHeight":{"type":"integer","default":0},"moreButton":{"type":"boolean","default":false},"moreButtonText":{"type":"string","default":""},"showAuthor":{"type":"boolean","default":true},"showAvatar":{"type":"boolean","default":true},"showCategory":{"type":"boolean","default":false},"postLayout":{"type":"string","default":"list"},"columns":{"type":"integer","default":3},"postsToShow":{"type":"integer","default":3},"mediaPosition":{"type":"string","default":"top"},"authors":{"type":"array","default":[],"items":{"type":"integer"}},"categories":{"type":"array","default":[],"items":{"type":"integer"}},"tags":{"type":"array","default":[],"items":{"type":"integer"}},"tagExclusions":{"type":"array","default":[],"items":{"type":"integer"}},"specificPosts":{"type":"array","default":[],"items":{"type":"integer"}},"typeScale":{"type":"integer","default":4},"imageScale":{"type":"integer","default":3},"mobileStack":{"type":"boolean","default":false},"sectionHeader":{"type":"string","default":""},"specificMode":{"type":"boolean","default":false},"textColor":{"type":"string","default":""},"customTextColor":{"type":"string","default":""},"singleMode":{"type":"boolean","default":false},"showSubtitle":{"type":"boolean","default":false}}}')},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){var o=n(25),c=n(26),a=n(27);e.exports=function(e){return o(e)||c(e)||a()}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,t,o){return t&&n(e.prototype,t),o&&n(e,o),e}},function(e,t){!function(){e.exports=this.wp.date}()},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){var o;
2
+ /*!
3
+ Copyright (c) 2017 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)&&o.length){var r=c.apply(null,o);r&&e.push(r)}else if("object"===a)for(var s in o)n.call(o,s)&&o[s]&&e.push(s)}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){function n(t,o){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,o)}e.exports=n},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var o=n(6),c=n.n(o),a=n(17),r=n(1),s=n(18),i=n(0),l=n(2),u=n(19),p=n.n(u),b=n(12),f=n.n(b),h=n(20),d=n.n(h),g=n(13),m=n.n(g),k=n(14),w=n.n(k),O=n(4),j=n.n(O),y=n(15),_=n.n(y),v=n(3),S=n.n(v),E=n(22),C=n.n(E),P=n(7),x=n.n(P),A=n(8),T=n(5),B=n(11),I=(n(30),function(e){function t(e){var n;return f()(this,t),n=m()(this,w()(t).call(this,e)),S()(j()(n),"isFetchingInfoOnLoad",(function(){var e=n.props,t=e.tokens,o=e.fetchSavedInfo;return Boolean(t.length&&o)})),n.state={suggestions:[],validValues:{},loading:n.isFetchingInfoOnLoad()},n.debouncedUpdateSuggestions=Object(B.debounce)(n.updateSuggestions,500),n}return _()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e=this;if(this.isFetchingInfoOnLoad()){var t=this.props,n=t.tokens;(0,t.fetchSavedInfo)(n).then((function(t){var n=e.state.validValues;t.forEach((function(e){n[e.value]=e.label})),e.setState({validValues:n,loading:!1})}))}}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest,this.debouncedUpdateSuggestions.cancel()}},{key:"getLabelsForValues",value:function(e){var t=this.state.validValues;return e.reduce((function(e,n){return t[n]?[].concat(p()(e),[t[n]]):e}),[])}},{key:"getValuesForLabels",value:function(e){var t=this.state.validValues;return e.map((function(e){return Object.keys(t).find((function(n){return t[n]===e}))}))}},{key:"updateSuggestions",value:function(e){var t=this,n=this.props.fetchSuggestions;n&&this.setState({loading:!0},(function(){var o=n(e);o.then((function(e){if(t.suggestionsRequest===o){var n=t.state.validValues,c=[];e.forEach((function(e){c.push(e.label),n[e.value]=e.label})),t.setState({suggestions:c,validValues:n,loading:!1})}})).catch((function(){t.suggestionsRequest===o&&t.setState({loading:!1})})),t.suggestionsRequest=o}))}},{key:"handleOnChange",value:function(e){(0,this.props.onChange)(this.getValuesForLabels(e))}},{key:"getTokens",value:function(){var e=this.props.tokens;return this.getLabelsForValues(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.help,o=t.label,c=void 0===o?"":o,a=this.state,r=a.suggestions,s=a.loading;return Object(i.createElement)("div",{className:"autocomplete-tokenfield"},Object(i.createElement)(l.FormTokenField,{value:this.getTokens(),suggestions:r,onChange:function(t){return e.handleOnChange(t)},onInputChange:function(t){return e.debouncedUpdateSuggestions(t)},label:c}),s&&Object(i.createElement)(l.Spinner,null),n&&Object(i.createElement)("p",{className:"autocomplete-tokenfield__help"},n))}}]),t}(i.Component)),M=function(e){function t(){var e,n;f()(this,t);for(var o=arguments.length,c=new Array(o),a=0;a<o;a++)c[a]=arguments[a];return n=m()(this,(e=w()(t)).call.apply(e,[this].concat(c))),S()(j()(n),"state",{showAdvancedFilters:!1}),S()(j()(n),"fetchPostSuggestions",(function(e){return x()({path:Object(A.addQueryArgs)("/wp/v2/search",{search:e,per_page:20,_fields:"id,title",type:"post"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.title)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),S()(j()(n),"fetchSavedPosts",(function(e){return x()({path:Object(A.addQueryArgs)("/wp/v2/posts",{per_page:100,include:e.join(","),_fields:"id,title"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.title.rendered)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),S()(j()(n),"fetchAuthorSuggestions",(function(e){return x()({path:Object(A.addQueryArgs)("/wp/v2/users",{search:e,per_page:20,_fields:"id,name"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no name)","newspack-blocks")}}))}))})),S()(j()(n),"fetchSavedAuthors",(function(e){return x()({path:Object(A.addQueryArgs)("/wp/v2/users",{per_page:100,include:e.join(","),_fields:"id,name"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no name)","newspack-blocks")}}))}))})),S()(j()(n),"fetchCategorySuggestions",(function(e){return x()({path:Object(A.addQueryArgs)("/wp/v2/categories",{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),S()(j()(n),"fetchSavedCategories",(function(e){return x()({path:Object(A.addQueryArgs)("/wp/v2/categories",{per_page:100,_fields:"id,name",include:e.join(",")})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),S()(j()(n),"fetchTagSuggestions",(function(e){return x()({path:Object(A.addQueryArgs)("/wp/v2/tags",{search:e,per_page:20,_fields:"id,name",orderby:"count",order:"desc"})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),S()(j()(n),"fetchSavedTags",(function(e){return x()({path:Object(A.addQueryArgs)("/wp/v2/tags",{per_page:100,_fields:"id,name",include:e.join(",")})}).then((function(e){return e.map((function(e){return{value:e.id,label:Object(T.decodeEntities)(e.name)||Object(r.__)("(no title)","newspack-blocks")}}))}))})),S()(j()(n),"render",(function(){var e=n.props,t=e.specificMode,o=e.onSpecificModeChange,c=e.specificPosts,a=e.onSpecificPostsChange,s=e.authors,u=e.onAuthorsChange,p=e.categories,b=e.onCategoriesChange,f=e.tags,h=e.onTagsChange,d=e.tagExclusions,g=e.onTagExclusionsChange,m=e.enableSpecific,k=n.state.showAdvancedFilters;return[m&&Object(i.createElement)(l.ToggleControl,{key:"specificMode",checked:t,onChange:o,label:Object(r.__)("Choose Specific Posts","newspack-blocks")}),t&&Object(i.createElement)(I,{key:"posts",tokens:c||[],onChange:a,fetchSuggestions:n.fetchPostSuggestions,fetchSavedInfo:n.fetchSavedPosts,label:Object(r.__)("Posts","newspack-blocks"),help:Object(r.__)("Begin typing post title, click autocomplete result to select.","newspack-blocks")}),!t&&Object(i.createElement)(l.QueryControls,C()({key:"queryControls"},n.props)),!t&&u&&Object(i.createElement)(I,{key:"authors",tokens:s||[],onChange:u,fetchSuggestions:n.fetchAuthorSuggestions,fetchSavedInfo:n.fetchSavedAuthors,label:Object(r.__)("Authors","newspack-blocks")}),!t&&b&&Object(i.createElement)(I,{key:"categories",tokens:p||[],onChange:b,fetchSuggestions:n.fetchCategorySuggestions,fetchSavedInfo:n.fetchSavedCategories,label:Object(r.__)("Categories","newspack-blocks")}),!t&&h&&Object(i.createElement)(I,{key:"tags",tokens:f||[],onChange:h,fetchSuggestions:n.fetchTagSuggestions,fetchSavedInfo:n.fetchSavedTags,label:Object(r.__)("Tags","newspack-blocks")}),!t&&g&&Object(i.createElement)("p",{key:"toggle-advanced-filters"},Object(i.createElement)(l.Button,{isLink:!0,onClick:function(){return n.setState({showAdvancedFilters:!k})}},k?Object(r.__)("Hide Advanced Filters","newspack-blocks"):Object(r.__)("Show Advanced Filters","newspack-blocks"))),!t&&g&&k&&Object(i.createElement)(I,{key:"tag-exclusion",tokens:d||[],onChange:g,fetchSuggestions:n.fetchTagSuggestions,fetchSavedInfo:n.fetchSavedTags,label:Object(r.__)("Excluded Tags","newspack-blocks")})]})),n}return _()(t,e),t}(i.Component);M.defaultProps={enableSpecific:!0,specificPosts:[],authors:[],categories:[],tags:[],tagExclusions:[]};var H,D=M,L=n(10),N=n(16),V=N.name,z=V,F="newspack-blocks/".concat(V),R={queryBlocks:[],postsByBlock:{},specificPostsByBlock:{}},q={updateBlocks:function(e){return{type:"UPDATE_BLOCKS",blocks:e}},markPostsAsDisplayed:function(e,t){return{type:"MARK_POSTS_DISPLAYED",clientId:e,posts:t}},markSpecificPostsAsDisplayed:function(e,t){return{type:"MARK_SPECIFIC_POSTS_DISPLAYED",clientId:e,posts:t}}},G={previousPostIds:function(e,t){var n,o,c,a=e.queryBlocks,r=e.specificPostsByBlock,s=e.postsByBlock,i=a.filter((function(e){var t=e.clientId;return r[t]})).flatMap((function(e){var t=e.clientId;return r[t].map((function(e){return e.id}))})),l=(n=a,o=t,c=n.findIndex((function(e){return e.clientId===o})),n.slice(0,c)).filter((function(e){var t=e.clientId;return s[t]})).flatMap((function(e){var t=e.clientId;return s[t].map((function(e){return e.id}))}));return Object(B.uniq)(i.concat(l)).sort()}},Q=function e(t){return t.flatMap((function(t){var n=[];return t.name===F&&n.push(t),n.concat(e(t.innerBlocks))}))},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BLOCKS":return c()({},e,{queryBlocks:Q(t.blocks)});case"MARK_POSTS_DISPLAYED":return c()({},e,{postsByBlock:c()({},e.postsByBlock,S()({},t.clientId,t.posts))});case"MARK_SPECIFIC_POSTS_DISPLAYED":return c()({},e,{specificPostsByBlock:c()({},e.specificPostsByBlock,S()({},t.clientId,t.posts))})}return e},K=function(){return"object"==typeof window&&window.wpcomGutenberg&&-1===Number(window.wpcomGutenberg.blogPublic)},Y=function(e){var t=e.specificMode,n=e.specificPosts;return t&&n&&n.length},W=n(23),J=n.n(W),X=n(21),Z=n(9),$=n(24);"object"==typeof window&&window.newspackIsPostSubtitleSupported&&window.newspackIsPostSubtitleSupported.post_subtitle&&(H=!0);var ee=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 12H5V7h14v10z"})),te=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M17 3H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7V5h10v14z"})),ne=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H6V6h12v12z"})),oe=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"})),ce=Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M4 4h7V2H4c-1.1 0-2 .9-2 2v7h2V4zm6 9l-4 5h12l-3-4-2.03 2.71L10 13zm7-4.5c0-.83-.67-1.5-1.5-1.5S14 7.67 14 8.5s.67 1.5 1.5 1.5S17 9.33 17 8.5zM20 2h-7v2h7v7h2V4c0-1.1-.9-2-2-2zm0 18h-7v2h7c1.1 0 2-.9 2-2v-7h-2v7zM4 13H2v7c0 1.1.9 2 2 2h7v-2H4v-7z"})),ae=function(e){function t(){var e,n;f()(this,t);for(var o=arguments.length,c=new Array(o),a=0;a<o;a++)c[a]=arguments[a];return n=m()(this,(e=w()(t)).call.apply(e,[this].concat(c))),S()(j()(n),"renderPost",(function(e){var t=n.props.attributes,o=t.showImage,c=t.imageShape,a=t.mediaPosition,r=t.minHeight,s=t.showCaption,l=t.showExcerpt,u=t.showSubtitle,p=t.showAuthor,b=t.showAvatar,f=t.showDate,h=t.showCategory,d=t.sectionHeader,g={minHeight:"behind"===a&&o&&e.newspack_featured_image_src&&r+"vh",paddingTop:"behind"===a&&o&&e.newspack_featured_image_src&&r/5+"vh"},m=n.titleForPost(e),k=Object(X.__experimentalGetSettings)().formats.date;return Object(i.createElement)("article",{className:e.newspack_featured_image_src?"post-has-image":null,key:e.id,style:g},o&&e.newspack_featured_image_src&&Object(i.createElement)("figure",{className:"post-thumbnail",key:"thumbnail"},Object(i.createElement)("a",{href:"#"},"landscape"===c&&Object(i.createElement)("img",{src:e.newspack_featured_image_src.landscape,alt:""}),"portrait"===c&&Object(i.createElement)("img",{src:e.newspack_featured_image_src.portrait,alt:""}),"square"===c&&Object(i.createElement)("img",{src:e.newspack_featured_image_src.square,alt:""}),"uncropped"===c&&Object(i.createElement)("img",{src:e.newspack_featured_image_src.uncropped,alt:""})),s&&""!==e.newspack_featured_image_caption&&Object(i.createElement)("figcaption",null,e.newspack_featured_image_caption)),Object(i.createElement)("div",{className:"entry-wrapper"},h&&e.newspack_category_info.length&&Object(i.createElement)("div",{className:"cat-links"},Object(i.createElement)("a",{href:"#"},e.newspack_category_info)),Z.RichText.isEmpty(d)?Object(i.createElement)("h2",{className:"entry-title",key:"title"},Object(i.createElement)("a",{href:"#"},m)):Object(i.createElement)("h3",{className:"entry-title",key:"title"},Object(i.createElement)("a",{href:"#"},m)),H&&u&&Object(i.createElement)(i.RawHTML,{key:"subtitle",className:"newspack-post-subtitle newspack-post-subtitle--in-homepage-block"},e.meta.newspack_post_subtitle||""),l&&Object(i.createElement)(i.RawHTML,{key:"excerpt",className:"excerpt-contain"},e.excerpt.rendered),Object(i.createElement)("div",{className:"entry-meta"},p&&b&&n.formatAvatars(e.newspack_author_info),p&&n.formatByline(e.newspack_author_info),f&&Object(i.createElement)("time",{className:"entry-date published",key:"pub-date"},Object(X.dateI18n)(k,e.date_gmt)))))})),S()(j()(n),"titleForPost",(function(e){return e.title?"string"==typeof e.title?Object(T.decodeEntities)(e.title.trim()):"object"==typeof e.title&&e.title.rendered?Object(T.decodeEntities)(e.title.rendered.trim()):void 0:""})),S()(j()(n),"formatAvatars",(function(e){return e.map((function(e){return Object(i.createElement)("span",{className:"avatar author-avatar",key:e.id},Object(i.createElement)("a",{className:"url fn n",href:"#"},Object(i.createElement)(i.RawHTML,null,e.avatar)))}))})),S()(j()(n),"formatByline",(function(e){return Object(i.createElement)("span",{className:"byline"},Object(r._x)("by","post author","newspack-blocks")," ",e.reduce((function(t,n,o){return[].concat(p()(t),[Object(i.createElement)("span",{className:"author vcard",key:n.id},Object(i.createElement)("a",{className:"url fn n",href:"#"},n.display_name)),o<e.length-2&&", ",e.length>1&&o===e.length-2&&Object(r._x)(" and ","post author","newspack-blocks")])}),[]))})),S()(j()(n),"renderInspectorControls",(function(){var e=n.props,t=e.attributes,o=e.setAttributes,c=e.textColor,a=e.setTextColor,s=t.authors,u=t.specificPosts,p=t.postsToShow,b=t.categories,f=t.columns,h=t.showImage,d=t.showCaption,g=t.imageScale,m=t.mobileStack,k=t.minHeight,w=t.moreButton,O=t.showExcerpt,j=t.showSubtitle,y=t.typeScale,_=t.showDate,v=t.showAuthor,S=t.showAvatar,E=t.showCategory,C=t.postLayout,P=t.mediaPosition,x=t.specificMode,A=t.tags,T=t.tagExclusions,B=[{value:1,label:Object(r.__)("Small","newspack-blocks"),shortName:Object(r.__)("S","newspack-blocks")},{value:2,label:Object(r.__)("Medium","newspack-blocks"),shortName:Object(r.__)("M","newspack-blocks")},{value:3,label:Object(r.__)("Large","newspack-blocks"),shortName:Object(r.__)("L","newspack-blocks")},{value:4,label:Object(r.__)("Extra Large","newspack-blocks"),shortName:Object(r.__)("XL","newspack-blocks")}];return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.PanelBody,{title:Object(r.__)("Display Settings","newspack-blocks"),initialOpen:!0},p&&Object(i.createElement)(D,{numberOfItems:p,onNumberOfItemsChange:function(e){return o({postsToShow:e})},specificMode:x,onSpecificModeChange:function(e){return o({specificMode:e})},specificPosts:u,onSpecificPostsChange:function(e){return o({specificPosts:e})},authors:s,onAuthorsChange:function(e){return o({authors:e})},categories:b,onCategoriesChange:function(e){return o({categories:e})},tags:A,onTagsChange:function(e){o({tags:e})},tagExclusions:T,onTagExclusionsChange:function(e){return o({tagExclusions:e})}}),"grid"===C&&Object(i.createElement)(l.RangeControl,{label:Object(r.__)("Columns","newspack-blocks"),value:f,onChange:function(e){return o({columns:e})},min:2,max:6,required:!0}),!x&&!K()&&Object(i.createElement)(l.ToggleControl,{label:Object(r.__)('Show "More" Button',"newspack-blocks"),checked:w,onChange:function(){return o({moreButton:!w})}})),Object(i.createElement)(l.PanelBody,{title:Object(r.__)("Featured Image Settings","newspack-blocks")},Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Featured Image","newspack-blocks"),checked:h,onChange:function(){return o({showImage:!h})}})),h&&Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Featured Image Caption","newspack-blocks"),checked:d,onChange:function(){return o({showCaption:!d})}})),h&&"top"!==P&&"behind"!==P&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Stack on mobile","newspack-blocks"),checked:m,onChange:function(){return o({mobileStack:!m})}})),Object(i.createElement)(l.BaseControl,{label:Object(r.__)("Featured Image Size","newspack-blocks"),id:"newspackfeatured-image-size"},Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ButtonGroup,{id:"newspackfeatured-image-size","aria-label":Object(r.__)("Featured Image Size","newspack-blocks")},B.map((function(e){var t=g===e.value;return Object(i.createElement)(l.Button,{isLarge:!0,isPrimary:t,"aria-pressed":t,"aria-label":e.label,key:e.value,onClick:function(){return o({imageScale:e.value})}},e.shortName)})))))),h&&"behind"===P&&Object(i.createElement)(l.RangeControl,{label:Object(r.__)("Minimum height","newspack-blocks"),help:Object(r.__)("Sets a minimum height for the block, using a percentage of the screen's current height.","newspack-blocks"),value:k,onChange:function(e){return o({minHeight:e})},min:0,max:100,required:!0})),Object(i.createElement)(l.PanelBody,{title:Object(r.__)("Post Control Settings","newspack-blocks")},H&&Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Subtitle","newspack-blocks"),checked:j,onChange:function(){return o({showSubtitle:!j})}})),Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Excerpt","newspack-blocks"),checked:O,onChange:function(){return o({showExcerpt:!O})}})),Object(i.createElement)(l.RangeControl,{className:"type-scale-slider",label:Object(r.__)("Type Scale","newspack-blocks"),value:y,onChange:function(e){return o({typeScale:e})},min:1,max:10,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",required:!0})),Object(i.createElement)(Z.PanelColorSettings,{title:Object(r.__)("Color Settings","newspack-blocks"),initialOpen:!0,colorSettings:[{value:c.color,onChange:a,label:Object(r.__)("Text Color","newspack-blocks")}]}),Object(i.createElement)(l.PanelBody,{title:Object(r.__)("Post Meta Settings","newspack-blocks")},Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Date","newspack-blocks"),checked:_,onChange:function(){return o({showDate:!_})}})),Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Category","newspack-blocks"),checked:E,onChange:function(){return o({showCategory:!E})}})),Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Author","newspack-blocks"),checked:v,onChange:function(){return o({showAuthor:!v})}})),v&&Object(i.createElement)(l.PanelRow,null,Object(i.createElement)(l.ToggleControl,{label:Object(r.__)("Show Author Avatar","newspack-blocks"),checked:S,onChange:function(){return o({showAvatar:!S})}}))))})),n}return _()(t,e),d()(t,[{key:"render",value:function(){var e,t=this,n=this.props,o=n.attributes,c=n.className,a=n.clientId,s=n.setAttributes,u=n.isSelected,p=n.latestPosts,b=n.textColor,f=n.markPostsAsDisplayed,h=o.showImage,d=o.imageShape,g=o.postLayout,m=o.mediaPosition,k=o.moreButton,w=o.moreButtonText,O=o.columns,j=o.typeScale,y=o.imageScale,_=o.mobileStack,v=o.sectionHeader,E=o.showCaption,C=o.showCategory,P=o.specificMode,x=J()(c,(e={"is-grid":"grid"===g,"show-image":h},S()(e,"columns-".concat(O),"grid"===g),S()(e,"ts-".concat(j),"5"!==j),S()(e,"image-align".concat(m),h),S()(e,"is-".concat(y),"1"!==y&&h),S()(e,"mobile-stack",_),S()(e,"image-shape".concat(d),"landscape"!==d),S()(e,"has-text-color",""!==b.color),S()(e,"show-caption",E),S()(e,"show-category",C),S()(e,"wpnbha",!0),e)),A=[{icon:"list-view",title:Object(r.__)("List View","newspack-blocks"),onClick:function(){return s({postLayout:"list"})},isActive:"list"===g},{icon:"grid-view",title:Object(r.__)("Grid View","newspack-blocks"),onClick:function(){return s({postLayout:"grid"})},isActive:"grid"===g}],T=[{icon:"align-none",title:Object(r.__)("Show media on top","newspack-blocks"),isActive:"top"===m,onClick:function(){return s({mediaPosition:"top"})}},{icon:"align-pull-left",title:Object(r.__)("Show media on left","newspack-blocks"),isActive:"left"===m,onClick:function(){return s({mediaPosition:"left"})}},{icon:"align-pull-right",title:Object(r.__)("Show media on right","newspack-blocks"),isActive:"right"===m,onClick:function(){return s({mediaPosition:"right"})}},{icon:ce,title:Object(r.__)("Show media behind","newspack-blocks"),isActive:"behind"===m,onClick:function(){return s({mediaPosition:"behind"})}}],B=[{icon:ee,title:Object(r.__)("Landscape Image Shape","newspack-blocks"),isActive:"landscape"===d,onClick:function(){return s({imageShape:"landscape"})}},{icon:te,title:Object(r.__)("portrait Image Shape","newspack-blocks"),isActive:"portrait"===d,onClick:function(){return s({imageShape:"portrait"})}},{icon:ne,title:Object(r.__)("Square Image Shape","newspack-blocks"),isActive:"square"===d,onClick:function(){return s({imageShape:"square"})}},{icon:oe,title:Object(r.__)("Uncropped","newspack-blocks"),isActive:"uncropped"===d,onClick:function(){return s({imageShape:"uncropped"})}}];return f(a,p),Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:x,style:{color:b.color}},Object(i.createElement)("div",null,p&&(!Z.RichText.isEmpty(v)||u)&&Object(i.createElement)(Z.RichText,{onChange:function(e){return s({sectionHeader:e})},placeholder:Object(r.__)("Write header…","newspack-blocks"),value:v,tagName:"h2",className:"article-section-title"}),p&&!p.length&&Object(i.createElement)(l.Placeholder,null,Object(r.__)("Sorry, no posts were found.","newspack-blocks")),!p&&Object(i.createElement)(l.Placeholder,{icon:Object(i.createElement)(l.Spinner,null),className:"component-placeholder__align-center"}),p&&p.map((function(e){return t.renderPost(e)})))),!P&&p&&k&&!K()&&Object(i.createElement)("div",{className:"editor-styles-wrapper wpnbha__wp-block-button__wrapper"},Object(i.createElement)("div",{className:"wp-block-button"},Object(i.createElement)(Z.RichText,{placeholder:Object(r.__)("Load more posts","newspack-blocks"),value:w,onChange:function(e){return s({moreButtonText:e})},className:"wp-block-button__link",keepPlaceholderOnFocus:!0,allowedFormats:[]}))),Object(i.createElement)(Z.BlockControls,null,Object(i.createElement)(l.Toolbar,{controls:A}),h&&Object(i.createElement)(l.Toolbar,{controls:T}),h&&Object(i.createElement)(l.Toolbar,{controls:B})),Object(i.createElement)(Z.InspectorControls,null,this.renderInspectorControls()))}}]),t}(i.Component),re=Object($.compose)([Object(Z.withColors)({textColor:"color"}),Object(L.withSelect)((function(e,t){var n=t.attributes,o=t.clientId,c=function(e){var t=e.postsToShow,n=e.authors,o=e.categories,c=e.tags,a=e.specificPosts,r=e.tagExclusions;return Object(B.pickBy)(Y(e)?{include:a,orderby:"include",per_page:a.length}:{per_page:t,categories:o,author:n,tags:c,tags_exclude:r},(function(e){return!Object(B.isUndefined)(e)}))}(n);if(!Y(n)){var a=e(z).previousPostIds(o);c.exclude=a.join(",")}return{latestPosts:e("core").getEntityRecords("postType","post",c)}})),Object(L.withDispatch)((function(e,t){var n=t.attributes;return{markPostsAsDisplayed:Y(n)?e(z).markSpecificPostsAsDisplayed:e(z).markPostsAsDisplayed}}))])(ae),se=(n(31),n(32),N.name,N.attributes),ie=N.category,le={title:Object(r.__)("Homepage Posts","newspack-blocks"),icon:Object(i.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(i.createElement)(l.Path,{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM10 9h8v2h-8zm0 3h4v2h-4zm0-6h8v2h-8z"})),attributes:se,category:ie,keywords:[Object(r.__)("posts","newspack-blocks"),Object(r.__)("articles","newspack-blocks"),Object(r.__)("latest","newspack-blocks")],description:Object(r.__)("A block for displaying homepage posts.","newspack-blocks"),styles:[{name:"default",label:Object(r._x)("Default","block style","newspack-blocks"),isDefault:!0},{name:"borders",label:Object(r._x)("Borders","block style","newspack-blocks")}],supports:{html:!1,align:["wide","full"],default:""},edit:re,save:function(){return null},transforms:{from:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.displayPostContent,n=e.displayPostDate,o=e.postLayout,c=e.columns,r=e.postsToShow,i=e.categories;return Object(a.createBlock)(Object(s.applyFilters)("blocks.transforms_from_name","newspack-blocks/homepage-articles"),{showExcerpt:t,showDate:n,postLayout:o,columns:c,postsToShow:r,showAuthor:!1,categories:i?[i]:[]})}}],to:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.showExcerpt,n=e.showDate,o=e.postLayout,c=e.columns,r=e.postsToShow,s=e.categories;return Object(a.createBlock)("core/latest-posts",{displayPostContent:t,displayPostDate:n,postLayout:o,columns:c,postsToShow:r,categories:s[0]||""})}}]}},ue="a8c/blog-posts";Object(s.addFilter)("blocks.transforms_from_name","set-transformed-block-name",(function(e){return"newspack-blocks/homepage-articles"!==e?e:ue})),Object(a.registerBlockType)(ue,c()({},le,{title:Object(r.__)("Blog Posts","full-site-editing"),category:"layout",supports:c()({},le.supports,{multiple:!1})})),function(){Object(L.registerStore)(z,{reducer:U,actions:q,selectors:G,initialState:R});var e,t=Object(L.select)("core/block-editor"),n=t.getClientIdsWithDescendants,o=t.getBlocks,c=Object(L.dispatch)(z).updateBlocks;Object(L.subscribe)((function(){var t=n(),a=t!==e;e=t,a&&c(o())}))}()}]));
blog-posts-block/dist/editor.js.LICENSE DELETED
@@ -1,5 +0,0 @@
1
- /*!
2
- Copyright (c) 2017 Jed Watson.
3
- Licensed under the MIT License (MIT), see
4
- http://jedwatson.github.io/classnames
5
- */
blog-posts-block/dist/editor.rtl.css CHANGED
@@ -1 +1 @@
1
- .autocomplete-tokenfield{position:relative}.autocomplete-tokenfield .components-spinner{position:absolute;top:2em;left:0}.type-scale-slider .dashicon{height:16px;width:16px}.type-scale-slider input+.dashicon{height:24px;margin-right:10px;margin-left:0;width:24px}.wpnbha .editor-rich-text{width:100%}.wpnbha .cat-links{font-size:.7em}.wpnbha span.avatar{display:inline-block;margin-left:.5em}.wpnbha span.avatar div{display:inline}.wpnbha .excerpt-contain p{margin:.5em 0}.wpnbha{margin-bottom:1em}.wpnbha article{margin-bottom:1.5em;word-break:break-word;overflow-wrap:break-word;position:relative}.wpnbha article:last-of-type{margin-bottom:0}.wpnbha .article-section-title{font-size:.8em;margin-bottom:.5em;width:100%}.wpnbha.is-grid>div{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0;list-style:none}.wpnbha.is-grid article{flex-basis:100%}@media only screen and (min-width:782px){.wpnbha.is-grid article,.wpnbha.is-grid article:last-child{margin-bottom:1em}}@media only screen and (min-width:600px){.wpnbha.columns-3 article,.wpnbha.columns-6 article{flex-basis:calc(33.333% - 16px)}.wpnbha.columns-2 article,.wpnbha.columns-4 article,.wpnbha.columns-5 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-5 article:last-of-type:nth-child(odd){flex-grow:1}}@media only screen and (min-width:782px){.wpnbha.columns-2 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-3 article{flex-basis:calc(33.33333% - 16px)}.wpnbha.columns-4 article{flex-basis:calc(25% - 16px)}.wpnbha.columns-5 article{flex-basis:calc(20% - 16px)}.wpnbha.columns-6 article{flex-basis:calc(16.66667% - 16px)}}.wpnbha .post-thumbnail{margin:0}.wpnbha .post-thumbnail img{height:auto;width:100%}.wpnbha figcaption{font-size:.6em}.wpnbha .post-thumbnail{margin-bottom:.25em}.wpnbha .post-thumbnail figcaption{margin-bottom:.5em}.wpnbha.image-alignleft .post-has-image,.wpnbha.image-alignright .post-has-image{display:flex}.wpnbha.image-alignleft .post-has-image .post-thumbnail,.wpnbha.image-alignright .post-has-image .post-thumbnail{flex-basis:33%}.wpnbha.image-alignleft .post-has-image .entry-wrapper,.wpnbha.image-alignright .post-has-image .entry-wrapper{flex-basis:67%}.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:block}@media only screen and (min-width:600px){.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:flex}}@media only screen and (min-width:600px){.wpnbha.image-alignleft.is-4 .post-thumbnail,.wpnbha.image-alignright.is-4 .post-thumbnail{flex-basis:75%}.wpnbha.image-alignleft.is-4 .entry-wrapper,.wpnbha.image-alignright.is-4 .entry-wrapper{flex-basis:25%}.wpnbha.image-alignleft.is-3 .entry-wrapper,.wpnbha.image-alignleft.is-3 .post-thumbnail,.wpnbha.image-alignright.is-3 .entry-wrapper,.wpnbha.image-alignright.is-3 .post-thumbnail{flex-basis:50%}}.wpnbha.image-alignleft.is-1 .post-thumbnail,.wpnbha.image-alignright.is-1 .post-thumbnail{flex-basis:25%}.wpnbha.image-alignleft.is-1 .entry-wrapper,.wpnbha.image-alignright.is-1 .entry-wrapper{flex-basis:75%}.wpnbha.image-alignleft .post-thumbnail{margin-left:1em}.wpnbha.image-alignright .post-thumbnail{margin-right:1em}.wpnbha.image-alignright .entry-wrapper{order:-1}.wpnbha.mobile-stack.image-alignleft .post-thumbnail,.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-right:0;margin-left:0}@media only screen and (min-width:600px){.wpnbha.mobile-stack.image-alignleft .post-thumbnail{margin-left:1em}.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-right:1em}}.wpnbha .entry-title{margin:0 0 .25em}.wpnbha .entry-title a{color:inherit;text-decoration:none}.wpnbha .cat-links{font-size:.6em;font-weight:700;margin:0 0 .5em}.wpnbha .cat-links a{text-decoration:none}.wpnbha .cat-links a:hover{text-decoration:underline}.wpnbha .entry-meta{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5em}.wpnbha .entry-meta .byline:not(:last-child){margin-left:1.5em}.wpnbha .entry-meta .updated:not(.published){display:none}.wpnbha .avatar{border-radius:100%;display:block;margin-left:.5em}.wpnbha p{margin:.5em 0}.wpnbha.has-text-color .article-section-title,.wpnbha.has-text-color .cat-links,.wpnbha.has-text-color .cat-links a,.wpnbha.has-text-color .cat-links a:visited,.wpnbha.has-text-color .entry-meta,.wpnbha.has-text-color .entry-meta .byline a,.wpnbha.has-text-color .entry-meta .byline a:visited,.wpnbha.has-text-color .entry-meta a,.wpnbha.has-text-color .entry-title,.wpnbha.has-text-color .entry-title a,.wpnbha.has-text-color .entry-title a:visited,.wpnbha.has-text-color figcaption{color:inherit}.wpnbha.has-text-color .entry-meta span:not(.avatar){opacity:.8}.wpnbha.image-alignbehind .post-has-image{display:flex;align-items:flex-end;position:relative}.wpnbha.image-alignbehind .post-has-image .post-thumbnail{bottom:0;right:0;margin:0;overflow:hidden;position:absolute;left:0;top:0}.wpnbha.image-alignbehind .post-has-image .post-thumbnail img{height:100%;-o-object-fit:cover;object-fit:cover;max-width:1000%;width:100%}.wpnbha.image-alignbehind .post-has-image .post-thumbnail figcaption{bottom:1em;-webkit-box-orient:vertical;color:hsla(0,0%,100%,.9);display:-webkit-box;font-style:italic;right:0;-webkit-line-clamp:1;margin:0;max-height:1.6em;overflow:hidden;padding:0 1em;position:absolute;left:0;text-align:left;text-overflow:ellipsis;z-index:2}.wpnbha.image-alignbehind .post-has-image .post-thumbnail:after{background:rgba(0,0,0,.5);bottom:0;content:"";right:0;position:absolute;left:0;top:0;z-index:1}.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em;position:relative;z-index:2}.wpnbha.image-alignbehind .post-has-image .cat-links a,.wpnbha.image-alignbehind .post-has-image .entry-meta,.wpnbha.image-alignbehind .post-has-image .entry-meta .byline a,.wpnbha.image-alignbehind .post-has-image .entry-title a,.wpnbha.image-alignbehind .post-has-image .entry-wrapper{color:#fff}.wpnbha article .entry-title{font-size:1.2em}.wpnbha article .entry-meta{font-size:.8em}.wpnbha article .avatar{height:25px;width:25px}@media only screen and (min-width:782px){.wpnbha article .entry-title{font-size:1.6em}.wpnbha article .avatar{height:40px;width:40px}}.wpnbha.ts-8 .entry-title,.wpnbha.ts-9 .entry-title,.wpnbha.ts-10 .entry-title{line-height:1.1em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .avatar,.wpnbha.ts-9 article .avatar,.wpnbha.ts-10 article .avatar{height:2.4em;width:2.4em}}.wpnbha.ts-10 article .entry-title{font-size:2.6em}@media only screen and (min-width:782px){.wpnbha.ts-10 article .entry-title{font-size:3.6em}}@media only screen and (min-width:1168px){.wpnbha.ts-10 article .entry-title{font-size:4.8em}}.wpnbha.ts-9 article .entry-title{font-size:2.4em}@media only screen and (min-width:782px){.wpnbha.ts-9 article .entry-title{font-size:3.4em}}@media only screen and (min-width:1168px){.wpnbha.ts-9 article .entry-title{font-size:4.2em}}.wpnbha.ts-8 article .entry-title{font-size:2.2em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .entry-title{font-size:3em}}@media only screen and (min-width:1168px){.wpnbha.ts-8 article .entry-title{font-size:3.6em}}.wpnbha.ts-7 article .entry-title{font-size:2em}@media only screen and (min-width:782px){.wpnbha.ts-7 article .entry-title{font-size:2.4em}.wpnbha.ts-7 article .avatar{height:48px;width:48px}}@media only screen and (min-width:1168px){.wpnbha.ts-7 article .entry-title{font-size:3em}}.wpnbha.ts-6 article .entry-title{font-size:1.7em}@media only screen and (min-width:782px){.wpnbha.ts-6 article .entry-title{font-size:2em}.wpnbha.ts-6 article .avatar{height:44px;width:44px}}@media only screen and (min-width:1168px){.wpnbha.ts-6 article .entry-title{font-size:2.4em}}.wpnbha.ts-5 article .entry-title{font-size:1.4em}@media only screen and (min-width:782px){.wpnbha.ts-5 article .entry-title{font-size:1.8em}.wpnbha.ts-5 article .avatar{height:40px;width:40px}}@media only screen and (min-width:1168px){.wpnbha.ts-5 article .entry-title{font-size:2em}}.wpnbha.ts-3 article .entry-title{font-size:1em}.wpnbha.ts-3 article .entry-wrapper p{font-size:.8em}.wpnbha.ts-3 article .entry-meta{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-3 article .entry-title{font-size:1.2em}.wpnbha.ts-3 article .avatar{height:32px;width:32px}}.wpnbha.ts-2 article .entry-title{font-size:.8em}.wpnbha.ts-2 article .entry-meta,.wpnbha.ts-2 article .entry-wrapper p{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-2 article .entry-title{font-size:.9em}.wpnbha.ts-2 article .avatar{height:28px;width:28px}}.wpnbha.ts-1 article .entry-title,.wpnbha.ts-1 article .entry-wrapper p{font-size:.7em}.wpnbha.ts-1 article .entry-meta{font-size:.6em}@media only screen and (min-width:782px){.wpnbha.ts-1 article .avatar{height:24px;width:24px}}.wpnbha.is-style-borders article{border:solid rgba(0,0,0,.2);border-width:0 0 1px;margin-bottom:1em;padding-bottom:1em}.wpnbha.is-style-borders article:last-of-type{margin-bottom:0}.wpnbha.is-style-borders article:last-of-type:not(:first-of-type){border-bottom:0}@media only screen and (min-width:782px){.wpnbha.is-style-borders.columns-2 article{padding-left:32px}.wpnbha.is-style-borders.columns-3 article{padding-left:24px}.wpnbha.is-style-borders.columns-4 article{padding-left:21.33333px}.wpnbha.is-style-borders.columns-5 article{padding-left:20px}.wpnbha.is-style-borders.columns-6 article{padding-left:19.2px}.wpnbha.is-style-borders.is-grid article{border-width:0 0 0 1px}.wpnbha.is-style-borders.columns-1 article,.wpnbha.is-style-borders.columns-2 article:nth-of-type(2n),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n),.wpnbha.is-style-borders.columns-4 article:nth-of-type(4n),.wpnbha.is-style-borders.columns-5 article:nth-of-type(5n),.wpnbha.is-style-borders.columns-6 article:nth-of-type(6n),.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}
1
+ .autocomplete-tokenfield{position:relative}.autocomplete-tokenfield .components-spinner{position:absolute;top:2em;left:0}.autocomplete-tokenfield .components-form-token-field>.components-form-token-field__help{display:none}.autocomplete-tokenfield .autocomplete-tokenfield__help{font-style:italic}.wp-block[data-type^="newspack-blocks/"] .component-placeholder__align-center{align-items:center}.type-scale-slider .dashicon{height:16px;width:16px}.type-scale-slider input+.dashicon{height:24px;margin-right:10px;margin-left:0;width:24px}.wpnbha .editor-rich-text{width:100%}.wpnbha .cat-links{font-size:.7em}.wpnbha span.avatar{display:inline-block;margin-left:.5em}.wpnbha span.avatar div{display:inline}.wpnbha .excerpt-contain p{margin:.5em 0}.editor-styles-wrapper.wpnbha__wp-block-button__wrapper{background-color:transparent}.wpnbha{margin-bottom:1em}.wpnbha article{margin-bottom:1.5em;word-break:break-word;overflow-wrap:break-word;position:relative}.wpnbha article:last-of-type{margin-bottom:0}.wpnbha .article-section-title{font-size:.8em;margin-bottom:.5em;width:100%}.wpnbha.is-grid>div{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0;list-style:none}.wpnbha.is-grid article{flex-basis:100%}@media only screen and (min-width:782px){.wpnbha.is-grid article,.wpnbha.is-grid article:last-child{margin-bottom:1em}}@media only screen and (min-width:600px){.wpnbha.columns-3 article,.wpnbha.columns-6 article{flex-basis:calc(33.333% - 16px)}.wpnbha.columns-2 article,.wpnbha.columns-4 article,.wpnbha.columns-5 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-5 article:last-of-type{flex-basis:100%}}@media only screen and (min-width:782px){.wpnbha.columns-2 article,.wpnbha.columns-2 article:last-of-type{flex-basis:calc(50% - 16px)}.wpnbha.columns-3 article,.wpnbha.columns-3 article:last-of-type{flex-basis:calc(33.33333% - 16px)}.wpnbha.columns-4 article,.wpnbha.columns-4 article:last-of-type{flex-basis:calc(25% - 16px)}.wpnbha.columns-5 article,.wpnbha.columns-5 article:last-of-type{flex-basis:calc(20% - 16px)}.wpnbha.columns-6 article,.wpnbha.columns-6 article:last-of-type{flex-basis:calc(16.66667% - 16px)}}.wpnbha .post-thumbnail{margin:0 0 .25em}.wpnbha .post-thumbnail img{height:auto;width:100%}.wpnbha .post-thumbnail figcaption{margin-bottom:.5em}.wpnbha figcaption{font-size:.6em}.wpnbha.image-alignleft .post-has-image,.wpnbha.image-alignright .post-has-image{display:flex}.wpnbha.image-alignleft .post-has-image .post-thumbnail,.wpnbha.image-alignright .post-has-image .post-thumbnail{flex-basis:33%}.wpnbha.image-alignleft .post-has-image .entry-wrapper,.wpnbha.image-alignright .post-has-image .entry-wrapper{flex-basis:67%}.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:block}@media only screen and (min-width:600px){.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:flex}}@media only screen and (min-width:600px){.wpnbha.image-alignleft.is-4 .post-thumbnail,.wpnbha.image-alignright.is-4 .post-thumbnail{flex-basis:75%}.wpnbha.image-alignleft.is-4 .entry-wrapper,.wpnbha.image-alignright.is-4 .entry-wrapper{flex-basis:25%}.wpnbha.image-alignleft.is-3 .entry-wrapper,.wpnbha.image-alignleft.is-3 .post-thumbnail,.wpnbha.image-alignright.is-3 .entry-wrapper,.wpnbha.image-alignright.is-3 .post-thumbnail{flex-basis:50%}}.wpnbha.image-alignleft.is-1 .post-thumbnail,.wpnbha.image-alignright.is-1 .post-thumbnail{flex-basis:25%}.wpnbha.image-alignleft.is-1 .entry-wrapper,.wpnbha.image-alignright.is-1 .entry-wrapper{flex-basis:75%}.wpnbha.image-alignleft .post-thumbnail{margin-left:1em}.wpnbha.image-alignright .post-thumbnail{margin-right:1em}.wpnbha.image-alignright .entry-wrapper{order:-1}.wpnbha.mobile-stack.image-alignleft .post-thumbnail,.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-right:0;margin-left:0}@media only screen and (min-width:600px){.wpnbha.mobile-stack.image-alignleft .post-thumbnail{margin-left:1em}.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-right:1em}}.wpnbha .entry-title{margin:0 0 .25em}.wpnbha .entry-title a{color:inherit;text-decoration:none}.wpnbha .cat-links{font-size:.6em;font-weight:700;margin:0 0 .5em}.wpnbha .cat-links a{text-decoration:none}.wpnbha .cat-links a:hover{text-decoration:underline}.wpnbha .entry-meta{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5em}.wpnbha .entry-meta .byline:not(:last-child){margin-left:1.5em}.wpnbha .entry-meta .updated:not(.published){display:none}.wpnbha .avatar{border-radius:100%;display:block;margin-left:.5em}.wpnbha p{margin:.5em 0}.wpnbha.has-text-color .article-section-title,.wpnbha.has-text-color .cat-links,.wpnbha.has-text-color .cat-links a,.wpnbha.has-text-color .cat-links a:visited,.wpnbha.has-text-color .entry-meta,.wpnbha.has-text-color .entry-meta .byline a,.wpnbha.has-text-color .entry-meta .byline a:visited,.wpnbha.has-text-color .entry-meta a,.wpnbha.has-text-color .entry-title,.wpnbha.has-text-color .entry-title a,.wpnbha.has-text-color .entry-title a:visited,.wpnbha.has-text-color figcaption{color:inherit}.wpnbha.has-text-color .entry-meta span:not(.avatar){opacity:.8}.wpnbha.image-alignbehind .post-has-image{display:flex;align-items:flex-end;position:relative}.wpnbha.image-alignbehind .post-has-image .post-thumbnail{bottom:0;right:0;margin:0;overflow:hidden;position:absolute;left:0;top:0}.wpnbha.image-alignbehind .post-has-image .post-thumbnail img{height:100%;-o-object-fit:cover;object-fit:cover;max-width:1000%;width:100%}.wpnbha.image-alignbehind .post-has-image .post-thumbnail figcaption{bottom:1em;-webkit-box-orient:vertical;color:hsla(0,0%,100%,.9);display:-webkit-box;font-style:italic;right:0;-webkit-line-clamp:1;margin:0;max-height:1.6em;overflow:hidden;padding:0 1em;position:absolute;left:0;text-align:left;text-overflow:ellipsis;z-index:2}.wpnbha.image-alignbehind .post-has-image .post-thumbnail:after{background:rgba(0,0,0,.5);bottom:0;content:"";right:0;position:absolute;left:0;top:0;z-index:1}.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em 1em;position:relative;z-index:2}@media only screen and (min-width:1168px){.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em 1.5em}}.wpnbha.image-alignbehind .post-has-image .cat-links a,.wpnbha.image-alignbehind .post-has-image .entry-meta,.wpnbha.image-alignbehind .post-has-image .entry-meta .byline a,.wpnbha.image-alignbehind .post-has-image .entry-title a,.wpnbha.image-alignbehind .post-has-image .entry-wrapper{color:#fff}.wpnbha .error,.wpnbha .loading,.wpnbha button{display:none}.wpnbha button{margin-top:1em}.wpnbha.has-more-button button{display:block}.wpnbha.has-more-button.is-loading button{display:none}.wpnbha.has-more-button.is-error .error,.wpnbha.has-more-button.is-error button,.wpnbha.has-more-button.is-loading .loading{display:block}.wpnbha article .entry-title{font-size:1.2em}.wpnbha article .entry-meta{font-size:.8em}.wpnbha article .avatar{height:25px;width:25px}@media only screen and (min-width:782px){.wpnbha article .entry-title{font-size:1.6em}.wpnbha article .avatar{height:40px;width:40px}}.wpnbha.ts-8 .entry-title,.wpnbha.ts-9 .entry-title,.wpnbha.ts-10 .entry-title{line-height:1.1em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .avatar,.wpnbha.ts-9 article .avatar,.wpnbha.ts-10 article .avatar{height:2.4em;width:2.4em}}.wpnbha.ts-7 .newspack-post-subtitle,.wpnbha.ts-8 .newspack-post-subtitle,.wpnbha.ts-9 .newspack-post-subtitle,.wpnbha.ts-10 .newspack-post-subtitle{font-size:1.4em}.wpnbha.ts-10 article .entry-title{font-size:2.6em}@media only screen and (min-width:782px){.wpnbha.ts-10 article .entry-title{font-size:3.6em}}@media only screen and (min-width:1168px){.wpnbha.ts-10 article .entry-title{font-size:4.8em}}.wpnbha.ts-9 article .entry-title{font-size:2.4em}@media only screen and (min-width:782px){.wpnbha.ts-9 article .entry-title{font-size:3.4em}}@media only screen and (min-width:1168px){.wpnbha.ts-9 article .entry-title{font-size:4.2em}}.wpnbha.ts-8 article .entry-title{font-size:2.2em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .entry-title{font-size:3em}}@media only screen and (min-width:1168px){.wpnbha.ts-8 article .entry-title{font-size:3.6em}}.wpnbha.ts-7 article .entry-title{font-size:2em}@media only screen and (min-width:782px){.wpnbha.ts-7 article .entry-title{font-size:2.4em}.wpnbha.ts-7 article .avatar{height:48px;width:48px}}@media only screen and (min-width:1168px){.wpnbha.ts-7 article .entry-title{font-size:3em}}.wpnbha.ts-6 article .entry-title{font-size:1.7em}.wpnbha.ts-6 article .newspack-post-subtitle{font-size:1.4em}@media only screen and (min-width:782px){.wpnbha.ts-6 article .entry-title{font-size:2em}.wpnbha.ts-6 article .avatar{height:44px;width:44px}}@media only screen and (min-width:1168px){.wpnbha.ts-6 article .entry-title{font-size:2.4em}}.wpnbha.ts-5 article .entry-title{font-size:1.4em}.wpnbha.ts-5 article .newspack-post-subtitle{font-size:1.2em}@media only screen and (min-width:782px){.wpnbha.ts-5 article .entry-title{font-size:1.8em}.wpnbha.ts-5 article .avatar{height:40px;width:40px}}@media only screen and (min-width:1168px){.wpnbha.ts-5 article .entry-title{font-size:2em}}.wpnbha.ts-3 article .entry-title{font-size:1em}.wpnbha.ts-3 article .entry-wrapper p,.wpnbha.ts-3 article .newspack-post-subtitle{font-size:.8em}.wpnbha.ts-3 article .entry-meta{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-3 article .entry-title{font-size:1.2em}.wpnbha.ts-3 article .avatar{height:32px;width:32px}}.wpnbha.ts-2 article .entry-title{font-size:.8em}.wpnbha.ts-2 article .entry-meta,.wpnbha.ts-2 article .entry-wrapper p,.wpnbha.ts-2 article .newspack-post-subtitle{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-2 article .entry-title{font-size:.9em}.wpnbha.ts-2 article .avatar{height:28px;width:28px}}.wpnbha.ts-1 article .entry-title,.wpnbha.ts-1 article .entry-wrapper p,.wpnbha.ts-1 article .newspack-post-subtitle{font-size:.7em}.wpnbha.ts-1 article .entry-meta{font-size:.6em}@media only screen and (min-width:782px){.wpnbha.ts-1 article .avatar{height:24px;width:24px}}.wpnbha.is-style-borders article{border:solid rgba(0,0,0,.2);border-width:0 0 1px;margin-bottom:1em;padding-bottom:1em}.wpnbha.is-style-borders article:last-of-type{margin-bottom:0}.wpnbha.is-style-borders article:last-of-type:not(:first-of-type){border-bottom:0}@media only screen and (min-width:600px){.wpnbha.is-style-borders.columns-2 article{padding-left:32px}.wpnbha.is-style-borders.columns-3 article{padding-left:24px}.wpnbha.is-style-borders.columns-4 article{padding-left:21.33333px}.wpnbha.is-style-borders.columns-5 article{padding-left:20px}.wpnbha.is-style-borders.columns-6 article{padding-left:19.2px}.wpnbha.is-style-borders.columns-2 article,.wpnbha.is-style-borders.columns-4 article,.wpnbha.is-style-borders.columns-5 article{border-width:0}.wpnbha.is-style-borders.columns-2 article:nth-of-type(odd),.wpnbha.is-style-borders.columns-4 article:nth-of-type(odd),.wpnbha.is-style-borders.columns-5 article:nth-of-type(odd){border-width:0 0 0 1px}.wpnbha.is-style-borders.columns-3 article,.wpnbha.is-style-borders.columns-6 article{border-width:0}.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n+1),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n+2),.wpnbha.is-style-borders.columns-6 article:nth-of-type(3n+1),.wpnbha.is-style-borders.columns-6 article:nth-of-type(3n+2){border-width:0 0 0 1px}.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}@media only screen and (min-width:782px){.wpnbha.is-style-borders.is-grid article{border-width:0 0 0 1px}.wpnbha.is-style-borders.columns-1 article,.wpnbha.is-style-borders.columns-2 article:nth-of-type(2n),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n),.wpnbha.is-style-borders.columns-4 article:nth-of-type(4n),.wpnbha.is-style-borders.columns-5 article:nth-of-type(5n),.wpnbha.is-style-borders.columns-6 article:nth-of-type(6n),.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}.newspack-post-subtitle--in-homepage-block{margin-top:.3em;margin-bottom:0;line-height:1.4em;font-style:italic}amp-script .wpnbha.has-more-button.is-loading button{display:none}amp-script .wpnbha.has-more-button.is-error .error,amp-script .wpnbha.has-more-button.is-error button,amp-script .wpnbha.has-more-button.is-loading .loading{display:block}
blog-posts-block/dist/view.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => '187983f2ec7aa568a46de75a4da480a2');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => '43a4fae037d34efbccdc834195608ae4');
blog-posts-block/dist/view.css CHANGED
@@ -1 +1 @@
1
- .wpnbha{margin-bottom:1em}.wpnbha article{margin-bottom:1.5em;word-break:break-word;overflow-wrap:break-word;position:relative}.wpnbha article:last-of-type{margin-bottom:0}.wpnbha .article-section-title{font-size:.8em;margin-bottom:.5em;width:100%}.wpnbha.is-grid>div{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0;list-style:none}.wpnbha.is-grid article{flex-basis:100%}@media only screen and (min-width:782px){.wpnbha.is-grid article,.wpnbha.is-grid article:last-child{margin-bottom:1em}}@media only screen and (min-width:600px){.wpnbha.columns-3 article,.wpnbha.columns-6 article{flex-basis:calc(33.333% - 16px)}.wpnbha.columns-2 article,.wpnbha.columns-4 article,.wpnbha.columns-5 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-5 article:last-of-type:nth-child(odd){flex-grow:1}}@media only screen and (min-width:782px){.wpnbha.columns-2 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-3 article{flex-basis:calc(33.33333% - 16px)}.wpnbha.columns-4 article{flex-basis:calc(25% - 16px)}.wpnbha.columns-5 article{flex-basis:calc(20% - 16px)}.wpnbha.columns-6 article{flex-basis:calc(16.66667% - 16px)}}.wpnbha .post-thumbnail{margin:0}.wpnbha .post-thumbnail img{height:auto;width:100%}.wpnbha figcaption{font-size:.6em}.wpnbha .post-thumbnail{margin-bottom:.25em}.wpnbha .post-thumbnail figcaption{margin-bottom:.5em}.wpnbha.image-alignleft .post-has-image,.wpnbha.image-alignright .post-has-image{display:flex}.wpnbha.image-alignleft .post-has-image .post-thumbnail,.wpnbha.image-alignright .post-has-image .post-thumbnail{flex-basis:33%}.wpnbha.image-alignleft .post-has-image .entry-wrapper,.wpnbha.image-alignright .post-has-image .entry-wrapper{flex-basis:67%}.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:block}@media only screen and (min-width:600px){.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:flex}}@media only screen and (min-width:600px){.wpnbha.image-alignleft.is-4 .post-thumbnail,.wpnbha.image-alignright.is-4 .post-thumbnail{flex-basis:75%}.wpnbha.image-alignleft.is-4 .entry-wrapper,.wpnbha.image-alignright.is-4 .entry-wrapper{flex-basis:25%}.wpnbha.image-alignleft.is-3 .entry-wrapper,.wpnbha.image-alignleft.is-3 .post-thumbnail,.wpnbha.image-alignright.is-3 .entry-wrapper,.wpnbha.image-alignright.is-3 .post-thumbnail{flex-basis:50%}}.wpnbha.image-alignleft.is-1 .post-thumbnail,.wpnbha.image-alignright.is-1 .post-thumbnail{flex-basis:25%}.wpnbha.image-alignleft.is-1 .entry-wrapper,.wpnbha.image-alignright.is-1 .entry-wrapper{flex-basis:75%}.wpnbha.image-alignleft .post-thumbnail{margin-right:1em}.wpnbha.image-alignright .post-thumbnail{margin-left:1em}.wpnbha.image-alignright .entry-wrapper{order:-1}.wpnbha.mobile-stack.image-alignleft .post-thumbnail,.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-left:0;margin-right:0}@media only screen and (min-width:600px){.wpnbha.mobile-stack.image-alignleft .post-thumbnail{margin-right:1em}.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-left:1em}}.wpnbha .entry-title{margin:0 0 .25em}.wpnbha .entry-title a{color:inherit;text-decoration:none}.wpnbha .cat-links{font-size:.6em;font-weight:700;margin:0 0 .5em}.wpnbha .cat-links a{text-decoration:none}.wpnbha .cat-links a:hover{text-decoration:underline}.wpnbha .entry-meta{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5em}.wpnbha .entry-meta .byline:not(:last-child){margin-right:1.5em}.wpnbha .entry-meta .updated:not(.published){display:none}.wpnbha .avatar{border-radius:100%;display:block;margin-right:.5em}.wpnbha p{margin:.5em 0}.wpnbha.has-text-color .article-section-title,.wpnbha.has-text-color .cat-links,.wpnbha.has-text-color .cat-links a,.wpnbha.has-text-color .cat-links a:visited,.wpnbha.has-text-color .entry-meta,.wpnbha.has-text-color .entry-meta .byline a,.wpnbha.has-text-color .entry-meta .byline a:visited,.wpnbha.has-text-color .entry-meta a,.wpnbha.has-text-color .entry-title,.wpnbha.has-text-color .entry-title a,.wpnbha.has-text-color .entry-title a:visited,.wpnbha.has-text-color figcaption{color:inherit}.wpnbha.has-text-color .entry-meta span:not(.avatar){opacity:.8}.wpnbha.image-alignbehind .post-has-image{display:flex;align-items:flex-end;position:relative}.wpnbha.image-alignbehind .post-has-image .post-thumbnail{bottom:0;left:0;margin:0;overflow:hidden;position:absolute;right:0;top:0}.wpnbha.image-alignbehind .post-has-image .post-thumbnail img{height:100%;-o-object-fit:cover;object-fit:cover;max-width:1000%;width:100%}.wpnbha.image-alignbehind .post-has-image .post-thumbnail figcaption{bottom:1em;-webkit-box-orient:vertical;color:hsla(0,0%,100%,.9);display:-webkit-box;font-style:italic;left:0;-webkit-line-clamp:1;margin:0;max-height:1.6em;overflow:hidden;padding:0 1em;position:absolute;right:0;text-align:right;text-overflow:ellipsis;z-index:2}.wpnbha.image-alignbehind .post-has-image .post-thumbnail:after{background:rgba(0,0,0,.5);bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em;position:relative;z-index:2}.wpnbha.image-alignbehind .post-has-image .cat-links a,.wpnbha.image-alignbehind .post-has-image .entry-meta,.wpnbha.image-alignbehind .post-has-image .entry-meta .byline a,.wpnbha.image-alignbehind .post-has-image .entry-title a,.wpnbha.image-alignbehind .post-has-image .entry-wrapper{color:#fff}.wpnbha article .entry-title{font-size:1.2em}.wpnbha article .entry-meta{font-size:.8em}.wpnbha article .avatar{height:25px;width:25px}@media only screen and (min-width:782px){.wpnbha article .entry-title{font-size:1.6em}.wpnbha article .avatar{height:40px;width:40px}}.wpnbha.ts-8 .entry-title,.wpnbha.ts-9 .entry-title,.wpnbha.ts-10 .entry-title{line-height:1.1em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .avatar,.wpnbha.ts-9 article .avatar,.wpnbha.ts-10 article .avatar{height:2.4em;width:2.4em}}.wpnbha.ts-10 article .entry-title{font-size:2.6em}@media only screen and (min-width:782px){.wpnbha.ts-10 article .entry-title{font-size:3.6em}}@media only screen and (min-width:1168px){.wpnbha.ts-10 article .entry-title{font-size:4.8em}}.wpnbha.ts-9 article .entry-title{font-size:2.4em}@media only screen and (min-width:782px){.wpnbha.ts-9 article .entry-title{font-size:3.4em}}@media only screen and (min-width:1168px){.wpnbha.ts-9 article .entry-title{font-size:4.2em}}.wpnbha.ts-8 article .entry-title{font-size:2.2em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .entry-title{font-size:3em}}@media only screen and (min-width:1168px){.wpnbha.ts-8 article .entry-title{font-size:3.6em}}.wpnbha.ts-7 article .entry-title{font-size:2em}@media only screen and (min-width:782px){.wpnbha.ts-7 article .entry-title{font-size:2.4em}.wpnbha.ts-7 article .avatar{height:48px;width:48px}}@media only screen and (min-width:1168px){.wpnbha.ts-7 article .entry-title{font-size:3em}}.wpnbha.ts-6 article .entry-title{font-size:1.7em}@media only screen and (min-width:782px){.wpnbha.ts-6 article .entry-title{font-size:2em}.wpnbha.ts-6 article .avatar{height:44px;width:44px}}@media only screen and (min-width:1168px){.wpnbha.ts-6 article .entry-title{font-size:2.4em}}.wpnbha.ts-5 article .entry-title{font-size:1.4em}@media only screen and (min-width:782px){.wpnbha.ts-5 article .entry-title{font-size:1.8em}.wpnbha.ts-5 article .avatar{height:40px;width:40px}}@media only screen and (min-width:1168px){.wpnbha.ts-5 article .entry-title{font-size:2em}}.wpnbha.ts-3 article .entry-title{font-size:1em}.wpnbha.ts-3 article .entry-wrapper p{font-size:.8em}.wpnbha.ts-3 article .entry-meta{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-3 article .entry-title{font-size:1.2em}.wpnbha.ts-3 article .avatar{height:32px;width:32px}}.wpnbha.ts-2 article .entry-title{font-size:.8em}.wpnbha.ts-2 article .entry-meta,.wpnbha.ts-2 article .entry-wrapper p{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-2 article .entry-title{font-size:.9em}.wpnbha.ts-2 article .avatar{height:28px;width:28px}}.wpnbha.ts-1 article .entry-title,.wpnbha.ts-1 article .entry-wrapper p{font-size:.7em}.wpnbha.ts-1 article .entry-meta{font-size:.6em}@media only screen and (min-width:782px){.wpnbha.ts-1 article .avatar{height:24px;width:24px}}.wpnbha.is-style-borders article{border:solid rgba(0,0,0,.2);border-width:0 0 1px;margin-bottom:1em;padding-bottom:1em}.wpnbha.is-style-borders article:last-of-type{margin-bottom:0}.wpnbha.is-style-borders article:last-of-type:not(:first-of-type){border-bottom:0}@media only screen and (min-width:782px){.wpnbha.is-style-borders.columns-2 article{padding-right:32px}.wpnbha.is-style-borders.columns-3 article{padding-right:24px}.wpnbha.is-style-borders.columns-4 article{padding-right:21.33333px}.wpnbha.is-style-borders.columns-5 article{padding-right:20px}.wpnbha.is-style-borders.columns-6 article{padding-right:19.2px}.wpnbha.is-style-borders.is-grid article{border-width:0 1px 0 0}.wpnbha.is-style-borders.columns-1 article,.wpnbha.is-style-borders.columns-2 article:nth-of-type(2n),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n),.wpnbha.is-style-borders.columns-4 article:nth-of-type(4n),.wpnbha.is-style-borders.columns-5 article:nth-of-type(5n),.wpnbha.is-style-borders.columns-6 article:nth-of-type(6n),.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}
1
+ .wpnbha{margin-bottom:1em}.wpnbha article{margin-bottom:1.5em;word-break:break-word;overflow-wrap:break-word;position:relative}.wpnbha article:last-of-type{margin-bottom:0}.wpnbha .article-section-title{font-size:.8em;margin-bottom:.5em;width:100%}.wpnbha.is-grid>div{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0;list-style:none}.wpnbha.is-grid article{flex-basis:100%}@media only screen and (min-width:782px){.wpnbha.is-grid article,.wpnbha.is-grid article:last-child{margin-bottom:1em}}@media only screen and (min-width:600px){.wpnbha.columns-3 article,.wpnbha.columns-6 article{flex-basis:calc(33.333% - 16px)}.wpnbha.columns-2 article,.wpnbha.columns-4 article,.wpnbha.columns-5 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-5 article:last-of-type{flex-basis:100%}}@media only screen and (min-width:782px){.wpnbha.columns-2 article,.wpnbha.columns-2 article:last-of-type{flex-basis:calc(50% - 16px)}.wpnbha.columns-3 article,.wpnbha.columns-3 article:last-of-type{flex-basis:calc(33.33333% - 16px)}.wpnbha.columns-4 article,.wpnbha.columns-4 article:last-of-type{flex-basis:calc(25% - 16px)}.wpnbha.columns-5 article,.wpnbha.columns-5 article:last-of-type{flex-basis:calc(20% - 16px)}.wpnbha.columns-6 article,.wpnbha.columns-6 article:last-of-type{flex-basis:calc(16.66667% - 16px)}}.wpnbha .post-thumbnail{margin:0 0 .25em}.wpnbha .post-thumbnail img{height:auto;width:100%}.wpnbha .post-thumbnail figcaption{margin-bottom:.5em}.wpnbha figcaption{font-size:.6em}.wpnbha.image-alignleft .post-has-image,.wpnbha.image-alignright .post-has-image{display:flex}.wpnbha.image-alignleft .post-has-image .post-thumbnail,.wpnbha.image-alignright .post-has-image .post-thumbnail{flex-basis:33%}.wpnbha.image-alignleft .post-has-image .entry-wrapper,.wpnbha.image-alignright .post-has-image .entry-wrapper{flex-basis:67%}.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:block}@media only screen and (min-width:600px){.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:flex}}@media only screen and (min-width:600px){.wpnbha.image-alignleft.is-4 .post-thumbnail,.wpnbha.image-alignright.is-4 .post-thumbnail{flex-basis:75%}.wpnbha.image-alignleft.is-4 .entry-wrapper,.wpnbha.image-alignright.is-4 .entry-wrapper{flex-basis:25%}.wpnbha.image-alignleft.is-3 .entry-wrapper,.wpnbha.image-alignleft.is-3 .post-thumbnail,.wpnbha.image-alignright.is-3 .entry-wrapper,.wpnbha.image-alignright.is-3 .post-thumbnail{flex-basis:50%}}.wpnbha.image-alignleft.is-1 .post-thumbnail,.wpnbha.image-alignright.is-1 .post-thumbnail{flex-basis:25%}.wpnbha.image-alignleft.is-1 .entry-wrapper,.wpnbha.image-alignright.is-1 .entry-wrapper{flex-basis:75%}.wpnbha.image-alignleft .post-thumbnail{margin-right:1em}.wpnbha.image-alignright .post-thumbnail{margin-left:1em}.wpnbha.image-alignright .entry-wrapper{order:-1}.wpnbha.mobile-stack.image-alignleft .post-thumbnail,.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-left:0;margin-right:0}@media only screen and (min-width:600px){.wpnbha.mobile-stack.image-alignleft .post-thumbnail{margin-right:1em}.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-left:1em}}.wpnbha .entry-title{margin:0 0 .25em}.wpnbha .entry-title a{color:inherit;text-decoration:none}.wpnbha .cat-links{font-size:.6em;font-weight:700;margin:0 0 .5em}.wpnbha .cat-links a{text-decoration:none}.wpnbha .cat-links a:hover{text-decoration:underline}.wpnbha .entry-meta{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5em}.wpnbha .entry-meta .byline:not(:last-child){margin-right:1.5em}.wpnbha .entry-meta .updated:not(.published){display:none}.wpnbha .avatar{border-radius:100%;display:block;margin-right:.5em}.wpnbha p{margin:.5em 0}.wpnbha.has-text-color .article-section-title,.wpnbha.has-text-color .cat-links,.wpnbha.has-text-color .cat-links a,.wpnbha.has-text-color .cat-links a:visited,.wpnbha.has-text-color .entry-meta,.wpnbha.has-text-color .entry-meta .byline a,.wpnbha.has-text-color .entry-meta .byline a:visited,.wpnbha.has-text-color .entry-meta a,.wpnbha.has-text-color .entry-title,.wpnbha.has-text-color .entry-title a,.wpnbha.has-text-color .entry-title a:visited,.wpnbha.has-text-color figcaption{color:inherit}.wpnbha.has-text-color .entry-meta span:not(.avatar){opacity:.8}.wpnbha.image-alignbehind .post-has-image{display:flex;align-items:flex-end;position:relative}.wpnbha.image-alignbehind .post-has-image .post-thumbnail{bottom:0;left:0;margin:0;overflow:hidden;position:absolute;right:0;top:0}.wpnbha.image-alignbehind .post-has-image .post-thumbnail img{height:100%;-o-object-fit:cover;object-fit:cover;max-width:1000%;width:100%}.wpnbha.image-alignbehind .post-has-image .post-thumbnail figcaption{bottom:1em;-webkit-box-orient:vertical;color:hsla(0,0%,100%,.9);display:-webkit-box;font-style:italic;left:0;-webkit-line-clamp:1;margin:0;max-height:1.6em;overflow:hidden;padding:0 1em;position:absolute;right:0;text-align:right;text-overflow:ellipsis;z-index:2}.wpnbha.image-alignbehind .post-has-image .post-thumbnail:after{background:rgba(0,0,0,.5);bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em 1em;position:relative;z-index:2}@media only screen and (min-width:1168px){.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em 1.5em}}.wpnbha.image-alignbehind .post-has-image .cat-links a,.wpnbha.image-alignbehind .post-has-image .entry-meta,.wpnbha.image-alignbehind .post-has-image .entry-meta .byline a,.wpnbha.image-alignbehind .post-has-image .entry-title a,.wpnbha.image-alignbehind .post-has-image .entry-wrapper{color:#fff}.wpnbha .error,.wpnbha .loading,.wpnbha button{display:none}.wpnbha button{margin-top:1em}.wpnbha.has-more-button button{display:block}.wpnbha.has-more-button.is-loading button{display:none}.wpnbha.has-more-button.is-error .error,.wpnbha.has-more-button.is-error button,.wpnbha.has-more-button.is-loading .loading{display:block}.wpnbha article .entry-title{font-size:1.2em}.wpnbha article .entry-meta{font-size:.8em}.wpnbha article .avatar{height:25px;width:25px}@media only screen and (min-width:782px){.wpnbha article .entry-title{font-size:1.6em}.wpnbha article .avatar{height:40px;width:40px}}.wpnbha.ts-8 .entry-title,.wpnbha.ts-9 .entry-title,.wpnbha.ts-10 .entry-title{line-height:1.1em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .avatar,.wpnbha.ts-9 article .avatar,.wpnbha.ts-10 article .avatar{height:2.4em;width:2.4em}}.wpnbha.ts-7 .newspack-post-subtitle,.wpnbha.ts-8 .newspack-post-subtitle,.wpnbha.ts-9 .newspack-post-subtitle,.wpnbha.ts-10 .newspack-post-subtitle{font-size:1.4em}.wpnbha.ts-10 article .entry-title{font-size:2.6em}@media only screen and (min-width:782px){.wpnbha.ts-10 article .entry-title{font-size:3.6em}}@media only screen and (min-width:1168px){.wpnbha.ts-10 article .entry-title{font-size:4.8em}}.wpnbha.ts-9 article .entry-title{font-size:2.4em}@media only screen and (min-width:782px){.wpnbha.ts-9 article .entry-title{font-size:3.4em}}@media only screen and (min-width:1168px){.wpnbha.ts-9 article .entry-title{font-size:4.2em}}.wpnbha.ts-8 article .entry-title{font-size:2.2em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .entry-title{font-size:3em}}@media only screen and (min-width:1168px){.wpnbha.ts-8 article .entry-title{font-size:3.6em}}.wpnbha.ts-7 article .entry-title{font-size:2em}@media only screen and (min-width:782px){.wpnbha.ts-7 article .entry-title{font-size:2.4em}.wpnbha.ts-7 article .avatar{height:48px;width:48px}}@media only screen and (min-width:1168px){.wpnbha.ts-7 article .entry-title{font-size:3em}}.wpnbha.ts-6 article .entry-title{font-size:1.7em}.wpnbha.ts-6 article .newspack-post-subtitle{font-size:1.4em}@media only screen and (min-width:782px){.wpnbha.ts-6 article .entry-title{font-size:2em}.wpnbha.ts-6 article .avatar{height:44px;width:44px}}@media only screen and (min-width:1168px){.wpnbha.ts-6 article .entry-title{font-size:2.4em}}.wpnbha.ts-5 article .entry-title{font-size:1.4em}.wpnbha.ts-5 article .newspack-post-subtitle{font-size:1.2em}@media only screen and (min-width:782px){.wpnbha.ts-5 article .entry-title{font-size:1.8em}.wpnbha.ts-5 article .avatar{height:40px;width:40px}}@media only screen and (min-width:1168px){.wpnbha.ts-5 article .entry-title{font-size:2em}}.wpnbha.ts-3 article .entry-title{font-size:1em}.wpnbha.ts-3 article .entry-wrapper p,.wpnbha.ts-3 article .newspack-post-subtitle{font-size:.8em}.wpnbha.ts-3 article .entry-meta{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-3 article .entry-title{font-size:1.2em}.wpnbha.ts-3 article .avatar{height:32px;width:32px}}.wpnbha.ts-2 article .entry-title{font-size:.8em}.wpnbha.ts-2 article .entry-meta,.wpnbha.ts-2 article .entry-wrapper p,.wpnbha.ts-2 article .newspack-post-subtitle{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-2 article .entry-title{font-size:.9em}.wpnbha.ts-2 article .avatar{height:28px;width:28px}}.wpnbha.ts-1 article .entry-title,.wpnbha.ts-1 article .entry-wrapper p,.wpnbha.ts-1 article .newspack-post-subtitle{font-size:.7em}.wpnbha.ts-1 article .entry-meta{font-size:.6em}@media only screen and (min-width:782px){.wpnbha.ts-1 article .avatar{height:24px;width:24px}}.wpnbha.is-style-borders article{border:solid rgba(0,0,0,.2);border-width:0 0 1px;margin-bottom:1em;padding-bottom:1em}.wpnbha.is-style-borders article:last-of-type{margin-bottom:0}.wpnbha.is-style-borders article:last-of-type:not(:first-of-type){border-bottom:0}@media only screen and (min-width:600px){.wpnbha.is-style-borders.columns-2 article{padding-right:32px}.wpnbha.is-style-borders.columns-3 article{padding-right:24px}.wpnbha.is-style-borders.columns-4 article{padding-right:21.33333px}.wpnbha.is-style-borders.columns-5 article{padding-right:20px}.wpnbha.is-style-borders.columns-6 article{padding-right:19.2px}.wpnbha.is-style-borders.columns-2 article,.wpnbha.is-style-borders.columns-4 article,.wpnbha.is-style-borders.columns-5 article{border-width:0}.wpnbha.is-style-borders.columns-2 article:nth-of-type(odd),.wpnbha.is-style-borders.columns-4 article:nth-of-type(odd),.wpnbha.is-style-borders.columns-5 article:nth-of-type(odd){border-width:0 1px 0 0}.wpnbha.is-style-borders.columns-3 article,.wpnbha.is-style-borders.columns-6 article{border-width:0}.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n+1),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n+2),.wpnbha.is-style-borders.columns-6 article:nth-of-type(3n+1),.wpnbha.is-style-borders.columns-6 article:nth-of-type(3n+2){border-width:0 1px 0 0}.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}@media only screen and (min-width:782px){.wpnbha.is-style-borders.is-grid article{border-width:0 1px 0 0}.wpnbha.is-style-borders.columns-1 article,.wpnbha.is-style-borders.columns-2 article:nth-of-type(2n),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n),.wpnbha.is-style-borders.columns-4 article:nth-of-type(4n),.wpnbha.is-style-borders.columns-5 article:nth-of-type(5n),.wpnbha.is-style-borders.columns-6 article:nth-of-type(6n),.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}.newspack-post-subtitle--in-homepage-block{margin-top:.3em;margin-bottom:0;line-height:1.4em;font-style:italic}amp-script .wpnbha.has-more-button.is-loading button{display:none}amp-script .wpnbha.has-more-button.is-error .error,amp-script .wpnbha.has-more-button.is-error button,amp-script .wpnbha.has-more-button.is-loading .loading{display:block}
blog-posts-block/dist/view.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){for(var r in e)t[r]=e[r]}(window,function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,e,r){var n=r(1),o=r(2),i=r(3);t.exports=function(t){return n(t)||o(t)||i()}},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e,r){},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n);r(4);function i(t){t.style.display="none",t.setAttribute("hidden","")}function u(t){t.style.display="",t.removeAttribute("hidden")}function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}document.querySelectorAll("[data-load-more-btn]").forEach((function(t){if(!t)return null;var e=function(t){var e=t.parentElement,r=e.querySelector("[data-posts-container]"),n=e.querySelector("[data-load-more-loading-text]"),c=e.querySelector("[data-load-more-error-text]"),l=!1,f=!1;return function(){if(l||f)return!1;l=!0,i(t),i(c),u(n);var e,s,d=new URL(t.getAttribute("data-load-more-url"));function p(){l=!1,i(n),u(c),u(t)}d.searchParams.set("exclude_ids",(e=document.querySelectorAll("article[data-post-id]"),s=Array.from(e).map((function(t){return t.getAttribute("data-post-id")})),o()(new Set(s))).join(",")),function t(e,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(n.status>=200&&n.status<300){var o=JSON.parse(n.responseText);return e.onSuccess(o)}return r?t(e,r-1):e.onError()}},n.open("GET",e.url),n.send()}({url:d.toString(),onSuccess:function(e){if(!function(t){var e=!1;t&&a(t,"items")&&Array.isArray(t.items)&&a(t,"next")&&"string"==typeof t.next&&(e=!0,!t.items.length||a(t.items[0],"html")&&"string"==typeof t.items[0].html||(e=!1));return e}(e))return p();if(e.items.length){var o=e.items.map((function(t){return t.html})).join("");r.insertAdjacentHTML("beforeend",o)}e.next&&(t.setAttribute("data-load-more-url",e.next),u(t));e.items.length&&e.next||(f=!0);l=!1,i(n)},onError:p},3)}}(t);t.addEventListener("click",e)}))}]));
1
+ !function(t,e){for(var r in e)t[r]=e[r]}(window,function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=5)}([function(t,e,r){var n=r(1),o=r(2),i=r(3);t.exports=function(t){return n(t)||o(t)||i()}},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e,r){},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=(r(4),3);function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}Array.prototype.forEach.call(document.querySelectorAll(".wp-block-newspack-blocks-homepage-articles.has-more-button"),(function(t){var e=t.querySelector("[data-next]");if(!e)return;var r=t.querySelector("[data-posts]"),n=!1,u=!1;e.addEventListener("click",(function(){if(n||u)return!1;n=!0,t.classList.remove("is-error"),t.classList.add("is-loading");var s,c,l=e.getAttribute("data-next")+"&exclude_ids="+(s=document.querySelectorAll(".wp-block-newspack-blocks-homepage-articles [data-post-id]"),c=Array.from(s).map((function(t){return t.getAttribute("data-post-id")})),o()(new Set(c))).join(",");function f(){n=!1,t.classList.remove("is-loading"),t.classList.add("is-error")}!function t(e,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(n.status>=200&&n.status<300){var o=JSON.parse(n.responseText);return e.onSuccess(o)}return r?t(e,r-1):e.onError()}},n.open("GET",e.url),n.send()}({url:encodeURI(l),onSuccess:function(o){if(!function(t){var e=!1;t&&a(t,"items")&&Array.isArray(t.items)&&a(t,"next")&&"string"==typeof t.next&&(e=!0,!t.items.length||a(t.items[0],"html")&&"string"==typeof t.items[0].html||(e=!1));return e}(o))return f();if(o.items.length){var i=o.items.map((function(t){return t.html})).join("");r.insertAdjacentHTML("beforeend",i)}o.next&&e.setAttribute("data-next",o.next);o.items.length&&o.next||(u=!0,t.classList.remove("has-more-button"));n=!1,t.classList.remove("is-loading")},onError:f},i)}))}))}]));
blog-posts-block/dist/view.rtl.css CHANGED
@@ -1 +1 @@
1
- .wpnbha{margin-bottom:1em}.wpnbha article{margin-bottom:1.5em;word-break:break-word;overflow-wrap:break-word;position:relative}.wpnbha article:last-of-type{margin-bottom:0}.wpnbha .article-section-title{font-size:.8em;margin-bottom:.5em;width:100%}.wpnbha.is-grid>div{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0;list-style:none}.wpnbha.is-grid article{flex-basis:100%}@media only screen and (min-width:782px){.wpnbha.is-grid article,.wpnbha.is-grid article:last-child{margin-bottom:1em}}@media only screen and (min-width:600px){.wpnbha.columns-3 article,.wpnbha.columns-6 article{flex-basis:calc(33.333% - 16px)}.wpnbha.columns-2 article,.wpnbha.columns-4 article,.wpnbha.columns-5 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-5 article:last-of-type:nth-child(odd){flex-grow:1}}@media only screen and (min-width:782px){.wpnbha.columns-2 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-3 article{flex-basis:calc(33.33333% - 16px)}.wpnbha.columns-4 article{flex-basis:calc(25% - 16px)}.wpnbha.columns-5 article{flex-basis:calc(20% - 16px)}.wpnbha.columns-6 article{flex-basis:calc(16.66667% - 16px)}}.wpnbha .post-thumbnail{margin:0}.wpnbha .post-thumbnail img{height:auto;width:100%}.wpnbha figcaption{font-size:.6em}.wpnbha .post-thumbnail{margin-bottom:.25em}.wpnbha .post-thumbnail figcaption{margin-bottom:.5em}.wpnbha.image-alignleft .post-has-image,.wpnbha.image-alignright .post-has-image{display:flex}.wpnbha.image-alignleft .post-has-image .post-thumbnail,.wpnbha.image-alignright .post-has-image .post-thumbnail{flex-basis:33%}.wpnbha.image-alignleft .post-has-image .entry-wrapper,.wpnbha.image-alignright .post-has-image .entry-wrapper{flex-basis:67%}.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:block}@media only screen and (min-width:600px){.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:flex}}@media only screen and (min-width:600px){.wpnbha.image-alignleft.is-4 .post-thumbnail,.wpnbha.image-alignright.is-4 .post-thumbnail{flex-basis:75%}.wpnbha.image-alignleft.is-4 .entry-wrapper,.wpnbha.image-alignright.is-4 .entry-wrapper{flex-basis:25%}.wpnbha.image-alignleft.is-3 .entry-wrapper,.wpnbha.image-alignleft.is-3 .post-thumbnail,.wpnbha.image-alignright.is-3 .entry-wrapper,.wpnbha.image-alignright.is-3 .post-thumbnail{flex-basis:50%}}.wpnbha.image-alignleft.is-1 .post-thumbnail,.wpnbha.image-alignright.is-1 .post-thumbnail{flex-basis:25%}.wpnbha.image-alignleft.is-1 .entry-wrapper,.wpnbha.image-alignright.is-1 .entry-wrapper{flex-basis:75%}.wpnbha.image-alignleft .post-thumbnail{margin-left:1em}.wpnbha.image-alignright .post-thumbnail{margin-right:1em}.wpnbha.image-alignright .entry-wrapper{order:-1}.wpnbha.mobile-stack.image-alignleft .post-thumbnail,.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-right:0;margin-left:0}@media only screen and (min-width:600px){.wpnbha.mobile-stack.image-alignleft .post-thumbnail{margin-left:1em}.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-right:1em}}.wpnbha .entry-title{margin:0 0 .25em}.wpnbha .entry-title a{color:inherit;text-decoration:none}.wpnbha .cat-links{font-size:.6em;font-weight:700;margin:0 0 .5em}.wpnbha .cat-links a{text-decoration:none}.wpnbha .cat-links a:hover{text-decoration:underline}.wpnbha .entry-meta{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5em}.wpnbha .entry-meta .byline:not(:last-child){margin-left:1.5em}.wpnbha .entry-meta .updated:not(.published){display:none}.wpnbha .avatar{border-radius:100%;display:block;margin-left:.5em}.wpnbha p{margin:.5em 0}.wpnbha.has-text-color .article-section-title,.wpnbha.has-text-color .cat-links,.wpnbha.has-text-color .cat-links a,.wpnbha.has-text-color .cat-links a:visited,.wpnbha.has-text-color .entry-meta,.wpnbha.has-text-color .entry-meta .byline a,.wpnbha.has-text-color .entry-meta .byline a:visited,.wpnbha.has-text-color .entry-meta a,.wpnbha.has-text-color .entry-title,.wpnbha.has-text-color .entry-title a,.wpnbha.has-text-color .entry-title a:visited,.wpnbha.has-text-color figcaption{color:inherit}.wpnbha.has-text-color .entry-meta span:not(.avatar){opacity:.8}.wpnbha.image-alignbehind .post-has-image{display:flex;align-items:flex-end;position:relative}.wpnbha.image-alignbehind .post-has-image .post-thumbnail{bottom:0;right:0;margin:0;overflow:hidden;position:absolute;left:0;top:0}.wpnbha.image-alignbehind .post-has-image .post-thumbnail img{height:100%;-o-object-fit:cover;object-fit:cover;max-width:1000%;width:100%}.wpnbha.image-alignbehind .post-has-image .post-thumbnail figcaption{bottom:1em;-webkit-box-orient:vertical;color:hsla(0,0%,100%,.9);display:-webkit-box;font-style:italic;right:0;-webkit-line-clamp:1;margin:0;max-height:1.6em;overflow:hidden;padding:0 1em;position:absolute;left:0;text-align:left;text-overflow:ellipsis;z-index:2}.wpnbha.image-alignbehind .post-has-image .post-thumbnail:after{background:rgba(0,0,0,.5);bottom:0;content:"";right:0;position:absolute;left:0;top:0;z-index:1}.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em;position:relative;z-index:2}.wpnbha.image-alignbehind .post-has-image .cat-links a,.wpnbha.image-alignbehind .post-has-image .entry-meta,.wpnbha.image-alignbehind .post-has-image .entry-meta .byline a,.wpnbha.image-alignbehind .post-has-image .entry-title a,.wpnbha.image-alignbehind .post-has-image .entry-wrapper{color:#fff}.wpnbha article .entry-title{font-size:1.2em}.wpnbha article .entry-meta{font-size:.8em}.wpnbha article .avatar{height:25px;width:25px}@media only screen and (min-width:782px){.wpnbha article .entry-title{font-size:1.6em}.wpnbha article .avatar{height:40px;width:40px}}.wpnbha.ts-8 .entry-title,.wpnbha.ts-9 .entry-title,.wpnbha.ts-10 .entry-title{line-height:1.1em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .avatar,.wpnbha.ts-9 article .avatar,.wpnbha.ts-10 article .avatar{height:2.4em;width:2.4em}}.wpnbha.ts-10 article .entry-title{font-size:2.6em}@media only screen and (min-width:782px){.wpnbha.ts-10 article .entry-title{font-size:3.6em}}@media only screen and (min-width:1168px){.wpnbha.ts-10 article .entry-title{font-size:4.8em}}.wpnbha.ts-9 article .entry-title{font-size:2.4em}@media only screen and (min-width:782px){.wpnbha.ts-9 article .entry-title{font-size:3.4em}}@media only screen and (min-width:1168px){.wpnbha.ts-9 article .entry-title{font-size:4.2em}}.wpnbha.ts-8 article .entry-title{font-size:2.2em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .entry-title{font-size:3em}}@media only screen and (min-width:1168px){.wpnbha.ts-8 article .entry-title{font-size:3.6em}}.wpnbha.ts-7 article .entry-title{font-size:2em}@media only screen and (min-width:782px){.wpnbha.ts-7 article .entry-title{font-size:2.4em}.wpnbha.ts-7 article .avatar{height:48px;width:48px}}@media only screen and (min-width:1168px){.wpnbha.ts-7 article .entry-title{font-size:3em}}.wpnbha.ts-6 article .entry-title{font-size:1.7em}@media only screen and (min-width:782px){.wpnbha.ts-6 article .entry-title{font-size:2em}.wpnbha.ts-6 article .avatar{height:44px;width:44px}}@media only screen and (min-width:1168px){.wpnbha.ts-6 article .entry-title{font-size:2.4em}}.wpnbha.ts-5 article .entry-title{font-size:1.4em}@media only screen and (min-width:782px){.wpnbha.ts-5 article .entry-title{font-size:1.8em}.wpnbha.ts-5 article .avatar{height:40px;width:40px}}@media only screen and (min-width:1168px){.wpnbha.ts-5 article .entry-title{font-size:2em}}.wpnbha.ts-3 article .entry-title{font-size:1em}.wpnbha.ts-3 article .entry-wrapper p{font-size:.8em}.wpnbha.ts-3 article .entry-meta{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-3 article .entry-title{font-size:1.2em}.wpnbha.ts-3 article .avatar{height:32px;width:32px}}.wpnbha.ts-2 article .entry-title{font-size:.8em}.wpnbha.ts-2 article .entry-meta,.wpnbha.ts-2 article .entry-wrapper p{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-2 article .entry-title{font-size:.9em}.wpnbha.ts-2 article .avatar{height:28px;width:28px}}.wpnbha.ts-1 article .entry-title,.wpnbha.ts-1 article .entry-wrapper p{font-size:.7em}.wpnbha.ts-1 article .entry-meta{font-size:.6em}@media only screen and (min-width:782px){.wpnbha.ts-1 article .avatar{height:24px;width:24px}}.wpnbha.is-style-borders article{border:solid rgba(0,0,0,.2);border-width:0 0 1px;margin-bottom:1em;padding-bottom:1em}.wpnbha.is-style-borders article:last-of-type{margin-bottom:0}.wpnbha.is-style-borders article:last-of-type:not(:first-of-type){border-bottom:0}@media only screen and (min-width:782px){.wpnbha.is-style-borders.columns-2 article{padding-left:32px}.wpnbha.is-style-borders.columns-3 article{padding-left:24px}.wpnbha.is-style-borders.columns-4 article{padding-left:21.33333px}.wpnbha.is-style-borders.columns-5 article{padding-left:20px}.wpnbha.is-style-borders.columns-6 article{padding-left:19.2px}.wpnbha.is-style-borders.is-grid article{border-width:0 0 0 1px}.wpnbha.is-style-borders.columns-1 article,.wpnbha.is-style-borders.columns-2 article:nth-of-type(2n),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n),.wpnbha.is-style-borders.columns-4 article:nth-of-type(4n),.wpnbha.is-style-borders.columns-5 article:nth-of-type(5n),.wpnbha.is-style-borders.columns-6 article:nth-of-type(6n),.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}
1
+ .wpnbha{margin-bottom:1em}.wpnbha article{margin-bottom:1.5em;word-break:break-word;overflow-wrap:break-word;position:relative}.wpnbha article:last-of-type{margin-bottom:0}.wpnbha .article-section-title{font-size:.8em;margin-bottom:.5em;width:100%}.wpnbha.is-grid>div{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0;list-style:none}.wpnbha.is-grid article{flex-basis:100%}@media only screen and (min-width:782px){.wpnbha.is-grid article,.wpnbha.is-grid article:last-child{margin-bottom:1em}}@media only screen and (min-width:600px){.wpnbha.columns-3 article,.wpnbha.columns-6 article{flex-basis:calc(33.333% - 16px)}.wpnbha.columns-2 article,.wpnbha.columns-4 article,.wpnbha.columns-5 article{flex-basis:calc(50% - 16px)}.wpnbha.columns-5 article:last-of-type{flex-basis:100%}}@media only screen and (min-width:782px){.wpnbha.columns-2 article,.wpnbha.columns-2 article:last-of-type{flex-basis:calc(50% - 16px)}.wpnbha.columns-3 article,.wpnbha.columns-3 article:last-of-type{flex-basis:calc(33.33333% - 16px)}.wpnbha.columns-4 article,.wpnbha.columns-4 article:last-of-type{flex-basis:calc(25% - 16px)}.wpnbha.columns-5 article,.wpnbha.columns-5 article:last-of-type{flex-basis:calc(20% - 16px)}.wpnbha.columns-6 article,.wpnbha.columns-6 article:last-of-type{flex-basis:calc(16.66667% - 16px)}}.wpnbha .post-thumbnail{margin:0 0 .25em}.wpnbha .post-thumbnail img{height:auto;width:100%}.wpnbha .post-thumbnail figcaption{margin-bottom:.5em}.wpnbha figcaption{font-size:.6em}.wpnbha.image-alignleft .post-has-image,.wpnbha.image-alignright .post-has-image{display:flex}.wpnbha.image-alignleft .post-has-image .post-thumbnail,.wpnbha.image-alignright .post-has-image .post-thumbnail{flex-basis:33%}.wpnbha.image-alignleft .post-has-image .entry-wrapper,.wpnbha.image-alignright .post-has-image .entry-wrapper{flex-basis:67%}.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:block}@media only screen and (min-width:600px){.wpnbha.image-alignleft.mobile-stack .post-has-image,.wpnbha.image-alignright.mobile-stack .post-has-image{display:flex}}@media only screen and (min-width:600px){.wpnbha.image-alignleft.is-4 .post-thumbnail,.wpnbha.image-alignright.is-4 .post-thumbnail{flex-basis:75%}.wpnbha.image-alignleft.is-4 .entry-wrapper,.wpnbha.image-alignright.is-4 .entry-wrapper{flex-basis:25%}.wpnbha.image-alignleft.is-3 .entry-wrapper,.wpnbha.image-alignleft.is-3 .post-thumbnail,.wpnbha.image-alignright.is-3 .entry-wrapper,.wpnbha.image-alignright.is-3 .post-thumbnail{flex-basis:50%}}.wpnbha.image-alignleft.is-1 .post-thumbnail,.wpnbha.image-alignright.is-1 .post-thumbnail{flex-basis:25%}.wpnbha.image-alignleft.is-1 .entry-wrapper,.wpnbha.image-alignright.is-1 .entry-wrapper{flex-basis:75%}.wpnbha.image-alignleft .post-thumbnail{margin-left:1em}.wpnbha.image-alignright .post-thumbnail{margin-right:1em}.wpnbha.image-alignright .entry-wrapper{order:-1}.wpnbha.mobile-stack.image-alignleft .post-thumbnail,.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-right:0;margin-left:0}@media only screen and (min-width:600px){.wpnbha.mobile-stack.image-alignleft .post-thumbnail{margin-left:1em}.wpnbha.mobile-stack.image-alignright .post-thumbnail{margin-right:1em}}.wpnbha .entry-title{margin:0 0 .25em}.wpnbha .entry-title a{color:inherit;text-decoration:none}.wpnbha .cat-links{font-size:.6em;font-weight:700;margin:0 0 .5em}.wpnbha .cat-links a{text-decoration:none}.wpnbha .cat-links a:hover{text-decoration:underline}.wpnbha .entry-meta{display:flex;flex-wrap:wrap;align-items:center;margin-top:.5em}.wpnbha .entry-meta .byline:not(:last-child){margin-left:1.5em}.wpnbha .entry-meta .updated:not(.published){display:none}.wpnbha .avatar{border-radius:100%;display:block;margin-left:.5em}.wpnbha p{margin:.5em 0}.wpnbha.has-text-color .article-section-title,.wpnbha.has-text-color .cat-links,.wpnbha.has-text-color .cat-links a,.wpnbha.has-text-color .cat-links a:visited,.wpnbha.has-text-color .entry-meta,.wpnbha.has-text-color .entry-meta .byline a,.wpnbha.has-text-color .entry-meta .byline a:visited,.wpnbha.has-text-color .entry-meta a,.wpnbha.has-text-color .entry-title,.wpnbha.has-text-color .entry-title a,.wpnbha.has-text-color .entry-title a:visited,.wpnbha.has-text-color figcaption{color:inherit}.wpnbha.has-text-color .entry-meta span:not(.avatar){opacity:.8}.wpnbha.image-alignbehind .post-has-image{display:flex;align-items:flex-end;position:relative}.wpnbha.image-alignbehind .post-has-image .post-thumbnail{bottom:0;right:0;margin:0;overflow:hidden;position:absolute;left:0;top:0}.wpnbha.image-alignbehind .post-has-image .post-thumbnail img{height:100%;-o-object-fit:cover;object-fit:cover;max-width:1000%;width:100%}.wpnbha.image-alignbehind .post-has-image .post-thumbnail figcaption{bottom:1em;-webkit-box-orient:vertical;color:hsla(0,0%,100%,.9);display:-webkit-box;font-style:italic;right:0;-webkit-line-clamp:1;margin:0;max-height:1.6em;overflow:hidden;padding:0 1em;position:absolute;left:0;text-align:left;text-overflow:ellipsis;z-index:2}.wpnbha.image-alignbehind .post-has-image .post-thumbnail:after{background:rgba(0,0,0,.5);bottom:0;content:"";right:0;position:absolute;left:0;top:0;z-index:1}.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em 1em;position:relative;z-index:2}@media only screen and (min-width:1168px){.wpnbha.image-alignbehind .post-has-image .entry-wrapper{padding:2em 1.5em}}.wpnbha.image-alignbehind .post-has-image .cat-links a,.wpnbha.image-alignbehind .post-has-image .entry-meta,.wpnbha.image-alignbehind .post-has-image .entry-meta .byline a,.wpnbha.image-alignbehind .post-has-image .entry-title a,.wpnbha.image-alignbehind .post-has-image .entry-wrapper{color:#fff}.wpnbha .error,.wpnbha .loading,.wpnbha button{display:none}.wpnbha button{margin-top:1em}.wpnbha.has-more-button button{display:block}.wpnbha.has-more-button.is-loading button{display:none}.wpnbha.has-more-button.is-error .error,.wpnbha.has-more-button.is-error button,.wpnbha.has-more-button.is-loading .loading{display:block}.wpnbha article .entry-title{font-size:1.2em}.wpnbha article .entry-meta{font-size:.8em}.wpnbha article .avatar{height:25px;width:25px}@media only screen and (min-width:782px){.wpnbha article .entry-title{font-size:1.6em}.wpnbha article .avatar{height:40px;width:40px}}.wpnbha.ts-8 .entry-title,.wpnbha.ts-9 .entry-title,.wpnbha.ts-10 .entry-title{line-height:1.1em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .avatar,.wpnbha.ts-9 article .avatar,.wpnbha.ts-10 article .avatar{height:2.4em;width:2.4em}}.wpnbha.ts-7 .newspack-post-subtitle,.wpnbha.ts-8 .newspack-post-subtitle,.wpnbha.ts-9 .newspack-post-subtitle,.wpnbha.ts-10 .newspack-post-subtitle{font-size:1.4em}.wpnbha.ts-10 article .entry-title{font-size:2.6em}@media only screen and (min-width:782px){.wpnbha.ts-10 article .entry-title{font-size:3.6em}}@media only screen and (min-width:1168px){.wpnbha.ts-10 article .entry-title{font-size:4.8em}}.wpnbha.ts-9 article .entry-title{font-size:2.4em}@media only screen and (min-width:782px){.wpnbha.ts-9 article .entry-title{font-size:3.4em}}@media only screen and (min-width:1168px){.wpnbha.ts-9 article .entry-title{font-size:4.2em}}.wpnbha.ts-8 article .entry-title{font-size:2.2em}@media only screen and (min-width:782px){.wpnbha.ts-8 article .entry-title{font-size:3em}}@media only screen and (min-width:1168px){.wpnbha.ts-8 article .entry-title{font-size:3.6em}}.wpnbha.ts-7 article .entry-title{font-size:2em}@media only screen and (min-width:782px){.wpnbha.ts-7 article .entry-title{font-size:2.4em}.wpnbha.ts-7 article .avatar{height:48px;width:48px}}@media only screen and (min-width:1168px){.wpnbha.ts-7 article .entry-title{font-size:3em}}.wpnbha.ts-6 article .entry-title{font-size:1.7em}.wpnbha.ts-6 article .newspack-post-subtitle{font-size:1.4em}@media only screen and (min-width:782px){.wpnbha.ts-6 article .entry-title{font-size:2em}.wpnbha.ts-6 article .avatar{height:44px;width:44px}}@media only screen and (min-width:1168px){.wpnbha.ts-6 article .entry-title{font-size:2.4em}}.wpnbha.ts-5 article .entry-title{font-size:1.4em}.wpnbha.ts-5 article .newspack-post-subtitle{font-size:1.2em}@media only screen and (min-width:782px){.wpnbha.ts-5 article .entry-title{font-size:1.8em}.wpnbha.ts-5 article .avatar{height:40px;width:40px}}@media only screen and (min-width:1168px){.wpnbha.ts-5 article .entry-title{font-size:2em}}.wpnbha.ts-3 article .entry-title{font-size:1em}.wpnbha.ts-3 article .entry-wrapper p,.wpnbha.ts-3 article .newspack-post-subtitle{font-size:.8em}.wpnbha.ts-3 article .entry-meta{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-3 article .entry-title{font-size:1.2em}.wpnbha.ts-3 article .avatar{height:32px;width:32px}}.wpnbha.ts-2 article .entry-title{font-size:.8em}.wpnbha.ts-2 article .entry-meta,.wpnbha.ts-2 article .entry-wrapper p,.wpnbha.ts-2 article .newspack-post-subtitle{font-size:.7em}@media only screen and (min-width:782px){.wpnbha.ts-2 article .entry-title{font-size:.9em}.wpnbha.ts-2 article .avatar{height:28px;width:28px}}.wpnbha.ts-1 article .entry-title,.wpnbha.ts-1 article .entry-wrapper p,.wpnbha.ts-1 article .newspack-post-subtitle{font-size:.7em}.wpnbha.ts-1 article .entry-meta{font-size:.6em}@media only screen and (min-width:782px){.wpnbha.ts-1 article .avatar{height:24px;width:24px}}.wpnbha.is-style-borders article{border:solid rgba(0,0,0,.2);border-width:0 0 1px;margin-bottom:1em;padding-bottom:1em}.wpnbha.is-style-borders article:last-of-type{margin-bottom:0}.wpnbha.is-style-borders article:last-of-type:not(:first-of-type){border-bottom:0}@media only screen and (min-width:600px){.wpnbha.is-style-borders.columns-2 article{padding-left:32px}.wpnbha.is-style-borders.columns-3 article{padding-left:24px}.wpnbha.is-style-borders.columns-4 article{padding-left:21.33333px}.wpnbha.is-style-borders.columns-5 article{padding-left:20px}.wpnbha.is-style-borders.columns-6 article{padding-left:19.2px}.wpnbha.is-style-borders.columns-2 article,.wpnbha.is-style-borders.columns-4 article,.wpnbha.is-style-borders.columns-5 article{border-width:0}.wpnbha.is-style-borders.columns-2 article:nth-of-type(odd),.wpnbha.is-style-borders.columns-4 article:nth-of-type(odd),.wpnbha.is-style-borders.columns-5 article:nth-of-type(odd){border-width:0 0 0 1px}.wpnbha.is-style-borders.columns-3 article,.wpnbha.is-style-borders.columns-6 article{border-width:0}.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n+1),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n+2),.wpnbha.is-style-borders.columns-6 article:nth-of-type(3n+1),.wpnbha.is-style-borders.columns-6 article:nth-of-type(3n+2){border-width:0 0 0 1px}.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}@media only screen and (min-width:782px){.wpnbha.is-style-borders.is-grid article{border-width:0 0 0 1px}.wpnbha.is-style-borders.columns-1 article,.wpnbha.is-style-borders.columns-2 article:nth-of-type(2n),.wpnbha.is-style-borders.columns-3 article:nth-of-type(3n),.wpnbha.is-style-borders.columns-4 article:nth-of-type(4n),.wpnbha.is-style-borders.columns-5 article:nth-of-type(5n),.wpnbha.is-style-borders.columns-6 article:nth-of-type(6n),.wpnbha.is-style-borders.is-grid article:last-of-type{border:0}}.newspack-post-subtitle--in-homepage-block{margin-top:.3em;margin-bottom:0;line-height:1.4em;font-style:italic}amp-script .wpnbha.has-more-button.is-loading button{display:none}amp-script .wpnbha.has-more-button.is-error .error,amp-script .wpnbha.has-more-button.is-error button,amp-script .wpnbha.has-more-button.is-loading .loading{display:block}
blog-posts-block/editor.js CHANGED
@@ -11,6 +11,7 @@ import { addFilter } from '@wordpress/hooks';
11
* NHA dependencies
12
*/
13
import { settings } from './newspack-homepage-articles/blocks/homepage-articles/index';
14
15
/**
16
* Block name in the A8C\FSE context.
@@ -36,3 +37,5 @@ registerBlockType( blockName, {
36
multiple: false,
37
},
38
} );
11
* NHA dependencies
12
*/
13
import { settings } from './newspack-homepage-articles/blocks/homepage-articles/index';
14
+ import { registerQueryStore } from './newspack-homepage-articles/blocks/homepage-articles/store';
15
16
/**
17
* Block name in the A8C\FSE context.
37
multiple: false,
38
},
39
} );
40
+
41
+ registerQueryStore();
blog-posts-block/index.php CHANGED
@@ -9,7 +9,7 @@ namespace A8C\FSE;
9
10
define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
11
define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
12
- define( 'NEWSPACK_BLOCKS__VERSION', '1.0.0-alpha.20' );
13
14
/**
15
* Filters block name.
9
10
define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
11
define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
12
+ define( 'NEWSPACK_BLOCKS__VERSION', '1.0.0-alpha.26' );
13
14
/**
15
* Filters block name.
blog-posts-block/newspack-homepage-articles/README.md CHANGED
@@ -1,5 +1,5 @@
1
# Newspack Homepage Articles
2
3
- This folder is synchronized from [Newspack Blocks repository](https://github.com/automattic/newspack-blocks) where the original code lives.
4
5
- Please don't make any changes to these files directly but rather open a PR in the original repository and once landed there, use the sync script.
1
# Newspack Homepage Articles
2
3
+ This folder is synchronized from [Newspack Blocks repository](https://github.com/automattic/newspack-blocks) where the original code lives.
4
5
+ Please don't make any changes to these files directly but rather open a PR in the original repository and once landed there, use the sync script.
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/block.json CHANGED
@@ -122,6 +122,10 @@
122
"singleMode": {
123
"type": "boolean",
124
"default": false
125
}
126
}
127
}
122
"singleMode": {
123
"type": "boolean",
124
"default": false
125
+ },
126
+ "showSubtitle": {
127
+ "type": "boolean",
128
+ "default": false
129
}
130
}
131
}
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php CHANGED
@@ -36,14 +36,14 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
36
register_rest_route(
37
$this->namespace,
38
'/' . $this->rest_base,
39
- array(
40
- array(
41
'methods' => WP_REST_Server::READABLE,
42
- 'callback' => array( $this, 'get_items' ),
43
'args' => $this->get_attribute_schema(),
44
'permission_callback' => '__return_true',
45
- ),
46
- )
47
);
48
}
49
@@ -55,10 +55,10 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
55
*/
56
public function get_items( $request ) {
57
$page = $request->get_param( 'page' ) ?? 1;
58
- $exclude_ids = $request->get_param( 'exclude_ids' ) ?? array();
59
$next_page = $page + 1;
60
$attributes = wp_parse_args(
61
- $request->get_params() ?? array(),
62
wp_list_pluck( $this->get_attribute_schema(), 'default' )
63
);
64
@@ -66,27 +66,34 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
66
67
$query = array_merge(
68
$article_query_args,
69
- array(
70
'post__not_in' => $exclude_ids,
71
- )
72
);
73
74
// Run Query.
75
$article_query = new WP_Query( $query );
76
77
// Defaults.
78
- $items = array();
79
$next_url = '';
80
81
// The Loop.
82
while ( $article_query->have_posts() ) {
83
$article_query->the_post();
84
- $items[]['html'] = Newspack_Blocks::template_inc(
85
__DIR__ . '/templates/article.php',
86
- array(
87
'attributes' => $attributes,
88
- )
89
);
90
}
91
92
// Provide next URL if there are more pages.
@@ -95,21 +102,26 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
95
array_merge(
96
array_map(
97
function( $attribute ) {
98
- return false === $attribute ? '0' : $attribute;
99
},
100
$attributes
101
),
102
- array( 'page' => $next_page ) // phpcs:ignore PHPCompatibility.Syntax.NewShortArray.Found
103
),
104
rest_url( '/newspack-blocks/v1/articles' )
105
);
106
}
107
108
return rest_ensure_response(
109
- array(
110
'items' => $items,
111
'next' => $next_url,
112
- )
113
);
114
}
115
@@ -127,17 +139,40 @@ class WP_REST_Newspack_Articles_Controller extends WP_REST_Controller {
127
128
$this->attribute_schema = array_merge(
129
$block_json['attributes'],
130
- array(
131
- 'exclude_ids' => array(
132
'type' => 'array',
133
- 'default' => array(),
134
- 'items' => array(
135
'type' => 'integer',
136
- ),
137
- ),
138
- )
139
);
140
}
141
return $this->attribute_schema;
142
}
143
}
36
register_rest_route(
37
$this->namespace,
38
'/' . $this->rest_base,
39
+ [
40
+ [
41
'methods' => WP_REST_Server::READABLE,
42
+ 'callback' => [ $this, 'get_items' ],
43
'args' => $this->get_attribute_schema(),
44
'permission_callback' => '__return_true',
45
+ ],
46
+ ]
47
);
48
}
49
55
*/
56
public function get_items( $request ) {
57
$page = $request->get_param( 'page' ) ?? 1;
58
+ $exclude_ids = $request->get_param( 'exclude_ids' ) ?? [];
59
$next_page = $page + 1;
60
$attributes = wp_parse_args(
61
+ $request->get_params() ?? [],
62
wp_list_pluck( $this->get_attribute_schema(), 'default' )
63
);
64
66
67
$query = array_merge(
68
$article_query_args,
69
+ [
70
'post__not_in' => $exclude_ids,
71
+ ]
72
);
73
74
// Run Query.
75
$article_query = new WP_Query( $query );
76
77
// Defaults.
78
+ $items = [];
79
+ $ids = [];
80
$next_url = '';
81
82
// The Loop.
83
while ( $article_query->have_posts() ) {
84
$article_query->the_post();
85
+ $html = Newspack_Blocks::template_inc(
86
__DIR__ . '/templates/article.php',
87
+ [
88
'attributes' => $attributes,
89
+ ]
90
);
91
+
92
+ if ( $request->get_param( 'amp' ) ) {
93
+ $html = $this->generate_amp_partial( $html );
94
+ }
95
+ $items[]['html'] = $html;
96
+ $ids[] = get_the_ID();
97
}
98
99
// Provide next URL if there are more pages.
102
array_merge(
103
array_map(
104
function( $attribute ) {
105
+ return false === $attribute ? '0' : str_replace( '#', '%23', $attribute );
106
},
107
$attributes
108
),
109
+ [
110
+ 'exclude_ids' => false,
111
+ 'page' => $next_page,
112
+ 'amp' => $request->get_param( 'amp' ),
113
+ ]
114
),
115
rest_url( '/newspack-blocks/v1/articles' )
116
);
117
}
118
119
return rest_ensure_response(
120
+ [
121
'items' => $items,
122
+ 'ids' => $ids,
123
'next' => $next_url,
124
+ ]
125
);
126
}
127
139
140
$this->attribute_schema = array_merge(
141
$block_json['attributes'],
142
+ [
143
+ 'exclude_ids' => [
144
'type' => 'array',
145
+ 'default' => [],
146
+ 'items' => [
147
'type' => 'integer',
148
+ ],
149
+ ],
150
+ ]
151
);
152
}
153
return $this->attribute_schema;
154
}
155
+
156
+ /**
157
+ * Use AMP Plugin functions to render markup as valid AMP.
158
+ *
159
+ * @param string $html Markup to convert to AMP.
160
+ * @return string
161
+ */
162
+ public function generate_amp_partial( $html ) {
163
+ $dom = AMP_DOM_Utils::get_dom_from_content( $html );
164
+
165
+ AMP_Content_Sanitizer::sanitize_document(
166
+ $dom,
167
+ amp_get_content_sanitizers(),
168
+ [
169
+ 'use_document_element' => false,
170
+ ]
171
+ );
172
+ $xpath = new DOMXPath( $dom );
173
+ foreach ( iterator_to_array( $xpath->query( '//noscript | //comment()' ) ) as $node ) {
174
+ $node->parentNode->removeChild( $node ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
175
+ }
176
+ return AMP_DOM_Utils::get_content_from_dom( $dom );
177
+ }
178
}
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/edit.js CHANGED
@@ -1,19 +1,22 @@
1
/**
2
* Internal dependencies
3
*/
4
import QueryControls from '../../components/query-controls';
5
6
/**
7
* External dependencies
8
*/
9
import classNames from 'classnames';
10
- import { isUndefined, pickBy } from 'lodash';
11
- import moment from 'moment';
12
13
/**
14
* WordPress dependencies
15
*/
16
- import { __ } from '@wordpress/i18n';
17
import { Component, Fragment, RawHTML } from '@wordpress/element';
18
import {
19
BlockControls,
@@ -30,22 +33,24 @@ import {
30
RangeControl,
31
Toolbar,
32
ToggleControl,
33
- Dashicon,
34
Placeholder,
35
Spinner,
36
BaseControl,
37
Path,
38
SVG,
39
} from '@wordpress/components';
40
- import { withSelect } from '@wordpress/data';
41
import { compose } from '@wordpress/compose';
42
- import { addQueryArgs } from '@wordpress/url';
43
import { decodeEntities } from '@wordpress/html-entities';
44
45
- /**
46
- * Module Constants
47
- */
48
- const MAX_POSTS_COLUMNS = 6;
49
50
/* From https://material.io/tools/icons */
51
const landscapeIcon = (
@@ -93,6 +98,7 @@ class Edit extends Component {
93
minHeight,
94
showCaption,
95
showExcerpt,
96
showAuthor,
97
showAvatar,
98
showDate,
@@ -113,8 +119,8 @@ class Edit extends Component {
113
minHeight / 5 + 'vh',
114
};
115
116
- const authorNumber = post.newspack_author_info.length;
117
const postTitle = this.titleForPost( post );
118
return (
119
<article
120
className={ post.newspack_featured_image_src ? 'post-has-image' : null }
@@ -125,15 +131,16 @@ class Edit extends Component {
125
<figure className="post-thumbnail" key="thumbnail">
126
<a href="#">
127
{ imageShape === 'landscape' && (
128
- <img src={ post.newspack_featured_image_src.landscape } />
129
) }
130
{ imageShape === 'portrait' && (
131
- <img src={ post.newspack_featured_image_src.portrait } />
132
) }
133
- { imageShape === 'square' && <img src={ post.newspack_featured_image_src.square } /> }
134
-
135
{ imageShape === 'uncropped' && (
136
- <img src={ post.newspack_featured_image_src.uncropped } />
137
) }
138
</a>
139
{ showCaption && '' !== post.newspack_featured_image_caption && (
@@ -157,6 +164,14 @@ class Edit extends Component {
157
<a href="#">{ postTitle }</a>
158
</h3>
159
) }
160
{ showExcerpt && (
161
<RawHTML key="excerpt" className="excerpt-contain">
162
{ post.excerpt.rendered }
@@ -167,9 +182,7 @@ class Edit extends Component {
167
{ showAuthor && this.formatByline( post.newspack_author_info ) }
168
{ showDate && (
169
<time className="entry-date published" key="pub-date">
170
- { moment( post.date_gmt )
171
- .local()
172
- .format( 'MMMM DD, Y' ) }
173
</time>
174
) }
175
</div>
@@ -201,7 +214,7 @@ class Edit extends Component {
201
202
formatByline = authorInfo => (
203
<span className="byline">
204
- { __( 'by', 'newspack-blocks' ) }{ ' ' }
205
{ authorInfo.reduce( ( accumulator, author, index ) => {
206
return [
207
...accumulator,
@@ -213,29 +226,20 @@ class Edit extends Component {
213
index < authorInfo.length - 2 && ', ',
214
authorInfo.length > 1 &&
215
index === authorInfo.length - 2 &&
216
- __( ' and ', 'newspack-blocks' ),
217
];
218
}, [] ) }
219
</span>
220
);
221
222
renderInspectorControls = () => {
223
- const {
224
- attributes,
225
- setAttributes,
226
- latestPosts,
227
- isSelected,
228
- textColor,
229
- setTextColor,
230
- } = this.props;
231
- const hasPosts = Array.isArray( latestPosts ) && latestPosts.length;
232
233
const {
234
authors,
235
specificPosts,
236
postsToShow,
237
categories,
238
- sectionHeader,
239
columns,
240
showImage,
241
showCaption,
@@ -243,8 +247,8 @@ class Edit extends Component {
243
mobileStack,
244
minHeight,
245
moreButton,
246
- moreButtonText,
247
showExcerpt,
248
typeScale,
249
showDate,
250
showAuthor,
@@ -255,7 +259,6 @@ class Edit extends Component {
255
specificMode,
256
tags,
257
tagExclusions,
258
- url,
259
} = attributes;
260
261
const imageSizeOptions = [
@@ -293,39 +296,53 @@ class Edit extends Component {
293
{ postsToShow && (
294
<QueryControls
295
numberOfItems={ postsToShow }
296
- onNumberOfItemsChange={ value => setAttributes( { postsToShow: value } ) }
297
specificMode={ specificMode }
298
- onSpecificModeChange={ value => setAttributes( { specificMode: value } ) }
299
specificPosts={ specificPosts }
300
- onSpecificPostsChange={ value => setAttributes( { specificPosts: value } ) }
301
authors={ authors }
302
- onAuthorsChange={ value => setAttributes( { authors: value } ) }
303
categories={ categories }
304
- onCategoriesChange={ value => setAttributes( { categories: value } ) }
305
tags={ tags }
306
- onTagsChange={ value => setAttributes( { tags: value } ) }
307
tagExclusions={ tagExclusions }
308
- onTagExclusionsChange={ value => setAttributes( { tagExclusions: value } ) }
309
/>
310
) }
311
{ postLayout === 'grid' && (
312
<RangeControl
313
label={ __( 'Columns', 'newspack-blocks' ) }
314
value={ columns }
315
- onChange={ value => setAttributes( { columns: value } ) }
316
min={ 2 }
317
- max={
318
- ! hasPosts ? MAX_POSTS_COLUMNS : Math.min( MAX_POSTS_COLUMNS, latestPosts.length )
319
- }
320
required
321
/>
322
) }
323
- { ! specificMode && (
324
<ToggleControl
325
label={ __( 'Show "More" Button', 'newspack-blocks' ) }
326
checked={ moreButton }
327
onChange={ () => setAttributes( { moreButton: ! moreButton } ) }
328
- help={ __( 'Only available for non-AMP requests.', 'newspack-blocks' ) }
329
/>
330
) }
331
</PanelBody>
@@ -357,9 +374,15 @@ class Edit extends Component {
357
onChange={ () => setAttributes( { mobileStack: ! mobileStack } ) }
358
/>
359
</PanelRow>
360
- <BaseControl label={ __( 'Featured Image Size', 'newspack-blocks' ) }>
361
<PanelRow>
362
- <ButtonGroup aria-label={ __( 'Featured Image Size', 'newspack-blocks' ) }>
363
{ imageSizeOptions.map( option => {
364
const isCurrent = imageScale === option.value;
365
return (
@@ -389,7 +412,7 @@ class Edit extends Component {
389
'newspack-blocks'
390
) }
391
value={ minHeight }
392
- onChange={ value => setAttributes( { minHeight: value } ) }
393
min={ 0 }
394
max={ 100 }
395
required
@@ -397,6 +420,15 @@ class Edit extends Component {
397
) }
398
</PanelBody>
399
<PanelBody title={ __( 'Post Control Settings', 'newspack-blocks' ) }>
400
<PanelRow>
401
<ToggleControl
402
label={ __( 'Show Excerpt', 'newspack-blocks' ) }
@@ -408,7 +440,7 @@ class Edit extends Component {
408
className="type-scale-slider"
409
label={ __( 'Type Scale', 'newspack-blocks' ) }
410
value={ typeScale }
411
- onChange={ value => setAttributes( { typeScale: value } ) }
412
min={ 1 }
413
max={ 10 }
414
beforeIcon="editor-textcolor"
@@ -467,29 +499,26 @@ class Edit extends Component {
467
/**
468
* Constants
469
*/
470
const {
471
attributes,
472
className,
473
setAttributes,
474
isSelected,
475
latestPosts,
476
- hasPosts,
477
textColor,
478
- } = this.props; // variables getting pulled out of props
479
const {
480
- showExcerpt,
481
- showDate,
482
showImage,
483
imageShape,
484
- showAuthor,
485
- showAvatar,
486
- postsToShow,
487
postLayout,
488
mediaPosition,
489
moreButton,
490
moreButtonText,
491
columns,
492
- categories,
493
typeScale,
494
imageScale,
495
mobileStack,
@@ -583,6 +612,7 @@ class Edit extends Component {
583
},
584
];
585
586
return (
587
<Fragment>
588
<div
@@ -605,16 +635,18 @@ class Edit extends Component {
605
<Placeholder>{ __( 'Sorry, no posts were found.', 'newspack-blocks' ) }</Placeholder>
606
) }
607
{ ! latestPosts && (
608
- <Placeholder>
609
- <Spinner />
610
- </Placeholder>
611
) }
612
{ latestPosts && latestPosts.map( post => this.renderPost( post ) ) }
613
</div>
614
</div>
615
616
- { ! specificMode && latestPosts && moreButton && (
617
- <div className="editor-styles-wrapper">
618
<div className="wp-block-button">
619
<RichText
620
placeholder={ __( 'Load more posts', 'newspack-blocks' ) }
@@ -642,36 +674,26 @@ class Edit extends Component {
642
export default compose( [
643
withColors( { textColor: 'color' } ),
644
withSelect( ( select, props ) => {
645
- const {
646
- postsToShow,
647
- authors,
648
- categories,
649
- tags,
650
- tagExclusions,
651
- specificPosts,
652
- specificMode,
653
- } = props.attributes;
654
- const { getAuthors, getEntityRecords } = select( 'core' );
655
- const latestPostsQuery = pickBy(
656
- specificMode && specificPosts && specificPosts.length
657
- ? {
658
- include: specificPosts,
659
- orderby: 'include',
660
- }
661
- : {
662
- per_page: postsToShow,
663
- categories,
664
- author: authors,
665
- tags,
666
- tags_exclude: tagExclusions,
667
- },
668
- value => ! isUndefined( value )
669
- );
670
- const postsListQuery = {
671
- per_page: 50,
672
};
673
return {
674
- latestPosts: getEntityRecords( 'postType', 'post', latestPostsQuery ),
675
};
676
} ),
677
] )( Edit );
1
+ /* eslint-disable jsx-a11y/anchor-is-valid */
2
+
3
/**
4
* Internal dependencies
5
*/
6
import QueryControls from '../../components/query-controls';
7
+ import { STORE_NAMESPACE } from './store';
8
+ import { isBlogPrivate, isSpecificPostModeActive, queryCriteriaFromAttributes } from './utils';
9
10
/**
11
* External dependencies
12
*/
13
import classNames from 'classnames';
14
15
/**
16
* WordPress dependencies
17
*/
18
+ import { __, _x } from '@wordpress/i18n';
19
+ import { dateI18n, __experimentalGetSettings } from '@wordpress/date';
20
import { Component, Fragment, RawHTML } from '@wordpress/element';
21
import {
22
BlockControls,
33
RangeControl,
34
Toolbar,
35
ToggleControl,
36
Placeholder,
37
Spinner,
38
BaseControl,
39
Path,
40
SVG,
41
} from '@wordpress/components';
42
+ import { withDispatch, withSelect } from '@wordpress/data';
43
import { compose } from '@wordpress/compose';
44
import { decodeEntities } from '@wordpress/html-entities';
45
46
+ let IS_SUBTITLE_SUPPORTED_IN_THEME;
47
+ if (
48
+ typeof window === 'object' &&
49
+ window.newspackIsPostSubtitleSupported &&
50
+ window.newspackIsPostSubtitleSupported.post_subtitle
51
+ ) {
52
+ IS_SUBTITLE_SUPPORTED_IN_THEME = true;
53
+ }
54
55
/* From https://material.io/tools/icons */
56
const landscapeIcon = (
98
minHeight,
99
showCaption,
100
showExcerpt,
101
+ showSubtitle,
102
showAuthor,
103
showAvatar,
104
showDate,
119
minHeight / 5 + 'vh',
120
};
121
122
const postTitle = this.titleForPost( post );
123
+ const dateFormat = __experimentalGetSettings().formats.date;
124
return (
125
<article
126
className={ post.newspack_featured_image_src ? 'post-has-image' : null }
131
<figure className="post-thumbnail" key="thumbnail">
132
<a href="#">
133
{ imageShape === 'landscape' && (
134
+ <img src={ post.newspack_featured_image_src.landscape } alt="" />
135
) }
136
{ imageShape === 'portrait' && (
137
+ <img src={ post.newspack_featured_image_src.portrait } alt="" />
138
+ ) }
139
+ { imageShape === 'square' && (
140
+ <img src={ post.newspack_featured_image_src.square } alt="" />
141
) }
142
{ imageShape === 'uncropped' && (
143
+ <img src={ post.newspack_featured_image_src.uncropped } alt="" />
144
) }
145
</a>
146
{ showCaption && '' !== post.newspack_featured_image_caption && (
164
<a href="#">{ postTitle }</a>
165
</h3>
166
) }
167
+ { IS_SUBTITLE_SUPPORTED_IN_THEME && showSubtitle && (
168
+ <RawHTML
169
+ key="subtitle"
170
+ className="newspack-post-subtitle newspack-post-subtitle--in-homepage-block"
171
+ >
172
+ { post.meta.newspack_post_subtitle || '' }
173
+ </RawHTML>
174
+ ) }
175
{ showExcerpt && (
176
<RawHTML key="excerpt" className="excerpt-contain">
177
{ post.excerpt.rendered }
182
{ showAuthor && this.formatByline( post.newspack_author_info ) }
183
{ showDate && (
184
<time className="entry-date published" key="pub-date">
185
+ { dateI18n( dateFormat, post.date_gmt ) }
186
</time>
187
) }
188
</div>
214
215
formatByline = authorInfo => (
216
<span className="byline">
217
+ { _x( 'by', 'post author', 'newspack-blocks' ) }{ ' ' }
218
{ authorInfo.reduce( ( accumulator, author, index ) => {
219
return [
220
...accumulator,
226
index < authorInfo.length - 2 && ', ',
227
authorInfo.length > 1 &&
228
index === authorInfo.length - 2 &&
229
+ _x( ' and ', 'post author', 'newspack-blocks' ),
230
];
231
}, [] ) }
232
</span>
233
);
234
235
renderInspectorControls = () => {
236
+ const { attributes, setAttributes, textColor, setTextColor } = this.props;
237
238
const {
239
authors,
240
specificPosts,
241
postsToShow,
242
categories,
243
columns,
244
showImage,
245
showCaption,
247
mobileStack,
248
minHeight,
249
moreButton,
250
showExcerpt,
251
+ showSubtitle,
252
typeScale,
253
showDate,
254
showAuthor,
259
specificMode,
260
tags,
261
tagExclusions,
262
} = attributes;
263
264
const imageSizeOptions = [
296
{ postsToShow && (
297
<QueryControls
298
numberOfItems={ postsToShow }
299
+ onNumberOfItemsChange={ _postsToShow =>
300
+ setAttributes( { postsToShow: _postsToShow } )
301
+ }
302
specificMode={ specificMode }
303
+ onSpecificModeChange={ _specificMode =>
304
+ setAttributes( { specificMode: _specificMode } )
305
+ }
306
specificPosts={ specificPosts }
307
+ onSpecificPostsChange={ _specificPosts =>
308
+ setAttributes( { specificPosts: _specificPosts } )
309
+ }
310
authors={ authors }
311
+ onAuthorsChange={ _authors => setAttributes( { authors: _authors } ) }
312
categories={ categories }
313
+ onCategoriesChange={ _categories => setAttributes( { categories: _categories } ) }
314
tags={ tags }
315
+ onTagsChange={ _tags => {
316
+ setAttributes( { tags: _tags } );
317
+ } }
318
tagExclusions={ tagExclusions }
319
+ onTagExclusionsChange={ _tagExclusions =>
320
+ setAttributes( { tagExclusions: _tagExclusions } )
321
+ }
322
/>
323
) }
324
{ postLayout === 'grid' && (
325
<RangeControl
326
label={ __( 'Columns', 'newspack-blocks' ) }
327
value={ columns }
328
+ onChange={ _columns => setAttributes( { columns: _columns } ) }
329
min={ 2 }
330
+ max={ 6 }
331
required
332
/>
333
) }
334
+ { ! specificMode && ! isBlogPrivate() && (
335
+ /*
336
+ * Hide the "More" button option on private sites.
337
+ *
338
+ * Client-side fetching from a private WP.com blog requires authentication,
339
+ * which is not provided in the current implementation.
340
+ * See https://github.com/Automattic/newspack-blocks/issues/306.
341
+ */
342
<ToggleControl
343
label={ __( 'Show "More" Button', 'newspack-blocks' ) }
344
checked={ moreButton }
345
onChange={ () => setAttributes( { moreButton: ! moreButton } ) }
346
/>
347
) }
348
</PanelBody>
374
onChange={ () => setAttributes( { mobileStack: ! mobileStack } ) }
375
/>
376
</PanelRow>
377
+ <BaseControl
378
+ label={ __( 'Featured Image Size', 'newspack-blocks' ) }
379
+ id="newspackfeatured-image-size"
380
+ >
381
<PanelRow>
382
+ <ButtonGroup
383
+ id="newspackfeatured-image-size"
384
+ aria-label={ __( 'Featured Image Size', 'newspack-blocks' ) }
385
+ >
386
{ imageSizeOptions.map( option => {
387
const isCurrent = imageScale === option.value;
388
return (
412
'newspack-blocks'
413
) }
414
value={ minHeight }
415
+ onChange={ _minHeight => setAttributes( { minHeight: _minHeight } ) }
416
min={ 0 }
417
max={ 100 }
418
required
420
) }
421
</PanelBody>
422
<PanelBody title={ __( 'Post Control Settings', 'newspack-blocks' ) }>
423
+ { IS_SUBTITLE_SUPPORTED_IN_THEME && (
424
+ <PanelRow>
425
+ <ToggleControl
426
+ label={ __( 'Show Subtitle', 'newspack-blocks' ) }
427
+ checked={ showSubtitle }
428
+ onChange={ () => setAttributes( { showSubtitle: ! showSubtitle } ) }
429
+ />
430
+ </PanelRow>
431
+ ) }
432
<PanelRow>
433
<ToggleControl
434
label={ __( 'Show Excerpt', 'newspack-blocks' ) }
440
className="type-scale-slider"
441
label={ __( 'Type Scale', 'newspack-blocks' ) }
442
value={ typeScale }
443
+ onChange={ _typeScale => setAttributes( { typeScale: _typeScale } ) }
444
min={ 1 }
445
max={ 10 }
446
beforeIcon="editor-textcolor"
499
/**
500
* Constants
501
*/
502
+
503
const {
504
attributes,
505
className,
506
+ clientId,
507
setAttributes,
508
isSelected,
509
latestPosts,
510
textColor,
511
+ markPostsAsDisplayed,
512
+ } = this.props;
513
+
514
const {
515
showImage,
516
imageShape,
517
postLayout,
518
mediaPosition,
519
moreButton,
520
moreButtonText,
521
columns,
522
typeScale,
523
imageScale,
524
mobileStack,
612
},
613
];
614
615
+ markPostsAsDisplayed( clientId, latestPosts );
616
return (
617
<Fragment>
618
<div
635
<Placeholder>{ __( 'Sorry, no posts were found.', 'newspack-blocks' ) }</Placeholder>
636
) }
637
{ ! latestPosts && (
638
+ <Placeholder icon={ <Spinner /> } className="component-placeholder__align-center" />
639
) }
640
{ latestPosts && latestPosts.map( post => this.renderPost( post ) ) }
641
</div>
642
</div>
643
644
+ { ! specificMode && latestPosts && moreButton && ! isBlogPrivate() && (
645
+ /*
646
+ * The "More" button option is hidden for private sites, so we should
647
+ * also hide the button in case it was previously enabled.
648
+ */
649
+ <div className="editor-styles-wrapper wpnbha__wp-block-button__wrapper">
650
<div className="wp-block-button">
651
<RichText
652
placeholder={ __( 'Load more posts', 'newspack-blocks' ) }
674
export default compose( [
675
withColors( { textColor: 'color' } ),
676
withSelect( ( select, props ) => {
677
+ const { attributes, clientId } = props;
678
+
679
+ const latestPostsQuery = queryCriteriaFromAttributes( attributes );
680
+ if ( ! isSpecificPostModeActive( attributes ) ) {
681
+ const postIdsToExclude = select( STORE_NAMESPACE ).previousPostIds( clientId );
682
+ latestPostsQuery.exclude = postIdsToExclude.join( ',' );
683
+ }
684
+
685
+ return {
686
+ latestPosts: select( 'core' ).getEntityRecords( 'postType', 'post', latestPostsQuery ),
687
};
688
+ } ),
689
+ withDispatch( ( dispatch, props ) => {
690
+ const { attributes } = props;
691
+ const markPostsAsDisplayed = isSpecificPostModeActive( attributes )
692
+ ? dispatch( STORE_NAMESPACE ).markSpecificPostsAsDisplayed
693
+ : dispatch( STORE_NAMESPACE ).markPostsAsDisplayed;
694
+
695
return {
696
+ markPostsAsDisplayed,
697
};
698
} ),
699
] )( Edit );
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/editor.js CHANGED
@@ -3,5 +3,7 @@
3
*/
4
import { registerBlockType } from '@wordpress/blocks';
5
import { name, settings } from '.';
6
7
registerBlockType( `newspack-blocks/${ name }`, settings );
3
*/
4
import { registerBlockType } from '@wordpress/blocks';
5
import { name, settings } from '.';
6
+ import { registerQueryStore } from './store';
7
8
registerBlockType( `newspack-blocks/${ name }`, settings );
9
+ registerQueryStore();
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/editor.scss CHANGED
@@ -1,4 +1,5 @@
1
- @import "../../shared/sass/variables";
2
3
.type-scale-slider {
4
.dashicon {
@@ -37,3 +38,7 @@
37
margin: 0.5em 0;
38
}
39
}
1
+ @import '../../shared/sass/variables';
2
+ @import '../../shared/sass/placeholder';
3
4
.type-scale-slider {
5
.dashicon {
38
margin: 0.5em 0;
39
}
40
}
41
+
42
+ .editor-styles-wrapper.wpnbha__wp-block-button__wrapper {
43
+ background-color: transparent;
44
+ }
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/store.js ADDED
@@ -0,0 +1,154 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { uniq } from 'lodash';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { registerStore, select, subscribe, dispatch } from '@wordpress/data';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import metadata from './block.json';
15
+
16
+ const { name } = metadata;
17
+ export const STORE_NAMESPACE = name;
18
+ const blockName = `newspack-blocks/${ name }`;
19
+
20
+ const initialState = {
21
+ queryBlocks: [], // list of Query blocks in the order they are on the page
22
+ postsByBlock: {}, // map of returned posts to block clientId
23
+ specificPostsByBlock: {}, // posts displayed by specific-mode, which always return in the selector
24
+ };
25
+
26
+ const UPDATE_BLOCKS = 'UPDATE_BLOCKS';
27
+ const MARK_POSTS_DISPLAYED = 'MARK_POSTS_DISPLAYED';
28
+ const MARK_SPECIFIC_POSTS_DISPLAYED = 'MARK_SPECIFIC_POSTS_DISPLAYED';
29
+
30
+ const actions = {
31
+ updateBlocks( blocks ) {
32
+ return {
33
+ type: UPDATE_BLOCKS,
34
+ blocks,
35
+ };
36
+ },
37
+ markPostsAsDisplayed( clientId, posts ) {
38
+ return {
39
+ type: MARK_POSTS_DISPLAYED,
40
+ clientId,
41
+ posts,
42
+ };
43
+ },
44
+ markSpecificPostsAsDisplayed( clientId, posts ) {
45
+ return {
46
+ type: MARK_SPECIFIC_POSTS_DISPLAYED,
47
+ clientId,
48
+ posts,
49
+ };
50
+ },
51
+ };
52
+
53
+ /**
54
+ * @typedef Block A Gutenberg editor block
55
+ * @type {object}
56
+ * @typedef uuid Unique id
57
+ * @type {string}
58
+ */
59
+
60
+ /**
61
+ * Returns the Query blocks that appear before the current one on the page
62
+ *
63
+ * @param {Block[]} orderedBlocks Ordered Blocks
64
+ * @param {uuid} clientId client id
65
+ * @returns {Block[]} blocks
66
+ */
67
+ const blocksBefore = ( orderedBlocks, clientId ) => {
68
+ const ourBlockIdx = orderedBlocks.findIndex( b => b.clientId === clientId );
69
+ return orderedBlocks.slice( 0, ourBlockIdx );
70
+ };
71
+
72
+ const selectors = {
73
+ previousPostIds( state, _clientId ) {
74
+ const { queryBlocks, specificPostsByBlock, postsByBlock } = state;
75
+
76
+ const postIdsFromSpecificMode = queryBlocks
77
+ .filter( ( { clientId } ) => specificPostsByBlock[ clientId ] )
78
+ .flatMap( ( { clientId } ) => specificPostsByBlock[ clientId ].map( p => p.id ) );
79
+
80
+ const previousPostIds = blocksBefore( queryBlocks, _clientId )
81
+ .filter( ( { clientId } ) => postsByBlock[ clientId ] )
82
+ .flatMap( ( { clientId } ) => postsByBlock[ clientId ].map( p => p.id ) );
83
+
84
+ return uniq( postIdsFromSpecificMode.concat( previousPostIds ) ).sort();
85
+ },
86
+ };
87
+
88
+ /**
89
+ * Returns an array of all newspack-blocks/query blocks in the order they are on
90
+ * the page. This is needed to be able to show the editor blocks in the order
91
+ * that PHP will render them.
92
+ *
93
+ * @param {Block[]} blocks any blocks
94
+ * @returns {Block[]} ordered newspack-blocks/query blocks
95
+ */
96
+ const getQueryBlocksInOrder = blocks =>
97
+ blocks.flatMap( block => {
98
+ const queryBlocks = [];
99
+ if ( block.name === blockName ) {
100
+ queryBlocks.push( block );
101
+ }
102
+ return queryBlocks.concat( getQueryBlocksInOrder( block.innerBlocks ) );
103
+ } );
104
+
105
+ const reducer = ( state = initialState, action ) => {
106
+ switch ( action.type ) {
107
+ case UPDATE_BLOCKS:
108
+ return {
109
+ ...state,
110
+ queryBlocks: getQueryBlocksInOrder( action.blocks ),
111
+ };
112
+ case MARK_POSTS_DISPLAYED:
113
+ return {
114
+ ...state,
115
+ postsByBlock: {
116
+ ...state.postsByBlock,
117
+ [ action.clientId ]: action.posts,
118
+ },
119
+ };
120
+ case MARK_SPECIFIC_POSTS_DISPLAYED:
121
+ return {
122
+ ...state,
123
+ specificPostsByBlock: {
124
+ ...state.specificPostsByBlock,
125
+ [ action.clientId ]: action.posts,
126
+ },
127
+ };
128
+ }
129
+ return state;
130
+ };
131
+
132
+ export const registerQueryStore = () => {
133
+ registerStore( STORE_NAMESPACE, {
134
+ reducer,
135
+ actions,
136
+ selectors,
137
+ initialState,
138
+ } );
139
+
140
+ const { getClientIdsWithDescendants, getBlocks } = select( 'core/block-editor' );
141
+ const { updateBlocks } = dispatch( STORE_NAMESPACE );
142
+
143
+ let currentBlocksIds;
144
+ subscribe( () => {
145
+ const newBlocksIds = getClientIdsWithDescendants();
146
+ // I don't know why != works but it does, I guess getClientIdsWithDescendants is memoized?
147
+ const blocksChanged = newBlocksIds !== currentBlocksIds;
148
+ currentBlocksIds = newBlocksIds;
149
+
150
+ if ( blocksChanged ) {
151
+ updateBlocks( getBlocks() );
152
+ }
153
+ } );
154
+ };
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/templates/article.php CHANGED
@@ -71,11 +71,21 @@ call_user_func(
71
</div>
72
<?php
73
endif;
74
if ( '' === $attributes['sectionHeader'] ) :
75
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
76
else :
77
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
78
endif;
79
if ( $attributes['showExcerpt'] ) :
80
the_excerpt();
81
endif;
71
</div>
72
<?php
73
endif;
74
+
75
if ( '' === $attributes['sectionHeader'] ) :
76
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
77
else :
78
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
79
endif;
80
+ ?>
81
+ <?php
82
+ if ( $attributes['showSubtitle'] ) :
83
+ ?>
84
+ <div class="newspack-post-subtitle newspack-post-subtitle--in-homepage-block">
85
+ <?php echo esc_html( get_post_meta( get_the_ID(), 'newspack_post_subtitle', true ) ); ?>
86
+ </div>
87
+ <?php endif; ?>
88
+ <?php
89
if ( $attributes['showExcerpt'] ) :
90
the_excerpt();
91
endif;
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/utils.js ADDED
@@ -0,0 +1,51 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { isUndefined, pickBy } from 'lodash';
5
+
6
+ /**
7
+ * Based global WP.com blog_public option, checks whether current blog is
8
+ * private or not.
9
+ *
10
+ * @return {boolean} a private WP.com blog flag
11
+ */
12
+ export const isBlogPrivate = () =>
13
+ typeof window === 'object' &&
14
+ window.wpcomGutenberg &&
15
+ Number( window.wpcomGutenberg.blogPublic ) === -1;
16
+
17
+ /**
18
+ * Checks whether the specific post mode is active.
19
+ *
20
+ * @param {Object} attributes block attributes
21
+ * @return {boolean} specific mode active flag
22
+ */
23
+ export const isSpecificPostModeActive = ( { specificMode, specificPosts } ) =>
24
+ specificMode && specificPosts && specificPosts.length;
25
+
26
+ /**
27
+ * Builds query criteria from given attributes.
28
+ *
29
+ * @param {Object} attributes block attributes
30
+ * @return {Object} criteria
31
+ */
32
+ export const queryCriteriaFromAttributes = attributes => {
33
+ const { postsToShow, authors, categories, tags, specificPosts, tagExclusions } = attributes;
34
+ const criteria = pickBy(
35
+ isSpecificPostModeActive( attributes )
36
+ ? {
37
+ include: specificPosts,
38
+ orderby: 'include',
39
+ per_page: specificPosts.length,
40
+ }
41
+ : {
42
+ per_page: postsToShow,
43
+ categories,
44
+ author: authors,
45
+ tags,
46
+ tags_exclude: tagExclusions,
47
+ },
48
+ value => ! isUndefined( value )
49
+ );
50
+ return criteria;
51
+ };
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/view.js CHANGED
@@ -8,48 +8,39 @@
8
*/
9
import './view.scss';
10
11
- const btnURLAttr = 'data-load-more-url';
12
const fetchRetryCount = 3;
13
14
/**
15
* Load More Button Handling
16
*/
17
-
18
- document.querySelectorAll( '[data-load-more-btn]' ).forEach( attachLoadMoreHandler );
19
-
20
- /**
21
- * Attaches an event handler to the Load more button.
22
- * @param {DOMElement} btnEl the button that was clicked
23
- */
24
- function attachLoadMoreHandler( btnEl ) {
25
- if ( ! btnEl ) {
26
- return null;
27
- }
28
-
29
- const handler = buildLoadMoreHandler( btnEl );
30
-
31
- btnEl.addEventListener( 'click', handler );
32
- }
33
34
/**
35
* Builds a function to handle clicks on the load more button.
36
* Creates internal state via closure to ensure all state is
37
* isolated to a single Block + button instance.
38
*
39
- * @param {DOMElement} btnEl the button that was clicked
40
*/
41
- function buildLoadMoreHandler( btnEl ) {
42
- // Set elements from scope determined by the clicked "Load more" button.
43
- const blockWrapperEl = btnEl.parentElement; // scope root element
44
- const postsContainerEl = blockWrapperEl.querySelector( '[data-posts-container]' );
45
- const loadingEl = blockWrapperEl.querySelector( '[data-load-more-loading-text]' );
46
- const errorEl = blockWrapperEl.querySelector( '[data-load-more-error-text]' );
47
48
// Set initial state flags.
49
let isFetching = false;
50
let isEndOfData = false;
51
52
- return () => {
53
// Early return if still fetching or no more posts to render.
54
if ( isFetching || isEndOfData ) {
55
return false;
@@ -57,18 +48,18 @@ function buildLoadMoreHandler( btnEl ) {
57
58
isFetching = true;
59
60
- // Set elements visibility for fetching state.
61
- hideEl( btnEl );
62
- hideEl( errorEl );
63
- showEl( loadingEl );
64
65
- const requestURL = new URL( btnEl.getAttribute( btnURLAttr ) );
66
67
- // Set currenty rendered posts' IDs as a query param (e.g. exclude_ids=1,2,3)
68
- requestURL.searchParams.set( 'exclude_ids', getRenderedPostsIds().join( ',' ) );
69
-
70
- fetchWithRetry( { url: requestURL.toString(), onSuccess, onError }, fetchRetryCount );
71
72
function onSuccess( data ) {
73
// Validate received data.
74
if ( ! isPostsDataValid( data ) ) {
@@ -83,37 +74,38 @@ function buildLoadMoreHandler( btnEl ) {
83
84
if ( data.next ) {
85
// Save next URL as button's attribute.
86
- btnEl.setAttribute( btnURLAttr, data.next );
87
-
88
- // Unhide button since there are more posts available.
89
- showEl( btnEl );
90
}
91
92
if ( ! data.items.length || ! data.next ) {
93
isEndOfData = true;
94
}
95
96
isFetching = false;
97
98
- hideEl( loadingEl );
99
}
100
101
function onError() {
102
isFetching = false;
103
104
- // Display error message and keep the button visible to enable retrying.
105
- hideEl( loadingEl );
106
- showEl( errorEl );
107
- showEl( btnEl );
108
}
109
- };
110
}
111
112
/**
113
* Returns unique IDs for posts that are currently in the DOM.
114
*/
115
function getRenderedPostsIds() {
116
- const postEls = document.querySelectorAll( 'article[data-post-id]' );
117
const postIds = Array.from( postEls ).map( el => el.getAttribute( 'data-post-id' ) );
118
119
return [ ...new Set( postIds ) ]; // Make values unique with Set
@@ -123,7 +115,7 @@ function getRenderedPostsIds() {
123
* Wrapper for XMLHttpRequest that performs given number of retries when error
124
* occurs.
125
*
126
- * @param {object} options XMLHttpRequest options
127
* @param {number} n retry count before throwing
128
*/
129
function fetchWithRetry( options, n ) {
@@ -180,7 +172,7 @@ function fetchWithRetry( options, n ) {
180
* "required": ["items", "next"]
181
* }
182
*
183
- * @param {object} data posts endpoint payload
184
*/
185
function isPostsDataValid( data ) {
186
let isValid = false;
@@ -205,31 +197,11 @@ function isPostsDataValid( data ) {
205
return isValid;
206
}
207
208
- /**
209
- * Hides given DOM element.
210
- *
211
- * @param {DOMElement} el
212
- */
213
- function hideEl( el ) {
214
- el.style.display = 'none';
215
- el.setAttribute( 'hidden', '' );
216
- }
217
-
218
- /**
219
- * Unhides given DOM element.
220
- *
221
- * @param {DOMElement} el
222
- */
223
- function showEl( el ) {
224
- el.style.display = '';
225
- el.removeAttribute( 'hidden' );
226
- }
227
-
228
/**
229
* Checks if object has own property.
230
*
231
- * @param {object} obj
232
- * @param {string} prop
233
*/
234
function hasOwnProp( obj, prop ) {
235
return Object.prototype.hasOwnProperty.call( obj, prop );
8
*/
9
import './view.scss';
10
11
const fetchRetryCount = 3;
12
13
/**
14
* Load More Button Handling
15
+ *
16
+ * Calls Array.prototype.forEach for IE11 compatibility.
17
+ *
18
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/NodeList
19
*/
20
+ Array.prototype.forEach.call(
21
+ document.querySelectorAll( '.wp-block-newspack-blocks-homepage-articles.has-more-button' ),
22
+ buildLoadMoreHandler
23
+ );
24
25
/**
26
* Builds a function to handle clicks on the load more button.
27
* Creates internal state via closure to ensure all state is
28
* isolated to a single Block + button instance.
29
*
30
+ * @param {HTMLElement} blockWrapperEl the button that was clicked
31
*/
32
+ function buildLoadMoreHandler( blockWrapperEl ) {
33
+ const btnEl = blockWrapperEl.querySelector( '[data-next]' );
34
+ if ( ! btnEl ) {
35
+ return;
36
+ }
37
+ const postsContainerEl = blockWrapperEl.querySelector( '[data-posts]' );
38
39
// Set initial state flags.
40
let isFetching = false;
41
let isEndOfData = false;
42
43
+ btnEl.addEventListener( 'click', () => {
44
// Early return if still fetching or no more posts to render.
45
if ( isFetching || isEndOfData ) {
46
return false;
48
49
isFetching = true;
50
51
+ blockWrapperEl.classList.remove( 'is-error' );
52
+ blockWrapperEl.classList.add( 'is-loading' );
53
54
+ // Set currently rendered posts' IDs as a query param (e.g. exclude_ids=1,2,3)
55
+ const requestURL =
56
+ btnEl.getAttribute( 'data-next' ) + '&exclude_ids=' + getRenderedPostsIds().join( ',' );
57
58
+ fetchWithRetry( { url: encodeURI( requestURL ), onSuccess, onError }, fetchRetryCount );
59
60
+ /**
61
+ * @param {Object} data Post data
62
+ */
63
function onSuccess( data ) {
64
// Validate received data.
65
if ( ! isPostsDataValid( data ) ) {
74
75
if ( data.next ) {
76
// Save next URL as button's attribute.
77
+ btnEl.setAttribute( 'data-next', data.next );
78
}
79
80
if ( ! data.items.length || ! data.next ) {
81
isEndOfData = true;
82
+ blockWrapperEl.classList.remove( 'has-more-button' );
83
}
84
85
isFetching = false;
86
87
+ blockWrapperEl.classList.remove( 'is-loading' );
88
}
89
90
+ /**
91
+ * Handle fetching error
92
+ */
93
function onError() {
94
isFetching = false;
95
96
+ blockWrapperEl.classList.remove( 'is-loading' );
97
+ blockWrapperEl.classList.add( 'is-error' );
98
}
99
+ } );
100
}
101
102
/**
103
* Returns unique IDs for posts that are currently in the DOM.
104
*/
105
function getRenderedPostsIds() {
106
+ const postEls = document.querySelectorAll(
107
+ '.wp-block-newspack-blocks-homepage-articles [data-post-id]'
108
+ );
109
const postIds = Array.from( postEls ).map( el => el.getAttribute( 'data-post-id' ) );
110
111
return [ ...new Set( postIds ) ]; // Make values unique with Set
115
* Wrapper for XMLHttpRequest that performs given number of retries when error
116
* occurs.
117
*
118
+ * @param {Object} options XMLHttpRequest options
119
* @param {number} n retry count before throwing
120
*/
121
function fetchWithRetry( options, n ) {
172
* "required": ["items", "next"]
173
* }
174
*
175
+ * @param {Object} data posts endpoint payload
176
*/
177
function isPostsDataValid( data ) {
178
let isValid = false;
197
return isValid;
198
}
199
200
/**
201
* Checks if object has own property.
202
*
203
+ * @param {Object} obj Object
204
+ * @param {string} prop Property to check
205
*/
206
function hasOwnProp( obj, prop ) {
207
return Object.prototype.hasOwnProperty.call( obj, prop );
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/view.php CHANGED
@@ -15,7 +15,7 @@
15
function newspack_blocks_render_block_homepage_articles( $attributes ) {
16
$article_query = new WP_Query( Newspack_Blocks::build_articles_query( $attributes ) );
17
18
- $classes = Newspack_Blocks::block_classes( 'homepage-articles', $attributes, array( 'wpnbha' ) );
19
20
if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) {
21
$classes .= ' is-grid';
@@ -60,65 +60,73 @@ function newspack_blocks_render_block_homepage_articles( $attributes ) {
60
if ( '' !== $attributes['customTextColor'] ) {
61
$styles = 'color: ' . $attributes['customTextColor'] . ';';
62
}
63
-
64
$articles_rest_url = add_query_arg(
65
array_merge(
66
array_map(
67
function( $attribute ) {
68
- return false === $attribute ? '0' : $attribute;
69
},
70
$attributes
71
),
72
- array( 'page' => 2 )
73
),
74
rest_url( '/newspack-blocks/v1/articles' )
75
);
76
77
ob_start();
78
79
if ( $article_query->have_posts() ) : ?>
80
- <div class="<?php echo esc_attr( $classes ); ?>" style="<?php echo esc_attr( $styles ); ?>">
81
- <div data-posts-container>
82
<?php if ( '' !== $attributes['sectionHeader'] ) : ?>
83
<h2 class="article-section-title">
84
<span><?php echo wp_kses_post( $attributes['sectionHeader'] ); ?></span>
85
</h2>
86
<?php endif; ?>
87
<?php
88
-
89
- /*
90
- * We are not using an AMP-based renderer on AMP requests because it has limitations
91
- * around dynamically calculating the height of the the article list on load.
92
- * As a result we render the same standards-based markup for all requests.
93
- */
94
-
95
echo Newspack_Blocks::template_inc(
96
__DIR__ . '/templates/articles-list.php',
97
- array(
98
'articles_rest_url' => $articles_rest_url,
99
'article_query' => $article_query,
100
'attributes' => $attributes,
101
- )
102
);
103
?>
104
</div>
105
<?php
106
107
- /*
108
- * AMP-requests cannot contain client-side scripting (eg: JavaScript). As a result
109
- * we do not display the "More" button on AMP-requests. This feature is deliberately
110
- * disabled.
111
- *
112
- * @see https://github.com/Automattic/newspack-blocks/pull/226#issuecomment-558695909
113
- * @see https://wp.me/paYJgx-jW
114
- */
115
- $page = $article_query->paged ?? 1;
116
-
117
- $has_more_pages = ( ++$page ) <= $article_query->max_num_pages;
118
-
119
- if ( ! Newspack_Blocks::is_amp() && $has_more_pages && boolval( $attributes['moreButton'] ) ) :
120
?>
121
- <button type="button" data-load-more-btn data-load-more-url="<?php echo esc_url( $articles_rest_url ); ?>">
122
<?php
123
if ( ! empty( $attributes['moreButtonText'] ) ) {
124
echo esc_html( $attributes['moreButtonText'] );
@@ -127,15 +135,19 @@ function newspack_blocks_render_block_homepage_articles( $attributes ) {
127
}
128
?>
129
</button>
130
- <p data-load-more-loading-text hidden>
131
<?php _e( 'Loading...', 'newspack-blocks' ); ?>
132
</p>
133
- <p data-load-more-error-text hidden>
134
<?php _e( 'Something went wrong. Please refresh the page and/or try again.', 'newspack-blocks' ); ?>
135
</p>
136
<?php endif; ?>
137
138
</div>
139
<?php
140
endif;
141
@@ -196,9 +208,9 @@ function newspack_blocks_format_avatars( $author_info ) {
196
function newspack_blocks_format_byline( $author_info ) {
197
$index = -1;
198
$elements = array_merge(
199
- array(
200
esc_html_x( 'by', 'post author', 'newspack-blocks' ) . ' ',
201
- ),
202
array_reduce(
203
$author_info,
204
function ( $accumulator, $author ) use ( $author_info, &$index ) {
@@ -207,21 +219,49 @@ function newspack_blocks_format_byline( $author_info ) {
207
208
return array_merge(
209
$accumulator,
210
- array(
211
sprintf(
212
/* translators: 1: author link. 2: author name. 3. variable seperator (comma, 'and', or empty) */
213
'<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
214
- esc_url( get_author_posts_url( $author->ID ) ),
215
esc_html( $author->display_name )
216
),
217
( $index < $penultimate ) ? ', ' : '',
218
( count( $author_info ) > 1 && $penultimate === $index ) ? esc_html_x( ' and ', 'post author', 'newspack-blocks' ) : '',
219
- )
220
);
221
},
222
- array()
223
)
224
);
225
226
return implode( '', $elements );
227
}
15
function newspack_blocks_render_block_homepage_articles( $attributes ) {
16
$article_query = new WP_Query( Newspack_Blocks::build_articles_query( $attributes ) );
17
18
+ $classes = Newspack_Blocks::block_classes( 'homepage-articles', $attributes, [ 'wpnbha' ] );
19
20
if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) {
21
$classes .= ' is-grid';
60
if ( '' !== $attributes['customTextColor'] ) {
61
$styles = 'color: ' . $attributes['customTextColor'] . ';';
62
}
63
$articles_rest_url = add_query_arg(
64
array_merge(
65
array_map(
66
function( $attribute ) {
67
+ return false === $attribute ? '0' : str_replace( '#', '%23', $attribute );
68
},
69
$attributes
70
),
71
+ [
72
+ 'page' => 2,
73
+ 'amp' => Newspack_Blocks::is_amp(),
74
+ ]
75
),
76
rest_url( '/newspack-blocks/v1/articles' )
77
);
78
79
+ $page = $article_query->paged ?? 1;
80
+
81
+ $has_more_pages = ( ++$page ) <= $article_query->max_num_pages;
82
+
83
+ /**
84
+ * Hide the "More" button on private sites.
85
+ *
86
+ * Client-side fetching from a private WP.com blog requires authentication,
87
+ * which is not provided in the current implementation.
88
+ * See https://github.com/Automattic/newspack-blocks/issues/306.
89
+ */
90
+ $is_blog_private = (int) get_option( 'blog_public' ) === -1;
91
+
92
+ $has_more_button = ! $is_blog_private && $has_more_pages && (bool) $attributes['moreButton'];
93
+
94
+ if ( $has_more_button ) {
95
+ $classes .= ' has-more-button';
96
+ }
97
+
98
ob_start();
99
100
if ( $article_query->have_posts() ) : ?>
101
+ <?php if ( $has_more_button && Newspack_Blocks::is_amp() ) : ?>
102
+ <amp-script layout="container" src="<?php echo esc_url( plugins_url( '/newspack-blocks/amp/homepage-articles/view.js' ) ); ?>">
103
+ <?php endif; ?>
104
+ <div
105
+ class="<?php echo esc_attr( $classes ); ?>"
106
+ style="<?php echo esc_attr( $styles ); ?>"
107
+ >
108
+ <div data-posts>
109
<?php if ( '' !== $attributes['sectionHeader'] ) : ?>
110
<h2 class="article-section-title">
111
<span><?php echo wp_kses_post( $attributes['sectionHeader'] ); ?></span>
112
</h2>
113
<?php endif; ?>
114
<?php
115
echo Newspack_Blocks::template_inc(
116
__DIR__ . '/templates/articles-list.php',
117
+ [
118
'articles_rest_url' => $articles_rest_url,
119
'article_query' => $article_query,
120
'attributes' => $attributes,
121
+ ]
122
);
123
?>
124
</div>
125
<?php
126
127
+ if ( $has_more_button ) :
128
?>
129
+ <button type="button" data-next="<?php echo esc_url( $articles_rest_url ); ?>">
130
<?php
131
if ( ! empty( $attributes['moreButtonText'] ) ) {
132
echo esc_html( $attributes['moreButtonText'] );
135
}
136
?>
137
</button>
138
+ <p class="loading">
139
<?php _e( 'Loading...', 'newspack-blocks' ); ?>
140
</p>
141
+ <p class="error">
142
<?php _e( 'Something went wrong. Please refresh the page and/or try again.', 'newspack-blocks' ); ?>
143
</p>
144
+
145
<?php endif; ?>
146
147
</div>
148
+ <?php if ( $has_more_button && Newspack_Blocks::is_amp() ) : ?>
149
+ </amp-script>
150
+ <?php endif; ?>
151
<?php
152
endif;
153
208
function newspack_blocks_format_byline( $author_info ) {
209
$index = -1;
210
$elements = array_merge(
211
+ [
212
esc_html_x( 'by', 'post author', 'newspack-blocks' ) . ' ',
213
+ ],
214
array_reduce(
215
$author_info,
216
function ( $accumulator, $author ) use ( $author_info, &$index ) {
219
220
return array_merge(
221
$accumulator,
222
+ [
223
sprintf(
224
/* translators: 1: author link. 2: author name. 3. variable seperator (comma, 'and', or empty) */
225
'<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
226
+ esc_url( get_author_posts_url( $author->ID, $author->user_nicename ) ),
227
esc_html( $author->display_name )
228
),
229
( $index < $penultimate ) ? ', ' : '',
230
( count( $author_info ) > 1 && $penultimate === $index ) ? esc_html_x( ' and ', 'post author', 'newspack-blocks' ) : '',
231
+ ]
232
);
233
},
234
+ []
235
)
236
);
237
238
return implode( '', $elements );
239
}
240
+
241
+
242
+ /**
243
+ * Inject amp-state containing all post IDs visible on page load.
244
+ */
245
+ function newspack_blocks_inject_amp_state() {
246
+ if ( ! Newspack_Blocks::is_amp() ) {
247
+ return;
248
+ }
249
+ global $newspack_blocks_post_id;
250
+ if ( ! $newspack_blocks_post_id || ! count( $newspack_blocks_post_id ) ) {
251
+ return;
252
+ }
253
+ $post_ids = implode( ', ', array_keys( $newspack_blocks_post_id ) );
254
+ ob_start();
255
+ ?>
256
+ <amp-state id='newspackHomepagePosts'>
257
+ <script type="application/json">
258
+ {
259
+ "exclude_ids": [ <?php echo esc_attr( $post_ids ); ?> ]
260
+ }
261
+ </script>
262
+ </amp-state>
263
+ <?php
264
+ echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
265
+ }
266
+
267
+ add_action( 'wp_footer', 'newspack_blocks_inject_amp_state' );
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/view.scss CHANGED
@@ -1,5 +1,5 @@
1
- @import "../../shared/sass/variables";
2
- @import "../../shared/sass/mixins";
3
4
.wpnbha {
5
margin-bottom: 1em;
@@ -35,7 +35,7 @@
35
article {
36
flex-basis: 100%;
37
38
- @include media(tablet) {
39
&:last-child,
40
& {
41
margin-bottom: 1em;
@@ -44,7 +44,7 @@
44
}
45
}
46
47
- @include media(mobile) {
48
&.columns-3 article,
49
&.columns-6 article {
50
flex-basis: calc( 33.333% - 16px );
@@ -53,17 +53,18 @@
53
&.columns-2 article,
54
&.columns-4 article,
55
&.columns-5 article {
56
- flex-basis: calc( 50% - 16px);
57
}
58
59
- &.columns-5 article:last-of-type:nth-child(odd) {
60
- flex-grow: 1;
61
}
62
}
63
64
- @include media(tablet) {
65
@for $i from 2 through 6 {
66
- &.columns-#{ $i } article {
67
flex-basis: calc( ( 100% / #{$i} ) - 16px );
68
}
69
}
@@ -73,25 +74,22 @@
73
74
.post-thumbnail {
75
margin: 0;
76
77
img {
78
height: auto;
79
width: 100%;
80
}
81
- }
82
-
83
- figcaption {
84
- font-size: $font__size-xxs;
85
- }
86
-
87
- .post-thumbnail {
88
- margin-bottom: 0.25em;
89
90
figcaption {
91
margin-bottom: 0.5em;
92
}
93
}
94
95
&.image-alignleft,
96
&.image-alignright {
97
.post-has-image {
@@ -109,14 +107,14 @@
109
display: block;
110
}
111
112
- @include media(mobile) {
113
&.mobile-stack .post-has-image {
114
display: flex;
115
}
116
}
117
118
// Image scale
119
- @include media(mobile) {
120
&.is-4 {
121
.post-thumbnail {
122
flex-basis: 75%;
@@ -210,11 +208,11 @@
210
align-items: center;
211
margin-top: 0.5em;
212
213
- .byline:not(:last-child) {
214
margin-right: 1.5em;
215
}
216
217
- .updated:not(.published) {
218
display: none;
219
}
220
}
@@ -244,10 +242,7 @@
244
figcaption {
245
color: inherit;
246
}
247
- }
248
-
249
- &.has-text-color {
250
- .entry-meta span:not(.avatar) {
251
opacity: 0.8;
252
}
253
}
@@ -278,7 +273,7 @@
278
bottom: 1em;
279
/* autoprefixer: ignore next */
280
-webkit-box-orient: vertical;
281
- color: rgba(white, 0.9);
282
display: -webkit-box;
283
font-style: italic;
284
left: 0;
@@ -294,7 +289,7 @@
294
z-index: 2;
295
}
296
297
- &:after {
298
background: rgba( 0, 0, 0, 0.5 );
299
bottom: 0;
300
content: '';
@@ -307,9 +302,13 @@
307
}
308
309
.entry-wrapper {
310
- padding: 2em;
311
position: relative;
312
z-index: 2;
313
}
314
315
.entry-wrapper,
@@ -319,12 +318,47 @@
319
.cat-links a {
320
color: #fff;
321
}
322
323
}
324
}
325
}
326
327
- /* Some really rough font sizing */
328
.wpnbha {
329
/* 'Normal' size */
330
article {
@@ -340,7 +374,7 @@
340
width: 25px;
341
}
342
343
- @include media(tablet) {
344
.entry-title {
345
font-size: 1.6em;
346
}