Full Site Editing - Version 3.14756

Version Description

Download this release

Release Info

Developer automattic
Plugin Icon wp plugin Full Site Editing
Version 3.14756
Comparing to
See all releases

Code changes from version 3.14741 to 3.14756

full-site-editing-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
- * Version: 3.14741
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
@@ -42,7 +42,7 @@ namespace A8C\FSE;
42
  *
43
  * @var string
44
  */
45
- define( 'A8C_ETK_PLUGIN_VERSION', '3.14741' );
46
 
47
  // Always include these helper files for dotcom FSE.
48
  require_once __DIR__ . '/dotcom-fse/helpers.php';
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
+ * Version: 3.14756
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
42
  *
43
  * @var string
44
  */
45
+ define( 'A8C_ETK_PLUGIN_VERSION', '3.14756' );
46
 
47
  // Always include these helper files for dotcom FSE.
48
  require_once __DIR__ . '/dotcom-fse/helpers.php';
global-styles/class-global-styles.php CHANGED
@@ -487,7 +487,7 @@ class Global_Styles {
487
  foreach ( $font_list as $font ) {
488
  // Some fonts lack italic variants,
489
  // the API will return only the regular and bold CSS for those.
490
- $font_list_str = $font_list_str . $font . ':regular,bold,italic,bolditalic|';
491
  }
492
  $result = $result . "@import url('https://fonts.googleapis.com/css?family=" . $font_list_str . "');";
493
  }
487
  foreach ( $font_list as $font ) {
488
  // Some fonts lack italic variants,
489
  // the API will return only the regular and bold CSS for those.
490
+ $font_list_str = $font_list_str . $font . ':thin,extralight,light,regular,medium,semibold,bold,italic,bolditalic,extrabold,black|';
491
  }
492
  $result = $result . "@import url('https://fonts.googleapis.com/css?family=" . $font_list_str . "');";
493
  }
