@wordpress/keyboard-shortcuts 4.35.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.0.0 (2024-05-31)
6
+
7
+ ### Breaking Changes
8
+
9
+ - Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
10
+
5
11
  ## 4.35.0 (2024-05-16)
6
12
 
7
13
  ## 4.34.0 (2024-05-02)
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ShortcutProvider = ShortcutProvider;
7
- var _react = require("react");
8
7
  var _element = require("@wordpress/element");
9
8
  var _context = require("../context");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
10
  /**
11
11
  * WordPress dependencies
12
12
  */
@@ -40,12 +40,13 @@ function ShortcutProvider(props) {
40
40
  }
41
41
 
42
42
  /* eslint-disable jsx-a11y/no-static-element-interactions */
43
- return (0, _react.createElement)(Provider, {
44
- value: keyboardShortcuts
45
- }, (0, _react.createElement)("div", {
46
- ...props,
47
- onKeyDown: onKeyDown
48
- }));
43
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Provider, {
44
+ value: keyboardShortcuts,
45
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
46
+ ...props,
47
+ onKeyDown: onKeyDown
48
+ })
49
+ });
49
50
  /* eslint-enable jsx-a11y/no-static-element-interactions */
50
51
  }
51
52
  //# sourceMappingURL=shortcut-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_context","Provider","context","ShortcutProvider","props","keyboardShortcuts","useState","Set","onKeyDown","event","keyboardShortcut","_react","createElement","value"],"sources":["@wordpress/keyboard-shortcuts/src/components/shortcut-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { context } from '../context';\n\nconst { Provider } = context;\n\n/**\n * Handles callbacks added to context by `useShortcut`.\n * Adding a provider allows to register contextual shortcuts\n * that are only active when a certain part of the UI is focused.\n *\n * @param {Object} props Props to pass to `div`.\n *\n * @return {Element} Component.\n */\nexport function ShortcutProvider( props ) {\n\tconst [ keyboardShortcuts ] = useState( () => new Set() );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( props.onKeyDown ) {\n\t\t\tprops.onKeyDown( event );\n\t\t}\n\n\t\tfor ( const keyboardShortcut of keyboardShortcuts ) {\n\t\t\tkeyboardShortcut( event );\n\t\t}\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\treturn (\n\t\t<Provider value={ keyboardShortcuts }>\n\t\t\t<div { ...props } onKeyDown={ onKeyDown } />\n\t\t</Provider>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EAAEE;AAAS,CAAC,GAAGC,gBAAO;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAEC,KAAK,EAAG;EACzC,MAAM,CAAEC,iBAAiB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,MAAM,IAAIC,GAAG,CAAC,CAAE,CAAC;EAEzD,SAASC,SAASA,CAAEC,KAAK,EAAG;IAC3B,IAAKL,KAAK,CAACI,SAAS,EAAG;MACtBJ,KAAK,CAACI,SAAS,CAAEC,KAAM,CAAC;IACzB;IAEA,KAAM,MAAMC,gBAAgB,IAAIL,iBAAiB,EAAG;MACnDK,gBAAgB,CAAED,KAAM,CAAC;IAC1B;EACD;;EAEA;EACA,OACC,IAAAE,MAAA,CAAAC,aAAA,EAACX,QAAQ;IAACY,KAAK,EAAGR;EAAmB,GACpC,IAAAM,MAAA,CAAAC,aAAA;IAAA,GAAUR,KAAK;IAAGI,SAAS,EAAGA;EAAW,CAAE,CAClC,CAAC;EAEZ;AACD","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_context","_jsxRuntime","Provider","context","ShortcutProvider","props","keyboardShortcuts","useState","Set","onKeyDown","event","keyboardShortcut","jsx","value","children"],"sources":["@wordpress/keyboard-shortcuts/src/components/shortcut-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { context } from '../context';\n\nconst { Provider } = context;\n\n/**\n * Handles callbacks added to context by `useShortcut`.\n * Adding a provider allows to register contextual shortcuts\n * that are only active when a certain part of the UI is focused.\n *\n * @param {Object} props Props to pass to `div`.\n *\n * @return {Element} Component.\n */\nexport function ShortcutProvider( props ) {\n\tconst [ keyboardShortcuts ] = useState( () => new Set() );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( props.onKeyDown ) {\n\t\t\tprops.onKeyDown( event );\n\t\t}\n\n\t\tfor ( const keyboardShortcut of keyboardShortcuts ) {\n\t\t\tkeyboardShortcut( event );\n\t\t}\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\treturn (\n\t\t<Provider value={ keyboardShortcuts }>\n\t\t\t<div { ...props } onKeyDown={ onKeyDown } />\n\t\t</Provider>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AARrC;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EAAEG;AAAS,CAAC,GAAGC,gBAAO;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAAEC,KAAK,EAAG;EACzC,MAAM,CAAEC,iBAAiB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,MAAM,IAAIC,GAAG,CAAC,CAAE,CAAC;EAEzD,SAASC,SAASA,CAAEC,KAAK,EAAG;IAC3B,IAAKL,KAAK,CAACI,SAAS,EAAG;MACtBJ,KAAK,CAACI,SAAS,CAAEC,KAAM,CAAC;IACzB;IAEA,KAAM,MAAMC,gBAAgB,IAAIL,iBAAiB,EAAG;MACnDK,gBAAgB,CAAED,KAAM,CAAC;IAC1B;EACD;;EAEA;EACA,oBACC,IAAAT,WAAA,CAAAW,GAAA,EAACV,QAAQ;IAACW,KAAK,EAAGP,iBAAmB;IAAAQ,QAAA,eACpC,IAAAb,WAAA,CAAAW,GAAA;MAAA,GAAUP,KAAK;MAAGI,SAAS,EAAGA;IAAW,CAAE;EAAC,CACnC,CAAC;EAEZ;AACD","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -8,6 +7,7 @@ import { useState } from '@wordpress/element';
