@pixerate/editor-react 0.114.2 → 0.115.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.
Files changed (42) hide show
  1. package/dist/animation-editor/index.cjs +361 -216
  2. package/dist/animation-editor/index.js +2 -2
  3. package/dist/canvas/index.cjs +539 -394
  4. package/dist/canvas/index.js +2 -2
  5. package/dist/{chunk-2INOKIJN.js → chunk-2KXZLZAS.js} +381 -364
  6. package/dist/{chunk-5LFQ2UQZ.js → chunk-5RPB4WGT.js} +240 -102
  7. package/dist/{chunk-BWEARAWR.js → chunk-6BWTJ3EE.js} +40 -18
  8. package/dist/effects/EffectParameters.d.cts +4 -1
  9. package/dist/effects/EffectParameters.d.ts +4 -1
  10. package/dist/effects/index.cjs +367 -222
  11. package/dist/effects/index.js +2 -2
  12. package/dist/image-editor/ImageEffectControls.d.cts +4 -1
  13. package/dist/image-editor/ImageEffectControls.d.ts +4 -1
  14. package/dist/image-editor/ImageProviderEffectsPanel.d.cts +4 -1
  15. package/dist/image-editor/ImageProviderEffectsPanel.d.ts +4 -1
  16. package/dist/image-editor/controls/controls.d.cts +19 -0
  17. package/dist/image-editor/controls/controls.d.ts +19 -0
  18. package/dist/image-editor/controls/parameterControls.d.cts +4 -0
  19. package/dist/image-editor/controls/parameterControls.d.ts +4 -0
  20. package/dist/image-editor/index.cjs +924 -765
  21. package/dist/image-editor/index.d.cts +1 -1
  22. package/dist/image-editor/index.d.ts +1 -1
  23. package/dist/image-editor/index.js +5 -3
  24. package/dist/index.cjs +1444 -1285
  25. package/dist/index.js +5 -3
  26. package/dist/paint-editor/index.cjs +354 -209
  27. package/dist/paint-editor/index.js +2 -2
  28. package/dist/parameters/ParametersPanel.d.cts +4 -1
  29. package/dist/parameters/ParametersPanel.d.ts +4 -1
  30. package/dist/parameters/controls.d.cts +92 -0
  31. package/dist/parameters/controls.d.ts +92 -0
  32. package/dist/parameters/fields.d.cts +20 -7
  33. package/dist/parameters/fields.d.ts +20 -7
  34. package/dist/parameters/index.cjs +369 -184
  35. package/dist/parameters/index.d.cts +1 -0
  36. package/dist/parameters/index.d.ts +1 -0
  37. package/dist/parameters/index.js +70 -14
  38. package/dist/vector/index.cjs +340 -195
  39. package/dist/vector/index.js +2 -2
  40. package/dist/video-editor/index.cjs +437 -292
  41. package/dist/video-editor/index.js +2 -2
  42. package/package.json +3 -3
@@ -6,8 +6,8 @@ import {
6
6
  useEffectAuthoring,
7
7
  useEffectDescription,
8
8
  useEffects
9
- } from "../chunk-BWEARAWR.js";
10
- import "../chunk-5LFQ2UQZ.js";
9
+ } from "../chunk-6BWTJ3EE.js";
10
+ import "../chunk-5RPB4WGT.js";
11
11
  import "../chunk-KIRIU53A.js";
12
12
  import "../chunk-3I7FOSLF.js";
