wp/wp-includes/js/dist/hooks.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
--- a/wp/wp-includes/js/dist/hooks.js	Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/js/dist/hooks.js	Tue Sep 27 16:37:53 2022 +0200
@@ -1,129 +1,74 @@
-this["wp"] = this["wp"] || {}; this["wp"]["hooks"] =
-/******/ (function(modules) { // webpackBootstrap
-/******/ 	// The module cache
-/******/ 	var installedModules = {};
-/******/
-/******/ 	// The require function
-/******/ 	function __webpack_require__(moduleId) {
-/******/
-/******/ 		// Check if module is in cache
-/******/ 		if(installedModules[moduleId]) {
-/******/ 			return installedModules[moduleId].exports;
-/******/ 		}
-/******/ 		// Create a new module (and put it into the cache)
-/******/ 		var module = installedModules[moduleId] = {
-/******/ 			i: moduleId,
-/******/ 			l: false,
-/******/ 			exports: {}
+/******/ (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] });
+/******/ 				}
+/******/ 			}
 /******/ 		};
-/******/
-/******/ 		// Execute the module function
-/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ 		// Flag the module as loaded
-/******/ 		module.l = true;
-/******/
-/******/ 		// Return the exports of the module
-/******/ 		return module.exports;
-/******/ 	}
-/******/
-/******/
-/******/ 	// expose the modules object (__webpack_modules__)
-/******/ 	__webpack_require__.m = modules;
-/******/
-/******/ 	// expose the module cache
-/******/ 	__webpack_require__.c = installedModules;
-/******/
-/******/ 	// define getter function for harmony exports
-/******/ 	__webpack_require__.d = function(exports, name, getter) {
-/******/ 		if(!__webpack_require__.o(exports, name)) {
-/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
-/******/ 		}
-/******/ 	};
-/******/
-/******/ 	// 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 });
-/******/ 	};
-/******/
-/******/ 	// create a fake namespace object
-/******/ 	// mode & 1: value is a module id, require it
-/******/ 	// mode & 2: merge all properties of value into the ns
-/******/ 	// mode & 4: return value when already ns object
-/******/ 	// mode & 8|1: behave like require
-/******/ 	__webpack_require__.t = function(value, mode) {
-/******/ 		if(mode & 1) value = __webpack_require__(value);
-/******/ 		if(mode & 8) return value;
-/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
-/******/ 		var ns = Object.create(null);
-/******/ 		__webpack_require__.r(ns);
-/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
-/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
-/******/ 		return ns;
-/******/ 	};
-/******/
-/******/ 	// getDefaultExport function for compatibility with non-harmony modules
-/******/ 	__webpack_require__.n = function(module) {
-/******/ 		var getter = module && module.__esModule ?
-/******/ 			function getDefault() { return module['default']; } :
-/******/ 			function getModuleExports() { return module; };
-/******/ 		__webpack_require__.d(getter, 'a', getter);
-/******/ 		return getter;
-/******/ 	};
-/******/
-/******/ 	// Object.prototype.hasOwnProperty.call
-/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ 	// __webpack_public_path__
-/******/ 	__webpack_require__.p = "";
-/******/
-/******/
-/******/ 	// Load entry module and return exports
-/******/ 	return __webpack_require__(__webpack_require__.s = "gEOj");
-/******/ })
+/******/ 	}();
+/******/ 	
+/******/ 	/* 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 });
+/******/ 		};
+/******/ 	}();
+/******/ 	
 /************************************************************************/