8
7
  * Internal dependencies
9
8
  */
10
9
  import { context } from '../context';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  const {
12
12
  Provider
13
13
  } = context;
@@ -33,12 +33,13 @@ export function ShortcutProvider(props) {
33
33
  }
34
34
 
35
35
  /* eslint-disable jsx-a11y/no-static-element-interactions */
36
- return createElement(Provider, {
37
- value: keyboardShortcuts
38
- }, createElement("div", {
39
- ...props,
40
- onKeyDown: onKeyDown
41
- }));
36
+ return /*#__PURE__*/_jsx(Provider, {
37
+ value: keyboardShortcuts,
38
+ children: /*#__PURE__*/_jsx("div", {
39
+ ...props,
40
+ onKeyDown: onKeyDown
41
+ })
42
+ });
42
43
  /* eslint-enable jsx-a11y/no-static-element-interactions */
43
44
  }
44
45
  //# sourceMappingURL=shortcut-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useState","context","Provider","ShortcutProvider","props","keyboardShortcuts","Set","onKeyDown","event","keyboardShortcut","createElement","value"],"sources":["@wordpress/keyboard-shortcuts/src/components/shortcut-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { context } from '../context';\n\nconst { Provider } = context;\n\n/**\n * Handles callbacks added to context by `useShortcut`.\n * Adding a provider allows to register contextual shortcuts\n * that are only active when a certain part of the UI is focused.\n *\n * @param {Object} props Props to pass to `div`.\n *\n * @return {Element} Component.\n */\nexport function ShortcutProvider( props ) {\n\tconst [ keyboardShortcuts ] = useState( () => new Set() );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( props.onKeyDown ) {\n\t\t\tprops.onKeyDown( event );\n\t\t}\n\n\t\tfor ( const keyboardShortcut of keyboardShortcuts ) {\n\t\t\tkeyboardShortcut( event );\n\t\t}\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\treturn (\n\t\t<Provider value={ keyboardShortcuts }>\n\t\t\t<div { ...props } onKeyDown={ onKeyDown } />\n\t\t</Provider>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,OAAO,QAAQ,YAAY;AAEpC,MAAM;EAAEC;AAAS,CAAC,GAAGD,OAAO;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAAEC,KAAK,EAAG;EACzC,MAAM,CAAEC,iBAAiB,CAAE,GAAGL,QAAQ,CAAE,MAAM,IAAIM,GAAG,CAAC,CAAE,CAAC;EAEzD,SAASC,SAASA,CAAEC,KAAK,EAAG;IAC3B,IAAKJ,KAAK,CAACG,SAAS,EAAG;MACtBH,KAAK,CAACG,SAAS,CAAEC,KAAM,CAAC;IACzB;IAEA,KAAM,MAAMC,gBAAgB,IAAIJ,iBAAiB,EAAG;MACnDI,gBAAgB,CAAED,KAAM,CAAC;IAC1B;EACD;;EAEA;EACA,OACCE,aAAA,CAACR,QAAQ;IAACS,KAAK,EAAGN;EAAmB,GACpCK,aAAA;IAAA,GAAUN,KAAK;IAAGG,SAAS,EAAGA;EAAW,CAAE,CAClC,CAAC;EAEZ;AACD","ignoreList":[]}
