@wordpress/commands 1.32.0 → 1.32.1-next.ff1cebbba.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.
Files changed (56) hide show
  1. package/README.md +2 -2
  2. package/build/components/command-menu.js +261 -246
  3. package/build/components/command-menu.js.map +7 -1
  4. package/build/hooks/use-command-context.js +31 -35
  5. package/build/hooks/use-command-context.js.map +7 -1
  6. package/build/hooks/use-command-loader.js +35 -92
  7. package/build/hooks/use-command-loader.js.map +7 -1
  8. package/build/hooks/use-command.js +53 -90
  9. package/build/hooks/use-command.js.map +7 -1
  10. package/build/index.js +49 -45
  11. package/build/index.js.map +7 -1
  12. package/build/lock-unlock.js +31 -15
  13. package/build/lock-unlock.js.map +7 -1
  14. package/build/private-apis.js +41 -19
  15. package/build/private-apis.js.map +7 -1
  16. package/build/store/actions.js +42 -92
  17. package/build/store/actions.js.map +7 -1
  18. package/build/store/index.js +47 -44
  19. package/build/store/index.js.map +7 -1
  20. package/build/store/private-actions.js +27 -14
  21. package/build/store/private-actions.js.map +7 -1
  22. package/build/store/reducer.js +39 -70
  23. package/build/store/reducer.js.map +7 -1
  24. package/build/store/selectors.js +47 -54
  25. package/build/store/selectors.js.map +7 -1
  26. package/build-module/components/command-menu.js +232 -229
  27. package/build-module/components/command-menu.js.map +7 -1
  28. package/build-module/hooks/use-command-context.js +11 -28
  29. package/build-module/hooks/use-command-context.js.map +7 -1
  30. package/build-module/hooks/use-command-loader.js +17 -87
  31. package/build-module/hooks/use-command-loader.js.map +7 -1
  32. package/build-module/hooks/use-command.js +25 -79
  33. package/build-module/hooks/use-command.js.map +7 -1
  34. package/build-module/index.js +14 -6
  35. package/build-module/index.js.map +7 -1
  36. package/build-module/lock-unlock.js +8 -7
  37. package/build-module/lock-unlock.js.map +7 -1
  38. package/build-module/private-apis.js +7 -11
  39. package/build-module/private-apis.js.map +7 -1
  40. package/build-module/store/actions.js +21 -88
  41. package/build-module/store/actions.js.map +7 -1
  42. package/build-module/store/index.js +12 -32
  43. package/build-module/store/index.js.map +7 -1
  44. package/build-module/store/private-actions.js +6 -10
  45. package/build-module/store/private-actions.js.map +7 -1
  46. package/build-module/store/reducer.js +20 -64
  47. package/build-module/store/reducer.js.map +7 -1
  48. package/build-module/store/selectors.js +24 -49
  49. package/build-module/store/selectors.js.map +7 -1
  50. package/build-style/style-rtl.css +7 -138
  51. package/build-style/style.css +7 -138
  52. package/package.json +18 -10
  53. package/src/components/command-menu.js +4 -1
  54. package/src/components/style.scss +10 -0
  55. package/src/hooks/use-command.js +2 -2
  56. package/src/style.scss +2 -1
