@wordpress/deprecated 4.31.1-next.f56bd8138.0 → 4.32.1-next.47f435fc9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.32.0 (2025-10-01)
6
+
5
7
  ## 4.31.0 (2025-09-17)
6
8
 
7
9
  ## 4.30.0 (2025-09-03)
package/build/index.js CHANGED
@@ -1,74 +1,47 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var index_exports = {};
20
+ __export(index_exports, {
21
+ default: () => deprecated,
22
+ logged: () => logged
5
23
  });
6
- exports.default = deprecated;
7
- exports.logged = void 0;
8
- var _hooks = require("@wordpress/hooks");
9
- /**
10
- * WordPress dependencies
11
- */
12
-
13
- /**
14
- * Object map tracking messages which have been logged, for use in ensuring a
15
- * message is only logged once.
16
- */
17
- const logged = exports.logged = Object.create(null);
18
- /**
19
- * Logs a message to notify developers about a deprecated feature.
20
- *
21
- * @param {string} feature Name of the deprecated feature.
22
- * @param {DeprecatedOptions} [options] Personalisation options
23
- *
24
- * @example
25
- * ```js
26
- * import deprecated from '@wordpress/deprecated';
27
- *
28
- * deprecated( 'Eating meat', {
29
- * since: '2019.01.01',
30
- * version: '2020.01.01',
31
- * alternative: 'vegetables',
32
- * plugin: 'the earth',
33
- * hint: 'You may find it beneficial to transition gradually.',
34
- * } );
35
- *
36
- * // 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.'
37
- * ```
38
- */
24
+ module.exports = __toCommonJS(index_exports);
25
+ var import_hooks = require("@wordpress/hooks");
26
+ const logged = /* @__PURE__ */ Object.create(null);
39
27
  function deprecated(feature, options = {}) {
40
- const {
41
- since,
42
- version,
43
- alternative,
44
- plugin,
45
- link,
46
- hint
47
- } = options;
48
- const pluginMessage = plugin ? ` from ${plugin}` : '';
49
- const sinceMessage = since ? ` since version ${since}` : '';
50
- const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : '';
51
- const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : '';
52
- const linkMessage = link ? ` See: ${link}` : '';
53
- const hintMessage = hint ? ` Note: ${hint}` : '';
28
+ const { since, version, alternative, plugin, link, hint } = options;
29
+ const pluginMessage = plugin ? ` from ${plugin}` : "";
30
+ const sinceMessage = since ? ` since version ${since}` : "";
31
+ const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : "";
32
+ const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : "";
33
+ const linkMessage = link ? ` See: ${link}` : "";
34
+ const hintMessage = hint ? ` Note: ${hint}` : "";
54
35
  const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`;
55
-
56
- // Skip if already logged.
57
36
  if (message in logged) {
58
37
  return;
59
38
  }
60
-
61
- /**
62
- * Fires whenever a deprecated feature is encountered
63
- *
64
- * @param {string} feature Name of the deprecated feature.
65
- * @param {DeprecatedOptions} options Personalisation options
66
- * @param {string} message Message sent to console.warn
67
- */
68
- (0, _hooks.doAction)('deprecated', feature, options, message);
69
-
70
- // eslint-disable-next-line no-console
39
+ (0, import_hooks.doAction)("deprecated", feature, options, message);
71
40
  console.warn(message);
72
41
  logged[message] = true;
73
42
  }
74
- //# sourceMappingURL=index.js.map
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ logged
46
+ });
47
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_hooks","require","logged","exports","Object","create","deprecated","feature","options","since","version","alternative","plugin","link","hint","pluginMessage","sinceMessage","versionMessage","useInsteadMessage","linkMessage","hintMessage","message","doAction","console","warn"],"sources":["@wordpress/deprecated/src/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n */\nexport const logged: Record< string, true > = Object.create( null );\n\ntype DeprecatedOptions = {\n\t/**\n\t * Version in which the feature was deprecated.\n\t */\n\tsince?: string;\n\t/**\n\t * Version in which the feature will be removed.\n\t */\n\tversion?: string;\n\t/**\n\t * Feature to use instead.\n\t */\n\talternative?: string;\n\t/**\n\t * Plugin name if it's a plugin feature.\n\t */\n\tplugin?: string;\n\t/**\n\t * Link to documentation.\n\t */\n\tlink?: string;\n\t/**\n\t * Additional message to help transition away from the deprecated feature.\n\t */\n\thint?: string;\n};\n\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {DeprecatedOptions} [options] Personalisation options\n *\n * @example\n * ```js\n * import deprecated from '@wordpress/deprecated';\n *\n * deprecated( 'Eating meat', {\n * \tsince: '2019.01.01',\n * \tversion: '2020.01.01',\n * \talternative: 'vegetables',\n * \tplugin: 'the earth',\n * \thint: 'You may find it beneficial to transition gradually.',\n * } );\n *\n * // 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.'\n * ```\n */\nexport default function deprecated(\n\tfeature: string,\n\toptions: DeprecatedOptions = {}\n) {\n\tconst { since, version, alternative, plugin, link, hint } = options;\n\n\tconst pluginMessage = plugin ? ` from ${ plugin }` : '';\n\tconst sinceMessage = since ? ` since version ${ since }` : '';\n\tconst versionMessage = version\n\t\t? ` and will be removed${ pluginMessage } in version ${ version }`\n\t\t: '';\n\tconst useInsteadMessage = alternative\n\t\t? ` Please use ${ alternative } instead.`\n\t\t: '';\n\tconst linkMessage = link ? ` See: ${ link }` : '';\n\tconst hintMessage = hint ? ` Note: ${ hint }` : '';\n\tconst message = `${ feature } is deprecated${ sinceMessage }${ versionMessage }.${ useInsteadMessage }${ linkMessage }${ hintMessage }`;\n\n\t// Skip if already logged.\n\tif ( message in logged ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires whenever a deprecated feature is encountered\n\t *\n\t * @param {string} feature Name of the deprecated feature.\n\t * @param {DeprecatedOptions} options Personalisation options\n\t * @param {string} message Message sent to console.warn\n\t */\n\tdoAction( 'deprecated', feature, options, message );\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\tlogged[ message ] = true;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,MAAMC,MAA8B,GAAAC,OAAA,CAAAD,MAAA,GAAGE,MAAM,CAACC,MAAM,CAAE,IAAK,CAAC;AA6BnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,UAAUA,CACjCC,OAAe,EACfC,OAA0B,GAAG,CAAC,CAAC,EAC9B;EACD,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,WAAW;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAGN,OAAO;EAEnE,MAAMO,aAAa,GAAGH,MAAM,GAAG,SAAUA,MAAM,EAAG,GAAG,EAAE;EACvD,MAAMI,YAAY,GAAGP,KAAK,GAAG,kBAAmBA,KAAK,EAAG,GAAG,EAAE;EAC7D,MAAMQ,cAAc,GAAGP,OAAO,GAC3B,uBAAwBK,aAAa,eAAiBL,OAAO,EAAG,GAChE,EAAE;EACL,MAAMQ,iBAAiB,GAAGP,WAAW,GAClC,eAAgBA,WAAW,WAAY,GACvC,EAAE;EACL,MAAMQ,WAAW,GAAGN,IAAI,GAAG,SAAUA,IAAI,EAAG,GAAG,EAAE;EACjD,MAAMO,WAAW,GAAGN,IAAI,GAAG,UAAWA,IAAI,EAAG,GAAG,EAAE;EAClD,MAAMO,OAAO,GAAG,GAAId,OAAO,iBAAmBS,YAAY,GAAKC,cAAc,IAAMC,iBAAiB,GAAKC,WAAW,GAAKC,WAAW,EAAG;;EAEvI;EACA,IAAKC,OAAO,IAAInB,MAAM,EAAG;IACxB;EACD;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;EACC,IAAAoB,eAAQ,EAAE,YAAY,EAAEf,OAAO,EAAEC,OAAO,EAAEa,OAAQ,CAAC;;EAEnD;EACAE,OAAO,CAACC,IAAI,CAAEH,OAAQ,CAAC;EAEvBnB,MAAM,CAAEmB,OAAO,CAAE,GAAG,IAAI;AACzB","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n */\nexport const logged: Record< string, true > = Object.create( null );\n\ntype DeprecatedOptions = {\n\t/**\n\t * Version in which the feature was deprecated.\n\t */\n\tsince?: string;\n\t/**\n\t * Version in which the feature will be removed.\n\t */\n\tversion?: string;\n\t/**\n\t * Feature to use instead.\n\t */\n\talternative?: string;\n\t/**\n\t * Plugin name if it's a plugin feature.\n\t */\n\tplugin?: string;\n\t/**\n\t * Link to documentation.\n\t */\n\tlink?: string;\n\t/**\n\t * Additional message to help transition away from the deprecated feature.\n\t */\n\thint?: string;\n};\n\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {DeprecatedOptions} [options] Personalisation options\n *\n * @example\n * ```js\n * import deprecated from '@wordpress/deprecated';\n *\n * deprecated( 'Eating meat', {\n * \tsince: '2019.01.01',\n * \tversion: '2020.01.01',\n * \talternative: 'vegetables',\n * \tplugin: 'the earth',\n * \thint: 'You may find it beneficial to transition gradually.',\n * } );\n *\n * // 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.'\n * ```\n */\nexport default function deprecated(\n\tfeature: string,\n\toptions: DeprecatedOptions = {}\n) {\n\tconst { since, version, alternative, plugin, link, hint } = options;\n\n\tconst pluginMessage = plugin ? ` from ${ plugin }` : '';\n\tconst sinceMessage = since ? ` since version ${ since }` : '';\n\tconst versionMessage = version\n\t\t? ` and will be removed${ pluginMessage } in version ${ version }`\n\t\t: '';\n\tconst useInsteadMessage = alternative\n\t\t? ` Please use ${ alternative } instead.`\n\t\t: '';\n\tconst linkMessage = link ? ` See: ${ link }` : '';\n\tconst hintMessage = hint ? ` Note: ${ hint }` : '';\n\tconst message = `${ feature } is deprecated${ sinceMessage }${ versionMessage }.${ useInsteadMessage }${ linkMessage }${ hintMessage }`;\n\n\t// Skip if already logged.\n\tif ( message in logged ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires whenever a deprecated feature is encountered\n\t *\n\t * @param {string} feature Name of the deprecated feature.\n\t * @param {DeprecatedOptions} options Personalisation options\n\t * @param {string} message Message sent to console.warn\n\t */\n\tdoAction( 'deprecated', feature, options, message );\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\tlogged[ message ] = true;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAyB;AAMlB,MAAM,SAAiC,uBAAO,OAAQ,IAAK;AAkDnD,SAAR,WACN,SACA,UAA6B,CAAC,GAC7B;AACD,QAAM,EAAE,OAAO,SAAS,aAAa,QAAQ,MAAM,KAAK,IAAI;AAE5D,QAAM,gBAAgB,SAAS,SAAU,MAAO,KAAK;AACrD,QAAM,eAAe,QAAQ,kBAAmB,KAAM,KAAK;AAC3D,QAAM,iBAAiB,UACpB,uBAAwB,aAAc,eAAgB,OAAQ,KAC9D;AACH,QAAM,oBAAoB,cACvB,eAAgB,WAAY,cAC5B;AACH,QAAM,cAAc,OAAO,SAAU,IAAK,KAAK;AAC/C,QAAM,cAAc,OAAO,UAAW,IAAK,KAAK;AAChD,QAAM,UAAU,GAAI,OAAQ,iBAAkB,YAAa,GAAI,cAAe,IAAK,iBAAkB,GAAI,WAAY,GAAI,WAAY;AAGrI,MAAK,WAAW,QAAS;AACxB;AAAA,EACD;AASA,6BAAU,cAAc,SAAS,SAAS,OAAQ;AAGlD,UAAQ,KAAM,OAAQ;AAEtB,SAAQ,OAAQ,IAAI;AACrB;",
6
+ "names": []
7
+ }
@@ -1,67 +1,23 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { doAction } from '@wordpress/hooks';
5
-
6
- /**
7
- * Object map tracking messages which have been logged, for use in ensuring a
8
- * message is only logged once.
9
- */
10
- export const logged = Object.create(null);
11
- /**
12
- * Logs a message to notify developers about a deprecated feature.
13
- *
14
- * @param {string} feature Name of the deprecated feature.
15
- * @param {DeprecatedOptions} [options] Personalisation options
16
- *
17
- * @example
18
- * ```js
19
- * import deprecated from '@wordpress/deprecated';
20
- *
21
- * deprecated( 'Eating meat', {
22
- * since: '2019.01.01',
23
- * version: '2020.01.01',
24
- * alternative: 'vegetables',
25
- * plugin: 'the earth',
26
- * hint: 'You may find it beneficial to transition gradually.',
27
- * } );
28
- *
29
- * // 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.'
30
- * ```
31
- */
32
- export default function deprecated(feature, options = {}) {
33
- const {
34
- since,
35
- version,
36
- alternative,
37
- plugin,
38
- link,
39
- hint
40
- } = options;
41
- const pluginMessage = plugin ? ` from ${plugin}` : '';
42
- const sinceMessage = since ? ` since version ${since}` : '';
43
- const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : '';
44
- const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : '';
45
- const linkMessage = link ? ` See: ${link}` : '';
46
- const hintMessage = hint ? ` Note: ${hint}` : '';
1
+ import { doAction } from "@wordpress/hooks";
2
+ const logged = /* @__PURE__ */ Object.create(null);
3
+ function deprecated(feature, options = {}) {
4
+ const { since, version, alternative, plugin, link, hint } = options;
5
+ const pluginMessage = plugin ? ` from ${plugin}` : "";
6
+ const sinceMessage = since ? ` since version ${since}` : "";
7
+ const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : "";
8
+ const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : "";
9
+ const linkMessage = link ? ` See: ${link}` : "";
10
+ const hintMessage = hint ? ` Note: ${hint}` : "";
47
11
  const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`;
48
-
49
- // Skip if already logged.
50
12
  if (message in logged) {
51
13
  return;
52
14
  }
53
-
54
- /**
55
- * Fires whenever a deprecated feature is encountered
56
- *
57
- * @param {string} feature Name of the deprecated feature.
58
- * @param {DeprecatedOptions} options Personalisation options
59
- * @param {string} message Message sent to console.warn
60
- */
61
- doAction('deprecated', feature, options, message);
62
-
63
- // eslint-disable-next-line no-console
15
+ doAction("deprecated", feature, options, message);
64
16
  console.warn(message);
65
17
  logged[message] = true;
66
18
  }
67
- //# sourceMappingURL=index.js.map
19
+ export {
20
+ deprecated as default,
21
+ logged
22
+ };
23
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["doAction","logged","Object","create","deprecated","feature","options","since","version","alternative","plugin","link","hint","pluginMessage","sinceMessage","versionMessage","useInsteadMessage","linkMessage","hintMessage","message","console","warn"],"sources":["@wordpress/deprecated/src/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n */\nexport const logged: Record< string, true > = Object.create( null );\n\ntype DeprecatedOptions = {\n\t/**\n\t * Version in which the feature was deprecated.\n\t */\n\tsince?: string;\n\t/**\n\t * Version in which the feature will be removed.\n\t */\n\tversion?: string;\n\t/**\n\t * Feature to use instead.\n\t */\n\talternative?: string;\n\t/**\n\t * Plugin name if it's a plugin feature.\n\t */\n\tplugin?: string;\n\t/**\n\t * Link to documentation.\n\t */\n\tlink?: string;\n\t/**\n\t * Additional message to help transition away from the deprecated feature.\n\t */\n\thint?: string;\n};\n\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {DeprecatedOptions} [options] Personalisation options\n *\n * @example\n * ```js\n * import deprecated from '@wordpress/deprecated';\n *\n * deprecated( 'Eating meat', {\n * \tsince: '2019.01.01',\n * \tversion: '2020.01.01',\n * \talternative: 'vegetables',\n * \tplugin: 'the earth',\n * \thint: 'You may find it beneficial to transition gradually.',\n * } );\n *\n * // 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.'\n * ```\n */\nexport default function deprecated(\n\tfeature: string,\n\toptions: DeprecatedOptions = {}\n) {\n\tconst { since, version, alternative, plugin, link, hint } = options;\n\n\tconst pluginMessage = plugin ? ` from ${ plugin }` : '';\n\tconst sinceMessage = since ? ` since version ${ since }` : '';\n\tconst versionMessage = version\n\t\t? ` and will be removed${ pluginMessage } in version ${ version }`\n\t\t: '';\n\tconst useInsteadMessage = alternative\n\t\t? ` Please use ${ alternative } instead.`\n\t\t: '';\n\tconst linkMessage = link ? ` See: ${ link }` : '';\n\tconst hintMessage = hint ? ` Note: ${ hint }` : '';\n\tconst message = `${ feature } is deprecated${ sinceMessage }${ versionMessage }.${ useInsteadMessage }${ linkMessage }${ hintMessage }`;\n\n\t// Skip if already logged.\n\tif ( message in logged ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires whenever a deprecated feature is encountered\n\t *\n\t * @param {string} feature Name of the deprecated feature.\n\t * @param {DeprecatedOptions} options Personalisation options\n\t * @param {string} message Message sent to console.warn\n\t */\n\tdoAction( 'deprecated', feature, options, message );\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\tlogged[ message ] = true;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,kBAAkB;;AAE3C;AACA;AACA;AACA;AACA,OAAO,MAAMC,MAA8B,GAAGC,MAAM,CAACC,MAAM,CAAE,IAAK,CAAC;AA6BnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CACjCC,OAAe,EACfC,OAA0B,GAAG,CAAC,CAAC,EAC9B;EACD,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,WAAW;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAGN,OAAO;EAEnE,MAAMO,aAAa,GAAGH,MAAM,GAAG,SAAUA,MAAM,EAAG,GAAG,EAAE;EACvD,MAAMI,YAAY,GAAGP,KAAK,GAAG,kBAAmBA,KAAK,EAAG,GAAG,EAAE;EAC7D,MAAMQ,cAAc,GAAGP,OAAO,GAC3B,uBAAwBK,aAAa,eAAiBL,OAAO,EAAG,GAChE,EAAE;EACL,MAAMQ,iBAAiB,GAAGP,WAAW,GAClC,eAAgBA,WAAW,WAAY,GACvC,EAAE;EACL,MAAMQ,WAAW,GAAGN,IAAI,GAAG,SAAUA,IAAI,EAAG,GAAG,EAAE;EACjD,MAAMO,WAAW,GAAGN,IAAI,GAAG,UAAWA,IAAI,EAAG,GAAG,EAAE;EAClD,MAAMO,OAAO,GAAG,GAAId,OAAO,iBAAmBS,YAAY,GAAKC,cAAc,IAAMC,iBAAiB,GAAKC,WAAW,GAAKC,WAAW,EAAG;;EAEvI;EACA,IAAKC,OAAO,IAAIlB,MAAM,EAAG;IACxB;EACD;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;EACCD,QAAQ,CAAE,YAAY,EAAEK,OAAO,EAAEC,OAAO,EAAEa,OAAQ,CAAC;;EAEnD;EACAC,OAAO,CAACC,IAAI,CAAEF,OAAQ,CAAC;EAEvBlB,MAAM,CAAEkB,OAAO,CAAE,GAAG,IAAI;AACzB","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Object map tracking messages which have been logged, for use in ensuring a\n * message is only logged once.\n */\nexport const logged: Record< string, true > = Object.create( null );\n\ntype DeprecatedOptions = {\n\t/**\n\t * Version in which the feature was deprecated.\n\t */\n\tsince?: string;\n\t/**\n\t * Version in which the feature will be removed.\n\t */\n\tversion?: string;\n\t/**\n\t * Feature to use instead.\n\t */\n\talternative?: string;\n\t/**\n\t * Plugin name if it's a plugin feature.\n\t */\n\tplugin?: string;\n\t/**\n\t * Link to documentation.\n\t */\n\tlink?: string;\n\t/**\n\t * Additional message to help transition away from the deprecated feature.\n\t */\n\thint?: string;\n};\n\n/**\n * Logs a message to notify developers about a deprecated feature.\n *\n * @param {string} feature Name of the deprecated feature.\n * @param {DeprecatedOptions} [options] Personalisation options\n *\n * @example\n * ```js\n * import deprecated from '@wordpress/deprecated';\n *\n * deprecated( 'Eating meat', {\n * \tsince: '2019.01.01',\n * \tversion: '2020.01.01',\n * \talternative: 'vegetables',\n * \tplugin: 'the earth',\n * \thint: 'You may find it beneficial to transition gradually.',\n * } );\n *\n * // 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.'\n * ```\n */\nexport default function deprecated(\n\tfeature: string,\n\toptions: DeprecatedOptions = {}\n) {\n\tconst { since, version, alternative, plugin, link, hint } = options;\n\n\tconst pluginMessage = plugin ? ` from ${ plugin }` : '';\n\tconst sinceMessage = since ? ` since version ${ since }` : '';\n\tconst versionMessage = version\n\t\t? ` and will be removed${ pluginMessage } in version ${ version }`\n\t\t: '';\n\tconst useInsteadMessage = alternative\n\t\t? ` Please use ${ alternative } instead.`\n\t\t: '';\n\tconst linkMessage = link ? ` See: ${ link }` : '';\n\tconst hintMessage = hint ? ` Note: ${ hint }` : '';\n\tconst message = `${ feature } is deprecated${ sinceMessage }${ versionMessage }.${ useInsteadMessage }${ linkMessage }${ hintMessage }`;\n\n\t// Skip if already logged.\n\tif ( message in logged ) {\n\t\treturn;\n\t}\n\n\t/**\n\t * Fires whenever a deprecated feature is encountered\n\t *\n\t * @param {string} feature Name of the deprecated feature.\n\t * @param {DeprecatedOptions} options Personalisation options\n\t * @param {string} message Message sent to console.warn\n\t */\n\tdoAction( 'deprecated', feature, options, message );\n\n\t// eslint-disable-next-line no-console\n\tconsole.warn( message );\n\n\tlogged[ message ] = true;\n}\n"],
5
+ "mappings": "AAGA,SAAS,gBAAgB;AAMlB,MAAM,SAAiC,uBAAO,OAAQ,IAAK;AAkDnD,SAAR,WACN,SACA,UAA6B,CAAC,GAC7B;AACD,QAAM,EAAE,OAAO,SAAS,aAAa,QAAQ,MAAM,KAAK,IAAI;AAE5D,QAAM,gBAAgB,SAAS,SAAU,MAAO,KAAK;AACrD,QAAM,eAAe,QAAQ,kBAAmB,KAAM,KAAK;AAC3D,QAAM,iBAAiB,UACpB,uBAAwB,aAAc,eAAgB,OAAQ,KAC9D;AACH,QAAM,oBAAoB,cACvB,eAAgB,WAAY,cAC5B;AACH,QAAM,cAAc,OAAO,SAAU,IAAK,KAAK;AAC/C,QAAM,cAAc,OAAO,UAAW,IAAK,KAAK;AAChD,QAAM,UAAU,GAAI,OAAQ,iBAAkB,YAAa,GAAI,cAAe,IAAK,iBAAkB,GAAI,WAAY,GAAI,WAAY;AAGrI,MAAK,WAAW,QAAS;AACxB;AAAA,EACD;AASA,WAAU,cAAc,SAAS,SAAS,OAAQ;AAGlD,UAAQ,KAAM,OAAQ;AAEtB,SAAQ,OAAQ,IAAI;AACrB;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/deprecated",
3
- "version": "4.31.1-next.f56bd8138.0",
3
+ "version": "4.32.1-next.47f435fc9.0",
4
4
  "description": "Deprecation utility for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -24,16 +24,24 @@
24
24
  },
25
25
  "main": "build/index.js",
26
26
  "module": "build-module/index.js",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./build-types/index.d.ts",
30
+ "import": "./build-module/index.js",
31
+ "require": "./build/index.js"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
27
35
  "react-native": "src/index",
28
36
  "wpScript": true,
37
+ "wpScriptDefaultExport": true,
29
38
  "types": "build-types",
30
39
  "sideEffects": false,
31
40
  "dependencies": {
32
- "@babel/runtime": "7.25.7",
33
- "@wordpress/hooks": "^4.31.1-next.f56bd8138.0"
41
+ "@wordpress/hooks": "^4.32.1-next.47f435fc9.0"
34
42
  },
35
43
  "publishConfig": {
36
44
  "access": "public"
37
45
  },
38
- "gitHead": "ea4a281fd857f48338877590de8c8eb9b9a8cef4"
46
+ "gitHead": "9720f22c138771d2ed1a0522725c3cdf1c242953"
39
47
  }