@pixerate/editor-svelte 0.110.1 → 0.111.1
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/createAnimationEditor.svelte.d.ts +4 -1
- package/dist/animation-editor/createAnimationEditor.svelte.js +4 -1
- package/dist/chart/createChartEditor.svelte.d.ts +4 -1
- package/dist/chart/createChartEditor.svelte.js +7 -2
- package/dist/parameters/createParameters.svelte.d.ts +4 -1
- package/dist/parameters/createParameters.svelte.js +7 -2
- package/dist/vector/createVectorEditor.svelte.d.ts +4 -1
- package/dist/vector/createVectorEditor.svelte.js +4 -1
- package/dist/video-editor/createVideoEditor.svelte.d.ts +4 -1
- package/dist/video-editor/createVideoEditor.svelte.js +4 -1
- package/package.json +2 -2
|
@@ -1,7 +1,10 @@
|
|
|
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
|
export interface SvelteAnimationEditor {
|
|
4
5
|
readonly controller: AnimationEditorController;
|
|
6
|
+
/** The save / load / undo contract (for `createEditorAutosave` or `createDocumentToolProvider`). */
|
|
7
|
+
readonly editorDocument: EditorDocument<MotionScene>;
|
|
5
8
|
/** The controller's state (reactive, including each played frame). */
|
|
6
9
|
readonly state: AnimationEditorState;
|
|
7
10
|
play(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { untrack } from "svelte";
|
|
2
|
-
import { AnimationEditorController, createAnimationEditorToolProvider, createAnimationEffectsToolProvider, } from "@pixerate/editor/animation-editor";
|
|
2
|
+
import { AnimationEditorController, createAnimationEditorToolProvider, createAnimationEffectsToolProvider, createAnimationEditorDocument, } from "@pixerate/editor/animation-editor";
|
|
3
3
|
/**
|
|
4
4
|
* Svelte 5 rune: subscribes to an `AnimationEditorController` (or creates one from options)
|
|
5
5
|
* and exposes its state reactively with bound actions.
|
|
@@ -11,8 +11,10 @@ export function createAnimationEditor(controllerOrOptions = {}) {
|
|
|
11
11
|
const unsubscribe = controller.subscribe((next) => {
|
|
12
12
|
state = next;
|
|
13
13
|
});
|
|
14
|
+
const editorDocument = createAnimationEditorDocument(controller);
|
|
14
15
|
return {
|
|
15
16
|
controller,
|
|
17
|
+
editorDocument,
|
|
16
18
|
get state() {
|
|
17
19
|
return state;
|
|
18
20
|
},
|
|
@@ -25,6 +27,7 @@ export function createAnimationEditor(controllerOrOptions = {}) {
|
|
|
25
27
|
toSvg: () => controller.toSvg(),
|
|
26
28
|
destroy: () => {
|
|
27
29
|
unsubscribe();
|
|
30
|
+
editorDocument.destroy();
|
|
28
31
|
if (owned)
|
|
29
32
|
controller.destroy();
|
|
30
33
|
},
|
|
@@ -1,7 +1,10 @@
|
|
|
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
|
export interface SvelteChartEditor {
|
|
4
5
|
readonly controller: ChartController;
|
|
6
|
+
/** The save / load / undo contract (for `createEditorAutosave` or `createDocumentToolProvider`). */
|
|
7
|
+
readonly editorDocument: EditorDocument<ChartSpec>;
|
|
5
8
|
/** The controller's state (reactive). */
|
|
6
9
|
readonly state: ChartState;
|
|
7
10
|
/** Shorthand for `state.spec` (reactive). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { untrack } from "svelte";
|
|
2
|
-
import { ChartController, ChartDirector, ChartPresence, createChartCommands, createChartRasterizer, createChartToolProvider, createOfficeChartToolProvider, layoutChart, } from "@pixerate/editor/chart";
|
|
2
|
+
import { ChartController, ChartDirector, ChartPresence, createChartCommands, createChartRasterizer, createChartToolProvider, createOfficeChartToolProvider, layoutChart, createChartEditorDocument, } from "@pixerate/editor/chart";
|
|
3
3
|
/**
|
|
4
4
|
* Svelte 5 rune: subscribes to a `ChartController` (or creates one from options) and
|
|
5
5
|
* exposes its state reactively with bound actions.
|
|
@@ -10,8 +10,10 @@ export function createChartEditor(controllerOrOptions = {}) {
|
|
|
10
10
|
const unsubscribe = controller.subscribe((next) => {
|
|
11
11
|
state = next;
|
|
12
12
|
});
|
|
13
|
+
const editorDocument = createChartEditorDocument(controller);
|
|
13
14
|
return {
|
|
14
15
|
controller,
|
|
16
|
+
editorDocument,
|
|
15
17
|
get state() {
|
|
16
18
|
return state;
|
|
17
19
|
},
|
|
@@ -27,7 +29,10 @@ export function createChartEditor(controllerOrOptions = {}) {
|
|
|
27
29
|
select: (selection) => controller.select(selection),
|
|
28
30
|
undo: () => void controller.undo(),
|
|
29
31
|
redo: () => void controller.redo(),
|
|
30
|
-
destroy:
|
|
32
|
+
destroy: () => {
|
|
33
|
+
unsubscribe();
|
|
34
|
+
editorDocument.destroy();
|
|
35
|
+
},
|
|
31
36
|
};
|
|
32
37
|
}
|
|
33
38
|
/** Reactive state of a (possibly replaced) controller prop, for use inside components. */
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ParametersController, type ParameterCommandOptions, type ParametersControllerOptions, type ParameterSetResult, type ParametersState, type ParameterValue } from "@pixerate/editor/parameters";
|
|
1
|
+
import { ParametersController, type ParameterCommandOptions, type ParametersControllerOptions, type ParameterSetResult, type ParametersState, type ParameterValue, type ParametersSnapshot } from "@pixerate/editor/parameters";
|
|
2
|
+
import type { EditorDocument } from "@pixerate/editor/persistence";
|
|
2
3
|
export interface SvelteParameters {
|
|
3
4
|
readonly controller: ParametersController;
|
|
5
|
+
/** The save / load / undo contract (for `createEditorAutosave` or `createDocumentToolProvider`). */
|
|
6
|
+
readonly editorDocument: EditorDocument<ParametersSnapshot>;
|
|
4
7
|
/** The controller's state (reactive). */
|
|
5
8
|
readonly state: ParametersState;
|
|
6
9
|
/** Shorthand for `state.values` (reactive). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParametersController, createParameterCommands, } from "@pixerate/editor/parameters";
|
|
1
|
+
import { ParametersController, createParameterCommands, createParametersEditorDocument, } from "@pixerate/editor/parameters";
|
|
2
2
|
/**
|
|
3
3
|
* Svelte 5 rune: subscribes to a `ParametersController` (or creates one from options) and
|
|
4
4
|
* exposes its state reactively with bound actions.
|
|
@@ -9,8 +9,10 @@ export function createParameters(controllerOrOptions) {
|
|
|
9
9
|
const unsubscribe = controller.subscribe((next) => {
|
|
10
10
|
state = next;
|
|
11
11
|
});
|
|
12
|
+
const editorDocument = createParametersEditorDocument(controller);
|
|
12
13
|
return {
|
|
13
14
|
controller,
|
|
15
|
+
editorDocument,
|
|
14
16
|
get state() {
|
|
15
17
|
return state;
|
|
16
18
|
},
|
|
@@ -22,7 +24,10 @@ export function createParameters(controllerOrOptions) {
|
|
|
22
24
|
redo: () => void controller.redo(),
|
|
23
25
|
reset: (ids) => void controller.reset(ids),
|
|
24
26
|
randomize: (ids) => void controller.randomize({ ids }),
|
|
25
|
-
destroy:
|
|
27
|
+
destroy: () => {
|
|
28
|
+
unsubscribe();
|
|
29
|
+
editorDocument.destroy();
|
|
30
|
+
},
|
|
26
31
|
};
|
|
27
32
|
}
|
|
28
33
|
/**
|
|
@@ -1,7 +1,10 @@
|
|
|
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
|
export interface SvelteVectorEditor {
|
|
4
5
|
readonly controller: VectorEditorController;
|
|
6
|
+
/** The save / load / undo contract (for `createEditorAutosave` or `createDocumentToolProvider`). */
|
|
7
|
+
readonly editorDocument: EditorDocument<VectorDocument>;
|
|
5
8
|
/** The controller's state (reactive). */
|
|
6
9
|
readonly state: VectorEditorState;
|
|
7
10
|
setTool(tool: VectorTool): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VectorEditorController, createVectorCommands, createVectorEffectsToolProvider, createVectorGenerationToolProvider, } from "@pixerate/editor/vector";
|
|
1
|
+
import { VectorEditorController, createVectorCommands, createVectorEffectsToolProvider, createVectorGenerationToolProvider, createVectorEditorDocument, } from "@pixerate/editor/vector";
|
|
2
2
|
/**
|
|
3
3
|
* Svelte 5 rune: subscribes to a `VectorEditorController` (or creates one from options) and
|
|
4
4
|
* exposes its state reactively with bound actions.
|
|
@@ -10,8 +10,10 @@ export function createVectorEditor(controllerOrOptions = {}) {
|
|
|
10
10
|
const unsubscribe = controller.subscribe((next) => {
|
|
11
11
|
state = next;
|
|
12
12
|
});
|
|
13
|
+
const editorDocument = createVectorEditorDocument(controller);
|
|
13
14
|
return {
|
|
14
15
|
controller,
|
|
16
|
+
editorDocument,
|
|
15
17
|
get state() {
|
|
16
18
|
return state;
|
|
17
19
|
},
|
|
@@ -22,6 +24,7 @@ export function createVectorEditor(controllerOrOptions = {}) {
|
|
|
22
24
|
toSvg: () => controller.toSvg(),
|
|
23
25
|
destroy: () => {
|
|
24
26
|
unsubscribe();
|
|
27
|
+
editorDocument.destroy();
|
|
25
28
|
if (owned)
|
|
26
29
|
controller.destroy();
|
|
27
30
|
},
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { VideoEditorController, type VideoEffectsToolProviderOptions, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoEditResult } from "@pixerate/editor/video-editor";
|
|
1
|
+
import { VideoEditorController, type VideoEffectsToolProviderOptions, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoEditResult, 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
|
export interface SvelteVideoEditor {
|
|
4
5
|
readonly controller: VideoEditorController;
|
|
6
|
+
/** The save / load / undo contract (for `createEditorAutosave` or `createDocumentToolProvider`). */
|
|
7
|
+
readonly editorDocument: EditorDocument<VideoProject>;
|
|
5
8
|
/** The controller's state (reactive, including the playhead while playing). */
|
|
6
9
|
readonly state: VideoEditorState;
|
|
7
10
|
play(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { untrack } from "svelte";
|
|
2
|
-
import { VideoEditorController, createVideoEditorToolProvider, createVideoEffectsToolProvider, } from "@pixerate/editor/video-editor";
|
|
2
|
+
import { VideoEditorController, createVideoEditorToolProvider, createVideoEffectsToolProvider, createVideoEditorDocument, } from "@pixerate/editor/video-editor";
|
|
3
3
|
/**
|
|
4
4
|
* Svelte 5 rune: subscribes to a `VideoEditorController` (or creates one from options) and
|
|
5
5
|
* exposes its state reactively with bound actions.
|
|
@@ -11,8 +11,10 @@ export function createVideoEditor(controllerOrOptions = {}) {
|
|
|
11
11
|
const unsubscribe = controller.subscribe((next) => {
|
|
12
12
|
state = next;
|
|
13
13
|
});
|
|
14
|
+
const editorDocument = createVideoEditorDocument(controller);
|
|
14
15
|
return {
|
|
15
16
|
controller,
|
|
17
|
+
editorDocument,
|
|
16
18
|
get state() {
|
|
17
19
|
return state;
|
|
18
20
|
},
|
|
@@ -27,6 +29,7 @@ export function createVideoEditor(controllerOrOptions = {}) {
|
|
|
27
29
|
deleteSelection: (options) => controller.deleteSelection(options),
|
|
28
30
|
destroy: () => {
|
|
29
31
|
unsubscribe();
|
|
32
|
+
editorDocument.destroy();
|
|
30
33
|
if (owned)
|
|
31
34
|
controller.destroy();
|
|
32
35
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.111.1",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@tiptap/extension-bubble-menu": "^2.27.3",
|
|
161
161
|
"@tiptap/extension-placeholder": "^2.27.3",
|
|
162
162
|
"@tiptap/starter-kit": "^2.27.3",
|
|
163
|
-
"@pixerate/editor": "0.
|
|
163
|
+
"@pixerate/editor": "0.152.0"
|
|
164
164
|
},
|
|
165
165
|
"peerDependencies": {
|
|
166
166
|
"@dagrejs/dagre": "^1.1.4",
|