13
13
  export {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { EffectProvider } from '@pixerate/editor/effects';
3
+ import { type ParameterComponents } from '../parameters/controls.cjs';
3
4
  export interface ImageEffectControlsProps {
4
5
  provider: EffectProvider | null;
5
6
  effect: string;
@@ -9,6 +10,8 @@ export interface ImageEffectControlsProps {
9
10
  onPreset: (values: Readonly<Record<string, unknown>>) => void;
10
11
  /** Extra classes on the root element. */
11
12
  className?: string;
13
+ /** Host parameter controls; else those of a `ParameterComponentsProvider`, else the image editor's host `Range` / `Select`. */
14
+ components?: ParameterComponents;
12
15
  }
13
16
  /** One effect's controls, loaded from the provider; a note when it does not have the effect. Parity with Svelte's `<ImageEffectControls>`. */
14
- export declare function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className }: ImageEffectControlsProps): React.JSX.Element;
17
+ export declare function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className, components }: ImageEffectControlsProps): React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { EffectProvider } from '@pixerate/editor/effects';
3
+ import { type ParameterComponents } from '../parameters/controls.js';
3
4
  export interface ImageEffectControlsProps {
4
5
  provider: EffectProvider | null;
5
6
  effect: string;
@@ -9,6 +10,8 @@ export interface ImageEffectControlsProps {
9
10
  onPreset: (values: Readonly<Record<string, unknown>>) => void;
10
11
  /** Extra classes on the root element. */
11
12
  className?: string;
13
+ /** Host parameter controls; else those of a `ParameterComponentsProvider`, else the image editor's host `Range` / `Select`. */
14
+ components?: ParameterComponents;
12
15
  }
13
16
  /** One effect's controls, loaded from the provider; a note when it does not have the effect. Parity with Svelte's `<ImageEffectControls>`. */
14
- export declare function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className }: ImageEffectControlsProps): React.JSX.Element;
17
+ export declare function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className, components }: ImageEffectControlsProps): React.JSX.Element;
@@ -1,8 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type ImageEditorController } from '@pixerate/editor/image-editor';
3
+ import type { ParameterComponents } from '../parameters/index.cjs';
3
4
  export interface ImageProviderEffectsPanelProps {
4
5
  controller: ImageEditorController;
5
6
  className?: string;
7
+ /** Host controls for the effects' parameters. */
8
+ components?: ParameterComponents;
6
9
  }
7
10
  /**
8
11
  * Provider effects in the image editor, for the active layer: its effect smart filters (apply,
@@ -10,4 +13,4 @@ export interface ImageProviderEffectsPanelProps {
10
13
  * controls; plus adding effect layers. Applying a filter effect to a pixel layer converts it to a
11
14
  * smart object in the same undo step. Without a provider it says why nothing can be added.
12
15
  */
13
- export declare function ImageProviderEffectsPanel({ controller, className }: ImageProviderEffectsPanelProps): React.JSX.Element;
16
+ export declare function ImageProviderEffectsPanel({ controller, className, components }: ImageProviderEffectsPanelProps): React.JSX.Element;
@@ -1,8 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type ImageEditorController } from '@pixerate/editor/image-editor';
3
+ import type { ParameterComponents } from '../parameters/index.js';
3
4
  export interface ImageProviderEffectsPanelProps {
4
5
  controller: ImageEditorController;
5
6
  className?: string;
7
+ /** Host controls for the effects' parameters. */
8
+ components?: ParameterComponents;
6
9
  }
7
10
  /**
8
11
  * Provider effects in the image editor, for the active layer: its effect smart filters (apply,
@@ -10,4 +13,4 @@ export interface ImageProviderEffectsPanelProps {
10
13
  * controls; plus adding effect layers. Applying a filter effect to a pixel layer converts it to a
11
14
  * smart object in the same undo step. Without a provider it says why nothing can be added.
12
15
  */
13
- export declare function ImageProviderEffectsPanel({ controller, className }: ImageProviderEffectsPanelProps): React.JSX.Element;
16
+ export declare function ImageProviderEffectsPanel({ controller, className, components }: ImageProviderEffectsPanelProps): React.JSX.Element;
@@ -42,6 +42,22 @@ export interface ImageSelectProps {
42
42
  onChange: (value: string) => void;
43
43
  className?: string;
44
44
  }
