2022-04-11 08:04:30 -04:00
/******/ ( function ( ) { // webpackBootstrap
/******/ "use strict" ;
/******/ // The require scope
/******/ var _ _webpack _require _ _ = { } ;
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ ! function ( ) {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function ( ) { return module [ 'default' ] ; } :
/******/ function ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , { a : getter } ) ;
/******/ return getter ;
/******/ } ;
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/define property getters */
/******/ ! function ( ) {
/******/ // define getter functions for harmony exports
/******/ _ _webpack _require _ _ . d = function ( 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 ] } ) ;
/******/ }
/******/ }
2018-12-13 23:41:57 -05:00
/******/ } ;
2022-04-11 08:04:30 -04:00
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ ! function ( ) {
/******/ _ _webpack _require _ _ . o = function ( obj , prop ) { return Object . prototype . hasOwnProperty . call ( obj , prop ) ; }
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ ! function ( ) {
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = function ( exports ) {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/ } ( ) ;
/******/
2018-12-13 23:41:57 -05:00
/************************************************************************/
2022-04-11 08:04:30 -04:00
var _ _webpack _exports _ _ = { } ;
2021-05-20 08:20:04 -04:00
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2021-04-15 11:19:43 -04:00
2021-05-20 08:20:04 -04:00
// EXPORTS
2022-04-11 08:04:30 -04:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
"DotTip" : function ( ) { return /* reexport */ dot _tip ; } ,
"store" : function ( ) { return /* reexport */ store ; }
} ) ;
2021-04-15 11:19:43 -04:00
2021-05-20 08:20:04 -04:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
2022-04-11 08:04:30 -04:00
_ _webpack _require _ _ . d ( actions _namespaceObject , {
"disableTips" : function ( ) { return disableTips ; } ,
"dismissTip" : function ( ) { return dismissTip ; } ,
"enableTips" : function ( ) { return enableTips ; } ,
"triggerGuide" : function ( ) { return triggerGuide ; }
} ) ;
2021-04-15 11:19:43 -04:00
2021-05-20 08:20:04 -04:00
// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
2022-04-11 08:04:30 -04:00
_ _webpack _require _ _ . d ( selectors _namespaceObject , {
"areTipsEnabled" : function ( ) { return selectors _areTipsEnabled ; } ,
"getAssociatedGuide" : function ( ) { return getAssociatedGuide ; } ,
"isTipVisible" : function ( ) { return isTipVisible ; }
} ) ;
2021-01-27 21:04:13 -05:00
2022-04-11 08:04:30 -04:00
; // CONCATENATED MODULE: external ["wp","deprecated"]
var external _wp _deprecated _namespaceObject = window [ "wp" ] [ "deprecated" ] ;
var external _wp _deprecated _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _wp _deprecated _namespaceObject ) ;
; // CONCATENATED MODULE: external ["wp","data"]
var external _wp _data _namespaceObject = window [ "wp" ] [ "data" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/reducer.js
2021-01-27 21:04:13 -05:00
/ * *
* WordPress dependencies
* /
2021-05-20 08:20:04 -04:00
/ * *
* Reducer that tracks which tips are in a guide . Each guide is represented by
* an array which contains the tip identifiers contained within that guide .
*
2021-11-08 09:29:21 -05:00
* @ param { Array } state Current state .
2021-05-20 08:20:04 -04:00
* @ param { Object } action Dispatched action .
*
* @ return { Array } Updated state .
* /
2020-06-26 09:33:47 -04:00
2021-11-15 07:50:17 -05:00
function guides ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : [ ] ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-20 08:20:04 -04:00
switch ( action . type ) {
case 'TRIGGER_GUIDE' :
return [ ... state , action . tipIds ] ;
}
2020-06-26 09:33:47 -04:00
2021-05-20 08:20:04 -04:00
return state ;
}
/ * *
* Reducer that tracks whether or not tips are globally enabled .
*
2021-11-08 09:29:21 -05:00
* @ param { boolean } state Current state .
* @ param { Object } action Dispatched action .
2021-05-20 08:20:04 -04:00
*
* @ return { boolean } Updated state .
* /
2019-09-19 11:19:18 -04:00
2021-11-15 07:50:17 -05:00
function areTipsEnabled ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : true ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-20 08:20:04 -04:00
switch ( action . type ) {
case 'DISABLE_TIPS' :
return false ;
2019-09-19 11:19:18 -04:00
2021-05-20 08:20:04 -04:00
case 'ENABLE_TIPS' :
return true ;
}
2019-09-19 11:19:18 -04:00
2021-05-20 08:20:04 -04:00
return state ;
}
/ * *
* Reducer that tracks which tips have been dismissed . If the state object
* contains a tip identifier , then that tip is dismissed .
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
2020-02-10 17:33:27 -05:00
2021-11-15 07:50:17 -05:00
function dismissedTips ( ) {
let state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
let action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2021-05-20 08:20:04 -04:00
switch ( action . type ) {
case 'DISMISS_TIP' :
return { ... state ,
[ action . id ] : true
} ;
2019-10-15 11:37:08 -04:00
2021-05-20 08:20:04 -04:00
case 'ENABLE_TIPS' :
return { } ;
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
return state ;
}
2022-04-11 08:04:30 -04:00
const preferences = ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
2021-05-20 08:20:04 -04:00
areTipsEnabled ,
dismissedTips
} ) ;
2022-04-11 08:04:30 -04:00
/* harmony default export */ var reducer = ( ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
2021-05-20 08:20:04 -04:00
guides ,
preferences
} ) ) ;
2018-12-13 23:41:57 -05:00
2022-04-11 08:04:30 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/actions.js
2018-12-17 22:14:52 -05:00
/ * *
2021-05-20 08:20:04 -04:00
* Returns an action object that , when dispatched , presents a guide that takes
* the user through a series of tips step by step .
2020-01-03 08:17:24 -05:00
*
2021-05-20 08:20:04 -04:00
* @ param { string [ ] } tipIds Which tips to show in the guide .
2018-12-17 22:14:52 -05:00
*
2021-05-20 08:20:04 -04:00
* @ return { Object } Action object .
2018-12-17 22:14:52 -05:00
* /
2021-05-20 08:20:04 -04:00
function triggerGuide ( tipIds ) {
return {
type : 'TRIGGER_GUIDE' ,
tipIds
} ;
}
2018-12-17 22:14:52 -05:00
/ * *
2021-05-20 08:20:04 -04:00
* Returns an action object that , when dispatched , dismisses the given tip . A
* dismissed tip will not show again .
2018-12-17 22:14:52 -05:00
*
2021-05-20 08:20:04 -04:00
* @ param { string } id The tip to dismiss .
2019-10-15 11:37:08 -04:00
*
2021-05-20 08:20:04 -04:00
* @ return { Object } Action object .
2018-12-17 22:14:52 -05:00
* /
2018-12-13 23:41:57 -05:00
2022-04-11 08:04:30 -04:00
function dismissTip ( id ) {
2021-05-20 08:20:04 -04:00
return {
type : 'DISMISS_TIP' ,
id
} ;
}
2018-12-17 22:14:52 -05:00
/ * *
2021-05-20 08:20:04 -04:00
* Returns an action object that , when dispatched , prevents all tips from
* showing again .
2020-01-03 08:17:24 -05:00
*
2021-05-20 08:20:04 -04:00
* @ return { Object } Action object .
2019-10-15 11:37:08 -04:00
* /
2018-12-13 23:41:57 -05:00
2022-04-11 08:04:30 -04:00
function disableTips ( ) {
2021-05-20 08:20:04 -04:00
return {
type : 'DISABLE_TIPS'
} ;
}
2019-10-15 11:37:08 -04:00
/ * *
2021-05-20 08:20:04 -04:00
* Returns an action object that , when dispatched , makes all tips show again .
2019-10-15 11:37:08 -04:00
*
2021-05-20 08:20:04 -04:00
* @ return { Object } Action object .
2020-01-03 08:17:24 -05:00
* /
2021-05-20 08:20:04 -04:00
function enableTips ( ) {
return {
type : 'ENABLE_TIPS'
} ;
2020-01-03 08:17:24 -05:00
}
2020-01-08 06:57:23 -05:00
2022-09-20 11:43:29 -04:00
; // CONCATENATED MODULE: ./node_modules/rememo/rememo.js
2020-01-22 17:06:21 -05:00
2019-10-15 12:17:12 -04:00
2022-09-20 11:43:29 -04:00
/** @typedef {(...args: any[]) => *[]} GetDependants */
/** @typedef {() => void} Clear */
2020-01-08 06:57:23 -05:00
/ * *
2022-09-20 11:43:29 -04:00
* @ typedef { {
* getDependants : GetDependants ,
* clear : Clear
* } } EnhancedSelector
* /
/ * *
* Internal cache entry .
2020-01-08 06:57:23 -05:00
*
2022-09-20 11:43:29 -04:00
* @ typedef CacheNode
*
* @ property { ? CacheNode | undefined } [ prev ] Previous node .
* @ property { ? CacheNode | undefined } [ next ] Next node .
* @ property { * [ ] } args Function arguments for cache entry .
* @ property { * } val Function result .
2020-01-08 06:57:23 -05:00
* /
/ * *
2022-09-20 11:43:29 -04:00
* @ typedef Cache
*
* @ property { Clear } clear Function to clear cache .
* @ property { boolean } [ isUniqueByDependants ] Whether dependants are valid in
* considering cache uniqueness . A cache is unique if dependents are all arrays
* or objects .
* @ property { CacheNode ? } [ head ] Cache head .
* @ property { * [ ] } [ lastDependants ] Dependants from previous invocation .
* /
/ * *
* Arbitrary value used as key for referencing cache object in WeakMap tree .
2020-01-08 06:57:23 -05:00
*
2022-09-20 11:43:29 -04:00
* @ type { { } }
2019-10-15 12:17:12 -04:00
* /
2022-09-20 11:43:29 -04:00
var LEAF _KEY = { } ;
2019-10-15 12:17:12 -04:00
2020-01-08 06:57:23 -05:00
/ * *
2021-05-20 08:20:04 -04:00
* Returns the first argument as the sole entry in an array .
2020-01-08 06:57:23 -05:00
*
2022-09-20 11:43:29 -04:00
* @ template T
2020-01-08 06:57:23 -05:00
*
2022-09-20 11:43:29 -04:00
* @ param { T } value Value to return .
*
* @ return { [ T ] } Value returned as entry in array .
2020-01-08 06:57:23 -05:00
* /
2022-09-20 11:43:29 -04:00
function arrayOf ( value ) {
return [ value ] ;
2020-01-08 06:57:23 -05:00
}
2019-10-15 12:17:12 -04:00
/ * *
2021-05-20 08:20:04 -04:00
* Returns true if the value passed is object - like , or false otherwise . A value
* is object - like if it can support property assignment , e . g . object or array .
2020-01-03 08:17:24 -05:00
*
2021-05-20 08:20:04 -04:00
* @ param { * } value Value to test .
2020-01-08 06:57:23 -05:00
*
2021-05-20 08:20:04 -04:00
* @ return { boolean } Whether value is object - like .
2019-10-15 12:17:12 -04:00
* /
2022-09-20 11:43:29 -04:00
function isObjectLike ( value ) {
return ! ! value && 'object' === typeof value ;
2020-01-08 06:57:23 -05:00
}
2019-10-15 12:17:12 -04:00
/ * *
2021-05-20 08:20:04 -04:00
* Creates and returns a new cache object .
2019-10-15 12:17:12 -04:00
*
2022-09-20 11:43:29 -04:00
* @ return { Cache } Cache object .
2019-10-15 12:17:12 -04:00
* /
2021-05-20 08:20:04 -04:00
function createCache ( ) {
2022-09-20 11:43:29 -04:00
/** @type {Cache} */
2021-05-20 08:20:04 -04:00
var cache = {
2022-09-20 11:43:29 -04:00
clear : function ( ) {
2021-05-20 08:20:04 -04:00
cache . head = null ;
} ,
} ;
2019-10-15 12:17:12 -04:00
2021-05-20 08:20:04 -04:00
return cache ;
2020-01-08 06:57:23 -05:00
}
2021-05-20 08:20:04 -04:00
2019-10-15 11:37:08 -04:00
/ * *
2021-05-20 08:20:04 -04:00
* Returns true if entries within the two arrays are strictly equal by
* reference from a starting index .
2019-10-15 11:37:08 -04:00
*
2022-09-20 11:43:29 -04:00
* @ param { * [ ] } a First array .
* @ param { * [ ] } b Second array .
2021-05-20 08:20:04 -04:00
* @ param { number } fromIndex Index from which to start comparison .
*
* @ return { boolean } Whether arrays are shallowly equal .
2019-10-15 11:37:08 -04:00
* /
2022-09-20 11:43:29 -04:00
function isShallowEqual ( a , b , fromIndex ) {
2021-05-20 08:20:04 -04:00
var i ;
2020-01-08 06:57:23 -05:00
2022-09-20 11:43:29 -04:00
if ( a . length !== b . length ) {
2021-05-20 08:20:04 -04:00
return false ;
}
2018-12-13 23:41:57 -05:00
2022-09-20 11:43:29 -04:00
for ( i = fromIndex ; i < a . length ; i ++ ) {
if ( a [ i ] !== b [ i ] ) {
2021-05-20 08:20:04 -04:00
return false ;
}
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
return true ;
}
2020-01-08 06:57:23 -05:00
/ * *
2021-05-20 08:20:04 -04:00
* Returns a memoized selector function . The getDependants function argument is
* called before the memoized selector and is expected to return an immutable
* reference or array of references on which the selector depends for computing
* its own return value . The memoize cache is preserved only as long as those
* dependant references remain the same . If getDependants returns a different
* reference ( s ) , the cache is cleared and the selector value regenerated .
2020-01-03 08:17:24 -05:00
*
2022-09-20 11:43:29 -04:00
* @ template { ( ... args : * [ ] ) => * } S
2020-01-08 06:57:23 -05:00
*
2022-09-20 11:43:29 -04:00
* @ param { S } selector Selector function .
* @ param { GetDependants = } getDependants Dependant getter returning an array of
* references used in cache bust consideration .
2019-10-15 12:17:12 -04:00
* /
2022-09-20 11:43:29 -04:00
/* harmony default export */ function rememo ( selector , getDependants ) {
/** @type {WeakMap<*,*>} */
var rootCache ;
2020-01-03 08:17:24 -05:00
2022-09-20 11:43:29 -04:00
/** @type {GetDependants} */
var normalizedGetDependants = getDependants ? getDependants : arrayOf ;
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
/ * *
* Returns the cache for a given dependants array . When possible , a WeakMap
* will be used to create a unique cache for each set of dependants . This
* is feasible due to the nature of WeakMap in allowing garbage collection
* to occur on entries where the key object is no longer referenced . Since
* WeakMap requires the key to be an object , this is only possible when the
* dependant is object - like . The root cache is created as a hierarchy where
* each top - level key is the first entry in a dependants set , the value a
* WeakMap where each key is the next dependant , and so on . This continues
* so long as the dependants are object - like . If no dependants are object -
* like , then the cache is shared across all invocations .
*
* @ see isObjectLike
*
2022-09-20 11:43:29 -04:00
* @ param { * [ ] } dependants Selector dependants .
2021-05-20 08:20:04 -04:00
*
2022-09-20 11:43:29 -04:00
* @ return { Cache } Cache object .
2021-05-20 08:20:04 -04:00
* /
2022-09-20 11:43:29 -04:00
function getCache ( dependants ) {
2021-05-20 08:20:04 -04:00
var caches = rootCache ,
isUniqueByDependants = true ,
2022-09-20 11:43:29 -04:00
i ,
dependant ,
map ,
cache ;
2018-12-13 23:41:57 -05:00
2022-09-20 11:43:29 -04:00
for ( i = 0 ; i < dependants . length ; i ++ ) {
dependant = dependants [ i ] ;
2020-01-08 06:57:23 -05:00
2021-05-20 08:20:04 -04:00
// Can only compose WeakMap from object-like key.
2022-09-20 11:43:29 -04:00
if ( ! isObjectLike ( dependant ) ) {
2021-05-20 08:20:04 -04:00
isUniqueByDependants = false ;
break ;
}
2020-01-08 06:57:23 -05:00
2021-05-20 08:20:04 -04:00
// Does current segment of cache already have a WeakMap?
2022-09-20 11:43:29 -04:00
if ( caches . has ( dependant ) ) {
2021-05-20 08:20:04 -04:00
// Traverse into nested WeakMap.
2022-09-20 11:43:29 -04:00
caches = caches . get ( dependant ) ;
2021-05-20 08:20:04 -04:00
} else {
// Create, set, and traverse into a new one.
map = new WeakMap ( ) ;
2022-09-20 11:43:29 -04:00
caches . set ( dependant , map ) ;
2021-05-20 08:20:04 -04:00
caches = map ;
}
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
// We use an arbitrary (but consistent) object as key for the last item
// in the WeakMap to serve as our running cache.
2022-09-20 11:43:29 -04:00
if ( ! caches . has ( LEAF _KEY ) ) {
2021-05-20 08:20:04 -04:00
cache = createCache ( ) ;
cache . isUniqueByDependants = isUniqueByDependants ;
2022-09-20 11:43:29 -04:00
caches . set ( LEAF _KEY , cache ) ;
2021-05-20 08:20:04 -04:00
}
2018-12-13 23:41:57 -05:00
2022-09-20 11:43:29 -04:00
return caches . get ( LEAF _KEY ) ;
2021-05-20 08:20:04 -04:00
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
/ * *
* Resets root memoization cache .
* /
function clear ( ) {
2022-09-20 11:43:29 -04:00
rootCache = new WeakMap ( ) ;
2021-05-20 08:20:04 -04:00
}
2018-12-13 23:41:57 -05:00
2022-09-20 11:43:29 -04:00
/* eslint-disable jsdoc/check-param-names */
2021-05-20 08:20:04 -04:00
/ * *
* The augmented selector call , considering first whether dependants have
* changed before passing it to underlying memoize function .
*
2022-09-20 11:43:29 -04:00
* @ param { * } source Source object for derivation .
* @ param { ... * } extraArgs Additional arguments to pass to selector .
2021-05-20 08:20:04 -04:00
*
* @ return { * } Selector result .
* /
2022-09-20 11:43:29 -04:00
/* eslint-enable jsdoc/check-param-names */
function callSelector ( /* source, ...extraArgs */ ) {
2021-05-20 08:20:04 -04:00
var len = arguments . length ,
2022-09-20 11:43:29 -04:00
cache ,
node ,
i ,
args ,
dependants ;
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
// Create copy of arguments (avoid leaking deoptimization).
2022-09-20 11:43:29 -04:00
args = new Array ( len ) ;
for ( i = 0 ; i < len ; i ++ ) {
args [ i ] = arguments [ i ] ;
2021-05-20 08:20:04 -04:00
}
2018-12-13 23:41:57 -05:00
2022-09-20 11:43:29 -04:00
dependants = normalizedGetDependants . apply ( null , args ) ;
cache = getCache ( dependants ) ;
// If not guaranteed uniqueness by dependants (primitive type), shallow
// compare against last dependants and, if references have changed,
// destroy cache to recalculate result.
if ( ! cache . isUniqueByDependants ) {
if (
cache . lastDependants &&
! isShallowEqual ( dependants , cache . lastDependants , 0 )
) {
2021-05-20 08:20:04 -04:00
cache . clear ( ) ;
}
2021-01-27 21:04:13 -05:00
2021-05-20 08:20:04 -04:00
cache . lastDependants = dependants ;
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
node = cache . head ;
2022-09-20 11:43:29 -04:00
while ( node ) {
2021-05-20 08:20:04 -04:00
// Check whether node arguments match arguments
2022-09-20 11:43:29 -04:00
if ( ! isShallowEqual ( node . args , args , 1 ) ) {
2021-05-20 08:20:04 -04:00
node = node . next ;
continue ;
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
// At this point we can assume we've found a match
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
// Surface matched node to head if not already
2022-09-20 11:43:29 -04:00
if ( node !== cache . head ) {
2021-05-20 08:20:04 -04:00
// Adjust siblings to point to each other.
2022-09-20 11:43:29 -04:00
/** @type {CacheNode} */ ( node . prev ) . next = node . next ;
if ( node . next ) {
2021-05-20 08:20:04 -04:00
node . next . prev = node . prev ;
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
node . next = cache . head ;
node . prev = null ;
2022-09-20 11:43:29 -04:00
/** @type {CacheNode} */ ( cache . head ) . prev = node ;
2021-05-20 08:20:04 -04:00
cache . head = node ;
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
// Return immediately
return node . val ;
}
2020-02-10 17:33:27 -05:00
2021-05-20 08:20:04 -04:00
// No cached value found. Continue to insertion phase:
2018-12-13 23:41:57 -05:00
2022-09-20 11:43:29 -04:00
node = /** @type {CacheNode} */ ( {
2021-05-20 08:20:04 -04:00
// Generate the result from original function
2022-09-20 11:43:29 -04:00
val : selector . apply ( null , args ) ,
} ) ;
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
// Avoid including the source object in the cache.
2022-09-20 11:43:29 -04:00
args [ 0 ] = null ;
2021-05-20 08:20:04 -04:00
node . args = args ;
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
// Shift existing head down list
2022-09-20 11:43:29 -04:00
if ( cache . head ) {
2021-05-20 08:20:04 -04:00
cache . head . prev = node ;
node . next = cache . head ;
}
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
cache . head = node ;
2018-12-13 23:41:57 -05:00
2021-05-20 08:20:04 -04:00
return node . val ;
}
2018-12-13 23:41:57 -05:00
2022-09-20 11:43:29 -04:00
callSelector . getDependants = normalizedGetDependants ;
2021-05-20 08:20:04 -04:00
callSelector . clear = clear ;
clear ( ) ;
2018-12-13 23:41:57 -05:00
2022-09-20 11:43:29 -04:00
return /** @type {S & EnhancedSelector} */ ( callSelector ) ;
2022-04-11 08:04:30 -04:00
}
2020-02-10 17:33:27 -05:00
2022-04-11 08:04:30 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/selectors.js
/ * *
* External dependencies
* /
2018-12-13 23:41:57 -05:00
2022-04-11 08:04:30 -04:00
/ * *
* An object containing information about a guide .
*
* @ typedef { Object } NUXGuideInfo
* @ property { string [ ] } tipIds Which tips the guide contains .
* @ property { ? string } currentTipId The guide ' s currently showing tip .
* @ property { ? string } nextTipId The guide ' s next tip to show .
* /
/ * *
* Returns an object describing the guide , if any , that the given tip is a part
* of .
*
* @ param { Object } state Global application state .
* @ param { string } tipId The tip to query .
*
* @ return { ? NUXGuideInfo } Information about the associated guide .
* /
const getAssociatedGuide = rememo ( ( state , tipId ) => {
for ( const tipIds of state . guides ) {
2022-09-20 11:43:29 -04:00
if ( tipIds . includes ( tipId ) ) {
const nonDismissedTips = tipIds . filter ( tId => ! Object . keys ( state . preferences . dismissedTips ) . includes ( tId ) ) ;
2022-04-11 08:04:30 -04:00
const [ currentTipId = null , nextTipId = null ] = nonDismissedTips ;
return {
tipIds ,
currentTipId ,
nextTipId
} ;
}
}
2018-12-13 23:41:57 -05:00
2022-04-11 08:04:30 -04:00
return null ;
} , state => [ state . guides , state . preferences . dismissedTips ] ) ;
/ * *
* Determines whether or not the given tip is showing . Tips are hidden if they
* are disabled , have been dismissed , or are not the current tip in any
* guide that they have been added to .
*
* @ param { Object } state Global application state .
* @ param { string } tipId The tip to query .
*
* @ return { boolean } Whether or not the given tip is showing .
* /
function isTipVisible ( state , tipId ) {
2022-09-20 11:43:29 -04:00
var _state$preferences$di ;
2022-04-11 08:04:30 -04:00
if ( ! state . preferences . areTipsEnabled ) {
return false ;
}
2022-09-20 11:43:29 -04:00
if ( ( _state$preferences$di = state . preferences . dismissedTips ) !== null && _state$preferences$di !== void 0 && _state$preferences$di . hasOwnProperty ( tipId ) ) {
2022-04-11 08:04:30 -04:00
return false ;
}
const associatedGuide = getAssociatedGuide ( state , tipId ) ;
if ( associatedGuide && associatedGuide . currentTipId !== tipId ) {
return false ;
}
return true ;
}
/ * *
* Returns whether or not tips are globally enabled .
*
* @ param { Object } state Global application state .
*
* @ return { boolean } Whether tips are globally enabled .
* /
function selectors _areTipsEnabled ( state ) {
return state . preferences . areTipsEnabled ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/index.js
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
const STORE _NAME = 'core/nux' ;
/ * *
* Store definition for the nux namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
* /
2019-10-15 12:17:12 -04:00
2022-04-11 08:04:30 -04:00
const store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( STORE _NAME , {
reducer : reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject ,
persist : [ 'preferences' ]
} ) ; // Once we build a more generic persistence plugin that works across types of stores
// we'd be able to replace this with a register call.
2018-12-13 23:41:57 -05:00
2022-04-11 08:04:30 -04:00
( 0 , external _wp _data _namespaceObject . registerStore ) ( STORE _NAME , {
reducer : reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject ,
persist : [ 'preferences' ]
} ) ;
2021-05-19 11:09:27 -04:00
2022-04-11 08:04:30 -04:00
; // CONCATENATED MODULE: external ["wp","element"]
var external _wp _element _namespaceObject = window [ "wp" ] [ "element" ] ;
; // CONCATENATED MODULE: external ["wp","compose"]
var external _wp _compose _namespaceObject = window [ "wp" ] [ "compose" ] ;
; // CONCATENATED MODULE: external ["wp","components"]
var external _wp _components _namespaceObject = window [ "wp" ] [ "components" ] ;
; // CONCATENATED MODULE: external ["wp","i18n"]
var external _wp _i18n _namespaceObject = window [ "wp" ] [ "i18n" ] ;
; // CONCATENATED MODULE: external ["wp","primitives"]
var external _wp _primitives _namespaceObject = window [ "wp" ] [ "primitives" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
2021-05-19 11:09:27 -04:00
2018-12-13 23:41:57 -05:00
2020-01-22 17:06:21 -05:00
/ * *
* WordPress dependencies
* /
2022-04-11 08:04:30 -04:00
const close _close = ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . SVG , {
2021-05-20 08:20:04 -04:00
xmlns : "http://www.w3.org/2000/svg" ,
viewBox : "0 0 24 24"
2022-04-11 08:04:30 -04:00
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _primitives _namespaceObject . Path , {
2021-05-20 08:20:04 -04:00
d : "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
} ) ) ;
2022-04-11 08:04:30 -04:00
/* harmony default export */ var library _close = ( close _close ) ;
2020-01-22 17:06:21 -05:00
2022-04-11 08:04:30 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
2018-12-13 23:41:57 -05:00
2022-04-11 08:04:30 -04:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
function onClick ( event ) {
// Tips are often nested within buttons. We stop propagation so that clicking
// on a tip doesn't result in the button being clicked.
event . stopPropagation ( ) ;
}
function DotTip ( _ref ) {
let {
position = 'middle right' ,
children ,
isVisible ,
hasNextTip ,
onDismiss ,
onDisable
} = _ref ;
const anchorParent = ( 0 , external _wp _element _namespaceObject . useRef ) ( null ) ;
const onFocusOutsideCallback = ( 0 , external _wp _element _namespaceObject . useCallback ) ( event => {
if ( ! anchorParent . current ) {
return ;
}
if ( anchorParent . current . contains ( event . relatedTarget ) ) {
return ;
}
onDisable ( ) ;
} , [ onDisable , anchorParent ] ) ;
if ( ! isVisible ) {
return null ;
}
return ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Popover , {
className : "nux-dot-tip" ,
position : position ,
2022-09-20 11:43:29 -04:00
focusOnMount : true ,
2022-04-11 08:04:30 -04:00
role : "dialog" ,
"aria-label" : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Editor tips' ) ,
onClick : onClick ,
onFocusOutside : onFocusOutsideCallback
} , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , null , children ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( "p" , null , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
variant : "link" ,
onClick : onDismiss
} , hasNextTip ? ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'See next tip' ) : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Got it' ) ) ) , ( 0 , external _wp _element _namespaceObject . createElement ) ( external _wp _components _namespaceObject . Button , {
className : "nux-dot-tip__disable" ,
icon : library _close ,
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Disable tips' ) ,
onClick : onDisable
} ) ) ;
}
/* harmony default export */ var dot _tip = ( ( 0 , external _wp _compose _namespaceObject . compose ) ( ( 0 , external _wp _data _namespaceObject . withSelect ) ( ( select , _ref2 ) => {
let {
tipId
} = _ref2 ;
const {
isTipVisible ,
getAssociatedGuide
} = select ( store ) ;
const associatedGuide = getAssociatedGuide ( tipId ) ;
return {
isVisible : isTipVisible ( tipId ) ,
hasNextTip : ! ! ( associatedGuide && associatedGuide . nextTipId )
} ;
} ) , ( 0 , external _wp _data _namespaceObject . withDispatch ) ( ( dispatch , _ref3 ) => {
let {
tipId
} = _ref3 ;
const {
dismissTip ,
disableTips
} = dispatch ( store ) ;
return {
onDismiss ( ) {
dismissTip ( tipId ) ;
} ,
onDisable ( ) {
disableTips ( ) ;
}
} ;
} ) ) ( DotTip ) ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/index.js
/ * *
* WordPress dependencies
* /
external _wp _deprecated _default ( ) ( 'wp.nux' , {
since : '5.4' ,
2022-04-12 11:12:47 -04:00
hint : 'wp.components.Guide can be used to show a user guide.' ,
version : '6.2'
2022-04-11 08:04:30 -04:00
} ) ;
( window . wp = window . wp || { } ) . nux = _ _webpack _exports _ _ ;
/******/ } ) ( )
;