Plugin Updates
This commit is contained in:
@@ -4,6 +4,19 @@
|
||||
"name": "core/navigation",
|
||||
"title": "Navigation",
|
||||
"category": "theme",
|
||||
"allowedBlocks": [
|
||||
"core/navigation-link",
|
||||
"core/search",
|
||||
"core/social-links",
|
||||
"core/page-list",
|
||||
"core/spacer",
|
||||
"core/home-link",
|
||||
"core/site-title",
|
||||
"core/site-logo",
|
||||
"core/navigation-submenu",
|
||||
"core/loginout",
|
||||
"core/buttons"
|
||||
],
|
||||
"description": "A collection of blocks that allow visitors to get around your site.",
|
||||
"keywords": [ "menu", "navigation", "links" ],
|
||||
"textdomain": "default",
|
||||
@@ -133,9 +146,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactivity": true
|
||||
"interactivity": true,
|
||||
"renaming": false
|
||||
},
|
||||
"viewScript": "file:./view.min.js",
|
||||
"editorStyle": "wp-block-navigation-editor",
|
||||
"style": "wp-block-navigation"
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
}
|
||||
.block-library-colors-selector .block-library-colors-selector__state-selection{
|
||||
border-radius:11px;
|
||||
box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);
|
||||
box-shadow:inset 0 0 0 1px #0003;
|
||||
height:22px;
|
||||
line-height:20px;
|
||||
margin-left:auto;
|
||||
@@ -125,7 +125,7 @@
|
||||
}
|
||||
|
||||
.wp-block-navigation .wp-block .wp-block .block-editor-button-block-appender{
|
||||
background-color:transparent;
|
||||
background-color:initial;
|
||||
color:#1e1e1e;
|
||||
}
|
||||
@keyframes loadingpulse{
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
.wp-block-navigation-placeholder__preview{
|
||||
align-items:center;
|
||||
background:transparent;
|
||||
background:#0000;
|
||||
color:currentColor;
|
||||
display:flex;
|
||||
font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
|
||||
@@ -249,8 +249,8 @@
|
||||
padding:0 0 0 6px;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions__indicator svg{
|
||||
fill:currentColor;
|
||||
margin-left:4px;
|
||||
fill:currentColor;
|
||||
}
|
||||
|
||||
.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset{
|
||||
@@ -401,7 +401,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
.wp-block-navigation__overlay-menu-preview.open{
|
||||
background-color:#fff;
|
||||
box-shadow:inset 0 0 0 1px #e0e0e0;
|
||||
outline:1px solid transparent;
|
||||
outline:1px solid #0000;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions hr+hr,.wp-block-navigation__toolbar-menu-selector.components-toolbar-group:empty{
|
||||
@@ -441,7 +441,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
|
||||
.wp-block-navigation__menu-inspector-controls{
|
||||
overflow-x:auto;
|
||||
scrollbar-color:transparent transparent;
|
||||
scrollbar-color:#0000 #0000;
|
||||
scrollbar-gutter:stable both-edges;
|
||||
scrollbar-width:thin;
|
||||
will-change:transform;
|
||||
@@ -451,23 +451,23 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
width:12px;
|
||||
}
|
||||
.wp-block-navigation__menu-inspector-controls::-webkit-scrollbar-track{
|
||||
background-color:transparent;
|
||||
background-color:initial;
|
||||
}
|
||||
.wp-block-navigation__menu-inspector-controls::-webkit-scrollbar-thumb{
|
||||
background-clip:padding-box;
|
||||
background-color:transparent;
|
||||
border:3px solid transparent;
|
||||
background-color:initial;
|
||||
border:3px solid #0000;
|
||||
border-radius:8px;
|
||||
}
|
||||
.wp-block-navigation__menu-inspector-controls:focus-within::-webkit-scrollbar-thumb,.wp-block-navigation__menu-inspector-controls:focus::-webkit-scrollbar-thumb,.wp-block-navigation__menu-inspector-controls:hover::-webkit-scrollbar-thumb{
|
||||
background-color:#949494;
|
||||
}
|
||||
.wp-block-navigation__menu-inspector-controls:focus,.wp-block-navigation__menu-inspector-controls:focus-within,.wp-block-navigation__menu-inspector-controls:hover{
|
||||
scrollbar-color:#949494 transparent;
|
||||
scrollbar-color:#949494 #0000;
|
||||
}
|
||||
@media (hover:none){
|
||||
.wp-block-navigation__menu-inspector-controls{
|
||||
scrollbar-color:#949494 transparent;
|
||||
scrollbar-color:#949494 #0000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -84,7 +84,7 @@
|
||||
}
|
||||
.block-library-colors-selector .block-library-colors-selector__state-selection{
|
||||
border-radius:11px;
|
||||
box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);
|
||||
box-shadow:inset 0 0 0 1px #0003;
|
||||
height:22px;
|
||||
line-height:20px;
|
||||
margin-left:auto;
|
||||
@@ -125,7 +125,7 @@
|
||||
}
|
||||
|
||||
.wp-block-navigation .wp-block .wp-block .block-editor-button-block-appender{
|
||||
background-color:transparent;
|
||||
background-color:initial;
|
||||
color:#1e1e1e;
|
||||
}
|
||||
@keyframes loadingpulse{
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
.wp-block-navigation-placeholder__preview{
|
||||
align-items:center;
|
||||
background:transparent;
|
||||
background:#0000;
|
||||
color:currentColor;
|
||||
display:flex;
|
||||
font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
|
||||
@@ -249,8 +249,8 @@
|
||||
padding:0 6px 0 0;
|
||||
}
|
||||
.wp-block-navigation-placeholder__actions__indicator svg{
|
||||
fill:currentColor;
|
||||
margin-right:4px;
|
||||
fill:currentColor;
|
||||
}
|
||||
|
||||
.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset{
|
||||
@@ -401,7 +401,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
.wp-block-navigation__overlay-menu-preview.open{
|
||||
background-color:#fff;
|
||||
box-shadow:inset 0 0 0 1px #e0e0e0;
|
||||
outline:1px solid transparent;
|
||||
outline:1px solid #0000;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions hr+hr,.wp-block-navigation__toolbar-menu-selector.components-toolbar-group:empty{
|
||||
@@ -441,7 +441,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
|
||||
.wp-block-navigation__menu-inspector-controls{
|
||||
overflow-x:auto;
|
||||
scrollbar-color:transparent transparent;
|
||||
scrollbar-color:#0000 #0000;
|
||||
scrollbar-gutter:stable both-edges;
|
||||
scrollbar-width:thin;
|
||||
will-change:transform;
|
||||
@@ -451,23 +451,23 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
width:12px;
|
||||
}
|
||||
.wp-block-navigation__menu-inspector-controls::-webkit-scrollbar-track{
|
||||
background-color:transparent;
|
||||
background-color:initial;
|
||||
}
|
||||
.wp-block-navigation__menu-inspector-controls::-webkit-scrollbar-thumb{
|
||||
background-clip:padding-box;
|
||||
background-color:transparent;
|
||||
border:3px solid transparent;
|
||||
background-color:initial;
|
||||
border:3px solid #0000;
|
||||
border-radius:8px;
|
||||
}
|
||||
.wp-block-navigation__menu-inspector-controls:focus-within::-webkit-scrollbar-thumb,.wp-block-navigation__menu-inspector-controls:focus::-webkit-scrollbar-thumb,.wp-block-navigation__menu-inspector-controls:hover::-webkit-scrollbar-thumb{
|
||||
background-color:#949494;
|
||||
}
|
||||
.wp-block-navigation__menu-inspector-controls:focus,.wp-block-navigation__menu-inspector-controls:focus-within,.wp-block-navigation__menu-inspector-controls:hover{
|
||||
scrollbar-color:#949494 transparent;
|
||||
scrollbar-color:#949494 #0000;
|
||||
}
|
||||
@media (hover:none){
|
||||
.wp-block-navigation__menu-inspector-controls{
|
||||
scrollbar-color:#949494 transparent;
|
||||
scrollbar-color:#949494 #0000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,10 +1,10 @@
|
||||
.wp-block-navigation{
|
||||
position:relative;
|
||||
--navigation-layout-justification-setting:flex-start;
|
||||
--navigation-layout-direction:row;
|
||||
--navigation-layout-wrap:wrap;
|
||||
--navigation-layout-justify:flex-start;
|
||||
--navigation-layout-align:center;
|
||||
position:relative;
|
||||
}
|
||||
.wp-block-navigation ul{
|
||||
margin-bottom:0;
|
||||
@@ -57,8 +57,8 @@
|
||||
width:.6em;
|
||||
}
|
||||
.wp-block-navigation .wp-block-navigation__submenu-icon svg{
|
||||
stroke:currentColor;
|
||||
display:inline-block;
|
||||
stroke:currentColor;
|
||||
height:inherit;
|
||||
margin-top:.075em;
|
||||
width:inherit;
|
||||
@@ -124,7 +124,7 @@
|
||||
top:-1px;
|
||||
}
|
||||
.wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container:before{
|
||||
background:transparent;
|
||||
background:#0000;
|
||||
content:"";
|
||||
display:block;
|
||||
height:100%;
|
||||
@@ -139,23 +139,7 @@
|
||||
transform:rotate(90deg);
|
||||
}
|
||||
}
|
||||
.wp-block-navigation .has-child:not(.open-on-click):hover>.wp-block-navigation__submenu-container{
|
||||
height:auto;
|
||||
min-width:200px;
|
||||
opacity:1;
|
||||
overflow:visible;
|
||||
visibility:visible;
|
||||
width:auto;
|
||||
}
|
||||
.wp-block-navigation .has-child:not(.open-on-click):not(.open-on-hover-click):focus-within>.wp-block-navigation__submenu-container{
|
||||
height:auto;
|
||||
min-width:200px;
|
||||
opacity:1;
|
||||
overflow:visible;
|
||||
visibility:visible;
|
||||
width:auto;
|
||||
}
|
||||
.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true]~.wp-block-navigation__submenu-container{
|
||||
.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true]~.wp-block-navigation__submenu-container,.wp-block-navigation .has-child:not(.open-on-click):hover>.wp-block-navigation__submenu-container,.wp-block-navigation .has-child:not(.open-on-click):not(.open-on-hover-click):focus-within>.wp-block-navigation__submenu-container{
|
||||
height:auto;
|
||||
min-width:200px;
|
||||
opacity:1;
|
||||
@@ -184,7 +168,7 @@
|
||||
}
|
||||
|
||||
button.wp-block-navigation-item__content{
|
||||
background-color:transparent;
|
||||
background-color:initial;
|
||||
border:none;
|
||||
color:currentColor;
|
||||
font-family:inherit;
|
||||
@@ -202,11 +186,16 @@ button.wp-block-navigation-item__content{
|
||||
|
||||
.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle{
|
||||
padding-left:.85em;
|
||||
padding-right:0;
|
||||
}
|
||||
.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle+.wp-block-navigation__submenu-icon{
|
||||
margin-right:-.6em;
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.wp-block-navigation-item.open-on-click button.wp-block-navigation-item__content:not(.wp-block-navigation-submenu__toggle){
|
||||
padding:0;
|
||||
}
|
||||
.wp-block-navigation .wp-block-page-list,.wp-block-navigation__container,.wp-block-navigation__responsive-close,.wp-block-navigation__responsive-container,.wp-block-navigation__responsive-container-content,.wp-block-navigation__responsive-dialog{
|
||||
gap:inherit;
|
||||
}
|
||||
@@ -234,7 +223,7 @@ button.wp-block-navigation-item__content{
|
||||
|
||||
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container{
|
||||
background-color:#fff;
|
||||
border:1px solid rgba(0,0,0,.15);
|
||||
border:1px solid #00000026;
|
||||
}
|
||||
|
||||
.wp-block-navigation.has-background .wp-block-navigation__submenu-container{
|
||||
@@ -351,7 +340,7 @@ button.wp-block-navigation-item__content{
|
||||
flex-direction:column;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list{
|
||||
background:transparent !important;
|
||||
background:#0000 !important;
|
||||
color:inherit !important;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container{
|
||||
@@ -388,7 +377,7 @@ button.wp-block-navigation-item__content{
|
||||
}
|
||||
|
||||
.wp-block-navigation__responsive-container-close,.wp-block-navigation__responsive-container-open{
|
||||
background:transparent;
|
||||
background:#0000;
|
||||
border:none;
|
||||
color:currentColor;
|
||||
cursor:pointer;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,10 +1,10 @@
|
||||
.wp-block-navigation{
|
||||
position:relative;
|
||||
--navigation-layout-justification-setting:flex-start;
|
||||
--navigation-layout-direction:row;
|
||||
--navigation-layout-wrap:wrap;
|
||||
--navigation-layout-justify:flex-start;
|
||||
--navigation-layout-align:center;
|
||||
position:relative;
|
||||
}
|
||||
.wp-block-navigation ul{
|
||||
margin-bottom:0;
|
||||
@@ -57,8 +57,8 @@
|
||||
width:.6em;
|
||||
}
|
||||
.wp-block-navigation .wp-block-navigation__submenu-icon svg{
|
||||
stroke:currentColor;
|
||||
display:inline-block;
|
||||
stroke:currentColor;
|
||||
height:inherit;
|
||||
margin-top:.075em;
|
||||
width:inherit;
|
||||
@@ -124,7 +124,7 @@
|
||||
top:-1px;
|
||||
}
|
||||
.wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container:before{
|
||||
background:transparent;
|
||||
background:#0000;
|
||||
content:"";
|
||||
display:block;
|
||||
height:100%;
|
||||
@@ -139,23 +139,7 @@
|
||||
transform:rotate(-90deg);
|
||||
}
|
||||
}
|
||||
.wp-block-navigation .has-child:not(.open-on-click):hover>.wp-block-navigation__submenu-container{
|
||||
height:auto;
|
||||
min-width:200px;
|
||||
opacity:1;
|
||||
overflow:visible;
|
||||
visibility:visible;
|
||||
width:auto;
|
||||
}
|
||||
.wp-block-navigation .has-child:not(.open-on-click):not(.open-on-hover-click):focus-within>.wp-block-navigation__submenu-container{
|
||||
height:auto;
|
||||
min-width:200px;
|
||||
opacity:1;
|
||||
overflow:visible;
|
||||
visibility:visible;
|
||||
width:auto;
|
||||
}
|
||||
.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true]~.wp-block-navigation__submenu-container{
|
||||
.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true]~.wp-block-navigation__submenu-container,.wp-block-navigation .has-child:not(.open-on-click):hover>.wp-block-navigation__submenu-container,.wp-block-navigation .has-child:not(.open-on-click):not(.open-on-hover-click):focus-within>.wp-block-navigation__submenu-container{
|
||||
height:auto;
|
||||
min-width:200px;
|
||||
opacity:1;
|
||||
@@ -184,7 +168,7 @@
|
||||
}
|
||||
|
||||
button.wp-block-navigation-item__content{
|
||||
background-color:transparent;
|
||||
background-color:initial;
|
||||
border:none;
|
||||
color:currentColor;
|
||||
font-family:inherit;
|
||||
@@ -201,12 +185,17 @@ button.wp-block-navigation-item__content{
|
||||
}
|
||||
|
||||
.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle{
|
||||
padding-left:0;
|
||||
padding-right:.85em;
|
||||
}
|
||||
.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle+.wp-block-navigation__submenu-icon{
|
||||
margin-left:-.6em;
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.wp-block-navigation-item.open-on-click button.wp-block-navigation-item__content:not(.wp-block-navigation-submenu__toggle){
|
||||
padding:0;
|
||||
}
|
||||
.wp-block-navigation .wp-block-page-list,.wp-block-navigation__container,.wp-block-navigation__responsive-close,.wp-block-navigation__responsive-container,.wp-block-navigation__responsive-container-content,.wp-block-navigation__responsive-dialog{
|
||||
gap:inherit;
|
||||
}
|
||||
@@ -234,7 +223,7 @@ button.wp-block-navigation-item__content{
|
||||
|
||||
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container{
|
||||
background-color:#fff;
|
||||
border:1px solid rgba(0,0,0,.15);
|
||||
border:1px solid #00000026;
|
||||
}
|
||||
|
||||
.wp-block-navigation.has-background .wp-block-navigation__submenu-container{
|
||||
@@ -351,7 +340,7 @@ button.wp-block-navigation-item__content{
|
||||
flex-direction:column;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list{
|
||||
background:transparent !important;
|
||||
background:#0000 !important;
|
||||
color:inherit !important;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container{
|
||||
@@ -388,7 +377,7 @@ button.wp-block-navigation-item__content{
|
||||
}
|
||||
|
||||
.wp-block-navigation__responsive-container-close,.wp-block-navigation__responsive-container-open{
|
||||
background:transparent;
|
||||
background:#0000;
|
||||
border:none;
|
||||
color:currentColor;
|
||||
cursor:pointer;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'b3eba25769c9fe5ec0fa');
|
||||
<?php return array('dependencies' => array(), 'version' => 'c7aadf427ad3311e0624');
|
||||
|
||||
@@ -1,10 +1,35 @@
|
||||
"use strict";
|
||||
(self["__WordPressPrivateInteractivityAPI__"] = self["__WordPressPrivateInteractivityAPI__"] || []).push([[3],{
|
||||
import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
|
||||
/******/ // The require scope
|
||||
/******/ var __webpack_require__ = {};
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
|
||||
/***/ 932:
|
||||
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var _wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(754);
|
||||
;// CONCATENATED MODULE: external "@wordpress/interactivity"
|
||||
var x = (y) => {
|
||||
var x = {}; __webpack_require__.d(x, y); return x
|
||||
}
|
||||
var y = (x) => (() => (x))
|
||||
const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/view.js
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@@ -15,199 +40,181 @@ const focusableSelectors = ['a[href]', 'input:not([disabled]):not([type="hidden"
|
||||
// when the user taps in the body. It can be removed once we add an overlay to
|
||||
// capture the clicks, instead of relying on the focusout event.
|
||||
document.addEventListener('click', () => {});
|
||||
const openMenu = (store, menuOpenedOn) => {
|
||||
const {
|
||||
context,
|
||||
selectors
|
||||
} = store;
|
||||
selectors.core.navigation.menuOpenedBy(store)[menuOpenedOn] = true;
|
||||
if (context.core.navigation.type === 'overlay') {
|
||||
// Add a `has-modal-open` class to the <html> root.
|
||||
document.documentElement.classList.add('has-modal-open');
|
||||
}
|
||||
};
|
||||
const closeMenu = (store, menuClosedOn) => {
|
||||
const {
|
||||
context,
|
||||
selectors
|
||||
} = store;
|
||||
selectors.core.navigation.menuOpenedBy(store)[menuClosedOn] = false;
|
||||
// Check if the menu is still open or not.
|
||||
if (!selectors.core.navigation.isMenuOpen(store)) {
|
||||
if (context.core.navigation.modal?.contains(window.document.activeElement)) {
|
||||
context.core.navigation.previousFocus?.focus();
|
||||
}
|
||||
context.core.navigation.modal = null;
|
||||
context.core.navigation.previousFocus = null;
|
||||
if (context.core.navigation.type === 'overlay') {
|
||||
document.documentElement.classList.remove('has-modal-open');
|
||||
}
|
||||
}
|
||||
};
|
||||
(0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__/* .store */ .h)({
|
||||
effects: {
|
||||
core: {
|
||||
navigation: {
|
||||
initMenu: store => {
|
||||
const {
|
||||
context,
|
||||
selectors,
|
||||
ref
|
||||
} = store;
|
||||
if (selectors.core.navigation.isMenuOpen(store)) {
|
||||
const focusableElements = ref.querySelectorAll(focusableSelectors);
|
||||
context.core.navigation.modal = ref;
|
||||
context.core.navigation.firstFocusableElement = focusableElements[0];
|
||||
context.core.navigation.lastFocusableElement = focusableElements[focusableElements.length - 1];
|
||||
}
|
||||
},
|
||||
focusFirstElement: store => {
|
||||
const {
|
||||
selectors,
|
||||
ref
|
||||
} = store;
|
||||
if (selectors.core.navigation.isMenuOpen(store)) {
|
||||
ref.querySelector('.wp-block-navigation-item > *:first-child').focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
selectors: {
|
||||
core: {
|
||||
navigation: {
|
||||
roleAttribute: store => {
|
||||
const {
|
||||
context,
|
||||
selectors
|
||||
} = store;
|
||||
return context.core.navigation.type === 'overlay' && selectors.core.navigation.isMenuOpen(store) ? 'dialog' : null;
|
||||
},
|
||||
ariaModal: store => {
|
||||
const {
|
||||
context,
|
||||
selectors
|
||||
} = store;
|
||||
return context.core.navigation.type === 'overlay' && selectors.core.navigation.isMenuOpen(store) ? 'true' : null;
|
||||
},
|
||||
ariaLabel: store => {
|
||||
const {
|
||||
context,
|
||||
selectors
|
||||
} = store;
|
||||
return context.core.navigation.type === 'overlay' && selectors.core.navigation.isMenuOpen(store) ? context.core.navigation.ariaLabel : null;
|
||||
},
|
||||
isMenuOpen: ({
|
||||
context
|
||||
}) =>
|
||||
// The menu is opened if either `click`, `hover` or `focus` is true.
|
||||
Object.values(context.core.navigation[context.core.navigation.type === 'overlay' ? 'overlayOpenedBy' : 'submenuOpenedBy']).filter(Boolean).length > 0,
|
||||
menuOpenedBy: ({
|
||||
context
|
||||
}) => context.core.navigation[context.core.navigation.type === 'overlay' ? 'overlayOpenedBy' : 'submenuOpenedBy']
|
||||
}
|
||||
const {
|
||||
state,
|
||||
actions
|
||||
} = (0,interactivity_namespaceObject.store)('core/navigation', {
|
||||
state: {
|
||||
get roleAttribute() {
|
||||
const ctx = (0,interactivity_namespaceObject.getContext)();
|
||||
return ctx.type === 'overlay' && state.isMenuOpen ? 'dialog' : null;
|
||||
},
|
||||
get ariaModal() {
|
||||
const ctx = (0,interactivity_namespaceObject.getContext)();
|
||||
return ctx.type === 'overlay' && state.isMenuOpen ? 'true' : null;
|
||||
},
|
||||
get ariaLabel() {
|
||||
const ctx = (0,interactivity_namespaceObject.getContext)();
|
||||
return ctx.type === 'overlay' && state.isMenuOpen ? ctx.ariaLabel : null;
|
||||
},
|
||||
get isMenuOpen() {
|
||||
// The menu is opened if either `click`, `hover` or `focus` is true.
|
||||
return Object.values(state.menuOpenedBy).filter(Boolean).length > 0;
|
||||
},
|
||||
get menuOpenedBy() {
|
||||
const ctx = (0,interactivity_namespaceObject.getContext)();
|
||||
return ctx.type === 'overlay' ? ctx.overlayOpenedBy : ctx.submenuOpenedBy;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
core: {
|
||||
navigation: {
|
||||
openMenuOnHover(store) {
|
||||
const {
|
||||
navigation
|
||||
} = store.context.core;
|
||||
if (navigation.type === 'submenu' &&
|
||||
// Only open on hover if the overlay is closed.
|
||||
Object.values(navigation.overlayOpenedBy || {}).filter(Boolean).length === 0) openMenu(store, 'hover');
|
||||
},
|
||||
closeMenuOnHover(store) {
|
||||
closeMenu(store, 'hover');
|
||||
},
|
||||
openMenuOnClick(store) {
|
||||
const {
|
||||
context,
|
||||
ref
|
||||
} = store;
|
||||
context.core.navigation.previousFocus = ref;
|
||||
openMenu(store, 'click');
|
||||
},
|
||||
closeMenuOnClick(store) {
|
||||
closeMenu(store, 'click');
|
||||
closeMenu(store, 'focus');
|
||||
},
|
||||
openMenuOnFocus(store) {
|
||||
openMenu(store, 'focus');
|
||||
},
|
||||
toggleMenuOnClick: store => {
|
||||
const {
|
||||
selectors,
|
||||
context,
|
||||
ref
|
||||
} = store;
|
||||
// Safari won't send focus to the clicked element, so we need to manually place it: https://bugs.webkit.org/show_bug.cgi?id=22261
|
||||
if (window.document.activeElement !== ref) ref.focus();
|
||||
const menuOpenedBy = selectors.core.navigation.menuOpenedBy(store);
|
||||
if (menuOpenedBy.click || menuOpenedBy.focus) {
|
||||
closeMenu(store, 'click');
|
||||
closeMenu(store, 'focus');
|
||||
} else {
|
||||
context.core.navigation.previousFocus = ref;
|
||||
openMenu(store, 'click');
|
||||
}
|
||||
},
|
||||
handleMenuKeydown: store => {
|
||||
const {
|
||||
context,
|
||||
selectors,
|
||||
event
|
||||
} = store;
|
||||
if (selectors.core.navigation.menuOpenedBy(store).click) {
|
||||
// If Escape close the menu.
|
||||
if (event?.key === 'Escape') {
|
||||
closeMenu(store, 'click');
|
||||
closeMenu(store, 'focus');
|
||||
return;
|
||||
}
|
||||
openMenuOnHover() {
|
||||
const {
|
||||
type,
|
||||
overlayOpenedBy
|
||||
} = (0,interactivity_namespaceObject.getContext)();
|
||||
if (type === 'submenu' &&
|
||||
// Only open on hover if the overlay is closed.
|
||||
Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) {
|
||||
actions.openMenu('hover');
|
||||
}
|
||||
},
|
||||
closeMenuOnHover() {
|
||||
const {
|
||||
type,
|
||||
overlayOpenedBy
|
||||
} = (0,interactivity_namespaceObject.getContext)();
|
||||
if (type === 'submenu' &&
|
||||
// Only close on hover if the overlay is closed.
|
||||
Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) {
|
||||
actions.closeMenu('hover');
|
||||
}
|
||||
},
|
||||
openMenuOnClick() {
|
||||
const ctx = (0,interactivity_namespaceObject.getContext)();
|
||||
const {
|
||||
ref
|
||||
} = (0,interactivity_namespaceObject.getElement)();
|
||||
ctx.previousFocus = ref;
|
||||
actions.openMenu('click');
|
||||
},
|
||||
closeMenuOnClick() {
|
||||
actions.closeMenu('click');
|
||||
actions.closeMenu('focus');
|
||||
},
|
||||
openMenuOnFocus() {
|
||||
actions.openMenu('focus');
|
||||
},
|
||||
toggleMenuOnClick() {
|
||||
const ctx = (0,interactivity_namespaceObject.getContext)();
|
||||
const {
|
||||
ref
|
||||
} = (0,interactivity_namespaceObject.getElement)();
|
||||
// Safari won't send focus to the clicked element, so we need to manually place it: https://bugs.webkit.org/show_bug.cgi?id=22261
|
||||
if (window.document.activeElement !== ref) ref.focus();
|
||||
const {
|
||||
menuOpenedBy
|
||||
} = state;
|
||||
if (menuOpenedBy.click || menuOpenedBy.focus) {
|
||||
actions.closeMenu('click');
|
||||
actions.closeMenu('focus');
|
||||
} else {
|
||||
ctx.previousFocus = ref;
|
||||
actions.openMenu('click');
|
||||
}
|
||||
},
|
||||
handleMenuKeydown(event) {
|
||||
const {
|
||||
type,
|
||||
firstFocusableElement,
|
||||
lastFocusableElement
|
||||
} = (0,interactivity_namespaceObject.getContext)();
|
||||
if (state.menuOpenedBy.click) {
|
||||
// If Escape close the menu.
|
||||
if (event?.key === 'Escape') {
|
||||
actions.closeMenu('click');
|
||||
actions.closeMenu('focus');
|
||||
return;
|
||||
}
|
||||
|
||||
// Trap focus if it is an overlay (main menu).
|
||||
if (context.core.navigation.type === 'overlay' && event.key === 'Tab') {
|
||||
// If shift + tab it change the direction.
|
||||
if (event.shiftKey && window.document.activeElement === context.core.navigation.firstFocusableElement) {
|
||||
event.preventDefault();
|
||||
context.core.navigation.lastFocusableElement.focus();
|
||||
} else if (!event.shiftKey && window.document.activeElement === context.core.navigation.lastFocusableElement) {
|
||||
event.preventDefault();
|
||||
context.core.navigation.firstFocusableElement.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleMenuFocusout: store => {
|
||||
const {
|
||||
context,
|
||||
event
|
||||
} = store;
|
||||
// If focus is outside modal, and in the document, close menu
|
||||
// event.target === The element losing focus
|
||||
// event.relatedTarget === The element receiving focus (if any)
|
||||
// When focusout is outsite the document,
|
||||
// `window.document.activeElement` doesn't change.
|
||||
|
||||
// The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari.
|
||||
if (event.relatedTarget === null || !context.core.navigation.modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement) {
|
||||
closeMenu(store, 'click');
|
||||
closeMenu(store, 'focus');
|
||||
// Trap focus if it is an overlay (main menu).
|
||||
if (type === 'overlay' && event.key === 'Tab') {
|
||||
// If shift + tab it change the direction.
|
||||
if (event.shiftKey && window.document.activeElement === firstFocusableElement) {
|
||||
event.preventDefault();
|
||||
lastFocusableElement.focus();
|
||||
} else if (!event.shiftKey && window.document.activeElement === lastFocusableElement) {
|
||||
event.preventDefault();
|
||||
firstFocusableElement.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleMenuFocusout(event) {
|
||||
const {
|
||||
modal
|
||||
} = (0,interactivity_namespaceObject.getContext)();
|
||||
// If focus is outside modal, and in the document, close menu
|
||||
// event.target === The element losing focus
|
||||
// event.relatedTarget === The element receiving focus (if any)
|
||||
// When focusout is outsite the document,
|
||||
// `window.document.activeElement` doesn't change.
|
||||
|
||||
// The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari.
|
||||
if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement) {
|
||||
actions.closeMenu('click');
|
||||
actions.closeMenu('focus');
|
||||
}
|
||||
},
|
||||
openMenu(menuOpenedOn = 'click') {
|
||||
const {
|
||||
type
|
||||
} = (0,interactivity_namespaceObject.getContext)();
|
||||
state.menuOpenedBy[menuOpenedOn] = true;
|
||||
if (type === 'overlay') {
|
||||
// Add a `has-modal-open` class to the <html> root.
|
||||
document.documentElement.classList.add('has-modal-open');
|
||||
}
|
||||
},
|
||||
closeMenu(menuClosedOn = 'click') {
|
||||
const ctx = (0,interactivity_namespaceObject.getContext)();
|
||||
state.menuOpenedBy[menuClosedOn] = false;
|
||||
// Check if the menu is still open or not.
|
||||
if (!state.isMenuOpen) {
|
||||
if (ctx.modal?.contains(window.document.activeElement)) {
|
||||
ctx.previousFocus?.focus();
|
||||
}
|
||||
ctx.modal = null;
|
||||
ctx.previousFocus = null;
|
||||
if (ctx.type === 'overlay') {
|
||||
document.documentElement.classList.remove('has-modal-open');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
initMenu() {
|
||||
const ctx = (0,interactivity_namespaceObject.getContext)();
|
||||
const {
|
||||
ref
|
||||
} = (0,interactivity_namespaceObject.getElement)();
|
||||
if (state.isMenuOpen) {
|
||||
const focusableElements = ref.querySelectorAll(focusableSelectors);
|
||||
ctx.modal = ref;
|
||||
ctx.firstFocusableElement = focusableElements[0];
|
||||
ctx.lastFocusableElement = focusableElements[focusableElements.length - 1];
|
||||
}
|
||||
},
|
||||
focusFirstElement() {
|
||||
const {
|
||||
ref
|
||||
} = (0,interactivity_namespaceObject.getElement)();
|
||||
if (state.isMenuOpen) {
|
||||
const focusableElements = ref.querySelectorAll(focusableSelectors);
|
||||
focusableElements?.[0]?.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
lock: true
|
||||
});
|
||||
|
||||
/***/ })
|
||||
|
||||
},
|
||||
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
||||
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
||||
/******/ var __webpack_exports__ = (__webpack_exec__(932));
|
||||
/******/ }
|
||||
]);
|
||||
@@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'e3d6f3216904b5b42831');
|
||||
<?php return array('dependencies' => array(), 'version' => 'dfccca53c03e01ca94e5');
|
||||
|
||||
2
wp/wp-includes/blocks/navigation/view.min.js
vendored
2
wp/wp-includes/blocks/navigation/view.min.js
vendored
@@ -1 +1 @@
|
||||
"use strict";(self.__WordPressPrivateInteractivityAPI__=self.__WordPressPrivateInteractivityAPI__||[]).push([[3],{932:function(e,n,o){var t=o(754);const a=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];document.addEventListener("click",(()=>{}));const i=(e,n)=>{const{context:o,selectors:t}=e;t.core.navigation.menuOpenedBy(e)[n]=!0,"overlay"===o.core.navigation.type&&document.documentElement.classList.add("has-modal-open")},c=(e,n)=>{const{context:o,selectors:t}=e;t.core.navigation.menuOpenedBy(e)[n]=!1,t.core.navigation.isMenuOpen(e)||(o.core.navigation.modal?.contains(window.document.activeElement)&&o.core.navigation.previousFocus?.focus(),o.core.navigation.modal=null,o.core.navigation.previousFocus=null,"overlay"===o.core.navigation.type&&document.documentElement.classList.remove("has-modal-open"))};(0,t.h)({effects:{core:{navigation:{initMenu:e=>{const{context:n,selectors:o,ref:t}=e;if(o.core.navigation.isMenuOpen(e)){const e=t.querySelectorAll(a);n.core.navigation.modal=t,n.core.navigation.firstFocusableElement=e[0],n.core.navigation.lastFocusableElement=e[e.length-1]}},focusFirstElement:e=>{const{selectors:n,ref:o}=e;n.core.navigation.isMenuOpen(e)&&o.querySelector(".wp-block-navigation-item > *:first-child").focus()}}}},selectors:{core:{navigation:{roleAttribute:e=>{const{context:n,selectors:o}=e;return"overlay"===n.core.navigation.type&&o.core.navigation.isMenuOpen(e)?"dialog":null},ariaModal:e=>{const{context:n,selectors:o}=e;return"overlay"===n.core.navigation.type&&o.core.navigation.isMenuOpen(e)?"true":null},ariaLabel:e=>{const{context:n,selectors:o}=e;return"overlay"===n.core.navigation.type&&o.core.navigation.isMenuOpen(e)?n.core.navigation.ariaLabel:null},isMenuOpen:({context:e})=>Object.values(e.core.navigation["overlay"===e.core.navigation.type?"overlayOpenedBy":"submenuOpenedBy"]).filter(Boolean).length>0,menuOpenedBy:({context:e})=>e.core.navigation["overlay"===e.core.navigation.type?"overlayOpenedBy":"submenuOpenedBy"]}}},actions:{core:{navigation:{openMenuOnHover(e){const{navigation:n}=e.context.core;"submenu"===n.type&&0===Object.values(n.overlayOpenedBy||{}).filter(Boolean).length&&i(e,"hover")},closeMenuOnHover(e){c(e,"hover")},openMenuOnClick(e){const{context:n,ref:o}=e;n.core.navigation.previousFocus=o,i(e,"click")},closeMenuOnClick(e){c(e,"click"),c(e,"focus")},openMenuOnFocus(e){i(e,"focus")},toggleMenuOnClick:e=>{const{selectors:n,context:o,ref:t}=e;window.document.activeElement!==t&&t.focus();const a=n.core.navigation.menuOpenedBy(e);a.click||a.focus?(c(e,"click"),c(e,"focus")):(o.core.navigation.previousFocus=t,i(e,"click"))},handleMenuKeydown:e=>{const{context:n,selectors:o,event:t}=e;if(o.core.navigation.menuOpenedBy(e).click){if("Escape"===t?.key)return c(e,"click"),void c(e,"focus");"overlay"===n.core.navigation.type&&"Tab"===t.key&&(t.shiftKey&&window.document.activeElement===n.core.navigation.firstFocusableElement?(t.preventDefault(),n.core.navigation.lastFocusableElement.focus()):t.shiftKey||window.document.activeElement!==n.core.navigation.lastFocusableElement||(t.preventDefault(),n.core.navigation.firstFocusableElement.focus()))}},handleMenuFocusout:e=>{const{context:n,event:o}=e;(null===o.relatedTarget||!n.core.navigation.modal?.contains(o.relatedTarget)&&o.target!==window.document.activeElement)&&(c(e,"click"),c(e,"focus"))}}}}})}},function(e){var n;n=932,e(e.s=n)}]);
|
||||
import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),o=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];document.addEventListener("click",(()=>{}));const{state:l,actions:c}=(0,n.store)("core/navigation",{state:{get roleAttribute(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"dialog":null},get ariaModal(){return"overlay"===(0,n.getContext)().type&&l.isMenuOpen?"true":null},get ariaLabel(){const e=(0,n.getContext)();return"overlay"===e.type&&l.isMenuOpen?e.ariaLabel:null},get isMenuOpen(){return Object.values(l.menuOpenedBy).filter(Boolean).length>0},get menuOpenedBy(){const e=(0,n.getContext)();return"overlay"===e.type?e.overlayOpenedBy:e.submenuOpenedBy}},actions:{openMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.openMenu("hover")},closeMenuOnHover(){const{type:e,overlayOpenedBy:t}=(0,n.getContext)();"submenu"===e&&0===Object.values(t||{}).filter(Boolean).length&&c.closeMenu("hover")},openMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();e.previousFocus=t,c.openMenu("click")},closeMenuOnClick(){c.closeMenu("click"),c.closeMenu("focus")},openMenuOnFocus(){c.openMenu("focus")},toggleMenuOnClick(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();window.document.activeElement!==t&&t.focus();const{menuOpenedBy:o}=l;o.click||o.focus?(c.closeMenu("click"),c.closeMenu("focus")):(e.previousFocus=t,c.openMenu("click"))},handleMenuKeydown(e){const{type:t,firstFocusableElement:o,lastFocusableElement:u}=(0,n.getContext)();if(l.menuOpenedBy.click){if("Escape"===e?.key)return c.closeMenu("click"),void c.closeMenu("focus");"overlay"===t&&"Tab"===e.key&&(e.shiftKey&&window.document.activeElement===o?(e.preventDefault(),u.focus()):e.shiftKey||window.document.activeElement!==u||(e.preventDefault(),o.focus()))}},handleMenuFocusout(e){const{modal:t}=(0,n.getContext)();(null===e.relatedTarget||!t?.contains(e.relatedTarget)&&e.target!==window.document.activeElement)&&(c.closeMenu("click"),c.closeMenu("focus"))},openMenu(e="click"){const{type:t}=(0,n.getContext)();l.menuOpenedBy[e]=!0,"overlay"===t&&document.documentElement.classList.add("has-modal-open")},closeMenu(e="click"){const t=(0,n.getContext)();l.menuOpenedBy[e]=!1,l.isMenuOpen||(t.modal?.contains(window.document.activeElement)&&t.previousFocus?.focus(),t.modal=null,t.previousFocus=null,"overlay"===t.type&&document.documentElement.classList.remove("has-modal-open"))}},callbacks:{initMenu(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)();if(l.isMenuOpen){const n=t.querySelectorAll(o);e.modal=t,e.firstFocusableElement=n[0],e.lastFocusableElement=n[n.length-1]}},focusFirstElement(){const{ref:e}=(0,n.getElement)();if(l.isMenuOpen){const t=e.querySelectorAll(o);t?.[0]?.focus()}}}},{lock:!0});
|
||||
Reference in New Issue
Block a user