Full Site Editing - Version 0.19

Version Description

  • Starter Page Templates: Added more than twenty new block editor page templates.
  • Starter Page Templates: Fix issues with full width blocks in the preview.
  • General: Fix style compatibility with the latest versions of the block editor.
Download this release

Release Info

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

Code changes from version 0.18.2 to 0.19

Files changed (31) hide show
  1. blog-posts-block/README.md +8 -0
  2. blog-posts-block/dist/editor.asset.php +1 -1
  3. blog-posts-block/dist/editor.js +1 -1
  4. blog-posts-block/dist/view.asset.php +1 -1
  5. blog-posts-block/dist/view.js +1 -1
  6. blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/view.js +5 -5
  7. blog-posts-block/newspack-homepage-articles/components/autocomplete-tokenfield.js +3 -3
  8. full-site-editing-plugin.php +2 -2
  9. full-site-editing/blocks/site-credit/index.php +2 -2
  10. full-site-editing/blocks/template/edit.js +1 -1
  11. full-site-editing/blocks/template/style.scss +63 -41
  12. full-site-editing/dist/full-site-editing.asset.php +1 -1
  13. full-site-editing/dist/full-site-editing.css +1 -1
  14. full-site-editing/dist/full-site-editing.js +1 -1
  15. full-site-editing/dist/full-site-editing.rtl.css +1 -1
  16. full-site-editing/editor/style.scss +6 -5
  17. full-site-editing/lib/site-options/use-previous.js +1 -1
  18. full-site-editing/lib/site-options/with-site-options.js +2 -2
  19. full-site-editing/plugins/editor-template-classes/index.js +6 -5
  20. full-site-editing/templates/class-wp-template-inserter.php +1 -1
  21. global-styles/dist/global-styles.asset.php +1 -1
  22. posts-list-block/dist/posts-list-block.asset.php +1 -1
  23. readme.txt +6 -1
  24. starter-page-templates/dist/starter-page-templates.asset.php +1 -1
  25. starter-page-templates/dist/starter-page-templates.css +1 -1
  26. starter-page-templates/dist/starter-page-templates.js +1 -1
  27. starter-page-templates/dist/starter-page-templates.rtl.css +1 -1
  28. starter-page-templates/page-template-modal/components/template-selector-item.js +0 -3
  29. starter-page-templates/page-template-modal/index.js +102 -67
  30. starter-page-templates/page-template-modal/styles/starter-page-templates-editor.scss +32 -54
  31. starter-page-templates/page-template-modal/utils/ensure-assets.js +13 -13
blog-posts-block/README.md CHANGED
@@ -30,3 +30,11 @@ npm run sync:blog-posts-block --release=1.0.0-alpha.17
30
  ```
31
 
32
  This will pull the code from the release and integrate it into this repository. Please review changes, make sure to update `NEWSPACK_BLOCKS__VERSION` in [index.php](./index.php) and commit.
 
 
 
 
 
 
 
 
30
  ```
31
 
32
  This will pull the code from the release and integrate it into this repository. Please review changes, make sure to update `NEWSPACK_BLOCKS__VERSION` in [index.php](./index.php) and commit.
33
+
34
+ ### Local development
35
+
36
+ Sometimes, probably, you will need to sync the NHA code straight in your local environment. It means you will get working on both projects at the same time. For this situation, you'd like to reference the code source through the `path` bin script argument.
37
+
38
+ ```js
39
+ npm run sync:blog-posts-block --path=/Absolute/path/of/newspack-blocks/
40
+ ```
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' => 'ec515417dc86f08cafcea39fe0b3b918');
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');
blog-posts-block/dist/editor.js CHANGED
@@ -1,2 +1,2 @@
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=6,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"})),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:"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"})),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:"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"})),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:"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"})),J=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"})),X=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(q,c.length):q,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:J,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:G,title:Object(r.__)("portrait Image Shape","newspack-blocks"),isActive:"portrait"===h,onClick:function(){return a({imageShape:"portrait"})}},{icon:U,title:Object(r.__)("Square Image Shape","newspack-blocks"),isActive:"square"===h,onClick:function(){return a({imageShape:"square"})}},{icon:W,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),Y=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)})))}}))])(X),K=(n(31),n(32),n(18)),Z=(K.name,K.attributes),$=K.category,ee={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:Z,category:$,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:Y,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]||""})}}]}},te="a8c/blog-posts";Object(s.addFilter)("blocks.transforms_from_name","set-transformed-block-name",(function(e){return"newspack-blocks/homepage-articles"!==e?e:te})),Object(a.registerBlockType)(te,c()({},ee,{title:Object(r.__)("Blog Posts","full-site-editing"),category:"layout",supports:c()({},ee.supports,{multiple:!1})}))}]));
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})}))}]));
blog-posts-block/dist/view.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'd8823275e1ff84c94cff5fb1d9d191e7');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => '187983f2ec7aa568a46de75a4da480a2');
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),i=(r(4),"data-load-more-url"),u=3;function a(t){t.style.display="none",t.setAttribute("hidden","")}function c(t){t.style.display="",t.removeAttribute("hidden")}function l(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]"),f=e.querySelector("[data-load-more-error-text]"),s=!1,d=!1;return function(){if(s||d)return!1;s=!0,a(t),a(f),c(n);var e,p,y=new URL(t.getAttribute(i));function m(){s=!1,a(n),c(f),c(t)}y.searchParams.set("exclude_ids",(e=document.querySelectorAll("article[data-post-id]"),p=Array.from(e).map((function(t){return t.getAttribute("data-post-id")})),o()(new Set(p))).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:y.toString(),onSuccess:function(e){if(!function(t){var e=!1;t&&l(t,"items")&&Array.isArray(t.items)&&l(t,"next")&&"string"==typeof t.next&&(e=!0,!t.items.length||l(t.items[0],"html")&&"string"==typeof t.items[0].html||(e=!1));return e}(e))return m();if(e.items.length){var o=e.items.map((function(t){return t.html})).join("");r.insertAdjacentHTML("beforeend",o)}e.next&&(t.setAttribute(i,e.next),c(t));e.items.length&&e.next||(d=!0);s=!1,a(n)},onError:m},u)}}(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);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)}))}]));
blog-posts-block/newspack-homepage-articles/blocks/homepage-articles/view.js CHANGED
@@ -123,8 +123,8 @@ 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 ) {
130
  const xhr = new XMLHttpRequest();
@@ -180,7 +180,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;
@@ -228,8 +228,8 @@ function showEl( el ) {
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 );
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 ) {
130
  const xhr = new XMLHttpRequest();
180
  * "required": ["items", "next"]
181
  * }
182
  *
183
+ * @param {object} data posts endpoint payload
184
  */
