@types/wordpress__block-editor 6.0.3 → 6.0.6

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: Mon, 12 Jul 2021 15:31:23 GMT
11
+ * Last updated: Wed, 30 Mar 2022 19:31:45 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
 
@@ -12,7 +12,7 @@ export { default as BlockFormatControls } from './block-format-controls';
12
12
  export { default as BlockIcon } from './block-icon';
13
13
  export { default as BlockNavigationDropdown } from './block-navigation/dropdown';
14
14
  export { default as BlockVerticalAlignmentToolbar } from './block-vertical-alignment-toolbar';
15
- export { default as ButtonBlockerAppender } from './button-block-appender';
15
+ export { default as ButtonBlockAppender } from './button-block-appender';
16
16
  export { default as ColorPalette } from './color-palette';
17
17
  export { default as ContrastChecker } from './contrast-checker';
18
18
  export { default as InnerBlocks } from './inner-blocks';
@@ -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';
@@ -45,7 +45,7 @@ declare const InnerBlocks: {
45
45
  * display a `+` (plus) icon button that, when clicked, displays the block picker menu. No
46
46
  * default Block is inserted.
47
47
  */
48
- ButtonBlockerAppender: ComponentType<{ children?: never | undefined }>;
48
+ ButtonBlockAppender: ComponentType<{ children?: never | undefined }>;
49
49
  /**
50
50
  * display the default block appender as set by `wp.blocks.setDefaultBlockName`. Typically this
51
51
  * is the `paragraph` block.
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/wordpress__block-editor",
3
- "version": "6.0.3",
3
+ "version": "6.0.6",
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",
@@ -38,6 +38,6 @@
38
38
  "@wordpress/element": "^3.0.0",
39
39
  "react-autosize-textarea": "^7.1.0"
40
40
  },
41
- "typesPublisherContentHash": "c35b5f7cff4521a037ba99138263ab1deb271ab0c9523b83852e720da2b43a32",
42
- "typeScriptVersion": "3.6"
41
+ "typesPublisherContentHash": "7309e469e3ef95ded043c5979866b1492606d16ae6b84b1f94f71a91c9383f5d",
42
+ "typeScriptVersion": "3.9"
43
43
  }