package/build/index.js CHANGED
@@ -1,48 +1,52 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "CommandMenu", {
8
- enumerable: true,
9
- get: function () {
10
- return _commandMenu.CommandMenu;
11
- }
12
- });
13
- Object.defineProperty(exports, "privateApis", {
14
- enumerable: true,
15
- get: function () {
16
- return _privateApis.privateApis;
17
- }
18
- });
19
- Object.defineProperty(exports, "store", {
20
- enumerable: true,
21
- get: function () {
22
- return _store.store;
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
16
  }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var index_exports = {};
29
+ __export(index_exports, {
30
+ CommandMenu: () => import_command_menu.CommandMenu,
31
+ privateApis: () => import_private_apis.privateApis,
32
+ store: () => import_store.store,
33
+ useCommand: () => import_use_command.useCommand,
34
+ useCommandLoader: () => import_use_command_loader.default,
35
+ useCommands: () => import_use_command.useCommands
24
36
  });
25
- Object.defineProperty(exports, "useCommand", {
26
- enumerable: true,
27
- get: function () {
28
- return _useCommand.useCommand;
29
- }
30
- });
31
- Object.defineProperty(exports, "useCommandLoader", {
32
- enumerable: true,
33
- get: function () {
34
- return _useCommandLoader.default;
35
- }
36
- });
37
- Object.defineProperty(exports, "useCommands", {
38
- enumerable: true,
39
- get: function () {
40
- return _useCommand.useCommands;
41
- }
37
+ module.exports = __toCommonJS(index_exports);
38
+ var import_command_menu = require("./components/command-menu");
39
+ var import_private_apis = require("./private-apis");
40
+ var import_use_command = require("./hooks/use-command");
41
+ var import_use_command_loader = __toESM(require("./hooks/use-command-loader"));
42
+ var import_store = require("./store");
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ CommandMenu,
46
+ privateApis,
47
+ store,
48
+ useCommand,
49
+ useCommandLoader,
50
+ useCommands
42
51
  });
43
- var _commandMenu = require("./components/command-menu");
44
- var _privateApis = require("./private-apis");
45
- var _useCommand = require("./hooks/use-command");
46
- var _useCommandLoader = _interopRequireDefault(require("./hooks/use-command-loader"));
47
- var _store = require("./store");
48
- //# sourceMappingURL=index.js.map
52
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_commandMenu","require","_privateApis","_useCommand","_useCommandLoader","_interopRequireDefault","_store"],"sources":["@wordpress/commands/src/index.js"],"sourcesContent":["export { CommandMenu } from './components/command-menu';\nexport { privateApis } from './private-apis';\nexport { useCommand, useCommands } from './hooks/use-command';\nexport { default as useCommandLoader } from './hooks/use-command-loader';\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "sourcesContent": ["export { CommandMenu } from './components/command-menu';\nexport { privateApis } from './private-apis';\nexport { useCommand, useCommands } from './hooks/use-command';\nexport { default as useCommandLoader } from './hooks/use-command-loader';\nexport { store } from './store';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B;AAC5B,0BAA4B;AAC5B,yBAAwC;AACxC,gCAA4C;AAC5C,mBAAsB;",
6
+ "names": []
7
+ }
@@ -1,18 +1,34 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var lock_unlock_exports = {};
19
+ __export(lock_unlock_exports, {
20
+ lock: () => lock,
21
+ unlock: () => unlock
5
22
  });
6
- exports.unlock = exports.lock = void 0;
7
- var _privateApis = require("@wordpress/private-apis");
8
- /**
9
- * WordPress dependencies
10
- */
11
-
12
- const {
23
+ module.exports = __toCommonJS(lock_unlock_exports);
24
+ var import_private_apis = require("@wordpress/private-apis");
25
+ const { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
26
+ "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
27
+ "@wordpress/commands"
28
+ );
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
13
31
  lock,
14
32
  unlock
15
- } = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/commands');
16
- exports.unlock = unlock;
17
- exports.lock = lock;
18
- //# sourceMappingURL=lock-unlock.js.map
33
+ });
34
+ //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/commands/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/commands'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,+HAA+H,EAC/H,qBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lock-unlock.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/commands'\n\t);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAE1D,MAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }
@@ -1,21 +1,43 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var private_apis_exports = {};
29
+ __export(private_apis_exports, {
30
+ privateApis: () => privateApis
6
31
  });
