2024-09-24 03:35:17 -04:00
/******/ var _ _webpack _modules _ _ = ( {
/***/ 380 :
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
2023-09-26 10:23:26 -04:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
2024-02-15 11:53:15 -05:00
zj : ( ) => ( /* reexport */ getConfig ) ,
SD : ( ) => ( /* reexport */ getContext ) ,
V6 : ( ) => ( /* reexport */ getElement ) ,
2024-09-19 21:55:35 -04:00
$K : ( ) => ( /* reexport */ getServerContext ) ,
vT : ( ) => ( /* reexport */ getServerState ) ,
2024-09-24 03:35:17 -04:00
jb : ( ) => ( /* binding */ privateApis ) ,
2024-06-25 09:49:28 -04:00
yT : ( ) => ( /* reexport */ splitTask ) ,
2024-02-15 11:53:15 -05:00
M _ : ( ) => ( /* reexport */ store ) ,
hb : ( ) => ( /* reexport */ useCallback ) ,
vJ : ( ) => ( /* reexport */ useEffect ) ,
ip : ( ) => ( /* reexport */ useInit ) ,
Nf : ( ) => ( /* reexport */ useLayoutEffect ) ,
Kr : ( ) => ( /* reexport */ useMemo ) ,
2024-09-24 03:35:17 -04:00
li : ( ) => ( /* reexport */ A ) ,
J0 : ( ) => ( /* reexport */ h ) ,
2024-02-15 11:53:15 -05:00
FH : ( ) => ( /* reexport */ useWatch ) ,
v4 : ( ) => ( /* reexport */ withScope )
2023-09-26 10:23:26 -04:00
} ) ;
2024-09-24 03:35:17 -04:00
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
var preact _module = _ _webpack _require _ _ ( 622 ) ;
2024-12-13 14:06:24 -05:00
; // ./node_modules/preact/hooks/dist/hooks.module.js
2024-09-24 03:35:17 -04:00
var hooks _module _t , r , hooks _module _u , i , hooks _module _o = 0 , hooks _module _f = [ ] , hooks _module _c = preact _module /* options */ . fF , e = hooks _module _c . _ _b , a = hooks _module _c . _ _r , v = hooks _module _c . diffed , l = hooks _module _c . _ _c , m = hooks _module _c . unmount , s = hooks _module _c . _ _ ; function d ( n , t ) { hooks _module _c . _ _h && hooks _module _c . _ _h ( r , n , hooks _module _o || t ) , hooks _module _o = 0 ; var u = r . _ _H || ( r . _ _H = { _ _ : [ ] , _ _h : [ ] } ) ; return n >= u . _ _ . length && u . _ _ . push ( { } ) , u . _ _ [ n ] } function h ( n ) { return hooks _module _o = 1 , p ( D , n ) } function p ( n , u , i ) { var o = d ( hooks _module _t ++ , 2 ) ; if ( o . t = n , ! o . _ _c && ( o . _ _ = [ i ? i ( u ) : D ( void 0 , u ) , function ( n ) { var t = o . _ _N ? o . _ _N [ 0 ] : o . _ _ [ 0 ] , r = o . t ( t , n ) ; t !== r && ( o . _ _N = [ r , o . _ _ [ 1 ] ] , o . _ _c . setState ( { } ) ) } ] , o . _ _c = r , ! r . u ) ) { var f = function ( n , t , r ) { if ( ! o . _ _c . _ _H ) return ! 0 ; var u = o . _ _c . _ _H . _ _ . filter ( function ( n ) { return ! ! n . _ _c } ) ; if ( u . every ( function ( n ) { return ! n . _ _N } ) ) return ! c || c . call ( this , n , t , r ) ; var i = ! 1 ; return u . forEach ( function ( n ) { if ( n . _ _N ) { var t = n . _ _ [ 0 ] ; n . _ _ = n . _ _N , n . _ _N = void 0 , t !== n . _ _ [ 0 ] && ( i = ! 0 ) } } ) , ! ( ! i && o . _ _c . props === n ) && ( ! c || c . call ( this , n , t , r ) ) } ; r . u = ! 0 ; var c = r . shouldComponentUpdate , e = r . componentWillUpdate ; r . componentWillUpdate = function ( n , t , r ) { if ( this . _ _e ) { var u = c ; c = void 0 , f ( n , t , r ) , c = u } e && e . call ( this , n , t , r ) } , r . shouldComponentUpdate = f } return o . _ _N || o . _ _ } function y ( n , u ) { var i = d ( hooks _module _t ++ , 3 ) ; ! hooks _module _c . _ _s && C ( i . _ _H , u ) && ( i . _ _ = n , i . i = u , r . _ _H . _ _h . push ( i ) ) } function _ ( n , u ) { var i = d ( hooks _module _t ++ , 4 ) ; ! hooks _module _c . _ _s && C ( i . _ _H , u ) && ( i . _ _ = n , i . i = u , r . _ _h . push ( i ) ) } function A ( n ) { return hooks _module _o = 5 , T ( function ( ) { return { current : n } } , [ ] ) } function F ( n , t , r ) { hooks _module _o = 6 , _ ( function ( ) { return "function" == typeof n ? ( n ( t ( ) ) , function ( ) { return n ( null ) } ) : n ? ( n . current = t ( ) , function ( ) { return n . current = null } ) : void 0 } , null == r ? r : r . concat ( n ) ) } function T ( n , r ) { var u = d ( hooks _module _t ++ , 7 ) ; return C ( u . _ _H , r ) && ( u . _ _ = n ( ) , u . _ _H = r , u . _ _h = n ) , u . _ _ } function q ( n , t ) { return hooks _module _o = 8 , T ( function ( ) { return n } , t ) } function x ( n ) { var u = r . context [ n . _ _c ] , i = d ( hooks _module _t ++ , 9 ) ; return i . c = n , u ? ( null == i . _ _ && ( i . _ _ = ! 0 , u . sub ( r ) ) , u . props . value ) : n . _ _ } function P ( n , t ) { hooks _module _c . useDebugValue && hooks _module _c . useDebugValue ( t ? t ( n ) : n ) } function b ( n ) { var u = d ( hooks _module _t ++ , 10 ) , i = h ( ) ; return u . _ _ = n , r . componentDidCatch || ( r . componentDidCatch = function ( n , t ) { u . _ _ && u . _ _ ( n , t ) , i [ 1 ] ( n ) } ) , [ i [ 0 ] , function ( ) { i [ 1 ] ( void 0 ) } ] } function g ( ) { var n = d ( hooks _module _t ++ , 11 ) ; if ( ! n . _ _ ) { for ( var u = r . _ _v ; null !== u && ! u . _ _m && null !== u . _ _ ; ) u = u . _ _ ; var i = u . _ _m || ( u . _ _m = [ 0 , 0 ] ) ; n . _ _ = "P" + i [ 0 ] + "-" + i [ 1 ] ++ } return n . _ _ } function j ( ) { for ( var n ; n = hooks _module _f . shift ( ) ; ) if ( n . _ _P && n . _ _H ) try { n . _ _H . _ _h . forEach ( z ) , n . _ _H . _ _h . forEach ( B ) , n . _ _H . _ _h = [ ] } catch ( t ) { n . _ _H . _ _h = [ ] , hooks _module _c . _ _e ( t , n . _ _v ) } } hooks _module _c . _ _b = function ( n ) { r = null , e && e ( n ) } , hooks _module _c . _ _ = function ( n , t ) { n && t . _ _k && t . _ _k . _ _m && ( n . _ _m = t . _ _k . _ _m ) , s && s ( n , t ) } , hooks _module _c . _ _r = function ( n ) { a && a ( n ) , hooks _module _t = 0 ; var i = ( r = n . _ _c ) . _ _H ; i && ( hooks _module _u === r ? ( i . _ _h = [ ] , r . _ _h = [ ] , i . _ _ . forEach ( function ( n ) { n . _ _N && ( n . _ _ = n . _ _N ) , n . i = n . _ _N = void 0 } ) ) : ( i . _ _h . forEach ( z ) , i . _ _h . forEach ( B ) , i . _ _h = [ ] , hooks _module _t = 0 ) ) , hooks _module _u = r } , hooks _module _c . diffed = function ( n ) { v && v ( n ) ; var t = n . _ _c ; t && t . _ _H && ( t . _ _H . _ _h . length && ( 1 !== hooks _module _f . push ( t ) && i === hooks _module _c . requestAnimationFrame || ( ( i = hooks _module _c . requestAnimationFrame ) || w ) ( j ) ) , t . _ _H . _ _ . forEach ( function ( n ) { n . i && ( n . _ _H = n . i ) , n . i = void 0 } ) ) , hooks _module _u = r = null } , hooks _module _c . _ _c = function ( n , t ) { t . some ( function ( n ) { try { n . _ _h . forEach ( z ) , n . _ _h = n . _ _h . filter ( function ( n ) { return ! n . _ _ || B ( n ) } ) } catch ( r ) { t . some ( function ( n ) { n . _ _h && ( n . _ _h = [ ] ) } ) , t = [ ] , hooks _module _c . _ _e ( r , n . _ _v ) } } ) , l && l ( n , t ) } , hooks _module _c . unmount = function ( n ) { m && m ( n ) ; var t , r = n . _ _c ; r && r . _ _H && ( r . _ _H . _ _ . forEach ( function ( n ) { try { z ( n ) } catch ( n ) { t = n } } ) , r . _ _H = void 0 , t && hooks _module _c . _ _e ( t , r . _ _v ) ) } ; var k = "function" == typeof requestAnimationFrame ; function w ( n ) { var t , r = function ( ) { clearTimeout ( u ) , k && cancelAnimationFrame ( t ) , setTimeout ( n ) } , u = setTimeout ( r , 100 ) ; k && ( t = requestAnimationFrame ( r ) ) } function z ( n ) { var t = r , u = n . _ _c ; "function" == typeof u && ( n . _ _c = void 0 , u ( ) ) , r = t } function B ( n ) { var t = r ; n . _ _c = n . _ _ ( ) , r = t } function C ( n , t ) { return ! n || n . length !== t . length || t . some ( function ( t , r ) { return t !== n [ r ] } ) } function D ( n , t ) { return "function" == typeof t ? t ( n ) :
2023-09-26 10:23:26 -04:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/@preact/signals-core/dist/signals-core.module.js
2024-09-24 03:35:17 -04:00
var signals _core _module _i = Symbol . for ( "preact-signals" ) ; function signals _core _module _t ( ) { if ( ! ( signals _core _module _s > 1 ) ) { var i , t = ! 1 ; while ( void 0 !== signals _core _module _h ) { var r = signals _core _module _h ; signals _core _module _h = void 0 ; signals _core _module _f ++ ; while ( void 0 !== r ) { var o = r . o ; r . o = void 0 ; r . f &= - 3 ; if ( ! ( 8 & r . f ) && signals _core _module _c ( r ) ) try { r . c ( ) } catch ( r ) { if ( ! t ) { i = r ; t = ! 0 } } r = o } } signals _core _module _f = 0 ; signals _core _module _s -- ; if ( t ) throw i } else signals _core _module _s -- } function signals _core _module _r ( i ) { if ( signals _core _module _s > 0 ) return i ( ) ; signals _core _module _s ++ ; try { return i ( ) } finally { signals _core _module _t ( ) } } var signals _core _module _o = void 0 ; function n ( i ) { var t = signals _core _module _o ; signals _core _module _o = void 0 ; try { return i ( ) } finally { signals _core _module _o = t } } var signals _core _module _h = void 0 , signals _core _module _s = 0 , signals _core _module _f = 0 , signals _core _module _v = 0 ; function signals _core _module _e ( i ) { if ( void 0 !== signals _core _module _o ) { var t = i . n ; if ( void 0 === t || t . t !== signals _core _module _o ) { t = { i : 0 , S : i , p : signals _core _module _o . s , n : void 0 , t : signals _core _module _o , e : void 0 , x : void 0 , r : t } ; if ( void 0 !== signals _core _module _o . s ) signals _core _module _o . s . n = t ; signals _core _module _o . s = t ; i . n = t ; if ( 32 & signals _core _module _o . f ) i . S ( t ) ; return t } else if ( - 1 === t . i ) { t . i = 0 ; if ( void 0 !== t . n ) { t . n . p = t . p ; if ( void 0 !== t . p ) t . p . n = t . n ; t . p = signals _core _module _o . s ; t . n = void 0 ; signals _core _module _o . s . n = t ; signals _core _module _o . s = t } return t } } } function signals _core _module _u ( i ) { this . v = i ; this . i = 0 ; this . n = void 0 ; this . t = void 0 } signals _core _module _u . prototype . brand = signals _core _module _i ; signals _core _module _u . prototype . h = function ( ) { return ! 0 } ; signals _core _module _u . prototype . S = function ( i ) { if ( this . t !== i && void 0 === i . e ) { i . x = this . t ; if ( void 0 !== this . t ) this . t . e = i ; this . t = i } } ; signals _core _module _u . prototype . U = function ( i ) { if ( void 0 !== this . t ) { var t = i . e , r = i . x ; if ( void 0 !== t ) { t . x = r ; i . e = void 0 } if ( void 0 !== r ) { r . e = t ; i . x = void 0 } if ( i === this . t ) this . t = r } } ; signals _core _module _u . prototype . subscribe = function ( i ) { var t = this ; return E ( function ( ) { var r = t . value , n = signals _core _module _o ; signals _core _module _o = void 0 ; try { i ( r ) } finally { signals _core _module _o = n } } ) } ; signals _core _module _u . prototype . valueOf = function ( ) { return this . value } ; signals _core _module _u . prototype . toString = function ( ) { return this . value + "" } ; signals _core _module _u . prototype . toJSON = function ( ) { return this . value } ; signals _core _module _u . prototype . peek = function ( ) { var i = signals _core _module _o ; signals _core _module _o = void 0 ; try { return this . value } finally { signals _core _module _o = i } } ; Object . defineProperty ( signals _core _module _u . prototype , "value" , { get : function ( ) { var i = signals _core _module _e ( this ) ; if ( void 0 !== i ) i . i = this . i ; return this . v } , set : function ( i ) { if ( i !== this . v ) { if ( signals _core _module _f > 100 ) throw new Error ( "Cycle detected" ) ; this . v = i ; this . i ++ ; signals _core _module _v ++ ; signals _core _module _s ++ ; try { for ( var r = this . t ; void 0 !== r ; r = r . x ) r . t . N ( ) } finally { signals _core _module _t ( ) } } } } ) ; function signals _core _module _d ( i ) { return new signals _core _module _u ( i ) } function signals _core _module _c ( i ) { for ( var t = i . s ; void 0 !== t ; t = t . n ) if ( t . S . i !== t . i || ! t . S . h ( ) || t . S . i !== t . i ) return ! 0 ; return ! 1 } function signals _core _module _a ( i ) { for ( var t = i . s ; void 0 !== t ; t = t . n ) { var r = t . S . n ; if ( void 0 !== r ) t . r = r ; t . S . n = t ; t . i = - 1 ; if ( void 0 === t . n ) { i . s = t ; break } } } function signals _core _module _l ( i ) { var t = i . s , r = void 0 ; while ( void 0 !== t ) { var o = t . p ; if ( - 1 === t . i ) { t . S . U ( t ) ; if ( void 0 !== o ) o . n = t . n ; if ( void 0 !== t . n ) t . n . p = o } else r = t ; t . S . n = t . r ; if ( void 0 !== t . r ) t . r = void 0 ; t = o } i . s = r } function signals _core _module _y ( i ) { signals _core _module _u . call ( this , void 0 ) ; this . x = i ; this . s = void 0 ; this . g = signals _core _module _v - 1 ; this . f = 4 } ( signals _core _module _y . prototype = new signals _core _module _u ) . h = function ( ) { this . f &= - 3 ; if ( 1 & this . f ) return ! 1 ; if ( 32 == ( 36 & this . f ) ) return ! 0 ; this . f &= - 5 ; if ( this . g === signals _core _module _v ) return ! 0 ; this . g = signals _core _module _v ; this . f |= 1 ; if ( this . i > 0 && ! signals _core _module _c ( this ) ) { this . f &= - 2 ; return ! 0 } var i = signals _core _module _o ; try { signals _core _module _a ( this ) ; signals _core _module _o = this ; var t = this . x ( ) ; if ( 16 & this . f || this . v !== t || 0 === this . i ) { this . v = t ; this . f &= - 17 ; this . i ++ } } catch ( i ) { this . v = i ; this . f |= 16 ; this . i ++ } signals _core _module _o = i ; signals _core _module _l ( this ) ; this
2024-12-13 14:06:24 -05:00
; // ./node_modules/@preact/signals/dist/signals.module.js
2024-09-24 03:35:17 -04:00
var signals _module _v , signals _module _s ; function signals _module _l ( n , i ) { preact _module /* options */ . fF [ n ] = i . bind ( null , preact _module /* options */ . fF [ n ] || function ( ) { } ) } function signals _module _d ( n ) { if ( signals _module _s ) signals _module _s ( ) ; signals _module _s = n && n . S ( ) } function signals _module _p ( n ) { var r = this , f = n . data , o = useSignal ( f ) ; o . value = f ; var e = T ( function ( ) { var n = r . _ _v ; while ( n = n . _ _ ) if ( n . _ _c ) { n . _ _c . _ _$f |= 4 ; break } r . _ _$u . c = function ( ) { var n ; if ( ! ( 0 , preact _module /* isValidElement */ . zO ) ( e . peek ( ) ) && 3 === ( null == ( n = r . base ) ? void 0 : n . nodeType ) ) r . base . data = e . peek ( ) ; else { r . _ _$f |= 1 ; r . setState ( { } ) } } ; return signals _core _module _w ( function ( ) { var n = o . value . value ; return 0 === n ? 0 : ! 0 === n ? "" : n || "" } ) } , [ ] ) ; return e . value } signals _module _p . displayName = "_st" ; Object . defineProperties ( signals _core _module _u . prototype , { constructor : { configurable : ! 0 , value : void 0 } , type : { configurable : ! 0 , value : signals _module _p } , props : { configurable : ! 0 , get : function ( ) { return { data : this } } } , _ _b : { configurable : ! 0 , value : 1 } } ) ; signals _module _l ( "__b" , function ( n , r ) { if ( "string" == typeof r . type ) { var i , t = r . props ; for ( var f in t ) if ( "children" !== f ) { var o = t [ f ] ; if ( o instanceof signals _core _module _u ) { if ( ! i ) r . _ _np = i = { } ; i [ f ] = o ; t [ f ] = o . peek ( ) } } } n ( r ) } ) ; signals _module _l ( "__r" , function ( n , r ) { signals _module _d ( ) ; var i , t = r . _ _c ; if ( t ) { t . _ _$f &= - 2 ; if ( void 0 === ( i = t . _ _$u ) ) t . _ _$u = i = function ( n ) { var r ; E ( function ( ) { r = this } ) ; r . c = function ( ) { t . _ _$f |= 1 ; t . setState ( { } ) } ; return r } ( ) } signals _module _v = t ; signals _module _d ( i ) ; n ( r ) } ) ; signals _module _l ( "__e" , function ( n , r , i , t ) { signals _module _d ( ) ; signals _module _v = void 0 ; n ( r , i , t ) } ) ; signals _module _l ( "diffed" , function ( n , r ) { signals _module _d ( ) ; signals _module _v = void 0 ; var i ; if ( "string" == typeof r . type && ( i = r . _ _e ) ) { var t = r . _ _np , f = r . props ; if ( t ) { var o = i . U ; if ( o ) for ( var e in o ) { var u = o [ e ] ; if ( void 0 !== u && ! ( e in t ) ) { u . d ( ) ; o [ e ] = void 0 } } else i . U = o = { } ; for ( var a in t ) { var c = o [ a ] , s = t [ a ] ; if ( void 0 === c ) { c = signals _module _ ( i , a , s , f ) ; o [ a ] = c } else c . o ( s , f ) } } } n ( r ) } ) ; function signals _module _ ( n , r , i , t ) { var f = r in n && void 0 === n . ownerSVGElement , o = signals _core _module _d ( i ) ; return { o : function ( n , r ) { o . value = n ; t = r } , d : E ( function ( ) { var i = o . value . value ; if ( t [ r ] !== i ) { t [ r ] = i ; if ( f ) n [ r ] = i ; else if ( i ) n . setAttribute ( r , i ) ; else n . removeAttribute ( r ) } } ) } } signals _module _l ( "unmount" , function ( n , r ) { if ( "string" == typeof r . type ) { var i = r . _ _e ; if ( i ) { var t = i . U ; if ( t ) { i . U = void 0 ; for ( var f in t ) { var o = t [ f ] ; if ( o ) o . d ( ) } } } } else { var e = r . _ _c ; if ( e ) { var u = e . _ _$u ; if ( u ) { e . _ _$u = void 0 ; u . d ( ) } } } n ( r ) } ) ; signals _module _l ( "__h" , function ( n , r , i , t ) { if ( t < 3 || 9 === t ) r . _ _$f |= 2 ; n ( r , i , t ) } ) ; preact _module /* Component */ . uA . prototype . shouldComponentUpdate = function ( n , r ) { var i = this . _ _$u ; if ( ! ( i && void 0 !== i . s || 4 & this . _ _$f ) ) return ! 0 ; if ( 3 & this . _ _$f ) return ! 0 ; for ( var t in r ) return ! 0 ; for ( var f in n ) if ( "__source" !== f && n [ f ] !== this . props [ f ] ) return ! 0 ; for ( var o in this . props ) if ( ! ( o in n ) ) return ! 0 ; return ! 1 } ; function useSignal ( n ) { return T ( function ( ) { return signals _core _module _d ( n ) } , [ ] ) } function useComputed ( n ) { var r = f ( n ) ; r . current = n ; signals _module _v . _ _$f |= 4 ; return t ( function ( ) { return u ( function ( ) { return r . current ( ) } ) } , [ ] ) } function useSignalEffect ( n ) { var r = f ( n ) ; r . current = n ; o ( function ( ) { return c ( function ( ) { return r . current ( ) } ) } , [ ] ) }
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/namespaces.js
2024-09-19 21:55:35 -04:00
const namespaceStack = [ ] ;
const getNamespace = ( ) => namespaceStack . slice ( - 1 ) [ 0 ] ;
const setNamespace = namespace => {
namespaceStack . push ( namespace ) ;
2024-02-27 09:48:23 -05:00
} ;
2024-09-19 21:55:35 -04:00
const resetNamespace = ( ) => {
namespaceStack . pop ( ) ;
2024-02-27 09:48:23 -05:00
} ;
2023-09-26 10:23:26 -04:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/scopes.js
2023-09-26 10:23:26 -04:00
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
2024-09-19 21:55:35 -04:00
// Store stacks for the current scope and the default namespaces and export APIs
// to interact with them.
const scopeStack = [ ] ;
const getScope = ( ) => scopeStack . slice ( - 1 ) [ 0 ] ;
const setScope = scope => {
scopeStack . push ( scope ) ;
} ;
const resetScope = ( ) => {
scopeStack . pop ( ) ;
} ;
2023-09-26 10:23:26 -04:00
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
// Wrap the element props to prevent modifications.
const immutableMap = new WeakMap ( ) ;
const immutableError = ( ) => {
throw new Error ( 'Please use `data-wp-bind` to modify the attributes of an element.' ) ;
} ;
const immutableHandlers = {
get ( target , key , receiver ) {
const value = Reflect . get ( target , key , receiver ) ;
return ! ! value && typeof value === 'object' ? deepImmutable ( value ) : value ;
} ,
set : immutableError ,
deleteProperty : immutableError
} ;
const deepImmutable = target => {
2024-05-23 15:39:28 -04:00
if ( ! immutableMap . has ( target ) ) {
immutableMap . set ( target , new Proxy ( target , immutableHandlers ) ) ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
return immutableMap . get ( target ) ;
} ;
2023-09-26 10:23:26 -04:00
/ * *
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* Retrieves the context inherited by the element evaluating a function from the
* store . The returned value depends on the element and the namespace where the
* function calling ` getContext() ` exists .
*
* @ param namespace Store namespace . By default , the namespace where the calling
* function exists is used .
* @ return The context content .
2023-09-26 10:23:26 -04:00
* /
2024-09-19 21:55:35 -04:00
const getContext = namespace => {
const scope = getScope ( ) ;
if ( true ) {
if ( ! scope ) {
throw Error ( 'Cannot call `getContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.' ) ;
}
}
return scope . context [ namespace || getNamespace ( ) ] ;
} ;
2023-09-26 10:23:26 -04:00
/ * *
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* Retrieves a representation of the element where a function from the store
* is being evalutated . Such representation is read - only , and contains a
* reference to the DOM element , its props and a local reactive state .
*
* @ return Element representation .
2023-09-26 10:23:26 -04:00
* /
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const getElement = ( ) => {
2024-09-19 21:55:35 -04:00
const scope = getScope ( ) ;
if ( true ) {
if ( ! scope ) {
throw Error ( 'Cannot call `getElement()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.' ) ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
const {
ref ,
attributes
2024-09-19 21:55:35 -04:00
} = scope ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
return Object . freeze ( {
ref : ref . current ,
attributes : deepImmutable ( attributes )
} ) ;
} ;
2023-09-26 10:23:26 -04:00
/ * *
2024-09-19 21:55:35 -04:00
* Retrieves the part of the inherited context defined and updated from the
* server .
*
* The object returned is read - only , and includes the context defined in PHP
* with ` wp_interactivity_data_wp_context() ` , including the corresponding
* inherited properties . When ` actions.navigate() ` is called , this object is
* updated to reflect the changes in the new visited page , without affecting the
* context returned by ` getContext() ` . Directives can subscribe to those changes
* to update the context if needed .
2023-09-26 10:23:26 -04:00
*
* @ example
* ` ` ` js
2024-09-19 21:55:35 -04:00
* store ( '...' , {
* callbacks : {
* updateServerContext ( ) {
* const context = getContext ( ) ;
* const serverContext = getServerContext ( ) ;
* // Override some property with the new value that came from the server.
* context . overridableProp = serverContext . overridableProp ;
* } ,
* } ,
* } ) ;
2023-09-26 10:23:26 -04:00
* ` ` `
*
2024-09-19 21:55:35 -04:00
* @ param namespace Store namespace . By default , the namespace where the calling
* function exists is used .
* @ return The server context content .
2023-09-26 10:23:26 -04:00
* /
2024-09-19 21:55:35 -04:00
const getServerContext = namespace => {
const scope = getScope ( ) ;
if ( true ) {
if ( ! scope ) {
throw Error ( 'Cannot call `getServerContext()` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like `setTimeout`, please wrap the callback with `withScope(callback)`.' ) ;
2023-09-26 10:23:26 -04:00
}
}
2024-09-19 21:55:35 -04:00
return scope . serverContext [ namespace || getNamespace ( ) ] ;
2023-09-26 10:23:26 -04:00
} ;
2024-01-31 07:59:56 -05:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/utils.js
2023-09-26 10:23:26 -04:00
/ * *
* External 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 16:07:12 -05:00
/ * *
* Internal dependencies
* /
2023-09-26 10:23:26 -04:00
2024-09-19 21:55:35 -04:00
2024-05-23 15:39:28 -04:00
/ * *
* Executes a callback function after the next frame is rendered .
*
* @ param callback The callback function to be executed .
* @ return A promise that resolves after the callback function is executed .
* /
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const afterNextFrame = callback => {
return new Promise ( resolve => {
const done = ( ) => {
clearTimeout ( timeout ) ;
window . cancelAnimationFrame ( raf ) ;
setTimeout ( ( ) => {
callback ( ) ;
resolve ( ) ;
} ) ;
} ;
const timeout = setTimeout ( done , 100 ) ;
const raf = window . requestAnimationFrame ( done ) ;
} ) ;
} ;
2024-05-31 14:59:00 -04:00
/ * *
* Returns a promise that resolves after yielding to main .
*
* @ return Promise
* /
2024-06-25 09:49:28 -04:00
const splitTask = ( ) => {
2024-05-31 14:59:00 -04:00
return new Promise ( resolve => {
// TODO: Use scheduler.yield() when available.
setTimeout ( resolve , 0 ) ;
} ) ;
} ;
2024-05-23 15:39:28 -04:00
/ * *
* Creates a Flusher object that can be used to flush computed values and notify listeners .
*
* Using the mangled properties :
* this . c : this . _callback
* this . x : this . _compute
* https : //github.com/preactjs/signals/blob/main/mangle.json
*
* @ param compute The function that computes the value to be flushed .
* @ param notify The function that notifies listeners when the value is flushed .
* @ return The Flusher object with ` flush ` and ` dispose ` properties .
* /
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
function createFlusher ( compute , notify ) {
2024-05-23 15:39:28 -04:00
let flush = ( ) => undefined ;
2024-09-24 03:35:17 -04:00
const dispose = E ( function ( ) {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
flush = this . c . bind ( this ) ;
this . x = compute ;
this . c = notify ;
return compute ( ) ;
} ) ;
return {
flush ,
dispose
} ;
}
2024-05-23 15:39:28 -04:00
/ * *
* Custom hook that executes a callback function whenever a signal is triggered .
* Version of ` useSignalEffect ` with a ` useEffect ` - like execution . This hook
* implementation comes from this PR , but we added short - cirtuiting to avoid
* infinite loops : https : //github.com/preactjs/signals/pull/290
*
* @ param callback The callback function to be executed .
* /
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
function utils _useSignalEffect ( callback ) {
2024-09-24 03:35:17 -04:00
y ( ( ) => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
let eff = null ;
let isExecuting = false ;
const notify = async ( ) => {
if ( eff && ! isExecuting ) {
isExecuting = true ;
await afterNextFrame ( eff . flush ) ;
isExecuting = false ;
}
} ;
eff = createFlusher ( callback , notify ) ;
return eff . dispose ;
} , [ ] ) ;
}
/ * *
* Returns the passed function wrapped with the current scope so it is
* accessible whenever the function runs . This is primarily to make the scope
* available inside hook callbacks .
*
2024-05-23 15:39:28 -04:00
* Asyncronous functions should use generators that yield promises instead of awaiting them .
* See the documentation for details : https : //developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store
*
* @ param func The passed function .
* @ return The wrapped function .
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* /
2024-05-23 15:39:28 -04:00
function withScope ( func ) {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const scope = getScope ( ) ;
const ns = getNamespace ( ) ;
if ( func ? . constructor ? . name === 'GeneratorFunction' ) {
return async ( ... args ) => {
const gen = func ( ... args ) ;
let value ;
let it ;
while ( true ) {
setNamespace ( ns ) ;
setScope ( scope ) ;
try {
it = gen . next ( value ) ;
} finally {
resetScope ( ) ;
2024-09-19 21:55:35 -04:00
resetNamespace ( ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
try {
value = await it . value ;
} catch ( e ) {
2024-09-19 21:55:35 -04:00
setNamespace ( ns ) ;
setScope ( scope ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
gen . throw ( e ) ;
2024-09-19 21:55:35 -04:00
} finally {
resetScope ( ) ;
resetNamespace ( ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
2024-05-23 15:39:28 -04:00
if ( it . done ) {
break ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
return value ;
} ;
}
return ( ... args ) => {
setNamespace ( ns ) ;
setScope ( scope ) ;
try {
return func ( ... args ) ;
} finally {
resetNamespace ( ) ;
resetScope ( ) ;
2023-09-26 10:23:26 -04:00
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} ;
2024-05-23 15:39:28 -04:00
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
2023-09-26 10:23:26 -04:00
/ * *
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* Accepts a function that contains imperative code which runs whenever any of
* the accessed _reactive _ properties ( e . g . , values from the global state or the
* context ) is modified .
*
* This hook makes the element ' s scope available so functions like
* ` getElement() ` and ` getContext() ` can be used inside the passed callback .
*
2024-05-23 15:39:28 -04:00
* @ param callback The hook callback .
2023-09-26 10:23:26 -04:00
* /
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
function useWatch ( callback ) {
utils _useSignalEffect ( withScope ( callback ) ) ;
}
2023-09-26 10:23:26 -04:00
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ * *
* Accepts a function that contains imperative code which runs only after the
* element ' s first render , mainly useful for intialization logic .
*
* This hook makes the element ' s scope available so functions like
* ` getElement() ` and ` getContext() ` can be used inside the passed callback .
*
2024-05-23 15:39:28 -04:00
* @ param callback The hook callback .
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* /
function useInit ( callback ) {
2024-09-24 03:35:17 -04:00
y ( withScope ( callback ) , [ ] ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
2023-09-26 10:23:26 -04:00
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ * *
* Accepts a function that contains imperative , possibly effectful code . The
* effects run after browser paint , without blocking it .
*
* This hook is equivalent to Preact 's `useEffect` and makes the element' s scope
* available so functions like ` getElement() ` and ` getContext() ` can be used
* inside the passed callback .
*
2024-05-23 15:39:28 -04:00
* @ param callback Imperative function that can return a cleanup
* function .
* @ param inputs If present , effect will only activate if the
* values in the list change ( using ` === ` ) .
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* /
function useEffect ( callback , inputs ) {
2024-09-24 03:35:17 -04:00
y ( withScope ( callback ) , inputs ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
2023-09-26 10:23:26 -04:00
/ * *
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* Accepts a function that contains imperative , possibly effectful code . Use
* this to read layout from the DOM and synchronously re - render .
*
* This hook is equivalent to Preact 's `useLayoutEffect` and makes the element' s
* scope available so functions like ` getElement() ` and ` getContext() ` can be
* used inside the passed callback .
*
2024-05-23 15:39:28 -04:00
* @ param callback Imperative function that can return a cleanup
* function .
* @ param inputs If present , effect will only activate if the
* values in the list change ( using ` === ` ) .
2023-09-26 10:23:26 -04:00
* /
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
function useLayoutEffect ( callback , inputs ) {
2024-09-24 03:35:17 -04:00
_ ( withScope ( callback ) , inputs ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
2023-09-26 10:23:26 -04:00
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ * *
* Returns a memoized version of the callback that only changes if one of the
* inputs has changed ( using ` === ` ) .
*
* This hook is equivalent to Preact 's `useCallback` and makes the element' s
* scope available so functions like ` getElement() ` and ` getContext() ` can be
* used inside the passed callback .
*
2024-05-23 15:39:28 -04:00
* @ param callback Callback function .
* @ param inputs If present , the callback will only be updated if the
* values in the list change ( using ` === ` ) .
*
* @ return The callback function .
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* /
function useCallback ( callback , inputs ) {
2024-09-24 03:35:17 -04:00
return q ( withScope ( callback ) , inputs ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
2023-09-26 10:23:26 -04:00
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ * *
* Pass a factory function and an array of inputs . ` useMemo ` will only recompute
* the memoized value when one of the inputs has changed .
*
* This hook is equivalent to Preact 's `useMemo` and makes the element' s scope
* available so functions like ` getElement() ` and ` getContext() ` can be used
* inside the passed factory function .
*
2024-05-23 15:39:28 -04:00
* @ param factory Factory function that returns that value for memoization .
* @ param inputs If present , the factory will only be run to recompute if
* the values in the list change ( using ` === ` ) .
*
* @ return The memoized value .
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* /
function useMemo ( factory , inputs ) {
2024-09-24 03:35:17 -04:00
return T ( withScope ( factory ) , inputs ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
2024-05-23 15:39:28 -04:00
/ * *
* Creates a root fragment by replacing a node or an array of nodes in a parent element .
* For wrapperless hydration .
* See https : //gist.github.com/developit/f4c67a2ede71dc2fab7f357f39cff28c
*
* @ param parent The parent element where the nodes will be replaced .
* @ param replaceNode The node or array of nodes to replace in the parent element .
* @ return The created root fragment .
* /
2024-09-19 21:55:35 -04:00
const createRootFragment = ( parent , replaceNode ) => {
replaceNode = [ ] . concat ( replaceNode ) ;
const sibling = replaceNode [ replaceNode . length - 1 ] . nextSibling ;
function insert ( child , root ) {
parent . insertBefore ( child , root || sibling ) ;
}
return parent . _ _k = {
nodeType : 1 ,
parentNode : parent ,
firstChild : replaceNode [ 0 ] ,
childNodes : replaceNode ,
insertBefore : insert ,
appendChild : insert ,
removeChild ( c ) {
parent . removeChild ( c ) ;
}
} ;
} ;
/ * *
* Transforms a kebab - case string to camelCase .
*
* @ param str The kebab - case string to transform to camelCase .
* @ return The transformed camelCase string .
* /
function kebabToCamelCase ( str ) {
return str . replace ( /^-+|-+$/g , '' ) . toLowerCase ( ) . replace ( /-([a-z])/g , function ( _match , group1 ) {
return group1 . toUpperCase ( ) ;
} ) ;
}
const logged = new Set ( ) ;
/ * *
* Shows a warning with ` message ` if environment is not ` production ` .
*
* Based on the ` @wordpress/warning ` package .
*
* @ param message Message to show in the warning .
* /
const warn = message => {
if ( true ) {
if ( logged . has ( message ) ) {
return ;
}
// eslint-disable-next-line no-console
console . warn ( message ) ;
// Throwing an error and catching it immediately to improve debugging
// A consumer can use 'pause on caught exceptions'
try {
throw Error ( message ) ;
} catch ( e ) {
// Do nothing.
}
logged . add ( message ) ;
}
} ;
/ * *
* Checks if the passed ` candidate ` is a plain object with just the ` Object `
* prototype .
*
* @ param candidate The item to check .
* @ return Whether ` candidate ` is a plain object .
* /
const isPlainObject = candidate => Boolean ( candidate && typeof candidate === 'object' && candidate . constructor === Object ) ;
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/proxies/registry.js
2024-09-19 21:55:35 -04:00
/ * *
* Proxies for each object .
* /
const objToProxy = new WeakMap ( ) ;
const proxyToObj = new WeakMap ( ) ;
/ * *
* Namespaces for each created proxy .
* /
const proxyToNs = new WeakMap ( ) ;
/ * *
* Object types that can be proxied .
* /
const supported = new Set ( [ Object , Array ] ) ;
/ * *
* Returns a proxy to the passed object with the given handlers , assigning the
* specified namespace to it . If a proxy for the passed object was created
* before , that proxy is returned .
*
* @ param namespace The namespace that will be associated to this proxy .
* @ param obj The object to proxify .
* @ param handlers Handlers that the proxy will use .
*
* @ throws Error if the object cannot be proxified . Use { @ link shouldProxy } to
* check if a proxy can be created for a specific object .
*
* @ return The created proxy .
* /
const createProxy = ( namespace , obj , handlers ) => {
if ( ! shouldProxy ( obj ) ) {
throw Error ( 'This object cannot be proxified.' ) ;
}
if ( ! objToProxy . has ( obj ) ) {
const proxy = new Proxy ( obj , handlers ) ;
objToProxy . set ( obj , proxy ) ;
proxyToObj . set ( proxy , obj ) ;
proxyToNs . set ( proxy , namespace ) ;
}
return objToProxy . get ( obj ) ;
} ;
/ * *
* Returns the proxy for the given object . If there is no associated proxy , the
* function returns ` undefined ` .
*
* @ param obj Object from which to know the proxy .
* @ return Associated proxy or ` undefined ` .
* /
const getProxyFromObject = obj => objToProxy . get ( obj ) ;
/ * *
* Gets the namespace associated with the given proxy .
*
* Proxies have a namespace assigned upon creation . See { @ link createProxy } .
*
* @ param proxy Proxy .
* @ return Namespace .
* /
const getNamespaceFromProxy = proxy => proxyToNs . get ( proxy ) ;
/ * *
* Checks if a given object can be proxied .
*
* @ param candidate Object to know whether it can be proxied .
* @ return True if the passed instance can be proxied .
* /
const shouldProxy = candidate => {
if ( typeof candidate !== 'object' || candidate === null ) {
return false ;
}
return ! proxyToNs . has ( candidate ) && supported . has ( candidate . constructor ) ;
} ;
/ * *
* Returns the target object for the passed proxy . If the passed object is not a registered proxy , the
* function returns ` undefined ` .
*
* @ param proxy Proxy from which to know the target .
* @ return The target object or ` undefined ` .
* /
const getObjectFromProxy = proxy => proxyToObj . get ( proxy ) ;
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/proxies/signals.js
2024-09-19 21:55:35 -04:00
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* Identifier for property computeds not associated to any scope .
* /
const NO _SCOPE = { } ;
/ * *
* Structure that manages reactivity for a property in a state object . It uses
* signals to keep track of property value or getter modifications .
* /
class PropSignal {
/ * *
* Proxy that holds the property this PropSignal is associated with .
* /
/ * *
* Relation of computeds by scope . These computeds are read - only signals
* that depend on whether the property is a value or a getter and ,
* therefore , can return different values depending on the scope in which
* the getter is accessed .
* /
/ * *
* Signal with the value assigned to the related property .
* /
/ * *
* Signal with the getter assigned to the related property .
* /
/ * *
* Structure that manages reactivity for a property in a state object , using
* signals to keep track of property value or getter modifications .
*
* @ param owner Proxy that holds the property this instance is associated
* with .
* /
constructor ( owner ) {
this . owner = owner ;
this . computedsByScope = new WeakMap ( ) ;
}
/ * *
* Changes the internal value . If a getter was set before , it is set to
* ` undefined ` .
*
* @ param value New value .
* /
setValue ( value ) {
this . update ( {
value
} ) ;
}
/ * *
* Changes the internal getter . If a value was set before , it is set to
* ` undefined ` .
*
* @ param getter New getter .
* /
setGetter ( getter ) {
this . update ( {
get : getter
} ) ;
}
/ * *
* Returns the computed that holds the result of evaluating the prop in the
* current scope .
*
* These computeds are read - only signals that depend on whether the property
* is a value or a getter and , therefore , can return different values
* depending on the scope in which the getter is accessed .
*
* @ return Computed that depends on the scope .
* /
getComputed ( ) {
const scope = getScope ( ) || NO _SCOPE ;
if ( ! this . valueSignal && ! this . getterSignal ) {
this . update ( { } ) ;
}
if ( ! this . computedsByScope . has ( scope ) ) {
const callback = ( ) => {
const getter = this . getterSignal ? . value ;
return getter ? getter . call ( this . owner ) : this . valueSignal ? . value ;
} ;
setNamespace ( getNamespaceFromProxy ( this . owner ) ) ;
this . computedsByScope . set ( scope , signals _core _module _w ( withScope ( callback ) ) ) ;
resetNamespace ( ) ;
}
return this . computedsByScope . get ( scope ) ;
}
/ * *
* Update the internal signals for the value and the getter of the
* corresponding prop .
*
* @ param param0
* @ param param0 . get New getter .
* @ param param0 . value New value .
* /
update ( {
get ,
value
} ) {
if ( ! this . valueSignal ) {
this . valueSignal = signals _core _module _d ( value ) ;
this . getterSignal = signals _core _module _d ( get ) ;
} else if ( value !== this . valueSignal . peek ( ) || get !== this . getterSignal . peek ( ) ) {
signals _core _module _r ( ( ) => {
this . valueSignal . value = value ;
this . getterSignal . value = get ;
} ) ;
}
}
}
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/proxies/state.js
2024-09-19 21:55:35 -04:00
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* Set of built - in symbols .
* /
const wellKnownSymbols = new Set ( Object . getOwnPropertyNames ( Symbol ) . map ( key => Symbol [ key ] ) . filter ( value => typeof value === 'symbol' ) ) ;
/ * *
* Relates each proxy with a map of { @ link PropSignal } instances , representing
* the proxy ' s accessed properties .
* /
const proxyToProps = new WeakMap ( ) ;
/ * *
* Checks wether a { @ link PropSignal | ` PropSignal ` } instance exists for the
* given property in the passed proxy .
*
* @ param proxy Proxy of a state object or array .
* @ param key The property key .
* @ return ` true ` when it exists ; false otherwise .
* /
const hasPropSignal = ( proxy , key ) => proxyToProps . has ( proxy ) && proxyToProps . get ( proxy ) . has ( key ) ;
const readOnlyProxies = new WeakSet ( ) ;
/ * *
* Returns the { @ link PropSignal | ` PropSignal ` } instance associated with the
* specified prop in the passed proxy .
*
* The ` PropSignal ` instance is generated if it doesn ' t exist yet , using the
* ` initial ` parameter to initialize the internal signals .
*
* @ param proxy Proxy of a state object or array .
* @ param key The property key .
* @ param initial Initial data for the ` PropSignal ` instance .
* @ return The ` PropSignal ` instance .
* /
const getPropSignal = ( proxy , key , initial ) => {
if ( ! proxyToProps . has ( proxy ) ) {
proxyToProps . set ( proxy , new Map ( ) ) ;
}
key = typeof key === 'number' ? ` ${ key } ` : key ;
const props = proxyToProps . get ( proxy ) ;
if ( ! props . has ( key ) ) {
const ns = getNamespaceFromProxy ( proxy ) ;
const prop = new PropSignal ( proxy ) ;
props . set ( key , prop ) ;
if ( initial ) {
const {
get ,
value
} = initial ;
if ( get ) {
prop . setGetter ( get ) ;
} else {
const readOnly = readOnlyProxies . has ( proxy ) ;
prop . setValue ( shouldProxy ( value ) ? proxifyState ( ns , value , {
readOnly
} ) : value ) ;
}
}
}
return props . get ( key ) ;
} ;
/ * *
* Relates each proxied object ( i . e . , the original object ) with a signal that
* tracks changes in the number of properties .
* /
const objToIterable = new WeakMap ( ) ;
/ * *
* When this flag is ` true ` , it avoids any signal subscription , overriding state
* props ' "reactive" behavior .
* /
let peeking = false ;
/ * *
* Handlers for reactive objects and arrays in the state .
* /
const stateHandlers = {
get ( target , key , receiver ) {
/ *
* The property should not be reactive for the following cases :
* 1. While using the ` peek ` function to read the property .
* 2. The property exists but comes from the Object or Array prototypes .
* 3. The property key is a known symbol .
* /
if ( peeking || ! target . hasOwnProperty ( key ) && key in target || typeof key === 'symbol' && wellKnownSymbols . has ( key ) ) {
return Reflect . get ( target , key , receiver ) ;
}
// At this point, the property should be reactive.
const desc = Object . getOwnPropertyDescriptor ( target , key ) ;
const prop = getPropSignal ( receiver , key , desc ) ;
const result = prop . getComputed ( ) . value ;
/ *
* Check if the property is a synchronous function . If it is , set the
* default namespace . Synchronous functions always run in the proper scope ,
* which is set by the Directives component .
* /
if ( typeof result === 'function' ) {
const ns = getNamespaceFromProxy ( receiver ) ;
return ( ... args ) => {
setNamespace ( ns ) ;
try {
return result . call ( receiver , ... args ) ;
} finally {
resetNamespace ( ) ;
}
} ;
}
return result ;
} ,
set ( target , key , value , receiver ) {
if ( readOnlyProxies . has ( receiver ) ) {
return false ;
}
setNamespace ( getNamespaceFromProxy ( receiver ) ) ;
try {
return Reflect . set ( target , key , value , receiver ) ;
} finally {
resetNamespace ( ) ;
}
} ,
defineProperty ( target , key , desc ) {
if ( readOnlyProxies . has ( getProxyFromObject ( target ) ) ) {
return false ;
}
const isNew = ! ( key in target ) ;
const result = Reflect . defineProperty ( target , key , desc ) ;
if ( result ) {
const receiver = getProxyFromObject ( target ) ;
const prop = getPropSignal ( receiver , key ) ;
const {
get ,
value
} = desc ;
if ( get ) {
prop . setGetter ( get ) ;
} else {
const ns = getNamespaceFromProxy ( receiver ) ;
prop . setValue ( shouldProxy ( value ) ? proxifyState ( ns , value ) : value ) ;
}
if ( isNew && objToIterable . has ( target ) ) {
objToIterable . get ( target ) . value ++ ;
}
/ *
* Modify the ` length ` property value only if the related
* ` PropSignal ` exists , which means that there are subscriptions to
* this property .
* /
if ( Array . isArray ( target ) && proxyToProps . get ( receiver ) ? . has ( 'length' ) ) {
const length = getPropSignal ( receiver , 'length' ) ;
length . setValue ( target . length ) ;
}
}
return result ;
} ,
deleteProperty ( target , key ) {
if ( readOnlyProxies . has ( getProxyFromObject ( target ) ) ) {
return false ;
}
const result = Reflect . deleteProperty ( target , key ) ;
if ( result ) {
const prop = getPropSignal ( getProxyFromObject ( target ) , key ) ;
prop . setValue ( undefined ) ;
if ( objToIterable . has ( target ) ) {
objToIterable . get ( target ) . value ++ ;
}
}
return result ;
} ,
ownKeys ( target ) {
if ( ! objToIterable . has ( target ) ) {
objToIterable . set ( target , signals _core _module _d ( 0 ) ) ;
}
/ *
* This subscribes to the signal while preventing the minifier from
* deleting this line in production .
* /
objToIterable . _ = objToIterable . get ( target ) . value ;
return Reflect . ownKeys ( target ) ;
}
} ;
/ * *
* Returns the proxy associated with the given state object , creating it if it
* does not exist .
*
* @ param namespace The namespace that will be associated to this proxy .
* @ param obj The object to proxify .
* @ param options Options .
* @ param options . readOnly Read - only .
*
* @ throws Error if the object cannot be proxified . Use { @ link shouldProxy } to
* check if a proxy can be created for a specific object .
*
* @ return The associated proxy .
* /
const proxifyState = ( namespace , obj , options ) => {
const proxy = createProxy ( namespace , obj , stateHandlers ) ;
if ( options ? . readOnly ) {
readOnlyProxies . add ( proxy ) ;
}
return proxy ;
} ;
/ * *
* Reads the value of the specified property without subscribing to it .
*
* @ param obj The object to read the property from .
* @ param key The property key .
* @ return The property value .
* /
const peek = ( obj , key ) => {
peeking = true ;
try {
return obj [ key ] ;
} finally {
peeking = false ;
}
} ;
/ * *
* Internal recursive implementation for { @ link deepMerge | ` deepMerge ` } .
*
* @ param target The target object .
* @ param source The source object containing new values and props .
* @ param override Whether existing props should be overwritten or not ( ` true `
* by default ) .
* /
const deepMergeRecursive = ( target , source , override = true ) => {
2024-10-06 18:45:30 -04:00
if ( ! ( isPlainObject ( target ) && isPlainObject ( source ) ) ) {
return ;
}
let hasNewKeys = false ;
for ( const key in source ) {
const isNew = ! ( key in target ) ;
hasNewKeys = hasNewKeys || isNew ;
const desc = Object . getOwnPropertyDescriptor ( source , key ) ;
const proxy = getProxyFromObject ( target ) ;
const propSignal = ! ! proxy && hasPropSignal ( proxy , key ) && getPropSignal ( proxy , key ) ;
if ( typeof desc . get === 'function' || typeof desc . set === 'function' ) {
if ( override || isNew ) {
Object . defineProperty ( target , key , {
... desc ,
configurable : true ,
enumerable : true
} ) ;
if ( desc . get && propSignal ) {
propSignal . setGetter ( desc . get ) ;
2024-09-19 21:55:35 -04:00
}
2024-10-06 18:45:30 -04:00
}
} else if ( isPlainObject ( source [ key ] ) ) {
if ( isNew || override && ! isPlainObject ( target [ key ] ) ) {
target [ key ] = { } ;
if ( propSignal ) {
2024-10-21 07:23:29 -04:00
const ns = getNamespaceFromProxy ( proxy ) ;
propSignal . setValue ( proxifyState ( ns , target [ key ] ) ) ;
2024-09-19 21:55:35 -04:00
}
2024-10-06 18:45:30 -04:00
}
if ( isPlainObject ( target [ key ] ) ) {
2024-09-19 21:55:35 -04:00
deepMergeRecursive ( target [ key ] , source [ key ] , override ) ;
2024-10-06 18:45:30 -04:00
}
} else if ( override || isNew ) {
Object . defineProperty ( target , key , desc ) ;
if ( propSignal ) {
2024-10-21 07:23:29 -04:00
const {
value
} = desc ;
const ns = getNamespaceFromProxy ( proxy ) ;
propSignal . setValue ( shouldProxy ( value ) ? proxifyState ( ns , value ) : value ) ;
2024-09-19 21:55:35 -04:00
}
}
2024-10-06 18:45:30 -04:00
}
if ( hasNewKeys && objToIterable . has ( target ) ) {
objToIterable . get ( target ) . value ++ ;
2024-09-19 21:55:35 -04:00
}
} ;
/ * *
* Recursively update prop values inside the passed ` target ` and nested plain
* objects , using the values present in ` source ` . References to plain objects
* are kept , only updating props containing primitives or arrays . Arrays are
* replaced instead of merged or concatenated .
*
* If the ` override ` parameter is set to ` false ` , then all values in ` target `
* are preserved , and only new properties from ` source ` are added .
*
* @ param target The target object .
* @ param source The source object containing new values and props .
* @ param override Whether existing props should be overwritten or not ( ` true `
* by default ) .
* /
const deepMerge = ( target , source , override = true ) => signals _core _module _r ( ( ) => deepMergeRecursive ( getObjectFromProxy ( target ) || target , source , override ) ) ;
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/proxies/store.js
2024-09-19 21:55:35 -04:00
/ * *
* Internal dependencies
* /
/ * *
* External dependencies
* /
/ * *
* Identifies the store proxies handling the root objects of each store .
* /
const storeRoots = new WeakSet ( ) ;
/ * *
* Handlers for store proxies .
* /
const storeHandlers = {
get : ( target , key , receiver ) => {
const result = Reflect . get ( target , key ) ;
const ns = getNamespaceFromProxy ( receiver ) ;
/ *
* Check if the proxy is the store root and no key with that name exist . In
* that case , return an empty object for the requested key .
* /
if ( typeof result === 'undefined' && storeRoots . has ( receiver ) ) {
const obj = { } ;
Reflect . set ( target , key , obj ) ;
return proxifyStore ( ns , obj , false ) ;
}
/ *
* Check if the property is a function . If it is , add the store
* namespace to the stack and wrap the function with the current scope .
* The ` withScope ` util handles both synchronous functions and generator
* functions .
* /
if ( typeof result === 'function' ) {
setNamespace ( ns ) ;
const scoped = withScope ( result ) ;
resetNamespace ( ) ;
return scoped ;
}
// Check if the property is an object. If it is, proxyify it.
if ( isPlainObject ( result ) && shouldProxy ( result ) ) {
return proxifyStore ( ns , result , false ) ;
}
return result ;
}
} ;
/ * *
* Returns the proxy associated with the given store object , creating it if it
* does not exist .
*
* @ param namespace The namespace that will be associated to this proxy .
* @ param obj The object to proxify .
*
* @ param isRoot Whether the passed object is the store root object .
* @ throws Error if the object cannot be proxified . Use { @ link shouldProxy } to
* check if a proxy can be created for a specific object .
*
* @ return The associated proxy .
* /
const proxifyStore = ( namespace , obj , isRoot = true ) => {
const proxy = createProxy ( namespace , obj , storeHandlers ) ;
if ( proxy && isRoot ) {
storeRoots . add ( proxy ) ;
}
return proxy ;
} ;
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/proxies/context.js
2024-09-19 21:55:35 -04:00
const contextObjectToProxy = new WeakMap ( ) ;
const contextObjectToFallback = new WeakMap ( ) ;
const contextProxies = new WeakSet ( ) ;
const descriptor = Reflect . getOwnPropertyDescriptor ;
// TODO: Use the proxy registry to avoid multiple proxies on the same object.
const contextHandlers = {
get : ( target , key ) => {
const fallback = contextObjectToFallback . get ( target ) ;
// Always subscribe to prop changes in the current context.
const currentProp = target [ key ] ;
/ *
* Return the value from ` target ` if it exists , or from ` fallback `
* otherwise . This way , in the case the property doesn ' t exist either in
* ` target ` or ` fallback ` , it also subscribes to changes in the parent
* context .
* /
return key in target ? currentProp : fallback [ key ] ;
} ,
set : ( target , key , value ) => {
const fallback = contextObjectToFallback . get ( target ) ;
// If the property exists in the current context, modify it. Otherwise,
// add it to the current context.
const obj = key in target || ! ( key in fallback ) ? target : fallback ;
obj [ key ] = value ;
return true ;
} ,
ownKeys : target => [ ... new Set ( [ ... Object . keys ( contextObjectToFallback . get ( target ) ) , ... Object . keys ( target ) ] ) ] ,
getOwnPropertyDescriptor : ( target , key ) => descriptor ( target , key ) || descriptor ( contextObjectToFallback . get ( target ) , key )
} ;
/ * *
* Wrap a context object with a proxy to reproduce the context stack . The proxy
* uses the passed ` inherited ` context as a fallback to look up for properties
* that don ' t exist in the given context . Also , updated properties are modified
* where they are defined , or added to the main context when they don ' t exist .
*
* @ param current Current context .
* @ param inherited Inherited context , used as fallback .
*
* @ return The wrapped context object .
* /
const proxifyContext = ( current , inherited = { } ) => {
if ( contextProxies . has ( current ) ) {
throw Error ( 'This object cannot be proxified.' ) ;
}
// Update the fallback object reference when it changes.
contextObjectToFallback . set ( current , inherited ) ;
if ( ! contextObjectToProxy . has ( current ) ) {
const proxy = new Proxy ( current , contextHandlers ) ;
contextObjectToProxy . set ( current , proxy ) ;
contextProxies . add ( proxy ) ;
}
return contextObjectToProxy . get ( current ) ;
} ;
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/proxies/index.js
2024-09-19 21:55:35 -04:00
/ * *
* Internal dependencies
* /
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/store.js
2024-09-19 21:55:35 -04:00
/ * *
* Internal dependencies
* /
/ * *
* External dependencies
* /
const stores = new Map ( ) ;
const rawStores = new Map ( ) ;
const storeLocks = new Map ( ) ;
const storeConfigs = new Map ( ) ;
const serverStates = new Map ( ) ;
/ * *
* Get the defined config for the store with the passed namespace .
*
* @ param namespace Store ' s namespace from which to retrieve the config .
* @ return Defined config for the given namespace .
* /
const getConfig = namespace => storeConfigs . get ( namespace || getNamespace ( ) ) || { } ;
/ * *
* Get the part of the state defined and updated from the server .
*
* The object returned is read - only , and includes the state defined in PHP with
* ` wp_interactivity_state() ` . When using ` actions.navigate() ` , this object is
* updated to reflect the changes in its properites , without affecting the state
* returned by ` store() ` . Directives can subscribe to those changes to update
* the state if needed .
*
* @ example
* ` ` ` js
* const { state } = store ( 'myStore' , {
* callbacks : {
* updateServerState ( ) {
* const serverState = getServerState ( ) ;
* // Override some property with the new value that came from the server.
* state . overridableProp = serverState . overridableProp ;
* } ,
* } ,
* } ) ;
* ` ` `
*
* @ param namespace Store ' s namespace from which to retrieve the server state .
* @ return The server state for the given namespace .
* /
const getServerState = namespace => {
const ns = namespace || getNamespace ( ) ;
if ( ! serverStates . has ( ns ) ) {
serverStates . set ( ns , proxifyState ( ns , { } , {
readOnly : true
} ) ) ;
}
return serverStates . get ( ns ) ;
} ;
const universalUnlock = 'I acknowledge that using a private store means my plugin will inevitably break on the next store release.' ;
/ * *
* Extends the Interactivity API global store adding the passed properties to
* the given namespace . It also returns stable references to the namespace
* content .
*
* These props typically consist of ` state ` , which is the reactive part of the
* store ― which means that any directive referencing a state property will be
* re - rendered anytime it changes ― and function properties like ` actions ` and
* ` callbacks ` , mostly used for event handlers . These props can then be
* referenced by any directive to make the HTML interactive .
*
* @ example
* ` ` ` js
* const { state } = store ( 'counter' , {
* state : {
* value : 0 ,
* get double ( ) { return state . value * 2 ; } ,
* } ,
* actions : {
* increment ( ) {
* state . value += 1 ;
* } ,
* } ,
* } ) ;
* ` ` `
*
* The code from the example above allows blocks to subscribe and interact with
* the store by using directives in the HTML , e . g . :
*
* ` ` ` html
* < div data - wp - interactive = "counter" >
* < button
* data - wp - text = "state.double"
* data - wp - on -- click = "actions.increment"
* >
* 0
* < / b u t t o n >
* < / d i v >
* ` ` `
* @ param namespace The store namespace to interact with .
* @ param storePart Properties to add to the store namespace .
* @ param options Options for the given namespace .
*
* @ return A reference to the namespace content .
* /
function store ( namespace , {
state = { } ,
... block
} = { } , {
lock = false
} = { } ) {
if ( ! stores . has ( namespace ) ) {
// Lock the store if the passed lock is different from the universal
// unlock. Once the lock is set (either false, true, or a given string),
// it cannot change.
if ( lock !== universalUnlock ) {
storeLocks . set ( namespace , lock ) ;
}
const rawStore = {
state : proxifyState ( namespace , isPlainObject ( state ) ? state : { } ) ,
... block
} ;
const proxifiedStore = proxifyStore ( namespace , rawStore ) ;
rawStores . set ( namespace , rawStore ) ;
stores . set ( namespace , proxifiedStore ) ;
} else {
// Lock the store if it wasn't locked yet and the passed lock is
// different from the universal unlock. If no lock is given, the store
// will be public and won't accept any lock from now on.
if ( lock !== universalUnlock && ! storeLocks . has ( namespace ) ) {
storeLocks . set ( namespace , lock ) ;
} else {
const storeLock = storeLocks . get ( namespace ) ;
const isLockValid = lock === universalUnlock || lock !== true && lock === storeLock ;
if ( ! isLockValid ) {
if ( ! storeLock ) {
throw Error ( 'Cannot lock a public store' ) ;
} else {
throw Error ( 'Cannot unlock a private store with an invalid lock code' ) ;
}
}
}
const target = rawStores . get ( namespace ) ;
deepMerge ( target , block ) ;
deepMerge ( target . state , state ) ;
}
return stores . get ( namespace ) ;
}
const parseServerData = ( dom = document ) => {
var _dom$getElementById ;
const jsonDataScriptTag = // Preferred Script Module data passing form
( _dom$getElementById = dom . getElementById ( 'wp-script-module-data-@wordpress/interactivity' ) ) !== null && _dom$getElementById !== void 0 ? _dom$getElementById :
// Legacy form
dom . getElementById ( 'wp-interactivity-data' ) ;
if ( jsonDataScriptTag ? . textContent ) {
try {
return JSON . parse ( jsonDataScriptTag . textContent ) ;
} catch { }
}
return { } ;
} ;
const populateServerData = data => {
if ( isPlainObject ( data ? . state ) ) {
Object . entries ( data . state ) . forEach ( ( [ namespace , state ] ) => {
const st = store ( namespace , { } , {
lock : universalUnlock
} ) ;
deepMerge ( st . state , state , false ) ;
deepMerge ( getServerState ( namespace ) , state ) ;
} ) ;
}
if ( isPlainObject ( data ? . config ) ) {
Object . entries ( data . config ) . forEach ( ( [ namespace , config ] ) => {
storeConfigs . set ( namespace , config ) ;
} ) ;
}
} ;
// Parse and populate the initial state and config.
const data = parseServerData ( ) ;
populateServerData ( data ) ;
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/hooks.js
2024-09-19 21:55:35 -04:00
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable react-hooks/exhaustive-deps */
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
2024-10-14 07:47:24 -04:00
function isNonDefaultDirectiveSuffix ( entry ) {
return entry . suffix !== null ;
}
function isDefaultDirectiveSuffix ( entry ) {
return entry . suffix === null ;
}
2024-09-19 21:55:35 -04:00
// Main context.
2024-09-24 03:35:17 -04:00
const context = ( 0 , preact _module /* createContext */ . q6 ) ( {
2024-09-19 21:55:35 -04:00
client : { } ,
server : { }
} ) ;
// WordPress Directives.
const directiveCallbacks = { } ;
const directivePriorities = { } ;
/ * *
* Register a new directive type in the Interactivity API runtime .
*
* @ example
* ` ` ` js
* directive (
* 'alert' , // Name without the `data-wp-` prefix.
* ( { directives : { alert } , element , evaluate } ) => {
2024-10-14 07:47:24 -04:00
* const defaultEntry = alert . find ( isDefaultDirectiveSuffix ) ;
2024-09-19 21:55:35 -04:00
* element . props . onclick = ( ) => { alert ( evaluate ( defaultEntry ) ) ; }
* }
* )
* ` ` `
*
* The previous code registers a custom directive type for displaying an alert
* message whenever an element using it is clicked . The message text is obtained
* from the store under the inherited namespace , using ` evaluate ` .
*
* When the HTML is processed by the Interactivity API , any element containing
* the ` data-wp-alert ` directive will have the ` onclick ` event handler , e . g . ,
*
* ` ` ` html
* < div data - wp - interactive = "messages" >
* < button data - wp - alert = "state.alert" > Click me ! < / b u t t o n >
* < / d i v >
* ` ` `
* Note that , in the previous example , the directive callback gets the path
2024-10-14 07:47:24 -04:00
* value ( ` state.alert ` ) from the directive entry with suffix ` null ` . A
2024-09-19 21:55:35 -04:00
* custom suffix can also be specified by appending ` -- ` to the directive
* attribute , followed by the suffix , like in the following HTML snippet :
*
* ` ` ` html
* < div data - wp - interactive = "myblock" >
* < button
* data - wp - color -- text = "state.text"
* data - wp - color -- background = "state.background"
* > Click me ! < / b u t t o n >
* < / d i v >
* ` ` `
*
* This could be an hypothetical implementation of the custom directive used in
* the snippet above .
*
* @ example
* ` ` ` js
* directive (
* 'color' , // Name without prefix and suffix.
* ( { directives : { color : colors } , ref , evaluate } ) =>
* colors . forEach ( ( color ) => {
* if ( color . suffix = 'text' ) {
* ref . style . setProperty (
* 'color' ,
* evaluate ( color . text )
* ) ;
* }
* if ( color . suffix = 'background' ) {
* ref . style . setProperty (
* 'background-color' ,
* evaluate ( color . background )
* ) ;
* }
* } ) ;
* }
* )
* ` ` `
*
* @ param name Directive name , without the ` data-wp- ` prefix .
* @ param callback Function that runs the directive logic .
* @ param options Options object .
* @ param options . priority Option to control the directive execution order . The
* lesser , the highest priority . Default is ` 10 ` .
* /
const directive = ( name , callback , {
priority = 10
} = { } ) => {
directiveCallbacks [ name ] = callback ;
directivePriorities [ name ] = priority ;
} ;
// Resolve the path to some property of the store object.
const resolve = ( path , namespace ) => {
if ( ! namespace ) {
warn ( ` Namespace missing for " ${ path } ". The value for that path won't be resolved. ` ) ;
return ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
2024-09-19 21:55:35 -04:00
let resolvedStore = stores . get ( namespace ) ;
if ( typeof resolvedStore === 'undefined' ) {
resolvedStore = store ( namespace , undefined , {
lock : universalUnlock
} ) ;
}
const current = {
... resolvedStore ,
context : getScope ( ) . context [ namespace ]
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} ;
2024-09-19 21:55:35 -04:00
try {
// TODO: Support lazy/dynamically initialized stores
return path . split ( '.' ) . reduce ( ( acc , key ) => acc [ key ] , current ) ;
} catch ( e ) { }
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} ;
2024-01-31 07:59:56 -05:00
2024-09-19 21:55:35 -04:00
// Generate the evaluate function.
const getEvaluate = ( {
scope
} ) => ( entry , ... args ) => {
let {
value : path ,
namespace
} = entry ;
if ( typeof path !== 'string' ) {
throw new Error ( 'The `value` prop should be a string path' ) ;
}
// If path starts with !, remove it and save a flag.
const hasNegationOperator = path [ 0 ] === '!' && ! ! ( path = path . slice ( 1 ) ) ;
setScope ( scope ) ;
const value = resolve ( path , namespace ) ;
const result = typeof value === 'function' ? value ( ... args ) : value ;
resetScope ( ) ;
return hasNegationOperator ? ! result : result ;
} ;
2024-05-31 14:59:00 -04:00
2024-09-19 21:55:35 -04:00
// Separate directives by priority. The resulting array contains objects
// of directives grouped by same priority, and sorted in ascending order.
const getPriorityLevels = directives => {
const byPriority = Object . keys ( directives ) . reduce ( ( obj , name ) => {
if ( directiveCallbacks [ name ] ) {
const priority = directivePriorities [ name ] ;
( obj [ priority ] = obj [ priority ] || [ ] ) . push ( name ) ;
2024-05-31 14:59:00 -04:00
}
2024-09-19 21:55:35 -04:00
return obj ;
} , { } ) ;
return Object . entries ( byPriority ) . sort ( ( [ p1 ] , [ p2 ] ) => parseInt ( p1 ) - parseInt ( p2 ) ) . map ( ( [ , arr ] ) => arr ) ;
} ;
2024-05-31 14:59:00 -04:00
2024-09-19 21:55:35 -04:00
// Component that wraps each priority level of directives of an element.
const Directives = ( {
directives ,
priorityLevels : [ currentPriorityLevel , ... nextPriorityLevels ] ,
element ,
originalProps ,
previousScope
} ) => {
// Initialize the scope of this element. These scopes are different per each
// level because each level has a different context, but they share the same
// element ref, state and props.
2024-09-24 03:35:17 -04:00
const scope = A ( { } ) . current ;
scope . evaluate = q ( getEvaluate ( {
2024-09-19 21:55:35 -04:00
scope
} ) , [ ] ) ;
const {
client ,
server
2024-09-24 03:35:17 -04:00
} = x ( context ) ;
2024-09-19 21:55:35 -04:00
scope . context = client ;
scope . serverContext = server ;
/* eslint-disable react-hooks/rules-of-hooks */
2024-09-24 03:35:17 -04:00
scope . ref = previousScope ? . ref || A ( null ) ;
2024-09-19 21:55:35 -04:00
/* eslint-enable react-hooks/rules-of-hooks */
2024-05-31 14:59:00 -04:00
2024-09-19 21:55:35 -04:00
// Create a fresh copy of the vnode element and add the props to the scope,
// named as attributes (HTML Attributes).
2024-09-24 03:35:17 -04:00
element = ( 0 , preact _module /* cloneElement */ . Ob ) ( element , {
2024-09-19 21:55:35 -04:00
ref : scope . ref
} ) ;
scope . attributes = element . props ;
// Recursively render the wrapper for the next priority level.
2024-09-24 03:35:17 -04:00
const children = nextPriorityLevels . length > 0 ? ( 0 , preact _module . h ) ( Directives , {
2024-09-19 21:55:35 -04:00
directives ,
priorityLevels : nextPriorityLevels ,
element ,
originalProps ,
previousScope : scope
} ) : element ;
const props = {
... originalProps ,
children
} ;
const directiveArgs = {
directives ,
props ,
element ,
context ,
evaluate : scope . evaluate
} ;
setScope ( scope ) ;
for ( const directiveName of currentPriorityLevel ) {
const wrapper = directiveCallbacks [ directiveName ] ? . ( directiveArgs ) ;
if ( wrapper !== undefined ) {
props . children = wrapper ;
}
}
resetScope ( ) ;
return props . children ;
} ;
// Preact Options Hook called each time a vnode is created.
2024-09-24 03:35:17 -04:00
const old = preact _module /* options */ . fF . vnode ;
preact _module /* options */ . fF . vnode = vnode => {
2024-09-19 21:55:35 -04:00
if ( vnode . props . _ _directives ) {
const props = vnode . props ;
const directives = props . _ _directives ;
if ( directives . key ) {
2024-10-14 07:47:24 -04:00
vnode . key = directives . key . find ( isDefaultDirectiveSuffix ) . value ;
2024-09-19 21:55:35 -04:00
}
delete props . _ _directives ;
const priorityLevels = getPriorityLevels ( directives ) ;
if ( priorityLevels . length > 0 ) {
vnode . props = {
directives ,
priorityLevels ,
originalProps : props ,
type : vnode . type ,
2024-09-24 03:35:17 -04:00
element : ( 0 , preact _module . h ) ( vnode . type , props ) ,
2024-09-19 21:55:35 -04:00
top : true
} ;
vnode . type = Directives ;
2024-05-31 14:59:00 -04:00
}
2024-09-19 21:55:35 -04:00
}
if ( old ) {
old ( vnode ) ;
2024-05-31 14:59:00 -04:00
}
} ;
2024-02-09 13:22:22 -05:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/directives.js
2024-05-23 15:39:28 -04:00
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable react-hooks/exhaustive-deps */
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ * *
* External dependencies
* /
2023-09-26 10:23:26 -04:00
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ * *
* Internal dependencies
* /
2023-09-26 10:23:26 -04:00
2024-02-27 09:48:23 -05:00
/ * *
* Recursively clone the passed object .
*
2024-05-23 15:39:28 -04:00
* @ param source Source object .
* @ return Cloned object .
2024-02-27 09:48:23 -05:00
* /
2024-05-23 15:39:28 -04:00
function deepClone ( source ) {
2024-02-27 09:48:23 -05:00
if ( isPlainObject ( source ) ) {
return Object . fromEntries ( Object . entries ( source ) . map ( ( [ key , value ] ) => [ key , deepClone ( value ) ] ) ) ;
}
if ( Array . isArray ( source ) ) {
return source . map ( i => deepClone ( i ) ) ;
}
return source ;
2024-05-23 15:39:28 -04:00
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g ;
const ruleClean = /\/\*[^]*?\*\/| +/g ;
const ruleNewline = /\n+/g ;
const empty = ' ' ;
/ * *
* Convert a css style string into a object .
*
* Made by Cristian Bote ( @ cristianbote ) for Goober .
* https : //unpkg.com/browse/goober@2.1.13/src/core/astish.js
*
2024-05-23 15:39:28 -04:00
* @ param val CSS string .
* @ return CSS object .
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* /
const cssStringToObject = val => {
const tree = [ { } ] ;
let block , left ;
while ( block = newRule . exec ( val . replace ( ruleClean , '' ) ) ) {
if ( block [ 4 ] ) {
tree . shift ( ) ;
} else if ( block [ 3 ] ) {
left = block [ 3 ] . replace ( ruleNewline , empty ) . trim ( ) ;
tree . unshift ( tree [ 0 ] [ left ] = tree [ 0 ] [ left ] || { } ) ;
} else {
tree [ 0 ] [ block [ 1 ] ] = block [ 2 ] . replace ( ruleNewline , empty ) . trim ( ) ;
}
}
return tree [ 0 ] ;
} ;
/ * *
* Creates a directive that adds an event listener to the global window or
* document object .
*
2024-05-23 15:39:28 -04:00
* @ param type 'window' or 'document'
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* /
2024-05-23 15:39:28 -04:00
const getGlobalEventDirective = type => {
return ( {
directives ,
evaluate
} ) => {
2024-10-14 07:47:24 -04:00
directives [ ` on- ${ type } ` ] . filter ( isNonDefaultDirectiveSuffix ) . forEach ( entry => {
2024-05-23 15:39:28 -04:00
const eventName = entry . suffix . split ( '--' , 1 ) [ 0 ] ;
useInit ( ( ) => {
const cb = event => evaluate ( entry , event ) ;
const globalVar = type === 'window' ? window : document ;
globalVar . addEventListener ( eventName , cb ) ;
return ( ) => globalVar . removeEventListener ( eventName , cb ) ;
} ) ;
} ) ;
} ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} ;
2024-05-31 14:59:00 -04:00
/ * *
* Creates a directive that adds an async event listener to the global window or
* document object .
*
* @ param type 'window' or 'document'
* /
const getGlobalAsyncEventDirective = type => {
return ( {
directives ,
evaluate
} ) => {
2024-10-14 07:47:24 -04:00
directives [ ` on-async- ${ type } ` ] . filter ( isNonDefaultDirectiveSuffix ) . forEach ( entry => {
2024-05-31 14:59:00 -04:00
const eventName = entry . suffix . split ( '--' , 1 ) [ 0 ] ;
useInit ( ( ) => {
const cb = async event => {
2024-06-25 09:49:28 -04:00
await splitTask ( ) ;
2024-05-31 14:59:00 -04:00
evaluate ( entry , event ) ;
} ;
const globalVar = type === 'window' ? window : document ;
globalVar . addEventListener ( eventName , cb , {
passive : true
} ) ;
return ( ) => globalVar . removeEventListener ( eventName , cb ) ;
} ) ;
} ) ;
} ;
} ;
2024-01-31 07:59:56 -05:00
/* harmony default export */ const directives = ( ( ) => {
2023-09-26 10:23:26 -04:00
// data-wp-context
2024-09-19 21:55:35 -04:00
directive ( 'context' , ( {
2023-09-26 10:23:26 -04:00
directives : {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
context
2023-09-26 10:23:26 -04:00
} ,
props : {
children
} ,
context : inheritedContext
} ) => {
const {
Provider
} = inheritedContext ;
2024-10-14 07:47:24 -04:00
const defaultEntry = context . find ( isDefaultDirectiveSuffix ) ;
2024-09-19 21:55:35 -04:00
const {
client : inheritedClient ,
server : inheritedServer
2024-09-24 03:35:17 -04:00
} = x ( inheritedContext ) ;
2024-09-19 21:55:35 -04:00
const ns = defaultEntry . namespace ;
2024-09-24 03:35:17 -04:00
const client = A ( proxifyState ( ns , { } ) ) ;
const server = A ( proxifyState ( ns , { } , {
2024-09-19 21:55:35 -04:00
readOnly : true
} ) ) ;
2024-02-27 09:48:23 -05:00
// No change should be made if `defaultEntry` does not exist.
2024-09-24 03:35:17 -04:00
const contextStack = T ( ( ) => {
2024-09-19 21:55:35 -04:00
const result = {
client : {
... inheritedClient
} ,
server : {
... inheritedServer
}
} ;
2024-02-27 09:48:23 -05:00
if ( defaultEntry ) {
const {
namespace ,
value
} = defaultEntry ;
2024-05-23 15:39:28 -04:00
// Check that the value is a JSON object. Send a console warning if not.
if ( ! isPlainObject ( value ) ) {
warn ( ` The value of data-wp-context in " ${ namespace } " store must be a valid stringified JSON object. ` ) ;
}
2024-09-19 21:55:35 -04:00
deepMerge ( client . current , deepClone ( value ) , false ) ;
deepMerge ( server . current , deepClone ( value ) ) ;
result . client [ namespace ] = proxifyContext ( client . current , inheritedClient [ namespace ] ) ;
result . server [ namespace ] = proxifyContext ( server . current , inheritedServer [ namespace ] ) ;
2024-02-27 09:48:23 -05:00
}
2024-09-19 21:55:35 -04:00
return result ;
} , [ defaultEntry , inheritedClient , inheritedServer ] ) ;
2024-09-24 03:35:17 -04:00
return ( 0 , preact _module . h ) ( Provider , {
2024-02-27 09:48:23 -05:00
value : contextStack
} , children ) ;
2023-09-26 10:23:26 -04:00
} , {
priority : 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 16:07:12 -05:00
// data-wp-watch--[name]
directive ( 'watch' , ( {
2023-09-26 10:23:26 -04:00
directives : {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
watch
2023-09-26 10:23:26 -04:00
} ,
evaluate
} ) => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
watch . forEach ( entry => {
2024-09-19 21:55:35 -04:00
useWatch ( ( ) => {
let start ;
if ( false ) { }
const result = evaluate ( entry ) ;
if ( false ) { }
return result ;
} ) ;
2023-09-26 10:23:26 -04:00
} ) ;
} ) ;
// data-wp-init--[name]
directive ( 'init' , ( {
directives : {
init
} ,
evaluate
} ) => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
init . forEach ( entry => {
// TODO: Replace with useEffect to prevent unneeded scopes.
2024-09-19 21:55:35 -04:00
useInit ( ( ) => {
let start ;
if ( false ) { }
const result = evaluate ( entry ) ;
if ( false ) { }
return result ;
} ) ;
2023-09-26 10:23:26 -04:00
} ) ;
} ) ;
// data-wp-on--[event]
directive ( 'on' , ( {
directives : {
on
} ,
element ,
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
evaluate
2023-09-26 10:23:26 -04:00
} ) => {
2024-05-23 15:39:28 -04:00
const events = new Map ( ) ;
2024-10-14 07:47:24 -04:00
on . filter ( isNonDefaultDirectiveSuffix ) . forEach ( entry => {
2024-05-23 15:39:28 -04:00
const event = entry . suffix . split ( '--' ) [ 0 ] ;
if ( ! events . has ( event ) ) {
events . set ( event , new Set ( ) ) ;
}
events . get ( event ) . add ( entry ) ;
} ) ;
events . forEach ( ( entries , eventType ) => {
2024-05-31 14:59:00 -04:00
const existingHandler = element . props [ ` on ${ eventType } ` ] ;
2024-05-23 15:39:28 -04:00
element . props [ ` on ${ eventType } ` ] = event => {
entries . forEach ( entry => {
2024-05-31 14:59:00 -04:00
if ( existingHandler ) {
existingHandler ( event ) ;
}
2024-09-19 21:55:35 -04:00
let start ;
if ( false ) { }
2024-05-31 14:59:00 -04:00
evaluate ( entry , event ) ;
2024-09-19 21:55:35 -04:00
if ( false ) { }
2024-05-31 14:59:00 -04:00
} ) ;
} ;
} ) ;
} ) ;
// data-wp-on-async--[event]
directive ( 'on-async' , ( {
directives : {
'on-async' : onAsync
} ,
element ,
evaluate
} ) => {
const events = new Map ( ) ;
2024-10-14 07:47:24 -04:00
onAsync . filter ( isNonDefaultDirectiveSuffix ) . forEach ( entry => {
2024-05-31 14:59:00 -04:00
const event = entry . suffix . split ( '--' ) [ 0 ] ;
if ( ! events . has ( event ) ) {
events . set ( event , new Set ( ) ) ;
}
events . get ( event ) . add ( entry ) ;
} ) ;
events . forEach ( ( entries , eventType ) => {
const existingHandler = element . props [ ` on ${ eventType } ` ] ;
element . props [ ` on ${ eventType } ` ] = event => {
if ( existingHandler ) {
existingHandler ( event ) ;
}
entries . forEach ( async entry => {
2024-06-25 09:49:28 -04:00
await splitTask ( ) ;
2024-05-23 15:39:28 -04:00
evaluate ( entry , event ) ;
} ) ;
2023-09-26 10:23:26 -04:00
} ;
} ) ;
} ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
// data-wp-on-window--[event]
directive ( 'on-window' , getGlobalEventDirective ( 'window' ) ) ;
// data-wp-on-document--[event]
directive ( 'on-document' , getGlobalEventDirective ( 'document' ) ) ;
2024-05-31 14:59:00 -04:00
// data-wp-on-async-window--[event]
directive ( 'on-async-window' , getGlobalAsyncEventDirective ( 'window' ) ) ;
// data-wp-on-async-document--[event]
directive ( 'on-async-document' , getGlobalAsyncEventDirective ( 'document' ) ) ;
2023-09-26 10:23:26 -04:00
// data-wp-class--[classname]
directive ( 'class' , ( {
directives : {
2024-02-09 13:22:22 -05:00
class : classNames
2023-09-26 10:23:26 -04:00
} ,
element ,
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
evaluate
2023-09-26 10:23:26 -04:00
} ) => {
2024-10-14 07:47:24 -04:00
classNames . filter ( isNonDefaultDirectiveSuffix ) . forEach ( entry => {
2024-02-09 13:22:22 -05:00
const className = entry . suffix ;
const result = evaluate ( entry ) ;
2023-09-26 10:23:26 -04:00
const currentClass = element . props . class || '' ;
2024-02-09 13:22:22 -05:00
const classFinder = new RegExp ( ` (^| \\ s) ${ className } ( \\ s| $ ) ` , 'g' ) ;
2024-05-23 15:39:28 -04:00
if ( ! result ) {
element . props . class = currentClass . replace ( classFinder , ' ' ) . trim ( ) ;
} else if ( ! classFinder . test ( currentClass ) ) {
element . props . class = currentClass ? ` ${ currentClass } ${ className } ` : className ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
useInit ( ( ) => {
/ *
* This seems necessary because Preact doesn ' t change the class
* names on the hydration , so we have to do it manually . It doesn ' t
* need deps because it only needs to do it the first time .
* /
2023-09-26 10:23:26 -04:00
if ( ! result ) {
2024-02-09 13:22:22 -05:00
element . ref . current . classList . remove ( className ) ;
2023-09-26 10:23:26 -04:00
} else {
2024-02-09 13:22:22 -05:00
element . ref . current . classList . add ( className ) ;
2023-09-26 10:23:26 -04:00
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} ) ;
2023-09-26 10:23:26 -04:00
} ) ;
} ) ;
2024-02-09 13:22:22 -05:00
// data-wp-style--[style-prop]
2023-09-26 10:23:26 -04:00
directive ( 'style' , ( {
directives : {
style
} ,
element ,
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
evaluate
2023-09-26 10:23:26 -04:00
} ) => {
2024-10-14 07:47:24 -04:00
style . filter ( isNonDefaultDirectiveSuffix ) . forEach ( entry => {
2024-02-09 13:22:22 -05:00
const styleProp = entry . suffix ;
const result = evaluate ( entry ) ;
2023-09-26 10:23:26 -04:00
element . props . style = element . props . style || { } ;
2024-05-23 15:39:28 -04:00
if ( typeof element . props . style === 'string' ) {
element . props . style = cssStringToObject ( element . props . style ) ;
}
if ( ! result ) {
delete element . props . style [ styleProp ] ;
} else {
element . props . style [ styleProp ] = result ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
useInit ( ( ) => {
/ *
* This seems necessary because Preact doesn ' t change the styles on
* the hydration , so we have to do it manually . It doesn ' t need deps
* because it only needs to do it the first time .
* /
2023-09-26 10:23:26 -04:00
if ( ! result ) {
2024-02-09 13:22:22 -05:00
element . ref . current . style . removeProperty ( styleProp ) ;
2023-09-26 10:23:26 -04:00
} else {
2024-02-09 13:22:22 -05:00
element . ref . current . style [ styleProp ] = result ;
2023-09-26 10:23:26 -04:00
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} ) ;
2023-09-26 10:23:26 -04:00
} ) ;
} ) ;
// data-wp-bind--[attribute]
directive ( 'bind' , ( {
directives : {
bind
} ,
element ,
evaluate
} ) => {
2024-10-14 07:47:24 -04:00
bind . filter ( isNonDefaultDirectiveSuffix ) . forEach ( entry => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const attribute = entry . suffix ;
const result = evaluate ( entry ) ;
2023-09-26 10:23:26 -04:00
element . props [ attribute ] = result ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ *
* This is necessary because Preact doesn ' t change the attributes on the
* hydration , so we have to do it manually . It only needs to do it the
* first time . After that , Preact will handle the changes .
* /
useInit ( ( ) => {
2023-09-26 10:23:26 -04:00
const el = element . ref . current ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ *
* We set the value directly to the corresponding HTMLElement instance
* property excluding the following special cases . We follow Preact ' s
* logic : https : //github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L110-L129
* /
2024-02-09 13:22:22 -05:00
if ( attribute === 'style' ) {
2024-05-23 15:39:28 -04:00
if ( typeof result === 'string' ) {
el . style . cssText = result ;
}
2024-02-09 13:22:22 -05:00
return ;
} else if ( attribute !== 'width' && attribute !== 'height' && attribute !== 'href' && attribute !== 'list' && attribute !== 'form' &&
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ *
* The value for ` tabindex ` follows the parsing rules for an
* integer . If that fails , or if the attribute isn ' t present , then
* the browsers should " follow platform conventions to determine if
* the element should be considered as a focusable area " ,
* practically meaning that most elements get a default of ` -1 ` ( not
* focusable ) , but several also get a default of ` 0 ` ( focusable in
* order after all elements with a positive ` tabindex ` value ) .
*
* @ see https : //html.spec.whatwg.org/#tabindex-value
* /
2023-09-26 10:23:26 -04:00
attribute !== 'tabIndex' && attribute !== 'download' && attribute !== 'rowSpan' && attribute !== 'colSpan' && attribute !== 'role' && attribute in el ) {
try {
el [ attribute ] = result === null || result === undefined ? '' : result ;
return ;
} catch ( err ) { }
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
/ *
* aria - and data - attributes have no boolean representation .
* A ` false ` value is different from the attribute not being
* present , so we can ' t remove it .
* We follow Preact ' s logic : https : //github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136
* /
2023-09-26 10:23:26 -04:00
if ( result !== null && result !== undefined && ( result !== false || attribute [ 4 ] === '-' ) ) {
el . setAttribute ( attribute , result ) ;
} else {
el . removeAttribute ( attribute ) ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} ) ;
2023-09-26 10:23:26 -04:00
} ) ;
} ) ;
// data-wp-ignore
directive ( 'ignore' , ( {
element : {
type : Type ,
props : {
innerHTML ,
... rest
}
}
} ) => {
// Preserve the initial inner HTML.
2024-09-24 03:35:17 -04:00
const cached = T ( ( ) => innerHTML , [ ] ) ;
return ( 0 , preact _module . h ) ( Type , {
2023-09-26 10:23:26 -04:00
dangerouslySetInnerHTML : {
_ _html : cached
} ,
... rest
} ) ;
} ) ;
// data-wp-text
directive ( 'text' , ( {
directives : {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
text
2023-09-26 10:23:26 -04:00
} ,
element ,
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
evaluate
2023-09-26 10:23:26 -04:00
} ) => {
2024-10-14 07:47:24 -04:00
const entry = text . find ( isDefaultDirectiveSuffix ) ;
2024-05-23 15:39:28 -04:00
if ( ! entry ) {
element . props . children = null ;
return ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
try {
const result = evaluate ( entry ) ;
element . props . children = typeof result === 'object' ? null : result . toString ( ) ;
} catch ( e ) {
element . props . children = null ;
}
2023-09-26 10:23:26 -04:00
} ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
// data-wp-run
directive ( 'run' , ( {
2023-09-26 10:23:26 -04:00
directives : {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
run
2023-09-26 10:23:26 -04:00
} ,
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
evaluate
2023-09-26 10:23:26 -04:00
} ) => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
run . forEach ( entry => evaluate ( entry ) ) ;
2023-09-26 10:23:26 -04:00
} ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
// data-wp-each--[item]
directive ( 'each' , ( {
2023-09-26 10:23:26 -04:00
directives : {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
each ,
'each-key' : eachKey
2023-09-26 10:23:26 -04:00
} ,
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
context : inheritedContext ,
element ,
evaluate
2023-09-26 10:23:26 -04:00
} ) => {
2024-05-23 15:39:28 -04:00
if ( element . type !== 'template' ) {
return ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const {
Provider
} = inheritedContext ;
2024-09-24 03:35:17 -04:00
const inheritedValue = x ( inheritedContext ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const [ entry ] = each ;
const {
2024-10-14 07:47:24 -04:00
namespace
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} = entry ;
const list = evaluate ( entry ) ;
2024-10-14 07:47:24 -04:00
const itemProp = isNonDefaultDirectiveSuffix ( entry ) ? kebabToCamelCase ( entry . suffix ) : 'item' ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
return list . map ( item => {
2024-09-19 21:55:35 -04:00
const itemContext = proxifyContext ( proxifyState ( namespace , { } ) , inheritedValue . client [ namespace ] ) ;
const mergedContext = {
client : {
... inheritedValue . client ,
[ namespace ] : itemContext
} ,
server : {
... inheritedValue . server
}
} ;
2024-02-27 09:48:23 -05:00
// Set the item after proxifying the context.
2024-09-19 21:55:35 -04:00
mergedContext . client [ namespace ] [ itemProp ] = item ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const scope = {
... getScope ( ) ,
2024-09-19 21:55:35 -04:00
context : mergedContext . client ,
serverContext : mergedContext . server
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} ;
const key = eachKey ? getEvaluate ( {
scope
} ) ( eachKey [ 0 ] ) : item ;
2024-09-24 03:35:17 -04:00
return ( 0 , preact _module . h ) ( Provider , {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
value : mergedContext ,
2024-05-31 14:59:00 -04:00
key
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} , element . props . content ) ;
2023-09-26 10:23:26 -04:00
} ) ;
} , {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
priority : 20
2023-09-26 10:23:26 -04:00
} ) ;
2024-06-11 06:07:32 -04:00
directive ( 'each-child' , ( ) => null , {
priority : 1
} ) ;
2023-09-26 10:23:26 -04:00
} ) ;
2024-01-31 07:59:56 -05:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/constants.js
2023-09-26 10:23:26 -04:00
const directivePrefix = 'wp' ;
2024-01-31 07:59:56 -05:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/vdom.js
2023-09-26 10:23:26 -04:00
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
2024-05-23 15:39:28 -04:00
2023-09-26 10:23:26 -04:00
const ignoreAttr = ` data- ${ directivePrefix } -ignore ` ;
const islandAttr = ` data- ${ directivePrefix } -interactive ` ;
const fullPrefix = ` data- ${ directivePrefix } - ` ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const namespaces = [ ] ;
const currentNamespace = ( ) => {
var _namespaces ;
return ( _namespaces = namespaces [ namespaces . length - 1 ] ) !== null && _namespaces !== void 0 ? _namespaces : null ;
} ;
2024-09-19 21:55:35 -04:00
const isObject = item => Boolean ( item && typeof item === 'object' && item . constructor === Object ) ;
2023-09-26 10:23:26 -04:00
// Regular expression for directive parsing.
const directiveParser = new RegExp ( ` ^data- ${ directivePrefix } - ` +
// ${p} must be a prefix string, like 'wp'.
// Match alphanumeric characters including hyphen-separated
// segments. It excludes underscore intentionally to prevent confusion.
// E.g., "custom-directive".
'([a-z0-9]+(?:-[a-z0-9]+)*)' +
// (Optional) Match '--' followed by any alphanumeric charachters. It
// excludes underscore intentionally to prevent confusion, but it can
// contain multiple hyphens. E.g., "--custom-prefix--with-more-info".
'(?:--([a-z0-9_-]+))?$' , 'i' // Case insensitive.
) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
// Regular expression for reference parsing. It can contain a namespace before
// the reference, separated by `::`, like `some-namespace::state.somePath`.
// Namespaces can contain any alphanumeric characters, hyphens, underscores or
// forward slashes. References don't have any restrictions.
2024-05-31 14:59:00 -04:00
const nsPathRegExp = /^([\w_\/-]+)::(.+)$/ ;
2023-09-26 10:23:26 -04:00
const hydratedIslands = new WeakSet ( ) ;
2024-02-09 13:22:22 -05:00
/ * *
* Recursive function that transforms a DOM tree into vDOM .
*
2024-05-23 15:39:28 -04:00
* @ param root The root element or node to start traversing on .
* @ return The resulting vDOM tree .
2024-02-09 13:22:22 -05:00
* /
2023-09-26 10:23:26 -04:00
function toVdom ( root ) {
2024-05-23 15:39:28 -04:00
const treeWalker = document . createTreeWalker ( root , 205 // TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT
2023-09-26 10:23:26 -04:00
) ;
function walk ( node ) {
const {
2024-05-23 15:39:28 -04:00
nodeType
2023-09-26 10:23:26 -04:00
} = node ;
2024-05-23 15:39:28 -04:00
// TEXT_NODE (3)
if ( nodeType === 3 ) {
return [ node . data ] ;
}
// CDATA_SECTION_NODE (4)
2023-09-26 10:23:26 -04:00
if ( nodeType === 4 ) {
2024-05-23 15:39:28 -04:00
var _nodeValue ;
2023-09-26 10:23:26 -04:00
const next = treeWalker . nextSibling ( ) ;
2024-05-23 15:39:28 -04:00
node . replaceWith ( new window . Text ( ( _nodeValue = node . nodeValue ) !== null && _nodeValue !== void 0 ? _nodeValue : '' ) ) ;
2023-09-26 10:23:26 -04:00
return [ node . nodeValue , next ] ;
}
2024-05-23 15:39:28 -04:00
// COMMENT_NODE (8) || PROCESSING_INSTRUCTION_NODE (7)
2023-09-26 10:23:26 -04:00
if ( nodeType === 8 || nodeType === 7 ) {
const next = treeWalker . nextSibling ( ) ;
node . remove ( ) ;
return [ null , next ] ;
}
2024-05-23 15:39:28 -04:00
const elementNode = node ;
const {
attributes
} = elementNode ;
const localName = elementNode . localName ;
2023-09-26 10:23:26 -04:00
const props = { } ;
const children = [ ] ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
const directives = [ ] ;
2023-09-26 10:23:26 -04:00
let ignore = false ;
let island = false ;
for ( let i = 0 ; i < attributes . length ; i ++ ) {
2024-05-23 15:39:28 -04:00
const attributeName = attributes [ i ] . name ;
2024-05-31 14:59:00 -04:00
const attributeValue = attributes [ i ] . value ;
2024-05-23 15:39:28 -04:00
if ( attributeName [ fullPrefix . length ] && attributeName . slice ( 0 , fullPrefix . length ) === fullPrefix ) {
if ( attributeName === ignoreAttr ) {
2023-09-26 10:23:26 -04:00
ignore = true ;
} else {
2024-05-31 14:59:00 -04:00
var _regexResult$ , _regexResult$2 ;
const regexResult = nsPathRegExp . exec ( attributeValue ) ;
const namespace = ( _regexResult$ = regexResult ? . [ 1 ] ) !== null && _regexResult$ !== void 0 ? _regexResult$ : null ;
let value = ( _regexResult$2 = regexResult ? . [ 2 ] ) !== null && _regexResult$2 !== void 0 ? _regexResult$2 : attributeValue ;
2023-09-26 10:23:26 -04:00
try {
2024-05-31 14:59:00 -04:00
const parsedValue = JSON . parse ( value ) ;
2024-09-19 21:55:35 -04:00
value = isObject ( parsedValue ) ? parsedValue : value ;
2024-05-31 14:59:00 -04:00
} catch { }
2024-05-23 15:39:28 -04:00
if ( attributeName === islandAttr ) {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
island = true ;
2024-05-23 15:39:28 -04:00
const islandNamespace =
// eslint-disable-next-line no-nested-ternary
typeof value === 'string' ? value : typeof value ? . namespace === 'string' ? value . namespace : null ;
namespaces . push ( islandNamespace ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} else {
2024-05-23 15:39:28 -04:00
directives . push ( [ attributeName , namespace , value ] ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
}
2023-09-26 10:23:26 -04:00
}
2024-05-23 15:39:28 -04:00
} else if ( attributeName === 'ref' ) {
2023-09-26 10:23:26 -04:00
continue ;
}
2024-05-31 14:59:00 -04:00
props [ attributeName ] = attributeValue ;
2024-05-23 15:39:28 -04:00
}
if ( ignore && ! island ) {
2024-09-24 03:35:17 -04:00
return [ ( 0 , preact _module . h ) ( localName , {
2024-05-23 15:39:28 -04:00
... props ,
innerHTML : elementNode . innerHTML ,
_ _directives : {
ignore : true
}
} ) ] ;
}
if ( island ) {
hydratedIslands . add ( elementNode ) ;
2023-09-26 10:23:26 -04:00
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
if ( directives . length ) {
props . _ _directives = directives . reduce ( ( obj , [ name , ns , value ] ) => {
2024-05-23 15:39:28 -04:00
const directiveMatch = directiveParser . exec ( name ) ;
if ( directiveMatch === null ) {
2024-05-31 14:59:00 -04:00
warn ( ` Found malformed directive name: ${ name } . ` ) ;
2024-05-23 15:39:28 -04:00
return obj ;
}
const prefix = directiveMatch [ 1 ] || '' ;
2024-10-14 07:47:24 -04:00
const suffix = directiveMatch [ 2 ] || null ;
2024-05-23 15:39:28 -04:00
obj [ prefix ] = obj [ prefix ] || [ ] ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
obj [ prefix ] . push ( {
namespace : ns !== null && ns !== void 0 ? ns : currentNamespace ( ) ,
2024-10-14 07:47:24 -04:00
value : value ,
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
suffix
} ) ;
return obj ;
} , { } ) ;
}
2024-05-23 15:39:28 -04:00
// @ts-expect-error Fixed in upcoming preact release https://github.com/preactjs/preact/pull/4334
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
if ( localName === 'template' ) {
2024-05-23 15:39:28 -04:00
props . content = [ ... elementNode . content . childNodes ] . map ( childNode => toVdom ( childNode ) ) ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} else {
let child = treeWalker . firstChild ( ) ;
if ( child ) {
while ( child ) {
const [ vnode , nextChild ] = walk ( child ) ;
2024-05-23 15:39:28 -04:00
if ( vnode ) {
children . push ( vnode ) ;
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
child = nextChild || treeWalker . nextSibling ( ) ;
}
treeWalker . parentNode ( ) ;
2023-09-26 10:23:26 -04:00
}
}
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
// Restore previous namespace.
2024-05-23 15:39:28 -04:00
if ( island ) {
namespaces . pop ( ) ;
}
2024-09-24 03:35:17 -04:00
return [ ( 0 , preact _module . h ) ( localName , props , children ) ] ;
2023-09-26 10:23:26 -04:00
}
return walk ( treeWalker . currentNode ) ;
}
2024-01-31 07:59:56 -05:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/init.js
2023-09-26 10:23:26 -04:00
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
// Keep the same root fragment for each interactive region node.
const regionRootFragments = new WeakMap ( ) ;
const getRegionRootFragment = region => {
2024-05-31 14:59:00 -04:00
if ( ! region . parentElement ) {
throw Error ( 'The passed region should be an element with a parent.' ) ;
}
2023-09-26 10:23:26 -04:00
if ( ! regionRootFragments . has ( region ) ) {
regionRootFragments . set ( region , createRootFragment ( region . parentElement , region ) ) ;
}
return regionRootFragments . get ( region ) ;
} ;
2024-02-09 13:22:22 -05:00
// Initial vDOM regions associated with its DOM element.
const initialVdom = new WeakMap ( ) ;
2023-09-26 10:23:26 -04:00
// Initialize the router with the initial DOM.
const init = async ( ) => {
2024-02-09 13:22:22 -05:00
const nodes = document . querySelectorAll ( ` [data- ${ directivePrefix } -interactive] ` ) ;
for ( const node of nodes ) {
2023-09-26 10:23:26 -04:00
if ( ! hydratedIslands . has ( node ) ) {
2024-06-25 09:49:28 -04:00
await splitTask ( ) ;
2023-09-26 10:23:26 -04:00
const fragment = getRegionRootFragment ( node ) ;
const vdom = toVdom ( node ) ;
2024-02-09 13:22:22 -05:00
initialVdom . set ( node , vdom ) ;
2024-06-25 09:49:28 -04:00
await splitTask ( ) ;
2024-09-24 03:35:17 -04:00
( 0 , preact _module /* hydrate */ . Qv ) ( vdom , fragment ) ;
2023-09-26 10:23:26 -04:00
}
2024-02-09 13:22:22 -05:00
}
2023-09-26 10:23:26 -04:00
} ;
2024-01-31 07:59:56 -05:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/@wordpress/interactivity/build-module/index.js
2023-09-26 10:23:26 -04:00
/ * *
2024-02-09 13:22:22 -05:00
* External dependencies
2023-09-26 10:23:26 -04:00
* /
2024-02-09 13:22:22 -05:00
/ * *
* Internal dependencies
* /
2023-09-26 10:23:26 -04:00
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
2024-02-27 09:48:23 -05:00
2024-09-19 21:55:35 -04:00
2024-02-09 13:22:22 -05:00
const requiredConsent = 'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.' ;
const privateApis = lock => {
if ( lock === requiredConsent ) {
return {
directivePrefix : directivePrefix ,
getRegionRootFragment : getRegionRootFragment ,
initialVdom : initialVdom ,
toVdom : toVdom ,
directive : directive ,
getNamespace : getNamespace ,
2024-09-24 03:35:17 -04:00
h : preact _module . h ,
cloneElement : preact _module /* cloneElement */ . Ob ,
render : preact _module /* render */ . XX ,
2024-09-19 21:55:35 -04:00
proxifyState : proxifyState ,
parseServerData : parseServerData ,
populateServerData : populateServerData ,
2024-05-23 15:39:28 -04:00
batch : signals _core _module _r
2024-02-09 13:22:22 -05:00
} ;
}
throw new Error ( 'Forbidden access.' ) ;
} ;
2024-09-19 21:55:35 -04:00
directives ( ) ;
init ( ) ;
2024-01-31 07:59:56 -05:00
2024-09-24 03:35:17 -04:00
/***/ } ) ,
/***/ 622 :
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
/* harmony export */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
/* harmony export */ FK : ( ) => ( /* binding */ b ) ,
/* harmony export */ Ob : ( ) => ( /* binding */ E ) ,
/* harmony export */ Qv : ( ) => ( /* binding */ D ) ,
/* harmony export */ XX : ( ) => ( /* binding */ B ) ,
/* harmony export */ fF : ( ) => ( /* binding */ l ) ,
/* harmony export */ h : ( ) => ( /* binding */ _ ) ,
/* harmony export */ q6 : ( ) => ( /* binding */ G ) ,
/* harmony export */ uA : ( ) => ( /* binding */ k ) ,
/* harmony export */ zO : ( ) => ( /* binding */ t )
/* harmony export */ } ) ;
/* unused harmony exports createElement, createRef, toChildArray */
2024-10-14 07:47:24 -04:00
var n , l , u , t , i , o , r , f , e , c , s , a , h = { } , v = [ ] , p = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i , y = Array . isArray ; function d ( n , l ) { for ( var u in l ) n [ u ] = l [ u ] ; return n } function w ( n ) { n && n . parentNode && n . parentNode . removeChild ( n ) } function _ ( l , u , t ) { var i , o , r , f = { } ; for ( r in u ) "key" == r ? i = u [ r ] : "ref" == r ? o = u [ r ] : f [ r ] = u [ r ] ; if ( arguments . length > 2 && ( f . children = arguments . length > 3 ? n . call ( arguments , 2 ) : t ) , "function" == typeof l && null != l . defaultProps ) for ( r in l . defaultProps ) void 0 === f [ r ] && ( f [ r ] = l . defaultProps [ r ] ) ; return g ( l , f , i , o , null ) } function g ( n , t , i , o , r ) { var f = { type : n , props : t , key : i , ref : o , _ _k : null , _ _ : null , _ _b : 0 , _ _e : null , _ _d : void 0 , _ _c : null , constructor : void 0 , _ _v : null == r ? ++ u : r , _ _i : - 1 , _ _u : 0 } ; return null == r && null != l . vnode && l . vnode ( f ) , f } function m ( ) { return { current : null } } function b ( n ) { return n . children } function k ( n , l ) { this . props = n , this . context = l } function x ( n , l ) { if ( null == l ) return n . _ _ ? x ( n . _ _ , n . _ _i + 1 ) : null ; for ( var u ; l < n . _ _k . length ; l ++ ) if ( null != ( u = n . _ _k [ l ] ) && null != u . _ _e ) return u . _ _e ; return "function" == typeof n . type ? x ( n ) : null } function C ( n ) { var l , u ; if ( null != ( n = n . _ _ ) && null != n . _ _c ) { for ( n . _ _e = n . _ _c . base = null , l = 0 ; l < n . _ _k . length ; l ++ ) if ( null != ( u = n . _ _k [ l ] ) && null != u . _ _e ) { n . _ _e = n . _ _c . base = u . _ _e ; break } return C ( n ) } } function S ( n ) { ( ! n . _ _d && ( n . _ _d = ! 0 ) && i . push ( n ) && ! M . _ _r ++ || o !== l . debounceRendering ) && ( ( o = l . debounceRendering ) || r ) ( M ) } function M ( ) { var n , u , t , o , r , e , c , s ; for ( i . sort ( f ) ; n = i . shift ( ) ; ) n . _ _d && ( u = i . length , o = void 0 , e = ( r = ( t = n ) . _ _v ) . _ _e , c = [ ] , s = [ ] , t . _ _P && ( ( o = d ( { } , r ) ) . _ _v = r . _ _v + 1 , l . vnode && l . vnode ( o ) , O ( t . _ _P , o , r , t . _ _n , t . _ _P . namespaceURI , 32 & r . _ _u ? [ e ] : null , c , null == e ? x ( r ) : e , ! ! ( 32 & r . _ _u ) , s ) , o . _ _v = r . _ _v , o . _ _ . _ _k [ o . _ _i ] = o , j ( c , o , s ) , o . _ _e != e && C ( o ) ) , i . length > u && i . sort ( f ) ) ; M . _ _r = 0 } function P ( n , l , u , t , i , o , r , f , e , c , s ) { var a , p , y , d , w , _ = t && t . _ _k || v , g = l . length ; for ( u . _ _d = e , $ ( u , l , _ ) , e = u . _ _d , a = 0 ; a < g ; a ++ ) null != ( y = u . _ _k [ a ] ) && ( p = - 1 === y . _ _i ? h : _ [ y . _ _i ] || h , y . _ _i = a , O ( n , y , p , i , o , r , f , e , c , s ) , d = y . _ _e , y . ref && p . ref != y . ref && ( p . ref && N ( p . ref , null , y ) , s . push ( y . ref , y . _ _c || d , y ) ) , null == w && null != d && ( w = d ) , 65536 & y . _ _u || p . _ _k === y . _ _k ? e = I ( y , e , n ) : "function" == typeof y . type && void 0 !== y . _ _d ? e = y . _ _d : d && ( e = d . nextSibling ) , y . _ _d = void 0 , y . _ _u &= - 196609 ) ; u . _ _d = e , u . _ _e = w } function $ ( n , l , u ) { var t , i , o , r , f , e = l . length , c = u . length , s = c , a = 0 ; for ( n . _ _k = [ ] , t = 0 ; t < e ; t ++ ) null != ( i = l [ t ] ) && "boolean" != typeof i && "function" != typeof i ? ( r = t + a , ( i = n . _ _k [ t ] = "string" == typeof i || "number" == typeof i || "bigint" == typeof i || i . constructor == String ? g ( null , i , null , null , null ) : y ( i ) ? g ( b , { children : i } , null , null , null ) : void 0 === i . constructor && i . _ _b > 0 ? g ( i . type , i . props , i . key , i . ref ? i . ref : null , i . _ _v ) : i ) . _ _ = n , i . _ _b = n . _ _b + 1 , o = null , - 1 !== ( f = i . _ _i = L ( i , u , r , s ) ) && ( s -- , ( o = u [ f ] ) && ( o . _ _u |= 131072 ) ) , null == o || null === o . _ _v ? ( - 1 == f && a -- , "function" != typeof i . type && ( i . _ _u |= 65536 ) ) : f !== r && ( f == r - 1 ? a -- : f == r + 1 ? a ++ : ( f > r ? a -- : a ++ , i . _ _u |= 65536 ) ) ) : i = n . _ _k [ t ] = null ; if ( s ) for ( t = 0 ; t < c ; t ++ ) null != ( o = u [ t ] ) && 0 == ( 131072 & o . _ _u ) && ( o . _ _e == n . _ _d && ( n . _ _d = x ( o ) ) , V ( o , o ) ) } function I ( n , l , u ) { var t , i ; if ( "function" == typeof n . type ) { for ( t = n . _ _k , i = 0 ; t && i < t . length ; i ++ ) t [ i ] && ( t [ i ] . _ _ = n , l = I ( t [ i ] , l , u ) ) ; return l } n . _ _e != l && ( l && n . type && ! u . contains ( l ) && ( l = x ( n ) ) , u . insertBefore ( n . _ _e , l || null ) , l = n . _ _e ) ; do { l = l && l . nextSibling } while ( null != l && 8 === l . nodeType ) ; return l } function H ( n , l ) { return l = l || [ ] , null == n || "boolean" == typeof n || ( y ( n ) ? n . some ( function ( n ) { H ( n , l ) } ) : l . push ( n ) ) , l } function L ( n , l , u , t ) { var i = n . key , o = n . type , r = u - 1 , f = u + 1 , e = l [ u ] ; if ( null === e || e && i == e . key && o === e . type && 0 == ( 131072 & e . _ _u ) ) return u ; if ( t > ( null != e && 0 == ( 131072 & e . _ _u ) ? 1 : 0 ) ) for ( ; r >= 0 || f < l . length ; ) { if ( r >= 0 ) { if ( ( e = l [ r ] ) && 0 == ( 131072 & e . _ _u ) && i == e . key && o === e . type ) return r ; r -- } if ( f < l . length ) { if ( ( e = l [ f ] ) && 0 == ( 131072 & e . _ _u ) && i == e . key && o === e . type ) return f ; f ++ } } return - 1 } function T ( n , l , u ) { "-" === l [ 0 ] ? n . setProperty ( l , null == u ? "" : u ) : n [ l ] = null == u ? "" : "number" != typeof u || p . test ( l ) ? u : u + "px" } function A ( n , l , u , t , i ) { var o ; n : if ( "style" === l ) if ( "string" == typeof u ) n . style . cssText = u ; else { if ( "string" == typeof t && ( n . style . cssText = t = "" ) , t ) for ( l in t ) u && l in u || T ( n . style , l , "" ) ; if ( u ) for ( l in u ) t && u [ l ] === t [ l ] || T ( n . style , l , u [ l ] ) } else if ( "o" === l [ 0 ] && "n" === l [ 1 ] ) o = l !== ( l = l . replace ( /(PointerCapture)$|Capture$/i , "$1" ) ) , l = l . toLowerCase ( ) in n || "onFocusOut" === l || "onFocusIn" === l ? l . toLowerCase ( ) . slice ( 2 ) : l . slice ( 2 ) , n . l || ( n .
2024-09-24 03:35:17 -04:00
/***/ } )
/******/ } ) ;
/************************************************************************/
/******/ // The module cache
/******/ var _ _webpack _module _cache _ _ = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/ // Check if module is in cache
/******/ var cachedModule = _ _webpack _module _cache _ _ [ moduleId ] ;
/******/ if ( cachedModule !== undefined ) {
/******/ return cachedModule . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = _ _webpack _module _cache _ _ [ moduleId ] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ _ _webpack _modules _ _ [ moduleId ] ( module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ ( ( ) => {
/******/ // define getter functions for harmony exports
/******/ _ _webpack _require _ _ . d = ( exports , definition ) => {
/******/ for ( var key in definition ) {
/******/ if ( _ _webpack _require _ _ . o ( definition , key ) && ! _ _webpack _require _ _ . o ( exports , key ) ) {
/******/ Object . defineProperty ( exports , key , { enumerable : true , get : definition [ key ] } ) ;
/******/ }
/******/ }
/******/ } ;
/******/ } ) ( ) ;
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ ( ( ) => {
/******/ _ _webpack _require _ _ . o = ( obj , prop ) => ( Object . prototype . hasOwnProperty . call ( obj , prop ) )
/******/ } ) ( ) ;
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
2024-12-13 14:06:24 -05:00
zj : ( ) => ( /* reexport */ debug _build _module /* getConfig */ . zj ) ,
SD : ( ) => ( /* reexport */ debug _build _module /* getContext */ . SD ) ,
V6 : ( ) => ( /* reexport */ debug _build _module /* getElement */ . V6 ) ,
$K : ( ) => ( /* reexport */ debug _build _module /* getServerContext */ . $K ) ,
vT : ( ) => ( /* reexport */ debug _build _module /* getServerState */ . vT ) ,
jb : ( ) => ( /* reexport */ debug _build _module /* privateApis */ . jb ) ,
yT : ( ) => ( /* reexport */ debug _build _module /* splitTask */ . yT ) ,
M _ : ( ) => ( /* reexport */ debug _build _module /* store */ . M _ ) ,
hb : ( ) => ( /* reexport */ debug _build _module /* useCallback */ . hb ) ,
vJ : ( ) => ( /* reexport */ debug _build _module /* useEffect */ . vJ ) ,
ip : ( ) => ( /* reexport */ debug _build _module /* useInit */ . ip ) ,
Nf : ( ) => ( /* reexport */ debug _build _module /* useLayoutEffect */ . Nf ) ,
Kr : ( ) => ( /* reexport */ debug _build _module /* useMemo */ . Kr ) ,
li : ( ) => ( /* reexport */ debug _build _module /* useRef */ . li ) ,
J0 : ( ) => ( /* reexport */ debug _build _module /* useState */ . J0 ) ,
FH : ( ) => ( /* reexport */ debug _build _module /* useWatch */ . FH ) ,
v4 : ( ) => ( /* reexport */ debug _build _module /* withScope */ . v4 )
2024-09-24 03:35:17 -04:00
} ) ;
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
2024-12-13 14:06:24 -05:00
var debug _preact _module = _ _webpack _require _ _ ( 622 ) ;
; // ./node_modules/preact/devtools/dist/devtools.module.js
var debug _i ; function debug _t ( o , e ) { return n . _ _a && n . _ _a ( e ) , o } null != ( debug _i = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 ) && debug _i . _ _PREACT _DEVTOOLS _ _ && debug _i . _ _PREACT _DEVTOOLS _ _ . attachPreact ( "10.24.3" , debug _preact _module /* options */ . fF , { Fragment : debug _preact _module /* Fragment */ . FK , Component : debug _preact _module /* Component */ . uA } ) ;
2024-09-24 03:35:17 -04:00
2024-12-13 14:06:24 -05:00
; // ./node_modules/preact/debug/dist/debug.module.js
var debug _debug _module _t = { } ; function debug _r ( ) { debug _debug _module _t = { } } function debug _a ( e ) { return e . type === debug _preact _module /* Fragment */ . FK ? "Fragment" : "function" == typeof e . type ? e . type . displayName || e . type . name : "string" == typeof e . type ? e . type : "#text" } var debug _debug _module _i = [ ] , debug _s = [ ] ; function debug _c ( ) { return debug _debug _module _i . length > 0 ? debug _debug _module _i [ debug _debug _module _i . length - 1 ] : null } var debug _l = ! 0 ; function debug _u ( e ) { return "function" == typeof e . type && e . type != debug _preact _module /* Fragment */ . FK } function debug _f ( n ) { for ( var e = [ n ] , o = n ; null != o . _ _o ; ) e . push ( o . _ _o ) , o = o . _ _o ; return e . reduce ( function ( n , e ) { n += " in " + debug _a ( e ) ; var o = e . _ _source ; return o ? n += " (at " + o . fileName + ":" + o . lineNumber + ")" : debug _l && console . warn ( "Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons." ) , debug _l = ! 1 , n + "\n" } , "" ) } var debug _d = "function" == typeof WeakMap ; function debug _p ( n ) { var e = [ ] ; return n . _ _k ? ( n . _ _k . forEach ( function ( n ) { n && "function" == typeof n . type ? e . push . apply ( e , debug _p ( n ) ) : n && "string" == typeof n . type && e . push ( n . type ) } ) , e ) : e } function debug _h ( n ) { return n ? "function" == typeof n . type ? null == n . _ _ ? null != n . _ _e && null != n . _ _e . parentNode ? n . _ _e . parentNode . localName : "" : debug _h ( n . _ _ ) : n . type : "" } var debug _v = debug _preact _module /* Component */ . uA . prototype . setState ; function debug _y ( n ) { return "table" === n || "tfoot" === n || "tbody" === n || "thead" === n || "td" === n || "tr" === n || "th" === n } debug _preact _module /* Component */ . uA . prototype . setState = function ( n , e ) { return null == this . _ _v && null == this . state && console . warn ( 'Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n' + debug _f ( debug _c ( ) ) ) , debug _v . call ( this , n , e ) } ; var debug _m = /^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/ , debug _b = debug _preact _module /* Component */ . uA . prototype . forceUpdate ; function debug _w ( n ) { var e = n . props , o = debug _a ( n ) , t = "" ; for ( var r in e ) if ( e . hasOwnProperty ( r ) && "children" !== r ) { var i = e [ r ] ; "function" == typeof i && ( i = "function " + ( i . displayName || i . name ) + "() {}" ) , i = Object ( i ) !== i || i . toString ? i + "" : Object . prototype . toString . call ( i ) , t += " " + r + "=" + JSON . stringify ( i ) } var s = e . children ; return "<" + o + t + ( s && s . length ? ">..</" + o + ">" : " />" ) } debug _preact _module /* Component */ . uA . prototype . forceUpdate = function ( n ) { return null == this . _ _v ? console . warn ( 'Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n' + debug _f ( debug _c ( ) ) ) : null == this . _ _P && console . warn ( 'Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n' + debug _f ( this . _ _v ) ) , debug _b . call ( this , n ) } , debug _preact _module /* options */ . fF . _ _m = function ( n , e ) { var o = n . type , t = e . map ( function ( n ) { return n && n . localName } ) . filter ( Boolean ) ; console . error ( "Expected a DOM node of type " + o + " but found " + t . join ( ", " ) + "as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n" + debug _f ( n ) ) } , function ( ) { ! function ( ) { var n = debug _preact _module /* options */ . fF . _ _b , o = debug _preact _module /* options */ . fF . diffed , t = debug _preact _module /* options */ . fF . _ _ , r = debug _preact _module /* options */ . fF . vnode , a = debug _preact _module /* options */ . fF . _ _r ; debug _preact _module /* options */ . fF . diffed = function ( n ) { debug _u ( n ) && debug _s . pop ( ) , debug _debug _module _i . pop ( ) , o && o ( n ) } , debug _preact _module /* options */ . fF . _ _b = function ( e ) { debug _u ( e ) && debug _debug _module _i . push ( e ) , n && n ( e ) } , debug _preact _module /* options */ . fF . _ _ = function ( n , e ) { debug _s = [ ] , t && t ( n , e ) } , debug _preact _module /* options */ . fF . vnode = function ( n ) { n . _ _o = debug _s . length > 0 ? debug _s [ debug _s . length - 1 ] : null , r && r ( n ) } , debug _preact _module /* options */ . fF . _ _r = function ( n ) { debug _u ( n ) && debug _s . push ( n ) , a && a ( n ) } } ( ) ; var n = ! 1 , o = debug _preact _module /* options */ . fF . _ _b , r
2024-09-24 03:35:17 -04:00
// EXTERNAL MODULE: ./node_modules/@wordpress/interactivity/build-module/index.js + 18 modules
2024-12-13 14:06:24 -05:00
var debug _build _module = _ _webpack _require _ _ ( 380 ) ;
; // ./node_modules/@wordpress/interactivity/build-module/debug.js
2024-05-24 05:42:09 -04:00
/ * *
* External dependencies
* /
2024-02-15 11:53:15 -05:00
var _ _webpack _exports _ _getConfig = _ _webpack _exports _ _ . zj ;
var _ _webpack _exports _ _getContext = _ _webpack _exports _ _ . SD ;
var _ _webpack _exports _ _getElement = _ _webpack _exports _ _ . V6 ;
2024-09-19 21:55:35 -04:00
var _ _webpack _exports _ _getServerContext = _ _webpack _exports _ _ . $K ;
var _ _webpack _exports _ _getServerState = _ _webpack _exports _ _ . vT ;
2024-02-15 11:53:15 -05:00
var _ _webpack _exports _ _privateApis = _ _webpack _exports _ _ . jb ;
2024-06-25 09:49:28 -04:00
var _ _webpack _exports _ _splitTask = _ _webpack _exports _ _ . yT ;
2024-02-15 11:53:15 -05:00
var _ _webpack _exports _ _store = _ _webpack _exports _ _ . M _ ;
var _ _webpack _exports _ _useCallback = _ _webpack _exports _ _ . hb ;
var _ _webpack _exports _ _useEffect = _ _webpack _exports _ _ . vJ ;
var _ _webpack _exports _ _useInit = _ _webpack _exports _ _ . ip ;
var _ _webpack _exports _ _useLayoutEffect = _ _webpack _exports _ _ . Nf ;
var _ _webpack _exports _ _useMemo = _ _webpack _exports _ _ . Kr ;
var _ _webpack _exports _ _useRef = _ _webpack _exports _ _ . li ;
var _ _webpack _exports _ _useState = _ _webpack _exports _ _ . J0 ;
var _ _webpack _exports _ _useWatch = _ _webpack _exports _ _ . FH ;
var _ _webpack _exports _ _withScope = _ _webpack _exports _ _ . v4 ;
2024-09-19 21:55:35 -04:00
export { _ _webpack _exports _ _getConfig as getConfig , _ _webpack _exports _ _getContext as getContext , _ _webpack _exports _ _getElement as getElement , _ _webpack _exports _ _getServerContext as getServerContext , _ _webpack _exports _ _getServerState as getServerState , _ _webpack _exports _ _privateApis as privateApis , _ _webpack _exports _ _splitTask as splitTask , _ _webpack _exports _ _store as store , _ _webpack _exports _ _useCallback as useCallback , _ _webpack _exports _ _useEffect as useEffect , _ _webpack _exports _ _useInit as useInit , _ _webpack _exports _ _useLayoutEffect as useLayoutEffect , _ _webpack _exports _ _useMemo as useMemo , _ _webpack _exports _ _useRef as useRef , _ _webpack _exports _ _useState as useState , _ _webpack _exports _ _useWatch as useWatch , _ _webpack _exports _ _withScope as withScope } ;