@types/wordpress__block-editor 14.21.3 → 14.21.4
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.
|
@@ -8,7 +8,7 @@ This package contains type definitions for @wordpress/block-editor (https://gith
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wordpress__block-editor.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Tue, 23 Dec 2025
|
|
11
|
+
* Last updated: Tue, 23 Dec 2025 20:36:26 GMT
|
|
12
12
|
* Dependencies: [@types/react](https://npmjs.com/package/@types/react), [@types/wordpress__blocks](https://npmjs.com/package/@types/wordpress__blocks), [@wordpress/components](https://npmjs.com/package/@wordpress/components), [@wordpress/data](https://npmjs.com/package/@wordpress/data), [@wordpress/element](https://npmjs.com/package/@wordpress/element), [@wordpress/keycodes](https://npmjs.com/package/@wordpress/keycodes), [react-autosize-textarea](https://npmjs.com/package/react-autosize-textarea)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -64,5 +64,6 @@ export { default as BlockEditorProvider } from "./provider";
|
|
|
64
64
|
*/
|
|
65
65
|
export { useBlockBindingsUtils } from "./use-block-bindings-utils";
|
|
66
66
|
export { useBlockEditContext } from "./use-block-edit-context";
|
|
67
|
+
export { useBlockEditingMode } from "./use-block-editing-mode";
|
|
67
68
|
export { useBlockProps } from "./use-block-props";
|
|
68
69
|
export { useSettings } from "./use-settings";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export namespace useBlockEditingMode {
|
|
2
|
+
type BlockEditingMode = "disabled" | "contentOnly" | "default";
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Allows a block to restrict the user interface that is displayed for editing
|
|
7
|
+
* that block and its inner blocks.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```js
|
|
11
|
+
* function MyBlock( { attributes, setAttributes } ) {
|
|
12
|
+
* useBlockEditingMode( 'disabled' );
|
|
13
|
+
* return <div { ...useBlockProps() }></div>;
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* `mode` can be one of three options:
|
|
18
|
+
*
|
|
19
|
+
* - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be
|
|
20
|
+
* selected.
|
|
21
|
+
* - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the
|
|
22
|
+
* toolbar, the block movers, block settings.
|
|
23
|
+
* - `'default'`: Allows editing the block as normal.
|
|
24
|
+
*
|
|
25
|
+
* The mode is inherited by all of the block's inner blocks, unless they have
|
|
26
|
+
* their own mode.
|
|
27
|
+
*
|
|
28
|
+
* If called outside of a block context, the mode is applied to all blocks.
|
|
29
|
+
*
|
|
30
|
+
* @param {?useBlockEditingMode.BlockEditingMode} mode The editing mode to apply. If undefined, the
|
|
31
|
+
* current editing mode is not changed.
|
|
32
|
+
*
|
|
33
|
+
* @return {useBlockEditingMode.BlockEditingMode} The current editing mode.
|
|
34
|
+
*/
|
|
35
|
+
export function useBlockEditingMode(mode?: useBlockEditingMode.BlockEditingMode): useBlockEditingMode.BlockEditingMode;
|
|
@@ -10,6 +10,9 @@ export * from "./utils";
|
|
|
10
10
|
declare module "@wordpress/data" {
|
|
11
11
|
function dispatch(key: "core/block-editor"): typeof import("./store/actions");
|
|
12
12
|
function select(key: "core/block-editor"): typeof import("./store/selectors");
|
|
13
|
+
|
|
14
|
+
function useDispatch(key: "core/block-editor"): typeof import("./store/actions");
|
|
15
|
+
function useSelect(key: "core/block-editor"): typeof import("./store/selectors");
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
export interface BlockEditorStoreDescriptor extends StoreDescriptor {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/wordpress__block-editor",
|
|
3
|
-
"version": "14.21.
|
|
3
|
+
"version": "14.21.4",
|
|
4
4
|
"description": "TypeScript definitions for @wordpress/block-editor",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wordpress__block-editor",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"react-autosize-textarea": "^7.1.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {},
|
|
47
|
-
"typesPublisherContentHash": "
|
|
47
|
+
"typesPublisherContentHash": "be5a7edcfff07cca8c6ac9b12c90fadc91c74b412165604095a706ef88ca5ed1",
|
|
48
48
|
"typeScriptVersion": "5.2"
|
|
49
49
|
}
|