2024-01-31 13:59:56 +01:00
/******/ ( ( ) => { // webpackBootstrap
2023-09-26 16:23:26 +02:00
/******/ "use strict" ;
/******/ // The require scope
/******/ var _ _webpack _require _ _ = { } ;
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
2024-01-31 13:59:56 +01:00
/******/ ( ( ) => {
2023-09-26 16:23:26 +02:00
/******/ // define getter functions for harmony exports
2024-01-31 13:59:56 +01:00
/******/ _ _webpack _require _ _ . d = ( exports , definition ) => {
2023-09-26 16:23:26 +02: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 13:59:56 +01:00
/******/ } ) ( ) ;
2023-09-26 16:23:26 +02:00
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
2024-01-31 13:59:56 +01:00
/******/ ( ( ) => {
/******/ _ _webpack _require _ _ . o = ( obj , prop ) => ( Object . prototype . hasOwnProperty . call ( obj , prop ) )
/******/ } ) ( ) ;
2023-09-26 16:23:26 +02:00
/******/
/******/ /* webpack/runtime/make namespace object */
2024-01-31 13:59:56 +01:00
/******/ ( ( ) => {
2023-09-26 16:23:26 +02:00
/******/ // define __esModule on exports
2024-01-31 13:59:56 +01:00
/******/ _ _webpack _require _ _ . r = ( exports ) => {
2023-09-26 16:23:26 +02:00
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
2024-01-31 13:59:56 +01:00
/******/ } ) ( ) ;
2023-09-26 16:23:26 +02:00
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
2024-01-31 13:59:56 +01:00
privateApis : ( ) => ( /* reexport */ privateApis ) ,
store : ( ) => ( /* reexport */ store )
2023-09-26 16:23:26 +02:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/patterns/build-module/store/actions.js
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , {
2024-01-31 13:59:56 +01:00
convertSyncedPatternToStatic : ( ) => ( convertSyncedPatternToStatic ) ,
createPattern : ( ) => ( createPattern ) ,
createPatternFromFile : ( ) => ( createPatternFromFile ) ,
setEditingPattern : ( ) => ( setEditingPattern )
2023-09-26 16:23:26 +02:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/patterns/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , {
2024-01-31 13:59:56 +01:00
isEditingPattern : ( ) => ( selectors _isEditingPattern )
2023-09-26 16:23:26 +02:00
} ) ;
; // CONCATENATED MODULE: external ["wp","data"]
2024-01-31 13:59:56 +01:00
const external _wp _data _namespaceObject = window [ "wp" ] [ "data" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/store/reducer.js
/ * *
* WordPress dependencies
* /
function isEditingPattern ( state = { } , action ) {
if ( action ? . type === 'SET_EDITING_PATTERN' ) {
return {
... state ,
[ action . clientId ] : action . isEditing
} ;
}
return state ;
}
2024-01-31 13:59:56 +01:00
/* harmony default export */ const reducer = ( ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
2023-09-26 16:23:26 +02:00
isEditingPattern
} ) ) ;
; // CONCATENATED MODULE: external ["wp","blocks"]
2024-01-31 13:59:56 +01:00
const external _wp _blocks _namespaceObject = window [ "wp" ] [ "blocks" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: external ["wp","coreData"]
2024-01-31 13:59:56 +01:00
const external _wp _coreData _namespaceObject = window [ "wp" ] [ "coreData" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: external ["wp","blockEditor"]
2024-01-31 13:59:56 +01:00
const external _wp _blockEditor _namespaceObject = window [ "wp" ] [ "blockEditor" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/constants.js
const PATTERN _TYPES = {
theme : 'pattern' ,
user : 'wp_block'
} ;
const PATTERN _DEFAULT _CATEGORY = 'all-patterns' ;
const PATTERN _USER _CATEGORY = 'my-patterns' ;
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 22:07:12 +01:00
const EXCLUDED _PATTERN _SOURCES = [ 'core' , 'pattern-directory/core' , 'pattern-directory/featured' ] ;
2023-09-26 16:23:26 +02:00
const PATTERN _SYNC _TYPES = {
full : 'fully' ,
unsynced : 'unsynced'
} ;
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 22:07:12 +01:00
// TODO: This should not be hardcoded. Maybe there should be a config and/or an UI.
const PARTIAL _SYNCING _SUPPORTED _BLOCKS = {
2024-02-27 15:48:23 +01:00
'core/paragraph' : [ 'content' ] ,
'core/heading' : [ 'content' ] ,
'core/button' : [ 'text' , 'url' , 'linkTarget' , 'rel' ] ,
'core/image' : [ 'id' , 'url' , 'title' , 'alt' ]
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 22:07:12 +01:00
} ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/store/actions.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* Returns a generator converting one or more static blocks into a pattern , or creating a new empty pattern .
*
* @ param { string } title Pattern title .
* @ param { 'full' | 'unsynced' } syncType They way block is synced , 'full' or 'unsynced' .
* @ param { string | undefined } [ content ] Optional serialized content of blocks to convert to pattern .
* @ param { number [ ] | undefined } [ categories ] Ids of any selected categories .
* /
const createPattern = ( title , syncType , content , categories ) => async ( {
registry
} ) => {
const meta = syncType === PATTERN _SYNC _TYPES . unsynced ? {
wp _pattern _sync _status : syncType
} : undefined ;
const reusableBlock = {
title ,
content ,
status : 'publish' ,
meta ,
wp _pattern _category : categories
} ;
const updatedRecord = await registry . dispatch ( external _wp _coreData _namespaceObject . store ) . saveEntityRecord ( 'postType' , 'wp_block' , reusableBlock ) ;
return updatedRecord ;
} ;
/ * *
* Create a pattern from a JSON file .
* @ param { File } file The JSON file instance of the pattern .
* @ param { number [ ] | undefined } [ categories ] Ids of any selected categories .
* /
const createPatternFromFile = ( file , categories ) => async ( {
dispatch
} ) => {
const fileContent = await file . text ( ) ;
/** @type {import('./types').PatternJSON} */
let parsedContent ;
try {
parsedContent = JSON . parse ( fileContent ) ;
} catch ( e ) {
throw new Error ( 'Invalid JSON file' ) ;
}
if ( parsedContent . _ _file !== 'wp_block' || ! parsedContent . title || ! parsedContent . content || typeof parsedContent . title !== 'string' || typeof parsedContent . content !== 'string' || parsedContent . syncStatus && typeof parsedContent . syncStatus !== 'string' ) {
2023-09-26 21:11:22 +02:00
throw new Error ( 'Invalid pattern JSON file' ) ;
2023-09-26 16:23:26 +02:00
}
const pattern = await dispatch . createPattern ( parsedContent . title , parsedContent . syncStatus , parsedContent . content , categories ) ;
return pattern ;
} ;
/ * *
* Returns a generator converting a synced pattern block into a static block .
*
* @ param { string } clientId The client ID of the block to attach .
* /
const convertSyncedPatternToStatic = clientId => ( {
registry
} ) => {
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 22:07:12 +01:00
const patternBlock = registry . select ( external _wp _blockEditor _namespaceObject . store ) . getBlock ( clientId ) ;
function cloneBlocksAndRemoveBindings ( blocks ) {
return blocks . map ( block => {
let metadata = block . attributes . metadata ;
if ( metadata ) {
metadata = {
... metadata
} ;
delete metadata . id ;
delete metadata . bindings ;
}
return ( 0 , external _wp _blocks _namespaceObject . cloneBlock ) ( block , {
metadata : metadata && Object . keys ( metadata ) . length > 0 ? metadata : undefined
} , cloneBlocksAndRemoveBindings ( block . innerBlocks ) ) ;
} ) ;
}
registry . dispatch ( external _wp _blockEditor _namespaceObject . store ) . replaceBlocks ( patternBlock . clientId , cloneBlocksAndRemoveBindings ( patternBlock . innerBlocks ) ) ;
2023-09-26 16:23:26 +02:00
} ;
/ * *
* Returns an action descriptor for SET _EDITING _PATTERN action .
*
* @ param { string } clientId The clientID of the pattern to target .
* @ param { boolean } isEditing Whether the block should be in editing state .
* @ return { Object } Action descriptor .
* /
function setEditingPattern ( clientId , isEditing ) {
return {
type : 'SET_EDITING_PATTERN' ,
clientId ,
isEditing
} ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/store/constants.js
/ * *
* Module Constants
* /
const STORE _NAME = 'core/patterns' ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/store/selectors.js
/ * *
* Returns true if pattern is in the editing state .
*
* @ param { Object } state Global application state .
* @ param { number } clientId the clientID of the block .
* @ return { boolean } Whether the pattern is in the editing state .
* /
function selectors _isEditingPattern ( state , clientId ) {
return state . isEditingPattern [ clientId ] ;
}
; // CONCATENATED MODULE: external ["wp","privateApis"]
2024-01-31 13:59:56 +01:00
const external _wp _privateApis _namespaceObject = window [ "wp" ] [ "privateApis" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/lock-unlock.js
/ * *
* WordPress dependencies
* /
const {
lock ,
unlock
Editor: Update npm packages ahead of 6.4 RC1.
Updates the npm packages and code for:
* [https://github.com/WordPress/gutenberg/pull/55121 List: fix forward merging of nested list]
* [https://github.com/WordPress/gutenberg/pull/55182 Update consent string for using private APIs.]
* [https://github.com/WordPress/gutenberg/pull/55204 useBlockSettings: add missing useMemo dependencies]
* [https://github.com/WordPress/gutenberg/pull/55120 Remove the lightbox filter and view file when the lightbox setting is disabled.]
* [https://github.com/WordPress/gutenberg/pull/55245 Patterns: Remove the version enforcement for npm in engines field]
* [https://github.com/WordPress/gutenberg/pull/55237 Remove `@return void` from PHP function docs]
* [https://github.com/WordPress/gutenberg/pull/55141 Image: Disable lightbox editor UI for linked images]
* [https://github.com/WordPress/gutenberg/pull/55269 Image: Stop crashing with Lightbox on image blocks without an image]
* [https://github.com/WordPress/gutenberg/pull/55021 Update fullscreen icon]
* [https://github.com/WordPress/gutenberg/pull/55217 Template Part block: Fall back to current theme if no theme attribute is given.] This change is part of fix for a performance regression re-introduced by [56818].
References:
* [https://github.com/WordPress/gutenberg/pull/55298 Gutenberg PR 55298] Cherry-pick commits
Follow-up to [56818], [56816].
Props ellatrix, peterwilsoncc, jsnajdr, afercia, gziolo, isabel_brison, artemiosans, richtabor, bernhard-reiter, flixos90, mikachan, spacedmonkey, hellofromTonya.
See #59583, #59411.
Built from https://develop.svn.wordpress.org/trunk@56849
git-svn-id: http://core.svn.wordpress.org/trunk@56361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-12 15:58:15 +02:00
} = ( 0 , external _wp _privateApis _namespaceObject . _ _dangerousOptInToUnstableAPIsOnlyForCoreModules ) ( 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.' , '@wordpress/patterns' ) ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/store/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* Post editor data store configuration .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
*
* @ type { Object }
* /
const storeConfig = {
reducer : reducer
} ;
/ * *
* Store definition for the editor namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
* /
const store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( STORE _NAME , {
... storeConfig
} ) ;
( 0 , external _wp _data _namespaceObject . register ) ( store ) ;
unlock ( store ) . registerPrivateActions ( actions _namespaceObject ) ;
unlock ( store ) . registerPrivateSelectors ( selectors _namespaceObject ) ;
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 22:07:12 +01:00
; // CONCATENATED MODULE: external "React"
2024-01-31 13:59:56 +01:00
const external _React _namespaceObject = window [ "React" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: external ["wp","components"]
2024-01-31 13:59:56 +01:00
const external _wp _components _namespaceObject = window [ "wp" ] [ "components" ] ;
2024-02-27 15:48:23 +01:00
; // CONCATENATED MODULE: external ["wp","i18n"]
const external _wp _i18n _namespaceObject = window [ "wp" ] [ "i18n" ] ;
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 22:07:12 +01:00
; // CONCATENATED MODULE: external ["wp","element"]
2024-01-31 13:59:56 +01:00
const external _wp _element _namespaceObject = window [ "wp" ] [ "element" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: external ["wp","notices"]
2024-01-31 13:59:56 +01:00
const external _wp _notices _namespaceObject = window [ "wp" ] [ "notices" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: external ["wp","compose"]
2024-01-31 13:59:56 +01:00
const external _wp _compose _namespaceObject = window [ "wp" ] [ "compose" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: external ["wp","htmlEntities"]
2024-01-31 13:59:56 +01:00
const external _wp _htmlEntities _namespaceObject = window [ "wp" ] [ "htmlEntities" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/category-selector.js
/ * *
* WordPress dependencies
* /
const unescapeString = arg => {
return ( 0 , external _wp _htmlEntities _namespaceObject . decodeEntities ) ( arg ) ;
} ;
const CATEGORY _SLUG = 'wp_pattern_category' ;
function CategorySelector ( {
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
categoryTerms ,
onChange ,
categoryMap
2023-09-26 16:23:26 +02:00
} ) {
const [ search , setSearch ] = ( 0 , external _wp _element _namespaceObject . useState ) ( '' ) ;
const debouncedSearch = ( 0 , external _wp _compose _namespaceObject . useDebounce ) ( setSearch , 500 ) ;
const suggestions = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
return Array . from ( categoryMap . values ( ) ) . map ( category => unescapeString ( category . label ) ) . filter ( category => {
if ( search !== '' ) {
return category . toLowerCase ( ) . includes ( search . toLowerCase ( ) ) ;
}
return true ;
} ) . sort ( ( a , b ) => a . localeCompare ( b ) ) ;
} , [ search , categoryMap ] ) ;
2023-09-26 16:23:26 +02:00
function handleChange ( termNames ) {
const uniqueTerms = termNames . reduce ( ( terms , newTerm ) => {
if ( ! terms . some ( term => term . toLowerCase ( ) === newTerm . toLowerCase ( ) ) ) {
terms . push ( newTerm ) ;
}
return terms ;
} , [ ] ) ;
onChange ( uniqueTerms ) ;
}
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 22:07:12 +01:00
return ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . FormTokenField , {
2023-09-26 16:23:26 +02:00
className : "patterns-menu-items__convert-modal-categories" ,
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
value : categoryTerms ,
2023-09-26 16:23:26 +02:00
suggestions : suggestions ,
onChange : handleChange ,
onInputChange : debouncedSearch ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Categories' ) ,
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
tokenizeOnBlur : true ,
_ _experimentalExpandOnFocus : true ,
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 22:07:12 +01:00
_ _next40pxDefaultSize : true ,
_ _nextHasNoMarginBottom : true
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
} ) ;
2023-09-26 16:23:26 +02:00
}
2024-02-20 16:41:18 +01:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/private-hooks.js
2023-09-26 16:23:26 +02:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
2024-02-20 16:41:18 +01:00
* Helper hook that creates a Map with the core and user patterns categories
* and removes any duplicates . It ' s used when we need to create new user
* categories when creating or importing patterns .
* This hook also provides a function to find or create a pattern category .
*
* @ return { Object } The merged categories map and the callback function to find or create a category .
2023-09-26 16:23:26 +02:00
* /
2024-02-20 16:41:18 +01:00
function useAddPatternCategory ( ) {
2023-09-26 16:23:26 +02:00
const {
saveEntityRecord ,
invalidateResolution
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
const {
corePatternCategories ,
userPatternCategories
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getUserPatternCategories ,
getBlockPatternCategories
} = select ( external _wp _coreData _namespaceObject . store ) ;
return {
corePatternCategories : getBlockPatternCategories ( ) ,
userPatternCategories : getUserPatternCategories ( )
} ;
2024-02-20 16:41:18 +01:00
} , [ ] ) ;
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
const categoryMap = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
// Merge the user and core pattern categories and remove any duplicates.
const uniqueCategories = new Map ( ) ;
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 22:07:12 +01:00
userPatternCategories . forEach ( category => {
uniqueCategories . set ( category . label . toLowerCase ( ) , {
label : category . label ,
name : category . name ,
id : category . id
} ) ;
} ) ;
corePatternCategories . forEach ( category => {
if ( ! uniqueCategories . has ( category . label . toLowerCase ( ) ) &&
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
// There are two core categories with `Post` label so explicitly remove the one with
// the `query` slug to avoid any confusion.
category . name !== 'query' ) {
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 22:07:12 +01:00
uniqueCategories . set ( category . label . toLowerCase ( ) , {
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
label : category . label ,
name : category . name
} ) ;
}
} ) ;
return uniqueCategories ;
} , [ userPatternCategories , corePatternCategories ] ) ;
2023-09-26 16:23:26 +02:00
async function findOrCreateTerm ( term ) {
try {
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 22:07:12 +01:00
const existingTerm = categoryMap . get ( term . toLowerCase ( ) ) ;
2024-02-20 16:41:18 +01:00
if ( existingTerm ? . id ) {
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 22:07:12 +01:00
return existingTerm . id ;
}
// If we have an existing core category we need to match the new user category to the
// correct slug rather than autogenerating it to prevent duplicates, eg. the core `Headers`
// category uses the singular `header` as the slug.
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
const termData = existingTerm ? {
name : existingTerm . label ,
slug : existingTerm . name
} : {
2023-09-26 16:23:26 +02:00
name : term
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
} ;
const newTerm = await saveEntityRecord ( 'taxonomy' , CATEGORY _SLUG , termData , {
2023-09-26 16:23:26 +02:00
throwOnError : true
} ) ;
invalidateResolution ( 'getUserPatternCategories' ) ;
return newTerm . id ;
} catch ( error ) {
if ( error . code !== 'term_exists' ) {
throw error ;
}
return error . data . term _id ;
}
}
2024-02-20 16:41:18 +01:00
return {
categoryMap ,
findOrCreateTerm
} ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/create-pattern-modal.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function CreatePatternModal ( {
className = 'patterns-menu-items__convert-modal' ,
modalTitle = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Create pattern' ) ,
... restProps
} ) {
return ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
title : modalTitle ,
onRequestClose : restProps . onClose ,
overlayClassName : className
} , ( 0 , external _React _namespaceObject . createElement ) ( CreatePatternModalContents , {
... restProps
} ) ) ;
}
function CreatePatternModalContents ( {
confirmLabel = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Create' ) ,
defaultCategories = [ ] ,
content ,
onClose ,
onError ,
onSuccess ,
defaultSyncType = PATTERN _SYNC _TYPES . full ,
defaultTitle = ''
} ) {
const [ syncType , setSyncType ] = ( 0 , external _wp _element _namespaceObject . useState ) ( defaultSyncType ) ;
const [ categoryTerms , setCategoryTerms ] = ( 0 , external _wp _element _namespaceObject . useState ) ( defaultCategories ) ;
const [ title , setTitle ] = ( 0 , external _wp _element _namespaceObject . useState ) ( defaultTitle ) ;
const [ isSaving , setIsSaving ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const {
createPattern
} = unlock ( ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ) ;
const {
createErrorNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const {
categoryMap ,
findOrCreateTerm
} = useAddPatternCategory ( ) ;
async function onCreate ( patternTitle , sync ) {
if ( ! title || isSaving ) {
return ;
}
try {
setIsSaving ( true ) ;
const categories = await Promise . all ( categoryTerms . map ( termName => findOrCreateTerm ( termName ) ) ) ;
const newPattern = await createPattern ( patternTitle , sync , typeof content === 'function' ? content ( ) : content , categories ) ;
onSuccess ( {
pattern : newPattern ,
categoryId : PATTERN _DEFAULT _CATEGORY
} ) ;
} catch ( error ) {
createErrorNotice ( error . message , {
type : 'snackbar' ,
id : 'pattern-create'
} ) ;
onError ? . ( ) ;
} finally {
setIsSaving ( false ) ;
setCategoryTerms ( [ ] ) ;
setTitle ( '' ) ;
}
}
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 22:07:12 +01:00
return ( 0 , external _React _namespaceObject . createElement ) ( "form" , {
2023-09-26 16:23:26 +02:00
onSubmit : event => {
event . preventDefault ( ) ;
onCreate ( title , syncType ) ;
}
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 22:07:12 +01:00
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalVStack , {
2023-09-26 16:23:26 +02:00
spacing : "5"
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 22:07:12 +01:00
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . TextControl , {
2023-09-26 16:23:26 +02:00
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Name' ) ,
value : title ,
onChange : setTitle ,
placeholder : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'My pattern' ) ,
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 22:07:12 +01:00
className : "patterns-create-modal__name-input" ,
_ _nextHasNoMarginBottom : true ,
_ _next40pxDefaultSize : true
} ) , ( 0 , external _React _namespaceObject . createElement ) ( CategorySelector , {
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4.
Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.
See #59411.
Built from https://develop.svn.wordpress.org/trunk@56808
git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-10-09 19:24:24 +02:00
categoryTerms : categoryTerms ,
onChange : setCategoryTerms ,
categoryMap : categoryMap
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 22:07:12 +01:00
} ) , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToggleControl , {
Editor: update npm packages for 6.4.2.
Package updates with bug fixes related to patterns, Query look interactivity, design tools UI and accessibility.
Props mikachan, jorbin, kebbet, artemiosans, talldanwp, ramonopoly, alexstine, andrewserong, mamaduka, cbravobernal, ajlende, luisherranz.
See #59828.
Built from https://develop.svn.wordpress.org/trunk@57109
git-svn-id: http://core.svn.wordpress.org/trunk@56620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-11-14 01:12:23 +01:00
label : ( 0 , external _wp _i18n _namespaceObject . _x ) ( 'Synced' , 'Option that makes an individual pattern synchronized' ) ,
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 22:07:12 +01:00
help : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Sync this pattern across multiple locations.' ) ,
2023-09-26 16:23:26 +02:00
checked : syncType === PATTERN _SYNC _TYPES . full ,
onChange : ( ) => {
setSyncType ( syncType === PATTERN _SYNC _TYPES . full ? PATTERN _SYNC _TYPES . unsynced : PATTERN _SYNC _TYPES . full ) ;
}
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 22:07:12 +01:00
} ) , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
2023-09-26 16:23:26 +02:00
justify : "right"
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 22:07:12 +01:00
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
_ _next40pxDefaultSize : true ,
2023-09-26 16:23:26 +02:00
variant : "tertiary" ,
onClick : ( ) => {
onClose ( ) ;
setTitle ( '' ) ;
}
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 22:07:12 +01:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Cancel' ) ) , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
_ _next40pxDefaultSize : true ,
2023-09-26 16:23:26 +02:00
variant : "primary" ,
type : "submit" ,
"aria-disabled" : ! title || isSaving ,
isBusy : isSaving
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 22:07:12 +01:00
} , confirmLabel ) ) ) ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/duplicate-pattern-modal.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function getTermLabels ( pattern , categories ) {
// Theme patterns rely on core pattern categories.
if ( pattern . type !== PATTERN _TYPES . user ) {
return categories . core ? . filter ( category => pattern . categories . includes ( category . name ) ) . map ( category => category . label ) ;
}
return categories . user ? . filter ( category => pattern . wp _pattern _category . includes ( category . id ) ) . map ( category => category . label ) ;
}
function useDuplicatePatternProps ( {
pattern ,
onSuccess
} ) {
const {
createSuccessNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const categories = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getUserPatternCategories ,
getBlockPatternCategories
} = select ( external _wp _coreData _namespaceObject . store ) ;
return {
core : getBlockPatternCategories ( ) ,
user : getUserPatternCategories ( )
} ;
} ) ;
if ( ! pattern ) {
return null ;
}
return {
content : pattern . content ,
defaultCategories : getTermLabels ( pattern , categories ) ,
defaultSyncType : pattern . type !== PATTERN _TYPES . user // Theme patterns are unsynced by default.
? PATTERN _SYNC _TYPES . unsynced : pattern . wp _pattern _sync _status || PATTERN _SYNC _TYPES . full ,
defaultTitle : ( 0 , external _wp _i18n _namespaceObject . sprintf ) ( /* translators: %s: Existing pattern title */
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '%s (Copy)' ) , typeof pattern . title === 'string' ? pattern . title : pattern . title . raw ) ,
onSuccess : ( {
pattern : newPattern
} ) => {
createSuccessNotice ( ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
// translators: %s: The new pattern's title e.g. 'Call to action (copy)'.
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( '"%s" duplicated.' ) , newPattern . title . raw ) , {
type : 'snackbar' ,
id : 'patterns-create'
} ) ;
onSuccess ? . ( {
pattern : newPattern
} ) ;
}
} ;
}
function DuplicatePatternModal ( {
pattern ,
onClose ,
onSuccess
} ) {
const duplicatedProps = useDuplicatePatternProps ( {
pattern ,
onSuccess
} ) ;
if ( ! pattern ) {
return null ;
}
return ( 0 , external _React _namespaceObject . createElement ) ( CreatePatternModal , {
modalTitle : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Duplicate pattern' ) ,
confirmLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Duplicate' ) ,
onClose : onClose ,
onError : onClose ,
... duplicatedProps
} ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/rename-pattern-modal.js
/ * *
* WordPress dependencies
* /
function RenamePatternModal ( {
onClose ,
onError ,
onSuccess ,
pattern ,
... props
} ) {
const originalName = ( 0 , external _wp _htmlEntities _namespaceObject . decodeEntities ) ( pattern . title ) ;
const [ name , setName ] = ( 0 , external _wp _element _namespaceObject . useState ) ( originalName ) ;
const [ isSaving , setIsSaving ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const {
editEntityRecord ,
_ _experimentalSaveSpecifiedEntityEdits : saveSpecifiedEntityEdits
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
const {
createSuccessNotice ,
createErrorNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const onRename = async event => {
event . preventDefault ( ) ;
if ( ! name || name === pattern . title || isSaving ) {
return ;
}
try {
await editEntityRecord ( 'postType' , pattern . type , pattern . id , {
title : name
} ) ;
setIsSaving ( true ) ;
setName ( '' ) ;
onClose ? . ( ) ;
const savedRecord = await saveSpecifiedEntityEdits ( 'postType' , pattern . type , pattern . id , [ 'title' ] , {
throwOnError : true
} ) ;
onSuccess ? . ( savedRecord ) ;
createSuccessNotice ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Pattern renamed' ) , {
type : 'snackbar' ,
id : 'pattern-update'
} ) ;
} catch ( error ) {
onError ? . ( ) ;
const errorMessage = error . message && error . code !== 'unknown_error' ? error . message : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'An error occurred while renaming the pattern.' ) ;
createErrorNotice ( errorMessage , {
type : 'snackbar' ,
id : 'pattern-update'
} ) ;
} finally {
setIsSaving ( false ) ;
setName ( '' ) ;
}
} ;
const onRequestClose = ( ) => {
onClose ? . ( ) ;
setName ( '' ) ;
} ;
return ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Rename' ) ,
... props ,
onRequestClose : onClose
} , ( 0 , external _React _namespaceObject . createElement ) ( "form" , {
onSubmit : onRename
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalVStack , {
spacing : "5"
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . TextControl , {
_ _nextHasNoMarginBottom : true ,
_ _next40pxDefaultSize : true ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Name' ) ,
value : name ,
onChange : setName ,
required : true
} ) , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
justify : "right"
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
_ _next40pxDefaultSize : true ,
variant : "tertiary" ,
onClick : onRequestClose
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Cancel' ) ) , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
_ _next40pxDefaultSize : true ,
variant : "primary" ,
type : "submit"
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Save' ) ) ) ) ) ) ;
2023-09-26 16:23:26 +02:00
}
; // CONCATENATED MODULE: external ["wp","primitives"]
2024-01-31 13:59:56 +01:00
const external _wp _primitives _namespaceObject = window [ "wp" ] [ "primitives" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
/ * *
* WordPress dependencies
* /
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 22:07:12 +01:00
const symbol = ( 0 , external _React _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
2023-09-26 16:23:26 +02:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
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 22:07:12 +01:00
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
2023-09-26 16:23:26 +02:00
d : "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
} ) ) ;
2024-01-31 13:59:56 +01:00
/* harmony default export */ const library _symbol = ( symbol ) ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/pattern-convert-button.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2023-09-26 21:11:22 +02:00
2023-09-26 16:23:26 +02:00
/ * *
* Menu control to convert block ( s ) to a pattern block .
*
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 22:07:12 +01:00
* @ param { Object } props Component props .
* @ param { string [ ] } props . clientIds Client ids of selected blocks .
* @ param { string } props . rootClientId ID of the currently selected top - level block .
* @ param { ( ) => void } props . closeBlockSettingsMenu Callback to close the block settings menu dropdown .
* @ return { import ( 'react' ) . ComponentType } The menu control or null .
2023-09-26 16:23:26 +02:00
* /
function PatternConvertButton ( {
clientIds ,
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 22:07:12 +01:00
rootClientId ,
closeBlockSettingsMenu
2023-09-26 16:23:26 +02:00
} ) {
const {
createSuccessNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const {
replaceBlocks
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _blockEditor _namespaceObject . store ) ;
// Ignore reason: false positive of the lint rule.
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
const {
setEditingPattern
} = unlock ( ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ) ;
const [ isModalOpen , setIsModalOpen ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const canConvert = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
var _getBlocksByClientId ;
const {
canUser
} = select ( external _wp _coreData _namespaceObject . store ) ;
const {
getBlocksByClientId ,
canInsertBlockType ,
getBlockRootClientId
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
const rootId = rootClientId || ( clientIds . length > 0 ? getBlockRootClientId ( clientIds [ 0 ] ) : undefined ) ;
const blocks = ( _getBlocksByClientId = getBlocksByClientId ( clientIds ) ) !== null && _getBlocksByClientId !== void 0 ? _getBlocksByClientId : [ ] ;
const isReusable = blocks . length === 1 && blocks [ 0 ] && ( 0 , external _wp _blocks _namespaceObject . isReusableBlock ) ( blocks [ 0 ] ) && ! ! select ( external _wp _coreData _namespaceObject . store ) . getEntityRecord ( 'postType' , 'wp_block' , blocks [ 0 ] . attributes . ref ) ;
const _canConvert =
// Hide when this is already a synced pattern.
! isReusable &&
// Hide when patterns are disabled.
canInsertBlockType ( 'core/block' , rootId ) && blocks . every ( block =>
// Guard against the case where a regular block has *just* been converted.
! ! block &&
// Hide on invalid blocks.
block . isValid &&
// Hide when block doesn't support being made into a pattern.
( 0 , external _wp _blocks _namespaceObject . hasBlockSupport ) ( block . name , 'reusable' , true ) ) &&
// Hide when current doesn't have permission to do that.
! ! canUser ( 'create' , 'blocks' ) ;
return _canConvert ;
} , [ clientIds , rootClientId ] ) ;
const {
getBlocksByClientId
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( external _wp _blockEditor _namespaceObject . store ) ;
const getContent = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( ) => ( 0 , external _wp _blocks _namespaceObject . serialize ) ( getBlocksByClientId ( clientIds ) ) , [ getBlocksByClientId , clientIds ] ) ;
if ( ! canConvert ) {
return null ;
}
const handleSuccess = ( {
pattern
} ) => {
2023-09-26 21:11:22 +02:00
if ( pattern . wp _pattern _sync _status !== PATTERN _SYNC _TYPES . unsynced ) {
const newBlock = ( 0 , external _wp _blocks _namespaceObject . createBlock ) ( 'core/block' , {
ref : pattern . id
} ) ;
replaceBlocks ( clientIds , newBlock ) ;
setEditingPattern ( newBlock . clientId , true ) ;
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 22:07:12 +01:00
closeBlockSettingsMenu ( ) ;
2023-09-26 21:11:22 +02:00
}
createSuccessNotice ( pattern . wp _pattern _sync _status === PATTERN _SYNC _TYPES . unsynced ? ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
2023-09-26 16:23:26 +02:00
// translators: %s: the name the user has given to the pattern.
2023-09-26 21:11:22 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Unsynced pattern created: %s' ) , pattern . title . raw ) : ( 0 , external _wp _i18n _namespaceObject . sprintf ) (
2023-09-26 16:23:26 +02:00
// translators: %s: the name the user has given to the pattern.
2023-09-26 21:11:22 +02:00
( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Synced pattern created: %s' ) , pattern . title . raw ) , {
2023-09-26 16:23:26 +02:00
type : 'snackbar' ,
id : 'convert-to-pattern-success'
} ) ;
setIsModalOpen ( false ) ;
} ;
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 22:07:12 +01:00
return ( 0 , external _React _namespaceObject . createElement ) ( external _React _namespaceObject . Fragment , null , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
2023-09-26 16:23:26 +02:00
icon : library _symbol ,
onClick : ( ) => setIsModalOpen ( true ) ,
"aria-expanded" : isModalOpen ,
"aria-haspopup" : "dialog"
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 22:07:12 +01:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Create pattern' ) ) , isModalOpen && ( 0 , external _React _namespaceObject . createElement ) ( CreatePatternModal , {
2023-09-26 16:23:26 +02:00
content : getContent ,
onSuccess : pattern => {
handleSuccess ( pattern ) ;
} ,
onError : ( ) => {
setIsModalOpen ( false ) ;
} ,
onClose : ( ) => {
setIsModalOpen ( false ) ;
}
} ) ) ;
}
; // CONCATENATED MODULE: external ["wp","url"]
2024-01-31 13:59:56 +01:00
const external _wp _url _namespaceObject = window [ "wp" ] [ "url" ] ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/patterns-manage-button.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function PatternsManageButton ( {
clientId
} ) {
const {
canRemove ,
isVisible ,
managePatternsUrl
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getBlock ,
canRemoveBlock ,
getBlockCount ,
getSettings
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
const {
canUser
} = select ( external _wp _coreData _namespaceObject . store ) ;
const reusableBlock = getBlock ( clientId ) ;
const isBlockTheme = getSettings ( ) . _ _unstableIsBlockBasedTheme ;
return {
canRemove : canRemoveBlock ( clientId ) ,
isVisible : ! ! reusableBlock && ( 0 , external _wp _blocks _namespaceObject . isReusableBlock ) ( reusableBlock ) && ! ! canUser ( 'update' , 'blocks' , reusableBlock . attributes . ref ) ,
innerBlockCount : getBlockCount ( clientId ) ,
// The site editor and templates both check whether the user
// has edit_theme_options capabilities. We can leverage that here
// and omit the manage patterns link if the user can't access it.
managePatternsUrl : isBlockTheme && canUser ( 'read' , 'templates' ) ? ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'site-editor.php' , {
path : '/patterns'
} ) : ( 0 , external _wp _url _namespaceObject . addQueryArgs ) ( 'edit.php' , {
post _type : 'wp_block'
} )
} ;
} , [ clientId ] ) ;
// Ignore reason: false positive of the lint rule.
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
const {
convertSyncedPatternToStatic
} = unlock ( ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ) ;
if ( ! isVisible ) {
return null ;
}
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 22:07:12 +01:00
return ( 0 , external _React _namespaceObject . createElement ) ( external _React _namespaceObject . Fragment , null , canRemove && ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
2023-09-26 16:23:26 +02:00
onClick : ( ) => convertSyncedPatternToStatic ( clientId )
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 22:07:12 +01:00
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Detach' ) ) , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . MenuItem , {
href : managePatternsUrl
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Manage patterns' ) ) ) ;
2023-09-26 16:23:26 +02:00
}
2024-01-31 13:59:56 +01:00
/* harmony default export */ const patterns _manage _button = ( PatternsManageButton ) ;
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function PatternsMenuItems ( {
rootClientId
} ) {
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 22:07:12 +01:00
return ( 0 , external _React _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockSettingsMenuControls , null , ( {
selectedClientIds ,
onClose
} ) => ( 0 , external _React _namespaceObject . createElement ) ( external _React _namespaceObject . Fragment , null , ( 0 , external _React _namespaceObject . createElement ) ( PatternConvertButton , {
2023-09-26 16:23:26 +02:00
clientIds : selectedClientIds ,
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 22:07:12 +01:00
rootClientId : rootClientId ,
closeBlockSettingsMenu : onClose
} ) , selectedClientIds . length === 1 && ( 0 , external _React _namespaceObject . createElement ) ( patterns _manage _button , {
2023-09-26 16:23:26 +02:00
clientId : selectedClientIds [ 0 ]
} ) ) ) ;
}
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 22:07:12 +01:00
; // CONCATENATED MODULE: external ["wp","a11y"]
2024-01-31 13:59:56 +01:00
const external _wp _a11y _namespaceObject = window [ "wp" ] [ "a11y" ] ;
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 22:07:12 +01:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/rename-pattern-category-modal.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function RenamePatternCategoryModal ( {
category ,
existingCategories ,
onClose ,
onError ,
onSuccess ,
... props
} ) {
const id = ( 0 , external _wp _element _namespaceObject . useId ) ( ) ;
const textControlRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
const [ name , setName ] = ( 0 , external _wp _element _namespaceObject . useState ) ( ( 0 , external _wp _htmlEntities _namespaceObject . decodeEntities ) ( category . name ) ) ;
const [ isSaving , setIsSaving ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const [ validationMessage , setValidationMessage ] = ( 0 , external _wp _element _namespaceObject . useState ) ( false ) ;
const validationMessageId = validationMessage ? ` patterns-rename-pattern-category-modal__validation-message- ${ id } ` : undefined ;
const {
saveEntityRecord ,
invalidateResolution
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _coreData _namespaceObject . store ) ;
const {
createErrorNotice ,
createSuccessNotice
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _notices _namespaceObject . store ) ;
const onChange = newName => {
if ( validationMessage ) {
setValidationMessage ( undefined ) ;
}
setName ( newName ) ;
} ;
const onSave = async event => {
event . preventDefault ( ) ;
if ( isSaving ) {
return ;
}
if ( ! name || name === category . name ) {
const message = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Please enter a new name for this category.' ) ;
( 0 , external _wp _a11y _namespaceObject . speak ) ( message , 'assertive' ) ;
setValidationMessage ( message ) ;
textControlRef . current ? . focus ( ) ;
return ;
}
// Check existing categories to avoid creating duplicates.
if ( existingCategories . patternCategories . find ( existingCategory => {
// Compare the id so that the we don't disallow the user changing the case of their current category
// (i.e. renaming 'test' to 'Test').
return existingCategory . id !== category . id && existingCategory . label . toLowerCase ( ) === name . toLowerCase ( ) ;
} ) ) {
const message = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'This category already exists. Please use a different name.' ) ;
( 0 , external _wp _a11y _namespaceObject . speak ) ( message , 'assertive' ) ;
setValidationMessage ( message ) ;
textControlRef . current ? . focus ( ) ;
return ;
}
try {
setIsSaving ( true ) ;
// User pattern category properties may differ as they can be
// normalized for use alongside template part areas, core pattern
// categories etc. As a result we won't just destructure the passed
// category object.
const savedRecord = await saveEntityRecord ( 'taxonomy' , CATEGORY _SLUG , {
id : category . id ,
slug : category . slug ,
name
} ) ;
invalidateResolution ( 'getUserPatternCategories' ) ;
onSuccess ? . ( savedRecord ) ;
onClose ( ) ;
createSuccessNotice ( ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Pattern category renamed.' ) , {
type : 'snackbar' ,
id : 'pattern-category-update'
} ) ;
} catch ( error ) {
onError ? . ( ) ;
createErrorNotice ( error . message , {
type : 'snackbar' ,
id : 'pattern-category-update'
} ) ;
} finally {
setIsSaving ( false ) ;
setName ( '' ) ;
}
} ;
const onRequestClose = ( ) => {
onClose ( ) ;
setName ( '' ) ;
} ;
return ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Modal , {
title : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Rename' ) ,
onRequestClose : onRequestClose ,
... props
} , ( 0 , external _React _namespaceObject . createElement ) ( "form" , {
onSubmit : onSave
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalVStack , {
spacing : "5"
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalVStack , {
spacing : "2"
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . TextControl , {
ref : textControlRef ,
_ _nextHasNoMarginBottom : true ,
_ _next40pxDefaultSize : true ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Name' ) ,
value : name ,
onChange : onChange ,
"aria-describedby" : validationMessageId ,
required : true
} ) , validationMessage && ( 0 , external _React _namespaceObject . createElement ) ( "span" , {
className : "patterns-rename-pattern-category-modal__validation-message" ,
id : validationMessageId
} , validationMessage ) ) , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
justify : "right"
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
_ _next40pxDefaultSize : true ,
variant : "tertiary" ,
onClick : onRequestClose
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Cancel' ) ) , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
_ _next40pxDefaultSize : true ,
variant : "primary" ,
type : "submit" ,
"aria-disabled" : ! name || name === category . name || isSaving ,
isBusy : isSaving
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Save' ) ) ) ) ) ) ;
}
2024-03-04 15:08:24 +01:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/use-set-pattern-bindings.js
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 22:07:12 +01:00
/ * *
* WordPress dependencies
* /
2024-03-12 15:08:24 +01: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 22:07:12 +01:00
/ * *
* Internal dependencies
* /
2024-03-12 15:08:24 +01:00
2024-03-04 15:08:24 +01:00
function removeBindings ( bindings , syncedAttributes ) {
let updatedBindings = { } ;
for ( const attributeName of syncedAttributes ) {
// Omit any pattern override bindings from the `updatedBindings` object.
if ( bindings ? . [ attributeName ] ? . source !== 'core/pattern-overrides' && bindings ? . [ attributeName ] ? . source !== undefined ) {
updatedBindings [ attributeName ] = bindings [ attributeName ] ;
}
}
if ( ! Object . keys ( updatedBindings ) . length ) {
updatedBindings = undefined ;
}
return updatedBindings ;
}
function addBindings ( bindings , syncedAttributes ) {
const updatedBindings = {
... bindings
} ;
for ( const attributeName of syncedAttributes ) {
if ( ! bindings ? . [ attributeName ] ) {
updatedBindings [ attributeName ] = {
source : 'core/pattern-overrides'
} ;
}
}
return updatedBindings ;
}
function useSetPatternBindings ( {
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 22:07:12 +01:00
name ,
attributes ,
setAttributes
2024-03-04 15:08:24 +01:00
} , currentPostType ) {
var _attributes$metadata$ , _usePrevious ;
2024-03-12 15:08:24 +01:00
const hasPatternOverridesSource = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getBlockBindingsSource
} = unlock ( select ( external _wp _blocks _namespaceObject . store ) ) ;
// For editing link to the site editor if the theme and user permissions support it.
return ! ! getBlockBindingsSource ( 'core/pattern-overrides' ) ;
} , [ ] ) ;
2024-03-04 15:08:24 +01:00
const metadataName = ( _attributes$metadata$ = attributes ? . metadata ? . name ) !== null && _attributes$metadata$ !== void 0 ? _attributes$metadata$ : '' ;
const prevMetadataName = ( _usePrevious = ( 0 , external _wp _compose _namespaceObject . usePrevious ) ( metadataName ) ) !== null && _usePrevious !== void 0 ? _usePrevious : '' ;
const bindings = attributes ? . metadata ? . bindings ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
// Bindings should only be created when editing a wp_block post type,
// and also when there's a change to the user-given name for the block.
2024-03-12 15:08:24 +01:00
// Also check that the pattern overrides source is registered.
if ( ! hasPatternOverridesSource || currentPostType !== 'wp_block' || metadataName === prevMetadataName ) {
2024-03-04 15:08:24 +01:00
return ;
}
const syncedAttributes = PARTIAL _SYNCING _SUPPORTED _BLOCKS [ name ] ;
const attributeSources = syncedAttributes . map ( attributeName => attributes . metadata ? . bindings ? . [ attributeName ] ? . source ) ;
const isConnectedToOtherSources = attributeSources . every ( source => source && source !== 'core/pattern-overrides' ) ;
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 22:07:12 +01:00
2024-03-04 15:08:24 +01:00
// Avoid overwriting other (e.g. meta) bindings.
if ( isConnectedToOtherSources ) {
return ;
}
// The user-given name for the block was deleted, remove the bindings.
if ( ! metadataName ? . length && prevMetadataName ? . length ) {
const updatedBindings = removeBindings ( bindings , syncedAttributes ) ;
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 22:07:12 +01:00
setAttributes ( {
metadata : {
... attributes . metadata ,
bindings : updatedBindings
}
} ) ;
}
2024-03-04 15:08:24 +01:00
// The user-given name for the block was set, set the bindings.
if ( ! prevMetadataName ? . length && metadataName . length ) {
const updatedBindings = addBindings ( bindings , syncedAttributes ) ;
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 22:07:12 +01:00
setAttributes ( {
metadata : {
... attributes . metadata ,
bindings : updatedBindings
}
} ) ;
}
2024-03-12 15:08:24 +01:00
} , [ hasPatternOverridesSource , bindings , prevMetadataName , metadataName , currentPostType , name , attributes . metadata , setAttributes ] ) ;
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 22:07:12 +01:00
}
2024-02-09 19:22:22 +01:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/reset-overrides-control.js
/ * *
* WordPress dependencies
* /
2024-03-04 15:08:24 +01:00
function recursivelyFindBlockWithName ( blocks , name ) {
2024-02-09 19:22:22 +01:00
for ( const block of blocks ) {
2024-03-04 15:08:24 +01:00
if ( block . attributes . metadata ? . name === name ) {
2024-02-09 19:22:22 +01:00
return block ;
}
2024-03-04 15:08:24 +01:00
const found = recursivelyFindBlockWithName ( block . innerBlocks , name ) ;
2024-02-09 19:22:22 +01:00
if ( found ) {
return found ;
}
}
}
function ResetOverridesControl ( props ) {
const registry = ( 0 , external _wp _data _namespaceObject . useRegistry ) ( ) ;
2024-03-04 15:08:24 +01:00
const name = props . attributes . metadata ? . name ;
2024-02-09 19:22:22 +01:00
const patternWithOverrides = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
2024-03-04 15:08:24 +01:00
if ( ! name ) {
2024-02-09 19:22:22 +01:00
return undefined ;
}
const {
getBlockParentsByBlockName ,
getBlocksByClientId
} = select ( external _wp _blockEditor _namespaceObject . store ) ;
const patternBlock = getBlocksByClientId ( getBlockParentsByBlockName ( props . clientId , 'core/block' ) ) [ 0 ] ;
2024-03-04 15:08:24 +01:00
if ( ! patternBlock ? . attributes . content ? . [ name ] ) {
2024-02-09 19:22:22 +01:00
return undefined ;
}
return patternBlock ;
2024-03-04 15:08:24 +01:00
} , [ props . clientId , name ] ) ;
2024-02-09 19:22:22 +01:00
const resetOverrides = async ( ) => {
var _editedRecord$blocks ;
const editedRecord = await registry . resolveSelect ( external _wp _coreData _namespaceObject . store ) . getEditedEntityRecord ( 'postType' , 'wp_block' , patternWithOverrides . attributes . ref ) ;
const blocks = ( _editedRecord$blocks = editedRecord . blocks ) !== null && _editedRecord$blocks !== void 0 ? _editedRecord$blocks : ( 0 , external _wp _blocks _namespaceObject . parse ) ( editedRecord . content ) ;
2024-03-04 15:08:24 +01:00
const block = recursivelyFindBlockWithName ( blocks , name ) ;
2024-02-27 15:48:23 +01:00
const newAttributes = Object . assign (
// Reset every existing attribute to undefined.
Object . fromEntries ( Object . keys ( props . attributes ) . map ( key => [ key , undefined ] ) ) ,
// Then assign the original attributes.
block . attributes ) ;
props . setAttributes ( newAttributes ) ;
2024-02-09 19:22:22 +01:00
} ;
return ( 0 , external _React _namespaceObject . createElement ) ( external _wp _blockEditor _namespaceObject . BlockControls , {
group : "other"
} , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarGroup , null , ( 0 , external _React _namespaceObject . createElement ) ( external _wp _components _namespaceObject . ToolbarButton , {
onClick : resetOverrides ,
disabled : ! patternWithOverrides ,
_ _experimentalIsFocusable : true
} , ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Reset' ) ) ) ) ;
}
2023-09-26 16:23:26 +02:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/private-apis.js
/ * *
* Internal dependencies
* /
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 22:07:12 +01:00
2024-02-09 19:22:22 +01:00
2024-02-20 16:41:18 +01:00
2023-09-26 16:23:26 +02:00
const privateApis = { } ;
lock ( privateApis , {
CreatePatternModal : CreatePatternModal ,
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 22:07:12 +01:00
CreatePatternModalContents : CreatePatternModalContents ,
DuplicatePatternModal : DuplicatePatternModal ,
useDuplicatePatternProps : useDuplicatePatternProps ,
RenamePatternModal : RenamePatternModal ,
2023-09-26 16:23:26 +02:00
PatternsMenuItems : PatternsMenuItems ,
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 22:07:12 +01:00
RenamePatternCategoryModal : RenamePatternCategoryModal ,
2024-03-04 15:08:24 +01:00
useSetPatternBindings : useSetPatternBindings ,
2024-02-09 19:22:22 +01:00
ResetOverridesControl : ResetOverridesControl ,
2024-02-20 16:41:18 +01:00
useAddPatternCategory : useAddPatternCategory ,
2023-09-26 16:23:26 +02:00
PATTERN _TYPES : PATTERN _TYPES ,
PATTERN _DEFAULT _CATEGORY : PATTERN _DEFAULT _CATEGORY ,
PATTERN _USER _CATEGORY : PATTERN _USER _CATEGORY ,
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 22:07:12 +01:00
EXCLUDED _PATTERN _SOURCES : EXCLUDED _PATTERN _SOURCES ,
PATTERN _SYNC _TYPES : PATTERN _SYNC _TYPES ,
PARTIAL _SYNCING _SUPPORTED _BLOCKS : PARTIAL _SYNCING _SUPPORTED _BLOCKS
2023-09-26 16:23:26 +02:00
} ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/index.js
/ * *
* Internal dependencies
* /
( window . wp = window . wp || { } ) . patterns = _ _webpack _exports _ _ ;
/******/ } ) ( )
;