@pixerate/editor-svelte 0.54.4 → 0.55.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { fitMotionSceneEdits, formatMotionNarration, parseMotionNarration, type AnimationEditorController, type MotionEdit, type MotionTrigger } from '@pixerate/editor/animation-editor';
|
|
2
|
+
import { fitMotionSceneEdits, formatMotionDrivers, formatMotionNarration, parseMotionDrivers, parseMotionNarration, type AnimationEditorController, type MotionEdit, type MotionTrigger } from '@pixerate/editor/animation-editor';
|
|
3
3
|
import { animationEditorStateOf } from './createAnimationEditor.svelte.js';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
const beat = $derived(scene.beat);
|
|
17
17
|
const target = $derived(scene.target);
|
|
18
18
|
const narration = $derived(formatMotionNarration(scene.narration));
|
|
19
|
+
const drivers = $derived(formatMotionDrivers(scene.drivers));
|
|
19
20
|
let localError = $state<{ text: string; revision: number } | null>(null);
|
|
20
21
|
let fitTo = $state('');
|
|
21
22
|
const fitSeconds = $derived(fitTo || String(target ? (target[0] + target[1]) / 2 : Math.round(editor.duration / 100) / 10));
|
|
@@ -67,6 +68,15 @@
|
|
|
67
68
|
setLocal((e as Error).message);
|
|
68
69
|
}
|
|
69
70
|
}
|
|
71
|
+
function setDrivers(text: string) {
|
|
72
|
+
if (text === drivers) return;
|
|
73
|
+
const parsed = parseMotionDrivers(text);
|
|
74
|
+
if ('error' in parsed) {
|
|
75
|
+
setLocal(parsed.error);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
apply({ op: 'set_drivers', drivers: parsed.drivers }, parsed.drivers.length ? 'Set drivers' : 'Clear drivers');
|
|
79
|
+
}
|
|
70
80
|
function setNarration(text: string) {
|
|
71
81
|
if (text === narration) return;
|
|
72
82
|
const parsed = parseMotionNarration(text);
|
|
@@ -136,6 +146,10 @@
|
|
|
136
146
|
<span class="text-muted-foreground">Narration (a word a line: start ms, then the word)</span>
|
|
137
147
|
<textarea class="{input} h-20 font-mono" aria-label="Narration" placeholder={'0 Meet\n320 the\n480 badge'} disabled={editor.readOnly} value={narration} onchange={(e) => setNarration(e.currentTarget.value)}></textarea>
|
|
138
148
|
</label>
|
|
149
|
+
<label class="flex flex-col gap-0.5">
|
|
150
|
+
<span class="text-muted-foreground">Drivers (one a line: target.property <- source.property * factor)</span>
|
|
151
|
+
<textarea class="{input} h-14 font-mono" aria-label="Drivers" placeholder={'back.x <- front.x * 0.5\nwheel.rotation <- wheel.x * 2.86'} disabled={editor.readOnly} value={drivers} onchange={(e) => setDrivers(e.currentTarget.value)}></textarea>
|
|
152
|
+
</label>
|
|
139
153
|
{#if message}
|
|
140
154
|
<p class="text-red-500" role="alert" data-edit-error="">{message}</p>
|
|
141
155
|
{/if}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneSettings.svelte.d.ts","sourceRoot":"","sources":["../../src/animation-editor/SceneSettings.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"SceneSettings.svelte.d.ts","sourceRoot":"","sources":["../../src/animation-editor/SceneSettings.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAA6G,KAAK,yBAAyB,EAAuC,MAAM,mCAAmC,CAAC;AAIjO,UAAU,KAAK;IACb,UAAU,EAAE,yBAAyB,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqJH,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@tiptap/extension-bubble-menu": "^2.11.5",
|
|
124
124
|
"@tiptap/extension-placeholder": "^2.11.5",
|
|
125
125
|
"@tiptap/starter-kit": "^2.11.5",
|
|
126
|
-
"@pixerate/editor": "0.
|
|
126
|
+
"@pixerate/editor": "0.72.0"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
129
|
"@dagrejs/dagre": "^1.1.4",
|