@wordpress/commands 1.32.0 → 1.32.1-next.ff1cebbba.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +2 -2
  2. package/build/components/command-menu.js +261 -246
  3. package/build/components/command-menu.js.map +7 -1
  4. package/build/hooks/use-command-context.js +31 -35
  5. package/build/hooks/use-command-context.js.map +7 -1
  6. package/build/hooks/use-command-loader.js +35 -92
  7. package/build/hooks/use-command-loader.js.map +7 -1
  8. package/build/hooks/use-command.js +53 -90
  9. package/build/hooks/use-command.js.map +7 -1
  10. package/build/index.js +49 -45
  11. package/build/index.js.map +7 -1
  12. package/build/lock-unlock.js +31 -15
  13. package/build/lock-unlock.js.map +7 -1
  14. package/build/private-apis.js +41 -19
  15. package/build/private-apis.js.map +7 -1
  16. package/build/store/actions.js +42 -92
  17. package/build/store/actions.js.map +7 -1
  18. package/build/store/index.js +47 -44
  19. package/build/store/index.js.map +7 -1
  20. package/build/store/private-actions.js +27 -14
  21. package/build/store/private-actions.js.map +7 -1
  22. package/build/store/reducer.js +39 -70
  23. package/build/store/reducer.js.map +7 -1
  24. package/build/store/selectors.js +47 -54
  25. package/build/store/selectors.js.map +7 -1
  26. package/build-module/components/command-menu.js +232 -229
  27. package/build-module/components/command-menu.js.map +7 -1
  28. package/build-module/hooks/use-command-context.js +11 -28
  29. package/build-module/hooks/use-command-context.js.map +7 -1
  30. package/build-module/hooks/use-command-loader.js +17 -87
  31. package/build-module/hooks/use-command-loader.js.map +7 -1
  32. package/build-module/hooks/use-command.js +25 -79
  33. package/build-module/hooks/use-command.js.map +7 -1
  34. package/build-module/index.js +14 -6
  35. package/build-module/index.js.map +7 -1
  36. package/build-module/lock-unlock.js +8 -7
  37. package/build-module/lock-unlock.js.map +7 -1
  38. package/build-module/private-apis.js +7 -11
  39. package/build-module/private-apis.js.map +7 -1
  40. package/build-module/store/actions.js +21 -88
  41. package/build-module/store/actions.js.map +7 -1
  42. package/build-module/store/index.js +12 -32
  43. package/build-module/store/index.js.map +7 -1
  44. package/build-module/store/private-actions.js +6 -10
  45. package/build-module/store/private-actions.js.map +7 -1
  46. package/build-module/store/reducer.js +20 -64
  47. package/build-module/store/reducer.js.map +7 -1
  48. package/build-module/store/selectors.js +24 -49
  49. package/build-module/store/selectors.js.map +7 -1
  50. package/build-style/style-rtl.css +7 -138
  51. package/build-style/style.css +7 -138
  52. package/package.json +18 -10
  53. package/src/components/command-menu.js +4 -1
  54. package/src/components/style.scss +10 -0
  55. package/src/hooks/use-command.js +2 -2
  56. package/src/style.scss +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/commands",
3
- "version": "1.32.0",
3
+ "version": "1.32.1-next.ff1cebbba.0",
4
4
  "description": "Handles the commands menu.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -25,17 +25,25 @@
25
25
  },
26
26
  "main": "build/index.js",
27
27
  "module": "build-module/index.js",
28
+ "exports": {
29
+ ".": {
30
+ "import": "./build-module/index.js",
31
+ "require": "./build/index.js"
32
+ },
33
+ "./package.json": "./package.json",
34
+ "./build-style/": "./build-style/"
35
+ },
28
36
  "react-native": "src/index",
29
37
  "wpScript": true,
