@types/wordpress__block-editor 6.0.4 → 7.0.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.
@@ -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: Sun, 29 Aug 2021 16:31:27 GMT
11
+ * Last updated: Wed, 13 Apr 2022 20:31:24 GMT
12
12
  * Dependencies: [@types/wordpress__blocks](https://npmjs.com/package/@types/wordpress__blocks), [@types/wordpress__data](https://npmjs.com/package/@types/wordpress__data), [@types/react](https://npmjs.com/package/@types/react), [@types/wordpress__components](https://npmjs.com/package/@types/wordpress__components), [@types/react-autosize-textarea](https://npmjs.com/package/@types/react-autosize-textarea), [@types/wordpress__keycodes](https://npmjs.com/package/@types/wordpress__keycodes)
13
13
  * Global values: none
14
14
 
@@ -56,3 +56,8 @@ export { default as WritingFlow } from './writing-flow';
56
56
  * State Related Components
57
57
  */
58
58
  export { default as BlockEditorProvider } from './provider';
59
+
60
+ /*
61
+ * Hooks
62
+ */
63
+ export { useBlockProps } from './use-block-props';
@@ -6,6 +6,11 @@ import { displayShortcut, rawShortcut } from '@wordpress/keycodes';
6
6
 
7
7
  declare namespace RichText {
8
8
  interface Props<T extends keyof HTMLElementTagNameMap> extends Omit<HTMLProps<T>, 'onChange'> {
9
+ /**
10
+ * By default, all registered formats are allowed. This setting can be used to fine-tune
11
+ * the allowed formats.
12
+ */
13
+ allowedFormats?: string[] | undefined;
9
14
  /**
10
15
  * A list of autocompleters to use instead of the default.
11
16
  */
@@ -0,0 +1,29 @@
1
+ import { Ref, RefCallback } from 'react';
2
+
3
+ export interface Reserved {
4
+ id: string;
5
+ role: 'document';
6
+ tabIndex: 0;
7
+ 'aria-label': string;
8
+ 'data-block': string;
9
+ 'data-type': string;
10
+ 'data-title': string;
11
+ }
12
+
13
+ export interface Merged {
14
+ className: string;
15
+ style: Record<string, unknown>;
16
+ ref: RefCallback<unknown>;
17
+ }
18
+
19
+ export interface UseBlockProps {
20
+ <Props extends Record<string, unknown>>(
21
+ props?: Props & {
22
+ [K in keyof Props]: K extends keyof Reserved ? never : Props[K];
23
+ } & { ref?: Ref<unknown> },
24
+ ): Omit<Props, 'ref'> & Merged & Reserved;
25
+
26
+ save: (props?: Record<string, unknown>) => Record<string, unknown>;
27
+ }
28
+
29
+ export const useBlockProps: UseBlockProps;
@@ -1,4 +1,4 @@
1
- // Type definitions for @wordpress/block-editor 6.0
1
+ // Type definitions for @wordpress/block-editor 7.0
2
2
  // Project: https://github.com/WordPress/gutenberg/tree/master/packages/block-editor/README.md
3
3
  // Definitions by: Derek Sifford <https://github.com/dsifford>
4
4
  // Jon Surrell <https://github.com/sirreal>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/wordpress__block-editor",
3
- "version": "6.0.4",
3
+ "version": "7.0.0",
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",
@@ -35,9 +35,9 @@
35
35
  "@types/wordpress__components": "*",
36
36
  "@types/wordpress__data": "*",
37
37
  "@types/wordpress__keycodes": "*",
38
- "@wordpress/element": "^3.0.0",
38
+ "@wordpress/element": "^4.0.0",
39
39
  "react-autosize-textarea": "^7.1.0"
40
40
  },
41
- "typesPublisherContentHash": "1f7f262aa7ae156329e3cfe9cd92e841c12dde25f79835969c9aec8eb1efa5af",
42
- "typeScriptVersion": "3.7"
41
+ "typesPublisherContentHash": "0f135fb743581f055c43b9ce8e9dd1388e0ef8b77e0453b8c7b2745ae02ca385",
42
+ "typeScriptVersion": "3.9"
43
43
  }