45
+ /** A colour well in the image editor's panels. */
46
+ export interface ImageColorProps {
47
+ /** `#rrggbb`, or `#rrggbbaa` with `alpha`. */
48
+ value: string;
49
+ /** The accessible name. */
50
+ label: string;
51
+ /** Whether the colour has an alpha channel. */
52
+ alpha?: boolean;
53
+ disabled?: boolean;
54
+ /** Every change while the colour is picked. */
55
+ onChange: (value: string) => void;
56
+ /** A pick (e.g. a drag in the picker) starts: changes until `onEnd` merge into one undo step. */
57
+ onStart?: () => void;
58
+ onEnd?: () => void;
59
+ className?: string;
60
+ }
45
61
  /**
46
62
  * The host's own form controls for the image editor's panels. Any left out fall back to the
47
63
  * editor's plain inputs.
@@ -50,6 +66,7 @@ export interface ImageEditorControls {
50
66
  Checkbox?: ComponentType<ImageCheckboxProps>;
51
67
  Range?: ComponentType<ImageRangeProps>;
52
68
  Select?: ComponentType<ImageSelectProps>;
69
+ Color?: ComponentType<ImageColorProps>;
53
70
  }
54
71
  /** Makes the image editor's panels inside it use the host's controls. */
55
72
  export declare function ImageEditorControlsProvider({ controls, children }: {
@@ -64,3 +81,5 @@ export declare function ImageCheckbox(props: ImageCheckboxProps): import("react"
64
81
  export declare function ImageRange(props: ImageRangeProps): import("react").JSX.Element;
65
82
  /** A dropdown: the host's, or a plain select. */
66
83
  export declare function ImageSelect(props: ImageSelectProps): import("react").JSX.Element;
84
+ /** A colour well: the host's, or a plain colour input (which keeps the stored alpha). */
85
+ export declare function ImageColor(props: ImageColorProps): import("react").JSX.Element;
@@ -42,6 +42,22 @@ export interface ImageSelectProps {
42
42
  onChange: (value: string) => void;
43
43
  className?: string;
44
44
  }
45
+ /** A colour well in the image editor's panels. */
46
+ export interface ImageColorProps {
47
+ /** `#rrggbb`, or `#rrggbbaa` with `alpha`. */
48
+ value: string;
49
+ /** The accessible name. */
50
+ label: string;
51
+ /** Whether the colour has an alpha channel. */
52
+ alpha?: boolean;
53
+ disabled?: boolean;
54
+ /** Every change while the colour is picked. */
55
+ onChange: (value: string) => void;
56
+ /** A pick (e.g. a drag in the picker) starts: changes until `onEnd` merge into one undo step. */
57
+ onStart?: () => void;
58
+ onEnd?: () => void;
59
+ className?: string;
60
+ }
45
61
  /**
46
62
  * The host's own form controls for the image editor's panels. Any left out fall back to the
47
63
  * editor's plain inputs.
@@ -50,6 +66,7 @@ export interface ImageEditorControls {
50
66
  Checkbox?: ComponentType<ImageCheckboxProps>;
51
67
  Range?: ComponentType<ImageRangeProps>;
52
68
  Select?: ComponentType<ImageSelectProps>;
69
+ Color?: ComponentType<ImageColorProps>;
53
70
  }
54
71
  /** Makes the image editor's panels inside it use the host's controls. */
55
72
  export declare function ImageEditorControlsProvider({ controls, children }: {
@@ -64,3 +81,5 @@ export declare function ImageCheckbox(props: ImageCheckboxProps): import("react"
64
81
  export declare function ImageRange(props: ImageRangeProps): import("react").JSX.Element;
65
82
  /** A dropdown: the host's, or a plain select. */
66
83
  export declare function ImageSelect(props: ImageSelectProps): import("react").JSX.Element;
84
+ /** A colour well: the host's, or a plain colour input (which keeps the stored alpha). */
85
+ export declare function ImageColor(props: ImageColorProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { ParameterComponents } from '../../parameters/controls.cjs';
2
+ import { type ImageEditorControls } from './controls.cjs';
3
+ /** The host's image-editor `Range`, `Select` and `Color` as parameter controls (only the ones it set). */
4
+ export declare function imageEditorParameterComponents(controls: ImageEditorControls): ParameterComponents;
@@ -0,0 +1,4 @@
1
+ import type { ParameterComponents } from '../../parameters/controls.js';
2
+ import { type ImageEditorControls } from './controls.js';
3
+ /** The host's image-editor `Range`, `Select` and `Color` as parameter controls (only the ones it set). */
4
+ export declare function imageEditorParameterComponents(controls: ImageEditorControls): ParameterComponents;