@types/wordpress__block-editor 11.5.2 → 11.5.4
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/LICENSE +0 -0
- wordpress__block-editor/README.md +1 -1
- wordpress__block-editor/components/alignment-toolbar.d.ts +9 -7
- wordpress__block-editor/components/autocomplete.d.ts +1 -1
- wordpress__block-editor/components/block-alignment-toolbar.d.ts +2 -2
- wordpress__block-editor/components/block-controls.d.ts +4 -4
- wordpress__block-editor/components/block-edit.d.ts +1 -1
- wordpress__block-editor/components/block-editor-keyboard-shortcuts.d.ts +1 -1
- wordpress__block-editor/components/block-format-controls.d.ts +3 -3
- wordpress__block-editor/components/block-icon.d.ts +3 -3
- wordpress__block-editor/components/block-inspector.d.ts +1 -1
- wordpress__block-editor/components/block-list.d.ts +1 -1
- wordpress__block-editor/components/block-mover.d.ts +1 -1
- wordpress__block-editor/components/block-navigation/dropdown.d.ts +1 -1
- wordpress__block-editor/components/block-selection-clearer.d.ts +1 -1
- wordpress__block-editor/components/block-settings-menu.d.ts +1 -1
- wordpress__block-editor/components/block-switcher/multi-blocks-switcher.d.ts +1 -1
- wordpress__block-editor/components/block-title.d.ts +1 -1
- wordpress__block-editor/components/block-toolbar.d.ts +1 -1
- wordpress__block-editor/components/block-vertical-alignment-toolbar.d.ts +2 -2
- wordpress__block-editor/components/button-block-appender.d.ts +1 -1
- wordpress__block-editor/components/color-palette/index.d.ts +1 -1
- wordpress__block-editor/components/color-palette/with-color-context.d.ts +8 -8
- wordpress__block-editor/components/colors.d.ts +10 -7
- wordpress__block-editor/components/contrast-checker.d.ts +1 -1
- wordpress__block-editor/components/copy-handler.d.ts +1 -1
- wordpress__block-editor/components/default-block-appender.d.ts +1 -1
- wordpress__block-editor/components/font-sizes.d.ts +6 -6
- wordpress__block-editor/components/index.d.ts +48 -48
- wordpress__block-editor/components/inner-blocks.d.ts +6 -6
- wordpress__block-editor/components/inserter.d.ts +3 -3
- wordpress__block-editor/components/inspector-advanced-controls.d.ts +3 -3
- wordpress__block-editor/components/inspector-controls.d.ts +3 -3
- wordpress__block-editor/components/media-placeholder.d.ts +8 -5
- wordpress__block-editor/components/media-upload/check.d.ts +1 -1
- wordpress__block-editor/components/media-upload/index.d.ts +4 -3
- wordpress__block-editor/components/multi-select-scroll-into-view.d.ts +1 -1
- wordpress__block-editor/components/navigable-toolbar.d.ts +2 -2
- wordpress__block-editor/components/observe-typing.d.ts +1 -1
- wordpress__block-editor/components/panel-color-settings.d.ts +7 -5
- wordpress__block-editor/components/plain-text.d.ts +3 -3
- wordpress__block-editor/components/preserve-scroll-in-reorder.d.ts +1 -1
- wordpress__block-editor/components/provider.d.ts +3 -3
- wordpress__block-editor/components/rich-text.d.ts +8 -8
- wordpress__block-editor/components/skip-to-selected-block.d.ts +1 -1
- wordpress__block-editor/components/url-input/button.d.ts +3 -3
- wordpress__block-editor/components/url-input/index.d.ts +1 -1
- wordpress__block-editor/components/url-popover.d.ts +2 -2
- wordpress__block-editor/components/use-block-props.d.ts +13 -10
- wordpress__block-editor/components/warning.d.ts +7 -5
- wordpress__block-editor/components/writing-flow.d.ts +1 -1
- wordpress__block-editor/hooks/index.d.ts +2 -2
- wordpress__block-editor/hooks/use-cached-truthy.d.ts +0 -0
- wordpress__block-editor/hooks/use-typography-props.d.ts +5 -2
- wordpress__block-editor/index.d.ts +13 -13
- wordpress__block-editor/package.json +3 -3
- wordpress__block-editor/store/actions.d.ts +6 -6
- wordpress__block-editor/store/defaults.d.ts +1 -1
- wordpress__block-editor/store/index.d.ts +0 -0
- wordpress__block-editor/store/selectors.d.ts +2 -2
- wordpress__block-editor/utils/index.d.ts +1 -1
wordpress__block-editor/LICENSE
CHANGED
|
File without changes
|
|
@@ -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:
|
|
11
|
+
* Last updated: Mon, 25 Sep 2023 13:39:07 GMT
|
|
12
12
|
* Dependencies: [@types/react](https://npmjs.com/package/@types/react), [@types/react-autosize-textarea](https://npmjs.com/package/@types/react-autosize-textarea), [@types/wordpress__blocks](https://npmjs.com/package/@types/wordpress__blocks), [@types/wordpress__components](https://npmjs.com/package/@types/wordpress__components), [@types/wordpress__data](https://npmjs.com/package/@types/wordpress__data), [@types/wordpress__keycodes](https://npmjs.com/package/@types/wordpress__keycodes)
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { Dashicon } from
|
|
2
|
-
import { ComponentType } from
|
|
1
|
+
import { Dashicon } from "@wordpress/components";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace AlignmentToolbar {
|
|
5
5
|
interface Props {
|
|
6
|
-
alignmentControls?:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
alignmentControls?:
|
|
7
|
+
| Array<{
|
|
8
|
+
align: string;
|
|
9
|
+
icon: Dashicon.Icon | JSX.Element;
|
|
10
|
+
title: string;
|
|
11
|
+
}>
|
|
12
|
+
| undefined;
|
|
11
13
|
children?: never | undefined;
|
|
12
14
|
value: string | undefined;
|
|
13
15
|
onChange(newValue: string | undefined): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentType } from
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
2
|
|
|
3
3
|
declare namespace BlockAlignmentToolbar {
|
|
4
|
-
type Control =
|
|
4
|
+
type Control = "center" | "full" | "left" | "right" | "wide";
|
|
5
5
|
interface Props {
|
|
6
6
|
children?: never | undefined;
|
|
7
7
|
controls?: Control[] | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FC, ReactNode } from
|
|
1
|
+
import { Slot, Toolbar } from "@wordpress/components";
|
|
2
|
+
import { FC, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace BlockControls {
|
|
5
|
-
interface Props extends Pick<Toolbar.Props,
|
|
5
|
+
interface Props extends Pick<Toolbar.Props, "controls"> {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
declare const BlockControls: {
|
|
10
10
|
(props: BlockControls.Props): JSX.Element;
|
|
11
|
-
Slot: FC<Omit<Slot.Props,
|
|
11
|
+
Slot: FC<Omit<Slot.Props, "name">>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default BlockControls;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Slot } from
|
|
2
|
-
import { FC, ReactNode } from
|
|
1
|
+
import { Slot } from "@wordpress/components";
|
|
2
|
+
import { FC, 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.Props,
|
|
11
|
+
Slot: FC<Omit<Slot.Props, "name">>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default BlockFormatControls;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Icon } from
|
|
2
|
-
import { ComponentType } from
|
|
1
|
+
import { Icon } from "@wordpress/components";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace BlockIcon {
|
|
5
5
|
interface Props {
|
|
6
6
|
className?: string | undefined;
|
|
7
|
-
icon: Icon.Props<any>[
|
|
7
|
+
icon: Icon.Props<any>["icon"];
|
|
8
8
|
showColors?: boolean | undefined;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentType } from
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
2
|
|
|
3
3
|
declare namespace BlockVerticalAlignmentToolbar {
|
|
4
|
-
type Value =
|
|
4
|
+
type Value = "bottom" | "center" | "top" | undefined;
|
|
5
5
|
interface Props {
|
|
6
6
|
children?: never | undefined;
|
|
7
7
|
value: Value;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2
|
-
import { ComponentType } from
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
|
-
import { EditorColor } from
|
|
4
|
+
import { EditorColor } from "../../";
|
|
5
5
|
|
|
6
6
|
declare namespace withColorContext {
|
|
7
7
|
interface Props {
|
|
@@ -15,11 +15,11 @@ declare namespace withColorContext {
|
|
|
15
15
|
declare function withColorContext<
|
|
16
16
|
ProvidedProps extends Partial<withColorContext.Props>,
|
|
17
17
|
OwnProps extends any = any,
|
|
18
|
-
T extends ComponentType<ProvidedProps & OwnProps> = ComponentType<ProvidedProps & OwnProps
|
|
19
|
-
>(component: T):
|
|
20
|
-
|
|
21
|
-
Omit<
|
|
22
|
-
|
|
23
|
-
never;
|
|
18
|
+
T extends ComponentType<ProvidedProps & OwnProps> = ComponentType<ProvidedProps & OwnProps>,
|
|
19
|
+
>(component: T): T extends ComponentType<infer U> ? ComponentType<
|
|
20
|
+
& Omit<U, "colors" | "disableCustomColors" | "hasColorsToChoose">
|
|
21
|
+
& Omit<ProvidedProps, "hasColorsToChoose">
|
|
22
|
+
>
|
|
23
|
+
: never;
|
|
24
24
|
|
|
25
25
|
export default withColorContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2
|
-
import { ComponentType } from
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
|
-
import { EditorColor } from
|
|
4
|
+
import { EditorColor } from "../";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic
|
|
@@ -24,7 +24,7 @@ import { EditorColor } from '../';
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export function createCustomColorsHOC<T extends string[]>(
|
|
27
|
-
colorsArray: EditorColor[]
|
|
27
|
+
colorsArray: EditorColor[],
|
|
28
28
|
): (...colorNames: T) => (component: ComponentType<any>) => ComponentType<any>;
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -36,7 +36,7 @@ export function createCustomColorsHOC<T extends string[]>(
|
|
|
36
36
|
export function getColorClassName(colorContextName: string, colorSlug: string): string;
|
|
37
37
|
export function getColorClassName(
|
|
38
38
|
colorContextName: string | undefined,
|
|
39
|
-
colorSlug: string | undefined
|
|
39
|
+
colorSlug: string | undefined,
|
|
40
40
|
): string | undefined;
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -55,8 +55,8 @@ export function getColorClassName(
|
|
|
55
55
|
export function getColorObjectByAttributeValues(
|
|
56
56
|
colors: EditorColor[],
|
|
57
57
|
definedColor: string | undefined,
|
|
58
|
-
customColor: string
|
|
59
|
-
): EditorColor | Pick<EditorColor,
|
|
58
|
+
customColor: string,
|
|
59
|
+
): EditorColor | Pick<EditorColor, "color">;
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Provided an array of color objects as set by the theme or by the editor defaults, and a color
|
|
@@ -65,7 +65,10 @@ export function getColorObjectByAttributeValues(
|
|
|
65
65
|
* @param colors - Array of color objects as set by the theme or by the editor defaults.
|
|
66
66
|
* @param colorValue - A string containing the color value.
|
|
67
67
|
*/
|
|
68
|
-
export function getColorObjectByColorValue(
|
|
68
|
+
export function getColorObjectByColorValue(
|
|
69
|
+
colors: EditorColor[],
|
|
70
|
+
colorValue: string | undefined,
|
|
71
|
+
): EditorColor | undefined;
|
|
69
72
|
|
|
70
73
|
/**
|
|
71
74
|
* A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FontSizePicker as FSP } from
|
|
2
|
-
import { ComponentType } from
|
|
1
|
+
import { FontSizePicker as FSP } from "@wordpress/components";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
|
-
import { EditorFontSize } from
|
|
4
|
+
import { EditorFontSize } from "../";
|
|
5
5
|
|
|
6
6
|
export namespace FontSizePicker {
|
|
7
|
-
type Props = Omit<FSP.Props,
|
|
7
|
+
type Props = Omit<FSP.Props, "disableCustomFontSizes" | "fontSizes">;
|
|
8
8
|
}
|
|
9
9
|
export const FontSizePicker: ComponentType<FontSizePicker.Props>;
|
|
10
10
|
|
|
@@ -25,8 +25,8 @@ export const FontSizePicker: ComponentType<FontSizePicker.Props>;
|
|
|
25
25
|
export function getFontSize(
|
|
26
26
|
fontSizes: EditorFontSize[],
|
|
27
27
|
fontSizeAttribute: string | undefined,
|
|
28
|
-
customFontSizeAttribute: number
|
|
29
|
-
): Partial<EditorFontSize> & Pick<EditorFontSize,
|
|
28
|
+
customFontSizeAttribute: number,
|
|
29
|
+
): Partial<EditorFontSize> & Pick<EditorFontSize, "size">;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Returns a class based on fontSizeName.
|
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Block Creation Components
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
15
|
-
export { default as
|
|
16
|
-
export
|
|
17
|
-
export { default as ContrastChecker } from
|
|
18
|
-
export
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
23
|
-
export { default as
|
|
24
|
-
export { default as
|
|
25
|
-
export { default as
|
|
26
|
-
export { default as
|
|
27
|
-
export { default as
|
|
28
|
-
export { default as
|
|
29
|
-
export { default as
|
|
30
|
-
export { default as
|
|
4
|
+
export { default as AlignmentToolbar } from "./alignment-toolbar";
|
|
5
|
+
export { default as Autocomplete } from "./autocomplete";
|
|
6
|
+
export { default as BlockAlignmentToolbar } from "./block-alignment-toolbar";
|
|
7
|
+
export { default as BlockControls } from "./block-controls";
|
|
8
|
+
export { default as BlockEdit } from "./block-edit";
|
|
9
|
+
export { default as BlockFormatControls } from "./block-format-controls";
|
|
10
|
+
export { default as BlockIcon } from "./block-icon";
|
|
11
|
+
export { default as BlockNavigationDropdown } from "./block-navigation/dropdown";
|
|
12
|
+
export { default as BlockVerticalAlignmentToolbar } from "./block-vertical-alignment-toolbar";
|
|
13
|
+
export { default as ButtonBlockAppender } from "./button-block-appender";
|
|
14
|
+
export { default as ColorPalette } from "./color-palette";
|
|
15
|
+
export { default as withColorContext } from "./color-palette/with-color-context";
|
|
16
|
+
export * from "./colors";
|
|
17
|
+
export { default as ContrastChecker } from "./contrast-checker";
|
|
18
|
+
export * from "./font-sizes";
|
|
19
|
+
export { default as InnerBlocks, useInnerBlocksProps } from "./inner-blocks";
|
|
20
|
+
export { default as InspectorAdvancedControls } from "./inspector-advanced-controls";
|
|
21
|
+
export { default as InspectorControls } from "./inspector-controls";
|
|
22
|
+
export { default as MediaPlaceholder } from "./media-placeholder";
|
|
23
|
+
export { default as MediaUpload } from "./media-upload";
|
|
24
|
+
export { default as MediaUploadCheck } from "./media-upload/check";
|
|
25
|
+
export { default as PanelColorSettings } from "./panel-color-settings";
|
|
26
|
+
export { default as PlainText } from "./plain-text";
|
|
27
|
+
export { default as RichText, RichTextShortcut, RichTextToolbarButton } from "./rich-text";
|
|
28
|
+
export { default as URLInput } from "./url-input";
|
|
29
|
+
export { default as URLInputButton } from "./url-input/button";
|
|
30
|
+
export { default as URLPopover } from "./url-popover";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Content Related Components
|
|
34
34
|
*/
|
|
35
|
-
export { default as BlockEditorKeyboardShortcuts } from
|
|
36
|
-
export { default as BlockInspector } from
|
|
37
|
-
export { default as BlockList } from
|
|
38
|
-
export { default as BlockMover } from
|
|
39
|
-
export { default as BlockSelectionClearer } from
|
|
40
|
-
export { default as BlockSettingsMenu } from
|
|
41
|
-
export { default as
|
|
42
|
-
export { default as
|
|
43
|
-
export { default as
|
|
44
|
-
export { default as
|
|
45
|
-
export { default as
|
|
46
|
-
export { default as
|
|
47
|
-
export { default as MultiSelectScrollIntoView } from
|
|
48
|
-
export { default as NavigableToolbar } from
|
|
49
|
-
export { default as ObserveTyping } from
|
|
50
|
-
export { default as PreserveScrollInReorder } from
|
|
51
|
-
export { default as SkipToSelectedBlock } from
|
|
52
|
-
export { default as Warning } from
|
|
53
|
-
export { default as WritingFlow } from
|
|
35
|
+
export { default as BlockEditorKeyboardShortcuts } from "./block-editor-keyboard-shortcuts";
|
|
36
|
+
export { default as BlockInspector } from "./block-inspector";
|
|
37
|
+
export { default as BlockList } from "./block-list";
|
|
38
|
+
export { default as BlockMover } from "./block-mover";
|
|
39
|
+
export { default as BlockSelectionClearer } from "./block-selection-clearer";
|
|
40
|
+
export { default as BlockSettingsMenu } from "./block-settings-menu";
|
|
41
|
+
export { default as MultiBlocksSwitcher } from "./block-switcher/multi-blocks-switcher";
|
|
42
|
+
export { default as BlockTitle } from "./block-title";
|
|
43
|
+
export { default as BlockToolbar } from "./block-toolbar";
|
|
44
|
+
export { default as CopyHandler } from "./copy-handler";
|
|
45
|
+
export { default as DefaultBlockAppender } from "./default-block-appender";
|
|
46
|
+
export { default as Inserter } from "./inserter";
|
|
47
|
+
export { default as MultiSelectScrollIntoView } from "./multi-select-scroll-into-view";
|
|
48
|
+
export { default as NavigableToolbar } from "./navigable-toolbar";
|
|
49
|
+
export { default as ObserveTyping } from "./observe-typing";
|
|
50
|
+
export { default as PreserveScrollInReorder } from "./preserve-scroll-in-reorder";
|
|
51
|
+
export { default as SkipToSelectedBlock } from "./skip-to-selected-block";
|
|
52
|
+
export { default as Warning } from "./warning";
|
|
53
|
+
export { default as WritingFlow } from "./writing-flow";
|
|
54
54
|
|
|
55
55
|
/*
|
|
56
56
|
* State Related Components
|
|
57
57
|
*/
|
|
58
|
-
export { default as BlockEditorProvider } from
|
|
58
|
+
export { default as BlockEditorProvider } from "./provider";
|
|
59
59
|
|
|
60
60
|
/*
|
|
61
61
|
* Hooks
|
|
62
62
|
*/
|
|
63
|
-
export { useBlockProps } from
|
|
63
|
+
export { useBlockProps } from "./use-block-props";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TemplateArray } from
|
|
2
|
-
import { ComponentType, Ref } from
|
|
1
|
+
import { TemplateArray } from "@wordpress/blocks";
|
|
2
|
+
import { ComponentType, Ref } from "react";
|
|
3
3
|
|
|
4
|
-
import { EditorTemplateLock } from
|
|
4
|
+
import { EditorTemplateLock } from "../";
|
|
5
5
|
|
|
6
|
-
import { Merged, Reserved } from
|
|
6
|
+
import { Merged, Reserved } from "./use-block-props";
|
|
7
7
|
|
|
8
8
|
declare namespace InnerBlocks {
|
|
9
9
|
interface Props {
|
|
@@ -58,8 +58,8 @@ declare const InnerBlocks: {
|
|
|
58
58
|
export interface UseInnerBlocksProps {
|
|
59
59
|
<Props extends Record<string, unknown>>(
|
|
60
60
|
props?: Props & { ref?: Ref<unknown> },
|
|
61
|
-
options?: InnerBlocks.Props
|
|
62
|
-
): Omit<Props,
|
|
61
|
+
options?: InnerBlocks.Props,
|
|
62
|
+
): Omit<Props, "ref"> & Merged & Reserved;
|
|
63
63
|
|
|
64
64
|
save: (props?: Record<string, unknown>) => Record<string, unknown>;
|
|
65
65
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Dropdown } from
|
|
2
|
-
import { ComponentType } from
|
|
1
|
+
import { Dropdown } from "@wordpress/components";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace Inserter {
|
|
5
|
-
interface Props extends Partial<Pick<Dropdown.Props,
|
|
5
|
+
interface Props extends Partial<Pick<Dropdown.Props, "position" | "renderToggle">> {
|
|
6
6
|
clientId?: string | undefined;
|
|
7
7
|
disabled?: boolean | undefined;
|
|
8
8
|
isAppender?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Slot } from
|
|
2
|
-
import { FC, ReactNode } from
|
|
1
|
+
import { Slot } from "@wordpress/components";
|
|
2
|
+
import { FC, 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.Props,
|
|
11
|
+
Slot: FC<Omit<Slot.Props, "name">>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default InspectorAdvancedControls;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Slot } from
|
|
2
|
-
import { FC, ReactNode } from
|
|
1
|
+
import { Slot } from "@wordpress/components";
|
|
2
|
+
import { FC, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace InspectorControls {
|
|
5
5
|
interface Props {
|
|
@@ -8,7 +8,7 @@ declare namespace InspectorControls {
|
|
|
8
8
|
}
|
|
9
9
|
declare const InspectorControls: {
|
|
10
10
|
(props: InspectorControls.Props): JSX.Element;
|
|
11
|
-
Slot: FC<Omit<Slot.Props,
|
|
11
|
+
Slot: FC<Omit<Slot.Props, "name">>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default InspectorControls;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2
|
-
import { Dashicon, DropZone } from
|
|
3
|
-
import { ComponentType, MouseEventHandler } from
|
|
2
|
+
import { Dashicon, DropZone } from "@wordpress/components";
|
|
3
|
+
import { ComponentType, MouseEventHandler } from "react";
|
|
4
4
|
|
|
5
5
|
declare namespace MediaPlaceholder {
|
|
6
|
-
|
|
6
|
+
type MediaPlaceholderMultipleAction = "add";
|
|
7
|
+
|
|
8
|
+
interface Props<T extends boolean> extends Pick<DropZone.Props, "onHTMLDrop"> {
|
|
7
9
|
/**
|
|
8
10
|
* A string passed to `FormFileUpload` that tells the browser which file types can be uploaded
|
|
9
11
|
* to the upload window the browser use e.g: `image#<{(|,video#<{(|`.
|
|
@@ -77,10 +79,11 @@ declare namespace MediaPlaceholder {
|
|
|
77
79
|
*/
|
|
78
80
|
onError?(message: string): void;
|
|
79
81
|
onSelectURL?(src: string): void;
|
|
80
|
-
multiple?: T | undefined;
|
|
82
|
+
multiple?: T | MediaPlaceholderMultipleAction | undefined;
|
|
81
83
|
value?: T extends true ? number[] : number | undefined | undefined | undefined | undefined;
|
|
82
84
|
onSelect(
|
|
83
|
-
value: T extends true ? Array<{ id: number } & { [k: string]: any }>
|
|
85
|
+
value: T extends true ? Array<{ id: number } & { [k: string]: any }>
|
|
86
|
+
: { id: number } & { [k: string]: any },
|
|
84
87
|
): void;
|
|
85
88
|
}
|
|
86
89
|
// type Props<T extends boolean> = BaseProps<T>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2
|
-
import { ComponentType } from
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
|
-
import { default as MediaPlaceholder } from
|
|
4
|
+
import { default as MediaPlaceholder } from "../media-placeholder";
|
|
5
5
|
|
|
6
6
|
declare namespace MediaUpload {
|
|
7
7
|
interface Props<T extends boolean>
|
|
8
|
-
extends Pick<MediaPlaceholder.Props<T>,
|
|
8
|
+
extends Pick<MediaPlaceholder.Props<T>, "addToGallery" | "allowedTypes" | "multiple" | "onSelect" | "value">
|
|
9
|
+
{
|
|
9
10
|
children?: never | undefined;
|
|
10
11
|
/**
|
|
11
12
|
* If `true`, the component will initiate all the states required to represent a gallery. By
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NavigableMenu } from
|
|
2
|
-
import { ComponentType } from
|
|
1
|
+
import { NavigableMenu } from "@wordpress/components";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace NavigableToolbar {
|
|
5
5
|
interface Props extends NavigableMenu.Props {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { ColorPalette, PanelBody } from
|
|
2
|
-
import { ComponentType } from
|
|
1
|
+
import { ColorPalette, PanelBody } from "@wordpress/components";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace PanelColorSettings {
|
|
5
|
-
type ColorSetting =
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type ColorSetting =
|
|
6
|
+
& Partial<ColorPalette.Props>
|
|
7
|
+
& Pick<ColorPalette.Props, "onChange" | "value">
|
|
8
|
+
& { label: string };
|
|
9
|
+
interface Props extends Omit<PanelBody.Props, "children"> {
|
|
8
10
|
colorSettings: ColorSetting[];
|
|
9
11
|
disableCustomColors?: boolean | undefined;
|
|
10
12
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ComponentType, Ref } from
|
|
2
|
-
import TextareaAutosize from
|
|
1
|
+
import { ComponentType, Ref } from "react";
|
|
2
|
+
import TextareaAutosize from "react-autosize-textarea";
|
|
3
3
|
|
|
4
4
|
declare namespace PlainText {
|
|
5
|
-
interface Props extends Omit<TextareaAutosize.Props,
|
|
5
|
+
interface Props extends Omit<TextareaAutosize.Props, "onChange"> {
|
|
6
6
|
/**
|
|
7
7
|
* The component forwards the `ref` property to the `TextareaAutosize` component.
|
|
8
8
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BlockInstance } from
|
|
2
|
-
import { ComponentType, ReactNode } from
|
|
1
|
+
import { BlockInstance } from "@wordpress/blocks";
|
|
2
|
+
import { ComponentType, ReactNode } from "react";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { EditorBlockListSettings, EditorSettings } from "../";
|
|
5
5
|
|
|
6
6
|
declare namespace BlockEditorProvider {
|
|
7
7
|
interface Props {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2
|
-
import { BlockInstance } from
|
|
3
|
-
import { Autocomplete, ToolbarButton } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { BlockInstance } from "@wordpress/blocks";
|
|
3
|
+
import { Autocomplete, ToolbarButton } from "@wordpress/components";
|
|
4
|
+
import { displayShortcut, rawShortcut } from "@wordpress/keycodes";
|
|
5
|
+
import { ComponentType, HTMLProps, ReactNode } from "react";
|
|
6
6
|
|
|
7
7
|
declare namespace RichText {
|
|
8
|
-
interface Props<T extends keyof HTMLElementTagNameMap> extends Omit<HTMLProps<T>,
|
|
8
|
+
interface Props<T extends keyof HTMLElementTagNameMap> extends Omit<HTMLProps<T>, "onChange"> {
|
|
9
9
|
/**
|
|
10
10
|
* By default, all registered formats are allowed. This setting can be used to fine-tune
|
|
11
11
|
* the allowed formats.
|
|
@@ -70,17 +70,17 @@ declare namespace RichText {
|
|
|
70
70
|
}
|
|
71
71
|
interface ContentProps<T extends keyof HTMLElementTagNameMap> extends HTMLProps<T> {
|
|
72
72
|
children?: never | undefined;
|
|
73
|
-
multiline?: boolean |
|
|
73
|
+
multiline?: boolean | "p" | "li" | undefined;
|
|
74
74
|
tagName?: T | undefined;
|
|
75
75
|
value: string;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
declare const RichText: {
|
|
79
|
-
<T extends keyof HTMLElementTagNameMap =
|
|
79
|
+
<T extends keyof HTMLElementTagNameMap = "div">(props: RichText.Props<T>): JSX.Element;
|
|
80
80
|
/**
|
|
81
81
|
* Should be used in the `save` function of your block to correctly save rich text content.
|
|
82
82
|
*/
|
|
83
|
-
Content<T extends keyof HTMLElementTagNameMap =
|
|
83
|
+
Content<T extends keyof HTMLElementTagNameMap = "div">(props: RichText.ContentProps<T>): JSX.Element;
|
|
84
84
|
isEmpty(value: string | string[]): boolean;
|
|
85
85
|
};
|
|
86
86
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ComponentType } from
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
2
|
|
|
3
|
-
import URLInput from
|
|
3
|
+
import URLInput from "./";
|
|
4
4
|
|
|
5
5
|
declare namespace URLInputButton {
|
|
6
|
-
interface Props extends Pick<URLInput.Props,
|
|
6
|
+
interface Props extends Pick<URLInput.Props, "onChange"> {
|
|
7
7
|
children?: never | undefined;
|
|
8
8
|
/**
|
|
9
9
|
* This should be set to the attribute (or component state) property used to store the URL.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Popover } from
|
|
2
|
-
import { ComponentType, ReactNode } from
|
|
1
|
+
import { Popover } from "@wordpress/components";
|
|
2
|
+
import { ComponentType, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
declare namespace URLPopover {
|
|
5
5
|
interface Props extends Popover.Props {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Ref, RefCallback } from
|
|
1
|
+
import { Ref, RefCallback } from "react";
|
|
2
2
|
|
|
3
3
|
export interface Reserved {
|
|
4
4
|
id: string;
|
|
5
|
-
role:
|
|
5
|
+
role: "document";
|
|
6
6
|
tabIndex: 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
"aria-label": string;
|
|
8
|
+
"data-block": string;
|
|
9
|
+
"data-type": string;
|
|
10
|
+
"data-title": string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export interface Merged {
|
|
@@ -18,10 +18,13 @@ export interface Merged {
|
|
|
18
18
|
|
|
19
19
|
export interface UseBlockProps {
|
|
20
20
|
<Props extends Record<string, unknown>>(
|
|
21
|
-
props?:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
props?:
|
|
22
|
+
& Props
|
|
23
|
+
& {
|
|
24
|
+
[K in keyof Props]: K extends keyof Reserved ? never : Props[K];
|
|
25
|
+
}
|
|
26
|
+
& { ref?: Ref<unknown> },
|
|
27
|
+
): Omit<Props, "ref"> & Merged & Reserved;
|
|
25
28
|
|
|
26
29
|
save: (props?: Record<string, unknown>) => Record<string, unknown>;
|
|
27
30
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { ComponentType, MouseEventHandler, ReactFragment, ReactNode } from
|
|
1
|
+
import { ComponentType, MouseEventHandler, ReactFragment, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
declare namespace Warning {
|
|
4
4
|
interface Props {
|
|
5
5
|
actions?: ReactFragment | undefined;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
className?: string | undefined;
|
|
8
|
-
secondaryActions?:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
secondaryActions?:
|
|
9
|
+
| Array<{
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
12
|
+
}>
|
|
13
|
+
| undefined;
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
declare const Warning: ComponentType<Warning.Props>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { useCachedTruthy } from "./use-cached-truthy";
|
|
2
|
+
export { getTypographyClassesAndStyles } from "./use-typography-props";
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockAttributes } from
|
|
1
|
+
import { BlockAttributes } from "@wordpress/blocks";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Provides the CSS class names and inline styles for a block's typography support
|
|
@@ -10,4 +10,7 @@ import { BlockAttributes } from '@wordpress/blocks';
|
|
|
10
10
|
*
|
|
11
11
|
* @return Typography block support derived CSS classes & styles.
|
|
12
12
|
*/
|
|
13
|
-
export function getTypographyClassesAndStyles(
|
|
13
|
+
export function getTypographyClassesAndStyles(
|
|
14
|
+
attributes: BlockAttributes,
|
|
15
|
+
fluidTypographySettings: { minFontSize?: string } | boolean,
|
|
16
|
+
): { className: string; style: Record<string, string> };
|
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|
// Dennis Snell <https://github.com/dmsnell>
|
|
6
6
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
7
|
// TypeScript Version: 3.6
|
|
8
|
-
import { BlockIconNormalized } from
|
|
9
|
-
import { dispatch, select } from
|
|
8
|
+
import { BlockIconNormalized } from "@wordpress/blocks";
|
|
9
|
+
import { dispatch, select } from "@wordpress/data";
|
|
10
10
|
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export
|
|
14
|
-
export {
|
|
15
|
-
export
|
|
11
|
+
export * from "./components";
|
|
12
|
+
export * from "./hooks";
|
|
13
|
+
export { storeConfig } from "./store";
|
|
14
|
+
export { SETTINGS_DEFAULTS } from "./store/defaults";
|
|
15
|
+
export * from "./utils";
|
|
16
16
|
|
|
17
|
-
declare module
|
|
18
|
-
function dispatch(key:
|
|
19
|
-
function select(key:
|
|
17
|
+
declare module "@wordpress/data" {
|
|
18
|
+
function dispatch(key: "core/block-editor"): typeof import("./store/actions");
|
|
19
|
+
function select(key: "core/block-editor"): typeof import("./store/selectors");
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const store: any;
|
|
23
23
|
|
|
24
|
-
export type EditorBlockMode =
|
|
25
|
-
export type EditorMode =
|
|
26
|
-
export type EditorTemplateLock =
|
|
24
|
+
export type EditorBlockMode = "html" | "visual";
|
|
25
|
+
export type EditorMode = "text" | "visual";
|
|
26
|
+
export type EditorTemplateLock = "all" | "insert" | false;
|
|
27
27
|
|
|
28
28
|
export interface EditorBaseSetting {
|
|
29
29
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/wordpress__block-editor",
|
|
3
|
-
"version": "11.5.
|
|
3
|
+
"version": "11.5.4",
|
|
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": "
|
|
42
|
-
"typeScriptVersion": "4.
|
|
41
|
+
"typesPublisherContentHash": "420e38661e3e335be1833ec356ca4dffa6b0e6e43197607ff6c9adae04333988",
|
|
42
|
+
"typeScriptVersion": "4.5"
|
|
43
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BlockInstance } from
|
|
1
|
+
import { BlockInstance } from "@wordpress/blocks";
|
|
2
2
|
|
|
3
|
-
import { EditorBlockListSettings, EditorSettings } from
|
|
3
|
+
import { EditorBlockListSettings, EditorSettings } from "../";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Signals that the block selection is cleared.
|
|
@@ -36,7 +36,7 @@ export function insertBlock(
|
|
|
36
36
|
block: BlockInstance,
|
|
37
37
|
index?: number,
|
|
38
38
|
rootClientId?: string,
|
|
39
|
-
updateSelection?: boolean
|
|
39
|
+
updateSelection?: boolean,
|
|
40
40
|
): void;
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -53,7 +53,7 @@ export function insertBlocks(
|
|
|
53
53
|
blocks: BlockInstance[],
|
|
54
54
|
index?: number,
|
|
55
55
|
rootClientId?: string,
|
|
56
|
-
updateSelection?: boolean
|
|
56
|
+
updateSelection?: boolean,
|
|
57
57
|
): IterableIterator<void>;
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -86,7 +86,7 @@ export function moveBlockToPosition(
|
|
|
86
86
|
clientId: string | undefined,
|
|
87
87
|
fromRootClientId: string | undefined,
|
|
88
88
|
toRootClientId: string | undefined,
|
|
89
|
-
index: number
|
|
89
|
+
index: number,
|
|
90
90
|
): IterableIterator<void>;
|
|
91
91
|
|
|
92
92
|
export function moveBlocksDown(clientIds: string | string[], rootClientId: string): void;
|
|
@@ -145,7 +145,7 @@ export function replaceBlock(clientId: string | string[], block: BlockInstance |
|
|
|
145
145
|
export function replaceBlocks(
|
|
146
146
|
clientIds: string | string[],
|
|
147
147
|
blocks: BlockInstance | BlockInstance[],
|
|
148
|
-
indexToSelect?: number
|
|
148
|
+
indexToSelect?: number,
|
|
149
149
|
): IterableIterator<void>;
|
|
150
150
|
|
|
151
151
|
/**
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BlockInstance } from
|
|
1
|
+
import { BlockInstance } from "@wordpress/blocks";
|
|
2
2
|
|
|
3
|
-
import { EditorBlockListSettings, EditorBlockMode, EditorInserterItem, EditorSelection, EditorSettings } from
|
|
3
|
+
import { EditorBlockListSettings, EditorBlockMode, EditorInserterItem, EditorSelection, EditorSettings } from "../";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Determines if the given block type is allowed to be inserted into the block list.
|