@wordpress/hooks 4.8.2 → 4.10.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,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.10.0 (2024-10-16)
6
+
7
+ ## 4.9.0 (2024-10-03)
8
+
5
9
  ### New Features
6
10
 
7
11
  - added new `doActionAsync` and `applyFiltersAsync` functions to run hooks in async mode ([#64204](https://github.com/WordPress/gutenberg/pull/64204)).
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_createAddHook","_interopRequireDefault","require","_createRemoveHook","_createHasHook","_createRunHook","_createCurrentHook","_createDoingHook","_createDidHook","_Hooks","constructor","actions","Object","create","__current","Set","filters","addAction","createAddHook","addFilter","removeAction","createRemoveHook","removeFilter","hasAction","createHasHook","hasFilter","removeAllActions","removeAllFilters","doAction","createRunHook","doActionAsync","applyFilters","applyFiltersAsync","currentAction","createCurrentHook","currentFilter","doingAction","createDoingHook","doingFilter","didAction","createDidHook","didFilter","exports","createHooks","_default","default"],"sources":["@wordpress/hooks/src/createHooks.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport 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 * Internal class for constructing hooks. Use `createHooks()` function\n *\n * Note, it is necessary to expose this class to make its type public.\n *\n * @private\n */\nexport class _Hooks {\n\tconstructor() {\n\t\t/** @type {import('.').Store} actions */\n\t\tthis.actions = Object.create( null );\n\t\tthis.actions.__current = new Set();\n\n\t\t/** @type {import('.').Store} filters */\n\t\tthis.filters = Object.create( null );\n\t\tthis.filters.__current = new Set();\n\n\t\tthis.addAction = createAddHook( this, 'actions' );\n\t\tthis.addFilter = createAddHook( this, 'filters' );\n\t\tthis.removeAction = createRemoveHook( this, 'actions' );\n\t\tthis.removeFilter = createRemoveHook( this, 'filters' );\n\t\tthis.hasAction = createHasHook( this, 'actions' );\n\t\tthis.hasFilter = createHasHook( this, 'filters' );\n\t\tthis.removeAllActions = createRemoveHook( this, 'actions', true );\n\t\tthis.removeAllFilters = createRemoveHook( this, 'filters', true );\n\t\tthis.doAction = createRunHook( this, 'actions', false, false );\n\t\tthis.doActionAsync = createRunHook( this, 'actions', false, true );\n\t\tthis.applyFilters = createRunHook( this, 'filters', true, false );\n\t\tthis.applyFiltersAsync = createRunHook( this, 'filters', true, true );\n\t\tthis.currentAction = createCurrentHook( this, 'actions' );\n\t\tthis.currentFilter = createCurrentHook( this, 'filters' );\n\t\tthis.doingAction = createDoingHook( this, 'actions' );\n\t\tthis.doingFilter = createDoingHook( this, 'filters' );\n\t\tthis.didAction = createDidHook( this, 'actions' );\n\t\tthis.didFilter = createDidHook( this, 'filters' );\n\t}\n}\n\n/** @typedef {_Hooks} Hooks */\n\n/**\n * Returns an instance of the hooks object.\n *\n * @return {Hooks} A Hooks instance.\n */\nfunction createHooks() {\n\treturn new _Hooks();\n}\n\nexport default createHooks;\n"],"mappings":";;;;;;;AAGA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,cAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,kBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,gBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AATA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO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AAE,KAAM,CAAC;IACjE,IAAI,CAACG,iBAAiB,GAAG,IAAAH,sBAAa,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAK,CAAC;IACrE,IAAI,CAACI,aAAa,GAAG,IAAAC,0BAAiB,EAAE,IAAI,EAAE,SAAU,CAAC;IACzD,IAAI,CAACC,aAAa,GAAG,IAAAD,0BAAiB,EAAE,IAAI,EAAE,SAAU,CAAC;IACzD,IAAI,CAACE,WAAW,GAAG,IAAAC,wBAAe,EAAE,IAAI,EAAE,SAAU,CAAC;IACrD,IAAI,CAACC,WAAW,GAAG,IAAAD,wBAAe,EAAE,IAAI,EAAE,SAAU,CAAC;IACrD,IAAI,CAACE,SAAS,GAAG,IAAAC,sBAAa,EAAE,IAAI,EAAE,SAAU,CAAC;IACjD,IAAI,CAACC,SAAS,GAAG,IAAAD,sBAAa,EAAE,IAAI,EAAE,SAAU,CAAC;EAClD;AACD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AAJAE,OAAA,CAAAjC,MAAA,GAAAA,MAAA;AAKA,SAASkC,WAAWA,CAAA,EAAG;EACtB,OAAO,IAAIlC,MAAM,CAAC,CAAC;AACpB;AAAC,IAAAmC,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEcF,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_createAddHook","_interopRequireDefault","require","_createRemoveHook","_createHasHook","_createRunHook","_createCurrentHook","_createDoingHook","_createDidHook","_Hooks","constructor","actions","Object","create","__current","Set","filters","addAction","createAddHook","addFilter","removeAction","createRemoveHook","removeFilter","hasAction","createHasHook","hasFilter","removeAllActions","removeAllFilters","doAction","createRunHook","doActionAsync","applyFilters","applyFiltersAsync","currentAction","createCurrentHook","currentFilter","doingAction","createDoingHook","doingFilter","didAction","createDidHook","didFilter","exports","createHooks","_default","default"],"sources":["@wordpress/hooks/src/createHooks.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport 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 * Internal class for constructing hooks. Use `createHooks()` function\n *\n * Note, it is necessary to expose this class to make its type public.\n *\n * @private\n */\nexport class _Hooks {\n\tconstructor() {\n\t\t/** @type {import('.').Store} actions */\n\t\tthis.actions = Object.create( null );\n\t\tthis.actions.__current = new Set();\n\n\t\t/** @type {import('.').Store} filters */\n\t\tthis.filters = Object.create( null );\n\t\tthis.filters.__current = new Set();\n\n\t\tthis.addAction = createAddHook( this, 'actions' );\n\t\tthis.addFilter = createAddHook( this, 'filters' );\n\t\tthis.removeAction = createRemoveHook( this, 'actions' );\n\t\tthis.removeFilter = createRemoveHook( this, 'filters' );\n\t\tthis.hasAction = createHasHook( this, 'actions' );\n\t\tthis.hasFilter = createHasHook( this, 'filters' );\n\t\tthis.removeAllActions = createRemoveHook( this, 'actions', true );\n\t\tthis.removeAllFilters = createRemoveHook( this, 'filters', true );\n\t\tthis.doAction = createRunHook( this, 'actions', false, false );\n\t\tthis.doActionAsync = createRunHook( this, 'actions', false, true );\n\t\tthis.applyFilters = createRunHook( this, 'filters', true, false );\n\t\tthis.applyFiltersAsync = createRunHook( this, 'filters', true, true );\n\t\tthis.currentAction = createCurrentHook( this, 'actions' );\n\t\tthis.currentFilter = createCurrentHook( this, 'filters' );\n\t\tthis.doingAction = createDoingHook( this, 'actions' );\n\t\tthis.doingFilter = createDoingHook( this, 'filters' );\n\t\tthis.didAction = createDidHook( this, 'actions' );\n\t\tthis.didFilter = createDidHook( this, 'filters' );\n\t}\n}\n\n/** @typedef {_Hooks} Hooks */\n\n/**\n * Returns an instance of the hooks object.\n *\n * @return {Hooks} A Hooks instance.\n */\nfunction createHooks() {\n\treturn new _Hooks();\n}\n\nexport default createHooks;\n"],"mappings":";;;;;;;;AAGA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA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":3,"names":["createAddHook","createRemoveHook","createHasHook","createRunHook","createCurrentHook","createDoingHook","createDidHook","_Hooks","constructor","actions","Object","create","__current","Set","filters","addAction","addFilter","removeAction","removeFilter","hasAction","hasFilter","removeAllActions","removeAllFilters","doAction","doActionAsync","applyFilters","applyFiltersAsync","currentAction","currentFilter","doingAction","doingFilter","didAction","didFilter","createHooks"],"sources":["@wordpress/hooks/src/createHooks.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport 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 * Internal class for constructing hooks. Use `createHooks()` function\n *\n * Note, it is necessary to expose this class to make its type public.\n *\n * @private\n */\nexport class _Hooks {\n\tconstructor() {\n\t\t/** @type {import('.').Store} actions */\n\t\tthis.actions = Object.create( null );\n\t\tthis.actions.__current = new Set();\n\n\t\t/** @type {import('.').Store} filters */\n\t\tthis.filters = Object.create( null );\n\t\tthis.filters.__current = new Set();\n\n\t\tthis.addAction = createAddHook( this, 'actions' );\n\t\tthis.addFilter = createAddHook( this, 'filters' );\n\t\tthis.removeAction = createRemoveHook( this, 'actions' );\n\t\tthis.removeFilter = createRemoveHook( this, 'filters' );\n\t\tthis.hasAction = createHasHook( this, 'actions' );\n\t\tthis.hasFilter = createHasHook( this, 'filters' );\n\t\tthis.removeAllActions = createRemoveHook( this, 'actions', true );\n\t\tthis.removeAllFilters = createRemoveHook( this, 'filters', true );\n\t\tthis.doAction = createRunHook( this, 'actions', false, false );\n\t\tthis.doActionAsync = createRunHook( this, 'actions', false, true );\n\t\tthis.applyFilters = createRunHook( this, 'filters', true, false );\n\t\tthis.applyFiltersAsync = createRunHook( this, 'filters', true, true );\n\t\tthis.currentAction = createCurrentHook( this, 'actions' );\n\t\tthis.currentFilter = createCurrentHook( this, 'filters' );\n\t\tthis.doingAction = createDoingHook( this, 'actions' );\n\t\tthis.doingFilter = createDoingHook( this, 'filters' );\n\t\tthis.didAction = createDidHook( this, 'actions' );\n\t\tthis.didFilter = createDidHook( this, 'filters' );\n\t}\n}\n\n/** @typedef {_Hooks} Hooks */\n\n/**\n * Returns an instance of the hooks object.\n *\n * @return {Hooks} A Hooks instance.\n */\nfunction createHooks() {\n\treturn new _Hooks();\n}\n\nexport default createHooks;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,aAAa,MAAM,iBAAiB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,MAAM,CAAC;EACnBC,WAAWA,CAAA,EAAG;IACb;IACA,IAAI,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAAE,IAAK,CAAC;IACpC,IAAI,CAACF,OAAO,CAACG,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;;IAElC;IACA,IAAI,CAACC,OAAO,GAAGJ,MAAM,CAACC,MAAM,CAAE,IAAK,CAAC;IACpC,IAAI,CAACG,OAAO,CAACF,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;IAElC,IAAI,CAACE,SAAS,GAAGf,aAAa,CAAE,IAAI,EAAE,SAAU,CAAC;IACjD,IAAI,CAACgB,SAAS,GAAGhB,aAAa,CAAE,IAAI,EAAE,SAAU,CAAC;IACjD,IAAI,CAACiB,YAAY,GAAGhB,gBAAgB,CAAE,IAAI,EAAE,SAAU,CAAC;IACvD,IAAI,CAACiB,YAAY,GAAGjB,gBAAgB,CAAE,IAAI,EAAE,SAAU,CAAC;IACvD,IAAI,CAACkB,SAAS,GAAGjB,aAAa,CAA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+ {"version":3,"names":["createAddHook","createRemoveHook","createHasHook","createRunHook","createCurrentHook","createDoingHook","createDidHook","_Hooks","constructor","actions","Object","create","__current","Set","filters","addAction","addFilter","removeAction","removeFilter","hasAction","hasFilter","removeAllActions","removeAllFilters","doAction","doActionAsync","applyFilters","applyFiltersAsync","currentAction","currentFilter","doingAction","doingFilter","didAction","didFilter","createHooks"],"sources":["@wordpress/hooks/src/createHooks.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport 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 * Internal class for constructing hooks. Use `createHooks()` function\n *\n * Note, it is necessary to expose this class to make its type public.\n *\n * @private\n */\nexport class _Hooks {\n\tconstructor() {\n\t\t/** @type {import('.').Store} actions */\n\t\tthis.actions = Object.create( null );\n\t\tthis.actions.__current = new Set();\n\n\t\t/** @type {import('.').Store} filters */\n\t\tthis.filters = Object.create( null );\n\t\tthis.filters.__current = new Set();\n\n\t\tthis.addAction = createAddHook( this, 'actions' );\n\t\tthis.addFilter = createAddHook( this, 'filters' );\n\t\tthis.removeAction = createRemoveHook( this, 'actions' );\n\t\tthis.removeFilter = createRemoveHook( this, 'filters' );\n\t\tthis.hasAction = createHasHook( this, 'actions' );\n\t\tthis.hasFilter = createHasHook( this, 'filters' );\n\t\tthis.removeAllActions = createRemoveHook( this, 'actions', true );\n\t\tthis.removeAllFilters = createRemoveHook( this, 'filters', true );\n\t\tthis.doAction = createRunHook( this, 'actions', false, false );\n\t\tthis.doActionAsync = createRunHook( this, 'actions', false, true );\n\t\tthis.applyFilters = createRunHook( this, 'filters', true, false );\n\t\tthis.applyFiltersAsync = createRunHook( this, 'filters', true, true );\n\t\tthis.currentAction = createCurrentHook( this, 'actions' );\n\t\tthis.currentFilter = createCurrentHook( this, 'filters' );\n\t\tthis.doingAction = createDoingHook( this, 'actions' );\n\t\tthis.doingFilter = createDoingHook( this, 'filters' );\n\t\tthis.didAction = createDidHook( this, 'actions' );\n\t\tthis.didFilter = createDidHook( this, 'filters' );\n\t}\n}\n\n/** @typedef {_Hooks} Hooks */\n\n/**\n * Returns an instance of the hooks object.\n *\n * @return {Hooks} A Hooks instance.\n */\nfunction createHooks() {\n\treturn new _Hooks();\n}\n\nexport default createHooks;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,aAAa,MAAM,iBAAiB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,MAAM,CAAC;EACnBC,WAAWA,CAAA,EAAG;IACb;IACA,IAAI,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAAE,IAAK,CAAC;IACpC,IAAI,CAACF,OAAO,CAACG,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;;IAElC;IACA,IAAI,CAACC,OAAO,GAAGJ,MAAM,CAACC,MAAM,CAAE,IAAK,CAAC;IACpC,IAAI,CAACG,OAAO,CAACF,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;IAElC,IAAI,CAACE,SAAS,GAAGf,aAAa,CAAE,IAAI,EAAE,SAAU,CAAC;IACjD,IAAI,CAACgB,SAAS,GAAGhB,aAAa,CAAE,IAAI,EAAE,SAAU,CAAC;IACjD,IAAI,CAACiB,YAAY,GAAGhB,gBAAgB,CAAE,IAAI,EAAE,SAAU,CAAC;IACvD,IAAI,CAACiB,YAAY,GAAGjB,gBAAgB,CAAE,IAAI,EAAE,SAAU,CAAC;IACvD,IAAI,CAACkB,SAAS,GAAGjB,aAA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]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/hooks",
3
- "version": "4.8.2",
3
+ "version": "4.10.0",
4
4
  "description": "WordPress hooks library.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,10 +27,10 @@
27
27
  "react-native": "src/index",
28
28
  "types": "build-types",
29
29
  "dependencies": {
30
- "@babel/runtime": "^7.16.0"
30
+ "@babel/runtime": "7.25.7"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "6187079697e13c3292eb098d6338523a6676c6e8"
35
+ "gitHead": "ab34a7ac935fd1478eac63b596242d83270897ee"
36
36
  }