1
+ {"version":3,"names":["useState","context","jsx","_jsx","Provider","ShortcutProvider","props","keyboardShortcuts","Set","onKeyDown","event","keyboardShortcut","value","children"],"sources":["@wordpress/keyboard-shortcuts/src/components/shortcut-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { context } from '../context';\n\nconst { Provider } = context;\n\n/**\n * Handles callbacks added to context by `useShortcut`.\n * Adding a provider allows to register contextual shortcuts\n * that are only active when a certain part of the UI is focused.\n *\n * @param {Object} props Props to pass to `div`.\n *\n * @return {Element} Component.\n */\nexport function ShortcutProvider( props ) {\n\tconst [ keyboardShortcuts ] = useState( () => new Set() );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( props.onKeyDown ) {\n\t\t\tprops.onKeyDown( event );\n\t\t}\n\n\t\tfor ( const keyboardShortcut of keyboardShortcuts ) {\n\t\t\tkeyboardShortcut( event );\n\t\t}\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\treturn (\n\t\t<Provider value={ keyboardShortcuts }>\n\t\t\t<div { ...props } onKeyDown={ onKeyDown } />\n\t\t</Provider>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,OAAO,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,MAAM;EAAEC;AAAS,CAAC,GAAGH,OAAO;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAAEC,KAAK,EAAG;EACzC,MAAM,CAAEC,iBAAiB,CAAE,GAAGP,QAAQ,CAAE,MAAM,IAAIQ,GAAG,CAAC,CAAE,CAAC;EAEzD,SAASC,SAASA,CAAEC,KAAK,EAAG;IAC3B,IAAKJ,KAAK,CAACG,SAAS,EAAG;MACtBH,KAAK,CAACG,SAAS,CAAEC,KAAM,CAAC;IACzB;IAEA,KAAM,MAAMC,gBAAgB,IAAIJ,iBAAiB,EAAG;MACnDI,gBAAgB,CAAED,KAAM,CAAC;IAC1B;EACD;;EAEA;EACA,oBACCP,IAAA,CAACC,QAAQ;IAACQ,KAAK,EAAGL,iBAAmB;IAAAM,QAAA,eACpCV,IAAA;MAAA,GAAUG,KAAK;MAAGG,SAAS,EAAGA;IAAW,CAAE;EAAC,CACnC,CAAC;EAEZ;AACD","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/keyboard-shortcuts",
3
- "version": "4.35.0",
3
+ "version": "5.0.1",
4
4
  "description": "Handling keyboard shortcuts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -19,16 +19,17 @@
19
19
  "url": "https://github.com/WordPress/gutenberg/issues"
20
20
  },
21
21
  "engines": {
22
- "node": ">=12"
22
+ "node": ">=18.12.0",
23
+ "npm": ">=8.19.2"
23
24
  },
24
25
  "main": "build/index.js",
25
26
  "module": "build-module/index.js",
26
27
  "react-native": "src/index",
27
28
  "dependencies": {
28
29
  "@babel/runtime": "^7.16.0",
29
- "@wordpress/data": "^9.28.0",
30
- "@wordpress/element": "^5.35.0",
31
- "@wordpress/keycodes": "^3.58.0"
30
+ "@wordpress/data": "^10.0.1",
31
+ "@wordpress/element": "^6.0.1",
32
+ "@wordpress/keycodes": "^4.0.1"
32
33
  },
33
34
  "peerDependencies": {
34
35
  "react": "^18.0.0"
@@ -36,5 +37,5 @@
36
37
  "publishConfig": {
37
38
  "access": "public"
38
39
  },
39
- "gitHead": "42f38f287506a6b3ed8ccba839b18ad066821044"
40
+ "gitHead": "0e973525f7787401b5a544e0727774d52a78639f"
40
41
  }