@wordpress/commands 1.32.0 → 1.32.1-next.b8c8708f3.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/README.md +2 -2
- package/build/components/command-menu.js +261 -246
- package/build/components/command-menu.js.map +7 -1
- package/build/hooks/use-command-context.js +31 -35
- package/build/hooks/use-command-context.js.map +7 -1
- package/build/hooks/use-command-loader.js +35 -92
- package/build/hooks/use-command-loader.js.map +7 -1
- package/build/hooks/use-command.js +53 -90
- package/build/hooks/use-command.js.map +7 -1
- package/build/index.js +49 -45
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/private-apis.js +41 -19
- package/build/private-apis.js.map +7 -1
- package/build/store/actions.js +42 -92
- package/build/store/actions.js.map +7 -1
- package/build/store/index.js +47 -44
- package/build/store/index.js.map +7 -1
- package/build/store/private-actions.js +27 -14
- package/build/store/private-actions.js.map +7 -1
- package/build/store/reducer.js +39 -70
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +47 -54
- package/build/store/selectors.js.map +7 -1
- package/build-module/components/command-menu.js +232 -229
- package/build-module/components/command-menu.js.map +7 -1
- package/build-module/hooks/use-command-context.js +11 -28
- package/build-module/hooks/use-command-context.js.map +7 -1
- package/build-module/hooks/use-command-loader.js +17 -87
- package/build-module/hooks/use-command-loader.js.map +7 -1
- package/build-module/hooks/use-command.js +25 -79
- package/build-module/hooks/use-command.js.map +7 -1
- package/build-module/index.js +14 -6
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/private-apis.js +7 -11
- package/build-module/private-apis.js.map +7 -1
- package/build-module/store/actions.js +21 -88
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/index.js +12 -32
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-actions.js +6 -10
- package/build-module/store/private-actions.js.map +7 -1
- package/build-module/store/reducer.js +20 -64
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +24 -49
- package/build-module/store/selectors.js.map +7 -1
- package/build-style/style-rtl.css +7 -138
- package/build-style/style.css +7 -138
- package/package.json +18 -10
- package/src/components/command-menu.js +4 -1
- package/src/components/style.scss +10 -0
- package/src/hooks/use-command.js +2 -2
- package/src/style.scss +2 -1
package/build/index.js
CHANGED
|
@@ -1,48 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
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
|
package/build/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
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
|
+
}
|
package/build/lock-unlock.js
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.lock = lock;
|
|
18
|
-
//# sourceMappingURL=lock-unlock.js.map
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=lock-unlock.js.map
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
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
|
+
}
|
package/build/private-apis.js
CHANGED
|
@@ -1,21 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
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
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
{
|
|
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
|
+
}
|
package/build/store/actions.js
CHANGED
|
@@ -1,121 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
59
|
+
type: "CLOSE"
|
|
119
60
|
};
|
|
120
61
|
}
|
|
121
|
-
|
|
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
|
-
{
|
|
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
|
+
}
|
package/build/store/index.js
CHANGED
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
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
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var actions =
|
|
11
|
-
var selectors =
|
|
12
|
-
var privateActions =
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
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,
|
|
47
|
-
(0,
|
|
48
|
-
|
|
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
|
package/build/store/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
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
|
|
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:
|
|
25
|
+
type: "SET_CONTEXT",
|
|
17
26
|
context
|
|
18
27
|
};
|
|
19
28
|
}
|
|
20
|
-
|
|
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
|
-
{
|
|
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
|
+
}
|