@pixerate/editor-svelte 0.54.5 → 0.56.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);
|
|
@@ -90,6 +100,13 @@
|
|
|
90
100
|
<option value="loop">Loop</option>
|
|
91
101
|
<option value="ping-pong">Ping-pong</option>
|
|
92
102
|
</select>
|
|
103
|
+
<span class="text-muted-foreground">Motion blur</span>
|
|
104
|
+
<select class={input} aria-label="Motion blur" disabled={editor.readOnly} value={scene.motionBlur ? String(scene.motionBlur.shutter ?? 180) : ''} onchange={(e) => settings({ motionBlur: e.currentTarget.value ? { ...(scene.motionBlur ?? {}), shutter: Number(e.currentTarget.value) } : null }, 'Change motion blur')}>
|
|
105
|
+
<option value="">Off</option>
|
|
106
|
+
<option value="90">Light (90°)</option>
|
|
107
|
+
<option value="180">Normal (180°)</option>
|
|
108
|
+
<option value="360">Heavy (360°)</option>
|
|
109
|
+
</select>
|
|
93
110
|
<span class="text-muted-foreground">Plays on</span>
|
|
94
111
|
<select class={input} aria-label="Scene trigger" title="How a viewer plays it when exported to Flair" disabled={editor.readOnly} value={scene.trigger ?? ''} onchange={(e) => settings({ trigger: (e.currentTarget.value || null) as MotionTrigger | null }, 'Change trigger')}>
|
|
95
112
|
<option value="">Its own (autoplay)</option>
|
|
@@ -136,6 +153,10 @@
|
|
|
136
153
|
<span class="text-muted-foreground">Narration (a word a line: start ms, then the word)</span>
|
|
137
154
|
<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
155
|
</label>
|
|
156
|
+
<label class="flex flex-col gap-0.5">
|
|
157
|
+
<span class="text-muted-foreground">Drivers (one a line: target.property <- source.property * factor)</span>
|
|
158
|
+
<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>
|
|
159
|
+
</label>
|
|
139
160
|
{#if message}
|
|
140
161
|
<p class="text-red-500" role="alert" data-edit-error="">{message}</p>
|
|
141
162
|
{/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;AA4JH,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.56.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.73.0"
|
|
127
127
|
},
|
|
128
128
|
"peerDependencies": {
|
|
129
129
|
"@dagrejs/dagre": "^1.1.4",
|