Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
import * as _ _WEBPACK _EXTERNAL _MODULE _ _wordpress _interactivity _8e89b257 _ _ from "@wordpress/interactivity" ;
/******/ // The require scope
/******/ var _ _webpack _require _ _ = { } ;
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
2024-01-31 07:59:56 -05:00
/******/ ( ( ) => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/******/ // define getter functions for harmony exports
2024-01-31 07:59:56 -05:00
/******/ _ _webpack _require _ _ . d = ( exports , definition ) => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/******/ 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 ] } ) ;
/******/ }
/******/ }
/******/ } ;
2024-01-31 07:59:56 -05:00
/******/ } ) ( ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
2024-01-31 07:59:56 -05:00
/******/ ( ( ) => {
/******/ _ _webpack _require _ _ . o = ( obj , prop ) => ( Object . prototype . hasOwnProperty . call ( obj , prop ) )
/******/ } ) ( ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
; // CONCATENATED MODULE: external "@wordpress/interactivity"
var x = y => { var x = { } ; _ _webpack _require _ _ . d ( x , y ) ; return x ; }
var y = x => ( ) => x
2024-01-31 07:59:56 -05:00
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 } ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/constants.js
const DEFAULT _BLOCK = {
name : 'core/navigation-link'
} ;
const ALLOWED _BLOCKS = ( /* unused pure expression or super */ null && ( [ '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' ] ) ) ;
const PRIORITIZED _INSERTER _BLOCKS = ( /* unused pure expression or super */ null && ( [ 'core/navigation-link/page' , 'core/navigation-link' ] ) ) ;
// These parameters must be kept aligned with those in
// lib/compat/wordpress-6.3/navigation-block-preloading.php
// and
// edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js
const PRELOADED _NAVIGATION _MENUS _QUERY = {
per _page : 100 ,
status : [ 'publish' , 'draft' ] ,
order : 'desc' ,
orderby : 'date'
} ;
const SELECT _NAVIGATION _MENUS _ARGS = [ 'postType' , 'wp_navigation' , PRELOADED _NAVIGATION _MENUS _QUERY ] ;
const NAVIGATION _MOBILE _COLLAPSE = '600px' ;
2024-01-31 07:59:56 -05:00
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/view.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const focusableSelectors = [ '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^="-"])' ] ;
// This is a fix for Safari in iOS/iPadOS. Without it, Safari doesn't focus out
// 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 {
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 : {
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 ( ) {
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 ( 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 ( ) ;
}
} ,
initNav ( ) {
const context = ( 0 , interactivity _namespaceObject . getContext ) ( ) ;
const mediaQuery = window . matchMedia ( ` (max-width: ${ NAVIGATION _MOBILE _COLLAPSE } ) ` ) ;
// Run once to set the initial state.
context . isCollapsed = mediaQuery . matches ;
function handleCollapse ( event ) {
context . isCollapsed = event . matches ;
}
// Run on resize to update the state.
mediaQuery . addEventListener ( 'change' , handleCollapse ) ;
// Remove the listener when the component is unmounted.
return ( ) => {
mediaQuery . removeEventListener ( 'change' , handleCollapse ) ;
} ;
}
}
} ) ;
2024-01-31 07:59:56 -05:00