7
- exports.privateApis = void 0;
8
- var _useCommandContext = _interopRequireDefault(require("./hooks/use-command-context"));
9
- var _lockUnlock = require("./lock-unlock");
10
- /**
11
- * Internal dependencies
12
- */
13
-
14
- /**
15
- * @private
16
- */
17
- const privateApis = exports.privateApis = {};
18
- (0, _lockUnlock.lock)(privateApis, {
19
- useCommandContext: _useCommandContext.default
32
+ module.exports = __toCommonJS(private_apis_exports);
33
+ var import_use_command_context = __toESM(require("./hooks/use-command-context"));
34
+ var import_lock_unlock = require("./lock-unlock");
35
+ const privateApis = {};
36
+ (0, import_lock_unlock.lock)(privateApis, {
37
+ useCommandContext: import_use_command_context.default
20
38
  });
21
- //# sourceMappingURL=private-apis.js.map
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ privateApis
42
+ });
43
+ //# sourceMappingURL=private-apis.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_useCommandContext","_interopRequireDefault","require","_lockUnlock","privateApis","exports","lock","useCommandContext"],"sources":["@wordpress/commands/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { default as useCommandContext } from './hooks/use-command-context';\nimport { lock } from './lock-unlock';\n\n/**\n * @private\n */\nexport const privateApis = {};\nlock( privateApis, {\n\tuseCommandContext,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACO,MAAME,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,CAAC,CAAC;AAC7B,IAAAE,gBAAI,EAAEF,WAAW,EAAE;EAClBG,iBAAiB,EAAjBA;AACD,CAAE,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/private-apis.js"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { default as useCommandContext } from './hooks/use-command-context';\nimport { lock } from './lock-unlock';\n\n/**\n * @private\n */\nexport const privateApis = {};\nlock( privateApis, {\n\tuseCommandContext,\n} );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iCAA6C;AAC7C,yBAAqB;AAKd,MAAM,cAAc,CAAC;AAAA,IAC5B,yBAAM,aAAa;AAAA,EAClB,8CAAAA;AACD,CAAE;",
6
+ "names": ["useCommandContext"]
7
+ }
@@ -1,121 +1,71 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var actions_exports = {};
19
+ __export(actions_exports, {
20
+ close: () => close,
21
+ open: () => open,
22
+ registerCommand: () => registerCommand,
23
+ registerCommandLoader: () => registerCommandLoader,
24
+ unregisterCommand: () => unregisterCommand,
25
+ unregisterCommandLoader: () => unregisterCommandLoader
5
26
  });
6
- exports.close = close;
7
- exports.open = open;
8
- exports.registerCommand = registerCommand;
9
- exports.registerCommandLoader = registerCommandLoader;
10
- exports.unregisterCommand = unregisterCommand;
11
- exports.unregisterCommandLoader = unregisterCommandLoader;
12
- /** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */
13
-
14
- /**
15
- * Configuration of a registered keyboard shortcut.
16
- *
17
- * @typedef {Object} WPCommandConfig
18
- *
19
- * @property {string} name Command name.
20
- * @property {string} label Command label.
21
- * @property {string=} searchLabel Command search label.
22
- * @property {string=} context Command context.
23
- * @property {JSX.Element} icon Command icon.
24
- * @property {Function} callback Command callback.
25
- * @property {boolean} disabled Whether to disable the command.
26
- * @property {string[]=} keywords Command keywords for search matching.
27
- */
28
-
29
- /**
30
- * @typedef {(search: string) => WPCommandConfig[]} WPCommandLoaderHook hoo
31
- */
32
-
33
- /**
34
- * Command loader config.
35
- *
36
- * @typedef {Object} WPCommandLoaderConfig
37
- *
38
- * @property {string} name Command loader name.
39
- * @property {string=} context Command loader context.
40
- * @property {WPCommandLoaderHook} hook Command loader hook.
41
- * @property {boolean} disabled Whether to disable the command loader.
42
- */
43
-
44
- /**
45
- * Returns an action object used to register a new command.
46
- *
47
- * @param {WPCommandConfig} config Command config.
48
- *
49
- * @return {Object} action.
50
- */
27
+ module.exports = __toCommonJS(actions_exports);
51
28
  function registerCommand(config) {
52
29
  return {
53
- type: 'REGISTER_COMMAND',
30
+ type: "REGISTER_COMMAND",
54
31
  ...config
55
32
  };
56
33
  }
