Full Site Editing - Version 0.24

Version Description

  • Starter Page Templates: fix overflow issue with feature image in blog posts.
  • Global Styles: add new font (Raleway).
Download this release

Release Info

Developer nosolosw
Plugin Icon wp plugin Full Site Editing
Version 0.24
Comparing to
See all releases

Code changes from version 0.23 to 0.24

full-site-editing-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
/**
3
* Plugin Name: Full Site Editing
4
* Description: Enhances your page creation workflow within the Block Editor.
5
- * Version: 0.23
6
* Author: Automattic
7
* Author URI: https://automattic.com/wordpress-plugins/
8
* License: GPLv2 or later
@@ -35,7 +35,7 @@ namespace A8C\FSE;
35
*
36
* @var string
37
*/
38
- define( 'PLUGIN_VERSION', '0.23' );
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: 0.24
6
* Author: Automattic
7
* Author URI: https://automattic.com/wordpress-plugins/
8
* License: GPLv2 or later
35
*
36
* @var string
37
*/
38
+ define( 'PLUGIN_VERSION', '0.24' );
39
40
// Always include these helper files for dotcom FSE.
41
require_once __DIR__ . '/dotcom-fse/helpers.php';
global-styles/class-global-styles.php CHANGED
@@ -78,7 +78,7 @@ class Global_Styles {
78
*/
79
private $plugin_name = 'jetpack-global-styles';
80
81
- const VERSION = '1909241817';
82
83
const SYSTEM_FONT = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif';
84
const AVAILABLE_FONTS = [
@@ -103,6 +103,7 @@ class Global_Styles {
103
'Open Sans',
104
'Playfair Display',
105
'Poppins',
106
'Roboto',
107
'Roboto Slab',
108
'Rubik',
78
*/
79
private $plugin_name = 'jetpack-global-styles';
80
81
+ const VERSION = '2003121439';
82
83
const SYSTEM_FONT = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif';
84
const AVAILABLE_FONTS = [
103
'Open Sans',
104
'Playfair Display',
105
'Poppins',
106
+ 'Raleway',
107
'Roboto',
108
'Roboto Slab',
109
'Rubik',
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.3
6
- Stable tag: 0.23
7
Requires PHP: 5.6.20
8
License: GPLv2 or later
9
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -42,6 +42,11 @@ This plugin is experimental, so we don't provide any support for it outside of w
42
43
== Changelog ==
44
45
= 0.23 =
46
* Dotcom Block Editor NUX: disable by default
47
3
Tags: block, blocks, editor, gutenberg, page
4
Requires at least: 5.0
5
Tested up to: 5.3
6
+ Stable tag: 0.24
7
Requires PHP: 5.6.20
8
License: GPLv2 or later
9
License URI: https://www.gnu.org/licenses/gpl-2.0.html
42
43
== Changelog ==
44
45
+ = 0.24 =
46
+
47
+ * Starter Page Templates: fix overflow issue with feature image in blog posts.
48
+ * Global Styles: add new font (Raleway).
49
+
50
= 0.23 =
51
* Dotcom Block Editor NUX: disable by default
52
starter-page-templates/dist/starter-page-templates.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => 'c5ea3a2d0a7fbc2cafc527640bc39fc8');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-nux', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => 'f6ee5c97e8cf7a44919c93b255d1713f');
starter-page-templates/dist/starter-page-templates.css CHANGED
@@ -1 +1 @@
1
- .page-template-modal-screen-overlay{animation:none;background-color:transparent;z-index:99}@media screen and (min-width:783px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{left:36px}}@media screen and (min-width:961px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{left:160px}}@media screen and (min-width:783px){body:not(.is-fullscreen-mode).folded .page-template-modal-screen-overlay{left:36px}body:not(.is-fullscreen-mode):not(.folded):not(.auto-fold) .page-template-modal-screen-overlay{left:160px}}body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:46px}@media screen and (min-width:783px){body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:32px}}.page-template-modal{width:100%;height:100vh;animation:none;box-shadow:none;border:none;top:0;left:0;right:0;bottom:0;transform:none;max-width:none;max-height:none;background-color:#eee}.page-template-modal .components-modal__header-heading-container{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__close-button{display:block;position:absolute;z-index:20;top:9px;width:36px;height:36px;left:10px}.page-template-modal .components-modal__header:after{display:block;position:absolute;content:" ";border-right:1px solid #e2e4e7;height:100%;left:56px}.page-template-modal .components-modal__content{overflow-y:scroll;-webkit-overflow-scrolling:touch}.page-template-modal__inner{position:relative;margin:0 auto;padding:0 20px 40px}.page-template-modal__list{margin-bottom:20px}.page-template-modal__list .components-base-control__label{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.template-selector-control__options{display:grid;grid-template-columns:1fr;grid-gap:.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}}.template-selector-item__label{display:block;width:100%;font-size:14px;text-align:center;border:2px solid #e2e4e7;border-radius:6px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;overflow:hidden;background-color:#fff;position:relative;transform:translateZ(0)}.template-selector-item__label:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;outline:2px solid transparent}.template-selector-item__label:hover{border:2px solid #c9c9ca}.template-selector-item__label.is-selected{border:2px solid #555d66;outline:2px solid transparent;outline-offset:-2px}.template-selector-item__label.is-selected:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;border:2px solid #555d66;outline:4px solid transparent;outline-offset:-4px}.template-selector-item__preview-wrap{width:100%;display:block;margin:0 auto;background:#fff;border-radius:0;overflow:hidden;height:0;padding-top:120%;box-sizing:content-box;position:relative;pointer-events:none;opacity:1;transform:translateZ(0)}@media screen and (min-width:660px){.template-selector-item__preview-wrap{padding-top:100%}}.template-selector-item__preview-wrap.is-rendering{opacity:.5}.template-selector-item__media{width:100%;display:block;position:absolute;top:0;left:0}@media screen and (min-width:660px){.page-template-modal__form{max-width:20%}}@media screen and (min-width:783px){.page-template-modal__form{max-width:30%}}.page-template-modal__form-title{font-weight:700;margin-bottom:1em;text-align:center}@media screen and (min-width:660px){.page-template-modal__form-title{text-align:left}}.page-template-modal__buttons{position:absolute;right:0;top:0;z-index:10;height:56px;display:flex;align-items:center;padding-right:24px}@media screen and (min-width:660px){.page-template-modal__buttons{display:flex}}.page-template-modal__buttons.is-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__buttons .components-button{height:33px;line-height:32px}.template-selector-preview{display:none;position:fixed;top:157px;bottom:24px;left:calc(20% + 48px);right:24px;background:#fff;border-radius:2px;overflow:hidden;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}@media screen and (min-width:660px){.template-selector-preview{display:block}.template-selector-preview.is-blank-preview{align-items:center;display:flex;justify-content:center}}@media screen and (min-width:783px){.template-selector-preview{top:143px;left:calc(30% + 72px)}body:not(.auto-fold):not(.folded) .template-selector-preview{left:calc(30% + 172px)}}@media screen and (min-width:961px){.template-selector-preview{left:calc(30% + 172px)}body.folded .template-selector-preview{left:calc(30% + 72px)}}body.is-fullscreen-mode .template-selector-preview{top:111px}@media screen and (min-width:783px){body.is-fullscreen-mode .template-selector-preview{left:calc(30% + 48px)!important}}.template-selector-preview .edit-post-visual-editor{margin:0;padding:0}.template-selector-preview.not-selected .editor-styles-wrapper{position:relative;width:100%;height:100%}.template-selector-preview.not-selected .editor-styles-wrapper .template-selector-preview__empty-state{position:absolute;width:100%;text-align:center;height:50px;line-height:50px;top:50%;margin:-25px 0 0}.page-template-modal__loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:flex-end}.page-template-modal__loading .components-spinner{float:none}.sidebar-modal-opener{display:flex;flex-direction:column;align-items:center;justify-content:center}.sidebar-modal-opener .template-selector-item__label{max-width:300px}.sidebar-modal-opener__button{margin-top:20px}.sidebar-modal-opener__warning-modal{display:flex;flex-direction:column;justify-content:center;align-items:center}.sidebar-modal-opener__warning-text{max-width:300px;font-size:1rem;line-height:1.5rem}.sidebar-modal-opener__warning-options{float:right;margin-top:20px}.sidebar-modal-opener__warning-options .components-button{margin-left:12px}.block-iframe-preview{position:absolute;top:0;left:0;transform-origin:top left;text-align:initial;margin:0;overflow:visible;min-height:auto;width:1440px}.block-iframe-preview-body{margin:0;padding:0;overflow-x:hidden;overflow-y:auto}.block-iframe-preview-body>.block-editor,.block-iframe-preview-body>.block-editor>.edit-post-visual-editor{padding:0;margin:0}.block-iframe-preview-body .block-editor-inserter,.block-iframe-preview-body .block-list-appender{display:none!important;visibility:hidden;position:absolute;left:-9999vw}.block-iframe-preview-body .editor-styles-wrapper .wp-block-cover{height:auto}.block-iframe-preview-body .editor-styles-wrapper .wp-block-embed__wrapper iframe{height:auto;min-height:400px}.block-iframe-preview-body [data-type="core/paragraph"] [data-rich-text-placeholder]{display:none}.block-iframe-preview-body .swiper-wrapper{display:flex}.block-iframe-preview-body .swiper-button-next,.block-iframe-preview-body .swiper-button-prev{display:none}.block-iframe-preview-body .swiper-pagination{text-align:center}.block-iframe-preview-body .swiper-pagination-bullet{border-radius:100%}.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/cover"][data-align=full],.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/group"]{margin-top:0;margin-bottom:0}.block-iframe-preview-body .block-iframe-preview__template-title{padding-top:20px}
1
+ .page-template-modal-screen-overlay{animation:none;background-color:transparent;z-index:99}@media screen and (min-width:783px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{left:36px}}@media screen and (min-width:961px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{left:160px}}@media screen and (min-width:783px){body:not(.is-fullscreen-mode).folded .page-template-modal-screen-overlay{left:36px}body:not(.is-fullscreen-mode):not(.folded):not(.auto-fold) .page-template-modal-screen-overlay{left:160px}}body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:46px}@media screen and (min-width:783px){body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:32px}}.page-template-modal{width:100%;height:100vh;animation:none;box-shadow:none;border:none;top:0;left:0;right:0;bottom:0;transform:none;max-width:none;max-height:none;background-color:#eee}.page-template-modal .components-modal__header-heading-container{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__close-button{display:block;position:absolute;z-index:20;top:9px;width:36px;height:36px;left:10px}.page-template-modal .components-modal__header:after{display:block;position:absolute;content:" ";border-right:1px solid #e2e4e7;height:100%;left:56px}.page-template-modal .components-modal__content{overflow-y:scroll;-webkit-overflow-scrolling:touch}.page-template-modal__inner{position:relative;margin:0 auto;padding:0 20px 40px}.page-template-modal__list{margin-bottom:20px}.page-template-modal__list .components-base-control__label{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.template-selector-control__options{display:grid;grid-template-columns:1fr;grid-gap:.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}}.template-selector-item__label{display:block;width:100%;font-size:14px;text-align:center;border:2px solid #e2e4e7;border-radius:6px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;overflow:hidden;background-color:#fff;position:relative;transform:translateZ(0)}.template-selector-item__label:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;outline:2px solid transparent}.template-selector-item__label:hover{border:2px solid #c9c9ca}.template-selector-item__label.is-selected{border:2px solid #555d66;outline:2px solid transparent;outline-offset:-2px}.template-selector-item__label.is-selected:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;border:2px solid #555d66;outline:4px solid transparent;outline-offset:-4px}.template-selector-item__preview-wrap{width:100%;display:block;margin:0 auto;background:#fff;border-radius:0;overflow:hidden;height:0;padding-top:120%;box-sizing:content-box;position:relative;pointer-events:none;opacity:1;transform:translateZ(0)}@media screen and (min-width:660px){.template-selector-item__preview-wrap{padding-top:100%}}.template-selector-item__preview-wrap.is-rendering{opacity:.5}.template-selector-item__media{width:100%;display:block;position:absolute;top:0;left:0}@media screen and (min-width:660px){.page-template-modal__form{max-width:20%}}@media screen and (min-width:783px){.page-template-modal__form{max-width:30%}}.page-template-modal__form-title{font-weight:700;margin-bottom:1em;text-align:center}@media screen and (min-width:660px){.page-template-modal__form-title{text-align:left}}.page-template-modal__buttons{position:absolute;right:0;top:0;z-index:10;height:56px;display:flex;align-items:center;padding-right:24px}@media screen and (min-width:660px){.page-template-modal__buttons{display:flex}}.page-template-modal__buttons.is-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__buttons .components-button{height:33px;line-height:32px}.template-selector-preview{display:none;position:fixed;top:157px;bottom:24px;left:calc(20% + 48px);right:24px;background:#fff;border-radius:2px;overflow:hidden;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}@media screen and (min-width:660px){.template-selector-preview{display:block}.template-selector-preview.is-blank-preview{align-items:center;display:flex;justify-content:center}}@media screen and (min-width:783px){.template-selector-preview{top:143px;left:calc(30% + 72px)}body:not(.auto-fold):not(.folded) .template-selector-preview{left:calc(30% + 172px)}}@media screen and (min-width:961px){.template-selector-preview{left:calc(30% + 172px)}body.folded .template-selector-preview{left:calc(30% + 72px)}}body.is-fullscreen-mode .template-selector-preview{top:111px}@media screen and (min-width:783px){body.is-fullscreen-mode .template-selector-preview{left:calc(30% + 48px)!important}}.template-selector-preview .edit-post-visual-editor{margin:0;padding:0}.template-selector-preview.not-selected .editor-styles-wrapper{position:relative;width:100%;height:100%}.template-selector-preview.not-selected .editor-styles-wrapper .template-selector-preview__empty-state{position:absolute;width:100%;text-align:center;height:50px;line-height:50px;top:50%;margin:-25px 0 0}.page-template-modal__loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:flex-end}.page-template-modal__loading .components-spinner{float:none}.sidebar-modal-opener{display:flex;flex-direction:column;align-items:center;justify-content:center}.sidebar-modal-opener .template-selector-item__label{max-width:300px}.sidebar-modal-opener__button{margin-top:20px}.sidebar-modal-opener__warning-modal{display:flex;flex-direction:column;justify-content:center;align-items:center}.sidebar-modal-opener__warning-text{max-width:300px;font-size:1rem;line-height:1.5rem}.sidebar-modal-opener__warning-options{float:right;margin-top:20px}.sidebar-modal-opener__warning-options .components-button{margin-left:12px}.block-iframe-preview{position:absolute;top:0;left:0;transform-origin:top left;text-align:initial;margin:0;overflow:visible;min-height:auto;width:1440px}.block-iframe-preview-body{margin:0;padding:0;overflow-x:hidden;overflow-y:auto}.block-iframe-preview-body>.block-editor,.block-iframe-preview-body>.block-editor>.edit-post-visual-editor{padding:0;margin:0}.block-iframe-preview-body .block-editor-inserter,.block-iframe-preview-body .block-list-appender{display:none!important;visibility:hidden;position:absolute;left:-9999vw}.block-iframe-preview-body .editor-styles-wrapper .wp-block-cover{height:auto}.block-iframe-preview-body .editor-styles-wrapper .wp-block-embed__wrapper iframe{height:auto;min-height:400px}.block-iframe-preview-body [data-type="core/paragraph"] [data-rich-text-placeholder]{display:none}.block-iframe-preview-body .swiper-wrapper{display:flex}.block-iframe-preview-body .swiper-button-next,.block-iframe-preview-body .swiper-button-prev{display:none}.block-iframe-preview-body .swiper-pagination{text-align:center}.block-iframe-preview-body .swiper-pagination-bullet{border-radius:100%}.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/cover"][data-align=full],.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/group"]{margin-top:0;margin-bottom:0}.block-iframe-preview-body .block-iframe-preview__template-title{padding-top:20px}.block-iframe-preview-body .wp-block-columns>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="core/column"] .block-core-columns{flex-basis:auto}
starter-page-templates/dist/starter-page-templates.js CHANGED
@@ -3,4 +3,4 @@
3
Copyright (c) 2017 Jed Watson.
4
Licensed under the MIT License (MIT), see
5
http://jedwatson.github.io/classnames
6
- */!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var a=i.apply(null,r);a&&e.push(a)}else if("object"===o)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(3);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(27),i=n(4);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var r=n(28);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t){!function(){e.exports=this.wp.blocks}()},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 r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){var r=n(31),i=n(32),o=n(33);e.exports=function(e,t){return r(e)||i(e,t)||o()}},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){function n(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,l,"next",e)}function l(e){n(a,i,o,s,l,"throw",e)}s(void 0)}))}}},function(e,t,n){var r=n(34),i=n(35),o=n(36);e.exports=function(e){return r(e)||i(e)||o()}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t){!function(){e.exports=this.wp.editor}()},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){!function(){e.exports=this.wp.nux}()},function(e,t,n){},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,n){"use strict";n.r(t);var r=n(16),i=n.n(r),o=n(0),a=n(2),s=n(17),l=n(6),c=n(23),u=n(9),p=n.n(u),m=n(10),d=n.n(m),f=n(11),b=n.n(f),g=n(12),v=n.n(g),O=n(13),h=n.n(O),j=n(4),y=n.n(j),_=n(14),w=n.n(_),T=n(3),k=n.n(T),P=n(1),E=n(8),S=n.n(E),x=(n(29),n(7)),B=n(5),C=n(15),N=n(18),I=(n(30),n(19)),A=n.n(I),M=n(20),L=n(24),D=function(e){var t=e.blocks,n=e.settings,r=e.hidePageTitle,i=e.recomputeBlockListKey;return Object(o.createElement)(M.BlockEditorProvider,{value:t,settings:n},Object(o.createElement)(B.Disabled,{key:i},!r&&Object(o.createElement)("div",{className:"block-iframe-preview__template-title"},Object(o.createElement)(L.PostTitle,null)),Object(o.createElement)(M.BlockList,null)))},F=Object(x.compose)(x.withSafeTimeout,Object(l.withSelect)((function(e){var t=e("core/block-editor");return{settings:t?t.getSettings():{}}})))((function(e){var t=e.className,n=void 0===t?"block-iframe-preview":t,r=e.bodyClassName,i=void 0===r?"block-iframe-preview-body":r,s=e.viewportWidth,l=e.blocks,c=e.settings,u=e.setTimeout,p=void 0===u?P.noop:u,m=e.title,d=Object(o.useRef)(),f=Object(o.useRef)(),b=Object(o.useRef)(),g=Object(o.useState)({transform:"scale( 1 )"}),v=A()(g,2),O=v[0],h=v[1],j=Object(o.useMemo)((function(){return Object(P.castArray)(l)}),[l]),y=Object(o.useReducer)((function(e){return e+1}),0),_=A()(y,2),w=_[0],T=_[1];Object(o.useLayoutEffect)(T,[l]);var k=Object(o.useCallback)((function(){var e=Object(P.get)(d,["current","parentNode"]);if(e){var t=s||d.current.offsetWidth,n=e.offsetWidth/s,r=e.offsetHeight/n;h({width:t,height:r,transform:"scale( ".concat(n," )")})}}),[s]);return Object(o.useEffect)((function(){if(m){var e=Object(P.get)(b,["current","contentDocument","body"]);if(e){var t=e.querySelector(".editor-post-title .editor-post-title__input");t&&(t.value=m)}}}),[w]),Object(o.useEffect)((function(){p((function(){var e,t,n,r;e=window.document,t=b.current.contentDocument,n=["link","style"],r={head:new DocumentFragment,body:new DocumentFragment},Object(P.each)(Object.keys(r),(function(t){return Object(P.each)(Object(P.filter)(e[t].children,(function(e){var t=e.localName;return(n.includes(t))})),(function(e){r[t].appendChild(e.cloneNode(!0))}))})),t.head.appendChild(r.head),t.body.appendChild(r.body),b.current.contentDocument.body.classList.add(i),b.current.contentDocument.body.classList.add("editor-styles-wrapper"),k()}),0)}),[p,i,k]),Object(o.useEffect)((function(){var e=Object(P.get)(b,["current","contentDocument","body"]);e&&(e.scrollTop=0)}),[w]),Object(o.useEffect)((function(){var e=f&&f.current;e&&b.current.contentDocument.body.appendChild(e)}),[w]),Object(o.useEffect)((function(){var e=Object(P.debounce)(k,300);return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[k]),Object(o.useEffect)((function(){return window.jQuery&&window.jQuery(window.document).on("wp-collapse-menu",k),function(){window.jQuery&&window.jQuery(window.document).off("wp-collapse-menu",k)}}),[k]),Object(o.createElement)("div",{ref:d},Object(o.createElement)("iframe",{ref:b,title:Object(a.__)("Preview"),className:S()("editor-styles-wrapper",n),style:O}),Object(o.createElement)("div",{ref:f,className:"block-editor"},Object(o.createElement)("div",{className:"edit-post-visual-editor"},Object(o.createElement)("div",{className:"editor-styles-wrapper"},Object(o.createElement)("div",{className:"editor-writing-flow"},Object(o.createElement)(D,{blocks:j,settings:c,hidePageTitle:!m,recomputeBlockListKey:w}))))))})),W=function(e){var t=e.id,n=e.value,r=e.onSelect,i=e.label,a=e.useDynamicPreview,s=void 0!==a&&a,l=e.staticPreviewImg,c=e.staticPreviewImgAlt,u=void 0===c?"":c,p=e.blocks,m=void 0===p?[]:p,d=e.isSelected;if(Object(P.isNil)(t)||Object(P.isNil)(i)||Object(P.isNil)(n))return null;if(s&&(Object(P.isNil)(m)||Object(P.isEmpty)(m)))return null;var f=s?Object(o.createElement)(B.Disabled,null,Object(o.createElement)(F,{blocks:m,viewportWidth:960})):Object(o.createElement)("img",{className:"template-selector-item__media",src:l,alt:u}),b="label-".concat(t,"-").concat(n);return Object(o.createElement)("button",{type:"button",className:S()("template-selector-item__label",{"is-selected":d}),value:n,onClick:function(){r(n)},"aria-labelledby":"".concat(t," ").concat(b)},Object(o.createElement)("span",{className:"template-selector-item__preview-wrap"},f))},G={Address:Object(a._x)("123 Main St","default address","full-site-editing"),Phone:Object(a._x)("555-555-5555","default phone number","full-site-editing"),CompanyName:Object(a._x)("Your Company Name","default company name","full-site-editing"),Vertical:Object(a._x)("Business","default vertical name","full-site-editing")},U={CompanyName:"title",Address:"address",Phone:"phone",Vertical:"vertical"},R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e.replace(/{{(\w+)}}/g,(function(e,n){var r=G[n];return t[U[n]]||r||n})):""},q=Object(x.compose)(o.memo,x.withInstanceId)((function(e){var t=e.label,n=e.className,r=e.help,i=e.instanceId,a=e.templates,s=void 0===a?[]:a,l=e.blocksByTemplates,c=void 0===l?{}:l,u=e.useDynamicPreview,p=void 0!==u&&u,m=e.onTemplateSelect,d=void 0===m?P.noop:m,f=e.siteInformation,b=void 0===f?{}:f,g=e.selectedTemplate;if(Object(P.isEmpty)(s)||!Object(P.isArray)(s))return null;if(!0===p&&Object(P.isEmpty)(c))return null;var v="template-selector-control-".concat(i);return Object(o.createElement)(B.BaseControl,{label:t,id:v,help:r,className:S()(n,"template-selector-control")},Object(o.createElement)("ul",{className:"template-selector-control__options","data-testid":"template-selector-control-options"},Object(P.map)(s,(function(e){var t=e.slug,n=e.title,i=e.preview,a=e.previewAlt;return Object(o.createElement)("li",{key:"".concat(v,"-").concat(t),className:"template-selector-control__template"},Object(o.createElement)(W,{id:v,value:t,label:R(n,b),help:r,onSelect:d,staticPreviewImg:i,staticPreviewImgAlt:a,blocks:c.hasOwnProperty(t)?c[t]:[],useDynamicPreview:p,isSelected:t===g}))}))))})),z=function(e){var t=e.blocks,n=void 0===t?[]:t,r=e.viewportWidth,i=e.title,s=!n.length;return Object(o.createElement)("div",{className:"template-selector-preview ".concat(s?"not-selected":"")},s&&Object(o.createElement)("div",{className:"editor-styles-wrapper"},Object(o.createElement)("div",{className:"template-selector-preview__empty-state"},Object(a.__)("Select a layout to preview.","full-site-editing"))),Object(o.createElement)(F,{blocks:n,viewportWidth:r,title:i}))};window._tkq=window._tkq||[];var V=null,Q=function(e,t){V&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_dismiss",{blog_id:V.blogid,segment_id:e,vertical_id:t}])},H=function(e,t,n){V&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_template_selected",{blog_id:V.blogid,segment_id:e,vertical_id:t,template:n}])},K=n(21),Y=n.n(K),J=n(22),X=n.n(J),Z=n(25),$=n.n(Z),ee=n(26),te=function(e,t,n){var r=e[t=Object(ee.removeQueryArgs)(t,"w","s")]||{url:t,usages:[]};return p()({},e,k()({},t,p()({},r,{usages:[].concat(X()(r.usages),X()(n))})))},ne=function e(t,n){switch(t.blocksByClientId[n.clientId]=n,n.name){case"core/cover":case"core/image":var r=n.attributes.url;r&&(t.assets=te(t.assets,r,[{prop:"url",path:[n.clientId,"attributes","url"]},{prop:"id",path:[n.clientId,"attributes","id"]}]));case"core/media-text":var i=n.attributes.mediaUrl;i&&"image"===n.attributes.mediaType&&(t.assets=te(t.assets,i,[{prop:"url",path:[n.clientId,"attributes","mediaUrl"]},{prop:"id",path:[n.clientId,"attributes","mediaId"]}]));case"core/gallery":Object(P.forEach)(n.attributes.images,(function(e,r){t.assets=te(t.assets,e.url,[{prop:"url",path:[n.clientId,"attributes","images",r,"url"]},{prop:"url",path:[n.clientId,"attributes","images",r,"link"]},{prop:"id",path:[n.clientId,"attributes","images",r,"id"]},{prop:"id",path:[n.clientId,"attributes","ids",r]}])}))}return Object(P.isEmpty)(n.innerBlocks)?t:Object(P.reduce)(n.innerBlocks,e,t)},re=function(){var e=Y()(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$()({method:"POST",path:"/fse/v1/sideload/image/batch",data:{resources:Object(P.map)(t)}}).then((function(e){return Object(P.reduce)(t,(function(t,n){var r=e.shift(),i=r.id,o=r.source_url;return p()({},t,k()({},n.url,{id:i,url:o}))}),{})}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ie=function(e,t){return Object(P.forEach)(e.assets,(function(n){var r=t[n.url];r&&Object(P.forEach)(n.usages,(function(t){Object(P.set)(e.blocksByClientId,t.path,r[t.prop])}))})),e.blocks},oe=function(){var e=Y()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Object(P.reduce)(t,ne,{assets:{},blocksByClientId:{},blocks:t}),!Object(P.isEmpty)(n.assets)){e.next=3;break}return e.abrupt("return",t);case 3:return e.abrupt("return",re(n.assets).then((function(e){return ie(n,e)})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var ae=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P.identity;return t.map((function(t){return(t=n(Object(C.cloneBlock)(t))).innerBlocks&&t.innerBlocks.length&&(t.innerBlocks=e(t.innerBlocks,n)),t}))},se="core/missing";var le=function e(t){return!!t.find((function(t){return t.name===se||!(!t.innerBlocks||!t.innerBlocks.length)&&e(t.innerBlocks)}))},ce=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=v()(this,(e=h()(t)).call.apply(e,[this].concat(i))),k()(y()(n),"state",{isLoading:!1,previewedTemplate:null,error:null,isOpen:!1}),k()(y()(n),"getTitlesByTemplateSlugs",Object(P.memoize)((function(e){return Object(P.mapValues)(Object(P.keyBy)(e,"slug"),"title")}))),k()(y()(n),"getBlocksByTemplateSlugs",Object(P.memoize)((function(e){var t=Object(P.reduce)(e,(function(e,t){var r=t.slug,i=t.content;return e[r]=i?Object(C.parse)(R(i,n.props.siteInformation)):[],e}),{});return n.filterTemplatesWithMissingBlocks(t)}))),k()(y()(n),"getBlocksForPreview",Object(P.memoize)((function(e){var t=n.getBlocksByTemplateSlug(e);return ae(t,(function(e){return"jetpack/contact-form"===e.name&&void 0!==e.attributes.hasFormSettingsSet&&(e.attributes.hasFormSettingsSet=!0),e}))}))),k()(y()(n),"getBlocksForSelection",(function(e){var t=n.getBlocksByTemplateSlug(e);return ae(t,(function(e){return"core/button"===e.name&&void 0!==e.attributes.url&&(e.attributes.url="#"),e}))})),k()(y()(n),"setTemplate",(function(e){if(H(n.props.segment.id,n.props.vertical.id,e),n.props.saveTemplateChoice(e),"blank"===e)return n.props.insertTemplate("",[]),void n.setState({isOpen:!1});var t=Object(P.find)(n.props.templates,{slug:e,category:"home"}),r=n.getBlocksForSelection(e),i=t?null:n.getTitleByTemplateSlug(e);r&&r.length?(n.setState({error:null,isLoading:!0}),n.maybePrefetchAssets(r).then((function(e){n.state.isOpen&&(n.props.insertTemplate(i,e),n.setState({isOpen:!1}))})).catch((function(e){n.setState({isLoading:!1,error:e})}))):n.setState({isOpen:!1})})),k()(y()(n),"maybePrefetchAssets",(function(e){return n.props.shouldPrefetchAssets?oe(e):Promise.resolve(e)})),k()(y()(n),"handleConfirmation",(function(e){"string"!=typeof e&&(e=n.state.previewedTemplate),n.setTemplate(e),n.props.isPromptedFromSidebar&&n.props.toggleTemplateModal()})),k()(y()(n),"previewTemplate",(function(e){n.setState({previewedTemplate:e}),window.matchMedia("(min-width: 660px)").matches||n.handleConfirmation(e)})),k()(y()(n),"closeModal",(function(e){if(e.target.matches("button.template-selector-item__label"))return!1;Q(n.props.segment.id,n.props.vertical.id);var t=Object(P.get)(window,["calypsoifyGutenberg","closeUrl"]);window.top.location=t||"edit.php?post_type=page"})),k()(y()(n),"getTemplateGroups",(function(){return{blankTemplate:Object(P.filter)(n.props.templates,{slug:"blank"}),aboutTemplates:Object(P.filter)(n.props.templates,{category:"about"}),blogTemplates:Object(P.filter)(n.props.templates,{category:"blog"}),contactTemplates:Object(P.filter)(n.props.templates,{category:"contact"}),eventTemplates:Object(P.filter)(n.props.templates,{category:"event"}),menuTemplates:Object(P.filter)(n.props.templates,{category:"menu"}),portfolioTemplates:Object(P.filter)(n.props.templates,{category:"portfolio"}),productTemplates:Object(P.filter)(n.props.templates,{category:"product"}),servicesTemplates:Object(P.filter)(n.props.templates,{category:"services"}),teamTemplates:Object(P.filter)(n.props.templates,{category:"team"}),homepageTemplates:Object(P.sortBy)(Object(P.filter)(n.props.templates,{category:"home"}),"title")}})),k()(y()(n),"renderTemplatesList",(function(e,t){if(!e.length)return null;var r,i=n.getBlocksByTemplateSlugs(n.props.templates),s=Object.keys(i),l=(r=s,e.filter((function(e){return r.includes(e.slug)})));return l.length?Object(o.createElement)("fieldset",{className:"page-template-modal__list"},Object(o.createElement)("legend",{className:"page-template-modal__form-title"},t),Object(o.createElement)(q,{label:Object(a.__)("Layout","full-site-editing"),templates:l,blocksByTemplates:i,onTemplateSelect:n.previewTemplate,useDynamicPreview:!1,siteInformation:n.props.siteInformation,selectedTemplate:n.state.previewedTemplate})):null})),n}return w()(t,e),b()(t,[{key:"filterTemplatesWithMissingBlocks",value:function(e){return Object(P.reduce)(e,(function(e,t,n){return le(t)&&t.length||(e[n]=t),e}),{})}},{key:"componentDidMount",value:function(){this.state.isOpen&&this.trackCurrentView()}},{key:"componentDidUpdate",value:function(e,t){!t.isOpen&&this.state.isOpen&&this.trackCurrentView(),(this.props.isWelcomeGuideActive||this.props.areTipsEnabled)&&this.props.hideWelcomeGuide()}},{key:"trackCurrentView",value:function(){var e,t,n;e=this.props.segment.id,t=this.props.vertical.id,n=this.props.isPromptedFromSidebar?"sidebar":"add-page",V&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_view",{blog_id:V.blogid,segment_id:e,vertical_id:t,source:n}])}},{key:"getBlocksByTemplateSlug",value:function(e){return Object(P.get)(this.getBlocksByTemplateSlugs(this.props.templates),[e],[])}},{key:"getTitleByTemplateSlug",value:function(e){return Object(P.get)(this.getTitlesByTemplateSlugs(this.props.templates),[e],"")}},{key:"render",value:function(){var e=this.state,t=e.previewedTemplate,n=e.isOpen,r=e.isLoading,i=this.props,s=i.isPromptedFromSidebar,l=i.hidePageTitle;if(!n)return null;var c=this.getTemplateGroups(),u=c.blankTemplate,p=c.aboutTemplates,m=c.blogTemplates,d=c.contactTemplates,f=c.eventTemplates,b=c.menuTemplates,g=c.portfolioTemplates,v=c.productTemplates,O=c.servicesTemplates,h=c.teamTemplates,j=c.homepageTemplates;return Object(o.createElement)(B.Modal,{title:Object(a.__)("Select Page Layout","full-site-editing"),className:"page-template-modal",overlayClassName:"page-template-modal-screen-overlay",shouldCloseOnClickOutside:!1,isDismissable:!1,isDismissible:!1},s?Object(o.createElement)(B.IconButton,{className:"page-template-modal__close-button components-icon-button",onClick:this.props.toggleTemplateModal,icon:"no-alt",label:Object(a.__)("Close Layout Selector")}):Object(o.createElement)(B.IconButton,{className:"page-template-modal__close-button components-icon-button",onClick:this.closeModal,icon:"arrow-left-alt2",label:Object(a.__)("Go back")}),Object(o.createElement)("div",{className:"page-template-modal__inner"},r?Object(o.createElement)("div",{className:"page-template-modal__loading"},Object(o.createElement)(B.Spinner,null),Object(a.__)("Adding layout…","full-site-editing")):Object(o.createElement)(o.Fragment,null,Object(o.createElement)("form",{className:"page-template-modal__form"},this.props.isFrontPage&&this.renderTemplatesList(j,Object(a.__)("Home Pages","full-site-editing")),this.renderTemplatesList(u,Object(a.__)("Blank","full-site-editing")),this.renderTemplatesList(p,Object(a.__)("About Pages","full-site-editing")),this.renderTemplatesList(m,Object(a.__)("Blog Pages","full-site-editing")),this.renderTemplatesList(d,Object(a.__)("Contact Pages","full-site-editing")),this.renderTemplatesList(f,Object(a.__)("Event Pages","full-site-editing")),this.renderTemplatesList(b,Object(a.__)("Menu Pages","full-site-editing")),this.renderTemplatesList(g,Object(a.__)("Portfolio Pages","full-site-editing")),this.renderTemplatesList(v,Object(a.__)("Product Pages","full-site-editing")),this.renderTemplatesList(O,Object(a.__)("Services Pages","full-site-editing")),this.renderTemplatesList(h,Object(a.__)("Team Pages","full-site-editing")),!this.props.isFrontPage&&this.renderTemplatesList(j,Object(a.__)("Home Pages","full-site-editing"))),Object(o.createElement)(z,{blocks:this.getBlocksForPreview(t),viewportWidth:1200,title:!l&&this.getTitleByTemplateSlug(t)}))),Object(o.createElement)("div",{className:S()("page-template-modal__buttons",{"is-visually-hidden":Object(P.isEmpty)(t)||r})},Object(o.createElement)(B.Button,{isPrimary:!0,isLarge:!0,disabled:Object(P.isEmpty)(t)||r,onClick:this.handleConfirmation},Object(a.sprintf)(Object(a.__)("Use %s layout","full-site-editing"),this.getTitleByTemplateSlug(t)))))}}],[{key:"getDerivedStateFromProps",value:function(e,n){return n.previewedTemplate||Object(P.isEmpty)(e.templates)?null:{isOpen:!0,previewedTemplate:t.getDefaultSelectedTemplate(e)}}}]),t}(o.Component);k()(ce,"getDefaultSelectedTemplate",(function(e){var t=Object(P.get)(e.templates,[0,"slug"]),n=e._starter_page_template;if(!e.isFrontPage&&!n)return t;"home"===n&&(n=e.theme);var r=n||e.theme;return Object(P.find)(e.templates,{slug:r})?r:Object(P.find)(e.templates,{slug:"maywood"})?"maywood":t}));var ue,pe=Object(x.compose)(Object(l.withSelect)((function(e){var t=function(){return e("core/editor").getEditedPostAttribute("meta")},n=t();return{getMeta:t,_starter_page_template:n._starter_page_template,postContentBlock:e("core/editor").getBlocks().find((function(e){return"a8c/post-content"===e.name})),isWelcomeGuideActive:e("core/edit-post").isFeatureActive("welcomeGuide"),areTipsEnabled:!!e("core/nux")&&e("core/nux").areTipsEnabled()}})),Object(l.withDispatch)((function(e,t){var n=e("core/editor");return{saveTemplateChoice:function(e){var r=t.getMeta();n.editPost({meta:p()({},r,{_starter_page_template:e})})},insertTemplate:function(r,i){Object(N.addFilter)("isInsertingPageTemplate","automattic/full-site-editing/inserting-template",P.stubTrue),r&&n.editPost({title:r});var o=t.postContentBlock;e("core/block-editor").replaceInnerBlocks(o?o.clientId:"",i,!1),Object(N.removeFilter)("isInsertingPageTemplate","automattic/full-site-editing/inserting-template")},hideWelcomeGuide:function(){t.isWelcomeGuideActive?e("core/edit-post").toggleFeature("welcomeGuide"):t.areTipsEnabled&&e("core/nux").disableTips()}}})))(ce),me=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=v()(this,(e=h()(t)).call.apply(e,[this].concat(i))),k()(y()(n),"state",{isTemplateModalOpen:!1,isWarningOpen:!1}),k()(y()(n),"toggleTemplateModal",(function(){n.setState({isTemplateModalOpen:!n.state.isTemplateModalOpen})})),k()(y()(n),"toggleWarningModal",(function(){n.setState({isWarningOpen:!n.state.isWarningOpen})})),k()(y()(n),"getLastTemplateUsed",(function(){var e=n.props,t=e.isFrontPage,r=e.templates,i=e.theme,o=n.props.lastTemplateUsedSlug;if(!o&&t&&(o=i),!o||"blank"===o)return r[0];var a=r.find((function(e){return e.slug===o}));return a||r[0]})),n}return w()(t,e),b()(t,[{key:"render",value:function(){var e=this.getLastTemplateUsed(),t=e.slug,n=e.title,r=e.preview,i=e.previewAlt,s=this.props,l=s.templates,c=s.theme,u=s.vertical,p=s.segment,m=s.siteInformation,d=s.hidePageTitle,f=s.isFrontPage;return Object(o.createElement)("div",{className:"sidebar-modal-opener"},Object(o.createElement)(W,{id:"sidebar-modal-opener__last-template-used-preview",value:t,label:R(n,m),staticPreviewImg:r,staticPreviewImgAlt:i,onSelect:this.toggleWarningModal}),Object(o.createElement)(B.Button,{isPrimary:!0,onClick:this.toggleWarningModal,className:"sidebar-modal-opener__button"},Object(a.__)("Change Layout")),this.state.isTemplateModalOpen&&Object(o.createElement)(pe,{shouldPrefetchAssets:!1,templates:l,theme:c,vertical:u,segment:p,toggleTemplateModal:this.toggleTemplateModal,hidePageTitle:d,isFrontPage:f,isPromptedFromSidebar:!0}),this.state.isWarningOpen&&Object(o.createElement)(B.Modal,{title:Object(a.__)("Overwrite Page Content?"),isDismissible:!1,onRequestClose:this.toggleWarningModal,className:"sidebar-modal-opener__warning-modal"},Object(o.createElement)("div",{className:"sidebar-modal-opener__warning-text"},Object(a.__)("Changing the page's layout will remove any customizations or edits you have already made.")),Object(o.createElement)("div",{className:"sidebar-modal-opener__warning-options"},Object(o.createElement)(B.Button,{isDefault:!0,onClick:this.toggleWarningModal},Object(a.__)("Cancel")),Object(o.createElement)(B.Button,{isPrimary:!0,onClick:this.toggleTemplateModal},Object(a.__)("Change Layout")))))}}]),t}(o.Component),de=Object(x.compose)(Object(l.withSelect)((function(e){return{lastTemplateUsedSlug:e("core/editor").getEditedPostAttribute("meta")._starter_page_template}})))(me),fe=window.starterPageTemplatesConfig,be=fe.templates,ge=void 0===be?[]:be,ve=fe.vertical,Oe=fe.segment,he=fe.tracksUserData,je=fe.siteInformation,ye=void 0===je?{}:je,_e=fe.screenAction,we=fe.theme,Te=fe.isFrontPage,ke=fe.hideFrontPageTitle;he&&(V=ue=he,window._tkq.push(["identifyUser",ue.userid,ue.username]));var Pe={segment:Oe,templates:ge,theme:we,vertical:ve,isFrontPage:Te,hidePageTitle:Boolean(Te&&ke)};"add"===_e&&Object(s.registerPlugin)("page-templates",{render:function(){return Object(o.createElement)(pe,i()({},Pe,{shouldPrefetchAssets:!1}))}}),Object(s.registerPlugin)("page-templates-sidebar",{render:function(){return Object(o.createElement)(c.PluginDocumentSettingPanel,{name:"Template Modal Opener",title:Object(a.__)("Page Layout"),className:"page-template-modal__sidebar",icon:"none"},Object(o.createElement)(de,i()({},Pe,{siteInformation:ye})))}});var Ee=Object(l.subscribe)((function(){Object(l.select)("core/edit-post").isEditorPanelOpened("page-templates-sidebar/Template Modal Opener")||Object(l.dispatch)("core/edit-post").toggleEditorPanelOpened("page-templates-sidebar/Template Modal Opener"),Ee()}))}]));
3
Copyright (c) 2017 Jed Watson.
4
Licensed under the MIT License (MIT), see
5
http://jedwatson.github.io/classnames
6
+ */!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)&&r.length){var a=i.apply(null,r);a&&e.push(a)}else if("object"===o)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(3);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(27),i=n(4);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var r=n(28);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t){!function(){e.exports=this.wp.blocks}()},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 r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t,n){var r=n(31),i=n(32),o=n(33);e.exports=function(e,t){return r(e)||i(e,t)||o()}},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t){function n(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,l,"next",e)}function l(e){n(a,i,o,s,l,"throw",e)}s(void 0)}))}}},function(e,t,n){var r=n(34),i=n(35),o=n(36);e.exports=function(e){return r(e)||i(e)||o()}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t){!function(){e.exports=this.wp.editor}()},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.url}()},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){!function(){e.exports=this.wp.nux}()},function(e,t,n){},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t,n){"use strict";n.r(t);var r=n(16),i=n.n(r),o=n(0),a=n(2),s=n(17),l=n(6),c=n(23),u=n(9),p=n.n(u),m=n(10),d=n.n(m),f=n(11),b=n.n(f),g=n(12),v=n.n(g),O=n(13),h=n.n(O),j=n(4),y=n.n(j),_=n(14),w=n.n(_),T=n(3),k=n.n(T),P=n(1),E=n(8),S=n.n(E),x=(n(29),n(7)),B=n(5),C=n(15),N=n(18),I=(n(30),n(19)),A=n.n(I),M=n(20),L=n(24),D=function(e){var t=e.blocks,n=e.settings,r=e.hidePageTitle,i=e.recomputeBlockListKey;return Object(o.createElement)(M.BlockEditorProvider,{value:t,settings:n},Object(o.createElement)(B.Disabled,{key:i},!r&&Object(o.createElement)("div",{className:"block-iframe-preview__template-title"},Object(o.createElement)(L.PostTitle,null)),Object(o.createElement)(M.BlockList,null)))},F=Object(x.compose)(x.withSafeTimeout,Object(l.withSelect)((function(e){var t=e("core/block-editor");return{settings:t?t.getSettings():{}}})))((function(e){var t=e.className,n=void 0===t?"block-iframe-preview":t,r=e.bodyClassName,i=void 0===r?"block-iframe-preview-body":r,s=e.viewportWidth,l=e.blocks,c=e.settings,u=e.setTimeout,p=void 0===u?P.noop:u,m=e.title,d=Object(o.useRef)(),f=Object(o.useRef)(),b=Object(o.useRef)(),g=Object(o.useState)({transform:"scale( 1 )"}),v=A()(g,2),O=v[0],h=v[1],j=Object(o.useMemo)((function(){return Object(P.castArray)(l)}),[l]),y=Object(o.useReducer)((function(e){return e+1}),0),_=A()(y,2),w=_[0],T=_[1];Object(o.useLayoutEffect)(T,[l]);var k=Object(o.useCallback)((function(){var e=Object(P.get)(d,["current","parentNode"]);if(e){var t=s||d.current.offsetWidth,n=e.offsetWidth/s,r=e.offsetHeight/n;h({width:t,height:r,transform:"scale( ".concat(n," )")})}}),[s]);return Object(o.useEffect)((function(){if(m){var e=Object(P.get)(b,["current","contentDocument","body"]);if(e){var t=e.querySelector(".editor-post-title .editor-post-title__input");t&&(t.value=m)}}}),[w]),Object(o.useEffect)((function(){p((function(){var e,t,n,r;e=window.document,t=b.current.contentDocument,n=["link","style"],r={head:new DocumentFragment,body:new DocumentFragment},Object(P.each)(Object.keys(r),(function(t){return Object(P.each)(Object(P.filter)(e[t].children,(function(e){var t=e.localName;return(n.includes(t))})),(function(e){r[t].appendChild(e.cloneNode(!0))}))})),t.head.appendChild(r.head),t.body.appendChild(r.body),b.current.contentDocument.body.classList.add(i,"editor-styles-wrapper","block-editor__container"),k()}),0)}),[p,i,k]),Object(o.useEffect)((function(){var e=Object(P.get)(b,["current","contentDocument","body"]);e&&(e.scrollTop=0)}),[w]),Object(o.useEffect)((function(){var e=f&&f.current;e&&b.current.contentDocument.body.appendChild(e)}),[w]),Object(o.useEffect)((function(){var e=Object(P.debounce)(k,300);return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[k]),Object(o.useEffect)((function(){return window.jQuery&&window.jQuery(window.document).on("wp-collapse-menu",k),function(){window.jQuery&&window.jQuery(window.document).off("wp-collapse-menu",k)}}),[k]),Object(o.createElement)("div",{ref:d},Object(o.createElement)("iframe",{ref:b,title:Object(a.__)("Preview"),className:S()("editor-styles-wrapper",n),style:O}),Object(o.createElement)("div",{ref:f,className:"block-editor"},Object(o.createElement)("div",{className:"edit-post-visual-editor"},Object(o.createElement)("div",{className:"editor-styles-wrapper"},Object(o.createElement)("div",{className:"editor-writing-flow"},Object(o.createElement)(D,{blocks:j,settings:c,hidePageTitle:!m,recomputeBlockListKey:w}))))))})),W=function(e){var t=e.id,n=e.value,r=e.onSelect,i=e.label,a=e.useDynamicPreview,s=void 0!==a&&a,l=e.staticPreviewImg,c=e.staticPreviewImgAlt,u=void 0===c?"":c,p=e.blocks,m=void 0===p?[]:p,d=e.isSelected;if(Object(P.isNil)(t)||Object(P.isNil)(i)||Object(P.isNil)(n))return null;if(s&&(Object(P.isNil)(m)||Object(P.isEmpty)(m)))return null;var f=s?Object(o.createElement)(B.Disabled,null,Object(o.createElement)(F,{blocks:m,viewportWidth:960})):Object(o.createElement)("img",{className:"template-selector-item__media",src:l,alt:u}),b="label-".concat(t,"-").concat(n);return Object(o.createElement)("button",{type:"button",className:S()("template-selector-item__label",{"is-selected":d}),value:n,onClick:function(){r(n)},"aria-labelledby":"".concat(t," ").concat(b)},Object(o.createElement)("span",{className:"template-selector-item__preview-wrap"},f))},G={Address:Object(a._x)("123 Main St","default address","full-site-editing"),Phone:Object(a._x)("555-555-5555","default phone number","full-site-editing"),CompanyName:Object(a._x)("Your Company Name","default company name","full-site-editing"),Vertical:Object(a._x)("Business","default vertical name","full-site-editing")},U={CompanyName:"title",Address:"address",Phone:"phone",Vertical:"vertical"},R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e.replace(/{{(\w+)}}/g,(function(e,n){var r=G[n];return t[U[n]]||r||n})):""},q=Object(x.compose)(o.memo,x.withInstanceId)((function(e){var t=e.label,n=e.className,r=e.help,i=e.instanceId,a=e.templates,s=void 0===a?[]:a,l=e.blocksByTemplates,c=void 0===l?{}:l,u=e.useDynamicPreview,p=void 0!==u&&u,m=e.onTemplateSelect,d=void 0===m?P.noop:m,f=e.siteInformation,b=void 0===f?{}:f,g=e.selectedTemplate;if(Object(P.isEmpty)(s)||!Object(P.isArray)(s))return null;if(!0===p&&Object(P.isEmpty)(c))return null;var v="template-selector-control-".concat(i);return Object(o.createElement)(B.BaseControl,{label:t,id:v,help:r,className:S()(n,"template-selector-control")},Object(o.createElement)("ul",{className:"template-selector-control__options","data-testid":"template-selector-control-options"},Object(P.map)(s,(function(e){var t=e.slug,n=e.title,i=e.preview,a=e.previewAlt;return Object(o.createElement)("li",{key:"".concat(v,"-").concat(t),className:"template-selector-control__template"},Object(o.createElement)(W,{id:v,value:t,label:R(n,b),help:r,onSelect:d,staticPreviewImg:i,staticPreviewImgAlt:a,blocks:c.hasOwnProperty(t)?c[t]:[],useDynamicPreview:p,isSelected:t===g}))}))))})),z=function(e){var t=e.blocks,n=void 0===t?[]:t,r=e.viewportWidth,i=e.title,s=!n.length;return Object(o.createElement)("div",{className:"template-selector-preview ".concat(s?"not-selected":"")},s&&Object(o.createElement)("div",{className:"editor-styles-wrapper"},Object(o.createElement)("div",{className:"template-selector-preview__empty-state"},Object(a.__)("Select a layout to preview.","full-site-editing"))),Object(o.createElement)(F,{blocks:n,viewportWidth:r,title:i}))};window._tkq=window._tkq||[];var V=null,Q=function(e,t){V&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_dismiss",{blog_id:V.blogid,segment_id:e,vertical_id:t}])},H=function(e,t,n){V&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_template_selected",{blog_id:V.blogid,segment_id:e,vertical_id:t,template:n}])},K=n(21),Y=n.n(K),J=n(22),X=n.n(J),Z=n(25),$=n.n(Z),ee=n(26),te=function(e,t,n){var r=e[t=Object(ee.removeQueryArgs)(t,"w","s")]||{url:t,usages:[]};return p()({},e,k()({},t,p()({},r,{usages:[].concat(X()(r.usages),X()(n))})))},ne=function e(t,n){switch(t.blocksByClientId[n.clientId]=n,n.name){case"core/cover":case"core/image":var r=n.attributes.url;r&&(t.assets=te(t.assets,r,[{prop:"url",path:[n.clientId,"attributes","url"]},{prop:"id",path:[n.clientId,"attributes","id"]}]));case"core/media-text":var i=n.attributes.mediaUrl;i&&"image"===n.attributes.mediaType&&(t.assets=te(t.assets,i,[{prop:"url",path:[n.clientId,"attributes","mediaUrl"]},{prop:"id",path:[n.clientId,"attributes","mediaId"]}]));case"core/gallery":Object(P.forEach)(n.attributes.images,(function(e,r){t.assets=te(t.assets,e.url,[{prop:"url",path:[n.clientId,"attributes","images",r,"url"]},{prop:"url",path:[n.clientId,"attributes","images",r,"link"]},{prop:"id",path:[n.clientId,"attributes","images",r,"id"]},{prop:"id",path:[n.clientId,"attributes","ids",r]}])}))}return Object(P.isEmpty)(n.innerBlocks)?t:Object(P.reduce)(n.innerBlocks,e,t)},re=function(){var e=Y()(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$()({method:"POST",path:"/fse/v1/sideload/image/batch",data:{resources:Object(P.map)(t)}}).then((function(e){return Object(P.reduce)(t,(function(t,n){var r=e.shift(),i=r.id,o=r.source_url;return p()({},t,k()({},n.url,{id:i,url:o}))}),{})}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ie=function(e,t){return Object(P.forEach)(e.assets,(function(n){var r=t[n.url];r&&Object(P.forEach)(n.usages,(function(t){Object(P.set)(e.blocksByClientId,t.path,r[t.prop])}))})),e.blocks},oe=function(){var e=Y()(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Object(P.reduce)(t,ne,{assets:{},blocksByClientId:{},blocks:t}),!Object(P.isEmpty)(n.assets)){e.next=3;break}return e.abrupt("return",t);case 3:return e.abrupt("return",re(n.assets).then((function(e){return ie(n,e)})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var ae=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P.identity;return t.map((function(t){return(t=n(Object(C.cloneBlock)(t))).innerBlocks&&t.innerBlocks.length&&(t.innerBlocks=e(t.innerBlocks,n)),t}))},se="core/missing";var le=function e(t){return!!t.find((function(t){return t.name===se||!(!t.innerBlocks||!t.innerBlocks.length)&&e(t.innerBlocks)}))},ce=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=v()(this,(e=h()(t)).call.apply(e,[this].concat(i))),k()(y()(n),"state",{isLoading:!1,previewedTemplate:null,error:null,isOpen:!1}),k()(y()(n),"getTitlesByTemplateSlugs",Object(P.memoize)((function(e){return Object(P.mapValues)(Object(P.keyBy)(e,"slug"),"title")}))),k()(y()(n),"getBlocksByTemplateSlugs",Object(P.memoize)((function(e){var t=Object(P.reduce)(e,(function(e,t){var r=t.slug,i=t.content;return e[r]=i?Object(C.parse)(R(i,n.props.siteInformation)):[],e}),{});return n.filterTemplatesWithMissingBlocks(t)}))),k()(y()(n),"getBlocksForPreview",Object(P.memoize)((function(e){var t=n.getBlocksByTemplateSlug(e);return ae(t,(function(e){return"jetpack/contact-form"===e.name&&void 0!==e.attributes.hasFormSettingsSet&&(e.attributes.hasFormSettingsSet=!0),e}))}))),k()(y()(n),"getBlocksForSelection",(function(e){var t=n.getBlocksByTemplateSlug(e);return ae(t,(function(e){return"core/button"===e.name&&void 0!==e.attributes.url&&(e.attributes.url="#"),e}))})),k()(y()(n),"setTemplate",(function(e){if(H(n.props.segment.id,n.props.vertical.id,e),n.props.saveTemplateChoice(e),"blank"===e)return n.props.insertTemplate("",[]),void n.setState({isOpen:!1});var t=Object(P.find)(n.props.templates,{slug:e,category:"home"}),r=n.getBlocksForSelection(e),i=t?null:n.getTitleByTemplateSlug(e);r&&r.length?(n.setState({error:null,isLoading:!0}),n.maybePrefetchAssets(r).then((function(e){n.state.isOpen&&(n.props.insertTemplate(i,e),n.setState({isOpen:!1}))})).catch((function(e){n.setState({isLoading:!1,error:e})}))):n.setState({isOpen:!1})})),k()(y()(n),"maybePrefetchAssets",(function(e){return n.props.shouldPrefetchAssets?oe(e):Promise.resolve(e)})),k()(y()(n),"handleConfirmation",(function(e){"string"!=typeof e&&(e=n.state.previewedTemplate),n.setTemplate(e),n.props.isPromptedFromSidebar&&n.props.toggleTemplateModal()})),k()(y()(n),"previewTemplate",(function(e){n.setState({previewedTemplate:e}),window.matchMedia("(min-width: 660px)").matches||n.handleConfirmation(e)})),k()(y()(n),"closeModal",(function(e){if(e.target.matches("button.template-selector-item__label"))return!1;Q(n.props.segment.id,n.props.vertical.id);var t=Object(P.get)(window,["calypsoifyGutenberg","closeUrl"]);window.top.location=t||"edit.php?post_type=page"})),k()(y()(n),"getTemplateGroups",(function(){return{blankTemplate:Object(P.filter)(n.props.templates,{slug:"blank"}),aboutTemplates:Object(P.filter)(n.props.templates,{category:"about"}),blogTemplates:Object(P.filter)(n.props.templates,{category:"blog"}),contactTemplates:Object(P.filter)(n.props.templates,{category:"contact"}),eventTemplates:Object(P.filter)(n.props.templates,{category:"event"}),menuTemplates:Object(P.filter)(n.props.templates,{category:"menu"}),portfolioTemplates:Object(P.filter)(n.props.templates,{category:"portfolio"}),productTemplates:Object(P.filter)(n.props.templates,{category:"product"}),servicesTemplates:Object(P.filter)(n.props.templates,{category:"services"}),teamTemplates:Object(P.filter)(n.props.templates,{category:"team"}),homepageTemplates:Object(P.sortBy)(Object(P.filter)(n.props.templates,{category:"home"}),"title")}})),k()(y()(n),"renderTemplatesList",(function(e,t){if(!e.length)return null;var r,i=n.getBlocksByTemplateSlugs(n.props.templates),s=Object.keys(i),l=(r=s,e.filter((function(e){return r.includes(e.slug)})));return l.length?Object(o.createElement)("fieldset",{className:"page-template-modal__list"},Object(o.createElement)("legend",{className:"page-template-modal__form-title"},t),Object(o.createElement)(q,{label:Object(a.__)("Layout","full-site-editing"),templates:l,blocksByTemplates:i,onTemplateSelect:n.previewTemplate,useDynamicPreview:!1,siteInformation:n.props.siteInformation,selectedTemplate:n.state.previewedTemplate})):null})),n}return w()(t,e),b()(t,[{key:"filterTemplatesWithMissingBlocks",value:function(e){return Object(P.reduce)(e,(function(e,t,n){return le(t)&&t.length||(e[n]=t),e}),{})}},{key:"componentDidMount",value:function(){this.state.isOpen&&this.trackCurrentView()}},{key:"componentDidUpdate",value:function(e,t){!t.isOpen&&this.state.isOpen&&this.trackCurrentView(),(this.props.isWelcomeGuideActive||this.props.areTipsEnabled)&&this.props.hideWelcomeGuide()}},{key:"trackCurrentView",value:function(){var e,t,n;e=this.props.segment.id,t=this.props.vertical.id,n=this.props.isPromptedFromSidebar?"sidebar":"add-page",V&&window._tkq.push(["recordEvent","a8c_full_site_editing_template_selector_view",{blog_id:V.blogid,segment_id:e,vertical_id:t,source:n}])}},{key:"getBlocksByTemplateSlug",value:function(e){return Object(P.get)(this.getBlocksByTemplateSlugs(this.props.templates),[e],[])}},{key:"getTitleByTemplateSlug",value:function(e){return Object(P.get)(this.getTitlesByTemplateSlugs(this.props.templates),[e],"")}},{key:"render",value:function(){var e=this.state,t=e.previewedTemplate,n=e.isOpen,r=e.isLoading,i=this.props,s=i.isPromptedFromSidebar,l=i.hidePageTitle;if(!n)return null;var c=this.getTemplateGroups(),u=c.blankTemplate,p=c.aboutTemplates,m=c.blogTemplates,d=c.contactTemplates,f=c.eventTemplates,b=c.menuTemplates,g=c.portfolioTemplates,v=c.productTemplates,O=c.servicesTemplates,h=c.teamTemplates,j=c.homepageTemplates;return Object(o.createElement)(B.Modal,{title:Object(a.__)("Select Page Layout","full-site-editing"),className:"page-template-modal",overlayClassName:"page-template-modal-screen-overlay",shouldCloseOnClickOutside:!1,isDismissable:!1,isDismissible:!1},s?Object(o.createElement)(B.IconButton,{className:"page-template-modal__close-button components-icon-button",onClick:this.props.toggleTemplateModal,icon:"no-alt",label:Object(a.__)("Close Layout Selector")}):Object(o.createElement)(B.IconButton,{className:"page-template-modal__close-button components-icon-button",onClick:this.closeModal,icon:"arrow-left-alt2",label:Object(a.__)("Go back")}),Object(o.createElement)("div",{className:"page-template-modal__inner"},r?Object(o.createElement)("div",{className:"page-template-modal__loading"},Object(o.createElement)(B.Spinner,null),Object(a.__)("Adding layout…","full-site-editing")):Object(o.createElement)(o.Fragment,null,Object(o.createElement)("form",{className:"page-template-modal__form"},this.props.isFrontPage&&this.renderTemplatesList(j,Object(a.__)("Home Pages","full-site-editing")),this.renderTemplatesList(u,Object(a.__)("Blank","full-site-editing")),this.renderTemplatesList(p,Object(a.__)("About Pages","full-site-editing")),this.renderTemplatesList(m,Object(a.__)("Blog Pages","full-site-editing")),this.renderTemplatesList(d,Object(a.__)("Contact Pages","full-site-editing")),this.renderTemplatesList(f,Object(a.__)("Event Pages","full-site-editing")),this.renderTemplatesList(b,Object(a.__)("Menu Pages","full-site-editing")),this.renderTemplatesList(g,Object(a.__)("Portfolio Pages","full-site-editing")),this.renderTemplatesList(v,Object(a.__)("Product Pages","full-site-editing")),this.renderTemplatesList(O,Object(a.__)("Services Pages","full-site-editing")),this.renderTemplatesList(h,Object(a.__)("Team Pages","full-site-editing")),!this.props.isFrontPage&&this.renderTemplatesList(j,Object(a.__)("Home Pages","full-site-editing"))),Object(o.createElement)(z,{blocks:this.getBlocksForPreview(t),viewportWidth:1200,title:!l&&this.getTitleByTemplateSlug(t)}))),Object(o.createElement)("div",{className:S()("page-template-modal__buttons",{"is-visually-hidden":Object(P.isEmpty)(t)||r})},Object(o.createElement)(B.Button,{isPrimary:!0,isLarge:!0,disabled:Object(P.isEmpty)(t)||r,onClick:this.handleConfirmation},Object(a.sprintf)(Object(a.__)("Use %s layout","full-site-editing"),this.getTitleByTemplateSlug(t)))))}}],[{key:"getDerivedStateFromProps",value:function(e,n){return n.previewedTemplate||Object(P.isEmpty)(e.templates)?null:{isOpen:!0,previewedTemplate:t.getDefaultSelectedTemplate(e)}}}]),t}(o.Component);k()(ce,"getDefaultSelectedTemplate",(function(e){var t=Object(P.get)(e.templates,[0,"slug"]),n=e._starter_page_template;if(!e.isFrontPage&&!n)return t;"home"===n&&(n=e.theme);var r=n||e.theme;return Object(P.find)(e.templates,{slug:r})?r:Object(P.find)(e.templates,{slug:"maywood"})?"maywood":t}));var ue,pe=Object(x.compose)(Object(l.withSelect)((function(e){var t=function(){return e("core/editor").getEditedPostAttribute("meta")},n=t();return{getMeta:t,_starter_page_template:n._starter_page_template,postContentBlock:e("core/editor").getBlocks().find((function(e){return"a8c/post-content"===e.name})),isWelcomeGuideActive:e("core/edit-post").isFeatureActive("welcomeGuide"),areTipsEnabled:!!e("core/nux")&&e("core/nux").areTipsEnabled()}})),Object(l.withDispatch)((function(e,t){var n=e("core/editor");return{saveTemplateChoice:function(e){var r=t.getMeta();n.editPost({meta:p()({},r,{_starter_page_template:e})})},insertTemplate:function(r,i){Object(N.addFilter)("isInsertingPageTemplate","automattic/full-site-editing/inserting-template",P.stubTrue),r&&n.editPost({title:r});var o=t.postContentBlock;e("core/block-editor").replaceInnerBlocks(o?o.clientId:"",i,!1),Object(N.removeFilter)("isInsertingPageTemplate","automattic/full-site-editing/inserting-template")},hideWelcomeGuide:function(){t.isWelcomeGuideActive?e("core/edit-post").toggleFeature("welcomeGuide"):t.areTipsEnabled&&e("core/nux").disableTips()}}})))(ce),me=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=v()(this,(e=h()(t)).call.apply(e,[this].concat(i))),k()(y()(n),"state",{isTemplateModalOpen:!1,isWarningOpen:!1}),k()(y()(n),"toggleTemplateModal",(function(){n.setState({isTemplateModalOpen:!n.state.isTemplateModalOpen})})),k()(y()(n),"toggleWarningModal",(function(){n.setState({isWarningOpen:!n.state.isWarningOpen})})),k()(y()(n),"getLastTemplateUsed",(function(){var e=n.props,t=e.isFrontPage,r=e.templates,i=e.theme,o=n.props.lastTemplateUsedSlug;if(!o&&t&&(o=i),!o||"blank"===o)return r[0];var a=r.find((function(e){return e.slug===o}));return a||r[0]})),n}return w()(t,e),b()(t,[{key:"render",value:function(){var e=this.getLastTemplateUsed(),t=e.slug,n=e.title,r=e.preview,i=e.previewAlt,s=this.props,l=s.templates,c=s.theme,u=s.vertical,p=s.segment,m=s.siteInformation,d=s.hidePageTitle,f=s.isFrontPage;return Object(o.createElement)("div",{className:"sidebar-modal-opener"},Object(o.createElement)(W,{id:"sidebar-modal-opener__last-template-used-preview",value:t,label:R(n,m),staticPreviewImg:r,staticPreviewImgAlt:i,onSelect:this.toggleWarningModal}),Object(o.createElement)(B.Button,{isPrimary:!0,onClick:this.toggleWarningModal,className:"sidebar-modal-opener__button"},Object(a.__)("Change Layout")),this.state.isTemplateModalOpen&&Object(o.createElement)(pe,{shouldPrefetchAssets:!1,templates:l,theme:c,vertical:u,segment:p,toggleTemplateModal:this.toggleTemplateModal,hidePageTitle:d,isFrontPage:f,isPromptedFromSidebar:!0}),this.state.isWarningOpen&&Object(o.createElement)(B.Modal,{title:Object(a.__)("Overwrite Page Content?"),isDismissible:!1,onRequestClose:this.toggleWarningModal,className:"sidebar-modal-opener__warning-modal"},Object(o.createElement)("div",{className:"sidebar-modal-opener__warning-text"},Object(a.__)("Changing the page's layout will remove any customizations or edits you have already made.")),Object(o.createElement)("div",{className:"sidebar-modal-opener__warning-options"},Object(o.createElement)(B.Button,{isDefault:!0,onClick:this.toggleWarningModal},Object(a.__)("Cancel")),Object(o.createElement)(B.Button,{isPrimary:!0,onClick:this.toggleTemplateModal},Object(a.__)("Change Layout")))))}}]),t}(o.Component),de=Object(x.compose)(Object(l.withSelect)((function(e){return{lastTemplateUsedSlug:e("core/editor").getEditedPostAttribute("meta")._starter_page_template}})))(me),fe=window.starterPageTemplatesConfig,be=fe.templates,ge=void 0===be?[]:be,ve=fe.vertical,Oe=fe.segment,he=fe.tracksUserData,je=fe.siteInformation,ye=void 0===je?{}:je,_e=fe.screenAction,we=fe.theme,Te=fe.isFrontPage,ke=fe.hideFrontPageTitle;he&&(V=ue=he,window._tkq.push(["identifyUser",ue.userid,ue.username]));var Pe={segment:Oe,templates:ge,theme:we,vertical:ve,isFrontPage:Te,hidePageTitle:Boolean(Te&&ke)};"add"===_e&&Object(s.registerPlugin)("page-templates",{render:function(){return Object(o.createElement)(pe,i()({},Pe,{shouldPrefetchAssets:!1}))}}),Object(s.registerPlugin)("page-templates-sidebar",{render:function(){return Object(o.createElement)(c.PluginDocumentSettingPanel,{name:"Template Modal Opener",title:Object(a.__)("Page Layout"),className:"page-template-modal__sidebar",icon:"none"},Object(o.createElement)(de,i()({},Pe,{siteInformation:ye})))}});var Ee=Object(l.subscribe)((function(){Object(l.select)("core/edit-post").isEditorPanelOpened("page-templates-sidebar/Template Modal Opener")||Object(l.dispatch)("core/edit-post").toggleEditorPanelOpened("page-templates-sidebar/Template Modal Opener"),Ee()}))}]));
starter-page-templates/dist/starter-page-templates.rtl.css CHANGED
@@ -1 +1 @@
1
- .page-template-modal-screen-overlay{animation:none;background-color:transparent;z-index:99}@media screen and (min-width:783px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{right:36px}}@media screen and (min-width:961px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{right:160px}}@media screen and (min-width:783px){body:not(.is-fullscreen-mode).folded .page-template-modal-screen-overlay{right:36px}body:not(.is-fullscreen-mode):not(.folded):not(.auto-fold) .page-template-modal-screen-overlay{right:160px}}body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:46px}@media screen and (min-width:783px){body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:32px}}.page-template-modal{width:100%;height:100vh;animation:none;box-shadow:none;border:none;top:0;right:0;left:0;bottom:0;transform:none;max-width:none;max-height:none;background-color:#eee}.page-template-modal .components-modal__header-heading-container{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__close-button{display:block;position:absolute;z-index:20;top:9px;width:36px;height:36px;right:10px}.page-template-modal .components-modal__header:after{display:block;position:absolute;content:" ";border-left:1px solid #e2e4e7;height:100%;right:56px}.page-template-modal .components-modal__content{overflow-y:scroll;-webkit-overflow-scrolling:touch}.page-template-modal__inner{position:relative;margin:0 auto;padding:0 20px 40px}.page-template-modal__list{margin-bottom:20px}.page-template-modal__list .components-base-control__label{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.template-selector-control__options{display:grid;grid-template-columns:1fr;grid-gap:.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}}.template-selector-item__label{display:block;width:100%;font-size:14px;text-align:center;border:2px solid #e2e4e7;border-radius:6px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;overflow:hidden;background-color:#fff;position:relative;transform:translateZ(0)}.template-selector-item__label:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;outline:2px solid transparent}.template-selector-item__label:hover{border:2px solid #c9c9ca}.template-selector-item__label.is-selected{border:2px solid #555d66;outline:2px solid transparent;outline-offset:-2px}.template-selector-item__label.is-selected:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;border:2px solid #555d66;outline:4px solid transparent;outline-offset:-4px}.template-selector-item__preview-wrap{width:100%;display:block;margin:0 auto;background:#fff;border-radius:0;overflow:hidden;height:0;padding-top:120%;box-sizing:content-box;position:relative;pointer-events:none;opacity:1;transform:translateZ(0)}@media screen and (min-width:660px){.template-selector-item__preview-wrap{padding-top:100%}}.template-selector-item__preview-wrap.is-rendering{opacity:.5}.template-selector-item__media{width:100%;display:block;position:absolute;top:0;right:0}@media screen and (min-width:660px){.page-template-modal__form{max-width:20%}}@media screen and (min-width:783px){.page-template-modal__form{max-width:30%}}.page-template-modal__form-title{font-weight:700;margin-bottom:1em;text-align:center}@media screen and (min-width:660px){.page-template-modal__form-title{text-align:right}}.page-template-modal__buttons{position:absolute;left:0;top:0;z-index:10;height:56px;display:flex;align-items:center;padding-left:24px}@media screen and (min-width:660px){.page-template-modal__buttons{display:flex}}.page-template-modal__buttons.is-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__buttons .components-button{height:33px;line-height:32px}.template-selector-preview{display:none;position:fixed;top:157px;bottom:24px;right:calc(20% + 48px);left:24px;background:#fff;border-radius:2px;overflow:hidden;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}@media screen and (min-width:660px){.template-selector-preview{display:block}.template-selector-preview.is-blank-preview{align-items:center;display:flex;justify-content:center}}@media screen and (min-width:783px){.template-selector-preview{top:143px;right:calc(30% + 72px)}body:not(.auto-fold):not(.folded) .template-selector-preview{right:calc(30% + 172px)}}@media screen and (min-width:961px){.template-selector-preview{right:calc(30% + 172px)}body.folded .template-selector-preview{right:calc(30% + 72px)}}body.is-fullscreen-mode .template-selector-preview{top:111px}@media screen and (min-width:783px){body.is-fullscreen-mode .template-selector-preview{right:calc(30% + 48px)!important}}.template-selector-preview .edit-post-visual-editor{margin:0;padding:0}.template-selector-preview.not-selected .editor-styles-wrapper{position:relative;width:100%;height:100%}.template-selector-preview.not-selected .editor-styles-wrapper .template-selector-preview__empty-state{position:absolute;width:100%;text-align:center;height:50px;line-height:50px;top:50%;margin:-25px 0 0}.page-template-modal__loading{position:absolute;top:50%;right:50%;transform:translate(50%,-50%);display:flex;align-items:flex-end}.page-template-modal__loading .components-spinner{float:none}.sidebar-modal-opener{display:flex;flex-direction:column;align-items:center;justify-content:center}.sidebar-modal-opener .template-selector-item__label{max-width:300px}.sidebar-modal-opener__button{margin-top:20px}.sidebar-modal-opener__warning-modal{display:flex;flex-direction:column;justify-content:center;align-items:center}.sidebar-modal-opener__warning-text{max-width:300px;font-size:1rem;line-height:1.5rem}.sidebar-modal-opener__warning-options{float:left;margin-top:20px}.sidebar-modal-opener__warning-options .components-button{margin-right:12px}.block-iframe-preview{position:absolute;top:0;right:0;transform-origin:top right;text-align:initial;margin:0;overflow:visible;min-height:auto;width:1440px}.block-iframe-preview-body{margin:0;padding:0;overflow-x:hidden;overflow-y:auto}.block-iframe-preview-body>.block-editor,.block-iframe-preview-body>.block-editor>.edit-post-visual-editor{padding:0;margin:0}.block-iframe-preview-body .block-editor-inserter,.block-iframe-preview-body .block-list-appender{display:none!important;visibility:hidden;position:absolute;right:-9999vw}.block-iframe-preview-body .editor-styles-wrapper .wp-block-cover{height:auto}.block-iframe-preview-body .editor-styles-wrapper .wp-block-embed__wrapper iframe{height:auto;min-height:400px}.block-iframe-preview-body [data-type="core/paragraph"] [data-rich-text-placeholder]{display:none}.block-iframe-preview-body .swiper-wrapper{display:flex}.block-iframe-preview-body .swiper-button-next,.block-iframe-preview-body .swiper-button-prev{display:none}.block-iframe-preview-body .swiper-pagination{text-align:center}.block-iframe-preview-body .swiper-pagination-bullet{border-radius:100%}.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/cover"][data-align=full],.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/group"]{margin-top:0;margin-bottom:0}.block-iframe-preview-body .block-iframe-preview__template-title{padding-top:20px}
1
+ .page-template-modal-screen-overlay{animation:none;background-color:transparent;z-index:99}@media screen and (min-width:783px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{right:36px}}@media screen and (min-width:961px){body:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{right:160px}}@media screen and (min-width:783px){body:not(.is-fullscreen-mode).folded .page-template-modal-screen-overlay{right:36px}body:not(.is-fullscreen-mode):not(.folded):not(.auto-fold) .page-template-modal-screen-overlay{right:160px}}body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:46px}@media screen and (min-width:783px){body.admin-bar:not(.is-fullscreen-mode) .page-template-modal-screen-overlay{top:32px}}.page-template-modal{width:100%;height:100vh;animation:none;box-shadow:none;border:none;top:0;right:0;left:0;bottom:0;transform:none;max-width:none;max-height:none;background-color:#eee}.page-template-modal .components-modal__header-heading-container{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__close-button{display:block;position:absolute;z-index:20;top:9px;width:36px;height:36px;right:10px}.page-template-modal .components-modal__header:after{display:block;position:absolute;content:" ";border-left:1px solid #e2e4e7;height:100%;right:56px}.page-template-modal .components-modal__content{overflow-y:scroll;-webkit-overflow-scrolling:touch}.page-template-modal__inner{position:relative;margin:0 auto;padding:0 20px 40px}.page-template-modal__list{margin-bottom:20px}.page-template-modal__list .components-base-control__label{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.template-selector-control__options{display:grid;grid-template-columns:1fr;grid-gap:.75em}@media screen and (min-width:660px){.template-selector-control__options{margin-top:0;grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}}.template-selector-item__label{display:block;width:100%;font-size:14px;text-align:center;border:2px solid #e2e4e7;border-radius:6px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;overflow:hidden;background-color:#fff;position:relative;transform:translateZ(0)}.template-selector-item__label:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;outline:2px solid transparent}.template-selector-item__label:hover{border:2px solid #c9c9ca}.template-selector-item__label.is-selected{border:2px solid #555d66;outline:2px solid transparent;outline-offset:-2px}.template-selector-item__label.is-selected:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #00a0d2;border:2px solid #555d66;outline:4px solid transparent;outline-offset:-4px}.template-selector-item__preview-wrap{width:100%;display:block;margin:0 auto;background:#fff;border-radius:0;overflow:hidden;height:0;padding-top:120%;box-sizing:content-box;position:relative;pointer-events:none;opacity:1;transform:translateZ(0)}@media screen and (min-width:660px){.template-selector-item__preview-wrap{padding-top:100%}}.template-selector-item__preview-wrap.is-rendering{opacity:.5}.template-selector-item__media{width:100%;display:block;position:absolute;top:0;right:0}@media screen and (min-width:660px){.page-template-modal__form{max-width:20%}}@media screen and (min-width:783px){.page-template-modal__form{max-width:30%}}.page-template-modal__form-title{font-weight:700;margin-bottom:1em;text-align:center}@media screen and (min-width:660px){.page-template-modal__form-title{text-align:right}}.page-template-modal__buttons{position:absolute;left:0;top:0;z-index:10;height:56px;display:flex;align-items:center;padding-left:24px}@media screen and (min-width:660px){.page-template-modal__buttons{display:flex}}.page-template-modal__buttons.is-visually-hidden{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.page-template-modal__buttons .components-button{height:33px;line-height:32px}.template-selector-preview{display:none;position:fixed;top:157px;bottom:24px;right:calc(20% + 48px);left:24px;background:#fff;border-radius:2px;overflow:hidden;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}@media screen and (min-width:660px){.template-selector-preview{display:block}.template-selector-preview.is-blank-preview{align-items:center;display:flex;justify-content:center}}@media screen and (min-width:783px){.template-selector-preview{top:143px;right:calc(30% + 72px)}body:not(.auto-fold):not(.folded) .template-selector-preview{right:calc(30% + 172px)}}@media screen and (min-width:961px){.template-selector-preview{right:calc(30% + 172px)}body.folded .template-selector-preview{right:calc(30% + 72px)}}body.is-fullscreen-mode .template-selector-preview{top:111px}@media screen and (min-width:783px){body.is-fullscreen-mode .template-selector-preview{right:calc(30% + 48px)!important}}.template-selector-preview .edit-post-visual-editor{margin:0;padding:0}.template-selector-preview.not-selected .editor-styles-wrapper{position:relative;width:100%;height:100%}.template-selector-preview.not-selected .editor-styles-wrapper .template-selector-preview__empty-state{position:absolute;width:100%;text-align:center;height:50px;line-height:50px;top:50%;margin:-25px 0 0}.page-template-modal__loading{position:absolute;top:50%;right:50%;transform:translate(50%,-50%);display:flex;align-items:flex-end}.page-template-modal__loading .components-spinner{float:none}.sidebar-modal-opener{display:flex;flex-direction:column;align-items:center;justify-content:center}.sidebar-modal-opener .template-selector-item__label{max-width:300px}.sidebar-modal-opener__button{margin-top:20px}.sidebar-modal-opener__warning-modal{display:flex;flex-direction:column;justify-content:center;align-items:center}.sidebar-modal-opener__warning-text{max-width:300px;font-size:1rem;line-height:1.5rem}.sidebar-modal-opener__warning-options{float:left;margin-top:20px}.sidebar-modal-opener__warning-options .components-button{margin-right:12px}.block-iframe-preview{position:absolute;top:0;right:0;transform-origin:top right;text-align:initial;margin:0;overflow:visible;min-height:auto;width:1440px}.block-iframe-preview-body{margin:0;padding:0;overflow-x:hidden;overflow-y:auto}.block-iframe-preview-body>.block-editor,.block-iframe-preview-body>.block-editor>.edit-post-visual-editor{padding:0;margin:0}.block-iframe-preview-body .block-editor-inserter,.block-iframe-preview-body .block-list-appender{display:none!important;visibility:hidden;position:absolute;right:-9999vw}.block-iframe-preview-body .editor-styles-wrapper .wp-block-cover{height:auto}.block-iframe-preview-body .editor-styles-wrapper .wp-block-embed__wrapper iframe{height:auto;min-height:400px}.block-iframe-preview-body [data-type="core/paragraph"] [data-rich-text-placeholder]{display:none}.block-iframe-preview-body .swiper-wrapper{display:flex}.block-iframe-preview-body .swiper-button-next,.block-iframe-preview-body .swiper-button-prev{display:none}.block-iframe-preview-body .swiper-pagination{text-align:center}.block-iframe-preview-body .swiper-pagination-bullet{border-radius:100%}.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/cover"][data-align=full],.block-iframe-preview-body .editor-styles-wrapper [data-block][data-type="core/group"]{margin-top:0;margin-bottom:0}.block-iframe-preview-body .block-iframe-preview__template-title{padding-top:20px}.block-iframe-preview-body .wp-block-columns>.block-editor-inner-blocks>.block-editor-block-list__layout>[data-type="core/column"] .block-core-columns{flex-basis:auto}
starter-page-templates/page-template-modal/components/block-iframe-preview.js CHANGED
@@ -153,8 +153,11 @@ const BlockFramePreview = ( {
153
useEffect( () => {
154
setTimeout( () => {
155
copyStylesToIframe( window.document, iframeRef.current.contentDocument );
156
- iframeRef.current.contentDocument.body.classList.add( bodyClassName );
157
- iframeRef.current.contentDocument.body.classList.add( 'editor-styles-wrapper' );
158
rescale();
159
}, 0 );
160
}, [ setTimeout, bodyClassName, rescale ] );
153
useEffect( () => {
154
setTimeout( () => {
155
copyStylesToIframe( window.document, iframeRef.current.contentDocument );
156
+ iframeRef.current.contentDocument.body.classList.add(
157
+ bodyClassName,
158
+ 'editor-styles-wrapper',
159
+ 'block-editor__container'
160
+ );
161
rescale();
162
}, 0 );
163
}, [ setTimeout, bodyClassName, rescale ] );
starter-page-templates/page-template-modal/styles/starter-page-templates-editor.scss CHANGED
@@ -479,4 +479,11 @@ body.admin-bar:not( .is-fullscreen-mode ) .page-template-modal-screen-overlay {
479
.block-iframe-preview__template-title {
480
padding-top: 20px;
481
}
482
}
479
.block-iframe-preview__template-title {
480
padding-top: 20px;
481
}
482
+
483
+ // flex: column; on the parent and flex-basis: 0; on the child in Safari causes a lot of weird overlapping layout
484
+ // issues in the iframe preview: https://github.com/Automattic/wp-calypso/issues/39874
485
+ // Using flex-basis: auto; on the child allows the height to be calculated properly
486
+ .wp-block-columns > .block-editor-inner-blocks > .block-editor-block-list__layout > [data-type='core/column'] .block-core-columns {
487
+ flex-basis: auto;
488
+ }
489
}