Version Description
- Fix issue with Newspack blocks not loading assets.
- Fix block-editor NUX issues.
Download this release
Release Info
Developer | obenland |
Plugin | Full Site Editing |
Version | 1.8 |
Comparing to | |
See all releases |
Code changes from version 1.7 to 1.8
- full-site-editing-plugin.php +2 -2
- newspack-blocks/dist/blog-posts-block-editor.asset.php +1 -1
- newspack-blocks/dist/blog-posts-block-editor.js +2 -2
- newspack-blocks/index.php +1 -1
- newspack-blocks/synced-newspack-blocks/blocks/carousel/view.php +4 -0
- newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/edit.js +6 -5
- newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/templates/article.php +11 -5
- newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/view.php +3 -0
- newspack-blocks/synced-newspack-blocks/class-newspack-blocks-api.php +25 -0
- newspack-blocks/synced-newspack-blocks/class-newspack-blocks.php +26 -0
- readme.txt +5 -1
- wpcom-block-editor-nux/dist/wpcom-block-editor-nux.asset.php +1 -1
- wpcom-block-editor-nux/dist/wpcom-block-editor-nux.css +1 -1
- wpcom-block-editor-nux/dist/wpcom-block-editor-nux.rtl.css +1 -1
- wpcom-block-editor-nux/src/style.scss +107 -16
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: 1.
|
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', '1.
|
39 |
|
40 |
// Always include these helper files for dotcom FSE.
|
41 |
require_once __DIR__ . '/dotcom-fse/helpers.php';
|
2 |
/**
|
3 |
* Plugin Name: Full Site Editing
|
4 |
* Description: Enhances your page creation workflow within the Block Editor.
|
5 |
+
* Version: 1.8
|
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', '1.8' );
|
39 |
|
40 |
// Always include these helper files for dotcom FSE.
|
41 |
require_once __DIR__ . '/dotcom-fse/helpers.php';
|
newspack-blocks/dist/blog-posts-block-editor.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-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'dadafebef3b4beca04fda7bf0e15b515');
|
newspack-blocks/dist/blog-posts-block-editor.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
!function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(o){if(t[o])return t[o].exports;var
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
-
*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var c=typeof o;if("string"===c||"number"===c)e.push(o);else if(Array.isArray(o)&&o.length){var a=r.apply(null,o);a&&e.push(a)}else if("object"===c)for(var i in o)n.call(o,i)&&o[i]&&e.push(i)}}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.compose}()},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){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){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},function(e,t,n){var o=n(29),r=n(4);e.exports=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?r(e):t}},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,n){var o=n(21);e.exports=function(e){if(Array.isArray(e))return o(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,n){var o=n(21);e.exports=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var o=n(9),r=n.n(o),c=n(16),a=n(1),i=n(17),s=n(0),l=n(2),u=n(12),p=n.n(u),f=n(18),d=n.n(f),h=n(4),g=n.n(h),b=n(13),m=n.n(b),O=n(14),y=n.n(O),j=n(3),v=n.n(j),w=n(22),_=n.n(w),k=n(6),S=n.n(k),E=n(7),C=n(5),P=n(19),x=n.n(P),A=n(11),T=(n(34),function(e){m()(n,e);var t=y()(n);function n(e){var o;return p()(this,n),o=t.call(this,e),v()(g()(o),"isFetchingInfoOnLoad",(function(){var e=o.props,t=e.tokens,n=e.fetchSavedInfo;return Boolean(t.length&&n)})),o.state={suggestions:[],validValues:{},loading:o.isFetchingInfoOnLoad()},o.debouncedUpdateSuggestions=Object(A.debounce)(o.updateSuggestions,500),o}return d()(n,[{key:"componentDidMount",value:function(){var e=this;if(this.isFetchingInfoOnLoad()){var t=this.props,n=t.tokens;(0,t.fetchSavedInfo)(n).then((function(t){var n=e.state.validValues;t.forEach((function(e){n[e.value]=e.label})),e.setState({validValues:n,loading:!1})}))}}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest,this.debouncedUpdateSuggestions.cancel()}},{key:"getLabelsForValues",value:function(e){var t=this.state.validValues;return e.reduce((function(e,n){return t[n]?[].concat(x()(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,r=[];e.forEach((function(e){r.push(e.label),n[e.value]=e.label})),t.setState({suggestions:r,validValues:n,loading:!1})}})).catch((function(){t.suggestionsRequest===o&&t.setState({loading:!1})})),t.suggestionsRequest=o}))}},{key:"handleOnChange",value:function(e){(0,this.props.onChange)(this.getValuesForLabels(e))}},{key:"getTokens",value:function(){var e=this.props.tokens;return this.getLabelsForValues(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.help,o=t.label,r=void 0===o?"":o,c=this.state,a=c.suggestions,i=c.loading;return Object(s.createElement)("div",{className:"autocomplete-tokenfield"},Object(s.createElement)(l.FormTokenField,{value:this.getTokens(),suggestions:a,onChange:function(t){return e.handleOnChange(t)},onInputChange:function(t){return e.debouncedUpdateSuggestions(t)},label:r}),i&&Object(s.createElement)(l.Spinner,null),n&&Object(s.createElement)("p",{className:"autocomplete-tokenfield__help"},n))}}]),n}(s.Component)),I=function(e){m()(n,e);var t=y()(n);function n(){var e;p()(this,n);for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return e=t.call.apply(t,[this].concat(r)),v()(g()(e),"state",{showAdvancedFilters:!1}),v()(g()(e),"fetchPostSuggestions",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.title)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchSavedPosts",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.title.rendered)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchAuthorSuggestions",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no name)","newspack-blocks")}}))}))})),v()(g()(e),"fetchSavedAuthors",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no name)","newspack-blocks")}}))}))})),v()(g()(e),"fetchCategorySuggestions",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchSavedCategories",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchTagSuggestions",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchSavedTags",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"render",(function(){var t=e.props,n=t.specificMode,o=t.onSpecificModeChange,r=t.specificPosts,c=t.onSpecificPostsChange,i=t.authors,u=t.onAuthorsChange,p=t.categories,f=t.onCategoriesChange,d=t.tags,h=t.onTagsChange,g=t.tagExclusions,b=t.onTagExclusionsChange,m=t.enableSpecific,O=e.state.showAdvancedFilters;return[m&&Object(s.createElement)(l.ToggleControl,{key:"specificMode",checked:n,onChange:o,label:Object(a.__)("Choose Specific Posts","newspack-blocks")}),n&&Object(s.createElement)(T,{key:"posts",tokens:r||[],onChange:c,fetchSuggestions:e.fetchPostSuggestions,fetchSavedInfo:e.fetchSavedPosts,label:Object(a.__)("Posts","newspack-blocks"),help:Object(a.__)("Begin typing post title, click autocomplete result to select.","newspack-blocks")}),!n&&Object(s.createElement)(l.QueryControls,_()({key:"queryControls"},e.props)),!n&&u&&Object(s.createElement)(T,{key:"authors",tokens:i||[],onChange:u,fetchSuggestions:e.fetchAuthorSuggestions,fetchSavedInfo:e.fetchSavedAuthors,label:Object(a.__)("Authors","newspack-blocks")}),!n&&f&&Object(s.createElement)(T,{key:"categories",tokens:p||[],onChange:f,fetchSuggestions:e.fetchCategorySuggestions,fetchSavedInfo:e.fetchSavedCategories,label:Object(a.__)("Categories","newspack-blocks")}),!n&&h&&Object(s.createElement)(T,{key:"tags",tokens:d||[],onChange:h,fetchSuggestions:e.fetchTagSuggestions,fetchSavedInfo:e.fetchSavedTags,label:Object(a.__)("Tags","newspack-blocks")}),!n&&b&&Object(s.createElement)("p",{key:"toggle-advanced-filters"},Object(s.createElement)(l.Button,{isLink:!0,onClick:function(){return e.setState({showAdvancedFilters:!O})}},O?Object(a.__)("Hide Advanced Filters","newspack-blocks"):Object(a.__)("Show Advanced Filters","newspack-blocks"))),!n&&b&&O&&Object(s.createElement)(T,{key:"tag-exclusion",tokens:g||[],onChange:b,fetchSuggestions:e.fetchTagSuggestions,fetchSavedInfo:e.fetchSavedTags,label:Object(a.__)("Excluded Tags","newspack-blocks")})]})),e}return n}(s.Component);I.defaultProps={enableSpecific:!0,specificPosts:[],authors:[],categories:[],tags:[],tagExclusions:[]};var B,M=I,D=n(10),H=n(15),L=H.name,N={queryBlocks:[],postsByBlock:{},specificPostsByBlock:{}},R={updateBlocks:function(e){return{type:"UPDATE_BLOCKS",blocks:e}},markPostsAsDisplayed:function(e,t){return{type:"MARK_POSTS_DISPLAYED",clientId:e,posts:t}},markSpecificPostsAsDisplayed:function(e,t){return{type:"MARK_SPECIFIC_POSTS_DISPLAYED",clientId:e,posts:t}}},V={previousPostIds:function(e,t){var n,o,r,c=e.queryBlocks,a=e.specificPostsByBlock,i=e.postsByBlock,s=c.filter((function(e){var t=e.clientId;return a[t]})).flatMap((function(e){var t=e.clientId;return a[t].map((function(e){return e.id}))})),l=(n=c,o=t,r=n.findIndex((function(e){return e.clientId===o})),n.slice(0,r)).filter((function(e){var t=e.clientId;return i[t]})).flatMap((function(e){var t=e.clientId;return i[t].map((function(e){return e.id}))}));return Object(A.uniq)(s.concat(l)).sort()}},z=function(){return"object"==typeof window&&window.wpcomGutenberg&&-1===Number(window.wpcomGutenberg.blogPublic)},F=function(e){var t=e.specificMode,n=e.specificPosts;return t&&n&&n.length},q=function(e){return e.map((function(e){return Object(s.createElement)("span",{className:"avatar author-avatar",key:e.id},Object(s.createElement)("a",{className:"url fn n",href:e.author_link},Object(s.createElement)(s.RawHTML,null,e.avatar)))}))},G=function(e){return Object(s.createElement)("span",{className:"byline"},Object(a._x)("by","post author","newspack-blocks")," ",e.reduce((function(t,n,o){return[].concat(x()(t),[Object(s.createElement)("span",{className:"author vcard",key:n.id},Object(s.createElement)("a",{className:"url fn n",href:n.author_link},n.display_name)),o<e.length-2&&", ",e.length>1&&o===e.length-2&&Object(a._x)(" and ","post author","newspack-blocks")])}),[]))},Q=n(23),U=n.n(Q),K=n(20),Y=n(8),W=n(24);"object"==typeof window&&window.newspackIsPostSubtitleSupported&&window.newspackIsPostSubtitleSupported.post_subtitle&&(B=!0);var J=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),X=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),$=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),Z=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),ee=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),te=function(e){m()(n,e);var t=y()(n);function n(){var e;p()(this,n);for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return e=t.call.apply(t,[this].concat(r)),v()(g()(e),"renderPost",(function(t){var n=e.props.attributes,o=n.showImage,r=n.imageShape,c=n.mediaPosition,a=n.minHeight,i=n.showCaption,l=n.showExcerpt,u=n.showSubtitle,p=n.showAuthor,f=n.showAvatar,d=n.showDate,h=n.showCategory,g=n.sectionHeader,b={minHeight:"behind"===c&&o&&t.newspack_featured_image_src&&a+"vh",paddingTop:"behind"===c&&o&&t.newspack_featured_image_src&&a/5+"vh"},m=e.titleForPost(t),O=Object(K.__experimentalGetSettings)().formats.date;return Object(s.createElement)("article",{className:t.newspack_featured_image_src?"post-has-image":null,key:t.id,style:b},o&&t.newspack_featured_image_src&&Object(s.createElement)("figure",{className:"post-thumbnail",key:"thumbnail"},Object(s.createElement)("a",{href:"#"},"landscape"===r&&Object(s.createElement)("img",{src:t.newspack_featured_image_src.landscape,alt:""}),"portrait"===r&&Object(s.createElement)("img",{src:t.newspack_featured_image_src.portrait,alt:""}),"square"===r&&Object(s.createElement)("img",{src:t.newspack_featured_image_src.square,alt:""}),"uncropped"===r&&Object(s.createElement)("img",{src:t.newspack_featured_image_src.uncropped,alt:""})),i&&""!==t.newspack_featured_image_caption&&Object(s.createElement)("figcaption",null,t.newspack_featured_image_caption)),Object(s.createElement)("div",{className:"entry-wrapper"},h&&t.newspack_category_info.length&&Object(s.createElement)("div",{className:"cat-links"},Object(s.createElement)("a",{href:"#"},Object(C.decodeEntities)(t.newspack_category_info))),Y.RichText.isEmpty(g)?Object(s.createElement)("h2",{className:"entry-title",key:"title"},Object(s.createElement)("a",{href:"#"},m)):Object(s.createElement)("h3",{className:"entry-title",key:"title"},Object(s.createElement)("a",{href:"#"},m)),B&&u&&Object(s.createElement)(s.RawHTML,{key:"subtitle",className:"newspack-post-subtitle newspack-post-subtitle--in-homepage-block"},t.meta.newspack_post_subtitle||""),l&&Object(s.createElement)(s.RawHTML,{key:"excerpt",className:"excerpt-contain"},t.excerpt.rendered),Object(s.createElement)("div",{className:"entry-meta"},p&&f&&q(t.newspack_author_info),p&&G(t.newspack_author_info),d&&Object(s.createElement)("time",{className:"entry-date published",key:"pub-date"},Object(K.dateI18n)(O,t.date_gmt)))))})),v()(g()(e),"titleForPost",(function(e){return e.title?"string"==typeof e.title?Object(C.decodeEntities)(e.title.trim()):"object"==typeof e.title&&e.title.rendered?Object(C.decodeEntities)(e.title.rendered.trim()):void 0:""})),v()(g()(e),"renderInspectorControls",(function(){var t=e.props,n=t.attributes,o=t.setAttributes,r=t.textColor,c=t.setTextColor,i=n.authors,u=n.specificPosts,p=n.postsToShow,f=n.categories,d=n.columns,h=n.showImage,g=n.showCaption,b=n.imageScale,m=n.mobileStack,O=n.minHeight,y=n.moreButton,j=n.showExcerpt,v=n.showSubtitle,w=n.typeScale,_=n.showDate,k=n.showAuthor,S=n.showAvatar,E=n.showCategory,C=n.postLayout,P=n.mediaPosition,x=n.specificMode,A=n.tags,T=n.tagExclusions,I=[{value:1,label:Object(a.__)("Small","full-site-editing"),shortName:Object(a.__)("S","full-site-editing")},{value:2,label:Object(a.__)("Medium","full-site-editing"),shortName:Object(a.__)("M","full-site-editing")},{value:3,label:Object(a.__)("Large","full-site-editing"),shortName:Object(a.__)("L","full-site-editing")},{value:4,label:Object(a.__)("Extra Large","newspack-blocks"),shortName:Object(a.__)("XL","newspack-blocks")}];return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(l.PanelBody,{title:Object(a.__)("Display Settings","full-site-editing"),initialOpen:!0},p&&Object(s.createElement)(M,{numberOfItems:p,onNumberOfItemsChange:function(e){return o({postsToShow:e})},specificMode:x,onSpecificModeChange:function(e){return o({specificMode:e})},specificPosts:u,onSpecificPostsChange:function(e){return o({specificPosts:e})},authors:i,onAuthorsChange:function(e){return o({authors:e})},categories:f,onCategoriesChange:function(e){return o({categories:e})},tags:A,onTagsChange:function(e){o({tags:e})},tagExclusions:T,onTagExclusionsChange:function(e){return o({tagExclusions:e})}}),"grid"===C&&Object(s.createElement)(l.RangeControl,{label:Object(a.__)("Columns","full-site-editing"),value:d,onChange:function(e){return o({columns:e})},min:2,max:6,required:!0}),!x&&!z()&&Object(s.createElement)(l.ToggleControl,{label:Object(a.__)('Show "More" Button',"full-site-editing"),checked:y,onChange:function(){return o({moreButton:!y})}})),Object(s.createElement)(l.PanelBody,{title:Object(a.__)("Featured Image Settings","full-site-editing")},Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Featured Image","full-site-editing"),checked:h,onChange:function(){return o({showImage:!h})}})),h&&Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Featured Image Caption","full-site-editing"),checked:g,onChange:function(){return o({showCaption:!g})}})),h&&"top"!==P&&"behind"!==P&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Stack on mobile","full-site-editing"),checked:m,onChange:function(){return o({mobileStack:!m})}})),Object(s.createElement)(l.BaseControl,{label:Object(a.__)("Featured Image Size","full-site-editing"),id:"newspackfeatured-image-size"},Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ButtonGroup,{id:"newspackfeatured-image-size","aria-label":Object(a.__)("Featured Image Size","full-site-editing")},I.map((function(e){var t=b===e.value;return Object(s.createElement)(l.Button,{isLarge:!0,isPrimary:t,"aria-pressed":t,"aria-label":e.label,key:e.value,onClick:function(){return o({imageScale:e.value})}},e.shortName)})))))),h&&"behind"===P&&Object(s.createElement)(l.RangeControl,{label:Object(a.__)("Minimum height","full-site-editing"),help:Object(a.__)("Sets a minimum height for the block, using a percentage of the screen's current height.","newspack-blocks"),value:O,onChange:function(e){return o({minHeight:e})},min:0,max:100,required:!0})),Object(s.createElement)(l.PanelBody,{title:Object(a.__)("Post Control Settings","full-site-editing")},B&&Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Subtitle","full-site-editing"),checked:v,onChange:function(){return o({showSubtitle:!v})}})),Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Excerpt","full-site-editing"),checked:j,onChange:function(){return o({showExcerpt:!j})}})),Object(s.createElement)(l.RangeControl,{className:"type-scale-slider",label:Object(a.__)("Type Scale","full-site-editing"),value:w,onChange:function(e){return o({typeScale:e})},min:1,max:10,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",required:!0})),Object(s.createElement)(Y.PanelColorSettings,{title:Object(a.__)("Color Settings","full-site-editing"),initialOpen:!0,colorSettings:[{value:r.color,onChange:c,label:Object(a.__)("Text Color","full-site-editing")}]}),Object(s.createElement)(l.PanelBody,{title:Object(a.__)("Post Meta Settings","full-site-editing")},Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Date","full-site-editing"),checked:_,onChange:function(){return o({showDate:!_})}})),Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Category","full-site-editing"),checked:E,onChange:function(){return o({showCategory:!E})}})),Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Author","full-site-editing"),checked:k,onChange:function(){return o({showAuthor:!k})}})),k&&Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Author Avatar","full-site-editing"),checked:S,onChange:function(){return o({showAvatar:!S})}}))))})),e}return d()(n,[{key:"render",value:function(){var e,t=this,n=this.props,o=n.attributes,r=n.className,c=n.clientId,i=n.setAttributes,u=n.isSelected,p=n.latestPosts,f=n.textColor,d=n.markPostsAsDisplayed,h=o.showImage,g=o.imageShape,b=o.postLayout,m=o.mediaPosition,O=o.moreButton,y=o.moreButtonText,j=o.columns,w=o.typeScale,_=o.imageScale,k=o.mobileStack,S=o.sectionHeader,E=o.showCaption,C=o.showCategory,P=o.specificMode,x=U()(r,(e={"is-grid":"grid"===b,"show-image":h},v()(e,"columns-".concat(j),"grid"===b),v()(e,"ts-".concat(w),"5"!==w),v()(e,"image-align".concat(m),h),v()(e,"is-".concat(_),"1"!==_&&h),v()(e,"mobile-stack",k),v()(e,"is-".concat(g),h),v()(e,"has-text-color",""!==f.color),v()(e,"show-caption",E),v()(e,"show-category",C),v()(e,"wpnbha",!0),e)),A=[{icon:"list-view",title:Object(a.__)("List View","full-site-editing"),onClick:function(){return i({postLayout:"list"})},isActive:"list"===b},{icon:"grid-view",title:Object(a.__)("Grid View","full-site-editing"),onClick:function(){return i({postLayout:"grid"})},isActive:"grid"===b}],T=[{icon:"align-none",title:Object(a.__)("Show media on top","full-site-editing"),isActive:"top"===m,onClick:function(){return i({mediaPosition:"top"})}},{icon:"align-pull-left",title:Object(a.__)("Show media on left","full-site-editing"),isActive:"left"===m,onClick:function(){return i({mediaPosition:"left"})}},{icon:"align-pull-right",title:Object(a.__)("Show media on right","full-site-editing"),isActive:"right"===m,onClick:function(){return i({mediaPosition:"right"})}},{icon:ee,title:Object(a.__)("Show media behind","full-site-editing"),isActive:"behind"===m,onClick:function(){return i({mediaPosition:"behind"})}}],I=[{icon:J,title:Object(a.__)("Landscape Image Shape","full-site-editing"),isActive:"landscape"===g,onClick:function(){return i({imageShape:"landscape"})}},{icon:X,title:Object(a.__)("portrait Image Shape","full-site-editing"),isActive:"portrait"===g,onClick:function(){return i({imageShape:"portrait"})}},{icon:$,title:Object(a.__)("Square Image Shape","full-site-editing"),isActive:"square"===g,onClick:function(){return i({imageShape:"square"})}},{icon:Z,title:Object(a.__)("Uncropped","full-site-editing"),isActive:"uncropped"===g,onClick:function(){return i({imageShape:"uncropped"})}}];return d(c,p),Object(s.createElement)(s.Fragment,null,Object(s.createElement)("div",{className:x,style:{color:f.color}},Object(s.createElement)("div",null,p&&(!Y.RichText.isEmpty(S)||u)&&Object(s.createElement)(Y.RichText,{onChange:function(e){return i({sectionHeader:e})},placeholder:Object(a.__)("Write header…","full-site-editing"),value:S,tagName:"h2",className:"article-section-title"}),p&&!p.length&&Object(s.createElement)(l.Placeholder,null,Object(a.__)("Sorry, no posts were found.","full-site-editing")),!p&&Object(s.createElement)(l.Placeholder,{icon:Object(s.createElement)(l.Spinner,null),className:"component-placeholder__align-center"}),p&&p.map((function(e){return t.renderPost(e)})))),!P&&p&&O&&!z()&&Object(s.createElement)("div",{className:"editor-styles-wrapper wpnbha__wp-block-button__wrapper"},Object(s.createElement)("div",{className:"wp-block-button"},Object(s.createElement)(Y.RichText,{placeholder:Object(a.__)("Load more posts","full-site-editing"),value:y,onChange:function(e){return i({moreButtonText:e})},className:"wp-block-button__link",keepPlaceholderOnFocus:!0,allowedFormats:[]}))),Object(s.createElement)(Y.BlockControls,null,Object(s.createElement)(l.Toolbar,{controls:A}),h&&Object(s.createElement)(l.Toolbar,{controls:T}),h&&Object(s.createElement)(l.Toolbar,{controls:I})),Object(s.createElement)(Y.InspectorControls,null,this.renderInspectorControls()))}}]),n}(s.Component),ne=Object(W.compose)([Object(Y.withColors)({textColor:"color"}),Object(D.withSelect)((function(e,t){var n=t.attributes,o=t.clientId,r=function(e){var t=e.postsToShow,n=e.authors,o=e.categories,r=e.tags,c=e.specificPosts,a=e.tagExclusions;return Object(A.pickBy)(F(e)?{include:c,orderby:"include",per_page:c.length}:{per_page:t,categories:o,author:n,tags:r,tags_exclude:a},(function(e){return!Object(A.isUndefined)(e)}))}(n);if(!F(n)){var c=e(L).previousPostIds(o);r.exclude=c.join(",")}return{latestPosts:e("core").getEntityRecords("postType","post",r)}})),Object(D.withDispatch)((function(e,t){var n=t.attributes;return{markPostsAsDisplayed:F(n)?e(L).markSpecificPostsAsDisplayed:e(L).markPostsAsDisplayed}}))])(te),oe=(n(35),n(36),H.name,H.attributes),re=H.category,ce={title:Object(a.__)("Homepage Posts","full-site-editing"),icon:Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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:oe,category:re,keywords:[Object(a.__)("posts","full-site-editing"),Object(a.__)("articles","full-site-editing"),Object(a.__)("latest","full-site-editing")],description:Object(a.__)("A block for displaying homepage posts.","full-site-editing"),styles:[{name:"default",label:Object(a._x)("Default","block style","full-site-editing"),isDefault:!0},{name:"borders",label:Object(a._x)("Borders","block style","full-site-editing")}],supports:{html:!1,align:["wide","full"],default:""},edit:ne,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,r=e.columns,a=e.postsToShow,s=e.categories;return Object(c.createBlock)(Object(i.applyFilters)("blocks.transforms_from_name","newspack-blocks/homepage-articles"),{showExcerpt:t,showDate:n,postLayout:o,columns:r,postsToShow:a,showAuthor:!1,categories:s?[s]:[]})}}],to:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.showExcerpt,n=e.showDate,o=e.postLayout,r=e.columns,a=e.postsToShow,i=e.categories;return Object(c.createBlock)("core/latest-posts",{displayPostContent:t,displayPostDate:n,postLayout:o,columns:r,postsToShow:a,categories:i[0]||""})}}]}};Object(i.addFilter)("blocks.transforms_from_name","set-transformed-block-name",(function(e){return"newspack-blocks/homepage-articles"!==e?e:"a8c/blog-posts"})),Object(c.registerBlockType)("a8c/blog-posts",r()({},ce,{title:Object(a.__)("Blog Posts","full-site-editing"),category:"layout"})),function(e){var t=function t(n){return n.flatMap((function(n){var o=[];return n.name===e&&o.push(n),o.concat(t(n.innerBlocks))}))};Object(D.registerStore)(L,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"UPDATE_BLOCKS":return r()({},e,{queryBlocks:t(n.blocks)});case"MARK_POSTS_DISPLAYED":return r()({},e,{postsByBlock:r()({},e.postsByBlock,v()({},n.clientId,n.posts))});case"MARK_SPECIFIC_POSTS_DISPLAYED":return r()({},e,{specificPostsByBlock:r()({},e.specificPostsByBlock,v()({},n.clientId,n.posts))})}return e},actions:R,selectors:V,initialState:N});var n,o=Object(D.select)("core/block-editor"),c=o.getClientIdsWithDescendants,a=o.getBlocks,i=Object(D.dispatch)(L).updateBlocks;Object(D.subscribe)((function(){var e=c(),t=e!==n;n=e,t&&i(a())}))}("a8c/blog-posts")}]));
|
1 |
+
!function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){var t={};function n(o){if(t[o])return t[o].exports;var c=t[o]={i:o,l:!1,exports:{}};return e[o].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(o,c,function(t){return e[t]}.bind(null,c));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=37)}([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.apiFetch}()},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,n){var o=n(3);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var o=n(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&&o(e,t)}},function(e,t,n){var o=n(26),c=n(27),r=n(28);e.exports=function(e){return function(){var t,n=o(e);if(c()){var a=o(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return r(this,t)}}},function(e){e.exports=JSON.parse('{"name":"homepage-articles","category":"newspack","attributes":{"className":{"type":"string","default":""},"showExcerpt":{"type":"boolean","default":true},"showDate":{"type":"boolean","default":true},"showImage":{"type":"boolean","default":true},"showCaption":{"type":"boolean","default":false},"imageShape":{"type":"string","default":"landscape"},"minHeight":{"type":"integer","default":0},"moreButton":{"type":"boolean","default":false},"moreButtonText":{"type":"string","default":""},"showAuthor":{"type":"boolean","default":true},"showAvatar":{"type":"boolean","default":true},"showCategory":{"type":"boolean","default":false},"postLayout":{"type":"string","default":"list"},"columns":{"type":"integer","default":3},"postsToShow":{"type":"integer","default":3},"mediaPosition":{"type":"string","default":"top"},"authors":{"type":"array","default":[],"items":{"type":"integer"}},"categories":{"type":"array","default":[],"items":{"type":"integer"}},"tags":{"type":"array","default":[],"items":{"type":"integer"}},"tagExclusions":{"type":"array","default":[],"items":{"type":"integer"}},"specificPosts":{"type":"array","default":[],"items":{"type":"integer"}},"typeScale":{"type":"integer","default":4},"imageScale":{"type":"integer","default":3},"mobileStack":{"type":"boolean","default":false},"sectionHeader":{"type":"string","default":""},"specificMode":{"type":"boolean","default":false},"textColor":{"type":"string","default":""},"customTextColor":{"type":"string","default":""},"singleMode":{"type":"boolean","default":false},"showSubtitle":{"type":"boolean","default":false}}}')},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){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),c=n(31),r=n(32),a=n(33);e.exports=function(e){return o(e)||c(e)||r(e)||a()}},function(e,t,n){var o;
|
2 |
/*!
|
3 |
Copyright (c) 2017 Jed Watson.
|
4 |
Licensed under the MIT License (MIT), see
|
5 |
http://jedwatson.github.io/classnames
|
6 |
+
*/!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var r=typeof o;if("string"===r||"number"===r)e.push(o);else if(Array.isArray(o)&&o.length){var a=c.apply(null,o);a&&e.push(a)}else if("object"===r)for(var i in o)n.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()},function(e,t){!function(){e.exports=this.wp.date}()},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}},function(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){!function(){e.exports=this.wp.compose}()},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){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){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},function(e,t,n){var o=n(29),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"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,n){var o=n(22);e.exports=function(e){if(Array.isArray(e))return o(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,n){var o=n(22);e.exports=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var o=n(9),c=n.n(o),r=n(16),a=n(1),i=n(17),s=n(0),l=n(2),u=n(12),p=n.n(u),f=n(18),d=n.n(f),h=n(4),g=n.n(h),b=n(13),m=n.n(b),O=n(14),y=n.n(O),j=n(3),v=n.n(j),_=n(23),w=n.n(_),k=n(6),S=n.n(k),E=n(7),C=n(5),P=n(19),x=n.n(P),A=n(11),T=(n(34),function(e){m()(n,e);var t=y()(n);function n(e){var o;return p()(this,n),o=t.call(this,e),v()(g()(o),"isFetchingInfoOnLoad",(function(){var e=o.props,t=e.tokens,n=e.fetchSavedInfo;return Boolean(t.length&&n)})),o.state={suggestions:[],validValues:{},loading:o.isFetchingInfoOnLoad()},o.debouncedUpdateSuggestions=Object(A.debounce)(o.updateSuggestions,500),o}return d()(n,[{key:"componentDidMount",value:function(){var e=this;if(this.isFetchingInfoOnLoad()){var t=this.props,n=t.tokens;(0,t.fetchSavedInfo)(n).then((function(t){var n=e.state.validValues;t.forEach((function(e){n[e.value]=e.label})),e.setState({validValues:n,loading:!1})}))}}},{key:"componentWillUnmount",value:function(){delete this.suggestionsRequest,this.debouncedUpdateSuggestions.cancel()}},{key:"getLabelsForValues",value:function(e){var t=this.state.validValues;return e.reduce((function(e,n){return t[n]?[].concat(x()(e),[t[n]]):e}),[])}},{key:"getValuesForLabels",value:function(e){var t=this.state.validValues;return e.map((function(e){return Object.keys(t).find((function(n){return t[n]===e}))}))}},{key:"updateSuggestions",value:function(e){var t=this,n=this.props.fetchSuggestions;n&&this.setState({loading:!0},(function(){var o=n(e);o.then((function(e){if(t.suggestionsRequest===o){var n=t.state.validValues,c=[];e.forEach((function(e){c.push(e.label),n[e.value]=e.label})),t.setState({suggestions:c,validValues:n,loading:!1})}})).catch((function(){t.suggestionsRequest===o&&t.setState({loading:!1})})),t.suggestionsRequest=o}))}},{key:"handleOnChange",value:function(e){(0,this.props.onChange)(this.getValuesForLabels(e))}},{key:"getTokens",value:function(){var e=this.props.tokens;return this.getLabelsForValues(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.help,o=t.label,c=void 0===o?"":o,r=this.state,a=r.suggestions,i=r.loading;return Object(s.createElement)("div",{className:"autocomplete-tokenfield"},Object(s.createElement)(l.FormTokenField,{value:this.getTokens(),suggestions:a,onChange:function(t){return e.handleOnChange(t)},onInputChange:function(t){return e.debouncedUpdateSuggestions(t)},label:c}),i&&Object(s.createElement)(l.Spinner,null),n&&Object(s.createElement)("p",{className:"autocomplete-tokenfield__help"},n))}}]),n}(s.Component)),I=function(e){m()(n,e);var t=y()(n);function n(){var e;p()(this,n);for(var o=arguments.length,c=new Array(o),r=0;r<o;r++)c[r]=arguments[r];return e=t.call.apply(t,[this].concat(c)),v()(g()(e),"state",{showAdvancedFilters:!1}),v()(g()(e),"fetchPostSuggestions",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.title)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchSavedPosts",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.title.rendered)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchAuthorSuggestions",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no name)","newspack-blocks")}}))}))})),v()(g()(e),"fetchSavedAuthors",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no name)","newspack-blocks")}}))}))})),v()(g()(e),"fetchCategorySuggestions",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchSavedCategories",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchTagSuggestions",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"fetchSavedTags",(function(e){return S()({path:Object(E.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(C.decodeEntities)(e.name)||Object(a.__)("(no title)","newspack-blocks")}}))}))})),v()(g()(e),"render",(function(){var t=e.props,n=t.specificMode,o=t.onSpecificModeChange,c=t.specificPosts,r=t.onSpecificPostsChange,i=t.authors,u=t.onAuthorsChange,p=t.categories,f=t.onCategoriesChange,d=t.tags,h=t.onTagsChange,g=t.tagExclusions,b=t.onTagExclusionsChange,m=t.enableSpecific,O=e.state.showAdvancedFilters;return[m&&Object(s.createElement)(l.ToggleControl,{key:"specificMode",checked:n,onChange:o,label:Object(a.__)("Choose Specific Posts","newspack-blocks")}),n&&Object(s.createElement)(T,{key:"posts",tokens:c||[],onChange:r,fetchSuggestions:e.fetchPostSuggestions,fetchSavedInfo:e.fetchSavedPosts,label:Object(a.__)("Posts","newspack-blocks"),help:Object(a.__)("Begin typing post title, click autocomplete result to select.","newspack-blocks")}),!n&&Object(s.createElement)(l.QueryControls,w()({key:"queryControls"},e.props)),!n&&u&&Object(s.createElement)(T,{key:"authors",tokens:i||[],onChange:u,fetchSuggestions:e.fetchAuthorSuggestions,fetchSavedInfo:e.fetchSavedAuthors,label:Object(a.__)("Authors","newspack-blocks")}),!n&&f&&Object(s.createElement)(T,{key:"categories",tokens:p||[],onChange:f,fetchSuggestions:e.fetchCategorySuggestions,fetchSavedInfo:e.fetchSavedCategories,label:Object(a.__)("Categories","newspack-blocks")}),!n&&h&&Object(s.createElement)(T,{key:"tags",tokens:d||[],onChange:h,fetchSuggestions:e.fetchTagSuggestions,fetchSavedInfo:e.fetchSavedTags,label:Object(a.__)("Tags","newspack-blocks")}),!n&&b&&Object(s.createElement)("p",{key:"toggle-advanced-filters"},Object(s.createElement)(l.Button,{isLink:!0,onClick:function(){return e.setState({showAdvancedFilters:!O})}},O?Object(a.__)("Hide Advanced Filters","newspack-blocks"):Object(a.__)("Show Advanced Filters","newspack-blocks"))),!n&&b&&O&&Object(s.createElement)(T,{key:"tag-exclusion",tokens:g||[],onChange:b,fetchSuggestions:e.fetchTagSuggestions,fetchSavedInfo:e.fetchSavedTags,label:Object(a.__)("Excluded Tags","newspack-blocks")})]})),e}return n}(s.Component);I.defaultProps={enableSpecific:!0,specificPosts:[],authors:[],categories:[],tags:[],tagExclusions:[]};var B,M=I,D=n(10),H=n(15),L=H.name,N={queryBlocks:[],postsByBlock:{},specificPostsByBlock:{}},R={updateBlocks:function(e){return{type:"UPDATE_BLOCKS",blocks:e}},markPostsAsDisplayed:function(e,t){return{type:"MARK_POSTS_DISPLAYED",clientId:e,posts:t}},markSpecificPostsAsDisplayed:function(e,t){return{type:"MARK_SPECIFIC_POSTS_DISPLAYED",clientId:e,posts:t}}},V={previousPostIds:function(e,t){var n,o,c,r=e.queryBlocks,a=e.specificPostsByBlock,i=e.postsByBlock,s=r.filter((function(e){var t=e.clientId;return a[t]})).flatMap((function(e){var t=e.clientId;return a[t].map((function(e){return e.id}))})),l=(n=r,o=t,c=n.findIndex((function(e){return e.clientId===o})),n.slice(0,c)).filter((function(e){var t=e.clientId;return i[t]})).flatMap((function(e){var t=e.clientId;return i[t].map((function(e){return e.id}))}));return Object(A.uniq)(s.concat(l)).sort()}},z=function(){return"object"==typeof window&&window.wpcomGutenberg&&-1===Number(window.wpcomGutenberg.blogPublic)},F=function(e){var t=e.specificMode,n=e.specificPosts;return t&&n&&n.length},q=function(e){return e.map((function(e){return Object(s.createElement)("span",{className:"avatar author-avatar",key:e.id},Object(s.createElement)("a",{className:"url fn n",href:e.author_link},Object(s.createElement)(s.RawHTML,null,e.avatar)))}))},G=function(e){return Object(s.createElement)("span",{className:"byline"},Object(a._x)("by","post author","newspack-blocks")," ",e.reduce((function(t,n,o){return[].concat(x()(t),[Object(s.createElement)("span",{className:"author vcard",key:n.id},Object(s.createElement)("a",{className:"url fn n",href:n.author_link},n.display_name)),o<e.length-2&&", ",e.length>1&&o===e.length-2&&Object(a._x)(" and ","post author","newspack-blocks")])}),[]))},Q=n(20),U=n.n(Q),K=n(21),Y=n(8),W=n(24);"object"==typeof window&&window.newspackIsPostSubtitleSupported&&window.newspackIsPostSubtitleSupported.post_subtitle&&(B=!0);var J=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),X=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),$=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),Z=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),ee=Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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"})),te=function(e){m()(n,e);var t=y()(n);function n(){var e;p()(this,n);for(var o=arguments.length,c=new Array(o),r=0;r<o;r++)c[r]=arguments[r];return e=t.call.apply(t,[this].concat(c)),v()(g()(e),"renderPost",(function(t){var n=e.props.attributes,o=n.showImage,c=n.imageShape,r=n.mediaPosition,a=n.minHeight,i=n.showCaption,l=n.showExcerpt,u=n.showSubtitle,p=n.showAuthor,f=n.showAvatar,d=n.showDate,h=n.showCategory,g=n.sectionHeader,b={minHeight:"behind"===r&&o&&t.newspack_featured_image_src&&a+"vh",paddingTop:"behind"===r&&o&&t.newspack_featured_image_src&&a/5+"vh"},m=U()({"post-has-image":t.newspack_featured_image_src},t.newspack_article_classes),O=e.titleForPost(t),y=Object(K.__experimentalGetSettings)().formats.date;return Object(s.createElement)("article",{className:m,key:t.id,style:b},o&&t.newspack_featured_image_src&&Object(s.createElement)("figure",{className:"post-thumbnail",key:"thumbnail"},Object(s.createElement)("a",{href:"#"},"landscape"===c&&Object(s.createElement)("img",{src:t.newspack_featured_image_src.landscape,alt:""}),"portrait"===c&&Object(s.createElement)("img",{src:t.newspack_featured_image_src.portrait,alt:""}),"square"===c&&Object(s.createElement)("img",{src:t.newspack_featured_image_src.square,alt:""}),"uncropped"===c&&Object(s.createElement)("img",{src:t.newspack_featured_image_src.uncropped,alt:""})),i&&""!==t.newspack_featured_image_caption&&Object(s.createElement)("figcaption",null,t.newspack_featured_image_caption)),Object(s.createElement)("div",{className:"entry-wrapper"},h&&t.newspack_category_info.length&&Object(s.createElement)("div",{className:"cat-links"},Object(s.createElement)("a",{href:"#"},Object(C.decodeEntities)(t.newspack_category_info))),Y.RichText.isEmpty(g)?Object(s.createElement)("h2",{className:"entry-title",key:"title"},Object(s.createElement)("a",{href:"#"},O)):Object(s.createElement)("h3",{className:"entry-title",key:"title"},Object(s.createElement)("a",{href:"#"},O)),B&&u&&Object(s.createElement)(s.RawHTML,{key:"subtitle",className:"newspack-post-subtitle newspack-post-subtitle--in-homepage-block"},t.meta.newspack_post_subtitle||""),l&&Object(s.createElement)(s.RawHTML,{key:"excerpt",className:"excerpt-contain"},t.excerpt.rendered),Object(s.createElement)("div",{className:"entry-meta"},p&&f&&q(t.newspack_author_info),p&&G(t.newspack_author_info),d&&Object(s.createElement)("time",{className:"entry-date published",key:"pub-date"},Object(K.dateI18n)(y,t.date_gmt)))))})),v()(g()(e),"titleForPost",(function(e){return e.title?"string"==typeof e.title?Object(C.decodeEntities)(e.title.trim()):"object"==typeof e.title&&e.title.rendered?Object(C.decodeEntities)(e.title.rendered.trim()):void 0:""})),v()(g()(e),"renderInspectorControls",(function(){var t=e.props,n=t.attributes,o=t.setAttributes,c=t.textColor,r=t.setTextColor,i=n.authors,u=n.specificPosts,p=n.postsToShow,f=n.categories,d=n.columns,h=n.showImage,g=n.showCaption,b=n.imageScale,m=n.mobileStack,O=n.minHeight,y=n.moreButton,j=n.showExcerpt,v=n.showSubtitle,_=n.typeScale,w=n.showDate,k=n.showAuthor,S=n.showAvatar,E=n.showCategory,C=n.postLayout,P=n.mediaPosition,x=n.specificMode,A=n.tags,T=n.tagExclusions,I=[{value:1,label:Object(a.__)("Small","full-site-editing"),shortName:Object(a.__)("S","full-site-editing")},{value:2,label:Object(a.__)("Medium","full-site-editing"),shortName:Object(a.__)("M","full-site-editing")},{value:3,label:Object(a.__)("Large","full-site-editing"),shortName:Object(a.__)("L","full-site-editing")},{value:4,label:Object(a.__)("Extra Large","newspack-blocks"),shortName:Object(a.__)("XL","newspack-blocks")}];return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(l.PanelBody,{title:Object(a.__)("Display Settings","full-site-editing"),initialOpen:!0},p&&Object(s.createElement)(M,{numberOfItems:p,onNumberOfItemsChange:function(e){return o({postsToShow:e})},specificMode:x,onSpecificModeChange:function(e){return o({specificMode:e})},specificPosts:u,onSpecificPostsChange:function(e){return o({specificPosts:e})},authors:i,onAuthorsChange:function(e){return o({authors:e})},categories:f,onCategoriesChange:function(e){return o({categories:e})},tags:A,onTagsChange:function(e){o({tags:e})},tagExclusions:T,onTagExclusionsChange:function(e){return o({tagExclusions:e})}}),"grid"===C&&Object(s.createElement)(l.RangeControl,{label:Object(a.__)("Columns","full-site-editing"),value:d,onChange:function(e){return o({columns:e})},min:2,max:6,required:!0}),!x&&!z()&&Object(s.createElement)(l.ToggleControl,{label:Object(a.__)('Show "More" Button',"full-site-editing"),checked:y,onChange:function(){return o({moreButton:!y})}})),Object(s.createElement)(l.PanelBody,{title:Object(a.__)("Featured Image Settings","full-site-editing")},Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Featured Image","full-site-editing"),checked:h,onChange:function(){return o({showImage:!h})}})),h&&Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Featured Image Caption","full-site-editing"),checked:g,onChange:function(){return o({showCaption:!g})}})),h&&"top"!==P&&"behind"!==P&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Stack on mobile","full-site-editing"),checked:m,onChange:function(){return o({mobileStack:!m})}})),Object(s.createElement)(l.BaseControl,{label:Object(a.__)("Featured Image Size","full-site-editing"),id:"newspackfeatured-image-size"},Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ButtonGroup,{id:"newspackfeatured-image-size","aria-label":Object(a.__)("Featured Image Size","full-site-editing")},I.map((function(e){var t=b===e.value;return Object(s.createElement)(l.Button,{isLarge:!0,isPrimary:t,"aria-pressed":t,"aria-label":e.label,key:e.value,onClick:function(){return o({imageScale:e.value})}},e.shortName)})))))),h&&"behind"===P&&Object(s.createElement)(l.RangeControl,{label:Object(a.__)("Minimum height","full-site-editing"),help:Object(a.__)("Sets a minimum height for the block, using a percentage of the screen's current height.","newspack-blocks"),value:O,onChange:function(e){return o({minHeight:e})},min:0,max:100,required:!0})),Object(s.createElement)(l.PanelBody,{title:Object(a.__)("Post Control Settings","full-site-editing")},B&&Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Subtitle","full-site-editing"),checked:v,onChange:function(){return o({showSubtitle:!v})}})),Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Excerpt","full-site-editing"),checked:j,onChange:function(){return o({showExcerpt:!j})}})),Object(s.createElement)(l.RangeControl,{className:"type-scale-slider",label:Object(a.__)("Type Scale","full-site-editing"),value:_,onChange:function(e){return o({typeScale:e})},min:1,max:10,beforeIcon:"editor-textcolor",afterIcon:"editor-textcolor",required:!0})),Object(s.createElement)(Y.PanelColorSettings,{title:Object(a.__)("Color Settings","full-site-editing"),initialOpen:!0,colorSettings:[{value:c.color,onChange:r,label:Object(a.__)("Text Color","full-site-editing")}]}),Object(s.createElement)(l.PanelBody,{title:Object(a.__)("Post Meta Settings","full-site-editing")},Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Date","full-site-editing"),checked:w,onChange:function(){return o({showDate:!w})}})),Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Category","full-site-editing"),checked:E,onChange:function(){return o({showCategory:!E})}})),Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Author","full-site-editing"),checked:k,onChange:function(){return o({showAuthor:!k})}})),k&&Object(s.createElement)(l.PanelRow,null,Object(s.createElement)(l.ToggleControl,{label:Object(a.__)("Show Author Avatar","full-site-editing"),checked:S,onChange:function(){return o({showAvatar:!S})}}))))})),e}return d()(n,[{key:"render",value:function(){var e,t=this,n=this.props,o=n.attributes,c=n.className,r=n.clientId,i=n.setAttributes,u=n.isSelected,p=n.latestPosts,f=n.textColor,d=n.markPostsAsDisplayed,h=o.showImage,g=o.imageShape,b=o.postLayout,m=o.mediaPosition,O=o.moreButton,y=o.moreButtonText,j=o.columns,_=o.typeScale,w=o.imageScale,k=o.mobileStack,S=o.sectionHeader,E=o.showCaption,C=o.showCategory,P=o.specificMode,x=U()(c,(e={"is-grid":"grid"===b,"show-image":h},v()(e,"columns-".concat(j),"grid"===b),v()(e,"ts-".concat(_),"5"!==_),v()(e,"image-align".concat(m),h),v()(e,"is-".concat(w),"1"!==w&&h),v()(e,"mobile-stack",k),v()(e,"is-".concat(g),h),v()(e,"has-text-color",""!==f.color),v()(e,"show-caption",E),v()(e,"show-category",C),v()(e,"wpnbha",!0),e)),A=[{icon:"list-view",title:Object(a.__)("List View","full-site-editing"),onClick:function(){return i({postLayout:"list"})},isActive:"list"===b},{icon:"grid-view",title:Object(a.__)("Grid View","full-site-editing"),onClick:function(){return i({postLayout:"grid"})},isActive:"grid"===b}],T=[{icon:"align-none",title:Object(a.__)("Show media on top","full-site-editing"),isActive:"top"===m,onClick:function(){return i({mediaPosition:"top"})}},{icon:"align-pull-left",title:Object(a.__)("Show media on left","full-site-editing"),isActive:"left"===m,onClick:function(){return i({mediaPosition:"left"})}},{icon:"align-pull-right",title:Object(a.__)("Show media on right","full-site-editing"),isActive:"right"===m,onClick:function(){return i({mediaPosition:"right"})}},{icon:ee,title:Object(a.__)("Show media behind","full-site-editing"),isActive:"behind"===m,onClick:function(){return i({mediaPosition:"behind"})}}],I=[{icon:J,title:Object(a.__)("Landscape Image Shape","full-site-editing"),isActive:"landscape"===g,onClick:function(){return i({imageShape:"landscape"})}},{icon:X,title:Object(a.__)("portrait Image Shape","full-site-editing"),isActive:"portrait"===g,onClick:function(){return i({imageShape:"portrait"})}},{icon:$,title:Object(a.__)("Square Image Shape","full-site-editing"),isActive:"square"===g,onClick:function(){return i({imageShape:"square"})}},{icon:Z,title:Object(a.__)("Uncropped","full-site-editing"),isActive:"uncropped"===g,onClick:function(){return i({imageShape:"uncropped"})}}];return d(r,p),Object(s.createElement)(s.Fragment,null,Object(s.createElement)("div",{className:x,style:{color:f.color}},Object(s.createElement)("div",null,p&&(!Y.RichText.isEmpty(S)||u)&&Object(s.createElement)(Y.RichText,{onChange:function(e){return i({sectionHeader:e})},placeholder:Object(a.__)("Write header…","full-site-editing"),value:S,tagName:"h2",className:"article-section-title"}),p&&!p.length&&Object(s.createElement)(l.Placeholder,null,Object(a.__)("Sorry, no posts were found.","full-site-editing")),!p&&Object(s.createElement)(l.Placeholder,{icon:Object(s.createElement)(l.Spinner,null),className:"component-placeholder__align-center"}),p&&p.map((function(e){return t.renderPost(e)})))),!P&&p&&O&&!z()&&Object(s.createElement)("div",{className:"editor-styles-wrapper wpnbha__wp-block-button__wrapper"},Object(s.createElement)("div",{className:"wp-block-button"},Object(s.createElement)(Y.RichText,{placeholder:Object(a.__)("Load more posts","full-site-editing"),value:y,onChange:function(e){return i({moreButtonText:e})},className:"wp-block-button__link",keepPlaceholderOnFocus:!0,allowedFormats:[]}))),Object(s.createElement)(Y.BlockControls,null,Object(s.createElement)(l.Toolbar,{controls:A}),h&&Object(s.createElement)(l.Toolbar,{controls:T}),h&&Object(s.createElement)(l.Toolbar,{controls:I})),Object(s.createElement)(Y.InspectorControls,null,this.renderInspectorControls()))}}]),n}(s.Component),ne=Object(W.compose)([Object(Y.withColors)({textColor:"color"}),Object(D.withSelect)((function(e,t){var n=t.attributes,o=t.clientId,c=function(e){var t=e.postsToShow,n=e.authors,o=e.categories,c=e.tags,r=e.specificPosts,a=e.tagExclusions;return Object(A.pickBy)(F(e)?{include:r,orderby:"include",per_page:r.length}:{per_page:t,categories:o,author:n,tags:c,tags_exclude:a},(function(e){return!Object(A.isUndefined)(e)}))}(n);if(!F(n)){var r=e(L).previousPostIds(o);c.exclude=r.join(",")}return{latestPosts:e("core").getEntityRecords("postType","post",c)}})),Object(D.withDispatch)((function(e,t){var n=t.attributes;return{markPostsAsDisplayed:F(n)?e(L).markSpecificPostsAsDisplayed:e(L).markPostsAsDisplayed}}))])(te),oe=(n(35),n(36),H.name,H.attributes),ce=H.category,re={title:Object(a.__)("Homepage Posts","full-site-editing"),icon:Object(s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(s.createElement)(l.Path,{d:"M0 0h24v24H0z",fill:"none"}),Object(s.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:oe,category:ce,keywords:[Object(a.__)("posts","full-site-editing"),Object(a.__)("articles","full-site-editing"),Object(a.__)("latest","full-site-editing")],description:Object(a.__)("A block for displaying homepage posts.","full-site-editing"),styles:[{name:"default",label:Object(a._x)("Default","block style","full-site-editing"),isDefault:!0},{name:"borders",label:Object(a._x)("Borders","block style","full-site-editing")}],supports:{html:!1,align:["wide","full"],default:""},edit:ne,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,a=e.postsToShow,s=e.categories;return Object(r.createBlock)(Object(i.applyFilters)("blocks.transforms_from_name","newspack-blocks/homepage-articles"),{showExcerpt:t,showDate:n,postLayout:o,columns:c,postsToShow:a,showAuthor:!1,categories:s?[s]:[]})}}],to:[{type:"block",blocks:["core/latest-posts"],transform:function(e){var t=e.showExcerpt,n=e.showDate,o=e.postLayout,c=e.columns,a=e.postsToShow,i=e.categories;return Object(r.createBlock)("core/latest-posts",{displayPostContent:t,displayPostDate:n,postLayout:o,columns:c,postsToShow:a,categories:i[0]||""})}}]}};Object(i.addFilter)("blocks.transforms_from_name","set-transformed-block-name",(function(e){return"newspack-blocks/homepage-articles"!==e?e:"a8c/blog-posts"})),Object(r.registerBlockType)("a8c/blog-posts",c()({},re,{title:Object(a.__)("Blog Posts","full-site-editing"),category:"layout"})),function(e){var t=function t(n){return n.flatMap((function(n){var o=[];return n.name===e&&o.push(n),o.concat(t(n.innerBlocks))}))};Object(D.registerStore)(L,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"UPDATE_BLOCKS":return c()({},e,{queryBlocks:t(n.blocks)});case"MARK_POSTS_DISPLAYED":return c()({},e,{postsByBlock:c()({},e.postsByBlock,v()({},n.clientId,n.posts))});case"MARK_SPECIFIC_POSTS_DISPLAYED":return c()({},e,{specificPostsByBlock:c()({},e.specificPostsByBlock,v()({},n.clientId,n.posts))})}return e},actions:R,selectors:V,initialState:N});var n,o=Object(D.select)("core/block-editor"),r=o.getClientIdsWithDescendants,a=o.getBlocks,i=Object(D.dispatch)(L).updateBlocks;Object(D.subscribe)((function(){var e=r(),t=e!==n;n=e,t&&i(a())}))}("a8c/blog-posts")}]));
|
newspack-blocks/index.php
CHANGED
@@ -11,7 +11,7 @@ define( 'NEWSPACK_BLOCKS__BLOCKS_DIRECTORY', 'dist/' );
|
|
11 |
define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
12 |
|
13 |
// Autogenerated by apps/full-site-editing/bin/sync-newspack-blocks.sh.
|
14 |
-
define( 'NEWSPACK_BLOCKS__VERSION', 'v1.
|
15 |
// End autogenerated area.
|
16 |
|
17 |
/**
|
11 |
define( 'NEWSPACK_BLOCKS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
12 |
|
13 |
// Autogenerated by apps/full-site-editing/bin/sync-newspack-blocks.sh.
|
14 |
+
define( 'NEWSPACK_BLOCKS__VERSION', 'v1.7.0' );
|
15 |
// End autogenerated area.
|
16 |
|
17 |
/**
|
newspack-blocks/synced-newspack-blocks/blocks/carousel/view.php
CHANGED
@@ -14,6 +14,10 @@
|
|
14 |
*/
|
15 |
function newspack_blocks_render_block_carousel( $attributes ) {
|
16 |
static $newspack_blocks_carousel_id = 0;
|
|
|
|
|
|
|
|
|
17 |
$newspack_blocks_carousel_id++;
|
18 |
$autoplay = isset( $attributes['autoplay'] ) ? $attributes['autoplay'] : false;
|
19 |
$delay = isset( $attributes['delay'] ) ? absint( $attributes['delay'] ) : 3;
|
14 |
*/
|
15 |
function newspack_blocks_render_block_carousel( $attributes ) {
|
16 |
static $newspack_blocks_carousel_id = 0;
|
17 |
+
|
18 |
+
// This will let the FSE plugin know we need CSS/JS now.
|
19 |
+
do_action( 'newspack_blocks_render_post_carousel' );
|
20 |
+
|
21 |
$newspack_blocks_carousel_id++;
|
22 |
$autoplay = isset( $attributes['autoplay'] ) ? $attributes['autoplay'] : false;
|
23 |
$delay = isset( $attributes['delay'] ) ? absint( $attributes['delay'] ) : 3;
|
newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/edit.js
CHANGED
@@ -120,14 +120,15 @@ class Edit extends Component {
|
|
120 |
minHeight / 5 + 'vh',
|
121 |
};
|
122 |
|
|
|
|
|
|
|
|
|
|
|
123 |
const postTitle = this.titleForPost( post );
|
124 |
const dateFormat = __experimentalGetSettings().formats.date;
|
125 |
return (
|
126 |
-
<article
|
127 |
-
className={ post.newspack_featured_image_src ? 'post-has-image' : null }
|
128 |
-
key={ post.id }
|
129 |
-
style={ styles }
|
130 |
-
>
|
131 |
{ showImage && post.newspack_featured_image_src && (
|
132 |
<figure className="post-thumbnail" key="thumbnail">
|
133 |
<a href="#">
|
120 |
minHeight / 5 + 'vh',
|
121 |
};
|
122 |
|
123 |
+
const postClasses = classNames(
|
124 |
+
{ 'post-has-image': post.newspack_featured_image_src },
|
125 |
+
post.newspack_article_classes
|
126 |
+
);
|
127 |
+
|
128 |
const postTitle = this.titleForPost( post );
|
129 |
const dateFormat = __experimentalGetSettings().formats.date;
|
130 |
return (
|
131 |
+
<article className={ postClasses } key={ post.id } style={ styles }>
|
|
|
|
|
|
|
|
|
132 |
{ showImage && post.newspack_featured_image_src && (
|
133 |
<figure className="post-thumbnail" key="thumbnail">
|
134 |
<a href="#">
|
newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/templates/article.php
CHANGED
@@ -9,10 +9,17 @@
|
|
9 |
call_user_func(
|
10 |
function( $data ) {
|
11 |
$attributes = $data['attributes'];
|
|
|
|
|
|
|
12 |
|
13 |
-
|
|
|
14 |
|
15 |
-
|
|
|
|
|
|
|
16 |
|
17 |
if ( 'behind' === $attributes['mediaPosition'] && $attributes['showImage'] && has_post_thumbnail() ) {
|
18 |
$styles = 'min-height: ' . $attributes['minHeight'] . 'vh; padding-top: ' . ( $attributes['minHeight'] / 5 ) . 'vh;';
|
@@ -42,10 +49,9 @@ call_user_func(
|
|
42 |
}
|
43 |
}
|
44 |
?>
|
|
|
45 |
<article data-post-id="<?php the_id(); ?>"
|
46 |
-
<?php
|
47 |
-
class="post-has-image"
|
48 |
-
<?php endif; ?>
|
49 |
<?php if ( $styles ) : ?>
|
50 |
style="<?php echo esc_attr( $styles ); ?>"
|
51 |
<?php endif; ?>
|
9 |
call_user_func(
|
10 |
function( $data ) {
|
11 |
$attributes = $data['attributes'];
|
12 |
+
$authors = Newspack_Blocks::prepare_authors();
|
13 |
+
$classes = array();
|
14 |
+
$styles = '';
|
15 |
|
16 |
+
// Add classes based on the post's assigned categories and tags.
|
17 |
+
$classes[] = Newspack_Blocks::get_term_classes( get_the_ID() );
|
18 |
|
19 |
+
// Add class if post has a featured image.
|
20 |
+
if ( has_post_thumbnail() ) {
|
21 |
+
$classes[] = 'post-has-image';
|
22 |
+
}
|
23 |
|
24 |
if ( 'behind' === $attributes['mediaPosition'] && $attributes['showImage'] && has_post_thumbnail() ) {
|
25 |
$styles = 'min-height: ' . $attributes['minHeight'] . 'vh; padding-top: ' . ( $attributes['minHeight'] / 5 ) . 'vh;';
|
49 |
}
|
50 |
}
|
51 |
?>
|
52 |
+
|
53 |
<article data-post-id="<?php the_id(); ?>"
|
54 |
+
class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>"
|
|
|
|
|
55 |
<?php if ( $styles ) : ?>
|
56 |
style="<?php echo esc_attr( $styles ); ?>"
|
57 |
<?php endif; ?>
|
newspack-blocks/synced-newspack-blocks/blocks/homepage-articles/view.php
CHANGED
@@ -13,6 +13,9 @@
|
|
13 |
* @return string Returns the post content with latest posts added.
|
14 |
*/
|
15 |
function newspack_blocks_render_block_homepage_articles( $attributes ) {
|
|
|
|
|
|
|
16 |
$article_query = new WP_Query( Newspack_Blocks::build_articles_query( $attributes ) );
|
17 |
|
18 |
$classes = Newspack_Blocks::block_classes( 'homepage-articles', $attributes, [ 'wpnbha' ] );
|
13 |
* @return string Returns the post content with latest posts added.
|
14 |
*/
|
15 |
function newspack_blocks_render_block_homepage_articles( $attributes ) {
|
16 |
+
// This will let the FSE plugin know we need CSS/JS now.
|
17 |
+
do_action( 'newspack_blocks_render_homepage_articles' );
|
18 |
+
|
19 |
$article_query = new WP_Query( Newspack_Blocks::build_articles_query( $attributes ) );
|
20 |
|
21 |
$classes = Newspack_Blocks::block_classes( 'homepage-articles', $attributes, [ 'wpnbha' ] );
|
newspack-blocks/synced-newspack-blocks/class-newspack-blocks-api.php
CHANGED
@@ -71,6 +71,21 @@ class Newspack_Blocks_API {
|
|
71 |
],
|
72 |
]
|
73 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
|
76 |
/**
|
@@ -236,6 +251,16 @@ class Newspack_Blocks_API {
|
|
236 |
return $category->name;
|
237 |
}
|
238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
/**
|
240 |
* Register the video-playlist endpoint.
|
241 |
*/
|
71 |
],
|
72 |
]
|
73 |
);
|
74 |
+
|
75 |
+
/* Add list of categories for CSS classes */
|
76 |
+
register_rest_field(
|
77 |
+
'post',
|
78 |
+
'newspack_article_classes',
|
79 |
+
[
|
80 |
+
'get_callback' => [ 'Newspack_Blocks_API', 'newspack_blocks_get_cat_tag_classes' ],
|
81 |
+
'schema' => [
|
82 |
+
'context' => [
|
83 |
+
'edit',
|
84 |
+
],
|
85 |
+
'type' => 'string',
|
86 |
+
],
|
87 |
+
]
|
88 |
+
);
|
89 |
}
|
90 |
|
91 |
/**
|
251 |
return $category->name;
|
252 |
}
|
253 |
|
254 |
+
/**
|
255 |
+
* Get a list of category, tag classes for the rest field.
|
256 |
+
*
|
257 |
+
* @param array $object The object info.
|
258 |
+
* @return string classes from assigned categories and tags.
|
259 |
+
*/
|
260 |
+
public static function newspack_blocks_get_cat_tag_classes( $object ) {
|
261 |
+
return Newspack_Blocks::get_term_classes( $object['id'] );
|
262 |
+
}
|
263 |
+
|
264 |
/**
|
265 |
* Register the video-playlist endpoint.
|
266 |
*/
|
newspack-blocks/synced-newspack-blocks/class-newspack-blocks.php
CHANGED
@@ -411,6 +411,32 @@ class Newspack_Blocks {
|
|
411 |
);
|
412 |
}
|
413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
/**
|
415 |
* Get patterns for post type.
|
416 |
*
|
411 |
);
|
412 |
}
|
413 |
|
414 |
+
/**
|
415 |
+
* Prepare a list of classes based on assigned tags and categories.
|
416 |
+
*
|
417 |
+
* @param string $post_id Post ID.
|
418 |
+
* @return string CSS classes.
|
419 |
+
*/
|
420 |
+
public static function get_term_classes( $post_id ) {
|
421 |
+
$classes = [];
|
422 |
+
|
423 |
+
$tags = get_the_terms( $post_id, 'post_tag' );
|
424 |
+
if ( ! empty( $tags ) ) {
|
425 |
+
foreach ( $tags as $tag ) {
|
426 |
+
$classes[] = 'tag-' . $tag->slug;
|
427 |
+
}
|
428 |
+
}
|
429 |
+
|
430 |
+
$categories = get_the_terms( $post_id, 'category' );
|
431 |
+
if ( ! empty( $categories ) ) {
|
432 |
+
foreach ( $categories as $cat ) {
|
433 |
+
$classes[] = 'category-' . $cat->slug;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
return implode( ' ', $classes );
|
438 |
+
}
|
439 |
+
|
440 |
/**
|
441 |
* Get patterns for post type.
|
442 |
*
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: alexislloyd, allancole, automattic, bartkalisz, codebykat, copons,
|
|
3 |
Tags: block, blocks, editor, gutenberg, page
|
4 |
Requires at least: 5.0
|
5 |
Tested up to: 5.4
|
6 |
-
Stable tag: 1.
|
7 |
Requires PHP: 5.6.20
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -40,6 +40,10 @@ This plugin is experimental, so we don't provide any support for it outside of w
|
|
40 |
|
41 |
== Changelog ==
|
42 |
|
|
|
|
|
|
|
|
|
43 |
= 1.7 =
|
44 |
* Save the post before navigation when launching a WordPress.com site.
|
45 |
* Add handling for site launch on WordPress.com.
|
3 |
Tags: block, blocks, editor, gutenberg, page
|
4 |
Requires at least: 5.0
|
5 |
Tested up to: 5.4
|
6 |
+
Stable tag: 1.8
|
7 |
Requires PHP: 5.6.20
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
40 |
|
41 |
== Changelog ==
|
42 |
|
43 |
+
= 1.8 =
|
44 |
+
* Fix issue with Newspack blocks not loading assets.
|
45 |
+
* Fix block-editor NUX issues.
|
46 |
+
|
47 |
= 1.7 =
|
48 |
* Save the post before navigation when launching a WordPress.com site.
|
49 |
* Add handling for site launch on WordPress.com.
|
wpcom-block-editor-nux/dist/wpcom-block-editor-nux.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill'), 'version' => '2abd647072b43030fb24f5d895691b61');
|
wpcom-block-editor-nux/dist/wpcom-block-editor-nux.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.eot);src:url(https://s1.wp.com/i/fonts/recoleta/400.eot#iefix) format("embedded-opentype"),url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff"),url(https://s1.wp.com/i/fonts/recoleta/400.ttf) format("truetype")}.wpcom-block-editor-nux .components-modal__header{display:none}.wpcom-block-editor-nux .components-guide__container{margin-top:0}.wpcom-block-editor-nux .components-
|
1 |
+
@font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.eot);src:url(https://s1.wp.com/i/fonts/recoleta/400.eot#iefix) format("embedded-opentype"),url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff"),url(https://s1.wp.com/i/fonts/recoleta/400.ttf) format("truetype")}.wpcom-block-editor-nux.components-modal__frame{overflow:visible;height:65vh;top:calc(17.5vh - 35px)}@media (max-width:660px){.wpcom-block-editor-nux.components-modal__frame{width:90vw;min-width:90vw;left:5vw;right:5vw}}@media (min-width:660px){.wpcom-block-editor-nux.components-modal__frame{width:720px;height:350px;top:calc(50% - 35px)}}.wpcom-block-editor-nux .components-modal__header{display:none}.wpcom-block-editor-nux .components-guide__container{margin-top:0}.wpcom-block-editor-nux .components-guide__footer{position:absolute;width:100%;height:70px;bottom:-70px;left:0;padding:20px 0;margin:0;display:flex;justify-content:center;background:#fff;border-top:1px solid #dcdcde}@media (min-width:660px){.wpcom-block-editor-nux .components-guide__footer{border-top:none}}.wpcom-block-editor-nux .components-guide__page{position:absolute;width:100%;height:100%;justify-content:start}.wpcom-block-editor-nux .components-guide__page-control{position:relative;height:0;top:100%;overflow:visible;margin:0 auto;z-index:2;display:none}.wpcom-block-editor-nux .components-guide__page-control:before{display:inline-block;content:"";height:70px;vertical-align:middle}.wpcom-block-editor-nux .components-guide__page-control li{vertical-align:middle;margin-bottom:0}@media (min-width:660px){.wpcom-block-editor-nux .components-guide__page-control{display:block}}.wpcom-block-editor-nux__page{display:flex;flex-direction:column-reverse;justify-content:flex-end;background:#fff;width:100%;height:100%}@media (min-width:660px){.wpcom-block-editor-nux__page{flex-direction:row;justify-content:flex-start;position:absolute;min-height:350px;bottom:0}}@media (min-width:660px){.wpcom-block-editor-nux__text,.wpcom-block-editor-nux__visual{flex:1 0 50%;min-width:290px}}.wpcom-block-editor-nux__text{padding:0 25px 25px;height:60%}@media (min-width:660px){.wpcom-block-editor-nux__text{height:auto;padding:40px 50px}}.wpcom-block-editor-nux__visual{height:40%;background:#1381d8;text-align:center}@media (min-width:660px){.wpcom-block-editor-nux__visual{height:auto}}.wpcom-block-editor-nux__heading{font-family:Recoleta,Georgia,Times New Roman,Times,serif;font-weight:400;letter-spacing:.2px;color:#1d2327;font-size:32px;line-height:1.19}@media (min-width:660px){.wpcom-block-editor-nux__heading{font-size:42px}}.wpcom-block-editor-nux__description{font-size:15px;line-height:22px;color:#50575e}@media (min-width:660px){.wpcom-block-editor-nux__description{font-size:17px;line-height:26px}}.wpcom-block-editor-nux__image{max-width:100%;height:auto;flex:1;align-self:center;max-height:100%}.wpcom-block-editor-nux__image.align-bottom{align-self:flex-end}@media (min-width:660px){.wpcom-block-editor-nux__image{max-height:none}}
|
wpcom-block-editor-nux/dist/wpcom-block-editor-nux.rtl.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.eot);src:url(https://s1.wp.com/i/fonts/recoleta/400.eot#iefix) format("embedded-opentype"),url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff"),url(https://s1.wp.com/i/fonts/recoleta/400.ttf) format("truetype")}.wpcom-block-editor-nux .components-modal__header{display:none}.wpcom-block-editor-nux .components-guide__container{margin-top:0}.wpcom-block-editor-nux .components-
|
1 |
+
@font-face{font-display:swap;font-family:Recoleta;font-weight:400;src:url(https://s1.wp.com/i/fonts/recoleta/400.eot);src:url(https://s1.wp.com/i/fonts/recoleta/400.eot#iefix) format("embedded-opentype"),url(https://s1.wp.com/i/fonts/recoleta/400.woff2) format("woff2"),url(https://s1.wp.com/i/fonts/recoleta/400.woff) format("woff"),url(https://s1.wp.com/i/fonts/recoleta/400.ttf) format("truetype")}.wpcom-block-editor-nux.components-modal__frame{overflow:visible;height:65vh;top:calc(17.5vh - 35px)}@media (max-width:660px){.wpcom-block-editor-nux.components-modal__frame{width:90vw;min-width:90vw;right:5vw;left:5vw}}@media (min-width:660px){.wpcom-block-editor-nux.components-modal__frame{width:720px;height:350px;top:calc(50% - 35px)}}.wpcom-block-editor-nux .components-modal__header{display:none}.wpcom-block-editor-nux .components-guide__container{margin-top:0}.wpcom-block-editor-nux .components-guide__footer{position:absolute;width:100%;height:70px;bottom:-70px;right:0;padding:20px 0;margin:0;display:flex;justify-content:center;background:#fff;border-top:1px solid #dcdcde}@media (min-width:660px){.wpcom-block-editor-nux .components-guide__footer{border-top:none}}.wpcom-block-editor-nux .components-guide__page{position:absolute;width:100%;height:100%;justify-content:start}.wpcom-block-editor-nux .components-guide__page-control{position:relative;height:0;top:100%;overflow:visible;margin:0 auto;z-index:2;display:none}.wpcom-block-editor-nux .components-guide__page-control:before{display:inline-block;content:"";height:70px;vertical-align:middle}.wpcom-block-editor-nux .components-guide__page-control li{vertical-align:middle;margin-bottom:0}@media (min-width:660px){.wpcom-block-editor-nux .components-guide__page-control{display:block}}.wpcom-block-editor-nux__page{display:flex;flex-direction:column-reverse;justify-content:flex-end;background:#fff;width:100%;height:100%}@media (min-width:660px){.wpcom-block-editor-nux__page{flex-direction:row;justify-content:flex-start;position:absolute;min-height:350px;bottom:0}}@media (min-width:660px){.wpcom-block-editor-nux__text,.wpcom-block-editor-nux__visual{flex:1 0 50%;min-width:290px}}.wpcom-block-editor-nux__text{padding:0 25px 25px;height:60%}@media (min-width:660px){.wpcom-block-editor-nux__text{height:auto;padding:40px 50px}}.wpcom-block-editor-nux__visual{height:40%;background:#1381d8;text-align:center}@media (min-width:660px){.wpcom-block-editor-nux__visual{height:auto}}.wpcom-block-editor-nux__heading{font-family:Recoleta,Georgia,Times New Roman,Times,serif;font-weight:400;letter-spacing:.2px;color:#1d2327;font-size:32px;line-height:1.19}@media (min-width:660px){.wpcom-block-editor-nux__heading{font-size:42px}}.wpcom-block-editor-nux__description{font-size:15px;line-height:22px;color:#50575e}@media (min-width:660px){.wpcom-block-editor-nux__description{font-size:17px;line-height:26px}}.wpcom-block-editor-nux__image{max-width:100%;height:auto;flex:1;align-self:center;max-height:100%}.wpcom-block-editor-nux__image.align-bottom{align-self:flex-end}@media (min-width:660px){.wpcom-block-editor-nux__image{max-height:none}}
|
wpcom-block-editor-nux/src/style.scss
CHANGED
@@ -19,9 +19,31 @@ $wpcom-modal-breakpoint: 660px;
|
|
19 |
|
20 |
$wpcom-modal-padding-v: 40px;
|
21 |
$wpcom-modal-padding-h: 50px;
|
|
|
|
|
|
|
22 |
|
23 |
// Core modal style overrides
|
24 |
.wpcom-block-editor-nux {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
.components-modal__header {
|
26 |
display: none;
|
27 |
}
|
@@ -30,17 +52,74 @@ $wpcom-modal-padding-h: 50px;
|
|
30 |
margin-top: 0;
|
31 |
}
|
32 |
|
33 |
-
.components-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
.wpcom-block-editor-nux__page {
|
43 |
display: flex;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
.wpcom-block-editor-nux__text,
|
@@ -52,20 +131,21 @@ $wpcom-modal-padding-h: 50px;
|
|
52 |
}
|
53 |
|
54 |
.wpcom-block-editor-nux__text {
|
|
|
|
|
|
|
55 |
@media ( min-width: $wpcom-modal-breakpoint ) {
|
56 |
-
|
|
|
57 |
}
|
58 |
}
|
59 |
.wpcom-block-editor-nux__visual {
|
60 |
-
|
61 |
-
|
62 |
background: #1381d8;
|
63 |
-
|
64 |
-
|
65 |
-
margin-top: -$wpcom-modal-padding-v;
|
66 |
-
// padding: 0 $wpcom-modal-padding-h;
|
67 |
@media ( min-width: $wpcom-modal-breakpoint ) {
|
68 |
-
|
69 |
}
|
70 |
}
|
71 |
|
@@ -74,7 +154,7 @@ $wpcom-modal-padding-h: 50px;
|
|
74 |
/* Gray / Gray 90 */
|
75 |
color: #1d2327;
|
76 |
|
77 |
-
font-size:
|
78 |
line-height: 1.19;
|
79 |
|
80 |
@media ( min-width: $wpcom-modal-breakpoint ) {
|
@@ -83,11 +163,16 @@ $wpcom-modal-padding-h: 50px;
|
|
83 |
}
|
84 |
|
85 |
.wpcom-block-editor-nux__description {
|
86 |
-
font-size:
|
87 |
-
line-height:
|
88 |
|
89 |
/* Gray / Gray 60 */
|
90 |
color: #50575e;
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
|
93 |
.wpcom-block-editor-nux__image {
|
@@ -99,4 +184,10 @@ $wpcom-modal-padding-h: 50px;
|
|
99 |
&.align-bottom {
|
100 |
align-self: flex-end;
|
101 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
19 |
|
20 |
$wpcom-modal-padding-v: 40px;
|
21 |
$wpcom-modal-padding-h: 50px;
|
22 |
+
$wpcom-modal-content-min-height: 350px;
|
23 |
+
$wpcom-modal-footer-padding-v: 20px;
|
24 |
+
$wpcom-modal-footer-height: 30px + ( $wpcom-modal-footer-padding-v * 2 );
|
25 |
|
26 |
// Core modal style overrides
|
27 |
.wpcom-block-editor-nux {
|
28 |
+
&.components-modal__frame {
|
29 |
+
overflow: visible;
|
30 |
+
height: 65vh;
|
31 |
+
top: calc( 17.5vh - #{$wpcom-modal-footer-height / 2} );
|
32 |
+
|
33 |
+
@media ( max-width: $wpcom-modal-breakpoint ) {
|
34 |
+
width: 90vw;
|
35 |
+
min-width: 90vw;
|
36 |
+
left: 5vw;
|
37 |
+
right: 5vw;
|
38 |
+
}
|
39 |
+
|
40 |
+
@media ( min-width: $wpcom-modal-breakpoint ) {
|
41 |
+
width: 720px;
|
42 |
+
height: $wpcom-modal-content-min-height;
|
43 |
+
top: calc( 50% - #{$wpcom-modal-footer-height / 2} );
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
.components-modal__header {
|
48 |
display: none;
|
49 |
}
|
52 |
margin-top: 0;
|
53 |
}
|
54 |
|
55 |
+
.components-guide__footer {
|
56 |
+
position: absolute;
|
57 |
+
width: 100%;
|
58 |
+
height: $wpcom-modal-footer-height;
|
59 |
+
bottom: $wpcom-modal-footer-height * -1;
|
60 |
+
left: 0;
|
61 |
+
padding: $wpcom-modal-footer-padding-v 0;
|
62 |
+
margin: 0;
|
63 |
+
display: flex;
|
64 |
+
justify-content: center;
|
65 |
+
background: white;
|
66 |
+
border-top: 1px solid #dcdcde;
|
67 |
+
|
68 |
+
@media ( min-width: $wpcom-modal-breakpoint ) {
|
69 |
+
border-top: none;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
.components-guide__page {
|
74 |
+
position: absolute;
|
75 |
+
width: 100%;
|
76 |
+
height: 100%;
|
77 |
+
justify-content: start;
|
78 |
}
|
79 |
|
80 |
+
.components-guide__page-control {
|
81 |
+
position: relative;
|
82 |
+
height: 0;
|
83 |
+
top: 100%;
|
84 |
+
overflow: visible;
|
85 |
+
margin: 0 auto;
|
86 |
+
z-index: 2;
|
87 |
+
|
88 |
+
&::before {
|
89 |
+
display: inline-block;
|
90 |
+
content: '';
|
91 |
+
height: $wpcom-modal-footer-height;
|
92 |
+
vertical-align: middle;
|
93 |
+
}
|
94 |
+
|
95 |
+
li {
|
96 |
+
vertical-align: middle;
|
97 |
+
margin-bottom: 0;
|
98 |
+
}
|
99 |
+
|
100 |
+
// Temporarily disable dots on mobile as alignment is wonky.
|
101 |
+
display: none;
|
102 |
+
@media ( min-width: $wpcom-modal-breakpoint ) {
|
103 |
+
display: block;
|
104 |
+
}
|
105 |
+
}
|
106 |
}
|
107 |
|
108 |
.wpcom-block-editor-nux__page {
|
109 |
display: flex;
|
110 |
+
flex-direction: column-reverse;
|
111 |
+
justify-content: flex-end;
|
112 |
+
background: white;
|
113 |
+
width: 100%;
|
114 |
+
height: 100%;
|
115 |
+
|
116 |
+
@media ( min-width: $wpcom-modal-breakpoint ) {
|
117 |
+
flex-direction: row;
|
118 |
+
justify-content: flex-start;
|
119 |
+
position: absolute;
|
120 |
+
min-height: $wpcom-modal-content-min-height;
|
121 |
+
bottom: 0;
|
122 |
+
}
|
123 |
}
|
124 |
|
125 |
.wpcom-block-editor-nux__text,
|
131 |
}
|
132 |
|
133 |
.wpcom-block-editor-nux__text {
|
134 |
+
padding: 0 25px 25px;
|
135 |
+
height: 60%;
|
136 |
+
|
137 |
@media ( min-width: $wpcom-modal-breakpoint ) {
|
138 |
+
height: auto;
|
139 |
+
padding: $wpcom-modal-padding-v $wpcom-modal-padding-h;
|
140 |
}
|
141 |
}
|
142 |
.wpcom-block-editor-nux__visual {
|
143 |
+
height: 40%;
|
|
|
144 |
background: #1381d8;
|
145 |
+
text-align: center;
|
146 |
+
|
|
|
|
|
147 |
@media ( min-width: $wpcom-modal-breakpoint ) {
|
148 |
+
height: auto;
|
149 |
}
|
150 |
}
|
151 |
|
154 |
/* Gray / Gray 90 */
|
155 |
color: #1d2327;
|
156 |
|
157 |
+
font-size: 32px;
|
158 |
line-height: 1.19;
|
159 |
|
160 |
@media ( min-width: $wpcom-modal-breakpoint ) {
|
163 |
}
|
164 |
|
165 |
.wpcom-block-editor-nux__description {
|
166 |
+
font-size: 15px;
|
167 |
+
line-height: 22px;
|
168 |
|
169 |
/* Gray / Gray 60 */
|
170 |
color: #50575e;
|
171 |
+
|
172 |
+
@media ( min-width: $wpcom-modal-breakpoint ) {
|
173 |
+
font-size: 17px;
|
174 |
+
line-height: 26px;
|
175 |
+
}
|
176 |
}
|
177 |
|
178 |
.wpcom-block-editor-nux__image {
|
184 |
&.align-bottom {
|
185 |
align-self: flex-end;
|
186 |
}
|
187 |
+
|
188 |
+
max-height: 100%;
|
189 |
+
|
190 |
+
@media ( min-width: $wpcom-modal-breakpoint ) {
|
191 |
+
max-height: none;
|
192 |
+
}
|
193 |
}
|