🎥 Make videos programmatically with React
Fix source locations and canceled inspector scrubs
JonnyBurger0f8daca125cf
diff --git a/packages/core/src/enable-sequence-stack-traces.ts b/packages/core/src/enable-sequence-stack-traces.tsindex d10b7624a6..a3da9963b4 100644--- a/packages/core/src/enable-sequence-stack-traces.ts+++ b/packages/core/src/enable-sequence-stack-traces.ts@@ -15,7 +15,7 @@ export const REMOTION_INTERNAL_STACK_PROP = '_remotionInternalStack';// location as a synthetic stack frame, so consumers can skip symbolication.const ORIGINAL_SOURCE_STACK_PREFIX = 'studio-original://';const originalSourceStackPattern =- /\(studio-original:\/\/([^\s:)]*):(\d+):(\d+)\)/;+ /\(studio-original:\/\/([^\r\n]+):(\d+):(\d+)\)/;export type OriginalSourceLocation = {fileName: string;diff --git a/packages/template-vibe-code/src/editor/components/Inspector/CompositionInspector.tsx b/packages/template-vibe-code/src/editor/components/Inspector/CompositionInspector.tsxindex 0df2f443f1..1f58c436ae 100644--- a/packages/template-vibe-code/src/editor/components/Inspector/CompositionInspector.tsx+++ b/packages/template-vibe-code/src/editor/components/Inspector/CompositionInspector.tsx@@ -142,6 +142,7 @@ export const CompositionInspector: React.FC = () => {integerunit="px"disabled={!metadataIsStatic}+ onCancel={null}onCommit={(width) =>width !== null &&void actions.updateCompositionMetadata(id, { width })@@ -156,6 +157,7 @@ export const CompositionInspector: React.FC = () => {integerunit="px"disabled={!metadataIsStatic}+ onCancel={null}onCommit={(height) =>height !== null &&void actions.updateCompositionMetadata(id, { height })@@ -171,6 +173,7 @@ export const CompositionInspector: React.FC = () => {min={1}max={240}disabled={activeComposition.fps === null}+ onCancel={null}onCommit={(fps) =>fps !== null &&void actions.updateCompositionMetadata(id, { fps })@@ -185,6 +188,7 @@ export const CompositionInspector: React.FC = () => {integerunit="f"disabled={activeComposition.durationInFrames === null}+ onCancel={null}onCommit={(durationInFrames) =>durationInFrames !== null &&void actions.updateCompositionMetadata(id, {diff --git a/packages/template-vibe-code/src/editor/components/Inspector/LayerInspector.tsx b/packages/template-vibe-code/src/editor/components/Inspector/LayerInspector.tsxindex 9b2d519c00..4d1e97e832 100644--- a/packages/template-vibe-code/src/editor/components/Inspector/LayerInspector.tsx+++ b/packages/template-vibe-code/src/editor/components/Inspector/LayerInspector.tsx@@ -66,7 +66,8 @@ const PropEditor: React.FC<{readonly onUpdate: (updates: SequencePropUpdate[]) => void;/** Shows a value on the canvas while it is being dragged. */readonly onPreview: (values: Record<string, unknown>) => void;-}> = ({ fieldKey, field, status, onUpdate, onPreview }) => {+ readonly onCancelPreview: () => void;+}> = ({ fieldKey, field, status, onUpdate, onPreview, onCancelPreview }) => {const label = getFieldLabel(fieldKey, field);const ariaLabel = label;const preview = (value: unknown) => onPreview({ [fieldKey]: value });@@ -122,6 +123,7 @@ const PropEditor: React.FC<{allowEmptyonCommit={(value) => commit(value === null ? undefined : value)}onLiveChange={preview}+ onCancel={onCancelPreview}/></FieldRow>);@@ -157,6 +159,7 @@ const PropEditor: React.FC<{onLiveChange={(x) =>preview(serializeTranslate({ x, y: current.y }))}+ onCancel={onCancelPreview}/><NumberFieldariaLabel={`${label} Y`}@@ -169,6 +172,7 @@ const PropEditor: React.FC<{onLiveChange={(y) =>preview(serializeTranslate({ x: current.x, y }))}+ onCancel={onCancelPreview}/></FieldRow>);@@ -185,6 +189,7 @@ const PropEditor: React.FC<{step={field.step ?? 0.01}onCommit={(value) => commit(value ?? 1)}onLiveChange={preview}+ onCancel={onCancelPreview}/></FieldRow>);@@ -199,6 +204,7 @@ const PropEditor: React.FC<{step={field.step ?? 1}onCommit={(value) => commit(serializeRotation(value ?? 0))}onLiveChange={(value) => preview(serializeRotation(value))}+ onCancel={onCancelPreview}/></FieldRow>);@@ -215,6 +221,7 @@ const PropEditor: React.FC<{step={field.step ?? 1}onCommit={(value) => commit(value ?? 0)}onLiveChange={preview}+ onCancel={onCancelPreview}/></FieldRow>);@@ -460,6 +467,7 @@ export const LayerInspector: React.FC<{ readonly layer: Layer }> = ({status={statuses?.[key]}onUpdate={onUpdate}onPreview={onPreview}+ onCancelPreview={() => actions.cancelLayerPreview(layer)}/>))}</section>diff --git a/packages/template-vibe-code/src/editor/components/Inspector/fields.tsx b/packages/template-vibe-code/src/editor/components/Inspector/fields.tsxindex 48426ed168..d12d8d9f65 100644--- a/packages/template-vibe-code/src/editor/components/Inspector/fields.tsx+++ b/packages/template-vibe-code/src/editor/components/Inspector/fields.tsx@@ -70,6 +70,7 @@ export const NumberField: React.FC<{readonly disabled?: boolean;readonly onCommit: (value: number | null) => void;readonly onLiveChange?: (value: number) => void;+ readonly onCancel: (() => void) | null;readonly ariaLabel: string;readonly className?: string;readonly allowEmpty?: boolean;@@ -84,6 +85,7 @@ export const NumberField: React.FC<{disabled,onCommit,onLiveChange,+ onCancel,ariaLabel,className,allowEmpty = false,@@ -124,6 +126,14 @@ export const NumberField: React.FC<{}};+ const cancelDrag = () => {+ const drag = dragRef.current;+ dragRef.current = null;+ if (!drag) return;+ setDraft(null);+ if (drag.previewed) onCancel?.();+ };+return (<div className={cn("relative flex min-w-0 flex-1 items-center", className)}><div@@ -169,6 +179,8 @@ export const NumberField: React.FC<{onCommit(next);}}}+ onPointerCancel={cancelDrag}+ onLostPointerCapture={cancelDrag}/><Inputaria-label={ariaLabel}diff --git a/packages/template-vibe-code/src/editor/components/RenderDialog.tsx b/packages/template-vibe-code/src/editor/components/RenderDialog.tsxindex c3e710a1f0..b0b372ea2a 100644--- a/packages/template-vibe-code/src/editor/components/RenderDialog.tsx+++ b/packages/template-vibe-code/src/editor/components/RenderDialog.tsx@@ -174,6 +174,7 @@ export const RenderDialog: React.FC = () => {min={0}max={composition.durationInFrames - 1}integer+ onCancel={null}onCommit={(value) => setFrame(value ?? 0)}/></FieldRow>