@wordpress/commands 1.32.0 → 1.32.1-next.47f435fc9.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/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.47f435fc9.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
|
-
"@
|
|
32
|
-
"@wordpress/components": "^30.
|
|
33
|
-
"@wordpress/data": "^10.32.0",
|
|
34
|
-
"@wordpress/element": "^6.32.0",
|
|
35
|
-
"@wordpress/i18n": "^6.5.0",
|
|
36
|
-
"@wordpress/icons": "^
|
|
37
|
-
"@wordpress/keyboard-shortcuts": "^5.32.0",
|
|
38
|
-
"@wordpress/private-apis": "^1.32.0",
|
|
39
|
+
"@wordpress/base-styles": "^6.8.1-next.47f435fc9.0",
|
|
40
|
+
"@wordpress/components": "^30.6.1-next.47f435fc9.0",
|
|
41
|
+
"@wordpress/data": "^10.32.1-next.47f435fc9.0",
|
|
42
|
+
"@wordpress/element": "^6.32.1-next.47f435fc9.0",
|
|
43
|
+
"@wordpress/i18n": "^6.5.1-next.47f435fc9.0",
|
|
44
|
+
"@wordpress/icons": "^11.0.1-next.47f435fc9.0",
|
|
45
|
+
"@wordpress/keyboard-shortcuts": "^5.32.1-next.47f435fc9.0",
|
|
46
|
+
"@wordpress/private-apis": "^1.32.1-next.47f435fc9.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": "
|
|
57
|
+
"gitHead": "9720f22c138771d2ed1a0522725c3cdf1c242953"
|
|
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;
|
package/src/hooks/use-command.js
CHANGED
|
@@ -74,7 +74,7 @@ export function useCommand( command ) {
|
|
|
74
74
|
* @example
|
|
75
75
|
* ```js
|
|
76
76
|
* import { useCommands } from '@wordpress/commands';
|
|
77
|
-
* import { plus,
|
|
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:
|
|
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
|
-
@
|
|
1
|
+
@use "@wordpress/base-styles/default-custom-properties" as *;
|
|
2
|
+
@use "./components/style.scss" as *;
|