@wordpress/customize-widgets 5.51.0 → 5.52.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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.52.0 (2026-07-29)
6
+
5
7
  ## 5.51.0 (2026-07-14)
6
8
 
7
9
  ### Enhancements
@@ -27,12 +27,21 @@ var import_keyboard_shortcuts = require("@wordpress/keyboard-shortcuts");
27
27
  var import_keycodes = require("@wordpress/keycodes");
28
28
  var import_data = require("@wordpress/data");
29
29
  var import_i18n = require("@wordpress/i18n");
30
+ var import_block_editor = require("@wordpress/block-editor");
31
+ var import_lock_unlock = require("../../lock-unlock.cjs");
32
+ var { usesNativeUndo } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
30
33
  function KeyboardShortcuts({ undo, redo, save }) {
31
34
  (0, import_keyboard_shortcuts.useShortcut)("core/customize-widgets/undo", (event) => {
35
+ if (usesNativeUndo(event)) {
36
+ return;
37
+ }
32
38
  undo();
33
39
  event.preventDefault();
34
40
  });
35
41
  (0, import_keyboard_shortcuts.useShortcut)("core/customize-widgets/redo", (event) => {
42
+ if (usesNativeUndo(event)) {
43
+ return;
44
+ }
36
45
  redo();
37
46
  event.preventDefault();
38
47
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/keyboard-shortcuts/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\nfunction KeyboardShortcuts( { undo, redo, save } ) {\n\tuseShortcut( 'core/customize-widgets/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsave();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/customize-widgets/undo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/redo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/save' );\n\t\t};\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0B;AAC1B,gCAGO;AACP,sBAA0B;AAC1B,kBAA4B;AAC5B,kBAAmB;AAEnB,SAAS,kBAAmB,EAAE,MAAM,MAAM,KAAK,GAAI;AAClD,6CAAa,+BAA+B,CAAE,UAAW;AACxD,SAAK;AACL,UAAM,eAAe;AAAA,EACtB,CAAE;AAEF,6CAAa,+BAA+B,CAAE,UAAW;AACxD,SAAK;AACL,UAAM,eAAe;AAAA,EACtB,CAAE;AAEF,6CAAa,+BAA+B,CAAE,UAAW;AACxD,UAAM,eAAe;AACrB,SAAK;AAAA,EACN,CAAE;AAEF,SAAO;AACR;AAEA,SAAS,4BAA4B;AACpC,QAAM,EAAE,kBAAkB,mBAAmB,QAAI;AAAA,IAChD,0BAAAA;AAAA,EACD;AAEA,gCAAW,MAAM;AAChB,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,yBAA0B;AAAA,MAC3C,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,IACD,CAAE;AAEF,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,sBAAuB;AAAA,MACxC,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,aAAS,2BAAU,IAChB,CAAC,IACD;AAAA,QACA;AAAA,UACC,UAAU;AAAA,UACV,WAAW;AAAA,QACZ;AAAA,MACA;AAAA,IACJ,CAAE;AAEF,qBAAkB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,iBAAa,gBAAI,oBAAqB;AAAA,MACtC,gBAAgB;AAAA,QACf,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,IACD,CAAE;AAEF,WAAO,MAAM;AACZ,yBAAoB,6BAA8B;AAClD,yBAAoB,6BAA8B;AAClD,yBAAoB,6BAA8B;AAAA,IACnD;AAAA,EACD,GAAG,CAAE,gBAAiB,CAAE;AAExB,SAAO;AACR;AAEA,kBAAkB,WAAW;AAC7B,IAAO,6BAAQ;",
6
- "names": ["keyboardShortcutsStore"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { usesNativeUndo } = unlock( blockEditorPrivateApis );\n\nfunction KeyboardShortcuts( { undo, redo, save } ) {\n\tuseShortcut( 'core/customize-widgets/undo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/redo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsave();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/customize-widgets/undo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/redo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/save' );\n\t\t};\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0B;AAC1B,gCAGO;AACP,sBAA0B;AAC1B,kBAA4B;AAC5B,kBAAmB;AACnB,0BAAsD;AAKtD,yBAAuB;AAEvB,IAAM,EAAE,eA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,yBAAoB,6BAA8B;AAClD,yBAAoB,6BAA8B;AAAA,IACnD;AAAA,EACD,GAAG,CAAE,gBAAiB,CAAE;AAExB,SAAO;AACR;AAEA,kBAAkB,WAAW;AAC7B,IAAO,6BAAQ;",
6
+ "names": ["blockEditorPrivateApis", "keyboardShortcutsStore"]
7
7
  }
@@ -7,12 +7,21 @@ import {
7
7
  import { isAppleOS } from "@wordpress/keycodes";
8
8
  import { useDispatch } from "@wordpress/data";
9
9
  import { __ } from "@wordpress/i18n";
10
+ import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
11
+ import { unlock } from "../../lock-unlock.mjs";
12
+ var { usesNativeUndo } = unlock(blockEditorPrivateApis);
10
13
  function KeyboardShortcuts({ undo, redo, save }) {
11
14
  useShortcut("core/customize-widgets/undo", (event) => {
15
+ if (usesNativeUndo(event)) {
16
+ return;
17
+ }
12
18
  undo();
13
19
  event.preventDefault();
14
20
  });
15
21
  useShortcut("core/customize-widgets/redo", (event) => {
22
+ if (usesNativeUndo(event)) {
23
+ return;
24
+ }
16
25
  redo();
17
26
  event.preventDefault();
18
27
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/keyboard-shortcuts/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\nfunction KeyboardShortcuts( { undo, redo, save } ) {\n\tuseShortcut( 'core/customize-widgets/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsave();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/customize-widgets/undo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/redo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/save' );\n\t\t};\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortc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AAoB,6BAA8B;AAClD,yBAAoB,6BAA8B;AAAA,IACnD;AAAA,EACD,GAAG,CAAE,gBAAiB,CAAE;AAExB,SAAO;AACR;AAEA,kBAAkB,WAAW;AAC7B,IAAO,6BAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { usesNativeUndo } = unlock( blockEditorPrivateApis );\n\nfunction KeyboardShortcuts( { undo, redo, save } ) {\n\tuseShortcut( 'core/customize-widgets/undo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/redo', ( event ) => {\n\t\tif ( usesNativeUndo( event ) ) {\n\t\t\treturn;\n\t\t}\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsave();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/customize-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/customize-widgets/undo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/redo' );\n\t\t\tunregisterShortcut( 'core/customize-widgets/save' );\n\t\t};\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAC1B;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,UAAU;AACnB,SAAS,eAAe,8BAA8B;AAKtD,SAAS,cAAc;AAEvB,IAAM,EAAE,eAAe,IAAI,OAAQ,sBAAuB;AAE1D,SAAS,kBAAmB,EAAE,MAAM,MAAM,KAAK,GAAI;AAClD,cAAa,+BAA+B,CAAE,UAAW;AACxD,QAAK,eAAgB,KAAM,GAAI;AAC9B;AAAA,IACD;AACA,SAAK;AACL,UA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1
  {
2
2
  "name": "@wordpress/customize-widgets",
3
- "version": "5.51.0",
3
+ "version": "5.52.0",
4
4
  "description": "Widgets blocks in Customizer Module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -39,28 +39,28 @@
39
39
  },
40
40
  "wpScript": true,
41
41
  "dependencies": {
42
- "@wordpress/base-styles": "^11.0.0",
43
- "@wordpress/block-editor": "^16.0.0",
44
- "@wordpress/block-library": "^10.2.0",
45
- "@wordpress/blocks": "^15.24.0",
46
- "@wordpress/components": "^37.0.0",
47
- "@wordpress/compose": "^8.4.0",
48
- "@wordpress/core-data": "^7.51.0",
49
- "@wordpress/data": "^10.51.0",
50
- "@wordpress/dom": "^4.51.0",
51
- "@wordpress/element": "^8.3.0",
52
- "@wordpress/hooks": "^4.51.0",
53
- "@wordpress/i18n": "^6.24.0",
54
- "@wordpress/icons": "^15.2.0",
55
- "@wordpress/interface": "^9.36.0",
56
- "@wordpress/is-shallow-equal": "^5.51.0",
57
- "@wordpress/keyboard-shortcuts": "^5.51.0",
58
- "@wordpress/keycodes": "^4.51.0",
59
- "@wordpress/media-utils": "^5.51.0",
60
- "@wordpress/preferences": "^4.51.0",
61
- "@wordpress/private-apis": "^1.51.0",
62
- "@wordpress/ui": "^0.18.0",
63
- "@wordpress/widgets": "^4.51.0",
42
+ "@wordpress/base-styles": "^12.0.0",
43
+ "@wordpress/block-editor": "^16.1.0",
44
+ "@wordpress/block-library": "^10.3.0",
45
+ "@wordpress/blocks": "^15.25.0",
46
+ "@wordpress/components": "^38.0.0",
47
+ "@wordpress/compose": "^8.5.0",
48
+ "@wordpress/core-data": "^7.52.0",
49
+ "@wordpress/data": "^10.52.0",
50
+ "@wordpress/dom": "^4.52.0",
51
+ "@wordpress/element": "^8.4.0",
52
+ "@wordpress/hooks": "^4.52.0",
53
+ "@wordpress/i18n": "^6.25.0",
54
+ "@wordpress/icons": "^15.3.0",
55
+ "@wordpress/interface": "^9.37.0",
56
+ "@wordpress/is-shallow-equal": "^5.52.0",
57
+ "@wordpress/keyboard-shortcuts": "^5.52.0",
58
+ "@wordpress/keycodes": "^4.52.0",
59
+ "@wordpress/media-utils": "^5.52.0",
60
+ "@wordpress/preferences": "^4.52.0",
61
+ "@wordpress/private-apis": "^1.52.0",
62
+ "@wordpress/ui": "^0.19.0",
63
+ "@wordpress/widgets": "^4.52.0",
64
64
  "clsx": "^2.1.1",
65
65
  "fast-deep-equal": "^3.1.3"
66
66
  },
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "e9a74f9c14095a34398ecd4d1f7a908e55051205"
78
+ "gitHead": "7e8b17a983f9391d3ebc7717af2a1c9ed7efc7ab"
79
79
  }
@@ -9,14 +9,28 @@ import {
9
9
  import { isAppleOS } from '@wordpress/keycodes';
10
10
  import { useDispatch } from '@wordpress/data';
11
11
  import { __ } from '@wordpress/i18n';
12
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import { unlock } from '../../lock-unlock';
18
+
19
+ const { usesNativeUndo } = unlock( blockEditorPrivateApis );
12
20
 
13
21
  function KeyboardShortcuts( { undo, redo, save } ) {
14
22
  useShortcut( 'core/customize-widgets/undo', ( event ) => {
23
+ if ( usesNativeUndo( event ) ) {
24
+ return;
25
+ }
15
26
  undo();
16
27
  event.preventDefault();
17
28
  } );
18
29
 
19
30
  useShortcut( 'core/customize-widgets/redo', ( event ) => {
31
+ if ( usesNativeUndo( event ) ) {
32
+ return;
33
+ }
20
34
  redo();
21
35
  event.preventDefault();
22
36
  } );