57
-
58
- /**
59
- * Returns an action object used to unregister a command.
60
- *
61
- * @param {string} name Command name.
62
- *
63
- * @return {Object} action.
64
- */
65
34
  function unregisterCommand(name) {
66
35
  return {
67
- type: 'UNREGISTER_COMMAND',
36
+ type: "UNREGISTER_COMMAND",
68
37
  name
69
38
  };
70
39
  }
71
-
72
- /**
73
- * Register command loader.
74
- *
75
- * @param {WPCommandLoaderConfig} config Command loader config.
76
- *
77
- * @return {Object} action.
78
- */
79
40
  function registerCommandLoader(config) {
80
41
  return {
81
- type: 'REGISTER_COMMAND_LOADER',
42
+ type: "REGISTER_COMMAND_LOADER",
82
43
  ...config
83
44
  };
84
45
  }
85
-
86
- /**
87
- * Unregister command loader hook.
88
- *
89
- * @param {string} name Command loader name.
90
- *
91
- * @return {Object} action.
92
- */
93
46
  function unregisterCommandLoader(name) {
94
47
  return {
95
- type: 'UNREGISTER_COMMAND_LOADER',
48
+ type: "UNREGISTER_COMMAND_LOADER",
96
49
  name
97
50
  };
98
51
  }
99
-
100
- /**
101
- * Opens the command palette.
102
- *
103
- * @return {Object} action.
104
- */
105
52
  function open() {
106
53
  return {
107
- type: 'OPEN'
54
+ type: "OPEN"
108
55
  };
109
56
  }
110
-
111
- /**
112
- * Closes the command palette.
113
- *
114
- * @return {Object} action.
115
- */
116
57
  function close() {
117
58
  return {
118
- type: 'CLOSE'
59
+ type: "CLOSE"
119
60
  };
120
61
  }
