@pixerate/editor-react 0.112.1 → 0.113.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/dist/{chunk-X2AGIMF3.js → chunk-HWZHG6GV.js} +709 -779
- package/dist/image-editor/controls/controls.d.cts +66 -0
- package/dist/image-editor/controls/controls.d.ts +66 -0
- package/dist/image-editor/index.cjs +1041 -1106
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +11 -1
- package/dist/index.cjs +1550 -1615
- package/dist/index.js +11 -1
- package/package.json +3 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
+
/** A checkbox in the image editor's panels. */
|
|
3
|
+
export interface ImageCheckboxProps {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
/** The accessible name. */
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onChange: (checked: boolean) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/** A range slider in the image editor's panels. */
|
|
12
|
+
export interface ImageRangeProps {
|
|
13
|
+
value: number;
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
step: number;
|
|
17
|
+
/** The accessible name. */
|
|
18
|
+
label: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Every change while the value moves. */
|
|
21
|
+
onChange: (value: number) => void;
|
|
22
|
+
/** A drag (or key press) starts. */
|
|
23
|
+
onStart?: () => void;
|
|
24
|
+
/** A drag (or key press) ends. */
|
|
25
|
+
onEnd?: () => void;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/** One choice of an {@link ImageSelectProps}. */
|
|
29
|
+
export interface ImageSelectOption {
|
|
30
|
+
value: string;
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
/** A dropdown in the image editor's panels. */
|
|
34
|
+
export interface ImageSelectProps {
|
|
35
|
+
value: string;
|
|
36
|
+
options: readonly ImageSelectOption[];
|
|
37
|
+
/** The accessible name. */
|
|
38
|
+
label: string;
|
|
39
|
+
/** Shown when `value` matches no option (e.g. "Add effect…"). */
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
onChange: (value: string) => void;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The host's own form controls for the image editor's panels. Any left out fall back to the
|
|
47
|
+
* editor's plain inputs.
|
|
48
|
+
*/
|
|
49
|
+
export interface ImageEditorControls {
|
|
50
|
+
Checkbox?: ComponentType<ImageCheckboxProps>;
|
|
51
|
+
Range?: ComponentType<ImageRangeProps>;
|
|
52
|
+
Select?: ComponentType<ImageSelectProps>;
|
|
53
|
+
}
|
|
54
|
+
/** Makes the image editor's panels inside it use the host's controls. */
|
|
55
|
+
export declare function ImageEditorControlsProvider({ controls, children }: {
|
|
56
|
+
controls: ImageEditorControls;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
}): import("react").JSX.Element;
|
|
59
|
+
/** The controls set by an enclosing {@link ImageEditorControlsProvider}, or none. */
|
|
60
|
+
export declare function useImageEditorControls(): ImageEditorControls;
|
|
61
|
+
/** A checkbox: the host's, or a plain input. */
|
|
62
|
+
export declare function ImageCheckbox(props: ImageCheckboxProps): import("react").JSX.Element;
|
|
63
|
+
/** A range slider: the host's, or a plain input. */
|
|
64
|
+
export declare function ImageRange(props: ImageRangeProps): import("react").JSX.Element;
|
|
65
|
+
/** A dropdown: the host's, or a plain select. */
|
|
66
|
+
export declare function ImageSelect(props: ImageSelectProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
+
/** A checkbox in the image editor's panels. */
|
|
3
|
+
export interface ImageCheckboxProps {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
/** The accessible name. */
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onChange: (checked: boolean) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/** A range slider in the image editor's panels. */
|
|
12
|
+
export interface ImageRangeProps {
|
|
13
|
+
value: number;
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
step: number;
|
|
17
|
+
/** The accessible name. */
|
|
18
|
+
label: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Every change while the value moves. */
|
|
21
|
+
onChange: (value: number) => void;
|
|
22
|
+
/** A drag (or key press) starts. */
|
|
23
|
+
onStart?: () => void;
|
|
24
|
+
/** A drag (or key press) ends. */
|
|
25
|
+
onEnd?: () => void;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/** One choice of an {@link ImageSelectProps}. */
|
|
29
|
+
export interface ImageSelectOption {
|
|
30
|
+
value: string;
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
/** A dropdown in the image editor's panels. */
|
|
34
|
+
export interface ImageSelectProps {
|
|
35
|
+
value: string;
|
|
36
|
+
options: readonly ImageSelectOption[];
|
|
37
|
+
/** The accessible name. */
|
|
38
|
+
label: string;
|
|
39
|
+
/** Shown when `value` matches no option (e.g. "Add effect…"). */
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
onChange: (value: string) => void;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The host's own form controls for the image editor's panels. Any left out fall back to the
|
|
47
|
+
* editor's plain inputs.
|
|
48
|
+
*/
|
|
49
|
+
export interface ImageEditorControls {
|
|
50
|
+
Checkbox?: ComponentType<ImageCheckboxProps>;
|
|
51
|
+
Range?: ComponentType<ImageRangeProps>;
|
|
52
|
+
Select?: ComponentType<ImageSelectProps>;
|
|
53
|
+
}
|
|
54
|
+
/** Makes the image editor's panels inside it use the host's controls. */
|
|
55
|
+
export declare function ImageEditorControlsProvider({ controls, children }: {
|
|
56
|
+
controls: ImageEditorControls;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
}): import("react").JSX.Element;
|
|
59
|
+
/** The controls set by an enclosing {@link ImageEditorControlsProvider}, or none. */
|
|
60
|
+
export declare function useImageEditorControls(): ImageEditorControls;
|
|
61
|
+
/** A checkbox: the host's, or a plain input. */
|
|
62
|
+
export declare function ImageCheckbox(props: ImageCheckboxProps): import("react").JSX.Element;
|
|
63
|
+
/** A range slider: the host's, or a plain input. */
|
|
64
|
+
export declare function ImageRange(props: ImageRangeProps): import("react").JSX.Element;
|
|
65
|
+
/** A dropdown: the host's, or a plain select. */
|
|
66
|
+
export declare function ImageSelect(props: ImageSelectProps): import("react").JSX.Element;
|