2022-04-11 14:04:30 +02:00
/******/ ( function ( ) { // webpackBootstrap
/******/ "use strict" ;
/******/ // The require scope
/******/ var _ _webpack _require _ _ = { } ;
/******/
/************************************************************************/
/******/ /* 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-14 05:41:57 +01:00
/******/ } ;
2022-04-11 14:04:30 +02:00
/******/ } ( ) ;
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ ! function ( ) {
/******/ _ _webpack _require _ _ . o = function ( obj , prop ) { return Object . prototype . hasOwnProperty . call ( obj , prop ) ; }
/******/ } ( ) ;
/******/
2018-12-14 05:41:57 +01:00
/************************************************************************/
2022-04-11 14:04:30 +02:00
var _ _webpack _exports _ _ = { } ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
"default" : function ( ) { return /* binding */ deprecated ; }
} ) ;
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
// UNUSED EXPORTS: logged
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
; // CONCATENATED MODULE: external ["wp","hooks"]
var external _wp _hooks _namespaceObject = window [ "wp" ] [ "hooks" ] ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/deprecated/build-module/index.js
2018-12-14 05:41:57 +01:00
/ * *
* WordPress dependencies
* /
/ * *
* Object map tracking messages which have been logged , for use in ensuring a
* message is only logged once .
*
2021-04-15 17:19:43 +02:00
* @ type { Record < string , true | undefined > }
2018-12-14 05:41:57 +01:00
* /
2021-05-19 17:09:27 +02:00
const logged = Object . create ( null ) ;
2018-12-14 05:41:57 +01:00
/ * *
* Logs a message to notify developers about a deprecated feature .
*
2021-01-28 03:04:13 +01:00
* @ param { string } feature Name of the deprecated feature .
* @ param { Object } [ options ] Personalisation options
2021-04-15 17:19:43 +02:00
* @ param { string } [ options . since ] Version in which the feature was deprecated .
2021-01-28 03:04:13 +01:00
* @ param { string } [ options . version ] Version in which the feature will be removed .
* @ param { string } [ options . alternative ] Feature to use instead
* @ param { string } [ options . plugin ] Plugin name if it ' s a plugin feature
* @ param { string } [ options . link ] Link to documentation
* @ param { string } [ options . hint ] Additional message to help transition away from the deprecated feature .
2019-03-21 13:48:00 +01:00
*
* @ example
* ` ` ` js
* import deprecated from '@wordpress/deprecated' ;
*
* deprecated ( 'Eating meat' , {
2021-04-15 17:19:43 +02:00
* since : '2019.01.01'
* version : '2020.01.01' ,
2019-03-21 13:48:00 +01:00
* alternative : 'vegetables' ,
* plugin : 'the earth' ,
* hint : 'You may find it beneficial to transition gradually.' ,
* } ) ;
*
2021-04-15 17:19:43 +02:00
* // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'
2019-03-21 13:48:00 +01:00
* ` ` `
2018-12-14 05:41:57 +01:00
* /
2021-11-15 13:50:17 +01:00
function deprecated ( feature ) {
let options = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
2021-05-19 17:09:27 +02:00
const {
since ,
version ,
alternative ,
plugin ,
link ,
hint
} = options ;
const pluginMessage = plugin ? ` from ${ plugin } ` : '' ;
const sinceMessage = since ? ` since version ${ since } ` : '' ;
const versionMessage = version ? ` and will be removed ${ pluginMessage } in version ${ version } ` : '' ;
const useInsteadMessage = alternative ? ` Please use ${ alternative } instead. ` : '' ;
const linkMessage = link ? ` See: ${ link } ` : '' ;
const hintMessage = hint ? ` Note: ${ hint } ` : '' ;
const message = ` ${ feature } is deprecated ${ sinceMessage } ${ versionMessage } . ${ useInsteadMessage } ${ linkMessage } ${ hintMessage } ` ; // Skip if already logged.
2018-12-14 05:41:57 +01:00
if ( message in logged ) {
return ;
}
/ * *
* Fires whenever a deprecated feature is encountered
*
* @ param { string } feature Name of the deprecated feature .
* @ param { ? Object } options Personalisation options
2021-04-15 17:19:43 +02:00
* @ param { string } options . since Version in which the feature was deprecated .
2018-12-14 05:41:57 +01:00
* @ param { ? string } options . version Version in which the feature will be removed .
* @ param { ? string } options . alternative Feature to use instead
* @ param { ? string } options . plugin Plugin name if it ' s a plugin feature
* @ param { ? string } options . link Link to documentation
* @ param { ? string } options . hint Additional message to help transition away from the deprecated feature .
* @ param { ? string } message Message sent to console . warn
* /
2022-04-11 14:04:30 +02:00
( 0 , external _wp _hooks _namespaceObject . doAction ) ( 'deprecated' , feature , options , message ) ; // eslint-disable-next-line no-console
2018-12-14 05:41:57 +01:00
console . warn ( message ) ;
logged [ message ] = true ;
}
2021-04-15 17:19:43 +02:00
/** @typedef {import('utility-types').NonUndefined<Parameters<typeof deprecated>[1]>} DeprecatedOptions */
2018-12-14 05:41:57 +01:00
2022-04-11 14:04:30 +02:00
( window . wp = window . wp || { } ) . deprecated = _ _webpack _exports _ _ [ "default" ] ;
/******/ } ) ( )
;