@types/wordpress__block-editor 11.5.12 → 11.5.13

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: Sat, 16 Mar 2024 12:09:31 GMT
11
+ * Last updated: Wed, 20 Mar 2024 03:07:00 GMT
12
12
  * Dependencies: [@types/react](https://npmjs.com/package/@types/react), [@types/wordpress__blocks](https://npmjs.com/package/@types/wordpress__blocks), [@types/wordpress__components](https://npmjs.com/package/@types/wordpress__components), [@types/wordpress__keycodes](https://npmjs.com/package/@types/wordpress__keycodes), [@wordpress/data](https://npmjs.com/package/@wordpress/data), [@wordpress/element](https://npmjs.com/package/@wordpress/element), [react-autosize-textarea](https://npmjs.com/package/react-autosize-textarea)
13
13
 
14
14
  # Credits
@@ -2,8 +2,16 @@ import { Slot, Toolbar } from "@wordpress/components";
2
2
  import { FC, JSX, ReactNode } from "react";
3
3
 
4
4
  declare namespace BlockControls {
5
+ type BlockControlGroup =
6
+ | "default"
7
+ | "block"
8
+ | "inline"
9
+ | "other"
10
+ | "parent";
11
+
5
12
  interface Props extends Pick<Toolbar.Props, "controls"> {
6
13
  children: ReactNode;
14
+ group?: BlockControlGroup | undefined;
7
15
  }
8
16
  }
9
17
  declare const BlockControls: {
@@ -1,5 +1,5 @@
1
1
  import { TemplateArray } from "@wordpress/blocks";
2
- import { ComponentType, JSX, Ref } from "react";
2
+ import { ComponentType, JSX, ReactElement, Ref } from "react";
3
3
 
4
4
  import { EditorTemplateLock } from "../";
5
5
 
@@ -40,6 +40,22 @@ declare namespace InnerBlocks {
40
40
  * If the block is a top level block: the locking of the Custom Post Type is used.
41
41
  */
42
42
  templateLock?: EditorTemplateLock | undefined;
43
+
44
+ /**
45
+ * By default, InnerBlocks expects its blocks to be shown in a vertical list. A valid use-case is to style inner blocks to appear
46
+ * horizontally, for instance by adding CSS flex or grid properties to the inner blocks wrapper. When blocks are styled in such
47
+ * a way, the orientation prop can be set to indicate that a horizontal layout is being used.
48
+ * Specifying this prop does not affect the layout of the inner blocks, but results in the block mover icons in the child blocks
49
+ * being displayed horizontally, and also ensures that drag and drop works correctly.
50
+ */
51
+ orientation?: "vertical" | "horizontal" | undefined;
52
+
53
+ /**
54
+ * Determines which block types should be shown in the block inserter. For example, when inserting a block within the Navigation
55
+ * block we specify `core/navigation-link` and `core/navigation-link/page` as these are the most commonly used inner blocks.
56
+ * `prioritizedInserterBlocks` takes an array of the form {blockName}/{variationName}, where {variationName} is optional.
57
+ */
58
+ prioritizedInserterBlocks?: string[] | undefined;
43
59
  }
44
60
  }
45
61
  declare const InnerBlocks: {
@@ -61,7 +77,9 @@ export interface UseInnerBlocksProps {
61
77
  <Props extends Record<string, unknown>>(
62
78
  props?: Props & { ref?: Ref<unknown> },
63
79
  options?: InnerBlocks.Props,
64
- ): Omit<Props, "ref"> & Merged & Reserved;
80
+ ): Omit<Props, "ref"> & Merged & Reserved & {
81
+ children: ReactElement;
82
+ };
65
83
 
66
84
  save: (props?: Record<string, unknown>) => Record<string, unknown>;
67
85
  }
@@ -48,7 +48,7 @@ declare namespace RichText {
48
48
  * off. Here you should create a new block with that content and return it. Note that you
49
49
  * also need to provide `onReplace` in order for this to take any effect.
50
50
  */
51
- onSplit?(value: string): void;
51
+ onSplit?(value: string, isOriginal?: boolean): void;
52
52
  onTagNameChange?(tagName: keyof HTMLElementTagNameMap): void;
53
53
  /**
54
54
  * Placeholder text to show when the field is empty, similar to the `input` and `textarea`
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/wordpress__block-editor",
3
- "version": "11.5.12",
3
+ "version": "11.5.13",
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": "^5.0.0",
39
39
  "react-autosize-textarea": "^7.1.0"
40
40
  },
41
- "typesPublisherContentHash": "1d55a5822166f52b50696464fca3b46ddc96210549b93aec73129f2df6feaa38",
41
+ "typesPublisherContentHash": "9b2bb6f4dc01fdfc86b8fbbfba0d9a037e40f87bca318a53268f312eb723dab9",
42
42
  "typeScriptVersion": "4.7"
43
43
  }