global-styles/dist/global-styles.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', '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', 'wp-url'), 'version' => 'c878d5592c5a3541f8c427d02c747898');
1
+ <?php return array('dependencies' => array('lodash', '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', 'wp-primitives', 'wp-url'), 'version' => '03234296dd5020e06e41063485070b3f');
global-styles/dist/global-styles.js CHANGED
@@ -1,6 +1,6 @@
1
- !function(){var e={119:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:function(){return r}})},394:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(119);function o(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}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},779:function(e,t){var n;
2
  /*!
3
  Copyright (c) 2018 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
- */!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},268:function(){},682:function(e,t,n){"use strict";n.d(t,{iU:function(){return r},V6:function(){return o},GK:function(){return i},c$:function(){return s},R$:function(){return a},qD:function(){return u},px:function(){return l}});var r="font_base",o="font_base_default",i="font_headings",s="font_headings_default",a="font_pairings",u="font_options",l="blogname"},517:function(e,t,n){"use strict";var r=n(394),o=n(707),i=n(531),s=n.n(i),a=n(804);t.Z=function(e,t){s()((function(){var n={},i={},s={};e.forEach((function(e){s[e]="--".concat(e.replace("_","-"))}));var u=null;(0,o.subscribe)((function(){var l=(0,o.select)("core/editor").__unstableIsEditorReady;if(!(l&&!1===l()||(u||(u=document.createElement("style"),document.body.appendChild(u)),e.forEach((function(e){n[e]=t(e)})),(0,a.isEmpty)(n)||(0,a.isEqual)(n,i)))){i=(0,r.Z)({},n);var c="";Object.keys(n).forEach((function(e){c+="".concat(s[e],":").concat(n[e],";")})),u.textContent=".edit-post-visual-editor .editor-styles-wrapper{".concat(c,"}")}}))}))}},296:function(e,t,n){"use strict";var r=n(27),o=n(997),i=n(163),s=n(983),a=n(779),u=n.n(a),l=n(409),__=i.__;t.Z=function(e){var t=e.fontPairings,n=e.fontBase,i=e.fontHeadings,a=e.update;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h3",null,__("Font Pairings","full-site-editing")),t&&i&&n?(0,r.createElement)("div",{className:"style-preview__font-options"},(0,r.createElement)("div",{className:"style-preview__font-options-desktop"},t.map((function(e){var t=e.label,l=e.headings,c=e.base,f=l===i&&c===n;return(0,r.createElement)(o.Button,{className:u()("style-preview__font-option",{"is-selected":f}),onClick:function(){return a({headings:l,base:c})},onKeyDown:function(e){return e.keyCode===s.ENTER?a({headings:l,base:c}):null},key:t},(0,r.createElement)("span",{className:"style-preview__font-option-contents"},(0,r.createElement)("span",{style:{fontFamily:l,fontWeight:700}},l)," / ",(0,r.createElement)("span",{style:{fontFamily:c}},c)))})))):(0,r.createElement)(l.Z,{unsupportedFeature:__("font pairings","full-site-editing")}))}},529:function(e,t,n){"use strict";var r=n(27),o=n(997),i=n(163),s=n(409),__=i.__;t.Z=function(e){var t=e.fontBase,n=e.fontBaseDefault,i=e.fontHeadings,a=e.fontHeadingsDefault,u=e.fontBaseOptions,l=e.fontHeadingsOptions,c=e.updateBaseFont,f=e.updateHeadingsFont;return u&&l?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.SelectControl,{label:__("Heading Font","full-site-editing"),value:i,options:l,onChange:function(e){return f(e)},style:{fontFamily:"unset"!==i?i:a}}),(0,r.createElement)(o.SelectControl,{label:__("Base Font","full-site-editing"),value:t,options:u,onChange:function(e){return c(e)},style:{fontFamily:"unset"!==t?t:n}}),(0,r.createElement)("hr",null)):(0,r.createElement)(s.Z,{unsupportedFeature:__("custom font selection","full-site-editing")})}},464:function(e,t,n){"use strict";var r=n(119),o=n(27),i=n(997),s=n(707),a=n(649),u=n(163),l=n(791),c=n(682),f=n(296),p=n(529),d=n(60),__=u.__,g="ANY_PROPERTY",m=function(e){if("object"==typeof e){var t=e.label,n=e.value,r=e.prop;return{label:t,value:n,prop:void 0===r?g:r}}return{label:e,value:e,prop:g}},h=function(e){return null!==e.value&&null!==e.label},b=function(e,t){return e?e.map(m).filter(h).filter(function(e){return function(t){return t.prop===g||t.prop===e}}(t)):[]},O=function(e){var t=e.hasLocalChanges,n=e.resetAction,r=e.publishAction,s=e.className,a=void 0===s?null:s;return(0,o.createElement)("div",{className:a},(0,o.createElement)(i.Button,{disabled:!t,isDefault:!0,onClick:n},__("Reset","full-site-editing")),(0,o.createElement)(i.Button,{className:"global-styles-sidebar__publish-button",disabled:!t,isPrimary:!0,onClick:r},__("Publish","full-site-editing")))};t.Z=function(e){var t=e.fontHeadings,n=e.fontHeadingsDefault,g=e.fontBase,m=e.fontBaseDefault,h=e.fontPairings,v=e.fontOptions,y=e.siteName,w=e.publishOptions,E=e.updateOptions,_=e.hasLocalChanges,P=e.resetLocalChanges;(0,o.useEffect)((function(){"global-styles"===(0,l.getQueryArg)(window.location.href,"openSidebar")&&(0,s.dispatch)("core/edit-post").openGeneralSidebar("jetpack-global-styles/global-styles")}),[]);var S=function(){var e;return w((e={},(0,r.Z)(e,c.iU,g),(0,r.Z)(e,c.GK,t),e))};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.PluginSidebarMoreMenuItem,{icon:(0,o.createElement)(d.x,null),target:"global-styles"},__("Global Styles","full-site-editing")),(0,o.createElement)(a.PluginSidebar,{icon:(0,o.createElement)(d.x,null),name:"global-styles",title:__("Global Styles","full-site-editing"),className:"global-styles-sidebar"},(0,o.createElement)(i.PanelBody,null,(0,o.createElement)("p",null,(0,u.sprintf)(__("You are customizing %s.","full-site-editing"),y)),(0,o.createElement)("p",null,__("Any change you make here will apply to the entire website.","full-site-editing")),_?(0,o.createElement)("div",null,(0,o.createElement)("p",null,(0,o.createElement)("em",null,__("You have unsaved changes.","full-site-editing"))),(0,o.createElement)(O,{hasLocalChanges:_,publishAction:S,resetAction:P})):null),(0,o.createElement)(i.PanelBody,{title:__("Font Selection","full-site-editing")},(0,o.createElement)(p.Z,{fontBase:g,fontBaseDefault:m,fontHeadings:t,fontHeadingsDefault:n,fontBaseOptions:b(v,c.iU),fontHeadingsOptions:b(v,c.GK),updateBaseFont:function(e){return E((0,r.Z)({},c.iU,e))},updateHeadingsFont:function(e){return E((0,r.Z)({},c.GK,e))}}),(0,o.createElement)(f.Z,{fontHeadings:t,fontBase:g,fontPairings:h,update:function(e){var t,n=e.headings,o=e.base;return E((t={},(0,r.Z)(t,c.GK,n),(0,r.Z)(t,c.iU,o),t))}})),(0,o.createElement)(i.PanelBody,null,_?(0,o.createElement)("p",null,(0,o.createElement)("em",null,__("You have unsaved changes.","full-site-editing"))):null,(0,o.createElement)(O,{hasLocalChanges:_,publishAction:S,resetAction:P,className:"global-styles-sidebar__panel-action-buttons"}))))}},60:function(e,t,n){"use strict";n.d(t,{x:function(){return i}});var r=n(27),o=n(997),i=function(){return(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(o.Path,{d:"M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-4.05 16.5l-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13h-2.09z"}))}},409:function(e,t,n){"use strict";var r=n(27),o=n(163),__=o.__;t.Z=function(e){var t=e.unsupportedFeature;return(0,r.createElement)("p",null,(0,o.sprintf)(__("Your active theme doesn't support %s.","full-site-editing"),t))}},942:function(e,t,n){"use strict";var r=n(394),o=n(606),i=n.n(o),s=n(707),a={},u=!1,l={publishOptions:regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,{type:"IO_PUBLISH_OPTIONS",options:t};case 2:return e.abrupt("return",{type:"PUBLISH_OPTIONS",options:t});case 3:case"end":return e.stop()}}),e)})),updateOptions:function(e){return{type:"UPDATE_OPTIONS",options:e}},fetchOptions:function(){return{type:"IO_FETCH_OPTIONS"}},resetLocalChanges:function(){return{type:"RESET_OPTIONS",options:a}}};t.Z=function(e,t){(0,s.registerStore)(e,{reducer:function(e,t){switch(t.type){case"UPDATE_OPTIONS":case"RESET_OPTIONS":case"PUBLISH_OPTIONS":return(0,r.Z)((0,r.Z)({},e),t.options)}return e},actions:l,selectors:{getOption:function(e,t){return e?e[t]:void 0},hasLocalChanges:function(e){return!!e&&Object.keys(a).some((function(t){return a[t]!==e[t]}))}},resolvers:{getOption:regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,u=!0,e.next=6,l.fetchOptions();case 6:n=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),n={};case 12:return a=n,e.abrupt("return",{type:"UPDATE_OPTIONS",options:n});case 14:case"end":return e.stop()}}),e,null,[[2,9]])}))},controls:{IO_FETCH_OPTIONS:function(){return i()({path:t})},IO_PUBLISH_OPTIONS:function(e){var n=e.options;return a=n,i()({path:t,method:"POST",data:(0,r.Z)({},n)})}}})}},804:function(e){"use strict";e.exports=window.lodash},606:function(e){"use strict";e.exports=window.wp.apiFetch},997:function(e){"use strict";e.exports=window.wp.components},417:function(e){"use strict";e.exports=window.wp.compose},707:function(e){"use strict";e.exports=window.wp.data},531:function(e){"use strict";e.exports=window.wp.domReady},649:function(e){"use strict";e.exports=window.wp.editPost},27:function(e){"use strict";e.exports=window.wp.element},163:function(e){"use strict";e.exports=window.wp.i18n},983:function(e){"use strict";e.exports=window.wp.keycodes},200:function(e){"use strict";e.exports=window.wp.plugins},791:function(e){"use strict";e.exports=window.wp.url}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r);var e=n(417),t=n(707),o=n(200),i=n(682),s=n(517),a=n(464),u=n(942),l=(n(268),JETPACK_GLOBAL_STYLES_EDITOR_CONSTANTS),c=l.PLUGIN_NAME,f=l.STORE_NAME,p=l.REST_PATH;(0,u.Z)(f,p),(0,s.Z)([i.iU,i.GK],(0,t.select)(f).getOption),(0,o.registerPlugin)(c,{render:(0,e.compose)((0,t.withSelect)((function(e){return{siteName:e(f).getOption(i.px),fontHeadings:e(f).getOption(i.GK),fontHeadingsDefault:e(f).getOption(i.c$),fontBase:e(f).getOption(i.iU),fontBaseDefault:e(f).getOption(i.V6),fontPairings:e(f).getOption(i.R$),fontOptions:e(f).getOption(i.qD),hasLocalChanges:e(f).hasLocalChanges()}})),(0,t.withDispatch)((function(e){return{updateOptions:e(f).updateOptions,publishOptions:e(f).publishOptions,resetLocalChanges:e(f).resetLocalChanges}})))(a.Z)})}(),window.EditingToolkit=r}();
1
+ !function(){var e={119:function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:function(){return r}})},394:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(119);function o(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}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},107:function(e,t,n){"use strict";var r=n(27),o=n(418),i=(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(o.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));t.Z=i},779:function(e,t){var n;
2
  /*!
3
  Copyright (c) 2018 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},268:function(){},682:function(e,t,n){"use strict";n.d(t,{iU:function(){return r},V6:function(){return o},GK:function(){return i},c$:function(){return s},R$:function(){return a},qD:function(){return u},px:function(){return l}});var r="font_base",o="font_base_default",i="font_headings",s="font_headings_default",a="font_pairings",u="font_options",l="blogname"},517:function(e,t,n){"use strict";var r=n(394),o=n(707),i=n(531),s=n.n(i),a=n(804);t.Z=function(e,t){s()((function(){var n={},i={},s={};e.forEach((function(e){s[e]="--".concat(e.replace("_","-"))}));var u=null;(0,o.subscribe)((function(){var l=(0,o.select)("core/editor").__unstableIsEditorReady;if(!(l&&!1===l()||(u||(u=document.createElement("style"),document.body.appendChild(u)),e.forEach((function(e){n[e]=t(e)})),(0,a.isEmpty)(n)||(0,a.isEqual)(n,i)))){i=(0,r.Z)({},n);var c="";Object.keys(n).forEach((function(e){c+="".concat(s[e],":").concat(n[e],";")})),u.textContent=".edit-post-visual-editor .editor-styles-wrapper{".concat(c,"}")}}))}))}},296:function(e,t,n){"use strict";var r=n(27),o=n(997),i=n(163),s=n(983),a=n(779),u=n.n(a),l=n(409),__=i.__;t.Z=function(e){var t=e.fontPairings,n=e.fontBase,i=e.fontHeadings,a=e.update;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h3",null,__("Font Pairings","full-site-editing")),t&&i&&n?(0,r.createElement)("div",{className:"style-preview__font-options"},(0,r.createElement)("div",{className:"style-preview__font-options-desktop"},t.map((function(e){var t=e.label,l=e.headings,c=e.base,f=l===i&&c===n;return(0,r.createElement)(o.Button,{className:u()("style-preview__font-option",{"is-selected":f}),onClick:function(){return a({headings:l,base:c})},onKeyDown:function(e){return e.keyCode===s.ENTER?a({headings:l,base:c}):null},key:t},(0,r.createElement)("span",{className:"style-preview__font-option-contents"},(0,r.createElement)("span",{style:{fontFamily:l,fontWeight:700}},l)," / ",(0,r.createElement)("span",{style:{fontFamily:c}},c)))})))):(0,r.createElement)(l.Z,{unsupportedFeature:__("font pairings","full-site-editing")}))}},529:function(e,t,n){"use strict";var r=n(27),o=n(997),i=n(163),s=n(409),__=i.__;t.Z=function(e){var t=e.fontBase,n=e.fontBaseDefault,i=e.fontHeadings,a=e.fontHeadingsDefault,u=e.fontBaseOptions,l=e.fontHeadingsOptions,c=e.updateBaseFont,f=e.updateHeadingsFont;return u&&l?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.SelectControl,{label:__("Heading Font","full-site-editing"),value:i,options:l,onChange:function(e){return f(e)},style:{fontFamily:"unset"!==i?i:a}}),(0,r.createElement)(o.SelectControl,{label:__("Base Font","full-site-editing"),value:t,options:u,onChange:function(e){return c(e)},style:{fontFamily:"unset"!==t?t:n}}),(0,r.createElement)("hr",null)):(0,r.createElement)(s.Z,{unsupportedFeature:__("custom font selection","full-site-editing")})}},464:function(e,t,n){"use strict";var r=n(119),o=n(27),i=n(997),s=n(707),a=n(649),u=n(163),l=n(107),c=n(791),f=n(682),p=n(296),d=n(529),__=u.__,g="ANY_PROPERTY",m=function(e){if("object"==typeof e){var t=e.label,n=e.value,r=e.prop;return{label:t,value:n,prop:void 0===r?g:r}}return{label:e,value:e,prop:g}},b=function(e){return null!==e.value&&null!==e.label},h=function(e,t){return e?e.map(m).filter(b).filter(function(e){return function(t){return t.prop===g||t.prop===e}}(t)):[]},O=function(e){var t=e.hasLocalChanges,n=e.resetAction,r=e.publishAction,s=e.className,a=void 0===s?null:s;return(0,o.createElement)("div",{className:a},(0,o.createElement)(i.Button,{disabled:!t,isDefault:!0,onClick:n},__("Reset","full-site-editing")),(0,o.createElement)(i.Button,{className:"global-styles-sidebar__publish-button",disabled:!t,isPrimary:!0,onClick:r},__("Publish","full-site-editing")))};t.Z=function(e){var t=e.fontHeadings,n=e.fontHeadingsDefault,g=e.fontBase,m=e.fontBaseDefault,b=e.fontPairings,v=e.fontOptions,y=e.siteName,w=e.publishOptions,E=e.updateOptions,_=e.hasLocalChanges,P=e.resetLocalChanges;(0,o.useEffect)((function(){"global-styles"===(0,c.getQueryArg)(window.location.href,"openSidebar")&&(0,s.dispatch)("core/edit-post").openGeneralSidebar("jetpack-global-styles/global-styles")}),[]);var S=function(){var e;return w((e={},(0,r.Z)(e,f.iU,g),(0,r.Z)(e,f.GK,t),e))};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.PluginSidebarMoreMenuItem,{icon:l.Z,target:"global-styles"},__("Global Styles","full-site-editing")),(0,o.createElement)(a.PluginSidebar,{icon:l.Z,name:"global-styles",title:__("Global Styles","full-site-editing"),className:"global-styles-sidebar"},(0,o.createElement)(i.PanelBody,null,(0,o.createElement)("p",null,(0,u.sprintf)(__("You are customizing %s.","full-site-editing"),y)),(0,o.createElement)("p",null,__("Any change you make here will apply to the entire website.","full-site-editing")),_?(0,o.createElement)("div",null,(0,o.createElement)("p",null,(0,o.createElement)("em",null,__("You have unsaved changes.","full-site-editing"))),(0,o.createElement)(O,{hasLocalChanges:_,publishAction:S,resetAction:P})):null),(0,o.createElement)(i.PanelBody,{title:__("Font Selection","full-site-editing")},(0,o.createElement)(d.Z,{fontBase:g,fontBaseDefault:m,fontHeadings:t,fontHeadingsDefault:n,fontBaseOptions:h(v,f.iU),fontHeadingsOptions:h(v,f.GK),updateBaseFont:function(e){return E((0,r.Z)({},f.iU,e))},updateHeadingsFont:function(e){return E((0,r.Z)({},f.GK,e))}}),(0,o.createElement)(p.Z,{fontHeadings:t,fontBase:g,fontPairings:b,update:function(e){var t,n=e.headings,o=e.base;return E((t={},(0,r.Z)(t,f.GK,n),(0,r.Z)(t,f.iU,o),t))}})),(0,o.createElement)(i.PanelBody,null,_?(0,o.createElement)("p",null,(0,o.createElement)("em",null,__("You have unsaved changes.","full-site-editing"))):null,(0,o.createElement)(O,{hasLocalChanges:_,publishAction:S,resetAction:P,className:"global-styles-sidebar__panel-action-buttons"}))))}},409:function(e,t,n){"use strict";var r=n(27),o=n(163),__=o.__;t.Z=function(e){var t=e.unsupportedFeature;return(0,r.createElement)("p",null,(0,o.sprintf)(__("Your active theme doesn't support %s.","full-site-editing"),t))}},942:function(e,t,n){"use strict";var r=n(394),o=n(606),i=n.n(o),s=n(707),a={},u=!1,l={publishOptions:regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,{type:"IO_PUBLISH_OPTIONS",options:t};case 2:return e.abrupt("return",{type:"PUBLISH_OPTIONS",options:t});case 3:case"end":return e.stop()}}),e)})),updateOptions:function(e){return{type:"UPDATE_OPTIONS",options:e}},fetchOptions:function(){return{type:"IO_FETCH_OPTIONS"}},resetLocalChanges:function(){return{type:"RESET_OPTIONS",options:a}}};t.Z=function(e,t){(0,s.registerStore)(e,{reducer:function(e,t){switch(t.type){case"UPDATE_OPTIONS":case"RESET_OPTIONS":case"PUBLISH_OPTIONS":return(0,r.Z)((0,r.Z)({},e),t.options)}return e},actions:l,selectors:{getOption:function(e,t){return e?e[t]:void 0},hasLocalChanges:function(e){return!!e&&Object.keys(a).some((function(t){return a[t]!==e[t]}))}},resolvers:{getOption:regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,u=!0,e.next=6,l.fetchOptions();case 6:n=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),n={};case 12:return a=n,e.abrupt("return",{type:"UPDATE_OPTIONS",options:n});case 14:case"end":return e.stop()}}),e,null,[[2,9]])}))},controls:{IO_FETCH_OPTIONS:function(){return i()({path:t})},IO_PUBLISH_OPTIONS:function(e){var n=e.options;return a=n,i()({path:t,method:"POST",data:(0,r.Z)({},n)})}}})}},804:function(e){"use strict";e.exports=window.lodash},606:function(e){"use strict";e.exports=window.wp.apiFetch},997:function(e){"use strict";e.exports=window.wp.components},417:function(e){"use strict";e.exports=window.wp.compose},707:function(e){"use strict";e.exports=window.wp.data},531:function(e){"use strict";e.exports=window.wp.domReady},649:function(e){"use strict";e.exports=window.wp.editPost},27:function(e){"use strict";e.exports=window.wp.element},163:function(e){"use strict";e.exports=window.wp.i18n},983:function(e){"use strict";e.exports=window.wp.keycodes},200:function(e){"use strict";e.exports=window.wp.plugins},418:function(e){"use strict";e.exports=window.wp.primitives},791:function(e){"use strict";e.exports=window.wp.url}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r);var e=n(417),t=n(707),o=n(200),i=n(682),s=n(517),a=n(464),u=n(942),l=(n(268),JETPACK_GLOBAL_STYLES_EDITOR_CONSTANTS),c=l.PLUGIN_NAME,f=l.STORE_NAME,p=l.REST_PATH;(0,u.Z)(f,p),(0,s.Z)([i.iU,i.GK],(0,t.select)(f).getOption),(0,o.registerPlugin)(c,{render:(0,e.compose)((0,t.withSelect)((function(e){return{siteName:e(f).getOption(i.px),fontHeadings:e(f).getOption(i.GK),fontHeadingsDefault:e(f).getOption(i.c$),fontBase:e(f).getOption(i.iU),fontBaseDefault:e(f).getOption(i.V6),fontPairings:e(f).getOption(i.R$),fontOptions:e(f).getOption(i.qD),hasLocalChanges:e(f).hasLocalChanges()}})),(0,t.withDispatch)((function(e){return{updateOptions:e(f).updateOptions,publishOptions:e(f).publishOptions,resetLocalChanges:e(f).resetLocalChanges}})))(a.Z)})}(),window.EditingToolkit=r}();
global-styles/src/global-styles-sidebar.js CHANGED
@@ -3,11 +3,11 @@ import { dispatch } from '@wordpress/data';
3
  import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
4
  import { useEffect } from '@wordpress/element';
5
  import { __, sprintf } from '@wordpress/i18n';
 
6
  import { getQueryArg } from '@wordpress/url';
7
  import { FONT_BASE, FONT_HEADINGS } from './constants';
8
  import FontPairingsPanel from './font-pairings-panel';
9
  import FontSelectionPanel from './font-selection-panel';
10
- import { GlobalStylesIcon } from './icon';
11
 
12
  const ANY_PROPERTY = 'ANY_PROPERTY';
13
 
@@ -77,11 +77,11 @@ export default ( {
77
  } );
78
  return (
79
  <>
80
- <PluginSidebarMoreMenuItem icon={ <GlobalStylesIcon /> } target="global-styles">
81
  { __( 'Global Styles', 'full-site-editing' ) }
82
  </PluginSidebarMoreMenuItem>
83
  <PluginSidebar
84
- icon={ <GlobalStylesIcon /> }
85
  name={ 'global-styles' }
86
  title={ __( 'Global Styles', 'full-site-editing' ) }
87
  className="global-styles-sidebar"
3
  import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
4
  import { useEffect } from '@wordpress/element';
5
  import { __, sprintf } from '@wordpress/i18n';
6
+ import { typography } from '@wordpress/icons';
7
  import { getQueryArg } from '@wordpress/url';
8
  import { FONT_BASE, FONT_HEADINGS } from './constants';
9
  import FontPairingsPanel from './font-pairings-panel';
10
  import FontSelectionPanel from './font-selection-panel';
 
11
 
12
  const ANY_PROPERTY = 'ANY_PROPERTY';
13
 
77
  } );
78
  return (
79
  <>
80
+ <PluginSidebarMoreMenuItem icon={ typography } target="global-styles">
81
  { __( 'Global Styles', 'full-site-editing' ) }
82
  </PluginSidebarMoreMenuItem>
83
  <PluginSidebar
84
+ icon={ typography }
85
  name={ 'global-styles' }
86
  title={ __( 'Global Styles', 'full-site-editing' ) }
87
  className="global-styles-sidebar"
global-styles/src/icon.js DELETED
@@ -1,9 +0,0 @@
1
- import { Path, SVG } from '@wordpress/components';
2
-
3
- // For now, this icon shows a font style picker. Once we add colors, we'll want colors.
4
-
5
- export const GlobalStylesIcon = () => (
6
- <SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
7
- <Path d="M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-4.05 16.5l-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13h-2.09z" />
8
- </SVG>
9
- );
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.5
5
  Tested up to: 5.6
6
- Stable tag: 3.14741
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.5
5
  Tested up to: 5.6
6
+ Stable tag: 3.14756
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html