@wordpress/hooks 4.32.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/build/createAddHook.js +53 -53
- package/build/createAddHook.js.map +7 -1
- package/build/createCurrentHook.js +24 -22
- package/build/createCurrentHook.js.map +7 -1
- package/build/createDidHook.js +35 -28
- package/build/createDidHook.js.map +7 -1
- package/build/createDoingHook.js +27 -31
- package/build/createDoingHook.js.map +7 -1
- package/build/createHasHook.js +27 -29
- package/build/createHasHook.js.map +7 -1
- package/build/createHooks.js +87 -53
- package/build/createHooks.js.map +7 -1
- package/build/createRemoveHook.js +40 -43
- package/build/createRemoveHook.js.map +7 -1
- package/build/createRunHook.js +30 -32
- package/build/createRunHook.js.map +7 -1
- package/build/index.js +81 -73
- package/build/index.js.map +7 -1
- package/build/types.js +16 -5
- package/build/types.js.map +7 -1
- package/build/validateHookName.js +29 -22
- package/build/validateHookName.js.map +7 -1
- package/build/validateNamespace.js +28 -19
- package/build/validateNamespace.js.map +7 -1
- package/build-module/createAddHook.js +23 -46
- package/build-module/createAddHook.js.map +7 -1
- package/build-module/createCurrentHook.js +6 -18
- package/build-module/createCurrentHook.js.map +7 -1
- package/build-module/createDidHook.js +6 -22
- package/build-module/createDidHook.js.map +7 -1
- package/build-module/createDoingHook.js +9 -27
- package/build-module/createDoingHook.js.map +7 -1
- package/build-module/createHasHook.js +9 -25
- package/build-module/createHasHook.js.map +7 -1
- package/build-module/createHooks.js +56 -47
- package/build-module/createHooks.js.map +7 -1
- package/build-module/createRemoveHook.js +10 -36
- package/build-module/createRemoveHook.js.map +7 -1
- package/build-module/createRunHook.js +12 -28
- package/build-module/createRunHook.js.map +7 -1
- package/build-module/index.js +28 -8
- package/build-module/index.js.map +7 -1
- package/build-module/types.js +1 -2
- package/build-module/types.js.map +7 -1
- package/build-module/validateHookName.js +11 -18
- package/build-module/validateHookName.js.map +7 -1
- package/build-module/validateNamespace.js +10 -15
- package/build-module/validateNamespace.js.map +7 -1
- package/package.json +10 -5
|
@@ -1,53 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import createAddHook from "./createAddHook";
|
|
2
|
+
import createRemoveHook from "./createRemoveHook";
|
|
3
|
+
import createHasHook from "./createHasHook";
|
|
4
|
+
import createRunHook from "./createRunHook";
|
|
5
|
+
import createCurrentHook from "./createCurrentHook";
|
|
6
|
+
import createDoingHook from "./createDoingHook";
|
|
7
|
+
import createDidHook from "./createDidHook";
|
|
8
|
+
class _Hooks {
|
|
9
|
+
actions;
|
|
10
|
+
filters;
|
|
11
|
+
addAction;
|
|
12
|
+
addFilter;
|
|
13
|
+
removeAction;
|
|
14
|
+
removeFilter;
|
|
15
|
+
hasAction;
|
|
16
|
+
hasFilter;
|
|
17
|
+
removeAllActions;
|
|
18
|
+
removeAllFilters;
|
|
19
|
+
doAction;
|
|
20
|
+
doActionAsync;
|
|
21
|
+
applyFilters;
|
|
22
|
+
applyFiltersAsync;
|
|
23
|
+
currentAction;
|
|
24
|
+
currentFilter;
|
|
25
|
+
doingAction;
|
|
26
|
+
doingFilter;
|
|
27
|
+
didAction;
|
|
28
|
+
didFilter;
|
|
19
29
|
constructor() {
|
|
20
|
-
this.actions = Object.create(null);
|
|
21
|
-
this.actions.__current = new Set();
|
|
22
|
-
this.filters = Object.create(null);
|
|
23
|
-
this.filters.__current = new Set();
|
|
24
|
-
this.addAction = createAddHook(this,
|
|
25
|
-
this.addFilter = createAddHook(this,
|
|
26
|
-
this.removeAction = createRemoveHook(this,
|
|
27
|
-
this.removeFilter = createRemoveHook(this,
|
|
28
|
-
this.hasAction = createHasHook(this,
|
|
29
|
-
this.hasFilter = createHasHook(this,
|
|
30
|
-
this.removeAllActions = createRemoveHook(this,
|
|
31
|
-
this.removeAllFilters = createRemoveHook(this,
|
|
32
|
-
this.doAction = createRunHook(this,
|
|
33
|
-
this.doActionAsync = createRunHook(this,
|
|
34
|
-
this.applyFilters = createRunHook(this,
|
|
35
|
-
this.applyFiltersAsync = createRunHook(this,
|
|
36
|
-
this.currentAction = createCurrentHook(this,
|
|
37
|
-
this.currentFilter = createCurrentHook(this,
|
|
38
|
-
this.doingAction = createDoingHook(this,
|
|
39
|
-
this.doingFilter = createDoingHook(this,
|
|
40
|
-
this.didAction = createDidHook(this,
|
|
41
|
-
this.didFilter = createDidHook(this,
|
|
30
|
+
this.actions = /* @__PURE__ */ Object.create(null);
|
|
31
|
+
this.actions.__current = /* @__PURE__ */ new Set();
|
|
32
|
+
this.filters = /* @__PURE__ */ Object.create(null);
|
|
33
|
+
this.filters.__current = /* @__PURE__ */ new Set();
|
|
34
|
+
this.addAction = createAddHook(this, "actions");
|
|
35
|
+
this.addFilter = createAddHook(this, "filters");
|
|
36
|
+
this.removeAction = createRemoveHook(this, "actions");
|
|
37
|
+
this.removeFilter = createRemoveHook(this, "filters");
|
|
38
|
+
this.hasAction = createHasHook(this, "actions");
|
|
39
|
+
this.hasFilter = createHasHook(this, "filters");
|
|
40
|
+
this.removeAllActions = createRemoveHook(this, "actions", true);
|
|
41
|
+
this.removeAllFilters = createRemoveHook(this, "filters", true);
|
|
42
|
+
this.doAction = createRunHook(this, "actions", false, false);
|
|
43
|
+
this.doActionAsync = createRunHook(this, "actions", false, true);
|
|
44
|
+
this.applyFilters = createRunHook(this, "filters", true, false);
|
|
45
|
+
this.applyFiltersAsync = createRunHook(this, "filters", true, true);
|
|
46
|
+
this.currentAction = createCurrentHook(this, "actions");
|
|
47
|
+
this.currentFilter = createCurrentHook(this, "filters");
|
|
48
|
+
this.doingAction = createDoingHook(this, "actions");
|
|
49
|
+
this.doingFilter = createDoingHook(this, "filters");
|
|
50
|
+
this.didAction = createDidHook(this, "actions");
|
|
51
|
+
this.didFilter = createDidHook(this, "filters");
|
|
42
52
|
}
|
|
43
53
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Returns an instance of the hooks object.
|
|
46
|
-
*
|
|
47
|
-
* @return A Hooks instance.
|
|
48
|
-
*/
|
|
49
54
|
function createHooks() {
|
|
50
55
|
return new _Hooks();
|
|
51
56
|
}
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
var createHooks_default = createHooks;
|
|
58
|
+
export {
|
|
59
|
+
_Hooks,
|
|
60
|
+
createHooks_default as default
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=createHooks.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/createHooks.ts"],
|
|
4
|
+
"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';\nimport type { Store } from './types';\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\tpublic actions: Store;\n\tpublic filters: Store;\n\n\tpublic addAction: ReturnType< typeof createAddHook >;\n\tpublic addFilter: ReturnType< typeof createAddHook >;\n\tpublic removeAction: ReturnType< typeof createRemoveHook >;\n\tpublic removeFilter: ReturnType< typeof createRemoveHook >;\n\tpublic hasAction: ReturnType< typeof createHasHook >;\n\tpublic hasFilter: ReturnType< typeof createHasHook >;\n\tpublic removeAllActions: ReturnType< typeof createRemoveHook >;\n\tpublic removeAllFilters: ReturnType< typeof createRemoveHook >;\n\tpublic doAction: ReturnType< typeof createRunHook >;\n\tpublic doActionAsync: ReturnType< typeof createRunHook >;\n\tpublic applyFilters: ReturnType< typeof createRunHook >;\n\tpublic applyFiltersAsync: ReturnType< typeof createRunHook >;\n\tpublic currentAction: ReturnType< typeof createCurrentHook >;\n\tpublic currentFilter: ReturnType< typeof createCurrentHook >;\n\tpublic doingAction: ReturnType< typeof createDoingHook >;\n\tpublic doingFilter: ReturnType< typeof createDoingHook >;\n\tpublic didAction: ReturnType< typeof createDidHook >;\n\tpublic didFilter: ReturnType< typeof createDidHook >;\n\n\tconstructor() {\n\t\tthis.actions = Object.create( null );\n\t\tthis.actions.__current = new Set();\n\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\nexport type Hooks = _Hooks;\n\n/**\n * Returns an instance of the hooks object.\n *\n * @return A Hooks instance.\n */\nfunction createHooks(): Hooks {\n\treturn new _Hooks();\n}\n\nexport default createHooks;\n"],
|
|
5
|
+
"mappings": "AAGA,OAAO,mBAAmB;AAC1B,OAAO,sBAAsB;AAC7B,OAAO,mBAAmB;AAC1B,OAAO,mBAAmB;AAC1B,OAAO,uBAAuB;AAC9B,OAAO,qBAAqB;AAC5B,OAAO,mBAAmB;AAUnB,MAAM,OAAO;AAAA,EACZ;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEP,cAAc;AACb,SAAK,UAAU,uBAAO,OAAQ,IAAK;AACnC,SAAK,QAAQ,YAAY,oBAAI,IAAI;AAEjC,SAAK,UAAU,uBAAO,OAAQ,IAAK;AACnC,SAAK,QAAQ,YAAY,oBAAI,IAAI;AAEjC,SAAK,YAAY,cAAe,MAAM,SAAU;AAChD,SAAK,YAAY,cAAe,MAAM,SAAU;AAChD,SAAK,eAAe,iBAAkB,MAAM,SAAU;AACtD,SAAK,eAAe,iBAAkB,MAAM,SAAU;AACtD,SAAK,YAAY,cAAe,MAAM,SAAU;AAChD,SAAK,YAAY,cAAe,MAAM,SAAU;AAChD,SAAK,mBAAmB,iBAAkB,MAAM,WAAW,IAAK;AAChE,SAAK,mBAAmB,iBAAkB,MAAM,WAAW,IAAK;AAChE,SAAK,WAAW,cAAe,MAAM,WAAW,OAAO,KAAM;AAC7D,SAAK,gBAAgB,cAAe,MAAM,WAAW,OAAO,IAAK;AACjE,SAAK,eAAe,cAAe,MAAM,WAAW,MAAM,KAAM;AAChE,SAAK,oBAAoB,cAAe,MAAM,WAAW,MAAM,IAAK;AACpE,SAAK,gBAAgB,kBAAmB,MAAM,SAAU;AACxD,SAAK,gBAAgB,kBAAmB,MAAM,SAAU;AACxD,SAAK,cAAc,gBAAiB,MAAM,SAAU;AACpD,SAAK,cAAc,gBAAiB,MAAM,SAAU;AACpD,SAAK,YAAY,cAAe,MAAM,SAAU;AAChD,SAAK,YAAY,cAAe,MAAM,SAAU;AAAA,EACjD;AACD;AASA,SAAS,cAAqB;AAC7B,SAAO,IAAI,OAAO;AACnB;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
import validateNamespace from './validateNamespace';
|
|
5
|
-
import validateHookName from './validateHookName';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Removes the specified callback (or all callbacks) from the hook with a given hookName
|
|
9
|
-
* and namespace.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Returns a function which, when invoked, will remove a specified hook or all
|
|
14
|
-
* hooks by the given name.
|
|
15
|
-
*
|
|
16
|
-
* @param hooks Hooks instance.
|
|
17
|
-
* @param storeKey
|
|
18
|
-
* @param [removeAll=false] Whether to remove all callbacks for a hookName,
|
|
19
|
-
* without regard to namespace. Used to create
|
|
20
|
-
* `removeAll*` functions.
|
|
21
|
-
*
|
|
22
|
-
* @return Function that removes hooks.
|
|
23
|
-
*/
|
|
1
|
+
import validateNamespace from "./validateNamespace";
|
|
2
|
+
import validateHookName from "./validateHookName";
|
|
24
3
|
function createRemoveHook(hooks, storeKey, removeAll = false) {
|
|
25
4
|
return function removeHook(hookName, namespace) {
|
|
26
5
|
const hooksStore = hooks[storeKey];
|
|
@@ -30,8 +9,6 @@ function createRemoveHook(hooks, storeKey, removeAll = false) {
|
|
|
30
9
|
if (!removeAll && !validateNamespace(namespace)) {
|
|
31
10
|
return;
|
|
32
11
|
}
|
|
33
|
-
|
|
34
|
-
// Bail if no hooks exist by this name.
|
|
35
12
|
if (!hooksStore[hookName]) {
|
|
36
13
|
return 0;
|
|
37
14
|
}
|
|
@@ -43,18 +20,12 @@ function createRemoveHook(hooks, storeKey, removeAll = false) {
|
|
|
43
20
|
handlers: []
|
|
44
21
|
};
|
|
45
22
|
} else {
|
|
46
|
-
// Try to find the specified callback to remove.
|
|
47
23
|
const handlers = hooksStore[hookName].handlers;
|
|
48
24
|
for (let i = handlers.length - 1; i >= 0; i--) {
|
|
49
25
|
if (handlers[i].namespace === namespace) {
|
|
50
26
|
handlers.splice(i, 1);
|
|
51
27
|
handlersRemoved++;
|
|
52
|
-
|
|
53
|
-
// currently executing. If the callback we're removing
|
|
54
|
-
// comes after the current callback, there's no problem;
|
|
55
|
-
// otherwise we need to decrease the execution index of any
|
|
56
|
-
// other runs by 1 to account for the removed element.
|
|
57
|
-
hooksStore.__current.forEach(hookInfo => {
|
|
28
|
+
hooksStore.__current.forEach((hookInfo) => {
|
|
58
29
|
if (hookInfo.name === hookName && hookInfo.currentIndex >= i) {
|
|
59
30
|
hookInfo.currentIndex--;
|
|
60
31
|
}
|
|
@@ -62,11 +33,14 @@ function createRemoveHook(hooks, storeKey, removeAll = false) {
|
|
|
62
33
|
}
|
|
63
34
|
}
|
|
64
35
|
}
|
|
65
|
-
if (hookName !==
|
|
66
|
-
hooks.doAction(
|
|
36
|
+
if (hookName !== "hookRemoved") {
|
|
37
|
+
hooks.doAction("hookRemoved", hookName, namespace);
|
|
67
38
|
}
|
|
68
39
|
return handlersRemoved;
|
|
69
40
|
};
|
|
70
41
|
}
|
|
71
|
-
|
|
72
|
-
|
|
42
|
+
var createRemoveHook_default = createRemoveHook;
|
|
43
|
+
export {
|
|
44
|
+
createRemoveHook_default as default
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=createRemoveHook.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/createRemoveHook.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport validateNamespace from './validateNamespace';\nimport validateHookName from './validateHookName';\nimport type { Hooks, StoreKey } from './types';\n\n/**\n * Removes the specified callback (or all callbacks) from the hook with a given hookName\n * and namespace.\n */\nexport type RemoveHook = (\n\t/**\n\t * The name of the hook to modify.\n\t */\n\thookName: string,\n\t/**\n\t * The unique namespace identifying the callback in the form `vendor/plugin/function`.\n\t */\n\tnamespace: string\n) => number | undefined;\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 hooks Hooks instance.\n * @param storeKey\n * @param [removeAll=false] Whether to remove all callbacks for a hookName,\n * without regard to namespace. Used to create\n * `removeAll*` functions.\n *\n * @return Function that removes hooks.\n */\nfunction createRemoveHook(\n\thooks: Hooks,\n\tstoreKey: StoreKey,\n\tremoveAll: boolean = false\n): RemoveHook {\n\treturn function removeHook( hookName, namespace ) {\n\t\tconst hooksStore = hooks[ storeKey ];\n\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 ( ! hooksStore[ hookName ] ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tlet handlersRemoved = 0;\n\n\t\tif ( removeAll ) {\n\t\t\thandlersRemoved = hooksStore[ hookName ].handlers.length;\n\t\t\thooksStore[ hookName ] = {\n\t\t\t\truns: hooksStore[ 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 = hooksStore[ hookName ].handlers;\n\t\t\tfor ( let i = handlers.length - 1; i >= 0; i-- ) {\n\t\t\t\tif ( handlers[ i ].namespace === namespace ) {\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\thooksStore.__current.forEach( ( hookInfo ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\thookInfo.name === hookName &&\n\t\t\t\t\t\t\thookInfo.currentIndex >= i\n\t\t\t\t\t\t) {\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\n\t\tif ( hookName !== 'hookRemoved' ) {\n\t\t\thooks.doAction( 'hookRemoved', hookName, namespace );\n\t\t}\n\n\t\treturn handlersRemoved;\n\t};\n}\n\nexport default createRemoveHook;\n"],
|
|
5
|
+
"mappings": "AAGA,OAAO,uBAAuB;AAC9B,OAAO,sBAAsB;AA8B7B,SAAS,iBACR,OACA,UACA,YAAqB,OACR;AACb,SAAO,SAAS,WAAY,UAAU,WAAY;AACjD,UAAM,aAAa,MAAO,QAAS;AAEnC,QAAK,CAAE,iBAAkB,QAAS,GAAI;AACrC;AAAA,IACD;AAEA,QAAK,CAAE,aAAa,CAAE,kBAAmB,SAAU,GAAI;AACtD;AAAA,IACD;AAGA,QAAK,CAAE,WAAY,QAAS,GAAI;AAC/B,aAAO;AAAA,IACR;AAEA,QAAI,kBAAkB;AAEtB,QAAK,WAAY;AAChB,wBAAkB,WAAY,QAAS,EAAE,SAAS;AAClD,iBAAY,QAAS,IAAI;AAAA,QACxB,MAAM,WAAY,QAAS,EAAE;AAAA,QAC7B,UAAU,CAAC;AAAA,MACZ;AAAA,IACD,OAAO;AAEN,YAAM,WAAW,WAAY,QAAS,EAAE;AACxC,eAAU,IAAI,SAAS,SAAS,GAAG,KAAK,GAAG,KAAM;AAChD,YAAK,SAAU,CAAE,EAAE,cAAc,WAAY;AAC5C,mBAAS,OAAQ,GAAG,CAAE;AACtB;AAMA,qBAAW,UAAU,QAAS,CAAE,aAAc;AAC7C,gBACC,SAAS,SAAS,YAClB,SAAS,gBAAgB,GACxB;AACD,uBAAS;AAAA,YACV;AAAA,UACD,CAAE;AAAA,QACH;AAAA,MACD;AAAA,IACD;AAEA,QAAK,aAAa,eAAgB;AACjC,YAAM,SAAU,eAAe,UAAU,SAAU;AAAA,IACpD;AAEA,WAAO;AAAA,EACR;AACD;AAEA,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Returns a function which, when invoked, will execute all callbacks
|
|
7
|
-
* registered to a hook of the specified type, optionally returning the final
|
|
8
|
-
* value of the call chain.
|
|
9
|
-
*
|
|
10
|
-
* @param hooks Hooks instance.
|
|
11
|
-
* @param storeKey
|
|
12
|
-
* @param returnFirstArg Whether each hook callback is expected to return its first argument.
|
|
13
|
-
* @param async Whether the hook callback should be run asynchronously
|
|
14
|
-
*
|
|
15
|
-
* @return Function that runs hook callbacks.
|
|
16
|
-
*/
|
|
17
1
|
function createRunHook(hooks, storeKey, returnFirstArg, async) {
|
|
18
2
|
return function runHook(hookName, ...args) {
|
|
19
3
|
const hooksStore = hooks[storeKey];
|
|
@@ -25,16 +9,13 @@ function createRunHook(hooks, storeKey, returnFirstArg, async) {
|
|
|
25
9
|
}
|
|
26
10
|
hooksStore[hookName].runs++;
|
|
27
11
|
const handlers = hooksStore[hookName].handlers;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if ('production' !== process.env.NODE_ENV) {
|
|
31
|
-
// Handle any 'all' hooks registered.
|
|
32
|
-
if ('hookAdded' !== hookName && hooksStore.all) {
|
|
12
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
13
|
+
if ("hookAdded" !== hookName && hooksStore.all) {
|
|
33
14
|
handlers.push(...hooksStore.all.handlers);
|
|
34
15
|
}
|
|
35
16
|
}
|
|
36
17
|
if (!handlers || !handlers.length) {
|
|
37
|
-
return returnFirstArg ? args[0] :
|
|
18
|
+
return returnFirstArg ? args[0] : void 0;
|
|
38
19
|
}
|
|
39
20
|
const hookInfo = {
|
|
40
21
|
name: hookName,
|
|
@@ -43,7 +24,7 @@ function createRunHook(hooks, storeKey, returnFirstArg, async) {
|
|
|
43
24
|
async function asyncRunner() {
|
|
44
25
|
try {
|
|
45
26
|
hooksStore.__current.add(hookInfo);
|
|
46
|
-
let result = returnFirstArg ? args[0] :
|
|
27
|
+
let result = returnFirstArg ? args[0] : void 0;
|
|
47
28
|
while (hookInfo.currentIndex < handlers.length) {
|
|
48
29
|
const handler = handlers[hookInfo.currentIndex];
|
|
49
30
|
result = await handler.callback.apply(null, args);
|
|
@@ -52,7 +33,7 @@ function createRunHook(hooks, storeKey, returnFirstArg, async) {
|
|
|
52
33
|
}
|
|
53
34
|
hookInfo.currentIndex++;
|
|
54
35
|
}
|
|
55
|
-
return returnFirstArg ? result :
|
|
36
|
+
return returnFirstArg ? result : void 0;
|
|
56
37
|
} finally {
|
|
57
38
|
hooksStore.__current.delete(hookInfo);
|
|
58
39
|
}
|
|
@@ -60,7 +41,7 @@ function createRunHook(hooks, storeKey, returnFirstArg, async) {
|
|
|
60
41
|
function syncRunner() {
|
|
61
42
|
try {
|
|
62
43
|
hooksStore.__current.add(hookInfo);
|
|
63
|
-
let result = returnFirstArg ? args[0] :
|
|
44
|
+
let result = returnFirstArg ? args[0] : void 0;
|
|
64
45
|
while (hookInfo.currentIndex < handlers.length) {
|
|
65
46
|
const handler = handlers[hookInfo.currentIndex];
|
|
66
47
|
result = handler.callback.apply(null, args);
|
|
@@ -69,7 +50,7 @@ function createRunHook(hooks, storeKey, returnFirstArg, async) {
|
|
|
69
50
|
}
|
|
70
51
|
hookInfo.currentIndex++;
|
|
71
52
|
}
|
|
72
|
-
return returnFirstArg ? result :
|
|
53
|
+
return returnFirstArg ? result : void 0;
|
|
73
54
|
} finally {
|
|
74
55
|
hooksStore.__current.delete(hookInfo);
|
|
75
56
|
}
|
|
@@ -77,5 +58,8 @@ function createRunHook(hooks, storeKey, returnFirstArg, async) {
|
|
|
77
58
|
return (async ? asyncRunner : syncRunner)();
|
|
78
59
|
};
|
|
79
60
|
}
|
|
80
|
-
|
|
81
|
-
|
|
61
|
+
var createRunHook_default = createRunHook;
|
|
62
|
+
export {
|
|
63
|
+
createRunHook_default as default
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=createRunHook.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/createRunHook.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Hooks, StoreKey } from './types';\n\nexport type RunHook = (\n\thookName: string,\n\t...args: unknown[]\n) => undefined | unknown;\n\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 hooks Hooks instance.\n * @param storeKey\n * @param returnFirstArg Whether each hook callback is expected to return its first argument.\n * @param async Whether the hook callback should be run asynchronously\n *\n * @return Function that runs hook callbacks.\n */\nfunction createRunHook(\n\thooks: Hooks,\n\tstoreKey: StoreKey,\n\treturnFirstArg: boolean,\n\tasync: boolean\n): RunHook {\n\treturn function runHook( hookName, ...args ) {\n\t\tconst hooksStore = hooks[ storeKey ];\n\n\t\tif ( ! hooksStore[ hookName ] ) {\n\t\t\thooksStore[ hookName ] = {\n\t\t\t\thandlers: [],\n\t\t\t\truns: 0,\n\t\t\t};\n\t\t}\n\n\t\thooksStore[ hookName ].runs++;\n\n\t\tconst handlers = hooksStore[ hookName ].handlers;\n\n\t\t// The following code is stripped from production builds.\n\t\tif ( 'production' !== process.env.NODE_ENV ) {\n\t\t\t// Handle any 'all' hooks registered.\n\t\t\tif ( 'hookAdded' !== hookName && hooksStore.all ) {\n\t\t\t\thandlers.push( ...hooksStore.all.handlers );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! handlers || ! handlers.length ) {\n\t\t\treturn returnFirstArg ? args[ 0 ] : undefined;\n\t\t}\n\n\t\tconst hookInfo = {\n\t\t\tname: hookName,\n\t\t\tcurrentIndex: 0,\n\t\t};\n\n\t\tasync function asyncRunner() {\n\t\t\ttry {\n\t\t\t\thooksStore.__current.add( hookInfo );\n\t\t\t\tlet result = returnFirstArg ? args[ 0 ] : undefined;\n\t\t\t\twhile ( hookInfo.currentIndex < handlers.length ) {\n\t\t\t\t\tconst handler = handlers[ hookInfo.currentIndex ];\n\t\t\t\t\tresult = await handler.callback.apply( null, args );\n\t\t\t\t\tif ( returnFirstArg ) {\n\t\t\t\t\t\targs[ 0 ] = result;\n\t\t\t\t\t}\n\t\t\t\t\thookInfo.currentIndex++;\n\t\t\t\t}\n\t\t\t\treturn returnFirstArg ? result : undefined;\n\t\t\t} finally {\n\t\t\t\thooksStore.__current.delete( hookInfo );\n\t\t\t}\n\t\t}\n\n\t\tfunction syncRunner() {\n\t\t\ttry {\n\t\t\t\thooksStore.__current.add( hookInfo );\n\t\t\t\tlet result = returnFirstArg ? args[ 0 ] : undefined;\n\t\t\t\twhile ( hookInfo.currentIndex < handlers.length ) {\n\t\t\t\t\tconst handler = handlers[ hookInfo.currentIndex ];\n\t\t\t\t\tresult = handler.callback.apply( null, args );\n\t\t\t\t\tif ( returnFirstArg ) {\n\t\t\t\t\t\targs[ 0 ] = result;\n\t\t\t\t\t}\n\t\t\t\t\thookInfo.currentIndex++;\n\t\t\t\t}\n\t\t\t\treturn returnFirstArg ? result : undefined;\n\t\t\t} finally {\n\t\t\t\thooksStore.__current.delete( hookInfo );\n\t\t\t}\n\t\t}\n\n\t\treturn ( async ? asyncRunner : syncRunner )();\n\t};\n}\n\nexport default createRunHook;\n"],
|
|
5
|
+
"mappings": "AAsBA,SAAS,cACR,OACA,UACA,gBACA,OACU;AACV,SAAO,SAAS,QAAS,aAAa,MAAO;AAC5C,UAAM,aAAa,MAAO,QAAS;AAEnC,QAAK,CAAE,WAAY,QAAS,GAAI;AAC/B,iBAAY,QAAS,IAAI;AAAA,QACxB,UAAU,CAAC;AAAA,QACX,MAAM;AAAA,MACP;AAAA,IACD;AAEA,eAAY,QAAS,EAAE;AAEvB,UAAM,WAAW,WAAY,QAAS,EAAE;AAGxC,QAAK,iBAAiB,QAAQ,IAAI,UAAW;AAE5C,UAAK,gBAAgB,YAAY,WAAW,KAAM;AACjD,iBAAS,KAAM,GAAG,WAAW,IAAI,QAAS;AAAA,MAC3C;AAAA,IACD;AAEA,QAAK,CAAE,YAAY,CAAE,SAAS,QAAS;AACtC,aAAO,iBAAiB,KAAM,CAAE,IAAI;AAAA,IACrC;AAEA,UAAM,WAAW;AAAA,MAChB,MAAM;AAAA,MACN,cAAc;AAAA,IACf;AAEA,mBAAe,cAAc;AAC5B,UAAI;AACH,mBAAW,UAAU,IAAK,QAAS;AACnC,YAAI,SAAS,iBAAiB,KAAM,CAAE,IAAI;AAC1C,eAAQ,SAAS,eAAe,SAAS,QAAS;AACjD,gBAAM,UAAU,SAAU,SAAS,YAAa;AAChD,mBAAS,MAAM,QAAQ,SAAS,MAAO,MAAM,IAAK;AAClD,cAAK,gBAAiB;AACrB,iBAAM,CAAE,IAAI;AAAA,UACb;AACA,mBAAS;AAAA,QACV;AACA,eAAO,iBAAiB,SAAS;AAAA,MAClC,UAAE;AACD,mBAAW,UAAU,OAAQ,QAAS;AAAA,MACvC;AAAA,IACD;AAEA,aAAS,aAAa;AACrB,UAAI;AACH,mBAAW,UAAU,IAAK,QAAS;AACnC,YAAI,SAAS,iBAAiB,KAAM,CAAE,IAAI;AAC1C,eAAQ,SAAS,eAAe,SAAS,QAAS;AACjD,gBAAM,UAAU,SAAU,SAAS,YAAa;AAChD,mBAAS,QAAQ,SAAS,MAAO,MAAM,IAAK;AAC5C,cAAK,gBAAiB;AACrB,iBAAM,CAAE,IAAI;AAAA,UACb;AACA,mBAAS;AAAA,QACV;AACA,eAAO,iBAAiB,SAAS;AAAA,MAClC,UAAE;AACD,mBAAW,UAAU,OAAQ,QAAS;AAAA,MACvC;AAAA,IACD;AAEA,YAAS,QAAQ,cAAc,YAAa;AAAA,EAC7C;AACD;AAEA,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
import createHooks from './createHooks';
|
|
5
|
-
export * from './types';
|
|
6
|
-
export const defaultHooks = createHooks();
|
|
1
|
+
import createHooks from "./createHooks";
|
|
2
|
+
export * from "./types";
|
|
3
|
+
const defaultHooks = createHooks();
|
|
7
4
|
const {
|
|
8
5
|
addAction,
|
|
9
6
|
addFilter,
|
|
@@ -26,5 +23,28 @@ const {
|
|
|
26
23
|
actions,
|
|
27
24
|
filters
|
|
28
25
|
} = defaultHooks;
|
|
29
|
-
export {
|
|
30
|
-
|
|
26
|
+
export {
|
|
27
|
+
actions,
|
|
28
|
+
addAction,
|
|
29
|
+
addFilter,
|
|
30
|
+
applyFilters,
|
|
31
|
+
applyFiltersAsync,
|
|
32
|
+
createHooks,
|
|
33
|
+
currentAction,
|
|
34
|
+
currentFilter,
|
|
35
|
+
defaultHooks,
|
|
36
|
+
didAction,
|
|
37
|
+
didFilter,
|
|
38
|
+
doAction,
|
|
39
|
+
doActionAsync,
|
|
40
|
+
doingAction,
|
|
41
|
+
doingFilter,
|
|
42
|
+
filters,
|
|
43
|
+
hasAction,
|
|
44
|
+
hasFilter,
|
|
45
|
+
removeAction,
|
|
46
|
+
removeAllActions,
|
|
47
|
+
removeAllFilters,
|
|
48
|
+
removeFilter
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport createHooks from './createHooks';\n\nexport * from './types';\n\nexport const defaultHooks = createHooks();\n\nconst {\n\taddAction,\n\taddFilter,\n\tremoveAction,\n\tremoveFilter,\n\thasAction,\n\thasFilter,\n\tremoveAllActions,\n\tremoveAllFilters,\n\tdoAction,\n\tdoActionAsync,\n\tapplyFilters,\n\tapplyFiltersAsync,\n\tcurrentAction,\n\tcurrentFilter,\n\tdoingAction,\n\tdoingFilter,\n\tdidAction,\n\tdidFilter,\n\tactions,\n\tfilters,\n} = defaultHooks;\n\nexport {\n\tcreateHooks,\n\taddAction,\n\taddFilter,\n\tremoveAction,\n\tremoveFilter,\n\thasAction,\n\thasFilter,\n\tremoveAllActions,\n\tremoveAllFilters,\n\tdoAction,\n\tdoActionAsync,\n\tapplyFilters,\n\tapplyFiltersAsync,\n\tcurrentAction,\n\tcurrentFilter,\n\tdoingAction,\n\tdoingFilter,\n\tdidAction,\n\tdidFilter,\n\tactions,\n\tfilters,\n};\n"],
|
|
5
|
+
"mappings": "AAGA,OAAO,iBAAiB;AAExB,cAAc;AAEP,MAAM,eAAe,YAAY;AAExC,MAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,IAAI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=types.js.map
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validate a hookName string.
|
|
3
|
-
*
|
|
4
|
-
* @param hookName The hook name to validate. Should be a non empty string containing
|
|
5
|
-
* only numbers, letters, dashes, periods and underscores. Also,
|
|
6
|
-
* the hook name cannot begin with `__`.
|
|
7
|
-
*
|
|
8
|
-
* @return Whether the hook name is valid.
|
|
9
|
-
*/
|
|
10
1
|
function validateHookName(hookName) {
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
console.error('The hook name must be a non-empty string.');
|
|
2
|
+
if ("string" !== typeof hookName || "" === hookName) {
|
|
3
|
+
console.error("The hook name must be a non-empty string.");
|
|
14
4
|
return false;
|
|
15
5
|
}
|
|
16
6
|
if (/^__/.test(hookName)) {
|
|
17
|
-
|
|
18
|
-
console.error('The hook name cannot begin with `__`.');
|
|
7
|
+
console.error("The hook name cannot begin with `__`.");
|
|
19
8
|
return false;
|
|
20
9
|
}
|
|
21
10
|
if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
console.error(
|
|
12
|
+
"The hook name can only contain numbers, letters, dashes, periods and underscores."
|
|
13
|
+
);
|
|
24
14
|
return false;
|
|
25
15
|
}
|
|
26
16
|
return true;
|
|
27
17
|
}
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
var validateHookName_default = validateHookName;
|
|
19
|
+
export {
|
|
20
|
+
validateHookName_default as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=validateHookName.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/validateHookName.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Validate a hookName string.\n *\n * @param 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 Whether the hook name is valid.\n */\nfunction validateHookName( hookName: string ): boolean {\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(\n\t\t\t'The hook name can only contain numbers, letters, dashes, periods and underscores.'\n\t\t);\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default validateHookName;\n"],
|
|
5
|
+
"mappings": "AASA,SAAS,iBAAkB,UAA4B;AACtD,MAAK,aAAa,OAAO,YAAY,OAAO,UAAW;AAEtD,YAAQ,MAAO,2CAA4C;AAC3D,WAAO;AAAA,EACR;AAEA,MAAK,MAAM,KAAM,QAAS,GAAI;AAE7B,YAAQ,MAAO,uCAAwC;AACvD,WAAO;AAAA,EACR;AAEA,MAAK,CAAE,4BAA4B,KAAM,QAAS,GAAI;AAErD,YAAQ;AAAA,MACP;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEA,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validate a namespace string.
|
|
3
|
-
*
|
|
4
|
-
* @param namespace The namespace to validate - should take the form
|
|
5
|
-
* `vendor/plugin/function`.
|
|
6
|
-
*
|
|
7
|
-
* @return Whether the namespace is valid.
|
|
8
|
-
*/
|
|
9
1
|
function validateNamespace(namespace) {
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
console.error('The namespace must be a non-empty string.');
|
|
2
|
+
if ("string" !== typeof namespace || "" === namespace) {
|
|
3
|
+
console.error("The namespace must be a non-empty string.");
|
|
13
4
|
return false;
|
|
14
5
|
}
|
|
15
6
|
if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) {
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
console.error(
|
|
8
|
+
"The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."
|
|
9
|
+
);
|
|
18
10
|
return false;
|
|
19
11
|
}
|
|
20
12
|
return true;
|
|
21
13
|
}
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
var validateNamespace_default = validateNamespace;
|
|
15
|
+
export {
|
|
16
|
+
validateNamespace_default as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=validateNamespace.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/validateNamespace.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Validate a namespace string.\n *\n * @param namespace The namespace to validate - should take the form\n * `vendor/plugin/function`.\n *\n * @return Whether the namespace is valid.\n */\nfunction validateNamespace( namespace: string ): boolean {\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(\n\t\t\t'The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.'\n\t\t);\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default validateNamespace;\n"],
|
|
5
|
+
"mappings": "AAQA,SAAS,kBAAmB,WAA6B;AACxD,MAAK,aAAa,OAAO,aAAa,OAAO,WAAY;AAExD,YAAQ,MAAO,2CAA4C;AAC3D,WAAO;AAAA,EACR;AAEA,MAAK,CAAE,+BAA+B,KAAM,SAAU,GAAI;AAEzD,YAAQ;AAAA,MACP;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEA,IAAO,4BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/hooks",
|
|
3
|
-
"version": "4.32.0",
|
|
3
|
+
"version": "4.32.1-next.47f435fc9.0",
|
|
4
4
|
"description": "WordPress hooks library.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -24,14 +24,19 @@
|
|
|
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,
|
|
29
37
|
"types": "build-types",
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@babel/runtime": "7.25.7"
|
|
32
|
-
},
|
|
33
38
|
"publishConfig": {
|
|
34
39
|
"access": "public"
|
|
35
40
|
},
|
|
36
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9720f22c138771d2ed1a0522725c3cdf1c242953"
|
|
37
42
|
}
|