Changeset 357429
- Timestamp:
- 11/05/2026 02:07:55 PM (10 hours ago)
- Location:
- nanospace/2.1.0
- Files:
-
- 4 added
- 17 edited
- 1 copied
-
. (copied) (copied from nanospace/2.0.1 )
-
assets/css/woocommerce.css (modified) (1 diff)
-
assets/js/customize-preview-mega.js (added)
-
assets/js/customizer-mega.js (modified) (1 diff)
-
assets/js/editor-layout.js (modified) (1 diff)
-
assets/js/meta-box.js (added)
-
inc/class-customizer.php (modified) (9 diffs)
-
inc/class-global-styles.php (modified) (3 diffs)
-
inc/class-layout.php (modified) (11 diffs)
-
inc/class-mega-menu.php (modified) (4 diffs)
-
inc/class-page-header.php (modified) (9 diffs)
-
inc/class-shop.php (modified) (2 diffs)
-
languages/nanospace.pot (modified) (9 diffs)
-
readme.txt (modified) (1 diff)
-
src/css/woocommerce.css (modified) (1 diff)
-
src/js/customize-preview-mega.js (added)
-
src/js/customizer-mega.js (modified) (3 diffs)
-
src/js/editor-layout.js (modified) (2 diffs)
-
src/js/meta-box.js (added)
-
style.css (modified) (1 diff)
-
template-parts/page-header.php (modified) (2 diffs)
-
woocommerce.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nanospace/2.1.0/assets/css/woocommerce.css
r357206 r357429 1 body{--wc-primary:var(--nanospace-color-accent);--wc-primary-text:var(--nanospace-color-background);--wc-secondary:color-mix(in srgb, var(--nanospace-color-text) 6%, var(--nanospace-color-background));--wc-secondary-text:var(--nanospace-color-text);--wc-highlight:var(--nanospace-color-accent);--wc-highligh-text:var(--nanospace-color-background);--wc-content-bg:var(--nanospace-color-background);--wc-subtext:var(--nanospace-color-muted);--wc-form-border-color:var(--nanospace-color-muted);--wc-form-border-radius:.75rem;--wc-form-color-background:var(--nanospace-color-background);--wc-form-color-text:var(--nanospace-color-text);--wc-separator-color:var(--nanospace-color-border);--wc-card-border-radius:var(--nanospace-radius-card)}.content-area .site-main>.nanospace-shop,.content-area--sidebar-none .entry-content>.woocommerce ,.content-area--sidebar-none .site-main>article:has(>.entry-content>.woocommerce:first-child)>.entry-header{max-inline-size:var(--nanospace-width-wide)}.content-area--sidebar-none .woocommerce-Tabs-panel.entry-content>*{margin-inline:0}.woocommerce ul.products{--nanospace-shop-columns:4;gap:calc(2 * var(--nanospace-space)) var(--nanospace-space);clear:both;grid-template-columns:repeat(2,minmax(0,1fr));display:grid}.woocommerce ul.products.columns-1{--nanospace-shop-columns:1}.woocommerce ul.products.columns-2{--nanospace-shop-columns:2}.woocommerce ul.products.columns-3{--nanospace-shop-columns:3}.woocommerce ul.products.columns-5{--nanospace-shop-columns:5}.woocommerce ul.products.columns-6{--nanospace-shop-columns:6}@media (width>=48rem){.woocommerce ul.products{grid-template-columns:repeat(var(--nanospace-shop-columns), minmax(0, 1fr))}}.woocommerce ul.products:before,.woocommerce ul.products:after{display:none}.woocommerce ul.products[class*=columns-] li.product,.woocommerce-page ul.products[class*=columns-] li.product{float:none;inline-size:auto;margin:0}.woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:var(--nanospace-font-size)}.woocommerce :is(ul.products li.product,div.product) .price{color:var(--nanospace-color-text)}.woocommerce :is(ul.products li.product,div.product) .price del{color:var(--nanospace-color-muted);opacity:1}.woocommerce .price ins{text-decoration:none}.woocommerce span.onsale{background-color:var(--nanospace-color-accent);min-block-size:auto;color:var(--nanospace-color-background);border-radius:var(--nanospace-radius-pill);padding:.25rem .625rem;line-height:1.5}.woocommerce :is(a,button,input).button,.woocommerce #respond input#submit{border-radius:var(--nanospace-radius-pill);background:var(--nanospace-color-pale);color:var(--nanospace-color-text);border:0;padding:.6875rem 1.375rem;font-weight:500;line-height:1.2}.woocommerce :is(a,button,input).button.alt{background:var(--nanospace-color-accent);color:var(--nanospace-color-background)}.woocommerce :is(a,button,input).button:is(:disabled,.disabled){color:var(--nanospace-color-text);padding:.6875rem 1.375rem}.woocommerce :is(form .form-row :is(.input-text,select),.quantity .qty,.woocommerce-ordering select),.woocommerce-page :is(form .form-row :is(.input-text,select),.woocommerce-ordering select){border:1px solid var(--nanospace-color-muted);background-color:var(--nanospace-color-background);color:var(--nanospace-color-text);border-radius:.75rem;padding:.625rem .875rem;line-height:1.2}.woocommerce .quantity .qty{inline-size:4.5em;padding-inline:.5rem}.woocommerce div.product form.cart{flex-wrap:wrap;gap:.5rem;display:flex}.woocommerce div.product form.cart:before,.woocommerce div.product form.cart:after{display:none}.woocommerce div.product form.cart :is(div.quantity,.button){float:none;margin:0}:is(.wc-block-components-text-input input,.wc-block-components-textarea,.wc-blocks-components-select :is(.wc-blocks-components-select__container,.wc-blocks-components-select__select),.wc-block-gateway-container .wc-block-gateway-input){background-color:var(--nanospace-color-background)!important;color:var(--nanospace-color-text)!important}.wc-block-cart:is(.is-mobile,.is-small,.is-medium) table.wc-block-cart-items .wc-block-cart-items__row{grid-template-columns:80px minmax(0,1fr)}.wc-block-cart:is(.is-mobile,.is-small,.is-medium) table.wc-block-cart-items .wc-block-cart-item__quantity{flex-wrap:wrap}.woocommerce form .show-password-input{min-block-size:1.5rem;min-inline-size:1.5rem}:is(.woocommerce-message,.woocommerce-info,.woocommerce-error){border-radius:var(--nanospace-radius-card);background-color:var(--wc-secondary);color:var(--nanospace-color-text)}:is(.woocommerce-message,.woocommerce-info,.woocommerce-error) a:not(.button){color:var(--nanospace-color-accent)}.woocommerce-MyAccount-navigation ul{margin:0 0 var(--nanospace-space);padding:0;list-style:none}.woocommerce-MyAccount-navigation li{border-block-end:1px solid var(--nanospace-color-border)}.woocommerce-MyAccount-navigation a{padding-block:.5rem;text-decoration:none;display:block}.woocommerce-MyAccount-navigation .is-active a{color:var(--nanospace-color-text);font-weight:600}.woocommerce div.product .woocommerce-tabs ul.tabs{border-block-end:1px solid var(--nanospace-color-border);flex-wrap:wrap;gap:.25rem;margin-block-end:var(--nanospace-space);padding:0;display:flex}.woocommerce div.product .woocommerce-tabs ul.tabs:before,.woocommerce div.product .woocommerce-tabs ul.tabs li:before,.woocommerce div.product .woocommerce-tabs ul.tabs li:after{display:none}.woocommerce div.product .woocommerce-tabs ul.tabs li{background:0 0;border:1px solid #0000;border-radius:.375rem .375rem 0 0;margin:0 0 -1px;padding:0}.woocommerce div.product .woocommerce-tabs ul.tabs li a{color:var(--nanospace-color-muted);padding:.625rem 1rem}.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover{text-decoration:underline 1px}.woocommerce div.product .woocommerce-tabs ul.tabs li.active{border-color:var(--nanospace-color-border);border-block-end-color:var(--nanospace-color-background);background:var(--nanospace-color-background)}.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{color:var(--nanospace-color-text)}.woocommerce :is(table.shop_table,table.shop_table :is(td,th),table.shop_attributes,table.shop_attributes :is(td,th),nav.woocommerce-pagination ul,nav.woocommerce-pagination ul li,ul.order_details li,.woocommerce-customer-details address,#reviews #comments ol.commentlist li .comment-text){border-color:var(--nanospace-color-border)}.woocommerce table.shop_attributes tr:nth-child(2n) :is(td,th){background:var(--wc-secondary)}.woocommerce nav.woocommerce-pagination ul li :is(a,span){color:var(--nanospace-color-text)}.woocommerce nav.woocommerce-pagination ul li :is(a:hover,a:focus-visible){text-decoration:underline 1px}.woocommerce nav.woocommerce-pagination ul li span.current{background:var(--wc-secondary);color:var(--nanospace-color-text)}.woocommerce .star-rating:before{color:var(--nanospace-color-border)}.woocommerce :is(small.note,#reviews h2 small,#reviews h2 small a,.woocommerce-breadcrumb),.woocommerce #reviews #comments ol.commentlist li .meta{color:var(--nanospace-color-muted)}:is(.woocommerce-cart,.woocommerce-checkout,#add_payment_method) #payment{border-radius:var(--nanospace-radius-card);background:var(--wc-secondary)}:is(.woocommerce-cart,.woocommerce-checkout,#add_payment_method) #payment div.payment_box{background:var(--nanospace-color-background);color:var(--nanospace-color-text)}:is(.woocommerce-cart,.woocommerce-checkout,#add_payment_method) #payment div.payment_box:before{border-block-end-color:var(--nanospace-color-background)}.woocommerce div.product div.images .woocommerce-product-gallery__trigger{background:var(--nanospace-color-background)}.woocommerce div.product div.images .woocommerce-product-gallery__trigger:before{border-color:var(--nanospace-color-text)}.woocommerce div.product div.images .woocommerce-product-gallery__trigger:after{background:var(--nanospace-color-text)}.nanospace-cart .wc-block-mini-cart__button{min-block-size:2.75rem;min-inline-size:2.75rem;color:inherit}.nanospace-cart .wc-block-mini-cart__button:hover{border-radius:var(--nanospace-radius-pill);background:var(--nanospace-color-pale)}.wc-block-mini-cart__drawer .components-modal__content{background:var(--nanospace-color-background);color:var(--nanospace-color-text)}.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-mini-cart__drawer{visibility:hidden}1 body{--wc-primary:var(--nanospace-color-accent);--wc-primary-text:var(--nanospace-color-background);--wc-secondary:color-mix(in srgb, var(--nanospace-color-text) 6%, var(--nanospace-color-background));--wc-secondary-text:var(--nanospace-color-text);--wc-highlight:var(--nanospace-color-accent);--wc-highligh-text:var(--nanospace-color-background);--wc-content-bg:var(--nanospace-color-background);--wc-subtext:var(--nanospace-color-muted);--wc-form-border-color:var(--nanospace-color-muted);--wc-form-border-radius:.75rem;--wc-form-color-background:var(--nanospace-color-background);--wc-form-color-text:var(--nanospace-color-text);--wc-separator-color:var(--nanospace-color-border);--wc-card-border-radius:var(--nanospace-radius-card)}.content-area .site-main>.nanospace-shop,.content-area--sidebar-none .entry-content>.woocommerce{max-inline-size:var(--nanospace-width-wide)}.content-area--sidebar-none .site-main:has(>.nanospace-shop)>.page-header--band .page-header__text{padding-inline:max(var(--nanospace-space), (100% - var(--nanospace-width-wide)) / 2)}.content-area--sidebar-none .site-main>article:has(>.entry-content>.woocommerce:first-child)>.entry-header{max-inline-size:var(--nanospace-width-wide)}.content-area--sidebar-none .woocommerce-Tabs-panel.entry-content>*{margin-inline:0}.woocommerce ul.products{--nanospace-shop-columns:4;gap:calc(2 * var(--nanospace-space)) var(--nanospace-space);clear:both;grid-template-columns:repeat(2,minmax(0,1fr));display:grid}.woocommerce ul.products.columns-1{--nanospace-shop-columns:1}.woocommerce ul.products.columns-2{--nanospace-shop-columns:2}.woocommerce ul.products.columns-3{--nanospace-shop-columns:3}.woocommerce ul.products.columns-5{--nanospace-shop-columns:5}.woocommerce ul.products.columns-6{--nanospace-shop-columns:6}@media (width>=48rem){.woocommerce ul.products{grid-template-columns:repeat(var(--nanospace-shop-columns), minmax(0, 1fr))}}.woocommerce ul.products:before,.woocommerce ul.products:after{display:none}.woocommerce ul.products[class*=columns-] li.product,.woocommerce-page ul.products[class*=columns-] li.product{float:none;inline-size:auto;margin:0}.woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:var(--nanospace-font-size)}.woocommerce :is(ul.products li.product,div.product) .price{color:var(--nanospace-color-text)}.woocommerce :is(ul.products li.product,div.product) .price del{color:var(--nanospace-color-muted);opacity:1}.woocommerce .price ins{text-decoration:none}.woocommerce span.onsale{background-color:var(--nanospace-color-accent);min-block-size:auto;color:var(--nanospace-color-background);border-radius:var(--nanospace-radius-pill);padding:.25rem .625rem;line-height:1.5}.woocommerce :is(a,button,input).button,.woocommerce #respond input#submit{border-radius:var(--nanospace-radius-pill);background:var(--nanospace-color-pale);color:var(--nanospace-color-text);border:0;padding:.6875rem 1.375rem;font-weight:500;line-height:1.2}.woocommerce :is(a,button,input).button.alt{background:var(--nanospace-color-accent);color:var(--nanospace-color-background)}.woocommerce :is(a,button,input).button:is(:disabled,.disabled){color:var(--nanospace-color-text);padding:.6875rem 1.375rem}.woocommerce :is(form .form-row :is(.input-text,select),.quantity .qty,.woocommerce-ordering select),.woocommerce-page :is(form .form-row :is(.input-text,select),.woocommerce-ordering select){border:1px solid var(--nanospace-color-muted);background-color:var(--nanospace-color-background);color:var(--nanospace-color-text);border-radius:.75rem;padding:.625rem .875rem;line-height:1.2}.woocommerce .quantity .qty{inline-size:4.5em;padding-inline:.5rem}.woocommerce div.product form.cart{flex-wrap:wrap;gap:.5rem;display:flex}.woocommerce div.product form.cart:before,.woocommerce div.product form.cart:after{display:none}.woocommerce div.product form.cart :is(div.quantity,.button){float:none;margin:0}:is(.wc-block-components-text-input input,.wc-block-components-textarea,.wc-blocks-components-select :is(.wc-blocks-components-select__container,.wc-blocks-components-select__select),.wc-block-gateway-container .wc-block-gateway-input){background-color:var(--nanospace-color-background)!important;color:var(--nanospace-color-text)!important}.wc-block-cart:is(.is-mobile,.is-small,.is-medium) table.wc-block-cart-items .wc-block-cart-items__row{grid-template-columns:80px minmax(0,1fr)}.wc-block-cart:is(.is-mobile,.is-small,.is-medium) table.wc-block-cart-items .wc-block-cart-item__quantity{flex-wrap:wrap}.woocommerce form .show-password-input{min-block-size:1.5rem;min-inline-size:1.5rem}:is(.woocommerce-message,.woocommerce-info,.woocommerce-error){border-radius:var(--nanospace-radius-card);background-color:var(--wc-secondary);color:var(--nanospace-color-text)}:is(.woocommerce-message,.woocommerce-info,.woocommerce-error) a:not(.button){color:var(--nanospace-color-accent)}.woocommerce-MyAccount-navigation ul{margin:0 0 var(--nanospace-space);padding:0;list-style:none}.woocommerce-MyAccount-navigation li{border-block-end:1px solid var(--nanospace-color-border)}.woocommerce-MyAccount-navigation a{padding-block:.5rem;text-decoration:none;display:block}.woocommerce-MyAccount-navigation .is-active a{color:var(--nanospace-color-text);font-weight:600}.woocommerce div.product .woocommerce-tabs ul.tabs{border-block-end:1px solid var(--nanospace-color-border);flex-wrap:wrap;gap:.25rem;margin-block-end:var(--nanospace-space);padding:0;display:flex}.woocommerce div.product .woocommerce-tabs ul.tabs:before,.woocommerce div.product .woocommerce-tabs ul.tabs li:before,.woocommerce div.product .woocommerce-tabs ul.tabs li:after{display:none}.woocommerce div.product .woocommerce-tabs ul.tabs li{background:0 0;border:1px solid #0000;border-radius:.375rem .375rem 0 0;margin:0 0 -1px;padding:0}.woocommerce div.product .woocommerce-tabs ul.tabs li a{color:var(--nanospace-color-muted);padding:.625rem 1rem}.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover{text-decoration:underline 1px}.woocommerce div.product .woocommerce-tabs ul.tabs li.active{border-color:var(--nanospace-color-border);border-block-end-color:var(--nanospace-color-background);background:var(--nanospace-color-background)}.woocommerce div.product .woocommerce-tabs ul.tabs li.active a{color:var(--nanospace-color-text)}.woocommerce :is(table.shop_table,table.shop_table :is(td,th),table.shop_attributes,table.shop_attributes :is(td,th),nav.woocommerce-pagination ul,nav.woocommerce-pagination ul li,ul.order_details li,.woocommerce-customer-details address,#reviews #comments ol.commentlist li .comment-text){border-color:var(--nanospace-color-border)}.woocommerce table.shop_attributes tr:nth-child(2n) :is(td,th){background:var(--wc-secondary)}.woocommerce nav.woocommerce-pagination ul li :is(a,span){color:var(--nanospace-color-text)}.woocommerce nav.woocommerce-pagination ul li :is(a:hover,a:focus-visible){text-decoration:underline 1px}.woocommerce nav.woocommerce-pagination ul li span.current{background:var(--wc-secondary);color:var(--nanospace-color-text)}.woocommerce .star-rating:before{color:var(--nanospace-color-border)}.woocommerce :is(small.note,#reviews h2 small,#reviews h2 small a,.woocommerce-breadcrumb),.woocommerce #reviews #comments ol.commentlist li .meta{color:var(--nanospace-color-muted)}:is(.woocommerce-cart,.woocommerce-checkout,#add_payment_method) #payment{border-radius:var(--nanospace-radius-card);background:var(--wc-secondary)}:is(.woocommerce-cart,.woocommerce-checkout,#add_payment_method) #payment div.payment_box{background:var(--nanospace-color-background);color:var(--nanospace-color-text)}:is(.woocommerce-cart,.woocommerce-checkout,#add_payment_method) #payment div.payment_box:before{border-block-end-color:var(--nanospace-color-background)}.woocommerce div.product div.images .woocommerce-product-gallery__trigger{background:var(--nanospace-color-background)}.woocommerce div.product div.images .woocommerce-product-gallery__trigger:before{border-color:var(--nanospace-color-text)}.woocommerce div.product div.images .woocommerce-product-gallery__trigger:after{background:var(--nanospace-color-text)}.nanospace-cart .wc-block-mini-cart__button{min-block-size:2.75rem;min-inline-size:2.75rem;color:inherit}.nanospace-cart .wc-block-mini-cart__button:hover{border-radius:var(--nanospace-radius-pill);background:var(--nanospace-color-pale)}.wc-block-mini-cart__drawer .components-modal__content{background:var(--nanospace-color-background);color:var(--nanospace-color-text)}.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-mini-cart__drawer{visibility:hidden} -
nanospace/2.1.0/assets/js/customizer-mega.js
r357206 r357429 1 (()=>{let n=window.wp.customize,{values: i}=window.nanospaceMega,o=t=>`nanospace_mega[${t}]`;function u(t){let e=o(t);return n.has(e)?n(e):n.create(e,e,i[t]??"",{transport:"refresh",previewer:n.previewer})}function r(t){t.params.type==="nav_menu_item"&&t.deferred.embedded.done(()=>{let e=u(t.params.menu_item_id),a=t.container[0].querySelector(".nanospace-mega-toggle"),s=t.container[0].querySelector(".nanospace-mega-columns");if(!a||!s)return;let c=()=>{let d=e.get();a.checked=d!=="",s.value=d||"3",s.disabled=d===""};a.addEventListener("change",()=>e.set(a.checked?s.value:"")),s.addEventListener("change",()=>{a.checked&&e.set(s.value)}),e.bind(c),c()})}n.bind("saved",t=>{for(let e of t.nav_menu_item_updates??[]){if(e.status!=="inserted"||!n.has(o(e.previous_post_id)))continue;let a=n(o(e.previous_post_id));if(i[e.post_id]=a.get(),n.remove(o(e.previous_post_id)),n.has(o(e.post_id))){let s=n(o(e.post_id));s.set(i[e.post_id]),s._dirty=!1}}}),n.control.each(r),n.control.bind("add",r)})();1 (()=>{let n=window.wp.customize,{values:d}=window.nanospaceMega,o=s=>`nanospace_mega[${s}]`;function u(s){let e=o(s);return n.has(e)?n(e):n.create(e,e,d[s]??"",{transport:"postMessage",previewer:n.previewer})}function c(s){s.params.type==="nav_menu_item"&&s.deferred.embedded.done(()=>{let e=u(s.params.menu_item_id),a=s.container[0].querySelector(".nanospace-mega-toggle"),t=s.container[0].querySelector(".nanospace-mega-columns");if(!a||!t)return;let r=()=>{let i=e.get();a.checked=i!=="",t.value=i||"3",t.disabled=i===""},p=i=>{e.set(i),n.previewer.send("nanospace-mega")};a.addEventListener("change",()=>p(a.checked?t.value:"")),t.addEventListener("change",()=>{a.checked&&p(t.value)}),e.bind(r),r()})}n.bind("saved",s=>{for(let e of s.nav_menu_item_updates??[]){if(e.status!=="inserted"||!n.has(o(e.previous_post_id)))continue;let a=n(o(e.previous_post_id));if(d[e.post_id]=a.get(),n.remove(o(e.previous_post_id)),n.has(o(e.post_id))){let t=n(o(e.post_id));t.set(d[e.post_id]),t._dirty=!1}}}),n.control.each(c),n.control.bind("add",c)})(); -
nanospace/2.1.0/assets/js/editor-layout.js
r357206 r357429 1 (()=>{let{registerPlugin: i}=window.wp.plugins,{PluginDocumentSettingPanel:s}=window.wp.editor,{SelectControl:c,ToggleControl:l}=window.wp.components,{useSelect:d,useDispatch:p}=window.wp.data,n=window.wp.element.createElement,{title:r,selects:w,hideTitle:u}=window.nanospaceLayout;function m(){let t=d(e=>e("core/editor").getEditedPostAttribute("meta"),[]),{editPost:g}=p("core/editor");if(!t||!("_nanospace_width"in t))return null;let a=e=>o=>g({meta:{[e]:o}});return n(s,{name:"nanospace-layout",title:r,className:"nanospace-layout-panel"},...Object.entries(w).map(([e,[o,h]])=>n(c,{key:e,label:o,value:t[e]??"",options:Object.entries(h).map(([_,P])=>({value:_,label:P})),onChange:a(e)})),n(l,{label:u,checked:!!t._nanospace_hide_title,onChange:a("_nanospace_hide_title")}))}i("nanospace-layout",{render:m})})();1 (()=>{let{registerPlugin:d}=window.wp.plugins,{PluginDocumentSettingPanel:u}=window.wp.editor,{MediaUpload:p,MediaUploadCheck:m}=window.wp.blockEditor,{Button:c,SelectControl:g,ToggleControl:_}=window.wp.components,{useSelect:r,useDispatch:w}=window.wp.data,{createElement:e,useRef:h}=window.wp.element,{title:b,selects:f,hideTitle:v,image:l}=window.nanospaceLayout;function y({id:n,onChange:i}){let o=h(null),a=r(t=>{let s=n?t("core").getMedia(n):null;return s?.media_details?.sizes?.medium?.source_url??s?.source_url??""},[n]);return e("div",{className:"nanospace-band-image",role:"group","aria-labelledby":"nanospace-band-image-label"},e("p",{id:"nanospace-band-image-label"},l.label),a?e("img",{src:a,alt:"",style:{display:"block",maxWidth:"100%"}}):null,e(m,null,e(p,{allowedTypes:["image"],value:n||void 0,onSelect:t=>i(t.id),render:({open:t})=>e(c,{ref:o,variant:"secondary",onClick:t,__next40pxDefaultSize:!0},n?l.replace:l.choose)})),n?e(c,{variant:"link",isDestructive:!0,onClick:()=>{i(0),o.current?.focus()}},l.remove):null,e("p",{className:"components-base-control__help"},l.help))}function C(){let n=r(a=>a("core/editor").getEditedPostAttribute("meta"),[]),{editPost:i}=w("core/editor");if(!n||!("_nanospace_width"in n))return null;let o=a=>t=>i({meta:{[a]:t}});return e(u,{name:"nanospace-layout",title:b,className:"nanospace-layout-panel"},...Object.entries(f).map(([a,[t,s]])=>e(g,{key:a,label:t,value:n[a]??"",options:Object.entries(s).map(([P,k])=>({value:P,label:k})),onChange:o(a)})),e(_,{label:v,checked:!!n._nanospace_hide_title,onChange:o("_nanospace_hide_title")}),e(y,{id:n._nanospace_page_header_image??0,onChange:o("_nanospace_page_header_image")}))}d("nanospace-layout",{render:C})})(); -
nanospace/2.1.0/inc/class-customizer.php
r357206 r357429 80 80 self::colors( $wp_customize ); 81 81 self::typography( $wp_customize ); 82 self::live_styles( $wp_customize ); 82 83 self::layout_section( $wp_customize ); 83 84 self::blog( $wp_customize ); … … 116 117 'default' => $defaults[ $key ], 117 118 'sanitize_callback' => array( Global_Styles::class, 'sanitize_color' ), 119 'transport' => 'postMessage', 118 120 ) 119 121 ); … … 161 163 'default' => $defaults[ $key ], 162 164 'sanitize_callback' => array( Global_Styles::class, 'sanitize_color' ), 165 'transport' => 'postMessage', 163 166 ) 164 167 ); … … 210 213 'choices' => $fonts, 211 214 ), 212 ' refresh'215 'postMessage' 213 216 ); 214 217 self::add( … … 223 226 'choices' => array( '' => __( 'Same as body', 'nanospace' ) ) + $fonts, 224 227 ), 225 ' refresh'228 'postMessage' 226 229 ); 227 230 self::add( … … 236 239 'choices' => $weights, 237 240 ), 238 ' refresh'241 'postMessage' 239 242 ); 240 243 self::add( … … 254 257 ), 255 258 ), 256 ' refresh'259 'postMessage' 257 260 ); 258 261 self::add( … … 271 274 ), 272 275 ), 273 'refresh' 276 'postMessage' 277 ); 278 } 279 280 /** 281 * Colors and typography preview without reloading the page: the stylesheets they feed are 282 * rendered again on the server (selective refresh), so the derived colors and the fluid type 283 * scale come from the same code as on the front end. The dark mode setting itself still 284 * reloads: it adds and removes scripts. 285 * 286 * @param \WP_Customize_Manager $wp_customize Customizer manager. 287 */ 288 private static function live_styles( \WP_Customize_Manager $wp_customize ): void { 289 $ids = static fn ( array $keys ): array => array_map( static fn ( string $key ): string => Global_Styles::MOD . "[{$key}]", $keys ); 290 291 $wp_customize->selective_refresh->add_partial( 292 'nanospace_global_styles', 293 array( 294 'selector' => '#global-styles-inline-css', 295 'settings' => $ids( array( 'text', 'background', 'accent', 'border', 'font_body', 'font_heading', 'heading_weight', 'font_size', 'line_height' ) ), 296 'container_inclusive' => false, 297 'render_callback' => array( Global_Styles::class, 'stylesheet' ), 298 ) 299 ); 300 $wp_customize->selective_refresh->add_partial( 301 'nanospace_dark_styles', 302 array( 303 'selector' => '#nanospace-dark-inline-css', 304 'settings' => $ids( array( 'dark_text', 'dark_background', 'dark_accent', 'dark_border' ) ), 305 'container_inclusive' => false, 306 'render_callback' => array( Global_Styles::class, 'dark_css' ), 307 ) 274 308 ); 275 309 } … … 454 488 ) 455 489 ); 456 $d = Page_Header::defaults(); 457 $id = static fn ( string $key ): string => Page_Header::MOD . "[{$key}]"; 458 foreach ( array( 459 'on_archive' => __( 'Show on the blog, archives and search', 'nanospace' ), 460 'on_post' => __( 'Show on posts', 'nanospace' ), 461 'on_page' => __( 'Show on pages', 'nanospace' ), 462 'breadcrumbs' => __( 'Show breadcrumbs (from Yoast SEO, Rank Math or Breadcrumb NavXT)', 'nanospace' ), 463 ) as $key => $label ) { 490 $d = Page_Header::defaults(); 491 $id = static fn ( string $key ): string => Page_Header::MOD . "[{$key}]"; 492 $checks = array( 493 'on_archive' => __( 'Show on the blog, archives and search', 'nanospace' ), 494 'on_post' => __( 'Show on posts', 'nanospace' ), 495 'on_page' => __( 'Show on pages', 'nanospace' ), 496 ); 497 if ( Shop::active() ) { 498 $checks['on_shop'] = __( 'Show on the shop and product categories (in place of WooCommerce\'s title)', 'nanospace' ); 499 } 500 $checks['breadcrumbs'] = __( 'Show breadcrumbs (from Yoast SEO, Rank Math or Breadcrumb NavXT)', 'nanospace' ); 501 foreach ( $checks as $key => $label ) { 464 502 self::add( 465 503 $wp_customize, -
nanospace/2.1.0/inc/class-global-styles.php
r357206 r357429 357 357 358 358 /** 359 * The theme.json stylesheet as core prints it for a classic theme (block styles go with each 360 * block), for the Customizer's selective refresh of colors and typography. 361 */ 362 public static function stylesheet(): string { 363 wp_clean_theme_json_cache(); 364 $filtered = false !== has_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' ); 365 if ( ! $filtered ) { 366 add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' ); 367 } 368 $css = wp_get_global_stylesheet(); 369 if ( ! $filtered ) { 370 remove_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' ); 371 } 372 return $css; 373 } 374 375 /** 359 376 * Dark mode: the dark colors replace the presets while the system asks for dark (`system`) or 360 377 * always (`dark`), unless the visitor chose light; and whenever the visitor chose dark. The 361 * toggle's script loads when the toggle362 * is placed, and always in the Customizer preview, where the toggle can be placed after the363 * p age loaded.378 * rules sit in their own inline style, which the Customizer re-renders when a dark color 379 * changes. The toggle's script loads when the toggle is placed, and always in the Customizer 380 * preview, where the toggle can be placed after the page loaded. 364 381 */ 365 382 public static function dark_styles(): void { … … 367 384 return; 368 385 } 386 wp_register_style( 'nanospace-dark', false, array( 'nanospace' ), Theme::version() ); 387 wp_add_inline_style( 'nanospace-dark', self::dark_css() ); 388 wp_enqueue_style( 'nanospace-dark' ); 389 390 foreach ( array( 'desktop', 'mobile', 'drawer' ) as $layout ) { 391 if ( is_customize_preview() || ( ! Page_Builders::replaces( 'header' ) && in_array( 'scheme', self::flatten( Builder::layout( 'header', $layout ) ), true ) ) ) { 392 wp_enqueue_script_module( 'nanospace-scheme', get_theme_file_uri( 'assets/js/scheme.js' ), array(), Theme::version() ); 393 return; 394 } 395 } 396 } 397 398 /** 399 * The dark mode rules (see dark_styles()). 400 */ 401 public static function dark_css(): string { 369 402 $s = self::settings(); 370 403 $vars = sprintf( … … 383 416 : ''; 384 417 $rule = static fn ( string $root ): string => "{$root}{{$vars}}" . ( '' === $logo ? '' : str_replace( '{}', "{$root} ", $logo ) ); 385 wp_add_inline_style( 386 'nanospace', 387 ':root[data-nanospace-scheme=light]{color-scheme:light}' . 418 return ':root[data-nanospace-scheme=light]{color-scheme:light}' . 388 419 $rule( ':root[data-nanospace-scheme=dark]' ) . 389 420 ( 'dark' === self::dark() 390 421 ? $rule( ':root:not([data-nanospace-scheme=light])' ) 391 : '@media (prefers-color-scheme:dark){' . $rule( ':root:not([data-nanospace-scheme=light])' ) . '}' ) 392 ); 393 394 foreach ( array( 'desktop', 'mobile', 'drawer' ) as $layout ) { 395 if ( is_customize_preview() || ( ! Page_Builders::replaces( 'header' ) && in_array( 'scheme', self::flatten( Builder::layout( 'header', $layout ) ), true ) ) ) { 396 wp_enqueue_script_module( 'nanospace-scheme', get_theme_file_uri( 'assets/js/scheme.js' ), array(), Theme::version() ); 397 return; 398 } 399 } 422 : '@media (prefers-color-scheme:dark){' . $rule( ':root:not([data-nanospace-scheme=light])' ) . '}' ); 400 423 } 401 424 -
nanospace/2.1.0/inc/class-layout.php
r357206 r357429 15 15 /** 16 16 * The `layout` theme mod sets the sidebar per content type (posts, pages, archives). Each post or 17 * page can override it, and choose a full-width or canvas layout, hide its title, and turn the 18 * page header band and the transparent header on or off, from a panel in the block editor's sidebar (or a meta box in the 19 * classic editor). The values are the theme's own post meta. 17 * page can override it, and choose a full-width or canvas layout, hide its title, turn the 18 * page header band and the transparent header on or off and give the band its own image, from a 19 * panel in the block editor's sidebar (or a meta box in the classic editor). The values are the 20 * theme's own post meta. 20 21 */ 21 22 final class Layout { … … 37 38 38 39 /** 39 * Per-post meta: key => allowed values ('' = the site default) or 'bool'. 40 * Per-post meta: key => allowed values ('' = the site default), 'bool', or 'image' (an image 41 * attachment ID, 0 = the site default). 40 42 */ 41 43 public const META = array( 42 '_nanospace_sidebar' => array( '', 'right', 'left', 'none' ), 43 '_nanospace_width' => array( '', 'full', 'canvas' ), 44 '_nanospace_hide_title' => 'bool', 45 '_nanospace_page_header' => array( '', 'on', 'off' ), 46 '_nanospace_image_style' => array( '', 'below', 'above', 'header', 'hidden' ), 47 '_nanospace_transparent' => array( '', 'on', 'off' ), 44 '_nanospace_sidebar' => array( '', 'right', 'left', 'none' ), 45 '_nanospace_width' => array( '', 'full', 'canvas' ), 46 '_nanospace_hide_title' => 'bool', 47 '_nanospace_page_header' => array( '', 'on', 'off' ), 48 '_nanospace_image_style' => array( '', 'below', 'above', 'header', 'hidden' ), 49 '_nanospace_transparent' => array( '', 'on', 'off' ), 50 '_nanospace_page_header_image' => 'image', 48 51 ); 49 52 … … 55 58 add_action( 'enqueue_block_editor_assets', array( self::class, 'editor_assets' ) ); 56 59 add_action( 'add_meta_boxes', array( self::class, 'meta_box' ) ); 60 add_action( 'admin_enqueue_scripts', array( self::class, 'meta_box_assets' ) ); 57 61 add_action( 'save_post', array( self::class, 'save_meta_box' ), 10, 2 ); 58 62 add_filter( 'template_include', array( self::class, 'canvas' ) ); … … 88 92 * @param string $key Meta key. 89 93 * @param mixed $value Raw value. 90 * @return string|bool 91 */ 92 public static function sanitize_meta( string $key, mixed $value ): string|bool {94 * @return string|bool|int 95 */ 96 public static function sanitize_meta( string $key, mixed $value ): string|bool|int { 93 97 $allowed = self::META[ $key ] ?? array(); 94 98 if ( 'bool' === $allowed ) { 95 99 return in_array( $value, array( true, 1, '1', 'true' ), true ); 100 } 101 if ( 'image' === $allowed ) { 102 $id = is_numeric( $value ) ? absint( $value ) : 0; 103 return $id && wp_attachment_is_image( $id ) ? $id : 0; 96 104 } 97 105 return in_array( $value, $allowed, true ) ? $value : ''; … … 119 127 foreach ( self::post_types() as $type ) { 120 128 foreach ( self::META as $key => $allowed ) { 121 $bool = 'bool' === $allowed; 129 $scalar = match ( $allowed ) { 130 'bool' => array( 'boolean', false ), 131 'image' => array( 'integer', 0 ), 132 default => null, 133 }; 122 134 register_post_meta( 123 135 $type, 124 136 $key, 125 137 array( 126 'type' => $ bool ? 'boolean': 'string',138 'type' => $scalar ? $scalar[0] : 'string', 127 139 'single' => true, 128 'default' => $ bool ? false: '',129 'show_in_rest' => $ bool? true : array( 'schema' => array( 'enum' => $allowed ) ),130 'sanitize_callback' => static fn ( mixed $value ): string|bool => self::sanitize_meta( $key, $value ),140 'default' => $scalar ? $scalar[1] : '', 141 'show_in_rest' => $scalar ? true : array( 'schema' => array( 'enum' => $allowed ) ), 142 'sanitize_callback' => static fn ( mixed $value ): string|bool|int => self::sanitize_meta( $key, $value ), 131 143 'auth_callback' => static fn ( bool $allowed, string $meta_key, int $post_id ): bool => current_user_can( 'edit_post', $post_id ), 132 144 ) … … 141 153 * @param string $key Meta key. 142 154 */ 143 public static function meta( string $key ): string|bool {155 public static function meta( string $key ): string|bool|int { 144 156 $id = is_singular() ? get_queried_object_id() : 0; 145 157 return self::sanitize_meta( $key, $id ? get_post_meta( $id, $key, true ) : '' ); … … 221 233 return; 222 234 } 223 wp_enqueue_script( 'nanospace-editor-layout', get_theme_file_uri( 'assets/js/editor-layout.js' ), array( 'wp-plugins', 'wp-editor', 'wp- components', 'wp-data', 'wp-element' ), Theme::version(), true );235 wp_enqueue_script( 'nanospace-editor-layout', get_theme_file_uri( 'assets/js/editor-layout.js' ), array( 'wp-plugins', 'wp-editor', 'wp-block-editor', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element' ), Theme::version(), true ); 224 236 wp_add_inline_script( 225 237 'nanospace-editor-layout', … … 229 241 'selects' => self::labels(), 230 242 'hideTitle' => __( 'Hide the title', 'nanospace' ), 243 'image' => self::image_labels(), 231 244 ) 232 245 ) . ';', 233 246 'before' 234 247 ); 248 } 249 250 /** 251 * Labels of the page header image field, shared by the meta box and the editor panel. 252 * 253 * @return array{label: string, help: string, choose: string, replace: string, remove: string} 254 */ 255 public static function image_labels(): array { 256 return array( 257 'label' => __( 'Page header image', 'nanospace' ), 258 'help' => __( 'Shown behind the page header when it is on. Without one, the image from Customize → Page header.', 'nanospace' ), 259 'choose' => __( 'Choose image', 'nanospace' ), 260 'replace' => __( 'Replace image', 'nanospace' ), 261 'remove' => __( 'Remove image', 'nanospace' ), 262 ); 263 } 264 265 /** 266 * The media library and the image field's script for the classic meta box. 267 * 268 * @param string $hook Admin page. 269 */ 270 public static function meta_box_assets( string $hook ): void { 271 $screen = get_current_screen(); 272 if ( ! in_array( $hook, array( 'post.php', 'post-new.php' ), true ) || ! $screen || $screen->is_block_editor() || ! in_array( $screen->post_type, self::post_types(), true ) ) { 273 return; 274 } 275 wp_enqueue_media(); 276 wp_enqueue_script( 'nanospace-meta-box', get_theme_file_uri( 'assets/js/meta-box.js' ), array( 'media-editor' ), Theme::version(), true ); 277 wp_add_inline_script( 'nanospace-meta-box', 'var nanospaceMetaBox = ' . wp_json_encode( self::image_labels() ) . ';', 'before' ); 235 278 } 236 279 … … 257 300 public static function render_meta_box( \WP_Post $post ): void { 258 301 wp_nonce_field( 'nanospace-layout', 'nanospace-layout-nonce' ); 259 $value = static fn ( string $key ): string|bool => self::sanitize_meta( $key, get_post_meta( $post->ID, $key, true ) );302 $value = static fn ( string $key ): string|bool|int => self::sanitize_meta( $key, get_post_meta( $post->ID, $key, true ) ); 260 303 $field = static function ( string $key, string $label, array $choices ) use ( $value ): void { 261 304 printf( '<p><label for="%1$s">%2$s</label><br><select id="%1$s" name="%1$s">', esc_attr( $key ), esc_html( $label ) ); … … 273 316 esc_html__( 'Hide the title', 'nanospace' ) 274 317 ); 318 $image = (int) $value( '_nanospace_page_header_image' ); 319 $labels = self::image_labels(); 320 printf( 321 '<div class="nanospace-band-image" role="group" aria-labelledby="nanospace-band-image-label"><p id="nanospace-band-image-label">%1$s</p><div class="nanospace-band-image__preview">%2$s</div><input type="hidden" name="_nanospace_page_header_image" value="%3$s"><p><button type="button" class="button nanospace-band-image__choose">%4$s</button> <button type="button" class="button-link button-link-delete nanospace-band-image__remove"%5$s>%6$s</button></p><p class="description">%7$s</p></div>', 322 esc_html( $labels['label'] ), 323 $image ? wp_get_attachment_image( 324 $image, 325 'medium', 326 false, 327 array( 328 'alt' => '', 329 'style' => 'display:block;max-width:100%;height:auto', 330 ) 331 ) : '', 332 esc_attr( (string) $image ), 333 esc_html( $image ? $labels['replace'] : $labels['choose'] ), 334 $image ? '' : ' hidden', 335 esc_html( $labels['remove'] ), 336 esc_html( $labels['help'] ) 337 ); 275 338 } 276 339 … … 291 354 } 292 355 update_post_meta( $post_id, '_nanospace_hide_title', isset( $_POST['_nanospace_hide_title'] ) ); 356 $image = isset( $_POST['_nanospace_page_header_image'] ) ? absint( wp_unslash( $_POST['_nanospace_page_header_image'] ) ) : 0; 357 update_post_meta( $post_id, '_nanospace_page_header_image', self::sanitize_meta( '_nanospace_page_header_image', $image ) ); 293 358 } 294 359 -
nanospace/2.1.0/inc/class-mega-menu.php
r357206 r357429 68 68 add_action( 'wp_nav_menu_item_custom_fields_customize_template', array( self::class, 'customize_fields' ) ); 69 69 add_action( 'customize_controls_enqueue_scripts', array( self::class, 'customize_script' ) ); 70 add_action( 'customize_preview_init', array( self::class, 'preview_script' ) ); 70 71 } 71 72 … … 152 153 return array( 153 154 'type' => 'nanospace_mega', 154 'transport' => ' refresh',155 'transport' => 'postMessage', 155 156 'capability' => 'edit_theme_options', 156 157 'default' => '', … … 212 213 wp_enqueue_script( 'nanospace-customizer-mega', get_theme_file_uri( 'assets/js/customizer-mega.js' ), array( 'customize-nav-menus' ), Theme::version(), true ); 213 214 wp_add_inline_script( 'nanospace-customizer-mega', 'var nanospaceMega = ' . wp_json_encode( array( 'values' => (object) $values ) ) . ';', 'before' ); 215 } 216 217 /** 218 * In the preview: the script that re-renders the header menus (selective refresh) when a 219 * field changes, and the panel styles, which a menu may need once a field is ticked. 220 */ 221 public static function preview_script(): void { 222 wp_enqueue_script( 'nanospace-customize-preview-mega', get_theme_file_uri( 'assets/js/customize-preview-mega.js' ), array( 'customize-preview', 'customize-selective-refresh' ), Theme::version(), true ); 223 add_action( 'wp_enqueue_scripts', array( self::class, 'enqueue_styles' ) ); 224 } 225 226 /** 227 * The panel styles. 228 */ 229 public static function enqueue_styles(): void { 230 wp_enqueue_style( 'nanospace-mega', get_theme_file_uri( 'assets/css/mega-menu.css' ), array( 'nanospace' ), Theme::version() ); 214 231 } 215 232 … … 331 348 foreach ( is_array( $items ) ? $items : array() as $item ) { 332 349 if ( 0 === (int) $item->menu_item_parent && self::is_mega( (int) $item->ID ) ) { 333 wp_enqueue_style( 'nanospace-mega', get_theme_file_uri( 'assets/css/mega-menu.css' ), array( 'nanospace' ), Theme::version());350 self::enqueue_styles(); 334 351 return; 335 352 } -
nanospace/2.1.0/inc/class-page-header.php
r357206 r357429 14 14 15 15 /** 16 * The `page_header` theme mod turns the band on per content type (archives on by default) and 17 * sets its image, overlay and breadcrumbs; a post or page can turn it on or off for itself 18 * (`_nanospace_page_header`, NanoSpace\Layout). Without the band, archives keep a plain title. 16 * The `page_header` theme mod turns the band on per content type (archives on by default; the 17 * WooCommerce shop and product archives off) and sets its image, overlay and breadcrumbs; a post 18 * or page can turn it on or off for itself (`_nanospace_page_header`, NanoSpace\Layout) and 19 * give it its own image (`_nanospace_page_header_image`). Without 20 * the band, archives keep a plain title and WooCommerce prints its own. 19 21 * 20 22 * Breadcrumbs come from Yoast SEO, Rank Math or Breadcrumb NavXT when one is active; the theme … … 31 33 * Defaults. 32 34 * 33 * @return array{on_archive: bool, on_post: bool, on_page: bool, breadcrumbs: bool, image: int, overlay: int}35 * @return array{on_archive: bool, on_post: bool, on_page: bool, on_shop: bool, breadcrumbs: bool, image: int, overlay: int} 34 36 */ 35 37 public static function defaults(): array { … … 38 40 'on_post' => false, 39 41 'on_page' => false, 42 'on_shop' => false, 40 43 'breadcrumbs' => true, 41 44 'image' => 0, … … 47 50 * Stored settings over the defaults, sanitized. 48 51 * 49 * @return array{on_archive: bool, on_post: bool, on_page: bool, breadcrumbs: bool, image: int, overlay: int}52 * @return array{on_archive: bool, on_post: bool, on_page: bool, on_shop: bool, breadcrumbs: bool, image: int, overlay: int} 50 53 */ 51 54 public static function settings(): array { … … 57 60 'on_post' => Blog::sanitize_bool( $stored['on_post'] ?? $d['on_post'] ), 58 61 'on_page' => Blog::sanitize_bool( $stored['on_page'] ?? $d['on_page'] ), 62 'on_shop' => Blog::sanitize_bool( $stored['on_shop'] ?? $d['on_shop'] ), 59 63 'breadcrumbs' => Blog::sanitize_bool( $stored['breadcrumbs'] ?? $d['breadcrumbs'] ), 60 64 'image' => absint( $stored['image'] ?? 0 ), … … 74 78 75 79 /** 76 * Whether the band shows on the current view. 80 * Whether the band shows on the current view. On WooCommerce's views only the shop, product 81 * archives and product search can have it; a product keeps WooCommerce's title. 77 82 */ 78 83 public static function shown(): bool { 79 if ( is_404() || ( is_front_page() && is_home() ) || Shop::view() ||Community::view() ) {84 if ( is_404() || ( is_front_page() && is_home() ) || Community::view() ) { 80 85 return false; 86 } 87 if ( Shop::view() ) { 88 return ! is_singular() && self::settings()['on_shop']; 81 89 } 82 90 $own = Layout::meta( '_nanospace_page_header' ); … … 92 100 93 101 /** 94 * The band's title: the post, archive or search title, or the blog page's. 102 * The band's image: the post's or page's own (`_nanospace_page_header_image`), else the 103 * site-wide one; 0 for none. 104 */ 105 public static function image(): int { 106 $own = (int) Layout::meta( '_nanospace_page_header_image' ); 107 return $own ? $own : self::settings()['image']; 108 } 109 110 /** 111 * The band's title: the post, archive or search title, the blog page's, or WooCommerce's 112 * shop, product archive or product search title. 95 113 */ 96 114 public static function title(): string { 115 if ( Shop::view() ) { 116 return wp_kses_post( woocommerce_page_title( false ) ); 117 } 97 118 if ( is_singular() ) { 98 119 return Layout::hide_title() ? '' : esc_html( single_post_title( '', false ) ?? '' ); … … 129 150 130 151 /** 152 * The archive description under the band's title. Not on the shop: its post type 153 * description is WooCommerce's own boilerplate, and the shop page's content prints below. 154 */ 155 public static function description(): void { 156 if ( ! is_singular() && ! ( Shop::view() && is_shop() ) ) { 157 the_archive_description( '<div class="archive-description">', '</div>' ); 158 } 159 } 160 161 /** 131 162 * Prints the band, or on archives without it the plain title; nothing on bbPress and 132 * BuddyPress views, whose page title is the h1 .163 * BuddyPress views, whose page title is the h1, nor on WooCommerce's without the band. 133 164 */ 134 165 public static function render(): void { … … 138 169 if ( self::shown() ) { 139 170 get_template_part( 'template-parts/page-header' ); 140 } elseif ( ! is_singular() && ! is_home() && ! is_404() ) {171 } elseif ( ! is_singular() && ! is_home() && ! is_404() && ! Shop::view() ) { 141 172 echo '<header class="page-header"><h1 class="page-title">' . self::title() . '</h1>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in title(). 142 173 the_archive_description( '<div class="archive-description">', '</div>' ); -
nanospace/2.1.0/inc/class-shop.php
r357206 r357429 16 16 * per page in Customize → WooCommerce → Product Catalog), a "Shop sidebar" widget area beside the 17 17 * shop and products (sidebar per `layout[sidebar_shop]`, right by default), the cart (WooCommerce's 18 * Mini-Cart block) and account header elements, and `woocommerce.css`, which maps WooCommerce's 18 * Mini-Cart block) and account header elements, the page header band on the shop and product 19 * archives when it is on, and `woocommerce.css`, which maps WooCommerce's 19 20 * colors and controls to the theme's tokens. Block and shortcode cart and checkout both take the 20 21 * theme's buttons and fields; the cart and checkout never have a sidebar. … … 54 55 add_action( 'wp_enqueue_scripts', array( self::class, 'enqueue' ), 20 ); 55 56 add_filter( 'woocommerce_checkout_coupon_message', array( self::class, 'coupon_message' ) ); 57 add_action( 'template_redirect', array( self::class, 'band' ) ); 58 } 59 60 /** 61 * Under the page header band (`page_header[on_shop]`), the band has the title and a product 62 * archive's description, so WooCommerce prints neither. 63 */ 64 public static function band(): void { 65 if ( self::view() && Page_Header::shown() ) { 66 add_filter( 'woocommerce_show_page_title', '__return_false' ); 67 remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description' ); 68 } 56 69 } 57 70 -
nanospace/2.1.0/languages/nanospace.pot
r357220 r357429 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: NanoSpace 2. 0.1\n"5 "Project-Id-Version: NanoSpace 2.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/theme/nanospace\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-11-0 1T04:29:05+00:00\n"12 "POT-Creation-Date: 2026-11-05T00:13:41+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 97 97 98 98 #: inc/class-admin.php:134 99 #: inc/class-customizer.php: 76799 #: inc/class-customizer.php:805 100 100 msgid "Footer credit" 101 101 msgstr "" … … 165 165 #: inc/class-builder-control.php:56 166 166 #: inc/class-builder.php:162 167 #: inc/class-customizer.php:7 25167 #: inc/class-customizer.php:763 168 168 #: inc/class-page-builders.php:99 169 169 #: inc/class-starter-content.php:66 … … 388 388 msgstr "" 389 389 390 #: inc/class-customizer.php: 99390 #: inc/class-customizer.php:100 391 391 msgid "Colors" 392 392 msgstr "" 393 393 394 #: inc/class-customizer.php:10 0394 #: inc/class-customizer.php:101 395 395 msgid "Muted text and the link hover color are derived from these. A warning shows when text or the accent falls below WCAG AA contrast." 396 396 msgstr "" 397 397 398 #: inc/class-customizer.php:10 7398 #: inc/class-customizer.php:108 399 399 #: inc/class-global-styles.php:321 400 400 msgid "Text" 401 401 msgstr "" 402 402 403 #: inc/class-customizer.php:10 8403 #: inc/class-customizer.php:109 404 404 #: inc/class-global-styles.php:322 405 405 msgid "Background" 406 406 msgstr "" 407 407 408 #: inc/class-customizer.php:1 09408 #: inc/class-customizer.php:110 409 409 msgid "Accent (links, buttons)" 410 410 msgstr "" 411 411 412 #: inc/class-customizer.php:11 0412 #: inc/class-customizer.php:111 413 413 msgid "Borders and dividers" 414 414 msgstr "" 415 415 416 #: inc/class-customizer.php:14 0416 #: inc/class-customizer.php:142 417 417 #: template-parts/builder/scheme-toggle.php:17 418 418 msgid "Dark mode" 419 419 msgstr "" 420 420 421 #: inc/class-customizer.php:14 1421 #: inc/class-customizer.php:143 422 422 msgid "Follow each visitor's system setting, or start every visitor in dark. Add the Dark mode toggle to the header to let visitors switch." 423 423 msgstr "" 424 424 425 #: inc/class-customizer.php:14 3426 #: inc/class-customizer.php:5 52427 #: inc/class-customizer.php: 587428 #: inc/class-layout.php: 343425 #: inc/class-customizer.php:145 426 #: inc/class-customizer.php:590 427 #: inc/class-customizer.php:625 428 #: inc/class-layout.php:408 429 429 msgid "Off" 430 430 msgstr "" 431 431 432 #: inc/class-customizer.php:14 4432 #: inc/class-customizer.php:146 433 433 msgid "Follow the visitor's system" 434 434 msgstr "" 435 435 436 #: inc/class-customizer.php:14 5436 #: inc/class-customizer.php:147 437 437 msgid "Start in dark" 438 438 msgstr "" 439 439 440 #: inc/class-customizer.php:15 2440 #: inc/class-customizer.php:154 441 441 msgid "Dark mode: text" 442 442 msgstr "" 443 443 444 #: inc/class-customizer.php:15 3444 #: inc/class-customizer.php:155 445 445 msgid "Dark mode: background" 446 446 msgstr "" 447 447 448 #: inc/class-customizer.php:15 4448 #: inc/class-customizer.php:156 449 449 msgid "Dark mode: accent" 450 450 msgstr "" 451 451 452 #: inc/class-customizer.php:15 5452 #: inc/class-customizer.php:157 453 453 msgid "Dark mode: borders and dividers" 454 454 msgstr "" 455 455 456 #: inc/class-customizer.php:1 88456 #: inc/class-customizer.php:191 457 457 msgid "Typography" 458 458 msgstr "" 459 459 460 #: inc/class-customizer.php:2 09460 #: inc/class-customizer.php:212 461 461 msgid "Body font" 462 462 msgstr "" 463 463 464 #: inc/class-customizer.php:22 2464 #: inc/class-customizer.php:225 465 465 msgid "Heading font" 466 466 msgstr "" 467 467 468 #: inc/class-customizer.php:22 3468 #: inc/class-customizer.php:226 469 469 msgid "Same as body" 470 470 msgstr "" 471 471 472 #: inc/class-customizer.php:23 5472 #: inc/class-customizer.php:238 473 473 msgid "Heading weight" 474 474 msgstr "" 475 475 476 #: inc/class-customizer.php:2 48476 #: inc/class-customizer.php:251 477 477 msgid "Base font size (px)" 478 478 msgstr "" 479 479 480 #: inc/class-customizer.php:2 49480 #: inc/class-customizer.php:252 481 481 msgid "Headings scale with it." 482 482 msgstr "" 483 483 484 #: inc/class-customizer.php:26 6484 #: inc/class-customizer.php:269 485 485 msgid "Line height" 486 486 msgstr "" 487 487 488 #: inc/class-customizer.php: 286489 #: inc/class-layout.php:2 28490 #: inc/class-layout.php:2 43488 #: inc/class-customizer.php:320 489 #: inc/class-layout.php:240 490 #: inc/class-layout.php:286 491 491 msgid "Layout" 492 492 msgstr "" 493 493 494 #: inc/class-customizer.php: 287494 #: inc/class-customizer.php:321 495 495 msgid "A post or page can choose its own sidebar in its Layout panel. The sidebar shows only while the Sidebar widget area has widgets." 496 496 msgstr "" 497 497 498 #: inc/class-customizer.php: 292499 #: inc/class-layout.php:3 07498 #: inc/class-customizer.php:326 499 #: inc/class-layout.php:372 500 500 msgid "Right" 501 501 msgstr "" 502 502 503 #: inc/class-customizer.php: 293504 #: inc/class-layout.php:3 08503 #: inc/class-customizer.php:327 504 #: inc/class-layout.php:373 505 505 msgid "Left" 506 506 msgstr "" 507 507 508 #: inc/class-customizer.php: 294509 #: inc/class-layout.php:3 09508 #: inc/class-customizer.php:328 509 #: inc/class-layout.php:374 510 510 msgid "None" 511 511 msgstr "" 512 512 513 #: inc/class-customizer.php: 297513 #: inc/class-customizer.php:331 514 514 msgid "Sidebar on posts" 515 515 msgstr "" 516 516 517 #: inc/class-customizer.php: 298517 #: inc/class-customizer.php:332 518 518 msgid "Sidebar on pages" 519 519 msgstr "" 520 520 521 #: inc/class-customizer.php: 299521 #: inc/class-customizer.php:333 522 522 msgid "Sidebar on the blog, archives and search" 523 523 msgstr "" 524 524 525 #: inc/class-customizer.php:3 02525 #: inc/class-customizer.php:336 526 526 msgid "Sidebar on the shop and products (Shop sidebar widgets; never on the cart or checkout)" 527 527 msgstr "" 528 528 529 #: inc/class-customizer.php:3 30529 #: inc/class-customizer.php:364 530 530 msgid "Blog" 531 531 msgstr "" 532 532 533 #: inc/class-customizer.php:3 45533 #: inc/class-customizer.php:379 534 534 msgid "Archive layout" 535 535 msgstr "" 536 536 537 #: inc/class-customizer.php:3 46537 #: inc/class-customizer.php:380 538 538 msgid "For the blog, categories, tags, authors, dates and search results." 539 539 msgstr "" 540 540 541 #: inc/class-customizer.php:3 48541 #: inc/class-customizer.php:382 542 542 msgid "List, image beside the excerpt" 543 543 msgstr "" 544 544 545 #: inc/class-customizer.php:3 49545 #: inc/class-customizer.php:383 546 546 msgid "Grid of cards" 547 547 msgstr "" 548 548 549 #: inc/class-customizer.php:3 50549 #: inc/class-customizer.php:384 550 550 msgid "Minimal: titles and dates" 551 551 msgstr "" 552 552 553 #: inc/class-customizer.php:3 63553 #: inc/class-customizer.php:397 554 554 msgid "Grid columns on wide screens" 555 555 msgstr "" 556 556 557 #: inc/class-customizer.php: 379557 #: inc/class-customizer.php:413 558 558 msgid "Excerpt length (words)" 559 559 msgstr "" 560 560 561 #: inc/class-customizer.php: 396561 #: inc/class-customizer.php:430 562 562 msgid "Show featured images in archives" 563 563 msgstr "" 564 564 565 #: inc/class-customizer.php:4 10565 #: inc/class-customizer.php:444 566 566 msgid "Featured image on posts and pages" 567 567 msgstr "" 568 568 569 #: inc/class-customizer.php:4 11569 #: inc/class-customizer.php:445 570 570 msgid "A post or page can choose its own in its Layout panel." 571 571 msgstr "" 572 572 573 #: inc/class-customizer.php:4 13574 #: inc/class-layout.php:3 24573 #: inc/class-customizer.php:447 574 #: inc/class-layout.php:389 575 575 msgid "Below the title" 576 576 msgstr "" 577 577 578 #: inc/class-customizer.php:4 14579 #: inc/class-layout.php:3 25578 #: inc/class-customizer.php:448 579 #: inc/class-layout.php:390 580 580 msgid "Above the title" 581 581 msgstr "" 582 582 583 #: inc/class-customizer.php:4 15584 #: inc/class-layout.php:3 26583 #: inc/class-customizer.php:449 584 #: inc/class-layout.php:391 585 585 msgid "Header with the title on it" 586 586 msgstr "" 587 587 588 #: inc/class-customizer.php:4 16589 #: inc/class-layout.php:3 27588 #: inc/class-customizer.php:450 589 #: inc/class-layout.php:392 590 590 msgid "Hidden" 591 591 msgstr "" 592 592 593 #: inc/class-customizer.php:4 22593 #: inc/class-customizer.php:456 594 594 msgid "Author box on posts (when the author has a biography)" 595 595 msgstr "" 596 596 597 #: inc/class-customizer.php:4 23597 #: inc/class-customizer.php:457 598 598 msgid "Previous and next post links" 599 599 msgstr "" 600 600 601 #: inc/class-customizer.php:4 24601 #: inc/class-customizer.php:458 602 602 msgid "Reading time on posts" 603 603 msgstr "" 604 604 605 #: inc/class-customizer.php:4 25605 #: inc/class-customizer.php:459 606 606 msgid "Reading progress bar on posts" 607 607 msgstr "" 608 608 609 #: inc/class-customizer.php:4 51610 #: inc/class-layout.php:3 31609 #: inc/class-customizer.php:485 610 #: inc/class-layout.php:396 611 611 #: inc/class-theme.php:49 612 612 msgid "Page header" 613 613 msgstr "" 614 614 615 #: inc/class-customizer.php:4 52615 #: inc/class-customizer.php:486 616 616 msgid "A band at the top of the content with the title, breadcrumbs and the Page header widget area. A post or page can turn it on or off in its Layout panel." 617 617 msgstr "" 618 618 619 #: inc/class-customizer.php:4 59619 #: inc/class-customizer.php:493 620 620 msgid "Show on the blog, archives and search" 621 621 msgstr "" 622 622 623 #: inc/class-customizer.php:4 60623 #: inc/class-customizer.php:494 624 624 msgid "Show on posts" 625 625 msgstr "" 626 626 627 #: inc/class-customizer.php:4 61627 #: inc/class-customizer.php:495 628 628 msgid "Show on pages" 629 629 msgstr "" 630 630 631 #: inc/class-customizer.php:462 631 #: inc/class-customizer.php:498 632 msgid "Show on the shop and product categories (in place of WooCommerce's title)" 633 msgstr "" 634 635 #: inc/class-customizer.php:500 632 636 msgid "Show breadcrumbs (from Yoast SEO, Rank Math or Breadcrumb NavXT)" 633 637 msgstr "" 634 638 635 #: inc/class-customizer.php: 490639 #: inc/class-customizer.php:528 636 640 msgid "Background image" 637 641 msgstr "" 638 642 639 #: inc/class-customizer.php:5 03643 #: inc/class-customizer.php:541 640 644 msgid "Overlay on the image (%)" 641 645 msgstr "" 642 646 643 #: inc/class-customizer.php:5 04647 #: inc/class-customizer.php:542 644 648 msgid "At least 60%, so white text stays readable on any image." 645 649 msgstr "" 646 650 647 #: inc/class-customizer.php:5 24651 #: inc/class-customizer.php:562 648 652 #: inc/class-page-builders.php:70 649 653 #: inc/class-theme.php:45 … … 651 655 msgstr "" 652 656 653 #: inc/class-customizer.php:5 30657 #: inc/class-customizer.php:568 654 658 msgid "Header layout" 655 659 msgstr "" 656 660 657 #: inc/class-customizer.php:5 40661 #: inc/class-customizer.php:578 658 662 msgid "Mobile header below (px)" 659 663 msgstr "" 660 664 661 #: inc/class-customizer.php:5 41665 #: inc/class-customizer.php:579 662 666 msgid "Screens narrower than this show the mobile header and menu button." 663 667 msgstr "" 664 668 665 #: inc/class-customizer.php:5 53669 #: inc/class-customizer.php:591 666 670 msgid "Always" 667 671 msgstr "" 668 672 669 #: inc/class-customizer.php:5 54673 #: inc/class-customizer.php:592 670 674 msgid "Reveal on scroll up" 671 675 msgstr "" 672 676 673 #: inc/class-customizer.php:5 57677 #: inc/class-customizer.php:595 674 678 msgid "Sticky header: desktop" 675 679 msgstr "" 676 680 677 #: inc/class-customizer.php:5 58681 #: inc/class-customizer.php:596 678 682 msgid "Sticky header: mobile" 679 683 msgstr "" 680 684 681 #: inc/class-customizer.php: 569685 #: inc/class-customizer.php:607 682 686 msgid "Keeps the main header row at the top of the window. \"Reveal on scroll up\" hides it while scrolling down." 683 687 msgstr "" 684 688 685 #: inc/class-customizer.php: 584686 #: inc/class-layout.php: 339689 #: inc/class-customizer.php:622 690 #: inc/class-layout.php:404 687 691 msgid "Transparent header" 688 692 msgstr "" 689 693 690 #: inc/class-customizer.php: 585694 #: inc/class-customizer.php:623 691 695 msgid "Lays the header over the image at the top of the page: the page header with a background image, or a post's image header, on views without a sidebar. Elsewhere the header stays solid. A post or page can turn it on or off in its Layout panel." 692 696 msgstr "" 693 697 694 #: inc/class-customizer.php: 588698 #: inc/class-customizer.php:626 695 699 msgid "Front page" 696 700 msgstr "" 697 701 698 #: inc/class-customizer.php: 589702 #: inc/class-customizer.php:627 699 703 msgid "All pages" 700 704 msgstr "" 701 705 702 #: inc/class-customizer.php:6 02706 #: inc/class-customizer.php:640 703 707 msgid "Transparent header: text" 704 708 msgstr "" 705 709 706 #: inc/class-customizer.php:6 03710 #: inc/class-customizer.php:641 707 711 msgid "Light text sits on a dark overlay over the image; dark text turns the overlay white. Either stays readable on any image." 708 712 msgstr "" 709 713 710 #: inc/class-customizer.php:6 05714 #: inc/class-customizer.php:643 711 715 msgid "Light" 712 716 msgstr "" 713 717 714 #: inc/class-customizer.php:6 06718 #: inc/class-customizer.php:644 715 719 msgid "Dark" 716 720 msgstr "" 717 721 718 #: inc/class-customizer.php:6 24722 #: inc/class-customizer.php:662 719 723 msgid "Transparent header: logo" 720 724 msgstr "" 721 725 722 #: inc/class-customizer.php:6 25726 #: inc/class-customizer.php:663 723 727 msgid "Optional. Shown instead of the logo while the header is transparent, e.g. a white version." 724 728 msgstr "" 725 729 726 730 #. translators: %d: button number. 727 #: inc/class-customizer.php:6 40731 #: inc/class-customizer.php:678 728 732 #, php-format 729 733 msgid "Button %d: label" 730 734 msgstr "" 731 735 732 #: inc/class-customizer.php:6 41736 #: inc/class-customizer.php:679 733 737 msgid "The button shows once it has a label." 734 738 msgstr "" 735 739 736 740 #. translators: %d: button number. 737 #: inc/class-customizer.php:6 53741 #: inc/class-customizer.php:691 738 742 #, php-format 739 743 msgid "Button %d: link" 740 744 msgstr "" 741 745 742 #: inc/class-customizer.php:6 61746 #: inc/class-customizer.php:699 743 747 msgid "Announcement: text" 744 748 msgstr "" 745 749 746 #: inc/class-customizer.php:6 61750 #: inc/class-customizer.php:699 747 751 msgid "One short line. The announcement shows once it has text." 748 752 msgstr "" 749 753 750 #: inc/class-customizer.php: 662754 #: inc/class-customizer.php:700 751 755 msgid "Announcement: badge" 752 756 msgstr "" 753 757 754 #: inc/class-customizer.php: 662758 #: inc/class-customizer.php:700 755 759 msgid "A word before the text, such as \"New\". Optional." 756 760 msgstr "" 757 761 758 #: inc/class-customizer.php: 663762 #: inc/class-customizer.php:701 759 763 msgid "Announcement: link" 760 764 msgstr "" 761 765 762 #: inc/class-customizer.php: 664766 #: inc/class-customizer.php:702 763 767 msgid "Announcement: link text" 764 768 msgstr "" 765 769 766 #: inc/class-customizer.php: 664770 #: inc/class-customizer.php:702 767 771 msgid "Shown when there is a link. Default: \"Learn more\"." 768 772 msgstr "" 769 773 770 #: inc/class-customizer.php: 697774 #: inc/class-customizer.php:735 771 775 msgid "Logo in dark mode" 772 776 msgstr "" 773 777 774 #: inc/class-customizer.php: 698778 #: inc/class-customizer.php:736 775 779 msgid "Optional. Shown instead of the logo while dark colors show (Colors → Dark mode), e.g. a light version. Needs a logo above." 776 780 msgstr "" 777 781 778 #: inc/class-customizer.php:7 30782 #: inc/class-customizer.php:768 779 783 msgid "Footer layout" 780 784 msgstr "" 781 785 782 #: inc/class-customizer.php:7 39786 #: inc/class-customizer.php:777 783 787 msgid "Footer widget columns" 784 788 msgstr "" 785 789 786 #: inc/class-customizer.php:7 40790 #: inc/class-customizer.php:778 787 791 msgid "Each widget in the Footer area fills one column. Columns stack on small screens." 788 792 msgstr "" 789 793 790 794 #. translators: %s: list of tokens such as {year}. 791 #: inc/class-customizer.php: 770795 #: inc/class-customizer.php:808 792 796 #, php-format 793 797 msgid "Leave empty to show no credit. Tokens: %s." 794 798 msgstr "" 795 799 796 #: inc/class-customizer.php:8 06800 #: inc/class-customizer.php:844 797 801 #: inc/class-social.php:101 798 802 msgid "Social profiles" 799 803 msgstr "" 800 804 801 #: inc/class-customizer.php:8 07805 #: inc/class-customizer.php:845 802 806 msgid "Fill in the profiles to link. The Social icons element of the header or footer shows them." 803 807 msgstr "" 804 808 805 809 #. translators: %d: HTML element number. 806 #: inc/class-customizer.php: 894810 #: inc/class-customizer.php:932 807 811 #, php-format 808 812 msgid "HTML %d" 809 813 msgstr "" 810 814 811 #: inc/class-customizer.php: 895815 #: inc/class-customizer.php:933 812 816 msgid "Text or HTML for the HTML element. Shows once it has content." 813 817 msgstr "" … … 837 841 msgstr "" 838 842 839 #: inc/class-global-styles.php:4 36843 #: inc/class-global-styles.php:459 840 844 msgid "Small" 841 845 msgstr "" 842 846 843 #: inc/class-global-styles.php:4 37847 #: inc/class-global-styles.php:460 844 848 msgid "Medium" 845 849 msgstr "" 846 850 847 #: inc/class-global-styles.php:4 38851 #: inc/class-global-styles.php:461 848 852 msgid "Large" 849 853 msgstr "" 850 854 851 #: inc/class-global-styles.php:4 39855 #: inc/class-global-styles.php:462 852 856 msgid "Extra large" 853 857 msgstr "" 854 858 855 #: inc/class-global-styles.php:4 40859 #: inc/class-global-styles.php:463 856 860 msgid "Huge" 857 861 msgstr "" 858 862 859 #: inc/class-layout.php:2 30860 #: inc/class-layout.php: 273863 #: inc/class-layout.php:242 864 #: inc/class-layout.php:316 861 865 msgid "Hide the title" 862 866 msgstr "" 863 867 864 #: inc/class-layout.php:301 868 #: inc/class-layout.php:257 869 msgid "Page header image" 870 msgstr "" 871 872 #: inc/class-layout.php:258 873 msgid "Shown behind the page header when it is on. Without one, the image from Customize → Page header." 874 msgstr "" 875 876 #: inc/class-layout.php:259 877 msgid "Choose image" 878 msgstr "" 879 880 #: inc/class-layout.php:260 881 msgid "Replace image" 882 msgstr "" 883 884 #: inc/class-layout.php:261 885 msgid "Remove image" 886 msgstr "" 887 888 #: inc/class-layout.php:366 865 889 msgid "Default" 866 890 msgstr "" 867 891 868 #: inc/class-layout.php:3 04892 #: inc/class-layout.php:369 869 893 #: inc/class-page-builders.php:92 870 894 #: inc/class-theme.php:41 … … 873 897 msgstr "" 874 898 875 #: inc/class-layout.php:3 13899 #: inc/class-layout.php:378 876 900 msgid "Content width" 877 901 msgstr "" 878 902 879 #: inc/class-layout.php:3 16903 #: inc/class-layout.php:381 880 904 msgid "Full width, for page builders" 881 905 msgstr "" 882 906 883 #: inc/class-layout.php:3 17907 #: inc/class-layout.php:382 884 908 msgid "Canvas: no header or footer" 885 909 msgstr "" 886 910 887 #: inc/class-layout.php:3 21911 #: inc/class-layout.php:386 888 912 msgid "Featured image" 889 913 msgstr "" 890 914 891 #: inc/class-layout.php:3 34915 #: inc/class-layout.php:399 892 916 msgid "Show" 893 917 msgstr "" 894 918 895 #: inc/class-layout.php: 335919 #: inc/class-layout.php:400 896 920 msgid "Hide" 897 921 msgstr "" 898 922 899 #: inc/class-layout.php: 342923 #: inc/class-layout.php:407 900 924 msgid "On, over the page header or image header" 901 925 msgstr "" 902 926 903 #: inc/class-mega-menu.php:18 0904 #: inc/class-mega-menu.php:2 47927 #: inc/class-mega-menu.php:181 928 #: inc/class-mega-menu.php:264 905 929 msgid "Mega menu: show this item's submenu as columns in the desktop header" 906 930 msgstr "" 907 931 908 #: inc/class-mega-menu.php:18 5909 #: inc/class-mega-menu.php:2 50932 #: inc/class-mega-menu.php:186 933 #: inc/class-mega-menu.php:267 910 934 msgid "Columns" 911 935 msgstr "" … … 970 994 971 995 #. translators: %s: the search query. 972 #: inc/class-page-header.php:1 02996 #: inc/class-page-header.php:123 973 997 #, php-format 974 998 msgid "Search results for: %s" 975 999 msgstr "" 976 1000 977 #: inc/class-page-header.php:1 171001 #: inc/class-page-header.php:138 978 1002 msgid "Breadcrumbs" 979 1003 msgstr "" -
nanospace/2.1.0/readme.txt
r357220 r357429 59 59 == Changelog == 60 60 61 = 2.1.0 = 62 63 * Colors, typography and mega menu settings now preview in the Customizer without a reload. 64 * Optional page header band on the WooCommerce shop and product categories (off by default). 65 * Pages can pick their own page header image. 66 61 67 = 2.0.1 = 62 68 -
nanospace/2.1.0/src/css/woocommerce.css
r357206 r357429 34 34 } 35 35 36 /* Without a sidebar, the band's text starts where the wide product grid does. */ 37 .content-area--sidebar-none 38 .site-main:has(> .nanospace-shop) 39 > .page-header--band 40 .page-header__text { 41 padding-inline: max(var(--nanospace-space), (100% - var(--nanospace-width-wide)) / 2); 42 } 43 36 44 /* Above a shortcode's wide content (My account, the shortcode cart), the title is wide too. */ 37 45 .content-area--sidebar-none -
nanospace/2.1.0/src/js/customizer-mega.js
r357206 r357429 6 6 * fields show on top-level items only (customizer.css). When a new item is saved, core gives it 7 7 * its real ID and a new control; the value moves to the setting under that ID. 8 * 9 * The preview follows without a reload: the setting reaches it by postMessage, then 10 * `nanospace-mega` asks it to re-render the header menus on the server (selective refresh, 11 * assets/js/customize-preview-mega.js). 8 12 */ 9 13 (() => { … … 18 22 ? api(key) 19 23 : api.create(key, key, values[itemId] ?? "", { 20 transport: " refresh",24 transport: "postMessage", 21 25 previewer: api.previewer, 22 26 }); … … 36 40 columns.disabled = v === ""; 37 41 }; 38 toggle.addEventListener("change", () => value.set(toggle.checked ? columns.value : "")); 42 const change = (v) => { 43 value.set(v); 44 api.previewer.send("nanospace-mega"); 45 }; 46 toggle.addEventListener("change", () => change(toggle.checked ? columns.value : "")); 39 47 columns.addEventListener("change", () => { 40 if (toggle.checked) value.set(columns.value);48 if (toggle.checked) change(columns.value); 41 49 }); 42 50 value.bind(render); -
nanospace/2.1.0/src/js/editor-layout.js
r357206 r357429 3 3 * assets/js/editor-layout.js by bin/build-theme.ts; a classic script after the wp-* packages. 4 4 * Labels and choices come from PHP (`nanospaceLayout`), shared with the classic meta box. 5 * The panel shows only for post types with the layout meta. 5 * The panel shows only for post types with the layout meta. The page header image is picked from 6 * the media library (`_nanospace_page_header_image`, 0 = the site-wide image). 6 7 */ 7 8 (() => { 8 9 const { registerPlugin } = window.wp.plugins; 9 10 const { PluginDocumentSettingPanel } = window.wp.editor; 10 const { SelectControl, ToggleControl } = window.wp.components; 11 const { MediaUpload, MediaUploadCheck } = window.wp.blockEditor; 12 const { Button, SelectControl, ToggleControl } = window.wp.components; 11 13 const { useSelect, useDispatch } = window.wp.data; 12 const h = window.wp.element.createElement; 13 /** @type {{ title: string, selects: Record<string, [string, Record<string, string>]>, hideTitle: string }} */ 14 const { title, selects, hideTitle } = window.nanospaceLayout; 14 const { createElement: h, useRef } = window.wp.element; 15 /** @type {{ title: string, selects: Record<string, [string, Record<string, string>]>, hideTitle: string, image: Record<"label" | "help" | "choose" | "replace" | "remove", string> }} */ 16 const { title, selects, hideTitle, image } = window.nanospaceLayout; 17 18 /** The page header image: a preview, a media library button and a remove button. */ 19 function ImageField({ id, onChange }) { 20 const choose = useRef(null); 21 const src = useSelect( 22 (select) => { 23 const media = id ? select("core").getMedia(id) : null; 24 return media?.media_details?.sizes?.medium?.source_url ?? media?.source_url ?? ""; 25 }, 26 [id], 27 ); 28 return h( 29 "div", 30 { 31 className: "nanospace-band-image", 32 role: "group", 33 "aria-labelledby": "nanospace-band-image-label", 34 }, 35 h("p", { id: "nanospace-band-image-label" }, image.label), 36 src ? h("img", { src, alt: "", style: { display: "block", maxWidth: "100%" } }) : null, 37 h( 38 MediaUploadCheck, 39 null, 40 h(MediaUpload, { 41 allowedTypes: ["image"], 42 value: id || undefined, 43 onSelect: (media) => onChange(media.id), 44 render: ({ open }) => 45 h( 46 Button, 47 { ref: choose, variant: "secondary", onClick: open, __next40pxDefaultSize: true }, 48 id ? image.replace : image.choose, 49 ), 50 }), 51 ), 52 id 53 ? h( 54 Button, 55 { 56 variant: "link", 57 isDestructive: true, 58 onClick: () => { 59 onChange(0); 60 choose.current?.focus(); 61 }, 62 }, 63 image.remove, 64 ) 65 : null, 66 h("p", { className: "components-base-control__help" }, image.help), 67 ); 68 } 15 69 16 70 function Panel() { … … 37 91 onChange: set("_nanospace_hide_title"), 38 92 }), 93 h(ImageField, { 94 id: meta._nanospace_page_header_image ?? 0, 95 onChange: set("_nanospace_page_header_image"), 96 }), 39 97 ); 40 98 } -
nanospace/2.1.0/style.css
r357220 r357429 5 5 Author URI: https://labinator.com/ 6 6 Description: NanoSpace is a fast, accessible multipurpose classic theme with drag-and-drop header and footer builders. It suits blogs, business sites, shops and communities, and works with WooCommerce, bbPress, BuddyPress, Elementor and Beaver Builder. Translation-ready with full RTL support. 7 Version: 2. 0.17 Version: 2.1.0 8 8 Requires at least: 7.1.4 9 9 Tested up to: 7.1 -
nanospace/2.1.0/template-parts/page-header.php
r357206 r357429 10 10 11 11 $nanospace_band = NanoSpace\Page_Header::settings(); 12 $nanospace_image = $nanospace_band['image'] ? wp_get_attachment_image( 13 $nanospace_band['image'], 12 $nanospace_id = NanoSpace\Page_Header::image(); 13 $nanospace_image = $nanospace_id ? wp_get_attachment_image( 14 $nanospace_id, 14 15 'full', 15 16 false, … … 29 30 <?php endif; ?> 30 31 <?php 31 if ( ! is_singular() ) { 32 the_archive_description( '<div class="archive-description">', '</div>' ); 33 } 32 NanoSpace\Page_Header::description(); 34 33 if ( is_active_sidebar( 'intro' ) ) { 35 34 echo '<div class="page-header__widgets">'; -
nanospace/2.1.0/woocommerce.php
r357206 r357429 1 1 <?php 2 2 /** 3 * WooCommerce's shop, product archives and single products (NanoSpace\Shop). Cart, checkout and 4 * account are ordinary pages and use page.php's layout through index.php. 3 * WooCommerce's shop, product archives and single products (NanoSpace\Shop), under the page 4 * header band where it is on (NanoSpace\Page_Header). Cart, checkout and account are ordinary 5 * pages and use page.php's layout through index.php. 5 6 * 6 7 * @package NanoSpace … … 13 14 <div class="<?php echo esc_attr( NanoSpace\Layout::content_classes() ); ?>"> 14 15 <main id="main" class="site-main"> 16 <?php NanoSpace\Page_Header::render(); ?> 15 17 <div class="nanospace-shop"> 16 18 <?php woocommerce_content(); ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)