@plaudit/gutenberg-api-extensions 2.7.0 → 2.9.0
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.
- package/build/blocks/common-native-property-implementations.js +95 -36
- package/build/blocks/common-native-property-implementations.js.map +1 -0
- package/build/blocks/index.js +1 -0
- package/build/blocks/index.js.map +1 -0
- package/build/blocks/layered-styles.js +10 -12
- package/build/blocks/layered-styles.js.map +1 -0
- package/build/blocks/simple-block.js +21 -17
- package/build/blocks/simple-block.js.map +1 -0
- package/build/blocks/simple-native-property.js +37 -34
- package/build/blocks/simple-native-property.js.map +1 -0
- package/build/controls/AsynchronousFormTokenField.js +123 -0
- package/build/controls/AsynchronousFormTokenField.js.map +1 -0
- package/build/controls/ExtendedPostPicker.js +29 -0
- package/build/controls/ExtendedPostPicker.js.map +1 -0
- package/build/controls/InspectorPanel.js +2 -1
- package/build/controls/InspectorPanel.js.map +1 -0
- package/build/controls/LazySuggestionsComboboxControl.js +70 -0
- package/build/controls/LazySuggestionsComboboxControl.js.map +1 -0
- package/build/controls/PickOne.js +6 -6
- package/build/controls/PickOne.js.map +1 -0
- package/build/controls/SimpleToggle.js +1 -0
- package/build/controls/SimpleToggle.js.map +1 -0
- package/build/controls/SortableItemsControl.js +43 -0
- package/build/controls/SortableItemsControl.js.map +1 -0
- package/build/controls/index.js +4 -0
- package/build/controls/index.js.map +1 -0
- package/build/controls/shared.js +7 -0
- package/build/controls/shared.js.map +1 -0
- package/build/controls/types.js +1 -0
- package/build/controls/types.js.map +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -0
- package/build/lib/plaudit-icons/column-1.js +1 -0
- package/build/lib/plaudit-icons/column-1.js.map +1 -0
- package/build/lib/plaudit-icons/column-2.js +1 -0
- package/build/lib/plaudit-icons/column-2.js.map +1 -0
- package/build/lib/plaudit-icons/column-3.js +1 -0
- package/build/lib/plaudit-icons/column-3.js.map +1 -0
- package/build/lib/plaudit-icons/placement-center.js +1 -0
- package/build/lib/plaudit-icons/placement-center.js.map +1 -0
- package/build/lib/plaudit-icons/placement-end.js +1 -0
- package/build/lib/plaudit-icons/placement-end.js.map +1 -0
- package/build/lib/plaudit-icons/placement-start.js +1 -0
- package/build/lib/plaudit-icons/placement-start.js.map +1 -0
- package/build/lib/plaudit-icons/placement-stretch.js +1 -0
- package/build/lib/plaudit-icons/placement-stretch.js.map +1 -0
- package/build/lib/plaudit-icons/plaudit-icon.js +1 -0
- package/build/lib/plaudit-icons/plaudit-icon.js.map +1 -0
- package/build/lib/plaudit-icons/reusable-block-marker.js +1 -0
- package/build/lib/plaudit-icons/reusable-block-marker.js.map +1 -0
- package/build/lib/plaudit-icons.js +1 -0
- package/build/lib/plaudit-icons.js.map +1 -0
- package/package.json +23 -20
- package/src/blocks/common-native-property-implementations.tsx +361 -0
- package/src/blocks/index.ts +12 -0
- package/src/blocks/layered-styles.tsx +108 -0
- package/src/blocks/simple-block.tsx +72 -0
- package/src/blocks/simple-native-property.tsx +204 -0
- package/src/controls/AsynchronousFormTokenField.tsx +158 -0
- package/src/controls/ExtendedPostPicker.tsx +50 -0
- package/src/controls/InspectorPanel.tsx +16 -0
- package/src/controls/LazySuggestionsComboboxControl.tsx +84 -0
- package/src/controls/PickOne.tsx +80 -0
- package/src/controls/SimpleToggle.tsx +9 -0
- package/src/controls/SortableItemsControl.tsx +70 -0
- package/src/controls/index.ts +6 -0
- package/src/controls/shared.ts +7 -0
- package/src/controls/types.ts +11 -0
- package/src/lib/plaudit-icons/column-1.tsx +8 -0
- package/src/lib/plaudit-icons/column-2.tsx +8 -0
- package/src/lib/plaudit-icons/column-3.tsx +8 -0
- package/src/lib/plaudit-icons/placement-center.tsx +5 -0
- package/src/lib/plaudit-icons/placement-end.tsx +5 -0
- package/src/lib/plaudit-icons/placement-start.tsx +5 -0
- package/src/lib/plaudit-icons/placement-stretch.tsx +5 -0
- package/src/lib/plaudit-icons/plaudit-icon.tsx +6 -0
- package/src/lib/plaudit-icons/reusable-block-marker.tsx +5 -0
- package/{build/lib/plaudit-icons.d.ts → src/lib/plaudit-icons.ts} +4 -0
- package/build/blocks/common-native-property-implementations.d.ts +0 -60
- package/build/blocks/index.d.ts +0 -5
- package/build/blocks/layered-styles.d.ts +0 -31
- package/build/blocks/simple-block.d.ts +0 -22
- package/build/blocks/simple-native-property.d.ts +0 -30
- package/build/controls/InspectorPanel.d.ts +0 -6
- package/build/controls/PickOne.d.ts +0 -19
- package/build/controls/SimpleToggle.d.ts +0 -3
- package/build/controls/index.d.ts +0 -3
- package/build/controls/types.d.ts +0 -12
- package/build/lib/plaudit-icons/column-1.d.ts +0 -2
- package/build/lib/plaudit-icons/column-2.d.ts +0 -2
- package/build/lib/plaudit-icons/column-3.d.ts +0 -2
- package/build/lib/plaudit-icons/placement-center.d.ts +0 -2
- package/build/lib/plaudit-icons/placement-end.d.ts +0 -2
- package/build/lib/plaudit-icons/placement-start.d.ts +0 -2
- package/build/lib/plaudit-icons/placement-stretch.d.ts +0 -2
- package/build/lib/plaudit-icons/plaudit-icon.d.ts +0 -2
- package/build/lib/plaudit-icons/reusable-block-marker.d.ts +0 -2
- /package/{build/index.d.ts → src/index.ts} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import apiFetch from "@wordpress/api-fetch";
|
|
2
|
+
import {addQueryArgs} from "@wordpress/url";
|
|
3
|
+
|
|
4
|
+
export async function requestPostsFromAPI(data: {search?: string, ids?: string, postTypes?: string|undefined}) {
|
|
5
|
+
return (await apiFetch<Array<{ id: number, title: string }>>({path: addQueryArgs("/plaudit/common/v1/post-table-search", data)}))
|
|
6
|
+
.map(item => ({id: item.id.toString(), title: item.title}));
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type {BlockEditProps} from "@wordpress/blocks";
|
|
2
|
+
|
|
3
|
+
export type SpecificValueBlockProps<T extends string, V> = {
|
|
4
|
+
attribute: T, attributes: BlockEditProps<Record<T, V>&Record<string, unknown>>['attributes'],
|
|
5
|
+
setAttributes: BlockEditProps<any>['setAttributes']
|
|
6
|
+
}
|
|
7
|
+
export type SimpleBlockControlProps<T extends string, V> = SpecificValueBlockProps<T, V>&{
|
|
8
|
+
label: string
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type PickableOptions<V extends string|number, T extends object = {}> = Array<[V, string|({text: string}&T)]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const iconColumn2 = <svg width={34} height={24} viewBox="0 0 34 24">
|
|
4
|
+
<path
|
|
5
|
+
d="M32 0c1.1 0 2 .9 2 2v20c0 1.1-.9 2-2 2H2c-1.1 0-2-.9-2-2V2C0 .9.9 0 2 0h30zm0 22V2H18v20h14zm-16 0H2V2h14v20z"
|
|
6
|
+
fillRule="evenodd" clipRule="evenodd"
|
|
7
|
+
/>
|
|
8
|
+
</svg>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const iconColumn3 = <svg width={34} height={24} viewBox="0 0 34 24">
|
|
4
|
+
<path
|
|
5
|
+
d="M34 2c0-1.1-.9-2-2-2H2C.9 0 0 .9 0 2v20c0 1.1.9 2 2 2h30c1.1 0 2-.9 2-2V2zM21.5 22h-9V2h9v20zm2 0V2H32v20h-8.5zm-13 0H2V2h8.5v20z"
|
|
6
|
+
fillRule="evenodd" clipRule="evenodd"
|
|
7
|
+
/>
|
|
8
|
+
</svg>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const placementStretch = <svg version="1.1" x="0px" y="0px" focusable={false} viewBox="0 0 24 24" enableBackground="new 0 0 24 24" xmlSpace="preserve">
|
|
4
|
+
<path d="M8.8,6.5h6v11h-6V6.5z M4,18.5h16V20H4V18.5z M4,4h16v1.5H4V4z" />
|
|
5
|
+
</svg>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const plauditIcon = <svg width={24} height={24} viewBox="0 0 139 157.6">
|
|
4
|
+
<path fill="#d20000"
|
|
5
|
+
d="M83.3 39.1L101.6 9c2-3.2.9-7.1-2.4-8.5s-6.9.4-7.9 4l-9.7 33.9c-1.1 3.6-.3 4 1.7.7zm-43.9 19L9 40.5c-3.3-1.9-7.1-.7-8.5 2.6s.5 6.8 4.2 7.8l34.1 8.9c3.7 1 4 .2.6-1.7zm16.3-19c2 3.2 2.7 2.9 1.7-.7L47.6 4.5C46.5.8 43-1 39.7.5S35.3 5.8 37.3 9l18.4 30.1zm82.8 4c-1.4-3.3-5.2-4.5-8.5-2.6L99.5 58.1c-3.3 1.9-3 2.7.7 1.7l34.1-8.9c3.7-1 5.6-4.5 4.2-7.8zM88.8 57.7c-10.6-18.3-28-18.3-38.7 0l-38.7 66.6c-10.6 18.3-1.9 33.3 19.3 33.3h77.4c21.3 0 30-15 19.3-33.3L88.8 57.7zm-19.3 1c7.1 0 12.8 5.8 12.7 12.9s-5.8 12.8-12.9 12.7c-7 0-12.7-5.8-12.8-12.8.1-7.1 5.8-12.9 13-12.8zm32 91.2h-64c-17.6 0-24.8-8.1-16-18l32-35.9c8.8-9.9 23.2-9.9 32 0l32 35.9c8.8 9.9 1.6 17.9-16 18z" />
|
|
6
|
+
</svg>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const reusableBlockMarker = <svg viewBox="0 0 24 24">
|
|
4
|
+
<path d="M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" />
|
|
5
|
+
</svg>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// =============================================
|
|
2
|
+
// Allows sharing of assets in block configurations
|
|
3
|
+
// =============================================
|
|
4
|
+
|
|
1
5
|
export * from './plaudit-icons/column-1';
|
|
2
6
|
export * from './plaudit-icons/column-2';
|
|
3
7
|
export * from './plaudit-icons/column-3';
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { BlockIcon } from "@wordpress/blocks";
|
|
2
|
-
import type { RadioControlProps } from "@wordpress/components/build-types/radio-control/types";
|
|
3
|
-
import type { RangeControlProps } from "@wordpress/components/build-types/range-control/types";
|
|
4
|
-
import type { TextControlProps } from "@wordpress/components/build-types/text-control/types";
|
|
5
|
-
import type { TextareaControlProps } from "@wordpress/components/build-types/textarea-control/types";
|
|
6
|
-
import type { ToggleControlProps } from "@wordpress/components/build-types/toggle-control/types";
|
|
7
|
-
import type { ToggleGroupControlProps } from "@wordpress/components/build-types/toggle-group-control/types";
|
|
8
|
-
import type { PickableOptions } from "../controls/types";
|
|
9
|
-
import type { SimpleNativeProperty } from "./simple-native-property";
|
|
10
|
-
export type ActualBlockEditProps = {
|
|
11
|
-
attributes: Record<string, any>;
|
|
12
|
-
setAttributes: (attributes: Record<string, any>) => void;
|
|
13
|
-
name: string;
|
|
14
|
-
};
|
|
15
|
-
type CommonPropertyConfig<T, V> = {
|
|
16
|
-
name: string;
|
|
17
|
-
label: string;
|
|
18
|
-
default: T;
|
|
19
|
-
enum?: T[];
|
|
20
|
-
component?: Partial<V>;
|
|
21
|
-
help?: string;
|
|
22
|
-
alwaysStore?: boolean;
|
|
23
|
-
condition?(blockEditProps: ActualBlockEditProps): boolean;
|
|
24
|
-
};
|
|
25
|
-
export declare function rangeProperty(config: CommonPropertyConfig<number, RangeControlProps> & {
|
|
26
|
-
min: number;
|
|
27
|
-
max: number;
|
|
28
|
-
step?: number;
|
|
29
|
-
enum?: number[];
|
|
30
|
-
}): SimpleNativeProperty;
|
|
31
|
-
export declare function radioProperty(config: CommonPropertyConfig<string, RadioControlProps> & {
|
|
32
|
-
options: PickableOptions<string>;
|
|
33
|
-
}): SimpleNativeProperty;
|
|
34
|
-
export declare function selectProperty(config: CommonPropertyConfig<string, never> & {
|
|
35
|
-
options: PickableOptions<string>;
|
|
36
|
-
}): SimpleNativeProperty;
|
|
37
|
-
export declare function toggleProperty(config: CommonPropertyConfig<boolean, ToggleControlProps>): SimpleNativeProperty;
|
|
38
|
-
type ToggleGroupPropertyConfigBase<T extends string | number> = CommonPropertyConfig<T, ToggleGroupControlProps> & {
|
|
39
|
-
options: PickableOptions<T, {
|
|
40
|
-
icon: BlockIcon;
|
|
41
|
-
}>;
|
|
42
|
-
};
|
|
43
|
-
export type ToggleGroupPropertyConfig = ToggleGroupPropertyConfigBase<string> | ToggleGroupPropertyConfigBase<number>;
|
|
44
|
-
export declare function toggleGroupProperty(config: ToggleGroupPropertyConfig): SimpleNativeProperty;
|
|
45
|
-
export declare function textProperty(config: CommonPropertyConfig<string, TextControlProps>): SimpleNativeProperty;
|
|
46
|
-
export declare function textareaProperty(config: CommonPropertyConfig<string, TextareaControlProps>): SimpleNativeProperty;
|
|
47
|
-
export type ImagePropertyData = {
|
|
48
|
-
media?: {
|
|
49
|
-
id?: number;
|
|
50
|
-
url?: string;
|
|
51
|
-
};
|
|
52
|
-
pos?: {
|
|
53
|
-
x?: number;
|
|
54
|
-
y?: number;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
export declare function imageProperty(config: Omit<CommonPropertyConfig<ImagePropertyData, {}>, 'default'> & Partial<Pick<CommonPropertyConfig<ImagePropertyData, {}>, 'default'>> & {
|
|
58
|
-
enableFocalPointPicker?: boolean;
|
|
59
|
-
}): SimpleNativeProperty;
|
|
60
|
-
export {};
|
package/build/blocks/index.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { BlockIcon } from "@wordpress/blocks";
|
|
2
|
-
import type { PickableOptions } from "../controls/types";
|
|
3
|
-
type BaseLayeredBlockStyleLayer = {
|
|
4
|
-
name: string;
|
|
5
|
-
title: string;
|
|
6
|
-
default?: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
type LayeredBlockStyleColorLayer = BaseLayeredBlockStyleLayer & {
|
|
9
|
-
picker: 'color';
|
|
10
|
-
options: PickableOptions<string, {
|
|
11
|
-
color?: string;
|
|
12
|
-
}>;
|
|
13
|
-
};
|
|
14
|
-
type LayeredBlockStyleToggleLayer = BaseLayeredBlockStyleLayer & {
|
|
15
|
-
picker?: 'toggle-control';
|
|
16
|
-
options: PickableOptions<string, {
|
|
17
|
-
icon: BlockIcon;
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
|
-
type LayeredBlockStyleSelectOrRadioLayer = BaseLayeredBlockStyleLayer & {
|
|
21
|
-
picker: 'select' | 'radio';
|
|
22
|
-
options: PickableOptions<string>;
|
|
23
|
-
};
|
|
24
|
-
export type LayeredBlockStyleLayer = LayeredBlockStyleColorLayer | LayeredBlockStyleToggleLayer | LayeredBlockStyleSelectOrRadioLayer;
|
|
25
|
-
export interface LayeredBlockStylesConfig {
|
|
26
|
-
block: `${string}/${string}`;
|
|
27
|
-
layers: LayeredBlockStyleLayer[];
|
|
28
|
-
}
|
|
29
|
-
export declare function registerLayeredBlockStyles(config: LayeredBlockStylesConfig): void;
|
|
30
|
-
export declare function installLayeredBlockStylesSupport(): void;
|
|
31
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type Block, type BlockConfiguration, type BlockSaveProps } from "@wordpress/blocks";
|
|
2
|
-
import { InnerBlocks } from "@wordpress/block-editor";
|
|
3
|
-
import type { UseBlockProps } from "@wordpress/block-editor/components/use-block-props";
|
|
4
|
-
import React, { type ComponentType, type ReactNode } from "react";
|
|
5
|
-
export type SimpleBlockTypeConfig<TAttributes extends Record<string, any>> = {
|
|
6
|
-
icon?: BlockConfiguration<TAttributes>['icon'] | undefined;
|
|
7
|
-
defaults?: Required<TAttributes>;
|
|
8
|
-
controls?: NonNullable<Block<TAttributes>['edit']>;
|
|
9
|
-
renderer: (attributes: BlockSaveProps<TAttributes>, wrapperProps: UseBlockProps | UseBlockProps['save'], InnerBlocks: () => React.ReactElement, mode: "edit" | "save") => ReactNode;
|
|
10
|
-
innerBlocksProps?: InnerBlocks.Props;
|
|
11
|
-
settings?: Partial<BlockConfiguration<TAttributes>>;
|
|
12
|
-
};
|
|
13
|
-
declare function applyDefaults<TAttributes extends Record<string, any>, K extends BlockSaveProps<TAttributes>>(config: Omit<SimpleBlockTypeConfig<TAttributes>, 'renderer'>, props: K): Omit<K, "attributes"> & {
|
|
14
|
-
attributes: { [P in keyof K["attributes"]]: K["attributes"][P]; };
|
|
15
|
-
};
|
|
16
|
-
export declare function registerSimpleBlockType<TAttributes extends Record<string, any> = {}>(metadata: BlockConfiguration<TAttributes>, config: SimpleBlockTypeConfig<TAttributes>): Block<TAttributes> | undefined;
|
|
17
|
-
type SimpleContainerTypeConfig<TAttributes extends Record<string, any>> = Omit<SimpleBlockTypeConfig<TAttributes>, 'renderer'> & {
|
|
18
|
-
tag?: ComponentType;
|
|
19
|
-
attributesFromProps?: (arg: ReturnType<typeof applyDefaults<TAttributes, BlockSaveProps<TAttributes>>>, mode: "edit" | "save") => Parameters<UseBlockProps | UseBlockProps['save']>[0];
|
|
20
|
-
};
|
|
21
|
-
export declare function registerSimpleContainerBlock<TAttributes extends Record<string, any> = {}>(metadata: BlockConfiguration<TAttributes>, config: SimpleContainerTypeConfig<TAttributes>): Block<TAttributes> | undefined;
|
|
22
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ActualBlockEditProps } from "./common-native-property-implementations";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export type InspectorPanelGroup = 'default' | 'advanced' | 'background' | 'border' | 'color' | 'dimensions' | 'effects' | 'filter' | 'list' | 'position' | 'settings' | 'styles' | 'typography';
|
|
4
|
-
type GenericSimpleNativeProperty<T, V extends 'string' | 'number' | 'boolean' | 'array' | 'object'> = {
|
|
5
|
-
name: string;
|
|
6
|
-
type: V;
|
|
7
|
-
enum?: T[];
|
|
8
|
-
default: T;
|
|
9
|
-
alwaysStore?: boolean;
|
|
10
|
-
renderer(value: T, onChange: (v: T | undefined) => void): React.JSX.Element;
|
|
11
|
-
condition?(blockEditProps: ActualBlockEditProps): boolean;
|
|
12
|
-
};
|
|
13
|
-
export type SimpleNativeProperty = GenericSimpleNativeProperty<string, 'string'> & {
|
|
14
|
-
enum?: string[];
|
|
15
|
-
} | GenericSimpleNativeProperty<number, 'number'> & {
|
|
16
|
-
enum?: number[];
|
|
17
|
-
} | GenericSimpleNativeProperty<boolean, 'boolean'> | GenericSimpleNativeProperty<any[], 'array'> | GenericSimpleNativeProperty<Record<string | number, unknown>, 'object'>;
|
|
18
|
-
export type SimpleNativePanel = {
|
|
19
|
-
title: string;
|
|
20
|
-
group?: InspectorPanelGroup;
|
|
21
|
-
initialOpen?: boolean;
|
|
22
|
-
properties: SimpleNativeProperty[];
|
|
23
|
-
condition?(blockEditProps: ActualBlockEditProps): boolean;
|
|
24
|
-
};
|
|
25
|
-
export declare function registerSimpleNativeProperties(config: {
|
|
26
|
-
block: `${string}/${string}` | Array<`${string}/${string}`>;
|
|
27
|
-
panel: SimpleNativePanel | Array<SimpleNativePanel>;
|
|
28
|
-
}): void;
|
|
29
|
-
export declare function installSimpleNativePropertiesSupport(): void;
|
|
30
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { PickableOptions, SimpleBlockControlProps } from "./types";
|
|
2
|
-
import React, { type ReactElement } from "react";
|
|
3
|
-
export type PickOneFromToggleGroupProps<T extends string> = SimpleBlockControlProps<T, string | number> & {
|
|
4
|
-
options: PickableOptions<string, {
|
|
5
|
-
icon: ReactElement;
|
|
6
|
-
}>;
|
|
7
|
-
};
|
|
8
|
-
export declare function PickOneFromToggleGroup<T extends string>(props: PickOneFromToggleGroupProps<T>): React.JSX.Element;
|
|
9
|
-
export declare function PickOneFromSelect<T extends string>(props: SimpleBlockControlProps<T, string> & {
|
|
10
|
-
options: PickableOptions<string>;
|
|
11
|
-
}): React.JSX.Element;
|
|
12
|
-
export declare function PickOneFromRadios<T extends string>(props: SimpleBlockControlProps<T, string> & {
|
|
13
|
-
options: PickableOptions<string>;
|
|
14
|
-
}): React.JSX.Element;
|
|
15
|
-
export declare function PickOneFromColors<T extends string>(props: SimpleBlockControlProps<T, string> & {
|
|
16
|
-
options: PickableOptions<string, {
|
|
17
|
-
color?: string | undefined;
|
|
18
|
-
}>;
|
|
19
|
-
}): React.JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BlockEditProps } from "@wordpress/blocks";
|
|
2
|
-
export type SpecificValueBlockProps<T extends string, V> = {
|
|
3
|
-
attribute: T;
|
|
4
|
-
attributes: BlockEditProps<Record<T, V> & Record<string, unknown>>['attributes'];
|
|
5
|
-
setAttributes: BlockEditProps<any>['setAttributes'];
|
|
6
|
-
};
|
|
7
|
-
export type SimpleBlockControlProps<T extends string, V> = SpecificValueBlockProps<T, V> & {
|
|
8
|
-
label: string;
|
|
9
|
-
};
|
|
10
|
-
export type PickableOptions<V extends string | number, T extends object = {}> = Array<[V, string | ({
|
|
11
|
-
text: string;
|
|
12
|
-
} & T)]>;
|
|
File without changes
|