@types/wordpress__block-editor 11.5.12 → 11.5.14
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.
- wordpress__block-editor/README.md +2 -2
- wordpress__block-editor/components/alignment-toolbar.d.ts +3 -3
- wordpress__block-editor/components/block-controls.d.ts +19 -4
- wordpress__block-editor/components/block-format-controls.d.ts +2 -2
- wordpress__block-editor/components/block-icon.d.ts +2 -2
- wordpress__block-editor/components/font-sizes.d.ts +3 -3
- wordpress__block-editor/components/inner-blocks.d.ts +20 -2
- wordpress__block-editor/components/inserter.d.ts +2 -2
- wordpress__block-editor/components/inspector-advanced-controls.d.ts +2 -2
- wordpress__block-editor/components/inspector-controls.d.ts +2 -2
- wordpress__block-editor/components/media-placeholder.d.ts +4 -4
- wordpress__block-editor/components/navigable-toolbar.d.ts +2 -2
- wordpress__block-editor/components/panel-color-settings.d.ts +4 -4
- wordpress__block-editor/components/rich-text.d.ts +4 -4
- wordpress__block-editor/components/url-popover.d.ts +3 -3
- wordpress__block-editor/package.json +4 -4
|
@@ -8,8 +8,8 @@ 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:
|
|
12
|
-
* Dependencies: [@types/react](https://npmjs.com/package/@types/react), [@types/wordpress__blocks](https://npmjs.com/package/@types/wordpress__blocks), [@
|
|
11
|
+
* Last updated: Wed, 03 Apr 2024 18:35:48 GMT
|
|
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
|
|
15
15
|
These definitions were written by [Derek Sifford](https://github.com/dsifford), [Jon Surrell](https://github.com/sirreal), and [Dennis Snell](https://github.com/dmsnell).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentType
|
|
1
|
+
import { IconType } from "@wordpress/components";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace AlignmentToolbar {
|
|
5
5
|
interface Props {
|
|
6
6
|
alignmentControls?:
|
|
7
7
|
| Array<{
|
|
8
8
|
align: string;
|
|
9
|
-
icon:
|
|
9
|
+
icon: IconType;
|
|
10
10
|
title: string;
|
|
11
11
|
}>
|
|
12
12
|
| undefined;
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { Slot,
|
|
2
|
-
import { FC, JSX, ReactNode } from "react";
|
|
1
|
+
import { Slot, ToolbarGroup } from "@wordpress/components";
|
|
2
|
+
import { ComponentProps, FC, JSX, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
type GetArrayTypeFromPossibleNestedArray<TestType extends Record<string, unknown> | Array<Record<string, unknown>>> =
|
|
5
|
+
TestType extends Array<Record<string, unknown>> ? TestType[number] : TestType;
|
|
6
|
+
type BlockControlControlsType = GetArrayTypeFromPossibleNestedArray<
|
|
7
|
+
NonNullable<Parameters<typeof ToolbarGroup>[0]["controls"]>[number]
|
|
8
|
+
>;
|
|
3
9
|
|
|
4
10
|
declare namespace BlockControls {
|
|
5
|
-
|
|
11
|
+
type BlockControlGroup =
|
|
12
|
+
| "default"
|
|
13
|
+
| "block"
|
|
14
|
+
| "inline"
|
|
15
|
+
| "other"
|
|
16
|
+
| "parent";
|
|
17
|
+
|
|
18
|
+
interface Props {
|
|
19
|
+
controls?: Array<BlockControlControlsType | BlockControlControlsType[]>;
|
|
6
20
|
children: ReactNode;
|
|
21
|
+
group?: BlockControlGroup | undefined;
|
|
7
22
|
}
|
|
8
23
|
}
|
|
9
24
|
declare const BlockControls: {
|
|
10
25
|
(props: BlockControls.Props): JSX.Element;
|
|
11
|
-
Slot: FC<Omit<Slot
|
|
26
|
+
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
|
|
12
27
|
};
|
|
13
28
|
|
|
14
29
|
export default BlockControls;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Slot } from "@wordpress/components";
|
|
2
|
-
import { FC, JSX, ReactNode } from "react";
|
|
2
|
+
import { ComponentProps, FC, JSX, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace BlockFormatControls {
|
|
5
5
|
interface Props {
|
|
@@ -8,7 +8,7 @@ declare namespace BlockFormatControls {
|
|
|
8
8
|
}
|
|
9
9
|
declare const BlockFormatControls: {
|
|
10
10
|
(props: BlockFormatControls.Props): JSX.Element;
|
|
11
|
-
Slot: FC<Omit<Slot
|
|
11
|
+
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default BlockFormatControls;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconType } from "@wordpress/components";
|
|
2
2
|
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace BlockIcon {
|
|
5
5
|
interface Props {
|
|
6
6
|
className?: string | undefined;
|
|
7
|
-
icon:
|
|
7
|
+
icon: IconType | null;
|
|
8
8
|
showColors?: boolean | undefined;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FontSizePicker as FSP } from "@wordpress/components";
|
|
2
|
-
import { ComponentType } from "react";
|
|
1
|
+
import { FontSizePicker as FSP } from "@wordpress/components/";
|
|
2
|
+
import { ComponentProps, ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
import { EditorFontSize } from "../";
|
|
5
5
|
|
|
6
6
|
export namespace FontSizePicker {
|
|
7
|
-
type Props = Omit<FSP
|
|
7
|
+
type Props = Omit<ComponentProps<typeof FSP>, "disableCustomFontSizes" | "fontSizes">;
|
|
8
8
|
}
|
|
9
9
|
export const FontSizePicker: ComponentType<FontSizePicker.Props>;
|
|
10
10
|
|
|
@@ -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
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Dropdown } from "@wordpress/components";
|
|
2
|
-
import { ComponentType } from "react";
|
|
2
|
+
import { ComponentProps, ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace Inserter {
|
|
5
|
-
interface Props extends Partial<Pick<Dropdown
|
|
5
|
+
interface Props extends Partial<Pick<ComponentProps<typeof Dropdown>, "position" | "renderToggle">> {
|
|
6
6
|
clientId?: string | undefined;
|
|
7
7
|
disabled?: boolean | undefined;
|
|
8
8
|
isAppender?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Slot } from "@wordpress/components";
|
|
2
|
-
import { FC, JSX, ReactNode } from "react";
|
|
2
|
+
import { ComponentProps, FC, JSX, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace InspectorAdvancedControls {
|
|
5
5
|
interface Props {
|
|
@@ -8,7 +8,7 @@ declare namespace InspectorAdvancedControls {
|
|
|
8
8
|
}
|
|
9
9
|
declare const InspectorAdvancedControls: {
|
|
10
10
|
(props: InspectorAdvancedControls.Props): JSX.Element;
|
|
11
|
-
Slot: FC<Omit<Slot
|
|
11
|
+
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default InspectorAdvancedControls;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Slot } from "@wordpress/components";
|
|
2
|
-
import { FC, JSX, ReactNode } from "react";
|
|
2
|
+
import { ComponentProps, FC, JSX, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace InspectorControls {
|
|
5
5
|
interface Props {
|
|
@@ -9,7 +9,7 @@ declare namespace InspectorControls {
|
|
|
9
9
|
}
|
|
10
10
|
declare const InspectorControls: {
|
|
11
11
|
(props: InspectorControls.Props): JSX.Element;
|
|
12
|
-
Slot: FC<Omit<Slot
|
|
12
|
+
Slot: FC<Omit<ComponentProps<typeof Slot>, "name">>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export default InspectorControls;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { DropZone, IconType } from "@wordpress/components";
|
|
3
|
+
import { ComponentProps, JSX, MouseEventHandler } from "react";
|
|
4
4
|
|
|
5
5
|
declare namespace MediaPlaceholder {
|
|
6
6
|
type MediaPlaceholderMultipleAction = "add";
|
|
7
7
|
|
|
8
|
-
interface Props<T extends boolean> extends Pick<DropZone
|
|
8
|
+
interface Props<T extends boolean> extends Pick<ComponentProps<typeof DropZone>, "onHTMLDrop"> {
|
|
9
9
|
/**
|
|
10
10
|
* A string passed to `FormFileUpload` that tells the browser which file types can be uploaded
|
|
11
11
|
* to the upload window the browser use e.g: `image#<{(|,video#<{(|`.
|
|
@@ -47,7 +47,7 @@ declare namespace MediaPlaceholder {
|
|
|
47
47
|
/**
|
|
48
48
|
* Icon to display left of the title.
|
|
49
49
|
*/
|
|
50
|
-
icon?:
|
|
50
|
+
icon?: IconType | undefined;
|
|
51
51
|
/**
|
|
52
52
|
* If `true`, the property changes the look of the placeholder to be adequate to scenarios
|
|
53
53
|
* where new files are added to an already existing set of files, e.g., adding files to a
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NavigableMenu } from "@wordpress/components";
|
|
2
|
-
import { ComponentType } from "react";
|
|
2
|
+
import { ComponentProps, ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace NavigableToolbar {
|
|
5
|
-
interface Props extends NavigableMenu
|
|
5
|
+
interface Props extends ComponentProps<typeof NavigableMenu> {
|
|
6
6
|
focusOnMount?: boolean | undefined;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ColorPalette, PanelBody } from "@wordpress/components";
|
|
2
|
-
import { ComponentType } from "react";
|
|
2
|
+
import { ComponentProps, ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace PanelColorSettings {
|
|
5
5
|
type ColorSetting =
|
|
6
|
-
& Partial<ColorPalette
|
|
7
|
-
& Pick<ColorPalette
|
|
6
|
+
& Partial<ComponentProps<typeof ColorPalette>>
|
|
7
|
+
& Pick<ComponentProps<typeof ColorPalette>, "onChange" | "value">
|
|
8
8
|
& { label: string };
|
|
9
|
-
interface Props extends Omit<PanelBody
|
|
9
|
+
interface Props extends Omit<ComponentProps<typeof PanelBody>, "children"> {
|
|
10
10
|
colorSettings: ColorSetting[];
|
|
11
11
|
disableCustomColors?: boolean | undefined;
|
|
12
12
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { BlockInstance } from "@wordpress/blocks";
|
|
3
3
|
import { Autocomplete, ToolbarButton } from "@wordpress/components";
|
|
4
4
|
import { displayShortcut, rawShortcut } from "@wordpress/keycodes";
|
|
5
|
-
import { ComponentType, HTMLProps, JSX
|
|
5
|
+
import { ComponentProps, ComponentType, HTMLProps, JSX } from "react";
|
|
6
6
|
|
|
7
7
|
declare namespace RichText {
|
|
8
8
|
interface Props<T extends keyof HTMLElementTagNameMap> extends Omit<HTMLProps<T>, "onChange"> {
|
|
@@ -14,7 +14,7 @@ declare namespace RichText {
|
|
|
14
14
|
/**
|
|
15
15
|
* A list of autocompleters to use instead of the default.
|
|
16
16
|
*/
|
|
17
|
-
autocompleters?:
|
|
17
|
+
autocompleters?: ComponentProps<typeof Autocomplete>["completers"] | undefined;
|
|
18
18
|
children?: never | undefined;
|
|
19
19
|
className?: string | undefined;
|
|
20
20
|
identifier?: string | undefined;
|
|
@@ -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`
|
|
@@ -94,7 +94,7 @@ export namespace RichTextShortcut {
|
|
|
94
94
|
export const RichTextShortcut: ComponentType<RichTextShortcut.Props>;
|
|
95
95
|
|
|
96
96
|
export namespace RichTextToolbarButton {
|
|
97
|
-
interface Props extends ToolbarButton
|
|
97
|
+
interface Props extends ComponentProps<typeof ToolbarButton> {
|
|
98
98
|
name?: string | undefined;
|
|
99
99
|
shortcutType?: keyof typeof displayShortcut | undefined;
|
|
100
100
|
shortcutCharacter?: string | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Popover } from "@wordpress/components";
|
|
2
|
-
import { ComponentType, JSX, ReactNode } from "react";
|
|
2
|
+
import { ComponentProps, ComponentType, JSX, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace URLPopover {
|
|
5
|
-
|
|
5
|
+
type Props = ComponentProps<typeof Popover> & {
|
|
6
6
|
additionalControls?: ReactNode | undefined;
|
|
7
7
|
/**
|
|
8
8
|
* Callback used to return the React Elements that will be rendered inside the settings
|
|
@@ -10,7 +10,7 @@ declare namespace URLPopover {
|
|
|
10
10
|
* that allows the user to open and close the settings drawer.
|
|
11
11
|
*/
|
|
12
12
|
renderSettings?(): JSX.Element;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
14
|
}
|
|
15
15
|
declare const URLPopover: ComponentType<URLPopover.Props>;
|
|
16
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/wordpress__block-editor",
|
|
3
|
-
"version": "11.5.
|
|
3
|
+
"version": "11.5.14",
|
|
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",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@types/react": "*",
|
|
34
34
|
"@types/wordpress__blocks": "*",
|
|
35
|
-
"@types/wordpress__components": "*",
|
|
36
|
-
"@types/wordpress__keycodes": "*",
|
|
37
35
|
"@wordpress/data": "^9.13.0",
|
|
36
|
+
"@wordpress/components": "^27.2.0",
|
|
38
37
|
"@wordpress/element": "^5.0.0",
|
|
38
|
+
"@wordpress/keycodes": "^3.54.0",
|
|
39
39
|
"react-autosize-textarea": "^7.1.0"
|
|
40
40
|
},
|
|
41
|
-
"typesPublisherContentHash": "
|
|
41
|
+
"typesPublisherContentHash": "19c44a95a4e9d75add8b0f3743db26b18e6f783247a17a26ea40252a0cfe4c27",
|
|
42
42
|
"typeScriptVersion": "4.7"
|
|
43
43
|
}
|