@wordpress/keyboard-shortcuts 3.0.5 → 3.0.6
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/hooks/use-shortcut-event-match.js +5 -4
- package/build/hooks/use-shortcut-event-match.js.map +1 -1
- package/build/hooks/use-shortcut.js +4 -3
- package/build/hooks/use-shortcut.js.map +1 -1
- package/build/index.js +8 -8
- package/build/store/actions.js +8 -7
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +4 -2
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +4 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +12 -5
- package/build/store/selectors.js.map +1 -1
- package/build-module/hooks/use-shortcut-event-match.js +5 -4
- package/build-module/hooks/use-shortcut-event-match.js.map +1 -1
- package/build-module/hooks/use-shortcut.js +4 -3
- package/build-module/hooks/use-shortcut.js.map +1 -1
- package/build-module/store/actions.js +8 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +4 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +9 -2
- package/build-module/store/selectors.js.map +1 -1
- package/package.json +7 -7
@@ -40,10 +40,11 @@ function useShortcutEventMatch() {
|
|
40
40
|
*/
|
41
41
|
|
42
42
|
function isMatch(name, event) {
|
43
|
-
return getAllShortcutKeyCombinations(name).some(
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
return getAllShortcutKeyCombinations(name).some(_ref => {
|
44
|
+
let {
|
45
|
+
modifier,
|
46
|
+
character
|
47
|
+
} = _ref;
|
47
48
|
return _keycodes.isKeyboardEvent[modifier](event, character);
|
48
49
|
});
|
49
50
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/hooks/use-shortcut-event-match.js"],"names":["useShortcutEventMatch","getAllShortcutKeyCombinations","keyboardShortcutsStore","isMatch","name","event","some","modifier","character","isKeyboardEvent"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,GAAiC;AAC/C,QAAM;AAAEC,IAAAA;AAAF,MAAoC,qBACzCC,YADyC,CAA1C;AAIA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,WAASC,OAAT,CAAkBC,IAAlB,EAAwBC,KAAxB,EAAgC;AAC/B,WAAOJ,6BAA6B,CAAEG,IAAF,CAA7B,CAAsCE,IAAtC,CACN,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/hooks/use-shortcut-event-match.js"],"names":["useShortcutEventMatch","getAllShortcutKeyCombinations","keyboardShortcutsStore","isMatch","name","event","some","modifier","character","isKeyboardEvent"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,GAAiC;AAC/C,QAAM;AAAEC,IAAAA;AAAF,MAAoC,qBACzCC,YADyC,CAA1C;AAIA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,WAASC,OAAT,CAAkBC,IAAlB,EAAwBC,KAAxB,EAAgC;AAC/B,WAAOJ,6BAA6B,CAAEG,IAAF,CAA7B,CAAsCE,IAAtC,CACN,QAA+B;AAAA,UAA7B;AAAEC,QAAAA,QAAF;AAAYC,QAAAA;AAAZ,OAA6B;AAC9B,aAAOC,0BAAiBF,QAAjB,EAA6BF,KAA7B,EAAoCG,SAApC,CAAP;AACA,KAHK,CAAP;AAKA;;AAED,SAAOL,OAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isKeyboardEvent } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as keyboardShortcutsStore } from '../store';\n\n/**\n * Returns a function to check if a keyboard event matches a shortcut name.\n *\n * @return {Function} A function to to check if a keyboard event matches a\n * predefined shortcut combination.\n */\nexport default function useShortcutEventMatch() {\n\tconst { getAllShortcutKeyCombinations } = useSelect(\n\t\tkeyboardShortcutsStore\n\t);\n\n\t/**\n\t * A function to check if a keyboard event matches a predefined shortcut\n\t * combination.\n\t *\n\t * @param {string} name Shortcut name.\n\t * @param {KeyboardEvent} event Event to check.\n\t *\n\t * @return {boolean} True if the event matches any shortcuts, false if not.\n\t */\n\tfunction isMatch( name, event ) {\n\t\treturn getAllShortcutKeyCombinations( name ).some(\n\t\t\t( { modifier, character } ) => {\n\t\t\t\treturn isKeyboardEvent[ modifier ]( event, character );\n\t\t\t}\n\t\t);\n\t}\n\n\treturn isMatch;\n}\n"]}
|
@@ -29,9 +29,10 @@ var _context = require("../context");
|
|
29
29
|
* @param {Object} options Shortcut options.
|
30
30
|
* @param {boolean} options.isDisabled Whether to disable to shortut.
|
31
31
|
*/
|
32
|
-
function useShortcut(name, callback
|
33
|
-
|
34
|
-
|
32
|
+
function useShortcut(name, callback) {
|
33
|
+
let {
|
34
|
+
isDisabled
|
35
|
+
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
35
36
|
const shortcuts = (0, _element.useContext)(_context.context);
|
36
37
|
const isMatch = (0, _useShortcutEventMatch.default)();
|
37
38
|
const callbackRef = (0, _element.useRef)();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/hooks/use-shortcut.js"],"names":["useShortcut","name","callback","isDisabled","shortcuts","context","isMatch","callbackRef","current","_callback","event","add","delete"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,WAAT,CAAsBC,IAAtB,EAA4BC,QAA5B,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/hooks/use-shortcut.js"],"names":["useShortcut","name","callback","isDisabled","shortcuts","context","isMatch","callbackRef","current","_callback","event","add","delete"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,WAAT,CAAsBC,IAAtB,EAA4BC,QAA5B,EAA4D;AAAA,MAAtB;AAAEC,IAAAA;AAAF,GAAsB,uEAAL,EAAK;AAC1E,QAAMC,SAAS,GAAG,yBAAYC,gBAAZ,CAAlB;AACA,QAAMC,OAAO,GAAG,qCAAhB;AACA,QAAMC,WAAW,GAAG,sBAApB;AACAA,EAAAA,WAAW,CAACC,OAAZ,GAAsBN,QAAtB;AAEA,0BAAW,MAAM;AAChB,QAAKC,UAAL,EAAkB;AACjB;AACA;;AAED,aAASM,SAAT,CAAoBC,KAApB,EAA4B;AAC3B,UAAKJ,OAAO,CAAEL,IAAF,EAAQS,KAAR,CAAZ,EAA8B;AAC7BH,QAAAA,WAAW,CAACC,OAAZ,CAAqBE,KAArB;AACA;AACD;;AAEDN,IAAAA,SAAS,CAACI,OAAV,CAAkBG,GAAlB,CAAuBF,SAAvB;AACA,WAAO,MAAM;AACZL,MAAAA,SAAS,CAACI,OAAV,CAAkBI,MAAlB,CAA0BH,SAA1B;AACA,KAFD;AAGA,GAfD,EAeG,CAAER,IAAF,EAAQE,UAAR,CAfH;AAgBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext, useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useShortcutEventMatch from './use-shortcut-event-match';\nimport { context } from '../context';\n\n/**\n * Attach a keyboard shortcut handler.\n *\n * @param {string} name Shortcut name.\n * @param {Function} callback Shortcut callback.\n * @param {Object} options Shortcut options.\n * @param {boolean} options.isDisabled Whether to disable to shortut.\n */\nexport default function useShortcut( name, callback, { isDisabled } = {} ) {\n\tconst shortcuts = useContext( context );\n\tconst isMatch = useShortcutEventMatch();\n\tconst callbackRef = useRef();\n\tcallbackRef.current = callback;\n\n\tuseEffect( () => {\n\t\tif ( isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction _callback( event ) {\n\t\t\tif ( isMatch( name, event ) ) {\n\t\t\t\tcallbackRef.current( event );\n\t\t\t}\n\t\t}\n\n\t\tshortcuts.current.add( _callback );\n\t\treturn () => {\n\t\t\tshortcuts.current.delete( _callback );\n\t\t};\n\t}, [ name, isDisabled ] );\n}\n"]}
|
package/build/index.js
CHANGED
@@ -5,28 +5,28 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
Object.defineProperty(exports, "
|
8
|
+
Object.defineProperty(exports, "ShortcutProvider", {
|
9
9
|
enumerable: true,
|
10
10
|
get: function () {
|
11
|
-
return
|
11
|
+
return _shortcutProvider.ShortcutProvider;
|
12
12
|
}
|
13
13
|
});
|
14
|
-
Object.defineProperty(exports, "
|
14
|
+
Object.defineProperty(exports, "__unstableUseShortcutEventMatch", {
|
15
15
|
enumerable: true,
|
16
16
|
get: function () {
|
17
|
-
return
|
17
|
+
return _useShortcutEventMatch.default;
|
18
18
|
}
|
19
19
|
});
|
20
|
-
Object.defineProperty(exports, "
|
20
|
+
Object.defineProperty(exports, "store", {
|
21
21
|
enumerable: true,
|
22
22
|
get: function () {
|
23
|
-
return
|
23
|
+
return _store.store;
|
24
24
|
}
|
25
25
|
});
|
26
|
-
Object.defineProperty(exports, "
|
26
|
+
Object.defineProperty(exports, "useShortcut", {
|
27
27
|
enumerable: true,
|
28
28
|
get: function () {
|
29
|
-
return
|
29
|
+
return _useShortcut.default;
|
30
30
|
}
|
31
31
|
});
|
32
32
|
|
package/build/store/actions.js
CHANGED
@@ -36,13 +36,14 @@ exports.unregisterShortcut = unregisterShortcut;
|
|
36
36
|
*
|
37
37
|
* @return {Object} action.
|
38
38
|
*/
|
39
|
-
function registerShortcut({
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
39
|
+
function registerShortcut(_ref) {
|
40
|
+
let {
|
41
|
+
name,
|
42
|
+
category,
|
43
|
+
description,
|
44
|
+
keyCombination,
|
45
|
+
aliases
|
46
|
+
} = _ref;
|
46
47
|
return {
|
47
48
|
type: 'REGISTER_SHORTCUT',
|
48
49
|
name,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/actions.js"],"names":["registerShortcut","name","category","description","keyCombination","aliases","type","unregisterShortcut"],"mappings":";;;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/actions.js"],"names":["registerShortcut","name","category","description","keyCombination","aliases","type","unregisterShortcut"],"mappings":";;;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,gBAAT,OAMH;AAAA,MAN8B;AACjCC,IAAAA,IADiC;AAEjCC,IAAAA,QAFiC;AAGjCC,IAAAA,WAHiC;AAIjCC,IAAAA,cAJiC;AAKjCC,IAAAA;AALiC,GAM9B;AACH,SAAO;AACNC,IAAAA,IAAI,EAAE,mBADA;AAENL,IAAAA,IAFM;AAGNC,IAAAA,QAHM;AAINE,IAAAA,cAJM;AAKNC,IAAAA,OALM;AAMNF,IAAAA;AANM,GAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,kBAAT,CAA6BN,IAA7B,EAAoC;AAC1C,SAAO;AACNK,IAAAA,IAAI,EAAE,qBADA;AAENL,IAAAA;AAFM,GAAP;AAIA","sourcesContent":["/** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */\n\n/**\n * Keyboard key combination.\n *\n * @typedef {Object} WPShortcutKeyCombination\n *\n * @property {string} character Character.\n * @property {WPKeycodeModifier|undefined} modifier Modifier.\n */\n\n/**\n * Configuration of a registered keyboard shortcut.\n *\n * @typedef {Object} WPShortcutConfig\n *\n * @property {string} name Shortcut name.\n * @property {string} category Shortcut category.\n * @property {string} description Shortcut description.\n * @property {WPShortcutKeyCombination} keyCombination Shortcut key combination.\n * @property {WPShortcutKeyCombination[]} [aliases] Shortcut aliases.\n */\n\n/**\n * Returns an action object used to register a new keyboard shortcut.\n *\n * @param {WPShortcutConfig} config Shortcut config.\n *\n * @return {Object} action.\n */\nexport function registerShortcut( {\n\tname,\n\tcategory,\n\tdescription,\n\tkeyCombination,\n\taliases,\n} ) {\n\treturn {\n\t\ttype: 'REGISTER_SHORTCUT',\n\t\tname,\n\t\tcategory,\n\t\tkeyCombination,\n\t\taliases,\n\t\tdescription,\n\t};\n}\n\n/**\n * Returns an action object used to unregister a keyboard shortcut.\n *\n * @param {string} name Shortcut name.\n *\n * @return {Object} action.\n */\nexport function unregisterShortcut( name ) {\n\treturn {\n\t\ttype: 'UNREGISTER_SHORTCUT',\n\t\tname,\n\t};\n}\n"]}
|
package/build/store/index.js
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
4
|
-
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
6
4
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
@@ -17,6 +15,10 @@ var actions = _interopRequireWildcard(require("./actions"));
|
|
17
15
|
|
18
16
|
var selectors = _interopRequireWildcard(require("./selectors"));
|
19
17
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
+
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
|
+
|
20
22
|
/**
|
21
23
|
* WordPress dependencies
|
22
24
|
*/
|
package/build/store/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/index.js"],"names":["STORE_NAME","store","reducer","actions","selectors"],"mappings":"
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/index.js"],"names":["STORE_NAME","store","reducer","actions","selectors"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;;;;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,MAAMA,UAAU,GAAG,yBAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,KAAK,GAAG,4BAAkBD,UAAlB,EAA8B;AAClDE,EAAAA,OAAO,EAAPA,gBADkD;AAElDC,EAAAA,OAFkD;AAGlDC,EAAAA;AAHkD,CAA9B,CAAd;;AAMP,oBAAUH,KAAV","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';\n\nconst STORE_NAME = 'core/keyboard-shortcuts';\n\n/**\n * Store definition for the keyboard shortcuts namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\nregister( store );\n"]}
|
package/build/store/reducer.js
CHANGED
@@ -19,7 +19,10 @@ var _lodash = require("lodash");
|
|
19
19
|
*
|
20
20
|
* @return {Object} Updated state.
|
21
21
|
*/
|
22
|
-
function reducer(
|
22
|
+
function reducer() {
|
23
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
24
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
25
|
+
|
23
26
|
switch (action.type) {
|
24
27
|
case 'REGISTER_SHORTCUT':
|
25
28
|
return { ...state,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/reducer.js"],"names":["reducer","state","action","type","name","category","keyCombination","aliases","description"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/reducer.js"],"names":["reducer","state","action","type","name","category","keyCombination","aliases","description"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,GAAuC;AAAA,MAArBC,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AACtC,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,mBAAL;AACC,aAAO,EACN,GAAGF,KADG;AAEN,SAAEC,MAAM,CAACE,IAAT,GAAiB;AAChBC,UAAAA,QAAQ,EAAEH,MAAM,CAACG,QADD;AAEhBC,UAAAA,cAAc,EAAEJ,MAAM,CAACI,cAFP;AAGhBC,UAAAA,OAAO,EAAEL,MAAM,CAACK,OAHA;AAIhBC,UAAAA,WAAW,EAAEN,MAAM,CAACM;AAJJ;AAFX,OAAP;;AASD,SAAK,qBAAL;AACC,aAAO,kBAAMP,KAAN,EAAaC,MAAM,CAACE,IAApB,CAAP;AAZF;;AAeA,SAAOH,KAAP;AACA;;eAEcD,O","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\n * Reducer returning the registered shortcuts\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nfunction reducer( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REGISTER_SHORTCUT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.name ]: {\n\t\t\t\t\tcategory: action.category,\n\t\t\t\t\tkeyCombination: action.keyCombination,\n\t\t\t\t\taliases: action.aliases,\n\t\t\t\t\tdescription: action.description,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'UNREGISTER_SHORTCUT':\n\t\t\treturn omit( state, action.name );\n\t}\n\n\treturn state;\n}\n\nexport default reducer;\n"]}
|
package/build/store/selectors.js
CHANGED
@@ -5,11 +5,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
+
exports.getCategoryShortcuts = exports.getAllShortcutRawKeyCombinations = exports.getAllShortcutKeyCombinations = void 0;
|
9
|
+
exports.getShortcutAliases = getShortcutAliases;
|
10
|
+
exports.getShortcutDescription = getShortcutDescription;
|
8
11
|
exports.getShortcutKeyCombination = getShortcutKeyCombination;
|
9
12
|
exports.getShortcutRepresentation = getShortcutRepresentation;
|
10
|
-
exports.getShortcutDescription = getShortcutDescription;
|
11
|
-
exports.getShortcutAliases = getShortcutAliases;
|
12
|
-
exports.getCategoryShortcuts = exports.getAllShortcutRawKeyCombinations = exports.getAllShortcutKeyCombinations = void 0;
|
13
13
|
|
14
14
|
var _rememo = _interopRequireDefault(require("rememo"));
|
15
15
|
|
@@ -91,7 +91,8 @@ function getShortcutKeyCombination(state, name) {
|
|
91
91
|
*/
|
92
92
|
|
93
93
|
|
94
|
-
function getShortcutRepresentation(state, name
|
94
|
+
function getShortcutRepresentation(state, name) {
|
95
|
+
let representation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'display';
|
95
96
|
const shortcut = getShortcutKeyCombination(state, name);
|
96
97
|
return getKeyCombinationRepresentation(shortcut, representation);
|
97
98
|
}
|
@@ -149,7 +150,13 @@ const getAllShortcutRawKeyCombinations = (0, _rememo.default)((state, name) => {
|
|
149
150
|
|
150
151
|
exports.getAllShortcutRawKeyCombinations = getAllShortcutRawKeyCombinations;
|
151
152
|
const getCategoryShortcuts = (0, _rememo.default)((state, categoryName) => {
|
152
|
-
return Object.entries(state).filter(
|
153
|
+
return Object.entries(state).filter(_ref => {
|
154
|
+
let [, shortcut] = _ref;
|
155
|
+
return shortcut.category === categoryName;
|
156
|
+
}).map(_ref2 => {
|
157
|
+
let [name] = _ref2;
|
158
|
+
return name;
|
159
|
+
});
|
153
160
|
}, state => [state]);
|
154
161
|
exports.getCategoryShortcuts = getCategoryShortcuts;
|
155
162
|
//# sourceMappingURL=selectors.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/selectors.js"],"names":["EMPTY_ARRAY","FORMATTING_METHODS","display","displayShortcut","raw","rawShortcut","ariaLabel","shortcutAriaLabel","getKeyCombinationRepresentation","shortcut","representation","modifier","character","getShortcutKeyCombination","state","name","keyCombination","getShortcutRepresentation","getShortcutDescription","description","getShortcutAliases","aliases","getAllShortcutKeyCombinations","getAllShortcutRawKeyCombinations","map","combination","getCategoryShortcuts","categoryName","Object","entries","filter","category"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,kBAAkB,GAAG;AAC1BC,EAAAA,OAAO,EAAEC,yBADiB;AAE1BC,EAAAA,GAAG,EAAEC,qBAFqB;AAG1BC,EAAAA,SAAS,EAAEC;AAHe,CAA3B;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,+BAAT,CAA0CC,QAA1C,EAAoDC,cAApD,EAAqE;AACpE,MAAK,CAAED,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SAAOA,QAAQ,CAACE,QAAT,GACJV,kBAAkB,CAAES,cAAF,CAAlB,CAAsCD,QAAQ,CAACE,QAA/C,EACAF,QAAQ,CAACG,SADT,CADI,GAIJH,QAAQ,CAACG,SAJZ;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,yBAAT,CAAoCC,KAApC,EAA2CC,IAA3C,EAAkD;AACxD,SAAOD,KAAK,CAAEC,IAAF,CAAL,GAAgBD,KAAK,CAAEC,IAAF,CAAL,CAAcC,cAA9B,GAA+C,IAAtD;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,yBAAT,CACNH,KADM,EAENC,IAFM,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/selectors.js"],"names":["EMPTY_ARRAY","FORMATTING_METHODS","display","displayShortcut","raw","rawShortcut","ariaLabel","shortcutAriaLabel","getKeyCombinationRepresentation","shortcut","representation","modifier","character","getShortcutKeyCombination","state","name","keyCombination","getShortcutRepresentation","getShortcutDescription","description","getShortcutAliases","aliases","getAllShortcutKeyCombinations","getAllShortcutRawKeyCombinations","map","combination","getCategoryShortcuts","categoryName","Object","entries","filter","category"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { compact } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tdisplayShortcut,\n\tshortcutAriaLabel,\n\trawShortcut,\n} from '@wordpress/keycodes';\n\n/** @typedef {import('./actions').WPShortcutKeyCombination} WPShortcutKeyCombination */\n\n/** @typedef {import('@wordpress/keycodes').WPKeycodeHandlerByModifier} WPKeycodeHandlerByModifier */\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation.\n *\n * @type {Array<any>}\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Shortcut formatting methods.\n *\n * @property {WPKeycodeHandlerByModifier} display Display formatting.\n * @property {WPKeycodeHandlerByModifier} rawShortcut Raw shortcut formatting.\n * @property {WPKeycodeHandlerByModifier} ariaLabel ARIA label formatting.\n */\nconst FORMATTING_METHODS = {\n\tdisplay: displayShortcut,\n\traw: rawShortcut,\n\tariaLabel: shortcutAriaLabel,\n};\n\n/**\n * Returns a string representing the key combination.\n *\n * @param {?WPShortcutKeyCombination} shortcut Key combination.\n * @param {keyof FORMATTING_METHODS} representation Type of representation\n * (display, raw, ariaLabel).\n *\n * @return {string?} Shortcut representation.\n */\nfunction getKeyCombinationRepresentation( shortcut, representation ) {\n\tif ( ! shortcut ) {\n\t\treturn null;\n\t}\n\n\treturn shortcut.modifier\n\t\t? FORMATTING_METHODS[ representation ][ shortcut.modifier ](\n\t\t\t\tshortcut.character\n\t\t )\n\t\t: shortcut.character;\n}\n\n/**\n * Returns the main key combination for a given shortcut name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n *\n * @return {WPShortcutKeyCombination?} Key combination.\n */\nexport function getShortcutKeyCombination( state, name ) {\n\treturn state[ name ] ? state[ name ].keyCombination : null;\n}\n\n/**\n * Returns a string representing the main key combination for a given shortcut name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n * @param {keyof FORMATTING_METHODS} representation Type of representation\n * (display, raw, ariaLabel).\n *\n * @return {string?} Shortcut representation.\n */\nexport function getShortcutRepresentation(\n\tstate,\n\tname,\n\trepresentation = 'display'\n) {\n\tconst shortcut = getShortcutKeyCombination( state, name );\n\treturn getKeyCombinationRepresentation( shortcut, representation );\n}\n\n/**\n * Returns the shortcut description given its name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n *\n * @return {string?} Shortcut description.\n */\nexport function getShortcutDescription( state, name ) {\n\treturn state[ name ] ? state[ name ].description : null;\n}\n\n/**\n * Returns the aliases for a given shortcut name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n *\n * @return {WPShortcutKeyCombination[]} Key combinations.\n */\nexport function getShortcutAliases( state, name ) {\n\treturn state[ name ] && state[ name ].aliases\n\t\t? state[ name ].aliases\n\t\t: EMPTY_ARRAY;\n}\n\nexport const getAllShortcutKeyCombinations = createSelector(\n\t( state, name ) => {\n\t\treturn compact( [\n\t\t\tgetShortcutKeyCombination( state, name ),\n\t\t\t...getShortcutAliases( state, name ),\n\t\t] );\n\t},\n\t( state, name ) => [ state[ name ] ]\n);\n\n/**\n * Returns the raw representation of all the keyboard combinations of a given shortcut name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n *\n * @return {string[]} Shortcuts.\n */\nexport const getAllShortcutRawKeyCombinations = createSelector(\n\t( state, name ) => {\n\t\treturn getAllShortcutKeyCombinations(\n\t\t\tstate,\n\t\t\tname\n\t\t).map( ( combination ) =>\n\t\t\tgetKeyCombinationRepresentation( combination, 'raw' )\n\t\t);\n\t},\n\t( state, name ) => [ state[ name ] ]\n);\n\n/**\n * Returns the shortcut names list for a given category name.\n *\n * @param {Object} state Global state.\n * @param {string} name Category name.\n *\n * @return {string[]} Shortcut names.\n */\nexport const getCategoryShortcuts = createSelector(\n\t( state, categoryName ) => {\n\t\treturn Object.entries( state )\n\t\t\t.filter( ( [ , shortcut ] ) => shortcut.category === categoryName )\n\t\t\t.map( ( [ name ] ) => name );\n\t},\n\t( state ) => [ state ]\n);\n"]}
|
@@ -30,10 +30,11 @@ export default function useShortcutEventMatch() {
|
|
30
30
|
*/
|
31
31
|
|
32
32
|
function isMatch(name, event) {
|
33
|
-
return getAllShortcutKeyCombinations(name).some(
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
return getAllShortcutKeyCombinations(name).some(_ref => {
|
34
|
+
let {
|
35
|
+
modifier,
|
36
|
+
character
|
37
|
+
} = _ref;
|
37
38
|
return isKeyboardEvent[modifier](event, character);
|
38
39
|
});
|
39
40
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/hooks/use-shortcut-event-match.js"],"names":["useSelect","isKeyboardEvent","store","keyboardShortcutsStore","useShortcutEventMatch","getAllShortcutKeyCombinations","isMatch","name","event","some","modifier","character"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,eAAT,QAAgC,qBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,sBAAlB,QAAgD,UAAhD;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,GAAiC;AAC/C,QAAM;AAAEC,IAAAA;AAAF,MAAoCL,SAAS,CAClDG,sBADkD,CAAnD;AAIA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,WAASG,OAAT,CAAkBC,IAAlB,EAAwBC,KAAxB,EAAgC;AAC/B,WAAOH,6BAA6B,CAAEE,IAAF,CAA7B,CAAsCE,IAAtC,CACN,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/hooks/use-shortcut-event-match.js"],"names":["useSelect","isKeyboardEvent","store","keyboardShortcutsStore","useShortcutEventMatch","getAllShortcutKeyCombinations","isMatch","name","event","some","modifier","character"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,eAAT,QAAgC,qBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,sBAAlB,QAAgD,UAAhD;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,GAAiC;AAC/C,QAAM;AAAEC,IAAAA;AAAF,MAAoCL,SAAS,CAClDG,sBADkD,CAAnD;AAIA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,WAASG,OAAT,CAAkBC,IAAlB,EAAwBC,KAAxB,EAAgC;AAC/B,WAAOH,6BAA6B,CAAEE,IAAF,CAA7B,CAAsCE,IAAtC,CACN,QAA+B;AAAA,UAA7B;AAAEC,QAAAA,QAAF;AAAYC,QAAAA;AAAZ,OAA6B;AAC9B,aAAOV,eAAe,CAAES,QAAF,CAAf,CAA6BF,KAA7B,EAAoCG,SAApC,CAAP;AACA,KAHK,CAAP;AAKA;;AAED,SAAOL,OAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { isKeyboardEvent } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as keyboardShortcutsStore } from '../store';\n\n/**\n * Returns a function to check if a keyboard event matches a shortcut name.\n *\n * @return {Function} A function to to check if a keyboard event matches a\n * predefined shortcut combination.\n */\nexport default function useShortcutEventMatch() {\n\tconst { getAllShortcutKeyCombinations } = useSelect(\n\t\tkeyboardShortcutsStore\n\t);\n\n\t/**\n\t * A function to check if a keyboard event matches a predefined shortcut\n\t * combination.\n\t *\n\t * @param {string} name Shortcut name.\n\t * @param {KeyboardEvent} event Event to check.\n\t *\n\t * @return {boolean} True if the event matches any shortcuts, false if not.\n\t */\n\tfunction isMatch( name, event ) {\n\t\treturn getAllShortcutKeyCombinations( name ).some(\n\t\t\t( { modifier, character } ) => {\n\t\t\t\treturn isKeyboardEvent[ modifier ]( event, character );\n\t\t\t}\n\t\t);\n\t}\n\n\treturn isMatch;\n}\n"]}
|
@@ -17,9 +17,10 @@ import { context } from '../context';
|
|
17
17
|
* @param {boolean} options.isDisabled Whether to disable to shortut.
|
18
18
|
*/
|
19
19
|
|
20
|
-
export default function useShortcut(name, callback
|
21
|
-
|
22
|
-
|
20
|
+
export default function useShortcut(name, callback) {
|
21
|
+
let {
|
22
|
+
isDisabled
|
23
|
+
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
23
24
|
const shortcuts = useContext(context);
|
24
25
|
const isMatch = useShortcutEventMatch();
|
25
26
|
const callbackRef = useRef();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/hooks/use-shortcut.js"],"names":["useContext","useEffect","useRef","useShortcutEventMatch","context","useShortcut","name","callback","isDisabled","shortcuts","isMatch","callbackRef","current","_callback","event","add","delete"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,EAAqBC,SAArB,EAAgCC,MAAhC,QAA8C,oBAA9C;AAEA;AACA;AACA;;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,SAASC,OAAT,QAAwB,YAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,CAAsBC,IAAtB,EAA4BC,QAA5B,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/hooks/use-shortcut.js"],"names":["useContext","useEffect","useRef","useShortcutEventMatch","context","useShortcut","name","callback","isDisabled","shortcuts","isMatch","callbackRef","current","_callback","event","add","delete"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,EAAqBC,SAArB,EAAgCC,MAAhC,QAA8C,oBAA9C;AAEA;AACA;AACA;;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,SAASC,OAAT,QAAwB,YAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,CAAsBC,IAAtB,EAA4BC,QAA5B,EAA4D;AAAA,MAAtB;AAAEC,IAAAA;AAAF,GAAsB,uEAAL,EAAK;AAC1E,QAAMC,SAAS,GAAGT,UAAU,CAAEI,OAAF,CAA5B;AACA,QAAMM,OAAO,GAAGP,qBAAqB,EAArC;AACA,QAAMQ,WAAW,GAAGT,MAAM,EAA1B;AACAS,EAAAA,WAAW,CAACC,OAAZ,GAAsBL,QAAtB;AAEAN,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKO,UAAL,EAAkB;AACjB;AACA;;AAED,aAASK,SAAT,CAAoBC,KAApB,EAA4B;AAC3B,UAAKJ,OAAO,CAAEJ,IAAF,EAAQQ,KAAR,CAAZ,EAA8B;AAC7BH,QAAAA,WAAW,CAACC,OAAZ,CAAqBE,KAArB;AACA;AACD;;AAEDL,IAAAA,SAAS,CAACG,OAAV,CAAkBG,GAAlB,CAAuBF,SAAvB;AACA,WAAO,MAAM;AACZJ,MAAAA,SAAS,CAACG,OAAV,CAAkBI,MAAlB,CAA0BH,SAA1B;AACA,KAFD;AAGA,GAfQ,EAeN,CAAEP,IAAF,EAAQE,UAAR,CAfM,CAAT;AAgBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext, useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useShortcutEventMatch from './use-shortcut-event-match';\nimport { context } from '../context';\n\n/**\n * Attach a keyboard shortcut handler.\n *\n * @param {string} name Shortcut name.\n * @param {Function} callback Shortcut callback.\n * @param {Object} options Shortcut options.\n * @param {boolean} options.isDisabled Whether to disable to shortut.\n */\nexport default function useShortcut( name, callback, { isDisabled } = {} ) {\n\tconst shortcuts = useContext( context );\n\tconst isMatch = useShortcutEventMatch();\n\tconst callbackRef = useRef();\n\tcallbackRef.current = callback;\n\n\tuseEffect( () => {\n\t\tif ( isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction _callback( event ) {\n\t\t\tif ( isMatch( name, event ) ) {\n\t\t\t\tcallbackRef.current( event );\n\t\t\t}\n\t\t}\n\n\t\tshortcuts.current.add( _callback );\n\t\treturn () => {\n\t\t\tshortcuts.current.delete( _callback );\n\t\t};\n\t}, [ name, isDisabled ] );\n}\n"]}
|
@@ -28,13 +28,14 @@
|
|
28
28
|
*
|
29
29
|
* @return {Object} action.
|
30
30
|
*/
|
31
|
-
export function registerShortcut({
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
export function registerShortcut(_ref) {
|
32
|
+
let {
|
33
|
+
name,
|
34
|
+
category,
|
35
|
+
description,
|
36
|
+
keyCombination,
|
37
|
+
aliases
|
38
|
+
} = _ref;
|
38
39
|
return {
|
39
40
|
type: 'REGISTER_SHORTCUT',
|
40
41
|
name,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/actions.js"],"names":["registerShortcut","name","category","description","keyCombination","aliases","type","unregisterShortcut"],"mappings":"AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAT,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/actions.js"],"names":["registerShortcut","name","category","description","keyCombination","aliases","type","unregisterShortcut"],"mappings":"AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAT,OAMH;AAAA,MAN8B;AACjCC,IAAAA,IADiC;AAEjCC,IAAAA,QAFiC;AAGjCC,IAAAA,WAHiC;AAIjCC,IAAAA,cAJiC;AAKjCC,IAAAA;AALiC,GAM9B;AACH,SAAO;AACNC,IAAAA,IAAI,EAAE,mBADA;AAENL,IAAAA,IAFM;AAGNC,IAAAA,QAHM;AAINE,IAAAA,cAJM;AAKNC,IAAAA,OALM;AAMNF,IAAAA;AANM,GAAP;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,kBAAT,CAA6BN,IAA7B,EAAoC;AAC1C,SAAO;AACNK,IAAAA,IAAI,EAAE,qBADA;AAENL,IAAAA;AAFM,GAAP;AAIA","sourcesContent":["/** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */\n\n/**\n * Keyboard key combination.\n *\n * @typedef {Object} WPShortcutKeyCombination\n *\n * @property {string} character Character.\n * @property {WPKeycodeModifier|undefined} modifier Modifier.\n */\n\n/**\n * Configuration of a registered keyboard shortcut.\n *\n * @typedef {Object} WPShortcutConfig\n *\n * @property {string} name Shortcut name.\n * @property {string} category Shortcut category.\n * @property {string} description Shortcut description.\n * @property {WPShortcutKeyCombination} keyCombination Shortcut key combination.\n * @property {WPShortcutKeyCombination[]} [aliases] Shortcut aliases.\n */\n\n/**\n * Returns an action object used to register a new keyboard shortcut.\n *\n * @param {WPShortcutConfig} config Shortcut config.\n *\n * @return {Object} action.\n */\nexport function registerShortcut( {\n\tname,\n\tcategory,\n\tdescription,\n\tkeyCombination,\n\taliases,\n} ) {\n\treturn {\n\t\ttype: 'REGISTER_SHORTCUT',\n\t\tname,\n\t\tcategory,\n\t\tkeyCombination,\n\t\taliases,\n\t\tdescription,\n\t};\n}\n\n/**\n * Returns an action object used to unregister a keyboard shortcut.\n *\n * @param {string} name Shortcut name.\n *\n * @return {Object} action.\n */\nexport function unregisterShortcut( name ) {\n\treturn {\n\t\ttype: 'UNREGISTER_SHORTCUT',\n\t\tname,\n\t};\n}\n"]}
|
@@ -11,7 +11,10 @@ import { omit } from 'lodash';
|
|
11
11
|
* @return {Object} Updated state.
|
12
12
|
*/
|
13
13
|
|
14
|
-
function reducer(
|
14
|
+
function reducer() {
|
15
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
16
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
17
|
+
|
15
18
|
switch (action.type) {
|
16
19
|
case 'REGISTER_SHORTCUT':
|
17
20
|
return { ...state,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/reducer.js"],"names":["omit","reducer","state","action","type","name","category","keyCombination","aliases","description"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,OAAT,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/reducer.js"],"names":["omit","reducer","state","action","type","name","category","keyCombination","aliases","description"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,OAAT,GAAuC;AAAA,MAArBC,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AACtC,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,mBAAL;AACC,aAAO,EACN,GAAGF,KADG;AAEN,SAAEC,MAAM,CAACE,IAAT,GAAiB;AAChBC,UAAAA,QAAQ,EAAEH,MAAM,CAACG,QADD;AAEhBC,UAAAA,cAAc,EAAEJ,MAAM,CAACI,cAFP;AAGhBC,UAAAA,OAAO,EAAEL,MAAM,CAACK,OAHA;AAIhBC,UAAAA,WAAW,EAAEN,MAAM,CAACM;AAJJ;AAFX,OAAP;;AASD,SAAK,qBAAL;AACC,aAAOT,IAAI,CAAEE,KAAF,EAASC,MAAM,CAACE,IAAhB,CAAX;AAZF;;AAeA,SAAOH,KAAP;AACA;;AAED,eAAeD,OAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\n * Reducer returning the registered shortcuts\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nfunction reducer( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REGISTER_SHORTCUT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.name ]: {\n\t\t\t\t\tcategory: action.category,\n\t\t\t\t\tkeyCombination: action.keyCombination,\n\t\t\t\t\taliases: action.aliases,\n\t\t\t\t\tdescription: action.description,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'UNREGISTER_SHORTCUT':\n\t\t\treturn omit( state, action.name );\n\t}\n\n\treturn state;\n}\n\nexport default reducer;\n"]}
|
@@ -74,7 +74,8 @@ export function getShortcutKeyCombination(state, name) {
|
|
74
74
|
* @return {string?} Shortcut representation.
|
75
75
|
*/
|
76
76
|
|
77
|
-
export function getShortcutRepresentation(state, name
|
77
|
+
export function getShortcutRepresentation(state, name) {
|
78
|
+
let representation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'display';
|
78
79
|
const shortcut = getShortcutKeyCombination(state, name);
|
79
80
|
return getKeyCombinationRepresentation(shortcut, representation);
|
80
81
|
}
|
@@ -127,6 +128,12 @@ export const getAllShortcutRawKeyCombinations = createSelector((state, name) =>
|
|
127
128
|
*/
|
128
129
|
|
129
130
|
export const getCategoryShortcuts = createSelector((state, categoryName) => {
|
130
|
-
return Object.entries(state).filter(
|
131
|
+
return Object.entries(state).filter(_ref => {
|
132
|
+
let [, shortcut] = _ref;
|
133
|
+
return shortcut.category === categoryName;
|
134
|
+
}).map(_ref2 => {
|
135
|
+
let [name] = _ref2;
|
136
|
+
return name;
|
137
|
+
});
|
131
138
|
}, state => [state]);
|
132
139
|
//# sourceMappingURL=selectors.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/selectors.js"],"names":["createSelector","compact","displayShortcut","shortcutAriaLabel","rawShortcut","EMPTY_ARRAY","FORMATTING_METHODS","display","raw","ariaLabel","getKeyCombinationRepresentation","shortcut","representation","modifier","character","getShortcutKeyCombination","state","name","keyCombination","getShortcutRepresentation","getShortcutDescription","description","getShortcutAliases","aliases","getAllShortcutKeyCombinations","getAllShortcutRawKeyCombinations","map","combination","getCategoryShortcuts","categoryName","Object","entries","filter","category"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AACA,SAASC,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SACCC,eADD,EAECC,iBAFD,EAGCC,WAHD,QAIO,qBAJP;AAMA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,WAAW,GAAG,EAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,kBAAkB,GAAG;AAC1BC,EAAAA,OAAO,EAAEL,eADiB;AAE1BM,EAAAA,GAAG,EAAEJ,WAFqB;AAG1BK,EAAAA,SAAS,EAAEN;AAHe,CAA3B;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASO,+BAAT,CAA0CC,QAA1C,EAAoDC,cAApD,EAAqE;AACpE,MAAK,CAAED,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SAAOA,QAAQ,CAACE,QAAT,GACJP,kBAAkB,CAAEM,cAAF,CAAlB,CAAsCD,QAAQ,CAACE,QAA/C,EACAF,QAAQ,CAACG,SADT,CADI,GAIJH,QAAQ,CAACG,SAJZ;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAASC,yBAAT,CAAoCC,KAApC,EAA2CC,IAA3C,EAAkD;AACxD,SAAOD,KAAK,CAAEC,IAAF,CAAL,GAAgBD,KAAK,CAAEC,IAAF,CAAL,CAAcC,cAA9B,GAA+C,IAAtD;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,yBAAT,CACNH,KADM,EAENC,IAFM,
|
1
|
+
{"version":3,"sources":["@wordpress/keyboard-shortcuts/src/store/selectors.js"],"names":["createSelector","compact","displayShortcut","shortcutAriaLabel","rawShortcut","EMPTY_ARRAY","FORMATTING_METHODS","display","raw","ariaLabel","getKeyCombinationRepresentation","shortcut","representation","modifier","character","getShortcutKeyCombination","state","name","keyCombination","getShortcutRepresentation","getShortcutDescription","description","getShortcutAliases","aliases","getAllShortcutKeyCombinations","getAllShortcutRawKeyCombinations","map","combination","getCategoryShortcuts","categoryName","Object","entries","filter","category"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { compact } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tdisplayShortcut,\n\tshortcutAriaLabel,\n\trawShortcut,\n} from '@wordpress/keycodes';\n\n/** @typedef {import('./actions').WPShortcutKeyCombination} WPShortcutKeyCombination */\n\n/** @typedef {import('@wordpress/keycodes').WPKeycodeHandlerByModifier} WPKeycodeHandlerByModifier */\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation.\n *\n * @type {Array<any>}\n */\nconst EMPTY_ARRAY = [];\n\n/**\n * Shortcut formatting methods.\n *\n * @property {WPKeycodeHandlerByModifier} display Display formatting.\n * @property {WPKeycodeHandlerByModifier} rawShortcut Raw shortcut formatting.\n * @property {WPKeycodeHandlerByModifier} ariaLabel ARIA label formatting.\n */\nconst FORMATTING_METHODS = {\n\tdisplay: displayShortcut,\n\traw: rawShortcut,\n\tariaLabel: shortcutAriaLabel,\n};\n\n/**\n * Returns a string representing the key combination.\n *\n * @param {?WPShortcutKeyCombination} shortcut Key combination.\n * @param {keyof FORMATTING_METHODS} representation Type of representation\n * (display, raw, ariaLabel).\n *\n * @return {string?} Shortcut representation.\n */\nfunction getKeyCombinationRepresentation( shortcut, representation ) {\n\tif ( ! shortcut ) {\n\t\treturn null;\n\t}\n\n\treturn shortcut.modifier\n\t\t? FORMATTING_METHODS[ representation ][ shortcut.modifier ](\n\t\t\t\tshortcut.character\n\t\t )\n\t\t: shortcut.character;\n}\n\n/**\n * Returns the main key combination for a given shortcut name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n *\n * @return {WPShortcutKeyCombination?} Key combination.\n */\nexport function getShortcutKeyCombination( state, name ) {\n\treturn state[ name ] ? state[ name ].keyCombination : null;\n}\n\n/**\n * Returns a string representing the main key combination for a given shortcut name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n * @param {keyof FORMATTING_METHODS} representation Type of representation\n * (display, raw, ariaLabel).\n *\n * @return {string?} Shortcut representation.\n */\nexport function getShortcutRepresentation(\n\tstate,\n\tname,\n\trepresentation = 'display'\n) {\n\tconst shortcut = getShortcutKeyCombination( state, name );\n\treturn getKeyCombinationRepresentation( shortcut, representation );\n}\n\n/**\n * Returns the shortcut description given its name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n *\n * @return {string?} Shortcut description.\n */\nexport function getShortcutDescription( state, name ) {\n\treturn state[ name ] ? state[ name ].description : null;\n}\n\n/**\n * Returns the aliases for a given shortcut name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n *\n * @return {WPShortcutKeyCombination[]} Key combinations.\n */\nexport function getShortcutAliases( state, name ) {\n\treturn state[ name ] && state[ name ].aliases\n\t\t? state[ name ].aliases\n\t\t: EMPTY_ARRAY;\n}\n\nexport const getAllShortcutKeyCombinations = createSelector(\n\t( state, name ) => {\n\t\treturn compact( [\n\t\t\tgetShortcutKeyCombination( state, name ),\n\t\t\t...getShortcutAliases( state, name ),\n\t\t] );\n\t},\n\t( state, name ) => [ state[ name ] ]\n);\n\n/**\n * Returns the raw representation of all the keyboard combinations of a given shortcut name.\n *\n * @param {Object} state Global state.\n * @param {string} name Shortcut name.\n *\n * @return {string[]} Shortcuts.\n */\nexport const getAllShortcutRawKeyCombinations = createSelector(\n\t( state, name ) => {\n\t\treturn getAllShortcutKeyCombinations(\n\t\t\tstate,\n\t\t\tname\n\t\t).map( ( combination ) =>\n\t\t\tgetKeyCombinationRepresentation( combination, 'raw' )\n\t\t);\n\t},\n\t( state, name ) => [ state[ name ] ]\n);\n\n/**\n * Returns the shortcut names list for a given category name.\n *\n * @param {Object} state Global state.\n * @param {string} name Category name.\n *\n * @return {string[]} Shortcut names.\n */\nexport const getCategoryShortcuts = createSelector(\n\t( state, categoryName ) => {\n\t\treturn Object.entries( state )\n\t\t\t.filter( ( [ , shortcut ] ) => shortcut.category === categoryName )\n\t\t\t.map( ( [ name ] ) => name );\n\t},\n\t( state ) => [ state ]\n);\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/keyboard-shortcuts",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.6",
|
4
4
|
"description": "Handling keyboard shortcuts.",
|
5
5
|
"author": "The WordPress Contributors",
|
6
6
|
"license": "GPL-2.0-or-later",
|
@@ -25,16 +25,16 @@
|
|
25
25
|
"module": "build-module/index.js",
|
26
26
|
"react-native": "src/index",
|
27
27
|
"dependencies": {
|
28
|
-
"@babel/runtime": "^7.
|
29
|
-
"@wordpress/compose": "^5.0.
|
30
|
-
"@wordpress/data": "^6.1.
|
31
|
-
"@wordpress/element": "^4.0.
|
32
|
-
"@wordpress/keycodes": "^3.2.
|
28
|
+
"@babel/runtime": "^7.16.0",
|
29
|
+
"@wordpress/compose": "^5.0.6",
|
30
|
+
"@wordpress/data": "^6.1.4",
|
31
|
+
"@wordpress/element": "^4.0.4",
|
32
|
+
"@wordpress/keycodes": "^3.2.4",
|
33
33
|
"lodash": "^4.17.21",
|
34
34
|
"rememo": "^3.0.0"
|
35
35
|
},
|
36
36
|
"publishConfig": {
|
37
37
|
"access": "public"
|
38
38
|
},
|
39
|
-
"gitHead": "
|
39
|
+
"gitHead": "9a1dd3474d937468e4cf9caf9886ad61ef0a8f50"
|
40
40
|
}
|