185
  function isPostsDataValid( data ) {
186
  let isValid = false;
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 );
blog-posts-block/newspack-homepage-articles/components/autocomplete-tokenfield.js CHANGED
@@ -66,7 +66,7 @@ class AutocompleteTokenField extends Component {
66
  * Get a list of labels for input values.
67
  *
68
  * @param array values Array of values (ids, etc.).
69
- * @return array Array of valid labels corresponding to the values.
70
  */
71
  getLabelsForValues( values ) {
72
  const { validValues } = this.state;
@@ -81,7 +81,7 @@ class AutocompleteTokenField extends Component {
81
  * Get a list of values for input labels.
82
  *
83
  * @param array labels Array of labels from the tokens.
84
- * @return array Array of valid values corresponding to the labels.
85
  */
86
  getValuesForLabels( labels ) {
87
  const { validValues } = this.state;
@@ -143,7 +143,7 @@ class AutocompleteTokenField extends Component {
143
  /**
144
  * To populate the tokens, we need to convert the values into a human-readable label.
145
  *
146
- * @return array An array of token label strings.
147
  */
148
  getTokens() {
149
  const { tokens } = this.props;
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;
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;
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;
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.18.2
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
@@ -35,7 +35,7 @@ namespace A8C\FSE;
35
  *
36
  * @var string
37
  */
38
- define( 'PLUGIN_VERSION', '0.18.2' );
39
 
40
  // Always include these helper files for FSE.
41
  require_once __DIR__ . '/full-site-editing/helpers.php';
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
  *
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';
full-site-editing/blocks/site-credit/index.php CHANGED
@@ -113,14 +113,14 @@ function footercredit_rel_nofollow_link( $link ) {
113
  * Most settings will still work
114
  *
115
  * @typedef CreditOption
116
- * @type {Object}
117
  * @property {string} label The text to show the user as an option.
118
  * @property {string} value The shorthand value to identify the option.
119
  * @property {string} [renderType] The type of render to use. Defaults to 'text',
120
  * which renders the label inside a <span/>. You
121
  * can also use 'icon' to render an icon from
122
  * @wordpress/components.
123
- * @property {Object} [renderProps] The props to pass into the renderer. For example,
124
  * for an icon, you could specify { icon: 'WordPress', color: 'gray' }
125
  * which get passed into <Icon /> as props in order to
126
  * render a gray WordPress icon. You can also specify
113
  * Most settings will still work
114
  *
115
  * @typedef CreditOption
116
+ * @type {object}
117
  * @property {string} label The text to show the user as an option.
118
  * @property {string} value The shorthand value to identify the option.
119
  * @property {string} [renderType] The type of render to use. Defaults to 'text',
120
  * which renders the label inside a <span/>. You
121
  * can also use 'icon' to render an icon from
122
  * @wordpress/components.
123
+ * @property {object} [renderProps] The props to pass into the renderer. For example,
124
  * for an icon, you could specify { icon: 'WordPress', color: 'gray' }
125
  * which get passed into <Icon /> as props in order to
126
  * render a gray WordPress icon. You can also specify
full-site-editing/blocks/template/edit.js CHANGED
@@ -87,7 +87,7 @@ const TemplateEdit = compose(
87
  } ) => {
88
  if ( ! template ) {
89
  return (
90
- <Placeholder>
91
  <Spinner />
92
  </Placeholder>
93
  );
87
  } ) => {
88
  if ( ! template ) {
89
  return (
90
+ <Placeholder className="template-block__placeholder">
91
  <Spinner />
92
  </Placeholder>
93
  );
full-site-editing/blocks/template/style.scss CHANGED
@@ -3,6 +3,7 @@
3
  // Prevent blur bleeding
4
  overflow: hidden;
5
  position: relative;
 
6
  }
7
 
8
  // Override some very specific theme styles.
@@ -10,12 +11,24 @@
10
  padding: 0;
11
  }
12
 
 
 
 
 
13
  .template__block-container {
14
- &.is-hovered {
 
 
 
 
15
  cursor: pointer;
16
  }
17
 
18
- &.is-hovered,
 
 
 
 
19
  &.is-selected,
20
  .is-navigating-to-template {
21
  .components-disabled {
@@ -45,50 +58,52 @@
45
  .block-editor-block-list__block-edit::before {
46
  display: none;
47
  }
48
- }
49
-
50
- .template-block__overlay {
51
- background: rgba( #ffffff, 0.8 );
52
- border: 0 solid rgba( #7b86a2, 0.3 ); // Gutenberg $dark-opacity-light-600
53
- bottom: 0;
54
- left: 0;
55
- margin: 0;
56
- opacity: 0;
57
- padding: 0;
58
- position: absolute;
59
- right: 0;
60
- transition: opacity 0.2s linear 0s;
61
- top: 0;
62
- z-index: 2;
63
-
64
- .is-selected & {
65
- border-color: rgba( #425863, 0.4 ); // Gutenberg $dark-opacity-light-800
66
- }
67
-
68
- .editor-block-list__block:first-child & {
69
- border-bottom-width: 1px;
70
- }
71
- .editor-block-list__block:last-child & {
72
- border-top-width: 1px;
73
- }
74
 
75
- @media only screen and ( min-width: 768px ) {
76
- border-width: 1px;
77
- }
78
-
79
- .components-button {
 
80
  opacity: 0;
 
 
 
81
  transition: opacity 0.2s linear 0s;
82
- &.hidden {
83
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  }
85
- }
86
- }
87
 
88
- .template-block__loading {
89
- display: flex;
90
- align-items: center;
91
- color: #191e23;
 
 
92
  }
93
 
94
  // Hide the site logo description and buttons when not editing the Template
@@ -100,3 +115,10 @@
100
  }
101
  }
102
  }
 
 
 
 
 
 
 
3
  // Prevent blur bleeding
4
  overflow: hidden;
5
  position: relative;
6
+ margin-top: 20px;
7
  }
8
 
9
  // Override some very specific theme styles.
11
  padding: 0;
12
  }
13
 
14
+ .components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar[data-type='a8c/template'] {
15
+ display: none;
16
+ }
17
+
18
  .template__block-container {
19
+ &::before {
20
+ display: none;
21
+ }
22
+
23
+ &:hover {
24
  cursor: pointer;
25
  }
26
 
27
+ .block-editor-block-list__block-edit [data-block] {
28
+ margin: 0;
29
+ }
30
+
31
+ &:hover,
32
  &.is-selected,
33
  .is-navigating-to-template {
34
  .components-disabled {
58
  .block-editor-block-list__block-edit::before {
59
  display: none;
60
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ .template-block__overlay {
63
+ background: rgba( #ffffff, 0.8 );
64
+ border: 0 solid rgba( #7b86a2, 0.3 ); // Gutenberg $dark-opacity-light-600
65
+ bottom: 0;
66
+ left: 0;
67
+ margin: 0;
68
  opacity: 0;
69
+ padding: 0;
70
+ position: absolute;
71
+ right: 0;
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;
95
+ margin: 0 auto;
96
+ &.hidden {
97
+ display: none;
98
+ }
99
  }
 
 
100
 
101
+ .template-block__loading {
102
+ display: flex;
103
+ align-items: center;
104
+ color: #191e23;
105
+ }
106
+ }
107
  }
108
 
109
  // Hide the site logo description and buttons when not editing the Template
115
  }
116
  }
117
  }
118
+
119
+ // Center initial loading spinner in placeholder block.
120
+ .template-block__placeholder {
121
+ .components-spinner {
122
+ margin: 0 auto;
123
+ }
124
+ }
full-site-editing/dist/full-site-editing.asset.php CHANGED
@@ -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' => 'ce35bb067918dc74b41096191243d826');
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');
full-site-editing/dist/full-site-editing.css CHANGED
@@ -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}.post-type-page .editor-styles-wrapper .template-block .fse-template-part{padding:0}.template__block-container.is-hovered{cursor:pointer}.template__block-container.is-hovered .components-disabled,.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled{filter:blur(2px);transition:filter .2s linear}.template__block-container.is-hovered .template-block__overlay,.template__block-container.is-hovered .template-block__overlay .components-button,.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{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__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__overlay{border-color:rgba(66,88,99,.4)}.editor-block-list__block:first-child .template-block__overlay{border-bottom-width:1px}.editor-block-list__block:last-child .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template-block__overlay{border-width:1px}}.template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s}.template-block__overlay .components-button.hidden{display:none}.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,.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-page .edit-post-layout__content,.post-type-wp_template_part .edit-post-editor-regions__content,.post-type-wp_template_part .edit-post-layout__content{background:#eee}.post-type-page .edit-post-editor-regions__content .edit-post-visual-editor,.post-type-page .edit-post-layout__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-editor-regions__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-layout__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-wp_template_part .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit{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-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 .editor-writing-flow__click-redirect,.post-type-wp_template_part .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 CHANGED
@@ -1,2 +1,2 @@
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,null,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-writing-flow.editor-writing-flow > 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
  /*! 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()}))}]));
full-site-editing/dist/full-site-editing.rtl.css CHANGED
@@ -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}.post-type-page .editor-styles-wrapper .template-block .fse-template-part{padding:0}.template__block-container.is-hovered{cursor:pointer}.template__block-container.is-hovered .components-disabled,.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled{filter:blur(2px);transition:filter .2s linear}.template__block-container.is-hovered .template-block__overlay,.template__block-container.is-hovered .template-block__overlay .components-button,.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{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__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__overlay{border-color:rgba(66,88,99,.4)}.editor-block-list__block:first-child .template-block__overlay{border-bottom-width:1px}.editor-block-list__block:last-child .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template-block__overlay{border-width:1px}}.template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s}.template-block__overlay .components-button.hidden{display:none}.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,.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-page .edit-post-layout__content,.post-type-wp_template_part .edit-post-editor-regions__content,.post-type-wp_template_part .edit-post-layout__content{background:#eee}.post-type-page .edit-post-editor-regions__content .edit-post-visual-editor,.post-type-page .edit-post-layout__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-editor-regions__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-layout__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-wp_template_part .block-editor-block-list__block[data-align=full]>.block-editor-block-list__block-edit{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-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 .editor-writing-flow__click-redirect,.post-type-wp_template_part .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/editor/style.scss CHANGED
@@ -23,14 +23,10 @@
23
  .post-type-page,
24
  .post-type-wp_template_part {
25
  @media ( min-width: 768px ) {
26
- // @TODO: remove .edit-post-layout__content when Gutenberg 7.0.0 lands in production
27
- .edit-post-layout__content,
28
  .edit-post-editor-regions__content {
29
  background: #eee;
30
  }
31
 
32
- // @TODO: remove .edit-post-layout__content when Gutenberg 7.0.0 lands in production
33
- .edit-post-layout__content .edit-post-visual-editor,
34
  .edit-post-editor-regions__content .edit-post-visual-editor {
35
  box-shadow: 0 2px 2px 0 rgba( 0, 0, 0, 0.14 ), 0 3px 1px -2px rgba( 0, 0, 0, 0.12 ),
36
  0 1px 5px 0 rgba( 0, 0, 0, 0.2 );
@@ -42,6 +38,11 @@
42
  .block-editor-block-list__layout {
43
  padding-left: 0;
44
  padding-right: 0;
 
 
 
 
 
45
  }
46
 
47
  .block-editor-block-list__block[data-align='full'] > .block-editor-block-list__block-edit {
@@ -65,7 +66,7 @@
65
  }
66
 
67
  // Remove the 50vh bottom padding that looks off with the FSE frame.
68
- .editor-writing-flow__click-redirect {
69
  display: none;
70
  }
71
  }
23
  .post-type-page,
24
  .post-type-wp_template_part {
25
  @media ( min-width: 768px ) {
 
 
26
  .edit-post-editor-regions__content {
27
  background: #eee;
28
  }
29
 
 
 
30
  .edit-post-editor-regions__content .edit-post-visual-editor {
31
  box-shadow: 0 2px 2px 0 rgba( 0, 0, 0, 0.14 ), 0 3px 1px -2px rgba( 0, 0, 0, 0.12 ),
32
  0 1px 5px 0 rgba( 0, 0, 0, 0.2 );
38
  .block-editor-block-list__layout {
39
  padding-left: 0;
40
  padding-right: 0;
41
+
42
+ .block-editor-block-list__block[data-align='full'] {
43
+ margin-left: 0;
44
+ margin-right: 0;
45
+ }
46
  }
47
 
48
  .block-editor-block-list__block[data-align='full'] > .block-editor-block-list__block-edit {
66
  }
67
 
68
  // Remove the 50vh bottom padding that looks off with the FSE frame.
69
+ .block-editor-writing-flow__click-redirect {
70
  display: none;
71
  }
72
  }
full-site-editing/lib/site-options/use-previous.js CHANGED
@@ -11,7 +11,7 @@ import { useEffect, useRef } from '@wordpress/element';
11
  * see https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
12
  *
13
  * @param {any} value state or prop value for which previous value is required
14
- * @return {any} previous value of requested state or prop value
15
  */
16
  export function usePrevious( value ) {
17
  const ref = useRef();
11
  * see https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
12
  *
13
  * @param {any} value state or prop value for which previous value is required
14
+ * @returns {any} previous value of requested state or prop value
15
  */
16
  export function usePrevious( value ) {
17
  const ref = useRef();
full-site-editing/lib/site-options/with-site-options.js CHANGED
@@ -24,7 +24,7 @@ import { useSiteOptions } from './use-site-options';
24
  * used to update the option. `updateValue` will re-render the component with
25
  * the new `value`.
26
  *
27
- * @param {Object} options An object of site options to retrieve. Keys should be
28
  * option names you wish to have locally. They can be
29
  * named whatever makes sense in the context of your
30
  * component. Any key's value should be another object
@@ -32,7 +32,7 @@ import { useSiteOptions } from './use-site-options';
32
  * WordPress option to fetch, and `defaultValue`, the
33
  * value to use while the option is fetching.
34
  *
35
- * @return {Component} The higher order component.
36
  *
37
  * In the following example, withSiteOptions is called with an object mapping a
38
  * name for the option to some information about it. In particular, optionName
24
  * used to update the option. `updateValue` will re-render the component with
25
  * the new `value`.
26
  *
27
+ * @param {object} options An object of site options to retrieve. Keys should be
28
  * option names you wish to have locally. They can be
29
  * named whatever makes sense in the context of your
30
  * component. Any key's value should be another object
32
  * WordPress option to fetch, and `defaultValue`, the
33
  * value to use while the option is fetching.
34
  *
35
+ * @returns {Component} The higher order component.
36
  *
37
  * In the following example, withSiteOptions is called with an object mapping a
38
  * name for the option to some information about it. In particular, optionName
full-site-editing/plugins/editor-template-classes/index.js CHANGED
@@ -31,16 +31,17 @@ const EditorTemplateClasses = withSelect( select => {
31
  return { templateClasses };
32
  } )( ( { templateClasses } ) => {
33
  const blockListInception = setInterval( () => {
34
- const blockList = document.querySelector(
35
- '.block-editor-writing-flow.editor-writing-flow > div'
36
- );
37
 
38
- if ( ! blockList ) {
39
  return;
40
  }
41
  clearInterval( blockListInception );
42
 
43
- blockList.className = classNames( 'a8c-template-editor fse-template-part', ...templateClasses );
 
 
 
44
  } );
45
 
46
  return null;
31
  return { templateClasses };
32
  } )( ( { templateClasses } ) => {
33
  const blockListInception = setInterval( () => {
34
+ const blockListParent = document.querySelector( '.block-editor__typewriter > div' );
 
 
35
 
36
+ if ( ! blockListParent ) {
37
  return;
38
  }
39
  clearInterval( blockListInception );
40
 
41
+ blockListParent.className = classNames(
42
+ 'a8c-template-editor fse-template-part',
43
+ ...templateClasses
44
+ );
45
  } );
46
 
47
  return null;
full-site-editing/templates/class-wp-template-inserter.php CHANGED
@@ -10,7 +10,7 @@ namespace A8C\FSE;
10
  /**
11
  * The strategy to use for loading the default template part content.
12
  *
13
- * @typedef {String="use-api","use-local"} LoadingStrategy
14
  */
15
 
16
  /**
10
  /**
11
  * The strategy to use for loading the default template part content.
12
  *
13
+ * @typedef {string="use-api","use-local"} LoadingStrategy
14
  */
15
 
16
  /**
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' => 'e69758b1ebc946c5bca258f7a5f9f1c6');
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');
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' => '2e905e3964ed274472b3f8c1a8d8b638');
1
+ <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'b4c9c5e6cb3715778c497c9ea13dd95b');
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: alexislloyd, allancole, automattic, codebykat, copons, dmsnell, ge
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.0
5
  Tested up to: 5.3
6
- Stable tag: 0.18.2
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,11 @@ This plugin is experimental, so we don't provide any support for it outside of w
42
 
43
  == Changelog ==
44
 
 
 
 
 
 
45
  = 0.18.2 =
46
  * Address core/nux package deprecation.
47
 
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
 
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.
48
+ * General: Fix style compatibility with the latest versions of the block editor.
49
+
50
  = 0.18.2 =
51
  * Address core/nux package deprecation.
52
 
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' => 'e45af06081060aeb4ef73b6ce76c174b');
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');
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:1.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fit,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 (max-width:659px){.template-selector-control__template:first-child .template-selector-item__preview-wrap{padding-top:0;height:70px}.template-selector-control__template:first-child .template-selector-item__template-title{height:70px;line-height:70px}}@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>.editor-inner-blocks>.editor-block-list__layout>[data-type="core/column"]>.editor-block-list__block-edit>div>.block-core-columns>.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}}.block-editor-block-preview__container .editor-styles-wrapper .block-editor-block-list__block,.block-editor-block-preview__container .editor-styles-wrapper .block-editor-block-list__layout{padding:inherit}.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 .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}
starter-page-templates/dist/starter-page-templates.js CHANGED
@@ -1,2 +1,2 @@
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=33)}([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 l in r)n.call(r,l)&&r[l]&&e.push(l)}}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,n){var r=n(26),i=n(27),a=n(28);e.exports=function(e,t){return r(e)||i(e,t)||a()}},function(e,t,n){var r=n(23),i=n(24),a=n(25);e.exports=function(e){return r(e)||i(e)||a()}},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(29),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(30);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){!function(){e.exports=this.wp.plugins}()},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){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){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,l=e[Symbol.iterator]();!(r=(o=l.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(s){i=!0,a=s}finally{try{r||null==l.return||l.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){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,n){"use strict";n.r(t);var r=n(0),i=n(2),a=n(18),o=n(6),l=n(19),s=n(9),c=n.n(s),p=n(11),u=n.n(p),m=n(10),d=n.n(m),f=n(12),b=n.n(f),g=n(13),O=n.n(g),v=n(14),h=n.n(v),j=n(15),y=n.n(j),_=n(5),w=n.n(_),E=n(16),T=n.n(E),P=n(3),k=n.n(P),S=n(1),x=n(7),N=n.n(x),B=(n(31),n(8)),C=n(4),A=n(20),I=(n(32),n(17)),M=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)(I.BlockPreview,{blocks:n,viewportWidth:i})))):null},L=function(e){var t=e.id,n=e.value,i=e.onSelect,a=e.label,o=e.useDynamicPreview,l=void 0!==o&&o,s=e.staticPreviewImg,c=e.staticPreviewImgAlt,p=void 0===c?"":c,u=e.blocks,m=void 0===u?[]:u,d=e.isSelected;if(Object(S.isNil)(t)||Object(S.isNil)(a)||Object(S.isNil)(n))return null;if(l&&(Object(S.isNil)(m)||Object(S.isEmpty)(m)))return null;var f=l?Object(r.createElement)(C.Disabled,null,Object(r.createElement)(M,{blocks:m,viewportWidth:960})):Object(r.createElement)("img",{className:"template-selector-item__media",src:s,alt:p}),b="label-".concat(t,"-").concat(n);return Object(r.createElement)("button",{type:"button",className:N()("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),Object(r.createElement)("span",{className:"template-selector-item__template-title",id:b},a))},D={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"},F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e.replace(/{{(\w+)}}/g,(function(e,n){var r=D[n];return t[W[n]]||r||n})):""},G=Object(B.compose)(r.memo,B.withInstanceId)((function(e){var t=e.label,n=e.className,i=e.help,a=e.instanceId,o=e.templates,l=void 0===o?[]:o,s=e.blocksByTemplates,c=void 0===s?{}:s,p=e.useDynamicPreview,u=void 0!==p&&p,m=e.onTemplateSelect,d=void 0===m?S.noop:m,f=e.siteInformation,b=void 0===f?{}:f,g=e.selectedTemplate;if(Object(S.isEmpty)(l)||!Object(S.isArray)(l))return null;if(!0===u&&Object(S.isEmpty)(c))return null;var O="template-selector-control-".concat(a);return Object(r.createElement)(C.BaseControl,{label:t,id:O,help:i,className:N()(n,"template-selector-control")},Object(r.createElement)("ul",{className:"template-selector-control__options","data-testid":"template-selector-control-options"},Object(S.map)(l,(function(e){var t=e.slug,n=e.title,a=e.preview,o=e.previewAlt;return Object(r.createElement)("li",{key:"".concat(O,"-").concat(t),className:"template-selector-control__template"},Object(r.createElement)(L,{id:O,value:t,label:F(n,b),help:i,onSelect:d,staticPreviewImg:a,staticPreviewImgAlt:o,blocks:c.hasOwnProperty(t)?c[t]:[],useDynamicPreview:u,isSelected:t===g}))}))))})),U=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(){}}))))},R=function(e){return Object(r.createElement)(I.BlockPreview,e)},q=function(e){var t=e.blocks,n=e.viewportWidth,a=e.title,o=Object(r.useRef)(null),l=Object(r.useState)(n),s=d()(l,2),c=s[0],p=s[1],u=Object(r.useState)({scale:1,offset:120}),m=d()(u,2),f=m[0],b=m[1],g=Object(r.useReducer)((function(e){return e+1}),0),O=d()(g,2),v=O[0],h=O[1],j=function(){o&&o.current&&setTimeout((function(){var e=o.current.querySelector(".block-editor-block-preview__content");if(e){var t=parseFloat(Object(S.get)(e,["style","transform"],"").replace("scale(","").replace(")",""));if(t)b({scale:t,offset:120*t})}}),500)},y=Object(r.useCallback)((function(){if(o&&o.current){var e=o.current.clientWidth;p(e>=n?e:n)}}),[n]);return Object(r.useLayoutEffect)((function(){y(),j()}),[t,y]),Object(r.useEffect)((function(){if(t&&t.length){var e=function(){y(),j(),h()},n=Object(S.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,y]),Object(S.isEmpty)(t)||!Object(S.isArray)(t)?Object(r.createElement)("div",{className:N()("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)(C.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)(U,{title:a,scale:f.scale}),Object(r.createElement)("div",{className:"template-selector-preview__offset-correction",style:{top:f.offset}},Object(r.createElement)(R,{key:v,blocks:t,viewportWidth:c})))))))};window._tkq=window._tkq||[];var z=null,Q=function(e,t){z&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_view",{blog_id:z.blogid,segment_id:e,vertical_id:t}])},V=function(e,t){z&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_dismiss",{blog_id:z.blogid,segment_id:e,vertical_id:t}])},H=function(e,t,n){z&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_template_selected",{blog_id:z.blogid,segment_id:e,vertical_id:t,template:n}])},Y=n(21),J=n.n(Y),K=n(22),X=function(e,t,n){var r=e[t=Object(K.removeQueryArgs)(t,"w","s")]||{url:t,usages:[]};return c()({},e,k()({},t,c()({},r,{usages:[].concat(u()(r.usages),u()(n))})))},Z=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=X(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=X(t.assets,i,[{prop:"url",path:[n.clientId,"attributes","mediaUrl"]},{prop:"id",path:[n.clientId,"attributes","mediaId"]}]));case"core/gallery":Object(S.forEach)(n.attributes.images,(function(e,r){t.assets=X(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(S.isEmpty)(n.innerBlocks)?t:Object(S.reduce)(n.innerBlocks,e,t)},$=function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,regeneratorRuntime.awrap(J()({method:"POST",path:"/fse/v1/sideload/image/batch",data:{resources:Object(S.map)(e)}}).then((function(t){return Object(S.reduce)(e,(function(e,n){var r=t.shift(),i=r.id,a=r.source_url;return c()({},e,k()({},n.url,{id:i,url:a}))}),{})})));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))},ee=function(e,t){return Object(S.forEach)(e.assets,(function(n){var r=t[n.url];r&&Object(S.forEach)(n.usages,(function(t){Object(S.set)(e.blocksByClientId,t.path,r[t.prop])}))})),e.blocks},te=function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=Object(S.reduce)(e,Z,{assets:{},blocksByClientId:{},blocks:e}),!Object(S.isEmpty)(t.assets)){n.next=3;break}return n.abrupt("return",e);case 3:return n.abrupt("return",$(t.assets).then((function(e){return ee(t,e)})));case 4:case"end":return n.stop()}}))},ne="maywood",re=function(e){function t(){var e,n;b()(this,t);for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];return n=h()(this,(e=y()(t)).call.apply(e,[this].concat(o))),k()(w()(n),"state",{isLoading:!1,previewedTemplate:null,error:null,isOpen:!1}),k()(w()(n),"getTitlesByTemplateSlugs",Object(S.memoize)((function(e){return Object(S.mapValues)(Object(S.keyBy)(e,"slug"),"title")}))),k()(w()(n),"getBlocksByTemplateSlugs",Object(S.memoize)((function(e){return Object(S.reduce)(e,(function(e,t){var r=t.slug,i=t.content;return e[r]=i?Object(A.parse)(F(i,n.props.siteInformation)):[],e}),{})}))),k()(w()(n),"setTemplate",(function(e){H(n.props.segment.id,n.props.vertical.id,e),n.props.saveTemplateChoice(e);var t=Object(S.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})})),k()(w()(n),"maybePrefetchAssets",(function(e){return n.props.shouldPrefetchAssets?te(e):Promise.resolve(e)})),k()(w()(n),"handleConfirmation",(function(e){"string"!=typeof e&&(e=n.state.previewedTemplate),n.setTemplate(e),n.props.isPromptedFromSidebar&&n.props.toggleTemplateModal()})),k()(w()(n),"previewTemplate",(function(e){n.setState({previewedTemplate:e}),window.matchMedia("(min-width: 660px)").matches||n.handleConfirmation(e)})),k()(w()(n),"closeModal",(function(e){if(e.target.matches("button.template-selector-item__label"))return!1;V(n.props.segment.id,n.props.vertical.id);var t=Object(S.get)(window,["calypsoifyGutenberg","closeUrl"]);window.top.location=t||"edit.php?post_type=page"})),k()(w()(n),"getTemplateGroups",(function(){var e=Object(S.partition)(n.props.templates,{category:"home"}),t=d()(e,2),r=t[0],i=t[1],a=Object(S.find)(n.props.templates,{slug:n.props.theme})||Object(S.find)(n.props.templates,{slug:ne});if(!n.props.isFrontPage||!a)return{homepageTemplates:Object(S.sortBy)(r,"title"),defaultTemplates:i};var o=Object(S.reject)(r,{slug:a.slug});return{homepageTemplates:[a].concat(u()(Object(S.sortBy)(o,"title"))),defaultTemplates:i}})),k()(w()(n),"renderTemplatesList",(function(e,t){return Object(r.createElement)("fieldset",{className:"page-template-modal__list"},Object(r.createElement)("legend",{className:"page-template-modal__form-title"},t),Object(r.createElement)(G,{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 T()(t,e),O()(t,[{key:"componentDidMount",value:function(){this.state.isOpen&&Q(this.props.segment.id,this.props.vertical.id)}},{key:"componentDidUpdate",value:function(e,t){!t.isOpen&&this.state.isOpen&&Q(this.props.segment.id,this.props.vertical.id),(this.props.isWelcomeGuideActive||this.props.areTipsEnabled)&&this.props.hideWelcomeGuide()}},{key:"getBlocksByTemplateSlug",value:function(e){return Object(S.get)(this.getBlocksByTemplateSlugs(this.props.templates),[e],[])}},{key:"getTitleByTemplateSlug",value:function(e){return Object(S.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 l=this.getTemplateGroups(),s=l.homepageTemplates,c=l.defaultTemplates;return Object(r.createElement)(C.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)(C.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)(C.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)(C.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?Object(r.createElement)(r.Fragment,null,this.renderTemplatesList(s,Object(i.__)("Recommended Layouts","full-site-editing")),this.renderTemplatesList(c,Object(i.__)("Other Page Layouts","full-site-editing"))):Object(r.createElement)(r.Fragment,null,this.renderTemplatesList(c,Object(i.__)("Recommended Layouts","full-site-editing")),this.renderTemplatesList(s,Object(i.__)("Homepage Layouts","full-site-editing")))),Object(r.createElement)(q,{blocks:this.getBlocksByTemplateSlug(t),viewportWidth:960,title:this.getTitleByTemplateSlug(t)}))),Object(r.createElement)("div",{className:N()("page-template-modal__buttons",{"is-visually-hidden":Object(S.isEmpty)(t)||a})},Object(r.createElement)(C.Button,{isPrimary:!0,isLarge:!0,disabled:Object(S.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(S.isEmpty)(e.templates)?null:{isOpen:!0,previewedTemplate:t.getDefaultSelectedTemplate(e)}}}]),t}(r.Component);k()(re,"getDefaultSelectedTemplate",(function(e){var t=Object(S.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(S.find)(e.templates,{slug:r})?r:Object(S.find)(e.templates,{slug:ne})?ne:t}));var ie,ae=Object(B.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()}}})))(re),oe=function(e){function t(){var e,n;b()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=h()(this,(e=y()(t)).call.apply(e,[this].concat(i))),k()(w()(n),"state",{isTemplateModalOpen:!1,isWarningOpen:!1}),k()(w()(n),"toggleTemplateModal",(function(){n.setState({isTemplateModalOpen:!n.state.isTemplateModalOpen})})),k()(w()(n),"toggleWarningModal",(function(){n.setState({isWarningOpen:!n.state.isWarningOpen})})),k()(w()(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 T()(t,e),O()(t,[{key:"render",value:function(){var e=this.getLastTemplateUsed(),t=e.slug,n=e.title,a=e.preview,o=e.previewAlt,l=this.props,s=l.isFrontPage,c=l.templates,p=l.theme,u=l.vertical,m=l.segment,d=l.siteInformation;return Object(r.createElement)("div",{className:"sidebar-modal-opener"},Object(r.createElement)(L,{id:"sidebar-modal-opener__last-template-used-preview",value:t,label:F(n,d),staticPreviewImg:a,staticPreviewImgAlt:o,onSelect:this.toggleWarningModal}),Object(r.createElement)(C.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:p,vertical:u,segment:m,toggleTemplateModal:this.toggleTemplateModal,isFrontPage:s,isPromptedFromSidebar:!0}),this.state.isWarningOpen&&Object(r.createElement)(C.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)(C.Button,{isDefault:!0,onClick:this.toggleWarningModal},Object(i.__)("Cancel")),Object(r.createElement)(C.Button,{isPrimary:!0,onClick:this.toggleTemplateModal},Object(i.__)("Change Layout")))))}}]),t}(r.Component),le=Object(B.compose)(Object(o.withSelect)((function(e){return{lastTemplateUsedSlug:e("core/editor").getEditedPostAttribute("meta")._starter_page_template}})))(oe),se=window.starterPageTemplatesConfig,ce=se.templates,pe=void 0===ce?[]:ce,ue=se.vertical,me=se.segment,de=se.tracksUserData,fe=se.siteInformation,be=void 0===fe?{}:fe,ge=se.screenAction,Oe=se.theme,ve=se.isFrontPage;de&&(z=ie=de,window._tkq.push(["identifyUser",ie.userid,ie.username])),"add"===ge&&Object(a.registerPlugin)("page-templates",{render:function(){return Object(r.createElement)(ae,{isFrontPage:ve,segment:me,shouldPrefetchAssets:!1,templates:pe,theme:Oe,vertical:ue})}}),Object(a.registerPlugin)("page-templates-sidebar",{render:function(){return Object(r.createElement)(l.PluginDocumentSettingPanel,{name:"Template Modal Opener",title:Object(i.__)("Page Layout"),className:"page-template-modal__sidebar",icon:"none"},Object(r.createElement)(le,{isFrontPage:ve,segment:me,siteInformation:be,templates:pe,theme:Oe,vertical:ue}))}});var he=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"),he()}))}]));
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()}))}]));
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:1.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fit,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 (max-width:659px){.template-selector-control__template:first-child .template-selector-item__preview-wrap{padding-top:0;height:70px}.template-selector-control__template:first-child .template-selector-item__template-title{height:70px;line-height:70px}}@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>.editor-inner-blocks>.editor-block-list__layout>[data-type="core/column"]>.editor-block-list__block-edit>div>.block-core-columns>.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}}.block-editor-block-preview__container .editor-styles-wrapper .block-editor-block-list__block,.block-editor-block-preview__container .editor-styles-wrapper .block-editor-block-list__layout{padding:inherit}.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 .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}
starter-page-templates/page-template-modal/components/template-selector-item.js CHANGED
@@ -65,9 +65,6 @@ const TemplateSelectorItem = props => {
65
  aria-labelledby={ `${ id } ${ labelId }` }
66
  >
67
  <div className="template-selector-item__preview-wrap">{ innerPreview }</div>
68
- <span className="template-selector-item__template-title" id={ labelId }>
69
- { label }
70
- </span>
71
  </button>
72
  );
73
  };
65
  aria-labelledby={ `${ id } ${ labelId }` }
66
  >
67
  <div className="template-selector-item__preview-wrap">{ innerPreview }</div>
 
 
 
68
  </button>
69
  );
70
  };
starter-page-templates/page-template-modal/index.js CHANGED
@@ -2,18 +2,7 @@
2
  /**
3
  * External dependencies
4
  */
5
- import {
6
- find,
7
- isEmpty,
8
- reduce,
9
- get,
10
- keyBy,
11
- mapValues,
12
- memoize,
13
- partition,
14
- reject,
15
- sortBy,
16
- } from 'lodash';
17
  import classnames from 'classnames';
18
  import '@wordpress/nux';
19
  import { __, sprintf } from '@wordpress/i18n';
@@ -223,43 +212,42 @@ class PageTemplateModal extends Component {
223
  }
224
 
225
  getTemplateGroups = () => {
226
- const [ homepageTemplates, defaultTemplates ] = partition( this.props.templates, {
227
- category: 'home',
228
- } );
229
-
230
- const currentThemeTemplate =
231
- find( this.props.templates, { slug: this.props.theme } ) ||
232
- find( this.props.templates, { slug: DEFAULT_HOMEPAGE_TEMPLATE } );
 
 
 
 
 
 
 
233
 
234
- if ( ! this.props.isFrontPage || ! currentThemeTemplate ) {
235
- return { homepageTemplates: sortBy( homepageTemplates, 'title' ), defaultTemplates };
 
236
  }
237
 
238
- const otherHomepageTemplates = reject( homepageTemplates, { slug: currentThemeTemplate.slug } );
239
-
240
- const sortedHomepageTemplates = [
241
- currentThemeTemplate,
242
- ...sortBy( otherHomepageTemplates, 'title' ),
243
- ];
244
-
245
- return { homepageTemplates: sortedHomepageTemplates, defaultTemplates };
 
 
 
 
 
 
246
  };
247
 
248
- renderTemplatesList = ( templatesList, legendLabel ) => (
249
- <fieldset className="page-template-modal__list">
250
- <legend className="page-template-modal__form-title">{ legendLabel }</legend>
251
- <TemplateSelectorControl
252
- label={ __( 'Layout', 'full-site-editing' ) }
253
- templates={ templatesList }
254
- blocksByTemplates={ this.getBlocksByTemplateSlugs( this.props.templates ) }
255
- onTemplateSelect={ this.previewTemplate }
256
- useDynamicPreview={ false }
257
- siteInformation={ this.props.siteInformation }
258
- selectedTemplate={ this.state.previewedTemplate }
259
- />
260
- </fieldset>
261
- );
262
-
263
  render() {
264
  const { previewedTemplate, isOpen, isLoading } = this.state;
265
  const { isPromptedFromSidebar } = this.props;
@@ -268,7 +256,19 @@ class PageTemplateModal extends Component {
268
  return null;
269
  }
270
 
271
- const { homepageTemplates, defaultTemplates } = this.getTemplateGroups();
 
 
 
 
 
 
 
 
 
 
 
 
272
 
273
  return (
274
  <Modal
@@ -305,29 +305,64 @@ class PageTemplateModal extends Component {
305
  ) : (
306
  <>
307
  <form className="page-template-modal__form">
308
- { this.props.isFrontPage ? (
309
- <>
310
- { this.renderTemplatesList(
311
- homepageTemplates,
312
- __( 'Recommended Layouts', 'full-site-editing' )
313
- ) }
314
- { this.renderTemplatesList(
315
- defaultTemplates,
316
- __( 'Other Page Layouts', 'full-site-editing' )
317
- ) }
318
- </>
319
- ) : (
320
- <>
321
- { this.renderTemplatesList(
322
- defaultTemplates,
323
- __( 'Recommended Layouts', 'full-site-editing' )
324
- ) }
325
- { this.renderTemplatesList(
326
- homepageTemplates,
327
- __( 'Homepage Layouts', 'full-site-editing' )
328
- ) }
329
- </>
330
  ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  </form>
332
  <TemplateSelectorPreview
333
  blocks={ this.getBlocksByTemplateSlug( previewedTemplate ) }
2
  /**
3
  * External dependencies
4
  */
5
+ import { find, isEmpty, reduce, get, keyBy, mapValues, memoize, filter, sortBy } from 'lodash';
 
 
 
 
 
 
 
 
 
 
 
6
  import classnames from 'classnames';
7
  import '@wordpress/nux';
8
  import { __, sprintf } from '@wordpress/i18n';
212
  }
213
 
214
  getTemplateGroups = () => {
215
+ return {
216
+ blankTemplate: filter( this.props.templates, { slug: 'blank' } ),
217
+ aboutTemplates: filter( this.props.templates, { category: 'about' } ),
218
+ blogTemplates: filter( this.props.templates, { category: 'blog' } ),
219
+ contactTemplates: filter( this.props.templates, { category: 'contact' } ),
220
+ eventTemplates: filter( this.props.templates, { category: 'event' } ),
221
+ menuTemplates: filter( this.props.templates, { category: 'menu' } ),
222
+ portfolioTemplates: filter( this.props.templates, { category: 'portfolio' } ),
223
+ productTemplates: filter( this.props.templates, { category: 'product' } ),
224
+ servicesTemplates: filter( this.props.templates, { category: 'services' } ),
225
+ teamTemplates: filter( this.props.templates, { category: 'team' } ),
226
+ homepageTemplates: sortBy( filter( this.props.templates, { category: 'home' } ), 'title' ),
227
+ };
228
+ };
229
 
230
+ renderTemplatesList = ( templatesList, legendLabel ) => {
231
+ if ( 0 === templatesList.length ) {
232
+ return null;
233
  }
234
 
235
+ return (
236
+ <fieldset className="page-template-modal__list">
237
+ <legend className="page-template-modal__form-title">{ legendLabel }</legend>
238
+ <TemplateSelectorControl
239
+ label={ __( 'Layout', 'full-site-editing' ) }
240
+ templates={ templatesList }
241
+ blocksByTemplates={ this.getBlocksByTemplateSlugs( this.props.templates ) }
242
+ onTemplateSelect={ this.previewTemplate }
243
+ useDynamicPreview={ false }
244
+ siteInformation={ this.props.siteInformation }
245
+ selectedTemplate={ this.state.previewedTemplate }
246
+ />
247
+ </fieldset>
248
+ );
249
  };
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  render() {
252
  const { previewedTemplate, isOpen, isLoading } = this.state;
253
  const { isPromptedFromSidebar } = this.props;
256
  return null;
257
  }
258
 
259
+ const {
260
+ blankTemplate,
261
+ aboutTemplates,
262
+ blogTemplates,
263
+ contactTemplates,
264
+ eventTemplates,
265
+ menuTemplates,
266
+ portfolioTemplates,
267
+ productTemplates,
268
+ servicesTemplates,
269
+ teamTemplates,
270
+ homepageTemplates,
271
+ } = this.getTemplateGroups();
272
 
273
  return (
274
  <Modal
305
  ) : (
306
  <>
307
  <form className="page-template-modal__form">
308
+ { this.props.isFrontPage &&
309
+ this.renderTemplatesList(
310
+ homepageTemplates,
311
+ __( 'Home Pages', 'full-site-editing' )
312
+ ) }
313
+
314
+ { this.renderTemplatesList( blankTemplate, __( 'Blank', 'full-site-editing' ) ) }
315
+
316
+ { this.renderTemplatesList(
317
+ aboutTemplates,
318
+ __( 'About Pages', 'full-site-editing' )
319
+ ) }
320
+
321
+ { this.renderTemplatesList(
322
+ blogTemplates,
323
+ __( 'Blog Pages', 'full-site-editing' )
 
 
 
 
 
 
324
  ) }
325
+
326
+ { this.renderTemplatesList(
327
+ contactTemplates,
328
+ __( 'Contact Pages', 'full-site-editing' )
329
+ ) }
330
+
331
+ { this.renderTemplatesList(
332
+ eventTemplates,
333
+ __( 'Event Pages', 'full-site-editing' )
334
+ ) }
335
+
336
+ { this.renderTemplatesList(
337
+ menuTemplates,
338
+ __( 'Menu Pages', 'full-site-editing' )
339
+ ) }
340
+
341
+ { this.renderTemplatesList(
342
+ portfolioTemplates,
343
+ __( 'Portfolio Pages', 'full-site-editing' )
344
+ ) }
345
+
346
+ { this.renderTemplatesList(
347
+ productTemplates,
348
+ __( 'Product Pages', 'full-site-editing' )
349
+ ) }
350
+
351
+ { this.renderTemplatesList(
352
+ servicesTemplates,
353
+ __( 'Services Pages', 'full-site-editing' )
354
+ ) }
355
+
356
+ { this.renderTemplatesList(
357
+ teamTemplates,
358
+ __( 'Team Pages', 'full-site-editing' )
359
+ ) }
360
+
361
+ { ! this.props.isFrontPage &&
362
+ this.renderTemplatesList(
363
+ homepageTemplates,
364
+ __( 'Home Pages', 'full-site-editing' )
365
+ ) }
366
  </form>
367
  <TemplateSelectorPreview
368
  blocks={ this.getBlocksByTemplateSlug( previewedTemplate ) }
starter-page-templates/page-template-modal/styles/starter-page-templates-editor.scss CHANGED
@@ -136,12 +136,12 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
136
  .template-selector-control__options {
137
  display: grid;
138
  grid-template-columns: 1fr;
139
- grid-gap: 1.75em;
140
 
141
  @media screen and ( min-width: $breakpoint-mobile ) {
142
  margin-top: 0;
143
  grid-template-columns: repeat(
144
- auto-fit,
145
  minmax( 110px, 1fr )
146
  ); // allow grid to take over number of cols on large screens
147
  }
@@ -238,20 +238,6 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
238
  left: 0;
239
  }
240
 
241
- // Blank template
242
- @media screen and ( max-width: ( $breakpoint-mobile - 1px ) ) {
243
- .template-selector-control__template:first-child {
244
- .template-selector-item__preview-wrap {
245
- padding-top: 0%;
246
- height: $template-selector-blank-template-mobile-height;
247
- }
248
- .template-selector-item__template-title {
249
- height: $template-selector-blank-template-mobile-height;
250
- line-height: $template-selector-blank-template-mobile-height;
251
- }
252
- }
253
- }
254
-
255
  .page-template-modal__form {
256
  @media screen and ( min-width: $breakpoint-mobile ) {
257
  max-width: 20%;
@@ -386,51 +372,43 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
386
 
387
  // Preview adjustments.
388
  // Tweak styles which are inside of the preview container.
389
- .block-editor-block-preview__container {
390
- .editor-styles-wrapper {
391
- .wp-block {
392
- width: 100%;
393
- }
394
 
395
- // `core/cover`
396
- .wp-block[data-type='core/cover'][data-align='full'] {
397
- margin: 0;
398
- .wp-block-cover {
399
- padding: 0;
400
- }
401
  }
 
402
 
403
- // `core/columns`
404
- /* stylelint-disable selector-combinator-space-before */
405
- .wp-block-columns
406
- > .editor-inner-blocks
407
- > .editor-block-list__layout
408
- > [data-type='core/column']
409
- > .editor-block-list__block-edit
410
- > div
411
- > .block-core-columns
412
- > .editor-inner-blocks {
413
- /* stylelint-enable */
414
- margin-top: 0;
415
- margin-bottom: 0;
 
 
 
 
 
416
  }
417
 
418
- .block-editor-block-list__block {
419
- &[data-align='full'] {
420
  margin: 0;
421
  }
422
-
423
- .block-editor-block-list__block-edit {
424
- @media screen and ( min-width: 600px ) {
425
- margin: 0;
426
- }
427
- }
428
- }
429
-
430
- // Fix upstream: https://github.com/WordPress/gutenberg/pull/17202.
431
- .block-editor-block-list__layout,
432
- .block-editor-block-list__block {
433
- padding: inherit;
434
  }
435
  }
436
  }
136
  .template-selector-control__options {
137
  display: grid;
138
  grid-template-columns: 1fr;
139
+ grid-gap: 0.75em;
140
 
141
  @media screen and ( min-width: $breakpoint-mobile ) {
142
  margin-top: 0;
143
  grid-template-columns: repeat(
144
+ auto-fill,
145
  minmax( 110px, 1fr )
146
  ); // allow grid to take over number of cols on large screens
147
  }
238
  left: 0;
239
  }
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  .page-template-modal__form {
242
  @media screen and ( min-width: $breakpoint-mobile ) {
243
  max-width: 20%;
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
  }
starter-page-templates/page-template-modal/utils/ensure-assets.js CHANGED
@@ -11,42 +11,42 @@ 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".
22
  * @property {Array<GutenbergBlock>} innerBlocks Nested blocks.
23
- * @property {Object} attributes An object with attributes, different for each block type.
24
  */
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.
31
  */
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.
38
  */
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 +166,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
+ * @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".
22
  * @property {Array<GutenbergBlock>} innerBlocks Nested blocks.
23
+ * @property {object} attributes An object with attributes, different for each block type.
24
  */
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.
31
  */
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.
38
  */
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
  * 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 ) => {