@pixerate/editor-react 0.100.1 → 0.101.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 +3 -1
- package/dist/animation-editor/index.js +5 -2
- package/dist/animation-editor/useAnimationEditor.d.cts +4 -1
- package/dist/animation-editor/useAnimationEditor.d.ts +4 -1
- package/dist/chart/index.cjs +3 -1
- package/dist/chart/index.js +1 -1
- package/dist/chart/useChartEditor.d.cts +4 -1
- package/dist/chart/useChartEditor.d.ts +4 -1
- package/dist/{chunk-GDPWLGPD.js → chunk-ZHMATFBB.js} +5 -2
- package/dist/index.js +1 -1
- package/dist/parameters/index.cjs +3 -1
- package/dist/parameters/index.js +5 -2
- package/dist/parameters/useParameters.d.cts +4 -1
- package/dist/parameters/useParameters.d.ts +4 -1
- package/dist/vector/index.cjs +3 -1
- package/dist/vector/index.js +5 -2
- package/dist/vector/useVectorEditor.d.cts +4 -1
- package/dist/vector/useVectorEditor.d.ts +4 -1
- package/dist/video-editor/index.cjs +3 -1
- package/dist/video-editor/index.js +5 -2
- package/dist/video-editor/useVideoEditor.d.cts +4 -1
- package/dist/video-editor/useVideoEditor.d.ts +4 -1
- package/package.json +3 -3
|
@@ -85,7 +85,9 @@ function useAnimationEditor(controllerOrOptions = {}) {
|
|
|
85
85
|
}),
|
|
86
86
|
[controller]
|
|
87
87
|
);
|
|
88
|
-
|
|
88
|
+
const editorDocument = (0, import_react.useMemo)(() => (0, import_animation_editor.createAnimationEditorDocument)(controller), [controller]);
|
|
89
|
+
(0, import_react.useEffect)(() => () => editorDocument.destroy(), [editorDocument]);
|
|
90
|
+
return { controller, editorDocument, state, ...actions };
|
|
89
91
|
}
|
|
90
92
|
function useAnimationEditorTools(registry, controller, options = {}) {
|
|
91
93
|
const { id, namespace, readOnly, rasterize, playbackSurface } = options;
|
|
@@ -18,7 +18,8 @@ import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
|
18
18
|
import {
|
|
19
19
|
AnimationEditorController,
|
|
20
20
|
createAnimationEditorToolProvider,
|
|
21
|
-
createAnimationEffectsToolProvider
|
|
21
|
+
createAnimationEffectsToolProvider,
|
|
22
|
+
createAnimationEditorDocument
|
|
22
23
|
} from "@pixerate/editor/animation-editor";
|
|
23
24
|
function useAnimationEditorController(options = {}) {
|
|
24
25
|
const ref = useRef(null);
|
|
@@ -52,7 +53,9 @@ function useAnimationEditor(controllerOrOptions = {}) {
|
|
|
52
53
|
}),
|
|
53
54
|
[controller]
|
|
54
55
|
);
|
|
55
|
-
|
|
56
|
+
const editorDocument = useMemo(() => createAnimationEditorDocument(controller), [controller]);
|
|
57
|
+
useEffect(() => () => editorDocument.destroy(), [editorDocument]);
|
|
58
|
+
return { controller, editorDocument, state, ...actions };
|
|
56
59
|
}
|
|
57
60
|
function useAnimationEditorTools(registry, controller, options = {}) {
|
|
58
61
|
const { id, namespace, readOnly, rasterize, playbackSurface } = options;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AnimationEditorController, type AnimationEffectsToolProviderOptions, type AnimationEditorOptions, type AnimationEditorState, type AnimationEditorToolProviderOptions } from '@pixerate/editor/animation-editor';
|
|
1
|
+
import { AnimationEditorController, type AnimationEffectsToolProviderOptions, type AnimationEditorOptions, type AnimationEditorState, type AnimationEditorToolProviderOptions, type MotionScene } from '@pixerate/editor/animation-editor';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
import type { ToolRegistry } from '@pixerate/editor/tools';
|
|
3
4
|
/** An `AnimationEditorController` created once for the component's lifetime (destroyed on unmount). */
|
|
4
5
|
export declare function useAnimationEditorController(options?: AnimationEditorOptions): AnimationEditorController;
|
|
@@ -6,6 +7,8 @@ export declare function useAnimationEditorController(options?: AnimationEditorOp
|
|
|
6
7
|
export declare function useAnimationEditorState(controller: AnimationEditorController): AnimationEditorState;
|
|
7
8
|
export interface UseAnimationEditorResult {
|
|
8
9
|
controller: AnimationEditorController;
|
|
10
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
11
|
+
editorDocument: EditorDocument<MotionScene>;
|
|
9
12
|
state: AnimationEditorState;
|
|
10
13
|
play: () => void;
|
|
11
14
|
pause: () => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AnimationEditorController, type AnimationEffectsToolProviderOptions, type AnimationEditorOptions, type AnimationEditorState, type AnimationEditorToolProviderOptions } from '@pixerate/editor/animation-editor';
|
|
1
|
+
import { AnimationEditorController, type AnimationEffectsToolProviderOptions, type AnimationEditorOptions, type AnimationEditorState, type AnimationEditorToolProviderOptions, type MotionScene } from '@pixerate/editor/animation-editor';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
import type { ToolRegistry } from '@pixerate/editor/tools';
|
|
3
4
|
/** An `AnimationEditorController` created once for the component's lifetime (destroyed on unmount). */
|
|
4
5
|
export declare function useAnimationEditorController(options?: AnimationEditorOptions): AnimationEditorController;
|
|
@@ -6,6 +7,8 @@ export declare function useAnimationEditorController(options?: AnimationEditorOp
|
|
|
6
7
|
export declare function useAnimationEditorState(controller: AnimationEditorController): AnimationEditorState;
|
|
7
8
|
export interface UseAnimationEditorResult {
|
|
8
9
|
controller: AnimationEditorController;
|
|
10
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
11
|
+
editorDocument: EditorDocument<MotionScene>;
|
|
9
12
|
state: AnimationEditorState;
|
|
10
13
|
play: () => void;
|
|
11
14
|
pause: () => void;
|
package/dist/chart/index.cjs
CHANGED
|
@@ -88,7 +88,9 @@ function useChartEditor(controllerOrOptions = {}) {
|
|
|
88
88
|
}),
|
|
89
89
|
[controller]
|
|
90
90
|
);
|
|
91
|
-
|
|
91
|
+
const editorDocument = (0, import_react.useMemo)(() => (0, import_chart.createChartEditorDocument)(controller), [controller]);
|
|
92
|
+
(0, import_react.useEffect)(() => () => editorDocument.destroy(), [editorDocument]);
|
|
93
|
+
return { controller, editorDocument, state, spec: state.spec, selection: state.selection, ...actions };
|
|
92
94
|
}
|
|
93
95
|
function useChartCommands(registry, controller, options = {}) {
|
|
94
96
|
const { prefix, group, scope } = options;
|
package/dist/chart/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { ToolRegistry } from '@pixerate/editor/tools';
|
|
2
|
-
import { ChartController, ChartDirector, ChartPresence, type OfficeChartToolProviderOptions, type ChartScene, type ChartToolProviderOptions, type ChartActionResult, type ChartCommandOptions, type ChartControllerOptions, type ChartSelection, type ChartSpecPatch, type ChartState, type ChartType } from '@pixerate/editor/chart';
|
|
2
|
+
import { ChartController, ChartDirector, ChartPresence, type OfficeChartToolProviderOptions, type ChartScene, type ChartToolProviderOptions, type ChartActionResult, type ChartCommandOptions, type ChartControllerOptions, type ChartSelection, type ChartSpecPatch, type ChartState, type ChartType, type ChartSpec } from '@pixerate/editor/chart';
|
|
3
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
3
4
|
/** A `ChartController` created once for the component's lifetime. */
|
|
4
5
|
export declare function useChartController(options?: ChartControllerOptions): ChartController;
|
|
5
6
|
/** The controller's state (re-renders on every change). */
|
|
6
7
|
export declare function useChartState(controller: ChartController): ChartState;
|
|
7
8
|
export interface UseChartEditorResult {
|
|
8
9
|
controller: ChartController;
|
|
10
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
11
|
+
editorDocument: EditorDocument<ChartSpec>;
|
|
9
12
|
state: ChartState;
|
|
10
13
|
spec: ChartState['spec'];
|
|
11
14
|
selection: ChartSelection | null;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { ToolRegistry } from '@pixerate/editor/tools';
|
|
2
|
-
import { ChartController, ChartDirector, ChartPresence, type OfficeChartToolProviderOptions, type ChartScene, type ChartToolProviderOptions, type ChartActionResult, type ChartCommandOptions, type ChartControllerOptions, type ChartSelection, type ChartSpecPatch, type ChartState, type ChartType } from '@pixerate/editor/chart';
|
|
2
|
+
import { ChartController, ChartDirector, ChartPresence, type OfficeChartToolProviderOptions, type ChartScene, type ChartToolProviderOptions, type ChartActionResult, type ChartCommandOptions, type ChartControllerOptions, type ChartSelection, type ChartSpecPatch, type ChartState, type ChartType, type ChartSpec } from '@pixerate/editor/chart';
|
|
3
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
3
4
|
/** A `ChartController` created once for the component's lifetime. */
|
|
4
5
|
export declare function useChartController(options?: ChartControllerOptions): ChartController;
|
|
5
6
|
/** The controller's state (re-renders on every change). */
|
|
6
7
|
export declare function useChartState(controller: ChartController): ChartState;
|
|
7
8
|
export interface UseChartEditorResult {
|
|
8
9
|
controller: ChartController;
|
|
10
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
11
|
+
editorDocument: EditorDocument<ChartSpec>;
|
|
9
12
|
state: ChartState;
|
|
10
13
|
spec: ChartState['spec'];
|
|
11
14
|
selection: ChartSelection | null;
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
createChartRasterizer,
|
|
9
9
|
createChartToolProvider,
|
|
10
10
|
createOfficeChartToolProvider,
|
|
11
|
-
layoutChart
|
|
11
|
+
layoutChart,
|
|
12
|
+
createChartEditorDocument
|
|
12
13
|
} from "@pixerate/editor/chart";
|
|
13
14
|
function useChartController(options = {}) {
|
|
14
15
|
const ref = useRef(null);
|
|
@@ -38,7 +39,9 @@ function useChartEditor(controllerOrOptions = {}) {
|
|
|
38
39
|
}),
|
|
39
40
|
[controller]
|
|
40
41
|
);
|
|
41
|
-
|
|
42
|
+
const editorDocument = useMemo(() => createChartEditorDocument(controller), [controller]);
|
|
43
|
+
useEffect(() => () => editorDocument.destroy(), [editorDocument]);
|
|
44
|
+
return { controller, editorDocument, state, spec: state.spec, selection: state.selection, ...actions };
|
|
42
45
|
}
|
|
43
46
|
function useChartCommands(registry, controller, options = {}) {
|
|
44
47
|
const { prefix, group, scope } = options;
|
package/dist/index.js
CHANGED
|
@@ -92,7 +92,9 @@ function useParameters(controllerOrOptions) {
|
|
|
92
92
|
}),
|
|
93
93
|
[controller]
|
|
94
94
|
);
|
|
95
|
-
|
|
95
|
+
const editorDocument = (0, import_react.useMemo)(() => (0, import_parameters.createParametersEditorDocument)(controller), [controller]);
|
|
96
|
+
(0, import_react.useEffect)(() => () => editorDocument.destroy(), [editorDocument]);
|
|
97
|
+
return { controller, editorDocument, state, values: state.values, ...actions };
|
|
96
98
|
}
|
|
97
99
|
function useParameterCommands(registry, controller, options = {}) {
|
|
98
100
|
const { prefix, group, scope } = options;
|
package/dist/parameters/index.js
CHANGED
|
@@ -27,7 +27,8 @@ import {
|
|
|
27
27
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
28
28
|
import {
|
|
29
29
|
ParametersController,
|
|
30
|
-
createParameterCommands
|
|
30
|
+
createParameterCommands,
|
|
31
|
+
createParametersEditorDocument
|
|
31
32
|
} from "@pixerate/editor/parameters";
|
|
32
33
|
function useParametersController(options) {
|
|
33
34
|
const ref = useRef(null);
|
|
@@ -66,7 +67,9 @@ function useParameters(controllerOrOptions) {
|
|
|
66
67
|
}),
|
|
67
68
|
[controller]
|
|
68
69
|
);
|
|
69
|
-
|
|
70
|
+
const editorDocument = useMemo(() => createParametersEditorDocument(controller), [controller]);
|
|
71
|
+
useEffect(() => () => editorDocument.destroy(), [editorDocument]);
|
|
72
|
+
return { controller, editorDocument, state, values: state.values, ...actions };
|
|
70
73
|
}
|
|
71
74
|
function useParameterCommands(registry, controller, options = {}) {
|
|
72
75
|
const { prefix, group, scope } = options;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ParametersController, type ParameterCommandOptions, type ParametersControllerOptions, type ParametersState, type ParameterValue, type ParameterSetResult } from '@pixerate/editor/parameters';
|
|
1
|
+
import { ParametersController, type ParameterCommandOptions, type ParametersControllerOptions, type ParametersState, type ParameterValue, type ParameterSetResult, type ParametersSnapshot } from '@pixerate/editor/parameters';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
/**
|
|
3
4
|
* A `ParametersController` created once for the component's lifetime. When `options.schema`
|
|
4
5
|
* changes (a new object), the controller's schema is replaced and fitting values are kept.
|
|
@@ -8,6 +9,8 @@ export declare function useParametersController(options: ParametersControllerOpt
|
|
|
8
9
|
export declare function useParametersState(controller: ParametersController): ParametersState;
|
|
9
10
|
export interface UseParametersResult {
|
|
10
11
|
controller: ParametersController;
|
|
12
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
13
|
+
editorDocument: EditorDocument<ParametersSnapshot>;
|
|
11
14
|
state: ParametersState;
|
|
12
15
|
values: ParametersState['values'];
|
|
13
16
|
setValue: (id: string, value: ParameterValue) => ParameterSetResult;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ParametersController, type ParameterCommandOptions, type ParametersControllerOptions, type ParametersState, type ParameterValue, type ParameterSetResult } from '@pixerate/editor/parameters';
|
|
1
|
+
import { ParametersController, type ParameterCommandOptions, type ParametersControllerOptions, type ParametersState, type ParameterValue, type ParameterSetResult, type ParametersSnapshot } from '@pixerate/editor/parameters';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
/**
|
|
3
4
|
* A `ParametersController` created once for the component's lifetime. When `options.schema`
|
|
4
5
|
* changes (a new object), the controller's schema is replaced and fitting values are kept.
|
|
@@ -8,6 +9,8 @@ export declare function useParametersController(options: ParametersControllerOpt
|
|
|
8
9
|
export declare function useParametersState(controller: ParametersController): ParametersState;
|
|
9
10
|
export interface UseParametersResult {
|
|
10
11
|
controller: ParametersController;
|
|
12
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
13
|
+
editorDocument: EditorDocument<ParametersSnapshot>;
|
|
11
14
|
state: ParametersState;
|
|
12
15
|
values: ParametersState['values'];
|
|
13
16
|
setValue: (id: string, value: ParameterValue) => ParameterSetResult;
|
package/dist/vector/index.cjs
CHANGED
|
@@ -101,7 +101,9 @@ function useVectorEditor(controllerOrOptions = {}) {
|
|
|
101
101
|
}),
|
|
102
102
|
[controller]
|
|
103
103
|
);
|
|
104
|
-
|
|
104
|
+
const editorDocument = (0, import_react.useMemo)(() => (0, import_vector.createVectorEditorDocument)(controller), [controller]);
|
|
105
|
+
(0, import_react.useEffect)(() => () => editorDocument.destroy(), [editorDocument]);
|
|
106
|
+
return { controller, editorDocument, state, ...actions };
|
|
105
107
|
}
|
|
106
108
|
function useVectorCommands(registry, controller, options = {}) {
|
|
107
109
|
const { prefix, group, scope } = options;
|
package/dist/vector/index.js
CHANGED
|
@@ -19,7 +19,8 @@ import {
|
|
|
19
19
|
VectorEditorController,
|
|
20
20
|
createVectorCommands,
|
|
21
21
|
createVectorEffectsToolProvider,
|
|
22
|
-
createVectorGenerationToolProvider
|
|
22
|
+
createVectorGenerationToolProvider,
|
|
23
|
+
createVectorEditorDocument
|
|
23
24
|
} from "@pixerate/editor/vector";
|
|
24
25
|
function useVectorEditorController(options = {}) {
|
|
25
26
|
const ref = useRef(null);
|
|
@@ -50,7 +51,9 @@ function useVectorEditor(controllerOrOptions = {}) {
|
|
|
50
51
|
}),
|
|
51
52
|
[controller]
|
|
52
53
|
);
|
|
53
|
-
|
|
54
|
+
const editorDocument = useMemo(() => createVectorEditorDocument(controller), [controller]);
|
|
55
|
+
useEffect(() => () => editorDocument.destroy(), [editorDocument]);
|
|
56
|
+
return { controller, editorDocument, state, ...actions };
|
|
54
57
|
}
|
|
55
58
|
function useVectorCommands(registry, controller, options = {}) {
|
|
56
59
|
const { prefix, group, scope } = options;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { VectorEditorController, type VectorEffectsToolProviderOptions, type VectorGenerationToolProviderOptions, type VectorCommandOptions, type VectorEditorOptions, type VectorEditorState, type VectorTool } from '@pixerate/editor/vector';
|
|
1
|
+
import { VectorEditorController, type VectorEffectsToolProviderOptions, type VectorGenerationToolProviderOptions, type VectorCommandOptions, type VectorEditorOptions, type VectorEditorState, type VectorTool, type VectorDocument } from '@pixerate/editor/vector';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
import type { ToolRegistry } from '@pixerate/editor/tools';
|
|
3
4
|
/** A `VectorEditorController` created once for the component's lifetime (destroyed on unmount). */
|
|
4
5
|
export declare function useVectorEditorController(options?: VectorEditorOptions): VectorEditorController;
|
|
@@ -6,6 +7,8 @@ export declare function useVectorEditorController(options?: VectorEditorOptions)
|
|
|
6
7
|
export declare function useVectorEditorState(controller: VectorEditorController): VectorEditorState;
|
|
7
8
|
export interface UseVectorEditorResult {
|
|
8
9
|
controller: VectorEditorController;
|
|
10
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
11
|
+
editorDocument: EditorDocument<VectorDocument>;
|
|
9
12
|
state: VectorEditorState;
|
|
10
13
|
setTool: (tool: VectorTool) => void;
|
|
11
14
|
undo: () => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { VectorEditorController, type VectorEffectsToolProviderOptions, type VectorGenerationToolProviderOptions, type VectorCommandOptions, type VectorEditorOptions, type VectorEditorState, type VectorTool } from '@pixerate/editor/vector';
|
|
1
|
+
import { VectorEditorController, type VectorEffectsToolProviderOptions, type VectorGenerationToolProviderOptions, type VectorCommandOptions, type VectorEditorOptions, type VectorEditorState, type VectorTool, type VectorDocument } from '@pixerate/editor/vector';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
import type { ToolRegistry } from '@pixerate/editor/tools';
|
|
3
4
|
/** A `VectorEditorController` created once for the component's lifetime (destroyed on unmount). */
|
|
4
5
|
export declare function useVectorEditorController(options?: VectorEditorOptions): VectorEditorController;
|
|
@@ -6,6 +7,8 @@ export declare function useVectorEditorController(options?: VectorEditorOptions)
|
|
|
6
7
|
export declare function useVectorEditorState(controller: VectorEditorController): VectorEditorState;
|
|
7
8
|
export interface UseVectorEditorResult {
|
|
8
9
|
controller: VectorEditorController;
|
|
10
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
11
|
+
editorDocument: EditorDocument<VectorDocument>;
|
|
9
12
|
state: VectorEditorState;
|
|
10
13
|
setTool: (tool: VectorTool) => void;
|
|
11
14
|
undo: () => void;
|
|
@@ -85,7 +85,9 @@ function useVideoEditor(controllerOrOptions = {}) {
|
|
|
85
85
|
}),
|
|
86
86
|
[controller]
|
|
87
87
|
);
|
|
88
|
-
|
|
88
|
+
const editorDocument = (0, import_react.useMemo)(() => (0, import_video_editor.createVideoEditorDocument)(controller), [controller]);
|
|
89
|
+
(0, import_react.useEffect)(() => () => editorDocument.destroy(), [editorDocument]);
|
|
90
|
+
return { controller, editorDocument, state, ...actions };
|
|
89
91
|
}
|
|
90
92
|
function useVideoEditorTools(registry, controller, options = {}) {
|
|
91
93
|
const { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout, playbackSurface } = options;
|
|
@@ -18,7 +18,8 @@ import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
|
18
18
|
import {
|
|
19
19
|
VideoEditorController,
|
|
20
20
|
createVideoEditorToolProvider,
|
|
21
|
-
createVideoEffectsToolProvider
|
|
21
|
+
createVideoEffectsToolProvider,
|
|
22
|
+
createVideoEditorDocument
|
|
22
23
|
} from "@pixerate/editor/video-editor";
|
|
23
24
|
function useVideoEditorController(options = {}) {
|
|
24
25
|
const ref = useRef(null);
|
|
@@ -54,7 +55,9 @@ function useVideoEditor(controllerOrOptions = {}) {
|
|
|
54
55
|
}),
|
|
55
56
|
[controller]
|
|
56
57
|
);
|
|
57
|
-
|
|
58
|
+
const editorDocument = useMemo(() => createVideoEditorDocument(controller), [controller]);
|
|
59
|
+
useEffect(() => () => editorDocument.destroy(), [editorDocument]);
|
|
60
|
+
return { controller, editorDocument, state, ...actions };
|
|
58
61
|
}
|
|
59
62
|
function useVideoEditorTools(registry, controller, options = {}) {
|
|
60
63
|
const { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout, playbackSurface } = options;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { VideoEditorController, type VideoEffectsToolProviderOptions, type VideoEditResult, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions } from '@pixerate/editor/video-editor';
|
|
1
|
+
import { VideoEditorController, type VideoEffectsToolProviderOptions, type VideoEditResult, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoProject } from '@pixerate/editor/video-editor';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
import type { ToolRegistry } from '@pixerate/editor/tools';
|
|
3
4
|
/** A `VideoEditorController` created once for the component's lifetime (destroyed on unmount). */
|
|
4
5
|
export declare function useVideoEditorController(options?: VideoEditorOptions): VideoEditorController;
|
|
@@ -6,6 +7,8 @@ export declare function useVideoEditorController(options?: VideoEditorOptions):
|
|
|
6
7
|
export declare function useVideoEditorState(controller: VideoEditorController): VideoEditorState;
|
|
7
8
|
export interface UseVideoEditorResult {
|
|
8
9
|
controller: VideoEditorController;
|
|
10
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
11
|
+
editorDocument: EditorDocument<VideoProject>;
|
|
9
12
|
state: VideoEditorState;
|
|
10
13
|
play: () => void;
|
|
11
14
|
pause: () => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { VideoEditorController, type VideoEffectsToolProviderOptions, type VideoEditResult, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions } from '@pixerate/editor/video-editor';
|
|
1
|
+
import { VideoEditorController, type VideoEffectsToolProviderOptions, type VideoEditResult, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoProject } from '@pixerate/editor/video-editor';
|
|
2
|
+
import type { EditorDocument } from '@pixerate/editor/persistence';
|
|
2
3
|
import type { ToolRegistry } from '@pixerate/editor/tools';
|
|
3
4
|
/** A `VideoEditorController` created once for the component's lifetime (destroyed on unmount). */
|
|
4
5
|
export declare function useVideoEditorController(options?: VideoEditorOptions): VideoEditorController;
|
|
@@ -6,6 +7,8 @@ export declare function useVideoEditorController(options?: VideoEditorOptions):
|
|
|
6
7
|
export declare function useVideoEditorState(controller: VideoEditorController): VideoEditorState;
|
|
7
8
|
export interface UseVideoEditorResult {
|
|
8
9
|
controller: VideoEditorController;
|
|
10
|
+
/** The save / load / undo contract (for `useEditorAutosave` or `createDocumentToolProvider`). */
|
|
11
|
+
editorDocument: EditorDocument<VideoProject>;
|
|
9
12
|
state: VideoEditorState;
|
|
10
13
|
play: () => void;
|
|
11
14
|
pause: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.101.0",
|
|
4
4
|
"description": "React bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
},
|
|
246
246
|
"peerDependencies": {
|
|
247
247
|
"@dagrejs/dagre": "^1.1.8",
|
|
248
|
-
"@pixerate/editor": ">=0.
|
|
248
|
+
"@pixerate/editor": ">=0.151.0 <1.0.0-0",
|
|
249
249
|
"@tiptap/core": "^2.27.3",
|
|
250
250
|
"@tiptap/pm": "^2.27.3",
|
|
251
251
|
"@tiptap/react": "^2.27.3",
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
"tsup": "^9.0.0",
|
|
273
273
|
"typescript": "^5.7.3",
|
|
274
274
|
"vitest": "^5.0.5",
|
|
275
|
-
"@pixerate/editor": "0.
|
|
275
|
+
"@pixerate/editor": "0.151.0"
|
|
276
276
|
},
|
|
277
277
|
"scripts": {
|
|
278
278
|
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|