@pixerate/editor-react 0.98.0 → 0.100.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 +11 -7
- package/dist/animation-editor/index.js +7 -7
- package/dist/canvas/index.cjs +20 -11
- package/dist/canvas/index.js +14 -9
- package/dist/canvas/useCanvasPlaybackSurface.d.cts +8 -2
- package/dist/canvas/useCanvasPlaybackSurface.d.ts +8 -2
- package/dist/chart/index.cjs +8 -4
- package/dist/chart/index.js +2 -2
- package/dist/{chunk-S6C2W5JW.js → chunk-EP6MSQN4.js} +1 -1
- package/dist/{chunk-AILJ4JOW.js → chunk-GDPWLGPD.js} +3 -3
- package/dist/{chunk-SI2V7XPZ.js → chunk-GNO54NFG.js} +5 -1
- package/dist/{chunk-TFEKLNC7.js → chunk-OTDAEVHW.js} +415 -358
- package/dist/{chunk-NEQI2ZIU.js → chunk-V2YC5T4R.js} +14 -8
- package/dist/image-editor/AdjustmentLayersPanel.d.cts +2 -0
- package/dist/image-editor/AdjustmentLayersPanel.d.ts +2 -0
- package/dist/image-editor/ControlSlider.d.cts +2 -0
- package/dist/image-editor/ControlSlider.d.ts +2 -0
- package/dist/image-editor/CurvesEditor.d.cts +2 -0
- package/dist/image-editor/CurvesEditor.d.ts +2 -0
- package/dist/image-editor/ImageEffectControls.d.cts +3 -1
- package/dist/image-editor/ImageEffectControls.d.ts +3 -1
- package/dist/image-editor/index.cjs +423 -361
- package/dist/image-editor/index.js +2 -2
- package/dist/image-editor/styles.d.cts +51 -0
- package/dist/image-editor/styles.d.ts +51 -0
- package/dist/index.cjs +461 -395
- package/dist/index.js +5 -5
- package/dist/paint-editor/index.cjs +8 -4
- package/dist/paint-editor/index.js +4 -4
- package/dist/parameters/index.cjs +18 -8
- package/dist/parameters/index.js +2 -2
- package/dist/playback/useElementPlaybackSurface.d.cts +5 -4
- package/dist/playback/useElementPlaybackSurface.d.ts +5 -4
- package/dist/spreadsheet/index.cjs +5 -1
- package/dist/spreadsheet/index.js +2 -2
- package/dist/vector/index.cjs +5 -1
- package/dist/vector/index.js +1 -1
- package/dist/video-editor/index.cjs +11 -7
- package/dist/video-editor/index.js +7 -7
- package/package.json +3 -3
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePlaybackSurface
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GNO54NFG.js";
|
|
4
4
|
|
|
5
5
|
// src/playback/useElementPlaybackSurface.ts
|
|
6
6
|
import { useRef } from "react";
|
|
7
|
+
import { locatePlaybackChrome } from "@pixerate/editor/tools";
|
|
7
8
|
function useElementPlaybackSurface(playback, id, element, options) {
|
|
8
9
|
const latest = useRef(options);
|
|
9
10
|
latest.current = options;
|
|
10
11
|
const box = () => element.current?.getBoundingClientRect() ?? null;
|
|
12
|
+
const fromViewport = (p) => {
|
|
13
|
+
const r = box();
|
|
14
|
+
return { x: p.x - (r?.left ?? 0), y: p.y - (r?.top ?? 0) };
|
|
15
|
+
};
|
|
11
16
|
return usePlaybackSurface(playback, id, {
|
|
12
17
|
get defaultKind() {
|
|
13
18
|
return latest.current.defaultKind;
|
|
14
19
|
},
|
|
15
20
|
locate: (ref) => {
|
|
16
|
-
const selector = latest.current.selectors[ref.kind]?.(ref.id);
|
|
21
|
+
const selector = latest.current.selectors?.[ref.kind]?.(ref.id);
|
|
17
22
|
const b = box();
|
|
18
23
|
const r = selector ? element.current?.querySelector(selector)?.getBoundingClientRect() : null;
|
|
19
|
-
|
|
24
|
+
if (b && r && r.width > 0) return { x: r.left - b.left, y: r.top - b.top, width: r.width, height: r.height };
|
|
25
|
+
return locatePlaybackChrome(ref, latest.current, fromViewport);
|
|
20
26
|
},
|
|
21
27
|
bounds: () => {
|
|
22
28
|
const r = box();
|
|
@@ -30,11 +36,11 @@ function useElementPlaybackSurface(playback, id, element, options) {
|
|
|
30
36
|
const r = box();
|
|
31
37
|
return { x: (r?.left ?? 0) + p.x, y: (r?.top ?? 0) + p.y };
|
|
32
38
|
},
|
|
33
|
-
fromViewport
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
fromViewport,
|
|
40
|
+
reveal: () => latest.current.reveal?.(),
|
|
41
|
+
get open() {
|
|
42
|
+
return latest.current.open ? (ref) => latest.current.open?.(ref) : void 0;
|
|
43
|
+
}
|
|
38
44
|
});
|
|
39
45
|
}
|
|
40
46
|
|
|
@@ -5,6 +5,8 @@ export interface AdjustmentLayersPanelProps {
|
|
|
5
5
|
/** The current layers (`state.adjustments.layers`), bottom to top. Omit to follow the controller. */
|
|
6
6
|
layers?: AdjustmentLayer[];
|
|
7
7
|
histogram?: ImageHistogram | null;
|
|
8
|
+
/** Extra classes on the root element. */
|
|
9
|
+
className?: string;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Adjustment-layer stack: add, reorder, show / hide and remove layers, and edit the selected
|
|
@@ -5,6 +5,8 @@ export interface AdjustmentLayersPanelProps {
|
|
|
5
5
|
/** The current layers (`state.adjustments.layers`), bottom to top. Omit to follow the controller. */
|
|
6
6
|
layers?: AdjustmentLayer[];
|
|
7
7
|
histogram?: ImageHistogram | null;
|
|
8
|
+
/** Extra classes on the root element. */
|
|
9
|
+
className?: string;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Adjustment-layer stack: add, reorder, show / hide and remove layers, and edit the selected
|
|
@@ -7,6 +7,8 @@ export interface ControlSliderProps {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
/** Overrides `spec.label` (also the accessible name). */
|
|
9
9
|
label?: string;
|
|
10
|
+
/** Extra classes on the root element. */
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
13
|
/** A labelled range input described by a control-table entry. */
|
|
12
14
|
export declare const ControlSlider: React.FC<ControlSliderProps>;
|
|
@@ -7,6 +7,8 @@ export interface ControlSliderProps {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
/** Overrides `spec.label` (also the accessible name). */
|
|
9
9
|
label?: string;
|
|
10
|
+
/** Extra classes on the root element. */
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
13
|
/** A labelled range input described by a control-table entry. */
|
|
12
14
|
export declare const ControlSlider: React.FC<ControlSliderProps>;
|
|
@@ -7,6 +7,8 @@ export interface CurvesEditorProps {
|
|
|
7
7
|
histogram?: ImageHistogram | null;
|
|
8
8
|
channel?: 'master' | 'red' | 'green' | 'blue';
|
|
9
9
|
size?: number;
|
|
10
|
+
/** Extra classes on the root element. */
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Curves editor over the histogram: click to add a point, drag to move it, double-click to
|
|
@@ -7,6 +7,8 @@ export interface CurvesEditorProps {
|
|
|
7
7
|
histogram?: ImageHistogram | null;
|
|
8
8
|
channel?: 'master' | 'red' | 'green' | 'blue';
|
|
9
9
|
size?: number;
|
|
10
|
+
/** Extra classes on the root element. */
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Curves editor over the histogram: click to add a point, drag to move it, double-click to
|
|
@@ -7,6 +7,8 @@ export interface ImageEffectControlsProps {
|
|
|
7
7
|
values: Readonly<Record<string, unknown>>;
|
|
8
8
|
onChange: (control: string, value: unknown, gesture: string | null) => void;
|
|
9
9
|
onPreset: (values: Readonly<Record<string, unknown>>) => void;
|
|
10
|
+
/** Extra classes on the root element. */
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
13
|
/** One effect's controls, loaded from the provider; a note when it does not have the effect. Parity with Svelte's `<ImageEffectControls>`. */
|
|
12
|
-
export declare function ImageEffectControls({ provider, effect, name, values, onChange, onPreset }: ImageEffectControlsProps): React.JSX.Element;
|
|
14
|
+
export declare function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className }: ImageEffectControlsProps): React.JSX.Element;
|
|
@@ -7,6 +7,8 @@ export interface ImageEffectControlsProps {
|
|
|
7
7
|
values: Readonly<Record<string, unknown>>;
|
|
8
8
|
onChange: (control: string, value: unknown, gesture: string | null) => void;
|
|
9
9
|
onPreset: (values: Readonly<Record<string, unknown>>) => void;
|
|
10
|
+
/** Extra classes on the root element. */
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
13
|
/** One effect's controls, loaded from the provider; a note when it does not have the effect. Parity with Svelte's `<ImageEffectControls>`. */
|
|
12
|
-
export declare function ImageEffectControls({ provider, effect, name, values, onChange, onPreset }: ImageEffectControlsProps): React.JSX.Element;
|
|
14
|
+
export declare function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className }: ImageEffectControlsProps): React.JSX.Element;
|