121
- //# sourceMappingURL=actions.js.map
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ close,
65
+ open,
66
+ registerCommand,
67
+ registerCommandLoader,
68
+ unregisterCommand,
69
+ unregisterCommandLoader
70
+ });
71
+ //# sourceMappingURL=actions.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["registerCommand","config","type","unregisterCommand","name","registerCommandLoader","unregisterCommandLoader","open","close"],"sources":["@wordpress/commands/src/store/actions.js"],"sourcesContent":["/** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */\n\n/**\n * Configuration of a registered keyboard shortcut.\n *\n * @typedef {Object} WPCommandConfig\n *\n * @property {string} name Command name.\n * @property {string} label Command label.\n * @property {string=} searchLabel Command search label.\n * @property {string=} context Command context.\n * @property {JSX.Element} icon Command icon.\n * @property {Function} callback Command callback.\n * @property {boolean} disabled Whether to disable the command.\n * @property {string[]=} keywords Command keywords for search matching.\n */\n\n/**\n * @typedef {(search: string) => WPCommandConfig[]} WPCommandLoaderHook hoo\n */\n\n/**\n * Command loader config.\n *\n * @typedef {Object} WPCommandLoaderConfig\n *\n * @property {string} name Command loader name.\n * @property {string=} context Command loader context.\n * @property {WPCommandLoaderHook} hook Command loader hook.\n * @property {boolean} disabled Whether to disable the command loader.\n */\n\n/**\n * Returns an action object used to register a new command.\n *\n * @param {WPCommandConfig} config Command config.\n *\n * @return {Object} action.\n */\nexport function registerCommand( config ) {\n\treturn {\n\t\ttype: 'REGISTER_COMMAND',\n\t\t...config,\n\t};\n}\n\n/**\n * Returns an action object used to unregister a command.\n *\n * @param {string} name Command name.\n *\n * @return {Object} action.\n */\nexport function unregisterCommand( name ) {\n\treturn {\n\t\ttype: 'UNREGISTER_COMMAND',\n\t\tname,\n\t};\n}\n\n/**\n * Register command loader.\n *\n * @param {WPCommandLoaderConfig} config Command loader config.\n *\n * @return {Object} action.\n */\nexport function registerCommandLoader( config ) {\n\treturn {\n\t\ttype: 'REGISTER_COMMAND_LOADER',\n\t\t...config,\n\t};\n}\n\n/**\n * Unregister command loader hook.\n *\n * @param {string} name Command loader name.\n *\n * @return {Object} action.\n */\nexport function unregisterCommandLoader( name ) {\n\treturn {\n\t\ttype: 'UNREGISTER_COMMAND_LOADER',\n\t\tname,\n\t};\n}\n\n/**\n * Opens the command palette.\n *\n * @return {Object} action.\n */\nexport function open() {\n\treturn {\n\t\ttype: 'OPEN',\n\t};\n}\n\n/**\n * Closes the command palette.\n *\n * @return {Object} action.\n */\nexport function close() {\n\treturn {\n\t\ttype: 'CLOSE',\n\t};\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAAEC,MAAM,EAAG;EACzC,OAAO;IACNC,IAAI,EAAE,kBAAkB;IACxB,GAAGD;EACJ,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,iBAAiBA,CAAEC,IAAI,EAAG;EACzC,OAAO;IACNF,IAAI,EAAE,oBAAoB;IAC1BE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAEJ,MAAM,EAAG;EAC/C,OAAO;IACNC,IAAI,EAAE,yBAAyB;IAC/B,GAAGD;EACJ,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,uBAAuBA,CAAEF,IAAI,EAAG;EAC/C,OAAO;IACNF,IAAI,EAAE,2BAA2B;IACjCE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASG,IAAIA,CAAA,EAAG;EACtB,OAAO;IACNL,IAAI,EAAE;EACP,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASM,KAAKA,CAAA,EAAG;EACvB,OAAO;IACNN,IAAI,EAAE;EACP,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/actions.js"],
4
+ "sourcesContent": ["/** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */\n\n/**\n * Configuration of a registered keyboard shortcut.\n *\n * @typedef {Object} WPCommandConfig\n *\n * @property {string} name Command name.\n * @property {string} label Command label.\n * @property {string=} searchLabel Command search label.\n * @property {string=} context Command context.\n * @property {JSX.Element} icon Command icon.\n * @property {Function} callback Command callback.\n * @property {boolean} disabled Whether to disable the command.\n * @property {string[]=} keywords Command keywords for search matching.\n */\n\n/**\n * @typedef {(search: string) => WPCommandConfig[]} WPCommandLoaderHook hoo\n */\n\n/**\n * Command loader config.\n *\n * @typedef {Object} WPCommandLoaderConfig\n *\n * @property {string} name Command loader name.\n * @property {string=} context Command loader context.\n * @property {WPCommandLoaderHook} hook Command loader hook.\n * @property {boolean} disabled Whether to disable the command loader.\n */\n\n/**\n * Returns an action object used to register a new command.\n *\n * @param {WPCommandConfig} config Command config.\n *\n * @return {Object} action.\n */\nexport function registerCommand( config ) {\n\treturn {\n\t\ttype: 'REGISTER_COMMAND',\n\t\t...config,\n\t};\n}\n\n/**\n * Returns an action object used to unregister a command.\n *\n * @param {string} name Command name.\n *\n * @return {Object} action.\n */\nexport function unregisterCommand( name ) {\n\treturn {\n\t\ttype: 'UNREGISTER_COMMAND',\n\t\tname,\n\t};\n}\n\n/**\n * Register command loader.\n *\n * @param {WPCommandLoaderConfig} config Command loader config.\n *\n * @return {Object} action.\n */\nexport function registerCommandLoader( config ) {\n\treturn {\n\t\ttype: 'REGISTER_COMMAND_LOADER',\n\t\t...config,\n\t};\n}\n\n/**\n * Unregister command loader hook.\n *\n * @param {string} name Command loader name.\n *\n * @return {Object} action.\n */\nexport function unregisterCommandLoader( name ) {\n\treturn {\n\t\ttype: 'UNREGISTER_COMMAND_LOADER',\n\t\tname,\n\t};\n}\n\n/**\n * Opens the command palette.\n *\n * @return {Object} action.\n */\nexport function open() {\n\treturn {\n\t\ttype: 'OPEN',\n\t};\n}\n\n/**\n * Closes the command palette.\n *\n * @return {Object} action.\n */\nexport function close() {\n\treturn {\n\t\ttype: 'CLOSE',\n\t};\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCO,SAAS,gBAAiB,QAAS;AACzC,SAAO;AAAA,IACN,MAAM;AAAA,IACN,GAAG;AAAA,EACJ;AACD;AASO,SAAS,kBAAmB,MAAO;AACzC,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AASO,SAAS,sBAAuB,QAAS;AAC/C,SAAO;AAAA,IACN,MAAM;AAAA,IACN,GAAG;AAAA,EACJ;AACD;AASO,SAAS,wBAAyB,MAAO;AAC/C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAOO,SAAS,OAAO;AACtB,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;AAOO,SAAS,QAAQ;AACvB,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;",
6
+ "names": []
7
+ }
@@ -1,48 +1,51 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var store_exports = {};
29
+ __export(store_exports, {
30
+ store: () => store
6
31
  });
