WordPress/wp-includes/js/dist/hooks.js.map

1 line
27 KiB
Plaintext

{"version":3,"sources":["webpack://wp.[name]/webpack/bootstrap","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/createAddHook.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/createCurrentHook.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/createDidHook.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/createDoingHook.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/createHasHook.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/createHooks.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/createRemoveHook.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/createRunHook.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/index.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/validateHookName.js","webpack://wp.[name]//Users/robert/projects/gutenberg/packages/hooks/src/validateNamespace.js"],"names":["createAddHook","hooks","addHook","hookName","namespace","callback","priority","validateHookName","validateNamespace","console","error","handler","handlers","i","length","splice","__current","forEach","hookInfo","name","currentIndex","runs","doAction","createCurrentHook","currentHook","createDidHook","didHook","createDoingHook","doingHook","createHasHook","hasHook","createHooks","actions","Object","create","filters","addAction","addFilter","removeAction","createRemoveHook","removeFilter","hasAction","hasFilter","removeAllActions","removeAllFilters","createRunHook","applyFilters","currentAction","currentFilter","doingAction","doingFilter","didAction","didFilter","removeAll","removeHook","handlersRemoved","returnFirstArg","runHooks","args","undefined","push","result","apply","pop","test"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AAC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AA;;;;;;;;AAQA,SAASC,iBAAT,CAA4BJ,SAA5B,EAAwC;AACvC,MAAK,aAAa,OAAOA,SAApB,IAAiC,OAAOA,SAA7C,EAAyD;AACxD;AACAK,WAAO,CAACC,KAAR,CAAe,2CAAf;AACA,WAAO,KAAP;AACA;;AAED,MAAK,CAAE,+BAA+BsD,IAA/B,CAAqC5D,SAArC,CAAP,EAA0D;AACzD;AACAK,WAAO,CAACC,KAAR,CAAe,4FAAf;AACA,WAAO,KAAP;AACA;;AAED,SAAO,IAAP;AACA;;AAEcF,gFAAf","file":"hooks.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./node_modules/@wordpress/hooks/build-module/index.js\");\n","import validateNamespace from './validateNamespace.js';\nimport validateHookName from './validateHookName.js';\nimport { doAction } from './';\n\n/**\n * Returns a function which, when invoked, will add a hook.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that adds a new hook.\n */\nfunction createAddHook( hooks ) {\n\t/**\n\t * Adds the hook to the appropriate hooks container.\n\t *\n\t * @param {string} hookName Name of hook to add\n\t * @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.\n\t * @param {Function} callback Function to call when the hook is run\n\t * @param {?number} priority Priority of this hook (default=10)\n\t */\n\treturn function addHook( hookName, namespace, callback, priority = 10 ) {\n\t\tif ( ! validateHookName( hookName ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! validateNamespace( namespace ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'function' !== typeof callback ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( 'The hook callback must be a function.' );\n\t\t\treturn;\n\t\t}\n\n\t\t// Validate numeric priority\n\t\tif ( 'number' !== typeof priority ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( 'If specified, the hook priority must be a number.' );\n\t\t\treturn;\n\t\t}\n\n\t\tconst handler = { callback, priority, namespace };\n\n\t\tif ( hooks[ hookName ] ) {\n\t\t\t// Find the correct insert index of the new hook.\n\t\t\tconst handlers = hooks[ hookName ].handlers;\n\t\t\tlet i = 0;\n\t\t\twhile ( i < handlers.length ) {\n\t\t\t\tif ( handlers[ i ].priority > priority ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t// Insert (or append) the new hook.\n\t\t\thandlers.splice( i, 0, handler );\n\t\t\t// We may also be currently executing this hook. If the callback\n\t\t\t// we're adding would come after the current callback, there's no\n\t\t\t// problem; otherwise we need to increase the execution index of\n\t\t\t// any other runs by 1 to account for the added element.\n\t\t\t( hooks.__current || [] ).forEach( ( hookInfo ) => {\n\t\t\t\tif ( hookInfo.name === hookName && hookInfo.currentIndex >= i ) {\n\t\t\t\t\thookInfo.currentIndex++;\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\t// This is the first hook of its type.\n\t\t\thooks[ hookName ] = {\n\t\t\t\thandlers: [ handler ],\n\t\t\t\truns: 0,\n\t\t\t};\n\t\t}\n\n\t\tif ( hookName !== 'hookAdded' ) {\n\t\t\tdoAction( 'hookAdded', hookName, namespace, callback, priority );\n\t\t}\n\t};\n}\n\nexport default createAddHook;\n","/**\n * Returns a function which, when invoked, will return the name of the\n * currently running hook, or `null` if no hook of the given type is currently\n * running.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that returns the current hook.\n */\nfunction createCurrentHook( hooks ) {\n\t/**\n\t * Returns the name of the currently running hook, or `null` if no hook of\n\t * the given type is currently running.\n\t *\n\t * @return {?string} The name of the currently running hook, or\n\t * `null` if no hook is currently running.\n\t */\n\treturn function currentHook() {\n\t\tif ( ! hooks.__current || ! hooks.__current.length ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn hooks.__current[ hooks.__current.length - 1 ].name;\n\t};\n}\n\nexport default createCurrentHook;\n","import validateHookName from './validateHookName.js';\n\n/**\n * Returns a function which, when invoked, will return the number of times a\n * hook has been called.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that returns a hook's call count.\n */\nfunction createDidHook( hooks ) {\n\t/**\n\t * Returns the number of times an action has been fired.\n\t *\n\t * @param {string} hookName The hook name to check.\n\t *\n\t * @return {number} The number of times the hook has run.\n\t */\n\treturn function didHook( hookName ) {\n\t\tif ( ! validateHookName( hookName ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn hooks[ hookName ] && hooks[ hookName ].runs ?\n\t\t\thooks[ hookName ].runs :\n\t\t\t0;\n\t};\n}\n\nexport default createDidHook;\n","/**\n * Returns a function which, when invoked, will return whether a hook is\n * currently being executed.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that returns whether a hook is currently\n * being executed.\n */\nfunction createDoingHook( hooks ) {\n\t/**\n\t * Returns whether a hook is currently being executed.\n\t *\n\t * @param {?string} hookName The name of the hook to check for. If\n\t * omitted, will check for any hook being executed.\n\t *\n\t * @return {boolean} Whether the hook is being executed.\n\t */\n\treturn function doingHook( hookName ) {\n\t\t// If the hookName was not passed, check for any current hook.\n\t\tif ( 'undefined' === typeof hookName ) {\n\t\t\treturn 'undefined' !== typeof hooks.__current[ 0 ];\n\t\t}\n\n\t\t// Return the __current hook.\n\t\treturn hooks.__current[ 0 ] ?\n\t\t\thookName === hooks.__current[ 0 ].name :\n\t\t\tfalse;\n\t};\n}\n\nexport default createDoingHook;\n","/**\n * Returns a function which, when invoked, will return whether any handlers are\n * attached to a particular hook.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n *\n * @return {Function} Function that returns whether any handlers are\n * attached to a particular hook.\n */\nfunction createHasHook( hooks ) {\n\t/**\n\t * Returns how many handlers are attached for the given hook.\n\t *\n\t * @param {string} hookName The name of the hook to check for.\n\t *\n\t * @return {boolean} Whether there are handlers that are attached to the given hook.\n\t */\n\treturn function hasHook( hookName ) {\n\t\treturn hookName in hooks;\n\t};\n}\n\nexport default createHasHook;\n","import createAddHook from './createAddHook';\nimport createRemoveHook from './createRemoveHook';\nimport createHasHook from './createHasHook';\nimport createRunHook from './createRunHook';\nimport createCurrentHook from './createCurrentHook';\nimport createDoingHook from './createDoingHook';\nimport createDidHook from './createDidHook';\n\n/**\n * Returns an instance of the hooks object.\n *\n * @return {Object} Object that contains all hooks.\n */\nfunction createHooks() {\n\tconst actions = Object.create( null );\n\tconst filters = Object.create( null );\n\tactions.__current = [];\n\tfilters.__current = [];\n\n\treturn {\n\t\taddAction: createAddHook( actions ),\n\t\taddFilter: createAddHook( filters ),\n\t\tremoveAction: createRemoveHook( actions ),\n\t\tremoveFilter: createRemoveHook( filters ),\n\t\thasAction: createHasHook( actions ),\n\t\thasFilter: createHasHook( filters ),\n\t\tremoveAllActions: createRemoveHook( actions, true ),\n\t\tremoveAllFilters: createRemoveHook( filters, true ),\n\t\tdoAction: createRunHook( actions ),\n\t\tapplyFilters: createRunHook( filters, true ),\n\t\tcurrentAction: createCurrentHook( actions ),\n\t\tcurrentFilter: createCurrentHook( filters ),\n\t\tdoingAction: createDoingHook( actions ),\n\t\tdoingFilter: createDoingHook( filters ),\n\t\tdidAction: createDidHook( actions ),\n\t\tdidFilter: createDidHook( filters ),\n\t\tactions: actions,\n\t\tfilters: filters,\n\t};\n}\n\nexport default createHooks;\n","import validateNamespace from './validateNamespace.js';\nimport validateHookName from './validateHookName.js';\nimport { doAction } from './';\n\n/**\n * Returns a function which, when invoked, will remove a specified hook or all\n * hooks by the given name.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n * @param {boolean} removeAll Whether to remove all callbacks for a hookName, without regard to namespace. Used to create `removeAll*` functions.\n *\n * @return {Function} Function that removes hooks.\n */\nfunction createRemoveHook( hooks, removeAll ) {\n\t/**\n\t * Removes the specified callback (or all callbacks) from the hook with a\n\t * given hookName and namespace.\n\t *\n\t * @param {string} hookName The name of the hook to modify.\n\t * @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`.\n\t *\n\t * @return {number} The number of callbacks removed.\n\t */\n\treturn function removeHook( hookName, namespace ) {\n\t\tif ( ! validateHookName( hookName ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! removeAll && ! validateNamespace( namespace ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if no hooks exist by this name\n\t\tif ( ! hooks[ hookName ] ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tlet handlersRemoved = 0;\n\n\t\tif ( removeAll ) {\n\t\t\thandlersRemoved = hooks[ hookName ].handlers.length;\n\t\t\thooks[ hookName ] = {\n\t\t\t\truns: hooks[ hookName ].runs,\n\t\t\t\thandlers: [],\n\t\t\t};\n\t\t} else {\n\t\t\t// Try to find the specified callback to remove.\n\t\t\tconst handlers = hooks[ hookName ].handlers;\n\t\t\tfor ( let i = handlers.length - 1; i >= 0; i-- ) {\n\t\t\t\tif (\n\t\t\t\t\thandlers[ i ].namespace === namespace\n\t\t\t\t) {\n\t\t\t\t\thandlers.splice( i, 1 );\n\t\t\t\t\thandlersRemoved++;\n\t\t\t\t\t// This callback may also be part of a hook that is\n\t\t\t\t\t// currently executing. If the callback we're removing\n\t\t\t\t\t// comes after the current callback, there's no problem;\n\t\t\t\t\t// otherwise we need to decrease the execution index of any\n\t\t\t\t\t// other runs by 1 to account for the removed element.\n\t\t\t\t\t( hooks.__current || [] ).forEach( ( hookInfo ) => {\n\t\t\t\t\t\tif ( hookInfo.name === hookName && hookInfo.currentIndex >= i ) {\n\t\t\t\t\t\t\thookInfo.currentIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ( hookName !== 'hookRemoved' ) {\n\t\t\tdoAction( 'hookRemoved', hookName, namespace );\n\t\t}\n\n\t\treturn handlersRemoved;\n\t};\n}\n\nexport default createRemoveHook;\n","/**\n * Returns a function which, when invoked, will execute all callbacks\n * registered to a hook of the specified type, optionally returning the final\n * value of the call chain.\n *\n * @param {Object} hooks Stored hooks, keyed by hook name.\n * @param {?boolean} returnFirstArg Whether each hook callback is expected to\n * return its first argument.\n *\n * @return {Function} Function that runs hook callbacks.\n */\nfunction createRunHook( hooks, returnFirstArg ) {\n\t/**\n\t * Runs all callbacks for the specified hook.\n\t *\n\t * @param {string} hookName The name of the hook to run.\n\t * @param {...*} args Arguments to pass to the hook callbacks.\n\t *\n\t * @return {*} Return value of runner, if applicable.\n\t */\n\treturn function runHooks( hookName, ...args ) {\n\t\tif ( ! hooks[ hookName ] ) {\n\t\t\thooks[ hookName ] = {\n\t\t\t\thandlers: [],\n\t\t\t\truns: 0,\n\t\t\t};\n\t\t}\n\n\t\thooks[ hookName ].runs++;\n\n\t\tconst handlers = hooks[ hookName ].handlers;\n\n\t\tif ( ! handlers || ! handlers.length ) {\n\t\t\treturn returnFirstArg ?\n\t\t\t\targs[ 0 ] :\n\t\t\t\tundefined;\n\t\t}\n\n\t\tconst hookInfo = {\n\t\t\tname: hookName,\n\t\t\tcurrentIndex: 0,\n\t\t};\n\n\t\thooks.__current.push( hookInfo );\n\n\t\twhile ( hookInfo.currentIndex < handlers.length ) {\n\t\t\tconst handler = handlers[ hookInfo.currentIndex ];\n\n\t\t\tconst result = handler.callback.apply( null, args );\n\t\t\tif ( returnFirstArg ) {\n\t\t\t\targs[ 0 ] = result;\n\t\t\t}\n\n\t\t\thookInfo.currentIndex++;\n\t\t}\n\n\t\thooks.__current.pop();\n\n\t\tif ( returnFirstArg ) {\n\t\t\treturn args[ 0 ];\n\t\t}\n\t};\n}\n\nexport default createRunHook;\n","import createHooks from './createHooks';\n\nconst {\n\taddAction,\n\taddFilter,\n\tremoveAction,\n\tremoveFilter,\n\thasAction,\n\thasFilter,\n\tremoveAllActions,\n\tremoveAllFilters,\n\tdoAction,\n\tapplyFilters,\n\tcurrentAction,\n\tcurrentFilter,\n\tdoingAction,\n\tdoingFilter,\n\tdidAction,\n\tdidFilter,\n\tactions,\n\tfilters,\n} = createHooks();\n\nexport {\n\tcreateHooks,\n\taddAction,\n\taddFilter,\n\tremoveAction,\n\tremoveFilter,\n\thasAction,\n\thasFilter,\n\tremoveAllActions,\n\tremoveAllFilters,\n\tdoAction,\n\tapplyFilters,\n\tcurrentAction,\n\tcurrentFilter,\n\tdoingAction,\n\tdoingFilter,\n\tdidAction,\n\tdidFilter,\n\tactions,\n\tfilters,\n};\n","/**\n * Validate a hookName string.\n *\n * @param {string} hookName The hook name to validate. Should be a non empty string containing\n * only numbers, letters, dashes, periods and underscores. Also,\n * the hook name cannot begin with `__`.\n *\n * @return {boolean} Whether the hook name is valid.\n */\nfunction validateHookName( hookName ) {\n\tif ( 'string' !== typeof hookName || '' === hookName ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.error( 'The hook name must be a non-empty string.' );\n\t\treturn false;\n\t}\n\n\tif ( /^__/.test( hookName ) ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.error( 'The hook name cannot begin with `__`.' );\n\t\treturn false;\n\t}\n\n\tif ( ! /^[a-zA-Z][a-zA-Z0-9_.-]*$/.test( hookName ) ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.error( 'The hook name can only contain numbers, letters, dashes, periods and underscores.' );\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default validateHookName;\n","/**\n * Validate a namespace string.\n *\n * @param {string} namespace The namespace to validate - should take the form\n * `vendor/plugin/function`.\n *\n * @return {boolean} Whether the namespace is valid.\n */\nfunction validateNamespace( namespace ) {\n\tif ( 'string' !== typeof namespace || '' === namespace ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.error( 'The namespace must be a non-empty string.' );\n\t\treturn false;\n\t}\n\n\tif ( ! /^[a-zA-Z][a-zA-Z0-9_.\\-\\/]*$/.test( namespace ) ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.error( 'The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.' );\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default validateNamespace;\n"],"sourceRoot":""}