@pixerate/editor-svelte 0.69.0 → 0.70.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/video-editor/MediaBin.svelte +1 -0
- package/dist/video-editor/MediaBin.svelte.d.ts.map +1 -1
- package/dist/video-editor/VideoTimeline.svelte +28 -1
- package/dist/video-editor/VideoTimeline.svelte.d.ts.map +1 -1
- package/dist/video-editor/VideoTransport.svelte +9 -2
- package/dist/video-editor/VideoTransport.svelte.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -130,6 +130,7 @@
|
|
|
130
130
|
<li class="flex items-center gap-1 rounded border border-border px-1 py-0.5" data-asset={asset.id}>
|
|
131
131
|
<span class="rounded bg-muted px-1 text-[10px] text-muted-foreground">{asset.kind}</span>
|
|
132
132
|
<span class="min-w-0 flex-1 truncate" title={asset.src}>{asset.name ?? asset.id}</span>
|
|
133
|
+
{#if asset.proxies?.length}<span class="rounded bg-muted px-1 text-[10px] text-muted-foreground" title="Proxies: {asset.proxies.map((p) => `${p.scale * 100}%`).join(', ')} (the preview can play these; exports use the original)" data-asset-proxies="">proxy</span>{/if}
|
|
133
134
|
{#if asset.duration !== undefined}<span class="tabular-nums text-muted-foreground">{formatVideoSeconds(asset.duration)}</span>{/if}
|
|
134
135
|
<button type="button" class={btn} disabled={editor.readOnly} onclick={() => addToTimeline(asset)} aria-label="Add {asset.name ?? asset.id} to timeline" data-add-to-timeline="">Add to timeline</button>
|
|
135
136
|
</li>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaBin.svelte.d.ts","sourceRoot":"","sources":["../../src/video-editor/MediaBin.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAOH,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AAIvC,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"MediaBin.svelte.d.ts","sourceRoot":"","sources":["../../src/video-editor/MediaBin.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAOH,KAAK,qBAAqB,EAC3B,MAAM,+BAA+B,CAAC;AAIvC,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoIH,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
type VideoTrack,
|
|
21
21
|
type VideoWaveformMode,
|
|
22
22
|
} from '@pixerate/editor/video-editor';
|
|
23
|
-
import { onDestroy } from 'svelte';
|
|
23
|
+
import { onDestroy, untrack } from 'svelte';
|
|
24
24
|
import { videoEditorStateOf } from './createVideoEditor.svelte.js';
|
|
25
25
|
|
|
26
26
|
interface Props {
|
|
@@ -57,6 +57,30 @@
|
|
|
57
57
|
const span = $derived(Math.max(editor.duration + 5000, 10000));
|
|
58
58
|
const width = $derived(x(span));
|
|
59
59
|
const ticks = $derived(videoRulerTicks(span, px, project.fps));
|
|
60
|
+
/** The stretches the controller's frame cache holds, every two pixels, re-read after edits and at most four times a second as frames arrive. */
|
|
61
|
+
let cached: { start: number; end: number }[] = $state.raw([]);
|
|
62
|
+
$effect(() => {
|
|
63
|
+
const cache = controller.frameCache;
|
|
64
|
+
const step = 2000 / px;
|
|
65
|
+
const p = project;
|
|
66
|
+
if (!cache) {
|
|
67
|
+
cached = [];
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
let timer: ReturnType<typeof setTimeout> | null = null;
|
|
71
|
+
const read = () => {
|
|
72
|
+
timer = null;
|
|
73
|
+
cached = cache.cachedRanges(p, { step });
|
|
74
|
+
};
|
|
75
|
+
untrack(read);
|
|
76
|
+
const off = cache.subscribe(() => {
|
|
77
|
+
timer ??= setTimeout(read, 250);
|
|
78
|
+
});
|
|
79
|
+
return () => {
|
|
80
|
+
off();
|
|
81
|
+
if (timer) clearTimeout(timer);
|
|
82
|
+
};
|
|
83
|
+
});
|
|
60
84
|
const canEdit = $derived(editable && !editor.readOnly);
|
|
61
85
|
const HEADER = 144;
|
|
62
86
|
const ZOOM_MIN = 10;
|
|
@@ -279,6 +303,9 @@
|
|
|
279
303
|
{#if t.label}<span class="absolute -top-0.5 left-1 whitespace-nowrap tabular-nums">{t.label}</span>{/if}
|
|
280
304
|
</div>
|
|
281
305
|
{/each}
|
|
306
|
+
{#each cached as r (r.start)}
|
|
307
|
+
<div class="pointer-events-none absolute bottom-0 h-[3px] bg-emerald-500/70" style="left:{x(r.start)}px;width:{Math.max(1, x(r.end - r.start))}px" title="Frames cached: plays and scrubs without waiting" data-cached-range=""></div>
|
|
308
|
+
{/each}
|
|
282
309
|
{#each project.markers ?? [] as m (m.id)}
|
|
283
310
|
<div
|
|
284
311
|
class="absolute top-0 h-2 w-2 -translate-x-1/2 rotate-45"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoTimeline.svelte.d.ts","sourceRoot":"","sources":["../../src/video-editor/VideoTimeline.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAgBH,KAAK,qBAAqB,EAG1B,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAKvC,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,kIAAkI;IAClI,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iKAAiK;IACjK,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"VideoTimeline.svelte.d.ts","sourceRoot":"","sources":["../../src/video-editor/VideoTimeline.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAgBH,KAAK,qBAAqB,EAG1B,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAKvC,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,kIAAkI;IAClI,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iKAAiK;IACjK,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsTH,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { formatVideoTimecode, type VideoEditorController } from '@pixerate/editor/video-editor';
|
|
2
|
+
import { formatVideoTimecode, parseVideoPreviewScale, VIDEO_PREVIEW_SCALE_OPTIONS, videoProjectHasProxies, type VideoEditorController } from '@pixerate/editor/video-editor';
|
|
3
3
|
import { videoEditorStateOf } from './createVideoEditor.svelte.js';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
const locked = $derived(editor.readOnly);
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<!-- Play / pause, frame steps, the playhead's timecode, and split, delete, undo and redo. -->
|
|
20
|
+
<!-- Play / pause, frame steps, the playhead's timecode, a preview size when there are proxies, and split, delete, undo and redo. -->
|
|
21
21
|
<div class="flex flex-wrap items-center gap-1.5 text-xs {className}" data-video-transport="">
|
|
22
22
|
<button type="button" class={btn} aria-label="Step back one frame" onclick={() => controller.step(-1)} data-step-back="">◀︎|</button>
|
|
23
23
|
<button type="button" class={btn} aria-label={editor.playing ? 'Pause' : 'Play'} onclick={() => controller.toggle()} disabled={editor.duration <= 0} data-play="">
|
|
@@ -25,6 +25,13 @@
|
|
|
25
25
|
</button>
|
|
26
26
|
<button type="button" class={btn} aria-label="Step forward one frame" onclick={() => controller.step(1)} data-step-forward="">|▶︎</button>
|
|
27
27
|
<span class="tabular-nums text-muted-foreground" data-timecode="">{formatVideoTimecode(editor.time, fps)} / {formatVideoTimecode(editor.duration, fps)}</span>
|
|
28
|
+
{#if videoProjectHasProxies(editor.project)}
|
|
29
|
+
<select class="rounded border border-border bg-transparent px-1 py-0.5 text-xs" value={String(editor.previewScale)} onchange={(e) => controller.setPreviewScale(parseVideoPreviewScale(e.currentTarget.value))} aria-label="Preview size" title="Play proxies in the preview (the export always uses the originals)" data-preview-scale="">
|
|
30
|
+
{#each VIDEO_PREVIEW_SCALE_OPTIONS as o (o.value)}
|
|
31
|
+
<option value={o.value}>{o.label}</option>
|
|
32
|
+
{/each}
|
|
33
|
+
</select>
|
|
34
|
+
{/if}
|
|
28
35
|
{#if editable}
|
|
29
36
|
<span class="ml-auto flex flex-wrap gap-1">
|
|
30
37
|
<button type="button" class={btn} disabled={locked} onclick={() => controller.splitAtPlayhead()} title="Split at the playhead (S)" data-split="">Split</button>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoTransport.svelte.d.ts","sourceRoot":"","sources":["../../src/video-editor/VideoTransport.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"VideoTransport.svelte.d.ts","sourceRoot":"","sources":["../../src/video-editor/VideoTransport.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoG,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAI3K,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0CH,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"@tiptap/extension-bubble-menu": "^2.11.5",
|
|
132
132
|
"@tiptap/extension-placeholder": "^2.11.5",
|
|
133
133
|
"@tiptap/starter-kit": "^2.11.5",
|
|
134
|
-
"@pixerate/editor": "0.
|
|
134
|
+
"@pixerate/editor": "0.91.0"
|
|
135
135
|
},
|
|
136
136
|
"peerDependencies": {
|
|
137
137
|
"@dagrejs/dagre": "^1.1.4",
|