@pixerate/editor-react 0.114.3 → 0.116.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/animation-editor/index.cjs +20 -2
- package/dist/animation-editor/index.js +2 -2
- package/dist/canvas/index.cjs +20 -2
- package/dist/canvas/index.js +2 -2
- package/dist/{chunk-354TA5QV.js → chunk-5RPB4WGT.js} +20 -2
- package/dist/{chunk-TOGMXZM4.js → chunk-6BWTJ3EE.js} +1 -1
- package/dist/{chunk-SH63DFOO.js → chunk-ZQ54FEXL.js} +170 -98
- package/dist/effects/index.cjs +20 -2
- package/dist/effects/index.js +2 -2
- package/dist/image-editor/ImageProviderEffectsPanel.d.cts +5 -4
- package/dist/image-editor/ImageProviderEffectsPanel.d.ts +5 -4
- package/dist/image-editor/LayerEffectsPanel.d.cts +5 -0
- package/dist/image-editor/LayerEffectsPanel.d.ts +5 -0
- package/dist/image-editor/controls/controls.d.cts +19 -0
- package/dist/image-editor/controls/controls.d.ts +19 -0
- package/dist/image-editor/controls/parameterControls.d.cts +1 -1
- package/dist/image-editor/controls/parameterControls.d.ts +1 -1
- package/dist/image-editor/index.cjs +183 -92
- package/dist/image-editor/index.d.cts +1 -1
- package/dist/image-editor/index.d.ts +1 -1
- package/dist/image-editor/index.js +5 -3
- package/dist/index.cjs +183 -92
- package/dist/index.js +5 -3
- package/dist/paint-editor/index.cjs +20 -2
- package/dist/paint-editor/index.js +2 -2
- package/dist/parameters/controls.d.cts +20 -0
- package/dist/parameters/controls.d.ts +20 -0
- package/dist/parameters/fields.d.cts +1 -1
- package/dist/parameters/fields.d.ts +1 -1
- package/dist/parameters/index.cjs +20 -2
- package/dist/parameters/index.js +1 -1
- package/dist/vector/index.cjs +20 -2
- package/dist/vector/index.js +2 -2
- package/dist/video-editor/index.cjs +20 -2
- package/dist/video-editor/index.js +2 -2
- package/package.json +3 -3
package/dist/effects/index.cjs
CHANGED
|
@@ -1236,7 +1236,8 @@ function resolveParameterComponents(explicit, context) {
|
|
|
1236
1236
|
return {
|
|
1237
1237
|
input: explicit?.input ?? context?.input,
|
|
1238
1238
|
slider: explicit?.slider ?? context?.slider,
|
|
1239
|
-
select: explicit?.select ?? context?.select
|
|
1239
|
+
select: explicit?.select ?? context?.select,
|
|
1240
|
+
color: explicit?.color ?? context?.color
|
|
1240
1241
|
};
|
|
1241
1242
|
}
|
|
1242
1243
|
|
|
@@ -1470,7 +1471,8 @@ function ParameterSelect(props) {
|
|
|
1470
1471
|
}
|
|
1471
1472
|
);
|
|
1472
1473
|
}
|
|
1473
|
-
function ParameterColor({ field, value, onChange, onGestureStart, onGestureEnd, disabled, id }) {
|
|
1474
|
+
function ParameterColor({ field, value, onChange, onGestureStart, onGestureEnd, disabled, id, components }) {
|
|
1475
|
+
const CustomColor = resolveParameterComponents(components, useParameterComponents()).color;
|
|
1474
1476
|
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
1475
1477
|
const containerRef = (0, import_react8.useRef)(null);
|
|
1476
1478
|
const buttonRef = (0, import_react8.useRef)(null);
|
|
@@ -1502,6 +1504,22 @@ function ParameterColor({ field, value, onChange, onGestureStart, onGestureEnd,
|
|
|
1502
1504
|
window.removeEventListener("keydown", onKeyDown, true);
|
|
1503
1505
|
};
|
|
1504
1506
|
}, [open]);
|
|
1507
|
+
if (CustomColor) {
|
|
1508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1509
|
+
CustomColor,
|
|
1510
|
+
{
|
|
1511
|
+
id,
|
|
1512
|
+
value: shown,
|
|
1513
|
+
alpha,
|
|
1514
|
+
swatches: field.swatches,
|
|
1515
|
+
disabled: off,
|
|
1516
|
+
label: name,
|
|
1517
|
+
onChange,
|
|
1518
|
+
onGestureStart,
|
|
1519
|
+
onGestureEnd
|
|
1520
|
+
}
|
|
1521
|
+
);
|
|
1522
|
+
}
|
|
1505
1523
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref: containerRef, className: "relative space-y-1.5", children: [
|
|
1506
1524
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1507
1525
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
package/dist/effects/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
useEffectAuthoring,
|
|
7
7
|
useEffectDescription,
|
|
8
8
|
useEffects
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
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 {
|
|
@@ -8,9 +8,10 @@ export interface ImageProviderEffectsPanelProps {
|
|
|
8
8
|
components?: ParameterComponents;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* smart object in the same undo step
|
|
11
|
+
* Effects for the active layer, in one place. An effect layer first: its effect (change it or
|
|
12
|
+
* rasterize it), a still frame or an animation for an effect that moves, and its controls. Then
|
|
13
|
+
* what is applied to any layer: provider filters (smart filters; applying one converts a pixel
|
|
14
|
+
* layer to a smart object in the same undo step) and layer styles, added from one menu. New
|
|
15
|
+
* effect layers come from the layers panel. Without a provider it says why nothing can be added.
|
|
15
16
|
*/
|
|
16
17
|
export declare function ImageProviderEffectsPanel({ controller, className, components }: ImageProviderEffectsPanelProps): React.JSX.Element;
|
|
@@ -8,9 +8,10 @@ export interface ImageProviderEffectsPanelProps {
|
|
|
8
8
|
components?: ParameterComponents;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* smart object in the same undo step
|
|
11
|
+
* Effects for the active layer, in one place. An effect layer first: its effect (change it or
|
|
12
|
+
* rasterize it), a still frame or an animation for an effect that moves, and its controls. Then
|
|
13
|
+
* what is applied to any layer: provider filters (smart filters; applying one converts a pixel
|
|
14
|
+
* layer to a smart object in the same undo step) and layer styles, added from one menu. New
|
|
15
|
+
* effect layers come from the layers panel. Without a provider it says why nothing can be added.
|
|
15
16
|
*/
|
|
16
17
|
export declare function ImageProviderEffectsPanel({ controller, className, components }: ImageProviderEffectsPanelProps): React.JSX.Element;
|
|
@@ -4,6 +4,11 @@ export interface LayerEffectsPanelProps {
|
|
|
4
4
|
controller: ImageEditorController;
|
|
5
5
|
/** The layer whose effects to show (default: the active layer). */
|
|
6
6
|
layerId?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Show the "fx Effects" title and the "Add effect" menu (default true). Without them (inside a
|
|
9
|
+
* panel that adds styles from its own menu) the master switch and Scale stay.
|
|
10
|
+
*/
|
|
11
|
+
heading?: boolean;
|
|
7
12
|
className?: string;
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
@@ -4,6 +4,11 @@ export interface LayerEffectsPanelProps {
|
|
|
4
4
|
controller: ImageEditorController;
|
|
5
5
|
/** The layer whose effects to show (default: the active layer). */
|
|
6
6
|
layerId?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Show the "fx Effects" title and the "Add effect" menu (default true). Without them (inside a
|
|
9
|
+
* panel that adds styles from its own menu) the master switch and Scale stay.
|
|
10
|
+
*/
|
|
11
|
+
heading?: boolean;
|
|
7
12
|
className?: string;
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ParameterComponents } from '../../parameters/controls.cjs';
|
|
2
2
|
import { type ImageEditorControls } from './controls.cjs';
|
|
3
|
-
/** The host's image-editor `Range` and `
|
|
3
|
+
/** The host's image-editor `Range`, `Select` and `Color` as parameter controls (only the ones it set). */
|
|
4
4
|
export declare function imageEditorParameterComponents(controls: ImageEditorControls): ParameterComponents;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ParameterComponents } from '../../parameters/controls.js';
|
|
2
2
|
import { type ImageEditorControls } from './controls.js';
|
|
3
|
-
/** The host's image-editor `Range` and `
|
|
3
|
+
/** The host's image-editor `Range`, `Select` and `Color` as parameter controls (only the ones it set). */
|
|
4
4
|
export declare function imageEditorParameterComponents(controls: ImageEditorControls): ParameterComponents;
|