7
- exports.store = void 0;
8
- var _data = require("@wordpress/data");
9
- var _reducer = _interopRequireDefault(require("./reducer"));
10
- var actions = _interopRequireWildcard(require("./actions"));
11
- var selectors = _interopRequireWildcard(require("./selectors"));
12
- var privateActions = _interopRequireWildcard(require("./private-actions"));
13
- var _lockUnlock = require("../lock-unlock");
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- /**
17
- * WordPress dependencies
18
- */
19
-
20
- /**
21
- * Internal dependencies
22
- */
23
-
24
- const STORE_NAME = 'core/commands';
25
-
26
- /**
27
- * Store definition for the commands namespace.
28
- *
29
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
30
- *
31
- * @type {Object}
32
- *
33
- * @example
34
- * ```js
35
- * import { store as commandsStore } from '@wordpress/commands';
36
- * import { useDispatch } from '@wordpress/data';
37
- * ...
38
- * const { open: openCommandCenter } = useDispatch( commandsStore );
39
- * ```
40
- */
41
- const store = exports.store = (0, _data.createReduxStore)(STORE_NAME, {
42
- reducer: _reducer.default,
32
+ module.exports = __toCommonJS(store_exports);
33
+ var import_data = require("@wordpress/data");
34
+ var import_reducer = __toESM(require("./reducer"));
35
+ var actions = __toESM(require("./actions"));
36
+ var selectors = __toESM(require("./selectors"));
37
+ var privateActions = __toESM(require("./private-actions"));
38
+ var import_lock_unlock = require("../lock-unlock");
39
+ const STORE_NAME = "core/commands";
40
+ const store = (0, import_data.createReduxStore)(STORE_NAME, {
41
+ reducer: import_reducer.default,
43
42
  actions,
44
43
  selectors
45
44
  });
46
- (0, _data.register)(store);
47
- (0, _lockUnlock.unlock)(store).registerPrivateActions(privateActions);
48
- //# sourceMappingURL=index.js.map
45
+ (0, import_data.register)(store);
46
+ (0, import_lock_unlock.unlock)(store).registerPrivateActions(privateActions);
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ store
50
+ });
51
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","selectors","privateActions","_lockUnlock","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","STORE_NAME","store","exports","createReduxStore","reducer","register","unlock","registerPrivateActions"],"sources":["@wordpress/commands/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport * as privateActions from './private-actions';\nimport { unlock } from '../lock-unlock';\n\nconst STORE_NAME = 'core/commands';\n\n/**\n * Store definition for the commands namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n *\n * @example\n * ```js\n * import { store as commandsStore } from '@wordpress/commands';\n * import { useDispatch } from '@wordpress/data';\n * ...\n * const { open: openCommandCenter } = useDispatch( commandsStore );\n * ```\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\nregister( store );\nunlock( store ).registerPrivateActions( privateActions );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,cAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAwC,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAZxC;AACA;AACA;;AAGA;AACA;AACA;;AAOA,MAAMW,UAAU,GAAG,eAAe;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,IAAAE,sBAAgB,EAAEH,UAAU,EAAE;EAClDI,OAAO,EAAPA,gBAAO;EACP7B,OAAO;EACPE;AACD,CAAE,CAAC;AAEH,IAAA4B,cAAQ,EAAEJ,KAAM,CAAC;AACjB,IAAAK,kBAAM,EAAEL,KAAM,CAAC,CAACM,sBAAsB,CAAE7B,cAAe,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport * as privateActions from './private-actions';\nimport { unlock } from '../lock-unlock';\n\nconst STORE_NAME = 'core/commands';\n\n/**\n * Store definition for the commands namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n *\n * @example\n * ```js\n * import { store as commandsStore } from '@wordpress/commands';\n * import { useDispatch } from '@wordpress/data';\n * ...\n * const { open: openCommandCenter } = useDispatch( commandsStore );\n * ```\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\nregister( store );\nunlock( store ).registerPrivateActions( privateActions );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA2C;AAK3C,qBAAoB;AACpB,cAAyB;AACzB,gBAA2B;AAC3B,qBAAgC;AAChC,yBAAuB;AAEvB,MAAM,aAAa;AAiBZ,MAAM,YAAQ,8BAAkB,YAAY;AAAA,EAClD,wBAAAA;AAAA,EACA;AAAA,EACA;AACD,CAAE;AAAA,IAEF,sBAAU,KAAM;AAAA,IAChB,2BAAQ,KAAM,EAAE,uBAAwB,cAAe;",
6
+ "names": ["reducer"]
7
+ }
@@ -1,20 +1,33 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var private_actions_exports = {};
19
+ __export(private_actions_exports, {
20
+ setContext: () => setContext
5
21
  });
6
- exports.setContext = setContext;
7
- /**
8
- * Sets the active context.
9
- *
10
- * @param {string} context Context.
11
- *
12
- * @return {Object} action.
13
- */
22
+ module.exports = __toCommonJS(private_actions_exports);
14
23
  function setContext(context) {
15
24
  return {
16
- type: 'SET_CONTEXT',
25
+ type: "SET_CONTEXT",
17
26
  context
18
27
  };
19
28
  }
20
- //# sourceMappingURL=private-actions.js.map
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ setContext
32
+ });
33
+ //# sourceMappingURL=private-actions.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["setContext","context","type"],"sources":["@wordpress/commands/src/store/private-actions.js"],"sourcesContent":["/**\n * Sets the active context.\n *\n * @param {string} context Context.\n *\n * @return {Object} action.\n */\nexport function setContext( context ) {\n\treturn {\n\t\ttype: 'SET_CONTEXT',\n\t\tcontext,\n\t};\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAUA,CAAEC,OAAO,EAAG;EACrC,OAAO;IACNC,IAAI,EAAE,aAAa;IACnBD;EACD,CAAC;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/store/private-actions.js"],
4
+ "sourcesContent": ["/**\n * Sets the active context.\n *\n * @param {string} context Context.\n *\n * @return {Object} action.\n */\nexport function setContext( context ) {\n\treturn {\n\t\ttype: 'SET_CONTEXT',\n\t\tcontext,\n\t};\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,WAAY,SAAU;AACrC,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;",
6
+ "names": []
7
+ }