@types/wordpress__block-editor 11.5.11 → 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: Tue, 27 Feb 2024 19:07:10 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
 
@@ -29,15 +29,33 @@ declare namespace InnerBlocks {
29
29
  /**
30
30
  * Template locking allows locking the `InnerBlocks` area for the current template.
31
31
  *
32
+ * - `'contentOnly'` — prevents all operations. Additionally, the block types that don't have content are hidden from the list view and can't gain focus within the block list. Unlike the other lock types, this is not overrideable by children.
32
33
  * - `'all'` — prevents all operations. It is not possible to insert new blocks. Move existing blocks or delete them.
33
34
  * - `'insert'` — prevents inserting or removing blocks, but allows moving existing ones.
34
35
  * - `false` — prevents locking from being applied to an `InnerBlocks` area even if a parent block contains locking.
35
36
  *
36
37
  * If locking is not set in an `InnerBlocks` area: the locking of the parent `InnerBlocks` area is used.
38
+ * Note that contentOnly can't be overridden: it's present, the templateLock value of any children is ignored.
37
39
  *
38
40
  * If the block is a top level block: the locking of the Custom Post Type is used.
39
41
  */
40
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;
41
59
  }
42
60
  }
43
61
  declare const InnerBlocks: {
@@ -59,7 +77,9 @@ export interface UseInnerBlocksProps {
59
77
  <Props extends Record<string, unknown>>(
60
78
  props?: Props & { ref?: Ref<unknown> },
61
79
  options?: InnerBlocks.Props,
62
- ): Omit<Props, "ref"> & Merged & Reserved;
80
+ ): Omit<Props, "ref"> & Merged & Reserved & {
81
+ children: ReactElement;
82
+ };
63
83
 
64
84
  save: (props?: Record<string, unknown>) => Record<string, unknown>;
65
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`
@@ -20,7 +20,7 @@ export const store: BlockEditorStoreDescriptor;
20
20
 
21
21
  export type EditorBlockMode = "html" | "visual";
22
22
  export type EditorMode = "text" | "visual";
23
- export type EditorTemplateLock = "all" | "insert" | false;
23
+ export type EditorTemplateLock = "contentOnly" | "all" | "insert" | false;
24
24
 
25
25
  export interface EditorBaseSetting {
26
26
  name: string;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/wordpress__block-editor",
3
- "version": "11.5.11",
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": "1210f34aa53c1447a4c626b5ae5ab002417234d2f67b4783eaff3b9b9c25eb02",
42
- "typeScriptVersion": "4.6"
41
+ "typesPublisherContentHash": "9b2bb6f4dc01fdfc86b8fbbfba0d9a037e40f87bca318a53268f312eb723dab9",
42
+ "typeScriptVersion": "4.7"
43
43
  }