PluginProbe
Gutenberg / 22.9.0
Gutenberg v22.9.0
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / build / scripts / deprecated / index.js

index.js in Gutenberg 22.9.0, at build/scripts/deprecated/index.js

70 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";
2 var wp;
3 (wp ||= {}).deprecated = (() => {
4 var __create = Object.create;
5 var __defProp = Object.defineProperty;
6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7 var __getOwnPropNames = Object.getOwnPropertyNames;
8 var __getProtoOf = Object.getPrototypeOf;
9 var __hasOwnProp = Object.prototype.hasOwnProperty;
10 var __commonJS = (cb, mod) => function __require() {
11 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12 };
13 var __export = (target, all) => {
14 for (var name in all)
15 __defProp(target, name, { get: all[name], enumerable: true });
16 };
17 var __copyProps = (to, from, except, desc) => {
18 if (from && typeof from === "object" || typeof from === "function") {
19 for (let key of __getOwnPropNames(from))
20 if (!__hasOwnProp.call(to, key) && key !== except)
21 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22 }
23 return to;
24 };
25 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26 // If the importer is in node compatibility mode or this is not an ESM
27 // file that has been converted to a CommonJS file using a Babel-
28 // compatible transform (i.e. "__esModule" has not been set), then set
29 // "default" to the CommonJS "module.exports" for node compatibility.
30 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31 mod
32 ));
33 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
35 // package-external:@wordpress/hooks
36 var require_hooks = __commonJS({
37 "package-external:@wordpress/hooks"(exports, module) {
38 module.exports = window.wp.hooks;
39 }
40 });
41
42 // packages/deprecated/build-module/index.mjs
43 var index_exports = {};
44 __export(index_exports, {
45 default: () => deprecated,
46 logged: () => logged
47 });
48 var import_hooks = __toESM(require_hooks(), 1);
49 var logged = /* @__PURE__ */ Object.create(null);
50 function deprecated(feature, options = {}) {
51 const { since, version, alternative, plugin, link, hint } = options;
52 const pluginMessage = plugin ? ` from ${plugin}` : "";
53 const sinceMessage = since ? ` since version ${since}` : "";
54 const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : "";
55 const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : "";
56 const linkMessage = link ? ` See: ${link}` : "";
57 const hintMessage = hint ? ` Note: ${hint}` : "";
58 const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`;
59 if (message in logged) {
60 return;
61 }
62 (0, import_hooks.doAction)("deprecated", feature, options, message);
63 console.warn(message);
64 logged[message] = true;
65 }
66 return __toCommonJS(index_exports);
67 })();
68 if (typeof wp.deprecated === 'object' && wp.deprecated.default) { wp.deprecated = wp.deprecated.default; }
69 //# sourceMappingURL=index.js.map
70