-/******/ ({
-
-/***/ "gEOj":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
+var __webpack_exports__ = {};
 // ESM COMPAT FLAG
 __webpack_require__.r(__webpack_exports__);
 
 // EXPORTS
-__webpack_require__.d(__webpack_exports__, "defaultHooks", function() { return /* binding */ defaultHooks; });
-__webpack_require__.d(__webpack_exports__, "createHooks", function() { return /* reexport */ build_module_createHooks; });
-__webpack_require__.d(__webpack_exports__, "addAction", function() { return /* binding */ addAction; });
-__webpack_require__.d(__webpack_exports__, "addFilter", function() { return /* binding */ addFilter; });
-__webpack_require__.d(__webpack_exports__, "removeAction", function() { return /* binding */ removeAction; });
-__webpack_require__.d(__webpack_exports__, "removeFilter", function() { return /* binding */ removeFilter; });
-__webpack_require__.d(__webpack_exports__, "hasAction", function() { return /* binding */ hasAction; });
-__webpack_require__.d(__webpack_exports__, "hasFilter", function() { return /* binding */ hasFilter; });
-__webpack_require__.d(__webpack_exports__, "removeAllActions", function() { return /* binding */ removeAllActions; });
-__webpack_require__.d(__webpack_exports__, "removeAllFilters", function() { return /* binding */ removeAllFilters; });
-__webpack_require__.d(__webpack_exports__, "doAction", function() { return /* binding */ doAction; });
-__webpack_require__.d(__webpack_exports__, "applyFilters", function() { return /* binding */ applyFilters; });
-__webpack_require__.d(__webpack_exports__, "currentAction", function() { return /* binding */ currentAction; });
-__webpack_require__.d(__webpack_exports__, "currentFilter", function() { return /* binding */ currentFilter; });
-__webpack_require__.d(__webpack_exports__, "doingAction", function() { return /* binding */ doingAction; });
-__webpack_require__.d(__webpack_exports__, "doingFilter", function() { return /* binding */ doingFilter; });
-__webpack_require__.d(__webpack_exports__, "didAction", function() { return /* binding */ didAction; });
-__webpack_require__.d(__webpack_exports__, "didFilter", function() { return /* binding */ didFilter; });
-__webpack_require__.d(__webpack_exports__, "actions", function() { return /* binding */ actions; });
-__webpack_require__.d(__webpack_exports__, "filters", function() { return /* binding */ filters; });
+__webpack_require__.d(__webpack_exports__, {
+  "actions": function() { return /* binding */ actions; },
+  "addAction": function() { return /* binding */ addAction; },
+  "addFilter": function() { return /* binding */ addFilter; },
+  "applyFilters": function() { return /* binding */ applyFilters; },
+  "createHooks": function() { return /* reexport */ build_module_createHooks; },
+  "currentAction": function() { return /* binding */ currentAction; },
+  "currentFilter": function() { return /* binding */ currentFilter; },
+  "defaultHooks": function() { return /* binding */ defaultHooks; },
+  "didAction": function() { return /* binding */ didAction; },
+  "didFilter": function() { return /* binding */ didFilter; },
+  "doAction": function() { return /* binding */ doAction; },
+  "doingAction": function() { return /* binding */ doingAction; },
+  "doingFilter": function() { return /* binding */ doingFilter; },
+  "filters": function() { return /* binding */ filters; },
+  "hasAction": function() { return /* binding */ hasAction; },
+  "hasFilter": function() { return /* binding */ hasFilter; },
+  "removeAction": function() { return /* binding */ removeAction; },
+  "removeAllActions": function() { return /* binding */ removeAllActions; },
+  "removeAllFilters": function() { return /* binding */ removeAllFilters; },
+  "removeFilter": function() { return /* binding */ removeFilter; }
+});
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/validateNamespace.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/validateNamespace.js
 /**
  * Validate a namespace string.
  *
- * @param  {string} namespace The namespace to validate - should take the form
- *                            `vendor/plugin/function`.
+ * @param {string} namespace The namespace to validate - should take the form
+ *                           `vendor/plugin/function`.
  *
- * @return {boolean}             Whether the namespace is valid.
+ * @return {boolean} Whether the namespace is valid.
  */
 function validateNamespace(namespace) {
   if ('string' !== typeof namespace || '' === namespace) {
@@ -143,15 +88,15 @@
 
 /* harmony default export */ var build_module_validateNamespace = (validateNamespace);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/validateHookName.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/validateHookName.js
 /**
  * Validate a hookName string.
  *
- * @param  {string} hookName The hook name to validate. Should be a non empty string containing
- *                           only numbers, letters, dashes, periods and underscores. Also,
- *                           the hook name cannot begin with `__`.
+ * @param {string} hookName The hook name to validate. Should be a non empty string containing
+ *                          only numbers, letters, dashes, periods and underscores. Also,
+ *                          the hook name cannot begin with `__`.
  *
- * @return {boolean}            Whether the hook name is valid.
+ * @return {boolean} Whether the hook name is valid.
  */
 function validateHookName(hookName) {
   if ('string' !== typeof hookName || '' === hookName) {
@@ -177,7 +122,7 @@
 
 /* harmony default export */ var build_module_validateHookName = (validateHookName);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createAddHook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createAddHook.js
 /**
  * Internal dependencies
  */
@@ -188,23 +133,24 @@
  *
  * Adds the hook to the appropriate hooks container.
  *
- * @param {string}               hookName  Name of hook to add
- * @param {string}               namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.
- * @param {import('.').Callback} callback  Function to call when the hook is run
- * @param {number}               [priority=10]  Priority of this hook
+ * @param {string}               hookName      Name of hook to add
+ * @param {string}               namespace     The unique namespace identifying the callback in the form `vendor/plugin/function`.
+ * @param {import('.').Callback} callback      Function to call when the hook is run
+ * @param {number}               [priority=10] Priority of this hook
  */
 
 /**
  * Returns a function which, when invoked, will add a hook.
  *
- * @param  {import('.').Hooks}    hooks Hooks instance.
- * @param  {import('.').StoreKey} storeKey
+ * @param {import('.').Hooks}    hooks    Hooks instance.
+ * @param {import('.').StoreKey} storeKey
  *
  * @return {AddHook} Function that adds a new hook.
  */
 
 function createAddHook(hooks, storeKey) {
-  return function addHook(hookName, namespace, callback, priority = 10) {
+  return function addHook(hookName, namespace, callback) {
+    let priority = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;
     const hooksStore = hooks[storeKey];
 
     if (!build_module_validateHookName(hookName)) {
@@ -280,7 +226,7 @@
 
 /* harmony default export */ var build_module_createAddHook = (createAddHook);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createRemoveHook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createRemoveHook.js
 /**
  * Internal dependencies
  */
@@ -302,16 +248,17 @@
  * Returns a function which, when invoked, will remove a specified hook or all
  * hooks by the given name.
  *
- * @param  {import('.').Hooks}    hooks Hooks instance.
- * @param  {import('.').StoreKey} storeKey
- * @param  {boolean}              [removeAll=false] Whether to remove all callbacks for a hookName,
- *                                                  without regard to namespace. Used to create
- *                                                  `removeAll*` functions.
+ * @param {import('.').Hooks}    hooks             Hooks instance.
+ * @param {import('.').StoreKey} storeKey
+ * @param {boolean}              [removeAll=false] Whether to remove all callbacks for a hookName,
+ *                                                 without regard to namespace. Used to create
+ *                                                 `removeAll*` functions.
  *
  * @return {RemoveHook} Function that removes hooks.
  */
 
-function createRemoveHook(hooks, storeKey, removeAll = false) {
+function createRemoveHook(hooks, storeKey) {
+  let removeAll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
   return function removeHook(hookName, namespace) {
     const hooksStore = hooks[storeKey];
 
@@ -321,7 +268,7 @@
 
     if (!removeAll && !build_module_validateNamespace(namespace)) {
       return;
-    } // Bail if no hooks exist by this name
+    } // Bail if no hooks exist by this name.
 
 
     if (!hooksStore[hookName]) {
@@ -368,7 +315,7 @@
 
 /* harmony default export */ var build_module_createRemoveHook = (createRemoveHook);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createHasHook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createHasHook.js
 /**
  * @callback HasHook
  *
@@ -385,8 +332,8 @@
  * Returns a function which, when invoked, will return whether any handlers are
  * attached to a particular hook.
  *
- * @param  {import('.').Hooks}    hooks Hooks instance.
- * @param  {import('.').StoreKey} storeKey
+ * @param {import('.').Hooks}    hooks    Hooks instance.
+ * @param {import('.').StoreKey} storeKey
  *
  * @return {HasHook} Function that returns whether any handlers are
  *                   attached to a particular hook and optional namespace.
@@ -405,21 +352,22 @@
 
 /* harmony default export */ var build_module_createHasHook = (createHasHook);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createRunHook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createRunHook.js
 /**
  * Returns a function which, when invoked, will execute all callbacks
  * registered to a hook of the specified type, optionally returning the final
  * value of the call chain.
  *
- * @param  {import('.').Hooks}    hooks Hooks instance.
- * @param  {import('.').StoreKey} storeKey
- * @param  {boolean}              [returnFirstArg=false] Whether each hook callback is expected to
- *                                                       return its first argument.
+ * @param {import('.').Hooks}    hooks                  Hooks instance.
+ * @param {import('.').StoreKey} storeKey
+ * @param {boolean}              [returnFirstArg=false] Whether each hook callback is expected to
+ *                                                      return its first argument.
  *
  * @return {(hookName:string, ...args: unknown[]) => unknown} Function that runs hook callbacks.
  */
-function createRunHook(hooks, storeKey, returnFirstArg = false) {
-  return function runHooks(hookName, ...args) {
+function createRunHook(hooks, storeKey) {
+  let returnFirstArg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
+  return function runHooks(hookName) {
     const hooksStore = hooks[storeKey];
 
     if (!hooksStore[hookName]) {
@@ -434,6 +382,10 @@
 
     if (false) {}
 
+    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+      args[_key - 1] = arguments[_key];
+    }
+
     if (!handlers || !handlers.length) {
       return returnFirstArg ? args[0] : undefined;
     }
@@ -466,14 +418,14 @@
 
 /* harmony default export */ var build_module_createRunHook = (createRunHook);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createCurrentHook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createCurrentHook.js
 /**
  * Returns a function which, when invoked, will return the name of the
  * currently running hook, or `null` if no hook of the given type is currently
  * running.
  *
- * @param  {import('.').Hooks}    hooks Hooks instance.
- * @param  {import('.').StoreKey} storeKey
+ * @param {import('.').Hooks}    hooks    Hooks instance.
+ * @param {import('.').StoreKey} storeKey
  *
  * @return {() => string | null} Function that returns the current hook name or null.
  */
@@ -488,13 +440,13 @@
 
 /* harmony default export */ var build_module_createCurrentHook = (createCurrentHook);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createDoingHook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createDoingHook.js
 /**
  * @callback DoingHook
  * Returns whether a hook is currently being executed.
  *
- * @param  {string} [hookName] The name of the hook to check for.  If
- *                             omitted, will check for any hook being executed.
+ * @param {string} [hookName] The name of the hook to check for.  If
+ *                            omitted, will check for any hook being executed.
  *
  * @return {boolean} Whether the hook is being executed.
  */
@@ -503,8 +455,8 @@
  * Returns a function which, when invoked, will return whether a hook is
  * currently being executed.
  *
- * @param  {import('.').Hooks}    hooks Hooks instance.
- * @param  {import('.').StoreKey} storeKey
+ * @param {import('.').Hooks}    hooks    Hooks instance.
+ * @param {import('.').StoreKey} storeKey
  *
  * @return {DoingHook} Function that returns whether a hook is currently
  *                     being executed.
@@ -524,7 +476,7 @@
 
 /* harmony default export */ var build_module_createDoingHook = (createDoingHook);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createDidHook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createDidHook.js
 /**
  * Internal dependencies
  */
@@ -534,7 +486,7 @@
  *
  * Returns the number of times an action has been fired.
  *
- * @param  {string} hookName The hook name to check.
+ * @param {string} hookName The hook name to check.
  *
  * @return {number | undefined} The number of times the hook has run.
  */
@@ -543,8 +495,8 @@
  * Returns a function which, when invoked, will return the number of times a
  * hook has been called.
  *
- * @param  {import('.').Hooks}    hooks Hooks instance.
- * @param  {import('.').StoreKey} storeKey
+ * @param {import('.').Hooks}    hooks    Hooks instance.
+ * @param {import('.').StoreKey} storeKey
  *
  * @return {DidHook} Function that returns a hook's call count.
  */
@@ -563,7 +515,7 @@
 
 /* harmony default export */ var build_module_createDidHook = (createDidHook);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createHooks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createHooks.js
 /**
  * Internal dependencies
  */
@@ -582,7 +534,7 @@
  * @private
  */
 
-class createHooks_Hooks {
+class _Hooks {
   constructor() {
     /** @type {import('.').Store} actions */
     this.actions = Object.create(null);
@@ -619,12 +571,12 @@
  */
 
 function createHooks() {
-  return new createHooks_Hooks();
+  return new _Hooks();
 }
 
 /* harmony default export */ var build_module_createHooks = (createHooks);
 
-// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/index.js
 /**
  * Internal dependencies
  */
@@ -685,7 +637,6 @@
 } = defaultHooks;
 
 
-
-/***/ })
-
-/******/ });
\ No newline at end of file
+(window.wp = window.wp || {}).hooks = __webpack_exports__;
+/******/ })()
+;
\ No newline at end of file