Changeset 2168427
- Timestamp:
- 10/04/2019 07:13:11 PM (6 years ago)
- Location:
- full-site-editing/trunk
- Files:
-
- 9 deleted
- 19 edited
-
full-site-editing-plugin.php (modified) (2 diffs)
-
full-site-editing/blocks/post-content/style.scss (modified) (2 diffs)
-
full-site-editing/blocks/site-logo (deleted)
-
full-site-editing/blocks/template/edit.js (modified) (4 diffs)
-
full-site-editing/blocks/template/index.js (modified) (1 diff)
-
full-site-editing/blocks/template/style.scss (modified) (1 diff)
-
full-site-editing/class-a8c-rest-templates-controller.php (deleted)
-
full-site-editing/class-full-site-editing.php (modified) (4 diffs)
-
full-site-editing/components (deleted)
-
full-site-editing/dist/full-site-editing.css (modified) (1 diff)
-
full-site-editing/dist/full-site-editing.js (modified) (2 diffs)
-
full-site-editing/dist/full-site-editing.rtl.css (modified) (1 diff)
-
full-site-editing/editor/remove-editor-panels/index.js (modified) (1 diff)
-
full-site-editing/editor/style.scss (modified) (2 diffs)
-
full-site-editing/editor/suppress-draft-action/index.js (modified) (1 diff)
-
full-site-editing/editor/suppress-trash-action/index.js (modified) (1 diff)
-
full-site-editing/page-fse.php (deleted)
-
full-site-editing/plugins/close-button-override/index.js (modified) (3 diffs)
-
full-site-editing/plugins/close-button-override/style.scss (deleted)
-
full-site-editing/plugins/editor-template-classes/index.js (modified) (2 diffs)
-
full-site-editing/plugins/template-selector-sidebar (deleted)
-
full-site-editing/plugins/template-update-confirmation (deleted)
-
full-site-editing/plugins/template-update-notice/index.js (modified) (1 diff)
-
full-site-editing/templates/class-wp-template-inserter.php (modified) (17 diffs)
-
full-site-editing/templates/class-wp-template.php (modified) (2 diffs)
-
full-site-editing/utils (deleted)
-
lib (deleted)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
full-site-editing/trunk/full-site-editing-plugin.php
r2164036 r2168427 3 3 * Plugin Name: Full Site Editing 4 4 * Description: Enhances your page creation workflow within the Block Editor. 5 * Version: 0. 7.15 * Version: 0.9 6 6 * Author: Automattic 7 7 * Author URI: https://automattic.com/wordpress-plugins/ … … 21 21 * @var string 22 22 */ 23 define( 'PLUGIN_VERSION', '0. 7.1' );23 define( 'PLUGIN_VERSION', '0.9' ); 24 24 25 25 // Themes which are supported by Full Site Editing (not the same as the SPT themes). -
full-site-editing/trunk/full-site-editing/blocks/post-content/style.scss
r2152004 r2168427 1 1 .post-content-block.alignfull { 2 2 padding: 0 12px; 3 4 @media ( max-width: 768px ) { 5 overflow-x: hidden; 6 } 3 7 } 4 8 … … 38 42 // TODO: Replace the magic numbers! 39 43 .post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full] { 40 max-width: calc( 100vw - 81px ); 41 margin-left: 3px; 42 margin-right: 3px; 44 @media ( max-width: 768px ) { 45 max-width: 768px; 46 margin-left: 0; 47 margin-right: 0; 48 49 .block-editor-block-mover { 50 left: 60px; 51 } 52 } 53 @media ( min-width: 768px ) { 54 max-width: calc( 100vw - 81px ); 55 margin-left: 3px; 56 margin-right: 3px; 57 } 43 58 } 44 59 -
full-site-editing/trunk/full-site-editing/blocks/template/edit.js
r2152004 r2168427 1 /* eslint-disable import/no-extraneous-dependencies */ 1 2 /* eslint-disable wpcalypso/jsx-classname-namespace */ 2 3 /* global fullSiteEditing */ … … 33 34 const { templateId } = attributes; 34 35 const currentPostId = getCurrentPostId(); 35 const template = templateId && getEntityRecord( 'postType', 'wp_template ', templateId );36 const template = templateId && getEntityRecord( 'postType', 'wp_template_part', templateId ); 36 37 const editTemplateUrl = addQueryArgs( fullSiteEditing.editTemplateBaseUrl, { 37 38 post: templateId, … … 63 64 64 65 const templateBlocks = parse( get( template, [ 'content', 'raw' ], '' ) ); 65 const templateBlock = createBlock( 'core/ template', {}, templateBlocks );66 const templateBlock = createBlock( 'core/group', {}, templateBlocks ); 66 67 67 68 receiveBlocks( [ templateBlock ] ); … … 132 133 }; 133 134 135 /** 136 * IMPORTANT: Be careful about changes to the overlay button. There is code in 137 * iframe-bridge-server.js (setupEditTemplateLinks) which looks for two 138 * elements matching '.template__block-container .template-block__overlay a'. 139 * This code updates the href of the button to match the calypso URL (which is 140 * sent through the iFrame port) since editTemplateUrl here will be the wpadmin URL. 141 * 142 * If you make changes to the button, navigation to the template editor MAY BREAK. 143 * 144 * For example, if the button does not exist in the DOM as the editor is loaded, 145 * the links may not be updated in time, or an interval will continuously try to 146 * find them (which is bad for performance). 147 * 148 * This has already broken several times, so be careful! 149 */ 150 134 151 return ( 135 152 <div -
full-site-editing/trunk/full-site-editing/blocks/template/index.js
r2152004 r2168427 15 15 import './site-logo'; 16 16 17 if ( 'wp_template ' !== fullSiteEditing.editorPostType ) {17 if ( 'wp_template_part' !== fullSiteEditing.editorPostType ) { 18 18 registerBlockType( 'a8c/template', { 19 title: __( 'Template ' ),20 description: __( 'Display a template.' ),19 title: __( 'Template Part' ), 20 description: __( 'Display a Template Part.' ), 21 21 icon: 'layout', 22 22 category: 'layout', -
full-site-editing/trunk/full-site-editing/blocks/template/style.scss
r2152004 r2168427 86 86 87 87 // Hide the site logo description and buttons when not editing the Template 88 .block-editor-page:not( .post-type-wp_template ) {88 .block-editor-page:not( .post-type-wp_template_part ) { 89 89 .fse-site-logo { 90 90 .components-placeholder__fieldset, .components-placeholder__instructions { -
full-site-editing/trunk/full-site-editing/class-full-site-editing.php
r2152004 r2168427 24 24 * @var array 25 25 */ 26 private $template_post_types = [ 'wp_template ' ];26 private $template_post_types = [ 'wp_template_part' ]; 27 27 28 28 /** … … 107 107 } 108 108 109 if ( ! $this->wp_template_inserter->is_template_data_inserted() ) { 110 $this->wp_template_inserter->insert_default_template_data(); 111 } 112 113 if ( ! $this->wp_template_inserter->is_pages_data_inserted() ) { 114 $this->wp_template_inserter->insert_default_pages(); 115 } 109 $this->wp_template_inserter->insert_default_template_data(); 110 $this->wp_template_inserter->insert_default_pages(); 116 111 } 117 112 … … 562 557 */ 563 558 public function remove_delete_row_action_for_template_taxonomy( $actions, $term ) { 564 if ( 'wp_template_ type' === $term->taxonomy ) {559 if ( 'wp_template_part_type' === $term->taxonomy ) { 565 560 unset( $actions['delete'] ); 566 561 } … … 586 581 */ 587 582 public function restrict_template_taxonomy_deletion( $term, $taxonomy ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed 588 if ( 'wp_template_ type' === $taxonomy ) {583 if ( 'wp_template_part_type' === $taxonomy ) { 589 584 wp_die( esc_html__( 'Template Types cannon be deleted.' ) ); 590 585 } -
full-site-editing/trunk/full-site-editing/dist/full-site-editing.css
r2152004 r2168427 1 .wp-block-a8c-navigation-menu.main-navigation{pointer-events:none}.post-content-block.alignfull{padding:0 12px} .post-content-block__selector{width:300px}.post-content-block__selector a{font-family:sans-serif;font-size:13px;padding-left:8px}.post-content-block__preview{pointer-events:none}.post-content-block__preview:after{content:"";clear:both;display:table}.post-content-block .editor-post-title,.show-post-title-before-content .editor-post-title{display:none}.show-post-title-before-content .post-content-block .editor-post-title{display:block}.post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{max-width:calc(100vw - 81px);margin-left:3px;margin-right:3px}.block-editor-block-list__layout .post-content__block.is-selected .block-editor-block-contextual-toolbar{display:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit:before{transition:none;border:none;outline:none;box-shadow:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb{display:none}.block-editor .wp-block-a8c-site-description:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-ms-input-placeholder{color:transparent}.block-editor .wp-block-a8c-site-title:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-ms-input-placeholder{color:transparent}.template-block{min-height:200px;overflow:hidden;position:relative}.template__block-container.is-hovered{cursor:pointer}.template__block-container.is-hovered .components-disabled,.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled{filter:blur(2px);transition:filter .2s linear .7s}.template__block-container.is-hovered .template-block__overlay,.template__block-container .is-navigating-to-template .template-block__overlay,.template__block-container.is-selected .template-block__overlay{opacity:1;transition:opacity .2s linear}.template__block-container.is-hovered .template-block__overlay .components-button,.template__block-container .is-navigating-to-template .template-block__overlay .components-button,.template__block-container.is-selected .template-block__overlay .components-button{opacity:1;transition:opacity .2s linear .7s}.template__block-container .components-disabled{filter:blur(0);transition:filter .2s linear 0s}.template__block-container .block-editor-block-contextual-toolbar,.template__block-container .block-editor-block-list__block-edit:before,.template__block-container .block-editor-block-list__block-mobile-toolbar,.template__block-container .block-editor-block-list__breadcrumb,.template__block-container .block-editor-block-list__insertion-point{display:none}.template-block__overlay{background:hsla(0,0%,100%,.8);border:0 solid rgba(123,134,162,.3);bottom:0;left:0;margin:0;opacity:0;padding:0;position:absolute;right:0;transition:opacity .2s linear 0s;top:0;z-index:2}.is-selected .template-block__overlay{border-color:rgba(66,88,99,.4)}.editor-block-list__block:first-child .template-block__overlay{border-bottom-width:1px}.editor-block-list__block:last-child .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template-block__overlay{border-width:1px}}.template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s}.template-block__overlay .components-button.hidden{display:none}.template-block__loading{display:flex;align-items:center;color:#191e23}.block-editor-page:not(.post-type-wp_template) .fse-site-logo .components-placeholder__fieldset,.block-editor-page:not(.post-type-wp_template) .fse-site-logo .components-placeholder__instructions{display:none}.edit-post-fullscreen-mode-close__toolbar a.is-button.is-default{height:auto}.edit-post-fullscreen-mode-close__toolbar a.is-button.is-default span{display:none}.edit-post-fullscreen-mode-close__toolbar a.a8c-close-button{padding:4px}.post-type-wp_template .edit-post-post-status,.post-type-wp_template .editor-post-title,.post-type-wp_template .editor-post-trash{display:none}.post-type-wp_template .edit-post-visual-editor{margin-top:20px;padding-top:0}.post-type-wp_template .editor-post-switch-to-draft{display:none}.post-type-page .edit-post-layout__content,.post-type-wp_template .edit-post-layout__content{background:#eee}.post-type-page .edit-post-layout__content .edit-post-visual-editor,.post-type-wp_template .edit-post-layout__content .edit-post-visual-editor{flex:none;margin:36px 32px;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 (max-width:768px){.post-type-page .edit-post-layout__content .edit-post-visual-editor,.post-type-wp_template .edit-post-layout__content .edit-post-visual-editor{margin:0}}.post-type-page .editor-writing-flow__click-redirect,.post-type-wp_template.editor-writing-flow__click-redirect{display:none}.editor-styles-wrapper{background:#fff}.post-type-page .edit-post-visual-editor{padding-top:0}.post-type-page .block-editor-writing-flow{display:block}.post-type-page .wp-block.template__block-container [data-block]{margin:0}1 .wp-block-a8c-navigation-menu.main-navigation{pointer-events:none}.post-content-block.alignfull{padding:0 12px}@media (max-width:768px){.post-content-block.alignfull{overflow-x:hidden}}.post-content-block__selector{width:300px}.post-content-block__selector a{font-family:sans-serif;font-size:13px;padding-left:8px}.post-content-block__preview{pointer-events:none}.post-content-block__preview:after{content:"";clear:both;display:table}.post-content-block .editor-post-title,.show-post-title-before-content .editor-post-title{display:none}.show-post-title-before-content .post-content-block .editor-post-title{display:block}@media (max-width:768px){.post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{max-width:768px;margin-left:0;margin-right:0}.post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full] .block-editor-block-mover{left:60px}}@media (min-width:768px){.post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{max-width:calc(100vw - 81px);margin-left:3px;margin-right:3px}}.block-editor-block-list__layout .post-content__block.is-selected .block-editor-block-contextual-toolbar{display:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit:before{transition:none;border:none;outline:none;box-shadow:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb{display:none}.block-editor .wp-block-a8c-site-description:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-ms-input-placeholder{color:transparent}.block-editor .wp-block-a8c-site-title:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-ms-input-placeholder{color:transparent}.template-block{min-height:200px;overflow:hidden;position:relative}.template__block-container.is-hovered{cursor:pointer}.template__block-container.is-hovered .components-disabled,.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled{filter:blur(2px);transition:filter .2s linear .7s}.template__block-container.is-hovered .template-block__overlay,.template__block-container .is-navigating-to-template .template-block__overlay,.template__block-container.is-selected .template-block__overlay{opacity:1;transition:opacity .2s linear}.template__block-container.is-hovered .template-block__overlay .components-button,.template__block-container .is-navigating-to-template .template-block__overlay .components-button,.template__block-container.is-selected .template-block__overlay .components-button{opacity:1;transition:opacity .2s linear .7s}.template__block-container .components-disabled{filter:blur(0);transition:filter .2s linear 0s}.template__block-container .block-editor-block-contextual-toolbar,.template__block-container .block-editor-block-list__block-edit:before,.template__block-container .block-editor-block-list__block-mobile-toolbar,.template__block-container .block-editor-block-list__breadcrumb,.template__block-container .block-editor-block-list__insertion-point{display:none}.template-block__overlay{background:hsla(0,0%,100%,.8);border:0 solid rgba(123,134,162,.3);bottom:0;left:0;margin:0;opacity:0;padding:0;position:absolute;right:0;transition:opacity .2s linear 0s;top:0;z-index:2}.is-selected .template-block__overlay{border-color:rgba(66,88,99,.4)}.editor-block-list__block:first-child .template-block__overlay{border-bottom-width:1px}.editor-block-list__block:last-child .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template-block__overlay{border-width:1px}}.template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s}.template-block__overlay .components-button.hidden{display:none}.template-block__loading{display:flex;align-items:center;color:#191e23}.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__fieldset,.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__instructions,.post-type-wp_template_part .edit-post-post-status,.post-type-wp_template_part .editor-post-title,.post-type-wp_template_part .editor-post-trash{display:none}.post-type-wp_template_part .edit-post-visual-editor{margin-top:20px;padding-top:0}.post-type-wp_template_part .editor-post-switch-to-draft{display:none}@media (min-width:768px){.post-type-page .edit-post-layout__content,.post-type-wp_template_part .edit-post-layout__content{background:#eee}.post-type-page .edit-post-layout__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-layout__content .edit-post-visual-editor{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);flex:none;margin:36px 32px}}.post-type-page .editor-writing-flow__click-redirect,.post-type-wp_template_part .editor-writing-flow__click-redirect{display:none}.editor-styles-wrapper{background:#fff}.post-type-page .edit-post-visual-editor{padding-top:0}.post-type-page .block-editor-writing-flow{display:block}.post-type-page .wp-block.template__block-container [data-block]{margin:0} -
full-site-editing/trunk/full-site-editing/dist/full-site-editing.js
r2152004 r2168427 1 !function(t,e){for(var n in e)t[n]=e[n]}(window,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4 3)}([function(t,e){!function(){t.exports=this.wp.element}()},function(t,e){!function(){t.exports=this.wp.i18n}()},function(t,e){!function(){t.exports=this.wp.data}()},function(t,e){!function(){t.exports=this.wp.compose}()},function(t,e){!function(){t.exports=this.wp.blocks}()},function(t,e){!function(){t.exports=this.wp.editor}()},function(t,e,n){var r=n(10);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}t.exports=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}},function(t,e){!function(){t.exports=this.lodash}()},function(t,e,n){var r;1 !function(t,e){for(var n in e)t[n]=e[n]}(window,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=42)}([function(t,e){!function(){t.exports=this.wp.element}()},function(t,e){!function(){t.exports=this.wp.i18n}()},function(t,e){!function(){t.exports=this.wp.data}()},function(t,e){!function(){t.exports=this.wp.compose}()},function(t,e){!function(){t.exports=this.wp.blocks}()},function(t,e){!function(){t.exports=this.wp.editor}()},function(t,e,n){var r=n(10);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}t.exports=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}},function(t,e){!function(){t.exports=this.lodash}()},function(t,e,n){var r; 2 2 /*! 3 3 Copyright (c) 2017 Jed Watson. … … 10 10 http://jedwatson.github.io/classnames 11 11 */ 12 !function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var i=typeof r;if("string"===i||"number"===i)t.push(r);else if(Array.isArray(r)&&r.length){var c=o.apply(null,r);c&&t.push(c)}else if("object"===i)for(var l in r)n.call(r,l)&&r[l]&&t.push(l)}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()},function(t,e){!function(){t.exports=this.wp.hooks}()},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){!function(){t.exports=this.wp.components}()},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}t.exports=n},function(t,e){!function(){t.exports=this.wp.domReady}()},function(t,e){!function(){t.exports=this.wp.keycodes}()},function(t,e,n){var r=n(33),o=n(34),i=n(35);t.exports=function(t,e){return r(t)||o(t,e)||i()}},function(t,e){!function(){t.exports=this.wp.apiFetch}()},function(t,e){!function(){t.exports=this.wp.htmlEntities}()},function(t,e,n){},function(t,e){!function(){t.exports=this.wp.serverSideRender}()},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(29),o=n(30);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){var r=n(31);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e){!function(){t.exports=this.wp.url}()},function(t,e,n){var r=n(39),o=n(40),i=n(41);t.exports=function(t){return r(t)||o(t)||i()}},function(t,e){!function(){t.exports=this.wp.plugins}()},function(t,e,n){},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e,n){},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var c,l=t[Symbol.iterator]();!(r=(c=l.next()).done)&&(n.push(c.value),!e||n.length!==e);r=!0);}catch(a){o=!0,i=a}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r=n(0),o=n(4),i=n(1),c=n(19),l=n.n(c),a=function(){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(l.a,{block:"a8c/navigation-menu"}))},s=(n(28),Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M12 7.27l4.28 10.43-3.47-1.53-.81-.36-.81.36-3.47 1.53L12 7.27M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71L12 2z"})));Object(o.registerBlockType)("a8c/navigation-menu",{title:Object(i.__)("Navigation Menu"),description:Object(i.__)("Visual placeholder for site-wide navigation and menus."),icon:s,category:"layout",supports:{align:["wide","full"],html:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"}},edit:a,save:function(){return null}});var u=n(12),p=n.n(u),d=n(3),f=n(9),b=n(10),m=n.n(b),O=n(20),g=n.n(O),v=n(21),h=n.n(v),y=n(22),j=n.n(y),w=n(23),E=n.n(w),S=n(24),k=n.n(S),_=n(8),P=n.n(_),x=n(2),T=n(5),I=function(t){function e(){return g()(this,e),j()(this,E()(e).apply(this,arguments))}return k()(e,t),h()(e,[{key:"toggleEditing",value:function(){var t=this.props,e=t.isEditing;(0,t.setState)({isEditing:!e})}},{key:"onSelectPost",value:function(t){var e=t.id,n=t.type;this.props.setState({isEditing:!1,selectedPostId:e,selectedPostType:n})}},{key:"render",value:function(){var t=this.props.attributes.align;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:P()("post-content-block",m()({},"align".concat(t),t))},Object(r.createElement)(T.PostTitle,null),Object(r.createElement)(T.InnerBlocks,{templateLock:!1})))}}]),e}(r.Component),B=Object(d.compose)([Object(d.withState)({isEditing:!1,selectedPostId:void 0,selectedPostType:void 0}),Object(x.withSelect)(function(t,e){var n=e.selectedPostId,r=e.selectedPostType;return{selectedPost:(0,t("core").getEntityRecord)("postType",r,n)}})])(I);n(32);Object(o.registerBlockType)("a8c/post-content",{title:Object(i.__)("Content"),description:Object(i.__)("The page content."),icon:"layout",category:"layout",supports:{align:["full"],anchor:!1,customClassName:!1,html:!1,inserter:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"full"}},edit:B,save:function(){return Object(r.createElement)(T.InnerBlocks.Content,null)}});var C=Object(d.createHigherOrderComponent)(function(t){return function(e){return"a8c/post-content"!==e.name?Object(r.createElement)(t,e):Object(r.createElement)(t,p()({},e,{className:"post-content__block"}))}},"addContentSlotClassname");Object(f.addFilter)("editor.BlockListBlock","full-site-editing/blocks/post-content",C,9);var D=n(14),N=n(6),L=n.n(N),A=n(15),M=n.n(A),F=n(16),R=n.n(F),U=n(17);function H(t){var e=Object(r.useRef)();return Object(r.useEffect)(function(){e.current=t},[t]),e.current}function z(t,e,n,o,c,l){var a=Object(r.useState)({option:e,previousOption:"",loaded:!1,error:!1}),s=M()(a,2),u=s[0],p=s[1],d=H(o),f=H(c);function b(){p(L()({},u,{option:u.previousOption,isSaving:!1}))}return Object(r.useEffect)(function(){u.loaded||u.error?function(){var e=u.option,r=u.previousOption,l=e&&e.trim()===r.trim(),a=!e||0===e.trim().length;!o&&d&&a&&b();if(!c||l)return;!f&&c&&function(e){p(L()({},u,{isSaving:!0})),R()({path:"/wp/v2/settings",method:"POST",data:m()({},t,e)}).then(function(){return function(t){p(L()({},u,{previousOption:t,isDirty:!1,isSaving:!1}))}(e)}).catch(function(){n(Object(i.sprintf)(Object(i.__)("Unable to save site %s"),t)),b()})}(e)}():R()({path:"/wp/v2/settings"}).then(function(e){return p(L()({},u,{option:Object(U.decodeEntities)(e[t]),previousOption:Object(U.decodeEntities)(e[t]),loaded:!0,error:!1}))}).catch(function(){n(Object(i.sprintf)(Object(i.__)("Unable to load site %s"),t)),p(L()({},u,{option:Object(i.sprintf)(Object(i.__)("Error loading site %s"),t),error:!0}))})}),{siteOptions:u,handleChange:function(t){l({updated:Date.now()}),p(L()({},u,{option:t}))}}}var q=Object(d.compose)([Object(x.withSelect)(function(t,e){var n=e.clientId,r=t("core/editor"),o=r.isSavingPost,i=r.isPublishingPost,c=r.isAutosavingPost,l=r.isCurrentPostPublished,a=t("core/block-editor"),s=a.getBlockIndex,u=a.getBlockRootClientId,p=a.getTemplateLock,d=u(n);return{blockIndex:s(n,d),isLocked:!!p(d),rootClientId:d,shouldUpdateSiteOption:(o()&&l()||i())&&!c()}}),Object(x.withDispatch)(function(t,e){var n=e.blockIndex,r=e.rootClientId;return{createErrorNotice:t("core/notices").createErrorNotice,insertDefaultBlock:function(){return t("core/block-editor").insertDefaultBlock({},r,n+1)}}})])(function(t){var e=t.className,n=t.createErrorNotice,o=t.shouldUpdateSiteOption,c=t.isSelected,l=t.setAttributes,a=t.isLocked,s=t.insertDefaultBlock,u=z("description",Object(i.__)("Site description loading…"),n,c,o,l),p=u.siteOptions,d=u.handleChange,f=p.option;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(T.PlainText,{className:P()("site-description",e),value:f,onChange:function(t){return d(t)},onKeyDown:function(t){t.keyCode===D.ENTER&&(t.preventDefault(),a||s())},placeholder:Object(i.__)("Add a Site Description"),"aria-label":Object(i.__)("Site Description")}))});n(36);Object(o.registerBlockType)("a8c/site-description",{title:Object(i.__)("Site Description"),description:Object(i.__)("Site description, also known as the tagline."),icon:Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(r.createElement)("path",{d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"})),category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"}},edit:q,save:function(){return null}});var V=Object(d.compose)([Object(x.withSelect)(function(t,e){var n=e.clientId,r=t("core/editor"),o=r.isSavingPost,i=r.isPublishingPost,c=r.isAutosavingPost,l=r.isCurrentPostPublished,a=t("core/block-editor"),s=a.getBlockIndex,u=a.getBlockRootClientId,p=a.getTemplateLock,d=u(n);return{blockIndex:s(n,d),isLocked:!!p(d),rootClientId:d,shouldUpdateSiteOption:(o()&&l()||i())&&!c()}}),Object(x.withDispatch)(function(t,e){var n=e.blockIndex,r=e.rootClientId;return{createErrorNotice:t("core/notices").createErrorNotice,insertDefaultBlock:function(){return t("core/block-editor").insertDefaultBlock({},r,n+1)}}})])(function(t){var e=t.className,n=t.createErrorNotice,o=t.shouldUpdateSiteOption,c=t.isSelected,l=t.setAttributes,a=t.isLocked,s=t.insertDefaultBlock,u=z("title",Object(i.__)("Site title loading…"),n,c,o,l),p=u.siteOptions,d=u.handleChange,f=p.option;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(T.PlainText,{className:P()("site-title",e),value:f,onChange:function(t){return d(t)},onKeyDown:function(t){t.keyCode===D.ENTER&&(t.preventDefault(),a||s())},placeholder:Object(i.__)("Add a Site Title"),"aria-label":Object(i.__)("Site Title")}))});n(37);Object(o.registerBlockType)("a8c/site-title",{title:Object(i.__)("Site Title"),description:Object(i.__)("Your site title."),icon:"layout",category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"}},edit:V,save:function(){return null}});var G=n(7),W=n(11),K=n(25),Q=(n(18),Object(d.compose)(Object(d.withState)({templateClientId:null}),Object(x.withSelect)(function(t,e){var n=e.attributes,r=e.templateClientId,o=t("core").getEntityRecord,i=t("core/editor"),c=i.getCurrentPostId,l=i.isEditedPostDirty,a=t("core/block-editor"),s=a.getBlock,u=a.getSelectedBlock,p=t("core/edit-post").isEditorSidebarOpened,d=n.templateId,f=c(),b=d&&o("postType","wp_template",d),m=Object(K.addQueryArgs)(fullSiteEditing.editTemplateBaseUrl,{post:d,fse_parent_post:f}),O=u();return{currentPostId:f,editTemplateUrl:m,template:b,templateBlock:s(r),templateTitle:Object(G.get)(b,["title","rendered"],""),isDirty:l(),isEditorSidebarOpened:!!p(),isAnyTemplateBlockSelected:O&&"a8c/template"===O.name}}),Object(x.withDispatch)(function(t,e){var n=t("core/block-editor").receiveBlocks,r=t("core/edit-post").openGeneralSidebar,i=e.template,c=e.templateClientId,l=e.setState;return{savePost:t("core/editor").savePost,receiveTemplateBlocks:function(){if(i&&!c){var t=Object(o.parse)(Object(G.get)(i,["content","raw"],"")),e=Object(o.createBlock)("core/template",{},t);n([e]),l({templateClientId:e.clientId})}},openGeneralSidebar:r}}))(function(t){var e,n=t.attributes,o=t.editTemplateUrl,c=t.receiveTemplateBlocks,l=t.template,a=t.templateBlock,s=t.templateTitle,u=t.isDirty,p=t.savePost,d=t.isEditorSidebarOpened,f=t.openGeneralSidebar,b=t.isAnyTemplateBlockSelected;if(!l)return Object(r.createElement)(W.Placeholder,null,Object(r.createElement)(W.Spinner,null));var O=Object(r.createRef)(),g=Object(r.useState)(!1),v=M()(g,2),h=v[0],y=v[1];Object(r.useEffect)(function(){h&&!u&&O.current.click(),c()}),Object(r.useEffect)(function(){var t=document.querySelector(".edit-post-sidebar__panel-tabs ul li:last-child");if(d&&t){if(b)return f("edit-post/document"),void t.classList.add("hidden");t.classList.remove("hidden")}},[b,d,f]);var j=n.align,w=n.className;return Object(r.createElement)("div",{className:P()("template-block",(e={},m()(e,"align".concat(j),j),m()(e,"is-navigating-to-template",h),e))},a&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(W.Disabled,null,Object(r.createElement)("div",{className:w},Object(r.createElement)(T.BlockEdit,{attributes:a.attributes,block:a,clientId:a.clientId,isSelected:!1,name:a.name,setAttributes:G.noop}))),Object(r.createElement)(W.Placeholder,{className:"template-block__overlay"},h&&Object(r.createElement)("div",{className:"template-block__loading"},Object(r.createElement)(W.Spinner,null)," ",Object(i.sprintf)(Object(i.__)("Loading %s Editor"),s)),Object(r.createElement)(W.Button,{className:h?"hidden":null,href:o,onClick:function(t){y(!0),u&&(t.preventDefault(),p())},isDefault:!0,isLarge:!0,ref:O},Object(i.sprintf)(Object(i.__)("Edit %s"),s)))))})),Y=Object(d.createHigherOrderComponent)(function(t){return function(e){return"fse-site-logo"!==e.attributes.className?Object(r.createElement)(t,e):Object(r.createElement)(t,p()({},e,{className:"template__site-logo"}))}},"addFSESiteLogoClassname");Object(f.addFilter)("editor.BlockListBlock","full-site-editing/blocks/template",Y),"wp_template"!==fullSiteEditing.editorPostType&&Object(o.registerBlockType)("a8c/template",{title:Object(i.__)("Template"),description:Object(i.__)("Display a template."),icon:"layout",category:"layout",attributes:{templateId:{type:"number"},className:{type:"string"}},supports:{anchor:!1,customClassName:!1,html:!1,inserter:!1,reusable:!1},edit:Q,save:function(){return null},getEditWrapperProps:function(){return{"data-align":"full"}}});var J=Object(d.createHigherOrderComponent)(function(t){return function(e){return"a8c/template"!==e.name?Object(r.createElement)(t,e):Object(r.createElement)(t,p()({},e,{className:"template__block-container"}))}},"addFSETemplateClassname");Object(f.addFilter)("editor.BlockListBlock","full-site-editing/blocks/template",J,9);var X=n(13),Z=n.n(X);n(38);Z()(function(){var t=fullSiteEditing,e=t.closeButtonLabel,n=t.closeButtonUrl,r=t.editorPostType,o=setInterval(function(){var t=document.querySelector(".edit-post-fullscreen-mode-close__toolbar a");if(t)if(clearInterval(o),"wp_template"===r&&n){var i=document.createElement("a");i.href=n,i.innerHTML=e,i.className="components-button components-icon-button is-button is-default",i.setAttribute("aria-label",e),document.querySelector(".edit-post-fullscreen-mode-close__toolbar").replaceChild(i,t)}else t.innerHTML='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="28" height="28" viewBox="0 0 20 20"><path d="M14.95 6.46l-3.54 3.54 3.54 3.54-1.41 1.41-3.54-3.53-3.53 3.53-1.42-1.42 3.53-3.53-3.53-3.53 1.42-1.42 3.53 3.53 3.54-3.53z"></path></svg>',t.classList.add("a8c-close-button")})});var $=n(26),tt=n.n($),et=n(27),nt=Object(x.withSelect)(function(t){var e=t("core").getEntityRecord,n=t("core/editor").getEditedPostAttribute;return{templateClasses:Object(G.map)(n("template_types"),function(t){var n=Object(G.get)(e("taxonomy","wp_template_type",t),"name","");return Object(G.endsWith)(n,"-header")?"site-header site-branding":Object(G.endsWith)(n,"-footer")?"site-footer":void 0})}})(function(t){var e=t.templateClasses,n=setInterval(function(){var t=document.querySelector(".block-editor-writing-flow.editor-writing-flow > div");t&&(clearInterval(n),t.className=P.a.apply(void 0,["a8c-template-editor"].concat(tt()(e))))});return null});"wp_template"===fullSiteEditing.editorPostType&&Object(et.registerPlugin)("fse-editor-template-classes",{render:nt}),Z()(function(){"wp_template"===fullSiteEditing.editorPostType&&Object(x.dispatch)("core/notices").createNotice("info",Object(i.__)("Updates to this template will affect all pages on your site."),{isDismissible:!1})});var rt=Object(d.compose)(Object(x.withSelect)(function(t){var e=t("core/editor"),n=e.getBlocks,r=e.getEditorSettings,o=t("core/edit-post").getEditorMode,i=n().find(function(t){return"a8c/post-content"===t.name});return{rootClientId:i?i.clientId:"",showInserter:"visual"===o()&&r().richEditingEnabled}}))(function(t){var e=t.rootClientId,n=t.showInserter;return Object(r.createElement)(T.Inserter,{rootClientId:e,disabled:!n,position:"bottom right"})});Z()(function(){return function(){if("page"===fullSiteEditing.editorPostType)var t=setInterval(function(){var e=document.querySelector(".edit-post-header-toolbar");if(e){clearInterval(t);var n=document.createElement("div");n.classList.add("fse-post-content-block-inserter"),e.insertBefore(n,e.firstChild),Object(r.render)(Object(r.createElement)(rt,null),n)}})}()});var ot=Object(x.subscribe)(function(){if("page"!==fullSiteEditing.editorPostType)return ot();!1===Object(x.select)("core/editor").isValidTemplate()&&Object(x.dispatch)("core/editor").setTemplateValidity(!0)}),it=["logo","brand","emblem","hallmark"];Object(f.addFilter)("blocks.registerBlockType","full-site-editing/editor/image-block-keywords",function(t,e){return"core/image"!==e?t:t=Object(G.assign)({},t,{keywords:t.keywords.concat(it)})});n(42);Object(x.use)(function(t){return{dispatch:function(e){var n=L()({},t.dispatch(e)),r=fullSiteEditing.editorPostType;return"core/editor"===e&&n.trashPost&&"wp_template"===r&&(n.trashPost=function(){}),n}}}),Object(x.use)(function(t){return{dispatch:function(e){var n=L()({},t.dispatch(e)),r=fullSiteEditing.editorPostType;if("core/editor"===e&&n.editPost&&"wp_template"===r){var o=n.editPost;n.editPost=function(t){"draft"!==t.status&&o(t)}}return n}}});var ct=Object(x.subscribe)(function(){var t=Object(x.dispatch)("core/edit-post").removeEditorPanel;return"page"===fullSiteEditing.editorPostType&&t("featured-image"),"wp_template"===fullSiteEditing.editorPostType&&t("post-status"),ct()})}]));12 !function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;e<arguments.length;e++){var r=arguments[e];if(r){var i=typeof r;if("string"===i||"number"===i)t.push(r);else if(Array.isArray(r)&&r.length){var c=o.apply(null,r);c&&t.push(c)}else if("object"===i)for(var a in r)n.call(r,a)&&r[a]&&t.push(a)}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()},function(t,e){!function(){t.exports=this.wp.hooks}()},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){!function(){t.exports=this.wp.components}()},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}t.exports=n},function(t,e){!function(){t.exports=this.wp.domReady}()},function(t,e){!function(){t.exports=this.wp.keycodes}()},function(t,e,n){var r=n(33),o=n(34),i=n(35);t.exports=function(t,e){return r(t)||o(t,e)||i()}},function(t,e){!function(){t.exports=this.wp.apiFetch}()},function(t,e){!function(){t.exports=this.wp.htmlEntities}()},function(t,e,n){},function(t,e){!function(){t.exports=this.wp.serverSideRender}()},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(29),o=n(30);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){var r=n(31);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e){!function(){t.exports=this.wp.url}()},function(t,e,n){var r=n(38),o=n(39),i=n(40);t.exports=function(t){return r(t)||o(t)||i()}},function(t,e){!function(){t.exports=this.wp.plugins}()},function(t,e,n){},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e,n){},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!e||n.length!==e);r=!0);}catch(l){o=!0,i=l}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,n){},function(t,e,n){},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r=n(0),o=n(4),i=n(1),c=n(19),a=n.n(c),l=function(){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.a,{block:"a8c/navigation-menu"}))},s=(n(28),Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M12 7.27l4.28 10.43-3.47-1.53-.81-.36-.81.36-3.47 1.53L12 7.27M12 2L4.5 20.29l.71.71L12 18l6.79 3 .71-.71L12 2z"})));Object(o.registerBlockType)("a8c/navigation-menu",{title:Object(i.__)("Navigation Menu"),description:Object(i.__)("Visual placeholder for site-wide navigation and menus."),icon:s,category:"layout",supports:{align:["wide","full"],html:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"}},edit:l,save:function(){return null}});var u=n(12),p=n.n(u),d=n(3),f=n(9),b=n(10),m=n.n(b),O=n(20),g=n.n(O),v=n(21),y=n.n(v),h=n(22),j=n.n(h),E=n(23),_=n.n(E),w=n(24),S=n.n(w),k=n(8),P=n.n(k),x=n(2),T=n(5),I=function(t){function e(){return g()(this,e),j()(this,_()(e).apply(this,arguments))}return S()(e,t),y()(e,[{key:"toggleEditing",value:function(){var t=this.props,e=t.isEditing;(0,t.setState)({isEditing:!e})}},{key:"onSelectPost",value:function(t){var e=t.id,n=t.type;this.props.setState({isEditing:!1,selectedPostId:e,selectedPostType:n})}},{key:"render",value:function(){var t=this.props.attributes.align;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:P()("post-content-block",m()({},"align".concat(t),t))},Object(r.createElement)(T.PostTitle,null),Object(r.createElement)(T.InnerBlocks,{templateLock:!1})))}}]),e}(r.Component),B=Object(d.compose)([Object(d.withState)({isEditing:!1,selectedPostId:void 0,selectedPostType:void 0}),Object(x.withSelect)(function(t,e){var n=e.selectedPostId,r=e.selectedPostType;return{selectedPost:(0,t("core").getEntityRecord)("postType",r,n)}})])(I);n(32);Object(o.registerBlockType)("a8c/post-content",{title:Object(i.__)("Content"),description:Object(i.__)("The page content."),icon:"layout",category:"layout",supports:{align:["full"],anchor:!1,customClassName:!1,html:!1,inserter:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"full"}},edit:B,save:function(){return Object(r.createElement)(T.InnerBlocks.Content,null)}});var C=Object(d.createHigherOrderComponent)(function(t){return function(e){return"a8c/post-content"!==e.name?Object(r.createElement)(t,e):Object(r.createElement)(t,p()({},e,{className:"post-content__block"}))}},"addContentSlotClassname");Object(f.addFilter)("editor.BlockListBlock","full-site-editing/blocks/post-content",C,9);var D=n(14),N=n(6),L=n.n(N),A=n(15),F=n.n(A),M=n(16),R=n.n(M),U=n(17);function H(t){var e=Object(r.useRef)();return Object(r.useEffect)(function(){e.current=t},[t]),e.current}function q(t,e,n,o,c,a){var l=Object(r.useState)({option:e,previousOption:"",loaded:!1,error:!1}),s=F()(l,2),u=s[0],p=s[1],d=H(o),f=H(c);function b(){p(L()({},u,{option:u.previousOption,isSaving:!1}))}return Object(r.useEffect)(function(){u.loaded||u.error?function(){var e=u.option,r=u.previousOption,a=e&&e.trim()===r.trim(),l=!e||0===e.trim().length;!o&&d&&l&&b();if(!c||a)return;!f&&c&&function(e){p(L()({},u,{isSaving:!0})),R()({path:"/wp/v2/settings",method:"POST",data:m()({},t,e)}).then(function(){return function(t){p(L()({},u,{previousOption:t,isDirty:!1,isSaving:!1}))}(e)}).catch(function(){n(Object(i.sprintf)(Object(i.__)("Unable to save site %s"),t)),b()})}(e)}():R()({path:"/wp/v2/settings"}).then(function(e){return p(L()({},u,{option:Object(U.decodeEntities)(e[t]),previousOption:Object(U.decodeEntities)(e[t]),loaded:!0,error:!1}))}).catch(function(){n(Object(i.sprintf)(Object(i.__)("Unable to load site %s"),t)),p(L()({},u,{option:Object(i.sprintf)(Object(i.__)("Error loading site %s"),t),error:!0}))})}),{siteOptions:u,handleChange:function(t){a({updated:Date.now()}),p(L()({},u,{option:t}))}}}var z=Object(d.compose)([Object(x.withSelect)(function(t,e){var n=e.clientId,r=t("core/editor"),o=r.isSavingPost,i=r.isPublishingPost,c=r.isAutosavingPost,a=r.isCurrentPostPublished,l=t("core/block-editor"),s=l.getBlockIndex,u=l.getBlockRootClientId,p=l.getTemplateLock,d=u(n);return{blockIndex:s(n,d),isLocked:!!p(d),rootClientId:d,shouldUpdateSiteOption:(o()&&a()||i())&&!c()}}),Object(x.withDispatch)(function(t,e){var n=e.blockIndex,r=e.rootClientId;return{createErrorNotice:t("core/notices").createErrorNotice,insertDefaultBlock:function(){return t("core/block-editor").insertDefaultBlock({},r,n+1)}}})])(function(t){var e=t.className,n=t.createErrorNotice,o=t.shouldUpdateSiteOption,c=t.isSelected,a=t.setAttributes,l=t.isLocked,s=t.insertDefaultBlock,u=q("description",Object(i.__)("Site description loading…"),n,c,o,a),p=u.siteOptions,d=u.handleChange,f=p.option;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(T.PlainText,{className:P()("site-description",e),value:f,onChange:function(t){return d(t)},onKeyDown:function(t){t.keyCode===D.ENTER&&(t.preventDefault(),l||s())},placeholder:Object(i.__)("Add a Site Description"),"aria-label":Object(i.__)("Site Description")}))});n(36);Object(o.registerBlockType)("a8c/site-description",{title:Object(i.__)("Site Description"),description:Object(i.__)("Site description, also known as the tagline."),icon:Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(r.createElement)("path",{d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"})),category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"}},edit:z,save:function(){return null}});var V=Object(d.compose)([Object(x.withSelect)(function(t,e){var n=e.clientId,r=t("core/editor"),o=r.isSavingPost,i=r.isPublishingPost,c=r.isAutosavingPost,a=r.isCurrentPostPublished,l=t("core/block-editor"),s=l.getBlockIndex,u=l.getBlockRootClientId,p=l.getTemplateLock,d=u(n);return{blockIndex:s(n,d),isLocked:!!p(d),rootClientId:d,shouldUpdateSiteOption:(o()&&a()||i())&&!c()}}),Object(x.withDispatch)(function(t,e){var n=e.blockIndex,r=e.rootClientId;return{createErrorNotice:t("core/notices").createErrorNotice,insertDefaultBlock:function(){return t("core/block-editor").insertDefaultBlock({},r,n+1)}}})])(function(t){var e=t.className,n=t.createErrorNotice,o=t.shouldUpdateSiteOption,c=t.isSelected,a=t.setAttributes,l=t.isLocked,s=t.insertDefaultBlock,u=q("title",Object(i.__)("Site title loading…"),n,c,o,a),p=u.siteOptions,d=u.handleChange,f=p.option;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(T.PlainText,{className:P()("site-title",e),value:f,onChange:function(t){return d(t)},onKeyDown:function(t){t.keyCode===D.ENTER&&(t.preventDefault(),l||s())},placeholder:Object(i.__)("Add a Site Title"),"aria-label":Object(i.__)("Site Title")}))});n(37);Object(o.registerBlockType)("a8c/site-title",{title:Object(i.__)("Site Title"),description:Object(i.__)("Your site title."),icon:"layout",category:"layout",supports:{align:["wide","full"],html:!1,multiple:!1,reusable:!1},attributes:{align:{type:"string",default:"wide"}},edit:V,save:function(){return null}});var G=n(7),W=n(11),K=n(25),Q=(n(18),Object(d.compose)(Object(d.withState)({templateClientId:null}),Object(x.withSelect)(function(t,e){var n=e.attributes,r=e.templateClientId,o=t("core").getEntityRecord,i=t("core/editor"),c=i.getCurrentPostId,a=i.isEditedPostDirty,l=t("core/block-editor"),s=l.getBlock,u=l.getSelectedBlock,p=t("core/edit-post").isEditorSidebarOpened,d=n.templateId,f=c(),b=d&&o("postType","wp_template_part",d),m=Object(K.addQueryArgs)(fullSiteEditing.editTemplateBaseUrl,{post:d,fse_parent_post:f}),O=u();return{currentPostId:f,editTemplateUrl:m,template:b,templateBlock:s(r),templateTitle:Object(G.get)(b,["title","rendered"],""),isDirty:a(),isEditorSidebarOpened:!!p(),isAnyTemplateBlockSelected:O&&"a8c/template"===O.name}}),Object(x.withDispatch)(function(t,e){var n=t("core/block-editor").receiveBlocks,r=t("core/edit-post").openGeneralSidebar,i=e.template,c=e.templateClientId,a=e.setState;return{savePost:t("core/editor").savePost,receiveTemplateBlocks:function(){if(i&&!c){var t=Object(o.parse)(Object(G.get)(i,["content","raw"],"")),e=Object(o.createBlock)("core/group",{},t);n([e]),a({templateClientId:e.clientId})}},openGeneralSidebar:r}}))(function(t){var e,n=t.attributes,o=t.editTemplateUrl,c=t.receiveTemplateBlocks,a=t.template,l=t.templateBlock,s=t.templateTitle,u=t.isDirty,p=t.savePost,d=t.isEditorSidebarOpened,f=t.openGeneralSidebar,b=t.isAnyTemplateBlockSelected;if(!a)return Object(r.createElement)(W.Placeholder,null,Object(r.createElement)(W.Spinner,null));var O=Object(r.createRef)(),g=Object(r.useState)(!1),v=F()(g,2),y=v[0],h=v[1];Object(r.useEffect)(function(){y&&!u&&O.current.click(),c()}),Object(r.useEffect)(function(){var t=document.querySelector(".edit-post-sidebar__panel-tabs ul li:last-child");if(d&&t){if(b)return f("edit-post/document"),void t.classList.add("hidden");t.classList.remove("hidden")}},[b,d,f]);var j=n.align,E=n.className;return Object(r.createElement)("div",{className:P()("template-block",(e={},m()(e,"align".concat(j),j),m()(e,"is-navigating-to-template",y),e))},l&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(W.Disabled,null,Object(r.createElement)("div",{className:E},Object(r.createElement)(T.BlockEdit,{attributes:l.attributes,block:l,clientId:l.clientId,isSelected:!1,name:l.name,setAttributes:G.noop}))),Object(r.createElement)(W.Placeholder,{className:"template-block__overlay"},y&&Object(r.createElement)("div",{className:"template-block__loading"},Object(r.createElement)(W.Spinner,null)," ",Object(i.sprintf)(Object(i.__)("Loading %s Editor"),s)),Object(r.createElement)(W.Button,{className:y?"hidden":null,href:o,onClick:function(t){h(!0),u&&(t.preventDefault(),p())},isDefault:!0,isLarge:!0,ref:O},Object(i.sprintf)(Object(i.__)("Edit %s"),s)))))})),Y=Object(d.createHigherOrderComponent)(function(t){return function(e){return"fse-site-logo"!==e.attributes.className?Object(r.createElement)(t,e):Object(r.createElement)(t,p()({},e,{className:"template__site-logo"}))}},"addFSESiteLogoClassname");Object(f.addFilter)("editor.BlockListBlock","full-site-editing/blocks/template",Y),"wp_template_part"!==fullSiteEditing.editorPostType&&Object(o.registerBlockType)("a8c/template",{title:Object(i.__)("Template Part"),description:Object(i.__)("Display a Template Part."),icon:"layout",category:"layout",attributes:{templateId:{type:"number"},className:{type:"string"}},supports:{anchor:!1,customClassName:!1,html:!1,inserter:!1,reusable:!1},edit:Q,save:function(){return null},getEditWrapperProps:function(){return{"data-align":"full"}}});var J=Object(d.createHigherOrderComponent)(function(t){return function(e){return"a8c/template"!==e.name?Object(r.createElement)(t,e):Object(r.createElement)(t,p()({},e,{className:"template__block-container"}))}},"addFSETemplateClassname");Object(f.addFilter)("editor.BlockListBlock","full-site-editing/blocks/template",J,9);var X=n(13),Z=n.n(X);Z()(function(){var t=fullSiteEditing,e=t.closeButtonLabel,n=t.closeButtonUrl,r=t.editorPostType,o=setInterval(function(){var t=document.querySelector(".edit-post-fullscreen-mode-close__toolbar a");if(t&&(clearInterval(o),"wp_template_part"===r&&n)){var i=document.createElement("a");i.href=n,i.innerHTML=e,i.className="components-button components-icon-button is-button is-default",i.setAttribute("aria-label",e),document.querySelector(".edit-post-fullscreen-mode-close__toolbar").replaceChild(i,t)}})});var $=n(26),tt=n.n($),et=n(27),nt=Object(x.withSelect)(function(t){var e=t("core").getEntityRecord,n=t("core/editor").getEditedPostAttribute;return{templateClasses:Object(G.map)(n("template_part_types"),function(t){var n=Object(G.get)(e("taxonomy","wp_template_part_type",t),"name","");return Object(G.endsWith)(n,"-header")?"site-header site-branding":Object(G.endsWith)(n,"-footer")?"site-footer":void 0})}})(function(t){var e=t.templateClasses,n=setInterval(function(){var t=document.querySelector(".block-editor-writing-flow.editor-writing-flow > div");t&&(clearInterval(n),t.className=P.a.apply(void 0,["a8c-template-editor"].concat(tt()(e))))});return null});"wp_template_part"===fullSiteEditing.editorPostType&&Object(et.registerPlugin)("fse-editor-template-classes",{render:nt}),Z()(function(){"wp_template_part"===fullSiteEditing.editorPostType&&Object(x.dispatch)("core/notices").createNotice("info",Object(i.__)("Updates to this template will affect all pages on your site."),{isDismissible:!1})});var rt=Object(d.compose)(Object(x.withSelect)(function(t){var e=t("core/editor"),n=e.getBlocks,r=e.getEditorSettings,o=t("core/edit-post").getEditorMode,i=n().find(function(t){return"a8c/post-content"===t.name});return{rootClientId:i?i.clientId:"",showInserter:"visual"===o()&&r().richEditingEnabled}}))(function(t){var e=t.rootClientId,n=t.showInserter;return Object(r.createElement)(T.Inserter,{rootClientId:e,disabled:!n,position:"bottom right"})});Z()(function(){return function(){if("page"===fullSiteEditing.editorPostType)var t=setInterval(function(){var e=document.querySelector(".edit-post-header-toolbar");if(e){clearInterval(t);var n=document.createElement("div");n.classList.add("fse-post-content-block-inserter"),e.insertBefore(n,e.firstChild),Object(r.render)(Object(r.createElement)(rt,null),n)}})}()});var ot=Object(x.subscribe)(function(){if("page"!==fullSiteEditing.editorPostType)return ot();!1===Object(x.select)("core/editor").isValidTemplate()&&Object(x.dispatch)("core/editor").setTemplateValidity(!0)}),it=["logo","brand","emblem","hallmark"];Object(f.addFilter)("blocks.registerBlockType","full-site-editing/editor/image-block-keywords",function(t,e){return"core/image"!==e?t:t=Object(G.assign)({},t,{keywords:t.keywords.concat(it)})});n(41);Object(x.use)(function(t){return{dispatch:function(e){var n=L()({},t.dispatch(e)),r=fullSiteEditing.editorPostType;return"core/editor"===e&&n.trashPost&&"wp_template_part"===r&&(n.trashPost=function(){}),n}}}),Object(x.use)(function(t){return{dispatch:function(e){var n=L()({},t.dispatch(e)),r=fullSiteEditing.editorPostType;if("core/editor"===e&&n.editPost&&"wp_template_part"===r){var o=n.editPost;n.editPost=function(t){"draft"!==t.status&&o(t)}}return n}}});var ct=Object(x.subscribe)(function(){var t=Object(x.dispatch)("core/edit-post").removeEditorPanel;return"page"===fullSiteEditing.editorPostType&&t("featured-image"),"wp_template_part"===fullSiteEditing.editorPostType&&t("post-status"),ct()})}])); -
full-site-editing/trunk/full-site-editing/dist/full-site-editing.rtl.css
r2152004 r2168427 1 .wp-block-a8c-navigation-menu.main-navigation{pointer-events:none}.post-content-block.alignfull{padding:0 12px} .post-content-block__selector{width:300px}.post-content-block__selector a{font-family:sans-serif;font-size:13px;padding-right:8px}.post-content-block__preview{pointer-events:none}.post-content-block__preview:after{content:"";clear:both;display:table}.post-content-block .editor-post-title,.show-post-title-before-content .editor-post-title{display:none}.show-post-title-before-content .post-content-block .editor-post-title{display:block}.post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{max-width:calc(100vw - 81px);margin-right:3px;margin-left:3px}.block-editor-block-list__layout .post-content__block.is-selected .block-editor-block-contextual-toolbar{display:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit:before{transition:none;border:none;outline:none;box-shadow:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb{display:none}.block-editor .wp-block-a8c-site-description:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-ms-input-placeholder{color:transparent}.block-editor .wp-block-a8c-site-title:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-ms-input-placeholder{color:transparent}.template-block{min-height:200px;overflow:hidden;position:relative}.template__block-container.is-hovered{cursor:pointer}.template__block-container.is-hovered .components-disabled,.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled{filter:blur(2px);transition:filter .2s linear .7s}.template__block-container.is-hovered .template-block__overlay,.template__block-container .is-navigating-to-template .template-block__overlay,.template__block-container.is-selected .template-block__overlay{opacity:1;transition:opacity .2s linear}.template__block-container.is-hovered .template-block__overlay .components-button,.template__block-container .is-navigating-to-template .template-block__overlay .components-button,.template__block-container.is-selected .template-block__overlay .components-button{opacity:1;transition:opacity .2s linear .7s}.template__block-container .components-disabled{filter:blur(0);transition:filter .2s linear 0s}.template__block-container .block-editor-block-contextual-toolbar,.template__block-container .block-editor-block-list__block-edit:before,.template__block-container .block-editor-block-list__block-mobile-toolbar,.template__block-container .block-editor-block-list__breadcrumb,.template__block-container .block-editor-block-list__insertion-point{display:none}.template-block__overlay{background:hsla(0,0%,100%,.8);border:0 solid rgba(123,134,162,.3);bottom:0;right:0;margin:0;opacity:0;padding:0;position:absolute;left:0;transition:opacity .2s linear 0s;top:0;z-index:2}.is-selected .template-block__overlay{border-color:rgba(66,88,99,.4)}.editor-block-list__block:first-child .template-block__overlay{border-bottom-width:1px}.editor-block-list__block:last-child .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template-block__overlay{border-width:1px}}.template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s}.template-block__overlay .components-button.hidden{display:none}.template-block__loading{display:flex;align-items:center;color:#191e23}.block-editor-page:not(.post-type-wp_template) .fse-site-logo .components-placeholder__fieldset,.block-editor-page:not(.post-type-wp_template) .fse-site-logo .components-placeholder__instructions{display:none}.edit-post-fullscreen-mode-close__toolbar a.is-button.is-default{height:auto}.edit-post-fullscreen-mode-close__toolbar a.is-button.is-default span{display:none}.edit-post-fullscreen-mode-close__toolbar a.a8c-close-button{padding:4px}.post-type-wp_template .edit-post-post-status,.post-type-wp_template .editor-post-title,.post-type-wp_template .editor-post-trash{display:none}.post-type-wp_template .edit-post-visual-editor{margin-top:20px;padding-top:0}.post-type-wp_template .editor-post-switch-to-draft{display:none}.post-type-page .edit-post-layout__content,.post-type-wp_template .edit-post-layout__content{background:#eee}.post-type-page .edit-post-layout__content .edit-post-visual-editor,.post-type-wp_template .edit-post-layout__content .edit-post-visual-editor{flex:none;margin:36px 32px;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 (max-width:768px){.post-type-page .edit-post-layout__content .edit-post-visual-editor,.post-type-wp_template .edit-post-layout__content .edit-post-visual-editor{margin:0}}.post-type-page .editor-writing-flow__click-redirect,.post-type-wp_template.editor-writing-flow__click-redirect{display:none}.editor-styles-wrapper{background:#fff}.post-type-page .edit-post-visual-editor{padding-top:0}.post-type-page .block-editor-writing-flow{display:block}.post-type-page .wp-block.template__block-container [data-block]{margin:0}1 .wp-block-a8c-navigation-menu.main-navigation{pointer-events:none}.post-content-block.alignfull{padding:0 12px}@media (max-width:768px){.post-content-block.alignfull{overflow-x:hidden}}.post-content-block__selector{width:300px}.post-content-block__selector a{font-family:sans-serif;font-size:13px;padding-right:8px}.post-content-block__preview{pointer-events:none}.post-content-block__preview:after{content:"";clear:both;display:table}.post-content-block .editor-post-title,.show-post-title-before-content .editor-post-title{display:none}.show-post-title-before-content .post-content-block .editor-post-title{display:block}@media (max-width:768px){.post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{max-width:768px;margin-right:0;margin-left:0}.post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full] .block-editor-block-mover{right:60px}}@media (min-width:768px){.post-content-block .block-editor-block-list__layout .block-editor-block-list__block[data-align=full]{max-width:calc(100vw - 81px);margin-right:3px;margin-left:3px}}.block-editor-block-list__layout .post-content__block.is-selected .block-editor-block-contextual-toolbar{display:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit:before,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit:before{transition:none;border:none;outline:none;box-shadow:none}.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.has-child-selected>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-hovered>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block.is-navigate-mode>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb,.block-editor-block-list__layout .post-content__block.block-editor-block-list__block>.block-editor-block-list__block-edit>.block-editor-block-list__breadcrumb{display:none}.block-editor .wp-block-a8c-site-description:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-description::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-description:-ms-input-placeholder{color:transparent}.block-editor .wp-block-a8c-site-title:focus{box-shadow:none;background-color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-webkit-input-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-moz-placeholder,.block-editor .wp-block.is-selected .wp-block-a8c-site-title::-moz-placeholder{color:transparent}.block-editor .wp-block.is-selected .wp-block-a8c-site-title:-ms-input-placeholder{color:transparent}.template-block{min-height:200px;overflow:hidden;position:relative}.template__block-container.is-hovered{cursor:pointer}.template__block-container.is-hovered .components-disabled,.template__block-container .is-navigating-to-template .components-disabled,.template__block-container.is-selected .components-disabled{filter:blur(2px);transition:filter .2s linear .7s}.template__block-container.is-hovered .template-block__overlay,.template__block-container .is-navigating-to-template .template-block__overlay,.template__block-container.is-selected .template-block__overlay{opacity:1;transition:opacity .2s linear}.template__block-container.is-hovered .template-block__overlay .components-button,.template__block-container .is-navigating-to-template .template-block__overlay .components-button,.template__block-container.is-selected .template-block__overlay .components-button{opacity:1;transition:opacity .2s linear .7s}.template__block-container .components-disabled{filter:blur(0);transition:filter .2s linear 0s}.template__block-container .block-editor-block-contextual-toolbar,.template__block-container .block-editor-block-list__block-edit:before,.template__block-container .block-editor-block-list__block-mobile-toolbar,.template__block-container .block-editor-block-list__breadcrumb,.template__block-container .block-editor-block-list__insertion-point{display:none}.template-block__overlay{background:hsla(0,0%,100%,.8);border:0 solid rgba(123,134,162,.3);bottom:0;right:0;margin:0;opacity:0;padding:0;position:absolute;left:0;transition:opacity .2s linear 0s;top:0;z-index:2}.is-selected .template-block__overlay{border-color:rgba(66,88,99,.4)}.editor-block-list__block:first-child .template-block__overlay{border-bottom-width:1px}.editor-block-list__block:last-child .template-block__overlay{border-top-width:1px}@media only screen and (min-width:768px){.template-block__overlay{border-width:1px}}.template-block__overlay .components-button{opacity:0;transition:opacity .2s linear 0s}.template-block__overlay .components-button.hidden{display:none}.template-block__loading{display:flex;align-items:center;color:#191e23}.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__fieldset,.block-editor-page:not(.post-type-wp_template_part) .fse-site-logo .components-placeholder__instructions,.post-type-wp_template_part .edit-post-post-status,.post-type-wp_template_part .editor-post-title,.post-type-wp_template_part .editor-post-trash{display:none}.post-type-wp_template_part .edit-post-visual-editor{margin-top:20px;padding-top:0}.post-type-wp_template_part .editor-post-switch-to-draft{display:none}@media (min-width:768px){.post-type-page .edit-post-layout__content,.post-type-wp_template_part .edit-post-layout__content{background:#eee}.post-type-page .edit-post-layout__content .edit-post-visual-editor,.post-type-wp_template_part .edit-post-layout__content .edit-post-visual-editor{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);flex:none;margin:36px 32px}}.post-type-page .editor-writing-flow__click-redirect,.post-type-wp_template_part .editor-writing-flow__click-redirect{display:none}.editor-styles-wrapper{background:#fff}.post-type-page .edit-post-visual-editor{padding-top:0}.post-type-page .block-editor-writing-flow{display:block}.post-type-page .wp-block.template__block-container [data-block]{margin:0} -
full-site-editing/trunk/full-site-editing/editor/remove-editor-panels/index.js
r2152004 r2168427 25 25 // https://github.com/WordPress/gutenberg/pull/17117 26 26 // When support is added, we should remove the CSS hack at '../style.scss' 27 if ( 'wp_template ' === fullSiteEditing.editorPostType ) {27 if ( 'wp_template_part' === fullSiteEditing.editorPostType ) { 28 28 removeEditorPanel( 'post-status' ); 29 29 } -
full-site-editing/trunk/full-site-editing/editor/style.scss
r2152004 r2168427 1 .post-type-wp_template {1 .post-type-wp_template_part { 2 2 .editor-post-title, 3 3 .editor-post-trash { … … 21 21 } 22 22 23 .post-type-page, .post-type-wp_template { 24 .edit-post-layout__content { 25 background: #eee; 26 } 23 .post-type-page, .post-type-wp_template_part { 24 @media ( min-width: 768px ) { 25 .edit-post-layout__content { 26 background: #eee; 27 } 27 28 28 .edit-post-layout__content .edit-post-visual-editor { 29 flex: none; 30 margin: 36px 32px; 31 box-shadow: 0 2px 2px 0 rgba( 0, 0, 0, 0.14 ), 0 3px 1px -2px rgba( 0, 0, 0, 0.12 ), 0 1px 5px 0 rgba( 0, 0, 0, 0.2 ); 32 33 @media ( max-width: 768px ) { 34 margin: 0; 29 .edit-post-layout__content .edit-post-visual-editor { 30 box-shadow: 0 2px 2px 0 rgba( 0, 0, 0, 0.14 ), 0 3px 1px -2px rgba( 0, 0, 0, 0.12 ), 0 1px 5px 0 rgba( 0, 0, 0, 0.2 ); 31 flex: none; 32 margin: 36px 32px; 35 33 } 36 34 } -
full-site-editing/trunk/full-site-editing/editor/suppress-draft-action/index.js
r2152004 r2168427 13 13 const { editorPostType } = fullSiteEditing; 14 14 15 if ( namespace === 'core/editor' && actions.editPost && editorPostType === 'wp_template' ) { 15 if ( 16 namespace === 'core/editor' && 17 actions.editPost && 18 editorPostType === 'wp_template_part' 19 ) { 16 20 const originalEditPost = actions.editPost; 17 21 -
full-site-editing/trunk/full-site-editing/editor/suppress-trash-action/index.js
r2152004 r2168427 13 13 const { editorPostType } = fullSiteEditing; 14 14 15 if ( namespace === 'core/editor' && actions.trashPost && editorPostType === 'wp_template' ) { 15 if ( 16 namespace === 'core/editor' && 17 actions.trashPost && 18 editorPostType === 'wp_template_part' 19 ) { 16 20 actions.trashPost = () => {}; 17 21 } -
full-site-editing/trunk/full-site-editing/plugins/close-button-override/index.js
r2140780 r2168427 5 5 */ 6 6 import domReady from '@wordpress/dom-ready'; 7 8 /**9 * Internal dependencies10 */11 import './style.scss';12 7 13 8 domReady( () => { … … 23 18 24 19 // When closing Template CPT (e.g. header) to navigate back to parent page. 25 if ( 'wp_template ' === editorPostType && closeButtonUrl ) {20 if ( 'wp_template_part' === editorPostType && closeButtonUrl ) { 26 21 const newCloseButton = document.createElement( 'a' ); 27 22 newCloseButton.href = closeButtonUrl; … … 32 27 const parentContainer = document.querySelector( '.edit-post-fullscreen-mode-close__toolbar' ); 33 28 parentContainer.replaceChild( newCloseButton, closeButton ); 34 } else {35 // Otherwise just replace the left caret with an X icon.36 // The size is 28 instead of 20 because `dashicons-no-alt` looks smaller than `dashicons-arrow-left-alt2`.37 closeButton.innerHTML =38 '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="28" height="28" viewBox="0 0 20 20"><path d="M14.95 6.46l-3.54 3.54 3.54 3.54-1.41 1.41-3.54-3.53-3.53 3.53-1.42-1.42 3.53-3.53-3.53-3.53 1.42-1.42 3.53 3.53 3.54-3.53z"></path></svg>';39 closeButton.classList.add( 'a8c-close-button' );40 29 } 41 30 } ); -
full-site-editing/trunk/full-site-editing/plugins/editor-template-classes/index.js
r2152004 r2168427 15 15 const { getEntityRecord } = select( 'core' ); 16 16 const { getEditedPostAttribute } = select( 'core/editor' ); 17 const templateClasses = map( getEditedPostAttribute( 'template_types' ), typeId => { 18 const typeName = get( getEntityRecord( 'taxonomy', 'wp_template_type', typeId ), 'name', '' ); 17 const templateClasses = map( getEditedPostAttribute( 'template_part_types' ), typeId => { 18 const typeName = get( 19 getEntityRecord( 'taxonomy', 'wp_template_part_type', typeId ), 20 'name', 21 '' 22 ); 19 23 if ( endsWith( typeName, '-header' ) ) { 20 24 return 'site-header site-branding'; … … 42 46 } ); 43 47 44 if ( 'wp_template ' === fullSiteEditing.editorPostType ) {48 if ( 'wp_template_part' === fullSiteEditing.editorPostType ) { 45 49 registerPlugin( 'fse-editor-template-classes', { 46 50 render: EditorTemplateClasses, -
full-site-editing/trunk/full-site-editing/plugins/template-update-notice/index.js
r2140780 r2168427 8 8 9 9 domReady( () => { 10 if ( 'wp_template ' !== fullSiteEditing.editorPostType ) {10 if ( 'wp_template_part' !== fullSiteEditing.editorPostType ) { 11 11 return; 12 12 } -
full-site-editing/trunk/full-site-editing/templates/class-wp-template-inserter.php
r2140780 r2168427 83 83 84 84 if ( ! $response ) { 85 do_action( 86 'a8c_fse_log', 87 'template_population_failure', 88 [ 89 'context' => 'WP_Template_Inserter->fetch_template_parts', 90 'error' => 'Fetch retry timeout', 91 'theme_slug' => $this->theme_slug, 92 ] 93 ); 94 $this->header_content = $this->get_default_header(); 95 $this->footer_content = $this->get_default_footer(); 85 96 return; 86 97 } … … 126 137 127 138 /** 139 * Returns a default header if call to template api fails for some reason. 140 * 141 * @return string Content of a default header 142 */ 143 public function get_default_header() { 144 return '<!-- wp:a8c/site-description /--> 145 <!-- wp:a8c/site-title /--> 146 <!-- wp:a8c/navigation-menu /-->'; 147 } 148 149 /** 150 * Returns a default footer if call to template api fails for some reason. 151 * 152 * @return string Content of a default footer 153 */ 154 public function get_default_footer() { 155 return '<!-- wp:a8c/navigation-menu /-->'; 156 } 157 158 /** 128 159 * Determines whether FSE data has already been inserted. 129 160 * … … 138 169 */ 139 170 public function insert_default_template_data() { 171 do_action( 172 'a8c_fse_log', 173 'before_template_population', 174 [ 175 'context' => 'WP_Template_Inserter->insert_default_template_data', 176 'theme_slug' => $this->theme_slug, 177 ] 178 ); 179 140 180 if ( $this->is_template_data_inserted() ) { 141 181 /* … … 143 183 * Multiple themes will still be able to insert different templates. 144 184 */ 185 do_action( 186 'a8c_fse_log', 187 'template_population_failure', 188 [ 189 'context' => 'WP_Template_Inserter->insert_default_template_data', 190 'error' => 'Data already exist', 191 'theme_slug' => $this->theme_slug, 192 ] 193 ); 145 194 return; 146 195 } … … 161 210 'post_content' => $this->header_content, 162 211 'post_status' => 'publish', 163 'post_type' => 'wp_template ',212 'post_type' => 'wp_template_part', 164 213 'comment_status' => 'closed', 165 214 'ping_status' => 'closed', … … 167 216 ); 168 217 169 if ( ! term_exists( "$this->theme_slug-header", 'wp_template_ type' ) ) {170 wp_insert_term( "$this->theme_slug-header", 'wp_template_ type' );171 } 172 173 wp_set_object_terms( $header_id, "$this->theme_slug-header", 'wp_template_ type' );218 if ( ! term_exists( "$this->theme_slug-header", 'wp_template_part_type' ) ) { 219 wp_insert_term( "$this->theme_slug-header", 'wp_template_part_type' ); 220 } 221 222 wp_set_object_terms( $header_id, "$this->theme_slug-header", 'wp_template_part_type' ); 174 223 175 224 $footer_id = wp_insert_post( … … 178 227 'post_content' => $this->footer_content, 179 228 'post_status' => 'publish', 180 'post_type' => 'wp_template ',229 'post_type' => 'wp_template_part', 181 230 'comment_status' => 'closed', 182 231 'ping_status' => 'closed', … … 184 233 ); 185 234 186 if ( ! term_exists( "$this->theme_slug-footer", 'wp_template_ type' ) ) {187 wp_insert_term( "$this->theme_slug-footer", 'wp_template_ type' );188 } 189 190 wp_set_object_terms( $footer_id, "$this->theme_slug-footer", 'wp_template_ type' );235 if ( ! term_exists( "$this->theme_slug-footer", 'wp_template_part_type' ) ) { 236 wp_insert_term( "$this->theme_slug-footer", 'wp_template_part_type' ); 237 } 238 239 wp_set_object_terms( $footer_id, "$this->theme_slug-footer", 'wp_template_part_type' ); 191 240 192 241 add_option( $this->fse_template_data_option, true ); 242 243 do_action( 244 'a8c_fse_log', 245 'template_population_success', 246 [ 247 'context' => 'WP_Template_Inserter->insert_default_template_data', 248 'theme_slug' => $this->theme_slug, 249 ] 250 ); 193 251 } 194 252 … … 209 267 */ 210 268 public function insert_default_pages() { 269 do_action( 270 'a8c_fse_log', 271 'before_pages_population', 272 [ 273 'context' => 'WP_Template_Inserter->insert_default_pages', 274 'theme_slug' => $this->theme_slug, 275 ] 276 ); 277 211 278 // Bail if this data has already been inserted. 212 279 if ( $this->is_pages_data_inserted() ) { 280 do_action( 281 'a8c_fse_log', 282 'pages_population_failure', 283 [ 284 'context' => 'WP_Template_Inserter->insert_default_pages', 285 'error' => 'Data already exist', 286 'theme_slug' => $this->theme_slug, 287 ] 288 ); 213 289 return; 214 290 } … … 224 300 225 301 if ( ! $response ) { 302 do_action( 303 'a8c_fse_log', 304 'pages_population_failure', 305 [ 306 'context' => 'WP_Template_Inserter->insert_default_pages', 307 'error' => 'Fetch retry timeout', 308 'theme_slug' => $this->theme_slug, 309 ] 310 ); 226 311 return; 227 312 } … … 229 314 $api_response = json_decode( wp_remote_retrieve_body( $response ), true ); 230 315 231 $about_page_content = ''; 232 $contact_page_content = ''; 233 234 /* 235 * Array of returned templates is not keyed by name, so we have to access it directly like this. 236 * About page is at position 6 in the array, and Contact page at 1. 237 */ 238 if ( ! empty( $api_response['templates'][6]['content'] ) ) { 239 $about_page_content = $api_response['templates'][6]['content']; 240 } 241 242 if ( ! empty( $api_response['templates'][1]['content'] ) ) { 243 $contact_page_content = $api_response['templates'][1]['content']; 244 } 245 246 if ( empty( get_page_by_title( 'About' ) ) ) { 316 // Convert templates response to [ slug => content ] pairs to extract required content more easily. 317 $template_content_by_slug = wp_list_pluck( $api_response['templates'], 'content', 'slug' ); 318 319 if ( empty( get_page_by_title( 'About' ) ) && ! empty( $template_content_by_slug['about'] ) ) { 247 320 wp_insert_post( 248 321 [ 249 322 'post_title' => _x( 'About', 'Default page title', 'full-site-editing' ), 250 'post_content' => $ about_page_content,323 'post_content' => $template_content_by_slug['about'], 251 324 'post_status' => 'publish', 252 325 'post_type' => 'page', … … 255 328 } 256 329 257 if ( empty( get_page_by_title( 'Contact' ) ) ) {330 if ( empty( get_page_by_title( 'Contact' ) ) && ! empty( $template_content_by_slug['contact'] ) ) { 258 331 wp_insert_post( 259 332 [ 260 333 'post_title' => _x( 'Contact', 'Default page title', 'full-site-editing' ), 261 'post_content' => $ contact_page_content,334 'post_content' => $template_content_by_slug['contact'], 262 335 'post_status' => 'publish', 263 336 'post_type' => 'page', … … 267 340 268 341 update_option( $this->fse_page_data_option, true ); 342 343 do_action( 344 'a8c_fse_log', 345 'pages_population_success', 346 [ 347 'context' => 'WP_Template_Inserter->insert_default_pages', 348 'theme_slug' => $this->theme_slug, 349 ] 350 ); 269 351 } 270 352 … … 291 373 public function register_template_post_types() { 292 374 register_post_type( 293 'wp_template ',375 'wp_template_part', 294 376 array( 295 377 'labels' => array( 296 'name' => _x( 'Template s', 'post type general name', 'full-site-editing' ),297 'singular_name' => _x( 'Template ', 'post type singular name', 'full-site-editing' ),298 'menu_name' => _x( 'Template s', 'admin menu', 'full-site-editing' ),299 'name_admin_bar' => _x( 'Template ', 'add new on admin bar', 'full-site-editing' ),378 'name' => _x( 'Template Parts', 'post type general name', 'full-site-editing' ), 379 'singular_name' => _x( 'Template Part', 'post type singular name', 'full-site-editing' ), 380 'menu_name' => _x( 'Template Parts', 'admin menu', 'full-site-editing' ), 381 'name_admin_bar' => _x( 'Template Part', 'add new on admin bar', 'full-site-editing' ), 300 382 'add_new' => _x( 'Add New', 'Template', 'full-site-editing' ), 301 'add_new_item' => __( 'Add New Template ', 'full-site-editing' ),302 'new_item' => __( 'New Template ', 'full-site-editing' ),303 'edit_item' => __( 'Edit Template ', 'full-site-editing' ),304 'view_item' => __( 'View Template ', 'full-site-editing' ),305 'all_items' => __( 'All Template s', 'full-site-editing' ),306 'search_items' => __( 'Search Template s', 'full-site-editing' ),307 'not_found' => __( 'No template s found.', 'full-site-editing' ),308 'not_found_in_trash' => __( 'No template s found in Trash.', 'full-site-editing' ),309 'filter_items_list' => __( 'Filter template s list', 'full-site-editing' ),310 'items_list_navigation' => __( 'Template s list navigation', 'full-site-editing' ),311 'items_list' => __( 'Template s list', 'full-site-editing' ),312 'item_published' => __( 'Template p ublished.', 'full-site-editing' ),313 'item_published_privately' => __( 'Template p ublished privately.', 'full-site-editing' ),314 'item_reverted_to_draft' => __( 'Template reverted to draft.', 'full-site-editing' ),315 'item_scheduled' => __( 'Template scheduled.', 'full-site-editing' ),316 'item_updated' => __( 'Template updated.', 'full-site-editing' ),383 'add_new_item' => __( 'Add New Template Part', 'full-site-editing' ), 384 'new_item' => __( 'New Template Part', 'full-site-editing' ), 385 'edit_item' => __( 'Edit Template Part', 'full-site-editing' ), 386 'view_item' => __( 'View Template Part', 'full-site-editing' ), 387 'all_items' => __( 'All Template Parts', 'full-site-editing' ), 388 'search_items' => __( 'Search Template Parts', 'full-site-editing' ), 389 'not_found' => __( 'No template parts found.', 'full-site-editing' ), 390 'not_found_in_trash' => __( 'No template parts found in Trash.', 'full-site-editing' ), 391 'filter_items_list' => __( 'Filter template parts list', 'full-site-editing' ), 392 'items_list_navigation' => __( 'Template parts list navigation', 'full-site-editing' ), 393 'items_list' => __( 'Template parts list', 'full-site-editing' ), 394 'item_published' => __( 'Template part published.', 'full-site-editing' ), 395 'item_published_privately' => __( 'Template part published privately.', 'full-site-editing' ), 396 'item_reverted_to_draft' => __( 'Template part reverted to draft.', 'full-site-editing' ), 397 'item_scheduled' => __( 'Template part scheduled.', 'full-site-editing' ), 398 'item_updated' => __( 'Template part updated.', 'full-site-editing' ), 317 399 ), 318 400 'menu_icon' => 'dashicons-layout', … … 322 404 'rewrite' => false, 323 405 'show_in_rest' => true, // Otherwise previews won't be generated in full page view. 324 'rest_base' => 'template s',406 'rest_base' => 'template_parts', 325 407 'rest_controller_class' => __NAMESPACE__ . '\REST_Templates_Controller', 326 'capability_type' => 'template ',408 'capability_type' => 'template_part', 327 409 'capabilities' => array( 328 410 // You need to be able to edit posts, in order to read templates in their raw form. … … 348 430 349 431 register_taxonomy( 350 'wp_template_ type',351 'wp_template ',432 'wp_template_part_type', 433 'wp_template_part', 352 434 array( 353 435 'labels' => array( 354 'name' => _x( 'Template Types', 'taxonomy general name', 'full-site-editing' ),355 'singular_name' => _x( 'Template Type', 'taxonomy singular name', 'full-site-editing' ),356 'menu_name' => _x( 'Template Types', 'admin menu', 'full-site-editing' ),357 'all_items' => __( 'All Template Types', 'full-site-editing' ),358 'edit_item' => __( 'Edit Template Type', 'full-site-editing' ),359 'view_item' => __( 'View Template Type', 'full-site-editing' ),360 'update_item' => __( 'Update Template Type', 'full-site-editing' ),361 'add_new_item' => __( 'Add New Template Type', 'full-site-editing' ),362 'new_item_name' => __( 'New Template Type', 'full-site-editing' ),363 'parent_item' => __( 'Parent Template Type', 'full-site-editing' ),364 'parent_item_colon' => __( 'Parent Template Type:', 'full-site-editing' ),365 'search_items' => __( 'Search Template Types', 'full-site-editing' ),366 'not_found' => __( 'No template types found.', 'full-site-editing' ),367 'back_to_items' => __( 'Back to template types', 'full-site-editing' ),436 'name' => _x( 'Template Part Types', 'taxonomy general name', 'full-site-editing' ), 437 'singular_name' => _x( 'Template Part Type', 'taxonomy singular name', 'full-site-editing' ), 438 'menu_name' => _x( 'Template Part Types', 'admin menu', 'full-site-editing' ), 439 'all_items' => __( 'All Template Part Types', 'full-site-editing' ), 440 'edit_item' => __( 'Edit Template Part Type', 'full-site-editing' ), 441 'view_item' => __( 'View Template Part Type', 'full-site-editing' ), 442 'update_item' => __( 'Update Template Part Type', 'full-site-editing' ), 443 'add_new_item' => __( 'Add New Template Part Type', 'full-site-editing' ), 444 'new_item_name' => __( 'New Template Part Type', 'full-site-editing' ), 445 'parent_item' => __( 'Parent Template Part Type', 'full-site-editing' ), 446 'parent_item_colon' => __( 'Parent Template Part Type:', 'full-site-editing' ), 447 'search_items' => __( 'Search Template Part Types', 'full-site-editing' ), 448 'not_found' => __( 'No template part types found.', 'full-site-editing' ), 449 'back_to_items' => __( 'Back to template part types', 'full-site-editing' ), 368 450 ), 369 451 'public' => false, … … 373 455 'show_in_nav_menu' => false, 374 456 'show_in_rest' => true, 375 'rest_base' => 'template_ types',457 'rest_base' => 'template_part_types', 376 458 'show_tagcloud' => false, 377 459 'hierarchical' => true, -
full-site-editing/trunk/full-site-editing/templates/class-wp-template.php
r2152004 r2168427 94 94 } 95 95 96 $term = get_term_by( 'name', "$this->current_theme_name-$template_type", 'wp_template_ type', ARRAY_A );96 $term = get_term_by( 'name', "$this->current_theme_name-$template_type", 'wp_template_part_type', ARRAY_A ); 97 97 98 98 // Bail if current site doesn't have this term registered. … … 204 204 // 10 priority 205 205 $content = wptexturize( $content ); 206 // @todo maybe look at WPCOM_Responsive_Images for WPCom responsive image handling207 206 208 207 // 11 priority 209 208 $content = do_shortcode( $content ); 210 209 210 $content = prepend_attachment( $content ); 211 212 if ( has_filter( 'a8c_fse_make_content_images_responsive' ) ) { 213 $content = apply_filters( 'a8c_fse_make_content_images_responsive', $content ); 214 } else { 215 $content = wp_make_content_images_responsive( $content ); 216 } 217 211 218 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped 212 219 echo $content; -
full-site-editing/trunk/readme.txt
r2164033 r2168427 4 4 Requires at least: 5.0 5 5 Tested up to: 5.2 6 Stable tag: 0. 7.16 Stable tag: 0.9 7 7 Requires PHP: 5.6.20 8 8 License: GPLv2 or later … … 41 41 == Changelog == 42 42 43 = 0.7.1 = 44 * Passes stylesheet to templates API to get homepage templates for latest themes. 43 = 0.9 = 44 45 * Rename wp_template CPT to wp_template_part. 45 46 46 47 = 0.7 =
Note: See TracChangeset
for help on using the changeset viewer.