30
38
  "dependencies": {
31
- "@babel/runtime": "7.25.7",
32
- "@wordpress/components": "^30.5.0",
33
- "@wordpress/data": "^10.32.0",
34
- "@wordpress/element": "^6.32.0",
35
- "@wordpress/i18n": "^6.5.0",
36
- "@wordpress/icons": "^10.32.0",
37
- "@wordpress/keyboard-shortcuts": "^5.32.0",
38
- "@wordpress/private-apis": "^1.32.0",
39
+ "@wordpress/base-styles": "^6.8.1-next.ff1cebbba.0",
40
+ "@wordpress/components": "^30.6.1-next.ff1cebbba.0",
41
+ "@wordpress/data": "^10.32.1-next.ff1cebbba.0",
42
+ "@wordpress/element": "^6.32.1-next.ff1cebbba.0",
43
+ "@wordpress/i18n": "^6.5.1-next.ff1cebbba.0",
44
+ "@wordpress/icons": "^11.0.1-next.ff1cebbba.0",
45
+ "@wordpress/keyboard-shortcuts": "^5.32.1-next.ff1cebbba.0",
46
+ "@wordpress/private-apis": "^1.32.1-next.ff1cebbba.0",
39
47
  "clsx": "^2.1.1",
40
48
  "cmdk": "^1.0.0"
41
49
  },
@@ -46,5 +54,5 @@
46
54
  "publishConfig": {
47
55
  "access": "public"
48
56
  },
49
- "gitHead": "a030b4c0e0695239b942c7dc18511782b64f10ed"
57
+ "gitHead": "c5b659710aff01d40d2eb97b211eb2cec9c07d3b"
50
58
  }
@@ -271,12 +271,15 @@ export function CommandMenu() {
271
271
  <div className="commands-command-menu__container">
272
272
  <Command label={ inputLabel } onKeyDown={ onKeyDown }>
273
273
  <div className="commands-command-menu__header">
274
+ <Icon
275
+ className="commands-command-menu__header-search-icon"
276
+ icon={ inputIcon }
277
+ />
274
278
  <CommandInput
275
279
  search={ search }
276
280
  setSearch={ setSearch }
277
281
  isOpen={ isOpen }
278
282
  />
279
- <Icon icon={ inputIcon } />
280
283
  </div>
281
284
  <Command.List label={ __( 'Command suggestions' ) }>
282
285
  { search && ! isLoading && (
@@ -1,3 +1,7 @@
1
+ @use "@wordpress/base-styles/mixins" as *;
2
+ @use "@wordpress/base-styles/variables" as *;
3
+ @use "@wordpress/base-styles/colors" as *;
4
+
1
5
  // dirty hack to clean up modal
2
6
  .commands-command-menu {
3
7
  border-radius: $grid-unit-05;
@@ -42,6 +46,12 @@
42
46
  }
43
47
  }
44
48
 
49
+ .commands-command-menu__header-search-icon {
50
+ &:dir(ltr) {
51
+ transform: scaleX(-1);
52
+ }
53
+ }
54
+
45
55
  .commands-command-menu__container {
46
56
  // the style here is a hack to force safari to repaint to avoid a style glitch
47
57
  will-change: transform;
@@ -74,7 +74,7 @@ export function useCommand( command ) {
74
74
  * @example
75
75
  * ```js
76
76
  * import { useCommands } from '@wordpress/commands';
77
- * import { plus, edit } from '@wordpress/icons';
77
+ * import { plus, pencil } from '@wordpress/icons';
78
78
  *
79
79
  * useCommands( [
80
80
  * {
@@ -89,7 +89,7 @@ export function useCommand( command ) {
89
89
  * {
90
90
  * name: 'myplugin/edit-posts',
91
91
  * label: __( 'Edit posts' ),
92
- * icon: edit,
92
+ * icon: pencil,
93
93
  * callback: ({ close }) => {
94
94
  * document.location.href = 'edit.php';
95
95
  * close();
package/src/style.scss CHANGED
@@ -1 +1,2 @@
1
- @import "./components/style.scss";
1
+ @use "@wordpress/base-styles/default-custom-properties" as *;
2
+ @use "./components/style.scss" as *;