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
  }
@@ -358,25 +392,33 @@
358
  .entry-title {
359
  line-height: 1.1em;
360
  }
361
- @include media(tablet) {
362
  article .avatar {
363
  height: 2.4em;
364
  width: 2.4em;
365
  }
366
  }
 
367
 
 
 
 
 
 
 
 
368
  }
369
 
370
  &.ts-10 article {
371
  .entry-title {
372
  font-size: 2.6em;
373
  }
374
- @include media(tablet) {
375
  .entry-title {
376
  font-size: 3.6em;
377
  }
378
  }
379
- @include media(desktop) {
380
  .entry-title {
381
  font-size: 4.8em;
382
  }
@@ -387,12 +429,12 @@
387
  .entry-title {
388
  font-size: 2.4em;
389
  }
390
- @include media(tablet) {
391
  .entry-title {
392
  font-size: 3.4em;
393
  }
394
  }
395
- @include media(desktop) {
396
  .entry-title {
397
  font-size: 4.2em;
398
  }
@@ -403,12 +445,12 @@
403
  .entry-title {
404
  font-size: 2.2em;
405
  }
406
- @include media(tablet) {
407
  .entry-title {
408
- font-size: 3.0em;
409
  }
410
  }
411
- @include media(desktop) {
412
  .entry-title {
413
  font-size: 3.6em;
414
  }
@@ -419,7 +461,7 @@
419
  .entry-title {
420
  font-size: 2em;
421
  }
422
- @include media( tablet) {
423
  .entry-title {
424
  font-size: 2.4em;
425
  }
@@ -428,7 +470,7 @@
428
  width: 48px;
429
  }
430
  }
431
- @include media(desktop) {
432
  .entry-title {
433
  font-size: 3em;
434
  }
@@ -439,16 +481,19 @@
439
  .entry-title {
440
  font-size: 1.7em;
441
  }
442
- @include media(tablet) {
 
 
 
443
  .entry-title {
444
- font-size: 2.0em;
445
  }
446
  .avatar {
447
  height: 44px;
448
  width: 44px;
449
  }
450
  }
451
- @include media(desktop) {
452
  .entry-title {
453
  font-size: 2.4em;
454
  }
@@ -459,7 +504,10 @@
459
  .entry-title {
460
  font-size: 1.4em;
461
  }
462
- @include media(tablet) {
 
 
 
463
  .entry-title {
464
  font-size: 1.8em;
465
  }
@@ -468,9 +516,9 @@
468
  width: 40px;
469
  }
470
  }
471
- @include media(desktop) {
472
  .entry-title {
473
- font-size: 2.0em;
474
  }
475
  }
476
  }
@@ -479,8 +527,9 @@
479
 
480
  &.ts-3 article {
481
  .entry-title {
482
- font-size: 1.0em;
483
  }
 
484
  .entry-wrapper p {
485
  font-size: 0.8em;
486
  }
@@ -489,7 +538,7 @@
489
  }
490
  @include media( tablet ) {
491
  .entry-title {
492
- font-size: 1.2em
493
  }
494
 
495
  .avatar {
@@ -503,6 +552,9 @@
503
  .entry-title {
504
  font-size: 0.8em;
505
  }
 
 
 
506
  .entry-wrapper p,
507
  .entry-meta {
508
  font-size: 0.7em;
@@ -525,6 +577,9 @@
525
  .entry-wrapper p {
526
  font-size: 0.7em;
527
  }
 
 
 
528
  .entry-meta {
529
  font-size: 0.6em;
530
  }
@@ -536,12 +591,13 @@
536
  }
537
  }
538
  }
 
539
 
540
  /* Block styles */
541
 
542
  .wpnbha.is-style-borders {
543
  article {
544
- border: solid rgba(0, 0, 0, 0.2);
545
  border-width: 0 0 1px;
546
  margin-bottom: 1em;
547
  padding-bottom: 1em;
@@ -549,20 +605,48 @@
549
  &:last-of-type {
550
  margin-bottom: 0;
551
 
552
- &:not(:first-of-type) {
553
  border-bottom: 0;
554
  }
555
  }
556
  }
557
 
558
- @include media(tablet) {
559
-
560
  @for $i from 2 through 6 {
561
  &.columns-#{ $i } article {
562
  padding-right: calc( ( 16px * #{$i} ) / ( #{$i} - 1 ) );
563
  }
564
  }
565
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
566
  &.is-grid {
567
  article {
568
  border-width: 0 1px 0 0;
@@ -571,12 +655,40 @@
571
 
572
  &.is-grid article:last-of-type,
573
  &.columns-1 article,
574
- &.columns-2 article:nth-of-type(2n),
575
- &.columns-3 article:nth-of-type(3n),
576
- &.columns-4 article:nth-of-type(4n),
577
- &.columns-5 article:nth-of-type(5n),
578
- &.columns-6 article:nth-of-type(6n) {
579
  border: 0;
580
  }
581
  }
582
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../../shared/sass/variables';
2
+ @import '../../shared/sass/mixins';
3
 
4
  .wpnbha {
5
  margin-bottom: 1em;
35
  article {
36
  flex-basis: 100%;
37
 
38
+ @include media( tablet ) {
39
  &:last-child,
40
  & {
41
  margin-bottom: 1em;
44
  }
45
  }
46
 
47
+ @include media( mobile ) {
48
  &.columns-3 article,
49
  &.columns-6 article {
50
  flex-basis: calc( 33.333% - 16px );
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 {
60
+ flex-basis: 100%;
61
  }
62
  }
63
 
64
+ @include media( tablet ) {
65
  @for $i from 2 through 6 {
66
+ &.columns-#{ $i } article,
67
+ &.columns-#{ $i } article:last-of-type {
68
  flex-basis: calc( ( 100% / #{$i} ) - 16px );
69
  }
70
  }
74
 
75
  .post-thumbnail {
76
  margin: 0;
77
+ margin-bottom: 0.25em;
78
 
79
  img {
80
  height: auto;
81
  width: 100%;
82
  }
 
 
 
 
 
 
 
 
83
 
84
  figcaption {
85
  margin-bottom: 0.5em;
86
  }
87
  }
88
 
89
+ figcaption {
90
+ font-size: $font__size-xxs;
91
+ }
92
+
93
  &.image-alignleft,
94
  &.image-alignright {
95
  .post-has-image {
107
  display: block;
108
  }
109
 
110
+ @include media( mobile ) {
111
  &.mobile-stack .post-has-image {
112
  display: flex;
113
  }
114
  }
115
 
116
  // Image scale
117
+ @include media( mobile ) {
118
  &.is-4 {
119
  .post-thumbnail {
120
  flex-basis: 75%;
208
  align-items: center;
209
  margin-top: 0.5em;
210
 
211
+ .byline:not( :last-child ) {
212
  margin-right: 1.5em;
213
  }
214
 
215
+ .updated:not( .published ) {
216
  display: none;
217
  }
218
  }
242
  figcaption {
243
  color: inherit;
244
  }
245
+ .entry-meta span:not( .avatar ) {
 
 
 
246
  opacity: 0.8;
247
  }
248
  }
273
  bottom: 1em;
274
  /* autoprefixer: ignore next */
275
  -webkit-box-orient: vertical;
276
+ color: rgba( white, 0.9 );
277
  display: -webkit-box;
278
  font-style: italic;
279
  left: 0;
289
  z-index: 2;
290
  }
291
 
292
+ &::after {
293
  background: rgba( 0, 0, 0, 0.5 );
294
  bottom: 0;
295
  content: '';
302
  }
303
 
304
  .entry-wrapper {
305
+ padding: 2em 1em;
306
  position: relative;
307
  z-index: 2;
308
+
309
+ @include media( desktop ) {
310
+ padding: 2em 1.5em;
311
+ }
312
  }
313
 
314
  .entry-wrapper,
318
  .cat-links a {
319
  color: #fff;
320
  }
321
+ }
322
+ }
323
+
324
+ /* "More" button & related elements styles */
325
+ button,
326
+ .loading,
327
+ .error {
328
+ display: none;
329
+ }
330
+
331
+ button {
332
+ margin-top: 1em;
333
+ }
334
+
335
+ &.has-more-button {
336
+ button {
337
+ display: block;
338
+ }
339
+ }
340
+
341
+ &.has-more-button.is-loading {
342
+ button {
343
+ display: none;
344
+ }
345
+ .loading {
346
+ display: block;
347
+ }
348
+ }
349
 
350
+ &.has-more-button.is-error {
351
+ button,
352
+ .error {
353
+ display: block;
354
  }
355
  }
356
  }
357
 
358
+ /*
359
+ Some really rough font sizing.
360
+ */
361
+ /* stylelint-disable no-duplicate-selectors */
362
  .wpnbha {
363
  /* 'Normal' size */
364
  article {
374
  width: 25px;
375
  }
376
 
377
+ @include media( tablet ) {
378
  .entry-title {
379
  font-size: 1.6em;
380
  }
392
  .entry-title {
393
  line-height: 1.1em;
394
  }
395
+ @include media( tablet ) {
396
  article .avatar {
397
  height: 2.4em;
398
  width: 2.4em;
399
  }
400
  }
401
+ }
402
 
403
+ &.ts-10,
404
+ &.ts-9,
405
+ &.ts-8,
406
+ &.ts-7 {
407
+ .newspack-post-subtitle {
408
+ font-size: 1.4em;
409
+ }
410
  }
411
 
412
  &.ts-10 article {
413
  .entry-title {
414
  font-size: 2.6em;
415
  }
416
+ @include media( tablet ) {
417
  .entry-title {
418
  font-size: 3.6em;
419
  }
420
  }
421
+ @include media( desktop ) {
422
  .entry-title {
423
  font-size: 4.8em;
424
  }
429
  .entry-title {
430
  font-size: 2.4em;
431
  }
432
+ @include media( tablet ) {
433
  .entry-title {
434
  font-size: 3.4em;
435
  }
436
  }
437
+ @include media( desktop ) {
438
  .entry-title {
439
  font-size: 4.2em;
440
  }
445
  .entry-title {
446
  font-size: 2.2em;
447
  }
448
+ @include media( tablet ) {
449
  .entry-title {
450
+ font-size: 3em;
451
  }
452
  }
453
+ @include media( desktop ) {
454
  .entry-title {
455
  font-size: 3.6em;
456
  }
461
  .entry-title {
462
  font-size: 2em;
463
  }
464
+ @include media( tablet ) {
465
  .entry-title {
466
  font-size: 2.4em;
467
  }
470
  width: 48px;
471
  }
472
  }
473
+ @include media( desktop ) {
474
  .entry-title {
475
  font-size: 3em;
476
  }
481
  .entry-title {
482
  font-size: 1.7em;
483
  }
484
+ .newspack-post-subtitle {
485
+ font-size: 1.4em;
486
+ }
487
+ @include media( tablet ) {
488
  .entry-title {
489
+ font-size: 2em;
490
  }
491
  .avatar {
492
  height: 44px;
493
  width: 44px;
494
  }
495
  }
496
+ @include media( desktop ) {
497
  .entry-title {
498
  font-size: 2.4em;
499
  }
504
  .entry-title {
505
  font-size: 1.4em;
506
  }
507
+ .newspack-post-subtitle {
508
+ font-size: 1.2em;
509
+ }
510
+ @include media( tablet ) {
511
  .entry-title {
512
  font-size: 1.8em;
513
  }
516
  width: 40px;
517
  }
518
  }
519
+ @include media( desktop ) {
520
  .entry-title {
521
+ font-size: 2em;
522
  }
523
  }
524
  }
527
 
528
  &.ts-3 article {
529
  .entry-title {
530
+ font-size: 1em;
531
  }
532
+ .newspack-post-subtitle,
533
  .entry-wrapper p {
534
  font-size: 0.8em;
535
  }
538
  }
539
  @include media( tablet ) {
540
  .entry-title {
541
+ font-size: 1.2em;
542
  }
543
 
544
  .avatar {
552
  .entry-title {
553
  font-size: 0.8em;
554
  }
555
+ .newspack-post-subtitle {
556
+ font-size: 0.7em;
557
+ }
558
  .entry-wrapper p,
559
  .entry-meta {
560
  font-size: 0.7em;
577
  .entry-wrapper p {
578
  font-size: 0.7em;
579
  }
580
+ .newspack-post-subtitle {
581
+ font-size: 0.7em;
582
+ }
583
  .entry-meta {
584
  font-size: 0.6em;
585
  }
591
  }
592
  }
593
  }
594
+ /* stylelint-enable */
595
 
596
  /* Block styles */
597
 
598
  .wpnbha.is-style-borders {
599
  article {
600
+ border: solid rgba( 0, 0, 0, 0.2 );
601
  border-width: 0 0 1px;
602
  margin-bottom: 1em;
603
  padding-bottom: 1em;
605
  &:last-of-type {
606
  margin-bottom: 0;
607
 
608
+ &:not( :first-of-type ) {
609
  border-bottom: 0;
610
  }
611
  }
612
  }
613
 
614
+ @include media( mobile ) {
 
615
  @for $i from 2 through 6 {
616
  &.columns-#{ $i } article {
617
  padding-right: calc( ( 16px * #{$i} ) / ( #{$i} - 1 ) );
618
  }
619
  }
620
 
621
+ &.columns-2,
622
+ &.columns-4,
623
+ &.columns-5 {
624
+ article {
625
+ border-width: 0;
626
+ &:nth-of-type( odd ) {
627
+ border-width: 0 1px 0 0;
628
+ }
629
+ }
630
+ }
631
+
632
+ &.columns-3,
633
+ &.columns-6 {
634
+ article {
635
+ border-width: 0;
636
+
637
+ &:nth-of-type( 3n + 1 ),
638
+ &:nth-of-type( 3n + 2 ) {
639
+ border-width: 0 1px 0 0;
640
+ }
641
+ }
642
+ }
643
+
644
+ &.is-grid article:last-of-type {
645
+ border: 0;
646
+ }
647
+ }
648
+
649
+ @include media( tablet ) {
650
  &.is-grid {
651
  article {
652
  border-width: 0 1px 0 0;
655
 
656
  &.is-grid article:last-of-type,
657
  &.columns-1 article,
658
+ &.columns-2 article:nth-of-type( 2n ),
659
+ &.columns-3 article:nth-of-type( 3n ),
660
+ &.columns-4 article:nth-of-type( 4n ),
661
+ &.columns-5 article:nth-of-type( 5n ),
662
+ &.columns-6 article:nth-of-type( 6n ) {
663
  border: 0;
664
  }
665
  }
666
  }
667
+
668
+ /* Styles for the Subtitle, as part of the the Block */
669
+ .newspack-post-subtitle {
670
+ &--in-homepage-block {
671
+ margin-top: 0.3em;
672
+ margin-bottom: 0;
673
+ line-height: 1.4em;
674
+ font-style: italic;
675
+ }
676
+ }
677
+
678
+ /* Prevent tree-shaking Loading and Error style rules */
679
+ /* stylelint-disable selector-type-no-unknown */
680
+ amp-script .wpnbha.has-more-button.is-loading {
681
+ button {
682
+ display: none;
683
+ }
684
+ .loading {
685
+ display: block;
686
+ }
687
+ }
688
+ amp-script .wpnbha.has-more-button.is-error {
689
+ button,
690
+ .error {
691
+ display: block;
692
+ }
693
+ }
694
+ /* stylelint-enable */
blog-posts-block/newspack-homepage-articles/class-newspack-blocks-api.php CHANGED
@@ -15,61 +15,61 @@ class Newspack_Blocks_API {
15
  */
16
  public static function register_rest_fields() {
17
  register_rest_field(
18
- array( 'post', 'page' ),
19
  'newspack_featured_image_src',
20
- array(
21
- 'get_callback' => array( 'Newspack_Blocks_API', 'newspack_blocks_get_image_src' ),
22
- 'schema' => array(
23
- 'context' => array(
24
  'edit',
25
- ),
26
  'type' => 'array',
27
- ),
28
- )
29
  );
30
 
31
  register_rest_field(
32
- array( 'post', 'page' ),
33
  'newspack_featured_image_caption',
34
- array(
35
- 'get_callback' => array( 'Newspack_Blocks_API', 'newspack_blocks_get_image_caption' ),
36
- 'schema' => array(
37
- 'context' => array(
38
  'edit',
39
- ),
40
  'type' => 'string',
41
- ),
42
- )
43
  );
44
 
45
  /* Add author info source */
46
  register_rest_field(
47
  'post',
48
  'newspack_author_info',
49
- array(
50
- 'get_callback' => array( 'Newspack_Blocks_API', 'newspack_blocks_get_author_info' ),
51
- 'schema' => array(
52
- 'context' => array(
53
  'edit',
54
- ),
55
  'type' => 'array',
56
- ),
57
- )
58
  );
59
 
60
  /* Add first category source */
61
  register_rest_field(
62
  'post',
63
  'newspack_category_info',
64
- array(
65
- 'get_callback' => array( 'Newspack_Blocks_API', 'newspack_blocks_get_primary_category' ),
66
- 'schema' => array(
67
- 'context' => array(
68
  'edit',
69
- ),
70
  'type' => 'string',
71
- ),
72
- )
73
  );
74
  }
75
 
@@ -80,7 +80,7 @@ class Newspack_Blocks_API {
80
  * @return array | bool Featured image if available, false if not.
81
  */
82
  public static function newspack_blocks_get_image_src( $object ) {
83
- $featured_image_set = array();
84
 
85
  if ( 0 === $object['featured_media'] ) {
86
  return false;
@@ -146,7 +146,7 @@ class Newspack_Blocks_API {
146
  * @return array Author data.
147
  */
148
  public static function newspack_blocks_get_author_info( $object ) {
149
- $author_data = array();
150
 
151
  if ( function_exists( 'coauthors_posts_links' ) ) :
152
  $authors = get_coauthors();
@@ -200,7 +200,7 @@ class Newspack_Blocks_API {
200
  // Use Yoast primary category if set.
201
  if ( class_exists( 'WPSEO_Primary_Term' ) ) {
202
  $primary_term = new WPSEO_Primary_Term( 'category', $object['id'] );
203
- $category_id = $primary_term->get_primary_term();
204
  if ( $category_id ) {
205
  $category = get_term( $category_id );
206
  }
15
  */
16
  public static function register_rest_fields() {
17
  register_rest_field(
18
+ [ 'post', 'page' ],
19
  'newspack_featured_image_src',
20
+ [
21
+ 'get_callback' => [ 'Newspack_Blocks_API', 'newspack_blocks_get_image_src' ],
22
+ 'schema' => [
23
+ 'context' => [
24
  'edit',
25
+ ],
26
  'type' => 'array',
27
+ ],
28
+ ]
29
  );
30
 
31
  register_rest_field(
32
+ [ 'post', 'page' ],
33
  'newspack_featured_image_caption',
34
+ [
35
+ 'get_callback' => [ 'Newspack_Blocks_API', 'newspack_blocks_get_image_caption' ],
36
+ 'schema' => [
37
+ 'context' => [
38
  'edit',
39
+ ],
40
  'type' => 'string',
41
+ ],
42
+ ]
43
  );
44
 
45
  /* Add author info source */
46
  register_rest_field(
47
  'post',
48
  'newspack_author_info',
49
+ [
50
+ 'get_callback' => [ 'Newspack_Blocks_API', 'newspack_blocks_get_author_info' ],
51
+ 'schema' => [
52
+ 'context' => [
53
  'edit',
54
+ ],
55
  'type' => 'array',
56
+ ],
57
+ ]
58
  );
59
 
60
  /* Add first category source */
61
  register_rest_field(
62
  'post',
63
  'newspack_category_info',
64
+ [
65
+ 'get_callback' => [ 'Newspack_Blocks_API', 'newspack_blocks_get_primary_category' ],
66
+ 'schema' => [
67
+ 'context' => [
68
  'edit',
69
+ ],
70
  'type' => 'string',
71
+ ],
72
+ ]
73
  );
74
  }
75
 
80
  * @return array | bool Featured image if available, false if not.
81
  */
82
  public static function newspack_blocks_get_image_src( $object ) {
83
+ $featured_image_set = [];
84
 
85
  if ( 0 === $object['featured_media'] ) {
86
  return false;
146
  * @return array Author data.
147
  */
148
  public static function newspack_blocks_get_author_info( $object ) {
149
+ $author_data = [];
150
 
151
  if ( function_exists( 'coauthors_posts_links' ) ) :
152
  $authors = get_coauthors();
200
  // Use Yoast primary category if set.
201
  if ( class_exists( 'WPSEO_Primary_Term' ) ) {
202
  $primary_term = new WPSEO_Primary_Term( 'category', $object['id'] );
203
+ $category_id = $primary_term->get_primary_term();
204
  if ( $category_id ) {
205
  $category = get_term( $category_id );
206
  }
blog-posts-block/newspack-homepage-articles/class-newspack-blocks.php CHANGED
@@ -14,7 +14,7 @@ class Newspack_Blocks {
14
  * Add hooks and filters.
15
  */
16
  public static function init() {
17
- add_action( 'after_setup_theme', array( __CLASS__, 'add_image_sizes' ) );
18
  }
19
 
20
  /**
@@ -57,6 +57,12 @@ class Newspack_Blocks {
57
  $script_data['version'],
58
  true
59
  );
 
 
 
 
 
 
60
  }
61
 
62
  $editor_style = plugins_url( NEWSPACK_BLOCKS__BLOCKS_DIRECTORY . 'editor.css', __FILE__ );
@@ -67,12 +73,6 @@ class Newspack_Blocks {
67
  array(),
68
  NEWSPACK_BLOCKS__VERSION
69
  );
70
-
71
- wp_set_script_translations(
72
- 'newspack-blocks-editor',
73
- 'newspack-blocks',
74
- plugin_dir_path( __FILE__ ) . 'languages'
75
- );
76
  }
77
 
78
  /**
@@ -176,7 +176,7 @@ class Newspack_Blocks {
176
  * @return string Class list separated by spaces.
177
  */
178
  public static function block_classes( $type, $attributes = array(), $extra = array() ) {
179
- $classes = array( "wp-block-newspack-blocks-{$type}" );
180
 
181
  if ( ! empty( $attributes['align'] ) ) {
182
  $classes[] = 'align' . $attributes['align'];
14
  * Add hooks and filters.
15
  */
16
  public static function init() {
17
+ add_action( 'after_setup_theme', [ __CLASS__, 'add_image_sizes' ] );
18
  }
19
 
20
  /**
57
  $script_data['version'],
58
  true
59
  );
60
+
61
+ wp_set_script_translations(
62
+ 'newspack-blocks-editor',
63
+ 'newspack-blocks',
64
+ plugin_dir_path( __FILE__ ) . 'languages'
65
+ );
66
  }
67
 
68
  $editor_style = plugins_url( NEWSPACK_BLOCKS__BLOCKS_DIRECTORY . 'editor.css', __FILE__ );
73
  array(),
74
  NEWSPACK_BLOCKS__VERSION
75
  );
 
 
 
 
 
 
76
  }
77
 
78
  /**
176
  * @return string Class list separated by spaces.
177
  */
178
  public static function block_classes( $type, $attributes = array(), $extra = array() ) {
179
+ $classes = [ "wp-block-newspack-blocks-{$type}" ];
180
 
181
  if ( ! empty( $attributes['align'] ) ) {
182
  $classes[] = 'align' . $attributes['align'];
blog-posts-block/newspack-homepage-articles/components/autocomplete-tokenfield.js CHANGED
@@ -23,35 +23,38 @@ class AutocompleteTokenField extends Component {
23
  this.state = {
24
  suggestions: [],
25
  validValues: {},
26
- loading: false,
27
  };
28
 
29
- this.debouncedUpdateSuggestions = debounce( this.updateSuggestions, 500 )
30
  }
31
 
 
 
 
 
 
 
 
 
32
  /**
33
  * When the component loads, fetch information about the tokens so we can populate
34
  * the tokens with the correct labels.
35
  */
36
  componentDidMount() {
37
- const { tokens, fetchSavedInfo } = this.props;
 
38
 
39
- if ( ! tokens.length || ! fetchSavedInfo ) {
40
- return;
41
- }
42
 
43
- this.setState( { loading: true }, () => {
44
- fetchSavedInfo( tokens )
45
- .then( results => {
46
- const { validValues } = this.state;
47
-
48
- results.forEach( suggestion => {
49
- validValues[ suggestion.value ] = suggestion.label;
50
- } );
51
-
52
- this.setState( { validValues, loading: false } );
53
  } );
54
- } );
 
 
 
55
  }
56
 
57
  /**
@@ -65,8 +68,8 @@ class AutocompleteTokenField extends Component {
65
  /**
66
  * Get a list of labels for input values.
67
  *
68
- * @param array values Array of values (ids, etc.).
69
- * @returns array Array of valid labels corresponding to the values.
70
  */
71
  getLabelsForValues( values ) {
72
  const { validValues } = this.state;
@@ -80,8 +83,8 @@ class AutocompleteTokenField extends Component {
80
  /**
81
  * Get a list of values for input labels.
82
  *
83
- * @param array labels Array of labels from the tokens.
84
- * @returns array Array of valid values corresponding to the labels.
85
  */
86
  getValuesForLabels( labels ) {
87
  const { validValues } = this.state;
@@ -92,6 +95,8 @@ class AutocompleteTokenField extends Component {
92
 
93
  /**
94
  * Refresh the autocomplete dropdown.
 
 
95
  */
96
  updateSuggestions( input ) {
97
  const { fetchSuggestions } = this.props;
@@ -101,30 +106,32 @@ class AutocompleteTokenField extends Component {
101
 
102
  this.setState( { loading: true }, () => {
103
  const request = fetchSuggestions( input );
104
- request.then( suggestions => {
105
- // A fetch Promise doesn't have an abort option. It's mimicked by
106
- // comparing the request reference in on the instance, which is
107
- // reset or deleted on subsequent requests or unmounting.
108
- if ( this.suggestionsRequest !== request ) {
109
- return;
110
- }
111
-
112
- const { validValues } = this.state;
113
- const currentSuggestions = []
114
-
115
- suggestions.forEach( suggestion => {
116
- currentSuggestions.push( suggestion.label );
117
- validValues[ suggestion.value ] = suggestion.label;
118
- } );
119
-
120
- this.setState( { suggestions: currentSuggestions, validValues, loading: false } );
121
- } ).catch( () => {
122
- if ( this.suggestionsRequest === request ) {
123
- this.setState( {
124
- loading: false,
125
  } );
126
- }
127
- } );
 
 
 
 
 
 
 
 
128
 
129
  this.suggestionsRequest = request;
130
  } );
@@ -133,7 +140,7 @@ class AutocompleteTokenField extends Component {
133
  /**
134
  * When a token is selected, we need to convert the string label into a recognized value suitable for saving as an attribute.
135
  *
136
- * @param array tokenStrings An array of token label strings.
137
  */
138
  handleOnChange( tokenStrings ) {
139
  const { onChange } = this.props;
@@ -143,7 +150,7 @@ class AutocompleteTokenField extends Component {
143
  /**
144
  * To populate the tokens, we need to convert the values into a human-readable label.
145
  *
146
- * @returns array An array of token label strings.
147
  */
148
  getTokens() {
149
  const { tokens } = this.props;
@@ -154,11 +161,11 @@ class AutocompleteTokenField extends Component {
154
  * Render.
155
  */
156
  render() {
157
- const { label = '' } = this.props;
158
  const { suggestions, loading } = this.state;
159
 
160
  return (
161
- <div className='autocomplete-tokenfield'>
162
  <FormTokenField
163
  value={ this.getTokens() }
164
  suggestions={ suggestions }
@@ -167,9 +174,10 @@ class AutocompleteTokenField extends Component {
167
  label={ label }
168
  />
169
  { loading && <Spinner /> }
 
170
  </div>
171
  );
172
  }
173
  }
174
 
175
- export default AutocompleteTokenField;
23
  this.state = {
24
  suggestions: [],
25
  validValues: {},
26
+ loading: this.isFetchingInfoOnLoad(),
27
  };
28
 
29
+ this.debouncedUpdateSuggestions = debounce( this.updateSuggestions, 500 );
30
  }
31
 
32
+ /**
33
+ * If the component has tokens passed in props, it should fetch info after it mounts.
34
+ */
35
+ isFetchingInfoOnLoad = () => {
36
+ const { tokens, fetchSavedInfo } = this.props;
37
+ return Boolean( tokens.length && fetchSavedInfo );
38
+ };
39
+
40
  /**
41
  * When the component loads, fetch information about the tokens so we can populate
42
  * the tokens with the correct labels.
43
  */
44
  componentDidMount() {
45
+ if ( this.isFetchingInfoOnLoad() ) {
46
+ const { tokens, fetchSavedInfo } = this.props;
47
 
48
+ fetchSavedInfo( tokens ).then( results => {
49
+ const { validValues } = this.state;
 
50
 
51
+ results.forEach( suggestion => {
52
+ validValues[ suggestion.value ] = suggestion.label;
 
 
 
 
 
 
 
 
53
  } );
54
+
55
+ this.setState( { validValues, loading: false } );
56
+ } );
57
+ }
58
  }
59
 
60
  /**
68
  /**
69
  * Get a list of labels for input values.
70
  *
71
+ * @param {Array} values Array of values (ids, etc.).
72
+ * @return {Array} array of valid labels corresponding to the values.
73
  */
74
  getLabelsForValues( values ) {
75
  const { validValues } = this.state;
83
  /**
84
  * Get a list of values for input labels.
85
  *
86
+ * @param {Array} labels Array of labels from the tokens.
87
+ * @return {Array} Array of valid values corresponding to the labels.
88
  */
89
  getValuesForLabels( labels ) {
90
  const { validValues } = this.state;
95
 
96
  /**
97
  * Refresh the autocomplete dropdown.
98
+ *
99
+ * @param {string} input Input to fetch suggestions for
100
  */
101
  updateSuggestions( input ) {
102
  const { fetchSuggestions } = this.props;
106
 
107
  this.setState( { loading: true }, () => {
108
  const request = fetchSuggestions( input );
109
+ request
110
+ .then( suggestions => {
111
+ // A fetch Promise doesn't have an abort option. It's mimicked by
112
+ // comparing the request reference in on the instance, which is
113
+ // reset or deleted on subsequent requests or unmounting.
114
+ if ( this.suggestionsRequest !== request ) {
115
+ return;
116
+ }
117
+
118
+ const { validValues } = this.state;
119
+ const currentSuggestions = [];
120
+
121
+ suggestions.forEach( suggestion => {
122
+ currentSuggestions.push( suggestion.label );
123
+ validValues[ suggestion.value ] = suggestion.label;
 
 
 
 
 
 
124
  } );
125
+
126
+ this.setState( { suggestions: currentSuggestions, validValues, loading: false } );
127
+ } )
128
+ .catch( () => {
129
+ if ( this.suggestionsRequest === request ) {
130
+ this.setState( {
131
+ loading: false,
132
+ } );
133
+ }
134
+ } );
135
 
136
  this.suggestionsRequest = request;
137
  } );
140
  /**
141
  * When a token is selected, we need to convert the string label into a recognized value suitable for saving as an attribute.
142
  *
143
+ * @param {Array} tokenStrings An array of token label strings.
144
  */
145
  handleOnChange( tokenStrings ) {
146
  const { onChange } = this.props;
150
  /**
151
  * To populate the tokens, we need to convert the values into a human-readable label.
152
  *
153
+ * @return {Array} An array of token label strings.
154
  */
155
  getTokens() {
156
  const { tokens } = this.props;
161
  * Render.
162
  */
163
  render() {
164
+ const { help, label = '' } = this.props;
165
  const { suggestions, loading } = this.state;
166
 
167
  return (
168
+ <div className="autocomplete-tokenfield">
169
  <FormTokenField
170
  value={ this.getTokens() }
171
  suggestions={ suggestions }
174
  label={ label }
175
  />
176
  { loading && <Spinner /> }
177
+ { help && <p className="autocomplete-tokenfield__help">{ help }</p> }
178
  </div>
179
  );
180
  }
181
  }
182
 
183
+ export default AutocompleteTokenField;
blog-posts-block/newspack-homepage-articles/components/autocomplete-tokenfield.scss CHANGED
@@ -6,4 +6,13 @@
6
  top: 2em;
7
  right: 0;
8
  }
9
- }
 
 
 
 
 
 
 
 
 
6
  top: 2em;
7
  right: 0;
8
  }
9
+
10
+ /* Workaround for hard-coded help text in FormTokenField. */
11
+ .components-form-token-field > .components-form-token-field__help {
12
+ display: none;
13
+ }
14
+
15
+ .autocomplete-tokenfield__help {
16
+ font-style: italic;
17
+ }
18
+ }
blog-posts-block/newspack-homepage-articles/components/query-controls.js CHANGED
@@ -2,17 +2,16 @@
2
  * WordPress dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { Component, Fragment } from '@wordpress/element';
6
- import {
7
- Button,
8
- QueryControls as BaseControl,
9
- SelectControl,
10
- ToggleControl,
11
- } from '@wordpress/components';
12
  import apiFetch from '@wordpress/api-fetch';
13
  import { addQueryArgs } from '@wordpress/url';
14
  import { decodeEntities } from '@wordpress/html-entities';
15
 
 
 
 
 
16
  /**
17
  * Internal dependencies.
18
  */
@@ -147,8 +146,6 @@ class QueryControls extends Component {
147
 
148
  render = () => {
149
  const {
150
- numberOfItems,
151
- onNumberOfItemsChange,
152
  specificMode,
153
  onSpecificModeChange,
154
  specificPosts,
@@ -171,7 +168,7 @@ class QueryControls extends Component {
171
  key="specificMode"
172
  checked={ specificMode }
173
  onChange={ onSpecificModeChange }
174
- label={ __( 'Choose specific stories', 'newspack-blocks' ) }
175
  />
176
  ),
177
  specificMode && (
@@ -182,6 +179,10 @@ class QueryControls extends Component {
182
  fetchSuggestions={ this.fetchPostSuggestions }
183
  fetchSavedInfo={ this.fetchSavedPosts }
184
  label={ __( 'Posts', 'newspack-blocks' ) }
 
 
 
 
185
  />
186
  ),
187
  ! specificMode && <BaseControl key="queryControls" { ...this.props } />,
@@ -216,9 +217,8 @@ class QueryControls extends Component {
216
  />
217
  ),
218
  ! specificMode && onTagExclusionsChange && (
219
- <p>
220
  <Button
221
- key="toggle-advanced-filters"
222
  isLink
223
  onClick={ () => this.setState( { showAdvancedFilters: ! showAdvancedFilters } ) }
224
  >
2
  * WordPress dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { Component } from '@wordpress/element';
6
+ import { Button, QueryControls as BaseControl, ToggleControl } from '@wordpress/components';
 
 
 
 
 
7
  import apiFetch from '@wordpress/api-fetch';
8
  import { addQueryArgs } from '@wordpress/url';
9
  import { decodeEntities } from '@wordpress/html-entities';
10
 
11
+ /**
12
+ * External dependencies.
13
+ */
14
+
15
  /**
16
  * Internal dependencies.
17
  */
146
 
147
  render = () => {
148
  const {
 
 
149
  specificMode,
150
  onSpecificModeChange,
151
  specificPosts,
168
  key="specificMode"
169
  checked={ specificMode }
170
  onChange={ onSpecificModeChange }
171
+ label={ __( 'Choose Specific Posts', 'newspack-blocks' ) }
172
  />
173
  ),
174
  specificMode && (
179
  fetchSuggestions={ this.fetchPostSuggestions }
180
  fetchSavedInfo={ this.fetchSavedPosts }
181
  label={ __( 'Posts', 'newspack-blocks' ) }
182
+ help={ __(
183
+ 'Begin typing post title, click autocomplete result to select.',
184
+ 'newspack-blocks'
185
+ ) }
186
  />
187
  ),
188
  ! specificMode && <BaseControl key="queryControls" { ...this.props } />,
217
  />
218
  ),
219
  ! specificMode && onTagExclusionsChange && (
220
+ <p key="toggle-advanced-filters">
221
  <Button
 
222
  isLink
223
  onClick={ () => this.setState( { showAdvancedFilters: ! showAdvancedFilters } ) }
224
  >
blog-posts-block/newspack-homepage-articles/shared/sass/_legacy_colors.scss CHANGED
@@ -10,4 +10,4 @@ $muriel-gray-500: #636d75;
10
  $muriel-gray-600: #50575d;
11
  $muriel-gray-700: #3d4145;
12
  $muriel-gray-800: #2b2d2f;
13
- $muriel-gray-900: #1a1a1a;
10
  $muriel-gray-600: #50575d;
11
  $muriel-gray-700: #3d4145;
12
  $muriel-gray-800: #2b2d2f;
13
+ $muriel-gray-900: #1a1a1a;
blog-posts-block/newspack-homepage-articles/shared/sass/_mixins.scss CHANGED
@@ -1,25 +1,24 @@
1
-
2
  @mixin media( $res ) {
3
  @if mobile == $res {
4
- @media only screen and (min-width: $mobile_width) {
5
  @content;
6
  }
7
  }
8
 
9
  @if tablet == $res {
10
- @media only screen and (min-width: $tablet_width) {
11
  @content;
12
  }
13
  }
14
 
15
  @if desktop == $res {
16
- @media only screen and (min-width: $desktop_width) {
17
  @content;
18
  }
19
  }
20
 
21
  @if wide == $res {
22
- @media only screen and (min-width: $wide_width) {
23
  @content;
24
  }
25
  }
 
1
  @mixin media( $res ) {
2
  @if mobile == $res {
3
+ @media only screen and ( min-width: $mobile_width ) {
4
  @content;
5
  }
6
  }
7
 
8
  @if tablet == $res {
9
+ @media only screen and ( min-width: $tablet_width ) {
10
  @content;
11
  }
12
  }
13
 
14
  @if desktop == $res {
15
+ @media only screen and ( min-width: $desktop_width ) {
16
  @content;
17
  }
18
  }
19
 
20
  @if wide == $res {
21
+ @media only screen and ( min-width: $wide_width ) {
22
  @content;
23
  }
24
  }
blog-posts-block/newspack-homepage-articles/shared/sass/_placeholder.scss ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ .wp-block[data-type^='newspack-blocks/'] {
2
+ .component-placeholder__align-center {
3
+ align-items: center;
4
+ }
5
+ }
blog-posts-block/newspack-homepage-articles/shared/sass/_variables.scss CHANGED
@@ -6,19 +6,18 @@ $wide_width: 1379px;
6
  $font__size_base: 20px;
7
  $font__size-ratio: 1.125;
8
 
9
- $font__size-xxxs: 1em * 0.5; // 10px
10
- $font__size-xxs: 1em * 0.6; // 12px
11
- $font__size-xs: 1em * 0.7; // 14px
12
- $font__size-sm: 1em * 0.8; // 16px
13
  // $font__size_base: 1em * 1; // 20px
14
- $font__size-md: 1em * 1.2; // 24px
15
- $font__size-lg: 1em * 1.4; // 28px
16
- $font__size-xl: 1em * 1.8; // 36px
17
- $font__size-xxl: 1em * 2.2; // 44px
18
- $font__size-xxxl: 1em * 2.8; // 56px
19
  $font__size-xxxxl: 1em * 3.2; // 64px
20
 
21
-
22
  $font__line-height-body: 1.6;
23
  $font__line-height-pre: 1.6;
24
  $font__line-height-heading: 1.2;
6
  $font__size_base: 20px;
7
  $font__size-ratio: 1.125;
8
 
9
+ $font__size-xxxs: 1em * 0.5; // 10px
10
+ $font__size-xxs: 1em * 0.6; // 12px
11
+ $font__size-xs: 1em * 0.7; // 14px
12
+ $font__size-sm: 1em * 0.8; // 16px
13
  // $font__size_base: 1em * 1; // 20px
14
+ $font__size-md: 1em * 1.2; // 24px
15
+ $font__size-lg: 1em * 1.4; // 28px
16
+ $font__size-xl: 1em * 1.8; // 36px
17
+ $font__size-xxl: 1em * 2.2; // 44px
18
+ $font__size-xxxl: 1em * 2.8; // 56px
19
  $font__size-xxxxl: 1em * 3.2; // 64px
20
 
 
21
  $font__line-height-body: 1.6;
22
  $font__line-height-pre: 1.6;
23
  $font__line-height-heading: 1.2;
{full-site-editing → dotcom-fse}/blocks/navigation-menu/edit.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/navigation-menu/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/navigation-menu/index.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/navigation-menu/style.scss RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/post-content/edit.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/post-content/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/post-content/index.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/post-content/save.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/post-content/style.scss RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-credit/edit.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-credit/footer-credit-choices.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-credit/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-credit/index.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-credit/style.scss RENAMED
@@ -34,4 +34,4 @@
34
  margin-bottom: 0;
35
  }
36
  }
37
- }
34
  margin-bottom: 0;
35
  }
36
  }
37
+ }
{full-site-editing → dotcom-fse}/blocks/site-description/edit.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-description/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-description/index.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-description/style.scss RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-title/edit.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-title/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-title/index.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/site-title/style.scss RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/template/edit.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/template/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/template/index.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/template/site-logo.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/blocks/template/style.scss RENAMED
@@ -72,23 +72,23 @@
72
  transition: opacity 0.2s linear 0s;
73
  top: 0;
74
  z-index: 2;
75
-
76
  .is-selected & {
77
  border-color: rgba( #425863, 0.4 ); // Gutenberg $dark-opacity-light-800
78
  }
79
-
80
  .block-editor-block-list__block:first-child & {
81
  border-bottom-width: 1px;
82
  }
83
-
84
  .block-editor-block-list__block:last-child & {
85
  border-top-width: 1px;
86
  }
87
-
88
  @media only screen and ( min-width: 768px ) {
89
  border-width: 1px;
90
  }
91
-
92
  .components-button {
93
  opacity: 0;
94
  transition: opacity 0.2s linear 0s;
@@ -121,4 +121,4 @@
121
  .components-spinner {
122
  margin: 0 auto;
123
  }
124
- }
72
  transition: opacity 0.2s linear 0s;
73
  top: 0;
74
  z-index: 2;
75
+
76
  .is-selected & {
77
  border-color: rgba( #425863, 0.4 ); // Gutenberg $dark-opacity-light-800
78
  }
79
+
80
  .block-editor-block-list__block:first-child & {
81
  border-bottom-width: 1px;
82
  }
83
+
84
  .block-editor-block-list__block:last-child & {
85
  border-top-width: 1px;
86
  }
87
+
88
  @media only screen and ( min-width: 768px ) {
89
  border-width: 1px;
90
  }
91
+
92
  .components-button {
93
  opacity: 0;
94
  transition: opacity 0.2s linear 0s;
121
  .components-spinner {
122
  margin: 0 auto;
123
  }
124
+ }
{full-site-editing → dotcom-fse}/class-full-site-editing.php RENAMED
@@ -23,7 +23,7 @@ class Full_Site_Editing {
23
  *
24
  * @var array
25
  */
26
- private $template_post_types = [ 'wp_template_part' ];
27
 
28
  /**
29
  * Current theme slug.
@@ -43,24 +43,24 @@ class Full_Site_Editing {
43
  * Full_Site_Editing constructor.
44
  */
45
  private function __construct() {
46
- add_action( 'init', [ $this, 'register_blocks' ], 100 );
47
- add_action( 'init', [ $this, 'register_template_post_types' ] );
48
- add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_script_and_style' ], 100 );
49
- add_action( 'the_post', [ $this, 'merge_template_and_post' ] );
50
- add_filter( 'wp_insert_post_data', [ $this, 'remove_template_components' ], 10, 2 );
51
- add_filter( 'admin_body_class', [ $this, 'toggle_editor_post_title_visibility' ] );
52
- add_filter( 'block_editor_settings', [ $this, 'set_block_template' ] );
53
  add_filter( 'body_class', array( $this, 'add_fse_body_class' ) );
54
 
55
- add_filter( 'post_row_actions', [ $this, 'remove_trash_row_action_for_template_post_types' ], 10, 2 );
56
- add_filter( 'bulk_actions-edit-wp_template', [ $this, 'remove_trash_bulk_action_for_template_post_type' ] );
57
- add_action( 'wp_trash_post', [ $this, 'restrict_template_deletion' ] );
58
- add_action( 'before_delete_post', [ $this, 'restrict_template_deletion' ] );
59
- add_filter( 'wp_template_type_row_actions', [ $this, 'remove_delete_row_action_for_template_taxonomy' ], 10, 2 );
60
- add_filter( 'bulk_actions-edit-wp_template_type', [ $this, 'remove_delete_bulk_action_for_template_taxonomy' ] );
61
- add_action( 'pre_delete_term', [ $this, 'restrict_template_taxonomy_deletion' ], 10, 2 );
62
- add_action( 'transition_post_status', [ $this, 'restrict_template_drafting' ], 10, 3 );
63
- add_action( 'admin_menu', [ $this, 'remove_wp_admin_menu_items' ] );
64
 
65
  $this->theme_slug = normalize_theme_slug( get_stylesheet() );
66
  $this->wp_template_inserter = new WP_Template_Inserter( $this->theme_slug );
@@ -82,11 +82,11 @@ class Full_Site_Editing {
82
  /**
83
  * Inserts template data for the theme we are currently switching to.
84
  *
85
- * This insertion will only happen if theme supports FSE.
86
  * It is hooked into after_switch_theme action.
87
  */
88
  public function insert_default_data() {
89
- // Bail if current theme doesn't support FSE.
90
  if ( ! is_theme_supported() ) {
91
  return;
92
  }
@@ -115,13 +115,13 @@ class Full_Site_Editing {
115
  * Enqueue assets.
116
  */
117
  public function enqueue_script_and_style() {
118
- $asset_file = include plugin_dir_path( __FILE__ ) . 'dist/full-site-editing.asset.php';
119
  $script_dependencies = $asset_file['dependencies'];
120
  wp_enqueue_script(
121
  'a8c-full-site-editing-script',
122
- plugins_url( 'dist/full-site-editing.js', __FILE__ ),
123
  is_array( $script_dependencies ) ? $script_dependencies : array(),
124
- filemtime( plugin_dir_path( __FILE__ ) . 'dist/full-site-editing.js' ),
125
  true
126
  );
127
 
@@ -137,8 +137,8 @@ class Full_Site_Editing {
137
  );
138
 
139
  $style_file = is_rtl()
140
- ? 'full-site-editing.rtl.css'
141
- : 'full-site-editing.css';
142
  wp_enqueue_style(
143
  'a8c-full-site-editing-style',
144
  plugins_url( 'dist/' . $style_file, __FILE__ ),
@@ -154,39 +154,39 @@ class Full_Site_Editing {
154
  register_block_type(
155
  'a8c/navigation-menu',
156
  array(
157
- 'attributes' => [
158
- 'className' => [
159
  'type' => 'string',
160
  'default' => '',
161
- ],
162
- 'align' => [
163
  'type' => 'string',
164
  'default' => 'wide',
165
- ],
166
- 'textAlign' => [
167
  'type' => 'string',
168
  'default' => 'center',
169
- ],
170
- 'textColor' => [
171
  'type' => 'string',
172
- ],
173
- 'customTextColor' => [
174
  'type' => 'string',
175
- ],
176
- 'backgroundColor' => [
177
  'type' => 'string',
178
- ],
179
- 'customBackgroundColor' => [
180
  'type' => 'string',
181
- ],
182
- 'fontSize' => [
183
  'type' => 'string',
184
  'default' => 'normal',
185
- ],
186
- 'customFontSize' => [
187
  'type' => 'number',
188
- ],
189
- ],
190
  'render_callback' => __NAMESPACE__ . '\render_navigation_menu_block',
191
  )
192
  );
@@ -616,13 +616,13 @@ class Full_Site_Editing {
616
  register_setting(
617
  'general',
618
  'footercredit',
619
- [
620
- 'show_in_rest' => [
621
  'name' => 'footer_credit',
622
- ],
623
  'type' => 'string',
624
  'description' => __( 'WordPress Footer Credit' ),
625
- ]
626
  );
627
  }
628
  }
23
  *
24
  * @var array
25
  */
26
+ private $template_post_types = array( 'wp_template_part' );
27
 
28
  /**
29
  * Current theme slug.
43
  * Full_Site_Editing constructor.
44
  */
45
  private function __construct() {
46
+ add_action( 'init', array( $this, 'register_blocks' ), 100 );
47
+ add_action( 'init', array( $this, 'register_template_post_types' ) );
48
+ add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_script_and_style' ), 100 );
49
+ add_action( 'the_post', array( $this, 'merge_template_and_post' ) );
50
+ add_filter( 'wp_insert_post_data', array( $this, 'remove_template_components' ), 10, 2 );
51
+ add_filter( 'admin_body_class', array( $this, 'toggle_editor_post_title_visibility' ) );
52
+ add_filter( 'block_editor_settings', array( $this, 'set_block_template' ) );
53
  add_filter( 'body_class', array( $this, 'add_fse_body_class' ) );
54
 
55
+ add_filter( 'post_row_actions', array( $this, 'remove_trash_row_action_for_template_post_types' ), 10, 2 );
56
+ add_filter( 'bulk_actions-edit-wp_template', array( $this, 'remove_trash_bulk_action_for_template_post_type' ) );
57
+ add_action( 'wp_trash_post', array( $this, 'restrict_template_deletion' ) );
58
+ add_action( 'before_delete_post', array( $this, 'restrict_template_deletion' ) );
59
+ add_filter( 'wp_template_type_row_actions', array( $this, 'remove_delete_row_action_for_template_taxonomy' ), 10, 2 );
60
+ add_filter( 'bulk_actions-edit-wp_template_type', array( $this, 'remove_delete_bulk_action_for_template_taxonomy' ) );
61
+ add_action( 'pre_delete_term', array( $this, 'restrict_template_taxonomy_deletion' ), 10, 2 );
62
+ add_action( 'transition_post_status', array( $this, 'restrict_template_drafting' ), 10, 3 );
63
+ add_action( 'admin_menu', array( $this, 'remove_wp_admin_menu_items' ) );
64
 
65
  $this->theme_slug = normalize_theme_slug( get_stylesheet() );
66
  $this->wp_template_inserter = new WP_Template_Inserter( $this->theme_slug );
82
  /**
83
  * Inserts template data for the theme we are currently switching to.
84
  *
85
+ * This insertion will only happen if theme supports dotcom FSE.
86
  * It is hooked into after_switch_theme action.
87
  */
88
  public function insert_default_data() {
89
+ // Bail if current theme doesn't support dotcom FSE.
90
  if ( ! is_theme_supported() ) {
91
  return;
92
  }
115
  * Enqueue assets.
116
  */
117
  public function enqueue_script_and_style() {
118
+ $asset_file = include plugin_dir_path( __FILE__ ) . 'dist/dotcom-fse.asset.php';
119
  $script_dependencies = $asset_file['dependencies'];
120
  wp_enqueue_script(
121
  'a8c-full-site-editing-script',
122
+ plugins_url( 'dist/dotcom-fse.js', __FILE__ ),
123
  is_array( $script_dependencies ) ? $script_dependencies : array(),
124
+ filemtime( plugin_dir_path( __FILE__ ) . 'dist/dotcom-fse.js' ),
125
  true
126
  );
127
 
137
  );
138
 
139
  $style_file = is_rtl()
140
+ ? 'dotcom-fse.rtl.css'
141
+ : 'dotcom-fse.css';
142
  wp_enqueue_style(
143
  'a8c-full-site-editing-style',
144
  plugins_url( 'dist/' . $style_file, __FILE__ ),
154
  register_block_type(
155
  'a8c/navigation-menu',
156
  array(
157
+ 'attributes' => array(
158
+ 'className' => array(
159
  'type' => 'string',
160
  'default' => '',
161
+ ),
162
+ 'align' => array(
163
  'type' => 'string',
164
  'default' => 'wide',
165
+ ),
166
+ 'textAlign' => array(
167
  'type' => 'string',
168
  'default' => 'center',
169
+ ),
170
+ 'textColor' => array(
171
  'type' => 'string',
172
+ ),
173
+ 'customTextColor' => array(
174
  'type' => 'string',
175
+ ),
176
+ 'backgroundColor' => array(
177
  'type' => 'string',
178
+ ),
179
+ 'customBackgroundColor' => array(
180
  'type' => 'string',
181
+ ),
182
+ 'fontSize' => array(
183
  'type' => 'string',
184
  'default' => 'normal',
185
+ ),
186
+ 'customFontSize' => array(
187
  'type' => 'number',
188
+ ),
189
+ ),
190
  'render_callback' => __NAMESPACE__ . '\render_navigation_menu_block',
191
  )
192
  );
616
  register_setting(
617
  'general',
618
  'footercredit',
619
+ array(
620
+ 'show_in_rest' => array(
621
  'name' => 'footer_credit',
622
+ ),
623
  'type' => 'string',
624
  'description' => __( 'WordPress Footer Credit' ),
625
+ )
626
  );
627
  }
628
  }
full-site-editing/dist/full-site-editing.asset.php → dotcom-fse/dist/dotcom-fse.asset.php RENAMED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-server-side-render', 'wp-url'), 'version' => 'b2f69d0a5748cceb5fcee9a1c38948a9');
1
+ <?php return array('dependencies' => array('lodash', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-server-side-render', 'wp-url'), 'version' => 'd8c7cf8fba8b9fc37e432325ba65d4ac');
full-site-editing/dist/full-site-editing.css → dotcom-fse/dist/dotcom-fse.css RENAMED
@@ -1 +1 @@
1
- .wp-block-a8c-navigation-menu.main-navigation{pointer-events:none}.post-content-block__selector{width:300px}.post-content-block__selector a{font-family:sans-serif;font-size:13px;padding-left:8px}.post-content-block__preview{pointer-events:none}.post-content-block__preview:after{content:"";clear:both;display:table}.post-content-block .editor-post-title,.show-post-title-before-content .editor-post-title{display:none}.show-post-title-before-content .post-content-block .editor-post-title{display:block}.block-editor-block-list__layout .post-content__block.is-selected .block-editor-block-contextual-toolbar{display:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit:before{transition:none;border:none;outline:none;box-shadow:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb{display:none}.site-credit__block{display:flex;flex-direction:row;align-items:center;font-size:14px;color:grey}.site-credit__block.has-text-align-center{justify-content:center}.site-credit__block.has-text-align-left{justify-content:flex-start}.site-credit__block.has-text-align-right{justify-content:flex-end}.site-credit__block .site-name{font-weight:700}.site-credit__block .site-credit__selection{margin-left:5px;display:flex;flex-direction:row;align-items:center}.site-credit__block .site-credit__selection .components-base-control .components-base-control__field{margin-bottom:0}.block-editor .wp-block-a8c-site-description:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-ms-input-placeholder{color:transparent}.block-editor .wp-block-a8c-site-title:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-ms-input-placeholder{color:transparent}.template-block{min-height:200px;overflow:hidden;position:relative;margin-top:20px}.post-type-page .editor-styles-wrapper .template-block .fse-template-part{padding:0}.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar[data-type="a8c/template"],.template__block-container:before{display:none}.template__block-container:hover{cursor:pointer}.template__block-container .block-editor-block-list__block-edit [data-block]{margin:0}.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled,.template__block-container:hover .components-disabled{filter:blur(2px);transition:filter .2s linear}.template__block-container .is-navigating-to-template .template-block__overlay,.template__block-container .is-navigating-to-template .template-block__overlay .components-button,.template__block-container.is-selected .template-block__overlay,.template__block-container.is-selected .template-block__overlay .components-button,.template__block-container:hover .template-block__overlay,.template__block-container:hover .template-block__overlay .components-button{opacity:1;transition:opacity .2s linear}.template__block-container .components-disabled{filter:blur(0);transition:filter .2s linear 0s}.template__block-container .block-editor-block-contextual-toolbar,.template__block-container .block-editor-block-list__block-edit:before,.template__block-container .block-editor-block-list__block-mobile-toolbar,.template__block-container .block-editor-block-list__breadcrumb,.template__block-container .block-editor-block-list__insertion-point{display:none}.template__block-container .template-block__overlay{background:hsla(0,0%,100%,.8);border:0 solid rgba(123,134,162,.3);bottom:0;left:0;margin:0;opacity:0;padding:0;position:absolute;right:0;transition:opacity .2s linear 0s;top:0;z-index:2}.is-selected .template__block-container .template-block__overlay{border-color:rgba(66,88,99,.4)}.block-editor-block-list__block:first-child .template__block-container .template-block__overlay{border-bottom-width:1px}.block-editor-block-list__block:last-child .template__block-container .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template__block-container .template-block__overlay{border-width:1px}}.template__block-container .template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s;margin:0 auto}.template__block-container .template-block__overlay .components-button.hidden{display:none}.template__block-container .template-block__overlay .template-block__loading{display:flex;align-items:center;color:#191e23}.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__fieldset,.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__instructions{display:none}.template-block__placeholder .components-spinner{margin:0 auto}.close-button-override-thin,.post-type-page .edit-post-fullscreen-mode-close__toolbar,.post-type-post .edit-post-fullscreen-mode-close__toolbar,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar{display:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override{display:flex;align-items:center;padding:9px 10px;margin-left:-8px;border:none;border-right:1px solid #e2e4e7}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:visited,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:visited,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:visited{text-decoration:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label{font-size:13px}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2{margin-left:-7px}@media (max-width:599px){.post-type-page .edit-post-fullscreen-mode-close__toolbar__override,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override{margin-left:-2px}}@media (max-width:400px){.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide{display:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin{display:flex}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label{display:none}}.post-type-wp_template_part .edit-post-post-status,.post-type-wp_template_part .editor-post-title,.post-type-wp_template_part .editor-post-trash{display:none}.post-type-wp_template_part .edit-post-visual-editor{margin-top:20px;padding-top:0}.post-type-wp_template_part .editor-post-switch-to-draft{display:none}@media (min-width:768px){.post-type-page .edit-post-editor-regions__content,.post-type-wp_template_part .edit-post-editor-regions__content{background:#eee}.post-type-page .edit-post-editor-regions__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-editor-regions__content .edit-post-visual-editor{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);flex:none;margin:36px 32px}}.post-type-page .block-editor-block-list__layout,.post-type-wp_template_part .block-editor-block-list__layout{padding-left:0;padding-right:0}.post-type-page .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit,.post-type-page .block-editor-block-list__layout .block-editor-block-list__block[data-align=full],.post-type-wp_template_part .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit,.post-type-wp_template_part .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{margin-left:0;margin-right:0}.post-type-page .block-editor-block-list__block[data-align=wide]>.block-editor-block-list__block-edit,.post-type-wp_template_part .block-editor-block-list__block[data-align=wide]>.block-editor-block-list__block-edit{margin-right:14px;margin-left:14px}@media (max-width:1200px){.post-type-page .wp-block:not([data-align=full]):not([data-align=wide]),.post-type-wp_template_part .wp-block:not([data-align=full]):not([data-align=wide]){max-width:580px}.post-type-page .is-sidebar-opened .wp-block:not([data-align=full]):not([data-align=wide]),.post-type-wp_template_part .is-sidebar-opened .wp-block:not([data-align=full]):not([data-align=wide]){max-width:400px}}.post-type-page .block-editor-writing-flow__click-redirect,.post-type-wp_template_part .block-editor-writing-flow__click-redirect{display:none}.editor-styles-wrapper{background:#fff}.post-type-page .edit-post-visual-editor{padding-top:0}.post-type-page .block-editor-writing-flow{display:block}.post-type-page .wp-block.template__block-container .wp-block-column [data-type="core/social-links"] [data-block]{margin:0}
1
+ .wp-block-a8c-navigation-menu.main-navigation{pointer-events:none}.post-content-block__selector{width:300px}.post-content-block__selector a{font-family:sans-serif;font-size:13px;padding-left:8px}.post-content-block__preview{pointer-events:none}.post-content-block__preview:after{content:"";clear:both;display:table}.post-content-block .editor-post-title,.show-post-title-before-content .editor-post-title{display:none}.show-post-title-before-content .post-content-block .editor-post-title{display:block}.block-editor-block-list__layout .post-content__block.is-selected .block-editor-block-contextual-toolbar{display:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit:before{transition:none;border:none;outline:none;box-shadow:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb{display:none}.site-credit__block{display:flex;flex-direction:row;align-items:center;font-size:14px;color:grey}.site-credit__block.has-text-align-center{justify-content:center}.site-credit__block.has-text-align-left{justify-content:flex-start}.site-credit__block.has-text-align-right{justify-content:flex-end}.site-credit__block .site-name{font-weight:700}.site-credit__block .site-credit__selection{margin-left:5px;display:flex;flex-direction:row;align-items:center}.site-credit__block .site-credit__selection .components-base-control .components-base-control__field{margin-bottom:0}.block-editor .wp-block-a8c-site-description:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-ms-input-placeholder{color:transparent}.block-editor .wp-block-a8c-site-title:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-ms-input-placeholder{color:transparent}.template-block{min-height:200px;overflow:hidden;position:relative;margin-top:20px}.post-type-page .editor-styles-wrapper .template-block .fse-template-part{padding:0}.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar[data-type="a8c/template"],.template__block-container:before{display:none}.template__block-container:hover{cursor:pointer}.template__block-container .block-editor-block-list__block-edit [data-block]{margin:0}.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled,.template__block-container:hover .components-disabled{filter:blur(2px);transition:filter .2s linear}.template__block-container .is-navigating-to-template .template-block__overlay,.template__block-container .is-navigating-to-template .template-block__overlay .components-button,.template__block-container.is-selected .template-block__overlay,.template__block-container.is-selected .template-block__overlay .components-button,.template__block-container:hover .template-block__overlay,.template__block-container:hover .template-block__overlay .components-button{opacity:1;transition:opacity .2s linear}.template__block-container .components-disabled{filter:blur(0);transition:filter .2s linear 0s}.template__block-container .block-editor-block-contextual-toolbar,.template__block-container .block-editor-block-list__block-edit:before,.template__block-container .block-editor-block-list__block-mobile-toolbar,.template__block-container .block-editor-block-list__breadcrumb,.template__block-container .block-editor-block-list__insertion-point{display:none}.template__block-container .template-block__overlay{background:hsla(0,0%,100%,.8);border:0 solid rgba(123,134,162,.3);bottom:0;left:0;margin:0;opacity:0;padding:0;position:absolute;right:0;transition:opacity .2s linear 0s;top:0;z-index:2}.is-selected .template__block-container .template-block__overlay{border-color:rgba(66,88,99,.4)}.block-editor-block-list__block:first-child .template__block-container .template-block__overlay{border-bottom-width:1px}.block-editor-block-list__block:last-child .template__block-container .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template__block-container .template-block__overlay{border-width:1px}}.template__block-container .template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s;margin:0 auto}.template__block-container .template-block__overlay .components-button.hidden{display:none}.template__block-container .template-block__overlay .template-block__loading{display:flex;align-items:center;color:#191e23}.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__fieldset,.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__instructions{display:none}.template-block__placeholder .components-spinner{margin:0 auto}.close-button-override-thin,.post-type-page .edit-post-fullscreen-mode-close__toolbar,.post-type-post .edit-post-fullscreen-mode-close__toolbar,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar{display:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override{display:flex;align-items:center;padding:9px 10px;margin-left:-8px;border:none;border-right:1px solid #e2e4e7}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:visited,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:visited,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:visited{text-decoration:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label{font-size:13px}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2{margin-left:-7px}@media (max-width:599px){.post-type-page .edit-post-fullscreen-mode-close__toolbar__override,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override{margin-left:-2px}}@media (max-width:400px){.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide{display:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin{display:flex}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label{display:none}}.post-type-wp_template_part .edit-post-post-status,.post-type-wp_template_part .editor-post-title,.post-type-wp_template_part .editor-post-trash{display:none}.post-type-wp_template_part .edit-post-visual-editor{margin-top:20px;padding-top:0}.post-type-wp_template_part .editor-post-switch-to-draft{display:none}@media (min-width:768px){.post-type-page .edit-post-editor-regions__content,.post-type-wp_template_part .edit-post-editor-regions__content{background:#eee}.post-type-page .edit-post-editor-regions__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-editor-regions__content .edit-post-visual-editor{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);flex:none;margin:36px 32px}}.post-type-page .block-editor-block-list__layout,.post-type-wp_template_part .block-editor-block-list__layout{padding-left:0;padding-right:0}.post-type-page .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit,.post-type-page .block-editor-block-list__layout .block-editor-block-list__block[data-align=full],.post-type-wp_template_part .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit,.post-type-wp_template_part .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{margin-left:0;margin-right:0}.post-type-page .block-editor-block-list__block[data-align=wide]>.block-editor-block-list__block-edit,.post-type-wp_template_part .block-editor-block-list__block[data-align=wide]>.block-editor-block-list__block-edit{margin-right:14px;margin-left:14px}@media (max-width:1200px){.post-type-page .wp-block:not([data-align=full]):not([data-align=wide]),.post-type-wp_template_part .wp-block:not([data-align=full]):not([data-align=wide]){max-width:580px}.post-type-page .is-sidebar-opened .wp-block:not([data-align=full]):not([data-align=wide]),.post-type-wp_template_part .is-sidebar-opened .wp-block:not([data-align=full]):not([data-align=wide]){max-width:400px}}.post-type-page .block-editor-writing-flow__click-redirect,.post-type-wp_template_part .block-editor-writing-flow__click-redirect{display:none}.editor-styles-wrapper{background:#fff}.post-type-page .edit-post-visual-editor{padding-top:0}.post-type-page .block-editor-writing-flow{display:block}.post-type-page .wp-block.template__block-container .wp-block-column [data-type="core/social-links"] [data-block]{margin:0}
full-site-editing/dist/full-site-editing.js → dotcom-fse/dist/dotcom-fse.js RENAMED
@@ -1,2 +1,6 @@
1
- /*! For license information please see full-site-editing.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 r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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=45)}([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.blockEditor}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.compose}()},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){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var o=n(6);function r(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?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(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 r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var c=r.apply(null,o);c&&e.push(c)}else if("object"===i)for(var l in o)n.call(o,l)&&o[l]&&e.push(l)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){var o=n(34),r=n(35),i=n(36);e.exports=function(e,t){return o(e)||r(e,t)||i()}},function(e,t){!function(){e.exports=this.wp.domReady}()},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){},function(e,t){!function(){e.exports=this.wp.serverSideRender}()},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){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,n){var o=n(30),r=n(31);e.exports=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?r(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(32);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.editor}()},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){!function(){e.exports=this.ReactDOM}()},function(e,t,n){var o=n(41),r=n(42),i=n(43);e.exports=function(e){return o(e)||r(e)||i()}},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t,n){},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){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 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){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],o=!0,r=!1,i=void 0;try{for(var c,l=e[Symbol.iterator]();!(o=(c=l.next()).done)&&(n.push(c.value),!t||n.length!==t);o=!0);}catch(a){r=!0,i=a}finally{try{o||null==l.return||l.return()}finally{if(r)throw i}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},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,n){},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(7),i=n(1),c=n(10),l=n.n(c),a=n(18),s=n.n(a),u=n(4),p=n(2),d=n(5),b=n(3),f=Object(u.compose)([Object(p.withColors)("backgroundColor",{textColor:"color"}),Object(p.withFontSizes)("fontSize"),Object(b.withSelect)((function(e){return{isPublished:e("core/editor").isCurrentPostPublished()}}))])((function(e){var t=e.attributes,n=e.backgroundColor,r=e.fontSize,c=e.setAttributes,a=e.setBackgroundColor,u=e.setFontSize,b=e.setTextColor,f=e.textColor,m=e.isPublished,O=t.customFontSize,g=t.textAlign,j=O||r.size;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,Object(o.createElement)(p.AlignmentToolbar,{value:g,onChange:function(e){c({textAlign:e})}})),Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(d.PanelBody,{className:"blocks-font-size",title:Object(i.__)("Text Settings")},Object(o.createElement)(p.FontSizePicker,{onChange:u,value:j})),Object(o.createElement)(p.PanelColorSettings,{title:Object(i.__)("Color Settings"),initialOpen:!1,colorSettings:[{value:n.color,onChange:a,label:Object(i.__)("Background Color")},{value:f.color,onChange:b,label:Object(i.__)("Text Color")}]},Object(o.createElement)(p.ContrastChecker,l()({textColor:f.color,backgroundColor:n.color},{fontSize:j})))),Object(o.createElement)(s.a,{isPublished:m,block:"a8c/navigation-menu",attributes:t}))})),m=(n(29),Object(o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M12 7.27l4.28 10.43-3.47-1.53-.81-.36-.81.36-3.47 1.53L12 7.27M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71L12 2z"})));Object(r.registerBlockType)("a8c/navigation-menu",{title:Object(i.__)("Navigation Menu"),description:Object(i.__)("Visual placeholder for site-wide navigation and menus."),icon:m,category:"layout",supports:{align:["wide","full","right","left"],html:!1,reusable:!1},edit:f,save:function(){return null}});var O=n(12),g=n(6),j=n.n(g),v=n(19),h=n.n(v),y=n(20),_=n.n(y),S=n(21),E=n.n(S),k=n(22),w=n.n(k),C=n(23),x=n.n(C),P=n(11),T=n.n(P),B=n(24),I=function(e){function t(){return h()(this,t),E()(this,w()(t).apply(this,arguments))}return x()(t,e),_()(t,[{key:"toggleEditing",value:function(){var e=this.props,t=e.isEditing;(0,e.setState)({isEditing:!t})}},{key:"onSelectPost",value:function(e){var t=e.id,n=e.type;this.props.setState({isEditing:!1,selectedPostId:t,selectedPostType:n})}},{key:"render",value:function(){var e=this.props.attributes.align;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:T()("post-content-block",j()({},"align".concat(e),e))},Object(o.createElement)(B.PostTitle,null),Object(o.createElement)(p.InnerBlocks,{templateLock:!1})))}}]),t}(o.Component),N=Object(u.compose)([Object(u.withState)({isEditing:!1,selectedPostId:void 0,selectedPostType:void 0}),Object(b.withSelect)((function(e,t){var n=t.selectedPostId,o=t.selectedPostType;return{selectedPost:(0,e("core").getEntityRecord)("postType",o,n)}}))])(I);n(33);Object(r.registerBlockType)("a8c/post-content",{title:Object(i.__)("Content"),description:Object(i.__)("The page content."),icon:"layout",category:"layout",supports:{align:["full"],anchor:!1,customClassName:!1,html:!1,inserter:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"full"}},edit:N,save:function(){return Object(o.createElement)(p.InnerBlocks.Content,null)}});var A=Object(u.createHigherOrderComponent)((function(e){return function(t){return"a8c/post-content"!==t.name?Object(o.createElement)(e,t):Object(o.createElement)(e,l()({},t,{className:"post-content__block"}))}}),"addContentSlotClassname");Object(O.addFilter)("editor.BlockListBlock","full-site-editing/blocks/post-content",A,9);var z=n(9),D=n.n(z),F=n(13),L=n.n(F),R=n(15),V=n.n(R),M=n(16);function U(e){var t=Object(o.useRef)();return Object(o.useEffect)((function(){t.current=e}),[e]),t.current}function H(e,t,n,r,c,l){var a=Object(o.useState)({option:t,previousOption:"",loaded:!1,error:!1}),s=L()(a,2),u=s[0],p=s[1],d=U(r),b=U(c);function f(){p(D()({},u,{option:u.previousOption,isSaving:!1}))}return Object(o.useEffect)((function(){u.loaded||u.error?function(){var t=u.option,o=u.previousOption,l=!o&&!t||t&&o&&t.trim()===o.trim(),a=!t||0===t.trim().length;!r&&d&&a&&f();if(!c||l)return;!b&&c&&function(t){p(D()({},u,{isSaving:!0})),V()({path:"/wp/v2/settings",method:"POST",data:j()({},e,t)}).then((function(){return function(e){p(D()({},u,{previousOption:e,isDirty:!1,isSaving:!1}))}(t)})).catch((function(){n(Object(i.sprintf)(Object(i.__)("Unable to save site %s"),e)),f()}))}(t)}():V()({path:"/wp/v2/settings"}).then((function(t){return p(D()({},u,{option:Object(M.decodeEntities)(t[e]),previousOption:Object(M.decodeEntities)(t[e]),loaded:!0,error:!1}))})).catch((function(){n(Object(i.sprintf)(Object(i.__)("Unable to load site %s"),e)),p(D()({},u,{option:Object(i.sprintf)(Object(i.__)("Error loading site %s"),e),error:!0}))}))})),{siteOptions:u,handleChange:function(e){l({updated:Date.now()}),p(D()({},u,{option:e}))}}}var W=function(e){return Object(u.createHigherOrderComponent)((function(t){return Object(u.pure)((function(n){var r=Object(b.useSelect)((function(e){var t=e("core/editor"),n=t.isSavingPost,o=t.isPublishingPost,r=t.isAutosavingPost,i=t.isCurrentPostPublished;return(n()&&i()||o())&&!r()})),i=Object(b.useDispatch)((function(e){return e("core/notices").createErrorNotice})),c=n.isSelected,a=n.setAttributes,s=Object.keys(e).reduce((function(t,n){var o=e[n],l=H(o.optionName,o.defaultValue,i,c,r,a),s=l.siteOptions,u=l.handleChange;return t[n]={value:s.option,updateValue:u,loaded:s.loaded},t}),{});return Object(o.createElement)(t,l()({},n,s))}))}),"withSiteOptions")},q=fullSiteEditing.footerCreditOptions,G=function(e){var t=e.choice,n=q.find((function(e){return e.value===t}));if(!n)return null;var r=n.renderType,i=n.renderProps,c=n.label,l=D()({label:c},i);return"icon"===r?Object(o.createElement)(d.Icon,l):Object(o.createElement)("span",null," ",l.label," ")},Q=fullSiteEditing,Y=Q.footerCreditOptions,J=Q.defaultCreditOption;var K=Object(u.compose)([W({siteTitleOption:{optionName:"title",defaultValue:Object(i.__)("Site title loading…")},footerCreditOption:{optionName:"footer_credit",defaultValue:Object(i.__)("Footer credit loading…")}})])((function(e){var t=e.attributes.textAlign,n=void 0===t?"center":t,r=e.isSelected,i=e.setAttributes,c=e.footerCreditOption,l=c.value,a=c.updateValue,s=e.siteTitleOption.value,u=l||J;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,Object(o.createElement)(p.AlignmentToolbar,{value:n,onChange:function(e){i({textAlign:e})}})),Object(o.createElement)("div",{className:T()("site-info","site-credit__block",j()({},"has-text-align-".concat(n),n))},Object(o.createElement)("span",{className:"site-name"},s),Object(o.createElement)("span",{className:"comma"},","),Object(o.createElement)("span",{className:"site-credit__selection"},r?Object(o.createElement)(d.SelectControl,{onChange:a,value:u,options:Y}):Object(o.createElement)(G,{choice:u}))))}));n(37);Object(r.registerBlockType)("a8c/site-credit",{title:Object(i.__)("WordPress.com Credit"),description:Object(i.__)("This block tells the world that you're using WordPress.com."),icon:"wordpress-alt",category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1,removal:!1},attributes:{align:{type:"string",default:"wide"},textAlign:{type:"string",default:"center"}},edit:K,save:function(){return null}});var X=n(8);var Z=Object(u.compose)([Object(p.withColors)("backgroundColor",{textColor:"color"}),Object(p.withFontSizes)("fontSize"),Object(b.withSelect)((function(e,t){var n=t.clientId,o=e("core/block-editor"),r=o.getBlockIndex,i=o.getBlockRootClientId,c=o.getTemplateLock,l=i(n);return{blockIndex:r(n,l),isLocked:!!c(l),rootClientId:l}})),Object(b.withDispatch)((function(e,t){var n=t.blockIndex,o=t.rootClientId;return{insertDefaultBlock:function(){return e("core/block-editor").insertDefaultBlock({},o,n+1)}}})),W({siteDescription:{optionName:"description",defaultValue:Object(i.__)("Site description loading…")}})])((function(e){var t,n=e.attributes,r=e.backgroundColor,c=e.className,a=e.fontSize,s=e.insertDefaultBlock,u=e.setAttributes,b=e.setBackgroundColor,f=e.setFontSize,m=e.setTextColor,O=e.siteDescription,g=e.textColor,v=n.customFontSize,h=n.textAlign,y=v||a.size,_=O.value,S=O.updateValue;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,Object(o.createElement)(p.AlignmentToolbar,{value:h,onChange:function(e){u({textAlign:e})}})),Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(d.PanelBody,{className:"blocks-font-size",title:Object(i.__)("Text Settings")},Object(o.createElement)(p.FontSizePicker,{onChange:f,value:y})),Object(o.createElement)(p.PanelColorSettings,{title:Object(i.__)("Color Settings"),initialOpen:!1,colorSettings:[{value:r.color,onChange:b,label:Object(i.__)("Background Color")},{value:g.color,onChange:m,label:Object(i.__)("Text Color")}]},Object(o.createElement)(p.ContrastChecker,l()({textColor:g.color,backgroundColor:r.color},{fontSize:y})))),Object(o.createElement)(p.RichText,{allowedFormats:[],"aria-label":Object(i.__)("Site Description"),className:T()("site-description",c,(t={"has-text-color":g.color,"has-background":r.color},j()(t,"has-text-align-".concat(h),h),j()(t,r.class,r.class),j()(t,g.class,g.class),j()(t,a.class,!v&&a.class),t)),identifier:"content",onChange:S,onReplace:s,onSplit:X.noop,placeholder:Object(i.__)("Add a Site Description"),style:{backgroundColor:r.color,color:g.color,fontSize:y?y+"px":void 0},tagName:"p",value:_}))}));n(38);Object(r.registerBlockType)("a8c/site-description",{title:Object(i.__)("Site Description"),description:Object(i.__)("Site description, also known as the tagline."),icon:Object(o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"})),category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"},textAlign:{type:"string",default:"center"},textColor:{type:"string"},customTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},fontSize:{type:"string",default:"small"},customFontSize:{type:"number"}},edit:Z,save:function(){return null}});var $=Object(u.compose)([Object(p.withColors)({textColor:"color"}),Object(p.withFontSizes)("fontSize"),Object(b.withSelect)((function(e,t){var n=t.clientId,o=e("core/block-editor"),r=o.getBlockIndex,i=o.getBlockRootClientId,c=o.getTemplateLock,l=i(n);return{blockIndex:r(n,l),isLocked:!!c(l),rootClientId:l}})),Object(b.withDispatch)((function(e,t){var n=t.blockIndex,o=t.rootClientId;return{insertDefaultBlock:function(){return e("core/block-editor").insertDefaultBlock({},o,n+1)}}})),W({siteTitle:{optionName:"title",defaultValue:Object(i.__)("Site title loading…")}})])((function(e){var t,n=e.attributes,r=e.className,c=e.fontSize,l=e.insertDefaultBlock,a=e.setAttributes,s=e.setFontSize,u=e.setTextColor,b=e.siteTitle,f=e.textColor,m=n.customFontSize,O=n.textAlign,g=m||c.size,v=b.value,h=b.updateValue;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,Object(o.createElement)(p.AlignmentToolbar,{value:O,onChange:function(e){a({textAlign:e})}})),Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(d.PanelBody,{className:"blocks-font-size",title:Object(i.__)("Text Settings")},Object(o.createElement)(p.FontSizePicker,{onChange:s,value:g})),Object(o.createElement)(p.PanelColorSettings,{title:Object(i.__)("Color Settings"),initialOpen:!1,colorSettings:[{value:f.color,onChange:u,label:Object(i.__)("Text Color")}]})),Object(o.createElement)(p.RichText,{allowedFormats:[],"aria-label":Object(i.__)("Site Title"),className:T()("site-title",r,(t={"has-text-color":f.color},j()(t,"has-text-align-".concat(O),O),j()(t,f.class,f.class),j()(t,c.class,!m&&c.class),t)),identifier:"content",onChange:h,onReplace:l,onSplit:X.noop,placeholder:Object(i.__)("Add a Site Title"),style:{color:f.color,fontSize:g?g+"px":void 0},tagName:"h1",value:v}))}));n(39);Object(r.registerBlockType)("a8c/site-title",{title:Object(i.__)("Site Title"),description:Object(i.__)("Your site title."),icon:"layout",category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"},textAlign:{type:"string",default:"center"},textColor:{type:"string"},customTextColor:{type:"string"},fontSize:{type:"string",default:"normal"},customFontSize:{type:"number"}},edit:$,save:function(){return null}});var ee=n(25),te=(n(17),Object(u.compose)(Object(u.withState)({templateClientId:null}),Object(b.withSelect)((function(e,t){var n=t.attributes,o=t.templateClientId,r=e("core").getEntityRecord,i=e("core/editor"),c=i.getCurrentPostId,l=i.isEditedPostDirty,a=e("core/block-editor"),s=a.getBlock,u=a.getSelectedBlock,p=e("core/edit-post").isEditorSidebarOpened,d=n.templateId,b=c(),f=d&&r("postType","wp_template_part",d),m=Object(ee.addQueryArgs)(fullSiteEditing.editTemplateBaseUrl,{post:d,fse_parent_post:b}),O=u();return{currentPostId:b,editTemplateUrl:m,template:f,templateBlock:s(o),templateTitle:Object(X.get)(f,["title","rendered"],""),isDirty:l(),isEditorSidebarOpened:!!p(),isAnyTemplateBlockSelected:O&&"a8c/template"===O.name}})),Object(b.withDispatch)((function(e,t){var n=e("core/block-editor").receiveBlocks,o=e("core/edit-post").openGeneralSidebar,i=t.template,c=t.templateClientId,l=t.setState;return{savePost:e("core/editor").savePost,receiveTemplateBlocks:function(){if(i&&!c){var e=Object(r.parse)(Object(X.get)(i,["content","raw"],"")),t=Object(r.createBlock)("core/group",{},e);n([t]),l({templateClientId:t.clientId})}},openGeneralSidebar:o}})))((function(e){var t,n=e.attributes,r=e.editTemplateUrl,c=e.receiveTemplateBlocks,l=e.template,a=e.templateBlock,s=e.templateTitle,u=e.isDirty,b=e.savePost,f=e.isEditorSidebarOpened,m=e.openGeneralSidebar,O=e.isAnyTemplateBlockSelected;if(!l)return Object(o.createElement)(d.Placeholder,{className:"template-block__placeholder"},Object(o.createElement)(d.Spinner,null));var g=Object(o.createRef)(),v=Object(o.useState)(!1),h=L()(v,2),y=h[0],_=h[1];Object(o.useEffect)((function(){y&&!u&&g.current.click(),c()})),Object(o.useEffect)((function(){var e=document.querySelector(".edit-post-sidebar__panel-tabs ul li:last-child");if(f&&e){if(O)return m("edit-post/document"),void e.classList.add("hidden");e.classList.remove("hidden")}}),[O,f,m]);var S=n.align,E=n.className,k=function(e){e.stopPropagation(),_(!0),u&&(e.preventDefault(),b())};return Object(o.createElement)("div",{className:T()("template-block",(t={},j()(t,"align".concat(S),S),j()(t,"is-navigating-to-template",y),t))},a&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(d.Disabled,null,Object(o.createElement)("div",{className:E},Object(o.createElement)(p.BlockEdit,{attributes:a.attributes,block:a,clientId:a.clientId,isSelected:!1,name:a.name,setAttributes:X.noop}))),Object(o.createElement)(d.Placeholder,{className:"template-block__overlay",onClick:k},y&&Object(o.createElement)("div",{className:"template-block__loading"},Object(o.createElement)(d.Spinner,null)," ",Object(i.sprintf)(Object(i.__)("Loading editor for: %s"),s)),Object(o.createElement)(d.Button,{className:y?"hidden":null,href:r,onClick:k,isDefault:!0,isLarge:!0,ref:g},Object(i.sprintf)(Object(i.__)("Edit %s"),s)))))}))),ne=Object(u.createHigherOrderComponent)((function(e){return function(t){return"fse-site-logo"!==t.attributes.className?Object(o.createElement)(e,t):Object(o.createElement)(e,l()({},t,{className:"template__site-logo"}))}}),"addFSESiteLogoClassname");Object(O.addFilter)("editor.BlockListBlock","full-site-editing/blocks/template",ne),"wp_template_part"!==fullSiteEditing.editorPostType&&Object(r.registerBlockType)("a8c/template",{title:Object(i.__)("Template Part"),__experimentalDisplayName:"label",description:Object(i.__)("Display a Template Part."),icon:"layout",category:"layout",attributes:{templateId:{type:"number"},className:{type:"string"},label:{type:"string"}},supports:{anchor:!1,customClassName:!1,html:!1,inserter:!1,reusable:!1},edit:te,save:function(){return null},getEditWrapperProps:function(){return{"data-align":"full"}}});var oe=Object(u.createHigherOrderComponent)((function(e){return function(t){return"a8c/template"!==t.name?Object(o.createElement)(e,t):Object(o.createElement)(e,l()({},t,{className:"template__block-container"}))}}),"addFSETemplateClassname");Object(O.addFilter)("editor.BlockListBlock","full-site-editing/blocks/template",oe,9);var re=n(14),ie=n.n(re),ce=n(26),le=n.n(ce);n(40);function ae(e){var t=e.defaultLabel,n=e.defaultUrl,r=Object(o.useState)(t),i=L()(r,2),c=i[0],l=i[1],a=Object(o.useState)(n),s=L()(a,2),u=s[0],p=s[1];return window.wp.hooks.addAction("updateCloseButtonOverrides","a8c-fse",(function(e){l(e.label),p(e.closeUrl)})),Object(o.createElement)("a",{href:u,"aria-label":c},Object(o.createElement)(d.Button,{className:"components-button components-icon-button"},Object(o.createElement)(d.Dashicon,{icon:"arrow-left-alt2"}),Object(o.createElement)("div",{className:"close-button-override__label"},c)))}ie()((function(){var e=fullSiteEditing.editorPostType;if("wp_template_part"===e||"page"===e||"post"===e)var t=setInterval((function(){var n=document.querySelector(".edit-post-header__toolbar");if(n){clearInterval(t);var r=document.createElement("div");r.className="components-toolbar edit-post-fullscreen-mode-close__toolbar edit-post-fullscreen-mode-close__toolbar__override",n.prepend(r);var c=fullSiteEditing,l=c.closeButtonLabel,a=c.closeButtonUrl,s=window.calypsoifyGutenberg;s&&s.closeUrl&&(a=s.closeUrl),s&&s.closeButtonLabel&&(l=s.closeButtonLabel);var u=a||"edit.php?post_type=".concat(e),p=l||"Back";"page"!==e||l?"post"!==e||l?"wp_template_part"!==e||l||(p=Object(i.__)("Template Parts")):p=Object(i.__)("Posts"):p=Object(i.__)("Pages"),le.a.render(Object(o.createElement)(ae,{defaultLabel:p,defaultUrl:u}),r)}}))}));var se=n(27),ue=n.n(se),pe=n(28),de=Object(b.withSelect)((function(e){var t=e("core").getEntityRecord,n=e("core/editor").getEditedPostAttribute;return{templateClasses:Object(X.map)(n("template_part_types"),(function(e){var n=Object(X.get)(t("taxonomy","wp_template_part_type",e),"name","");return Object(X.endsWith)(n,"-header")?"fse-header":Object(X.endsWith)(n,"-footer")?"fse-footer":void 0}))}}))((function(e){var t=e.templateClasses,n=setInterval((function(){var e=document.querySelector(".block-editor__typewriter > div");e&&(clearInterval(n),e.className=T.a.apply(void 0,["a8c-template-editor fse-template-part"].concat(ue()(t))))}));return null}));"wp_template_part"===fullSiteEditing.editorPostType&&Object(pe.registerPlugin)("fse-editor-template-classes",{render:de}),ie()((function(){"wp_template_part"===fullSiteEditing.editorPostType&&Object(b.dispatch)("core/notices").createNotice("info",Object(i.__)("Updates to this template will affect all pages on your site."),{isDismissible:!1})}));var be=Object(u.compose)(Object(b.withSelect)((function(e){var t=e("core/editor").getEditorSettings,n=e("core/block-editor").getBlocks,o=e("core/edit-post").getEditorMode,r=n().find((function(e){return"a8c/post-content"===e.name}));return{rootClientId:r?r.clientId:"",showInserter:"visual"===o()&&t().richEditingEnabled}})))((function(e){var t=e.rootClientId,n=e.showInserter;return Object(o.createElement)(p.Inserter,{rootClientId:t,disabled:!n,position:"bottom right"})}));ie()((function(){return function(){if("page"===fullSiteEditing.editorPostType)var e=setInterval((function(){var t=document.querySelector(".edit-post-header-toolbar");if(t){clearInterval(e);var n=document.createElement("div");n.classList.add("fse-post-content-block-inserter"),t.insertBefore(n,t.firstChild),Object(o.render)(Object(o.createElement)(be,null),n)}}))}()}));var fe=Object(b.subscribe)((function(){if("page"!==fullSiteEditing.editorPostType)return fe();!1===Object(b.select)("core/block-editor").isValidTemplate()&&Object(b.dispatch)("core/block-editor").setTemplateValidity(!0)})),me=["logo","brand","emblem","hallmark"];Object(O.addFilter)("blocks.registerBlockType","full-site-editing/editor/image-block-keywords",(function(e,t){return"core/image"!==t?e:e=Object(X.assign)({},e,{keywords:e.keywords.concat(me)})}));n(44);Object(b.use)((function(e){return{dispatch:function(t){var n=D()({},e.dispatch(t)),o=fullSiteEditing.editorPostType;return"core/editor"===t&&n.trashPost&&"wp_template_part"===o&&(n.trashPost=function(){}),n}}})),Object(b.use)((function(e){return{dispatch:function(t){var n=D()({},e.dispatch(t)),o=fullSiteEditing.editorPostType;if("core/editor"===t&&n.editPost&&"wp_template_part"===o){var r=n.editPost;n.editPost=function(e){"draft"!==e.status&&r(e)}}return n}}}));var Oe=Object(b.subscribe)((function(){var e=Object(b.dispatch)("core/edit-post").removeEditorPanel;return"page"===fullSiteEditing.editorPostType&&e("featured-image"),"wp_template_part"===fullSiteEditing.editorPostType&&e("post-status"),Oe()}))}]));
 
 
 
 
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 r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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=45)}([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.blockEditor}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.compose}()},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){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t,n){var o=n(6);function r(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?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(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;
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 r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var c=r.apply(null,o);c&&e.push(c)}else if("object"===i)for(var l in o)n.call(o,l)&&o[l]&&e.push(l)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){var o=n(34),r=n(35),i=n(36);e.exports=function(e,t){return o(e)||r(e,t)||i()}},function(e,t){!function(){e.exports=this.wp.domReady}()},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.htmlEntities}()},function(e,t,n){},function(e,t){!function(){e.exports=this.wp.serverSideRender}()},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){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,n){var o=n(30),r=n(31);e.exports=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?r(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(32);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.editor}()},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){!function(){e.exports=this.ReactDOM}()},function(e,t,n){var o=n(41),r=n(42),i=n(43);e.exports=function(e){return o(e)||r(e)||i()}},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t,n){},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){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 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){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],o=!0,r=!1,i=void 0;try{for(var c,l=e[Symbol.iterator]();!(o=(c=l.next()).done)&&(n.push(c.value),!t||n.length!==t);o=!0);}catch(a){r=!0,i=a}finally{try{o||null==l.return||l.return()}finally{if(r)throw i}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},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,n){},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(7),i=n(1),c=n(10),l=n.n(c),a=n(18),s=n.n(a),u=n(4),p=n(2),d=n(5),b=n(3),f=Object(u.compose)([Object(p.withColors)("backgroundColor",{textColor:"color"}),Object(p.withFontSizes)("fontSize"),Object(b.withSelect)((function(e){return{isPublished:e("core/editor").isCurrentPostPublished()}}))])((function(e){var t=e.attributes,n=e.backgroundColor,r=e.fontSize,c=e.setAttributes,a=e.setBackgroundColor,u=e.setFontSize,b=e.setTextColor,f=e.textColor,m=e.isPublished,O=t.customFontSize,g=t.textAlign,j=O||r.size;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,Object(o.createElement)(p.AlignmentToolbar,{value:g,onChange:function(e){c({textAlign:e})}})),Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(d.PanelBody,{className:"blocks-font-size",title:Object(i.__)("Text Settings")},Object(o.createElement)(p.FontSizePicker,{onChange:u,value:j})),Object(o.createElement)(p.PanelColorSettings,{title:Object(i.__)("Color Settings"),initialOpen:!1,colorSettings:[{value:n.color,onChange:a,label:Object(i.__)("Background Color")},{value:f.color,onChange:b,label:Object(i.__)("Text Color")}]},Object(o.createElement)(p.ContrastChecker,l()({textColor:f.color,backgroundColor:n.color},{fontSize:j})))),Object(o.createElement)(s.a,{isPublished:m,block:"a8c/navigation-menu",attributes:t}))})),m=(n(29),Object(o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M12 7.27l4.28 10.43-3.47-1.53-.81-.36-.81.36-3.47 1.53L12 7.27M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71L12 2z"})));Object(r.registerBlockType)("a8c/navigation-menu",{title:Object(i.__)("Navigation Menu"),description:Object(i.__)("Visual placeholder for site-wide navigation and menus."),icon:m,category:"layout",supports:{align:["wide","full","right","left"],html:!1,reusable:!1},edit:f,save:function(){return null}});var O=n(12),g=n(6),j=n.n(g),v=n(19),h=n.n(v),y=n(20),_=n.n(y),S=n(21),E=n.n(S),k=n(22),w=n.n(k),C=n(23),x=n.n(C),P=n(11),T=n.n(P),B=n(24),I=function(e){function t(){return h()(this,t),E()(this,w()(t).apply(this,arguments))}return x()(t,e),_()(t,[{key:"toggleEditing",value:function(){var e=this.props,t=e.isEditing;(0,e.setState)({isEditing:!t})}},{key:"onSelectPost",value:function(e){var t=e.id,n=e.type;this.props.setState({isEditing:!1,selectedPostId:t,selectedPostType:n})}},{key:"render",value:function(){var e=this.props.attributes.align;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:T()("post-content-block",j()({},"align".concat(e),e))},Object(o.createElement)(B.PostTitle,null),Object(o.createElement)(p.InnerBlocks,{templateLock:!1})))}}]),t}(o.Component),N=Object(u.compose)([Object(u.withState)({isEditing:!1,selectedPostId:void 0,selectedPostType:void 0}),Object(b.withSelect)((function(e,t){var n=t.selectedPostId,o=t.selectedPostType;return{selectedPost:(0,e("core").getEntityRecord)("postType",o,n)}}))])(I);n(33);Object(r.registerBlockType)("a8c/post-content",{title:Object(i.__)("Content"),description:Object(i.__)("The page content."),icon:"layout",category:"layout",supports:{align:["full"],anchor:!1,customClassName:!1,html:!1,inserter:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"full"}},edit:N,save:function(){return Object(o.createElement)(p.InnerBlocks.Content,null)}});var A=Object(u.createHigherOrderComponent)((function(e){return function(t){return"a8c/post-content"!==t.name?Object(o.createElement)(e,t):Object(o.createElement)(e,l()({},t,{className:"post-content__block"}))}}),"addContentSlotClassname");Object(O.addFilter)("editor.BlockListBlock","full-site-editing/blocks/post-content",A,9);var z=n(9),D=n.n(z),F=n(13),L=n.n(F),R=n(15),V=n.n(R),M=n(16);function U(e){var t=Object(o.useRef)();return Object(o.useEffect)((function(){t.current=e}),[e]),t.current}function H(e,t,n,r,c,l){var a=Object(o.useState)({option:t,previousOption:"",loaded:!1,error:!1}),s=L()(a,2),u=s[0],p=s[1],d=U(r),b=U(c);function f(){p(D()({},u,{option:u.previousOption,isSaving:!1}))}return Object(o.useEffect)((function(){u.loaded||u.error?function(){var t=u.option,o=u.previousOption,l=!o&&!t||t&&o&&t.trim()===o.trim(),a=!t||0===t.trim().length;!r&&d&&a&&f();if(!c||l)return;!b&&c&&function(t){p(D()({},u,{isSaving:!0})),V()({path:"/wp/v2/settings",method:"POST",data:j()({},e,t)}).then((function(){return function(e){p(D()({},u,{previousOption:e,isDirty:!1,isSaving:!1}))}(t)})).catch((function(){n(Object(i.sprintf)(Object(i.__)("Unable to save site %s"),e)),f()}))}(t)}():V()({path:"/wp/v2/settings"}).then((function(t){return p(D()({},u,{option:Object(M.decodeEntities)(t[e]),previousOption:Object(M.decodeEntities)(t[e]),loaded:!0,error:!1}))})).catch((function(){n(Object(i.sprintf)(Object(i.__)("Unable to load site %s"),e)),p(D()({},u,{option:Object(i.sprintf)(Object(i.__)("Error loading site %s"),e),error:!0}))}))})),{siteOptions:u,handleChange:function(e){l({updated:Date.now()}),p(D()({},u,{option:e}))}}}var W=function(e){return Object(u.createHigherOrderComponent)((function(t){return Object(u.pure)((function(n){var r=Object(b.useSelect)((function(e){var t=e("core/editor"),n=t.isSavingPost,o=t.isPublishingPost,r=t.isAutosavingPost,i=t.isCurrentPostPublished;return(n()&&i()||o())&&!r()})),i=Object(b.useDispatch)((function(e){return e("core/notices").createErrorNotice})),c=n.isSelected,a=n.setAttributes,s=Object.keys(e).reduce((function(t,n){var o=e[n],l=H(o.optionName,o.defaultValue,i,c,r,a),s=l.siteOptions,u=l.handleChange;return t[n]={value:s.option,updateValue:u,loaded:s.loaded},t}),{});return Object(o.createElement)(t,l()({},n,s))}))}),"withSiteOptions")},q=fullSiteEditing.footerCreditOptions,G=function(e){var t=e.choice,n=q.find((function(e){return e.value===t}));if(!n)return null;var r=n.renderType,i=n.renderProps,c=n.label,l=D()({label:c},i);return"icon"===r?Object(o.createElement)(d.Icon,l):Object(o.createElement)("span",null," ",l.label," ")},Q=fullSiteEditing,Y=Q.footerCreditOptions,J=Q.defaultCreditOption;var K=Object(u.compose)([W({siteTitleOption:{optionName:"title",defaultValue:Object(i.__)("Site title loading…")},footerCreditOption:{optionName:"footer_credit",defaultValue:Object(i.__)("Footer credit loading…")}})])((function(e){var t=e.attributes.textAlign,n=void 0===t?"center":t,r=e.isSelected,i=e.setAttributes,c=e.footerCreditOption,l=c.value,a=c.updateValue,s=e.siteTitleOption.value,u=l||J;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,Object(o.createElement)(p.AlignmentToolbar,{value:n,onChange:function(e){i({textAlign:e})}})),Object(o.createElement)("div",{className:T()("site-info","site-credit__block",j()({},"has-text-align-".concat(n),n))},Object(o.createElement)("span",{className:"site-name"},s),Object(o.createElement)("span",{className:"comma"},","),Object(o.createElement)("span",{className:"site-credit__selection"},r?Object(o.createElement)(d.SelectControl,{onChange:a,value:u,options:Y}):Object(o.createElement)(G,{choice:u}))))}));n(37);Object(r.registerBlockType)("a8c/site-credit",{title:Object(i.__)("WordPress.com Credit"),description:Object(i.__)("This block tells the world that you're using WordPress.com."),icon:"wordpress-alt",category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1,removal:!1},attributes:{align:{type:"string",default:"wide"},textAlign:{type:"string",default:"center"}},edit:K,save:function(){return null}});var X=n(8);var Z=Object(u.compose)([Object(p.withColors)("backgroundColor",{textColor:"color"}),Object(p.withFontSizes)("fontSize"),Object(b.withSelect)((function(e,t){var n=t.clientId,o=e("core/block-editor"),r=o.getBlockIndex,i=o.getBlockRootClientId,c=o.getTemplateLock,l=i(n);return{blockIndex:r(n,l),isLocked:!!c(l),rootClientId:l}})),Object(b.withDispatch)((function(e,t){var n=t.blockIndex,o=t.rootClientId;return{insertDefaultBlock:function(){return e("core/block-editor").insertDefaultBlock({},o,n+1)}}})),W({siteDescription:{optionName:"description",defaultValue:Object(i.__)("Site description loading…")}})])((function(e){var t,n=e.attributes,r=e.backgroundColor,c=e.className,a=e.fontSize,s=e.insertDefaultBlock,u=e.setAttributes,b=e.setBackgroundColor,f=e.setFontSize,m=e.setTextColor,O=e.siteDescription,g=e.textColor,v=n.customFontSize,h=n.textAlign,y=v||a.size,_=O.value,S=O.updateValue;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,Object(o.createElement)(p.AlignmentToolbar,{value:h,onChange:function(e){u({textAlign:e})}})),Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(d.PanelBody,{className:"blocks-font-size",title:Object(i.__)("Text Settings")},Object(o.createElement)(p.FontSizePicker,{onChange:f,value:y})),Object(o.createElement)(p.PanelColorSettings,{title:Object(i.__)("Color Settings"),initialOpen:!1,colorSettings:[{value:r.color,onChange:b,label:Object(i.__)("Background Color")},{value:g.color,onChange:m,label:Object(i.__)("Text Color")}]},Object(o.createElement)(p.ContrastChecker,l()({textColor:g.color,backgroundColor:r.color},{fontSize:y})))),Object(o.createElement)(p.RichText,{allowedFormats:[],"aria-label":Object(i.__)("Site Description"),className:T()("site-description",c,(t={"has-text-color":g.color,"has-background":r.color},j()(t,"has-text-align-".concat(h),h),j()(t,r.class,r.class),j()(t,g.class,g.class),j()(t,a.class,!v&&a.class),t)),identifier:"content",onChange:S,onReplace:s,onSplit:X.noop,placeholder:Object(i.__)("Add a Site Description"),style:{backgroundColor:r.color,color:g.color,fontSize:y?y+"px":void 0},tagName:"p",value:_}))}));n(38);Object(r.registerBlockType)("a8c/site-description",{title:Object(i.__)("Site Description"),description:Object(i.__)("Site description, also known as the tagline."),icon:Object(o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"})),category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"},textAlign:{type:"string",default:"center"},textColor:{type:"string"},customTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},fontSize:{type:"string",default:"small"},customFontSize:{type:"number"}},edit:Z,save:function(){return null}});var $=Object(u.compose)([Object(p.withColors)({textColor:"color"}),Object(p.withFontSizes)("fontSize"),Object(b.withSelect)((function(e,t){var n=t.clientId,o=e("core/block-editor"),r=o.getBlockIndex,i=o.getBlockRootClientId,c=o.getTemplateLock,l=i(n);return{blockIndex:r(n,l),isLocked:!!c(l),rootClientId:l}})),Object(b.withDispatch)((function(e,t){var n=t.blockIndex,o=t.rootClientId;return{insertDefaultBlock:function(){return e("core/block-editor").insertDefaultBlock({},o,n+1)}}})),W({siteTitle:{optionName:"title",defaultValue:Object(i.__)("Site title loading…")}})])((function(e){var t,n=e.attributes,r=e.className,c=e.fontSize,l=e.insertDefaultBlock,a=e.setAttributes,s=e.setFontSize,u=e.setTextColor,b=e.siteTitle,f=e.textColor,m=n.customFontSize,O=n.textAlign,g=m||c.size,v=b.value,h=b.updateValue;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(p.BlockControls,null,Object(o.createElement)(p.AlignmentToolbar,{value:O,onChange:function(e){a({textAlign:e})}})),Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(d.PanelBody,{className:"blocks-font-size",title:Object(i.__)("Text Settings")},Object(o.createElement)(p.FontSizePicker,{onChange:s,value:g})),Object(o.createElement)(p.PanelColorSettings,{title:Object(i.__)("Color Settings"),initialOpen:!1,colorSettings:[{value:f.color,onChange:u,label:Object(i.__)("Text Color")}]})),Object(o.createElement)(p.RichText,{allowedFormats:[],"aria-label":Object(i.__)("Site Title"),className:T()("site-title",r,(t={"has-text-color":f.color},j()(t,"has-text-align-".concat(O),O),j()(t,f.class,f.class),j()(t,c.class,!m&&c.class),t)),identifier:"content",onChange:h,onReplace:l,onSplit:X.noop,placeholder:Object(i.__)("Add a Site Title"),style:{color:f.color,fontSize:g?g+"px":void 0},tagName:"h1",value:v}))}));n(39);Object(r.registerBlockType)("a8c/site-title",{title:Object(i.__)("Site Title"),description:Object(i.__)("Your site title."),icon:"layout",category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"},textAlign:{type:"string",default:"center"},textColor:{type:"string"},customTextColor:{type:"string"},fontSize:{type:"string",default:"normal"},customFontSize:{type:"number"}},edit:$,save:function(){return null}});var ee=n(25),te=(n(17),Object(u.compose)(Object(u.withState)({templateClientId:null}),Object(b.withSelect)((function(e,t){var n=t.attributes,o=t.templateClientId,r=e("core").getEntityRecord,i=e("core/editor"),c=i.getCurrentPostId,l=i.isEditedPostDirty,a=e("core/block-editor"),s=a.getBlock,u=a.getSelectedBlock,p=e("core/edit-post").isEditorSidebarOpened,d=n.templateId,b=c(),f=d&&r("postType","wp_template_part",d),m=Object(ee.addQueryArgs)(fullSiteEditing.editTemplateBaseUrl,{post:d,fse_parent_post:b}),O=u();return{currentPostId:b,editTemplateUrl:m,template:f,templateBlock:s(o),templateTitle:Object(X.get)(f,["title","rendered"],""),isDirty:l(),isEditorSidebarOpened:!!p(),isAnyTemplateBlockSelected:O&&"a8c/template"===O.name}})),Object(b.withDispatch)((function(e,t){var n=e("core/block-editor").receiveBlocks,o=e("core/edit-post").openGeneralSidebar,i=t.template,c=t.templateClientId,l=t.setState;return{savePost:e("core/editor").savePost,receiveTemplateBlocks:function(){if(i&&!c){var e=Object(r.parse)(Object(X.get)(i,["content","raw"],"")),t=Object(r.createBlock)("core/group",{},e);n([t]),l({templateClientId:t.clientId})}},openGeneralSidebar:o}})))((function(e){var t,n=e.attributes,r=e.editTemplateUrl,c=e.receiveTemplateBlocks,l=e.template,a=e.templateBlock,s=e.templateTitle,u=e.isDirty,b=e.savePost,f=e.isEditorSidebarOpened,m=e.openGeneralSidebar,O=e.isAnyTemplateBlockSelected;if(!l)return Object(o.createElement)(d.Placeholder,{className:"template-block__placeholder"},Object(o.createElement)(d.Spinner,null));var g=Object(o.createRef)(),v=Object(o.useState)(!1),h=L()(v,2),y=h[0],_=h[1];Object(o.useEffect)((function(){y&&!u&&g.current.click(),c()})),Object(o.useEffect)((function(){var e=document.querySelector(".edit-post-sidebar__panel-tabs ul li:last-child");if(f&&e){if(O)return m("edit-post/document"),void e.classList.add("hidden");e.classList.remove("hidden")}}),[O,f,m]);var S=n.align,E=n.className,k=function(e){e.stopPropagation(),_(!0),u&&(e.preventDefault(),b())};return Object(o.createElement)("div",{className:T()("template-block",(t={},j()(t,"align".concat(S),S),j()(t,"is-navigating-to-template",y),t))},a&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(d.Disabled,null,Object(o.createElement)("div",{className:E},Object(o.createElement)(p.BlockEdit,{attributes:a.attributes,block:a,clientId:a.clientId,isSelected:!1,name:a.name,setAttributes:X.noop}))),Object(o.createElement)(d.Placeholder,{className:"template-block__overlay",onClick:k},y&&Object(o.createElement)("div",{className:"template-block__loading"},Object(o.createElement)(d.Spinner,null)," ",Object(i.sprintf)(Object(i.__)("Loading editor for: %s"),s)),Object(o.createElement)(d.Button,{className:y?"hidden":null,href:r,onClick:k,isDefault:!0,isLarge:!0,ref:g},Object(i.sprintf)(Object(i.__)("Edit %s"),s)))))}))),ne=Object(u.createHigherOrderComponent)((function(e){return function(t){return"fse-site-logo"!==t.attributes.className?Object(o.createElement)(e,t):Object(o.createElement)(e,l()({},t,{className:"template__site-logo"}))}}),"addFSESiteLogoClassname");Object(O.addFilter)("editor.BlockListBlock","full-site-editing/blocks/template",ne),"wp_template_part"!==fullSiteEditing.editorPostType&&Object(r.registerBlockType)("a8c/template",{title:Object(i.__)("Template Part"),__experimentalDisplayName:"label",description:Object(i.__)("Display a Template Part."),icon:"layout",category:"layout",attributes:{templateId:{type:"number"},className:{type:"string"},label:{type:"string"}},supports:{anchor:!1,customClassName:!1,html:!1,inserter:!1,reusable:!1},edit:te,save:function(){return null},getEditWrapperProps:function(){return{"data-align":"full"}}});var oe=Object(u.createHigherOrderComponent)((function(e){return function(t){return"a8c/template"!==t.name?Object(o.createElement)(e,t):Object(o.createElement)(e,l()({},t,{className:"template__block-container"}))}}),"addFSETemplateClassname");Object(O.addFilter)("editor.BlockListBlock","full-site-editing/blocks/template",oe,9);var re=n(14),ie=n.n(re),ce=n(26),le=n.n(ce);n(40);function ae(e){var t=e.defaultLabel,n=e.defaultUrl,r=Object(o.useState)(t),i=L()(r,2),c=i[0],l=i[1],a=Object(o.useState)(n),s=L()(a,2),u=s[0],p=s[1];return window.wp.hooks.addAction("updateCloseButtonOverrides","a8c-fse",(function(e){l(e.label),p(e.closeUrl)})),Object(o.createElement)("a",{href:u,"aria-label":c},Object(o.createElement)(d.Button,{className:"components-button components-icon-button"},Object(o.createElement)(d.Dashicon,{icon:"arrow-left-alt2"}),Object(o.createElement)("div",{className:"close-button-override__label"},c)))}ie()((function(){var e=fullSiteEditing.editorPostType;if("wp_template_part"===e||"page"===e||"post"===e)var t=setInterval((function(){var n=document.querySelector(".edit-post-header__toolbar");if(n){clearInterval(t);var r=document.createElement("div");r.className="components-toolbar edit-post-fullscreen-mode-close__toolbar edit-post-fullscreen-mode-close__toolbar__override",n.prepend(r);var c=fullSiteEditing,l=c.closeButtonLabel,a=c.closeButtonUrl,s=window.calypsoifyGutenberg;s&&s.closeUrl&&(a=s.closeUrl),s&&s.closeButtonLabel&&(l=s.closeButtonLabel);var u=a||"edit.php?post_type=".concat(e),p=l||"Back";"page"!==e||l?"post"!==e||l?"wp_template_part"!==e||l||(p=Object(i.__)("Template Parts")):p=Object(i.__)("Posts"):p=Object(i.__)("Pages"),le.a.render(Object(o.createElement)(ae,{defaultLabel:p,defaultUrl:u}),r)}}))}));var se=n(27),ue=n.n(se),pe=n(28),de=Object(b.withSelect)((function(e){var t=e("core").getEntityRecord,n=e("core/editor").getEditedPostAttribute;return{templateClasses:Object(X.map)(n("template_part_types"),(function(e){var n=Object(X.get)(t("taxonomy","wp_template_part_type",e),"name","");return Object(X.endsWith)(n,"-header")?"fse-header":Object(X.endsWith)(n,"-footer")?"fse-footer":void 0}))}}))((function(e){var t=e.templateClasses,n=setInterval((function(){var e=document.querySelector(".block-editor__typewriter > div");e&&(clearInterval(n),e.className=T.a.apply(void 0,["a8c-template-editor fse-template-part"].concat(ue()(t))))}));return null}));"wp_template_part"===fullSiteEditing.editorPostType&&Object(pe.registerPlugin)("fse-editor-template-classes",{render:de}),ie()((function(){"wp_template_part"===fullSiteEditing.editorPostType&&Object(b.dispatch)("core/notices").createNotice("info",Object(i.__)("Updates to this template will affect all pages on your site."),{isDismissible:!1})}));var be=Object(u.compose)(Object(b.withSelect)((function(e){var t=e("core/editor").getEditorSettings,n=e("core/block-editor").getBlocks,o=e("core/edit-post").getEditorMode,r=n().find((function(e){return"a8c/post-content"===e.name}));return{rootClientId:r?r.clientId:"",showInserter:"visual"===o()&&t().richEditingEnabled}})))((function(e){var t=e.rootClientId,n=e.showInserter;return Object(o.createElement)(p.Inserter,{rootClientId:t,disabled:!n,position:"bottom right"})}));ie()((function(){return function(){if("page"===fullSiteEditing.editorPostType)var e=setInterval((function(){var t=document.querySelector(".edit-post-header-toolbar");if(t){clearInterval(e);var n=document.createElement("div");n.classList.add("fse-post-content-block-inserter"),t.insertBefore(n,t.firstChild),Object(o.render)(Object(o.createElement)(be,null),n)}}))}()}));var fe=Object(b.subscribe)((function(){if("page"!==fullSiteEditing.editorPostType)return fe();!1===Object(b.select)("core/block-editor").isValidTemplate()&&Object(b.dispatch)("core/block-editor").setTemplateValidity(!0)})),me=["logo","brand","emblem","hallmark"];Object(O.addFilter)("blocks.registerBlockType","full-site-editing/editor/image-block-keywords",(function(e,t){return"core/image"!==t?e:e=Object(X.assign)({},e,{keywords:e.keywords.concat(me)})}));n(44);Object(b.use)((function(e){return{dispatch:function(t){var n=D()({},e.dispatch(t)),o=fullSiteEditing.editorPostType;return"core/editor"===t&&n.trashPost&&"wp_template_part"===o&&(n.trashPost=function(){}),n}}})),Object(b.use)((function(e){return{dispatch:function(t){var n=D()({},e.dispatch(t)),o=fullSiteEditing.editorPostType;if("core/editor"===t&&n.editPost&&"wp_template_part"===o){var r=n.editPost;n.editPost=function(e){"draft"!==e.status&&r(e)}}return n}}}));var Oe=Object(b.subscribe)((function(){var e=Object(b.dispatch)("core/edit-post").removeEditorPanel;return"page"===fullSiteEditing.editorPostType&&e("featured-image"),"wp_template_part"===fullSiteEditing.editorPostType&&e("post-status"),Oe()}))}]));
full-site-editing/dist/full-site-editing.rtl.css → dotcom-fse/dist/dotcom-fse.rtl.css RENAMED
@@ -1 +1 @@
1
- .wp-block-a8c-navigation-menu.main-navigation{pointer-events:none}.post-content-block__selector{width:300px}.post-content-block__selector a{font-family:sans-serif;font-size:13px;padding-right:8px}.post-content-block__preview{pointer-events:none}.post-content-block__preview:after{content:"";clear:both;display:table}.post-content-block .editor-post-title,.show-post-title-before-content .editor-post-title{display:none}.show-post-title-before-content .post-content-block .editor-post-title{display:block}.block-editor-block-list__layout .post-content__block.is-selected .block-editor-block-contextual-toolbar{display:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit:before{transition:none;border:none;outline:none;box-shadow:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb{display:none}.site-credit__block{display:flex;flex-direction:row;align-items:center;font-size:14px;color:grey}.site-credit__block.has-text-align-center{justify-content:center}.site-credit__block.has-text-align-left{justify-content:flex-start}.site-credit__block.has-text-align-right{justify-content:flex-end}.site-credit__block .site-name{font-weight:700}.site-credit__block .site-credit__selection{margin-right:5px;display:flex;flex-direction:row;align-items:center}.site-credit__block .site-credit__selection .components-base-control .components-base-control__field{margin-bottom:0}.block-editor .wp-block-a8c-site-description:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-ms-input-placeholder{color:transparent}.block-editor .wp-block-a8c-site-title:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-ms-input-placeholder{color:transparent}.template-block{min-height:200px;overflow:hidden;position:relative;margin-top:20px}.post-type-page .editor-styles-wrapper .template-block .fse-template-part{padding:0}.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar[data-type="a8c/template"],.template__block-container:before{display:none}.template__block-container:hover{cursor:pointer}.template__block-container .block-editor-block-list__block-edit [data-block]{margin:0}.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled,.template__block-container:hover .components-disabled{filter:blur(2px);transition:filter .2s linear}.template__block-container .is-navigating-to-template .template-block__overlay,.template__block-container .is-navigating-to-template .template-block__overlay .components-button,.template__block-container.is-selected .template-block__overlay,.template__block-container.is-selected .template-block__overlay .components-button,.template__block-container:hover .template-block__overlay,.template__block-container:hover .template-block__overlay .components-button{opacity:1;transition:opacity .2s linear}.template__block-container .components-disabled{filter:blur(0);transition:filter .2s linear 0s}.template__block-container .block-editor-block-contextual-toolbar,.template__block-container .block-editor-block-list__block-edit:before,.template__block-container .block-editor-block-list__block-mobile-toolbar,.template__block-container .block-editor-block-list__breadcrumb,.template__block-container .block-editor-block-list__insertion-point{display:none}.template__block-container .template-block__overlay{background:hsla(0,0%,100%,.8);border:0 solid rgba(123,134,162,.3);bottom:0;right:0;margin:0;opacity:0;padding:0;position:absolute;left:0;transition:opacity .2s linear 0s;top:0;z-index:2}.is-selected .template__block-container .template-block__overlay{border-color:rgba(66,88,99,.4)}.block-editor-block-list__block:first-child .template__block-container .template-block__overlay{border-bottom-width:1px}.block-editor-block-list__block:last-child .template__block-container .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template__block-container .template-block__overlay{border-width:1px}}.template__block-container .template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s;margin:0 auto}.template__block-container .template-block__overlay .components-button.hidden{display:none}.template__block-container .template-block__overlay .template-block__loading{display:flex;align-items:center;color:#191e23}.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__fieldset,.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__instructions{display:none}.template-block__placeholder .components-spinner{margin:0 auto}.close-button-override-thin,.post-type-page .edit-post-fullscreen-mode-close__toolbar,.post-type-post .edit-post-fullscreen-mode-close__toolbar,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar{display:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override{display:flex;align-items:center;padding:9px 10px;margin-right:-8px;border:none;border-left:1px solid #e2e4e7}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:visited,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:visited,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:visited{text-decoration:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label{font-size:13px}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2{margin-right:-7px}@media (max-width:599px){.post-type-page .edit-post-fullscreen-mode-close__toolbar__override,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override{margin-right:-2px}}@media (max-width:400px){.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide{display:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin{display:flex}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label{display:none}}.post-type-wp_template_part .edit-post-post-status,.post-type-wp_template_part .editor-post-title,.post-type-wp_template_part .editor-post-trash{display:none}.post-type-wp_template_part .edit-post-visual-editor{margin-top:20px;padding-top:0}.post-type-wp_template_part .editor-post-switch-to-draft{display:none}@media (min-width:768px){.post-type-page .edit-post-editor-regions__content,.post-type-wp_template_part .edit-post-editor-regions__content{background:#eee}.post-type-page .edit-post-editor-regions__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-editor-regions__content .edit-post-visual-editor{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);flex:none;margin:36px 32px}}.post-type-page .block-editor-block-list__layout,.post-type-wp_template_part .block-editor-block-list__layout{padding-right:0;padding-left:0}.post-type-page .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit,.post-type-page .block-editor-block-list__layout .block-editor-block-list__block[data-align=full],.post-type-wp_template_part .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit,.post-type-wp_template_part .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{margin-right:0;margin-left:0}.post-type-page .block-editor-block-list__block[data-align=wide]>.block-editor-block-list__block-edit,.post-type-wp_template_part .block-editor-block-list__block[data-align=wide]>.block-editor-block-list__block-edit{margin-left:14px;margin-right:14px}@media (max-width:1200px){.post-type-page .wp-block:not([data-align=full]):not([data-align=wide]),.post-type-wp_template_part .wp-block:not([data-align=full]):not([data-align=wide]){max-width:580px}.post-type-page .is-sidebar-opened .wp-block:not([data-align=full]):not([data-align=wide]),.post-type-wp_template_part .is-sidebar-opened .wp-block:not([data-align=full]):not([data-align=wide]){max-width:400px}}.post-type-page .block-editor-writing-flow__click-redirect,.post-type-wp_template_part .block-editor-writing-flow__click-redirect{display:none}.editor-styles-wrapper{background:#fff}.post-type-page .edit-post-visual-editor{padding-top:0}.post-type-page .block-editor-writing-flow{display:block}.post-type-page .wp-block.template__block-container .wp-block-column [data-type="core/social-links"] [data-block]{margin:0}
1
+ .wp-block-a8c-navigation-menu.main-navigation{pointer-events:none}.post-content-block__selector{width:300px}.post-content-block__selector a{font-family:sans-serif;font-size:13px;padding-right:8px}.post-content-block__preview{pointer-events:none}.post-content-block__preview:after{content:"";clear:both;display:table}.post-content-block .editor-post-title,.show-post-title-before-content .editor-post-title{display:none}.show-post-title-before-content .post-content-block .editor-post-title{display:block}.block-editor-block-list__layout .post-content__block.is-selected .block-editor-block-contextual-toolbar{display:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit:before{transition:none;border:none;outline:none;box-shadow:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb{display:none}.site-credit__block{display:flex;flex-direction:row;align-items:center;font-size:14px;color:grey}.site-credit__block.has-text-align-center{justify-content:center}.site-credit__block.has-text-align-left{justify-content:flex-start}.site-credit__block.has-text-align-right{justify-content:flex-end}.site-credit__block .site-name{font-weight:700}.site-credit__block .site-credit__selection{margin-right:5px;display:flex;flex-direction:row;align-items:center}.site-credit__block .site-credit__selection .components-base-control .components-base-control__field{margin-bottom:0}.block-editor .wp-block-a8c-site-description:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-ms-input-placeholder{color:transparent}.block-editor .wp-block-a8c-site-title:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-ms-input-placeholder{color:transparent}.template-block{min-height:200px;overflow:hidden;position:relative;margin-top:20px}.post-type-page .editor-styles-wrapper .template-block .fse-template-part{padding:0}.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar[data-type="a8c/template"],.template__block-container:before{display:none}.template__block-container:hover{cursor:pointer}.template__block-container .block-editor-block-list__block-edit [data-block]{margin:0}.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled,.template__block-container:hover .components-disabled{filter:blur(2px);transition:filter .2s linear}.template__block-container .is-navigating-to-template .template-block__overlay,.template__block-container .is-navigating-to-template .template-block__overlay .components-button,.template__block-container.is-selected .template-block__overlay,.template__block-container.is-selected .template-block__overlay .components-button,.template__block-container:hover .template-block__overlay,.template__block-container:hover .template-block__overlay .components-button{opacity:1;transition:opacity .2s linear}.template__block-container .components-disabled{filter:blur(0);transition:filter .2s linear 0s}.template__block-container .block-editor-block-contextual-toolbar,.template__block-container .block-editor-block-list__block-edit:before,.template__block-container .block-editor-block-list__block-mobile-toolbar,.template__block-container .block-editor-block-list__breadcrumb,.template__block-container .block-editor-block-list__insertion-point{display:none}.template__block-container .template-block__overlay{background:hsla(0,0%,100%,.8);border:0 solid rgba(123,134,162,.3);bottom:0;right:0;margin:0;opacity:0;padding:0;position:absolute;left:0;transition:opacity .2s linear 0s;top:0;z-index:2}.is-selected .template__block-container .template-block__overlay{border-color:rgba(66,88,99,.4)}.block-editor-block-list__block:first-child .template__block-container .template-block__overlay{border-bottom-width:1px}.block-editor-block-list__block:last-child .template__block-container .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template__block-container .template-block__overlay{border-width:1px}}.template__block-container .template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s;margin:0 auto}.template__block-container .template-block__overlay .components-button.hidden{display:none}.template__block-container .template-block__overlay .template-block__loading{display:flex;align-items:center;color:#191e23}.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__fieldset,.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__instructions{display:none}.template-block__placeholder .components-spinner{margin:0 auto}.close-button-override-thin,.post-type-page .edit-post-fullscreen-mode-close__toolbar,.post-type-post .edit-post-fullscreen-mode-close__toolbar,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar{display:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override{display:flex;align-items:center;padding:9px 10px;margin-right:-8px;border:none;border-left:1px solid #e2e4e7}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-page .edit-post-fullscreen-mode-close__toolbar__override a:visited,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override a:visited,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:active,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:hover,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:link,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override a:visited{text-decoration:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label{font-size:13px}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .dashicons-arrow-left-alt2{margin-right:-7px}@media (max-width:599px){.post-type-page .edit-post-fullscreen-mode-close__toolbar__override,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override{margin-right:-2px}}@media (max-width:400px){.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-wide{display:none}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override-thin{display:flex}.post-type-page .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-post .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label,.post-type-wp_template_part .edit-post-fullscreen-mode-close__toolbar__override .close-button-override__label{display:none}}.post-type-wp_template_part .edit-post-post-status,.post-type-wp_template_part .editor-post-title,.post-type-wp_template_part .editor-post-trash{display:none}.post-type-wp_template_part .edit-post-visual-editor{margin-top:20px;padding-top:0}.post-type-wp_template_part .editor-post-switch-to-draft{display:none}@media (min-width:768px){.post-type-page .edit-post-editor-regions__content,.post-type-wp_template_part .edit-post-editor-regions__content{background:#eee}.post-type-page .edit-post-editor-regions__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-editor-regions__content .edit-post-visual-editor{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);flex:none;margin:36px 32px}}.post-type-page .block-editor-block-list__layout,.post-type-wp_template_part .block-editor-block-list__layout{padding-right:0;padding-left:0}.post-type-page .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit,.post-type-page .block-editor-block-list__layout .block-editor-block-list__block[data-align=full],.post-type-wp_template_part .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit,.post-type-wp_template_part .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{margin-right:0;margin-left:0}.post-type-page .block-editor-block-list__block[data-align=wide]>.block-editor-block-list__block-edit,.post-type-wp_template_part .block-editor-block-list__block[data-align=wide]>.block-editor-block-list__block-edit{margin-left:14px;margin-right:14px}@media (max-width:1200px){.post-type-page .wp-block:not([data-align=full]):not([data-align=wide]),.post-type-wp_template_part .wp-block:not([data-align=full]):not([data-align=wide]){max-width:580px}.post-type-page .is-sidebar-opened .wp-block:not([data-align=full]):not([data-align=wide]),.post-type-wp_template_part .is-sidebar-opened .wp-block:not([data-align=full]):not([data-align=wide]){max-width:400px}}.post-type-page .block-editor-writing-flow__click-redirect,.post-type-wp_template_part .block-editor-writing-flow__click-redirect{display:none}.editor-styles-wrapper{background:#fff}.post-type-page .edit-post-visual-editor{padding-top:0}.post-type-page .block-editor-writing-flow{display:block}.post-type-page .wp-block.template__block-container .wp-block-column [data-type="core/social-links"] [data-block]{margin:0}
{full-site-editing → dotcom-fse}/editor/block-inserter/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/editor/block-inserter/post-content-block-appender.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/editor/image-block-keywords/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/editor/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/editor/remove-editor-panels/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/editor/style.scss RENAMED
File without changes
{full-site-editing → dotcom-fse}/editor/suppress-draft-action/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/editor/suppress-trash-action/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/editor/template-validity-override/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/helpers.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/lib/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/lib/site-options/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/lib/site-options/use-previous.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/lib/site-options/use-site-options.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/lib/site-options/with-site-options.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/plugins/close-button-override/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/plugins/close-button-override/style.scss RENAMED
File without changes
{full-site-editing → dotcom-fse}/plugins/editor-template-classes/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/plugins/template-update-notice/index.js RENAMED
File without changes
{full-site-editing → dotcom-fse}/sass/_mixins.scss RENAMED
File without changes
{full-site-editing → dotcom-fse}/serialize-block-fallback.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/templates/class-rest-templates-controller.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/templates/class-template-image-inserter.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/templates/class-wp-template-inserter.php RENAMED
File without changes
{full-site-editing → dotcom-fse}/templates/class-wp-template.php RENAMED
File without changes
dotcom-fse/tests/fse-back-button.spec.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ /* eslint-disable import/no-extraneous-dependencies */
5
+ const { createNewPost } = require( '@wordpress/e2e-test-utils' );
6
+
7
+ import { activateTheme } from '../../e2e-test-helpers';
8
+
9
+ describe( 'Full Site Editing Back Button', () => {
10
+ beforeAll( async () => {
11
+ // Otherwise, tests often do not pass quickly enough.
12
+ jest.setTimeout( 10000 );
13
+ await activateTheme( 'maywood' );
14
+ // Creates a new page and uses the blank page layout.
15
+ await createNewPost( { postType: 'page', title: 'New e2e Page!' } );
16
+ await page.click( '.page-template-modal__buttons .components-button.is-primary.is-large' );
17
+ } );
18
+
19
+ it( 'Should have an overriden button', async () => {
20
+ // Target the toolbar__override class we added to see if our custom button exists.
21
+ const button = await page.$(
22
+ '.components-toolbar.edit-post-fullscreen-mode-close__toolbar.edit-post-fullscreen-mode-close__toolbar__override'
23
+ );
24
+ // Button is null if it does not exist.
25
+ expect( button ).toBeTruthy();
26
+ } );
27
+ } );
e2e-test-helpers/activate-theme.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ /**
3
+ * External dependencies
4
+ */
5
+ const { visitAdminPage } = require( '@wordpress/e2e-test-utils' );
6
+
7
+ export async function activateTheme( themeSlug ) {
8
+ await visitAdminPage( 'themes.php' );
9
+ const wrapperSelector = `div[data-slug="${ themeSlug }"]`;
10
+ const theme = await page.$( wrapperSelector );
11
+ if ( ! theme ) {
12
+ throw new Error( `The theme ${ themeSlug } is not installed on the test site!` );
13
+ }
14
+ const activateLink = await page.$( `${ wrapperSelector } a.activate` );
15
+ // It is already active.
16
+ if ( ! activateLink ) {
17
+ return;
18
+ }
19
+ await page.click( `${ wrapperSelector } a.activate` );
20
+ }
e2e-test-helpers/index.js ADDED
@@ -0,0 +1 @@
 
1
+ export * from './activate-theme';
event-countdown-block/blocks/src/edit.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable wpcalypso/jsx-classname-namespace */
2
+ // disabled CSS class rule due to existing code already
3
+ // that users the non-conformant classnames
4
+
5
+ /**
6
+ * WordPress dependencies
7
+ */
8
+ import { dateI18n, __experimentalGetSettings } from '@wordpress/date';
9
+ import { __ } from '@wordpress/i18n';
10
+ import { Button, DateTimePicker, Dropdown, Placeholder } from '@wordpress/components';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import { EventCountdownIcon } from './icon';
16
+
17
+ const edit = ( { attributes, setAttributes, className } ) => {
18
+ const settings = __experimentalGetSettings();
19
+
20
+ let label = __( 'Choose Date', 'full-site-editing' );
21
+ if ( attributes.eventDate ) {
22
+ label = dateI18n( settings.formats.datetimeAbbreviated, attributes.eventDate );
23
+ }
24
+
25
+ return (
26
+ <Placeholder
27
+ label={ __( 'Event Countdown', 'full-site-editing' ) }
28
+ instructions={ __(
29
+ 'Count down to an event. Set a title and pick a time and date.',
30
+ 'full-site-editing'
31
+ ) }
32
+ icon={ <EventCountdownIcon /> }
33
+ className={ className }
34
+ >
35
+ <div>
36
+ <strong>{ __( 'Title:', 'full-site-editing' ) }</strong>
37
+ <br />
38
+ <input
39
+ type="text"
40
+ value={ attributes.eventTitle }
41
+ onChange={ evt => setAttributes( { eventTitle: evt.target.value } ) }
42
+ placeholder={ __( 'Event Title', 'full-site-editing' ) }
43
+ className="event-countdown__event-title"
44
+ aria-label={ __( 'Event Title', 'full-site-editing' ) }
45
+ />
46
+ </div>
47
+ <div>
48
+ <strong>{ __( 'Date:', 'full-site-editing' ) }</strong>
49
+ <br />
50
+ <Dropdown
51
+ position="bottom left"
52
+ renderToggle={ ( { onToggle, isOpen } ) => (
53
+ <Button
54
+ className="button"
55
+ onClick={ onToggle }
56
+ aria-expanded={ isOpen }
57
+ aria-live="polite"
58
+ >
59
+ { label }
60
+ </Button>
61
+ ) }
62
+ renderContent={ () => (
63
+ <DateTimePicker
64
+ key="event-countdown-picker"
65
+ onChange={ eventDate => setAttributes( { eventDate } ) }
66
+ currentDate={ attributes.eventDate }
67
+ />
68
+ ) }
69
+ />
70
+ </div>
71
+ </Placeholder>
72
+ );
73
+ };
74
+
75
+ export default edit;
event-countdown-block/blocks/src/icon.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Path, SVG } from '@wordpress/components';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ export const EventCountdownIcon = () => (
10
+ <SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
11
+ <Path d="M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z" />
12
+ </SVG>
13
+ );
event-countdown-block/blocks/src/index.js ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { registerBlockType } from '@wordpress/blocks';
5
+ import { __ } from '@wordpress/i18n';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { EventCountdownIcon } from './icon';
11
+ import edit from './edit';
12
+ import view from './view';
13
+
14
+ registerBlockType( 'jetpack/event-countdown', {
15
+ title: __( 'Event Countdown', 'full-site-editing' ),
16
+ description: __(
17
+ 'Count down to your favorite next thing, and celebrate with fireworks when the time is right!',
18
+ 'full-site-editing'
19
+ ),
20
+ icon: EventCountdownIcon,
21
+ category: 'widgets',
22
+ supports: {
23
+ align: [ 'wide', 'full' ],
24
+ },
25
+ example: {
26
+ attributes: {
27
+ eventDate: '2024-04-08T11:38:32',
28
+ eventTitle: 'Total Solar Eclipse',
29
+ },
30
+ },
31
+ attributes: {
32
+ eventTitle: {
33
+ type: 'string',
34
+ source: 'text',
35
+ selector: '.event-countdown__event-title',
36
+ },
37
+ eventDate: {
38
+ type: 'string',
39
+ },
40
+ },
41
+
42
+ edit: props => {
43
+ if ( props.isSelected ) {
44
+ return edit( props );
45
+ }
46
+ return view( { ...props, isEditView: true } );
47
+ },
48
+
49
+ save: view,
50
+ } );
event-countdown-block/blocks/src/view.js ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable wpcalypso/jsx-classname-namespace */
2
+ // disabled CSS class rule due to existing code already
3
+ // that users the non-conformant classnames
4
+
5
+ /**
6
+ * WordPress dependencies
7
+ */
8
+ import { __, _x } from '@wordpress/i18n';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+
14
+ const view = ( { attributes, className, isEditView } ) => {
15
+ // Expected values in save.
16
+ let days = '&nbsp;',
17
+ hours = '&nbsp;',
18
+ mins = '&nbsp;',
19
+ secs = '&nbsp;';
20
+
21
+ if ( isEditView ) {
22
+ // Zero out.
23
+ days = hours = mins = secs = 0;
24
+ const eventTime = new Date( attributes.eventDate ).getTime();
25
+ const now = Date.now();
26
+ const diff = eventTime - now;
27
+
28
+ if ( diff > 0 ) {
29
+ // Convert diff to seconds.
30
+ let rem = Math.round( diff / 1000 );
31
+
32
+ days = Math.floor( rem / ( 24 * 60 * 60 ) );
33
+ rem = rem - days * 24 * 60 * 60;
34
+
35
+ hours = Math.floor( rem / ( 60 * 60 ) );
36
+ rem = rem - hours * 60 * 60;
37
+
38
+ mins = Math.floor( rem / 60 );
39
+ rem = rem - mins * 60;
40
+
41
+ secs = rem;
42
+ }
43
+ }
44
+
45
+ return (
46
+ <div className={ className }>
47
+ <div className="event-countdown__date">{ attributes.eventDate }</div>
48
+ <div className="event-countdown__counter">
49
+ <p>
50
+ <strong className="event-countdown__day">{ days }</strong>{ ' ' }
51
+ { _x( 'days', 'Countdown days remaining', 'full-site-editing' ) }
52
+ </p>
53
+ <p>
54
+ <span>
55
+ <strong className="event-countdown__hour">{ hours }</strong>{ ' ' }
56
+ { _x( 'hours', 'Countdown hours remaining', 'full-site-editing' ) }
57
+ </span>
58
+ <span>
59
+ <strong className="event-countdown__minute">{ mins }</strong>{ ' ' }
60
+ { _x( 'minutes', 'Countdown minutes remaining', 'full-site-editing' ) }
61
+ </span>
62
+ <span>
63
+ <strong className="event-countdown__second">{ secs }</strong>{ ' ' }
64
+ { _x( 'seconds', 'Countdown seconds remaining', 'full-site-editing' ) }
65
+ </span>
66
+ </p>
67
+ <p>{ __( 'until', 'full-site-editing' ) }</p>
68
+ </div>
69
+ <div className="event-countdown__event-title">
70
+ <p>{ attributes.eventTitle }</p>
71
+ </div>
72
+ </div>
73
+ );
74
+ };
75
+
76
+ export default view;
event-countdown-block/{index.asset.php → dist/event-countdown-block.asset.php} RENAMED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-blocks', 'wp-components', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'aa4fcf7b1a27d1764e73dd2a7d94465d');
1
+ <?php return array('dependencies' => array('wp-blocks', 'wp-components', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'b6ff5be92030a2e6aa8a5b1eb2de8110');
event-countdown-block/dist/event-countdown-block.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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=7)}([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){!function(){e.exports=this.wp.date}()},function(e,t,n){var r=n(6);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){!function(){e.exports=this.wp.blocks}()},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,n){"use strict";n.r(t);var r=n(4),i=n.n(r),c=n(5),o=n(1),l=n(0),a=n(2),u=function(){return Object(l.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(l.createElement)(a.Path,{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}))},s=n(3),b=function(e){var t=e.attributes,n=e.setAttributes,r=e.className,i=Object(s.__experimentalGetSettings)(),c=Object(o.__)("Choose Date","full-site-editing");return t.eventDate&&(c=Object(s.dateI18n)(i.formats.datetimeAbbreviated,t.eventDate)),Object(l.createElement)(a.Placeholder,{label:Object(o.__)("Event Countdown","full-site-editing"),instructions:Object(o.__)("Count down to an event. Set a title and pick a time and date.","full-site-editing"),icon:Object(l.createElement)(u,null),className:r},Object(l.createElement)("div",null,Object(l.createElement)("strong",null,Object(o.__)("Title:","full-site-editing")),Object(l.createElement)("br",null),Object(l.createElement)("input",{type:"text",value:t.eventTitle,onChange:function(e){return n({eventTitle:e.target.value})},placeholder:Object(o.__)("Event Title","full-site-editing"),className:"event-countdown__event-title","aria-label":Object(o.__)("Event Title","full-site-editing")})),Object(l.createElement)("div",null,Object(l.createElement)("strong",null,Object(o.__)("Date:","full-site-editing")),Object(l.createElement)("br",null),Object(l.createElement)(a.Dropdown,{position:"bottom left",renderToggle:function(e){var t=e.onToggle,n=e.isOpen;return Object(l.createElement)(a.Button,{className:"button",onClick:t,"aria-expanded":n,"aria-live":"polite"},c)},renderContent:function(){return Object(l.createElement)(a.DateTimePicker,{key:"event-countdown-picker",onChange:function(e){return n({eventDate:e})},currentDate:t.eventDate})}})))},d=function(e){var t=e.attributes,n=e.className,r="&nbsp;",i="&nbsp;",c="&nbsp;",a="&nbsp;";if(e.isEditView){r=i=c=a=0;var u=new Date(t.eventDate).getTime()-Date.now();if(u>0){var s=Math.round(u/1e3);s-=24*(r=Math.floor(s/86400))*60*60,s-=60*(i=Math.floor(s/3600))*60,a=s-=60*(c=Math.floor(s/60))}}return Object(l.createElement)("div",{className:n},Object(l.createElement)("div",{className:"event-countdown__date"},t.eventDate),Object(l.createElement)("div",{className:"event-countdown__counter"},Object(l.createElement)("p",null,Object(l.createElement)("strong",{className:"event-countdown__day"},r)," ",Object(o._x)("days","Countdown days remaining","full-site-editing")),Object(l.createElement)("p",null,Object(l.createElement)("span",null,Object(l.createElement)("strong",{className:"event-countdown__hour"},i)," ",Object(o._x)("hours","Countdown hours remaining","full-site-editing")),Object(l.createElement)("span",null,Object(l.createElement)("strong",{className:"event-countdown__minute"},c)," ",Object(o._x)("minutes","Countdown minutes remaining","full-site-editing")),Object(l.createElement)("span",null,Object(l.createElement)("strong",{className:"event-countdown__second"},a)," ",Object(o._x)("seconds","Countdown seconds remaining","full-site-editing"))),Object(l.createElement)("p",null,Object(o.__)("until","full-site-editing"))),Object(l.createElement)("div",{className:"event-countdown__event-title"},Object(l.createElement)("p",null,t.eventTitle)))};Object(c.registerBlockType)("jetpack/event-countdown",{title:Object(o.__)("Event Countdown","full-site-editing"),description:Object(o.__)("Count down to your favorite next thing, and celebrate with fireworks when the time is right!","full-site-editing"),icon:u,category:"widgets",supports:{align:["wide","full"]},example:{attributes:{eventDate:"2024-04-08T11:38:32",eventTitle:"Total Solar Eclipse"}},attributes:{eventTitle:{type:"string",source:"text",selector:".event-countdown__event-title"},eventDate:{type:"string"}},edit:function(e){return e.isSelected?b(e):d(i()({},e,{isEditView:!0}))},save:d})}]));
event-countdown-block/index.js CHANGED
@@ -1,294 +1,4 @@
1
- ! ( function( e ) {
2
- var t = {};
3
- function n( r ) {
4
- if ( t[ r ] ) return t[ r ].exports;
5
- var c = ( t[ r ] = { i: r, l: ! 1, exports: {} } );
6
- return e[ r ].call( c.exports, c, c.exports, n ), ( c.l = ! 0 ), c.exports;
7
- }
8
- ( n.m = e ),
9
- ( n.c = t ),
10
- ( n.d = function( e, t, r ) {
11
- n.o( e, t ) || Object.defineProperty( e, t, { enumerable: ! 0, get: r } );
12
- } ),
13
- ( n.r = function( e ) {
14
- 'undefined' != typeof Symbol &&
15
- Symbol.toStringTag &&
16
- Object.defineProperty( e, Symbol.toStringTag, { value: 'Module' } ),
17
- Object.defineProperty( e, '__esModule', { value: ! 0 } );
18
- } ),
19
- ( n.t = function( e, t ) {
20
- if ( ( 1 & t && ( e = n( e ) ), 8 & t ) ) return e;
21
- if ( 4 & t && 'object' == typeof e && e && e.__esModule ) return e;
22
- var r = Object.create( null );
23
- if (
24
- ( n.r( r ),
25
- Object.defineProperty( r, 'default', { enumerable: ! 0, value: e } ),
26
- 2 & t && 'string' != typeof e )
27
- )
28
- for ( var c in e )
29
- n.d(
30
- r,
31
- c,
32
- function( t ) {
33
- return e[ t ];
34
- }.bind( null, c )
35
- );
36
- return r;
37
- } ),
38
- ( n.n = function( e ) {
39
- var t =
40
- e && e.__esModule
41
- ? function() {
42
- return e.default;
43
- }
44
- : function() {
45
- return e;
46
- };
47
- return n.d( t, 'a', t ), t;
48
- } ),
49
- ( n.o = function( e, t ) {
50
- return Object.prototype.hasOwnProperty.call( e, t );
51
- } ),
52
- ( n.p = '' ),
53
- n( ( n.s = 6 ) );
54
- } )( [
55
- function( e, t ) {
56
- ! ( function() {
57
- e.exports = this.wp.element;
58
- } )();
59
- },
60
- function( e, t ) {
61
- ! ( function() {
62
- e.exports = this.wp.i18n;
63
- } )();
64
- },
65
- function( e, t ) {
66
- ! ( function() {
67
- e.exports = this.wp.components;
68
- } )();
69
- },
70
- function( e, t ) {
71
- ! ( function() {
72
- e.exports = this.wp.date;
73
- } )();
74
- },
75
- function( e, t ) {
76
- e.exports = function( e, t, n ) {
77
- return (
78
- t in e
79
- ? Object.defineProperty( e, t, {
80
- value: n,
81
- enumerable: ! 0,
82
- configurable: ! 0,
83
- writable: ! 0,
84
- } )
85
- : ( e[ t ] = n ),
86
- e
87
- );
88
- };
89
- },
90
- function( e, t ) {
91
- ! ( function() {
92
- e.exports = this.wp.blocks;
93
- } )();
94
- },
95
- function( e, t, n ) {
96
- 'use strict';
97
- n.r( t );
98
- var r = n( 4 ),
99
- c = n.n( r ),
100
- o = n( 5 ),
101
- a = n( 0 ),
102
- l = n( 2 ),
103
- i = function() {
104
- return Object( a.createElement )(
105
- l.SVG,
106
- { xmlns: 'http://www.w3.org/2000/svg', width: '24', height: '24', viewBox: '0 0 24 24' },
107
- Object( a.createElement )( l.Path, {
108
- d:
109
- 'M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z',
110
- } )
111
- );
112
- },
113
- u = n( 3 ),
114
- s = n( 1 ),
115
- b = function( e ) {
116
- var t = e.attributes,
117
- n = e.setAttributes,
118
- r = e.className,
119
- c = Object( u.__experimentalGetSettings )(),
120
- o = Object( s.__ )( 'Choose Date' );
121
- return (
122
- t.eventDate && ( o = Object( u.dateI18n )( c.formats.datetimeAbbreviated, t.eventDate ) ),
123
- Object( a.createElement )(
124
- l.Placeholder,
125
- {
126
- label: Object( s.__ )( 'Event Countdown' ),
127
- instructions: Object( s.__ )(
128
- 'Count down to an event. Set a title and pick a time and date.'
129
- ),
130
- icon: Object( a.createElement )( i, null ),
131
- className: r,
132
- },
133
- Object( a.createElement )(
134
- 'div',
135
- null,
136
- Object( a.createElement )( 'strong', null, 'Title:' ),
137
- Object( a.createElement )( 'br', null ),
138
- Object( a.createElement )( 'input', {
139
- type: 'text',
140
- value: t.eventTitle,
141
- onChange: function( e ) {
142
- return n( { eventTitle: e.target.value } );
143
- },
144
- placeholder: Object( s.__ )( 'Event Title' ),
145
- className: 'event-countdown__event-title',
146
- 'aria-label': Object( s.__ )( 'Event Title' ),
147
- } )
148
- ),
149
- Object( a.createElement )(
150
- 'div',
151
- null,
152
- Object( a.createElement )( 'strong', null, 'Date:' ),
153
- Object( a.createElement )( 'br', null ),
154
- Object( a.createElement )( l.Dropdown, {
155
- position: 'bottom left',
156
- renderToggle: function( e ) {
157
- var t = e.onToggle,
158
- n = e.isOpen;
159
- return Object( a.createElement )(
160
- l.Button,
161
- { className: 'button', onClick: t, 'aria-expanded': n, 'aria-live': 'polite' },
162
- o
163
- );
164
- },
165
- renderContent: function() {
166
- return Object( a.createElement )( l.DateTimePicker, {
167
- key: 'event-countdown-picker',
168
- onChange: function( e ) {
169
- return n( { eventDate: e } );
170
- },
171
- currentDate: t.eventDate,
172
- } );
173
- },
174
- } )
175
- )
176
- )
177
- );
178
- },
179
- p = function( e ) {
180
- var t = e.attributes,
181
- n = e.className,
182
- r = '&nbsp;',
183
- c = '&nbsp;',
184
- o = '&nbsp;',
185
- l = '&nbsp;';
186
- if ( e.isEditView ) {
187
- r = c = o = l = 0;
188
- var i = new Date( t.eventDate ).getTime() - Date.now();
189
- if ( i > 0 ) {
190
- var u = Math.round( i / 1e3 );
191
- ( u -= 24 * ( r = Math.floor( u / 86400 ) ) * 60 * 60 ),
192
- ( u -= 60 * ( c = Math.floor( u / 3600 ) ) * 60 ),
193
- ( l = u -= 60 * ( o = Math.floor( u / 60 ) ) );
194
- }
195
- }
196
- return Object( a.createElement )(
197
- 'div',
198
- { className: n },
199
- Object( a.createElement )( 'div', { className: 'event-countdown__date' }, t.eventDate ),
200
- Object( a.createElement )(
201
- 'div',
202
- { className: 'event-countdown__counter' },
203
- Object( a.createElement )(
204
- 'p',
205
- null,
206
- Object( a.createElement )( 'strong', { className: 'event-countdown__day' }, r ),
207
- ' ',
208
- Object( s.__ )( 'days' )
209
- ),
210
- Object( a.createElement )(
211
- 'p',
212
- null,
213
- Object( a.createElement )(
214
- 'span',
215
- null,
216
- Object( a.createElement )( 'strong', { className: 'event-countdown__hour' }, c ),
217
- ' ',
218
- Object( s.__ )( 'hours' )
219
- ),
220
- Object( a.createElement )(
221
- 'span',
222
- null,
223
- Object( a.createElement )( 'strong', { className: 'event-countdown__minute' }, o ),
224
- ' ',
225
- Object( s.__ )( 'minutes' )
226
- ),
227
- Object( a.createElement )(
228
- 'span',
229
- null,
230
- Object( a.createElement )( 'strong', { className: 'event-countdown__second' }, l ),
231
- ' ',
232
- Object( s.__ )( 'seconds' )
233
- )
234
- ),
235
- Object( a.createElement )( 'p', null, Object( s.__ )( 'until' ) )
236
- ),
237
- Object( a.createElement )(
238
- 'div',
239
- { className: 'event-countdown__event-title' },
240
- Object( a.createElement )( 'p', null, t.eventTitle )
241
- )
242
- );
243
- };
244
- function d( e, t ) {
245
- var n = Object.keys( e );
246
- if ( Object.getOwnPropertySymbols ) {
247
- var r = Object.getOwnPropertySymbols( e );
248
- t &&
249
- ( r = r.filter( function( t ) {
250
- return Object.getOwnPropertyDescriptor( e, t ).enumerable;
251
- } ) ),
252
- n.push.apply( n, r );
253
- }
254
- return n;
255
- }
256
- Object( o.registerBlockType )( 'jetpack/event-countdown', {
257
- title: 'Event Countdown',
258
- description:
259
- 'Count down to your favorite next thing, and celebrate with fireworks when the time is right!',
260
- icon: i,
261
- category: 'widgets',
262
- supports: { align: [ 'wide', 'full' ] },
263
- example: {
264
- attributes: { eventDate: '2024-04-08T11:38:32', eventTitle: 'Total Solar Eclipse' },
265
- },
266
- attributes: {
267
- eventTitle: { type: 'string', source: 'text', selector: '.event-countdown__event-title' },
268
- eventDate: { type: 'string' },
269
- },
270
- edit: function( e ) {
271
- return e.isSelected
272
- ? b( e )
273
- : p(
274
- ( function( e ) {
275
- for ( var t = 1; t < arguments.length; t++ ) {
276
- var n = null != arguments[ t ] ? arguments[ t ] : {};
277
- t % 2
278
- ? d( n, ! 0 ).forEach( function( t ) {
279
- c()( e, t, n[ t ] );
280
- } )
281
- : Object.getOwnPropertyDescriptors
282
- ? Object.defineProperties( e, Object.getOwnPropertyDescriptors( n ) )
283
- : d( n ).forEach( function( t ) {
284
- Object.defineProperty( e, t, Object.getOwnPropertyDescriptor( n, t ) );
285
- } );
286
- }
287
- return e;
288
- } )( {}, e, { isEditView: ! 0 } )
289
- );
290
- },
291
- save: p,
292
- } );
293
- },
294
- ] );
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import './blocks/src/index';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
event-countdown-block/index.php CHANGED
@@ -1,40 +1,45 @@
1
  <?php
 
 
 
 
 
2
 
3
- // Register Block Scripts
4
- add_action( 'init', function() {
5
- $asset_file = __DIR__ . '/index.asset.php';
6
- $asset = file_exists( $asset_file ) ? require_once $asset_file : null;
7
- $dependencies = isset( $asset['dependencies'] ) ? $asset['dependencies'] : [];
8
- $version = isset( $asset['version'] ) ? $asset['version'] : filemtime( __DIR__ . '/index.js' );
 
9
 
10
- // Block JS
11
- wp_register_script(
12
- 'jetpack-event-countdown',
13
- plugins_url( 'index.js', __FILE__ ),
14
- $dependencies,
15
- $version,
16
- true
17
- );
18
 
19
- // Block front end style
20
- wp_register_style(
21
- 'jetpack-event-countdown',
22
- plugins_url( 'style.css', __FILE__ ),
23
- [],
24
- filemtime( __DIR__ . '/style.css' )
25
- );
26
 
27
- // Block editor style
28
- wp_register_style(
29
- 'jetpack-event-countdown-editor',
30
- plugins_url( 'editor.css', __FILE__ ),
31
- [],
32
- filemtime( __DIR__ . '/editor.css' )
33
- );
34
- } );
35
 
36
- /**
37
- * AUTO-GENERATED blocks will be added here
38
- */
39
 
40
- include_once __DIR__ . '/blocks/event-countdown.php';
1
  <?php
2
+ /**
3
+ * Event Countdown Block
4
+ *
5
+ * @package A8C\FSE
6
+ */
7
 
8
+ add_action(
9
+ 'init',
10
+ function() {
11
+ $asset_file = __DIR__ . '/dist/event-countdown-block.asset.php';
12
+ $asset = file_exists( $asset_file ) ? require_once $asset_file : null;
13
+ $dependencies = isset( $asset['dependencies'] ) ? $asset['dependencies'] : array();
14
+ $version = isset( $asset['version'] ) ? $asset['version'] : filemtime( __DIR__ . '/dist/event-countdown-block.js' );
15
 
16
+ // Block JS.
17
+ wp_register_script(
18
+ 'jetpack-event-countdown',
19
+ plugins_url( 'dist/event-countdown-block.js', __FILE__ ),
20
+ $dependencies,
21
+ $version,
22
+ true
23
+ );
24
 
25
+ // Block front end style.
26
+ wp_register_style(
27
+ 'jetpack-event-countdown',
28
+ plugins_url( 'style.css', __FILE__ ),
29
+ array(),
30
+ filemtime( __DIR__ . '/style.css' )
31
+ );
32
 
33
+ // Block editor style.
34
+ wp_register_style(
35
+ 'jetpack-event-countdown-editor',
36
+ plugins_url( 'editor.css', __FILE__ ),
37
+ array(),
38
+ filemtime( __DIR__ . '/editor.css' )
39
+ );
 
40
 
41
+ wp_set_script_translations( 'jetpack-event-countdown', 'full-site-editing' );
42
+ }
43
+ );
44
 
45
+ require_once __DIR__ . '/blocks/event-countdown.php';
full-site-editing-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Full Site Editing
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
- * Version: 0.19
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
@@ -35,10 +35,10 @@ namespace A8C\FSE;
35
  *
36
  * @var string
37
  */
38
- define( 'PLUGIN_VERSION', '0.19' );
39
 
40
- // Always include these helper files for FSE.
41
- require_once __DIR__ . '/full-site-editing/helpers.php';
42
 
43
  /**
44
  * Load Full Site Editing.
@@ -192,9 +192,13 @@ add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_coblocks_gallery_scr
192
  * Load Blog Posts block.
193
  */
194
  function load_blog_posts_block() {
 
195
  $disable_block = (
196
- in_array( 'newspack-blocks/newspack-blocks.php', (array) get_option( 'active_plugins', array() ), true ) ||
197
- in_array( 'newspack-blocks/newspack-blocks.php', (array) get_site_option( 'active_sitewide_plugins', array() ), true )
 
 
 
198
  );
199
 
200
  /**
@@ -211,3 +215,12 @@ function load_blog_posts_block() {
211
  require_once __DIR__ . '/blog-posts-block/index.php';
212
  }
213
  add_action( 'plugins_loaded', __NAMESPACE__ . '\load_blog_posts_block' );
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Plugin Name: Full Site Editing
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
+ * Version: 0.21
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
35
  *
36
  * @var string
37
  */
38
+ define( 'PLUGIN_VERSION', '0.21' );
39
 
40
+ // Always include these helper files for dotcom FSE.
41
+ require_once __DIR__ . '/dotcom-fse/helpers.php';
42
 
43
  /**
44
  * Load Full Site Editing.
192
  * Load Blog Posts block.
193
  */
194
  function load_blog_posts_block() {
195
+ $slug = 'newspack-blocks/newspack-blocks.php';
196
  $disable_block = (
197
+ ( defined( 'WP_CLI' ) && WP_CLI ) ||
198
+ /* phpcs:ignore WordPress.Security.NonceVerification */
199
+ ( isset( $_GET['action'], $_GET['plugin'] ) && 'activate' === $_GET['action'] && $slug === $_GET['plugin'] ) ||
200
+ in_array( $slug, (array) get_option( 'active_plugins', array() ), true ) ||
201
+ in_array( $slug, (array) get_site_option( 'active_sitewide_plugins', array() ), true )
202
  );
203
 
204
  /**
215
  require_once __DIR__ . '/blog-posts-block/index.php';
216
  }
217
  add_action( 'plugins_loaded', __NAMESPACE__ . '\load_blog_posts_block' );
218
+
219
+ // @TODO - Uncomment once ready to deploy wpcom NUX.
220
+ /**
221
+ * Load WPCOM Block Editor NUX
222
+ */
223
+ // function load_wpcom_block_editor_nux() {
224
+ // require_once __DIR__ . '/wpcom-block-editor-nux/class-wpcom-block-editor-nux.php';
225
+ // }
226
+ // add_action( 'plugins_loaded', __NAMESPACE__ . '\load_wpcom_block_editor_nux' );
full-site-editing/dist/full-site-editing.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
- */
 
 
 
 
 
global-styles/dist/global-styles.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-polyfill'), 'version' => 'e9b98e283c2a655df49ec88da79a8c3e');
1
+ <?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-polyfill'), 'version' => '603bed5808f28d5f465cf89f412ee922');
global-styles/dist/global-styles.css CHANGED
@@ -1 +1 @@
1
- .global-styles-sidebar .components-select-control__input{line-height:1;font-size:18px;height:36px}.global-styles-sidebar h3{margin:0 0 1em}.global-styles-sidebar__panel-action-buttons{display:flex;justify-content:flex-end;margin-bottom:96px}.global-styles-sidebar__publish-button{margin-left:1em}.font-pairings-panel{cursor:pointer;border-radius:4px;padding:4px;margin-bottom:.5em}.font-pairings-panel.is-selected{box-shadow:0 0 0 2px #555d66}.font-pairings-panel:focus{box-shadow:0 0 0 2px #00a0d2}.font-pairings-panel:hover{background-color:#f3f4f5;color:#191e23}.font-pairings-panel__preview{border:1px solid rgba(25,30,35,.2);border-radius:4px;background-color:#fff;padding:4px}.font-pairings-panel__preview h1,.font-pairings-panel__preview p{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:10px 0}.font-pairings-panel__preview svg{display:block;width:100%;height:auto}.font-pairings-panel__label{text-align:center;margin-bottom:0}
1
+ .global-styles-sidebar .components-select-control__input{line-height:1;font-size:18px;height:36px}.global-styles-sidebar h3{margin:0 0 1em}.global-styles-sidebar__panel-action-buttons{display:flex;justify-content:flex-end;margin-bottom:96px}.global-styles-sidebar__publish-button{margin-left:1em}.font-pairings-panel{cursor:pointer;border-radius:4px;padding:4px;margin-bottom:.5em}.font-pairings-panel.is-selected{box-shadow:0 0 0 2px #555d66}.font-pairings-panel:focus{box-shadow:0 0 0 2px #00a0d2}.font-pairings-panel:hover{background-color:#f3f4f5;color:#191e23}.font-pairings-panel__preview{border:1px solid rgba(25,30,35,.2);border-radius:4px;background-color:#fff;padding:4px}.font-pairings-panel__preview h1,.font-pairings-panel__preview p{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:10px 0}.font-pairings-panel__preview svg{display:block;width:100%;height:auto}.font-pairings-panel__label{text-align:center;margin-bottom:0}
global-styles/dist/global-styles.js CHANGED
@@ -1,2 +1,6 @@
1
- /*! For license information please see global-styles.js.LICENSE */
2
- !function(e,t){for(var c in t)e[c]=t[c]}(window,function(e){var t={};function c(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,c),a.l=!0,a.exports}return c.m=e,c.c=t,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)c.d(n,a,function(t){return e[t]}.bind(null,a));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="",c(c.s=14)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){e.exports=function(e,t,c){return t in e?Object.defineProperty(e,t,{value:c,enumerable:!0,configurable:!0,writable:!0}):e[t]=c,e}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t,c){var n=c(4);function a(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}e.exports=function(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?a(Object(c),!0).forEach((function(t){n(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):a(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){!function(){e.exports=this.wp.domReady}()},function(e,t){!function(){e.exports=this.wp.keycodes}()},function(e,t,c){var n;!function(){"use strict";var c={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)&&n.length){var l=a.apply(null,n);l&&e.push(l)}else if("object"===r)for(var o in n)c.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},function(e,t,c){},function(e,t,c){"use strict";c.r(t);var n,a,r,l,o=c(8),s=c(3),i=c(9),u=c(6),h=c.n(u),f=c(7),p=c.n(f),v={},b=!1,O={publishOptions:regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,{type:"IO_PUBLISH_OPTIONS",options:t};case 2:return e.abrupt("return",{type:"PUBLISH_OPTIONS",options:t});case 3:case"end":return e.stop()}}),e)})),updateOptions:function(e){return{type:"UPDATE_OPTIONS",options:e}},fetchOptions:function(){return{type:"IO_FETCH_OPTIONS"}},resetLocalChanges:function(){return{type:"RESET_OPTIONS",options:v}}},m=c(10),d=c.n(m),g=c(4),j=c.n(g),_=c(0),E=c(5),z=c(1),y=c(2),P=c(11),w=c(12),V=c.n(w),S=function(e){var t=e.unsupportedFeature;return Object(_.createElement)("p",null,Object(y.sprintf)(Object(y.__)("Your active theme doesn't support %s."),t))},H=function(e,t,c){switch(e){case"SPACE_LORA":return Object(_.createElement)(z.SVG,{width:"232",height:"132",viewBox:"0 0 232 132",xmlns:"http://www.w3.org/2000/svg"},Object(_.createElement)(z.Path,{fill:"#fa4d4b",d:"M0 0h232v132H0z"}),Object(_.createElement)(z.Path,{d:"M24.1 62c-3.6-2.9-8.9-5-15.8-6.3-2.8-.5-5-1-6.9-1.6-.5-.2-1-.3-1.5-.5v12.5c1.4.3 2.9.6 4.4.9 2.5.4 4.6 1 6.2 1.6s2.9 1.3 3.9 2.2c.9.8 1.6 1.6 2 2.6.4.9.6 1.9.6 3 0 2.3-.9 4.2-2.7 5.8-1.8 1.6-4.6 2.4-8.4 2.4-2.2 0-4.2-.3-5.9-.8v12c1.8.3 3.7.4 5.7.4 3.7 0 7-.5 10-1.4 2.9-.9 5.5-2.3 7.5-4s3.6-3.9 4.7-6.3c1.1-2.5 1.7-5.3 1.7-8.4V75c0-5.7-1.8-10-5.5-13zM12.9 42.5c2.1 1.9 3.1 4.2 3.1 6.9v2.3h12.4v-3.4c0-2.7-.5-5.3-1.6-7.7-1-2.4-2.5-4.6-4.6-6.5-2-1.9-4.5-3.4-7.5-4.4-3-1.1-6.5-1.7-10.3-1.7-1.5 0-3 .1-4.4.3v11.9c1.3-.4 2.7-.5 4.4-.5 3.7-.2 6.5.8 8.5 2.8zm67.9 10.9c-1.8-2.1-4-3.6-6.5-4.7-2.4-1.1-5-1.6-7.8-1.6-3.7 0-6.7.7-9.1 2.2-2.4 1.4-4.2 3.4-5.5 5.9h-1.7v-6.8H38.4v65.4h11.8V88.2H52c.6 1.1 1.2 2.1 2 3.1.8.9 1.8 1.8 2.9 2.5 1.2.8 2.6 1.3 4.1 1.8 1.6.4 3.4.7 5.5.7 2.9 0 5.5-.5 8-1.5 2.5-1.1 4.7-2.6 6.5-4.6 1.8-2.1 3.3-4.6 4.3-7.5 1.1-2.9 1.6-6.3 1.6-10.2v-1.7c0-3.8-.6-7.1-1.7-10.1-1-2.9-2.5-5.3-4.4-7.3zm-5.7 18.9c0 3.9-1.2 7.1-3.5 9.4-2.3 2.3-5.2 3.4-8.9 3.4s-6.7-1.2-9-3.5c-2.3-2.4-3.4-5.5-3.4-9.3v-1.1c0-3.8 1.1-6.9 3.4-9.2 2.3-2.4 5.3-3.6 9-3.6s6.7 1.2 8.9 3.5c2.3 2.3 3.5 5.4 3.5 9.3v1.1zm66.2 8.6V48.4h-11.8V54h-1.7c-1.2-2.4-2.8-4.1-4.9-5.3-2-1.1-4.7-1.7-8-1.7-2.8 0-5.4.6-7.8 1.7-2.4 1.1-4.5 2.6-6.3 4.7-1.8 2.1-3.3 4.6-4.3 7.6-1.1 2.9-1.6 6.3-1.6 10v1.5c0 3.8.5 7.1 1.6 10.1 1.1 2.9 2.6 5.5 4.5 7.5 1.9 2.1 4 3.6 6.5 4.7s5.2 1.6 8 1.6c3 0 5.6-.6 7.9-1.8 2.3-1.3 4-3.4 5.3-6.3h1.7c0 2 .7 3.6 2 4.9 1.4 1.3 3.1 1.9 5.3 1.9h8.1V83.7H144c-1.8 0-2.7-.9-2.7-2.8zm-11.8-8.6c0 3.9-1 7.1-3.1 9.4-2.1 2.3-4.8 3.4-8.3 3.4-3.4 0-6.2-1.1-8.3-3.4-2.1-2.3-3.1-5.5-3.1-9.4v-1.1c0-3.9 1-7.1 3.1-9.3 2.1-2.3 4.8-3.5 8.3-3.5 3.4 0 6.2 1.2 8.3 3.5 2.1 2.3 3.1 5.4 3.1 9.3v1.1zm98.3-12.2c1.2-1 2.6-1.6 4.2-2V47.3c-2.1.3-4 .8-5.9 1.6-2.8 1.1-5.3 2.7-7.4 4.8-2.1 2.1-3.8 4.6-5.1 7.5-1.2 2.9-1.8 6.2-1.8 9.8v.6c0 3.9.6 7.4 1.7 10.4 1.2 3.1 2.8 5.7 4.9 7.8 2.1 2.1 4.6 3.8 7.5 4.9 1.9.7 4 1.2 6.1 1.5V84.7c-.4-.1-.7-.2-1.1-.3-1.3-.5-2.5-1.2-3.6-2-1-.9-1.8-1.9-2.4-3-.6-1.2-.9-2.5-.9-3.9h8V65.4h-7.8c.5-2 1.8-3.8 3.6-5.3zm-61.5 6.1c.7-1.7 1.6-3.1 2.7-4.2 1.1-1.2 2.4-2.1 3.9-2.7 1.5-.6 3.1-.9 4.8-.9 3.6 0 6.5 1 8.5 3s3.2 4.4 3.6 7.1l11.7-3c-1.1-5.5-3.6-10-7.7-13.3-4-3.4-9.3-5.1-15.8-5.1-3.4 0-6.6.6-9.6 1.7-2.9 1.1-5.5 2.8-7.8 4.9-2.2 2.1-3.9 4.7-5.2 7.7s-1.9 6.4-1.9 10.2v1.1c0 3.8.6 7.1 1.9 10.1 1.3 2.9 3 5.4 5.2 7.4s4.8 3.5 7.7 4.6c3 1.1 6.2 1.6 9.7 1.6 6.6 0 11.9-1.7 15.9-5.1 4-3.4 6.5-7.8 7.6-13.3l-11.7-3c-.6 3.1-1.8 5.5-3.8 7.3-1.9 1.8-4.6 2.7-8.3 2.7-1.7 0-3.3-.3-4.8-.8-1.5-.6-2.8-1.4-3.9-2.4-1.1-1.1-2-2.4-2.7-3.9-.6-1.6-.9-3.5-.9-5.5v-.6c0-2.1.3-3.9.9-5.6z",fill:"#270920"}),Object(_.createElement)(z.Path,{d:"M49.7 89.3c-1.1 1.3-2.6 2-4.5 2h-6.5c.1-1.1.2-2.5.2-4.3V68.5c0-1.3.1-2.2.4-2.8s.6-1 1.1-1.1c.5-.2 1.1-.3 2-.3v-3.2h-14v3.7l3.6-.1c-.1 1.1-.2 2.5-.2 4.4v18.5c0 1.3-.1 2.2-.4 2.8-.3.6-.6 1-1.1 1.2-.5.2-1.1.3-2 .3V95h25.8l.3-11.6h-3.2c.1 2.6-.5 4.5-1.5 5.9zM101.3 70c-2.5 0-4.8 1.5-7 4.5h-.1v-2.3c0-.8-.1-1.4-.1-1.9h-2.4c-.4.4-1.3.7-2.5 1-1.3.3-2.9.4-4.9.4v3.7l3.4-.1c-.1 1.3-.2 2.7-.2 4.1v8.1c0 1.5-.2 2.6-.5 3.3-.3.7-1.1 1-2.3 1V95h12.7v-3.7c-1.1 0-2.1 0-3.1.1.1-1.3.2-2.7.2-4.3v-7.9c.3-1 1-2.1 1.9-3.1 1-1.1 1.9-1.6 2.8-1.6.1 1 .5 1.8 1.1 2.2.6.4 1.4.6 2.2.6 1.1 0 1.9-.4 2.5-1.1.5-.7.8-1.5.8-2.3 0-1.3-.4-2.3-1.2-3-1-.5-2-.9-3.3-.9zm25.8 21.5c.1-1.3.2-2.7.2-4.3v-7.9c0-6.2-3-9.2-9-9.2-1.9 0-3.6.3-5.2.8-1.5.5-2.8 1.3-3.7 2.2-.9 1-1.4 2.1-1.4 3.3 0 .9.3 1.7.8 2.4.5.6 1.3.9 2.3.9 1 0 1.8-.3 2.3-.9.5-.6.8-1.3.8-2.1s-.2-1.4-.6-1.8c.9-.9 2.1-1.4 3.5-1.4 2.2 0 3.3 1.5 3.3 4.4v2.5c-3.7.2-6.9 1-9.5 2.5-2.6 1.5-4 3.6-4 6.4 0 1.9.6 3.4 1.7 4.6 1.2 1.2 2.8 1.8 4.8 1.8 2.8 0 5.2-1 7.2-3 .1 1.1.1 1.8.2 2.2h9.1v-3.7c-.7.1-1.8.2-2.8.3zm-6.6-2.2c-1.1 1.2-2.4 1.7-3.8 1.7-.8 0-1.4-.2-2-.6-.5-.4-.8-1.1-.8-1.9 0-1.3.6-2.4 1.8-3.1 1.3-.8 2.8-1.3 4.7-1.5v5.4zM75.1 71.5c-1.8-1-3.9-1.5-6.2-1.5-2.2 0-4.3.6-6.1 1.7-1.8 1.1-3.3 2.7-4.4 4.7-1.1 2-1.6 4.4-1.6 7 0 2.5.5 4.7 1.6 6.5 1.1 1.9 2.5 3.3 4.4 4.3 1.9 1 4 1.5 6.3 1.5 2.4 0 4.4-.5 6.2-1.6 1.8-1.1 3.3-2.6 4.3-4.6 1-2 1.5-4.3 1.5-7 0-2.5-.5-4.7-1.6-6.6-1.1-1.9-2.5-3.4-4.4-4.4zm-2.2 18.4c-.7 1.6-2 2.5-3.7 2.5-1.8 0-3.1-1-4-3-.9-2-1.3-4.4-1.3-7.2 0-2.5.4-4.5 1.2-6.2.8-1.7 2.1-2.5 3.9-2.5 1.7 0 3 1 3.8 3s1.2 4.4 1.2 7.2c-.1 2.5-.4 4.5-1.1 6.2z",fill:"#fff"}));case"SYSTEM_BASKER":return Object(_.createElement)(z.SVG,{width:"232",height:"132",viewBox:"0 0 232 132",xmlns:"http://www.w3.org/2000/svg"},Object(_.createElement)(z.Path,{fill:"#F18F1B",d:"M0 0h232v132H0z"}),Object(_.createElement)(z.Path,{d:"M10.016 50.563c.14 4.25 3.718 6.828 9.093 6.828 5.641 0 9.094-2.797 9.094-7.203 0-3.422-2.078-5.344-6.844-6.297l-2.39-.485c-2.657-.531-3.75-1.39-3.75-2.781 0-1.656 1.562-2.75 3.89-2.75 2.375 0 4.047 1.156 4.203 3.078h4.454c-.078-4.14-3.391-6.89-8.657-6.89-5.015 0-8.609 2.734-8.609 6.859 0 3.36 2.203 5.516 6.703 6.406l2.375.469c2.828.578 3.89 1.422 3.89 2.906 0 1.656-1.718 2.875-4.234 2.875-2.562 0-4.468-1.125-4.765-3.016h-4.453zM53 37v-8.422l7.86-14.125h-5.063l-5.063 9.625h-.109l-5.047-9.625h-5.14l7.843 14.125V37H53zM73.016 60.563c.14 4.25 3.718 6.828 9.093 6.828 5.641 0 9.094-2.797 9.094-7.204 0-3.421-2.078-5.343-6.844-6.296l-2.39-.485c-2.656-.531-3.75-1.39-3.75-2.781 0-1.656 1.562-2.75 3.89-2.75 2.375 0 4.047 1.156 4.204 3.078h4.453c-.079-4.14-3.391-6.89-8.657-6.89-5.015 0-8.609 2.734-8.609 6.859 0 3.36 2.203 5.516 6.703 6.406l2.375.469c2.828.578 3.89 1.422 3.89 2.906 0 1.656-1.718 2.875-4.234 2.875-2.562 0-4.468-1.125-4.765-3.016h-4.453zM114.984 47V28.344h6.532v-3.89H103.75v3.89h6.516V47h4.718zM149.812 43.094h-10.218v-5.688h9.64v-3.625h-9.64v-5.437h10.218v-3.89h-14.937V47h14.937v-3.906zM187.75 37V14.453h-5.469l-6.406 16.188h-.125l-6.406-16.188h-5.469V37h4.203V21.781h.125L174.328 37h2.969l6.125-15.219h.125V37h4.203z",fill:"#492B06"}),Object(_.createElement)(z.Path,{d:"M22.032 92H9.63v-.72c.396-.012.72-.048.972-.108s.444-.162.576-.306c.132-.144.222-.348.27-.612.048-.264.072-.606.072-1.026v-8.316c0-.42-.024-.756-.072-1.008-.036-.264-.114-.468-.234-.612a.852.852 0 0 0-.522-.306 4.454 4.454 0 0 0-.864-.126v-.72h6.21v.72a5.062 5.062 0 0 0-.99.108c-.24.06-.426.168-.558.324-.132.156-.222.372-.27.648a8.868 8.868 0 0 0-.054 1.098v7.542c0 .504.048.918.144 1.242.108.312.288.558.54.738.252.168.588.288 1.008.36.42.06.942.09 1.566.09.696 0 1.278-.042 1.746-.126.468-.084.858-.24 1.17-.468.324-.24.582-.558.774-.954.192-.396.354-.912.486-1.548h.72L22.032 92zm5.182-2.952c0 .48.018.864.054 1.152.036.288.108.51.216.666a.833.833 0 0 0 .468.324c.204.048.48.078.828.09V92h-5.67v-.72c.336-.012.606-.048.81-.108a.968.968 0 0 0 .486-.324c.12-.156.198-.366.234-.63.048-.276.072-.624.072-1.044V86.96c0-.696-.012-1.266-.036-1.71-.024-.456-.054-.768-.09-.936-.06-.3-.198-.498-.414-.594-.204-.096-.582-.144-1.134-.144v-.612l4.176-.684v6.768zm-2.646-10.584c0-.396.132-.726.396-.99a1.35 1.35 0 0 1 .99-.414c.396 0 .726.138.99.414.276.264.414.594.414.99 0 .384-.138.714-.414.99a1.343 1.343 0 0 1-.99.396c-.384 0-.714-.132-.99-.396a1.382 1.382 0 0 1-.396-.99zm8.574 9.594c0 .444.06.858.18 1.242.132.372.306.696.522.972.216.276.474.492.774.648.3.156.63.234.99.234.72 0 1.266-.33 1.638-.99.372-.66.558-1.632.558-2.916 0-1.248-.186-2.196-.558-2.844-.36-.66-.906-.99-1.638-.99-.432 0-.834.12-1.206.36-.36.228-.642.552-.846.972-.276.576-.414 1.302-.414 2.178v1.134zm-.036-4.356h.072a3.07 3.07 0 0 1 1.206-1.044c.492-.252 1.05-.378 1.674-.378.636 0 1.224.132 1.764.396.552.252 1.026.6 1.422 1.044.408.444.726.966.954 1.566.228.6.342 1.242.342 1.926 0 .72-.126 1.386-.378 1.998-.24.6-.576 1.122-1.008 1.566-.42.444-.918.792-1.494 1.044a4.362 4.362 0 0 1-1.8.378c-.66 0-1.284-.126-1.872-.378-.576-.264-1.038-.606-1.386-1.026L31.234 92h-.612V81.29c0-1.128-.078-1.902-.234-2.322a.93.93 0 0 0-.126-.216.488.488 0 0 0-.216-.144 1.07 1.07 0 0 0-.36-.108 7.62 7.62 0 0 0-.612-.108v-.612l4.032-.72v6.642zm12.759 5.508c0 .468.018.84.054 1.116.048.264.138.468.27.612.132.144.324.24.576.288.252.036.588.054 1.008.054V92H41.76v-.72c.36-.024.648-.06.864-.108.216-.048.378-.144.486-.288.108-.144.174-.348.198-.612.036-.276.054-.642.054-1.098v-2.196c0-.744-.018-1.338-.054-1.782-.036-.444-.114-.786-.234-1.026a.867.867 0 0 0-.522-.468c-.216-.084-.504-.126-.864-.126v-.63l3.6-.666.288 2.07h.072c.324-.636.75-1.14 1.278-1.512.528-.372 1.086-.558 1.674-.558.456 0 .828.114 1.116.342.288.228.432.516.432.864 0 .384-.114.708-.342.972-.216.264-.516.396-.9.396-.18 0-.342-.036-.486-.108a3.131 3.131 0 0 1-.396-.234 2.28 2.28 0 0 0-.342-.252.549.549 0 0 0-.342-.126c-.228 0-.444.15-.648.45-.204.3-.372.702-.504 1.206a9.68 9.68 0 0 0-.234 1.224c-.06.444-.09.888-.09 1.332v.864zM59.8 90.326c-1.092 1.236-2.454 1.854-4.086 1.854a5.787 5.787 0 0 1-2.034-.342c-.6-.24-1.116-.57-1.548-.99a4.592 4.592 0 0 1-1.008-1.53c-.24-.588-.36-1.242-.36-1.962 0-.744.126-1.422.378-2.034a4.619 4.619 0 0 1 1.062-1.602 5.01 5.01 0 0 1 1.638-1.062 5.62 5.62 0 0 1 2.088-.378c1.272 0 2.262.342 2.97 1.026.708.684 1.062 1.644 1.062 2.88 0 .192-.03.312-.09.36-.06.036-.228.054-.504.054h-5.796c-.048.108-.072.306-.072.594 0 1.176.252 2.106.756 2.79.516.684 1.212 1.026 2.088 1.026.504 0 1.002-.114 1.494-.342.504-.228.99-.552 1.458-.972l.504.63zm-3.492-4.734c.48 0 .786-.024.918-.072.144-.06.216-.192.216-.396 0-.528-.15-.96-.45-1.296a1.455 1.455 0 0 0-1.134-.504c-.516 0-.978.216-1.386.648-.396.42-.654.96-.774 1.62h2.61zM65.985 92v-.72a4.75 4.75 0 0 0 .972-.108c.252-.06.444-.162.576-.306.144-.144.24-.348.288-.612.048-.264.072-.606.072-1.026v-8.316c0-.42-.018-.756-.054-1.008-.036-.264-.114-.468-.234-.612a.755.755 0 0 0-.468-.306 3.572 3.572 0 0 0-.774-.126v-.72h5.778c1.812 0 3.204.294 4.176.882.984.576 1.476 1.404 1.476 2.484 0 1.428-1.026 2.436-3.078 3.024v.072c.66 0 1.254.096 1.782.288.54.18.996.438 1.368.774a3.523 3.523 0 0 1 1.17 2.682c0 .612-.15 1.146-.45 1.602-.288.456-.708.84-1.26 1.152-1.068.6-2.538.9-4.41.9h-6.93zm7.056-1.098c1.932 0 2.898-.87 2.898-2.61 0-1.068-.348-1.848-1.044-2.34-.36-.252-.828-.432-1.404-.54-.564-.108-1.26-.162-2.088-.162h-.864v3.6c0 .744.192 1.272.576 1.584.384.312 1.026.468 1.926.468zM71.6 84.17c.54 0 1.008-.048 1.404-.144a3.249 3.249 0 0 0 1.008-.45c.576-.396.864-1.014.864-1.854 0-.876-.216-1.506-.648-1.89-.432-.396-1.128-.594-2.088-.594h-1.278c-.216 0-.324.102-.324.306v4.626H71.6zm14.325 2.7c-1.008.456-1.77.882-2.286 1.278-.504.384-.756.786-.756 1.206 0 .348.096.624.288.828a.948.948 0 0 0 .72.306c.288 0 .558-.048.81-.144.252-.108.468-.246.648-.414.18-.168.318-.366.414-.594.108-.24.162-.492.162-.756v-1.71zm0-.954v-.756c0-.696-.126-1.2-.378-1.512-.24-.324-.618-.486-1.134-.486-.348 0-.612.096-.792.288-.18.18-.348.486-.504.918-.108.3-.264.534-.468.702-.192.168-.462.252-.81.252-.336 0-.594-.102-.774-.306-.18-.204-.27-.492-.27-.864 0-.576.312-1.032.936-1.368.636-.336 1.59-.504 2.862-.504 1.344 0 2.304.246 2.88.738.576.48.864 1.29.864 2.43v3.942c0 1.02.204 1.53.612 1.53a.978.978 0 0 0 .63-.234l.27.522c-.168.3-.432.54-.792.72a2.7 2.7 0 0 1-1.188.252c-.552 0-.972-.168-1.26-.504-.288-.336-.432-.81-.432-1.422h-.09c-.348.624-.798 1.098-1.35 1.422-.552.324-1.182.486-1.89.486-.756 0-1.362-.21-1.818-.63-.456-.432-.684-.99-.684-1.674 0-.528.234-1.02.702-1.476.468-.468 1.248-.924 2.34-1.368l2.538-1.098zM91.6 92h-.558v-3.276h.756c.204.864.498 1.494.882 1.89.384.396.882.594 1.494.594.444 0 .786-.09 1.026-.27a.923.923 0 0 0 .378-.774c0-.336-.15-.66-.45-.972-.3-.324-.786-.666-1.458-1.026-.912-.492-1.566-.978-1.962-1.458a2.574 2.574 0 0 1-.594-1.656c0-.396.072-.762.216-1.098.156-.348.36-.648.612-.9.264-.252.576-.444.936-.576.36-.144.75-.216 1.17-.216.372 0 .738.054 1.098.162.372.108.696.258.972.45l.324-.432h.468v2.718h-.702c-.276-.684-.564-1.176-.864-1.476-.288-.3-.642-.45-1.062-.45-.336 0-.606.09-.81.27-.192.18-.288.42-.288.72 0 .336.144.654.432.954.3.3.792.63 1.476.99.48.264.894.522 1.242.774s.63.51.846.774c.216.252.372.522.468.81.108.276.162.576.162.9 0 .42-.078.798-.234 1.134a2.462 2.462 0 0 1-.666.864c-.288.24-.636.426-1.044.558-.396.132-.84.198-1.332.198-.516 0-.996-.066-1.44-.198-.444-.144-.81-.348-1.098-.612L91.6 92zm13.299-.72c.384 0 .654-.012.81-.036.156-.036.234-.102.234-.198 0-.072-.084-.246-.252-.522-.156-.288-.36-.618-.612-.99l-1.368-2.052-.9.864v.702c0 .468.018.846.054 1.134.036.288.096.516.18.684a.759.759 0 0 0 .378.324c.168.06.378.09.63.09V92h-5.31v-.72c.336-.012.606-.048.81-.108a.969.969 0 0 0 .486-.306c.12-.156.198-.366.234-.63a6.4 6.4 0 0 0 .072-1.062v-7.632c0-.732-.012-1.308-.036-1.728-.024-.42-.09-.732-.198-.936a.647.647 0 0 0-.468-.396 3.877 3.877 0 0 0-.846-.072v-.666l4.014-.684v10.008l1.728-1.638a28.697 28.697 0 0 0 1.332-1.314c.264-.3.396-.516.396-.648 0-.108-.114-.18-.342-.216-.216-.048-.624-.072-1.224-.072v-.72h4.914v.72c-.456 0-.858.078-1.206.234-.348.156-.726.426-1.134.81l-1.746 1.638 3.114 4.41c.276.384.546.648.81.792.264.144.612.216 1.044.216V92h-5.598v-.72zm14.737-.954c-1.092 1.236-2.454 1.854-4.086 1.854a5.787 5.787 0 0 1-2.034-.342c-.6-.24-1.116-.57-1.548-.99a4.592 4.592 0 0 1-1.008-1.53c-.24-.588-.36-1.242-.36-1.962 0-.744.126-1.422.378-2.034a4.619 4.619 0 0 1 1.062-1.602 5.01 5.01 0 0 1 1.638-1.062 5.62 5.62 0 0 1 2.088-.378c1.272 0 2.262.342 2.97 1.026.708.684 1.062 1.644 1.062 2.88 0 .192-.03.312-.09.36-.06.036-.228.054-.504.054h-5.796c-.048.108-.072.306-.072.594 0 1.176.252 2.106.756 2.79.516.684 1.212 1.026 2.088 1.026.504 0 1.002-.114 1.494-.342.504-.228.99-.552 1.458-.972l.504.63zm-3.492-4.734c.48 0 .786-.024.918-.072.144-.06.216-.192.216-.396 0-.528-.15-.96-.45-1.296a1.455 1.455 0 0 0-1.134-.504c-.516 0-.978.216-1.386.648-.396.42-.654.96-.774 1.62h2.61zm8.945 3.618c0 .468.018.84.054 1.116.048.264.138.468.27.612.132.144.324.24.576.288.252.036.588.054 1.008.054V92h-6.012v-.72c.36-.024.648-.06.864-.108.216-.048.378-.144.486-.288.108-.144.174-.348.198-.612.036-.276.054-.642.054-1.098v-2.196c0-.744-.018-1.338-.054-1.782-.036-.444-.114-.786-.234-1.026a.867.867 0 0 0-.522-.468c-.216-.084-.504-.126-.864-.126v-.63l3.6-.666.288 2.07h.072c.324-.636.75-1.14 1.278-1.512.528-.372 1.086-.558 1.674-.558.456 0 .828.114 1.116.342.288.228.432.516.432.864 0 .384-.114.708-.342.972-.216.264-.516.396-.9.396-.18 0-.342-.036-.486-.108a3.131 3.131 0 0 1-.396-.234 2.28 2.28 0 0 0-.342-.252.549.549 0 0 0-.342-.126c-.228 0-.444.15-.648.45-.204.3-.372.702-.504 1.206a9.68 9.68 0 0 0-.234 1.224c-.06.444-.09.888-.09 1.332v.864zm6.139-4.428a5.587 5.587 0 0 0-.378-.828 1.667 1.667 0 0 0-.378-.486.847.847 0 0 0-.414-.234 2.18 2.18 0 0 0-.522-.054v-.72h5.382v.72c-.3 0-.54.012-.72.036-.168.024-.3.06-.396.108a.328.328 0 0 0-.162.198.798.798 0 0 0-.036.252c0 .156.03.336.09.54.06.204.132.408.216.612l1.71 4.716h.072l1.926-4.698a6.35 6.35 0 0 0 .198-.54 1.66 1.66 0 0 0 .072-.45c0-.264-.09-.456-.27-.576-.18-.12-.498-.186-.954-.198v-.72h3.978v.72c-.324 0-.606.084-.846.252-.228.168-.468.54-.72 1.116l-3.366 7.632h-1.638l-2.844-7.398zm14.041 4.266c0 .48.018.864.054 1.152.036.288.108.51.216.666a.833.833 0 0 0 .468.324c.204.048.48.078.828.09V92h-5.67v-.72c.336-.012.606-.048.81-.108a.968.968 0 0 0 .486-.324c.12-.156.198-.366.234-.63.048-.276.072-.624.072-1.044V86.96c0-.696-.012-1.266-.036-1.71-.024-.456-.054-.768-.09-.936-.06-.3-.198-.498-.414-.594-.204-.096-.582-.144-1.134-.144v-.612l4.176-.684v6.768zm-2.646-10.584c0-.396.132-.726.396-.99a1.35 1.35 0 0 1 .99-.414c.396 0 .726.138.99.414.276.264.414.594.414.99 0 .384-.138.714-.414.99a1.343 1.343 0 0 1-.99.396c-.384 0-.714-.132-.99-.396a1.382 1.382 0 0 1-.396-.99zm8.969 10.584c0 .48.018.864.054 1.152.036.288.108.51.216.666a.833.833 0 0 0 .468.324c.204.048.48.078.828.09V92h-5.67v-.72c.336-.012.606-.048.81-.108a.968.968 0 0 0 .486-.324c.12-.156.198-.366.234-.63.048-.276.072-.624.072-1.044V81.74c0-.696-.012-1.266-.036-1.71-.024-.456-.054-.768-.09-.936-.06-.3-.198-.498-.414-.594-.204-.096-.582-.144-1.134-.144v-.612l4.176-.684v11.988zm6.399 0c0 .48.018.864.054 1.152.036.288.108.51.216.666a.833.833 0 0 0 .468.324c.204.048.48.078.828.09V92h-5.67v-.72c.336-.012.606-.048.81-.108a.968.968 0 0 0 .486-.324c.12-.156.198-.366.234-.63.048-.276.072-.624.072-1.044V81.74c0-.696-.012-1.266-.036-1.71-.024-.456-.054-.768-.09-.936-.06-.3-.198-.498-.414-.594-.204-.096-.582-.144-1.134-.144v-.612l4.176-.684v11.988zm11.672 1.278c-1.092 1.236-2.454 1.854-4.086 1.854a5.787 5.787 0 0 1-2.034-.342c-.6-.24-1.116-.57-1.548-.99a4.592 4.592 0 0 1-1.008-1.53c-.24-.588-.36-1.242-.36-1.962 0-.744.126-1.422.378-2.034a4.619 4.619 0 0 1 1.062-1.602 5.01 5.01 0 0 1 1.638-1.062 5.62 5.62 0 0 1 2.088-.378c1.272 0 2.262.342 2.97 1.026.708.684 1.062 1.644 1.062 2.88 0 .192-.03.312-.09.36-.06.036-.228.054-.504.054h-5.796c-.048.108-.072.306-.072.594 0 1.176.252 2.106.756 2.79.516.684 1.212 1.026 2.088 1.026.504 0 1.002-.114 1.494-.342.504-.228.99-.552 1.458-.972l.504.63zm-3.492-4.734c.48 0 .786-.024.918-.072.144-.06.216-.192.216-.396 0-.528-.15-.96-.45-1.296a1.455 1.455 0 0 0-1.134-.504c-.516 0-.978.216-1.386.648-.396.42-.654.96-.774 1.62h2.61z",fill:"#FFF1E1"}));case"RUBIK_WORK":return Object(_.createElement)(z.SVG,{width:"232",height:"132",viewBox:"0 0 232 132",xmlns:"http://www.w3.org/2000/svg"},Object(_.createElement)(z.Path,{fill:"#000",d:"M0 0h232v132H0z"}),Object(_.createElement)(z.Path,{d:"M14.936 62c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V29.696c0-.352.128-.656.384-.912s.56-.384.912-.384h14.208c4.608 0 8.208 1.04 10.8 3.12 2.592 2.048 3.888 4.896 3.888 8.544 0 2.08-.464 3.92-1.392 5.52-.928 1.568-2.192 2.864-3.792 3.888l5.904 10.944c.096.192.144.368.144.528 0 .288-.112.544-.336.768a.977.977 0 0 1-.72.288H33.8c-.576 0-1.04-.128-1.392-.384-.32-.288-.544-.592-.672-.912l-4.128-9.168H25.64v9.168c0 .352-.128.656-.384.912s-.56.384-.912.384h-9.408zm14.208-19.584c.704 0 1.248-.224 1.632-.672.384-.48.576-1.072.576-1.776s-.192-1.312-.576-1.824c-.352-.544-.896-.816-1.632-.816H25.64v5.088h3.504zM56.873 62.48c-1.696 0-3.248-.384-4.656-1.152-1.408-.8-2.544-2.016-3.408-3.648-.832-1.632-1.248-3.664-1.248-6.096V38.336c0-.352.128-.656.384-.912s.56-.384.912-.384h9.168c.352 0 .656.128.912.384s.384.56.384.912v12.912c0 .864.208 1.52.624 1.968.416.448 1.008.672 1.776.672s1.36-.224 1.776-.672c.416-.448.624-1.104.624-1.968V38.336c0-.352.128-.656.384-.912s.56-.384.912-.384h9.12c.352 0 .656.128.912.384s.384.56.384.912v22.368c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.4c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V59.12c-.768 1.12-1.84 1.968-3.216 2.544-1.376.544-2.96.816-4.752.816zm41.127 0c-3.04 0-5.408-.96-7.104-2.88v1.104c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.16c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V29.216c0-.352.128-.656.384-.912s.56-.384.912-.384h8.88c.352 0 .656.128.912.384s.384.56.384.912v9.6C93.28 37.312 95.408 36.56 98 36.56c2.912 0 5.296.944 7.152 2.832 1.888 1.856 2.896 4.592 3.024 8.208.032.48.048 1.104.048 1.872 0 .8-.016 1.44-.048 1.92-.16 3.808-1.152 6.608-2.976 8.4-1.824 1.792-4.224 2.688-7.2 2.688zm-3.984-8.592c.832 0 1.408-.224 1.728-.672.352-.448.576-1.152.672-2.112.064-.64.096-1.168.096-1.584 0-.416-.032-.944-.096-1.584-.096-.96-.32-1.664-.672-2.112-.32-.448-.896-.672-1.728-.672-.8 0-1.392.208-1.776.624-.352.384-.56.976-.624 1.776-.032.48-.048 1.072-.048 1.776s.016 1.296.048 1.776c.064.928.272 1.632.624 2.112.352.448.944.672 1.776.672zM113.415 34.4c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912v-5.808c0-.352.128-.656.384-.912s.56-.384.912-.384h8.112c.352 0 .656.128.912.384s.384.56.384.912v5.808c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.112zm-.24 27.6c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V38.336c0-.352.128-.656.384-.912s.56-.384.912-.384h8.592c.352 0 .656.128.912.384s.384.56.384.912v22.368c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.592zm15.515 0c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V29.216c0-.352.128-.656.384-.912s.56-.384.912-.384h8.4c.352 0 .656.128.912.384s.384.56.384.912v15.552l4.224-6.912c.32-.544.784-.816 1.392-.816h9.696c.32 0 .592.112.816.336.224.224.336.496.336.816 0 .224-.08.464-.24.72l-6.576 9.36 7.776 11.952c.128.192.192.4.192.624 0 .32-.112.592-.336.816a1.11 1.11 0 0 1-.816.336h-10.08c-.64 0-1.136-.272-1.488-.816l-4.896-8.16v7.68c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.4zM25.4 105.48c-3.776 0-6.768-.88-8.976-2.64-2.208-1.76-3.312-4.16-3.312-7.2 0-1.952.56-3.664 1.68-5.136 1.12-1.472 2.72-2.8 4.8-3.984-1.216-1.312-2.096-2.528-2.64-3.648-.512-1.152-.768-2.32-.768-3.504 0-1.536.4-2.944 1.2-4.224.8-1.28 1.984-2.304 3.552-3.072 1.568-.768 3.456-1.152 5.664-1.152 2.048 0 3.824.384 5.328 1.152 1.536.736 2.688 1.744 3.456 3.024a7.494 7.494 0 0 1 1.2 4.128c0 1.856-.56 3.456-1.68 4.8-1.12 1.312-2.784 2.608-4.992 3.888l5.712 5.712c.512-.832.944-1.632 1.296-2.4.384-.8.768-1.84 1.152-3.12.128-.448.464-.672 1.008-.672h4.848c.256 0 .48.096.672.288.192.16.288.368.288.624-.032 1.12-.56 2.64-1.584 4.56-.992 1.92-2.096 3.616-3.312 5.088l5.376 5.424c.224.288.336.528.336.72a.774.774 0 0 1-.288.624.844.844 0 0 1-.624.24h-6.528c-.512 0-.928-.16-1.248-.48l-2.16-2.064c-2.464 2.016-5.616 3.024-9.456 3.024zm.432-21.984c1.28-.64 2.24-1.264 2.88-1.872.672-.608 1.008-1.328 1.008-2.16 0-.864-.304-1.552-.912-2.064-.576-.544-1.312-.816-2.208-.816a3.31 3.31 0 0 0-2.208.816c-.608.544-.912 1.248-.912 2.112 0 .576.176 1.184.528 1.824.384.608.992 1.328 1.824 2.16zM25.4 99.384c1.984 0 3.632-.592 4.944-1.776l-6.384-6.384c-2.112 1.12-3.168 2.48-3.168 4.08 0 1.216.464 2.208 1.392 2.976.928.736 2 1.104 3.216 1.104zM65.56 105h-3.168l-6.24-21.12h2.752l5.088 19.104 4.992-19.104h2.912l4.992 19.168 5.12-19.168H84.6L78.392 105h-3.168L71.48 91.304l-1.088-4.768h-.032l-1.088 4.768L65.56 105zm28.824-16.32c2.41 0 4.299.736 5.664 2.208 1.387 1.472 2.08 3.51 2.08 6.112 0 2.603-.693 4.64-2.08 6.112-1.365 1.472-3.253 2.208-5.664 2.208-2.41 0-4.31-.736-5.696-2.208-1.365-1.472-2.048-3.51-2.048-6.112 0-2.603.683-4.64 2.048-6.112 1.387-1.472 3.286-2.208 5.696-2.208zm0 2.208c-1.621 0-2.89.544-3.808 1.632C89.66 93.608 89.2 95.101 89.2 97c0 1.899.459 3.392 1.376 4.48.918 1.088 2.187 1.632 3.808 1.632 1.622 0 2.89-.544 3.808-1.632.918-1.088 1.376-2.581 1.376-4.48 0-1.899-.458-3.392-1.376-4.48-.917-1.088-2.186-1.632-3.808-1.632zm20.269-2.208c.768 0 1.355.107 1.76.32l-.512 2.496c-.512-.277-1.184-.416-2.016-.416-.683 0-1.355.203-2.016.608-.64.384-1.173.981-1.6 1.792-.405.79-.608 1.75-.608 2.88V105h-2.56V89h2.08l.352 2.624c.896-1.963 2.603-2.944 5.12-2.944zm11.463 8.416l-3.392 3.392V105h-2.56V81.64h2.56v15.648L131.012 89h3.2l-6.24 6.24 6.624 9.76h-3.104l-5.376-7.904zm29.655-13.536c3.776 0 6.496 1.493 8.16 4.48l-2.208 1.792c-.64-1.408-1.408-2.4-2.304-2.976-.874-.597-2.08-.896-3.616-.896-1.621 0-2.901.341-3.84 1.024-.917.661-1.376 1.515-1.376 2.56 0 .683.182 1.248.544 1.696.363.448.96.843 1.792 1.184.854.32 2.027.608 3.52.864 2.795.47 4.768 1.173 5.92 2.112 1.174.939 1.76 2.24 1.76 3.904 0 1.195-.341 2.251-1.024 3.168-.661.896-1.61 1.6-2.848 2.112-1.237.491-2.666.736-4.288.736-2.133 0-3.957-.416-5.472-1.248-1.493-.832-2.634-1.941-3.424-3.328l2.208-1.792c.576 1.259 1.419 2.24 2.528 2.944 1.131.683 2.539 1.024 4.224 1.024 1.664 0 2.987-.299 3.968-.896.982-.619 1.472-1.483 1.472-2.592 0-.939-.426-1.685-1.28-2.24-.853-.555-2.368-1.024-4.544-1.408-2.816-.49-4.81-1.195-5.984-2.112-1.173-.917-1.76-2.197-1.76-3.84 0-1.13.32-2.176.96-3.136.64-.96 1.558-1.717 2.752-2.272 1.195-.576 2.582-.864 4.16-.864zm26.044 19.584a5.25 5.25 0 0 0 1.28-.16l-.16 2.016a5.68 5.68 0 0 1-1.92.32c-.832 0-1.494-.181-1.984-.544-.47-.363-.768-.971-.896-1.824-.491.747-1.216 1.333-2.176 1.76a7.435 7.435 0 0 1-2.976.608c-1.579 0-2.88-.363-3.904-1.088-1.024-.747-1.536-1.813-1.536-3.2 0-1.216.533-2.261 1.6-3.136 1.066-.896 2.613-1.515 4.64-1.856l4.256-.704v-.896c0-1.067-.331-1.92-.992-2.56-.662-.64-1.579-.96-2.752-.96-1.067 0-1.995.256-2.784.768-.768.512-1.366 1.27-1.792 2.272l-1.888-1.376c.426-1.195 1.216-2.144 2.368-2.848 1.173-.704 2.538-1.056 4.096-1.056 1.898 0 3.424.459 4.576 1.376 1.152.917 1.728 2.272 1.728 4.064v7.872c0 .384.096.672.288.864.192.192.501.288.928.288zm-8.704-.064c1.344 0 2.496-.32 3.456-.96.981-.64 1.472-1.472 1.472-2.496v-2.208l-3.584.672c-1.43.256-2.496.63-3.2 1.12-.704.47-1.056 1.077-1.056 1.824 0 .661.256 1.173.768 1.536.512.341 1.226.512 2.144.512zm21.485-14.4c1.813 0 3.306.523 4.48 1.568 1.173 1.045 1.76 2.55 1.76 4.512V105h-2.56v-9.344c0-1.664-.363-2.87-1.088-3.616-.704-.747-1.654-1.12-2.848-1.12-.854 0-1.654.192-2.4.576-.747.363-1.366.97-1.856 1.824-.47.832-.704 1.888-.704 3.168V105h-2.56V89h2.24l.16 2.496c.533-.96 1.269-1.664 2.208-2.112.938-.47 1.994-.704 3.168-.704zm17.476 16.64c-1.536 0-2.922-.299-4.16-.896-1.237-.619-2.144-1.525-2.72-2.72l2.08-1.44a3.898 3.898 0 0 0 1.888 2.112c.896.469 1.952.704 3.168.704 1.259 0 2.219-.224 2.88-.672.662-.448.992-1.013.992-1.696 0-.619-.309-1.11-.928-1.472-.618-.384-1.706-.715-3.264-.992-1.536-.277-2.752-.608-3.648-.992-.896-.405-1.546-.907-1.952-1.504-.405-.619-.608-1.376-.608-2.272 0-.875.256-1.675.768-2.4.512-.725 1.248-1.301 2.208-1.728.96-.448 2.07-.672 3.328-.672 1.707 0 3.072.32 4.096.96 1.046.619 1.792 1.579 2.24 2.88l-2.176 1.28c-.341-1.024-.864-1.76-1.568-2.208-.682-.448-1.546-.672-2.592-.672-1.045 0-1.93.235-2.656.704-.725.47-1.088 1.013-1.088 1.632 0 .704.31 1.248.928 1.632.64.384 1.771.715 3.392.992 2.219.363 3.787.907 4.704 1.632.918.725 1.376 1.75 1.376 3.072a3.95 3.95 0 0 1-.832 2.464c-.533.704-1.312 1.259-2.336 1.664-1.002.405-2.176.608-3.52.608z",fill:"#fff"}));case"PLAY_ROBOTO":return Object(_.createElement)(z.SVG,{width:"232",height:"132",viewBox:"0 0 232 132",xmlns:"http://www.w3.org/2000/svg"},Object(_.createElement)(z.Path,{fill:"#B9B5B8",d:"M0 0h232v132H0z"}),Object(_.createElement)(z.Path,{d:"M149.438 101c-.75-2.125-1.23-5.27-1.438-9.438-2.625 3.417-5.979 6.063-10.062 7.938-4.042 1.833-8.334 2.75-12.876 2.75-6.5 0-11.77-1.812-15.812-5.438-4-3.624-6-8.208-6-13.75 0-6.583 2.729-11.791 8.188-15.624 5.5-3.834 13.145-5.75 22.937-5.75h13.563V54c0-4.833-1.5-8.625-4.5-11.375-2.959-2.792-7.292-4.188-13-4.188-5.209 0-9.521 1.334-12.938 4-3.417 2.667-5.125 5.876-5.125 9.626l-7.5-.063c0-5.375 2.5-10.02 7.5-13.938 5-3.958 11.146-5.937 18.437-5.937 7.542 0 13.48 1.896 17.813 5.688 4.375 3.75 6.625 9 6.75 15.75v32c0 6.541.687 11.437 2.063 14.687v.75h-8zm-23.5-5.375c5 0 9.458-1.208 13.374-3.625 3.959-2.417 6.834-5.646 8.626-9.688V67.439h-13.376c-7.458.083-13.291 1.458-17.5 4.124-4.208 2.626-6.312 6.25-6.312 10.876 0 3.791 1.396 6.937 4.188 9.437 2.833 2.5 6.5 3.75 11 3.75zM39.328 101.896c-5.461 0-9.6-1.451-12.416-4.352-2.73-2.987-4.096-6.699-4.096-11.136 0-3.84.981-6.997 2.944-9.472 2.048-2.56 4.437-4.523 7.168-5.888 2.73-1.365 6.272-2.773 10.624-4.224 4.608-1.536 7.979-2.944 10.112-4.224 2.133-1.28 3.2-3.072 3.2-5.376V45.832c0-2.73-.683-5.163-2.048-7.296s-3.712-3.2-7.04-3.2c-2.645 0-5.035.725-7.168 2.176 2.901 1.024 5.035 2.56 6.4 4.608 1.45 1.963 2.176 4.181 2.176 6.656 0 3.328-1.195 6.016-3.584 8.064-2.304 1.963-5.12 2.944-8.448 2.944-3.328 0-5.973-1.024-7.936-3.072-1.877-2.133-2.816-4.821-2.816-8.064 0-2.56.64-4.779 1.92-6.656 1.28-1.877 3.285-3.584 6.016-5.12 4.779-2.73 11.605-4.096 20.48-4.096 4.693 0 8.747.47 12.16 1.408 3.413.853 6.315 2.517 8.704 4.992 1.707 1.792 2.816 4.053 3.328 6.784.597 2.645.896 6.357.896 11.136V91.4c0 2.133.128 3.584.384 4.352.341.768.896 1.152 1.664 1.152.597 0 1.237-.17 1.92-.512a15.863 15.863 0 0 0 1.92-1.408l1.28 2.176c-3.67 3.157-8.917 4.736-15.744 4.736-5.12 0-8.704-.853-10.752-2.56-2.048-1.792-3.157-4.181-3.328-7.168-4.01 6.485-9.984 9.728-17.92 9.728zm12.8-10.24c1.792 0 3.37-.725 4.736-2.176V62.472c-.768 1.28-2.176 2.944-4.224 4.992-2.304 2.219-4.053 4.395-5.248 6.528-1.195 2.048-1.792 4.864-1.792 8.448 0 6.144 2.176 9.216 6.528 9.216z",fill:"#270920"}));default:return Object(_.createElement)("div",{className:"font-pairings-panel__preview"},Object(_.createElement)("h1",{style:{fontFamily:t}},"Lorem Ipsum"),Object(_.createElement)("p",{style:{fontFamily:c}},"Etiam tempor orci eu lobortis elementum nibh tellus molestie."))}},B=function(e){var t=e.fontPairings,c=e.fontBase,n=e.fontHeadings,a=e.update;return Object(_.createElement)(_.Fragment,null,Object(_.createElement)("h3",null,Object(y.__)("Font Pairings")),t&&n&&c?Object(_.createElement)("div",{role:"listbox"},t.map((function(e){var t=e.label,r=e.headings,l=e.base,o=e.preview,s=r===n&&l===c,i=V()("font-pairings-panel",{"is-selected":s});return Object(_.createElement)("div",{key:t,tabIndex:0,role:"option","aria-selected":s,className:i,onClick:function(){return a({headings:r,base:l})},onKeyDown:function(e){return e.keyCode===P.ENTER?a({headings:r,base:l}):null}},Object(_.createElement)("div",{className:"font-pairings-panel__preview"},H(o,r,l)),Object(_.createElement)("p",{className:"font-pairings-panel__label"},t))}))):Object(_.createElement)(S,{unsupportedFeature:Object(y.__)("font pairings")}))},M=function(e){var t=e.fontBase,c=e.fontBaseDefault,n=e.fontHeadings,a=e.fontHeadingsDefault,r=e.fontBaseOptions,l=e.fontHeadingsOptions,o=e.updateBaseFont,s=e.updateHeadingsFont;return r&&l?Object(_.createElement)(_.Fragment,null,Object(_.createElement)(z.SelectControl,{label:Object(y.__)("Heading Font"),value:n,options:l,onChange:function(e){return s(e)},style:{fontFamily:"unset"!==n?n:a}}),Object(_.createElement)(z.SelectControl,{label:Object(y.__)("Base Font"),value:t,options:r,onChange:function(e){return o(e)},style:{fontFamily:"unset"!==t?t:c}}),Object(_.createElement)("hr",null)):Object(_.createElement)(S,{unsupportedFeature:Object(y.__)("custom font selection")})},x=function(){return Object(_.createElement)(z.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(_.createElement)(z.Path,{d:"M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-4.05 16.5l-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13h-2.09z"}))},T=function(e){if("object"==typeof e){var t=e.label,c=e.value,n=e.prop;return{label:t,value:c,prop:void 0===n?"ANY_PROPERTY":n}}return{label:e,value:e,prop:"ANY_PROPERTY"}},N=function(e){return null!==e.value&&null!==e.label},L=function(e,t){return e?e.map(T).filter(N).filter(function(e){return function(t){return"ANY_PROPERTY"===t.prop||t.prop===e}}(t)):[]},C=function(e){var t=e.hasLocalChanges,c=e.resetAction,n=e.publishAction,a=e.className,r=void 0===a?null:a;return Object(_.createElement)("div",{className:r},Object(_.createElement)(z.Button,{disabled:!t,isDefault:!0,onClick:c},Object(y.__)("Reset")),Object(_.createElement)(z.Button,{className:"global-styles-sidebar__publish-button",disabled:!t,isPrimary:!0,onClick:n},Object(y.__)("Publish")))},F=(c(13),JETPACK_GLOBAL_STYLES_EDITOR_CONSTANTS),A=F.PLUGIN_NAME,I=F.STORE_NAME,R=F.REST_PATH;n=I,a=R,Object(s.registerStore)(n,{reducer:function(e,t){switch(t.type){case"UPDATE_OPTIONS":case"RESET_OPTIONS":case"PUBLISH_OPTIONS":return h()({},e,{},t.options)}return e},actions:O,selectors:{getOption:function(e,t){return e?e[t]:void 0},hasLocalChanges:function(e){return!!e&&Object.keys(v).some((function(t){return v[t]!==e[t]}))}},resolvers:{getOption:regeneratorRuntime.mark((function e(t){var c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,b=!0,e.next=6,O.fetchOptions();case 6:c=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),c={};case 12:return v=c,e.abrupt("return",{type:"UPDATE_OPTIONS",options:c});case 14:case"end":return e.stop()}}),e,null,[[2,9]])}))},controls:{IO_FETCH_OPTIONS:function(){return p()({path:a})},IO_PUBLISH_OPTIONS:function(e){var t=e.options;return v=t,p()({path:a,method:"POST",data:h()({},t)})}}}),r=["font_base","font_headings"],l=Object(s.select)(I).getOption,d()((function(){var e={},t={};r.forEach((function(c){e[c]=null,t[c]="--".concat(c.replace("_","-"))})),Object(s.subscribe)((function(){Object.keys(e).forEach((function(c){var n=l(c);if(e[c]!==n){e[c]=n;var a=document.getElementsByClassName("editor-styles-wrapper")[0];a&&a.style.setProperty(t[c],n)}}))}))})),Object(o.registerPlugin)(A,{render:Object(i.compose)(Object(s.withSelect)((function(e){return{siteName:e(I).getOption("blogname"),fontHeadings:e(I).getOption("font_headings"),fontHeadingsDefault:e(I).getOption("font_headings_default"),fontBase:e(I).getOption("font_base"),fontBaseDefault:e(I).getOption("font_base_default"),fontPairings:e(I).getOption("font_pairings"),fontOptions:e(I).getOption("font_options"),hasLocalChanges:e(I).hasLocalChanges()}})),Object(s.withDispatch)((function(e){return{updateOptions:e(I).updateOptions,publishOptions:e(I).publishOptions,resetLocalChanges:e(I).resetLocalChanges}})))((function(e){var t=e.fontHeadings,c=e.fontHeadingsDefault,n=e.fontBase,a=e.fontBaseDefault,r=e.fontPairings,l=e.fontOptions,o=e.siteName,s=e.publishOptions,i=e.updateOptions,u=e.hasLocalChanges,h=e.resetLocalChanges,f=function(){var e;return s((e={},j()(e,"font_base",n),j()(e,"font_headings",t),e))};return Object(_.createElement)(_.Fragment,null,Object(_.createElement)(E.PluginSidebarMoreMenuItem,{icon:Object(_.createElement)(x,null),target:"global-styles"},Object(y.__)("Global Styles")),Object(_.createElement)(E.PluginSidebar,{icon:Object(_.createElement)(x,null),name:"global-styles",title:Object(y.__)("Global Styles"),className:"global-styles-sidebar"},Object(_.createElement)(z.PanelBody,null,Object(_.createElement)("p",null,Object(y.sprintf)(Object(y.__)("You are customizing %s."),o)),Object(_.createElement)("p",null,Object(y.__)("Any change you make here will apply to the entire website.")),u?Object(_.createElement)("div",null,Object(_.createElement)("p",null,Object(_.createElement)("em",null,Object(y.__)("You have unsaved changes."))),Object(_.createElement)(C,{hasLocalChanges:u,publishAction:f,resetAction:h})):null),Object(_.createElement)(z.PanelBody,{title:Object(y.__)("Font Selection")},Object(_.createElement)(M,{fontBase:n,fontBaseDefault:a,fontHeadings:t,fontHeadingsDefault:c,fontBaseOptions:L(l,"font_base"),fontHeadingsOptions:L(l,"font_headings"),updateBaseFont:function(e){return i(j()({},"font_base",e))},updateHeadingsFont:function(e){return i(j()({},"font_headings",e))}}),Object(_.createElement)(B,{fontHeadings:t,fontBase:n,fontPairings:r,update:function(e){var t,c=e.headings,n=e.base;return i((t={},j()(t,"font_headings",c),j()(t,"font_base",n),t))}})),Object(_.createElement)(z.PanelBody,null,u?Object(_.createElement)("p",null,Object(_.createElement)("em",null,Object(y.__)("You have unsaved changes."))):null,Object(_.createElement)(C,{hasLocalChanges:u,publishAction:f,resetAction:h,className:"global-styles-sidebar__panel-action-buttons"}))))}))})}]));
 
 
 
 
1
+ !function(e,t){for(var c in t)e[c]=t[c]}(window,function(e){var t={};function c(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,c),a.l=!0,a.exports}return c.m=e,c.c=t,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)c.d(n,a,function(t){return e[t]}.bind(null,a));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="",c(c.s=14)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){e.exports=function(e,t,c){return t in e?Object.defineProperty(e,t,{value:c,enumerable:!0,configurable:!0,writable:!0}):e[t]=c,e}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t,c){var n=c(4);function a(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),c.push.apply(c,n)}return c}e.exports=function(e){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?a(Object(c),!0).forEach((function(t){n(e,t,c[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):a(Object(c)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(c,t))}))}return e}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){!function(){e.exports=this.wp.domReady}()},function(e,t){!function(){e.exports=this.wp.keycodes}()},function(e,t,c){var n;
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 c={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)&&n.length){var l=a.apply(null,n);l&&e.push(l)}else if("object"===r)for(var o in n)c.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},function(e,t,c){},function(e,t,c){"use strict";c.r(t);var n,a,r,l,o=c(8),s=c(3),i=c(9),u=c(6),h=c.n(u),f=c(7),p=c.n(f),v={},b=!1,O={publishOptions:regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,{type:"IO_PUBLISH_OPTIONS",options:t};case 2:return e.abrupt("return",{type:"PUBLISH_OPTIONS",options:t});case 3:case"end":return e.stop()}}),e)})),updateOptions:function(e){return{type:"UPDATE_OPTIONS",options:e}},fetchOptions:function(){return{type:"IO_FETCH_OPTIONS"}},resetLocalChanges:function(){return{type:"RESET_OPTIONS",options:v}}},m=c(10),d=c.n(m),g=c(4),j=c.n(g),_=c(0),E=c(5),z=c(1),y=c(2),P=c(11),w=c(12),V=c.n(w),S=function(e){var t=e.unsupportedFeature;return Object(_.createElement)("p",null,Object(y.sprintf)(Object(y.__)("Your active theme doesn't support %s."),t))},H=function(e,t,c){switch(e){case"SPACE_LORA":return Object(_.createElement)(z.SVG,{width:"232",height:"132",viewBox:"0 0 232 132",xmlns:"http://www.w3.org/2000/svg"},Object(_.createElement)(z.Path,{fill:"#fa4d4b",d:"M0 0h232v132H0z"}),Object(_.createElement)(z.Path,{d:"M24.1 62c-3.6-2.9-8.9-5-15.8-6.3-2.8-.5-5-1-6.9-1.6-.5-.2-1-.3-1.5-.5v12.5c1.4.3 2.9.6 4.4.9 2.5.4 4.6 1 6.2 1.6s2.9 1.3 3.9 2.2c.9.8 1.6 1.6 2 2.6.4.9.6 1.9.6 3 0 2.3-.9 4.2-2.7 5.8-1.8 1.6-4.6 2.4-8.4 2.4-2.2 0-4.2-.3-5.9-.8v12c1.8.3 3.7.4 5.7.4 3.7 0 7-.5 10-1.4 2.9-.9 5.5-2.3 7.5-4s3.6-3.9 4.7-6.3c1.1-2.5 1.7-5.3 1.7-8.4V75c0-5.7-1.8-10-5.5-13zM12.9 42.5c2.1 1.9 3.1 4.2 3.1 6.9v2.3h12.4v-3.4c0-2.7-.5-5.3-1.6-7.7-1-2.4-2.5-4.6-4.6-6.5-2-1.9-4.5-3.4-7.5-4.4-3-1.1-6.5-1.7-10.3-1.7-1.5 0-3 .1-4.4.3v11.9c1.3-.4 2.7-.5 4.4-.5 3.7-.2 6.5.8 8.5 2.8zm67.9 10.9c-1.8-2.1-4-3.6-6.5-4.7-2.4-1.1-5-1.6-7.8-1.6-3.7 0-6.7.7-9.1 2.2-2.4 1.4-4.2 3.4-5.5 5.9h-1.7v-6.8H38.4v65.4h11.8V88.2H52c.6 1.1 1.2 2.1 2 3.1.8.9 1.8 1.8 2.9 2.5 1.2.8 2.6 1.3 4.1 1.8 1.6.4 3.4.7 5.5.7 2.9 0 5.5-.5 8-1.5 2.5-1.1 4.7-2.6 6.5-4.6 1.8-2.1 3.3-4.6 4.3-7.5 1.1-2.9 1.6-6.3 1.6-10.2v-1.7c0-3.8-.6-7.1-1.7-10.1-1-2.9-2.5-5.3-4.4-7.3zm-5.7 18.9c0 3.9-1.2 7.1-3.5 9.4-2.3 2.3-5.2 3.4-8.9 3.4s-6.7-1.2-9-3.5c-2.3-2.4-3.4-5.5-3.4-9.3v-1.1c0-3.8 1.1-6.9 3.4-9.2 2.3-2.4 5.3-3.6 9-3.6s6.7 1.2 8.9 3.5c2.3 2.3 3.5 5.4 3.5 9.3v1.1zm66.2 8.6V48.4h-11.8V54h-1.7c-1.2-2.4-2.8-4.1-4.9-5.3-2-1.1-4.7-1.7-8-1.7-2.8 0-5.4.6-7.8 1.7-2.4 1.1-4.5 2.6-6.3 4.7-1.8 2.1-3.3 4.6-4.3 7.6-1.1 2.9-1.6 6.3-1.6 10v1.5c0 3.8.5 7.1 1.6 10.1 1.1 2.9 2.6 5.5 4.5 7.5 1.9 2.1 4 3.6 6.5 4.7s5.2 1.6 8 1.6c3 0 5.6-.6 7.9-1.8 2.3-1.3 4-3.4 5.3-6.3h1.7c0 2 .7 3.6 2 4.9 1.4 1.3 3.1 1.9 5.3 1.9h8.1V83.7H144c-1.8 0-2.7-.9-2.7-2.8zm-11.8-8.6c0 3.9-1 7.1-3.1 9.4-2.1 2.3-4.8 3.4-8.3 3.4-3.4 0-6.2-1.1-8.3-3.4-2.1-2.3-3.1-5.5-3.1-9.4v-1.1c0-3.9 1-7.1 3.1-9.3 2.1-2.3 4.8-3.5 8.3-3.5 3.4 0 6.2 1.2 8.3 3.5 2.1 2.3 3.1 5.4 3.1 9.3v1.1zm98.3-12.2c1.2-1 2.6-1.6 4.2-2V47.3c-2.1.3-4 .8-5.9 1.6-2.8 1.1-5.3 2.7-7.4 4.8-2.1 2.1-3.8 4.6-5.1 7.5-1.2 2.9-1.8 6.2-1.8 9.8v.6c0 3.9.6 7.4 1.7 10.4 1.2 3.1 2.8 5.7 4.9 7.8 2.1 2.1 4.6 3.8 7.5 4.9 1.9.7 4 1.2 6.1 1.5V84.7c-.4-.1-.7-.2-1.1-.3-1.3-.5-2.5-1.2-3.6-2-1-.9-1.8-1.9-2.4-3-.6-1.2-.9-2.5-.9-3.9h8V65.4h-7.8c.5-2 1.8-3.8 3.6-5.3zm-61.5 6.1c.7-1.7 1.6-3.1 2.7-4.2 1.1-1.2 2.4-2.1 3.9-2.7 1.5-.6 3.1-.9 4.8-.9 3.6 0 6.5 1 8.5 3s3.2 4.4 3.6 7.1l11.7-3c-1.1-5.5-3.6-10-7.7-13.3-4-3.4-9.3-5.1-15.8-5.1-3.4 0-6.6.6-9.6 1.7-2.9 1.1-5.5 2.8-7.8 4.9-2.2 2.1-3.9 4.7-5.2 7.7s-1.9 6.4-1.9 10.2v1.1c0 3.8.6 7.1 1.9 10.1 1.3 2.9 3 5.4 5.2 7.4s4.8 3.5 7.7 4.6c3 1.1 6.2 1.6 9.7 1.6 6.6 0 11.9-1.7 15.9-5.1 4-3.4 6.5-7.8 7.6-13.3l-11.7-3c-.6 3.1-1.8 5.5-3.8 7.3-1.9 1.8-4.6 2.7-8.3 2.7-1.7 0-3.3-.3-4.8-.8-1.5-.6-2.8-1.4-3.9-2.4-1.1-1.1-2-2.4-2.7-3.9-.6-1.6-.9-3.5-.9-5.5v-.6c0-2.1.3-3.9.9-5.6z",fill:"#270920"}),Object(_.createElement)(z.Path,{d:"M49.7 89.3c-1.1 1.3-2.6 2-4.5 2h-6.5c.1-1.1.2-2.5.2-4.3V68.5c0-1.3.1-2.2.4-2.8s.6-1 1.1-1.1c.5-.2 1.1-.3 2-.3v-3.2h-14v3.7l3.6-.1c-.1 1.1-.2 2.5-.2 4.4v18.5c0 1.3-.1 2.2-.4 2.8-.3.6-.6 1-1.1 1.2-.5.2-1.1.3-2 .3V95h25.8l.3-11.6h-3.2c.1 2.6-.5 4.5-1.5 5.9zM101.3 70c-2.5 0-4.8 1.5-7 4.5h-.1v-2.3c0-.8-.1-1.4-.1-1.9h-2.4c-.4.4-1.3.7-2.5 1-1.3.3-2.9.4-4.9.4v3.7l3.4-.1c-.1 1.3-.2 2.7-.2 4.1v8.1c0 1.5-.2 2.6-.5 3.3-.3.7-1.1 1-2.3 1V95h12.7v-3.7c-1.1 0-2.1 0-3.1.1.1-1.3.2-2.7.2-4.3v-7.9c.3-1 1-2.1 1.9-3.1 1-1.1 1.9-1.6 2.8-1.6.1 1 .5 1.8 1.1 2.2.6.4 1.4.6 2.2.6 1.1 0 1.9-.4 2.5-1.1.5-.7.8-1.5.8-2.3 0-1.3-.4-2.3-1.2-3-1-.5-2-.9-3.3-.9zm25.8 21.5c.1-1.3.2-2.7.2-4.3v-7.9c0-6.2-3-9.2-9-9.2-1.9 0-3.6.3-5.2.8-1.5.5-2.8 1.3-3.7 2.2-.9 1-1.4 2.1-1.4 3.3 0 .9.3 1.7.8 2.4.5.6 1.3.9 2.3.9 1 0 1.8-.3 2.3-.9.5-.6.8-1.3.8-2.1s-.2-1.4-.6-1.8c.9-.9 2.1-1.4 3.5-1.4 2.2 0 3.3 1.5 3.3 4.4v2.5c-3.7.2-6.9 1-9.5 2.5-2.6 1.5-4 3.6-4 6.4 0 1.9.6 3.4 1.7 4.6 1.2 1.2 2.8 1.8 4.8 1.8 2.8 0 5.2-1 7.2-3 .1 1.1.1 1.8.2 2.2h9.1v-3.7c-.7.1-1.8.2-2.8.3zm-6.6-2.2c-1.1 1.2-2.4 1.7-3.8 1.7-.8 0-1.4-.2-2-.6-.5-.4-.8-1.1-.8-1.9 0-1.3.6-2.4 1.8-3.1 1.3-.8 2.8-1.3 4.7-1.5v5.4zM75.1 71.5c-1.8-1-3.9-1.5-6.2-1.5-2.2 0-4.3.6-6.1 1.7-1.8 1.1-3.3 2.7-4.4 4.7-1.1 2-1.6 4.4-1.6 7 0 2.5.5 4.7 1.6 6.5 1.1 1.9 2.5 3.3 4.4 4.3 1.9 1 4 1.5 6.3 1.5 2.4 0 4.4-.5 6.2-1.6 1.8-1.1 3.3-2.6 4.3-4.6 1-2 1.5-4.3 1.5-7 0-2.5-.5-4.7-1.6-6.6-1.1-1.9-2.5-3.4-4.4-4.4zm-2.2 18.4c-.7 1.6-2 2.5-3.7 2.5-1.8 0-3.1-1-4-3-.9-2-1.3-4.4-1.3-7.2 0-2.5.4-4.5 1.2-6.2.8-1.7 2.1-2.5 3.9-2.5 1.7 0 3 1 3.8 3s1.2 4.4 1.2 7.2c-.1 2.5-.4 4.5-1.1 6.2z",fill:"#fff"}));case"SYSTEM_BASKER":return Object(_.createElement)(z.SVG,{width:"232",height:"132",viewBox:"0 0 232 132",xmlns:"http://www.w3.org/2000/svg"},Object(_.createElement)(z.Path,{fill:"#F18F1B",d:"M0 0h232v132H0z"}),Object(_.createElement)(z.Path,{d:"M10.016 50.563c.14 4.25 3.718 6.828 9.093 6.828 5.641 0 9.094-2.797 9.094-7.203 0-3.422-2.078-5.344-6.844-6.297l-2.39-.485c-2.657-.531-3.75-1.39-3.75-2.781 0-1.656 1.562-2.75 3.89-2.75 2.375 0 4.047 1.156 4.203 3.078h4.454c-.078-4.14-3.391-6.89-8.657-6.89-5.015 0-8.609 2.734-8.609 6.859 0 3.36 2.203 5.516 6.703 6.406l2.375.469c2.828.578 3.89 1.422 3.89 2.906 0 1.656-1.718 2.875-4.234 2.875-2.562 0-4.468-1.125-4.765-3.016h-4.453zM53 37v-8.422l7.86-14.125h-5.063l-5.063 9.625h-.109l-5.047-9.625h-5.14l7.843 14.125V37H53zM73.016 60.563c.14 4.25 3.718 6.828 9.093 6.828 5.641 0 9.094-2.797 9.094-7.204 0-3.421-2.078-5.343-6.844-6.296l-2.39-.485c-2.656-.531-3.75-1.39-3.75-2.781 0-1.656 1.562-2.75 3.89-2.75 2.375 0 4.047 1.156 4.204 3.078h4.453c-.079-4.14-3.391-6.89-8.657-6.89-5.015 0-8.609 2.734-8.609 6.859 0 3.36 2.203 5.516 6.703 6.406l2.375.469c2.828.578 3.89 1.422 3.89 2.906 0 1.656-1.718 2.875-4.234 2.875-2.562 0-4.468-1.125-4.765-3.016h-4.453zM114.984 47V28.344h6.532v-3.89H103.75v3.89h6.516V47h4.718zM149.812 43.094h-10.218v-5.688h9.64v-3.625h-9.64v-5.437h10.218v-3.89h-14.937V47h14.937v-3.906zM187.75 37V14.453h-5.469l-6.406 16.188h-.125l-6.406-16.188h-5.469V37h4.203V21.781h.125L174.328 37h2.969l6.125-15.219h.125V37h4.203z",fill:"#492B06"}),Object(_.createElement)(z.Path,{d:"M22.032 92H9.63v-.72c.396-.012.72-.048.972-.108s.444-.162.576-.306c.132-.144.222-.348.27-.612.048-.264.072-.606.072-1.026v-8.316c0-.42-.024-.756-.072-1.008-.036-.264-.114-.468-.234-.612a.852.852 0 0 0-.522-.306 4.454 4.454 0 0 0-.864-.126v-.72h6.21v.72a5.062 5.062 0 0 0-.99.108c-.24.06-.426.168-.558.324-.132.156-.222.372-.27.648a8.868 8.868 0 0 0-.054 1.098v7.542c0 .504.048.918.144 1.242.108.312.288.558.54.738.252.168.588.288 1.008.36.42.06.942.09 1.566.09.696 0 1.278-.042 1.746-.126.468-.084.858-.24 1.17-.468.324-.24.582-.558.774-.954.192-.396.354-.912.486-1.548h.72L22.032 92zm5.182-2.952c0 .48.018.864.054 1.152.036.288.108.51.216.666a.833.833 0 0 0 .468.324c.204.048.48.078.828.09V92h-5.67v-.72c.336-.012.606-.048.81-.108a.968.968 0 0 0 .486-.324c.12-.156.198-.366.234-.63.048-.276.072-.624.072-1.044V86.96c0-.696-.012-1.266-.036-1.71-.024-.456-.054-.768-.09-.936-.06-.3-.198-.498-.414-.594-.204-.096-.582-.144-1.134-.144v-.612l4.176-.684v6.768zm-2.646-10.584c0-.396.132-.726.396-.99a1.35 1.35 0 0 1 .99-.414c.396 0 .726.138.99.414.276.264.414.594.414.99 0 .384-.138.714-.414.99a1.343 1.343 0 0 1-.99.396c-.384 0-.714-.132-.99-.396a1.382 1.382 0 0 1-.396-.99zm8.574 9.594c0 .444.06.858.18 1.242.132.372.306.696.522.972.216.276.474.492.774.648.3.156.63.234.99.234.72 0 1.266-.33 1.638-.99.372-.66.558-1.632.558-2.916 0-1.248-.186-2.196-.558-2.844-.36-.66-.906-.99-1.638-.99-.432 0-.834.12-1.206.36-.36.228-.642.552-.846.972-.276.576-.414 1.302-.414 2.178v1.134zm-.036-4.356h.072a3.07 3.07 0 0 1 1.206-1.044c.492-.252 1.05-.378 1.674-.378.636 0 1.224.132 1.764.396.552.252 1.026.6 1.422 1.044.408.444.726.966.954 1.566.228.6.342 1.242.342 1.926 0 .72-.126 1.386-.378 1.998-.24.6-.576 1.122-1.008 1.566-.42.444-.918.792-1.494 1.044a4.362 4.362 0 0 1-1.8.378c-.66 0-1.284-.126-1.872-.378-.576-.264-1.038-.606-1.386-1.026L31.234 92h-.612V81.29c0-1.128-.078-1.902-.234-2.322a.93.93 0 0 0-.126-.216.488.488 0 0 0-.216-.144 1.07 1.07 0 0 0-.36-.108 7.62 7.62 0 0 0-.612-.108v-.612l4.032-.72v6.642zm12.759 5.508c0 .468.018.84.054 1.116.048.264.138.468.27.612.132.144.324.24.576.288.252.036.588.054 1.008.054V92H41.76v-.72c.36-.024.648-.06.864-.108.216-.048.378-.144.486-.288.108-.144.174-.348.198-.612.036-.276.054-.642.054-1.098v-2.196c0-.744-.018-1.338-.054-1.782-.036-.444-.114-.786-.234-1.026a.867.867 0 0 0-.522-.468c-.216-.084-.504-.126-.864-.126v-.63l3.6-.666.288 2.07h.072c.324-.636.75-1.14 1.278-1.512.528-.372 1.086-.558 1.674-.558.456 0 .828.114 1.116.342.288.228.432.516.432.864 0 .384-.114.708-.342.972-.216.264-.516.396-.9.396-.18 0-.342-.036-.486-.108a3.131 3.131 0 0 1-.396-.234 2.28 2.28 0 0 0-.342-.252.549.549 0 0 0-.342-.126c-.228 0-.444.15-.648.45-.204.3-.372.702-.504 1.206a9.68 9.68 0 0 0-.234 1.224c-.06.444-.09.888-.09 1.332v.864zM59.8 90.326c-1.092 1.236-2.454 1.854-4.086 1.854a5.787 5.787 0 0 1-2.034-.342c-.6-.24-1.116-.57-1.548-.99a4.592 4.592 0 0 1-1.008-1.53c-.24-.588-.36-1.242-.36-1.962 0-.744.126-1.422.378-2.034a4.619 4.619 0 0 1 1.062-1.602 5.01 5.01 0 0 1 1.638-1.062 5.62 5.62 0 0 1 2.088-.378c1.272 0 2.262.342 2.97 1.026.708.684 1.062 1.644 1.062 2.88 0 .192-.03.312-.09.36-.06.036-.228.054-.504.054h-5.796c-.048.108-.072.306-.072.594 0 1.176.252 2.106.756 2.79.516.684 1.212 1.026 2.088 1.026.504 0 1.002-.114 1.494-.342.504-.228.99-.552 1.458-.972l.504.63zm-3.492-4.734c.48 0 .786-.024.918-.072.144-.06.216-.192.216-.396 0-.528-.15-.96-.45-1.296a1.455 1.455 0 0 0-1.134-.504c-.516 0-.978.216-1.386.648-.396.42-.654.96-.774 1.62h2.61zM65.985 92v-.72a4.75 4.75 0 0 0 .972-.108c.252-.06.444-.162.576-.306.144-.144.24-.348.288-.612.048-.264.072-.606.072-1.026v-8.316c0-.42-.018-.756-.054-1.008-.036-.264-.114-.468-.234-.612a.755.755 0 0 0-.468-.306 3.572 3.572 0 0 0-.774-.126v-.72h5.778c1.812 0 3.204.294 4.176.882.984.576 1.476 1.404 1.476 2.484 0 1.428-1.026 2.436-3.078 3.024v.072c.66 0 1.254.096 1.782.288.54.18.996.438 1.368.774a3.523 3.523 0 0 1 1.17 2.682c0 .612-.15 1.146-.45 1.602-.288.456-.708.84-1.26 1.152-1.068.6-2.538.9-4.41.9h-6.93zm7.056-1.098c1.932 0 2.898-.87 2.898-2.61 0-1.068-.348-1.848-1.044-2.34-.36-.252-.828-.432-1.404-.54-.564-.108-1.26-.162-2.088-.162h-.864v3.6c0 .744.192 1.272.576 1.584.384.312 1.026.468 1.926.468zM71.6 84.17c.54 0 1.008-.048 1.404-.144a3.249 3.249 0 0 0 1.008-.45c.576-.396.864-1.014.864-1.854 0-.876-.216-1.506-.648-1.89-.432-.396-1.128-.594-2.088-.594h-1.278c-.216 0-.324.102-.324.306v4.626H71.6zm14.325 2.7c-1.008.456-1.77.882-2.286 1.278-.504.384-.756.786-.756 1.206 0 .348.096.624.288.828a.948.948 0 0 0 .72.306c.288 0 .558-.048.81-.144.252-.108.468-.246.648-.414.18-.168.318-.366.414-.594.108-.24.162-.492.162-.756v-1.71zm0-.954v-.756c0-.696-.126-1.2-.378-1.512-.24-.324-.618-.486-1.134-.486-.348 0-.612.096-.792.288-.18.18-.348.486-.504.918-.108.3-.264.534-.468.702-.192.168-.462.252-.81.252-.336 0-.594-.102-.774-.306-.18-.204-.27-.492-.27-.864 0-.576.312-1.032.936-1.368.636-.336 1.59-.504 2.862-.504 1.344 0 2.304.246 2.88.738.576.48.864 1.29.864 2.43v3.942c0 1.02.204 1.53.612 1.53a.978.978 0 0 0 .63-.234l.27.522c-.168.3-.432.54-.792.72a2.7 2.7 0 0 1-1.188.252c-.552 0-.972-.168-1.26-.504-.288-.336-.432-.81-.432-1.422h-.09c-.348.624-.798 1.098-1.35 1.422-.552.324-1.182.486-1.89.486-.756 0-1.362-.21-1.818-.63-.456-.432-.684-.99-.684-1.674 0-.528.234-1.02.702-1.476.468-.468 1.248-.924 2.34-1.368l2.538-1.098zM91.6 92h-.558v-3.276h.756c.204.864.498 1.494.882 1.89.384.396.882.594 1.494.594.444 0 .786-.09 1.026-.27a.923.923 0 0 0 .378-.774c0-.336-.15-.66-.45-.972-.3-.324-.786-.666-1.458-1.026-.912-.492-1.566-.978-1.962-1.458a2.574 2.574 0 0 1-.594-1.656c0-.396.072-.762.216-1.098.156-.348.36-.648.612-.9.264-.252.576-.444.936-.576.36-.144.75-.216 1.17-.216.372 0 .738.054 1.098.162.372.108.696.258.972.45l.324-.432h.468v2.718h-.702c-.276-.684-.564-1.176-.864-1.476-.288-.3-.642-.45-1.062-.45-.336 0-.606.09-.81.27-.192.18-.288.42-.288.72 0 .336.144.654.432.954.3.3.792.63 1.476.99.48.264.894.522 1.242.774s.63.51.846.774c.216.252.372.522.468.81.108.276.162.576.162.9 0 .42-.078.798-.234 1.134a2.462 2.462 0 0 1-.666.864c-.288.24-.636.426-1.044.558-.396.132-.84.198-1.332.198-.516 0-.996-.066-1.44-.198-.444-.144-.81-.348-1.098-.612L91.6 92zm13.299-.72c.384 0 .654-.012.81-.036.156-.036.234-.102.234-.198 0-.072-.084-.246-.252-.522-.156-.288-.36-.618-.612-.99l-1.368-2.052-.9.864v.702c0 .468.018.846.054 1.134.036.288.096.516.18.684a.759.759 0 0 0 .378.324c.168.06.378.09.63.09V92h-5.31v-.72c.336-.012.606-.048.81-.108a.969.969 0 0 0 .486-.306c.12-.156.198-.366.234-.63a6.4 6.4 0 0 0 .072-1.062v-7.632c0-.732-.012-1.308-.036-1.728-.024-.42-.09-.732-.198-.936a.647.647 0 0 0-.468-.396 3.877 3.877 0 0 0-.846-.072v-.666l4.014-.684v10.008l1.728-1.638a28.697 28.697 0 0 0 1.332-1.314c.264-.3.396-.516.396-.648 0-.108-.114-.18-.342-.216-.216-.048-.624-.072-1.224-.072v-.72h4.914v.72c-.456 0-.858.078-1.206.234-.348.156-.726.426-1.134.81l-1.746 1.638 3.114 4.41c.276.384.546.648.81.792.264.144.612.216 1.044.216V92h-5.598v-.72zm14.737-.954c-1.092 1.236-2.454 1.854-4.086 1.854a5.787 5.787 0 0 1-2.034-.342c-.6-.24-1.116-.57-1.548-.99a4.592 4.592 0 0 1-1.008-1.53c-.24-.588-.36-1.242-.36-1.962 0-.744.126-1.422.378-2.034a4.619 4.619 0 0 1 1.062-1.602 5.01 5.01 0 0 1 1.638-1.062 5.62 5.62 0 0 1 2.088-.378c1.272 0 2.262.342 2.97 1.026.708.684 1.062 1.644 1.062 2.88 0 .192-.03.312-.09.36-.06.036-.228.054-.504.054h-5.796c-.048.108-.072.306-.072.594 0 1.176.252 2.106.756 2.79.516.684 1.212 1.026 2.088 1.026.504 0 1.002-.114 1.494-.342.504-.228.99-.552 1.458-.972l.504.63zm-3.492-4.734c.48 0 .786-.024.918-.072.144-.06.216-.192.216-.396 0-.528-.15-.96-.45-1.296a1.455 1.455 0 0 0-1.134-.504c-.516 0-.978.216-1.386.648-.396.42-.654.96-.774 1.62h2.61zm8.945 3.618c0 .468.018.84.054 1.116.048.264.138.468.27.612.132.144.324.24.576.288.252.036.588.054 1.008.054V92h-6.012v-.72c.36-.024.648-.06.864-.108.216-.048.378-.144.486-.288.108-.144.174-.348.198-.612.036-.276.054-.642.054-1.098v-2.196c0-.744-.018-1.338-.054-1.782-.036-.444-.114-.786-.234-1.026a.867.867 0 0 0-.522-.468c-.216-.084-.504-.126-.864-.126v-.63l3.6-.666.288 2.07h.072c.324-.636.75-1.14 1.278-1.512.528-.372 1.086-.558 1.674-.558.456 0 .828.114 1.116.342.288.228.432.516.432.864 0 .384-.114.708-.342.972-.216.264-.516.396-.9.396-.18 0-.342-.036-.486-.108a3.131 3.131 0 0 1-.396-.234 2.28 2.28 0 0 0-.342-.252.549.549 0 0 0-.342-.126c-.228 0-.444.15-.648.45-.204.3-.372.702-.504 1.206a9.68 9.68 0 0 0-.234 1.224c-.06.444-.09.888-.09 1.332v.864zm6.139-4.428a5.587 5.587 0 0 0-.378-.828 1.667 1.667 0 0 0-.378-.486.847.847 0 0 0-.414-.234 2.18 2.18 0 0 0-.522-.054v-.72h5.382v.72c-.3 0-.54.012-.72.036-.168.024-.3.06-.396.108a.328.328 0 0 0-.162.198.798.798 0 0 0-.036.252c0 .156.03.336.09.54.06.204.132.408.216.612l1.71 4.716h.072l1.926-4.698a6.35 6.35 0 0 0 .198-.54 1.66 1.66 0 0 0 .072-.45c0-.264-.09-.456-.27-.576-.18-.12-.498-.186-.954-.198v-.72h3.978v.72c-.324 0-.606.084-.846.252-.228.168-.468.54-.72 1.116l-3.366 7.632h-1.638l-2.844-7.398zm14.041 4.266c0 .48.018.864.054 1.152.036.288.108.51.216.666a.833.833 0 0 0 .468.324c.204.048.48.078.828.09V92h-5.67v-.72c.336-.012.606-.048.81-.108a.968.968 0 0 0 .486-.324c.12-.156.198-.366.234-.63.048-.276.072-.624.072-1.044V86.96c0-.696-.012-1.266-.036-1.71-.024-.456-.054-.768-.09-.936-.06-.3-.198-.498-.414-.594-.204-.096-.582-.144-1.134-.144v-.612l4.176-.684v6.768zm-2.646-10.584c0-.396.132-.726.396-.99a1.35 1.35 0 0 1 .99-.414c.396 0 .726.138.99.414.276.264.414.594.414.99 0 .384-.138.714-.414.99a1.343 1.343 0 0 1-.99.396c-.384 0-.714-.132-.99-.396a1.382 1.382 0 0 1-.396-.99zm8.969 10.584c0 .48.018.864.054 1.152.036.288.108.51.216.666a.833.833 0 0 0 .468.324c.204.048.48.078.828.09V92h-5.67v-.72c.336-.012.606-.048.81-.108a.968.968 0 0 0 .486-.324c.12-.156.198-.366.234-.63.048-.276.072-.624.072-1.044V81.74c0-.696-.012-1.266-.036-1.71-.024-.456-.054-.768-.09-.936-.06-.3-.198-.498-.414-.594-.204-.096-.582-.144-1.134-.144v-.612l4.176-.684v11.988zm6.399 0c0 .48.018.864.054 1.152.036.288.108.51.216.666a.833.833 0 0 0 .468.324c.204.048.48.078.828.09V92h-5.67v-.72c.336-.012.606-.048.81-.108a.968.968 0 0 0 .486-.324c.12-.156.198-.366.234-.63.048-.276.072-.624.072-1.044V81.74c0-.696-.012-1.266-.036-1.71-.024-.456-.054-.768-.09-.936-.06-.3-.198-.498-.414-.594-.204-.096-.582-.144-1.134-.144v-.612l4.176-.684v11.988zm11.672 1.278c-1.092 1.236-2.454 1.854-4.086 1.854a5.787 5.787 0 0 1-2.034-.342c-.6-.24-1.116-.57-1.548-.99a4.592 4.592 0 0 1-1.008-1.53c-.24-.588-.36-1.242-.36-1.962 0-.744.126-1.422.378-2.034a4.619 4.619 0 0 1 1.062-1.602 5.01 5.01 0 0 1 1.638-1.062 5.62 5.62 0 0 1 2.088-.378c1.272 0 2.262.342 2.97 1.026.708.684 1.062 1.644 1.062 2.88 0 .192-.03.312-.09.36-.06.036-.228.054-.504.054h-5.796c-.048.108-.072.306-.072.594 0 1.176.252 2.106.756 2.79.516.684 1.212 1.026 2.088 1.026.504 0 1.002-.114 1.494-.342.504-.228.99-.552 1.458-.972l.504.63zm-3.492-4.734c.48 0 .786-.024.918-.072.144-.06.216-.192.216-.396 0-.528-.15-.96-.45-1.296a1.455 1.455 0 0 0-1.134-.504c-.516 0-.978.216-1.386.648-.396.42-.654.96-.774 1.62h2.61z",fill:"#FFF1E1"}));case"RUBIK_WORK":return Object(_.createElement)(z.SVG,{width:"232",height:"132",viewBox:"0 0 232 132",xmlns:"http://www.w3.org/2000/svg"},Object(_.createElement)(z.Path,{fill:"#000",d:"M0 0h232v132H0z"}),Object(_.createElement)(z.Path,{d:"M14.936 62c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V29.696c0-.352.128-.656.384-.912s.56-.384.912-.384h14.208c4.608 0 8.208 1.04 10.8 3.12 2.592 2.048 3.888 4.896 3.888 8.544 0 2.08-.464 3.92-1.392 5.52-.928 1.568-2.192 2.864-3.792 3.888l5.904 10.944c.096.192.144.368.144.528 0 .288-.112.544-.336.768a.977.977 0 0 1-.72.288H33.8c-.576 0-1.04-.128-1.392-.384-.32-.288-.544-.592-.672-.912l-4.128-9.168H25.64v9.168c0 .352-.128.656-.384.912s-.56.384-.912.384h-9.408zm14.208-19.584c.704 0 1.248-.224 1.632-.672.384-.48.576-1.072.576-1.776s-.192-1.312-.576-1.824c-.352-.544-.896-.816-1.632-.816H25.64v5.088h3.504zM56.873 62.48c-1.696 0-3.248-.384-4.656-1.152-1.408-.8-2.544-2.016-3.408-3.648-.832-1.632-1.248-3.664-1.248-6.096V38.336c0-.352.128-.656.384-.912s.56-.384.912-.384h9.168c.352 0 .656.128.912.384s.384.56.384.912v12.912c0 .864.208 1.52.624 1.968.416.448 1.008.672 1.776.672s1.36-.224 1.776-.672c.416-.448.624-1.104.624-1.968V38.336c0-.352.128-.656.384-.912s.56-.384.912-.384h9.12c.352 0 .656.128.912.384s.384.56.384.912v22.368c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.4c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V59.12c-.768 1.12-1.84 1.968-3.216 2.544-1.376.544-2.96.816-4.752.816zm41.127 0c-3.04 0-5.408-.96-7.104-2.88v1.104c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.16c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V29.216c0-.352.128-.656.384-.912s.56-.384.912-.384h8.88c.352 0 .656.128.912.384s.384.56.384.912v9.6C93.28 37.312 95.408 36.56 98 36.56c2.912 0 5.296.944 7.152 2.832 1.888 1.856 2.896 4.592 3.024 8.208.032.48.048 1.104.048 1.872 0 .8-.016 1.44-.048 1.92-.16 3.808-1.152 6.608-2.976 8.4-1.824 1.792-4.224 2.688-7.2 2.688zm-3.984-8.592c.832 0 1.408-.224 1.728-.672.352-.448.576-1.152.672-2.112.064-.64.096-1.168.096-1.584 0-.416-.032-.944-.096-1.584-.096-.96-.32-1.664-.672-2.112-.32-.448-.896-.672-1.728-.672-.8 0-1.392.208-1.776.624-.352.384-.56.976-.624 1.776-.032.48-.048 1.072-.048 1.776s.016 1.296.048 1.776c.064.928.272 1.632.624 2.112.352.448.944.672 1.776.672zM113.415 34.4c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912v-5.808c0-.352.128-.656.384-.912s.56-.384.912-.384h8.112c.352 0 .656.128.912.384s.384.56.384.912v5.808c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.112zm-.24 27.6c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V38.336c0-.352.128-.656.384-.912s.56-.384.912-.384h8.592c.352 0 .656.128.912.384s.384.56.384.912v22.368c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.592zm15.515 0c-.352 0-.656-.128-.912-.384a1.246 1.246 0 0 1-.384-.912V29.216c0-.352.128-.656.384-.912s.56-.384.912-.384h8.4c.352 0 .656.128.912.384s.384.56.384.912v15.552l4.224-6.912c.32-.544.784-.816 1.392-.816h9.696c.32 0 .592.112.816.336.224.224.336.496.336.816 0 .224-.08.464-.24.72l-6.576 9.36 7.776 11.952c.128.192.192.4.192.624 0 .32-.112.592-.336.816a1.11 1.11 0 0 1-.816.336h-10.08c-.64 0-1.136-.272-1.488-.816l-4.896-8.16v7.68c0 .352-.128.656-.384.912s-.56.384-.912.384h-8.4zM25.4 105.48c-3.776 0-6.768-.88-8.976-2.64-2.208-1.76-3.312-4.16-3.312-7.2 0-1.952.56-3.664 1.68-5.136 1.12-1.472 2.72-2.8 4.8-3.984-1.216-1.312-2.096-2.528-2.64-3.648-.512-1.152-.768-2.32-.768-3.504 0-1.536.4-2.944 1.2-4.224.8-1.28 1.984-2.304 3.552-3.072 1.568-.768 3.456-1.152 5.664-1.152 2.048 0 3.824.384 5.328 1.152 1.536.736 2.688 1.744 3.456 3.024a7.494 7.494 0 0 1 1.2 4.128c0 1.856-.56 3.456-1.68 4.8-1.12 1.312-2.784 2.608-4.992 3.888l5.712 5.712c.512-.832.944-1.632 1.296-2.4.384-.8.768-1.84 1.152-3.12.128-.448.464-.672 1.008-.672h4.848c.256 0 .48.096.672.288.192.16.288.368.288.624-.032 1.12-.56 2.64-1.584 4.56-.992 1.92-2.096 3.616-3.312 5.088l5.376 5.424c.224.288.336.528.336.72a.774.774 0 0 1-.288.624.844.844 0 0 1-.624.24h-6.528c-.512 0-.928-.16-1.248-.48l-2.16-2.064c-2.464 2.016-5.616 3.024-9.456 3.024zm.432-21.984c1.28-.64 2.24-1.264 2.88-1.872.672-.608 1.008-1.328 1.008-2.16 0-.864-.304-1.552-.912-2.064-.576-.544-1.312-.816-2.208-.816a3.31 3.31 0 0 0-2.208.816c-.608.544-.912 1.248-.912 2.112 0 .576.176 1.184.528 1.824.384.608.992 1.328 1.824 2.16zM25.4 99.384c1.984 0 3.632-.592 4.944-1.776l-6.384-6.384c-2.112 1.12-3.168 2.48-3.168 4.08 0 1.216.464 2.208 1.392 2.976.928.736 2 1.104 3.216 1.104zM65.56 105h-3.168l-6.24-21.12h2.752l5.088 19.104 4.992-19.104h2.912l4.992 19.168 5.12-19.168H84.6L78.392 105h-3.168L71.48 91.304l-1.088-4.768h-.032l-1.088 4.768L65.56 105zm28.824-16.32c2.41 0 4.299.736 5.664 2.208 1.387 1.472 2.08 3.51 2.08 6.112 0 2.603-.693 4.64-2.08 6.112-1.365 1.472-3.253 2.208-5.664 2.208-2.41 0-4.31-.736-5.696-2.208-1.365-1.472-2.048-3.51-2.048-6.112 0-2.603.683-4.64 2.048-6.112 1.387-1.472 3.286-2.208 5.696-2.208zm0 2.208c-1.621 0-2.89.544-3.808 1.632C89.66 93.608 89.2 95.101 89.2 97c0 1.899.459 3.392 1.376 4.48.918 1.088 2.187 1.632 3.808 1.632 1.622 0 2.89-.544 3.808-1.632.918-1.088 1.376-2.581 1.376-4.48 0-1.899-.458-3.392-1.376-4.48-.917-1.088-2.186-1.632-3.808-1.632zm20.269-2.208c.768 0 1.355.107 1.76.32l-.512 2.496c-.512-.277-1.184-.416-2.016-.416-.683 0-1.355.203-2.016.608-.64.384-1.173.981-1.6 1.792-.405.79-.608 1.75-.608 2.88V105h-2.56V89h2.08l.352 2.624c.896-1.963 2.603-2.944 5.12-2.944zm11.463 8.416l-3.392 3.392V105h-2.56V81.64h2.56v15.648L131.012 89h3.2l-6.24 6.24 6.624 9.76h-3.104l-5.376-7.904zm29.655-13.536c3.776 0 6.496 1.493 8.16 4.48l-2.208 1.792c-.64-1.408-1.408-2.4-2.304-2.976-.874-.597-2.08-.896-3.616-.896-1.621 0-2.901.341-3.84 1.024-.917.661-1.376 1.515-1.376 2.56 0 .683.182 1.248.544 1.696.363.448.96.843 1.792 1.184.854.32 2.027.608 3.52.864 2.795.47 4.768 1.173 5.92 2.112 1.174.939 1.76 2.24 1.76 3.904 0 1.195-.341 2.251-1.024 3.168-.661.896-1.61 1.6-2.848 2.112-1.237.491-2.666.736-4.288.736-2.133 0-3.957-.416-5.472-1.248-1.493-.832-2.634-1.941-3.424-3.328l2.208-1.792c.576 1.259 1.419 2.24 2.528 2.944 1.131.683 2.539 1.024 4.224 1.024 1.664 0 2.987-.299 3.968-.896.982-.619 1.472-1.483 1.472-2.592 0-.939-.426-1.685-1.28-2.24-.853-.555-2.368-1.024-4.544-1.408-2.816-.49-4.81-1.195-5.984-2.112-1.173-.917-1.76-2.197-1.76-3.84 0-1.13.32-2.176.96-3.136.64-.96 1.558-1.717 2.752-2.272 1.195-.576 2.582-.864 4.16-.864zm26.044 19.584a5.25 5.25 0 0 0 1.28-.16l-.16 2.016a5.68 5.68 0 0 1-1.92.32c-.832 0-1.494-.181-1.984-.544-.47-.363-.768-.971-.896-1.824-.491.747-1.216 1.333-2.176 1.76a7.435 7.435 0 0 1-2.976.608c-1.579 0-2.88-.363-3.904-1.088-1.024-.747-1.536-1.813-1.536-3.2 0-1.216.533-2.261 1.6-3.136 1.066-.896 2.613-1.515 4.64-1.856l4.256-.704v-.896c0-1.067-.331-1.92-.992-2.56-.662-.64-1.579-.96-2.752-.96-1.067 0-1.995.256-2.784.768-.768.512-1.366 1.27-1.792 2.272l-1.888-1.376c.426-1.195 1.216-2.144 2.368-2.848 1.173-.704 2.538-1.056 4.096-1.056 1.898 0 3.424.459 4.576 1.376 1.152.917 1.728 2.272 1.728 4.064v7.872c0 .384.096.672.288.864.192.192.501.288.928.288zm-8.704-.064c1.344 0 2.496-.32 3.456-.96.981-.64 1.472-1.472 1.472-2.496v-2.208l-3.584.672c-1.43.256-2.496.63-3.2 1.12-.704.47-1.056 1.077-1.056 1.824 0 .661.256 1.173.768 1.536.512.341 1.226.512 2.144.512zm21.485-14.4c1.813 0 3.306.523 4.48 1.568 1.173 1.045 1.76 2.55 1.76 4.512V105h-2.56v-9.344c0-1.664-.363-2.87-1.088-3.616-.704-.747-1.654-1.12-2.848-1.12-.854 0-1.654.192-2.4.576-.747.363-1.366.97-1.856 1.824-.47.832-.704 1.888-.704 3.168V105h-2.56V89h2.24l.16 2.496c.533-.96 1.269-1.664 2.208-2.112.938-.47 1.994-.704 3.168-.704zm17.476 16.64c-1.536 0-2.922-.299-4.16-.896-1.237-.619-2.144-1.525-2.72-2.72l2.08-1.44a3.898 3.898 0 0 0 1.888 2.112c.896.469 1.952.704 3.168.704 1.259 0 2.219-.224 2.88-.672.662-.448.992-1.013.992-1.696 0-.619-.309-1.11-.928-1.472-.618-.384-1.706-.715-3.264-.992-1.536-.277-2.752-.608-3.648-.992-.896-.405-1.546-.907-1.952-1.504-.405-.619-.608-1.376-.608-2.272 0-.875.256-1.675.768-2.4.512-.725 1.248-1.301 2.208-1.728.96-.448 2.07-.672 3.328-.672 1.707 0 3.072.32 4.096.96 1.046.619 1.792 1.579 2.24 2.88l-2.176 1.28c-.341-1.024-.864-1.76-1.568-2.208-.682-.448-1.546-.672-2.592-.672-1.045 0-1.93.235-2.656.704-.725.47-1.088 1.013-1.088 1.632 0 .704.31 1.248.928 1.632.64.384 1.771.715 3.392.992 2.219.363 3.787.907 4.704 1.632.918.725 1.376 1.75 1.376 3.072a3.95 3.95 0 0 1-.832 2.464c-.533.704-1.312 1.259-2.336 1.664-1.002.405-2.176.608-3.52.608z",fill:"#fff"}));case"PLAY_ROBOTO":return Object(_.createElement)(z.SVG,{width:"232",height:"132",viewBox:"0 0 232 132",xmlns:"http://www.w3.org/2000/svg"},Object(_.createElement)(z.Path,{fill:"#B9B5B8",d:"M0 0h232v132H0z"}),Object(_.createElement)(z.Path,{d:"M149.438 101c-.75-2.125-1.23-5.27-1.438-9.438-2.625 3.417-5.979 6.063-10.062 7.938-4.042 1.833-8.334 2.75-12.876 2.75-6.5 0-11.77-1.812-15.812-5.438-4-3.624-6-8.208-6-13.75 0-6.583 2.729-11.791 8.188-15.624 5.5-3.834 13.145-5.75 22.937-5.75h13.563V54c0-4.833-1.5-8.625-4.5-11.375-2.959-2.792-7.292-4.188-13-4.188-5.209 0-9.521 1.334-12.938 4-3.417 2.667-5.125 5.876-5.125 9.626l-7.5-.063c0-5.375 2.5-10.02 7.5-13.938 5-3.958 11.146-5.937 18.437-5.937 7.542 0 13.48 1.896 17.813 5.688 4.375 3.75 6.625 9 6.75 15.75v32c0 6.541.687 11.437 2.063 14.687v.75h-8zm-23.5-5.375c5 0 9.458-1.208 13.374-3.625 3.959-2.417 6.834-5.646 8.626-9.688V67.439h-13.376c-7.458.083-13.291 1.458-17.5 4.124-4.208 2.626-6.312 6.25-6.312 10.876 0 3.791 1.396 6.937 4.188 9.437 2.833 2.5 6.5 3.75 11 3.75zM39.328 101.896c-5.461 0-9.6-1.451-12.416-4.352-2.73-2.987-4.096-6.699-4.096-11.136 0-3.84.981-6.997 2.944-9.472 2.048-2.56 4.437-4.523 7.168-5.888 2.73-1.365 6.272-2.773 10.624-4.224 4.608-1.536 7.979-2.944 10.112-4.224 2.133-1.28 3.2-3.072 3.2-5.376V45.832c0-2.73-.683-5.163-2.048-7.296s-3.712-3.2-7.04-3.2c-2.645 0-5.035.725-7.168 2.176 2.901 1.024 5.035 2.56 6.4 4.608 1.45 1.963 2.176 4.181 2.176 6.656 0 3.328-1.195 6.016-3.584 8.064-2.304 1.963-5.12 2.944-8.448 2.944-3.328 0-5.973-1.024-7.936-3.072-1.877-2.133-2.816-4.821-2.816-8.064 0-2.56.64-4.779 1.92-6.656 1.28-1.877 3.285-3.584 6.016-5.12 4.779-2.73 11.605-4.096 20.48-4.096 4.693 0 8.747.47 12.16 1.408 3.413.853 6.315 2.517 8.704 4.992 1.707 1.792 2.816 4.053 3.328 6.784.597 2.645.896 6.357.896 11.136V91.4c0 2.133.128 3.584.384 4.352.341.768.896 1.152 1.664 1.152.597 0 1.237-.17 1.92-.512a15.863 15.863 0 0 0 1.92-1.408l1.28 2.176c-3.67 3.157-8.917 4.736-15.744 4.736-5.12 0-8.704-.853-10.752-2.56-2.048-1.792-3.157-4.181-3.328-7.168-4.01 6.485-9.984 9.728-17.92 9.728zm12.8-10.24c1.792 0 3.37-.725 4.736-2.176V62.472c-.768 1.28-2.176 2.944-4.224 4.992-2.304 2.219-4.053 4.395-5.248 6.528-1.195 2.048-1.792 4.864-1.792 8.448 0 6.144 2.176 9.216 6.528 9.216z",fill:"#270920"}));default:return Object(_.createElement)("div",{className:"font-pairings-panel__preview"},Object(_.createElement)("h1",{style:{fontFamily:t}},"Lorem Ipsum"),Object(_.createElement)("p",{style:{fontFamily:c}},"Etiam tempor orci eu lobortis elementum nibh tellus molestie."))}},B=function(e){var t=e.fontPairings,c=e.fontBase,n=e.fontHeadings,a=e.update;return Object(_.createElement)(_.Fragment,null,Object(_.createElement)("h3",null,Object(y.__)("Font Pairings")),t&&n&&c?Object(_.createElement)("div",{role:"listbox"},t.map((function(e){var t=e.label,r=e.headings,l=e.base,o=e.preview,s=r===n&&l===c,i=V()("font-pairings-panel",{"is-selected":s});return Object(_.createElement)("div",{key:t,tabIndex:0,role:"option","aria-selected":s,className:i,onClick:function(){return a({headings:r,base:l})},onKeyDown:function(e){return e.keyCode===P.ENTER?a({headings:r,base:l}):null}},Object(_.createElement)("div",{className:"font-pairings-panel__preview"},H(o,r,l)),Object(_.createElement)("p",{className:"font-pairings-panel__label"},t))}))):Object(_.createElement)(S,{unsupportedFeature:Object(y.__)("font pairings")}))},M=function(e){var t=e.fontBase,c=e.fontBaseDefault,n=e.fontHeadings,a=e.fontHeadingsDefault,r=e.fontBaseOptions,l=e.fontHeadingsOptions,o=e.updateBaseFont,s=e.updateHeadingsFont;return r&&l?Object(_.createElement)(_.Fragment,null,Object(_.createElement)(z.SelectControl,{label:Object(y.__)("Heading Font"),value:n,options:l,onChange:function(e){return s(e)},style:{fontFamily:"unset"!==n?n:a}}),Object(_.createElement)(z.SelectControl,{label:Object(y.__)("Base Font"),value:t,options:r,onChange:function(e){return o(e)},style:{fontFamily:"unset"!==t?t:c}}),Object(_.createElement)("hr",null)):Object(_.createElement)(S,{unsupportedFeature:Object(y.__)("custom font selection")})},x=function(){return Object(_.createElement)(z.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(_.createElement)(z.Path,{d:"M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-4.05 16.5l-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13h-2.09z"}))},T=function(e){if("object"==typeof e){var t=e.label,c=e.value,n=e.prop;return{label:t,value:c,prop:void 0===n?"ANY_PROPERTY":n}}return{label:e,value:e,prop:"ANY_PROPERTY"}},N=function(e){return null!==e.value&&null!==e.label},L=function(e,t){return e?e.map(T).filter(N).filter(function(e){return function(t){return"ANY_PROPERTY"===t.prop||t.prop===e}}(t)):[]},C=function(e){var t=e.hasLocalChanges,c=e.resetAction,n=e.publishAction,a=e.className,r=void 0===a?null:a;return Object(_.createElement)("div",{className:r},Object(_.createElement)(z.Button,{disabled:!t,isDefault:!0,onClick:c},Object(y.__)("Reset")),Object(_.createElement)(z.Button,{className:"global-styles-sidebar__publish-button",disabled:!t,isPrimary:!0,onClick:n},Object(y.__)("Publish")))},F=(c(13),JETPACK_GLOBAL_STYLES_EDITOR_CONSTANTS),A=F.PLUGIN_NAME,I=F.STORE_NAME,R=F.REST_PATH;n=I,a=R,Object(s.registerStore)(n,{reducer:function(e,t){switch(t.type){case"UPDATE_OPTIONS":case"RESET_OPTIONS":case"PUBLISH_OPTIONS":return h()({},e,{},t.options)}return e},actions:O,selectors:{getOption:function(e,t){return e?e[t]:void 0},hasLocalChanges:function(e){return!!e&&Object.keys(v).some((function(t){return v[t]!==e[t]}))}},resolvers:{getOption:regeneratorRuntime.mark((function e(t){var c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,b=!0,e.next=6,O.fetchOptions();case 6:c=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),c={};case 12:return v=c,e.abrupt("return",{type:"UPDATE_OPTIONS",options:c});case 14:case"end":return e.stop()}}),e,null,[[2,9]])}))},controls:{IO_FETCH_OPTIONS:function(){return p()({path:a})},IO_PUBLISH_OPTIONS:function(e){var t=e.options;return v=t,p()({path:a,method:"POST",data:h()({},t)})}}}),r=["font_base","font_headings"],l=Object(s.select)(I).getOption,d()((function(){var e={},t={};r.forEach((function(c){e[c]=null,t[c]="--".concat(c.replace("_","-"))})),Object(s.subscribe)((function(){Object.keys(e).forEach((function(c){var n=l(c);if(e[c]!==n){e[c]=n;var a=document.getElementsByClassName("editor-styles-wrapper")[0];a&&a.style.setProperty(t[c],n)}}))}))})),Object(o.registerPlugin)(A,{render:Object(i.compose)(Object(s.withSelect)((function(e){return{siteName:e(I).getOption("blogname"),fontHeadings:e(I).getOption("font_headings"),fontHeadingsDefault:e(I).getOption("font_headings_default"),fontBase:e(I).getOption("font_base"),fontBaseDefault:e(I).getOption("font_base_default"),fontPairings:e(I).getOption("font_pairings"),fontOptions:e(I).getOption("font_options"),hasLocalChanges:e(I).hasLocalChanges()}})),Object(s.withDispatch)((function(e){return{updateOptions:e(I).updateOptions,publishOptions:e(I).publishOptions,resetLocalChanges:e(I).resetLocalChanges}})))((function(e){var t=e.fontHeadings,c=e.fontHeadingsDefault,n=e.fontBase,a=e.fontBaseDefault,r=e.fontPairings,l=e.fontOptions,o=e.siteName,s=e.publishOptions,i=e.updateOptions,u=e.hasLocalChanges,h=e.resetLocalChanges,f=function(){var e;return s((e={},j()(e,"font_base",n),j()(e,"font_headings",t),e))};return Object(_.createElement)(_.Fragment,null,Object(_.createElement)(E.PluginSidebarMoreMenuItem,{icon:Object(_.createElement)(x,null),target:"global-styles"},Object(y.__)("Global Styles")),Object(_.createElement)(E.PluginSidebar,{icon:Object(_.createElement)(x,null),name:"global-styles",title:Object(y.__)("Global Styles"),className:"global-styles-sidebar"},Object(_.createElement)(z.PanelBody,null,Object(_.createElement)("p",null,Object(y.sprintf)(Object(y.__)("You are customizing %s."),o)),Object(_.createElement)("p",null,Object(y.__)("Any change you make here will apply to the entire website.")),u?Object(_.createElement)("div",null,Object(_.createElement)("p",null,Object(_.createElement)("em",null,Object(y.__)("You have unsaved changes."))),Object(_.createElement)(C,{hasLocalChanges:u,publishAction:f,resetAction:h})):null),Object(_.createElement)(z.PanelBody,{title:Object(y.__)("Font Selection")},Object(_.createElement)(M,{fontBase:n,fontBaseDefault:a,fontHeadings:t,fontHeadingsDefault:c,fontBaseOptions:L(l,"font_base"),fontHeadingsOptions:L(l,"font_headings"),updateBaseFont:function(e){return i(j()({},"font_base",e))},updateHeadingsFont:function(e){return i(j()({},"font_headings",e))}}),Object(_.createElement)(B,{fontHeadings:t,fontBase:n,fontPairings:r,update:function(e){var t,c=e.headings,n=e.base;return i((t={},j()(t,"font_headings",c),j()(t,"font_base",n),t))}})),Object(_.createElement)(z.PanelBody,null,u?Object(_.createElement)("p",null,Object(_.createElement)("em",null,Object(y.__)("You have unsaved changes."))):null,Object(_.createElement)(C,{hasLocalChanges:u,publishAction:f,resetAction:h,className:"global-styles-sidebar__panel-action-buttons"}))))}))})}]));
global-styles/dist/global-styles.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
- */
 
 
 
 
 
global-styles/dist/global-styles.rtl.css CHANGED
@@ -1 +1 @@
1
- .global-styles-sidebar .components-select-control__input{line-height:1;font-size:18px;height:36px}.global-styles-sidebar h3{margin:0 0 1em}.global-styles-sidebar__panel-action-buttons{display:flex;justify-content:flex-end;margin-bottom:96px}.global-styles-sidebar__publish-button{margin-right:1em}.font-pairings-panel{cursor:pointer;border-radius:4px;padding:4px;margin-bottom:.5em}.font-pairings-panel.is-selected{box-shadow:0 0 0 2px #555d66}.font-pairings-panel:focus{box-shadow:0 0 0 2px #00a0d2}.font-pairings-panel:hover{background-color:#f3f4f5;color:#191e23}.font-pairings-panel__preview{border:1px solid rgba(25,30,35,.2);border-radius:4px;background-color:#fff;padding:4px}.font-pairings-panel__preview h1,.font-pairings-panel__preview p{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:10px 0}.font-pairings-panel__preview svg{display:block;width:100%;height:auto}.font-pairings-panel__label{text-align:center;margin-bottom:0}
1
+ .global-styles-sidebar .components-select-control__input{line-height:1;font-size:18px;height:36px}.global-styles-sidebar h3{margin:0 0 1em}.global-styles-sidebar__panel-action-buttons{display:flex;justify-content:flex-end;margin-bottom:96px}.global-styles-sidebar__publish-button{margin-right:1em}.font-pairings-panel{cursor:pointer;border-radius:4px;padding:4px;margin-bottom:.5em}.font-pairings-panel.is-selected{box-shadow:0 0 0 2px #555d66}.font-pairings-panel:focus{box-shadow:0 0 0 2px #00a0d2}.font-pairings-panel:hover{background-color:#f3f4f5;color:#191e23}.font-pairings-panel__preview{border:1px solid rgba(25,30,35,.2);border-radius:4px;background-color:#fff;padding:4px}.font-pairings-panel__preview h1,.font-pairings-panel__preview p{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:10px 0}.font-pairings-panel__preview svg{display:block;width:100%;height:auto}.font-pairings-panel__label{text-align:center;margin-bottom:0}
jetpack-timeline/blocks/src/block-appender.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable wpcalypso/jsx-classname-namespace */
2
+ // disabled CSS class rule due to existing code already
3
+ // that users the non-conformant classnames
4
+
5
+ /**
6
+ * External dependencies
7
+ */
8
+
9
+ import { __ } from '@wordpress/i18n';
10
+
11
+ /**
12
+ * WordPress dependencies
13
+ */
14
+
15
+ export const BlockAppender = props => {
16
+ const { onClick } = props;
17
+ return (
18
+ <button
19
+ className="block-editor-inserter__toggle timeline-item-appender"
20
+ type="button"
21
+ style={ { zIndex: 99999 } }
22
+ onClick={ onClick }
23
+ >
24
+ <svg
25
+ aria-hidden="true"
26
+ role="img"
27
+ focusable="false"
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ width="20"
30
+ height="20"
31
+ viewBox="0 0 20 20"
32
+ >
33
+ <path d="M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z"></path>
34
+ </svg>{ ' ' }
35
+ { __( 'Add New Entry', 'full-site-editing' ) }
36
+ </button>
37
+ );
38
+ };
jetpack-timeline/blocks/src/icon.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Path, SVG } from '@wordpress/components';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ export const TimelineIcon = () => (
9
+ <SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
10
+ <Path d="M21 6c-1.1 0-2 .9-2 2 0 .2 0 .3.1.5l-3.5 3.6c-.2-.1-.4-.1-.6-.1s-.4 0-.5.1L12 9.6V9c0-1.1-.9-2-2-2s-2 .9-2 2c0 .2 0 .4.1.5L3.5 14H3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2c0-.2 0-.3-.1-.5l4.5-4.6c.2.1.4.1.6.1s.4 0 .5-.1l2.5 2.5c0 .2-.1.3-.1.5 0 1.1.9 2 2 2s2-.9 2-2c0-.2 0-.4-.1-.5l3.6-3.5c.2 0 .3.1.5.1 1.1 0 2-.9 2-2s-.8-2-1.9-2z" />
11
+ </SVG>
12
+ );
jetpack-timeline/blocks/src/index.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { registerTimelineBlock } from './timeline';
5
+ import { registerTimelineItemBlock } from './timeline-item';
6
+
7
+ registerTimelineBlock();
8
+ registerTimelineItemBlock();
jetpack-timeline/blocks/src/timeline-item.js ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+
5
+ import { InspectorControls, InnerBlocks, PanelColorSettings } from '@wordpress/block-editor';
6
+ import { registerBlockType } from '@wordpress/blocks';
7
+ import { __ } from '@wordpress/i18n';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { TimelineIcon } from './icon';
13
+
14
+ export function registerTimelineItemBlock() {
15
+ registerBlockType( 'jetpack/timeline-item', {
16
+ title: __( 'Timeline Entry', 'full-site-editing' ),
17
+ description: __( 'An entry on the timeline', 'full-site-editing' ),
18
+ icon: TimelineIcon,
19
+ category: 'widgets',
20
+ parent: [ 'jetpack/timeline' ],
21
+ edit: ( { attributes, setAttributes } ) => {
22
+ const style = {
23
+ backgroundColor: attributes.background,
24
+ };
25
+
26
+ const bubbleStyle = {
27
+ borderColor: attributes.background,
28
+ };
29
+
30
+ return (
31
+ <li style={ style }>
32
+ <InspectorControls>
33
+ <PanelColorSettings
34
+ title={ __( 'Color Settings', 'full-site-editing' ) }
35
+ colorSettings={ [
36
+ {
37
+ value: attributes.background,
38
+ onChange: background => setAttributes( { background } ),
39
+ label: __( 'Background Color', 'full-site-editing' ),
40
+ },
41
+ ] }
42
+ />
43
+ </InspectorControls>
44
+ <div className="timeline-item">
45
+ <div className="timeline-item__bubble" style={ bubbleStyle } />
46
+ <div className="timeline-item__dot" style={ style } />
47
+ <InnerBlocks template={ [ [ 'core/heading' ] ] } />
48
+ </div>
49
+ </li>
50
+ );
51
+ },
52
+ save: ( { attributes } ) => {
53
+ const style = {
54
+ backgroundColor: attributes.background,
55
+ };
56
+
57
+ const bubbleStyle = {
58
+ borderColor: attributes.background,
59
+ };
60
+
61
+ return (
62
+ <li style={ style }>
63
+ <div className="timeline-item">
64
+ <div className="timeline-item__bubble" style={ bubbleStyle } />
65
+ <div className="timeline-item__dot" style={ style } />
66
+ <InnerBlocks.Content />
67
+ </div>
68
+ </li>
69
+ );
70
+ },
71
+ attributes: {
72
+ background: {
73
+ type: 'string',
74
+ default: '#eeeeee',
75
+ },
76
+ },
77
+ } );
78
+ }
jetpack-timeline/blocks/src/timeline.js ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable wpcalypso/jsx-classname-namespace */
2
+ // disabled CSS class rule due to existing code already
3
+ // that users the non-conformant classnames
4
+
5
+ /**
6
+ * External dependencies
7
+ */
8
+
9
+ import { InnerBlocks } from '@wordpress/block-editor';
10
+ import { registerBlockType, createBlock } from '@wordpress/blocks';
11
+ import { dispatch } from '@wordpress/data';
12
+ import { __ } from '@wordpress/i18n';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import { TimelineIcon } from './icon';
18
+ import { BlockAppender } from './block-appender';
19
+
20
+ export function registerTimelineBlock() {
21
+ registerBlockType( 'jetpack/timeline', {
22
+ title: __( 'Timeline', 'full-site-editing' ),
23
+ description: __( 'Create a timeline of events.', 'full-site-editing' ),
24
+ icon: TimelineIcon,
25
+ category: 'widgets',
26
+ example: {
27
+ innerBlocks: [
28
+ {
29
+ name: 'jetpack/timeline-item',
30
+ innerBlocks: [
31
+ {
32
+ name: 'core/heading',
33
+ attributes: {
34
+ content: __( 'Spring', 'full-site-editing' ),
35
+ },
36
+ },
37
+ ],
38
+ },
39
+ {
40
+ name: 'jetpack/timeline-item',
41
+ innerBlocks: [
42
+ {
43
+ name: 'core/heading',
44
+ attributes: {
45
+ content: __( 'Summer', 'full-site-editing' ),
46
+ },
47
+ },
48
+ ],
49
+ },
50
+ {
51
+ name: 'jetpack/timeline-item',
52
+ innerBlocks: [
53
+ {
54
+ name: 'core/heading',
55
+ attributes: {
56
+ content: __( 'Fall', 'full-site-editing' ),
57
+ },
58
+ },
59
+ ],
60
+ },
61
+ {
62
+ name: 'jetpack/timeline-item',
63
+ innerBlocks: [
64
+ {
65
+ name: 'core/heading',
66
+ attributes: {
67
+ content: __( 'Winter', 'full-site-editing' ),
68
+ },
69
+ },
70
+ ],
71
+ },
72
+ ],
73
+ },
74
+ edit: props => {
75
+ const { clientId } = props;
76
+
77
+ const addItem = () => {
78
+ const block = createBlock( 'jetpack/timeline-item' );
79
+ dispatch( 'core/block-editor' ).insertBlock( block, undefined, clientId );
80
+ };
81
+
82
+ return (
83
+ <>
84
+ <ul className="wp-block-jetpack-timeline">
85
+ <InnerBlocks
86
+ allowedBlocks={ [ 'jetpack/timeline-item' ] }
87
+ template={ [ [ 'jetpack/timeline-item' ] ] }
88
+ renderAppender={ () => <BlockAppender onClick={ addItem } /> }
89
+ />
90
+ </ul>
91
+ </>
92
+ );
93
+ },
94
+
95
+ save: () => {
96
+ return (
97
+ <ul className="wp-block-jetpack-timeline">
98
+ <InnerBlocks.Content />
99
+ </ul>
100
+ );
101
+ },
102
+ } );
103
+ }
jetpack-timeline/dist/jetpack-timeline.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'd05584059885e369deac825f068cecc7');
jetpack-timeline/dist/jetpack-timeline.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(i){if(t[i])return t[i].exports;var c=t[i]={i:i,l:!1,exports:{}};return e[i].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(i,c,function(t){return e[t]}.bind(null,c));return i},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=6)}([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.blockEditor}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t,n){"use strict";n.r(t);var i=n(0),c=n(2),r=n(3),l=n(5),o=n(1),a=n(4),s=function(){return Object(i.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(i.createElement)(a.Path,{d:"M21 6c-1.1 0-2 .9-2 2 0 .2 0 .3.1.5l-3.5 3.6c-.2-.1-.4-.1-.6-.1s-.4 0-.5.1L12 9.6V9c0-1.1-.9-2-2-2s-2 .9-2 2c0 .2 0 .4.1.5L3.5 14H3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2c0-.2 0-.3-.1-.5l4.5-4.6c.2.1.4.1.6.1s.4 0 .5-.1l2.5 2.5c0 .2-.1.3-.1.5 0 1.1.9 2 2 2s2-.9 2-2c0-.2 0-.4-.1-.5l3.6-3.5c.2 0 .3.1.5.1 1.1 0 2-.9 2-2s-.8-2-1.9-2z"}))},u=function(e){var t=e.onClick;return Object(i.createElement)("button",{className:"block-editor-inserter__toggle timeline-item-appender",type:"button",style:{zIndex:99999},onClick:t},Object(i.createElement)("svg",{"aria-hidden":"true",role:"img",focusable:"false",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20"},Object(i.createElement)("path",{d:"M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z"}))," ",Object(o.__)("Add New Entry","full-site-editing"))};Object(r.registerBlockType)("jetpack/timeline",{title:Object(o.__)("Timeline","full-site-editing"),description:Object(o.__)("Create a timeline of events.","full-site-editing"),icon:s,category:"widgets",example:{innerBlocks:[{name:"jetpack/timeline-item",innerBlocks:[{name:"core/heading",attributes:{content:Object(o.__)("Spring","full-site-editing")}}]},{name:"jetpack/timeline-item",innerBlocks:[{name:"core/heading",attributes:{content:Object(o.__)("Summer","full-site-editing")}}]},{name:"jetpack/timeline-item",innerBlocks:[{name:"core/heading",attributes:{content:Object(o.__)("Fall","full-site-editing")}}]},{name:"jetpack/timeline-item",innerBlocks:[{name:"core/heading",attributes:{content:Object(o.__)("Winter","full-site-editing")}}]}]},edit:function(e){var t=e.clientId,n=function(){var e=Object(r.createBlock)("jetpack/timeline-item");Object(l.dispatch)("core/block-editor").insertBlock(e,void 0,t)};return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("ul",{className:"wp-block-jetpack-timeline"},Object(i.createElement)(c.InnerBlocks,{allowedBlocks:["jetpack/timeline-item"],template:[["jetpack/timeline-item"]],renderAppender:function(){return Object(i.createElement)(u,{onClick:n})}})))},save:function(){return Object(i.createElement)("ul",{className:"wp-block-jetpack-timeline"},Object(i.createElement)(c.InnerBlocks.Content,null))}}),Object(r.registerBlockType)("jetpack/timeline-item",{title:Object(o.__)("Timeline Entry","full-site-editing"),description:Object(o.__)("An entry on the timeline","full-site-editing"),icon:s,category:"widgets",parent:["jetpack/timeline"],edit:function(e){var t=e.attributes,n=e.setAttributes,r={backgroundColor:t.background},l={borderColor:t.background};return Object(i.createElement)("li",{style:r},Object(i.createElement)(c.InspectorControls,null,Object(i.createElement)(c.PanelColorSettings,{title:Object(o.__)("Color Settings","full-site-editing"),colorSettings:[{value:t.background,onChange:function(e){return n({background:e})},label:Object(o.__)("Background Color","full-site-editing")}]})),Object(i.createElement)("div",{className:"timeline-item"},Object(i.createElement)("div",{className:"timeline-item__bubble",style:l}),Object(i.createElement)("div",{className:"timeline-item__dot",style:r}),Object(i.createElement)(c.InnerBlocks,{template:[["core/heading"]]})))},save:function(e){var t=e.attributes,n={backgroundColor:t.background},r={borderColor:t.background};return Object(i.createElement)("li",{style:n},Object(i.createElement)("div",{className:"timeline-item"},Object(i.createElement)("div",{className:"timeline-item__bubble",style:r}),Object(i.createElement)("div",{className:"timeline-item__dot",style:n}),Object(i.createElement)(c.InnerBlocks.Content,null)))},attributes:{background:{type:"string",default:"#eeeeee"}}})}]));
jetpack-timeline/index.asset.php DELETED
@@ -1 +0,0 @@
1
- <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '7fdbff971ff150fc46dd5f60ea26743d');
 
jetpack-timeline/index.js CHANGED
@@ -1,252 +1,4 @@
1
- ! ( function( e ) {
2
- var t = {};
3
- function n( c ) {
4
- if ( t[ c ] ) return t[ c ].exports;
5
- var r = ( t[ c ] = { i: c, l: ! 1, exports: {} } );
6
- return e[ c ].call( r.exports, r, r.exports, n ), ( r.l = ! 0 ), r.exports;
7
- }
8
- ( n.m = e ),
9
- ( n.c = t ),
10
- ( n.d = function( e, t, c ) {
11
- n.o( e, t ) || Object.defineProperty( e, t, { enumerable: ! 0, get: c } );
12
- } ),
13
- ( n.r = function( e ) {
14
- 'undefined' != typeof Symbol &&
15
- Symbol.toStringTag &&
16
- Object.defineProperty( e, Symbol.toStringTag, { value: 'Module' } ),
17
- Object.defineProperty( e, '__esModule', { value: ! 0 } );
18
- } ),
19
- ( n.t = function( e, t ) {
20
- if ( ( 1 & t && ( e = n( e ) ), 8 & t ) ) return e;
21
- if ( 4 & t && 'object' == typeof e && e && e.__esModule ) return e;
22
- var c = Object.create( null );
23
- if (
24
- ( n.r( c ),
25
- Object.defineProperty( c, 'default', { enumerable: ! 0, value: e } ),
26
- 2 & t && 'string' != typeof e )
27
- )
28
- for ( var r in e )
29
- n.d(
30
- c,
31
- r,
32
- function( t ) {
33
- return e[ t ];
34
- }.bind( null, r )
35
- );
36
- return c;
37
- } ),
38
- ( n.n = function( e ) {
39
- var t =
40
- e && e.__esModule
41
- ? function() {
42
- return e.default;
43
- }
44
- : function() {
45
- return e;
46
- };
47
- return n.d( t, 'a', t ), t;
48
- } ),
49
- ( n.o = function( e, t ) {
50
- return Object.prototype.hasOwnProperty.call( e, t );
51
- } ),
52
- ( n.p = '' ),
53
- n( ( n.s = 5 ) );
54
- } )( [
55
- function( e, t ) {
56
- ! ( function() {
57
- e.exports = this.wp.element;
58
- } )();
59
- },
60
- function( e, t ) {
61
- ! ( function() {
62
- e.exports = this.wp.i18n;
63
- } )();
64
- },
65
- function( e, t ) {
66
- ! ( function() {
67
- e.exports = this.wp.blockEditor;
68
- } )();
69
- },
70
- function( e, t ) {
71
- ! ( function() {
72
- e.exports = this.wp.blocks;
73
- } )();
74
- },
75
- function( e, t ) {
76
- ! ( function() {
77
- e.exports = this.wp.data;
78
- } )();
79
- },
80
- function( e, t, n ) {
81
- 'use strict';
82
- n.r( t );
83
- var c = n( 0 ),
84
- r = n( 2 ),
85
- i = n( 3 ),
86
- l = n( 4 ),
87
- o = n( 1 ),
88
- a = wp.components,
89
- s = a.Path,
90
- m = a.SVG,
91
- u = function() {
92
- return Object( c.createElement )(
93
- m,
94
- { xmlns: 'http://www.w3.org/2000/svg', width: '24', height: '24', viewBox: '0 0 24 24' },
95
- Object( c.createElement )( s, {
96
- d:
97
- 'M21 6c-1.1 0-2 .9-2 2 0 .2 0 .3.1.5l-3.5 3.6c-.2-.1-.4-.1-.6-.1s-.4 0-.5.1L12 9.6V9c0-1.1-.9-2-2-2s-2 .9-2 2c0 .2 0 .4.1.5L3.5 14H3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2c0-.2 0-.3-.1-.5l4.5-4.6c.2.1.4.1.6.1s.4 0 .5-.1l2.5 2.5c0 .2-.1.3-.1.5 0 1.1.9 2 2 2s2-.9 2-2c0-.2 0-.4-.1-.5l3.6-3.5c.2 0 .3.1.5.1 1.1 0 2-.9 2-2s-.8-2-1.9-2z',
98
- } )
99
- );
100
- },
101
- b = function( e ) {
102
- var t = e.onClick;
103
- return Object( c.createElement )(
104
- 'button',
105
- {
106
- className: 'block-editor-inserter__toggle timeline-item-appender',
107
- type: 'button',
108
- style: { zIndex: 99999 },
109
- onClick: t,
110
- },
111
- Object( c.createElement )(
112
- 'svg',
113
- {
114
- 'aria-hidden': 'true',
115
- role: 'img',
116
- focusable: 'false',
117
- xmlns: 'http://www.w3.org/2000/svg',
118
- width: '20',
119
- height: '20',
120
- viewBox: '0 0 20 20',
121
- },
122
- Object( c.createElement )( 'path', {
123
- d:
124
- 'M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z',
125
- } )
126
- ),
127
- ' ',
128
- Object( o.__ )( 'Add New Entry' )
129
- );
130
- };
131
- Object( i.registerBlockType )( 'jetpack/timeline', {
132
- title: 'Timeline',
133
- description: 'Create a timeline of events.',
134
- icon: u,
135
- category: 'widgets',
136
- example: {
137
- innerBlocks: [
138
- {
139
- name: 'jetpack/timeline-item',
140
- innerBlocks: [
141
- { name: 'core/heading', attributes: { content: Object( o.__ )( 'Spring' ) } },
142
- ],
143
- },
144
- {
145
- name: 'jetpack/timeline-item',
146
- innerBlocks: [
147
- { name: 'core/heading', attributes: { content: Object( o.__ )( 'Summer' ) } },
148
- ],
149
- },
150
- {
151
- name: 'jetpack/timeline-item',
152
- innerBlocks: [
153
- { name: 'core/heading', attributes: { content: Object( o.__ )( 'Fall' ) } },
154
- ],
155
- },
156
- {
157
- name: 'jetpack/timeline-item',
158
- innerBlocks: [
159
- { name: 'core/heading', attributes: { content: Object( o.__ )( 'Winter' ) } },
160
- ],
161
- },
162
- ],
163
- },
164
- edit: function( e ) {
165
- var t = e.clientId,
166
- n = function() {
167
- var e = Object( i.createBlock )( 'jetpack/timeline-item' );
168
- Object( l.dispatch )( 'core/block-editor' ).insertBlock( e, void 0, t );
169
- };
170
- return Object( c.createElement )(
171
- c.Fragment,
172
- null,
173
- Object( c.createElement )(
174
- 'ul',
175
- { className: 'wp-block-jetpack-timeline' },
176
- Object( c.createElement )( r.InnerBlocks, {
177
- allowedBlocks: [ 'jetpack/timeline-item' ],
178
- template: [ [ 'jetpack/timeline-item' ] ],
179
- renderAppender: function() {
180
- return Object( c.createElement )( b, { onClick: n } );
181
- },
182
- } )
183
- )
184
- );
185
- },
186
- save: function() {
187
- return Object( c.createElement )(
188
- 'ul',
189
- { className: 'wp-block-jetpack-timeline' },
190
- Object( c.createElement )( r.InnerBlocks.Content, null )
191
- );
192
- },
193
- } ),
194
- Object( i.registerBlockType )( 'jetpack/timeline-item', {
195
- title: 'Timeline Entry',
196
- description: 'An entry on the timeline',
197
- icon: u,
198
- category: 'widgets',
199
- parent: [ 'jetpack/timeline' ],
200
- edit: function( e ) {
201
- var t = e.attributes,
202
- n = e.setAttributes,
203
- i = { backgroundColor: t.background },
204
- l = { borderColor: t.background };
205
- return Object( c.createElement )(
206
- 'li',
207
- { style: i },
208
- Object( c.createElement )(
209
- r.InspectorControls,
210
- null,
211
- Object( c.createElement )( r.PanelColorSettings, {
212
- title: Object( o.__ )( 'Color Settings' ),
213
- colorSettings: [
214
- {
215
- value: t.background,
216
- onChange: function( e ) {
217
- return n( { background: e } );
218
- },
219
- label: Object( o.__ )( 'Background Color' ),
220
- },
221
- ],
222
- } )
223
- ),
224
- Object( c.createElement )(
225
- 'div',
226
- { className: 'timeline-item' },
227
- Object( c.createElement )( 'div', { className: 'timeline-item__bubble', style: l } ),
228
- Object( c.createElement )( 'div', { className: 'timeline-item__dot', style: i } ),
229
- Object( c.createElement )( r.InnerBlocks, { template: [ [ 'core/heading' ] ] } )
230
- )
231
- );
232
- },
233
- save: function( e ) {
234
- var t = e.attributes,
235
- n = { backgroundColor: t.background },
236
- i = { borderColor: t.background };
237
- return Object( c.createElement )(
238
- 'li',
239
- { style: n },
240
- Object( c.createElement )(
241
- 'div',
242
- { className: 'timeline-item' },
243
- Object( c.createElement )( 'div', { className: 'timeline-item__bubble', style: i } ),
244
- Object( c.createElement )( 'div', { className: 'timeline-item__dot', style: n } ),
245
- Object( c.createElement )( r.InnerBlocks.Content, null )
246
- )
247
- );
248
- },
249
- attributes: { background: { type: 'string', default: '#eeeeee' } },
250
- } );
251
- },
252
- ] );
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import './blocks/src/index';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
jetpack-timeline/index.php CHANGED
@@ -1,40 +1,46 @@
1
  <?php
 
 
 
 
 
2
 
3
- // Register Block Scripts
4
- add_action( 'init', function() {
5
- $asset_file = __DIR__ . '/index.asset.php';
6
- $asset = file_exists( $asset_file ) ? require_once $asset_file : null;
7
- $dependencies = isset( $asset['dependencies'] ) ? $asset['dependencies'] : [];
8
- $version = isset( $asset['version'] ) ? $asset['version'] : filemtime( __DIR__ . '/index.js' );
 
 
9
 
10
- // Block JS
11
- wp_register_script(
12
- 'jetpack-timeline',
13
- plugins_url( 'index.js', __FILE__ ),
14
- $dependencies,
15
- $version,
16
- true
17
- );
18
 
19
- // Block front end style
20
- wp_register_style(
21
- 'jetpack-timeline',
22
- plugins_url( 'style.css', __FILE__ ),
23
- [],
24
- filemtime( __DIR__ . '/style.css' )
25
- );
26
 
27
- // Block editor style
28
- wp_register_style(
29
- 'jetpack-timeline-editor',
30
- plugins_url( 'editor.css', __FILE__ ),
31
- [],
32
- filemtime( __DIR__ . '/editor.css' )
33
- );
34
- } );
35
 
36
- /**
37
- * AUTO-GENERATED blocks will be added here
38
- */
39
 
40
- include_once __DIR__ . '/blocks/timeline.php';
1
  <?php
2
+ /**
3
+ * Timeline Block
4
+ *
5
+ * @package A8C\FSE
6
+ */
7
 
8
+ // Register Block Scripts.
9
+ add_action(
10
+ 'init',
11
+ function() {
12
+ $asset_file = __DIR__ . '/dist/jetpack-timleine.asset.php';
13
+ $asset = file_exists( $asset_file ) ? require_once $asset_file : null;
14
+ $dependencies = isset( $asset['dependencies'] ) ? $asset['dependencies'] : array();
15
+ $version = isset( $asset['version'] ) ? $asset['version'] : filemtime( __DIR__ . '/index.js' );
16
 
17
+ // Block JS.
18
+ wp_register_script(
19
+ 'jetpack-timeline',
20
+ plugins_url( 'dist/jetpack-timeline.js', __FILE__ ),
21
+ $dependencies,
22
+ $version,
23
+ true
24
+ );
25
 
26
+ // Block front end style.
27
+ wp_register_style(
28
+ 'jetpack-timeline',
29
+ plugins_url( 'style.css', __FILE__ ),
30
+ array(),
31
+ filemtime( __DIR__ . '/style.css' )
32
+ );
33
 
34
+ // Block editor style.
35
+ wp_register_style(
36
+ 'jetpack-timeline-editor',
37
+ plugins_url( 'editor.css', __FILE__ ),
38
+ array(),
39
+ filemtime( __DIR__ . '/editor.css' )
40
+ );
 
41
 
42
+ wp_set_script_translations( 'jetpack-timeline', 'full-site-editing' );
43
+ }
44
+ );
45
 
46
+ require_once __DIR__ . '/blocks/timeline.php';
posts-list-block/dist/posts-list-block.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'b4c9c5e6cb3715778c497c9ea13dd95b');
1
+ <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '2d46fa6b50eef5817f491385a0848338');
posts-list-block/dist/posts-list-block.css CHANGED
@@ -1 +1 @@
1
- div.posts-list__notice{margin:0 0 5px}div.posts-list__notice .components-notice__content{display:flex;align-items:center;justify-content:space-between}.a8c-posts-list__listing{list-style:none;margin:0;padding:0}.a8c-posts-list__item{display:block}
1
+ div.posts-list__notice{margin:0 0 5px}div.posts-list__notice .components-notice__content{display:flex;align-items:center;justify-content:space-between}.a8c-posts-list__listing{list-style:none;margin:0;padding:0}.a8c-posts-list__item{display:block}
posts-list-block/dist/posts-list-block.js CHANGED
@@ -1 +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 r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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=9)}([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.blocks}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e){e.exports=JSON.parse('{"b":"a8c/posts-list","a":{"postsPerPage":{"type":"number","default":10}}}')},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(2),i=n(1),l=n(3),s=n(6),c=n(4),a=n(5),u=(n(7),n(8),["a8c/blog-posts","newspack-blocks/homepage-articles"]),f=function(e){return function(t){var n=t.postsPerPage;return Object(r.createBlock)(e,{postsToShow:n,showAvatar:!1,displayPostDate:!0,displayPostContent:!0})}},p={to:u.map((function(e){return{type:"block",blocks:[e],transform:f(e)}}))},b=Object(o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(o.createElement)("path",{opacity:".87",fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M3 5v14h17V5H3zm4 2v2H5V7h2zm-2 6v-2h2v2H5zm0 2h2v2H5v-2zm13 2H9v-2h9v2zm0-4H9v-2h9v2zm0-4H9V7h9v2z"}));Object(r.registerBlockType)(a.b,{title:Object(i.__)("Blog Posts Listing","full-site-editing"),description:Object(i.__)("Displays your latest Blog Posts.","full-site-editing"),icon:b,category:"layout",supports:{html:!1,multiple:!1,reusable:!1,inserter:!1},attributes:a.a,edit:function(e){var t=e.attributes,n=e.setAttributes,a=e.clientId,f=e.isSelected,p=Object(c.select)("core/block-editor").getBlock(a),d=Object(r.getPossibleBlockTransformations)([p]).find((function(e){return e&&(t=e.name,u.indexOf(t)>-1);var t})),m=!!d;return Object(o.createElement)(o.Fragment,null,m&&Object(o.createElement)(l.Notice,{actions:[{label:Object(i.__)("Update Block","full-site-editing"),onClick:function(){Object(c.dispatch)("core/block-editor").replaceBlocks(p.clientId,Object(r.switchToBlockType)(p,d.name))}}],className:"posts-list__notice",isDismissible:!1},Object(i.__)("An improved version of this block is available. Update for a better, more natural way to manage your blog post listings. There may be small visual changes.","full-site-editing")),Object(o.createElement)(l.Placeholder,{icon:b,label:Object(i.__)("Your recent blog posts will be displayed here.","full-site-editing")},f?Object(o.createElement)(l.RangeControl,{label:Object(i.__)("Number of posts to show","full-site-editing"),value:t.postsPerPage,onChange:function(e){return n({postsPerPage:e})},min:1,max:50}):null),Object(o.createElement)(s.InspectorControls,null,Object(o.createElement)(l.PanelBody,null,Object(o.createElement)(l.RangeControl,{label:Object(i.__)("Number of posts","full-site-editing"),value:t.postsPerPage,onChange:function(e){return n({postsPerPage:e})},min:1,max:50}))))},save:function(){return null},transforms:p})}]));
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 r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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=9)}([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.blocks}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e){e.exports=JSON.parse('{"b":"a8c/posts-list","a":{"postsPerPage":{"type":"number","default":10}}}')},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var o=n(0),r=n(2),i=n(1),l=n(3),s=n(6),c=n(4),a=n(5),u=(n(7),n(8),["a8c/blog-posts","newspack-blocks/homepage-articles"]),f=function(e){return function(t){var n=t.postsPerPage;return Object(r.createBlock)(e,{postsToShow:n,showAvatar:!1,displayPostDate:!0,displayPostContent:!0})}},p={to:u.map((function(e){return{type:"block",blocks:[e],transform:f(e)}}))},b=Object(o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(o.createElement)("path",{opacity:".87",fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M3 5v14h17V5H3zm4 2v2H5V7h2zm-2 6v-2h2v2H5zm0 2h2v2H5v-2zm13 2H9v-2h9v2zm0-4H9v-2h9v2zm0-4H9V7h9v2z"}));Object(r.registerBlockType)(a.b,{title:Object(i.__)("Blog Posts Listing","full-site-editing"),description:Object(i.__)("Displays your latest Blog Posts.","full-site-editing"),icon:b,category:"layout",supports:{html:!1,multiple:!1,reusable:!1,inserter:!1},attributes:a.a,edit:function(e){var t=e.attributes,n=e.setAttributes,a=e.clientId,f=e.isSelected,p=Object(c.select)("core/block-editor").getBlock(a),d=Object(r.getPossibleBlockTransformations)([p]).find((function(e){return e&&(t=e.name,u.indexOf(t)>-1);var t})),m=!!d;return Object(o.createElement)(o.Fragment,null,m&&Object(o.createElement)(l.Notice,{actions:[{label:Object(i.__)("Update Block","full-site-editing"),onClick:function(){Object(c.dispatch)("core/block-editor").replaceBlocks(p.clientId,Object(r.switchToBlockType)(p,d.name))}}],className:"posts-list__notice",isDismissible:!1},Object(i.__)("An improved version of this block is available. Update for a better, more natural way to manage your blog post listings. There may be small visual changes.","full-site-editing")),Object(o.createElement)(l.Placeholder,{icon:b,label:Object(i.__)("Your recent blog posts will be displayed here.","full-site-editing")},f?Object(o.createElement)(l.RangeControl,{label:Object(i.__)("Number of posts to show","full-site-editing"),value:t.postsPerPage,onChange:function(e){return n({postsPerPage:e})},min:1,max:50}):null),Object(o.createElement)(s.InspectorControls,null,Object(o.createElement)(l.PanelBody,null,Object(o.createElement)(l.RangeControl,{label:Object(i.__)("Number of posts","full-site-editing"),value:t.postsPerPage,onChange:function(e){return n({postsPerPage:e})},min:1,max:50}))))},save:function(){return null},transforms:p})}]));
posts-list-block/dist/posts-list-block.rtl.css CHANGED
@@ -1 +1 @@
1
- div.posts-list__notice{margin:0 0 5px}div.posts-list__notice .components-notice__content{display:flex;align-items:center;justify-content:space-between}.a8c-posts-list__listing{list-style:none;margin:0;padding:0}.a8c-posts-list__item{display:block}
1
+ div.posts-list__notice{margin:0 0 5px}div.posts-list__notice .components-notice__content{display:flex;align-items:center;justify-content:space-between}.a8c-posts-list__listing{list-style:none;margin:0;padding:0}.a8c-posts-list__item{display:block}
posts-list-block/templates/post-item.php CHANGED
@@ -31,7 +31,7 @@
31
  <span class="a8c-posts-list-item__author"><?php echo esc_html_x( 'by', 'designating the post author (eg: by John Doe', 'full-site-editing' ); ?>
32
  <?php the_author_posts_link(); ?>
33
  </span>
34
- <?php if ( current_user_can( 'edit_posts' ) ) : ?>
35
  <span class="a8c-posts-list-item__edit-link">
36
  <a href="<?php echo esc_attr( get_edit_post_link() ); ?>"><?php esc_html_e( 'Edit', 'full-site-editing' ); ?></a>
37
  </span>
31
  <span class="a8c-posts-list-item__author"><?php echo esc_html_x( 'by', 'designating the post author (eg: by John Doe', 'full-site-editing' ); ?>
32
  <?php the_author_posts_link(); ?>
33
  </span>
34
+ <?php if ( current_user_can( 'edit_posts' ) ) : ?>
35
  <span class="a8c-posts-list-item__edit-link">
36
  <a href="<?php echo esc_attr( get_edit_post_link() ); ?>"><?php esc_html_e( 'Edit', 'full-site-editing' ); ?></a>
37
  </span>
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Full Site Editing ===
2
- Contributors: alexislloyd, allancole, automattic, codebykat, copons, dmsnell, get_dave, glendaviesnz, gwwar, iamtakashi, Joen, kwight, marekhrabe, mattwiebe, mmtr86, mppfeiffer, nrqsnchz, obenland, okenobi, vindl, noahtallen, owolski, nosolosw
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.0
5
  Tested up to: 5.3
6
- Stable tag: 0.19
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -42,6 +42,12 @@ This plugin is experimental, so we don't provide any support for it outside of w
42
 
43
  == Changelog ==
44
 
 
 
 
 
 
 
45
  = 0.19 =
46
  * Starter Page Templates: Added more than twenty new block editor page templates.
47
  * Starter Page Templates: Fix issues with full width blocks in the preview.
1
  === Full Site Editing ===
2
+ Contributors: alexislloyd, allancole, automattic, codebykat, copons, dmsnell, get_dave, glendaviesnz, gwwar, iamtakashi, Joen, kwight, marekhrabe, mattwiebe, mkaz, mmtr86, mppfeiffer, nrqsnchz, obenland, okenobi, vindl, noahtallen, owolski, nosolosw
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.0
5
  Tested up to: 5.3
6
+ Stable tag: 0.21
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
42
 
43
  == Changelog ==
44
 
45
+ = 0.21 =
46
+ * Linting fixes and page layout selector improvements.
47
+
48
+ = 0.20 =
49
+ * Fix text domain for i18n for Event Countdown and Timeline
50
+
51
  = 0.19 =
52
  * Starter Page Templates: Added more than twenty new block editor page templates.
53
  * Starter Page Templates: Fix issues with full width blocks in the preview.
starter-page-templates/class-starter-page-templates.php CHANGED
@@ -249,9 +249,11 @@ class Starter_Page_Templates {
249
  * @return string ISO 639 locale string
250
  */
251
  private function get_iso_639_locale() {
252
- $language = strtolower( get_locale() );
 
 
253
 
254
- if ( in_array( $language, [ 'zh_tw', 'zh-tw', 'zh_cn', 'zh-cn' ], true ) ) {
255
  $language = str_replace( '_', '-', $language );
256
  } else {
257
  $language = preg_replace( '/([-_].*)$/i', '', $language );
249
  * @return string ISO 639 locale string
250
  */
251
  private function get_iso_639_locale() {
252
+ // Make sure to get blog locale, not user locale.
253
+ $language = function_exists( 'get_blog_lang_code' ) ? get_blog_lang_code() : get_locale();
254
+ $language = strtolower( $language );
255
 
256
+ if ( in_array( $language, [ 'pt_br', 'pt-br', 'zh_tw', 'zh-tw', 'zh_cn', 'zh-cn' ], true ) ) {
257
  $language = str_replace( '_', '-', $language );
258
  } else {
259
  $language = preg_replace( '/([-_].*)$/i', '', $language );
starter-page-templates/dist/starter-page-templates.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => 'e274f8ab3d7b7b3dc96dfb6f93467ef8');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => 'f6c2eb5c4c327d51953b2e611af92dda');
starter-page-templates/dist/starter-page-templates.css CHANGED
@@ -1 +1 @@
1
- .page-template-modal-screen-overlay{animation:none;background-color:transparent;z-index:99}@media screen and (min-width:783px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{left:36px}}@media screen and (min-width:961px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{left:160px}}@media screen and (min-width:783px){body:not(.is-fullscreen-mode).folded .page-template-modal-screen-overlay{left:36px}body:not(.is-fullscreen-mode):not(.folded):not(.auto-fold) .page-template-modal-screen-overlay{left:160px}}body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:46px}@media screen and (min-width:783px){body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:32px}}.page-template-modal{width:100%;height:100vh;animation:none;box-shadow:none;border:none;top:0;left:0;right:0;bottom:0;transform:none;max-width:none;max-height:none;background-color:#eee}.page-template-modal .components-modal__header-heading-container{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__close-button{display:block;position:absolute;z-index:20;top:9px;width:36px;height:36px;left:10px}.page-template-modal .components-modal__header:after{display:block;position:absolute;content:" ";border-right:1px solid #e2e4e7;height:100%;left:56px}.page-template-modal .components-modal__content{overflow-y:scroll;-webkit-overflow-scrolling:touch}.page-template-modal__inner{position:relative;margin:0 auto;padding:0 20px 40px}.page-template-modal__list{margin-bottom:20px}.page-template-modal__list .components-base-control__label{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.template-selector-control__options{display:grid;grid-template-columns:1fr;grid-gap:.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}}.template-selector-item__label{display:block;width:100%;font-size:14px;text-align:center;border:2px solid #e2e4e7;border-radius:6px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;overflow:hidden;background-color:#fff;position:relative;transform:translateZ(0)}.template-selector-item__label .template-selector-item__template-title{width:100%;position:absolute;bottom:0;left:0;height:40px;line-height:40px;background-color:#fff}.template-selector-item__label:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;outline:2px solid transparent}.template-selector-item__label:hover{border:2px solid #c9c9ca}.template-selector-item__label.is-selected{border:2px solid #555d66;outline:2px solid transparent;outline-offset:-2px}.template-selector-item__label.is-selected:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;border:2px solid #555d66;outline:4px solid transparent;outline-offset:-4px}.template-selector-item__preview-wrap{width:100%;display:block;margin:0 auto;background:#fff;border-radius:0;overflow:hidden;height:0;padding-top:120%;box-sizing:content-box;position:relative;pointer-events:none;opacity:1;transform:translateZ(0)}@media screen and (min-width:660px){.template-selector-item__preview-wrap{padding-top:100%}}.template-selector-item__preview-wrap.is-rendering{opacity:.5}.template-selector-item__preview-wrap .block-editor-block-list__block,.template-selector-item__preview-wrap .block-editor-block-list__layout{padding:inherit}.template-selector-item__media{width:100%;display:block;position:absolute;top:0;left:0}@media screen and (min-width:660px){.page-template-modal__form{max-width:20%}}@media screen and (min-width:783px){.page-template-modal__form{max-width:30%}}.page-template-modal__form-title{font-weight:700;margin-bottom:1em;text-align:center}@media screen and (min-width:660px){.page-template-modal__form-title{text-align:left}}.page-template-modal__buttons{position:absolute;right:0;top:0;z-index:10;height:56px;display:flex;align-items:center;padding-right:24px}@media screen and (min-width:660px){.page-template-modal__buttons{display:flex}}.page-template-modal__buttons.is-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__buttons .components-button{height:33px;line-height:32px}.template-selector-preview{display:none;position:fixed;top:157px;bottom:24px;left:calc(20% + 48px);right:24px;background:#fff;border-radius:2px;overflow-x:hidden;overflow-y:auto;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}@media screen and (min-width:660px){.template-selector-preview{display:block}.template-selector-preview.is-blank-preview{align-items:center;display:flex;justify-content:center}}@media screen and (min-width:783px){.template-selector-preview{top:143px;left:calc(30% + 72px)}body:not(.auto-fold):not(.folded) .template-selector-preview{left:calc(30% + 172px)}}@media screen and (min-width:961px){.template-selector-preview{left:calc(30% + 172px)}body.folded .template-selector-preview{left:calc(30% + 72px)}}body.is-fullscreen-mode .template-selector-preview{top:111px}@media screen and (min-width:783px){body.is-fullscreen-mode .template-selector-preview{left:calc(30% + 48px)!important}}.template-selector-preview .edit-post-visual-editor{margin:0;padding:0}.template-selector-preview .editor-styles-wrapper .template-selector-preview__offset-correction{position:relative;top:120px}.template-selector-preview .editor-styles-wrapper .editor-post-title{transform-origin:top center;width:100%;display:block;position:absolute;top:0}.template-selector-preview .editor-styles-wrapper .editor-post-title,.template-selector-preview .editor-styles-wrapper .editor-post-title__block,.template-selector-preview .editor-styles-wrapper .editor-post-title__input{padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0}.template-selector-preview .editor-styles-wrapper .editor-post-title .editor-post-title__input,.template-selector-preview .editor-styles-wrapper .editor-post-title__block .editor-post-title__input,.template-selector-preview .editor-styles-wrapper .editor-post-title__input .editor-post-title__input{margin:0;padding:0;height:120px;line-height:120px;overflow:hidden;resize:none}.template-selector-preview__placeholder{color:var(--color-text-subtle);font-size:15px;font-weight:400}.block-editor-block-preview__container.editor-styles-wrapper .wp-block{width:100%}.block-editor-block-preview__container.editor-styles-wrapper .wp-block[data-type="core/cover"][data-align=full]{margin:0}.block-editor-block-preview__container.editor-styles-wrapper .wp-block[data-type="core/cover"][data-align=full] .wp-block-cover{padding:0}.block-editor-block-preview__container.editor-styles-wrapper .wp-block-columns>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="core/column"]>.block-editor-block-list__block-edit>div>.block-core-columns>.block-editor-inner-blocks{margin-top:0;margin-bottom:0}.block-editor-block-preview__container.editor-styles-wrapper .block-editor-block-list__block[data-align=full]{margin:0}@media screen and (min-width:600px){.block-editor-block-preview__container.editor-styles-wrapper .block-editor-block-list__block .block-editor-block-list__block-edit{margin:0}}.template-selector-item__preview-wrap .components-disabled,.template-selector-item__preview-wrap .components-disabled .editor-styles-wrapper,.template-selector-item__preview-wrap .edit-post-visual-editor,.template-selector-item__preview-wrap .edit-post-visual-editor .editor-styles-wrapper,.template-selector-preview .components-disabled,.template-selector-preview .components-disabled .editor-styles-wrapper,.template-selector-preview .edit-post-visual-editor,.template-selector-preview .edit-post-visual-editor .editor-styles-wrapper{height:100%}.page-template-modal__loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:flex-end}.page-template-modal__loading .components-spinner{float:none}.sidebar-modal-opener{display:flex;flex-direction:column;align-items:center;justify-content:center}.sidebar-modal-opener .template-selector-item__label{max-width:300px}.sidebar-modal-opener .template-selector-item__template-title{font-size:1.2rem}.sidebar-modal-opener__button{margin-top:20px}.sidebar-modal-opener__warning-modal{display:flex;flex-direction:column;justify-content:center;align-items:center}.sidebar-modal-opener__warning-text{max-width:300px;font-size:1rem;line-height:1.5rem}.sidebar-modal-opener__warning-options{display:flex;justify-content:space-around;margin-top:20px}
1
+ .page-template-modal-screen-overlay{animation:none;background-color:transparent;z-index:99}@media screen and (min-width:783px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{left:36px}}@media screen and (min-width:961px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{left:160px}}@media screen and (min-width:783px){body:not(.is-fullscreen-mode).folded .page-template-modal-screen-overlay{left:36px}body:not(.is-fullscreen-mode):not(.folded):not(.auto-fold) .page-template-modal-screen-overlay{left:160px}}body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:46px}@media screen and (min-width:783px){body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:32px}}.page-template-modal{width:100%;height:100vh;animation:none;box-shadow:none;border:none;top:0;left:0;right:0;bottom:0;transform:none;max-width:none;max-height:none;background-color:#eee}.page-template-modal .components-modal__header-heading-container{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__close-button{display:block;position:absolute;z-index:20;top:9px;width:36px;height:36px;left:10px}.page-template-modal .components-modal__header:after{display:block;position:absolute;content:" ";border-right:1px solid #e2e4e7;height:100%;left:56px}.page-template-modal .components-modal__content{overflow-y:scroll;-webkit-overflow-scrolling:touch}.page-template-modal__inner{position:relative;margin:0 auto;padding:0 20px 40px}.page-template-modal__list{margin-bottom:20px}.page-template-modal__list .components-base-control__label{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.template-selector-control__options{display:grid;grid-template-columns:1fr;grid-gap:.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}}.template-selector-item__label{display:block;width:100%;font-size:14px;text-align:center;border:2px solid #e2e4e7;border-radius:6px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;overflow:hidden;background-color:#fff;position:relative;transform:translateZ(0)}.template-selector-item__label:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;outline:2px solid transparent}.template-selector-item__label:hover{border:2px solid #c9c9ca}.template-selector-item__label.is-selected{border:2px solid #555d66;outline:2px solid transparent;outline-offset:-2px}.template-selector-item__label.is-selected:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;border:2px solid #555d66;outline:4px solid transparent;outline-offset:-4px}.template-selector-item__preview-wrap{width:100%;display:block;margin:0 auto;background:#fff;border-radius:0;overflow:hidden;height:0;padding-top:120%;box-sizing:content-box;position:relative;pointer-events:none;opacity:1;transform:translateZ(0)}@media screen and (min-width:660px){.template-selector-item__preview-wrap{padding-top:100%}}.template-selector-item__preview-wrap.is-rendering{opacity:.5}.template-selector-item__media{width:100%;display:block;position:absolute;top:0;left:0}@media screen and (min-width:660px){.page-template-modal__form{max-width:20%}}@media screen and (min-width:783px){.page-template-modal__form{max-width:30%}}.page-template-modal__form-title{font-weight:700;margin-bottom:1em;text-align:center}@media screen and (min-width:660px){.page-template-modal__form-title{text-align:left}}.page-template-modal__buttons{position:absolute;right:0;top:0;z-index:10;height:56px;display:flex;align-items:center;padding-right:24px}@media screen and (min-width:660px){.page-template-modal__buttons{display:flex}}.page-template-modal__buttons.is-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__buttons .components-button{height:33px;line-height:32px}.template-selector-preview{display:none;position:fixed;top:157px;bottom:24px;left:calc(20% + 48px);right:24px;background:#fff;border-radius:2px;overflow:hidden;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}@media screen and (min-width:660px){.template-selector-preview{display:block}.template-selector-preview.is-blank-preview{align-items:center;display:flex;justify-content:center}}@media screen and (min-width:783px){.template-selector-preview{top:143px;left:calc(30% + 72px)}body:not(.auto-fold):not(.folded) .template-selector-preview{left:calc(30% + 172px)}}@media screen and (min-width:961px){.template-selector-preview{left:calc(30% + 172px)}body.folded .template-selector-preview{left:calc(30% + 72px)}}body.is-fullscreen-mode .template-selector-preview{top:111px}@media screen and (min-width:783px){body.is-fullscreen-mode .template-selector-preview{left:calc(30% + 48px)!important}}.template-selector-preview .edit-post-visual-editor{margin:0;padding:0}.template-selector-preview.not-selected .editor-styles-wrapper{position:relative;width:100%;height:100%}.template-selector-preview.not-selected .editor-styles-wrapper .template-selector-preview__empty-state{position:absolute;width:100%;text-align:center;height:50px;line-height:50px;top:50%;margin:-25px 0 0}.page-template-modal__loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:flex-end}.page-template-modal__loading .components-spinner{float:none}.sidebar-modal-opener{display:flex;flex-direction:column;align-items:center;justify-content:center}.sidebar-modal-opener .template-selector-item__label{max-width:300px}.sidebar-modal-opener__button{margin-top:20px}.sidebar-modal-opener__warning-modal{display:flex;flex-direction:column;justify-content:center;align-items:center}.sidebar-modal-opener__warning-text{max-width:300px;font-size:1rem;line-height:1.5rem}.sidebar-modal-opener__warning-options{float:right;margin-top:20px}.sidebar-modal-opener__warning-options .components-button{margin-left:12px}.block-iframe-preview{position:absolute;top:0;left:0;transform-origin:top left;text-align:initial;margin:0;overflow:visible;min-height:auto;width:1440px}.block-iframe-preview-body{margin:0;padding:0;overflow-x:hidden;overflow-y:auto}.block-iframe-preview-body>.block-editor,.block-iframe-preview-body>.block-editor>.edit-post-visual-editor{padding:0;margin:0}.block-iframe-preview-body .block-editor-inserter,.block-iframe-preview-body .block-list-appender{display:none!important;visibility:hidden;position:absolute;left:-9999vw}.block-iframe-preview-body .editor-styles-wrapper .wp-block-cover{height:auto}.block-iframe-preview-body .editor-styles-wrapper .wp-block-embed__wrapper iframe{height:auto;min-height:400px}.block-iframe-preview-body [data-type="core/paragraph"] [data-rich-text-placeholder]{display:none}.block-iframe-preview-body .swiper-wrapper{display:flex}.block-iframe-preview-body .swiper-button-next,.block-iframe-preview-body .swiper-button-prev{display:none}.block-iframe-preview-body .swiper-pagination{text-align:center}.block-iframe-preview-body .swiper-pagination-bullet{border-radius:100%}.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/cover"]{margin-top:0;margin-bottom:0}
starter-page-templates/dist/starter-page-templates.js CHANGED
@@ -1,2 +1,6 @@
1
- /*! For license information please see starter-page-templates.js.LICENSE */
2
- !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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=34)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.i18n}()},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){!function(){e.exports=this.wp.components}()},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.data}()},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)&&r.length){var o=i.apply(null,r);o&&e.push(o)}else if("object"===a)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t,n){var r=n(3);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},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){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(24),i=n(5);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(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 r=n(25);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&&r(e,t)}},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,n){var r=n(28),i=n(29),a=n(30);e.exports=function(e,t){return r(e)||i(e,t)||a()}},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t){function n(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,l,"next",e)}function l(e){n(o,i,a,s,l,"throw",e)}s(void 0)}))}}},function(e,t,n){var r=n(31),i=n(32),a=n(33);e.exports=function(e){return r(e)||i(e)||a()}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.url}()},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,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){!function(){e.exports=this.wp.nux}()},function(e,t,n){},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(l){i=!0,a=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},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,n){"use strict";n.r(t);var r=n(0),i=n(2),a=n(17),o=n(6),s=n(20),l=n(9),c=n.n(l),p=n(10),u=n.n(p),m=n(11),d=n.n(m),f=n(12),b=n.n(f),g=n(13),v=n.n(g),O=n(5),h=n.n(O),j=n(14),y=n.n(j),_=n(3),w=n.n(_),T=n(1),E=n(7),P=n.n(E),k=(n(26),n(8)),S=n(4),x=n(21),B=(n(27),n(15)),N=function(e){var t=e.blocks,n=void 0===t?[]:t,i=e.viewportWidth;return n&&n.length?Object(r.createElement)("div",{className:"edit-post-visual-editor"},Object(r.createElement)("div",{className:"editor-styles-wrapper"},Object(r.createElement)("div",{className:"editor-writing-flow"},Object(r.createElement)(B.BlockPreview,{blocks:n,viewportWidth:i})))):null},C=function(e){var t=e.id,n=e.value,i=e.onSelect,a=e.label,o=e.useDynamicPreview,s=void 0!==o&&o,l=e.staticPreviewImg,c=e.staticPreviewImgAlt,p=void 0===c?"":c,u=e.blocks,m=void 0===u?[]:u,d=e.isSelected;if(Object(T.isNil)(t)||Object(T.isNil)(a)||Object(T.isNil)(n))return null;if(s&&(Object(T.isNil)(m)||Object(T.isEmpty)(m)))return null;var f=s?Object(r.createElement)(S.Disabled,null,Object(r.createElement)(N,{blocks:m,viewportWidth:960})):Object(r.createElement)("img",{className:"template-selector-item__media",src:l,alt:p}),b="label-".concat(t,"-").concat(n);return Object(r.createElement)("button",{type:"button",className:P()("template-selector-item__label",{"is-selected":d}),value:n,onClick:function(){i(n)},"aria-labelledby":"".concat(t," ").concat(b)},Object(r.createElement)("div",{className:"template-selector-item__preview-wrap"},f))},A={Address:Object(i._x)("123 Main St","default address","full-site-editing"),Phone:Object(i._x)("555-555-5555","default phone number","full-site-editing"),CompanyName:Object(i._x)("Your Company Name","default company name","full-site-editing"),Vertical:Object(i._x)("Business","default vertical name","full-site-editing")},I={CompanyName:"title",Address:"address",Phone:"phone",Vertical:"vertical"},M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e.replace(/{{(\w+)}}/g,(function(e,n){var r=A[n];return t[I[n]]||r||n})):""},L=Object(k.compose)(r.memo,k.withInstanceId)((function(e){var t=e.label,n=e.className,i=e.help,a=e.instanceId,o=e.templates,s=void 0===o?[]:o,l=e.blocksByTemplates,c=void 0===l?{}:l,p=e.useDynamicPreview,u=void 0!==p&&p,m=e.onTemplateSelect,d=void 0===m?T.noop:m,f=e.siteInformation,b=void 0===f?{}:f,g=e.selectedTemplate;if(Object(T.isEmpty)(s)||!Object(T.isArray)(s))return null;if(!0===u&&Object(T.isEmpty)(c))return null;var v="template-selector-control-".concat(a);return Object(r.createElement)(S.BaseControl,{label:t,id:v,help:i,className:P()(n,"template-selector-control")},Object(r.createElement)("ul",{className:"template-selector-control__options","data-testid":"template-selector-control-options"},Object(T.map)(s,(function(e){var t=e.slug,n=e.title,a=e.preview,o=e.previewAlt;return Object(r.createElement)("li",{key:"".concat(v,"-").concat(t),className:"template-selector-control__template"},Object(r.createElement)(C,{id:v,value:t,label:M(n,b),help:i,onSelect:d,staticPreviewImg:a,staticPreviewImgAlt:o,blocks:c.hasOwnProperty(t)?c[t]:[],useDynamicPreview:u,isSelected:t===g}))}))))})),D=n(16),W=n.n(D),F=function(e){var t=e.title,n=e.scale;return(Object(r.createElement)("div",{className:"editor-post-title",style:{transform:"scale(".concat(n,")")}},Object(r.createElement)("div",{className:"wp-block editor-post-title__block"},Object(r.createElement)("textarea",{className:"editor-post-title__input",value:t,onChange:function(){}}))))},G=function(e){return Object(r.createElement)(B.BlockPreview,e)},U=function(e){var t=e.blocks,n=e.viewportWidth,a=e.title,o=Object(r.useRef)(null),s=Object(r.useState)(n),l=W()(s,2),c=l[0],p=l[1],u=Object(r.useState)({scale:1,offset:120}),m=W()(u,2),d=m[0],f=m[1],b=Object(r.useReducer)((function(e){return e+1}),0),g=W()(b,2),v=g[0],O=g[1],h=function(){o&&o.current&&setTimeout((function(){var e=o.current.querySelector(".block-editor-block-preview__content");if(e){var t=parseFloat(Object(T.get)(e,["style","transform"],"").replace("scale(","").replace(")",""));if(t)f({scale:t,offset:120*t})}}),500)},j=Object(r.useCallback)((function(){if(o&&o.current){var e=o.current.clientWidth;p(e>=n?e:n)}}),[n]);return Object(r.useLayoutEffect)((function(){j(),h()}),[t,j]),Object(r.useEffect)((function(){if(t&&t.length){var e=function(){j(),h(),O()},n=Object(T.debounce)(e,300);return window.addEventListener("resize",n),window.jQuery&&window.jQuery(window.document).on("wp-collapse-menu",e),function(){window.removeEventListener("resize",n)}}}),[t,j]),Object(T.isEmpty)(t)||!Object(T.isArray)(t)?Object(r.createElement)("div",{className:P()("template-selector-preview","is-blank-preview")},Object(r.createElement)("div",{className:"template-selector-preview__placeholder"},Object(i.__)("Select a layout to preview.","full-site-editing"))):Object(r.createElement)("div",{className:"template-selector-preview"},Object(r.createElement)(S.Disabled,null,Object(r.createElement)("div",{ref:o,className:"edit-post-visual-editor"},Object(r.createElement)("div",{className:"editor-styles-wrapper"},Object(r.createElement)("div",{className:"editor-writing-flow"},Object(r.createElement)(F,{title:a,scale:d.scale}),Object(r.createElement)("div",{className:"template-selector-preview__offset-correction",style:{top:d.offset}},Object(r.createElement)(G,{key:v,blocks:t,viewportWidth:c})))))))};window._tkq=window._tkq||[];var q=null,R=function(e,t){q&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_view",{blog_id:q.blogid,segment_id:e,vertical_id:t}])},z=function(e,t){q&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_dismiss",{blog_id:q.blogid,segment_id:e,vertical_id:t}])},Q=function(e,t,n){q&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_template_selected",{blog_id:q.blogid,segment_id:e,vertical_id:t,template:n}])},V=n(18),H=n.n(V),Y=n(19),J=n.n(Y),K=n(22),X=n.n(K),Z=n(23),$=function(e,t,n){var r=e[t=Object(Z.removeQueryArgs)(t,"w","s")]||{url:t,usages:[]};return c()({},e,w()({},t,c()({},r,{usages:[].concat(J()(r.usages),J()(n))})))},ee=function e(t,n){switch(t.blocksByClientId[n.clientId]=n,n.name){case"core/cover":case"core/image":var r=n.attributes.url;r&&(t.assets=$(t.assets,r,[{prop:"url",path:[n.clientId,"attributes","url"]},{prop:"id",path:[n.clientId,"attributes","id"]}]));case"core/media-text":var i=n.attributes.mediaUrl;i&&"image"===n.attributes.mediaType&&(t.assets=$(t.assets,i,[{prop:"url",path:[n.clientId,"attributes","mediaUrl"]},{prop:"id",path:[n.clientId,"attributes","mediaId"]}]));case"core/gallery":Object(T.forEach)(n.attributes.images,(function(e,r){t.assets=$(t.assets,e.url,[{prop:"url",path:[n.clientId,"attributes","images",r,"url"]},{prop:"url",path:[n.clientId,"attributes","images",r,"link"]},{prop:"id",path:[n.clientId,"attributes","images",r,"id"]},{prop:"id",path:[n.clientId,"attributes","ids",r]}])}))}return Object(T.isEmpty)(n.innerBlocks)?t:Object(T.reduce)(n.innerBlocks,e,t)},te=function(){var e=H()(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X()({method:"POST",path:"/fse/v1/sideload/image/batch",data:{resources:Object(T.map)(t)}}).then((function(e){return Object(T.reduce)(t,(function(t,n){var r=e.shift(),i=r.id,a=r.source_url;return c()({},t,w()({},n.url,{id:i,url:a}))}),{})}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ne=function(e,t){return Object(T.forEach)(e.assets,(function(n){var r=t[n.url];r&&Object(T.forEach)(n.usages,(function(t){Object(T.set)(e.blocksByClientId,t.path,r[t.prop])}))})),e.blocks},re=function(){var e=H()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Object(T.reduce)(t,ee,{assets:{},blocksByClientId:{},blocks:t}),!Object(T.isEmpty)(n.assets)){e.next=3;break}return e.abrupt("return",t);case 3:return e.abrupt("return",te(n.assets).then((function(e){return ne(n,e)})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ie=function(e){function t(){var e,n;u()(this,t);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return n=b()(this,(e=v()(t)).call.apply(e,[this].concat(o))),w()(h()(n),"state",{isLoading:!1,previewedTemplate:null,error:null,isOpen:!1}),w()(h()(n),"getTitlesByTemplateSlugs",Object(T.memoize)((function(e){return Object(T.mapValues)(Object(T.keyBy)(e,"slug"),"title")}))),w()(h()(n),"getBlocksByTemplateSlugs",Object(T.memoize)((function(e){return Object(T.reduce)(e,(function(e,t){var r=t.slug,i=t.content;return e[r]=i?Object(x.parse)(M(i,n.props.siteInformation)):[],e}),{})}))),w()(h()(n),"setTemplate",(function(e){Q(n.props.segment.id,n.props.vertical.id,e),n.props.saveTemplateChoice(e);var t=Object(T.find)(n.props.templates,{slug:e,category:"home"}),r=n.getBlocksByTemplateSlug(e),i=t?null:n.getTitleByTemplateSlug(e);r&&r.length?(n.setState({error:null,isLoading:!0}),n.maybePrefetchAssets(r).then((function(e){n.state.isOpen&&(n.props.insertTemplate(i,e),n.setState({isOpen:!1}))})).catch((function(e){n.setState({isLoading:!1,error:e})}))):n.setState({isOpen:!1})})),w()(h()(n),"maybePrefetchAssets",(function(e){return n.props.shouldPrefetchAssets?re(e):Promise.resolve(e)})),w()(h()(n),"handleConfirmation",(function(e){"string"!=typeof e&&(e=n.state.previewedTemplate),n.setTemplate(e),n.props.isPromptedFromSidebar&&n.props.toggleTemplateModal()})),w()(h()(n),"previewTemplate",(function(e){n.setState({previewedTemplate:e}),window.matchMedia("(min-width: 660px)").matches||n.handleConfirmation(e)})),w()(h()(n),"closeModal",(function(e){if(e.target.matches("button.template-selector-item__label"))return!1;z(n.props.segment.id,n.props.vertical.id);var t=Object(T.get)(window,["calypsoifyGutenberg","closeUrl"]);window.top.location=t||"edit.php?post_type=page"})),w()(h()(n),"getTemplateGroups",(function(){return{blankTemplate:Object(T.filter)(n.props.templates,{slug:"blank"}),aboutTemplates:Object(T.filter)(n.props.templates,{category:"about"}),blogTemplates:Object(T.filter)(n.props.templates,{category:"blog"}),contactTemplates:Object(T.filter)(n.props.templates,{category:"contact"}),eventTemplates:Object(T.filter)(n.props.templates,{category:"event"}),menuTemplates:Object(T.filter)(n.props.templates,{category:"menu"}),portfolioTemplates:Object(T.filter)(n.props.templates,{category:"portfolio"}),productTemplates:Object(T.filter)(n.props.templates,{category:"product"}),servicesTemplates:Object(T.filter)(n.props.templates,{category:"services"}),teamTemplates:Object(T.filter)(n.props.templates,{category:"team"}),homepageTemplates:Object(T.sortBy)(Object(T.filter)(n.props.templates,{category:"home"}),"title")}})),w()(h()(n),"renderTemplatesList",(function(e,t){return 0===e.length?null:Object(r.createElement)("fieldset",{className:"page-template-modal__list"},Object(r.createElement)("legend",{className:"page-template-modal__form-title"},t),Object(r.createElement)(L,{label:Object(i.__)("Layout","full-site-editing"),templates:e,blocksByTemplates:n.getBlocksByTemplateSlugs(n.props.templates),onTemplateSelect:n.previewTemplate,useDynamicPreview:!1,siteInformation:n.props.siteInformation,selectedTemplate:n.state.previewedTemplate}))})),n}return y()(t,e),d()(t,[{key:"componentDidMount",value:function(){this.state.isOpen&&R(this.props.segment.id,this.props.vertical.id)}},{key:"componentDidUpdate",value:function(e,t){!t.isOpen&&this.state.isOpen&&R(this.props.segment.id,this.props.vertical.id),(this.props.isWelcomeGuideActive||this.props.areTipsEnabled)&&this.props.hideWelcomeGuide()}},{key:"getBlocksByTemplateSlug",value:function(e){return Object(T.get)(this.getBlocksByTemplateSlugs(this.props.templates),[e],[])}},{key:"getTitleByTemplateSlug",value:function(e){return Object(T.get)(this.getTitlesByTemplateSlugs(this.props.templates),[e],"")}},{key:"render",value:function(){var e=this.state,t=e.previewedTemplate,n=e.isOpen,a=e.isLoading,o=this.props.isPromptedFromSidebar;if(!n)return null;var s=this.getTemplateGroups(),l=s.blankTemplate,c=s.aboutTemplates,p=s.blogTemplates,u=s.contactTemplates,m=s.eventTemplates,d=s.menuTemplates,f=s.portfolioTemplates,b=s.productTemplates,g=s.servicesTemplates,v=s.teamTemplates,O=s.homepageTemplates;return Object(r.createElement)(S.Modal,{title:Object(i.__)("Select Page Layout","full-site-editing"),className:"page-template-modal",overlayClassName:"page-template-modal-screen-overlay",shouldCloseOnClickOutside:!1,isDismissable:!1,isDismissible:!1},o?Object(r.createElement)(S.IconButton,{className:"page-template-modal__close-button components-icon-button",onClick:this.props.toggleTemplateModal,icon:"no-alt",label:Object(i.__)("Close Layout Selector")}):Object(r.createElement)(S.IconButton,{className:"page-template-modal__close-button components-icon-button",onClick:this.closeModal,icon:"arrow-left-alt2",label:Object(i.__)("Go back")}),Object(r.createElement)("div",{className:"page-template-modal__inner"},a?Object(r.createElement)("div",{className:"page-template-modal__loading"},Object(r.createElement)(S.Spinner,null),Object(i.__)("Adding layout…","full-site-editing")):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("form",{className:"page-template-modal__form"},this.props.isFrontPage&&this.renderTemplatesList(O,Object(i.__)("Home Pages","full-site-editing")),this.renderTemplatesList(l,Object(i.__)("Blank","full-site-editing")),this.renderTemplatesList(c,Object(i.__)("About Pages","full-site-editing")),this.renderTemplatesList(p,Object(i.__)("Blog Pages","full-site-editing")),this.renderTemplatesList(u,Object(i.__)("Contact Pages","full-site-editing")),this.renderTemplatesList(m,Object(i.__)("Event Pages","full-site-editing")),this.renderTemplatesList(d,Object(i.__)("Menu Pages","full-site-editing")),this.renderTemplatesList(f,Object(i.__)("Portfolio Pages","full-site-editing")),this.renderTemplatesList(b,Object(i.__)("Product Pages","full-site-editing")),this.renderTemplatesList(g,Object(i.__)("Services Pages","full-site-editing")),this.renderTemplatesList(v,Object(i.__)("Team Pages","full-site-editing")),!this.props.isFrontPage&&this.renderTemplatesList(O,Object(i.__)("Home Pages","full-site-editing"))),Object(r.createElement)(U,{blocks:this.getBlocksByTemplateSlug(t),viewportWidth:960,title:this.getTitleByTemplateSlug(t)}))),Object(r.createElement)("div",{className:P()("page-template-modal__buttons",{"is-visually-hidden":Object(T.isEmpty)(t)||a})},Object(r.createElement)(S.Button,{isPrimary:!0,isLarge:!0,disabled:Object(T.isEmpty)(t)||a,onClick:this.handleConfirmation},Object(i.sprintf)(Object(i.__)("Use %s layout","full-site-editing"),this.getTitleByTemplateSlug(t)))))}}],[{key:"getDerivedStateFromProps",value:function(e,n){return n.previewedTemplate||Object(T.isEmpty)(e.templates)?null:{isOpen:!0,previewedTemplate:t.getDefaultSelectedTemplate(e)}}}]),t}(r.Component);w()(ie,"getDefaultSelectedTemplate",(function(e){var t=Object(T.get)(e.templates,[0,"slug"]),n=e._starter_page_template;if(!e.isFrontPage&&!n)return t;"home"===n&&(n=e.theme);var r=n||e.theme;return Object(T.find)(e.templates,{slug:r})?r:Object(T.find)(e.templates,{slug:"maywood"})?"maywood":t}));var ae,oe=Object(k.compose)(Object(o.withSelect)((function(e){var t=function(){return e("core/editor").getEditedPostAttribute("meta")},n=t();return{getMeta:t,_starter_page_template:n._starter_page_template,postContentBlock:e("core/editor").getBlocks().find((function(e){return"a8c/post-content"===e.name})),isWelcomeGuideActive:e("core/edit-post").isFeatureActive("welcomeGuide"),areTipsEnabled:!!e("core/nux")&&e("core/nux").areTipsEnabled()}})),Object(o.withDispatch)((function(e,t){var n=e("core/editor");return{saveTemplateChoice:function(e){var r=t.getMeta();n.editPost({meta:c()({},r,{_starter_page_template:e})})},insertTemplate:function(r,i){r&&n.editPost({title:r});var a=t.postContentBlock;e("core/block-editor").replaceInnerBlocks(a?a.clientId:"",i,!1)},hideWelcomeGuide:function(){t.isWelcomeGuideActive?e("core/edit-post").toggleFeature("welcomeGuide"):t.areTipsEnabled&&e("core/nux").disableTips()}}})))(ie),se=function(e){function t(){var e,n;u()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=b()(this,(e=v()(t)).call.apply(e,[this].concat(i))),w()(h()(n),"state",{isTemplateModalOpen:!1,isWarningOpen:!1}),w()(h()(n),"toggleTemplateModal",(function(){n.setState({isTemplateModalOpen:!n.state.isTemplateModalOpen})})),w()(h()(n),"toggleWarningModal",(function(){n.setState({isWarningOpen:!n.state.isWarningOpen})})),w()(h()(n),"getLastTemplateUsed",(function(){var e=n.props,t=e.isFrontPage,r=e.templates,i=e.theme,a=n.props.lastTemplateUsedSlug;if(!a&&t&&(a=i),!a||"blank"===a)return r[0];var o=r.find((function(e){return e.slug===a}));return o||r[0]})),n}return y()(t,e),d()(t,[{key:"render",value:function(){var e=this.getLastTemplateUsed(),t=e.slug,n=e.title,a=e.preview,o=e.previewAlt,s=this.props,l=s.isFrontPage,c=s.templates,p=s.theme,u=s.vertical,m=s.segment,d=s.siteInformation;return Object(r.createElement)("div",{className:"sidebar-modal-opener"},Object(r.createElement)(C,{id:"sidebar-modal-opener__last-template-used-preview",value:t,label:M(n,d),staticPreviewImg:a,staticPreviewImgAlt:o,onSelect:this.toggleWarningModal}),Object(r.createElement)(S.Button,{isPrimary:!0,onClick:this.toggleWarningModal,className:"sidebar-modal-opener__button"},Object(i.__)("Change Layout")),this.state.isTemplateModalOpen&&Object(r.createElement)(oe,{shouldPrefetchAssets:!1,templates:c,theme:p,vertical:u,segment:m,toggleTemplateModal:this.toggleTemplateModal,isFrontPage:l,isPromptedFromSidebar:!0}),this.state.isWarningOpen&&Object(r.createElement)(S.Modal,{title:Object(i.__)("Overwrite Page Content?"),isDismissible:!1,onRequestClose:this.toggleWarningModal,className:"sidebar-modal-opener__warning-modal"},Object(r.createElement)("div",{className:"sidebar-modal-opener__warning-text"},Object(i.__)("Changing the page's layout will remove any customizations or edits you have already made.")),Object(r.createElement)("div",{className:"sidebar-modal-opener__warning-options"},Object(r.createElement)(S.Button,{isDefault:!0,onClick:this.toggleWarningModal},Object(i.__)("Cancel")),Object(r.createElement)(S.Button,{isPrimary:!0,onClick:this.toggleTemplateModal},Object(i.__)("Change Layout")))))}}]),t}(r.Component),le=Object(k.compose)(Object(o.withSelect)((function(e){return{lastTemplateUsedSlug:e("core/editor").getEditedPostAttribute("meta")._starter_page_template}})))(se),ce=window.starterPageTemplatesConfig,pe=ce.templates,ue=void 0===pe?[]:pe,me=ce.vertical,de=ce.segment,fe=ce.tracksUserData,be=ce.siteInformation,ge=void 0===be?{}:be,ve=ce.screenAction,Oe=ce.theme,he=ce.isFrontPage;fe&&(q=ae=fe,window._tkq.push(["identifyUser",ae.userid,ae.username])),"add"===ve&&Object(a.registerPlugin)("page-templates",{render:function(){return Object(r.createElement)(oe,{isFrontPage:he,segment:de,shouldPrefetchAssets:!1,templates:ue,theme:Oe,vertical:me})}}),Object(a.registerPlugin)("page-templates-sidebar",{render:function(){return Object(r.createElement)(s.PluginDocumentSettingPanel,{name:"Template Modal Opener",title:Object(i.__)("Page Layout"),className:"page-template-modal__sidebar",icon:"none"},Object(r.createElement)(le,{isFrontPage:he,segment:de,siteInformation:ge,templates:ue,theme:Oe,vertical:me}))}});var je=Object(o.subscribe)((function(){Object(o.select)("core/edit-post").isEditorPanelOpened("page-templates-sidebar/Template Modal Opener")||Object(o.dispatch)("core/edit-post").toggleEditorPanelOpened("page-templates-sidebar/Template Modal Opener"),je()}))}]));
 
 
 
 
1
+ !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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=34)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.i18n}()},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.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t,n){var r;
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 i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var a=i.apply(null,r);a&&e.push(a)}else if("object"===o)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(3);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t,n){var r=n(24),i=n(25),o=n(26);e.exports=function(e){return r(e)||i(e)||o()}},function(e,t){!function(){e.exports=this.wp.blocks}()},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){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(27),i=n(4);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(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 r=n(28);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&&r(e,t)}},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t,n){var r=n(31),i=n(32),o=n(33);e.exports=function(e,t){return r(e)||i(e,t)||o()}},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){function n(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,l,"next",e)}function l(e){n(a,i,o,s,l,"throw",e)}s(void 0)}))}}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.url}()},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,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){!function(){e.exports=this.wp.nux}()},function(e,t,n){},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n(2),o=n(17),a=n(6),s=n(21),l=n(9),c=n.n(l),u=n(10),p=n.n(u),m=n(12),d=n.n(m),f=n(13),b=n.n(f),g=n(14),v=n.n(g),O=n(15),h=n.n(O),j=n(4),y=n.n(j),_=n(16),w=n.n(_),T=n(3),k=n.n(T),P=n(1),E=n(8),S=n.n(E),x=(n(29),n(7)),B=n(5),N=n(11),C=(n(30),n(18)),A=n.n(C),I=n(19),L=function(e){var t=e.blocks,n=e.settings,i=e.recomputeBlockListKey;return Object(r.createElement)(I.BlockEditorProvider,{value:t,settings:n},Object(r.createElement)(B.Disabled,{key:i},Object(r.createElement)(I.BlockList,null)))},M=Object(x.compose)(x.withSafeTimeout,Object(a.withSelect)((function(e){var t=e("core/block-editor");return{settings:t?t.getSettings():{}}})))((function(e){var t=e.className,n=void 0===t?"block-iframe-preview":t,o=e.bodyClassName,a=void 0===o?"block-iframe-preview-body":o,s=e.viewportWidth,l=e.blocks,c=e.settings,u=e.setTimeout,p=void 0===u?P.noop:u,m=Object(r.useRef)(),d=Object(r.useRef)(),f=Object(r.useRef)(),b=Object(r.useState)({transform:"scale( 1 )"}),g=A()(b,2),v=g[0],O=g[1],h=Object(r.useMemo)((function(){return Object(P.castArray)(l)}),[l]),j=Object(r.useReducer)((function(e){return e+1}),0),y=A()(j,2),_=y[0],w=y[1];Object(r.useLayoutEffect)(w,[l]);var T=Object(r.useCallback)((function(){var e=Object(P.get)(m,["current","parentNode"]);if(e){var t=s||m.current.offsetWidth,n=e.offsetWidth/s,r=e.offsetHeight/n;O({width:t,height:r,transform:"scale( ".concat(n," )")})}}),[s]);return Object(r.useEffect)((function(){p((function(){var e,t,n,r;e=window.document,t=f.current.contentDocument,n=["link","style"],r={head:new DocumentFragment,body:new DocumentFragment},Object(P.each)(Object.keys(r),(function(t){return Object(P.each)(Object(P.filter)(e[t].children,(function(e){var t=e.localName;return(n.includes(t))})),(function(e){r[t].appendChild(e.cloneNode(!0))}))})),t.head.appendChild(r.head),t.body.appendChild(r.body),f.current.contentDocument.body.classList.add(a),f.current.contentDocument.body.classList.add("editor-styles-wrapper"),T()}),0)}),[p,a,T]),Object(r.useEffect)((function(){var e=Object(P.get)(f,["current","contentDocument","body"]);e&&(e.scrollTop=0)}),[_]),Object(r.useEffect)((function(){var e=d&&d.current;e&&f.current.contentDocument.body.appendChild(e)}),[_]),Object(r.useEffect)((function(){var e=Object(P.debounce)(T,300);return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[T]),Object(r.useEffect)((function(){return window.jQuery&&window.jQuery(window.document).on("wp-collapse-menu",T),function(){window.jQuery&&window.jQuery(window.document).off("wp-collapse-menu",T)}}),[T]),Object(r.createElement)("div",{ref:m},Object(r.createElement)("iframe",{ref:f,title:Object(i.__)("Preview"),className:S()("editor-styles-wrapper",n),style:v}),Object(r.createElement)("div",{ref:d,className:"block-editor",id:"rendered-blocks"},Object(r.createElement)("div",{className:"edit-post-visual-editor"},Object(r.createElement)("div",{className:"editor-styles-wrapper"},Object(r.createElement)("div",{className:"editor-writing-flow"},l&&l.length?Object(r.createElement)(L,{blocks:h,settings:c,recomputeBlockListKey:_}):null)))))})),D=function(e){var t=e.id,n=e.value,i=e.onSelect,o=e.label,a=e.useDynamicPreview,s=void 0!==a&&a,l=e.staticPreviewImg,c=e.staticPreviewImgAlt,u=void 0===c?"":c,p=e.blocks,m=void 0===p?[]:p,d=e.isSelected;if(Object(P.isNil)(t)||Object(P.isNil)(o)||Object(P.isNil)(n))return null;if(s&&(Object(P.isNil)(m)||Object(P.isEmpty)(m)))return null;var f=s?Object(r.createElement)(B.Disabled,null,Object(r.createElement)(M,{blocks:m,viewportWidth:960})):Object(r.createElement)("img",{className:"template-selector-item__media",src:l,alt:u}),b="label-".concat(t,"-").concat(n);return Object(r.createElement)("button",{type:"button",className:S()("template-selector-item__label",{"is-selected":d}),value:n,onClick:function(){i(n)},"aria-labelledby":"".concat(t," ").concat(b)},Object(r.createElement)("span",{className:"template-selector-item__preview-wrap"},f))},F={Address:Object(i._x)("123 Main St","default address","full-site-editing"),Phone:Object(i._x)("555-555-5555","default phone number","full-site-editing"),CompanyName:Object(i._x)("Your Company Name","default company name","full-site-editing"),Vertical:Object(i._x)("Business","default vertical name","full-site-editing")},W={CompanyName:"title",Address:"address",Phone:"phone",Vertical:"vertical"},G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e.replace(/{{(\w+)}}/g,(function(e,n){var r=F[n];return t[W[n]]||r||n})):""},U=Object(x.compose)(r.memo,x.withInstanceId)((function(e){var t=e.label,n=e.className,i=e.help,o=e.instanceId,a=e.templates,s=void 0===a?[]:a,l=e.blocksByTemplates,c=void 0===l?{}:l,u=e.useDynamicPreview,p=void 0!==u&&u,m=e.onTemplateSelect,d=void 0===m?P.noop:m,f=e.siteInformation,b=void 0===f?{}:f,g=e.selectedTemplate;if(Object(P.isEmpty)(s)||!Object(P.isArray)(s))return null;if(!0===p&&Object(P.isEmpty)(c))return null;var v="template-selector-control-".concat(o);return Object(r.createElement)(B.BaseControl,{label:t,id:v,help:i,className:S()(n,"template-selector-control")},Object(r.createElement)("ul",{className:"template-selector-control__options","data-testid":"template-selector-control-options"},Object(P.map)(s,(function(e){var t=e.slug,n=e.title,o=e.preview,a=e.previewAlt;return Object(r.createElement)("li",{key:"".concat(v,"-").concat(t),className:"template-selector-control__template"},Object(r.createElement)(D,{id:v,value:t,label:G(n,b),help:i,onSelect:d,staticPreviewImg:o,staticPreviewImgAlt:a,blocks:c.hasOwnProperty(t)?c[t]:[],useDynamicPreview:p,isSelected:t===g}))}))))})),R=function(e){var t=e.blocks,n=void 0===t?[]:t,o=e.viewportWidth,a=!n.length;return Object(r.createElement)("div",{className:"template-selector-preview ".concat(a?"not-selected":"")},a&&Object(r.createElement)("div",{className:"editor-styles-wrapper"},Object(r.createElement)("div",{className:"template-selector-preview__empty-state"},Object(i.__)("Select a layout to preview.","full-site-editing"))),Object(r.createElement)(M,{blocks:n,viewportWidth:o}))};window._tkq=window._tkq||[];var q=null,z=function(e,t){q&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_view",{blog_id:q.blogid,segment_id:e,vertical_id:t}])},Q=function(e,t){q&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_dismiss",{blog_id:q.blogid,segment_id:e,vertical_id:t}])},H=function(e,t,n){q&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_template_selected",{blog_id:q.blogid,segment_id:e,vertical_id:t,template:n}])},V=n(20),K=n.n(V),Y=n(22),J=n.n(Y),X=n(23),Z=function(e,t,n){var r=e[t=Object(X.removeQueryArgs)(t,"w","s")]||{url:t,usages:[]};return c()({},e,k()({},t,c()({},r,{usages:[].concat(p()(r.usages),p()(n))})))},$=function e(t,n){switch(t.blocksByClientId[n.clientId]=n,n.name){case"core/cover":case"core/image":var r=n.attributes.url;r&&(t.assets=Z(t.assets,r,[{prop:"url",path:[n.clientId,"attributes","url"]},{prop:"id",path:[n.clientId,"attributes","id"]}]));case"core/media-text":var i=n.attributes.mediaUrl;i&&"image"===n.attributes.mediaType&&(t.assets=Z(t.assets,i,[{prop:"url",path:[n.clientId,"attributes","mediaUrl"]},{prop:"id",path:[n.clientId,"attributes","mediaId"]}]));case"core/gallery":Object(P.forEach)(n.attributes.images,(function(e,r){t.assets=Z(t.assets,e.url,[{prop:"url",path:[n.clientId,"attributes","images",r,"url"]},{prop:"url",path:[n.clientId,"attributes","images",r,"link"]},{prop:"id",path:[n.clientId,"attributes","images",r,"id"]},{prop:"id",path:[n.clientId,"attributes","ids",r]}])}))}return Object(P.isEmpty)(n.innerBlocks)?t:Object(P.reduce)(n.innerBlocks,e,t)},ee=function(){var e=K()(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J()({method:"POST",path:"/fse/v1/sideload/image/batch",data:{resources:Object(P.map)(t)}}).then((function(e){return Object(P.reduce)(t,(function(t,n){var r=e.shift(),i=r.id,o=r.source_url;return c()({},t,k()({},n.url,{id:i,url:o}))}),{})}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),te=function(e,t){return Object(P.forEach)(e.assets,(function(n){var r=t[n.url];r&&Object(P.forEach)(n.usages,(function(t){Object(P.set)(e.blocksByClientId,t.path,r[t.prop])}))})),e.blocks},ne=function(){var e=K()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Object(P.reduce)(t,$,{assets:{},blocksByClientId:{},blocks:t}),!Object(P.isEmpty)(n.assets)){e.next=3;break}return e.abrupt("return",t);case 3:return e.abrupt("return",ee(n.assets).then((function(e){return te(n,e)})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var re=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P.identity;return t.map((function(t){return(t=n(Object(N.cloneBlock)(t))).innerBlocks&&t.innerBlocks.length&&(t.innerBlocks=e(t.innerBlocks,n)),t}))},ie=function(e){function t(){var e,n;d()(this,t);for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=v()(this,(e=h()(t)).call.apply(e,[this].concat(a))),k()(y()(n),"state",{isLoading:!1,previewedTemplate:null,error:null,isOpen:!1}),k()(y()(n),"getTitlesByTemplateSlugs",Object(P.memoize)((function(e){return Object(P.mapValues)(Object(P.keyBy)(e,"slug"),"title")}))),k()(y()(n),"getBlocksByTemplateSlugs",Object(P.memoize)((function(e){return Object(P.reduce)(e,(function(e,t){var r=t.slug,i=t.content,o=t.title;return e[r]=i?[Object(N.createBlock)("core/heading",{content:o,align:"center",level:1})].concat(p()(Object(N.parse)(G(i,n.props.siteInformation)))):[],e}),{})}))),k()(y()(n),"getBlocksForPreview",Object(P.memoize)((function(e){var t=n.getBlocksByTemplateSlug(e);return re(t,(function(e){return"jetpack/contact-form"===e.name&&void 0!==e.attributes.hasFormSettingsSet&&(e.attributes.hasFormSettingsSet=!0),e}))}))),k()(y()(n),"getBlocksForSelection",(function(e){var t=n.getBlocksByTemplateSlug(e);return re(t,(function(e){return"core/button"===e.name&&void 0!==e.attributes.url&&(e.attributes.url="#"),e}))})),k()(y()(n),"setTemplate",(function(e){if(H(n.props.segment.id,n.props.vertical.id,e),n.props.saveTemplateChoice(e),"blank"===e)return n.props.insertTemplate("",[]),void n.setState({isOpen:!1});var t=Object(P.find)(n.props.templates,{slug:e,category:"home"}),r=n.getBlocksForSelection(e);r.shift();var i=t?null:n.getTitleByTemplateSlug(e);r&&r.length?(n.setState({error:null,isLoading:!0}),n.maybePrefetchAssets(r).then((function(e){n.state.isOpen&&(n.props.insertTemplate(i,e),n.setState({isOpen:!1}))})).catch((function(e){n.setState({isLoading:!1,error:e})}))):n.setState({isOpen:!1})})),k()(y()(n),"maybePrefetchAssets",(function(e){return n.props.shouldPrefetchAssets?ne(e):Promise.resolve(e)})),k()(y()(n),"handleConfirmation",(function(e){"string"!=typeof e&&(e=n.state.previewedTemplate),n.setTemplate(e),n.props.isPromptedFromSidebar&&n.props.toggleTemplateModal()})),k()(y()(n),"previewTemplate",(function(e){n.setState({previewedTemplate:e}),window.matchMedia("(min-width: 660px)").matches||n.handleConfirmation(e)})),k()(y()(n),"closeModal",(function(e){if(e.target.matches("button.template-selector-item__label"))return!1;Q(n.props.segment.id,n.props.vertical.id);var t=Object(P.get)(window,["calypsoifyGutenberg","closeUrl"]);window.top.location=t||"edit.php?post_type=page"})),k()(y()(n),"getTemplateGroups",(function(){return{blankTemplate:Object(P.filter)(n.props.templates,{slug:"blank"}),aboutTemplates:Object(P.filter)(n.props.templates,{category:"about"}),blogTemplates:Object(P.filter)(n.props.templates,{category:"blog"}),contactTemplates:Object(P.filter)(n.props.templates,{category:"contact"}),eventTemplates:Object(P.filter)(n.props.templates,{category:"event"}),menuTemplates:Object(P.filter)(n.props.templates,{category:"menu"}),portfolioTemplates:Object(P.filter)(n.props.templates,{category:"portfolio"}),productTemplates:Object(P.filter)(n.props.templates,{category:"product"}),servicesTemplates:Object(P.filter)(n.props.templates,{category:"services"}),teamTemplates:Object(P.filter)(n.props.templates,{category:"team"}),homepageTemplates:Object(P.sortBy)(Object(P.filter)(n.props.templates,{category:"home"}),"title")}})),k()(y()(n),"renderTemplatesList",(function(e,t){return 0===e.length?null:Object(r.createElement)("fieldset",{className:"page-template-modal__list"},Object(r.createElement)("legend",{className:"page-template-modal__form-title"},t),Object(r.createElement)(U,{label:Object(i.__)("Layout","full-site-editing"),templates:e,blocksByTemplates:n.getBlocksByTemplateSlugs(n.props.templates),onTemplateSelect:n.previewTemplate,useDynamicPreview:!1,siteInformation:n.props.siteInformation,selectedTemplate:n.state.previewedTemplate}))})),n}return w()(t,e),b()(t,[{key:"componentDidMount",value:function(){this.state.isOpen&&z(this.props.segment.id,this.props.vertical.id)}},{key:"componentDidUpdate",value:function(e,t){!t.isOpen&&this.state.isOpen&&z(this.props.segment.id,this.props.vertical.id),(this.props.isWelcomeGuideActive||this.props.areTipsEnabled)&&this.props.hideWelcomeGuide()}},{key:"getBlocksByTemplateSlug",value:function(e){return Object(P.get)(this.getBlocksByTemplateSlugs(this.props.templates),[e],[])}},{key:"getTitleByTemplateSlug",value:function(e){return Object(P.get)(this.getTitlesByTemplateSlugs(this.props.templates),[e],"")}},{key:"render",value:function(){var e=this.state,t=e.previewedTemplate,n=e.isOpen,o=e.isLoading,a=this.props.isPromptedFromSidebar;if(!n)return null;var s=this.getTemplateGroups(),l=s.blankTemplate,c=s.aboutTemplates,u=s.blogTemplates,p=s.contactTemplates,m=s.eventTemplates,d=s.menuTemplates,f=s.portfolioTemplates,b=s.productTemplates,g=s.servicesTemplates,v=s.teamTemplates,O=s.homepageTemplates;return Object(r.createElement)(B.Modal,{title:Object(i.__)("Select Page Layout","full-site-editing"),className:"page-template-modal",overlayClassName:"page-template-modal-screen-overlay",shouldCloseOnClickOutside:!1,isDismissable:!1,isDismissible:!1},a?Object(r.createElement)(B.IconButton,{className:"page-template-modal__close-button components-icon-button",onClick:this.props.toggleTemplateModal,icon:"no-alt",label:Object(i.__)("Close Layout Selector")}):Object(r.createElement)(B.IconButton,{className:"page-template-modal__close-button components-icon-button",onClick:this.closeModal,icon:"arrow-left-alt2",label:Object(i.__)("Go back")}),Object(r.createElement)("div",{className:"page-template-modal__inner"},o?Object(r.createElement)("div",{className:"page-template-modal__loading"},Object(r.createElement)(B.Spinner,null),Object(i.__)("Adding layout…","full-site-editing")):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("form",{className:"page-template-modal__form"},this.props.isFrontPage&&this.renderTemplatesList(O,Object(i.__)("Home Pages","full-site-editing")),this.renderTemplatesList(l,Object(i.__)("Blank","full-site-editing")),this.renderTemplatesList(c,Object(i.__)("About Pages","full-site-editing")),this.renderTemplatesList(u,Object(i.__)("Blog Pages","full-site-editing")),this.renderTemplatesList(p,Object(i.__)("Contact Pages","full-site-editing")),this.renderTemplatesList(m,Object(i.__)("Event Pages","full-site-editing")),this.renderTemplatesList(d,Object(i.__)("Menu Pages","full-site-editing")),this.renderTemplatesList(f,Object(i.__)("Portfolio Pages","full-site-editing")),this.renderTemplatesList(b,Object(i.__)("Product Pages","full-site-editing")),this.renderTemplatesList(g,Object(i.__)("Services Pages","full-site-editing")),this.renderTemplatesList(v,Object(i.__)("Team Pages","full-site-editing")),!this.props.isFrontPage&&this.renderTemplatesList(O,Object(i.__)("Home Pages","full-site-editing"))),Object(r.createElement)(R,{blocks:this.getBlocksForPreview(t),viewportWidth:1200,title:this.getTitleByTemplateSlug(t)}))),Object(r.createElement)("div",{className:S()("page-template-modal__buttons",{"is-visually-hidden":Object(P.isEmpty)(t)||o})},Object(r.createElement)(B.Button,{isPrimary:!0,isLarge:!0,disabled:Object(P.isEmpty)(t)||o,onClick:this.handleConfirmation},Object(i.sprintf)(Object(i.__)("Use %s layout","full-site-editing"),this.getTitleByTemplateSlug(t)))))}}],[{key:"getDerivedStateFromProps",value:function(e,n){return n.previewedTemplate||Object(P.isEmpty)(e.templates)?null:{isOpen:!0,previewedTemplate:t.getDefaultSelectedTemplate(e)}}}]),t}(r.Component);k()(ie,"getDefaultSelectedTemplate",(function(e){var t=Object(P.get)(e.templates,[0,"slug"]),n=e._starter_page_template;if(!e.isFrontPage&&!n)return t;"home"===n&&(n=e.theme);var r=n||e.theme;return Object(P.find)(e.templates,{slug:r})?r:Object(P.find)(e.templates,{slug:"maywood"})?"maywood":t}));var oe,ae=Object(x.compose)(Object(a.withSelect)((function(e){var t=function(){return e("core/editor").getEditedPostAttribute("meta")},n=t();return{getMeta:t,_starter_page_template:n._starter_page_template,postContentBlock:e("core/editor").getBlocks().find((function(e){return"a8c/post-content"===e.name})),isWelcomeGuideActive:e("core/edit-post").isFeatureActive("welcomeGuide"),areTipsEnabled:!!e("core/nux")&&e("core/nux").areTipsEnabled()}})),Object(a.withDispatch)((function(e,t){var n=e("core/editor");return{saveTemplateChoice:function(e){var r=t.getMeta();n.editPost({meta:c()({},r,{_starter_page_template:e})})},insertTemplate:function(r,i){r&&n.editPost({title:r});var o=t.postContentBlock;e("core/block-editor").replaceInnerBlocks(o?o.clientId:"",i,!1)},hideWelcomeGuide:function(){t.isWelcomeGuideActive?e("core/edit-post").toggleFeature("welcomeGuide"):t.areTipsEnabled&&e("core/nux").disableTips()}}})))(ie),se=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=v()(this,(e=h()(t)).call.apply(e,[this].concat(i))),k()(y()(n),"state",{isTemplateModalOpen:!1,isWarningOpen:!1}),k()(y()(n),"toggleTemplateModal",(function(){n.setState({isTemplateModalOpen:!n.state.isTemplateModalOpen})})),k()(y()(n),"toggleWarningModal",(function(){n.setState({isWarningOpen:!n.state.isWarningOpen})})),k()(y()(n),"getLastTemplateUsed",(function(){var e=n.props,t=e.isFrontPage,r=e.templates,i=e.theme,o=n.props.lastTemplateUsedSlug;if(!o&&t&&(o=i),!o||"blank"===o)return r[0];var a=r.find((function(e){return e.slug===o}));return a||r[0]})),n}return w()(t,e),b()(t,[{key:"render",value:function(){var e=this.getLastTemplateUsed(),t=e.slug,n=e.title,o=e.preview,a=e.previewAlt,s=this.props,l=s.isFrontPage,c=s.templates,u=s.theme,p=s.vertical,m=s.segment,d=s.siteInformation;return Object(r.createElement)("div",{className:"sidebar-modal-opener"},Object(r.createElement)(D,{id:"sidebar-modal-opener__last-template-used-preview",value:t,label:G(n,d),staticPreviewImg:o,staticPreviewImgAlt:a,onSelect:this.toggleWarningModal}),Object(r.createElement)(B.Button,{isPrimary:!0,onClick:this.toggleWarningModal,className:"sidebar-modal-opener__button"},Object(i.__)("Change Layout")),this.state.isTemplateModalOpen&&Object(r.createElement)(ae,{shouldPrefetchAssets:!1,templates:c,theme:u,vertical:p,segment:m,toggleTemplateModal:this.toggleTemplateModal,isFrontPage:l,isPromptedFromSidebar:!0}),this.state.isWarningOpen&&Object(r.createElement)(B.Modal,{title:Object(i.__)("Overwrite Page Content?"),isDismissible:!1,onRequestClose:this.toggleWarningModal,className:"sidebar-modal-opener__warning-modal"},Object(r.createElement)("div",{className:"sidebar-modal-opener__warning-text"},Object(i.__)("Changing the page's layout will remove any customizations or edits you have already made.")),Object(r.createElement)("div",{className:"sidebar-modal-opener__warning-options"},Object(r.createElement)(B.Button,{isDefault:!0,onClick:this.toggleWarningModal},Object(i.__)("Cancel")),Object(r.createElement)(B.Button,{isPrimary:!0,onClick:this.toggleTemplateModal},Object(i.__)("Change Layout")))))}}]),t}(r.Component),le=Object(x.compose)(Object(a.withSelect)((function(e){return{lastTemplateUsedSlug:e("core/editor").getEditedPostAttribute("meta")._starter_page_template}})))(se),ce=window.starterPageTemplatesConfig,ue=ce.templates,pe=void 0===ue?[]:ue,me=ce.vertical,de=ce.segment,fe=ce.tracksUserData,be=ce.siteInformation,ge=void 0===be?{}:be,ve=ce.screenAction,Oe=ce.theme,he=ce.isFrontPage;fe&&(q=oe=fe,window._tkq.push(["identifyUser",oe.userid,oe.username])),"add"===ve&&Object(o.registerPlugin)("page-templates",{render:function(){return Object(r.createElement)(ae,{isFrontPage:he,segment:de,shouldPrefetchAssets:!1,templates:pe,theme:Oe,vertical:me})}}),Object(o.registerPlugin)("page-templates-sidebar",{render:function(){return Object(r.createElement)(s.PluginDocumentSettingPanel,{name:"Template Modal Opener",title:Object(i.__)("Page Layout"),className:"page-template-modal__sidebar",icon:"none"},Object(r.createElement)(le,{isFrontPage:he,segment:de,siteInformation:ge,templates:pe,theme:Oe,vertical:me}))}});var je=Object(a.subscribe)((function(){Object(a.select)("core/edit-post").isEditorPanelOpened("page-templates-sidebar/Template Modal Opener")||Object(a.dispatch)("core/edit-post").toggleEditorPanelOpened("page-templates-sidebar/Template Modal Opener"),je()}))}]));
starter-page-templates/dist/starter-page-templates.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
- */
 
 
 
 
 
starter-page-templates/dist/starter-page-templates.rtl.css CHANGED
@@ -1 +1 @@
1
- .page-template-modal-screen-overlay{animation:none;background-color:transparent;z-index:99}@media screen and (min-width:783px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{right:36px}}@media screen and (min-width:961px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{right:160px}}@media screen and (min-width:783px){body:not(.is-fullscreen-mode).folded .page-template-modal-screen-overlay{right:36px}body:not(.is-fullscreen-mode):not(.folded):not(.auto-fold) .page-template-modal-screen-overlay{right:160px}}body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:46px}@media screen and (min-width:783px){body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:32px}}.page-template-modal{width:100%;height:100vh;animation:none;box-shadow:none;border:none;top:0;right:0;left:0;bottom:0;transform:none;max-width:none;max-height:none;background-color:#eee}.page-template-modal .components-modal__header-heading-container{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__close-button{display:block;position:absolute;z-index:20;top:9px;width:36px;height:36px;right:10px}.page-template-modal .components-modal__header:after{display:block;position:absolute;content:" ";border-left:1px solid #e2e4e7;height:100%;right:56px}.page-template-modal .components-modal__content{overflow-y:scroll;-webkit-overflow-scrolling:touch}.page-template-modal__inner{position:relative;margin:0 auto;padding:0 20px 40px}.page-template-modal__list{margin-bottom:20px}.page-template-modal__list .components-base-control__label{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.template-selector-control__options{display:grid;grid-template-columns:1fr;grid-gap:.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}}.template-selector-item__label{display:block;width:100%;font-size:14px;text-align:center;border:2px solid #e2e4e7;border-radius:6px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;overflow:hidden;background-color:#fff;position:relative;transform:translateZ(0)}.template-selector-item__label .template-selector-item__template-title{width:100%;position:absolute;bottom:0;right:0;height:40px;line-height:40px;background-color:#fff}.template-selector-item__label:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;outline:2px solid transparent}.template-selector-item__label:hover{border:2px solid #c9c9ca}.template-selector-item__label.is-selected{border:2px solid #555d66;outline:2px solid transparent;outline-offset:-2px}.template-selector-item__label.is-selected:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;border:2px solid #555d66;outline:4px solid transparent;outline-offset:-4px}.template-selector-item__preview-wrap{width:100%;display:block;margin:0 auto;background:#fff;border-radius:0;overflow:hidden;height:0;padding-top:120%;box-sizing:content-box;position:relative;pointer-events:none;opacity:1;transform:translateZ(0)}@media screen and (min-width:660px){.template-selector-item__preview-wrap{padding-top:100%}}.template-selector-item__preview-wrap.is-rendering{opacity:.5}.template-selector-item__preview-wrap .block-editor-block-list__block,.template-selector-item__preview-wrap .block-editor-block-list__layout{padding:inherit}.template-selector-item__media{width:100%;display:block;position:absolute;top:0;right:0}@media screen and (min-width:660px){.page-template-modal__form{max-width:20%}}@media screen and (min-width:783px){.page-template-modal__form{max-width:30%}}.page-template-modal__form-title{font-weight:700;margin-bottom:1em;text-align:center}@media screen and (min-width:660px){.page-template-modal__form-title{text-align:right}}.page-template-modal__buttons{position:absolute;left:0;top:0;z-index:10;height:56px;display:flex;align-items:center;padding-left:24px}@media screen and (min-width:660px){.page-template-modal__buttons{display:flex}}.page-template-modal__buttons.is-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__buttons .components-button{height:33px;line-height:32px}.template-selector-preview{display:none;position:fixed;top:157px;bottom:24px;right:calc(20% + 48px);left:24px;background:#fff;border-radius:2px;overflow-x:hidden;overflow-y:auto;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}@media screen and (min-width:660px){.template-selector-preview{display:block}.template-selector-preview.is-blank-preview{align-items:center;display:flex;justify-content:center}}@media screen and (min-width:783px){.template-selector-preview{top:143px;right:calc(30% + 72px)}body:not(.auto-fold):not(.folded) .template-selector-preview{right:calc(30% + 172px)}}@media screen and (min-width:961px){.template-selector-preview{right:calc(30% + 172px)}body.folded .template-selector-preview{right:calc(30% + 72px)}}body.is-fullscreen-mode .template-selector-preview{top:111px}@media screen and (min-width:783px){body.is-fullscreen-mode .template-selector-preview{right:calc(30% + 48px)!important}}.template-selector-preview .edit-post-visual-editor{margin:0;padding:0}.template-selector-preview .editor-styles-wrapper .template-selector-preview__offset-correction{position:relative;top:120px}.template-selector-preview .editor-styles-wrapper .editor-post-title{transform-origin:top center;width:100%;display:block;position:absolute;top:0}.template-selector-preview .editor-styles-wrapper .editor-post-title,.template-selector-preview .editor-styles-wrapper .editor-post-title__block,.template-selector-preview .editor-styles-wrapper .editor-post-title__input{padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0}.template-selector-preview .editor-styles-wrapper .editor-post-title .editor-post-title__input,.template-selector-preview .editor-styles-wrapper .editor-post-title__block .editor-post-title__input,.template-selector-preview .editor-styles-wrapper .editor-post-title__input .editor-post-title__input{margin:0;padding:0;height:120px;line-height:120px;overflow:hidden;resize:none}.template-selector-preview__placeholder{color:var(--color-text-subtle);font-size:15px;font-weight:400}.block-editor-block-preview__container.editor-styles-wrapper .wp-block{width:100%}.block-editor-block-preview__container.editor-styles-wrapper .wp-block[data-type="core/cover"][data-align=full]{margin:0}.block-editor-block-preview__container.editor-styles-wrapper .wp-block[data-type="core/cover"][data-align=full] .wp-block-cover{padding:0}.block-editor-block-preview__container.editor-styles-wrapper .wp-block-columns>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="core/column"]>.block-editor-block-list__block-edit>div>.block-core-columns>.block-editor-inner-blocks{margin-top:0;margin-bottom:0}.block-editor-block-preview__container.editor-styles-wrapper .block-editor-block-list__block[data-align=full]{margin:0}@media screen and (min-width:600px){.block-editor-block-preview__container.editor-styles-wrapper .block-editor-block-list__block .block-editor-block-list__block-edit{margin:0}}.template-selector-item__preview-wrap .components-disabled,.template-selector-item__preview-wrap .components-disabled .editor-styles-wrapper,.template-selector-item__preview-wrap .edit-post-visual-editor,.template-selector-item__preview-wrap .edit-post-visual-editor .editor-styles-wrapper,.template-selector-preview .components-disabled,.template-selector-preview .components-disabled .editor-styles-wrapper,.template-selector-preview .edit-post-visual-editor,.template-selector-preview .edit-post-visual-editor .editor-styles-wrapper{height:100%}.page-template-modal__loading{position:absolute;top:50%;right:50%;transform:translate(50%,-50%);display:flex;align-items:flex-end}.page-template-modal__loading .components-spinner{float:none}.sidebar-modal-opener{display:flex;flex-direction:column;align-items:center;justify-content:center}.sidebar-modal-opener .template-selector-item__label{max-width:300px}.sidebar-modal-opener .template-selector-item__template-title{font-size:1.2rem}.sidebar-modal-opener__button{margin-top:20px}.sidebar-modal-opener__warning-modal{display:flex;flex-direction:column;justify-content:center;align-items:center}.sidebar-modal-opener__warning-text{max-width:300px;font-size:1rem;line-height:1.5rem}.sidebar-modal-opener__warning-options{display:flex;justify-content:space-around;margin-top:20px}
1
+ .page-template-modal-screen-overlay{animation:none;background-color:transparent;z-index:99}@media screen and (min-width:783px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{right:36px}}@media screen and (min-width:961px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{right:160px}}@media screen and (min-width:783px){body:not(.is-fullscreen-mode).folded .page-template-modal-screen-overlay{right:36px}body:not(.is-fullscreen-mode):not(.folded):not(.auto-fold) .page-template-modal-screen-overlay{right:160px}}body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:46px}@media screen and (min-width:783px){body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:32px}}.page-template-modal{width:100%;height:100vh;animation:none;box-shadow:none;border:none;top:0;right:0;left:0;bottom:0;transform:none;max-width:none;max-height:none;background-color:#eee}.page-template-modal .components-modal__header-heading-container{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__close-button{display:block;position:absolute;z-index:20;top:9px;width:36px;height:36px;right:10px}.page-template-modal .components-modal__header:after{display:block;position:absolute;content:" ";border-left:1px solid #e2e4e7;height:100%;right:56px}.page-template-modal .components-modal__content{overflow-y:scroll;-webkit-overflow-scrolling:touch}.page-template-modal__inner{position:relative;margin:0 auto;padding:0 20px 40px}.page-template-modal__list{margin-bottom:20px}.page-template-modal__list .components-base-control__label{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.template-selector-control__options{display:grid;grid-template-columns:1fr;grid-gap:.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}}.template-selector-item__label{display:block;width:100%;font-size:14px;text-align:center;border:2px solid #e2e4e7;border-radius:6px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;overflow:hidden;background-color:#fff;position:relative;transform:translateZ(0)}.template-selector-item__label:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;outline:2px solid transparent}.template-selector-item__label:hover{border:2px solid #c9c9ca}.template-selector-item__label.is-selected{border:2px solid #555d66;outline:2px solid transparent;outline-offset:-2px}.template-selector-item__label.is-selected:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;border:2px solid #555d66;outline:4px solid transparent;outline-offset:-4px}.template-selector-item__preview-wrap{width:100%;display:block;margin:0 auto;background:#fff;border-radius:0;overflow:hidden;height:0;padding-top:120%;box-sizing:content-box;position:relative;pointer-events:none;opacity:1;transform:translateZ(0)}@media screen and (min-width:660px){.template-selector-item__preview-wrap{padding-top:100%}}.template-selector-item__preview-wrap.is-rendering{opacity:.5}.template-selector-item__media{width:100%;display:block;position:absolute;top:0;right:0}@media screen and (min-width:660px){.page-template-modal__form{max-width:20%}}@media screen and (min-width:783px){.page-template-modal__form{max-width:30%}}.page-template-modal__form-title{font-weight:700;margin-bottom:1em;text-align:center}@media screen and (min-width:660px){.page-template-modal__form-title{text-align:right}}.page-template-modal__buttons{position:absolute;left:0;top:0;z-index:10;height:56px;display:flex;align-items:center;padding-left:24px}@media screen and (min-width:660px){.page-template-modal__buttons{display:flex}}.page-template-modal__buttons.is-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__buttons .components-button{height:33px;line-height:32px}.template-selector-preview{display:none;position:fixed;top:157px;bottom:24px;right:calc(20% + 48px);left:24px;background:#fff;border-radius:2px;overflow:hidden;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}@media screen and (min-width:660px){.template-selector-preview{display:block}.template-selector-preview.is-blank-preview{align-items:center;display:flex;justify-content:center}}@media screen and (min-width:783px){.template-selector-preview{top:143px;right:calc(30% + 72px)}body:not(.auto-fold):not(.folded) .template-selector-preview{right:calc(30% + 172px)}}@media screen and (min-width:961px){.template-selector-preview{right:calc(30% + 172px)}body.folded .template-selector-preview{right:calc(30% + 72px)}}body.is-fullscreen-mode .template-selector-preview{top:111px}@media screen and (min-width:783px){body.is-fullscreen-mode .template-selector-preview{right:calc(30% + 48px)!important}}.template-selector-preview .edit-post-visual-editor{margin:0;padding:0}.template-selector-preview.not-selected .editor-styles-wrapper{position:relative;width:100%;height:100%}.template-selector-preview.not-selected .editor-styles-wrapper .template-selector-preview__empty-state{position:absolute;width:100%;text-align:center;height:50px;line-height:50px;top:50%;margin:-25px 0 0}.page-template-modal__loading{position:absolute;top:50%;right:50%;transform:translate(50%,-50%);display:flex;align-items:flex-end}.page-template-modal__loading .components-spinner{float:none}.sidebar-modal-opener{display:flex;flex-direction:column;align-items:center;justify-content:center}.sidebar-modal-opener .template-selector-item__label{max-width:300px}.sidebar-modal-opener__button{margin-top:20px}.sidebar-modal-opener__warning-modal{display:flex;flex-direction:column;justify-content:center;align-items:center}.sidebar-modal-opener__warning-text{max-width:300px;font-size:1rem;line-height:1.5rem}.sidebar-modal-opener__warning-options{float:left;margin-top:20px}.sidebar-modal-opener__warning-options .components-button{margin-right:12px}.block-iframe-preview{position:absolute;top:0;right:0;transform-origin:top right;text-align:initial;margin:0;overflow:visible;min-height:auto;width:1440px}.block-iframe-preview-body{margin:0;padding:0;overflow-x:hidden;overflow-y:auto}.block-iframe-preview-body>.block-editor,.block-iframe-preview-body>.block-editor>.edit-post-visual-editor{padding:0;margin:0}.block-iframe-preview-body .block-editor-inserter,.block-iframe-preview-body .block-list-appender{display:none!important;visibility:hidden;position:absolute;right:-9999vw}.block-iframe-preview-body .editor-styles-wrapper .wp-block-cover{height:auto}.block-iframe-preview-body .editor-styles-wrapper .wp-block-embed__wrapper iframe{height:auto;min-height:400px}.block-iframe-preview-body [data-type="core/paragraph"] [data-rich-text-placeholder]{display:none}.block-iframe-preview-body .swiper-wrapper{display:flex}.block-iframe-preview-body .swiper-button-next,.block-iframe-preview-body .swiper-button-prev{display:none}.block-iframe-preview-body .swiper-pagination{text-align:center}.block-iframe-preview-body .swiper-pagination-bullet{border-radius:100%}.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/cover"]{margin-top:0;margin-bottom:0}
starter-page-templates/page-template-modal/components/block-iframe-preview.js ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { each, filter, get, castArray, debounce, noop } from 'lodash';
5
+ import classnames from 'classnames';
6
+
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+ /* eslint-disable import/no-extraneous-dependencies */
11
+ import {
12
+ useRef,
13
+ useEffect,
14
+ useState,
15
+ useMemo,
16
+ useReducer,
17
+ useLayoutEffect,
18
+ useCallback,
19
+ } from '@wordpress/element';
20
+ import { withSelect } from '@wordpress/data';
21
+ import { compose, withSafeTimeout } from '@wordpress/compose';
22
+
23
+ import { __ } from '@wordpress/i18n';
24
+ /* eslint-enable import/no-extraneous-dependencies */
25
+
26
+ import CustomBlockPreview from './block-preview';
27
+
28
+ // Debounce time applied to the on resize window event.
29
+ const DEBOUNCE_TIMEOUT = 300;
30
+
31
+ /**
32
+ * Copies the styles from the provided src document
33
+ * to the given iFrame head and body DOM references.
34
+ *
35
+ * @param {object} srcDocument the src document from which to copy the
36
+ * `link` and `style` Nodes from the `head` and `body`
37
+ * @param {object} targetiFrameDocument the target iframe's
38
+ * `contentDocument` where the `link` and `style` Nodes from the `head` and
39
+ * `body` will be copied
40
+ */
41
+ const copyStylesToIframe = ( srcDocument, targetiFrameDocument ) => {
42
+ const styleNodes = [ 'link', 'style' ];
43
+
44
+ // See https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment
45
+ const targetDOMFragment = {
46
+ head: new DocumentFragment(), // eslint-disable-line no-undef
47
+ body: new DocumentFragment(), // eslint-disable-line no-undef
48
+ };
49
+
50
+ each( Object.keys( targetDOMFragment ), domReference => {
51
+ return each(
52
+ filter( srcDocument[ domReference ].children, ( { localName } ) =>
53
+ // Only return specific style-related Nodes
54
+ styleNodes.includes( localName )
55
+ ),
56
+ targetNode => {
57
+ // Clone the original node and append to the appropriate Fragement
58
+ const deep = true;
59
+ targetDOMFragment[ domReference ].appendChild( targetNode.cloneNode( deep ) );
60
+ }
61
+ );
62
+ } );
63
+
64
+ // Consolidate updates to iframe DOM
65
+ targetiFrameDocument.head.appendChild( targetDOMFragment.head );
66
+ targetiFrameDocument.body.appendChild( targetDOMFragment.body );
67
+ };
68
+
69
+ /**
70
+ * Performs a blocks preview using an iFrame.
71
+ *
72
+ * @param {object} props component's props
73
+ * @param {object} props.className CSS class to apply to component
74
+ * @param {string} props.bodyClassName CSS class to apply to the iframe's `<body>` tag
75
+ * @param {number} props.viewportWidth pixel width of the viewable size of the preview
76
+ * @param {Array} props.blocks array of Gutenberg Block objects
77
+ * @param {object} props.settings block Editor settings object
78
+ * @param {Function} props.setTimeout safe version of window.setTimeout via `withSafeTimeout`
79
+ */
80
+ const BlockFramePreview = ( {
81
+ className = 'block-iframe-preview',
82
+ bodyClassName = 'block-iframe-preview-body',
83
+ viewportWidth,
84
+ blocks,
85
+ settings,
86
+ setTimeout = noop,
87
+ } ) => {
88
+ const frameContainerRef = useRef();
89
+ const renderedBlocksRef = useRef();
90
+ const iframeRef = useRef();
91
+
92
+ // Set the initial scale factor.
93
+ const [ style, setStyle ] = useState( {
94
+ transform: `scale( 1 )`,
95
+ } );
96
+
97
+ // Rendering blocks list.
98
+ const renderedBlocks = useMemo( () => castArray( blocks ), [ blocks ] );
99
+ const [ recomputeBlockListKey, triggerRecomputeBlockList ] = useReducer( state => state + 1, 0 );
100
+ useLayoutEffect( triggerRecomputeBlockList, [ blocks ] );
101
+
102
+ /**
103
+ * This function re scales the viewport depending on
104
+ * the wrapper and the iframe width.
105
+ */
106
+ const rescale = useCallback( () => {
107
+ const parentNode = get( frameContainerRef, [ 'current', 'parentNode' ] );
108
+ if ( ! parentNode ) {
109
+ return;
110
+ }
111
+
112
+ // Scaling iFrame.
113
+ const width = viewportWidth || frameContainerRef.current.offsetWidth;
114
+ const scale = parentNode.offsetWidth / viewportWidth;
115
+ const height = parentNode.offsetHeight / scale;
116
+
117
+ setStyle( {
118
+ width,
119
+ height,
120
+ transform: `scale( ${ scale } )`,
121
+ } );
122
+ }, [ viewportWidth ] );
123
+
124
+ // Populate iFrame styles.
125
+ useEffect( () => {
126
+ setTimeout( () => {
127
+ copyStylesToIframe( window.document, iframeRef.current.contentDocument );
128
+ iframeRef.current.contentDocument.body.classList.add( bodyClassName );
129
+ iframeRef.current.contentDocument.body.classList.add( 'editor-styles-wrapper' );
130
+ rescale();
131
+ }, 0 );
132
+ }, [ setTimeout, bodyClassName, rescale ] );
133
+
134
+ // Scroll the preview to the top when the blocks change.
135
+ useEffect( () => {
136
+ const body = get( iframeRef, [ 'current', 'contentDocument', 'body' ] );
137
+ if ( ! body ) {
138
+ return;
139
+ }
140
+
141
+ // scroll to top when blocks changes.
142
+ body.scrollTop = 0;
143
+ }, [ recomputeBlockListKey ] );
144
+
145
+ // Append rendered Blocks to iFrame when changed
146
+ useEffect( () => {
147
+ const renderedBlocksDOM = renderedBlocksRef && renderedBlocksRef.current;
148
+
149
+ if ( renderedBlocksDOM ) {
150
+ iframeRef.current.contentDocument.body.appendChild( renderedBlocksDOM );
151
+ }
152
+ }, [ recomputeBlockListKey ] );
153
+
154
+ // Handling windows resize event.
155
+ useEffect( () => {
156
+ const refreshPreview = debounce( rescale, DEBOUNCE_TIMEOUT );
157
+ window.addEventListener( 'resize', refreshPreview );
158
+
159
+ return () => {
160
+ window.removeEventListener( 'resize', refreshPreview );
161
+ };
162
+ }, [ rescale ] );
163
+
164
+ // Handle wp-admin specific `wp-collapse-menu` event to refresh the preview on sidebar toggle.
165
+ useEffect( () => {
166
+ if ( window.jQuery ) {
167
+ window.jQuery( window.document ).on( 'wp-collapse-menu', rescale );
168
+ }
169
+ return () => {
170
+ if ( window.jQuery ) {
171
+ window.jQuery( window.document ).off( 'wp-collapse-menu', rescale );
172
+ }
173
+ };
174
+ }, [ rescale ] );
175
+
176
+ /* eslint-disable wpcalypso/jsx-classname-namespace */
177
+ return (
178
+ <div ref={ frameContainerRef }>
179
+ <iframe
180
+ ref={ iframeRef }
181
+ title={ __( 'Preview' ) }
182
+ className={ classnames( 'editor-styles-wrapper', className ) }
183
+ style={ style }
184
+ />
185
+
186
+ <div ref={ renderedBlocksRef } className="block-editor" id="rendered-blocks">
187
+ <div className="edit-post-visual-editor">
188
+ <div className="editor-styles-wrapper">
189
+ <div className="editor-writing-flow">
190
+ { blocks && blocks.length ? (
191
+ <CustomBlockPreview
192
+ blocks={ renderedBlocks }
193
+ settings={ settings }
194
+ recomputeBlockListKey={ recomputeBlockListKey }
195
+ />
196
+ ) : null }
197
+ </div>
198
+ </div>
199
+ </div>
200
+ </div>
201
+ </div>
202
+ );
203
+ /* eslint-enable wpcalypso/jsx-classname-namespace */
204
+ };
205
+
206
+ export default compose(
207
+ withSafeTimeout,
208
+ withSelect( select => {
209
+ const blockEditorStore = select( 'core/block-editor' );
210
+ return {
211
+ settings: blockEditorStore ? blockEditorStore.getSettings() : {},
212
+ };
213
+ } )
214
+ )( BlockFramePreview );
starter-page-templates/page-template-modal/components/block-preview.js CHANGED
@@ -9,19 +9,20 @@
9
  /**
10
  * WordPress dependencies
11
  */
12
- /* eslint-disable import/no-extraneous-dependencies */
13
- import { BlockPreview } from '@wordpress/block-editor';
14
- /* eslint-enable import/no-extraneous-dependencies */
15
 
16
- // Exists as a pass through component to simplying testing
17
- // components which consume `BlockPreview` from
18
- // `@wordpress/block-editor`. This is because jest cannot mock
19
- // node modules that are not part of the root node modules.
20
- // Due to the way this projects dependencies are defined
21
- // `@wordpress/block-editor` does not exist within `node_modules`
22
- // and it is there impossible to mock it without providing a wrapping
23
- // component to act as a pass though.
24
- // See https://jestjs.io/docs/en/manual-mocks
25
- export default function( props ) {
26
- return <BlockPreview { ...props } />;
 
 
27
  }
9
  /**
10
  * WordPress dependencies
11
  */
12
+ import { BlockEditorProvider, BlockList } from '@wordpress/block-editor';
13
+ import { Disabled } from '@wordpress/components';
 
14
 
15
+ // Exists as a pass through component to simplify automatted testing of
16
+ // components which need to `BlockEditorProvider`. Setting up JSDom to handle
17
+ // and mock the entire Block Editor isn't useful and is difficult for testing.
18
+ // Therefore this component exists to simplify mocking out the Block Editor
19
+ // when under test conditions.
20
+ export default function( { blocks, settings, recomputeBlockListKey } ) {
21
+ return (
22
+ <BlockEditorProvider value={ blocks } settings={ settings }>
23
+ <Disabled key={ recomputeBlockListKey }>
24
+ <BlockList />
25
+ </Disabled>
26
+ </BlockEditorProvider>
27
+ );
28
  }
starter-page-templates/page-template-modal/components/block-template-preview.js DELETED
@@ -1,34 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
-
5
- /**
6
- * Internal dependencies
7
- */
8
-
9
- /**
10
- * WordPress dependencies
11
- */
12
- /* eslint-disable import/no-extraneous-dependencies */
13
- import { BlockPreview } from '@wordpress/block-editor';
14
- /* eslint-enable import/no-extraneous-dependencies */
15
-
16
- const BlockTemplatePreview = ( { blocks = [], viewportWidth } ) => {
17
- if ( ! blocks || ! blocks.length ) {
18
- return null;
19
- }
20
-
21
- return (
22
- /* eslint-disable wpcalypso/jsx-classname-namespace */
23
- <div className="edit-post-visual-editor">
24
- <div className="editor-styles-wrapper">
25
- <div className="editor-writing-flow">
26
- <BlockPreview blocks={ blocks } viewportWidth={ viewportWidth } />
27
- </div>
28
- </div>
29
- </div>
30
- /* eslint-enable wpcalypso/jsx-classname-namespace */
31
- );
32
- };
33
-
34
- export default BlockTemplatePreview;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
starter-page-templates/page-template-modal/components/preview-template-title.js DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * Return a component which acts as a PostTitle,
3
- * applying the css classes needed to follow the styles
4
- * inherited from the Editor.
5
- *
6
- * @param {object} props Component props.
7
- * @param {string} props.title Template title - transform css rule.
8
- * @param {number} props.scale Scale transform based upon the preview viewport width.
9
- * @returns {*} Component
10
- */
11
-
12
- const PreviewTemplateTitle = ( { title, scale } ) => (
13
- /* eslint-disable wpcalypso/jsx-classname-namespace */
14
- <div className="editor-post-title" style={ { transform: `scale(${ scale })` } }>
15
- <div className="wp-block editor-post-title__block">
16
- <textarea className="editor-post-title__input" value={ title } onChange={ () => {} } />
17
- </div>
18
- </div>
19
- /* eslint-enable wpcalypso/jsx-classname-namespace */
20
- );
21
-
22
- export default PreviewTemplateTitle;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
starter-page-templates/page-template-modal/components/template-selector-item.js CHANGED
@@ -9,11 +9,15 @@ import classnames from 'classnames';
9
  /**
10
  * WordPress dependencies
11
  */
12
- import BlockPreview from './block-template-preview';
13
  /* eslint-disable import/no-extraneous-dependencies */
14
  import { Disabled } from '@wordpress/components';
15
  /* eslint-enable import/no-extraneous-dependencies */
16
 
 
 
 
 
 
17
  const TemplateSelectorItem = props => {
18
  const {
19
  id,
@@ -38,7 +42,7 @@ const TemplateSelectorItem = props => {
38
  // Define static or dynamic preview.
39
  const innerPreview = useDynamicPreview ? (
40
  <Disabled>
41
- <BlockPreview blocks={ blocks } viewportWidth={ 960 } />
42
  </Disabled>
43
  ) : (
44
  <img
@@ -64,7 +68,7 @@ const TemplateSelectorItem = props => {
64
  onClick={ handleLabelClick }
65
  aria-labelledby={ `${ id } ${ labelId }` }
66
  >
67
- <div className="template-selector-item__preview-wrap">{ innerPreview }</div>
68
  </button>
69
  );
70
  };
9
  /**
10
  * WordPress dependencies
11
  */
 
12
  /* eslint-disable import/no-extraneous-dependencies */
13
  import { Disabled } from '@wordpress/components';
14
  /* eslint-enable import/no-extraneous-dependencies */
15
 
16
+ /**
17
+ * Internal dependencies
18
+ */
19
+ import BlockIframePreview from './block-iframe-preview';
20
+
21
  const TemplateSelectorItem = props => {
22
  const {
23
  id,
42
  // Define static or dynamic preview.
43
  const innerPreview = useDynamicPreview ? (
44
  <Disabled>
45
+ <BlockIframePreview blocks={ blocks } viewportWidth={ 960 } />
46
  </Disabled>
47
  ) : (
48
  <img
68
  onClick={ handleLabelClick }
69
  aria-labelledby={ `${ id } ${ labelId }` }
70
  >
71
+ <span className="template-selector-item__preview-wrap">{ innerPreview }</span>
72
  </button>
73
  );
74
  };
starter-page-templates/page-template-modal/components/template-selector-preview.js CHANGED
@@ -1,142 +1,32 @@
1
- /**
2
- * External dependencies
3
- */
4
- /* eslint-disable import/no-extraneous-dependencies */
5
- import { debounce, get, isArray, isEmpty } from 'lodash';
6
- /* eslint-enable import/no-extraneous-dependencies */
7
- import classnames from 'classnames';
8
-
9
  /**
10
  * WordPress dependencies
11
  */
12
  /* eslint-disable import/no-extraneous-dependencies */
13
  import { __ } from '@wordpress/i18n';
14
- import { Disabled } from '@wordpress/components';
15
- import {
16
- useState,
17
- useEffect,
18
- useLayoutEffect,
19
- useRef,
20
- useReducer,
21
- useCallback,
22
- } from '@wordpress/element';
23
  /* eslint-enable import/no-extraneous-dependencies */
24
 
25
  /**
26
  * Internal dependencies
27
  */
28
- import PreviewTemplateTitle from './preview-template-title';
29
- import BlockPreview from './block-preview';
30
-
31
- const TemplateSelectorPreview = ( { blocks, viewportWidth, title } ) => {
32
- const THRESHOLD_RESIZE = 300;
33
- const TITLE_DEFAULT_HEIGHT = 120;
34
-
35
- const ref = useRef( null );
36
-
37
- const [ previewViewport, setPreviewViewport ] = useState( viewportWidth );
38
- const [ titleTransform, setTitleTransform ] = useState( {
39
- scale: 1,
40
- offset: TITLE_DEFAULT_HEIGHT,
41
- } );
42
- const [ recompute, triggerRecompute ] = useReducer( state => state + 1, 0 );
43
-
44
- const updatePreviewTitle = () => {
45
- if ( ! ref || ! ref.current ) {
46
- return;
47
- }
48
-
49
- setTimeout( () => {
50
- const preview = ref.current.querySelector( '.block-editor-block-preview__content' );
51
- if ( ! preview ) {
52
- return;
53
- }
54
-
55
- const previewScale = parseFloat(
56
- get( preview, [ 'style', 'transform' ], '' )
57
- .replace( 'scale(', '' )
58
- .replace( ')', '' )
59
- );
60
- if ( previewScale ) {
61
- const titleOffset = TITLE_DEFAULT_HEIGHT * previewScale;
62
- setTitleTransform( { scale: previewScale, offset: titleOffset } );
63
- }
64
- }, 500 );
65
- };
66
-
67
- const updatePreviewViewport = useCallback( () => {
68
- if ( ! ref || ! ref.current ) {
69
- return;
70
- }
71
- const wrapperWidth = ref.current.clientWidth;
72
- if ( wrapperWidth >= viewportWidth ) {
73
- setPreviewViewport( wrapperWidth );
74
- } else {
75
- setPreviewViewport( viewportWidth );
76
- }
77
- }, [ viewportWidth ] );
78
-
79
- useLayoutEffect( () => {
80
- updatePreviewViewport();
81
- updatePreviewTitle();
82
- }, [ blocks, updatePreviewViewport ] );
83
-
84
- useEffect( () => {
85
- if ( ! blocks || ! blocks.length ) {
86
- return;
87
- }
88
-
89
- const rePreviewTemplate = () => {
90
- updatePreviewViewport();
91
- updatePreviewTitle();
92
- triggerRecompute();
93
- };
94
-
95
- const refreshPreview = debounce( rePreviewTemplate, THRESHOLD_RESIZE );
96
- window.addEventListener( 'resize', refreshPreview );
97
-
98
- // In wp-admin, listen to the jQuery `wp-collapse-menu` event to refresh the preview on sidebar toggle.
99
- if ( window.jQuery ) {
100
- window.jQuery( window.document ).on( 'wp-collapse-menu', rePreviewTemplate );
101
- }
102
-
103
- return () => {
104
- window.removeEventListener( 'resize', refreshPreview );
105
- };
106
- }, [ blocks, updatePreviewViewport ] );
107
-
108
- if ( isEmpty( blocks ) || ! isArray( blocks ) ) {
109
- return (
110
- <div className={ classnames( 'template-selector-preview', 'is-blank-preview' ) }>
111
- <div className="template-selector-preview__placeholder">
112
- { __( 'Select a layout to preview.', 'full-site-editing' ) }
113
- </div>
114
- </div>
115
- );
116
- }
117
 
 
 
118
  return (
119
  /* eslint-disable wpcalypso/jsx-classname-namespace */
120
- <div className="template-selector-preview">
121
- <Disabled>
122
- <div ref={ ref } className="edit-post-visual-editor">
123
- <div className="editor-styles-wrapper">
124
- <div className="editor-writing-flow">
125
- <PreviewTemplateTitle title={ title } scale={ titleTransform.scale } />
126
- <div
127
- className="template-selector-preview__offset-correction"
128
- style={ { top: titleTransform.offset } }
129
- >
130
- <BlockPreview
131
- key={ recompute }
132
- blocks={ blocks }
133
- viewportWidth={ previewViewport }
134
- />
135
- </div>
136
- </div>
137
  </div>
138
  </div>
139
- </Disabled>
 
 
 
 
 
140
  </div>
141
  /* eslint-enable wpcalypso/jsx-classname-namespace */
142
  );
 
 
 
 
 
 
 
 
1
  /**
2
  * WordPress dependencies
3
  */
4
  /* eslint-disable import/no-extraneous-dependencies */
5
  import { __ } from '@wordpress/i18n';
 
 
 
 
 
 
 
 
 
6
  /* eslint-enable import/no-extraneous-dependencies */
7
 
8
  /**
9
  * Internal dependencies
10
  */
11
+ import BlockIframePreview from './block-iframe-preview';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
+ const TemplateSelectorPreview = ( { blocks = [], viewportWidth } ) => {
14
+ const noBlocks = ! blocks.length;
15
  return (
16
  /* eslint-disable wpcalypso/jsx-classname-namespace */
17
+ <div className={ `template-selector-preview ${ noBlocks ? 'not-selected' : '' }` }>
18
+ { noBlocks && (
19
+ <div className="editor-styles-wrapper">
20
+ <div className="template-selector-preview__empty-state">
21
+ { __( 'Select a layout to preview.', 'full-site-editing' ) }
 
 
 
 
 
 
 
 
 
 
 
 
22
  </div>
23
  </div>
24
+ ) }
25
+
26
+ { /* Always render preview iframe to ensure it's ready to populate with Blocks. */
27
+ /* Without this some browsers will experience a noticavle delay
28
+ /* before Blocks are populated into the iframe. */ }
29
+ <BlockIframePreview blocks={ blocks } viewportWidth={ viewportWidth } />
30
  </div>
31
  /* eslint-enable wpcalypso/jsx-classname-namespace */
32
  );
starter-page-templates/page-template-modal/components/test/__snapshots__/{template-selector-control-test.js.snap → template-selector-control.test.js.snap} RENAMED
@@ -27,19 +27,13 @@ exports[`TemplateSelectorControl Basic rendering renders with required props 1`]
27
  type="button"
28
  value="blank"
29
  >
30
- <div
31
  class="template-selector-item__preview-wrap"
32
  >
33
  <img
34
  alt=""
35
  class="template-selector-item__media"
36
  />
37
- </div>
38
- <span
39
- class="template-selector-item__template-title"
40
- id="label-template-selector-control-17-blank"
41
- >
42
- Blank
43
  </span>
44
  </button>
45
  </li>
@@ -52,7 +46,7 @@ exports[`TemplateSelectorControl Basic rendering renders with required props 1`]
52
  type="button"
53
  value="template-1"
54
  >
55
- <div
56
  class="template-selector-item__preview-wrap"
57
  >
58
  <img
@@ -60,12 +54,6 @@ exports[`TemplateSelectorControl Basic rendering renders with required props 1`]
60
  class="template-selector-item__media"
61
  src="https://via.placeholder.com/350x150"
62
  />
63
- </div>
64
- <span
65
- class="template-selector-item__template-title"
66
- id="label-template-selector-control-17-template-1"
67
- >
68
- Template 1
69
  </span>
70
  </button>
71
  </li>
@@ -78,7 +66,7 @@ exports[`TemplateSelectorControl Basic rendering renders with required props 1`]
78
  type="button"
79
  value="template-2"
80
  >
81
- <div
82
  class="template-selector-item__preview-wrap"
83
  >
84
  <img
@@ -86,12 +74,6 @@ exports[`TemplateSelectorControl Basic rendering renders with required props 1`]
86
  class="template-selector-item__media"
87
  src="https://via.placeholder.com/300x250"
88
  />
89
- </div>
90
- <span
91
- class="template-selector-item__template-title"
92
- id="label-template-selector-control-17-template-2"
93
- >
94
- Template 2
95
  </span>
96
  </button>
97
  </li>
@@ -104,7 +86,7 @@ exports[`TemplateSelectorControl Basic rendering renders with required props 1`]
104
  type="button"
105
  value="template-3"
106
  >
107
- <div
108
  class="template-selector-item__preview-wrap"
109
  >
110
  <img
@@ -112,12 +94,6 @@ exports[`TemplateSelectorControl Basic rendering renders with required props 1`]
112
  class="template-selector-item__media"
113
  src="https://via.placeholder.com/500x200"
114
  />
115
- </div>
116
- <span
117
- class="template-selector-item__template-title"
118
- id="label-template-selector-control-17-template-3"
119
- >
120
- Template 3
121
  </span>
122
  </button>
123
  </li>
27
  type="button"
28
  value="blank"
29
  >
30
+ <span
31
  class="template-selector-item__preview-wrap"
32
  >
33
  <img
34
  alt=""
35
  class="template-selector-item__media"
36
  />
 
 
 
 
 
 
37
  </span>
38
  </button>
39
  </li>
46
  type="button"
47
  value="template-1"
48
  >
49
+ <span
50
  class="template-selector-item__preview-wrap"
51
  >
52
  <img
54
  class="template-selector-item__media"
55
  src="https://via.placeholder.com/350x150"
56
  />
 
 
 
 
 
 
57
  </span>
58
  </button>
59
  </li>
66
  type="button"
67
  value="template-2"
68
  >
69
+ <span
70
  class="template-selector-item__preview-wrap"
71
  >
72
  <img
74
  class="template-selector-item__media"
75
  src="https://via.placeholder.com/300x250"
76
  />
 
 
 
 
 
 
77
  </span>
78
  </button>
79
  </li>
86
  type="button"
87
  value="template-3"
88
  >
89
+ <span
90
  class="template-selector-item__preview-wrap"
91
  >
92
  <img
94
  class="template-selector-item__media"
95
  src="https://via.placeholder.com/500x200"
96
  />
 
 
 
 
 
 
97
  </span>
98
  </button>
99
  </li>
starter-page-templates/page-template-modal/components/test/__snapshots__/template-selector-preview-test.js.snap DELETED
@@ -1,48 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`TemplateSelectorPreview Basic rendering renders the preview when blocks are provided 1`] = `
4
- <div>
5
- <div
6
- class="template-selector-preview"
7
- >
8
- <div
9
- class="components-disabled"
10
- >
11
- <div
12
- class="edit-post-visual-editor"
13
- >
14
- <div
15
- class="editor-styles-wrapper"
16
- >
17
- <div
18
- class="editor-writing-flow"
19
- >
20
- <div
21
- class="editor-post-title"
22
- style="transform: scale(1);"
23
- >
24
- <div
25
- class="wp-block editor-post-title__block"
26
- >
27
- <textarea
28
- class="editor-post-title__input"
29
- />
30
- </div>
31
- </div>
32
- <div
33
- class="template-selector-preview__offset-correction"
34
- style="top: 120px;"
35
- >
36
- <div
37
- data-testid="block-template-preview"
38
- >
39
- MockedBlockPreview
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
47
- </div>
48
- `;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
starter-page-templates/page-template-modal/components/test/__snapshots__/template-selector-preview.test.js.snap ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`TemplateSelectorPreview Basic rendering renders the preview and no placeholder when blocks are provided 1`] = `
4
+ <div>
5
+ <div
6
+ class="template-selector-preview "
7
+ >
8
+ <div>
9
+ <iframe
10
+ class="editor-styles-wrapper block-iframe-preview"
11
+ style="transform: scale( 1 );"
12
+ title="Preview"
13
+ />
14
+ </div>
15
+ </div>
16
+ </div>
17
+ `;
starter-page-templates/page-template-modal/components/test/{template-selector-control-test.js → template-selector-control.test.js} RENAMED
@@ -3,9 +3,8 @@
3
  */
4
  /* eslint-disable import/no-extraneous-dependencies */
5
  import { uniqueId, omit } from 'lodash';
6
- /* eslint-enable import/no-extraneous-dependencies */
7
-
8
  import { render, fireEvent } from '@testing-library/react';
 
9
 
10
  import { templatesFixture, blocksByTemplatesFixture } from './helpers/templates-blocks-helpers';
11
  import { TemplateSelectorControl } from '../template-selector-control';
@@ -14,7 +13,7 @@ import { TemplateSelectorControl } from '../template-selector-control';
14
  // `BlockPreview` component is available as default export.
15
  // Once available, swap this mock to mocking out `BlockPreview`
16
  // directly as it causes too many knock on effects when rendering
17
- jest.mock( '../block-template-preview', () => () => {
18
  return <div data-testid="block-template-preview">MockedBlockPreview</div>;
19
  } );
20
 
@@ -53,7 +52,7 @@ describe( 'TemplateSelectorControl', () => {
53
  );
54
 
55
  expect( getByText( 'Select a Template...' ) ).toBeInTheDocument();
56
- expect( getByText( 'Blank' ) ).toBeInTheDocument();
57
  expect( document.querySelectorAll( 'button.template-selector-item__label' ) ).toHaveLength(
58
  4
59
  );
@@ -120,7 +119,7 @@ describe( 'TemplateSelectorControl', () => {
120
  />
121
  );
122
 
123
- fireEvent.click( getByText( 'Template 3' ) );
124
 
125
  expect( onSelectSpy ).toHaveBeenCalled();
126
  } );
@@ -158,7 +157,7 @@ describe( 'TemplateSelectorControl', () => {
158
  );
159
 
160
  expect( getByText( 'Select a Template...' ) ).toBeInTheDocument();
161
- expect( getByText( 'Blank' ) ).toBeInTheDocument();
162
  } );
163
  } );
164
 
3
  */
4
  /* eslint-disable import/no-extraneous-dependencies */
5
  import { uniqueId, omit } from 'lodash';
 
 
6
  import { render, fireEvent } from '@testing-library/react';
7
+ /* eslint-enable import/no-extraneous-dependencies */
8
 
9
  import { templatesFixture, blocksByTemplatesFixture } from './helpers/templates-blocks-helpers';
10
  import { TemplateSelectorControl } from '../template-selector-control';
13
  // `BlockPreview` component is available as default export.
14
  // Once available, swap this mock to mocking out `BlockPreview`
15
  // directly as it causes too many knock on effects when rendering
16
+ jest.mock( '../block-iframe-preview', () => () => {
17
  return <div data-testid="block-template-preview">MockedBlockPreview</div>;
18
  } );
19
 
52
  );
53
 
54
  expect( getByText( 'Select a Template...' ) ).toBeInTheDocument();
55
+ expect( getByText( ( content, element ) => element.value === 'blank' ) ).toBeInTheDocument();
56
  expect( document.querySelectorAll( 'button.template-selector-item__label' ) ).toHaveLength(
57
  4
58
  );
119
  />
120
  );
121
 
122
+ fireEvent.click( getByText( ( content, element ) => element.value === 'template-3' ) );
123
 
124
  expect( onSelectSpy ).toHaveBeenCalled();
125
  } );
157
  );
158
 
159
  expect( getByText( 'Select a Template...' ) ).toBeInTheDocument();
160
+ expect( getByText( ( content, element ) => element.value === 'blank' ) ).toBeInTheDocument();
161
  } );
162
  } );
163
 
starter-page-templates/page-template-modal/components/test/{template-selector-preview-test.js → template-selector-preview.test.js} RENAMED
@@ -1,6 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
 
 
4
  import { render } from '@testing-library/react';
5
  import { blocksFixture } from './helpers/templates-blocks-helpers';
6
  import TemplateSelectorPreview from '../template-selector-preview';
@@ -8,7 +10,7 @@ import TemplateSelectorPreview from '../template-selector-preview';
8
  // Mock the "pass through" version of the `BlockPreview` component
9
  // See `components/block-preview.js`
10
  jest.mock( '../block-preview', () => () => {
11
- return <div data-testid="block-template-preview">MockedBlockPreview</div>;
12
  } );
13
 
14
  // Required to handle `BlockPreview` usage of Mutation Observer
@@ -27,22 +29,20 @@ afterAll( () => {
27
 
28
  describe( 'TemplateSelectorPreview', () => {
29
  describe( 'Basic rendering', () => {
30
- it( 'renders the preview when blocks are provided', () => {
31
- const { queryByTestId, container } = render(
32
  <TemplateSelectorPreview blocks={ blocksFixture } viewportWidth={ 960 } />
33
  );
34
 
35
- expect( queryByTestId( 'block-template-preview' ) ).toBeInTheDocument();
 
36
  expect( container ).toMatchSnapshot();
37
  } );
38
 
39
  it( 'renders placeholder when no blocks are provided', () => {
40
- const { getByText, queryByTestId } = render(
41
- <TemplateSelectorPreview viewportWidth={ 960 } />
42
- );
43
 
44
  expect( getByText( 'Select a layout to preview.' ) ).toBeInTheDocument();
45
- expect( queryByTestId( 'block-template-preview' ) ).not.toBeInTheDocument();
46
  } );
47
 
48
  it( 'renders placeholder when blocks is not an array', () => {
@@ -54,12 +54,24 @@ describe( 'TemplateSelectorPreview', () => {
54
  block: 'bar',
55
  },
56
  };
57
- const { getByText, queryByTestId } = render(
58
  <TemplateSelectorPreview blocks={ invalidBlocksProp } viewportWidth={ 960 } />
59
  );
60
 
61
  expect( getByText( 'Select a layout to preview.' ) ).toBeInTheDocument();
62
- expect( queryByTestId( 'block-template-preview' ) ).not.toBeInTheDocument();
 
 
 
 
 
 
 
 
 
 
 
 
63
  } );
64
  } );
65
  } );
1
  /**
2
  * External dependencies
3
  */
4
+ /* eslint-disable import/no-extraneous-dependencies */
5
+
6
  import { render } from '@testing-library/react';
7
  import { blocksFixture } from './helpers/templates-blocks-helpers';
8
  import TemplateSelectorPreview from '../template-selector-preview';
10
  // Mock the "pass through" version of the `BlockPreview` component
11
  // See `components/block-preview.js`
12
  jest.mock( '../block-preview', () => () => {
13
+ return <div data-testid="block-preview">MockedBlockPreview</div>;
14
  } );
15
 
16
  // Required to handle `BlockPreview` usage of Mutation Observer
29
 
30
  describe( 'TemplateSelectorPreview', () => {
31
  describe( 'Basic rendering', () => {
32
+ it( 'renders the preview and no placeholder when blocks are provided', () => {
33
+ const { queryByText, getByTitle, container } = render(
34
  <TemplateSelectorPreview blocks={ blocksFixture } viewportWidth={ 960 } />
35
  );
36
 
37
+ expect( getByTitle( 'Preview' ) ).toBeInTheDocument();
38
+ expect( queryByText( 'Select a layout to preview.' ) ).not.toBeInTheDocument();
39
  expect( container ).toMatchSnapshot();
40
  } );
41
 
42
  it( 'renders placeholder when no blocks are provided', () => {
43
+ const { getByText } = render( <TemplateSelectorPreview viewportWidth={ 960 } /> );
 
 
44
 
45
  expect( getByText( 'Select a layout to preview.' ) ).toBeInTheDocument();
 
46
  } );
47
 
48
  it( 'renders placeholder when blocks is not an array', () => {
54
  block: 'bar',
55
  },
56
  };
57
+ const { getByText } = render(
58
  <TemplateSelectorPreview blocks={ invalidBlocksProp } viewportWidth={ 960 } />
59
  );
60
 
61
  expect( getByText( 'Select a layout to preview.' ) ).toBeInTheDocument();
62
+ } );
63
+
64
+ it( 'renders "pending" preview container even when no blocks are provided', () => {
65
+ const { getByTitle } = render( <TemplateSelectorPreview viewportWidth={ 960 } /> );
66
+
67
+ // We're testing that the iframe is rendered even if there are no
68
+ // blocks. This is because unless we pre-render the iframe, when we
69
+ // click on template to preview there is a noticeable delay in some
70
+ // browsers (eg: Firefox) before the blocks get rendered. By
71
+ // pre-rendering the iframe we avoid this. Therefore this test is
72
+ // designed to assert that the iframe is always present even though
73
+ // this seems counter intuative.
74
+ expect( getByTitle( 'Preview' ) ).toBeInTheDocument();
75
  } );
76
  } );
77
  } );
starter-page-templates/page-template-modal/index.js CHANGED
@@ -10,7 +10,7 @@ import { compose } from '@wordpress/compose';
10
  import { Button, Modal, Spinner, IconButton } from '@wordpress/components';
11
  import { withDispatch, withSelect } from '@wordpress/data';
12
  import { Component } from '@wordpress/element';
13
- import { parse as parseBlocks } from '@wordpress/blocks';
14
 
15
  /**
16
  * Internal dependencies
@@ -21,6 +21,7 @@ import TemplateSelectorPreview from './components/template-selector-preview';
21
  import { trackDismiss, trackSelection, trackView } from './utils/tracking';
22
  import replacePlaceholders from './utils/replace-placeholders';
23
  import ensureAssets from './utils/ensure-assets';
 
24
  /* eslint-enable import/no-extraneous-dependencies */
25
 
26
  const DEFAULT_HOMEPAGE_TEMPLATE = 'maywood';
@@ -42,9 +43,21 @@ class PageTemplateModal extends Component {
42
  getBlocksByTemplateSlugs = memoize( templates =>
43
  reduce(
44
  templates,
45
- ( prev, { slug, content } ) => {
46
  prev[ slug ] = content
47
- ? parseBlocks( replacePlaceholders( content, this.props.siteInformation ) )
 
 
 
 
 
 
 
 
 
 
 
 
48
  : [];
49
  return prev;
50
  },
@@ -52,6 +65,37 @@ class PageTemplateModal extends Component {
52
  )
53
  );
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  static getDerivedStateFromProps( props, state ) {
56
  // The only time `state.previewedTemplate` isn't set is before `templates`
57
  // are loaded. As soon as we have our `templates`, we set it using
@@ -118,14 +162,27 @@ class PageTemplateModal extends Component {
118
  trackSelection( this.props.segment.id, this.props.vertical.id, slug );
119
  this.props.saveTemplateChoice( slug );
120
 
 
 
 
 
 
 
 
 
121
  const isHomepageTemplate = find( this.props.templates, { slug, category: 'home' } );
122
 
123
  // Load content.
124
- const blocks = this.getBlocksByTemplateSlug( slug );
 
 
 
 
125
  // Only overwrite the page title if the template is not one of the Homepage Layouts
126
  const title = isHomepageTemplate ? null : this.getTitleByTemplateSlug( slug );
127
 
128
- // Skip inserting if there's nothing to insert.
 
129
  if ( ! blocks || ! blocks.length ) {
130
  this.setState( { isOpen: false } );
131
  return;
@@ -365,8 +422,8 @@ class PageTemplateModal extends Component {
365
  ) }
366
  </form>
367
  <TemplateSelectorPreview
368
- blocks={ this.getBlocksByTemplateSlug( previewedTemplate ) }
369
- viewportWidth={ 960 }
370
  title={ this.getTitleByTemplateSlug( previewedTemplate ) }
371
  />
372
  </>
10
  import { Button, Modal, Spinner, IconButton } from '@wordpress/components';
11
  import { withDispatch, withSelect } from '@wordpress/data';
12
  import { Component } from '@wordpress/element';
13
+ import { parse as parseBlocks, createBlock } from '@wordpress/blocks';
14
 
15
  /**
16
  * Internal dependencies
21
  import { trackDismiss, trackSelection, trackView } from './utils/tracking';
22
  import replacePlaceholders from './utils/replace-placeholders';
23
  import ensureAssets from './utils/ensure-assets';
24
+ import mapBlocksRecursively from './utils/map-blocks-recursively';
25
  /* eslint-enable import/no-extraneous-dependencies */
26
 
27
  const DEFAULT_HOMEPAGE_TEMPLATE = 'maywood';
43
  getBlocksByTemplateSlugs = memoize( templates =>
44
  reduce(
45
  templates,
46
+ ( prev, { slug, content, title } ) => {
47
  prev[ slug ] = content
48
+ ? [
49
+ /*
50
+ * Let's add the page title as a heading block.
51
+ * It will be remove when inserting the template
52
+ * blocks into the editor.
53
+ */
54
+ createBlock( 'core/heading', {
55
+ content: title,
56
+ align: 'center',
57
+ level: 1,
58
+ } ),
59
+ ...parseBlocks( replacePlaceholders( content, this.props.siteInformation ) ),
60
+ ]
61
  : [];
62
  return prev;
63
  },
65
  )
66
  );
67
 
68
+ getBlocksForPreview = memoize( previewedTemplate => {
69
+ const blocks = this.getBlocksByTemplateSlug( previewedTemplate );
70
+
71
+ // Modify the existing blocks returning new block object references.
72
+ return mapBlocksRecursively( blocks, function modifyBlocksForPreview( block ) {
73
+ // `jetpack/contact-form` has a placeholder to configure form settings
74
+ // we need to disable this to show the full form in the preview
75
+ if (
76
+ 'jetpack/contact-form' === block.name &&
77
+ undefined !== block.attributes.hasFormSettingsSet
78
+ ) {
79
+ block.attributes.hasFormSettingsSet = true;
80
+ }
81
+
82
+ return block;
83
+ } );
84
+ } );
85
+
86
+ getBlocksForSelection = selectedTemplate => {
87
+ const blocks = this.getBlocksByTemplateSlug( selectedTemplate );
88
+ // Modify the existing blocks returning new block object references.
89
+ return mapBlocksRecursively( blocks, function modifyBlocksForSelection( block ) {
90
+ // Ensure that core/button doesn't link to external template site
91
+ if ( 'core/button' === block.name && undefined !== block.attributes.url ) {
92
+ block.attributes.url = '#';
93
+ }
94
+
95
+ return block;
96
+ } );
97
+ };
98
+
99
  static getDerivedStateFromProps( props, state ) {
100
  // The only time `state.previewedTemplate` isn't set is before `templates`
101
  // are loaded. As soon as we have our `templates`, we set it using
162
  trackSelection( this.props.segment.id, this.props.vertical.id, slug );
163
  this.props.saveTemplateChoice( slug );
164
 
165
+ // Check to see if this is a blank template selection
166
+ // and reset the template if so.
167
+ if ( 'blank' === slug ) {
168
+ this.props.insertTemplate( '', [] );
169
+ this.setState( { isOpen: false } );
170
+ return;
171
+ }
172
+
173
  const isHomepageTemplate = find( this.props.templates, { slug, category: 'home' } );
174
 
175
  // Load content.
176
+ const blocks = this.getBlocksForSelection( slug );
177
+
178
+ // Let's pull the title before to insert blocks in the editor.
179
+ blocks.shift();
180
+
181
  // Only overwrite the page title if the template is not one of the Homepage Layouts
182
  const title = isHomepageTemplate ? null : this.getTitleByTemplateSlug( slug );
183
 
184
+ // Skip inserting if this is not a blank template
185
+ // and there's nothing to insert.
186
  if ( ! blocks || ! blocks.length ) {
187
  this.setState( { isOpen: false } );
188
  return;
422
  ) }
423
  </form>
424
  <TemplateSelectorPreview
425
+ blocks={ this.getBlocksForPreview( previewedTemplate ) }
426
+ viewportWidth={ 1200 }
427
  title={ this.getTitleByTemplateSlug( previewedTemplate ) }
428
  />
429
  </>
starter-page-templates/page-template-modal/styles/starter-page-templates-editor.scss CHANGED
@@ -162,16 +162,6 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
162
  position: relative;
163
  transform: translateZ( 0 ); // Fix for Safari rounded border overflow (1/2).
164
 
165
- .template-selector-item__template-title {
166
- width: 100%;
167
- position: absolute;
168
- bottom: 0;
169
- left: 0;
170
- height: 40px;
171
- line-height: 40px;
172
- background-color: $template-selector-empty-background;
173
- }
174
-
175
  &:focus {
176
  box-shadow: 0 0 0 1px $template-selector-empty-background,
177
  0 0 0 3px $template-selector-border-color-active;
@@ -223,11 +213,6 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
223
  &.is-rendering {
224
  opacity: 0.5;
225
  }
226
-
227
- .block-editor-block-list__layout,
228
- .block-editor-block-list__block {
229
- padding: inherit;
230
- }
231
  }
232
 
233
  .template-selector-item__media {
@@ -291,9 +276,9 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
291
  right: $preview-right-margin;
292
  background: $template-selector-empty-background;
293
  border-radius: 2px;
294
- overflow-x: hidden;
295
- overflow-y: auto;
296
- box-shadow: 0 2px 2px 0 rgba( 0, 0, 0, 0.14 ), 0 3px 1px -2px rgba( 0, 0, 0, 0.12 ),
297
  0 1px 5px 0 rgba( 0, 0, 0, 0.2 );
298
 
299
  @media screen and ( min-width: $breakpoint-mobile ) {
@@ -331,100 +316,26 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
331
  padding: 0;
332
  }
333
 
334
- .editor-styles-wrapper {
335
- .template-selector-preview__offset-correction {
 
336
  position: relative;
337
- top: $template-large-preview-title-height;
338
- }
339
-
340
- .editor-post-title {
341
- transform-origin: top center;
342
  width: 100%;
343
- display: block;
344
- position: absolute;
345
- top: 0;
346
- }
347
-
348
- .editor-post-title,
349
- .editor-post-title__block,
350
- .editor-post-title__input {
351
- padding-top: 0;
352
- padding-bottom: 0;
353
- margin-top: 0;
354
- margin-bottom: 0;
355
- .editor-post-title__input {
356
- margin: 0;
357
- padding: 0;
358
- height: $template-large-preview-title-height;
359
- line-height: $template-large-preview-title-height;
360
- overflow: hidden;
361
- resize: none;
362
  }
363
  }
364
  }
365
  }
366
 
367
- .template-selector-preview__placeholder {
368
- color: var( --color-text-subtle );
369
- font-size: 15px;
370
- font-weight: 400;
371
- }
372
-
373
- // Preview adjustments.
374
- // Tweak styles which are inside of the preview container.
375
- .block-editor-block-preview__container.editor-styles-wrapper {
376
- .wp-block {
377
- width: 100%;
378
- }
379
-
380
- // `core/cover`
381
- .wp-block[data-type='core/cover'][data-align='full'] {
382
- margin: 0;
383
- .wp-block-cover {
384
- padding: 0;
385
- }
386
- }
387
-
388
- // `core/columns`
389
- /* stylelint-disable selector-combinator-space-before */
390
- .wp-block-columns
391
- > .block-editor-inner-blocks
392
- > .block-editor-block-list__layout
393
- > [data-type='core/column']
394
- > .block-editor-block-list__block-edit
395
- > div
396
- > .block-core-columns
397
- > .block-editor-inner-blocks {
398
- /* stylelint-enable */
399
- margin-top: 0;
400
- margin-bottom: 0;
401
- }
402
-
403
- .block-editor-block-list__block {
404
- &[data-align='full'] {
405
- margin: 0;
406
- }
407
-
408
- .block-editor-block-list__block-edit {
409
- @media screen and ( min-width: 600px ) {
410
- margin: 0;
411
- }
412
- }
413
- }
414
- }
415
-
416
- // Set full height to preview container to inherits styles defined for themes.
417
- .template-selector-preview .components-disabled,
418
- .template-selector-preview .edit-post-visual-editor,
419
- .template-selector-item__preview-wrap .components-disabled,
420
- .template-selector-item__preview-wrap .edit-post-visual-editor {
421
- height: 100%;
422
-
423
- .editor-styles-wrapper {
424
- height: 100%;
425
- }
426
- }
427
-
428
  .page-template-modal__loading {
429
  position: absolute;
430
  top: 50%;
@@ -448,10 +359,6 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
448
  .template-selector-item__label {
449
  max-width: 300px;
450
  }
451
-
452
- .template-selector-item__template-title {
453
- font-size: 1.2rem;
454
- }
455
  }
456
 
457
  .sidebar-modal-opener__button {
@@ -472,7 +379,97 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
472
  }
473
 
474
  .sidebar-modal-opener__warning-options {
475
- display: flex;
476
- justify-content: space-around;
477
  margin-top: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  }
162
  position: relative;
163
  transform: translateZ( 0 ); // Fix for Safari rounded border overflow (1/2).
164
 
 
 
 
 
 
 
 
 
 
 
165
  &:focus {
166
  box-shadow: 0 0 0 1px $template-selector-empty-background,
167
  0 0 0 3px $template-selector-border-color-active;
213
  &.is-rendering {
214
  opacity: 0.5;
215
  }
 
 
 
 
 
216
  }
217
 
218
  .template-selector-item__media {
276
  right: $preview-right-margin;
277
  background: $template-selector-empty-background;
278
  border-radius: 2px;
279
+ overflow: hidden;
280
+ box-shadow: 0 2px 2px 0 rgba( 0, 0, 0, 0.14 ),
281
+ 0 3px 1px -2px rgba( 0, 0, 0, 0.12 ),
282
  0 1px 5px 0 rgba( 0, 0, 0, 0.2 );
283
 
284
  @media screen and ( min-width: $breakpoint-mobile ) {
316
  padding: 0;
317
  }
318
 
319
+ // not-selected template
320
+ &.not-selected {
321
+ .editor-styles-wrapper {
322
  position: relative;
 
 
 
 
 
323
  width: 100%;
324
+ height: 100%;
325
+
326
+ .template-selector-preview__empty-state {
327
+ position: absolute;
328
+ width: 100%;
329
+ text-align: center;
330
+ height: 50px;
331
+ line-height: 50px;
332
+ top: 50%;
333
+ margin: -25px 0 0;
 
 
 
 
 
 
 
 
 
334
  }
335
  }
336
  }
337
  }
338
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  .page-template-modal__loading {
340
  position: absolute;
341
  top: 50%;
359
  .template-selector-item__label {
360
  max-width: 300px;
361
  }
 
 
 
 
362
  }
363
 
364
  .sidebar-modal-opener__button {
379
  }
380
 
381
  .sidebar-modal-opener__warning-options {
382
+ float: right;
 
383
  margin-top: 20px;
384
+
385
+ .components-button {
386
+ margin-left: 12px;
387
+ }
388
+ }
389
+
390
+ .block-iframe-preview {
391
+ position: absolute;
392
+ top: 0;
393
+ left: 0;
394
+ transform-origin: top left;
395
+ text-align: initial;
396
+ margin: 0;
397
+ overflow: visible;
398
+ min-height: auto;
399
+
400
+ // Fallback viewport width.
401
+ // Used when BlockFramePreview's viewportWidth prop is undefined.
402
+ // Can be overridden through more specific CSS.
403
+ width: 1440px;
404
+ }
405
+
406
+ .block-iframe-preview-body {
407
+ margin: 0;
408
+ padding: 0;
409
+ overflow-x: hidden;
410
+ overflow-y: auto;
411
+
412
+ > .block-editor,
413
+ > .block-editor > .edit-post-visual-editor {
414
+ padding: 0;
415
+ margin: 0;
416
+ }
417
+
418
+ // Hide inserter/appender.
419
+ .block-list-appender,
420
+ .block-editor-inserter {
421
+ display: none !important;
422
+ visibility: hidden;
423
+ position: absolute;
424
+ left: -9999vw;
425
+ }
426
+
427
+ // Preview adjustments.
428
+ .editor-styles-wrapper {
429
+ // core/cover.
430
+ .wp-block-cover {
431
+ height: auto;
432
+ }
433
+
434
+ // TODO: fix the embed iframe blocks properly.
435
+ .wp-block-embed__wrapper iframe {
436
+ height: auto;
437
+ min-height: 400px;
438
+ }
439
+ }
440
+
441
+ // Manual CSS Overrides. Remove after better solutions are in place.
442
+
443
+ // Removes empty paragraph placeholders, i.e. "Write Title..."
444
+ [data-type='core/paragraph'] [data-rich-text-placeholder] {
445
+ display: none;
446
+ }
447
+
448
+ /*
449
+ * Fixes jetpack .wp-block-jetpack-slideshow styles, as the /wp-content/plugins/jetpack/_inc/blocks/vendors~swiper.[hash].css
450
+ * file is loaded on block insert, not on page load. After the iframe is grabbing these styles, we can remove this code.
451
+ */
452
+ .swiper-wrapper {
453
+ display: flex;
454
+ }
455
+
456
+ .swiper-button-prev,
457
+ .swiper-button-next {
458
+ display: none;
459
+ }
460
+
461
+ .swiper-pagination {
462
+ text-align: center;
463
+ }
464
+
465
+ .swiper-pagination-bullet {
466
+ border-radius: 100%;
467
+ }
468
+
469
+ // Fixes cover image spacing
470
+ .editor-styles-wrapper [data-block][data-type='core/cover'] {
471
+ margin-top: 0;
472
+ margin-bottom: 0;
473
+ }
474
+
475
  }
starter-page-templates/page-template-modal/utils/ensure-assets.js CHANGED
@@ -11,11 +11,13 @@ import { removeQueryArgs } from '@wordpress/url';
11
 
12
  /**
13
  * A full asset URL.
 
14
  * @typedef {string} URL
15
  */
16
 
17
  /**
18
  * Gutenberg Block.
 
19
  * @typedef {object} GutenbergBlock
20
  * @property {string} clientId A unique id of the block.
21
  * @property {string} name A block name, like "core/paragraph".
@@ -25,6 +27,7 @@ import { removeQueryArgs } from '@wordpress/url';
25
 
26
  /**
27
  * Usage object contains an info that certain property is used inside another object.
 
28
  * @typedef {object} Usage
29
  * @property {string} prop Name of the property.
30
  * @property {Array<string|number>} path A path inside an object where prop is, defined as list of keys.
@@ -32,6 +35,7 @@ import { removeQueryArgs } from '@wordpress/url';
32
 
33
  /**
34
  * An asset file that is referenced in blocks.
 
35
  * @typedef {object} Asset
36
  * @property {URL} url A full URL of the asset.
37
  * @property {Array<Usage>} usages A list of {@link Usage} objects.
@@ -39,14 +43,16 @@ import { removeQueryArgs } from '@wordpress/url';
39
 
40
  /**
41
  * A collection of {@link Asset} objects, keyed by their URLs.
42
- * @typedef {object.<String, Asset>} Assets URLs as keys, {@link Asset}.as a values.
 
43
  */
44
 
45
  /**
46
  * FetchSession describes a set of blocks and their assets.
 
47
  * @typedef {object} FetchSession
48
  * @property {Array<GutenbergBlock>} blocks List of Gutenberg blocks.
49
- * @property {object<String, GutenbergBlock>} blocksByClientId Blocks, keyed by their `clientId`
50
  * @property {Assets} assets A list of assets detected in blocks.
51
  */
52
 
@@ -166,7 +172,7 @@ const fetchAssets = async assets => {
166
  * their new local copies.
167
  *
168
  * @param {FetchSession} session A current session.
169
- * @param {object<String,Object>} fetchedAssets Fetched assets.
170
  * @returns {Array<GutenbergBlock>} A promise resolving into an array of blocks.
171
  */
172
  const getBlocksWithAppliedAssets = ( session, fetchedAssets ) => {
11
 
12
  /**
13
  * A full asset URL.
14
+ *
15
  * @typedef {string} URL
16
  */
17
 
18
  /**
19
  * Gutenberg Block.
20
+ *
21
  * @typedef {object} GutenbergBlock
22
  * @property {string} clientId A unique id of the block.
23
  * @property {string} name A block name, like "core/paragraph".
27
 
28
  /**
29
  * Usage object contains an info that certain property is used inside another object.
30
+ *
31
  * @typedef {object} Usage
32
  * @property {string} prop Name of the property.
33
  * @property {Array<string|number>} path A path inside an object where prop is, defined as list of keys.
35
 
36
  /**
37
  * An asset file that is referenced in blocks.
38
+ *
39
  * @typedef {object} Asset
40
  * @property {URL} url A full URL of the asset.
41
  * @property {Array<Usage>} usages A list of {@link Usage} objects.
43
 
44
  /**
45
  * A collection of {@link Asset} objects, keyed by their URLs.
46
+ *
47
+ * @typedef {object.<string, Asset>} Assets URLs as keys, {@link Asset}.as a values.
48
  */
49
 
50
  /**
51
  * FetchSession describes a set of blocks and their assets.
52
+ *
53
  * @typedef {object} FetchSession
54
  * @property {Array<GutenbergBlock>} blocks List of Gutenberg blocks.
55
+ * @property {object<string, GutenbergBlock>} blocksByClientId Blocks, keyed by their `clientId`
56
  * @property {Assets} assets A list of assets detected in blocks.
57
  */
58
 
172
  * their new local copies.
173
  *
174
  * @param {FetchSession} session A current session.
175
+ * @param {object<string, object>} fetchedAssets Fetched assets.
176
  * @returns {Array<GutenbergBlock>} A promise resolving into an array of blocks.
177
  */
178
  const getBlocksWithAppliedAssets = ( session, fetchedAssets ) => {
starter-page-templates/page-template-modal/utils/map-blocks-recursively.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { identity } from 'lodash';
5
+ import { cloneBlock } from '@wordpress/blocks';
6
+
7
+ /**
8
+ * Recursively maps over a collection of blocks calling the modifier function on
9
+ * each to modify it and returning a collection of new block references.
10
+ *
11
+ * @param {Array} blocks an array of block objects
12
+ * @param {Function} modifier a callback function used to modify the blocks
13
+ */
14
+ function mapBlocksRecursively( blocks, modifier = identity ) {
15
+ return blocks.map( block => {
16
+ // `blocks` is an object. Therefore any changes made here will
17
+ // be reflected across all references to the blocks object. To ensure we
18
+ // only modify the blocks when needed, we return a new object reference
19
+ // for any blocks we modify. This allows us to modify blocks for
20
+ // particular contexts. For example we may wish to show blocks
21
+ // differently in the preview than we do when they are inserted into the
22
+ // editor itself.
23
+ block = modifier( cloneBlock( block ) );
24
+
25
+ // Recurse into nested Blocks
26
+ if ( block.innerBlocks && block.innerBlocks.length ) {
27
+ block.innerBlocks = mapBlocksRecursively( block.innerBlocks, modifier );
28
+ }
29
+
30
+ return block;
31
+ } );
32
+ }
33
+
34
+ export default mapBlocksRecursively;
wpcom-block-editor-nux/class-wp-rest-wpcom-block-editor-nux-status-controller.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP_REST_WPCOM_Block_Editor_NUX_Status_Controller file.
4
+ *
5
+ * @package A8C\FSE
6
+ */
7
+
8
+ namespace A8C\FSE;
9
+
10
+ /**
11
+ * Class WP_REST_WPCOM_Block_Editor_NUX_Status_Controller.
12
+ */
13
+ class WP_REST_WPCOM_Block_Editor_NUX_Status_Controller extends \WP_REST_Controller {
14
+ /**
15
+ * WP_REST_WPCOM_Block_Editor_NUX_Status_Controller constructor.
16
+ */
17
+ public function __construct() {
18
+ $this->namespace = 'wpcom/v2';
19
+ $this->rest_base = 'block-editor/nux';
20
+ }
21
+
22
+ /**
23
+ * Register available routes.
24
+ */
25
+ public function register_rest_route() {
26
+ register_rest_route(
27
+ $this->namespace,
28
+ $this->rest_base,
29
+ array(
30
+ array(
31
+ 'methods' => \WP_REST_Server::READABLE,
32
+ 'callback' => array( $this, 'get_nux_status' ),
33
+ 'permission_callback' => array( $this, 'permission_callback' ),
34
+ ),
35
+ array(
36
+ 'methods' => \WP_REST_Server::EDITABLE,
37
+ 'callback' => array( $this, 'update_nux_status' ),
38
+ 'permission_callback' => array( $this, 'permission_callback' ),
39
+ ),
40
+ )
41
+ );
42
+ }
43
+
44
+ /**
45
+ * Callback to determine whether the request can proceed.
46
+ *
47
+ * @return boolean
48
+ */
49
+ public function permission_callback() {
50
+ return is_user_logged_in();
51
+ }
52
+
53
+ /**
54
+ * Check if NUX is enabled.
55
+ *
56
+ * @param mixed $nux_status Can be "enabled", "dismissed", or undefined.
57
+ * @return boolean
58
+ */
59
+ public function is_nux_enabled( $nux_status ) {
60
+ return 'enabled' === $nux_status;
61
+ }
62
+
63
+ /**
64
+ * Return the WPCOM NUX status
65
+ *
66
+ * @return WP_REST_Response
67
+ */
68
+ public function get_nux_status() {
69
+ if ( has_filter( 'wpcom_block_editor_nux_get_status' ) ) {
70
+ $nux_status = apply_filters( 'wpcom_block_editor_nux_get_status', false );
71
+ } elseif ( ! metadata_exists( 'user', get_current_user_id(), 'wpcom_block_editor_nux_status' ) ) {
72
+ $nux_status = 'enabled';
73
+ } else {
74
+ $nux_status = get_user_meta( get_current_user_id(), 'wpcom_block_editor_nux_status', true );
75
+ }
76
+ return rest_ensure_response( array( 'is_nux_enabled' => $this->is_nux_enabled( $nux_status ) ) );
77
+ }
78
+
79
+ /**
80
+ * Update the WPCOM NUX status
81
+ *
82
+ * @param WP_REST_Request $request Request object.
83
+ * @return WP_REST_Response
84
+ */
85
+ public function update_nux_status( $request ) {
86
+ $params = $request->get_json_params();
87
+ $nux_status = $params['isNuxEnabled'] ? 'enabled' : 'dismissed';
88
+ if ( has_action( 'wpcom_block_editor_nux_update_status' ) ) {
89
+ do_action( 'wpcom_block_editor_nux_update_status', $nux_status );
90
+ }
91
+ update_user_meta( get_current_user_id(), 'wpcom_block_editor_nux_status', $nux_status );
92
+ return rest_ensure_response( array( 'is_nux_enabled' => $this->is_nux_enabled( $nux_status ) ) );
93
+ }
94
+ }
wpcom-block-editor-nux/class-wpcom-block-editor-nux.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WPCOM Block Editor NUX file.
4
+ *
5
+ * @package A8C\FSE
6
+ */
7
+
8
+ namespace A8C\FSE;
9
+
10
+ /**
11
+ * Class WPCOM_Block_Editor_NUX
12
+ */
13
+ class WPCOM_Block_Editor_NUX {
14
+ /**
15
+ * Class instance.
16
+ *
17
+ * @var WPCOM_Block_Editor_NUX
18
+ */
19
+ private static $instance = null;
20
+
21
+ /**
22
+ * WPCOM_Block_Editor_NUX constructor.
23
+ */
24
+ public function __construct() {
25
+ add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_script_and_style' ), 100 );
26
+ add_action( 'rest_api_init', array( $this, 'register_rest_api' ) );
27
+ }
28
+
29
+ /**
30
+ * Creates instance.
31
+ *
32
+ * @return \A8C\FSE\WPCOM_Block_Editor_NUX
33
+ */
34
+ public static function init() {
35
+ if ( is_null( self::$instance ) ) {
36
+ self::$instance = new self();
37
+ }
38
+ return self::$instance;
39
+ }
40
+
41
+ /**
42
+ * Enqueue block editor assets.
43
+ */
44
+ public function enqueue_script_and_style() {
45
+ $asset_file = include plugin_dir_path( __FILE__ ) . 'dist/wpcom-block-editor-nux.asset.php';
46
+ $script_dependencies = $asset_file['dependencies'];
47
+ wp_enqueue_script(
48
+ 'wpcom-block-editor-nux-script',
49
+ plugins_url( 'dist/wpcom-block-editor-nux.js', __FILE__ ),
50
+ is_array( $script_dependencies ) ? $script_dependencies : array(),
51
+ filemtime( plugin_dir_path( __FILE__ ) . 'dist/wpcom-block-editor-nux.js' ),
52
+ true
53
+ );
54
+ }
55
+
56
+ /**
57
+ * Register the WPCOM Block Editor NUX endpoints.
58
+ */
59
+ public function register_rest_api() {
60
+ require_once __DIR__ . '/class-wp-rest-wpcom-block-editor-nux-status-controller.php';
61
+ $controller = new WP_REST_WPCOM_Block_Editor_NUX_Status_Controller();
62
+ $controller->register_rest_route();
63
+ }
64
+ }
65
+ add_action( 'init', array( __NAMESPACE__ . '\WPCOM_Block_Editor_NUX', 'init' ) );
wpcom-block-editor-nux/dist/wpcom-block-editor-nux.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill'), 'version' => 'cb5a85e4f3ad4ba8feb76c64518a48bc');
wpcom-block-editor-nux/dist/wpcom-block-editor-nux.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(r){if(t[r])return t[r].exports;var c=t[r]={i:r,l:!1,exports:{}};return e[r].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(r,c,function(t){return e[t]}.bind(null,c));return r},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=10)}([function(e,t){!function(){e.exports=this.wp.data}()},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){!function(){e.exports=this.wp.apiFetch}()},function(e,t,n){var r=n(8);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}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){r(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(e,t,n,r,c,o,i){try{var a=e[o](i),u=a.value}catch(s){return void n(s)}a.done?t(u):Promise.resolve(u).then(r,c)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(c,o){var i=e.apply(t,r);function a(e){n(i,c,o,a,u,"next",e)}function u(e){n(i,c,o,a,u,"throw",e)}a(void 0)}))}}},function(e,t){!function(){e.exports=this.wp.plugins}()},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){!function(){e.exports=this.wp.nux}()},function(e,t,n){"use strict";n.r(t);var r=n(5),c=n.n(r),o=n(4),i=n.n(o),a=n(0),u={setWpcomNuxStatus:function(e){var t=e.isNuxEnabled;return e.bypassApi||i()({path:"/wpcom/v2/block-editor/nux",method:"POST",data:{isNuxEnabled:t}}),{type:"WPCOM_BLOCK_EDITOR_NUX_SET_STATUS",isNuxEnabled:t}}};Object(a.registerStore)("automattic/nux",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.isNuxEnabled;return"WPCOM_BLOCK_EDITOR_NUX_SET_STATUS"===n?c()({},e,{isNuxEnabled:r}):e},actions:u,selectors:{isWpcomNuxEnabled:function(e){return e.isNuxEnabled}},persist:!0});n(9);var s=Object(a.subscribe)((function(){Object(a.dispatch)("core/nux").disableTips(),Object(a.select)("core/edit-post").isFeatureActive("welcomeGuide")&&Object(a.dispatch)("core/edit-post").toggleFeature("welcomeGuide"),s()}));Object(a.subscribe)((function(){Object(a.select)("core/nux").areTipsEnabled()&&(Object(a.dispatch)("core/nux").disableTips(),Object(a.dispatch)("automattic/nux").setWpcomNuxStatus({isNuxEnabled:!0})),Object(a.select)("core/edit-post").isFeatureActive("welcomeGuide")&&(Object(a.dispatch)("core/edit-post").toggleFeature("welcomeGuide"),Object(a.dispatch)("automattic/nux").setWpcomNuxStatus({isNuxEnabled:!0}))}));var l=n(6),d=n.n(l),p=n(1),b=n(3),f=n(2),m=n(7);function h(){var e=Object(a.useSelect)((function(e){return e("automattic/nux").isWpcomNuxEnabled()})),t=Object(a.useDispatch)("automattic/nux").setWpcomNuxStatus;if(Object(p.useEffect)((function(){void 0===e&&function(){var e=d()(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i()({path:"/wpcom/v2/block-editor/nux"});case 2:n=e.sent,t({isNuxEnabled:n.is_nux_enabled,bypassApi:!0});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()()}),[e,t]),!e)return null;return Object(p.createElement)(b.Guide,{className:"edit-post-welcome-guide",finishButtonText:Object(f.__)("Get started"),onFinish:function(){return t({isNuxEnabled:!1})}},Object(p.createElement)(b.GuidePage,{className:"edit-post-welcome-guide__page"},Object(p.createElement)("h1",{className:"edit-post-welcome-guide__heading"},Object(f.__)("Welcome to the Block Editor")),Object(p.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(f.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content."))),Object(p.createElement)(b.GuidePage,{className:"edit-post-welcome-guide__page"},Object(p.createElement)("h1",{className:"edit-post-welcome-guide__heading"},Object(f.__)("Make each block your own")),Object(p.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(f.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected."))),Object(p.createElement)(b.GuidePage,{className:"edit-post-welcome-guide__page"},Object(p.createElement)("h1",{className:"edit-post-welcome-guide__heading"},Object(f.__)("Get to know the Block Library")),Object(p.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(p.__experimentalCreateInterpolateElement)(Object(f.__)("All of the blocks available to you live in the Block Library. You’ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:Object(p.createElement)("img",{alt:Object(f.__)("inserter"),src:"data:image/svg+xml;charset=utf8,%3Csvg width='18' height='18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.824 0C3.97 0 0 3.97 0 8.824c0 4.853 3.97 8.824 8.824 8.824 4.853 0 8.824-3.971 8.824-8.824S13.677 0 8.824 0zM7.94 5.294v2.647H5.294v1.765h2.647v2.647h1.765V9.706h2.647V7.941H9.706V5.294H7.941zm-6.176 3.53c0 3.882 3.176 7.059 7.059 7.059 3.882 0 7.059-3.177 7.059-7.06 0-3.882-3.177-7.058-7.06-7.058-3.882 0-7.058 3.176-7.058 7.059z' fill='%234A4A4A'/%3E%3Cmask id='a' maskUnits='userSpaceOnUse' x='0' y='0' width='18' height='18'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.824 0C3.97 0 0 3.97 0 8.824c0 4.853 3.97 8.824 8.824 8.824 4.853 0 8.824-3.971 8.824-8.824S13.677 0 8.824 0zM7.94 5.294v2.647H5.294v1.765h2.647v2.647h1.765V9.706h2.647V7.941H9.706V5.294H7.941zm-6.176 3.53c0 3.882 3.176 7.059 7.059 7.059 3.882 0 7.059-3.177 7.059-7.06 0-3.882-3.177-7.058-7.06-7.058-3.882 0-7.058 3.176-7.058 7.059z' fill='%23fff'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Cpath fill='%23444' d='M0 0h17.644v17.644H0z'/%3E%3C/g%3E%3C/svg%3E",className:"edit-post-welcome-guide__inserter-icon"})}))))}Object(m.registerPlugin)("wpcom-block-editor-nux",{render:function(){return Object(p.createElement)(h,null)}})}]));
wpcom-block-editor-nux/index.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import './src/store';
5
+ import './src/disable-core-nux';
6
+ import './src/wpcom-nux';
wpcom-block-editor-nux/src/disable-core-nux.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import { select, dispatch, subscribe } from '@wordpress/data';
6
+ import '@wordpress/nux'; //ensure nux store loads
7
+
8
+ // Disable nux and welcome guide features from core.
9
+ const unsubscribe = subscribe( () => {
10
+ dispatch( 'core/nux' ).disableTips();
11
+ if ( select( 'core/edit-post' ).isFeatureActive( 'welcomeGuide' ) ) {
12
+ dispatch( 'core/edit-post' ).toggleFeature( 'welcomeGuide' );
13
+ }
14
+ unsubscribe();
15
+ } );
16
+
17
+ // Listen for these features being triggered to call dotcom nux instead.
18
+ subscribe( () => {
19
+ if ( select( 'core/nux' ).areTipsEnabled() ) {
20
+ dispatch( 'core/nux' ).disableTips();
21
+ dispatch( 'automattic/nux' ).setWpcomNuxStatus( { isNuxEnabled: true } );
22
+ }
23
+ if ( select( 'core/edit-post' ).isFeatureActive( 'welcomeGuide' ) ) {
24
+ dispatch( 'core/edit-post' ).toggleFeature( 'welcomeGuide' );
25
+ dispatch( 'automattic/nux' ).setWpcomNuxStatus( { isNuxEnabled: true } );
26
+ }
27
+ } );
wpcom-block-editor-nux/src/store.js ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import apiFetch from '@wordpress/api-fetch';
6
+ import { registerStore } from '@wordpress/data';
7
+
8
+ const reducer = ( state = {}, { type, isNuxEnabled } ) =>
9
+ 'WPCOM_BLOCK_EDITOR_NUX_SET_STATUS' === type ? { ...state, isNuxEnabled } : state;
10
+
11
+ const actions = {
12
+ setWpcomNuxStatus: ( { isNuxEnabled, bypassApi } ) => {
13
+ if ( ! bypassApi ) {
14
+ apiFetch( {
15
+ path: '/wpcom/v2/block-editor/nux',
16
+ method: 'POST',
17
+ data: { isNuxEnabled },
18
+ } );
19
+ }
20
+ return {
21
+ type: 'WPCOM_BLOCK_EDITOR_NUX_SET_STATUS',
22
+ isNuxEnabled,
23
+ };
24
+ },
25
+ };
26
+
27
+ const selectors = {
28
+ isWpcomNuxEnabled: state => state.isNuxEnabled,
29
+ };
30
+
31
+ registerStore( 'automattic/nux', {
32
+ reducer,
33
+ actions,
34
+ selectors,
35
+ persist: true,
36
+ } );
wpcom-block-editor-nux/src/wpcom-nux.js ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ /* eslint-disable wpcalypso/jsx-classname-namespace */
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import apiFetch from '@wordpress/api-fetch';
7
+ import { Guide, GuidePage } from '@wordpress/components';
8
+ import { useDispatch, useSelect } from '@wordpress/data';
9
+ import { useEffect, __experimentalCreateInterpolateElement } from '@wordpress/element';
10
+ import { __ } from '@wordpress/i18n';
11
+ import { registerPlugin } from '@wordpress/plugins';
12
+
13
+ function WpcomNux() {
14
+ const isWpcomNuxEnabled = useSelect( select => select( 'automattic/nux' ).isWpcomNuxEnabled() );
15
+ const { setWpcomNuxStatus } = useDispatch( 'automattic/nux' );
16
+
17
+ // On mount check if the WPCOM NUX status exists in state, otherwise fetch it from the API.
18
+ useEffect( () => {
19
+ if ( typeof isWpcomNuxEnabled !== 'undefined' ) {
20
+ return;
21
+ }
22
+ const fetchWpcomNuxStatus = async () => {
23
+ const response = await apiFetch( { path: '/wpcom/v2/block-editor/nux' } );
24
+ setWpcomNuxStatus( { isNuxEnabled: response.is_nux_enabled, bypassApi: true } );
25
+ };
26
+ fetchWpcomNuxStatus();
27
+ }, [ isWpcomNuxEnabled, setWpcomNuxStatus ] );
28
+
29
+ if ( ! isWpcomNuxEnabled ) {
30
+ return null;
31
+ }
32
+
33
+ const dismissWpcomNux = () => setWpcomNuxStatus( { isNuxEnabled: false } );
34
+
35
+ return (
36
+ <Guide
37
+ className="edit-post-welcome-guide"
38
+ finishButtonText={ __( 'Get started' ) }
39
+ onFinish={ dismissWpcomNux }
40
+ >
41
+ <GuidePage className="edit-post-welcome-guide__page">
42
+ <h1 className="edit-post-welcome-guide__heading">
43
+ { __( 'Welcome to the Block Editor' ) }
44
+ </h1>
45
+ <p className="edit-post-welcome-guide__text">
46
+ { __(
47
+ 'In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.'
48
+ ) }
49
+ </p>
50
+ </GuidePage>
51
+ <GuidePage className="edit-post-welcome-guide__page">
52
+ <h1 className="edit-post-welcome-guide__heading">{ __( 'Make each block your own' ) }</h1>
53
+ <p className="edit-post-welcome-guide__text">
54
+ { __(
55
+ 'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'
56
+ ) }
57
+ </p>
58
+ </GuidePage>
59
+ <GuidePage className="edit-post-welcome-guide__page">
60
+ <h1 className="edit-post-welcome-guide__heading">
61
+ { __( 'Get to know the Block Library' ) }
62
+ </h1>
63
+ <p className="edit-post-welcome-guide__text">
64
+ { __experimentalCreateInterpolateElement(
65
+ __(
66
+ 'All of the blocks available to you live in the Block Library. You’ll find it wherever you see the <InserterIconImage /> icon.'
67
+ ),
68
+ {
69
+ InserterIconImage: (
70
+ <img
71
+ alt={ __( 'inserter' ) }
72
+ src="data:image/svg+xml;charset=utf8,%3Csvg width='18' height='18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.824 0C3.97 0 0 3.97 0 8.824c0 4.853 3.97 8.824 8.824 8.824 4.853 0 8.824-3.971 8.824-8.824S13.677 0 8.824 0zM7.94 5.294v2.647H5.294v1.765h2.647v2.647h1.765V9.706h2.647V7.941H9.706V5.294H7.941zm-6.176 3.53c0 3.882 3.176 7.059 7.059 7.059 3.882 0 7.059-3.177 7.059-7.06 0-3.882-3.177-7.058-7.06-7.058-3.882 0-7.058 3.176-7.058 7.059z' fill='%234A4A4A'/%3E%3Cmask id='a' maskUnits='userSpaceOnUse' x='0' y='0' width='18' height='18'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.824 0C3.97 0 0 3.97 0 8.824c0 4.853 3.97 8.824 8.824 8.824 4.853 0 8.824-3.971 8.824-8.824S13.677 0 8.824 0zM7.94 5.294v2.647H5.294v1.765h2.647v2.647h1.765V9.706h2.647V7.941H9.706V5.294H7.941zm-6.176 3.53c0 3.882 3.176 7.059 7.059 7.059 3.882 0 7.059-3.177 7.059-7.06 0-3.882-3.177-7.058-7.06-7.058-3.882 0-7.058 3.176-7.058 7.059z' fill='%23fff'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Cpath fill='%23444' d='M0 0h17.644v17.644H0z'/%3E%3C/g%3E%3C/svg%3E"
73
+ className="edit-post-welcome-guide__inserter-icon"
74
+ />
75
+ ),
76
+ }
77
+ ) }
78
+ </p>
79
+ </GuidePage>
80
+ </Guide>
81
+ );
82
+ }
83
+
84
+ registerPlugin( 'wpcom-block-editor-nux', {
85
+ render: () => <WpcomNux />,
86
+ } );