@remotion/studio 4.0.477 → 4.0.478
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/components/CanvasIfSizeIsAvailable.js +2 -6
- package/dist/components/EditorGuides/Guide.js +37 -9
- package/dist/components/EditorRuler/Ruler.js +4 -14
- package/dist/components/EditorRuler/index.js +9 -4
- package/dist/components/InlineAction.js +1 -0
- package/dist/components/MenuToolbar.d.ts +1 -0
- package/dist/components/MenuToolbar.js +4 -1
- package/dist/components/SelectedOutlineElement.js +85 -14
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +5 -1
- package/dist/components/Timeline/TimelineSequence.js +7 -15
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +93 -8
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +7 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +32 -3
- package/dist/components/Timeline/timeline-video-filmstrip-times.d.ts +17 -0
- package/dist/components/Timeline/timeline-video-filmstrip-times.js +22 -0
- package/dist/components/import-assets.d.ts +11 -2
- package/dist/components/import-assets.js +61 -6
- package/dist/components/selected-outline-drag.d.ts +23 -0
- package/dist/components/selected-outline-drag.js +49 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -0
- package/dist/esm/{chunk-t8fjnw2d.js → chunk-hrw9799x.js} +926 -578
- package/dist/esm/internals.mjs +926 -578
- package/dist/esm/previewEntry.mjs +10204 -9852
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/editor-guide-selection.js +1 -1
- package/dist/helpers/get-preview-file-type.js +1 -1
- package/dist/helpers/ruler-canvas-size.d.ts +5 -0
- package/dist/helpers/ruler-canvas-size.js +17 -0
- package/package.json +11 -11
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./chunk-6jf1natv.js";
|
|
5
5
|
|
|
6
6
|
// src/Studio.tsx
|
|
7
|
-
import { useLayoutEffect as
|
|
7
|
+
import { useLayoutEffect as useLayoutEffect6 } from "react";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
import { Internals as Internals103 } from "remotion";
|
|
10
10
|
|
|
11
11
|
// src/components/Editor.tsx
|
|
12
12
|
import { PlayerInternals as PlayerInternals22 } from "@remotion/player";
|
|
13
|
-
import React233, { useCallback as useCallback189, useMemo as useMemo195, useState as
|
|
13
|
+
import React233, { useCallback as useCallback189, useMemo as useMemo195, useState as useState114 } from "react";
|
|
14
14
|
import { Internals as Internals98 } from "remotion";
|
|
15
15
|
|
|
16
16
|
// src/helpers/colors.ts
|
|
@@ -1645,7 +1645,7 @@ var InitialCompositionLoader = () => {
|
|
|
1645
1645
|
};
|
|
1646
1646
|
|
|
1647
1647
|
// src/components/MenuToolbar.tsx
|
|
1648
|
-
import { useCallback as useCallback116, useMemo as useMemo117, useState as
|
|
1648
|
+
import { useCallback as useCallback116, useMemo as useMemo117, useState as useState72 } from "react";
|
|
1649
1649
|
|
|
1650
1650
|
// src/helpers/use-menu-structure.tsx
|
|
1651
1651
|
import { useContext as useContext12, useEffect as useEffect17, useMemo as useMemo21 } from "react";
|
|
@@ -2420,7 +2420,7 @@ var getPreviewFileType = (fileName) => {
|
|
|
2420
2420
|
}
|
|
2421
2421
|
const audioExtensions = ["mp3", "wav", "ogg", "aac"];
|
|
2422
2422
|
const videoExtensions = ["mp4", "avi", "mkv", "mov", "webm"];
|
|
2423
|
-
const imageExtensions = ["jpg", "jpeg", "png", "gif", "bmp"];
|
|
2423
|
+
const imageExtensions = ["jpg", "jpeg", "png", "apng", "gif", "bmp"];
|
|
2424
2424
|
const fileExtension = fileName.split(".").pop()?.toLowerCase();
|
|
2425
2425
|
if (fileExtension === undefined) {
|
|
2426
2426
|
throw new Error("File extension is undefined");
|
|
@@ -6090,7 +6090,7 @@ var MenuBuildIndicator = () => {
|
|
|
6090
6090
|
};
|
|
6091
6091
|
|
|
6092
6092
|
// src/components/SidebarCollapserControls.tsx
|
|
6093
|
-
import { useCallback as useCallback113, useContext as useContext74, useEffect as
|
|
6093
|
+
import { useCallback as useCallback113, useContext as useContext74, useEffect as useEffect68 } from "react";
|
|
6094
6094
|
|
|
6095
6095
|
// src/components/InlineAction.tsx
|
|
6096
6096
|
import { useCallback as useCallback22, useMemo as useMemo26, useState as useState19 } from "react";
|
|
@@ -6115,6 +6115,7 @@ var InlineAction = ({
|
|
|
6115
6115
|
background: disabled ? "transparent" : getBackgroundFromHoverState({ hovered, selected: false }),
|
|
6116
6116
|
height: 24,
|
|
6117
6117
|
width: 24,
|
|
6118
|
+
padding: 0,
|
|
6118
6119
|
display: "inline-flex",
|
|
6119
6120
|
justifyContent: "center",
|
|
6120
6121
|
alignItems: "center",
|
|
@@ -6135,7 +6136,7 @@ var InlineAction = ({
|
|
|
6135
6136
|
};
|
|
6136
6137
|
|
|
6137
6138
|
// src/components/TopPanel.tsx
|
|
6138
|
-
import React139, { useCallback as useCallback112, useContext as useContext73, useEffect as
|
|
6139
|
+
import React139, { useCallback as useCallback112, useContext as useContext73, useEffect as useEffect67, useMemo as useMemo115 } from "react";
|
|
6139
6140
|
import { Internals as Internals57 } from "remotion";
|
|
6140
6141
|
|
|
6141
6142
|
// src/helpers/use-breakpoint.ts
|
|
@@ -6162,8 +6163,25 @@ function useBreakpoint(breakpoint2) {
|
|
|
6162
6163
|
import { useContext as useContext34, useMemo as useMemo51 } from "react";
|
|
6163
6164
|
import { Internals as Internals34 } from "remotion";
|
|
6164
6165
|
|
|
6166
|
+
// src/helpers/ruler-canvas-size.ts
|
|
6167
|
+
var applyRulerInsetsToCanvasSize = ({
|
|
6168
|
+
rulersAreVisible,
|
|
6169
|
+
size
|
|
6170
|
+
}) => {
|
|
6171
|
+
if (!rulersAreVisible) {
|
|
6172
|
+
return size;
|
|
6173
|
+
}
|
|
6174
|
+
return {
|
|
6175
|
+
...size,
|
|
6176
|
+
left: size.left + RULER_WIDTH,
|
|
6177
|
+
top: size.top + RULER_WIDTH,
|
|
6178
|
+
width: size.width - RULER_WIDTH,
|
|
6179
|
+
height: size.height - RULER_WIDTH
|
|
6180
|
+
};
|
|
6181
|
+
};
|
|
6182
|
+
|
|
6165
6183
|
// src/components/CanvasOrLoading.tsx
|
|
6166
|
-
import { useContext as useContext33, useEffect as
|
|
6184
|
+
import { useContext as useContext33, useEffect as useEffect42 } from "react";
|
|
6167
6185
|
import { Internals as Internals33 } from "remotion";
|
|
6168
6186
|
|
|
6169
6187
|
// src/error-overlay/remotion-overlay/ErrorLoader.tsx
|
|
@@ -7677,10 +7695,10 @@ import {
|
|
|
7677
7695
|
import {
|
|
7678
7696
|
useCallback as useCallback43,
|
|
7679
7697
|
useContext as useContext32,
|
|
7680
|
-
useEffect as
|
|
7698
|
+
useEffect as useEffect40,
|
|
7681
7699
|
useMemo as useMemo50,
|
|
7682
7700
|
useRef as useRef28,
|
|
7683
|
-
useState as
|
|
7701
|
+
useState as useState38
|
|
7684
7702
|
} from "react";
|
|
7685
7703
|
import { Internals as Internals31, watchStaticFile } from "remotion";
|
|
7686
7704
|
|
|
@@ -8040,7 +8058,7 @@ var findGuide = (guidesList, guideId) => {
|
|
|
8040
8058
|
if (guideId === null) {
|
|
8041
8059
|
return null;
|
|
8042
8060
|
}
|
|
8043
|
-
return guidesList.find((guide) => guide.id === guideId) ?? null;
|
|
8061
|
+
return guidesList.find((guide) => guide.id === guideId && guide.show) ?? null;
|
|
8044
8062
|
};
|
|
8045
8063
|
var getRulerGuideHighlight = ({
|
|
8046
8064
|
guidesList,
|
|
@@ -9746,15 +9764,38 @@ var duplicateSequencesFromSource = (nodePathInfos, confirm) => {
|
|
|
9746
9764
|
});
|
|
9747
9765
|
};
|
|
9748
9766
|
var isDuplicatableSequenceRowSelection = (selection) => selection.type === "sequence";
|
|
9767
|
+
var isDuplicatableEffectSelection = (selection) => selection.type === "sequence-effect";
|
|
9768
|
+
var duplicateEffectsFromSource = (effects) => {
|
|
9769
|
+
return callApi("/api/duplicate-effect", effects.map((effect) => {
|
|
9770
|
+
const nodePath = effect.nodePathInfo.sequenceSubscriptionKey;
|
|
9771
|
+
return {
|
|
9772
|
+
fileName: nodePath.absolutePath,
|
|
9773
|
+
sequenceNodePath: nodePath,
|
|
9774
|
+
effectIndex: effect.i
|
|
9775
|
+
};
|
|
9776
|
+
})).then((result) => {
|
|
9777
|
+
if (result.success) {
|
|
9778
|
+
showNotification(effects.length === 1 ? "Duplicated effect in source file" : "Duplicated effects in source files", 2000);
|
|
9779
|
+
} else {
|
|
9780
|
+
showNotification(result.reason, 4000);
|
|
9781
|
+
}
|
|
9782
|
+
}).catch((err) => {
|
|
9783
|
+
showNotification(err.message, 4000);
|
|
9784
|
+
});
|
|
9785
|
+
};
|
|
9749
9786
|
var duplicateSelectedTimelineItems = ({
|
|
9750
9787
|
selections,
|
|
9751
9788
|
confirm
|
|
9752
9789
|
}) => {
|
|
9753
9790
|
const sequenceSelections = selections.filter(isDuplicatableSequenceRowSelection);
|
|
9754
|
-
if (sequenceSelections.length
|
|
9791
|
+
if (sequenceSelections.length > 0) {
|
|
9792
|
+
return duplicateSequencesFromSource(sequenceSelections.map((selection) => selection.nodePathInfo), confirm);
|
|
9793
|
+
}
|
|
9794
|
+
const effectSelections = selections.filter(isDuplicatableEffectSelection);
|
|
9795
|
+
if (effectSelections.length === 0) {
|
|
9755
9796
|
return null;
|
|
9756
9797
|
}
|
|
9757
|
-
return
|
|
9798
|
+
return duplicateEffectsFromSource(effectSelections);
|
|
9758
9799
|
};
|
|
9759
9800
|
|
|
9760
9801
|
// src/components/Timeline/reset-selected-timeline-props.ts
|
|
@@ -11112,8 +11153,7 @@ var GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
11112
11153
|
clientX: e.clientX,
|
|
11113
11154
|
clientY: e.clientY
|
|
11114
11155
|
};
|
|
11115
|
-
shouldCreateGuideRef.current =
|
|
11116
|
-
forceSpecificCursor("no-drop");
|
|
11156
|
+
shouldCreateGuideRef.current = false;
|
|
11117
11157
|
setDraggingGuideId(() => guide.id);
|
|
11118
11158
|
}, [guide.id, setDraggingGuideId, shouldCreateGuideRef]);
|
|
11119
11159
|
const onMouseDown = useCallback35((e) => {
|
|
@@ -11128,8 +11168,7 @@ var GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
11128
11168
|
clientX: e.clientX,
|
|
11129
11169
|
clientY: e.clientY
|
|
11130
11170
|
};
|
|
11131
|
-
shouldCreateGuideRef.current =
|
|
11132
|
-
forceSpecificCursor("no-drop");
|
|
11171
|
+
shouldCreateGuideRef.current = false;
|
|
11133
11172
|
setDraggingGuideId(() => guide.id);
|
|
11134
11173
|
}, [guide.id, setDraggingGuideId, shouldCreateGuideRef]);
|
|
11135
11174
|
const updateHasMovedGuide = useCallback35((clientX, clientY) => {
|
|
@@ -11152,13 +11191,38 @@ var GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
11152
11191
|
const onMouseMove = useCallback35((e) => {
|
|
11153
11192
|
updateHasMovedGuide(e.clientX, e.clientY);
|
|
11154
11193
|
}, [updateHasMovedGuide]);
|
|
11194
|
+
const finishGuideInteraction = useCallback35(() => {
|
|
11195
|
+
const shouldDeleteGuide = shouldDeleteGuideRef.current;
|
|
11196
|
+
setGuidesList((prevState) => {
|
|
11197
|
+
const newGuides = shouldDeleteGuide ? prevState.filter((candidate) => candidate.id !== guide.id) : prevState;
|
|
11198
|
+
persistGuidesList(newGuides);
|
|
11199
|
+
return newGuides;
|
|
11200
|
+
});
|
|
11201
|
+
if (shouldDeleteGuide && selected) {
|
|
11202
|
+
clearSelection();
|
|
11203
|
+
}
|
|
11204
|
+
shouldDeleteGuideRef.current = false;
|
|
11205
|
+
shouldCreateGuideRef.current = false;
|
|
11206
|
+
stopForcingSpecificCursor();
|
|
11207
|
+
setDraggingGuideId(() => null);
|
|
11208
|
+
}, [
|
|
11209
|
+
clearSelection,
|
|
11210
|
+
guide.id,
|
|
11211
|
+
selected,
|
|
11212
|
+
setDraggingGuideId,
|
|
11213
|
+
setGuidesList,
|
|
11214
|
+
shouldCreateGuideRef,
|
|
11215
|
+
shouldDeleteGuideRef
|
|
11216
|
+
]);
|
|
11155
11217
|
const onPointerUp = useCallback35((e) => {
|
|
11156
11218
|
if (e.currentTarget.hasPointerCapture(e.pointerId)) {
|
|
11157
11219
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
11158
11220
|
}
|
|
11159
11221
|
const pointerDownPosition = pointerDownPositionRef.current;
|
|
11160
11222
|
pointerDownPositionRef.current = null;
|
|
11161
|
-
|
|
11223
|
+
const shouldDeleteGuide = shouldDeleteGuideRef.current;
|
|
11224
|
+
finishGuideInteraction();
|
|
11225
|
+
if (shouldDeleteGuide) {
|
|
11162
11226
|
return;
|
|
11163
11227
|
}
|
|
11164
11228
|
if (isGuidePointerUpAClick({
|
|
@@ -11169,11 +11233,13 @@ var GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
11169
11233
|
})) {
|
|
11170
11234
|
onSelect();
|
|
11171
11235
|
}
|
|
11172
|
-
}, [guide.id, onSelect, shouldDeleteGuideRef]);
|
|
11236
|
+
}, [finishGuideInteraction, guide.id, onSelect, shouldDeleteGuideRef]);
|
|
11173
11237
|
const onMouseUp = useCallback35((e) => {
|
|
11174
11238
|
const pointerDownPosition = pointerDownPositionRef.current;
|
|
11175
11239
|
pointerDownPositionRef.current = null;
|
|
11176
|
-
|
|
11240
|
+
const shouldDeleteGuide = shouldDeleteGuideRef.current;
|
|
11241
|
+
finishGuideInteraction();
|
|
11242
|
+
if (shouldDeleteGuide) {
|
|
11177
11243
|
return;
|
|
11178
11244
|
}
|
|
11179
11245
|
if (isGuidePointerUpAClick({
|
|
@@ -11184,7 +11250,7 @@ var GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
11184
11250
|
})) {
|
|
11185
11251
|
onSelect();
|
|
11186
11252
|
}
|
|
11187
|
-
}, [guide.id, onSelect, shouldDeleteGuideRef]);
|
|
11253
|
+
}, [finishGuideInteraction, guide.id, onSelect, shouldDeleteGuideRef]);
|
|
11188
11254
|
const onClick = useCallback35((e) => {
|
|
11189
11255
|
if (e.button !== 0) {
|
|
11190
11256
|
return;
|
|
@@ -11194,7 +11260,8 @@ var GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
11194
11260
|
}, []);
|
|
11195
11261
|
const onPointerCancel = useCallback35(() => {
|
|
11196
11262
|
pointerDownPositionRef.current = null;
|
|
11197
|
-
|
|
11263
|
+
finishGuideInteraction();
|
|
11264
|
+
}, [finishGuideInteraction]);
|
|
11198
11265
|
const isActive = selected || hoveredGuideId === guide.id;
|
|
11199
11266
|
const activeClassName = isActive ? "__remotion_editor_guide_selected" : null;
|
|
11200
11267
|
const guideClassName = useMemo38(() => {
|
|
@@ -11286,7 +11353,7 @@ var EditorGuides_default = EditorGuides;
|
|
|
11286
11353
|
import {
|
|
11287
11354
|
useCallback as useCallback37,
|
|
11288
11355
|
useContext as useContext23,
|
|
11289
|
-
|
|
11356
|
+
useLayoutEffect as useLayoutEffect2,
|
|
11290
11357
|
useMemo as useMemo41,
|
|
11291
11358
|
useRef as useRef20
|
|
11292
11359
|
} from "react";
|
|
@@ -11504,8 +11571,7 @@ import {
|
|
|
11504
11571
|
useContext as useContext22,
|
|
11505
11572
|
useEffect as useEffect31,
|
|
11506
11573
|
useMemo as useMemo40,
|
|
11507
|
-
useRef as useRef19
|
|
11508
|
-
useState as useState29
|
|
11574
|
+
useRef as useRef19
|
|
11509
11575
|
} from "react";
|
|
11510
11576
|
import { Internals as Internals23 } from "remotion";
|
|
11511
11577
|
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
@@ -11537,7 +11603,7 @@ var Ruler = ({
|
|
|
11537
11603
|
if (!unsafeVideoConfig) {
|
|
11538
11604
|
throw new Error("Video config not set");
|
|
11539
11605
|
}
|
|
11540
|
-
const
|
|
11606
|
+
const cursor = isVerticalRuler ? "ew-resize" : "ns-resize";
|
|
11541
11607
|
const guideHighlight = useMemo40(() => getRulerGuideHighlight({
|
|
11542
11608
|
guidesList,
|
|
11543
11609
|
selectedItems,
|
|
@@ -11589,7 +11655,7 @@ var Ruler = ({
|
|
|
11589
11655
|
e.preventDefault();
|
|
11590
11656
|
e.stopPropagation();
|
|
11591
11657
|
shouldCreateGuideRef.current = true;
|
|
11592
|
-
forceSpecificCursor(
|
|
11658
|
+
forceSpecificCursor(cursor);
|
|
11593
11659
|
const guideId = makeGuideId();
|
|
11594
11660
|
setEditorShowGuides(() => true);
|
|
11595
11661
|
setDraggingGuideId(() => guideId);
|
|
@@ -11612,28 +11678,16 @@ var Ruler = ({
|
|
|
11612
11678
|
setGuidesList,
|
|
11613
11679
|
orientation,
|
|
11614
11680
|
originOffset,
|
|
11615
|
-
unsafeVideoConfig.id
|
|
11681
|
+
unsafeVideoConfig.id,
|
|
11682
|
+
cursor
|
|
11616
11683
|
]);
|
|
11617
|
-
const changeCursor = useCallback36((e) => {
|
|
11618
|
-
e.preventDefault();
|
|
11619
|
-
if (draggingGuideId !== null) {
|
|
11620
|
-
setCursor("no-drop");
|
|
11621
|
-
}
|
|
11622
|
-
}, [setCursor, draggingGuideId]);
|
|
11623
|
-
useEffect31(() => {
|
|
11624
|
-
if (draggingGuideId === null) {
|
|
11625
|
-
setCursor(isVerticalRuler ? "ew-resize" : "ns-resize");
|
|
11626
|
-
}
|
|
11627
|
-
}, [draggingGuideId, isVerticalRuler]);
|
|
11628
11684
|
return /* @__PURE__ */ jsx67("canvas", {
|
|
11629
11685
|
ref: rulerCanvasRef,
|
|
11630
11686
|
width: rulerWidth * window.devicePixelRatio,
|
|
11631
11687
|
height: rulerHeight * window.devicePixelRatio,
|
|
11632
11688
|
style: rulerStyle,
|
|
11633
11689
|
...{ [PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: "true" },
|
|
11634
|
-
onPointerDown
|
|
11635
|
-
onPointerEnter: changeCursor,
|
|
11636
|
-
onPointerLeave: changeCursor
|
|
11690
|
+
onPointerDown
|
|
11637
11691
|
});
|
|
11638
11692
|
};
|
|
11639
11693
|
var Ruler_default = Ruler;
|
|
@@ -11709,12 +11763,13 @@ var EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef
|
|
|
11709
11763
|
if (!shouldDeleteGuideRef.current) {
|
|
11710
11764
|
shouldDeleteGuideRef.current = true;
|
|
11711
11765
|
}
|
|
11712
|
-
forceSpecificCursor("no-drop");
|
|
11713
11766
|
setGuidesList((prevState) => {
|
|
11714
11767
|
const newGuides = prevState.map((guide) => {
|
|
11715
11768
|
if (guide.id !== draggingGuideId) {
|
|
11716
11769
|
return guide;
|
|
11717
11770
|
}
|
|
11771
|
+
const desiredCursor = guide.orientation === "vertical" ? "ew-resize" : "ns-resize";
|
|
11772
|
+
forceSpecificCursor(desiredCursor);
|
|
11718
11773
|
return {
|
|
11719
11774
|
...guide,
|
|
11720
11775
|
show: false
|
|
@@ -11754,9 +11809,10 @@ var EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef
|
|
|
11754
11809
|
canvasPosition.top
|
|
11755
11810
|
]);
|
|
11756
11811
|
const onMouseUp = useCallback37(() => {
|
|
11812
|
+
const shouldDeleteGuide = shouldDeleteGuideRef.current;
|
|
11757
11813
|
setGuidesList((prevState) => {
|
|
11758
11814
|
const newGuides = prevState.filter((selected) => {
|
|
11759
|
-
if (!
|
|
11815
|
+
if (!shouldDeleteGuide) {
|
|
11760
11816
|
return true;
|
|
11761
11817
|
}
|
|
11762
11818
|
return selected.id !== draggingGuideId;
|
|
@@ -11765,7 +11821,7 @@ var EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef
|
|
|
11765
11821
|
return newGuides;
|
|
11766
11822
|
});
|
|
11767
11823
|
const deletedGuideWasSelected = selectedItems.some((item) => item.type === "guide" && item.guideId === draggingGuideId);
|
|
11768
|
-
if (
|
|
11824
|
+
if (shouldDeleteGuide && deletedGuideWasSelected) {
|
|
11769
11825
|
clearSelection();
|
|
11770
11826
|
}
|
|
11771
11827
|
shouldDeleteGuideRef.current = false;
|
|
@@ -11773,6 +11829,7 @@ var EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef
|
|
|
11773
11829
|
shouldCreateGuideRef.current = false;
|
|
11774
11830
|
setDraggingGuideId(() => null);
|
|
11775
11831
|
document.removeEventListener("pointerup", onMouseUp);
|
|
11832
|
+
document.removeEventListener("pointercancel", onMouseUp);
|
|
11776
11833
|
document.removeEventListener("pointermove", onMouseMove);
|
|
11777
11834
|
}, [
|
|
11778
11835
|
clearSelection,
|
|
@@ -11784,14 +11841,16 @@ var EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef
|
|
|
11784
11841
|
onMouseMove,
|
|
11785
11842
|
selectedItems
|
|
11786
11843
|
]);
|
|
11787
|
-
|
|
11844
|
+
useLayoutEffect2(() => {
|
|
11788
11845
|
if (draggingGuideId !== null) {
|
|
11789
11846
|
document.addEventListener("pointermove", onMouseMove);
|
|
11790
11847
|
document.addEventListener("pointerup", onMouseUp);
|
|
11848
|
+
document.addEventListener("pointercancel", onMouseUp);
|
|
11791
11849
|
}
|
|
11792
11850
|
return () => {
|
|
11793
11851
|
document.removeEventListener("pointermove", onMouseMove);
|
|
11794
11852
|
document.removeEventListener("pointerup", onMouseUp);
|
|
11853
|
+
document.removeEventListener("pointercancel", onMouseUp);
|
|
11795
11854
|
if (requestAnimationFrameRef.current) {
|
|
11796
11855
|
cancelAnimationFrame(requestAnimationFrameRef.current);
|
|
11797
11856
|
}
|
|
@@ -12001,6 +12060,16 @@ var getAssetElement = ({
|
|
|
12001
12060
|
position: null
|
|
12002
12061
|
};
|
|
12003
12062
|
}
|
|
12063
|
+
if (fileType.type === "apng") {
|
|
12064
|
+
return {
|
|
12065
|
+
type: "asset",
|
|
12066
|
+
assetType: "animated-image",
|
|
12067
|
+
src,
|
|
12068
|
+
srcType: "static",
|
|
12069
|
+
dimensions: fileType.dimensions,
|
|
12070
|
+
position: null
|
|
12071
|
+
};
|
|
12072
|
+
}
|
|
12004
12073
|
if (fileType.type === "gif") {
|
|
12005
12074
|
return {
|
|
12006
12075
|
type: "asset",
|
|
@@ -12051,6 +12120,16 @@ var getAssetElementFromPath = (assetPath) => {
|
|
|
12051
12120
|
position: null
|
|
12052
12121
|
};
|
|
12053
12122
|
}
|
|
12123
|
+
if (extension === "apng") {
|
|
12124
|
+
return {
|
|
12125
|
+
type: "asset",
|
|
12126
|
+
assetType: "animated-image",
|
|
12127
|
+
src: assetPath,
|
|
12128
|
+
srcType: "static",
|
|
12129
|
+
dimensions: null,
|
|
12130
|
+
position: null
|
|
12131
|
+
};
|
|
12132
|
+
}
|
|
12054
12133
|
if (extension === "gif") {
|
|
12055
12134
|
return {
|
|
12056
12135
|
type: "asset",
|
|
@@ -12096,6 +12175,9 @@ var getAssetLabel = (element) => {
|
|
|
12096
12175
|
if (element.assetType === "gif") {
|
|
12097
12176
|
return "<Gif>";
|
|
12098
12177
|
}
|
|
12178
|
+
if (element.assetType === "animated-image") {
|
|
12179
|
+
return "<AnimatedImage>";
|
|
12180
|
+
}
|
|
12099
12181
|
if (element.assetType === "audio") {
|
|
12100
12182
|
return "<Audio>";
|
|
12101
12183
|
}
|
|
@@ -12127,6 +12209,9 @@ var getComponentPropNumber = (props, name) => {
|
|
|
12127
12209
|
return typeof prop?.value === "number" ? prop.value : null;
|
|
12128
12210
|
};
|
|
12129
12211
|
var getComponentDimensions = (component) => {
|
|
12212
|
+
if (component.dimensions) {
|
|
12213
|
+
return component.dimensions;
|
|
12214
|
+
}
|
|
12130
12215
|
const width = getComponentPropNumber(component.props, "width");
|
|
12131
12216
|
const height = getComponentPropNumber(component.props, "height");
|
|
12132
12217
|
if (width !== null && height !== null) {
|
|
@@ -12170,7 +12255,7 @@ var getFileDimensions = async ({
|
|
|
12170
12255
|
if (fileType.type === "wav" || fileType.type === "mp3" || fileType.type === "aac" || fileType.type === "flac") {
|
|
12171
12256
|
return null;
|
|
12172
12257
|
}
|
|
12173
|
-
if (fileType.type === "png" || fileType.type === "jpeg" || fileType.type === "webp" || fileType.type === "bmp" || fileType.type === "gif") {
|
|
12258
|
+
if (fileType.type === "png" || fileType.type === "jpeg" || fileType.type === "webp" || fileType.type === "bmp" || fileType.type === "apng" || fileType.type === "gif") {
|
|
12174
12259
|
if (fileType.dimensions) {
|
|
12175
12260
|
return fileType.dimensions;
|
|
12176
12261
|
}
|
|
@@ -12190,7 +12275,7 @@ var getFileDimensions = async ({
|
|
|
12190
12275
|
var getStaticAssetDimensions = (assetPath) => {
|
|
12191
12276
|
const extension = assetPath.split(".").pop()?.toLowerCase();
|
|
12192
12277
|
const src = staticFile2(assetPath);
|
|
12193
|
-
if (extension && ["png", "jpg", "jpeg", "webp", "bmp", "gif"].includes(extension)) {
|
|
12278
|
+
if (extension && ["png", "jpg", "jpeg", "webp", "bmp", "gif", "apng"].includes(extension)) {
|
|
12194
12279
|
return getImageDimensions({ revokeObjectUrl: false, src });
|
|
12195
12280
|
}
|
|
12196
12281
|
if (extension && ["mp4", "m4v", "mov", "avi", "webm", "ts", "m2ts"].includes(extension)) {
|
|
@@ -12215,6 +12300,31 @@ var getStaticAssetDimensionsOrNull = async (assetPath) => {
|
|
|
12215
12300
|
return null;
|
|
12216
12301
|
}
|
|
12217
12302
|
};
|
|
12303
|
+
var getStaticAssetFileType = async (assetPath) => {
|
|
12304
|
+
const extension = assetPath.split(".").pop()?.toLowerCase();
|
|
12305
|
+
if (extension !== "png" && extension !== "apng") {
|
|
12306
|
+
return null;
|
|
12307
|
+
}
|
|
12308
|
+
try {
|
|
12309
|
+
const response = await fetch(staticFile2(assetPath));
|
|
12310
|
+
if (!response.ok) {
|
|
12311
|
+
return null;
|
|
12312
|
+
}
|
|
12313
|
+
return detectFileType(new Uint8Array(await response.arrayBuffer()));
|
|
12314
|
+
} catch {
|
|
12315
|
+
return null;
|
|
12316
|
+
}
|
|
12317
|
+
};
|
|
12318
|
+
var getAssetElementFromStaticAsset = async (assetPath) => {
|
|
12319
|
+
const fileType = await getStaticAssetFileType(assetPath);
|
|
12320
|
+
if (fileType) {
|
|
12321
|
+
const element = getAssetElement({ fileType, src: assetPath });
|
|
12322
|
+
if (element) {
|
|
12323
|
+
return element;
|
|
12324
|
+
}
|
|
12325
|
+
}
|
|
12326
|
+
return getAssetElementFromPath(assetPath);
|
|
12327
|
+
};
|
|
12218
12328
|
var pickFilesToImport = () => {
|
|
12219
12329
|
return new Promise((resolve) => {
|
|
12220
12330
|
const input = document.createElement("input");
|
|
@@ -12427,18 +12537,18 @@ var insertExistingAssets = async ({
|
|
|
12427
12537
|
const unsupportedFiles = [];
|
|
12428
12538
|
try {
|
|
12429
12539
|
for (const assetPath of assetPaths) {
|
|
12430
|
-
const element =
|
|
12540
|
+
const element = await getAssetElementFromStaticAsset(assetPath);
|
|
12431
12541
|
if (element === null) {
|
|
12432
12542
|
unsupportedFiles.push(assetPath);
|
|
12433
12543
|
continue;
|
|
12434
12544
|
}
|
|
12435
|
-
const dimensions = await getStaticAssetDimensionsOrNull(assetPath);
|
|
12545
|
+
const dimensions = element.dimensions ?? await getStaticAssetDimensionsOrNull(assetPath);
|
|
12436
12546
|
const inserted = await insertAssetElement({
|
|
12437
12547
|
compositionFile,
|
|
12438
12548
|
compositionId,
|
|
12439
12549
|
element: {
|
|
12440
12550
|
...element,
|
|
12441
|
-
dimensions
|
|
12551
|
+
dimensions,
|
|
12442
12552
|
position: getCenteredPosition({
|
|
12443
12553
|
dimensions,
|
|
12444
12554
|
dropPosition
|
|
@@ -12492,7 +12602,7 @@ import { PlayerInternals as PlayerInternals10 } from "@remotion/player";
|
|
|
12492
12602
|
import {
|
|
12493
12603
|
useCallback as useCallback42,
|
|
12494
12604
|
useContext as useContext31,
|
|
12495
|
-
useEffect as
|
|
12605
|
+
useEffect as useEffect39,
|
|
12496
12606
|
useMemo as useMemo49,
|
|
12497
12607
|
useRef as useRef27
|
|
12498
12608
|
} from "react";
|
|
@@ -12524,32 +12634,32 @@ var checkerboardBackgroundImage = (checkerboard) => {
|
|
|
12524
12634
|
};
|
|
12525
12635
|
|
|
12526
12636
|
// src/components/RenderPreview.tsx
|
|
12527
|
-
import { useContext as useContext25, useEffect as
|
|
12637
|
+
import { useContext as useContext25, useEffect as useEffect36, useState as useState33 } from "react";
|
|
12528
12638
|
|
|
12529
12639
|
// src/components/FilePreview.tsx
|
|
12530
12640
|
import { formatBytes } from "@remotion/studio-shared";
|
|
12531
12641
|
|
|
12532
12642
|
// src/components/JSONViewer.tsx
|
|
12533
|
-
import { useEffect as
|
|
12643
|
+
import { useEffect as useEffect34, useState as useState31 } from "react";
|
|
12534
12644
|
|
|
12535
12645
|
// src/components/NewComposition/RemTextarea.tsx
|
|
12536
12646
|
import {
|
|
12537
12647
|
forwardRef as forwardRef3,
|
|
12538
|
-
useEffect as
|
|
12648
|
+
useEffect as useEffect33,
|
|
12539
12649
|
useImperativeHandle as useImperativeHandle8,
|
|
12540
12650
|
useMemo as useMemo43,
|
|
12541
12651
|
useRef as useRef22,
|
|
12542
|
-
useState as
|
|
12652
|
+
useState as useState30
|
|
12543
12653
|
} from "react";
|
|
12544
12654
|
|
|
12545
12655
|
// src/components/NewComposition/RemInput.tsx
|
|
12546
12656
|
import {
|
|
12547
12657
|
forwardRef as forwardRef2,
|
|
12548
|
-
useEffect as
|
|
12658
|
+
useEffect as useEffect32,
|
|
12549
12659
|
useImperativeHandle as useImperativeHandle7,
|
|
12550
12660
|
useMemo as useMemo42,
|
|
12551
12661
|
useRef as useRef21,
|
|
12552
|
-
useState as
|
|
12662
|
+
useState as useState29
|
|
12553
12663
|
} from "react";
|
|
12554
12664
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
12555
12665
|
var INPUT_HORIZONTAL_PADDING = 8;
|
|
@@ -12575,8 +12685,8 @@ var getInputBorderColor = ({
|
|
|
12575
12685
|
isHovered
|
|
12576
12686
|
}) => status === "warning" ? WARNING_COLOR : status === "error" ? FAIL_COLOR : isFocused ? SELECTED_BACKGROUND : isHovered ? INPUT_BORDER_COLOR_HOVERED : INPUT_BORDER_COLOR_UNHOVERED;
|
|
12577
12687
|
var RemInputForwardRef = ({ status, rightAlign, ...props }, ref2) => {
|
|
12578
|
-
const [isFocused, setIsFocused] =
|
|
12579
|
-
const [isHovered, setIsHovered] =
|
|
12688
|
+
const [isFocused, setIsFocused] = useState29(false);
|
|
12689
|
+
const [isHovered, setIsHovered] = useState29(false);
|
|
12580
12690
|
const inputRef = useRef21(null);
|
|
12581
12691
|
const { tabIndex } = useZIndex();
|
|
12582
12692
|
const style5 = useMemo42(() => {
|
|
@@ -12592,7 +12702,7 @@ var RemInputForwardRef = ({ status, rightAlign, ...props }, ref2) => {
|
|
|
12592
12702
|
useImperativeHandle7(ref2, () => {
|
|
12593
12703
|
return inputRef.current;
|
|
12594
12704
|
}, []);
|
|
12595
|
-
|
|
12705
|
+
useEffect32(() => {
|
|
12596
12706
|
if (!inputRef.current) {
|
|
12597
12707
|
return;
|
|
12598
12708
|
}
|
|
@@ -12633,8 +12743,8 @@ var inputBaseStyle2 = {
|
|
|
12633
12743
|
overflowX: "hidden"
|
|
12634
12744
|
};
|
|
12635
12745
|
var RemTextareaFRFunction = ({ status, ...props }, ref2) => {
|
|
12636
|
-
const [isFocused, setIsFocused] =
|
|
12637
|
-
const [isHovered, setIsHovered] =
|
|
12746
|
+
const [isFocused, setIsFocused] = useState30(false);
|
|
12747
|
+
const [isHovered, setIsHovered] = useState30(false);
|
|
12638
12748
|
const inputRef = useRef22(null);
|
|
12639
12749
|
const { tabIndex } = useZIndex();
|
|
12640
12750
|
useImperativeHandle8(ref2, () => {
|
|
@@ -12649,7 +12759,7 @@ var RemTextareaFRFunction = ({ status, ...props }, ref2) => {
|
|
|
12649
12759
|
...props.style ?? {}
|
|
12650
12760
|
};
|
|
12651
12761
|
}, [isFocused, isHovered, props.style, status]);
|
|
12652
|
-
|
|
12762
|
+
useEffect33(() => {
|
|
12653
12763
|
if (!inputRef.current) {
|
|
12654
12764
|
return;
|
|
12655
12765
|
}
|
|
@@ -12726,8 +12836,8 @@ var jsonStyle = {
|
|
|
12726
12836
|
flex: 1
|
|
12727
12837
|
};
|
|
12728
12838
|
var JSONViewer = ({ src }) => {
|
|
12729
|
-
const [json, setJson] =
|
|
12730
|
-
|
|
12839
|
+
const [json, setJson] = useState31(null);
|
|
12840
|
+
useEffect34(() => {
|
|
12731
12841
|
fetch(src).then((res) => res.json()).then((jsonRes) => {
|
|
12732
12842
|
setJson(JSON.stringify(jsonRes, null, 2));
|
|
12733
12843
|
});
|
|
@@ -12743,7 +12853,7 @@ var JSONViewer = ({ src }) => {
|
|
|
12743
12853
|
};
|
|
12744
12854
|
|
|
12745
12855
|
// src/components/TextViewer.tsx
|
|
12746
|
-
import { useEffect as
|
|
12856
|
+
import { useEffect as useEffect35, useState as useState32 } from "react";
|
|
12747
12857
|
import { jsxs as jsxs31 } from "react/jsx-runtime";
|
|
12748
12858
|
var textStyle = {
|
|
12749
12859
|
margin: 14,
|
|
@@ -12753,8 +12863,8 @@ var textStyle = {
|
|
|
12753
12863
|
whiteSpace: "pre-wrap"
|
|
12754
12864
|
};
|
|
12755
12865
|
var TextViewer = ({ src }) => {
|
|
12756
|
-
const [txt, setTxt] =
|
|
12757
|
-
|
|
12866
|
+
const [txt, setTxt] = useState32("");
|
|
12867
|
+
useEffect35(() => {
|
|
12758
12868
|
fetch(src).then(async (res) => {
|
|
12759
12869
|
if (!res.ok || !res.body) {
|
|
12760
12870
|
return;
|
|
@@ -12855,9 +12965,9 @@ var errMsgStyle = {
|
|
|
12855
12965
|
var RenderPreview = ({ path, assetMetadata, getBlob }) => {
|
|
12856
12966
|
const fileType = getPreviewFileType(path);
|
|
12857
12967
|
const connectionStatus = useContext25(StudioServerConnectionCtx).previewServerState.type;
|
|
12858
|
-
const [blobUrl, setBlobUrl] =
|
|
12859
|
-
const [blobError, setBlobError] =
|
|
12860
|
-
|
|
12968
|
+
const [blobUrl, setBlobUrl] = useState33(null);
|
|
12969
|
+
const [blobError, setBlobError] = useState33(null);
|
|
12970
|
+
useEffect36(() => {
|
|
12861
12971
|
if (!getBlob) {
|
|
12862
12972
|
setBlobUrl(null);
|
|
12863
12973
|
setBlobError(null);
|
|
@@ -12922,10 +13032,10 @@ import { PlayerInternals as PlayerInternals9 } from "@remotion/player";
|
|
|
12922
13032
|
import React63, {
|
|
12923
13033
|
useCallback as useCallback41,
|
|
12924
13034
|
useContext as useContext29,
|
|
12925
|
-
useEffect as
|
|
13035
|
+
useEffect as useEffect38,
|
|
12926
13036
|
useMemo as useMemo48,
|
|
12927
13037
|
useRef as useRef26,
|
|
12928
|
-
useState as
|
|
13038
|
+
useState as useState37
|
|
12929
13039
|
} from "react";
|
|
12930
13040
|
import { Internals as Internals29 } from "remotion";
|
|
12931
13041
|
import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
|
|
@@ -15371,11 +15481,11 @@ var serializeTranslate = (x, y, decimalPlaces = translateDecimalPlaces) => {
|
|
|
15371
15481
|
};
|
|
15372
15482
|
|
|
15373
15483
|
// src/components/Timeline/TimelineScaleField.tsx
|
|
15374
|
-
import { useCallback as useCallback40, useContext as useContext26, useMemo as useMemo45, useRef as useRef24, useState as
|
|
15484
|
+
import { useCallback as useCallback40, useContext as useContext26, useMemo as useMemo45, useRef as useRef24, useState as useState35 } from "react";
|
|
15375
15485
|
import { NoReactInternals as NoReactInternals5 } from "remotion/no-react";
|
|
15376
15486
|
|
|
15377
15487
|
// src/components/NewComposition/InputDragger.tsx
|
|
15378
|
-
import React58, { useCallback as useCallback38, useEffect as
|
|
15488
|
+
import React58, { useCallback as useCallback38, useEffect as useEffect37, useMemo as useMemo44, useRef as useRef23, useState as useState34 } from "react";
|
|
15379
15489
|
import { interpolate as interpolate2 } from "remotion";
|
|
15380
15490
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
15381
15491
|
var isInt = (num) => {
|
|
@@ -15418,8 +15528,8 @@ var InputDraggerForwardRefFn = ({
|
|
|
15418
15528
|
dragDecimalPlaces,
|
|
15419
15529
|
...props
|
|
15420
15530
|
}, ref2) => {
|
|
15421
|
-
const [inputFallback, setInputFallback] =
|
|
15422
|
-
const [dragging, setDragging] =
|
|
15531
|
+
const [inputFallback, setInputFallback] = useState34(false);
|
|
15532
|
+
const [dragging, setDragging] = useState34(false);
|
|
15423
15533
|
const fallbackRef = useRef23(null);
|
|
15424
15534
|
const pointerDownRef = useRef23(false);
|
|
15425
15535
|
const style5 = useMemo44(() => {
|
|
@@ -15540,7 +15650,7 @@ var InputDraggerForwardRefFn = ({
|
|
|
15540
15650
|
snapToStep,
|
|
15541
15651
|
dragDecimalPlaces
|
|
15542
15652
|
]);
|
|
15543
|
-
|
|
15653
|
+
useEffect37(() => {
|
|
15544
15654
|
if (inputFallback) {
|
|
15545
15655
|
fallbackRef.current?.select();
|
|
15546
15656
|
}
|
|
@@ -15796,8 +15906,8 @@ var TimelineScaleField = ({
|
|
|
15796
15906
|
onDragEnd,
|
|
15797
15907
|
scaleLockNodePath
|
|
15798
15908
|
}) => {
|
|
15799
|
-
const [dragX, setDragX] =
|
|
15800
|
-
const [dragY, setDragY] =
|
|
15909
|
+
const [dragX, setDragX] = useState35(null);
|
|
15910
|
+
const [dragY, setDragY] = useState35(null);
|
|
15801
15911
|
const dragStartRef = useRef24(null);
|
|
15802
15912
|
const { getScaleLockState, setScaleLockState } = useContext26(ScaleLockContext);
|
|
15803
15913
|
const [codeX, codeY, codeZ] = useMemo45(() => NoReactInternals5.parseScaleValue(effectiveValue), [effectiveValue]);
|
|
@@ -16486,9 +16596,66 @@ var compensateTranslateForTransformOrigin = ({
|
|
|
16486
16596
|
return [startTranslate[0] - compensationX, startTranslate[1] - compensationY];
|
|
16487
16597
|
};
|
|
16488
16598
|
var uvsEqual = (left3, right) => Math.abs(left3[0] - right[0]) < 0.000001 && Math.abs(left3[1] - right[1]) < 0.000001;
|
|
16599
|
+
var getSelectedOutlineTransformOriginLockedAxis = ({
|
|
16600
|
+
axisLocked,
|
|
16601
|
+
dimensions,
|
|
16602
|
+
startUv,
|
|
16603
|
+
uv
|
|
16604
|
+
}) => {
|
|
16605
|
+
if (!axisLocked) {
|
|
16606
|
+
return null;
|
|
16607
|
+
}
|
|
16608
|
+
const deltaX = (uv[0] - startUv[0]) * dimensions.width;
|
|
16609
|
+
const deltaY = (uv[1] - startUv[1]) * dimensions.height;
|
|
16610
|
+
return Math.abs(deltaX) >= Math.abs(deltaY) ? "x" : "y";
|
|
16611
|
+
};
|
|
16612
|
+
var applySelectedOutlineTransformOriginAxisLock = ({
|
|
16613
|
+
lockedAxis,
|
|
16614
|
+
startUv,
|
|
16615
|
+
uv
|
|
16616
|
+
}) => {
|
|
16617
|
+
if (lockedAxis === "x") {
|
|
16618
|
+
return [uv[0], startUv[1]];
|
|
16619
|
+
}
|
|
16620
|
+
if (lockedAxis === "y") {
|
|
16621
|
+
return [startUv[0], uv[1]];
|
|
16622
|
+
}
|
|
16623
|
+
return uv;
|
|
16624
|
+
};
|
|
16625
|
+
var transformOriginSnapTargets = [
|
|
16626
|
+
[0, 0],
|
|
16627
|
+
[0.5, 0],
|
|
16628
|
+
[1, 0],
|
|
16629
|
+
[1, 0.5],
|
|
16630
|
+
[1, 1],
|
|
16631
|
+
[0.5, 1],
|
|
16632
|
+
[0, 1],
|
|
16633
|
+
[0, 0.5],
|
|
16634
|
+
[0.5, 0.5]
|
|
16635
|
+
];
|
|
16636
|
+
var selectedOutlineTransformOriginSnapThresholdPx = 10;
|
|
16637
|
+
var snapSelectedOutlineTransformOriginUv = ({
|
|
16638
|
+
point,
|
|
16639
|
+
points,
|
|
16640
|
+
thresholdPx = selectedOutlineTransformOriginSnapThresholdPx,
|
|
16641
|
+
uv
|
|
16642
|
+
}) => {
|
|
16643
|
+
let best = null;
|
|
16644
|
+
for (const snapUv of transformOriginSnapTargets) {
|
|
16645
|
+
const snapPoint = getUvHandlePosition(points, snapUv);
|
|
16646
|
+
const distance = Math.hypot(point.x - snapPoint.x, point.y - snapPoint.y);
|
|
16647
|
+
if (distance > thresholdPx) {
|
|
16648
|
+
continue;
|
|
16649
|
+
}
|
|
16650
|
+
if (best === null || distance < best.distance) {
|
|
16651
|
+
best = { distance, uv: snapUv };
|
|
16652
|
+
}
|
|
16653
|
+
}
|
|
16654
|
+
return best?.uv ?? uv;
|
|
16655
|
+
};
|
|
16489
16656
|
|
|
16490
16657
|
// src/components/SelectedOutlineElement.tsx
|
|
16491
|
-
import React61, { useContext as useContext27, useMemo as useMemo46, useRef as useRef25, useState as
|
|
16658
|
+
import React61, { useContext as useContext27, useMemo as useMemo46, useRef as useRef25, useState as useState36 } from "react";
|
|
16492
16659
|
import { Internals as Internals27 } from "remotion";
|
|
16493
16660
|
import { NoReactInternals as NoReactInternals9 } from "remotion/no-react";
|
|
16494
16661
|
|
|
@@ -16887,14 +17054,39 @@ var SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, target
|
|
|
16887
17054
|
const defaultOrigin = transformOriginDrag.originDefault !== undefined ? JSON.stringify(transformOriginDrag.originDefault) : null;
|
|
16888
17055
|
const defaultTranslate = transformOriginDrag.translateDefault !== undefined ? JSON.stringify(transformOriginDrag.translateDefault) : null;
|
|
16889
17056
|
let last = null;
|
|
17057
|
+
let currentPointerX = event.clientX;
|
|
17058
|
+
let currentPointerY = event.clientY;
|
|
17059
|
+
let axisLocked = event.shiftKey;
|
|
16890
17060
|
onDraggingChange(true);
|
|
16891
17061
|
forceSpecificCursor("crosshair");
|
|
16892
|
-
const
|
|
17062
|
+
const updateFromPointerPosition = () => {
|
|
16893
17063
|
const point = {
|
|
16894
|
-
x:
|
|
16895
|
-
y:
|
|
17064
|
+
x: currentPointerX - svgRect.left,
|
|
17065
|
+
y: currentPointerY - svgRect.top
|
|
16896
17066
|
};
|
|
16897
|
-
const
|
|
17067
|
+
const rawUv = getUvCoordinateForPoint(outline.points, point);
|
|
17068
|
+
const lockedAxis = getSelectedOutlineTransformOriginLockedAxis({
|
|
17069
|
+
axisLocked,
|
|
17070
|
+
dimensions,
|
|
17071
|
+
startUv: uv,
|
|
17072
|
+
uv: rawUv
|
|
17073
|
+
});
|
|
17074
|
+
const axisLockedUv = applySelectedOutlineTransformOriginAxisLock({
|
|
17075
|
+
lockedAxis,
|
|
17076
|
+
startUv: uv,
|
|
17077
|
+
uv: rawUv
|
|
17078
|
+
});
|
|
17079
|
+
const snapPoint = lockedAxis === null ? point : getUvHandlePosition(outline.points, axisLockedUv);
|
|
17080
|
+
const snappedUv = snapSelectedOutlineTransformOriginUv({
|
|
17081
|
+
point: snapPoint,
|
|
17082
|
+
points: outline.points,
|
|
17083
|
+
uv: axisLockedUv
|
|
17084
|
+
});
|
|
17085
|
+
const nextUv = applySelectedOutlineTransformOriginAxisLock({
|
|
17086
|
+
lockedAxis,
|
|
17087
|
+
startUv: uv,
|
|
17088
|
+
uv: snappedUv
|
|
17089
|
+
});
|
|
16898
17090
|
const deltaOrigin = [
|
|
16899
17091
|
(nextUv[0] - uv[0]) * dimensions.width,
|
|
16900
17092
|
(nextUv[1] - uv[1]) * dimensions.height
|
|
@@ -16922,15 +17114,31 @@ var SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, target
|
|
|
16922
17114
|
value: translate
|
|
16923
17115
|
}) : Internals27.makeStaticDragOverride(translate));
|
|
16924
17116
|
};
|
|
16925
|
-
|
|
17117
|
+
updateFromPointerPosition();
|
|
16926
17118
|
const onPointerMove = (moveEvent) => {
|
|
16927
17119
|
moveEvent.preventDefault();
|
|
16928
|
-
|
|
17120
|
+
currentPointerX = moveEvent.clientX;
|
|
17121
|
+
currentPointerY = moveEvent.clientY;
|
|
17122
|
+
axisLocked = moveEvent.shiftKey;
|
|
17123
|
+
updateFromPointerPosition();
|
|
17124
|
+
};
|
|
17125
|
+
const onKeyChange = (keyEvent) => {
|
|
17126
|
+
if (keyEvent.key !== "Shift") {
|
|
17127
|
+
return;
|
|
17128
|
+
}
|
|
17129
|
+
const nextAxisLocked = keyEvent.type === "keydown";
|
|
17130
|
+
if (nextAxisLocked === axisLocked) {
|
|
17131
|
+
return;
|
|
17132
|
+
}
|
|
17133
|
+
axisLocked = nextAxisLocked;
|
|
17134
|
+
updateFromPointerPosition();
|
|
16929
17135
|
};
|
|
16930
17136
|
const onPointerUp = () => {
|
|
16931
17137
|
window.removeEventListener("pointermove", onPointerMove);
|
|
16932
17138
|
window.removeEventListener("pointerup", onPointerUp);
|
|
16933
17139
|
window.removeEventListener("pointercancel", onPointerUp);
|
|
17140
|
+
window.removeEventListener("keydown", onKeyChange);
|
|
17141
|
+
window.removeEventListener("keyup", onKeyChange);
|
|
16934
17142
|
stopForcingSpecificCursor();
|
|
16935
17143
|
onDraggingChange(false);
|
|
16936
17144
|
if (last === null || uvsEqual(last.uv, uv)) {
|
|
@@ -16999,6 +17207,8 @@ var SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, target
|
|
|
16999
17207
|
window.addEventListener("pointermove", onPointerMove);
|
|
17000
17208
|
window.addEventListener("pointerup", onPointerUp);
|
|
17001
17209
|
window.addEventListener("pointercancel", onPointerUp);
|
|
17210
|
+
window.addEventListener("keydown", onKeyChange);
|
|
17211
|
+
window.addEventListener("keyup", onKeyChange);
|
|
17002
17212
|
}, [
|
|
17003
17213
|
clearDragOverrides,
|
|
17004
17214
|
onDraggingChange,
|
|
@@ -17072,7 +17282,7 @@ var SelectedOutlinePolygon = ({
|
|
|
17072
17282
|
const selected = target?.selected ?? false;
|
|
17073
17283
|
const containsSelection = target?.containsSelection ?? false;
|
|
17074
17284
|
const effectDrop = target?.effectDrop ?? null;
|
|
17075
|
-
const [effectDropHovered, setEffectDropHovered] =
|
|
17285
|
+
const [effectDropHovered, setEffectDropHovered] = useState36(false);
|
|
17076
17286
|
const visible = containsSelection || hovered;
|
|
17077
17287
|
const onPointerDown = React61.useCallback((event) => {
|
|
17078
17288
|
if (event.button !== 0 || target === undefined) {
|
|
@@ -17326,8 +17536,6 @@ var SelectedOutlineScaleEdgeLine = ({
|
|
|
17326
17536
|
if (interaction.shiftKey || interaction.toggleKey) {
|
|
17327
17537
|
return;
|
|
17328
17538
|
}
|
|
17329
|
-
onDraggingChange(true);
|
|
17330
|
-
forceSpecificCursor(edgeInfo.cursor);
|
|
17331
17539
|
const startPointer = { x: event.clientX, y: event.clientY };
|
|
17332
17540
|
const dragStates = getSelectedOutlineScaleDragStates({
|
|
17333
17541
|
dragTargets: selected ? allScaleDragTargets : [scaleDrag],
|
|
@@ -17335,12 +17543,24 @@ var SelectedOutlineScaleEdgeLine = ({
|
|
|
17335
17543
|
timelinePosition: timelinePositionRef.current
|
|
17336
17544
|
});
|
|
17337
17545
|
let lastValues = new Map;
|
|
17546
|
+
let dragStarted = false;
|
|
17338
17547
|
const onPointerMove = (moveEvent) => {
|
|
17339
17548
|
moveEvent.preventDefault();
|
|
17340
17549
|
const delta = {
|
|
17341
17550
|
x: moveEvent.clientX - startPointer.x,
|
|
17342
17551
|
y: moveEvent.clientY - startPointer.y
|
|
17343
17552
|
};
|
|
17553
|
+
if (!dragStarted) {
|
|
17554
|
+
if (!isSelectedOutlineDragPastThreshold({
|
|
17555
|
+
deltaX: delta.x,
|
|
17556
|
+
deltaY: delta.y
|
|
17557
|
+
})) {
|
|
17558
|
+
return;
|
|
17559
|
+
}
|
|
17560
|
+
dragStarted = true;
|
|
17561
|
+
onDraggingChange(true);
|
|
17562
|
+
forceSpecificCursor(edgeInfo.cursor);
|
|
17563
|
+
}
|
|
17344
17564
|
const projectedDelta = dot(delta, edgeInfo.normal);
|
|
17345
17565
|
const scaleFactor = Math.max(0.001, 1 + projectedDelta / edgeInfo.extent);
|
|
17346
17566
|
lastValues = getSelectedOutlineScaleDragValues({
|
|
@@ -17368,8 +17588,10 @@ var SelectedOutlineScaleEdgeLine = ({
|
|
|
17368
17588
|
window.removeEventListener("pointermove", onPointerMove);
|
|
17369
17589
|
window.removeEventListener("pointerup", onPointerUp);
|
|
17370
17590
|
window.removeEventListener("pointercancel", onPointerUp);
|
|
17371
|
-
|
|
17372
|
-
|
|
17591
|
+
if (dragStarted) {
|
|
17592
|
+
stopForcingSpecificCursor();
|
|
17593
|
+
onDraggingChange(false);
|
|
17594
|
+
}
|
|
17373
17595
|
const changes = getSelectedOutlineScaleDragChanges({
|
|
17374
17596
|
dragStates,
|
|
17375
17597
|
lastValues
|
|
@@ -17507,8 +17729,7 @@ var SelectedOutlineRotationCornerHandle = ({
|
|
|
17507
17729
|
if (interaction.shiftKey || interaction.toggleKey) {
|
|
17508
17730
|
return;
|
|
17509
17731
|
}
|
|
17510
|
-
|
|
17511
|
-
forceSpecificCursor(cornerInfo.cursor);
|
|
17732
|
+
const startPointer = { x: event.clientX, y: event.clientY };
|
|
17512
17733
|
const svgRect = svg.getBoundingClientRect();
|
|
17513
17734
|
const center2 = svgPointToClientPoint(getSelectedOutlineRotationPivot({
|
|
17514
17735
|
dimensions: outline.dimensions,
|
|
@@ -17526,8 +17747,21 @@ var SelectedOutlineRotationCornerHandle = ({
|
|
|
17526
17747
|
});
|
|
17527
17748
|
let accumulatedDelta = 0;
|
|
17528
17749
|
let lastValues = new Map;
|
|
17750
|
+
let dragStarted = false;
|
|
17529
17751
|
const onPointerMove = (moveEvent) => {
|
|
17530
17752
|
moveEvent.preventDefault();
|
|
17753
|
+
const screenDeltaX = moveEvent.clientX - startPointer.x;
|
|
17754
|
+
const screenDeltaY = moveEvent.clientY - startPointer.y;
|
|
17755
|
+
if (!dragStarted) {
|
|
17756
|
+
if (!isSelectedOutlineDragPastThreshold({
|
|
17757
|
+
deltaX: screenDeltaX,
|
|
17758
|
+
deltaY: screenDeltaY
|
|
17759
|
+
})) {
|
|
17760
|
+
return;
|
|
17761
|
+
}
|
|
17762
|
+
dragStarted = true;
|
|
17763
|
+
onDraggingChange(true);
|
|
17764
|
+
}
|
|
17531
17765
|
const nextAngle = getAngleDegrees(center2, {
|
|
17532
17766
|
x: moveEvent.clientX,
|
|
17533
17767
|
y: moveEvent.clientY
|
|
@@ -17562,8 +17796,10 @@ var SelectedOutlineRotationCornerHandle = ({
|
|
|
17562
17796
|
window.removeEventListener("pointermove", onPointerMove);
|
|
17563
17797
|
window.removeEventListener("pointerup", onPointerUp);
|
|
17564
17798
|
window.removeEventListener("pointercancel", onPointerUp);
|
|
17565
|
-
|
|
17566
|
-
|
|
17799
|
+
if (dragStarted) {
|
|
17800
|
+
stopForcingSpecificCursor();
|
|
17801
|
+
onDraggingChange(false);
|
|
17802
|
+
}
|
|
17567
17803
|
const changes = getSelectedOutlineRotationDragChanges({
|
|
17568
17804
|
dragStates,
|
|
17569
17805
|
lastValues
|
|
@@ -18006,9 +18242,9 @@ var SelectedOutlineOverlay = ({ scale }) => {
|
|
|
18006
18242
|
const { frameBack, frameForward, getCurrentFrame: getCurrentFrame2, seek } = PlayerInternals9.usePlayer();
|
|
18007
18243
|
const keybindings = useKeybinding();
|
|
18008
18244
|
const timelinePosition = Internals29.Timeline.useTimelinePosition();
|
|
18009
|
-
const [outlines, setOutlines] =
|
|
18010
|
-
const [hoveredOutlineKey, setHoveredOutlineKey] =
|
|
18011
|
-
const [draggingOutline, setDraggingOutline] =
|
|
18245
|
+
const [outlines, setOutlines] = useState37([]);
|
|
18246
|
+
const [hoveredOutlineKey, setHoveredOutlineKey] = useState37(null);
|
|
18247
|
+
const [draggingOutline, setDraggingOutline] = useState37(false);
|
|
18012
18248
|
const overlayRef = useRef26(null);
|
|
18013
18249
|
const keyboardNudgeSessionRef = useRef26(null);
|
|
18014
18250
|
const saveKeyboardNudgeSessionRef = useRef26(() => {
|
|
@@ -18186,7 +18422,7 @@ var SelectedOutlineOverlay = ({ scale }) => {
|
|
|
18186
18422
|
sequences,
|
|
18187
18423
|
timelinePosition
|
|
18188
18424
|
]);
|
|
18189
|
-
|
|
18425
|
+
useEffect38(() => {
|
|
18190
18426
|
if (hoveredOutlineKey !== null && !outlineTargets.some((target) => target.key === hoveredOutlineKey)) {
|
|
18191
18427
|
setHoveredOutlineKey(null);
|
|
18192
18428
|
}
|
|
@@ -18249,10 +18485,10 @@ var SelectedOutlineOverlay = ({ scale }) => {
|
|
|
18249
18485
|
});
|
|
18250
18486
|
});
|
|
18251
18487
|
}, [clearDragOverrides, setPropStatuses]);
|
|
18252
|
-
|
|
18488
|
+
useEffect38(() => {
|
|
18253
18489
|
saveKeyboardNudgeSessionRef.current = saveKeyboardNudgeSession;
|
|
18254
18490
|
}, [saveKeyboardNudgeSession]);
|
|
18255
|
-
|
|
18491
|
+
useEffect38(() => {
|
|
18256
18492
|
return () => {
|
|
18257
18493
|
saveKeyboardNudgeSessionRef.current();
|
|
18258
18494
|
};
|
|
@@ -18387,7 +18623,7 @@ var SelectedOutlineOverlay = ({ scale }) => {
|
|
|
18387
18623
|
event.preventDefault();
|
|
18388
18624
|
saveKeyboardNudgeSession();
|
|
18389
18625
|
}, [saveKeyboardNudgeSession]);
|
|
18390
|
-
|
|
18626
|
+
useEffect38(() => {
|
|
18391
18627
|
const keyDownBindings = ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].map((key2) => keybindings.registerKeybinding({
|
|
18392
18628
|
event: "keydown",
|
|
18393
18629
|
key: key2,
|
|
@@ -18412,7 +18648,7 @@ var SelectedOutlineOverlay = ({ scale }) => {
|
|
|
18412
18648
|
}
|
|
18413
18649
|
};
|
|
18414
18650
|
}, [keybindings, onArrowKeyDown, onArrowKeyUp, saveKeyboardNudgeSession]);
|
|
18415
|
-
|
|
18651
|
+
useEffect38(() => {
|
|
18416
18652
|
if (outlineTargets.length === 0) {
|
|
18417
18653
|
setOutlines((prevOutlines) => prevOutlines.length === 0 ? prevOutlines : []);
|
|
18418
18654
|
return;
|
|
@@ -18703,7 +18939,7 @@ var PortalContainer = ({ scale, xCorrection, yCorrection, contentDimensions }) =
|
|
|
18703
18939
|
xCorrection,
|
|
18704
18940
|
yCorrection
|
|
18705
18941
|
]);
|
|
18706
|
-
|
|
18942
|
+
useEffect39(() => {
|
|
18707
18943
|
const { current } = portalContainer;
|
|
18708
18944
|
current?.appendChild(Internals30.portalNode());
|
|
18709
18945
|
return () => {
|
|
@@ -18716,7 +18952,7 @@ var PortalContainer = ({ scale, xCorrection, yCorrection, contentDimensions }) =
|
|
|
18716
18952
|
}
|
|
18717
18953
|
clearSelection();
|
|
18718
18954
|
}, [clearSelection]);
|
|
18719
|
-
|
|
18955
|
+
useEffect39(() => {
|
|
18720
18956
|
const { current } = portalContainer;
|
|
18721
18957
|
if (!current) {
|
|
18722
18958
|
return;
|
|
@@ -18869,8 +19105,8 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
18869
19105
|
const { editorShowGuides } = useContext32(EditorShowGuidesContext);
|
|
18870
19106
|
const { compositions } = useContext32(Internals31.CompositionManager);
|
|
18871
19107
|
const { previewServerState } = useContext32(StudioServerConnectionCtx);
|
|
18872
|
-
const [isAddingAsset, setIsAddingAsset] =
|
|
18873
|
-
const [assetResolution, setAssetResolution] =
|
|
19108
|
+
const [isAddingAsset, setIsAddingAsset] = useState38(false);
|
|
19109
|
+
const [assetResolution, setAssetResolution] = useState38(null);
|
|
18874
19110
|
const currentCompositionId = canvasContent.type === "composition" ? canvasContent.compositionId : null;
|
|
18875
19111
|
const currentComposition = useMemo50(() => {
|
|
18876
19112
|
if (currentCompositionId === null) {
|
|
@@ -18964,7 +19200,7 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
18964
19200
|
};
|
|
18965
19201
|
});
|
|
18966
19202
|
}, [editorZoomGestures, contentDimensions, isFit, setSize, size2]);
|
|
18967
|
-
|
|
19203
|
+
useEffect40(() => {
|
|
18968
19204
|
const { current } = canvasRef;
|
|
18969
19205
|
if (!current) {
|
|
18970
19206
|
return;
|
|
@@ -18975,7 +19211,7 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
18975
19211
|
};
|
|
18976
19212
|
}, [onWheel]);
|
|
18977
19213
|
const supportsWebKitPinch = typeof window !== "undefined" && "GestureEvent" in window;
|
|
18978
|
-
|
|
19214
|
+
useEffect40(() => {
|
|
18979
19215
|
const { current } = canvasRef;
|
|
18980
19216
|
if (!current || !editorZoomGestures || !supportsWebKitPinch) {
|
|
18981
19217
|
return;
|
|
@@ -19050,7 +19286,7 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
19050
19286
|
current.removeEventListener("gesturecancel", onGestureEnd);
|
|
19051
19287
|
};
|
|
19052
19288
|
}, [editorZoomGestures, setSize, supportsWebKitPinch]);
|
|
19053
|
-
|
|
19289
|
+
useEffect40(() => {
|
|
19054
19290
|
const { current } = canvasRef;
|
|
19055
19291
|
if (!current || !editorZoomGestures) {
|
|
19056
19292
|
return;
|
|
@@ -19184,7 +19420,7 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
19184
19420
|
};
|
|
19185
19421
|
});
|
|
19186
19422
|
}, [contentDimensions, setSize, size2]);
|
|
19187
|
-
|
|
19423
|
+
useEffect40(() => {
|
|
19188
19424
|
const resetBinding = keybindings.registerKeybinding({
|
|
19189
19425
|
event: "keydown",
|
|
19190
19426
|
key: "0",
|
|
@@ -19226,7 +19462,7 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
19226
19462
|
const metadata = await getAssetMetadata(canvasContent, canvasContent.type === "asset");
|
|
19227
19463
|
setAssetResolution(metadata);
|
|
19228
19464
|
}, [canvasContent]);
|
|
19229
|
-
|
|
19465
|
+
useEffect40(() => {
|
|
19230
19466
|
if (canvasContent.type !== "asset") {
|
|
19231
19467
|
return;
|
|
19232
19468
|
}
|
|
@@ -19237,7 +19473,7 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
19237
19473
|
file.cancel();
|
|
19238
19474
|
};
|
|
19239
19475
|
}, [canvasContent, fetchMetadata]);
|
|
19240
|
-
|
|
19476
|
+
useEffect40(() => {
|
|
19241
19477
|
fetchMetadata();
|
|
19242
19478
|
}, [fetchMetadata]);
|
|
19243
19479
|
const onDragOver = useCallback43((event) => {
|
|
@@ -19333,7 +19569,7 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
19333
19569
|
previewSize,
|
|
19334
19570
|
size2
|
|
19335
19571
|
]);
|
|
19336
|
-
|
|
19572
|
+
useEffect40(() => {
|
|
19337
19573
|
if (!canDropAssets) {
|
|
19338
19574
|
return;
|
|
19339
19575
|
}
|
|
@@ -19382,14 +19618,14 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
19382
19618
|
};
|
|
19383
19619
|
|
|
19384
19620
|
// src/components/FramePersistor.tsx
|
|
19385
|
-
import { useEffect as
|
|
19621
|
+
import { useEffect as useEffect41 } from "react";
|
|
19386
19622
|
import { Internals as Internals32, useVideoConfig as useVideoConfig2 } from "remotion";
|
|
19387
19623
|
var FramePersistor = () => {
|
|
19388
19624
|
const [playing] = Internals32.Timeline.usePlayingState();
|
|
19389
19625
|
const config = useVideoConfig2();
|
|
19390
19626
|
const frame2 = Internals32.Timeline.useTimelinePosition();
|
|
19391
19627
|
const setFrame = Internals32.useTimelineSetFrame();
|
|
19392
|
-
|
|
19628
|
+
useEffect41(() => {
|
|
19393
19629
|
if (!playing) {
|
|
19394
19630
|
setFrame((f) => {
|
|
19395
19631
|
const newObj = f[config.id] === frame2 ? f : { ...f, [config.id]: frame2 };
|
|
@@ -19489,7 +19725,7 @@ var CanvasOrLoading = ({ size: size2 }) => {
|
|
|
19489
19725
|
const { setZoom } = useContext33(TimelineZoomCtx);
|
|
19490
19726
|
const { canvasContent } = useContext33(Internals33.CompositionManager);
|
|
19491
19727
|
const { error: renderError } = useContext33(RenderErrorContext);
|
|
19492
|
-
|
|
19728
|
+
useEffect42(() => {
|
|
19493
19729
|
if (resolved?.type !== "success" && resolved?.type !== "success-and-refreshing") {
|
|
19494
19730
|
return;
|
|
19495
19731
|
}
|
|
@@ -19595,11 +19831,7 @@ var CanvasIfSizeIsAvailable = () => {
|
|
|
19595
19831
|
if (!size2) {
|
|
19596
19832
|
return null;
|
|
19597
19833
|
}
|
|
19598
|
-
return {
|
|
19599
|
-
...size2,
|
|
19600
|
-
width: size2.width - RULER_WIDTH,
|
|
19601
|
-
height: size2.height - RULER_WIDTH
|
|
19602
|
-
};
|
|
19834
|
+
return applyRulerInsetsToCanvasSize({ rulersAreVisible, size: size2 });
|
|
19603
19835
|
}, [context, rulersAreVisible]);
|
|
19604
19836
|
if (!sizeWithRulersApplied) {
|
|
19605
19837
|
return null;
|
|
@@ -19610,7 +19842,7 @@ var CanvasIfSizeIsAvailable = () => {
|
|
|
19610
19842
|
};
|
|
19611
19843
|
|
|
19612
19844
|
// src/components/CurrentCompositionSideEffects.tsx
|
|
19613
|
-
import { useCallback as useCallback44, useContext as useContext35, useEffect as
|
|
19845
|
+
import { useCallback as useCallback44, useContext as useContext35, useEffect as useEffect43 } from "react";
|
|
19614
19846
|
import { Internals as Internals35 } from "remotion";
|
|
19615
19847
|
|
|
19616
19848
|
// src/helpers/document-title.ts
|
|
@@ -19668,7 +19900,7 @@ var TitleUpdater = () => {
|
|
|
19668
19900
|
const renderQueue = useContext35(RenderQueueContext);
|
|
19669
19901
|
const { canvasContent } = useContext35(Internals35.CompositionManager);
|
|
19670
19902
|
const { jobs } = renderQueue;
|
|
19671
|
-
|
|
19903
|
+
useEffect43(() => {
|
|
19672
19904
|
if (!canvasContent) {
|
|
19673
19905
|
setCurrentCanvasContentId(null);
|
|
19674
19906
|
return;
|
|
@@ -19687,7 +19919,7 @@ var TitleUpdater = () => {
|
|
|
19687
19919
|
}
|
|
19688
19920
|
setCurrentCanvasContentId(canvasContent.asset);
|
|
19689
19921
|
}, [canvasContent]);
|
|
19690
|
-
|
|
19922
|
+
useEffect43(() => {
|
|
19691
19923
|
setRenderJobs(jobs);
|
|
19692
19924
|
}, [jobs]);
|
|
19693
19925
|
return null;
|
|
@@ -19707,7 +19939,7 @@ var CurrentCompositionKeybindings = ({ readOnlyStudio }) => {
|
|
|
19707
19939
|
const renderButton = document.getElementById("render-modal-button");
|
|
19708
19940
|
renderButton.click();
|
|
19709
19941
|
}, [readOnlyStudio, type, video]);
|
|
19710
|
-
|
|
19942
|
+
useEffect43(() => {
|
|
19711
19943
|
const binding = keybindings.registerKeybinding({
|
|
19712
19944
|
event: "keydown",
|
|
19713
19945
|
key: "r",
|
|
@@ -19725,14 +19957,14 @@ var CurrentCompositionKeybindings = ({ readOnlyStudio }) => {
|
|
|
19725
19957
|
};
|
|
19726
19958
|
|
|
19727
19959
|
// src/components/ExplorerPanel.tsx
|
|
19728
|
-
import { useCallback as useCallback55, useImperativeHandle as useImperativeHandle10, useState as
|
|
19960
|
+
import { useCallback as useCallback55, useImperativeHandle as useImperativeHandle10, useState as useState45 } from "react";
|
|
19729
19961
|
|
|
19730
19962
|
// src/components/AssetSelector.tsx
|
|
19731
|
-
import { useCallback as useCallback47, useContext as useContext38, useMemo as useMemo55, useState as
|
|
19963
|
+
import { useCallback as useCallback47, useContext as useContext38, useMemo as useMemo55, useState as useState41 } from "react";
|
|
19732
19964
|
import { Internals as Internals38 } from "remotion";
|
|
19733
19965
|
|
|
19734
19966
|
// src/helpers/use-asset-drag-events.ts
|
|
19735
|
-
import { useCallback as useCallback45, useEffect as
|
|
19967
|
+
import { useCallback as useCallback45, useEffect as useEffect44, useMemo as useMemo52, useRef as useRef29 } from "react";
|
|
19736
19968
|
import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
|
|
19737
19969
|
var isFileDragEvent2 = (event) => {
|
|
19738
19970
|
return Array.from(event.dataTransfer.types).includes("Files");
|
|
@@ -19768,7 +20000,7 @@ function useAssetDragEvents({
|
|
|
19768
20000
|
setDropLocation((currentPath) => currentPath === combinedParents ? parentFolder : currentPath);
|
|
19769
20001
|
}
|
|
19770
20002
|
}, [combinedParents, dragDepthRef, parentFolder, setDropLocation]);
|
|
19771
|
-
|
|
20003
|
+
useEffect44(() => {
|
|
19772
20004
|
if (dropLocation === null) {
|
|
19773
20005
|
dragDepthRef.current = 0;
|
|
19774
20006
|
}
|
|
@@ -19786,10 +20018,10 @@ import { ASSET_DRAG_MIME_TYPE as ASSET_DRAG_MIME_TYPE3, makeAssetDragData } from
|
|
|
19786
20018
|
import {
|
|
19787
20019
|
useCallback as useCallback46,
|
|
19788
20020
|
useContext as useContext36,
|
|
19789
|
-
useLayoutEffect as
|
|
20021
|
+
useLayoutEffect as useLayoutEffect3,
|
|
19790
20022
|
useMemo as useMemo53,
|
|
19791
20023
|
useRef as useRef30,
|
|
19792
|
-
useState as
|
|
20024
|
+
useState as useState39
|
|
19793
20025
|
} from "react";
|
|
19794
20026
|
import { Internals as Internals36 } from "remotion";
|
|
19795
20027
|
import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
|
|
@@ -20266,7 +20498,7 @@ var AssetFolderItem = ({
|
|
|
20266
20498
|
setDropLocation,
|
|
20267
20499
|
readOnlyStudio
|
|
20268
20500
|
}) => {
|
|
20269
|
-
const [hovered, setHovered] =
|
|
20501
|
+
const [hovered, setHovered] = useState39(false);
|
|
20270
20502
|
const openFolderTimerRef = useRef30(null);
|
|
20271
20503
|
const { isDropDiv, onDragEnter, onDragLeave } = use_asset_drag_events_default({
|
|
20272
20504
|
name: item.name,
|
|
@@ -20401,8 +20633,8 @@ var AssetFolderTree = ({
|
|
|
20401
20633
|
};
|
|
20402
20634
|
var AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio }) => {
|
|
20403
20635
|
const isMobileLayout = useMobileLayout();
|
|
20404
|
-
const [hovered, setHovered] =
|
|
20405
|
-
const [isDragging, setIsDragging] =
|
|
20636
|
+
const [hovered, setHovered] = useState39(false);
|
|
20637
|
+
const [isDragging, setIsDragging] = useState39(false);
|
|
20406
20638
|
const { setSidebarCollapsedState } = useContext36(SidebarContext);
|
|
20407
20639
|
const { setSelectedModal } = useContext36(ModalsContext);
|
|
20408
20640
|
const confirm = useConfirmationDialog();
|
|
@@ -20428,7 +20660,7 @@ var AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio }
|
|
|
20428
20660
|
setHovered(false);
|
|
20429
20661
|
}, []);
|
|
20430
20662
|
const rowRef = useRef30(null);
|
|
20431
|
-
|
|
20663
|
+
useLayoutEffect3(() => {
|
|
20432
20664
|
maybeScrollAssetSidebarRowIntoView({
|
|
20433
20665
|
element: rowRef.current,
|
|
20434
20666
|
assetPath: relativePath,
|
|
@@ -20707,7 +20939,7 @@ var formatMediaDuration = (seconds) => {
|
|
|
20707
20939
|
// src/helpers/use-media-metadata.ts
|
|
20708
20940
|
import { getVideoMetadata as getVideoMetadata3 } from "@remotion/media-utils";
|
|
20709
20941
|
import { ALL_FORMATS, Input, UrlSource } from "mediabunny";
|
|
20710
|
-
import { useEffect as
|
|
20942
|
+
import { useEffect as useEffect45, useState as useState40 } from "react";
|
|
20711
20943
|
|
|
20712
20944
|
// src/helpers/get-duration-or-compute.ts
|
|
20713
20945
|
var getDurationOrCompute = async (input) => {
|
|
@@ -20802,8 +21034,8 @@ var getMediaMetadata = (src) => {
|
|
|
20802
21034
|
return request;
|
|
20803
21035
|
};
|
|
20804
21036
|
var useMediaMetadata = (src) => {
|
|
20805
|
-
const [mediaMetadata, setMediaMetadata] =
|
|
20806
|
-
|
|
21037
|
+
const [mediaMetadata, setMediaMetadata] = useState40(src ? cache.get(src) ?? null : null);
|
|
21038
|
+
useEffect45(() => {
|
|
20807
21039
|
const cached = src ? cache.get(src) ?? null : null;
|
|
20808
21040
|
setMediaMetadata(cached);
|
|
20809
21041
|
if (!src || cached) {
|
|
@@ -20950,7 +21182,7 @@ var AssetSelector = ({ readOnlyStudio }) => {
|
|
|
20950
21182
|
const { tabIndex } = useZIndex();
|
|
20951
21183
|
const { canvasContent } = useContext38(Internals38.CompositionManager);
|
|
20952
21184
|
const { assetFoldersExpanded, setAssetFoldersExpanded } = useContext38(FolderContext);
|
|
20953
|
-
const [dropLocation, setDropLocation] =
|
|
21185
|
+
const [dropLocation, setDropLocation] = useState41(null);
|
|
20954
21186
|
const connectionStatus = useContext38(StudioServerConnectionCtx).previewServerState.type;
|
|
20955
21187
|
const shouldAllowUpload = connectionStatus === "connected" && !readOnlyStudio;
|
|
20956
21188
|
const showCurrentAsset = canvasContent?.type === "asset";
|
|
@@ -21094,10 +21326,10 @@ import { Internals as Internals41 } from "remotion";
|
|
|
21094
21326
|
import {
|
|
21095
21327
|
useCallback as useCallback51,
|
|
21096
21328
|
useContext as useContext41,
|
|
21097
|
-
useLayoutEffect as
|
|
21329
|
+
useLayoutEffect as useLayoutEffect4,
|
|
21098
21330
|
useMemo as useMemo59,
|
|
21099
21331
|
useRef as useRef32,
|
|
21100
|
-
useState as
|
|
21332
|
+
useState as useState43
|
|
21101
21333
|
} from "react";
|
|
21102
21334
|
|
|
21103
21335
|
// src/helpers/is-composition-still.ts
|
|
@@ -21153,7 +21385,7 @@ var EllipsisIcon = (props) => {
|
|
|
21153
21385
|
|
|
21154
21386
|
// src/components/InlineDropdown.tsx
|
|
21155
21387
|
import { PlayerInternals as PlayerInternals11 } from "@remotion/player";
|
|
21156
|
-
import { useCallback as useCallback48, useMemo as useMemo56, useRef as useRef31, useState as
|
|
21388
|
+
import { useCallback as useCallback48, useMemo as useMemo56, useRef as useRef31, useState as useState42 } from "react";
|
|
21157
21389
|
import ReactDOM5 from "react-dom";
|
|
21158
21390
|
import { jsx as jsx97, jsxs as jsxs45, Fragment as Fragment20 } from "react/jsx-runtime";
|
|
21159
21391
|
var InlineDropdown = ({
|
|
@@ -21161,7 +21393,7 @@ var InlineDropdown = ({
|
|
|
21161
21393
|
...props
|
|
21162
21394
|
}) => {
|
|
21163
21395
|
const ref2 = useRef31(null);
|
|
21164
|
-
const [opened, setOpened] =
|
|
21396
|
+
const [opened, setOpened] = useState42({ type: "not-open" });
|
|
21165
21397
|
const { currentZIndex } = useZIndex();
|
|
21166
21398
|
const size2 = PlayerInternals11.useElementSize(ref2, {
|
|
21167
21399
|
triggerOnWindowResize: true,
|
|
@@ -21593,7 +21825,7 @@ var CompositionSelectorItem = ({
|
|
|
21593
21825
|
}
|
|
21594
21826
|
return false;
|
|
21595
21827
|
}, [item, currentComposition]);
|
|
21596
|
-
const [hovered, setHovered] =
|
|
21828
|
+
const [hovered, setHovered] = useState43(false);
|
|
21597
21829
|
const onPointerEnter = useCallback51(() => {
|
|
21598
21830
|
setHovered(true);
|
|
21599
21831
|
}, []);
|
|
@@ -21602,7 +21834,7 @@ var CompositionSelectorItem = ({
|
|
|
21602
21834
|
}, []);
|
|
21603
21835
|
const compositionRowRef = useRef32(null);
|
|
21604
21836
|
const compositionId = item.type === "composition" ? item.composition.id : null;
|
|
21605
|
-
|
|
21837
|
+
useLayoutEffect4(() => {
|
|
21606
21838
|
if (compositionId === null) {
|
|
21607
21839
|
return;
|
|
21608
21840
|
}
|
|
@@ -22064,7 +22296,7 @@ var CompSelectorRef = ({ children }) => {
|
|
|
22064
22296
|
};
|
|
22065
22297
|
|
|
22066
22298
|
// src/components/Tabs/index.tsx
|
|
22067
|
-
import { useCallback as useCallback54, useMemo as useMemo62, useState as
|
|
22299
|
+
import { useCallback as useCallback54, useMemo as useMemo62, useState as useState44 } from "react";
|
|
22068
22300
|
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
22069
22301
|
var tabsContainer = {
|
|
22070
22302
|
display: "flex",
|
|
@@ -22098,7 +22330,7 @@ var selectorButton = {
|
|
|
22098
22330
|
WebkitUserSelect: "none"
|
|
22099
22331
|
};
|
|
22100
22332
|
var Tab = ({ children, onClick, style: style5, selected }) => {
|
|
22101
|
-
const [hovered, setHovered] =
|
|
22333
|
+
const [hovered, setHovered] = useState44(false);
|
|
22102
22334
|
const { tabIndex } = useZIndex();
|
|
22103
22335
|
const onPointerEnter = useCallback54(() => {
|
|
22104
22336
|
setHovered(true);
|
|
@@ -22150,7 +22382,7 @@ var persistSelectedOptionsSidebarPanel = (panel2) => {
|
|
|
22150
22382
|
localStorage.setItem(localStorageKey, panel2);
|
|
22151
22383
|
};
|
|
22152
22384
|
var ExplorerPanel = ({ readOnlyStudio }) => {
|
|
22153
|
-
const [panel2, setPanel] =
|
|
22385
|
+
const [panel2, setPanel] = useState45(() => getSelectedPanel());
|
|
22154
22386
|
const onCompositionsSelected = useCallback55(() => {
|
|
22155
22387
|
setPanel("compositions");
|
|
22156
22388
|
persistSelectedOptionsSidebarPanel("compositions");
|
|
@@ -22252,9 +22484,9 @@ function MobilePanel({
|
|
|
22252
22484
|
import React75, {
|
|
22253
22485
|
useCallback as useCallback56,
|
|
22254
22486
|
useContext as useContext44,
|
|
22255
|
-
useEffect as
|
|
22487
|
+
useEffect as useEffect46,
|
|
22256
22488
|
useMemo as useMemo63,
|
|
22257
|
-
useState as
|
|
22489
|
+
useState as useState46
|
|
22258
22490
|
} from "react";
|
|
22259
22491
|
import { Internals as Internals43 } from "remotion";
|
|
22260
22492
|
import { NoReactInternals as NoReactInternals16 } from "remotion/no-react";
|
|
@@ -22263,7 +22495,7 @@ var ObserveDefaultPropsContext = React75.createContext(null);
|
|
|
22263
22495
|
var ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
|
|
22264
22496
|
const { previewServerState, subscribeToEvent } = useContext44(StudioServerConnectionCtx);
|
|
22265
22497
|
const { updateProps } = useContext44(Internals43.EditorPropsContext);
|
|
22266
|
-
const [canSaveDefaultPropsObjectState, setCanSaveDefaultProps] =
|
|
22498
|
+
const [canSaveDefaultPropsObjectState, setCanSaveDefaultProps] = useState46({});
|
|
22267
22499
|
const canSaveDefaultProps = useMemo63(() => {
|
|
22268
22500
|
if (compositionId === null) {
|
|
22269
22501
|
return null;
|
|
@@ -22294,7 +22526,7 @@ var ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
|
|
|
22294
22526
|
}));
|
|
22295
22527
|
}
|
|
22296
22528
|
}, [updateProps]);
|
|
22297
|
-
|
|
22529
|
+
useEffect46(() => {
|
|
22298
22530
|
if (readOnlyStudio || !clientId || compositionId === null) {
|
|
22299
22531
|
return;
|
|
22300
22532
|
}
|
|
@@ -22313,7 +22545,7 @@ var ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
|
|
|
22313
22545
|
}).catch(() => {});
|
|
22314
22546
|
};
|
|
22315
22547
|
}, [readOnlyStudio, clientId, compositionId, applyResult]);
|
|
22316
|
-
|
|
22548
|
+
useEffect46(() => {
|
|
22317
22549
|
const unsub = subscribeToEvent("default-props-updatable-changed", (e) => {
|
|
22318
22550
|
if (e.type !== "default-props-updatable-changed") {
|
|
22319
22551
|
return;
|
|
@@ -22341,7 +22573,7 @@ import {
|
|
|
22341
22573
|
useContext as useContext62,
|
|
22342
22574
|
useImperativeHandle as useImperativeHandle12,
|
|
22343
22575
|
useMemo as useMemo109,
|
|
22344
|
-
useState as
|
|
22576
|
+
useState as useState64
|
|
22345
22577
|
} from "react";
|
|
22346
22578
|
import { Internals as Internals47 } from "remotion";
|
|
22347
22579
|
|
|
@@ -22350,11 +22582,11 @@ import {
|
|
|
22350
22582
|
createContext as createContext20,
|
|
22351
22583
|
createRef as createRef9,
|
|
22352
22584
|
useCallback as useCallback57,
|
|
22353
|
-
useEffect as
|
|
22585
|
+
useEffect as useEffect48,
|
|
22354
22586
|
useImperativeHandle as useImperativeHandle11,
|
|
22355
22587
|
useMemo as useMemo65,
|
|
22356
22588
|
useRef as useRef33,
|
|
22357
|
-
useState as
|
|
22589
|
+
useState as useState48
|
|
22358
22590
|
} from "react";
|
|
22359
22591
|
import { useRemotionEnvironment as useRemotionEnvironment2 } from "remotion";
|
|
22360
22592
|
|
|
@@ -22377,9 +22609,9 @@ function getZodSchemaFromPrimitive(value, z) {
|
|
|
22377
22609
|
import {
|
|
22378
22610
|
createContext as createContext19,
|
|
22379
22611
|
useContext as useContext45,
|
|
22380
|
-
useEffect as
|
|
22612
|
+
useEffect as useEffect47,
|
|
22381
22613
|
useMemo as useMemo64,
|
|
22382
|
-
useState as
|
|
22614
|
+
useState as useState47
|
|
22383
22615
|
} from "react";
|
|
22384
22616
|
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
22385
22617
|
async function getZodIfPossible() {
|
|
@@ -22416,16 +22648,16 @@ var useZodTypesIfPossible = () => {
|
|
|
22416
22648
|
};
|
|
22417
22649
|
var ZodContext = createContext19(null);
|
|
22418
22650
|
var ZodProvider = ({ children }) => {
|
|
22419
|
-
const [zod, setZod] =
|
|
22420
|
-
const [zodV3, setZodV3] =
|
|
22421
|
-
const [zodTypes, setZodTypes] =
|
|
22422
|
-
|
|
22651
|
+
const [zod, setZod] = useState47(null);
|
|
22652
|
+
const [zodV3, setZodV3] = useState47(null);
|
|
22653
|
+
const [zodTypes, setZodTypes] = useState47(null);
|
|
22654
|
+
useEffect47(() => {
|
|
22423
22655
|
getZodIfPossible().then((z) => setZod(z));
|
|
22424
22656
|
}, []);
|
|
22425
|
-
|
|
22657
|
+
useEffect47(() => {
|
|
22426
22658
|
getZodV3IfPossible().then((z) => setZodV3(z));
|
|
22427
22659
|
}, []);
|
|
22428
|
-
|
|
22660
|
+
useEffect47(() => {
|
|
22429
22661
|
getZTypesIfPossible().then((z) => setZodTypes(z));
|
|
22430
22662
|
}, []);
|
|
22431
22663
|
const contextValue = useMemo64(() => {
|
|
@@ -22494,7 +22726,7 @@ var SetVisualControlsContext = createContext20({
|
|
|
22494
22726
|
});
|
|
22495
22727
|
var VisualControlsProvider = ({ children }) => {
|
|
22496
22728
|
const imperativeHandles = useRef33({});
|
|
22497
|
-
const [handles, setHandles] =
|
|
22729
|
+
const [handles, setHandles] = useState48({});
|
|
22498
22730
|
const state = useMemo65(() => {
|
|
22499
22731
|
return {
|
|
22500
22732
|
handles
|
|
@@ -22563,7 +22795,7 @@ var VisualControlsProvider = ({ children }) => {
|
|
|
22563
22795
|
globalVisualControl: visualControl
|
|
22564
22796
|
};
|
|
22565
22797
|
}, [visualControl]);
|
|
22566
|
-
|
|
22798
|
+
useEffect48(() => {
|
|
22567
22799
|
const callback = () => {
|
|
22568
22800
|
if (imperativeHandles.current) {
|
|
22569
22801
|
updateHandles();
|
|
@@ -22599,7 +22831,7 @@ var VisualControlsProvider = ({ children }) => {
|
|
|
22599
22831
|
import { useContext as useContext49 } from "react";
|
|
22600
22832
|
|
|
22601
22833
|
// src/components/RenderModal/DataEditor.tsx
|
|
22602
|
-
import React109, { useCallback as useCallback86, useContext as useContext48, useMemo as useMemo98, useState as
|
|
22834
|
+
import React109, { useCallback as useCallback86, useContext as useContext48, useMemo as useMemo98, useState as useState59 } from "react";
|
|
22603
22835
|
import { getInputProps } from "remotion";
|
|
22604
22836
|
import { NoReactInternals as NoReactInternals20 } from "remotion/no-react";
|
|
22605
22837
|
|
|
@@ -22665,7 +22897,7 @@ var ValidationMessage = ({ message, align, type, action }) => {
|
|
|
22665
22897
|
};
|
|
22666
22898
|
|
|
22667
22899
|
// src/components/SegmentedControl.tsx
|
|
22668
|
-
import { useCallback as useCallback58, useMemo as useMemo67, useState as
|
|
22900
|
+
import { useCallback as useCallback58, useMemo as useMemo67, useState as useState49 } from "react";
|
|
22669
22901
|
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
22670
22902
|
var container26 = {
|
|
22671
22903
|
display: "flex",
|
|
@@ -22714,7 +22946,7 @@ var SegmentedControl = ({ items, needsWrapping }) => {
|
|
|
22714
22946
|
});
|
|
22715
22947
|
};
|
|
22716
22948
|
var Item = ({ selected, onClick, children }) => {
|
|
22717
|
-
const [hovered, setHovered] =
|
|
22949
|
+
const [hovered, setHovered] = useState49(false);
|
|
22718
22950
|
const { tabIndex } = useZIndex();
|
|
22719
22951
|
const onPointerEnter = useCallback58(() => {
|
|
22720
22952
|
setHovered(true);
|
|
@@ -22822,7 +23054,7 @@ var getRenderModalWarnings = ({
|
|
|
22822
23054
|
};
|
|
22823
23055
|
|
|
22824
23056
|
// src/components/RenderModal/RenderModalJSONPropsEditor.tsx
|
|
22825
|
-
import React81, { useCallback as useCallback59, useEffect as
|
|
23057
|
+
import React81, { useCallback as useCallback59, useEffect as useEffect49, useMemo as useMemo69 } from "react";
|
|
22826
23058
|
import { useContext as useContext46 } from "react";
|
|
22827
23059
|
import { NoReactInternals as NoReactInternals18 } from "remotion/no-react";
|
|
22828
23060
|
|
|
@@ -23155,7 +23387,7 @@ var RenderModalJSONPropsEditor = ({
|
|
|
23155
23387
|
const [localValue, setLocalValue] = React81.useState(() => {
|
|
23156
23388
|
return parseJSON(serializedJSON.serializedString, schema);
|
|
23157
23389
|
});
|
|
23158
|
-
|
|
23390
|
+
useEffect49(() => {
|
|
23159
23391
|
const unsub = subscribeToEvent("default-props-updatable-changed", (e) => {
|
|
23160
23392
|
if (e.type !== "default-props-updatable-changed") {
|
|
23161
23393
|
return;
|
|
@@ -23174,7 +23406,7 @@ var RenderModalJSONPropsEditor = ({
|
|
|
23174
23406
|
unsub();
|
|
23175
23407
|
};
|
|
23176
23408
|
}, [subscribeToEvent, compositionId, schema]);
|
|
23177
|
-
|
|
23409
|
+
useEffect49(() => {
|
|
23178
23410
|
setLocalValue((prev) => {
|
|
23179
23411
|
if (prev.validJSON && deepEqual(value, prev.value)) {
|
|
23180
23412
|
return prev;
|
|
@@ -23207,7 +23439,7 @@ var RenderModalJSONPropsEditor = ({
|
|
|
23207
23439
|
onSave();
|
|
23208
23440
|
}
|
|
23209
23441
|
}, [hasChanged, hasError, onSave]);
|
|
23210
|
-
|
|
23442
|
+
useEffect49(() => {
|
|
23211
23443
|
setLocalValue((v) => parseJSON(v.str, schema));
|
|
23212
23444
|
}, [schema]);
|
|
23213
23445
|
const reset = useCallback59(() => {
|
|
@@ -23656,7 +23888,7 @@ var Fieldset = ({ children, shouldPad }) => {
|
|
|
23656
23888
|
};
|
|
23657
23889
|
|
|
23658
23890
|
// src/components/RenderModal/SchemaEditor/SchemaLabel.tsx
|
|
23659
|
-
import { useCallback as useCallback61, useMemo as useMemo71, useState as
|
|
23891
|
+
import { useCallback as useCallback61, useMemo as useMemo71, useState as useState50 } from "react";
|
|
23660
23892
|
|
|
23661
23893
|
// src/components/RenderModal/InlineRemoveButton.tsx
|
|
23662
23894
|
import { useCallback as useCallback60 } from "react";
|
|
@@ -23708,7 +23940,7 @@ var compactStyles = {
|
|
|
23708
23940
|
flex: 1
|
|
23709
23941
|
};
|
|
23710
23942
|
var SchemaLabel = ({ jsonPath, onRemove, valid, suffix: suffix2, handleClick }) => {
|
|
23711
|
-
const [clickableButtonHovered, setClickableButtonHovered] =
|
|
23943
|
+
const [clickableButtonHovered, setClickableButtonHovered] = useState50(false);
|
|
23712
23944
|
const labelStyle4 = useMemo71(() => {
|
|
23713
23945
|
return {
|
|
23714
23946
|
fontFamily: "monospace",
|
|
@@ -23754,7 +23986,7 @@ var SchemaLabel = ({ jsonPath, onRemove, valid, suffix: suffix2, handleClick })
|
|
|
23754
23986
|
|
|
23755
23987
|
// src/components/RenderModal/SchemaEditor/ZodObjectEditor.tsx
|
|
23756
23988
|
import { useCallback as useCallback84 } from "react";
|
|
23757
|
-
import React107, { useMemo as useMemo95, useState as
|
|
23989
|
+
import React107, { useMemo as useMemo95, useState as useState58 } from "react";
|
|
23758
23990
|
|
|
23759
23991
|
// src/components/RenderModal/layout.ts
|
|
23760
23992
|
var optionRow = {
|
|
@@ -23800,7 +24032,7 @@ var fieldsetLabel = {
|
|
|
23800
24032
|
};
|
|
23801
24033
|
|
|
23802
24034
|
// src/components/RenderModal/SchemaEditor/SchemaSeparationLine.tsx
|
|
23803
|
-
import { useCallback as useCallback62, useMemo as useMemo72, useState as
|
|
24035
|
+
import { useCallback as useCallback62, useMemo as useMemo72, useState as useState51 } from "react";
|
|
23804
24036
|
|
|
23805
24037
|
// src/icons/plus.tsx
|
|
23806
24038
|
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
@@ -23835,8 +24067,8 @@ var arraySeparationLine = {
|
|
|
23835
24067
|
flexBasis: "100%"
|
|
23836
24068
|
};
|
|
23837
24069
|
var SchemaArrayItemSeparationLine = ({ onChange, index, schema, isLast, showAddButton }) => {
|
|
23838
|
-
const [outerHovered, setOuterHovered] =
|
|
23839
|
-
const [innerHovered, setInnerHovered] =
|
|
24070
|
+
const [outerHovered, setOuterHovered] = useState51(false);
|
|
24071
|
+
const [innerHovered, setInnerHovered] = useState51(false);
|
|
23840
24072
|
const zodTypes = useZodTypesIfPossible();
|
|
23841
24073
|
const z = useZodIfPossible();
|
|
23842
24074
|
if (!z) {
|
|
@@ -23976,7 +24208,7 @@ var SchemaVerticalGuide = ({ isRoot, children }) => {
|
|
|
23976
24208
|
};
|
|
23977
24209
|
|
|
23978
24210
|
// src/components/RenderModal/SchemaEditor/ZodArrayEditor.tsx
|
|
23979
|
-
import React89, { useCallback as useCallback65, useMemo as useMemo77, useState as
|
|
24211
|
+
import React89, { useCallback as useCallback65, useMemo as useMemo77, useState as useState53 } from "react";
|
|
23980
24212
|
|
|
23981
24213
|
// src/components/RenderModal/SchemaEditor/ZodArrayItemEditor.tsx
|
|
23982
24214
|
import { useCallback as useCallback63, useMemo as useMemo74 } from "react";
|
|
@@ -24013,7 +24245,7 @@ var ZodArrayItemEditor = ({ elementSchema, onChange, jsonPath, index, value, may
|
|
|
24013
24245
|
|
|
24014
24246
|
// src/components/RenderModal/InfoBubble.tsx
|
|
24015
24247
|
import { PlayerInternals as PlayerInternals12 } from "@remotion/player";
|
|
24016
|
-
import { useCallback as useCallback64, useEffect as
|
|
24248
|
+
import { useCallback as useCallback64, useEffect as useEffect50, useMemo as useMemo76, useRef as useRef34, useState as useState52 } from "react";
|
|
24017
24249
|
import ReactDOM7 from "react-dom";
|
|
24018
24250
|
|
|
24019
24251
|
// src/components/RenderModal/InfoTooltip.tsx
|
|
@@ -24096,8 +24328,8 @@ var container27 = {
|
|
|
24096
24328
|
verticalAlign: "text-bottom"
|
|
24097
24329
|
};
|
|
24098
24330
|
var InfoBubble = ({ title: title4, children }) => {
|
|
24099
|
-
const [hovered, setIsHovered] =
|
|
24100
|
-
const [opened, setOpened] =
|
|
24331
|
+
const [hovered, setIsHovered] = useState52(false);
|
|
24332
|
+
const [opened, setOpened] = useState52(false);
|
|
24101
24333
|
const ref2 = useRef34(null);
|
|
24102
24334
|
const { tabIndex, currentZIndex } = useZIndex();
|
|
24103
24335
|
const size2 = PlayerInternals12.useElementSize(ref2, {
|
|
@@ -24108,7 +24340,7 @@ var InfoBubble = ({ title: title4, children }) => {
|
|
|
24108
24340
|
const onHide = useCallback64(() => {
|
|
24109
24341
|
setOpened(false);
|
|
24110
24342
|
}, []);
|
|
24111
|
-
|
|
24343
|
+
useEffect50(() => {
|
|
24112
24344
|
const { current } = ref2;
|
|
24113
24345
|
if (!current) {
|
|
24114
24346
|
return;
|
|
@@ -24284,7 +24516,7 @@ var ZodArrayEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad }) =
|
|
|
24284
24516
|
const onChange = useCallback65((updater, { shouldSave }) => {
|
|
24285
24517
|
setValue(updater, { shouldSave });
|
|
24286
24518
|
}, [setValue]);
|
|
24287
|
-
const [expanded, setExpanded] =
|
|
24519
|
+
const [expanded, setExpanded] = useState53(true);
|
|
24288
24520
|
const arrayElement = getArrayElement(schema);
|
|
24289
24521
|
const suffix2 = useMemo77(() => {
|
|
24290
24522
|
return expanded ? " [" : " [...] ";
|
|
@@ -24356,7 +24588,7 @@ var ZodArrayEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad }) =
|
|
|
24356
24588
|
import { useCallback as useCallback66 } from "react";
|
|
24357
24589
|
|
|
24358
24590
|
// src/components/Checkbox.tsx
|
|
24359
|
-
import { useEffect as
|
|
24591
|
+
import { useEffect as useEffect51, useMemo as useMemo78, useRef as useRef35 } from "react";
|
|
24360
24592
|
import { jsx as jsx127, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
24361
24593
|
var SIZES = {
|
|
24362
24594
|
default: 20,
|
|
@@ -24411,7 +24643,7 @@ var Checkbox = ({ checked, onChange, disabled, name, rounded, variant = "default
|
|
|
24411
24643
|
margin: 0
|
|
24412
24644
|
};
|
|
24413
24645
|
}, [disabled, size2]);
|
|
24414
|
-
|
|
24646
|
+
useEffect51(() => {
|
|
24415
24647
|
if (ref2.current) {
|
|
24416
24648
|
ref2.current.style.setProperty("border-radius", rounded ? "50%" : "0%", "important");
|
|
24417
24649
|
}
|
|
@@ -24477,7 +24709,7 @@ import { useCallback as useCallback72, useMemo as useMemo84 } from "react";
|
|
|
24477
24709
|
|
|
24478
24710
|
// src/components/ColorPicker/ColorPicker.tsx
|
|
24479
24711
|
import { PlayerInternals as PlayerInternals13 } from "@remotion/player";
|
|
24480
|
-
import { useCallback as useCallback71, useEffect as
|
|
24712
|
+
import { useCallback as useCallback71, useEffect as useEffect53, useMemo as useMemo83, useRef as useRef40, useState as useState55 } from "react";
|
|
24481
24713
|
import ReactDOM8 from "react-dom";
|
|
24482
24714
|
|
|
24483
24715
|
// src/components/ColorPicker/checker.ts
|
|
@@ -24487,7 +24719,7 @@ var CHECKER_BACKGROUND_POSITION = "0 0, 0 4px, 4px -4px, -4px 0";
|
|
|
24487
24719
|
var CHECKER_BACKGROUND_COLOR = "#444";
|
|
24488
24720
|
|
|
24489
24721
|
// src/components/ColorPicker/ColorPickerPopup.tsx
|
|
24490
|
-
import { useCallback as useCallback70, useEffect as
|
|
24722
|
+
import { useCallback as useCallback70, useEffect as useEffect52, useMemo as useMemo82, useRef as useRef39, useState as useState54 } from "react";
|
|
24491
24723
|
|
|
24492
24724
|
// src/helpers/color-conversion.ts
|
|
24493
24725
|
import { NoReactInternals as NoReactInternals19 } from "remotion/no-react";
|
|
@@ -24977,9 +25209,9 @@ var ChannelInput = ({
|
|
|
24977
25209
|
max,
|
|
24978
25210
|
onCommit
|
|
24979
25211
|
}) => {
|
|
24980
|
-
const [draft, setDraft] =
|
|
25212
|
+
const [draft, setDraft] = useState54(String(Math.round(value)));
|
|
24981
25213
|
const { tabIndex } = useZIndex();
|
|
24982
|
-
|
|
25214
|
+
useEffect52(() => {
|
|
24983
25215
|
setDraft(String(Math.round(value)));
|
|
24984
25216
|
}, [value]);
|
|
24985
25217
|
const onChange = useCallback70((e) => {
|
|
@@ -25021,9 +25253,9 @@ var ChannelInput = ({
|
|
|
25021
25253
|
});
|
|
25022
25254
|
};
|
|
25023
25255
|
var HexInput = ({ value, onCommit }) => {
|
|
25024
|
-
const [draft, setDraft] =
|
|
25256
|
+
const [draft, setDraft] = useState54(value);
|
|
25025
25257
|
const { tabIndex } = useZIndex();
|
|
25026
|
-
|
|
25258
|
+
useEffect52(() => {
|
|
25027
25259
|
setDraft(value);
|
|
25028
25260
|
}, [value]);
|
|
25029
25261
|
const onChange = useCallback70((e) => {
|
|
@@ -25071,9 +25303,9 @@ var HexInput = ({ value, onCommit }) => {
|
|
|
25071
25303
|
};
|
|
25072
25304
|
var ColorPickerPopup = ({ value, onChange, onChangeComplete }) => {
|
|
25073
25305
|
const { tabIndex } = useZIndex();
|
|
25074
|
-
const [hsva, setHsva] =
|
|
25306
|
+
const [hsva, setHsva] = useState54(() => rgbaToHsva(parseAnyColor(value)));
|
|
25075
25307
|
const lastEmittedRef = useRef39(formatRgba(parseAnyColor(value)));
|
|
25076
|
-
|
|
25308
|
+
useEffect52(() => {
|
|
25077
25309
|
const incoming = formatRgba(parseAnyColor(value));
|
|
25078
25310
|
if (incoming === lastEmittedRef.current) {
|
|
25079
25311
|
return;
|
|
@@ -25287,7 +25519,7 @@ var ColorPicker = ({
|
|
|
25287
25519
|
className: className2,
|
|
25288
25520
|
style: customStyle
|
|
25289
25521
|
}) => {
|
|
25290
|
-
const [opened, setOpened] =
|
|
25522
|
+
const [opened, setOpened] = useState55(false);
|
|
25291
25523
|
const triggerRef = useRef40(null);
|
|
25292
25524
|
const { tabIndex, currentZIndex } = useZIndex();
|
|
25293
25525
|
const size2 = PlayerInternals13.useElementSize(triggerRef, {
|
|
@@ -25370,7 +25602,7 @@ var ColorPicker = ({
|
|
|
25370
25602
|
boxShadow: "none"
|
|
25371
25603
|
};
|
|
25372
25604
|
}, [opened, size2]);
|
|
25373
|
-
|
|
25605
|
+
useEffect53(() => {
|
|
25374
25606
|
if (!opened) {
|
|
25375
25607
|
return;
|
|
25376
25608
|
}
|
|
@@ -25673,7 +25905,7 @@ var ZodEnumEditor = ({ schema, jsonPath, setValue, value, onRemove }) => {
|
|
|
25673
25905
|
};
|
|
25674
25906
|
|
|
25675
25907
|
// src/components/RenderModal/SchemaEditor/ZodMatrixEditor.tsx
|
|
25676
|
-
import React101, { useMemo as useMemo88, useState as
|
|
25908
|
+
import React101, { useMemo as useMemo88, useState as useState56 } from "react";
|
|
25677
25909
|
import { useCallback as useCallback76 } from "react";
|
|
25678
25910
|
import { jsx as jsx140, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
25679
25911
|
var rowStyle = {
|
|
@@ -25686,7 +25918,7 @@ var ZodMatrixEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad })
|
|
|
25686
25918
|
setValue(updater, { shouldSave });
|
|
25687
25919
|
}, [setValue]);
|
|
25688
25920
|
const zodValidation = useMemo88(() => zodSafeParse(schema, value), [schema, value]);
|
|
25689
|
-
const [expanded, setExpanded] =
|
|
25921
|
+
const [expanded, setExpanded] = useState56(true);
|
|
25690
25922
|
const arrayElement = getArrayElement(schema);
|
|
25691
25923
|
const suffix2 = useMemo88(() => {
|
|
25692
25924
|
return expanded ? " [" : " [...] ";
|
|
@@ -26182,7 +26414,7 @@ var ZodTextareaEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad }
|
|
|
26182
26414
|
};
|
|
26183
26415
|
|
|
26184
26416
|
// src/components/RenderModal/SchemaEditor/ZodTupleEditor.tsx
|
|
26185
|
-
import React106, { useCallback as useCallback83, useMemo as useMemo94, useState as
|
|
26417
|
+
import React106, { useCallback as useCallback83, useMemo as useMemo94, useState as useState57 } from "react";
|
|
26186
26418
|
|
|
26187
26419
|
// src/components/RenderModal/SchemaEditor/ZodTupleItemEditor.tsx
|
|
26188
26420
|
import { useCallback as useCallback82, useMemo as useMemo93 } from "react";
|
|
@@ -26219,7 +26451,7 @@ var ZodTupleEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad }) =
|
|
|
26219
26451
|
setValue(updater, { shouldSave });
|
|
26220
26452
|
}, [setValue]);
|
|
26221
26453
|
const zodValidation = useMemo94(() => zodSafeParse(schema, value), [schema, value]);
|
|
26222
|
-
const [expanded, setExpanded] =
|
|
26454
|
+
const [expanded, setExpanded] = useState57(true);
|
|
26223
26455
|
const tupleItems = getTupleItems(schema);
|
|
26224
26456
|
const suffix2 = useMemo94(() => {
|
|
26225
26457
|
return expanded ? " [" : " [...] ";
|
|
@@ -26608,7 +26840,7 @@ var ZodObjectEditor = ({
|
|
|
26608
26840
|
mayPad,
|
|
26609
26841
|
discriminatedUnionReplacement
|
|
26610
26842
|
}) => {
|
|
26611
|
-
const [expanded, setExpanded] =
|
|
26843
|
+
const [expanded, setExpanded] = useState58(true);
|
|
26612
26844
|
const onChange = useCallback84((updater, { shouldSave }) => {
|
|
26613
26845
|
setValue(updater, { shouldSave });
|
|
26614
26846
|
}, [setValue]);
|
|
@@ -26924,8 +27156,8 @@ var DataEditor = ({
|
|
|
26924
27156
|
propsEditType,
|
|
26925
27157
|
canSaveDefaultProps
|
|
26926
27158
|
}) => {
|
|
26927
|
-
const [mode, setMode] =
|
|
26928
|
-
const [showWarning, setShowWarningWithoutPersistance] =
|
|
27159
|
+
const [mode, setMode] = useState59("schema");
|
|
27160
|
+
const [showWarning, setShowWarningWithoutPersistance] = useState59(() => getPersistedShowWarningState());
|
|
26929
27161
|
const jsonEditorSetValue = useCallback86((newProps) => {
|
|
26930
27162
|
setDefaultProps(typeof newProps === "function" ? newProps : () => newProps, { shouldSave: false });
|
|
26931
27163
|
}, [setDefaultProps]);
|
|
@@ -27337,16 +27569,16 @@ var SchemaResetButton = ({ onClick }) => {
|
|
|
27337
27569
|
};
|
|
27338
27570
|
|
|
27339
27571
|
// src/components/RenderQueue/index.tsx
|
|
27340
|
-
import React121, { useContext as useContext58, useEffect as
|
|
27572
|
+
import React121, { useContext as useContext58, useEffect as useEffect56, useMemo as useMemo106 } from "react";
|
|
27341
27573
|
import { Internals as Internals46 } from "remotion";
|
|
27342
27574
|
|
|
27343
27575
|
// src/components/RenderQueue/RenderQueueItem.tsx
|
|
27344
27576
|
import {
|
|
27345
27577
|
useCallback as useCallback98,
|
|
27346
27578
|
useContext as useContext57,
|
|
27347
|
-
useEffect as
|
|
27579
|
+
useEffect as useEffect55,
|
|
27348
27580
|
useMemo as useMemo105,
|
|
27349
|
-
useState as
|
|
27581
|
+
useState as useState60
|
|
27350
27582
|
} from "react";
|
|
27351
27583
|
import { Internals as Internals45 } from "remotion";
|
|
27352
27584
|
|
|
@@ -27447,7 +27679,7 @@ import { useCallback as useCallback90, useMemo as useMemo99 } from "react";
|
|
|
27447
27679
|
|
|
27448
27680
|
// src/components/RenderQueue/ClientRenderQueueProcessor.tsx
|
|
27449
27681
|
import { renderMediaOnWeb, renderStillOnWeb } from "@remotion/web-renderer";
|
|
27450
|
-
import { useCallback as useCallback89, useContext as useContext50, useEffect as
|
|
27682
|
+
import { useCallback as useCallback89, useContext as useContext50, useEffect as useEffect54 } from "react";
|
|
27451
27683
|
|
|
27452
27684
|
// src/api/save-render-output.ts
|
|
27453
27685
|
var throwIfNotOk = async (response) => {
|
|
@@ -27647,7 +27879,7 @@ var ClientRenderQueueProcessor = () => {
|
|
|
27647
27879
|
markClientJobFailed,
|
|
27648
27880
|
markClientJobCancelled
|
|
27649
27881
|
]);
|
|
27650
|
-
|
|
27882
|
+
useEffect54(() => {
|
|
27651
27883
|
setProcessJobCallback(processJob);
|
|
27652
27884
|
return () => setProcessJobCallback(null);
|
|
27653
27885
|
}, [processJob, setProcessJobCallback]);
|
|
@@ -28356,7 +28588,7 @@ var subtitle3 = {
|
|
|
28356
28588
|
};
|
|
28357
28589
|
var SELECTED_CLASSNAME = "__remotion_selected_classname";
|
|
28358
28590
|
var RenderQueueItem = ({ job, selected }) => {
|
|
28359
|
-
const [hovered, setHovered] =
|
|
28591
|
+
const [hovered, setHovered] = useState60(false);
|
|
28360
28592
|
const { setCanvasContent } = useContext57(Internals45.CompositionSetters);
|
|
28361
28593
|
const isClientJob = isClientRenderJob(job);
|
|
28362
28594
|
const onPointerEnter = useCallback98(() => {
|
|
@@ -28433,7 +28665,7 @@ var RenderQueueItem = ({ job, selected }) => {
|
|
|
28433
28665
|
selected,
|
|
28434
28666
|
setCanvasContent
|
|
28435
28667
|
]);
|
|
28436
|
-
|
|
28668
|
+
useEffect55(() => {
|
|
28437
28669
|
if (selected) {
|
|
28438
28670
|
scrollCurrentIntoView();
|
|
28439
28671
|
}
|
|
@@ -28529,7 +28761,7 @@ var RenderQueue = () => {
|
|
|
28529
28761
|
const previousJobCount = React121.useRef(jobs.length);
|
|
28530
28762
|
const jobCount = jobs.length;
|
|
28531
28763
|
const divRef = React121.useRef(null);
|
|
28532
|
-
|
|
28764
|
+
useEffect56(() => {
|
|
28533
28765
|
if (!divRef.current) {
|
|
28534
28766
|
return;
|
|
28535
28767
|
}
|
|
@@ -28666,7 +28898,7 @@ var RendersTab = ({ selected, onClick }) => {
|
|
|
28666
28898
|
import React124, { useContext as useContext61 } from "react";
|
|
28667
28899
|
|
|
28668
28900
|
// src/components/VisualControls/VisualControlHandle.tsx
|
|
28669
|
-
import { useCallback as useCallback100, useContext as useContext60, useEffect as
|
|
28901
|
+
import { useCallback as useCallback100, useContext as useContext60, useEffect as useEffect58, useState as useState63 } from "react";
|
|
28670
28902
|
import { NoReactInternals as NoReactInternals22 } from "remotion/no-react";
|
|
28671
28903
|
|
|
28672
28904
|
// src/fast-refresh-context.ts
|
|
@@ -28678,10 +28910,10 @@ var FastRefreshContext = createContext22({
|
|
|
28678
28910
|
});
|
|
28679
28911
|
|
|
28680
28912
|
// src/components/VisualControls/get-original-stack-trace.ts
|
|
28681
|
-
import { useEffect as
|
|
28913
|
+
import { useEffect as useEffect57, useState as useState61 } from "react";
|
|
28682
28914
|
var useOriginalFileName = (stack2) => {
|
|
28683
|
-
const [originalFileName, setOriginalFileName] =
|
|
28684
|
-
|
|
28915
|
+
const [originalFileName, setOriginalFileName] = useState61({ type: "loading" });
|
|
28916
|
+
useEffect57(() => {
|
|
28685
28917
|
if (!stack2) {
|
|
28686
28918
|
return;
|
|
28687
28919
|
}
|
|
@@ -28702,7 +28934,7 @@ var useOriginalFileName = (stack2) => {
|
|
|
28702
28934
|
};
|
|
28703
28935
|
|
|
28704
28936
|
// src/components/VisualControls/ClickableFileName.tsx
|
|
28705
|
-
import { useCallback as useCallback99, useMemo as useMemo108, useState as
|
|
28937
|
+
import { useCallback as useCallback99, useMemo as useMemo108, useState as useState62 } from "react";
|
|
28706
28938
|
|
|
28707
28939
|
// src/components/Timeline/TimelineStack/source-attribution.ts
|
|
28708
28940
|
var getOriginalSourceAttribution = (originalLocation) => {
|
|
@@ -28727,7 +28959,7 @@ var container32 = {
|
|
|
28727
28959
|
var ClickableFileName = ({
|
|
28728
28960
|
originalFileName
|
|
28729
28961
|
}) => {
|
|
28730
|
-
const [titleHovered, setTitleHovered] =
|
|
28962
|
+
const [titleHovered, setTitleHovered] = useState62(false);
|
|
28731
28963
|
const hoverEffect = titleHovered && originalFileName.type === "loaded";
|
|
28732
28964
|
const onTitlePointerEnter = useCallback99(() => {
|
|
28733
28965
|
setTitleHovered(true);
|
|
@@ -28780,7 +29012,7 @@ var VisualControlHandle = ({ value, keyName }) => {
|
|
|
28780
29012
|
const state = useContext60(VisualControlsContext);
|
|
28781
29013
|
const { updateValue } = useContext60(SetVisualControlsContext);
|
|
28782
29014
|
const { fastRefreshes, increaseManualRefreshes } = useContext60(FastRefreshContext);
|
|
28783
|
-
const [_saving, setSaving] =
|
|
29015
|
+
const [_saving, setSaving] = useState63(false);
|
|
28784
29016
|
const currentValue = getVisualControlEditedValue({
|
|
28785
29017
|
handles: state.handles,
|
|
28786
29018
|
key: keyName
|
|
@@ -28832,7 +29064,7 @@ var VisualControlHandle = ({ value, keyName }) => {
|
|
|
28832
29064
|
keyName,
|
|
28833
29065
|
zodTypes
|
|
28834
29066
|
]);
|
|
28835
|
-
|
|
29067
|
+
useEffect58(() => {
|
|
28836
29068
|
setSaving(false);
|
|
28837
29069
|
}, [fastRefreshes]);
|
|
28838
29070
|
const setValue = useCallback100((updater, { shouldSave }) => {
|
|
@@ -28924,7 +29156,7 @@ var OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
28924
29156
|
flexDirection: "column",
|
|
28925
29157
|
flex: 1
|
|
28926
29158
|
}), [isMobileLayout]);
|
|
28927
|
-
const [panel2, setPanel] =
|
|
29159
|
+
const [panel2, setPanel] = useState64(() => getSelectedPanel2(renderingAvailable));
|
|
28928
29160
|
const onPropsSelected = useCallback101(() => {
|
|
28929
29161
|
setPanel("input-props");
|
|
28930
29162
|
persistSelectedOptionsSidebarPanel2("input-props");
|
|
@@ -29089,9 +29321,9 @@ var OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
29089
29321
|
import {
|
|
29090
29322
|
useCallback as useCallback111,
|
|
29091
29323
|
useContext as useContext70,
|
|
29092
|
-
useEffect as
|
|
29324
|
+
useEffect as useEffect64,
|
|
29093
29325
|
useRef as useRef43,
|
|
29094
|
-
useState as
|
|
29326
|
+
useState as useState68
|
|
29095
29327
|
} from "react";
|
|
29096
29328
|
import { Internals as Internals56 } from "remotion";
|
|
29097
29329
|
|
|
@@ -29166,11 +29398,11 @@ var CheckboardToggle = () => {
|
|
|
29166
29398
|
|
|
29167
29399
|
// src/components/FpsCounter.tsx
|
|
29168
29400
|
import {
|
|
29169
|
-
useEffect as
|
|
29170
|
-
useLayoutEffect as
|
|
29401
|
+
useEffect as useEffect59,
|
|
29402
|
+
useLayoutEffect as useLayoutEffect5,
|
|
29171
29403
|
useMemo as useMemo110,
|
|
29172
29404
|
useRef as useRef41,
|
|
29173
|
-
useState as
|
|
29405
|
+
useState as useState65
|
|
29174
29406
|
} from "react";
|
|
29175
29407
|
import { Internals as Internals49 } from "remotion";
|
|
29176
29408
|
import { jsxs as jsxs90 } from "react/jsx-runtime";
|
|
@@ -29188,17 +29420,17 @@ var FpsCounter = ({ playbackSpeed }) => {
|
|
|
29188
29420
|
const videoConfig = Internals49.useUnsafeVideoConfig();
|
|
29189
29421
|
const [playing] = Internals49.Timeline.usePlayingState();
|
|
29190
29422
|
const frame2 = Internals49.Timeline.useTimelinePosition();
|
|
29191
|
-
const [marker, rerender] =
|
|
29192
|
-
const [fps, setFps] =
|
|
29423
|
+
const [marker, rerender] = useState65({});
|
|
29424
|
+
const [fps, setFps] = useState65(0);
|
|
29193
29425
|
const previousUpdates = useRef41([]);
|
|
29194
29426
|
const fpsRef = useRef41(0);
|
|
29195
29427
|
const playingRef = useRef41(playing);
|
|
29196
|
-
|
|
29428
|
+
useLayoutEffect5(() => {
|
|
29197
29429
|
fpsRef.current = 0;
|
|
29198
29430
|
previousUpdates.current = [];
|
|
29199
29431
|
playingRef.current = playing;
|
|
29200
29432
|
}, [playing]);
|
|
29201
|
-
|
|
29433
|
+
useLayoutEffect5(() => {
|
|
29202
29434
|
if (playingRef.current === false)
|
|
29203
29435
|
return;
|
|
29204
29436
|
previousUpdates.current = pushWithMaxSize(previousUpdates.current, performance.now(), 15);
|
|
@@ -29210,7 +29442,7 @@ var FpsCounter = ({ playbackSpeed }) => {
|
|
|
29210
29442
|
if (previousUpdates.current.length === 2)
|
|
29211
29443
|
setFps(fpsRef.current);
|
|
29212
29444
|
}, [frame2]);
|
|
29213
|
-
|
|
29445
|
+
useEffect59(() => {
|
|
29214
29446
|
if (playing) {
|
|
29215
29447
|
const t = setTimeout(() => {
|
|
29216
29448
|
rerender({});
|
|
@@ -29248,7 +29480,7 @@ var FpsCounter = ({ playbackSpeed }) => {
|
|
|
29248
29480
|
};
|
|
29249
29481
|
|
|
29250
29482
|
// src/components/FullscreenToggle.tsx
|
|
29251
|
-
import { useCallback as useCallback103, useContext as useContext65, useEffect as
|
|
29483
|
+
import { useCallback as useCallback103, useContext as useContext65, useEffect as useEffect60 } from "react";
|
|
29252
29484
|
import { Internals as Internals50 } from "remotion";
|
|
29253
29485
|
import { NoReactInternals as NoReactInternals24 } from "remotion/no-react";
|
|
29254
29486
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
@@ -29270,7 +29502,7 @@ var FullScreenToggle = () => {
|
|
|
29270
29502
|
}
|
|
29271
29503
|
}));
|
|
29272
29504
|
}, [setSize]);
|
|
29273
|
-
|
|
29505
|
+
useEffect60(() => {
|
|
29274
29506
|
const f = keybindings.registerKeybinding({
|
|
29275
29507
|
event: "keydown",
|
|
29276
29508
|
key: "f",
|
|
@@ -29411,7 +29643,7 @@ var OutlineToggle = () => {
|
|
|
29411
29643
|
|
|
29412
29644
|
// src/components/PlaybackKeyboardShortcutsManager.tsx
|
|
29413
29645
|
import { PlayerInternals as PlayerInternals14 } from "@remotion/player";
|
|
29414
|
-
import { useCallback as useCallback107, useEffect as
|
|
29646
|
+
import { useCallback as useCallback107, useEffect as useEffect61 } from "react";
|
|
29415
29647
|
var PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
|
|
29416
29648
|
const keybindings = useKeybinding();
|
|
29417
29649
|
const { play, pause, playing } = PlayerInternals14.usePlayer();
|
|
@@ -29449,7 +29681,7 @@ var PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
|
|
|
29449
29681
|
});
|
|
29450
29682
|
play();
|
|
29451
29683
|
}, [play, playing, setPlaybackRate]);
|
|
29452
|
-
|
|
29684
|
+
useEffect61(() => {
|
|
29453
29685
|
const jKey = keybindings.registerKeybinding({
|
|
29454
29686
|
event: "keydown",
|
|
29455
29687
|
key: "j",
|
|
@@ -29487,7 +29719,7 @@ var PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
|
|
|
29487
29719
|
};
|
|
29488
29720
|
|
|
29489
29721
|
// src/components/PlaybackRatePersistor.tsx
|
|
29490
|
-
import { useEffect as
|
|
29722
|
+
import { useEffect as useEffect62 } from "react";
|
|
29491
29723
|
import { Internals as Internals51 } from "remotion";
|
|
29492
29724
|
|
|
29493
29725
|
// src/state/playbackrate.ts
|
|
@@ -29509,10 +29741,10 @@ var loadPlaybackRate = () => {
|
|
|
29509
29741
|
// src/components/PlaybackRatePersistor.tsx
|
|
29510
29742
|
var PlaybackRatePersistor = () => {
|
|
29511
29743
|
const { setPlaybackRate, playbackRate } = Internals51.usePlaybackRate();
|
|
29512
|
-
|
|
29744
|
+
useEffect62(() => {
|
|
29513
29745
|
setPlaybackRate(loadPlaybackRate());
|
|
29514
29746
|
}, [setPlaybackRate]);
|
|
29515
|
-
|
|
29747
|
+
useEffect62(() => {
|
|
29516
29748
|
persistPlaybackRate(playbackRate);
|
|
29517
29749
|
}, [playbackRate]);
|
|
29518
29750
|
return null;
|
|
@@ -29591,7 +29823,7 @@ var PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
|
|
|
29591
29823
|
|
|
29592
29824
|
// src/components/PlayPause.tsx
|
|
29593
29825
|
import { PlayerInternals as PlayerInternals15 } from "@remotion/player";
|
|
29594
|
-
import { useCallback as useCallback108, useEffect as
|
|
29826
|
+
import { useCallback as useCallback108, useEffect as useEffect63, useState as useState66 } from "react";
|
|
29595
29827
|
import { Internals as Internals53 } from "remotion";
|
|
29596
29828
|
|
|
29597
29829
|
// src/icons/jump-to-start.tsx
|
|
@@ -29688,7 +29920,7 @@ var iconButton = {
|
|
|
29688
29920
|
var PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted }) => {
|
|
29689
29921
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
29690
29922
|
const videoConfig = Internals53.useUnsafeVideoConfig();
|
|
29691
|
-
const [showBufferIndicator, setShowBufferState] =
|
|
29923
|
+
const [showBufferIndicator, setShowBufferState] = useState66(false);
|
|
29692
29924
|
const {
|
|
29693
29925
|
playing,
|
|
29694
29926
|
play,
|
|
@@ -29715,7 +29947,7 @@ var PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted })
|
|
|
29715
29947
|
muted
|
|
29716
29948
|
});
|
|
29717
29949
|
const isStill = useIsStill();
|
|
29718
|
-
|
|
29950
|
+
useEffect63(() => {
|
|
29719
29951
|
if (isStill) {
|
|
29720
29952
|
pause();
|
|
29721
29953
|
}
|
|
@@ -29757,7 +29989,7 @@ var PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted })
|
|
|
29757
29989
|
seek(outFrame ?? getCurrentDuration() - 1);
|
|
29758
29990
|
}, [seek, outFrame]);
|
|
29759
29991
|
const keybindings = useKeybinding();
|
|
29760
|
-
|
|
29992
|
+
useEffect63(() => {
|
|
29761
29993
|
const commandArrowLeft = keybindings.registerKeybinding({
|
|
29762
29994
|
event: "keydown",
|
|
29763
29995
|
key: "ArrowLeft",
|
|
@@ -29829,7 +30061,7 @@ var PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted })
|
|
|
29829
30061
|
oneFrameBack,
|
|
29830
30062
|
oneFrameForward
|
|
29831
30063
|
]);
|
|
29832
|
-
|
|
30064
|
+
useEffect63(() => {
|
|
29833
30065
|
let timeout = null;
|
|
29834
30066
|
let stopped = false;
|
|
29835
30067
|
const onBuffer = () => {
|
|
@@ -29911,7 +30143,7 @@ var PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted })
|
|
|
29911
30143
|
|
|
29912
30144
|
// src/components/RenderButton.tsx
|
|
29913
30145
|
import { PlayerInternals as PlayerInternals16 } from "@remotion/player";
|
|
29914
|
-
import { useCallback as useCallback109, useContext as useContext68, useMemo as useMemo112, useRef as useRef42, useState as
|
|
30146
|
+
import { useCallback as useCallback109, useContext as useContext68, useMemo as useMemo112, useRef as useRef42, useState as useState67 } from "react";
|
|
29915
30147
|
import ReactDOM9 from "react-dom";
|
|
29916
30148
|
import { Internals as Internals54 } from "remotion";
|
|
29917
30149
|
import { jsx as jsx194, jsxs as jsxs92, Fragment as Fragment29 } from "react/jsx-runtime";
|
|
@@ -29983,8 +30215,8 @@ var RenderButton = ({
|
|
|
29983
30215
|
}) => {
|
|
29984
30216
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
29985
30217
|
const { setSelectedModal } = useContext68(ModalsContext);
|
|
29986
|
-
const [preferredRenderType, setPreferredRenderType] =
|
|
29987
|
-
const [dropdownOpened, setDropdownOpened] =
|
|
30218
|
+
const [preferredRenderType, setPreferredRenderType] = useState67(() => getInitialRenderType(readOnlyStudio));
|
|
30219
|
+
const [dropdownOpened, setDropdownOpened] = useState67(false);
|
|
29988
30220
|
const dropdownRef = useRef42(null);
|
|
29989
30221
|
const containerRef = useRef42(null);
|
|
29990
30222
|
const { currentZIndex } = useZIndex();
|
|
@@ -30561,10 +30793,10 @@ var PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
30561
30793
|
const leftScrollIndicatorRef = useRef43(null);
|
|
30562
30794
|
const rightScrollIndicatorRef = useRef43(null);
|
|
30563
30795
|
const isStill = useIsStill();
|
|
30564
|
-
const [loop, setLoop] =
|
|
30796
|
+
const [loop, setLoop] = useState68(loadLoopOption());
|
|
30565
30797
|
const isFullscreenSupported = checkFullscreenSupport();
|
|
30566
30798
|
const isMobileLayout = useMobileLayout();
|
|
30567
|
-
|
|
30799
|
+
useEffect64(() => {
|
|
30568
30800
|
if (!isMobileLayout) {
|
|
30569
30801
|
if (leftScrollIndicatorRef.current) {
|
|
30570
30802
|
leftScrollIndicatorRef.current.style.display = "none";
|
|
@@ -30757,7 +30989,7 @@ var PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
30757
30989
|
|
|
30758
30990
|
// src/components/Splitter/SplitterContainer.tsx
|
|
30759
30991
|
import { PlayerInternals as PlayerInternals17 } from "@remotion/player";
|
|
30760
|
-
import { useEffect as
|
|
30992
|
+
import { useEffect as useEffect65, useMemo as useMemo113, useRef as useRef44, useState as useState69 } from "react";
|
|
30761
30993
|
|
|
30762
30994
|
// src/state/timeline.ts
|
|
30763
30995
|
var localStorageKey3 = (id) => `remotion.editor.timelineFlex.${id}`;
|
|
@@ -30811,7 +31043,7 @@ var containerColumn = {
|
|
|
30811
31043
|
};
|
|
30812
31044
|
var SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, id }) => {
|
|
30813
31045
|
const [initialTimelineFlex, persistFlex] = useTimelineFlex(id);
|
|
30814
|
-
const [flexValue, setFlexValue] =
|
|
31046
|
+
const [flexValue, setFlexValue] = useState69(initialTimelineFlex ?? defaultFlex);
|
|
30815
31047
|
const ref2 = useRef44(null);
|
|
30816
31048
|
const isDragging = useRef44(false);
|
|
30817
31049
|
const value = useMemo113(() => {
|
|
@@ -30837,7 +31069,7 @@ var SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex,
|
|
|
30837
31069
|
persistFlex,
|
|
30838
31070
|
ref2
|
|
30839
31071
|
]);
|
|
30840
|
-
|
|
31072
|
+
useEffect65(() => {
|
|
30841
31073
|
const frame2 = requestAnimationFrame(() => {
|
|
30842
31074
|
PlayerInternals17.updateAllElementsSizes();
|
|
30843
31075
|
});
|
|
@@ -30894,7 +31126,7 @@ var SplitterElement = ({ children, type, sticky }) => {
|
|
|
30894
31126
|
|
|
30895
31127
|
// src/components/Splitter/SplitterHandle.tsx
|
|
30896
31128
|
import { PlayerInternals as PlayerInternals18 } from "@remotion/player";
|
|
30897
|
-
import { useContext as useContext72, useEffect as
|
|
31129
|
+
import { useContext as useContext72, useEffect as useEffect66, useRef as useRef45 } from "react";
|
|
30898
31130
|
import { jsx as jsx200 } from "react/jsx-runtime";
|
|
30899
31131
|
var SPLITTER_HANDLE_SIZE = 3;
|
|
30900
31132
|
var containerRow2 = {
|
|
@@ -30911,7 +31143,7 @@ var SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
30911
31143
|
const ref2 = useRef45(null);
|
|
30912
31144
|
const latest = useRef45({ context, allowToCollapse, onCollapse });
|
|
30913
31145
|
latest.current = { context, allowToCollapse, onCollapse };
|
|
30914
|
-
|
|
31146
|
+
useEffect66(() => {
|
|
30915
31147
|
const { current } = ref2;
|
|
30916
31148
|
if (!current) {
|
|
30917
31149
|
return;
|
|
@@ -30985,7 +31217,7 @@ var SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
30985
31217
|
endDrag?.();
|
|
30986
31218
|
};
|
|
30987
31219
|
}, []);
|
|
30988
|
-
|
|
31220
|
+
useEffect66(() => {
|
|
30989
31221
|
const { current } = ref2;
|
|
30990
31222
|
if (!current) {
|
|
30991
31223
|
return;
|
|
@@ -31073,7 +31305,7 @@ var TopPanelInner = ({ readOnlyStudio, onMounted, drawRef: drawRef2, bufferState
|
|
|
31073
31305
|
}
|
|
31074
31306
|
return "expanded";
|
|
31075
31307
|
}, [sidebarCollapsedStateRight]);
|
|
31076
|
-
|
|
31308
|
+
useEffect67(() => {
|
|
31077
31309
|
onMounted();
|
|
31078
31310
|
}, [onMounted]);
|
|
31079
31311
|
const canvasContainerStyle = useMemo115(() => ({
|
|
@@ -31248,7 +31480,7 @@ var SidebarCollapserControls = () => {
|
|
|
31248
31480
|
toggleLeft,
|
|
31249
31481
|
toggleRight
|
|
31250
31482
|
]);
|
|
31251
|
-
|
|
31483
|
+
useEffect68(() => {
|
|
31252
31484
|
const left3 = keybindings.registerKeybinding({
|
|
31253
31485
|
event: "keydown",
|
|
31254
31486
|
key: "b",
|
|
@@ -31326,9 +31558,9 @@ var SidebarCollapserControls = () => {
|
|
|
31326
31558
|
import {
|
|
31327
31559
|
useCallback as useCallback114,
|
|
31328
31560
|
useContext as useContext75,
|
|
31329
|
-
useEffect as
|
|
31561
|
+
useEffect as useEffect69,
|
|
31330
31562
|
useRef as useRef46,
|
|
31331
|
-
useState as
|
|
31563
|
+
useState as useState70
|
|
31332
31564
|
} from "react";
|
|
31333
31565
|
|
|
31334
31566
|
// src/icons/redo.tsx
|
|
@@ -31364,13 +31596,13 @@ var iconStyle5 = {
|
|
|
31364
31596
|
height: 16
|
|
31365
31597
|
};
|
|
31366
31598
|
var UndoRedoButtons = () => {
|
|
31367
|
-
const [undoFile, setUndoFile] =
|
|
31368
|
-
const [redoFile, setRedoFile] =
|
|
31599
|
+
const [undoFile, setUndoFile] = useState70(null);
|
|
31600
|
+
const [redoFile, setRedoFile] = useState70(null);
|
|
31369
31601
|
const { subscribeToEvent } = useContext75(StudioServerConnectionCtx);
|
|
31370
31602
|
const keybindings = useKeybinding();
|
|
31371
31603
|
const undoInFlight = useRef46(false);
|
|
31372
31604
|
const redoInFlight = useRef46(false);
|
|
31373
|
-
|
|
31605
|
+
useEffect69(() => {
|
|
31374
31606
|
const unsub = subscribeToEvent("undo-redo-stack-changed", (event) => {
|
|
31375
31607
|
if (event.type !== "undo-redo-stack-changed") {
|
|
31376
31608
|
return;
|
|
@@ -31398,7 +31630,7 @@ var UndoRedoButtons = () => {
|
|
|
31398
31630
|
redoInFlight.current = false;
|
|
31399
31631
|
});
|
|
31400
31632
|
}, []);
|
|
31401
|
-
|
|
31633
|
+
useEffect69(() => {
|
|
31402
31634
|
const undo = keybindings.registerKeybinding({
|
|
31403
31635
|
event: "keydown",
|
|
31404
31636
|
key: "z",
|
|
@@ -31472,9 +31704,9 @@ var UndoRedoButtons = () => {
|
|
|
31472
31704
|
import {
|
|
31473
31705
|
useCallback as useCallback115,
|
|
31474
31706
|
useContext as useContext76,
|
|
31475
|
-
useEffect as
|
|
31707
|
+
useEffect as useEffect70,
|
|
31476
31708
|
useMemo as useMemo116,
|
|
31477
|
-
useState as
|
|
31709
|
+
useState as useState71
|
|
31478
31710
|
} from "react";
|
|
31479
31711
|
import { VERSION } from "remotion";
|
|
31480
31712
|
import { jsx as jsx206 } from "react/jsx-runtime";
|
|
@@ -31490,10 +31722,10 @@ var buttonStyle4 = {
|
|
|
31490
31722
|
justifyContent: "center"
|
|
31491
31723
|
};
|
|
31492
31724
|
var UpdateCheck = () => {
|
|
31493
|
-
const [info, setInfo] =
|
|
31725
|
+
const [info, setInfo] = useState71(null);
|
|
31494
31726
|
const { setSelectedModal } = useContext76(ModalsContext);
|
|
31495
31727
|
const { tabIndex } = useZIndex();
|
|
31496
|
-
const [knownBugs, setKnownBugs] =
|
|
31728
|
+
const [knownBugs, setKnownBugs] = useState71(null);
|
|
31497
31729
|
const hasKnownBugs = useMemo116(() => {
|
|
31498
31730
|
return knownBugs && knownBugs.length > 0;
|
|
31499
31731
|
}, [knownBugs]);
|
|
@@ -31524,7 +31756,7 @@ var UpdateCheck = () => {
|
|
|
31524
31756
|
});
|
|
31525
31757
|
return controller;
|
|
31526
31758
|
}, []);
|
|
31527
|
-
|
|
31759
|
+
useEffect70(() => {
|
|
31528
31760
|
const abortUpdate = checkForUpdates();
|
|
31529
31761
|
const abortBugs = checkForBugs();
|
|
31530
31762
|
return () => {
|
|
@@ -31574,13 +31806,16 @@ var UpdateCheck = () => {
|
|
|
31574
31806
|
|
|
31575
31807
|
// src/components/MenuToolbar.tsx
|
|
31576
31808
|
import { jsx as jsx207, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
31809
|
+
var MENU_TOOLBAR_HEIGHT = 30;
|
|
31577
31810
|
var row6 = {
|
|
31578
31811
|
alignItems: "center",
|
|
31579
31812
|
flexDirection: "row",
|
|
31580
31813
|
display: "flex",
|
|
31581
31814
|
color: "white",
|
|
31582
31815
|
borderBottom: "1px solid black",
|
|
31816
|
+
boxSizing: "border-box",
|
|
31583
31817
|
fontSize: 13,
|
|
31818
|
+
height: MENU_TOOLBAR_HEIGHT,
|
|
31584
31819
|
paddingLeft: 6,
|
|
31585
31820
|
paddingRight: 10,
|
|
31586
31821
|
backgroundColor: BACKGROUND
|
|
@@ -31589,7 +31824,7 @@ var flex2 = {
|
|
|
31589
31824
|
flex: 1
|
|
31590
31825
|
};
|
|
31591
31826
|
var MenuToolbar = ({ readOnlyStudio }) => {
|
|
31592
|
-
const [selected, setSelected] =
|
|
31827
|
+
const [selected, setSelected] = useState72(null);
|
|
31593
31828
|
const mobileLayout = useMobileLayout();
|
|
31594
31829
|
const fixedWidthRight = useMemo117(() => {
|
|
31595
31830
|
return {
|
|
@@ -31699,7 +31934,7 @@ var MenuToolbar = ({ readOnlyStudio }) => {
|
|
|
31699
31934
|
};
|
|
31700
31935
|
|
|
31701
31936
|
// src/components/Timeline/Timeline.tsx
|
|
31702
|
-
import React191, { useCallback as useCallback145, useContext as useContext105, useMemo as useMemo160, useState as
|
|
31937
|
+
import React191, { useCallback as useCallback145, useContext as useContext105, useMemo as useMemo160, useState as useState90 } from "react";
|
|
31703
31938
|
import { Internals as Internals84 } from "remotion";
|
|
31704
31939
|
|
|
31705
31940
|
// src/components/Timeline/MaxTimelineTracks.tsx
|
|
@@ -31731,12 +31966,12 @@ var MaxTimelineTracksReached = () => {
|
|
|
31731
31966
|
};
|
|
31732
31967
|
|
|
31733
31968
|
// src/components/Timeline/SequencePropsObserver.tsx
|
|
31734
|
-
import { useContext as useContext77, useEffect as
|
|
31969
|
+
import { useContext as useContext77, useEffect as useEffect71 } from "react";
|
|
31735
31970
|
import { Internals as Internals58 } from "remotion";
|
|
31736
31971
|
var SequencePropsObserver = () => {
|
|
31737
31972
|
const { subscribeToEvent } = useContext77(StudioServerConnectionCtx);
|
|
31738
31973
|
const { setPropStatuses } = useContext77(Internals58.VisualModeSettersContext);
|
|
31739
|
-
|
|
31974
|
+
useEffect71(() => {
|
|
31740
31975
|
const handleEvent = (event) => {
|
|
31741
31976
|
if (event.type !== "sequence-props-updated") {
|
|
31742
31977
|
return;
|
|
@@ -31770,7 +32005,7 @@ import { useMemo as useMemo120 } from "react";
|
|
|
31770
32005
|
import { NoReactInternals as NoReactInternals25 } from "remotion/no-react";
|
|
31771
32006
|
|
|
31772
32007
|
// src/components/Timeline/use-resolved-stack-react-to-change.ts
|
|
31773
|
-
import { useContext as useContext78, useEffect as
|
|
32008
|
+
import { useContext as useContext78, useEffect as useEffect72, useRef as useRef47, useState as useState73 } from "react";
|
|
31774
32009
|
var matchesLostNodePathEvent = (event, location2) => {
|
|
31775
32010
|
if (!location2?.source || !location2.line) {
|
|
31776
32011
|
return false;
|
|
@@ -31779,11 +32014,11 @@ var matchesLostNodePathEvent = (event, location2) => {
|
|
|
31779
32014
|
};
|
|
31780
32015
|
var useResolveStackAndReactToChange = (getStack) => {
|
|
31781
32016
|
const { subscribeToEvent } = useContext78(StudioServerConnectionCtx);
|
|
31782
|
-
const [stack2, setStack] =
|
|
32017
|
+
const [stack2, setStack] = useState73(() => getStack());
|
|
31783
32018
|
const resolvedLocation = useResolvedStack(stack2);
|
|
31784
32019
|
const resolvedLocationRef = useRef47(resolvedLocation);
|
|
31785
32020
|
resolvedLocationRef.current = resolvedLocation;
|
|
31786
|
-
|
|
32021
|
+
useEffect72(() => {
|
|
31787
32022
|
let interval = null;
|
|
31788
32023
|
const handleEvent = (event) => {
|
|
31789
32024
|
if (event.type !== "lost-node-path") {
|
|
@@ -31823,11 +32058,11 @@ import {
|
|
|
31823
32058
|
getAllSchemaKeys as getAllSchemaKeys2,
|
|
31824
32059
|
stringifySequenceSubscriptionKey as stringifySequenceSubscriptionKey3
|
|
31825
32060
|
} from "@remotion/studio-shared";
|
|
31826
|
-
import { useContext as useContext79, useEffect as
|
|
32061
|
+
import { useContext as useContext79, useEffect as useEffect73, useMemo as useMemo119, useRef as useRef48 } from "react";
|
|
31827
32062
|
import { Internals as Internals60 } from "remotion";
|
|
31828
32063
|
|
|
31829
32064
|
// src/components/ExpandedTracksProvider.tsx
|
|
31830
|
-
import { createContext as createContext23, useCallback as useCallback117, useMemo as useMemo118, useState as
|
|
32065
|
+
import { createContext as createContext23, useCallback as useCallback117, useMemo as useMemo118, useState as useState74 } from "react";
|
|
31831
32066
|
|
|
31832
32067
|
// src/helpers/migrate-expanded-tracks-for-subscription-key.ts
|
|
31833
32068
|
import { stringifySequenceExpandedRowKey as stringifySequenceExpandedRowKey3 } from "@remotion/studio-shared";
|
|
@@ -31873,7 +32108,7 @@ var ExpandedTracksSetterContext = createContext23({
|
|
|
31873
32108
|
}
|
|
31874
32109
|
});
|
|
31875
32110
|
var ExpandedTracksProvider = ({ children }) => {
|
|
31876
|
-
const [expandedTracks, setExpandedTracks] =
|
|
32111
|
+
const [expandedTracks, setExpandedTracks] = useState74(loadExpandedTracks);
|
|
31877
32112
|
const toggleTrack = useCallback117((nodePathInfo) => {
|
|
31878
32113
|
setExpandedTracks((prev) => {
|
|
31879
32114
|
const key5 = timelineNodePathInfoToKey(nodePathInfo);
|
|
@@ -32044,7 +32279,7 @@ var useSequencePropsSubscription = ({
|
|
|
32044
32279
|
const locationSource = validatedLocation?.source ?? null;
|
|
32045
32280
|
const locationLine = validatedLocation?.line ?? null;
|
|
32046
32281
|
const locationColumn = validatedLocation?.column ?? null;
|
|
32047
|
-
|
|
32282
|
+
useEffect73(() => {
|
|
32048
32283
|
if (!clientId || !locationSource || !locationLine || locationColumn === null || !schema) {
|
|
32049
32284
|
return;
|
|
32050
32285
|
}
|
|
@@ -32124,22 +32359,22 @@ import { PlayerInternals as PlayerInternals20 } from "@remotion/player";
|
|
|
32124
32359
|
import React147, {
|
|
32125
32360
|
useCallback as useCallback119,
|
|
32126
32361
|
useContext as useContext81,
|
|
32127
|
-
useEffect as
|
|
32362
|
+
useEffect as useEffect76,
|
|
32128
32363
|
useMemo as useMemo122,
|
|
32129
32364
|
useRef as useRef51,
|
|
32130
|
-
useState as
|
|
32365
|
+
useState as useState75
|
|
32131
32366
|
} from "react";
|
|
32132
32367
|
import { Internals as Internals63, useVideoConfig as useVideoConfig3 } from "remotion";
|
|
32133
32368
|
|
|
32134
32369
|
// src/components/Timeline/TimelineTimeIndicators.tsx
|
|
32135
|
-
import { useContext as useContext80, useEffect as
|
|
32370
|
+
import { useContext as useContext80, useEffect as useEffect75, useMemo as useMemo121, useRef as useRef50 } from "react";
|
|
32136
32371
|
import { Internals as Internals62 } from "remotion";
|
|
32137
32372
|
|
|
32138
32373
|
// src/components/TimeValue.tsx
|
|
32139
32374
|
import { PlayerInternals as PlayerInternals19 } from "@remotion/player";
|
|
32140
32375
|
import {
|
|
32141
32376
|
useCallback as useCallback118,
|
|
32142
|
-
useEffect as
|
|
32377
|
+
useEffect as useEffect74,
|
|
32143
32378
|
useImperativeHandle as useImperativeHandle13,
|
|
32144
32379
|
useRef as useRef49
|
|
32145
32380
|
} from "react";
|
|
@@ -32190,7 +32425,7 @@ var TimeValue = () => {
|
|
|
32190
32425
|
pause,
|
|
32191
32426
|
toggle
|
|
32192
32427
|
}), [seek, play, pause, toggle]);
|
|
32193
|
-
|
|
32428
|
+
useEffect74(() => {
|
|
32194
32429
|
const gKey = keybindings.registerKeybinding({
|
|
32195
32430
|
event: "keypress",
|
|
32196
32431
|
key: "g",
|
|
@@ -32306,7 +32541,7 @@ var TimelineTimeIndicators = () => {
|
|
|
32306
32541
|
};
|
|
32307
32542
|
var TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) => {
|
|
32308
32543
|
const ref2 = useRef50(null);
|
|
32309
|
-
|
|
32544
|
+
useEffect75(() => {
|
|
32310
32545
|
const currentRef = ref2.current;
|
|
32311
32546
|
if (!currentRef) {
|
|
32312
32547
|
return;
|
|
@@ -32440,7 +32675,7 @@ var TimelineDragHandlerInner = () => {
|
|
|
32440
32675
|
const setFrame = Internals63.useTimelineSetFrame();
|
|
32441
32676
|
const width = scrollableRef.current?.scrollWidth ?? 0;
|
|
32442
32677
|
const left3 = size3?.left ?? 0;
|
|
32443
|
-
const [dragging, setDragging] =
|
|
32678
|
+
const [dragging, setDragging] = useState75({
|
|
32444
32679
|
dragging: false
|
|
32445
32680
|
});
|
|
32446
32681
|
const { playing, play, pause, seek } = PlayerInternals20.usePlayer();
|
|
@@ -32576,7 +32811,7 @@ var TimelineDragHandlerInner = () => {
|
|
|
32576
32811
|
play();
|
|
32577
32812
|
}
|
|
32578
32813
|
}, [dragging, left3, play, videoConfig, setFrame, width]);
|
|
32579
|
-
|
|
32814
|
+
useEffect76(() => {
|
|
32580
32815
|
if (!dragging.dragging) {
|
|
32581
32816
|
return;
|
|
32582
32817
|
}
|
|
@@ -32588,7 +32823,7 @@ var TimelineDragHandlerInner = () => {
|
|
|
32588
32823
|
};
|
|
32589
32824
|
}, [dragging.dragging, onPointerMoveScrubbing, onPointerUpScrubbing]);
|
|
32590
32825
|
const ref2 = useRef51(null);
|
|
32591
|
-
|
|
32826
|
+
useEffect76(() => {
|
|
32592
32827
|
const currentRef = ref2.current;
|
|
32593
32828
|
if (!currentRef) {
|
|
32594
32829
|
return;
|
|
@@ -32671,9 +32906,9 @@ import { PlayerInternals as PlayerInternals21 } from "@remotion/player";
|
|
|
32671
32906
|
import React151, {
|
|
32672
32907
|
useCallback as useCallback120,
|
|
32673
32908
|
useContext as useContext85,
|
|
32674
|
-
useEffect as
|
|
32909
|
+
useEffect as useEffect77,
|
|
32675
32910
|
useMemo as useMemo126,
|
|
32676
|
-
useState as
|
|
32911
|
+
useState as useState76
|
|
32677
32912
|
} from "react";
|
|
32678
32913
|
import { Internals as Internals66, useVideoConfig as useVideoConfig5 } from "remotion";
|
|
32679
32914
|
|
|
@@ -32790,7 +33025,7 @@ var TimelineInOutDragHandlerInner = () => {
|
|
|
32790
33025
|
shouldApplyCssTransforms: true
|
|
32791
33026
|
});
|
|
32792
33027
|
const { isHighestContext } = useZIndex();
|
|
32793
|
-
const [inOutDragging, setInOutDragging] =
|
|
33028
|
+
const [inOutDragging, setInOutDragging] = useState76({
|
|
32794
33029
|
dragging: false
|
|
32795
33030
|
});
|
|
32796
33031
|
const timelineWidth = useContext85(TimelineWidthContext);
|
|
@@ -32955,7 +33190,7 @@ var TimelineInOutDragHandlerInner = () => {
|
|
|
32955
33190
|
videoConfig,
|
|
32956
33191
|
width
|
|
32957
33192
|
]);
|
|
32958
|
-
|
|
33193
|
+
useEffect77(() => {
|
|
32959
33194
|
if (inOutDragging.dragging === false) {
|
|
32960
33195
|
return;
|
|
32961
33196
|
}
|
|
@@ -33058,7 +33293,7 @@ var useTimelineKeyframeTracks = () => {
|
|
|
33058
33293
|
};
|
|
33059
33294
|
|
|
33060
33295
|
// src/components/Timeline/TimelineSequenceItem.tsx
|
|
33061
|
-
import React176, { useCallback as useCallback138, useContext as useContext93, useMemo as useMemo149, useState as
|
|
33296
|
+
import React176, { useCallback as useCallback138, useContext as useContext93, useMemo as useMemo149, useState as useState84 } from "react";
|
|
33062
33297
|
import { Internals as Internals74 } from "remotion";
|
|
33063
33298
|
|
|
33064
33299
|
// src/components/Timeline/TimelineExpandArrowButton.tsx
|
|
@@ -33153,7 +33388,7 @@ var getExpandedRowDepth = ({
|
|
|
33153
33388
|
};
|
|
33154
33389
|
|
|
33155
33390
|
// src/components/Timeline/TimelineEffectItem.tsx
|
|
33156
|
-
import { useCallback as useCallback122, useContext as useContext87, useMemo as useMemo130, useState as
|
|
33391
|
+
import { useCallback as useCallback122, useContext as useContext87, useMemo as useMemo130, useState as useState77 } from "react";
|
|
33157
33392
|
import { Internals as Internals67 } from "remotion";
|
|
33158
33393
|
|
|
33159
33394
|
// src/components/Timeline/TimelineRowChrome.tsx
|
|
@@ -33369,7 +33604,7 @@ var TimelineEffectItem = ({
|
|
|
33369
33604
|
const { propStatuses } = useContext87(Internals67.VisualModePropStatusesContext);
|
|
33370
33605
|
const { setPropStatuses } = useContext87(Internals67.VisualModeSettersContext);
|
|
33371
33606
|
const selection = useTimelineRowSelection(nodePathInfo);
|
|
33372
|
-
const [dropIndicator, setDropIndicator] =
|
|
33607
|
+
const [dropIndicator, setDropIndicator] = useState77(null);
|
|
33373
33608
|
const effectStatus = useMemo130(() => Internals67.getEffectPropStatusesCtx({
|
|
33374
33609
|
propStatuses,
|
|
33375
33610
|
nodePath,
|
|
@@ -34405,7 +34640,7 @@ var TimelineEnumField = ({
|
|
|
34405
34640
|
};
|
|
34406
34641
|
|
|
34407
34642
|
// src/components/Timeline/TimelineNumberField.tsx
|
|
34408
|
-
import { useCallback as useCallback127, useMemo as useMemo135, useState as
|
|
34643
|
+
import { useCallback as useCallback127, useMemo as useMemo135, useState as useState78 } from "react";
|
|
34409
34644
|
import { jsx as jsx227 } from "react/jsx-runtime";
|
|
34410
34645
|
var TimelineNumberField = ({
|
|
34411
34646
|
field,
|
|
@@ -34415,7 +34650,7 @@ var TimelineNumberField = ({
|
|
|
34415
34650
|
onDragEnd,
|
|
34416
34651
|
propStatus
|
|
34417
34652
|
}) => {
|
|
34418
|
-
const [dragValue, setDragValue] =
|
|
34653
|
+
const [dragValue, setDragValue] = useState78(null);
|
|
34419
34654
|
const onValueChange = useCallback127((newVal) => {
|
|
34420
34655
|
setDragValue(newVal);
|
|
34421
34656
|
onDragValueChange(newVal);
|
|
@@ -34473,7 +34708,7 @@ var TimelineNumberField = ({
|
|
|
34473
34708
|
};
|
|
34474
34709
|
|
|
34475
34710
|
// src/components/Timeline/TimelineRotationField.tsx
|
|
34476
|
-
import { useCallback as useCallback128, useMemo as useMemo136, useState as
|
|
34711
|
+
import { useCallback as useCallback128, useMemo as useMemo136, useState as useState79 } from "react";
|
|
34477
34712
|
import { jsx as jsx228 } from "react/jsx-runtime";
|
|
34478
34713
|
var TimelineRotationField = ({
|
|
34479
34714
|
field,
|
|
@@ -34483,7 +34718,7 @@ var TimelineRotationField = ({
|
|
|
34483
34718
|
onDragValueChange,
|
|
34484
34719
|
onDragEnd
|
|
34485
34720
|
}) => {
|
|
34486
|
-
const [dragValue, setDragValue] =
|
|
34721
|
+
const [dragValue, setDragValue] = useState79(null);
|
|
34487
34722
|
const isCssRotation = field.fieldSchema.type === "rotation-css";
|
|
34488
34723
|
const degrees = useMemo136(() => {
|
|
34489
34724
|
if (isCssRotation) {
|
|
@@ -34556,7 +34791,7 @@ var TimelineRotationField = ({
|
|
|
34556
34791
|
};
|
|
34557
34792
|
|
|
34558
34793
|
// src/components/Timeline/TimelineTransformOriginField.tsx
|
|
34559
|
-
import { useCallback as useCallback129, useMemo as useMemo137, useState as
|
|
34794
|
+
import { useCallback as useCallback129, useMemo as useMemo137, useState as useState80 } from "react";
|
|
34560
34795
|
import { jsx as jsx229, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
34561
34796
|
var leftDraggerStyle2 = {
|
|
34562
34797
|
paddingLeft: 0
|
|
@@ -34576,8 +34811,8 @@ var TimelineTransformOriginField = ({
|
|
|
34576
34811
|
onDragValueChange,
|
|
34577
34812
|
onDragEnd
|
|
34578
34813
|
}) => {
|
|
34579
|
-
const [dragX, setDragX] =
|
|
34580
|
-
const [dragY, setDragY] =
|
|
34814
|
+
const [dragX, setDragX] = useState80(null);
|
|
34815
|
+
const [dragY, setDragY] = useState80(null);
|
|
34581
34816
|
const parsed = useMemo137(() => parseTransformOrigin(effectiveValue), [effectiveValue]);
|
|
34582
34817
|
const percent = useMemo137(() => parsed === null ? null : parsedTransformOriginToPercent(parsed), [parsed]);
|
|
34583
34818
|
const configuredStep = field.fieldSchema.type === "transform-origin" ? field.fieldSchema.step : undefined;
|
|
@@ -34731,7 +34966,7 @@ var TimelineTransformOriginField = ({
|
|
|
34731
34966
|
};
|
|
34732
34967
|
|
|
34733
34968
|
// src/components/Timeline/TimelineTranslateField.tsx
|
|
34734
|
-
import { useCallback as useCallback130, useMemo as useMemo138, useState as
|
|
34969
|
+
import { useCallback as useCallback130, useMemo as useMemo138, useState as useState81 } from "react";
|
|
34735
34970
|
import { jsx as jsx230, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
34736
34971
|
var leftDraggerStyle3 = {
|
|
34737
34972
|
paddingLeft: 0
|
|
@@ -34751,8 +34986,8 @@ var TimelineTranslateField = ({
|
|
|
34751
34986
|
onDragValueChange,
|
|
34752
34987
|
onDragEnd
|
|
34753
34988
|
}) => {
|
|
34754
|
-
const [dragX, setDragX] =
|
|
34755
|
-
const [dragY, setDragY] =
|
|
34989
|
+
const [dragX, setDragX] = useState81(null);
|
|
34990
|
+
const [dragY, setDragY] = useState81(null);
|
|
34756
34991
|
const [codeX, codeY] = useMemo138(() => parseTranslate(String(effectiveValue ?? "0px 0px")), [effectiveValue]);
|
|
34757
34992
|
const configuredStep = field.fieldSchema.type === "translate" ? field.fieldSchema.step : undefined;
|
|
34758
34993
|
const step = configuredStep ?? 1;
|
|
@@ -34875,7 +35110,7 @@ var TimelineTranslateField = ({
|
|
|
34875
35110
|
};
|
|
34876
35111
|
|
|
34877
35112
|
// src/components/Timeline/TimelineUvCoordinateField.tsx
|
|
34878
|
-
import { useCallback as useCallback131, useMemo as useMemo139, useState as
|
|
35113
|
+
import { useCallback as useCallback131, useMemo as useMemo139, useState as useState82 } from "react";
|
|
34879
35114
|
import { jsx as jsx231, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
34880
35115
|
var leftDraggerStyle4 = {
|
|
34881
35116
|
paddingLeft: 0
|
|
@@ -34907,8 +35142,8 @@ var TimelineUvCoordinateField = ({
|
|
|
34907
35142
|
onDragValueChange,
|
|
34908
35143
|
onDragEnd
|
|
34909
35144
|
}) => {
|
|
34910
|
-
const [dragX, setDragX] =
|
|
34911
|
-
const [dragY, setDragY] =
|
|
35145
|
+
const [dragX, setDragX] = useState82(null);
|
|
35146
|
+
const [dragY, setDragY] = useState82(null);
|
|
34912
35147
|
const [codeX, codeY] = useMemo139(() => parseUvCoordinate2(effectiveValue), [effectiveValue]);
|
|
34913
35148
|
const configuredStep = field.fieldSchema.type === "uv-coordinate" ? field.fieldSchema.step : undefined;
|
|
34914
35149
|
const step = configuredStep ?? 0.01;
|
|
@@ -36548,7 +36783,7 @@ var TimelineMediaInfo = ({ src }) => {
|
|
|
36548
36783
|
};
|
|
36549
36784
|
|
|
36550
36785
|
// src/components/Timeline/TimelineSequenceName.tsx
|
|
36551
|
-
import { useCallback as useCallback136, useEffect as
|
|
36786
|
+
import { useCallback as useCallback136, useEffect as useEffect78, useMemo as useMemo147, useRef as useRef53, useState as useState83 } from "react";
|
|
36552
36787
|
import { jsx as jsx242, jsxs as jsxs115, Fragment as Fragment37 } from "react/jsx-runtime";
|
|
36553
36788
|
var MAX_DISPLAY_NAME_LENGTH = 1000;
|
|
36554
36789
|
var MAX_RENAME_INPUT_WIDTH = 240;
|
|
@@ -36568,7 +36803,7 @@ var TimelineSequenceName = ({
|
|
|
36568
36803
|
onSaveName
|
|
36569
36804
|
}) => {
|
|
36570
36805
|
const inputRef = useRef53(null);
|
|
36571
|
-
const [draftName, setDraftName] =
|
|
36806
|
+
const [draftName, setDraftName] = useState83(displayName);
|
|
36572
36807
|
const cancelNextBlurRef = useRef53(false);
|
|
36573
36808
|
const style10 = useMemo147(() => {
|
|
36574
36809
|
return {
|
|
@@ -36605,7 +36840,7 @@ var TimelineSequenceName = ({
|
|
|
36605
36840
|
};
|
|
36606
36841
|
}, [style10]);
|
|
36607
36842
|
const text2 = getTruncatedDisplayName(displayName) || "<Sequence>";
|
|
36608
|
-
|
|
36843
|
+
useEffect78(() => {
|
|
36609
36844
|
if (!editing) {
|
|
36610
36845
|
setDraftName(displayName);
|
|
36611
36846
|
return;
|
|
@@ -36787,10 +37022,10 @@ var TimelineSequenceItem = ({
|
|
|
36787
37022
|
const { onSelect, selectable, selected } = useTimelineRowSelection(nodePathInfo);
|
|
36788
37023
|
const { selectedItems } = useTimelineSelection();
|
|
36789
37024
|
const containsSelection = useTimelineRowContainsSelection(nodePathInfo);
|
|
36790
|
-
const [effectDropHovered, setEffectDropHovered] =
|
|
36791
|
-
const [isRenaming, setIsRenaming] =
|
|
36792
|
-
const [sequenceDropIndicator, setSequenceDropIndicator] =
|
|
36793
|
-
const [sequenceDropRejection, setSequenceDropRejection] =
|
|
37025
|
+
const [effectDropHovered, setEffectDropHovered] = useState84(false);
|
|
37026
|
+
const [isRenaming, setIsRenaming] = useState84(false);
|
|
37027
|
+
const [sequenceDropIndicator, setSequenceDropIndicator] = useState84(null);
|
|
37028
|
+
const [sequenceDropRejection, setSequenceDropRejection] = useState84(null);
|
|
36794
37029
|
const timelinePosition = Internals74.Timeline.useTimelinePosition();
|
|
36795
37030
|
const { canOpenInEditor, openInEditor: openInEditor2, originalLocation } = useOpenSequenceInEditor(sequence);
|
|
36796
37031
|
const fileLocation = useMemo149(() => formatFileLocation({
|
|
@@ -37464,7 +37699,7 @@ var TimelineList = ({ timeline }) => {
|
|
|
37464
37699
|
};
|
|
37465
37700
|
|
|
37466
37701
|
// src/components/Timeline/TimelinePinchZoom.tsx
|
|
37467
|
-
import { useCallback as useCallback139, useContext as useContext94, useEffect as
|
|
37702
|
+
import { useCallback as useCallback139, useContext as useContext94, useEffect as useEffect79, useRef as useRef54 } from "react";
|
|
37468
37703
|
import { Internals as Internals75 } from "remotion";
|
|
37469
37704
|
var ZOOM_WHEEL_DELTA = 0.06;
|
|
37470
37705
|
var TimelinePinchZoom = () => {
|
|
@@ -37521,7 +37756,7 @@ var TimelinePinchZoom = () => {
|
|
|
37521
37756
|
setZoom
|
|
37522
37757
|
]);
|
|
37523
37758
|
const supportsWebKitPinch = typeof window !== "undefined" && "GestureEvent" in window;
|
|
37524
|
-
|
|
37759
|
+
useEffect79(() => {
|
|
37525
37760
|
const el = timelineVerticalScroll.current;
|
|
37526
37761
|
if (!el) {
|
|
37527
37762
|
return;
|
|
@@ -37531,7 +37766,7 @@ var TimelinePinchZoom = () => {
|
|
|
37531
37766
|
el.removeEventListener("wheel", onWheel);
|
|
37532
37767
|
};
|
|
37533
37768
|
}, [onWheel]);
|
|
37534
|
-
|
|
37769
|
+
useEffect79(() => {
|
|
37535
37770
|
const el = timelineVerticalScroll.current;
|
|
37536
37771
|
if (!el || !editorZoomGestures || !supportsWebKitPinch) {
|
|
37537
37772
|
return;
|
|
@@ -37603,7 +37838,7 @@ var TimelinePinchZoom = () => {
|
|
|
37603
37838
|
canvasContent,
|
|
37604
37839
|
setZoom
|
|
37605
37840
|
]);
|
|
37606
|
-
|
|
37841
|
+
useEffect79(() => {
|
|
37607
37842
|
const el = timelineVerticalScroll.current;
|
|
37608
37843
|
if (!el || !editorZoomGestures) {
|
|
37609
37844
|
return;
|
|
@@ -37681,7 +37916,7 @@ var TimelinePinchZoom = () => {
|
|
|
37681
37916
|
};
|
|
37682
37917
|
|
|
37683
37918
|
// src/components/Timeline/TimelinePlayCursorSyncer.tsx
|
|
37684
|
-
import { useContext as useContext95, useEffect as
|
|
37919
|
+
import { useContext as useContext95, useEffect as useEffect80 } from "react";
|
|
37685
37920
|
import { Internals as Internals76 } from "remotion";
|
|
37686
37921
|
var lastTimelinePositionWhileScrolling = null;
|
|
37687
37922
|
var TimelinePlayCursorSyncer = () => {
|
|
@@ -37699,7 +37934,7 @@ var TimelinePlayCursorSyncer = () => {
|
|
|
37699
37934
|
setCurrentDuration(video.durationInFrames);
|
|
37700
37935
|
setCurrentFps(video.fps);
|
|
37701
37936
|
}
|
|
37702
|
-
|
|
37937
|
+
useEffect80(() => {
|
|
37703
37938
|
if (!video) {
|
|
37704
37939
|
return;
|
|
37705
37940
|
}
|
|
@@ -37712,7 +37947,7 @@ var TimelinePlayCursorSyncer = () => {
|
|
|
37712
37947
|
frame: timelinePosition
|
|
37713
37948
|
});
|
|
37714
37949
|
}, [playbackRate, playing, timelinePosition, video]);
|
|
37715
|
-
|
|
37950
|
+
useEffect80(() => {
|
|
37716
37951
|
const { current } = scrollableRef;
|
|
37717
37952
|
if (!current) {
|
|
37718
37953
|
return;
|
|
@@ -37834,7 +38069,7 @@ import {
|
|
|
37834
38069
|
useCallback as useCallback140,
|
|
37835
38070
|
useContext as useContext96,
|
|
37836
38071
|
useMemo as useMemo151,
|
|
37837
|
-
useState as
|
|
38072
|
+
useState as useState85
|
|
37838
38073
|
} from "react";
|
|
37839
38074
|
import { jsx as jsx246 } from "react/jsx-runtime";
|
|
37840
38075
|
var emptyDraggedKeyframes = new Set;
|
|
@@ -37854,7 +38089,7 @@ var TimelineKeyframeDragStateContext = createContext25({
|
|
|
37854
38089
|
}
|
|
37855
38090
|
});
|
|
37856
38091
|
var TimelineKeyframeDragStateProvider = ({ children }) => {
|
|
37857
|
-
const [draggedKeys, setDraggedKeys] =
|
|
38092
|
+
const [draggedKeys, setDraggedKeys] = useState85(emptyDraggedKeyframes);
|
|
37858
38093
|
const setDraggedKeyframes = useCallback140((keyframes) => {
|
|
37859
38094
|
setDraggedKeys(new Set(keyframes.map(getTimelineKeyframeDragKey)));
|
|
37860
38095
|
}, []);
|
|
@@ -39221,7 +39456,7 @@ var getTimelineSequenceLayout = ({
|
|
|
39221
39456
|
};
|
|
39222
39457
|
|
|
39223
39458
|
// src/helpers/use-max-media-duration.ts
|
|
39224
|
-
import { useEffect as
|
|
39459
|
+
import { useEffect as useEffect81, useState as useState86 } from "react";
|
|
39225
39460
|
var cache2 = new Map;
|
|
39226
39461
|
var getCacheKey = (src, fps) => JSON.stringify([src, fps]);
|
|
39227
39462
|
var getSrc = (s) => {
|
|
@@ -39236,8 +39471,8 @@ var getSrc = (s) => {
|
|
|
39236
39471
|
var useMaxMediaDuration = (s, fps) => {
|
|
39237
39472
|
const src = getSrc(s);
|
|
39238
39473
|
const cacheKey = src ? getCacheKey(src, fps) : null;
|
|
39239
|
-
const [maxMediaDuration, setMaxMediaDuration] =
|
|
39240
|
-
|
|
39474
|
+
const [maxMediaDuration, setMaxMediaDuration] = useState86(cacheKey ? cache2.get(cacheKey) ?? null : Infinity);
|
|
39475
|
+
useEffect81(() => {
|
|
39241
39476
|
if (!src || !cacheKey) {
|
|
39242
39477
|
return;
|
|
39243
39478
|
}
|
|
@@ -39279,7 +39514,7 @@ import {
|
|
|
39279
39514
|
shouldTileLoopDisplay,
|
|
39280
39515
|
sliceWaveformPeaks
|
|
39281
39516
|
} from "@remotion/timeline-utils";
|
|
39282
|
-
import { useEffect as
|
|
39517
|
+
import { useEffect as useEffect82, useMemo as useMemo155, useRef as useRef57, useState as useState87 } from "react";
|
|
39283
39518
|
import { Internals as Internals81 } from "remotion";
|
|
39284
39519
|
import { jsx as jsx251, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
39285
39520
|
var EMPTY_PEAKS = new Float32Array(0);
|
|
@@ -39368,9 +39603,9 @@ var AudioWaveform = ({
|
|
|
39368
39603
|
playbackRate,
|
|
39369
39604
|
loopDisplay
|
|
39370
39605
|
}) => {
|
|
39371
|
-
const [peaks, setPeaks] =
|
|
39372
|
-
const [error, setError] =
|
|
39373
|
-
const [waveformCanvasKey, setWaveformCanvasKey] =
|
|
39606
|
+
const [peaks, setPeaks] = useState87(null);
|
|
39607
|
+
const [error, setError] = useState87(null);
|
|
39608
|
+
const [waveformCanvasKey, setWaveformCanvasKey] = useState87(0);
|
|
39374
39609
|
const canUseWorkerPath = useMemo155(() => canUseAudioWaveformWorker(), []);
|
|
39375
39610
|
const vidConf = Internals81.useUnsafeVideoConfig();
|
|
39376
39611
|
if (vidConf === null) {
|
|
@@ -39382,7 +39617,7 @@ var AudioWaveform = ({
|
|
|
39382
39617
|
const hasTransferredCanvas = useRef57(false);
|
|
39383
39618
|
const latestRequestId = useRef57(0);
|
|
39384
39619
|
const shouldRenderVolumeOverlay = doesVolumeChange && typeof volume === "string";
|
|
39385
|
-
|
|
39620
|
+
useEffect82(() => {
|
|
39386
39621
|
if (canUseWorkerPath) {
|
|
39387
39622
|
return;
|
|
39388
39623
|
}
|
|
@@ -39400,7 +39635,7 @@ var AudioWaveform = ({
|
|
|
39400
39635
|
});
|
|
39401
39636
|
return () => controller.abort();
|
|
39402
39637
|
}, [canUseWorkerPath, src]);
|
|
39403
|
-
|
|
39638
|
+
useEffect82(() => {
|
|
39404
39639
|
if (!canUseWorkerPath) {
|
|
39405
39640
|
return;
|
|
39406
39641
|
}
|
|
@@ -39473,7 +39708,7 @@ var AudioWaveform = ({
|
|
|
39473
39708
|
startFrom,
|
|
39474
39709
|
vidConf.fps
|
|
39475
39710
|
]);
|
|
39476
|
-
|
|
39711
|
+
useEffect82(() => {
|
|
39477
39712
|
const { current: canvasElement } = waveformCanvas;
|
|
39478
39713
|
if (!canvasElement) {
|
|
39479
39714
|
return;
|
|
@@ -39540,7 +39775,7 @@ var AudioWaveform = ({
|
|
|
39540
39775
|
volume,
|
|
39541
39776
|
waveformCanvasKey
|
|
39542
39777
|
]);
|
|
39543
|
-
|
|
39778
|
+
useEffect82(() => {
|
|
39544
39779
|
if (!shouldRenderVolumeOverlay) {
|
|
39545
39780
|
return;
|
|
39546
39781
|
}
|
|
@@ -39678,7 +39913,7 @@ var LoopedTimelineIndicator = ({ loops }) => {
|
|
|
39678
39913
|
|
|
39679
39914
|
// src/components/Timeline/TimelineImageInfo.tsx
|
|
39680
39915
|
import { drawRepeatingImageThumbnail } from "@remotion/timeline-utils";
|
|
39681
|
-
import { useEffect as
|
|
39916
|
+
import { useEffect as useEffect83, useRef as useRef58 } from "react";
|
|
39682
39917
|
import { jsx as jsx254 } from "react/jsx-runtime";
|
|
39683
39918
|
var HEIGHT = getTimelineLayerHeight("image") - 2;
|
|
39684
39919
|
var containerStyle9 = {
|
|
@@ -39691,7 +39926,7 @@ var containerStyle9 = {
|
|
|
39691
39926
|
};
|
|
39692
39927
|
var TimelineImageInfo = ({ src, visualizationWidth }) => {
|
|
39693
39928
|
const ref2 = useRef58(null);
|
|
39694
|
-
|
|
39929
|
+
useEffect83(() => {
|
|
39695
39930
|
const { current } = ref2;
|
|
39696
39931
|
if (!current) {
|
|
39697
39932
|
return;
|
|
@@ -39770,9 +40005,9 @@ import { stringifySequenceSubscriptionKey as stringifySequenceSubscriptionKey4 }
|
|
|
39770
40005
|
import {
|
|
39771
40006
|
useCallback as useCallback143,
|
|
39772
40007
|
useContext as useContext102,
|
|
39773
|
-
useEffect as
|
|
40008
|
+
useEffect as useEffect84,
|
|
39774
40009
|
useRef as useRef59,
|
|
39775
|
-
useState as
|
|
40010
|
+
useState as useState88
|
|
39776
40011
|
} from "react";
|
|
39777
40012
|
import { Internals as Internals82 } from "remotion";
|
|
39778
40013
|
import { NoReactInternals as NoReactInternals26 } from "remotion/no-react";
|
|
@@ -39976,7 +40211,7 @@ var useTimelineSequenceFromDrag = ({
|
|
|
39976
40211
|
const { overrideIdToNodePathMappings } = useContext102(Internals82.OverrideIdsToNodePathsGettersContext);
|
|
39977
40212
|
const { previewServerState } = useContext102(StudioServerConnectionCtx);
|
|
39978
40213
|
const currentSelection = useCurrentTimelineSelectionStateAsRef();
|
|
39979
|
-
const [dragging, setDragging] =
|
|
40214
|
+
const [dragging, setDragging] = useState88(false);
|
|
39980
40215
|
const dragStateRef = useRef59(null);
|
|
39981
40216
|
const latestRef = useRef59({
|
|
39982
40217
|
nodePathInfo,
|
|
@@ -40079,7 +40314,7 @@ var useTimelineSequenceFromDrag = ({
|
|
|
40079
40314
|
timelineDurationInFrames,
|
|
40080
40315
|
windowWidth
|
|
40081
40316
|
]);
|
|
40082
|
-
|
|
40317
|
+
useEffect84(() => {
|
|
40083
40318
|
if (!dragging) {
|
|
40084
40319
|
return;
|
|
40085
40320
|
}
|
|
@@ -40138,7 +40373,7 @@ var TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timeline
|
|
|
40138
40373
|
const { overrideIdToNodePathMappings } = useContext102(Internals82.OverrideIdsToNodePathsGettersContext);
|
|
40139
40374
|
const { previewServerState } = useContext102(StudioServerConnectionCtx);
|
|
40140
40375
|
const currentSelection = useCurrentTimelineSelectionStateAsRef();
|
|
40141
|
-
const [dragging, setDragging] =
|
|
40376
|
+
const [dragging, setDragging] = useState88(false);
|
|
40142
40377
|
const dragStateRef = useRef59(null);
|
|
40143
40378
|
const latestRef = useRef59({
|
|
40144
40379
|
nodePathInfo,
|
|
@@ -40241,7 +40476,7 @@ var TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timeline
|
|
|
40241
40476
|
timelineDurationInFrames,
|
|
40242
40477
|
windowWidth
|
|
40243
40478
|
]);
|
|
40244
|
-
|
|
40479
|
+
useEffect84(() => {
|
|
40245
40480
|
if (!dragging) {
|
|
40246
40481
|
return;
|
|
40247
40482
|
}
|
|
@@ -40310,14 +40545,17 @@ import {
|
|
|
40310
40545
|
extractFrames,
|
|
40311
40546
|
fillFrameWhereItFits,
|
|
40312
40547
|
fillWithCachedFrames,
|
|
40548
|
+
frameDatabase,
|
|
40313
40549
|
getAspectRatioFromCache,
|
|
40550
|
+
getFrameDatabaseKeyPrefix,
|
|
40314
40551
|
getLoopDisplayWidth as getLoopDisplayWidth2,
|
|
40552
|
+
getTimestampFromFrameDatabaseKey,
|
|
40315
40553
|
makeFrameDatabaseKey,
|
|
40316
40554
|
resizeVideoFrame,
|
|
40317
|
-
shouldTileLoopDisplay as
|
|
40555
|
+
shouldTileLoopDisplay as shouldTileLoopDisplay3,
|
|
40318
40556
|
WEBCODECS_TIMESCALE
|
|
40319
40557
|
} from "@remotion/timeline-utils";
|
|
40320
|
-
import { useEffect as
|
|
40558
|
+
import { useEffect as useEffect85, useMemo as useMemo156, useRef as useRef60, useState as useState89 } from "react";
|
|
40321
40559
|
import { useVideoConfig as useVideoConfig10 } from "remotion";
|
|
40322
40560
|
|
|
40323
40561
|
// src/components/Timeline/get-timeline-video-info-widths.ts
|
|
@@ -40334,6 +40572,31 @@ var getTimelineVideoInfoWidths = ({
|
|
|
40334
40572
|
};
|
|
40335
40573
|
};
|
|
40336
40574
|
|
|
40575
|
+
// src/components/Timeline/timeline-video-filmstrip-times.ts
|
|
40576
|
+
import { shouldTileLoopDisplay as shouldTileLoopDisplay2 } from "@remotion/timeline-utils";
|
|
40577
|
+
var getTimelineVideoFilmstripTimes = ({
|
|
40578
|
+
trimBefore,
|
|
40579
|
+
durationInFrames,
|
|
40580
|
+
playbackRate,
|
|
40581
|
+
fps,
|
|
40582
|
+
loopDisplay,
|
|
40583
|
+
frozenMediaFrame
|
|
40584
|
+
}) => {
|
|
40585
|
+
if (frozenMediaFrame !== null) {
|
|
40586
|
+
return {
|
|
40587
|
+
type: "frozen",
|
|
40588
|
+
timestampInSeconds: Math.max(0, frozenMediaFrame / fps)
|
|
40589
|
+
};
|
|
40590
|
+
}
|
|
40591
|
+
const fromSeconds = trimBefore / fps;
|
|
40592
|
+
const visibleDurationInFrames = shouldTileLoopDisplay2(loopDisplay) && loopDisplay ? loopDisplay.durationInFrames : durationInFrames;
|
|
40593
|
+
return {
|
|
40594
|
+
type: "range",
|
|
40595
|
+
fromSeconds,
|
|
40596
|
+
toSeconds: fromSeconds + visibleDurationInFrames * playbackRate / fps
|
|
40597
|
+
};
|
|
40598
|
+
};
|
|
40599
|
+
|
|
40337
40600
|
// src/components/Timeline/TimelineVideoInfo.tsx
|
|
40338
40601
|
import { jsx as jsx257, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
40339
40602
|
var outerStyle = {
|
|
@@ -40350,6 +40613,7 @@ var filmstripContainerStyle = {
|
|
|
40350
40613
|
fontSize: 10,
|
|
40351
40614
|
fontFamily: "Arial, Helvetica"
|
|
40352
40615
|
};
|
|
40616
|
+
var MAX_FROZEN_FRAME_CACHE_DEVIATION = WEBCODECS_TIMESCALE * 0.05;
|
|
40353
40617
|
var TimelineVideoInfo = ({
|
|
40354
40618
|
src,
|
|
40355
40619
|
visualizationWidth,
|
|
@@ -40361,11 +40625,12 @@ var TimelineVideoInfo = ({
|
|
|
40361
40625
|
doesVolumeChange,
|
|
40362
40626
|
premountWidth,
|
|
40363
40627
|
postmountWidth,
|
|
40364
|
-
loopDisplay
|
|
40628
|
+
loopDisplay,
|
|
40629
|
+
frozenMediaFrame
|
|
40365
40630
|
}) => {
|
|
40366
40631
|
const { fps } = useVideoConfig10();
|
|
40367
40632
|
const ref2 = useRef60(null);
|
|
40368
|
-
const [error, setError] =
|
|
40633
|
+
const [error, setError] = useState89(null);
|
|
40369
40634
|
const aspectRatio = useRef60(getAspectRatioFromCache(src));
|
|
40370
40635
|
const { mediaVisualizationWidth, mediaNaturalWidth } = useMemo156(() => {
|
|
40371
40636
|
return getTimelineVideoInfoWidths({
|
|
@@ -40375,7 +40640,7 @@ var TimelineVideoInfo = ({
|
|
|
40375
40640
|
postmountWidth
|
|
40376
40641
|
});
|
|
40377
40642
|
}, [naturalWidth, postmountWidth, premountWidth, visualizationWidth]);
|
|
40378
|
-
|
|
40643
|
+
useEffect85(() => {
|
|
40379
40644
|
if (error) {
|
|
40380
40645
|
return;
|
|
40381
40646
|
}
|
|
@@ -40392,11 +40657,96 @@ var TimelineVideoInfo = ({
|
|
|
40392
40657
|
return;
|
|
40393
40658
|
}
|
|
40394
40659
|
current.appendChild(canvas);
|
|
40660
|
+
const drawRepeatedFrame = (frame2) => {
|
|
40661
|
+
const thumbnailWidth = Math.max(1, frame2.displayWidth / window.devicePixelRatio);
|
|
40662
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
40663
|
+
for (let x = 0;x < canvas.width; x += thumbnailWidth) {
|
|
40664
|
+
ctx.drawImage(frame2, x, 0, thumbnailWidth, TIMELINE_LAYER_FILMSTRIP_HEIGHT);
|
|
40665
|
+
}
|
|
40666
|
+
};
|
|
40667
|
+
const getCachedFrozenFrame = (timestamp) => {
|
|
40668
|
+
const prefix = getFrameDatabaseKeyPrefix(src);
|
|
40669
|
+
const keys = Array.from(frameDatabase.keys()).filter((k) => k.startsWith(prefix));
|
|
40670
|
+
let bestDistance = Infinity;
|
|
40671
|
+
let bestFrame = null;
|
|
40672
|
+
for (const key5 of keys) {
|
|
40673
|
+
const frame2 = frameDatabase.get(key5);
|
|
40674
|
+
if (!frame2) {
|
|
40675
|
+
continue;
|
|
40676
|
+
}
|
|
40677
|
+
const distance = Math.abs(getTimestampFromFrameDatabaseKey(key5) - timestamp);
|
|
40678
|
+
if (distance < bestDistance) {
|
|
40679
|
+
bestDistance = distance;
|
|
40680
|
+
bestFrame = frame2.frame;
|
|
40681
|
+
}
|
|
40682
|
+
}
|
|
40683
|
+
return bestDistance <= MAX_FROZEN_FRAME_CACHE_DEVIATION ? bestFrame : null;
|
|
40684
|
+
};
|
|
40685
|
+
const times = getTimelineVideoFilmstripTimes({
|
|
40686
|
+
trimBefore,
|
|
40687
|
+
durationInFrames,
|
|
40688
|
+
playbackRate,
|
|
40689
|
+
fps,
|
|
40690
|
+
loopDisplay,
|
|
40691
|
+
frozenMediaFrame
|
|
40692
|
+
});
|
|
40693
|
+
if (times.type === "frozen") {
|
|
40694
|
+
const timestamp = times.timestampInSeconds * WEBCODECS_TIMESCALE;
|
|
40695
|
+
const cachedFrame = getCachedFrozenFrame(timestamp);
|
|
40696
|
+
if (cachedFrame) {
|
|
40697
|
+
drawRepeatedFrame(cachedFrame);
|
|
40698
|
+
return () => {
|
|
40699
|
+
current.removeChild(canvas);
|
|
40700
|
+
};
|
|
40701
|
+
}
|
|
40702
|
+
extractFrames({
|
|
40703
|
+
timestampsInSeconds: ({
|
|
40704
|
+
track
|
|
40705
|
+
}) => {
|
|
40706
|
+
aspectRatio.current = track.width / track.height;
|
|
40707
|
+
aspectRatioCache.set(src, aspectRatio.current);
|
|
40708
|
+
return [times.timestampInSeconds];
|
|
40709
|
+
},
|
|
40710
|
+
src,
|
|
40711
|
+
onVideoSample: (sample) => {
|
|
40712
|
+
let frame2;
|
|
40713
|
+
try {
|
|
40714
|
+
frame2 = sample.toVideoFrame();
|
|
40715
|
+
const scale = TIMELINE_LAYER_FILMSTRIP_HEIGHT / frame2.displayHeight * window.devicePixelRatio;
|
|
40716
|
+
const transformed = resizeVideoFrame({
|
|
40717
|
+
frame: frame2,
|
|
40718
|
+
scale
|
|
40719
|
+
});
|
|
40720
|
+
if (transformed !== frame2) {
|
|
40721
|
+
frame2.close();
|
|
40722
|
+
}
|
|
40723
|
+
frame2 = undefined;
|
|
40724
|
+
const databaseKey = makeFrameDatabaseKey(src, transformed.timestamp);
|
|
40725
|
+
addFrameToCache(databaseKey, transformed);
|
|
40726
|
+
drawRepeatedFrame(transformed);
|
|
40727
|
+
} catch (e) {
|
|
40728
|
+
if (frame2) {
|
|
40729
|
+
frame2.close();
|
|
40730
|
+
}
|
|
40731
|
+
throw e;
|
|
40732
|
+
} finally {
|
|
40733
|
+
sample.close();
|
|
40734
|
+
}
|
|
40735
|
+
},
|
|
40736
|
+
signal: controller.signal
|
|
40737
|
+
}).catch((e) => {
|
|
40738
|
+
setError(e);
|
|
40739
|
+
});
|
|
40740
|
+
return () => {
|
|
40741
|
+
controller.abort();
|
|
40742
|
+
current.removeChild(canvas);
|
|
40743
|
+
};
|
|
40744
|
+
}
|
|
40395
40745
|
const loopWidth = getLoopDisplayWidth2({
|
|
40396
40746
|
visualizationWidth: mediaNaturalWidth,
|
|
40397
40747
|
loopDisplay
|
|
40398
40748
|
});
|
|
40399
|
-
const shouldRepeatVideo =
|
|
40749
|
+
const shouldRepeatVideo = shouldTileLoopDisplay3(loopDisplay);
|
|
40400
40750
|
const targetCanvas = shouldRepeatVideo ? document.createElement("canvas") : canvas;
|
|
40401
40751
|
targetCanvas.width = shouldRepeatVideo ? Math.max(1, Math.ceil(loopWidth)) : canvas.width;
|
|
40402
40752
|
targetCanvas.height = canvas.height;
|
|
@@ -40419,9 +40769,7 @@ var TimelineVideoInfo = ({
|
|
|
40419
40769
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
40420
40770
|
};
|
|
40421
40771
|
const filledSlots = new Map;
|
|
40422
|
-
const fromSeconds
|
|
40423
|
-
const visibleDurationInFrames = shouldRepeatVideo && loopDisplay ? loopDisplay.durationInFrames : durationInFrames;
|
|
40424
|
-
const toSeconds = fromSeconds + visibleDurationInFrames * playbackRate / fps;
|
|
40772
|
+
const { fromSeconds, toSeconds } = times;
|
|
40425
40773
|
const targetWidth = shouldRepeatVideo ? targetCanvas.width : mediaNaturalWidth;
|
|
40426
40774
|
if (aspectRatio.current !== null) {
|
|
40427
40775
|
ensureSlots({
|
|
@@ -40540,6 +40888,7 @@ var TimelineVideoInfo = ({
|
|
|
40540
40888
|
durationInFrames,
|
|
40541
40889
|
error,
|
|
40542
40890
|
fps,
|
|
40891
|
+
frozenMediaFrame,
|
|
40543
40892
|
loopDisplay,
|
|
40544
40893
|
mediaNaturalWidth,
|
|
40545
40894
|
mediaVisualizationWidth,
|
|
@@ -40859,9 +41208,7 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
|
|
|
40859
41208
|
onSelect({ shiftKey: false, toggleKey: false });
|
|
40860
41209
|
}
|
|
40861
41210
|
}, [onSelect, selectable]);
|
|
40862
|
-
const
|
|
40863
|
-
const runtimeFreezeFrame = typeof s.controls?.currentRuntimeValueDotNotation.freeze === "number" ? s.controls.currentRuntimeValueDotNotation.freeze : null;
|
|
40864
|
-
const frozenFrame = freezeStatus?.status === "static" ? typeof freezeStatus.codeValue === "number" ? freezeStatus.codeValue : null : runtimeFreezeFrame;
|
|
41211
|
+
const { frozenFrame } = s;
|
|
40865
41212
|
const { onPointerDown: onMoveDragPointerDown } = useTimelineSequenceFromDrag({
|
|
40866
41213
|
nodePathInfo,
|
|
40867
41214
|
windowWidth,
|
|
@@ -40940,7 +41287,8 @@ var TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffset
|
|
|
40940
41287
|
doesVolumeChange: s.doesVolumeChange,
|
|
40941
41288
|
premountWidth: premountWidth ?? 0,
|
|
40942
41289
|
postmountWidth: postmountWidth ?? 0,
|
|
40943
|
-
loopDisplay: s.loopDisplay
|
|
41290
|
+
loopDisplay: s.loopDisplay,
|
|
41291
|
+
frozenMediaFrame: s.frozenMediaFrame
|
|
40944
41292
|
}) : null,
|
|
40945
41293
|
s.type === "image" ? /* @__PURE__ */ jsx258(TimelineImageInfo, {
|
|
40946
41294
|
src: s.src,
|
|
@@ -41055,8 +41403,8 @@ var noop3 = () => {
|
|
|
41055
41403
|
var TimelineContextMenuArea = ({ children }) => {
|
|
41056
41404
|
const { compositions, canvasContent } = useContext105(Internals84.CompositionManager);
|
|
41057
41405
|
const videoConfig = Internals84.useUnsafeVideoConfig();
|
|
41058
|
-
const [isAddingSolid, setIsAddingSolid] =
|
|
41059
|
-
const [isAddingAsset, setIsAddingAsset] =
|
|
41406
|
+
const [isAddingSolid, setIsAddingSolid] = useState90(false);
|
|
41407
|
+
const [isAddingAsset, setIsAddingAsset] = useState90(false);
|
|
41060
41408
|
const { previewServerState } = useContext105(StudioServerConnectionCtx);
|
|
41061
41409
|
const previewConnected = previewServerState.type === "connected";
|
|
41062
41410
|
const currentCompositionId = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
@@ -41341,13 +41689,13 @@ var EditorContent = ({ readOnlyStudio, children }) => {
|
|
|
41341
41689
|
};
|
|
41342
41690
|
|
|
41343
41691
|
// src/components/GlobalKeybindings.tsx
|
|
41344
|
-
import { useContext as useContext107, useEffect as
|
|
41692
|
+
import { useContext as useContext107, useEffect as useEffect86 } from "react";
|
|
41345
41693
|
var GlobalKeybindings = () => {
|
|
41346
41694
|
const keybindings = useKeybinding();
|
|
41347
41695
|
const { setSelectedModal } = useContext107(ModalsContext);
|
|
41348
41696
|
const { setCheckerboard } = useContext107(CheckerboardContext);
|
|
41349
41697
|
const { navigateToNextComposition, navigateToPreviousComposition } = useCompositionNavigation();
|
|
41350
|
-
|
|
41698
|
+
useEffect86(() => {
|
|
41351
41699
|
const nKey = keybindings.registerKeybinding({
|
|
41352
41700
|
event: "keypress",
|
|
41353
41701
|
key: "n",
|
|
@@ -41470,7 +41818,7 @@ import {
|
|
|
41470
41818
|
extraPackages,
|
|
41471
41819
|
installableMap
|
|
41472
41820
|
} from "@remotion/studio-shared";
|
|
41473
|
-
import React194, { useCallback as useCallback148, useContext as useContext109, useEffect as
|
|
41821
|
+
import React194, { useCallback as useCallback148, useContext as useContext109, useEffect as useEffect87 } from "react";
|
|
41474
41822
|
import { VERSION as VERSION2 } from "remotion";
|
|
41475
41823
|
|
|
41476
41824
|
// src/components/InstallablePackage.tsx
|
|
@@ -41556,7 +41904,7 @@ var InstallPackageModal = ({ packageManager }) => {
|
|
|
41556
41904
|
const canSelectPackages = state.type === "idle" && ctx.type === "connected";
|
|
41557
41905
|
const disabled = !(canSelectPackages || state.type === "done") || selectedPackages.length === 0;
|
|
41558
41906
|
const { registerKeybinding } = useKeybinding();
|
|
41559
|
-
|
|
41907
|
+
useEffect87(() => {
|
|
41560
41908
|
if (disabled) {
|
|
41561
41909
|
return;
|
|
41562
41910
|
}
|
|
@@ -41710,7 +42058,7 @@ var InstallPackageModal = ({ packageManager }) => {
|
|
|
41710
42058
|
import { useCallback as useCallback150, useContext as useContext112, useMemo as useMemo163 } from "react";
|
|
41711
42059
|
|
|
41712
42060
|
// src/components/RenderModal/ResolveCompositionBeforeModal.tsx
|
|
41713
|
-
import React195, { useContext as useContext110, useEffect as
|
|
42061
|
+
import React195, { useContext as useContext110, useEffect as useEffect88, useMemo as useMemo161 } from "react";
|
|
41714
42062
|
import { Internals as Internals86 } from "remotion";
|
|
41715
42063
|
import { jsx as jsx267, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
41716
42064
|
var loaderContainer2 = {
|
|
@@ -41734,7 +42082,7 @@ var ResolveCompositionBeforeModal = ({ compositionId, children }) => {
|
|
|
41734
42082
|
const resolved = Internals86.useResolvedVideoConfig(compositionId);
|
|
41735
42083
|
const unresolvedContext = useContext110(Internals86.CompositionManager);
|
|
41736
42084
|
const unresolved = unresolvedContext.compositions.find((c) => compositionId === c.id);
|
|
41737
|
-
|
|
42085
|
+
useEffect88(() => {
|
|
41738
42086
|
const { current } = Internals86.resolveCompositionsRef;
|
|
41739
42087
|
if (!current) {
|
|
41740
42088
|
throw new Error("No ref to trigger composition calc");
|
|
@@ -41795,9 +42143,9 @@ var ResolveCompositionBeforeModal = ({ compositionId, children }) => {
|
|
|
41795
42143
|
import {
|
|
41796
42144
|
useCallback as useCallback149,
|
|
41797
42145
|
useContext as useContext111,
|
|
41798
|
-
useEffect as
|
|
42146
|
+
useEffect as useEffect89,
|
|
41799
42147
|
useMemo as useMemo162,
|
|
41800
|
-
useState as
|
|
42148
|
+
useState as useState91
|
|
41801
42149
|
} from "react";
|
|
41802
42150
|
|
|
41803
42151
|
// src/helpers/resolved-stack-to-symbolicated.ts
|
|
@@ -41873,9 +42221,9 @@ var CodemodFooter = ({
|
|
|
41873
42221
|
submitLabel,
|
|
41874
42222
|
onSuccess
|
|
41875
42223
|
}) => {
|
|
41876
|
-
const [submitting, setSubmitting] =
|
|
42224
|
+
const [submitting, setSubmitting] = useState91(false);
|
|
41877
42225
|
const { setSelectedModal } = useContext111(ModalsContext);
|
|
41878
|
-
const [codemodStatus, setCanApplyCodemod] =
|
|
42226
|
+
const [codemodStatus, setCanApplyCodemod] = useState91({
|
|
41879
42227
|
type: "loading"
|
|
41880
42228
|
});
|
|
41881
42229
|
const resolvedLocation = useResolvedStack(stack2);
|
|
@@ -41921,7 +42269,7 @@ var CodemodFooter = ({
|
|
|
41921
42269
|
});
|
|
41922
42270
|
}
|
|
41923
42271
|
}, [codemod, symbolicatedStack]);
|
|
41924
|
-
|
|
42272
|
+
useEffect89(() => {
|
|
41925
42273
|
if (!stack2) {
|
|
41926
42274
|
setCanApplyCodemod({
|
|
41927
42275
|
type: "fail",
|
|
@@ -41956,7 +42304,7 @@ var CodemodFooter = ({
|
|
|
41956
42304
|
}, [errorNotification, getCanApplyCodemod, stack2, symbolicatedStack]);
|
|
41957
42305
|
const disabled = !valid || submitting || symbolicatedStack === null || codemodStatus.type !== "success";
|
|
41958
42306
|
const { registerKeybinding } = useKeybinding();
|
|
41959
|
-
|
|
42307
|
+
useEffect89(() => {
|
|
41960
42308
|
if (disabled) {
|
|
41961
42309
|
return;
|
|
41962
42310
|
}
|
|
@@ -42153,7 +42501,7 @@ var DeleteFolder = ({ folderName, parentName, stack: stack2 }) => {
|
|
|
42153
42501
|
};
|
|
42154
42502
|
|
|
42155
42503
|
// src/components/NewComposition/DuplicateComposition.tsx
|
|
42156
|
-
import { useCallback as useCallback153, useContext as useContext113, useMemo as useMemo165, useState as
|
|
42504
|
+
import { useCallback as useCallback153, useContext as useContext113, useMemo as useMemo165, useState as useState92 } from "react";
|
|
42157
42505
|
import { Internals as Internals88 } from "remotion";
|
|
42158
42506
|
|
|
42159
42507
|
// src/helpers/validate-new-comp-data.ts
|
|
@@ -42265,14 +42613,14 @@ var DuplicateCompositionLoaded = ({ initialType }) => {
|
|
|
42265
42613
|
}
|
|
42266
42614
|
const { resolved, unresolved } = context;
|
|
42267
42615
|
const compositionStack = unresolved.stack ?? null;
|
|
42268
|
-
const [initialCompType] =
|
|
42616
|
+
const [initialCompType] = useState92(initialType);
|
|
42269
42617
|
const hadDimensionsDefined = unresolved.width && unresolved.height;
|
|
42270
42618
|
const hadFpsDefined = unresolved.fps !== undefined;
|
|
42271
42619
|
const hadDurationDefined = unresolved.durationInFrames !== undefined;
|
|
42272
|
-
const [selectedFrameRate, setFrameRate] =
|
|
42620
|
+
const [selectedFrameRate, setFrameRate] = useState92(resolved.result.fps);
|
|
42273
42621
|
const { compositions } = useContext113(Internals88.CompositionManager);
|
|
42274
|
-
const [type, setType] =
|
|
42275
|
-
const [newId, setName] =
|
|
42622
|
+
const [type, setType] = useState92(initialCompType);
|
|
42623
|
+
const [newId, setName] = useState92(() => {
|
|
42276
42624
|
const numberAtEnd = resolved.result.id.match(/([0-9]+)$/)?.[0];
|
|
42277
42625
|
let prefix = numberAtEnd ? Number(numberAtEnd) : 1;
|
|
42278
42626
|
const initialName = resolved.result.id.replace(/([0-9]+)$/, "");
|
|
@@ -42287,11 +42635,11 @@ var DuplicateCompositionLoaded = ({ initialType }) => {
|
|
|
42287
42635
|
}
|
|
42288
42636
|
return currentName;
|
|
42289
42637
|
});
|
|
42290
|
-
const [size3, setSize] =
|
|
42638
|
+
const [size3, setSize] = useState92(() => ({
|
|
42291
42639
|
width: resolved.result.width,
|
|
42292
42640
|
height: resolved.result.height
|
|
42293
42641
|
}));
|
|
42294
|
-
const [durationInFrames, setDurationInFrames] =
|
|
42642
|
+
const [durationInFrames, setDurationInFrames] = useState92(resolved.result.durationInFrames);
|
|
42295
42643
|
const onTypeChanged = useCallback153((newType) => {
|
|
42296
42644
|
setType(newType);
|
|
42297
42645
|
}, []);
|
|
@@ -42621,10 +42969,10 @@ var DuplicateComposition = ({ compositionId, compositionType }) => {
|
|
|
42621
42969
|
import {
|
|
42622
42970
|
useCallback as useCallback154,
|
|
42623
42971
|
useContext as useContext114,
|
|
42624
|
-
useEffect as
|
|
42972
|
+
useEffect as useEffect90,
|
|
42625
42973
|
useMemo as useMemo166,
|
|
42626
42974
|
useRef as useRef62,
|
|
42627
|
-
useState as
|
|
42975
|
+
useState as useState93
|
|
42628
42976
|
} from "react";
|
|
42629
42977
|
import { Internals as Internals89 } from "remotion";
|
|
42630
42978
|
import { jsx as jsx274, jsxs as jsxs140, Fragment as Fragment44 } from "react/jsx-runtime";
|
|
@@ -42643,11 +42991,11 @@ var RenameCompositionLoaded = () => {
|
|
|
42643
42991
|
const { resolved, unresolved } = context;
|
|
42644
42992
|
const compositionStack = unresolved.stack ?? null;
|
|
42645
42993
|
const { compositions } = useContext114(Internals89.CompositionManager);
|
|
42646
|
-
const [newId, setName] =
|
|
42994
|
+
const [newId, setName] = useState93(() => {
|
|
42647
42995
|
return resolved.result.id;
|
|
42648
42996
|
});
|
|
42649
42997
|
const inputRef = useRef62(null);
|
|
42650
|
-
|
|
42998
|
+
useEffect90(() => {
|
|
42651
42999
|
const input2 = inputRef.current;
|
|
42652
43000
|
if (!input2)
|
|
42653
43001
|
return;
|
|
@@ -42749,10 +43097,10 @@ var RenameComposition = ({ compositionId }) => {
|
|
|
42749
43097
|
import {
|
|
42750
43098
|
useCallback as useCallback155,
|
|
42751
43099
|
useContext as useContext115,
|
|
42752
|
-
useEffect as
|
|
43100
|
+
useEffect as useEffect91,
|
|
42753
43101
|
useMemo as useMemo167,
|
|
42754
43102
|
useRef as useRef63,
|
|
42755
|
-
useState as
|
|
43103
|
+
useState as useState94
|
|
42756
43104
|
} from "react";
|
|
42757
43105
|
import { Internals as Internals91 } from "remotion";
|
|
42758
43106
|
|
|
@@ -42789,9 +43137,9 @@ var content8 = {
|
|
|
42789
43137
|
};
|
|
42790
43138
|
var RenameFolder = ({ folderName, parentName, stack: stack2 }) => {
|
|
42791
43139
|
const { folders } = useContext115(Internals91.CompositionManager);
|
|
42792
|
-
const [newName, setName] =
|
|
43140
|
+
const [newName, setName] = useState94(folderName);
|
|
42793
43141
|
const inputRef = useRef63(null);
|
|
42794
|
-
|
|
43142
|
+
useEffect91(() => {
|
|
42795
43143
|
const input2 = inputRef.current;
|
|
42796
43144
|
if (!input2)
|
|
42797
43145
|
return;
|
|
@@ -42892,10 +43240,10 @@ var RenameFolder = ({ folderName, parentName, stack: stack2 }) => {
|
|
|
42892
43240
|
import {
|
|
42893
43241
|
useCallback as useCallback156,
|
|
42894
43242
|
useContext as useContext116,
|
|
42895
|
-
useEffect as
|
|
43243
|
+
useEffect as useEffect92,
|
|
42896
43244
|
useMemo as useMemo168,
|
|
42897
43245
|
useRef as useRef64,
|
|
42898
|
-
useState as
|
|
43246
|
+
useState as useState95
|
|
42899
43247
|
} from "react";
|
|
42900
43248
|
import { Internals as Internals92 } from "remotion";
|
|
42901
43249
|
|
|
@@ -42939,10 +43287,10 @@ var RenameStaticFileModal = ({ relativePath }) => {
|
|
|
42939
43287
|
const { canvasContent } = useContext116(Internals92.CompositionManager);
|
|
42940
43288
|
const { setCanvasContent } = useContext116(Internals92.CompositionSetters);
|
|
42941
43289
|
const staticFiles = useStaticFiles();
|
|
42942
|
-
const [newName, setNewName] =
|
|
42943
|
-
const [submitting, setSubmitting] =
|
|
43290
|
+
const [newName, setNewName] = useState95(() => getBaseName(relativePath));
|
|
43291
|
+
const [submitting, setSubmitting] = useState95(false);
|
|
42944
43292
|
const inputRef = useRef64(null);
|
|
42945
|
-
|
|
43293
|
+
useEffect92(() => {
|
|
42946
43294
|
const input2 = inputRef.current;
|
|
42947
43295
|
if (!input2)
|
|
42948
43296
|
return;
|
|
@@ -43089,7 +43437,7 @@ var RenameStaticFileModal = ({ relativePath }) => {
|
|
|
43089
43437
|
};
|
|
43090
43438
|
|
|
43091
43439
|
// src/components/OverrideInputProps.tsx
|
|
43092
|
-
import { useCallback as useCallback157, useContext as useContext117, useMemo as useMemo169, useState as
|
|
43440
|
+
import { useCallback as useCallback157, useContext as useContext117, useMemo as useMemo169, useState as useState96 } from "react";
|
|
43093
43441
|
import { Internals as Internals93 } from "remotion";
|
|
43094
43442
|
import { jsx as jsx277, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
43095
43443
|
var style10 = {
|
|
@@ -43125,7 +43473,7 @@ var isValidJSON = (value) => {
|
|
|
43125
43473
|
}
|
|
43126
43474
|
};
|
|
43127
43475
|
var Inner = () => {
|
|
43128
|
-
const [value, setValue] =
|
|
43476
|
+
const [value, setValue] = useState96(() => {
|
|
43129
43477
|
const override = Internals93.getInputPropsOverride();
|
|
43130
43478
|
if (override) {
|
|
43131
43479
|
return JSON.stringify(override, null, 2);
|
|
@@ -43214,10 +43562,10 @@ var OverrideInputPropsModal = () => {
|
|
|
43214
43562
|
import {
|
|
43215
43563
|
useCallback as useCallback158,
|
|
43216
43564
|
useContext as useContext118,
|
|
43217
|
-
useEffect as
|
|
43565
|
+
useEffect as useEffect94,
|
|
43218
43566
|
useMemo as useMemo171,
|
|
43219
43567
|
useRef as useRef66,
|
|
43220
|
-
useState as
|
|
43568
|
+
useState as useState98
|
|
43221
43569
|
} from "react";
|
|
43222
43570
|
import { Internals as Internals94 } from "remotion";
|
|
43223
43571
|
|
|
@@ -44276,7 +44624,7 @@ var QuickSwitcherNoResults = ({ query, mode }) => {
|
|
|
44276
44624
|
};
|
|
44277
44625
|
|
|
44278
44626
|
// src/components/QuickSwitcher/QuickSwitcherResult.tsx
|
|
44279
|
-
import { useEffect as
|
|
44627
|
+
import { useEffect as useEffect93, useMemo as useMemo170, useRef as useRef65, useState as useState97 } from "react";
|
|
44280
44628
|
import { jsx as jsx281, jsxs as jsxs146, Fragment as Fragment48 } from "react/jsx-runtime";
|
|
44281
44629
|
var container48 = {
|
|
44282
44630
|
paddingLeft: 16,
|
|
@@ -44305,10 +44653,10 @@ var labelContainer = {
|
|
|
44305
44653
|
paddingBottom: 5
|
|
44306
44654
|
};
|
|
44307
44655
|
var QuickSwitcherResult = ({ result, selected }) => {
|
|
44308
|
-
const [hovered, setIsHovered] =
|
|
44656
|
+
const [hovered, setIsHovered] = useState97(false);
|
|
44309
44657
|
const ref2 = useRef65(null);
|
|
44310
44658
|
const keybindings = useKeybinding();
|
|
44311
|
-
|
|
44659
|
+
useEffect93(() => {
|
|
44312
44660
|
const { current } = ref2;
|
|
44313
44661
|
if (!current) {
|
|
44314
44662
|
return;
|
|
@@ -44322,7 +44670,7 @@ var QuickSwitcherResult = ({ result, selected }) => {
|
|
|
44322
44670
|
current.removeEventListener("mouseleave", onMouseLeave);
|
|
44323
44671
|
};
|
|
44324
44672
|
}, []);
|
|
44325
|
-
|
|
44673
|
+
useEffect93(() => {
|
|
44326
44674
|
if (!selected) {
|
|
44327
44675
|
return;
|
|
44328
44676
|
}
|
|
@@ -44339,7 +44687,7 @@ var QuickSwitcherResult = ({ result, selected }) => {
|
|
|
44339
44687
|
binding.unregister();
|
|
44340
44688
|
};
|
|
44341
44689
|
}, [keybindings, result.onSelected, selected]);
|
|
44342
|
-
|
|
44690
|
+
useEffect93(() => {
|
|
44343
44691
|
if (selected) {
|
|
44344
44692
|
ref2.current?.scrollIntoView({
|
|
44345
44693
|
block: "nearest",
|
|
@@ -44472,13 +44820,13 @@ var mapModeToQuery = (mode) => {
|
|
|
44472
44820
|
};
|
|
44473
44821
|
var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }) => {
|
|
44474
44822
|
const { compositions } = useContext118(Internals94.CompositionManager);
|
|
44475
|
-
const [state, setState] =
|
|
44823
|
+
const [state, setState] = useState98(() => {
|
|
44476
44824
|
return {
|
|
44477
44825
|
query: mapModeToQuery(initialMode),
|
|
44478
44826
|
selectedIndex: 0
|
|
44479
44827
|
};
|
|
44480
44828
|
});
|
|
44481
|
-
|
|
44829
|
+
useEffect94(() => {
|
|
44482
44830
|
setState({
|
|
44483
44831
|
query: mapModeToQuery(initialMode),
|
|
44484
44832
|
selectedIndex: 0
|
|
@@ -44490,7 +44838,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
44490
44838
|
return;
|
|
44491
44839
|
}, []);
|
|
44492
44840
|
const actions = useMenuStructure(closeMenu, readOnlyStudio);
|
|
44493
|
-
const [docResults, setDocResults] =
|
|
44841
|
+
const [docResults, setDocResults] = useState98({ type: "initial" });
|
|
44494
44842
|
const { setSelectedModal } = useContext118(ModalsContext);
|
|
44495
44843
|
const keybindings = useKeybinding();
|
|
44496
44844
|
const mode = mapQueryToMode(state.query);
|
|
@@ -44552,7 +44900,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
44552
44900
|
};
|
|
44553
44901
|
});
|
|
44554
44902
|
}, []);
|
|
44555
|
-
|
|
44903
|
+
useEffect94(() => {
|
|
44556
44904
|
const binding = keybindings.registerKeybinding({
|
|
44557
44905
|
key: "ArrowUp",
|
|
44558
44906
|
callback: onArrowUp,
|
|
@@ -44566,7 +44914,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
44566
44914
|
binding.unregister();
|
|
44567
44915
|
};
|
|
44568
44916
|
}, [keybindings, onArrowDown, onArrowUp]);
|
|
44569
|
-
|
|
44917
|
+
useEffect94(() => {
|
|
44570
44918
|
if (mode !== "docs") {
|
|
44571
44919
|
return;
|
|
44572
44920
|
}
|
|
@@ -44591,7 +44939,7 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
44591
44939
|
cancelled = true;
|
|
44592
44940
|
};
|
|
44593
44941
|
}, [actualQuery, mode]);
|
|
44594
|
-
|
|
44942
|
+
useEffect94(() => {
|
|
44595
44943
|
const binding = keybindings.registerKeybinding({
|
|
44596
44944
|
key: "ArrowDown",
|
|
44597
44945
|
callback: onArrowDown,
|
|
@@ -45257,11 +45605,11 @@ import { getDefaultOutLocation } from "@remotion/studio-shared";
|
|
|
45257
45605
|
import {
|
|
45258
45606
|
useCallback as useCallback178,
|
|
45259
45607
|
useContext as useContext121,
|
|
45260
|
-
useEffect as
|
|
45608
|
+
useEffect as useEffect97,
|
|
45261
45609
|
useMemo as useMemo183,
|
|
45262
45610
|
useReducer as useReducer2,
|
|
45263
45611
|
useRef as useRef68,
|
|
45264
|
-
useState as
|
|
45612
|
+
useState as useState104
|
|
45265
45613
|
} from "react";
|
|
45266
45614
|
|
|
45267
45615
|
// src/helpers/convert-env-variables.ts
|
|
@@ -45531,9 +45879,9 @@ var makeReadOnlyStudioRenderCommand = ({
|
|
|
45531
45879
|
};
|
|
45532
45880
|
|
|
45533
45881
|
// src/helpers/render-modal-sections.ts
|
|
45534
|
-
import { useMemo as useMemo173, useState as
|
|
45882
|
+
import { useMemo as useMemo173, useState as useState99 } from "react";
|
|
45535
45883
|
var useRenderModalSections = (renderMode, codec) => {
|
|
45536
|
-
const [selectedTab, setTab] =
|
|
45884
|
+
const [selectedTab, setTab] = useState99("general");
|
|
45537
45885
|
const shownTabs = useMemo173(() => {
|
|
45538
45886
|
if (renderMode === "audio") {
|
|
45539
45887
|
return [
|
|
@@ -45656,7 +46004,7 @@ var GifIcon = (props) => /* @__PURE__ */ jsx292("svg", {
|
|
|
45656
46004
|
});
|
|
45657
46005
|
|
|
45658
46006
|
// src/components/Tabs/vertical.tsx
|
|
45659
|
-
import { useCallback as useCallback161, useMemo as useMemo174, useState as
|
|
46007
|
+
import { useCallback as useCallback161, useMemo as useMemo174, useState as useState100 } from "react";
|
|
45660
46008
|
import { jsx as jsx293 } from "react/jsx-runtime";
|
|
45661
46009
|
var selectorButton2 = {
|
|
45662
46010
|
border: "none",
|
|
@@ -45672,7 +46020,7 @@ var selectorButton2 = {
|
|
|
45672
46020
|
WebkitUserSelect: "none"
|
|
45673
46021
|
};
|
|
45674
46022
|
var VerticalTab = ({ children, onClick, style: style11, selected }) => {
|
|
45675
|
-
const [hovered, setHovered] =
|
|
46023
|
+
const [hovered, setHovered] = useState100(false);
|
|
45676
46024
|
const { tabIndex } = useZIndex();
|
|
45677
46025
|
const onPointerEnter = useCallback161(() => {
|
|
45678
46026
|
setHovered(true);
|
|
@@ -45702,7 +46050,7 @@ var VerticalTab = ({ children, onClick, style: style11, selected }) => {
|
|
|
45702
46050
|
|
|
45703
46051
|
// src/components/RenderModal/CrfSetting.tsx
|
|
45704
46052
|
import { BrowserSafeApis as BrowserSafeApis3 } from "@remotion/renderer/client";
|
|
45705
|
-
import { useState as
|
|
46053
|
+
import { useState as useState102 } from "react";
|
|
45706
46054
|
|
|
45707
46055
|
// src/components/RenderModal/NumberSetting.tsx
|
|
45708
46056
|
import { useCallback as useCallback163 } from "react";
|
|
@@ -45711,7 +46059,7 @@ import { useCallback as useCallback163 } from "react";
|
|
|
45711
46059
|
import { BrowserSafeApis as BrowserSafeApis2 } from "@remotion/renderer/client";
|
|
45712
46060
|
|
|
45713
46061
|
// src/components/RenderModal/CliCopyButton.tsx
|
|
45714
|
-
import { useCallback as useCallback162, useEffect as
|
|
46062
|
+
import { useCallback as useCallback162, useEffect as useEffect95, useMemo as useMemo175, useState as useState101 } from "react";
|
|
45715
46063
|
import { jsx as jsx294 } from "react/jsx-runtime";
|
|
45716
46064
|
var svgStyle4 = {
|
|
45717
46065
|
width: 16,
|
|
@@ -45738,8 +46086,8 @@ var buttonStyle5 = {
|
|
|
45738
46086
|
var CliCopyButton = ({
|
|
45739
46087
|
valueToCopy
|
|
45740
46088
|
}) => {
|
|
45741
|
-
const [copied, setCopied] =
|
|
45742
|
-
const [hovered, setHovered] =
|
|
46089
|
+
const [copied, setCopied] = useState101(false);
|
|
46090
|
+
const [hovered, setHovered] = useState101(false);
|
|
45743
46091
|
const fillColor = useMemo175(() => {
|
|
45744
46092
|
return hovered ? "white" : LIGHT_TEXT;
|
|
45745
46093
|
}, [hovered]);
|
|
@@ -45762,7 +46110,7 @@ var CliCopyButton = ({
|
|
|
45762
46110
|
const onPointerLeave = useCallback162(() => {
|
|
45763
46111
|
setHovered(false);
|
|
45764
46112
|
}, []);
|
|
45765
|
-
|
|
46113
|
+
useEffect95(() => {
|
|
45766
46114
|
if (!copied) {
|
|
45767
46115
|
return;
|
|
45768
46116
|
}
|
|
@@ -46027,7 +46375,7 @@ var getDefaultCrfState = () => {
|
|
|
46027
46375
|
}, {});
|
|
46028
46376
|
};
|
|
46029
46377
|
var useCrfState = (codec) => {
|
|
46030
|
-
const [state, setState] =
|
|
46378
|
+
const [state, setState] = useState102(() => getDefaultCrfState());
|
|
46031
46379
|
const range = BrowserSafeApis3.getValidCrfRanges(codec);
|
|
46032
46380
|
const setCrf = (updater) => {
|
|
46033
46381
|
setState((q) => {
|
|
@@ -46909,14 +47257,14 @@ import { BrowserSafeApis as BrowserSafeApis7 } from "@remotion/renderer/client";
|
|
|
46909
47257
|
import { useCallback as useCallback167, useMemo as useMemo177 } from "react";
|
|
46910
47258
|
|
|
46911
47259
|
// src/helpers/use-file-existence.ts
|
|
46912
|
-
import { useContext as useContext120, useEffect as
|
|
47260
|
+
import { useContext as useContext120, useEffect as useEffect96, useRef as useRef67, useState as useState103 } from "react";
|
|
46913
47261
|
var useFileExistence = (outName) => {
|
|
46914
|
-
const [exists, setExists] =
|
|
47262
|
+
const [exists, setExists] = useState103(false);
|
|
46915
47263
|
const { previewServerState: state, subscribeToEvent } = useContext120(StudioServerConnectionCtx);
|
|
46916
47264
|
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
46917
47265
|
const currentOutName = useRef67("");
|
|
46918
47266
|
currentOutName.current = outName;
|
|
46919
|
-
|
|
47267
|
+
useEffect96(() => {
|
|
46920
47268
|
if (!clientId) {
|
|
46921
47269
|
return;
|
|
46922
47270
|
}
|
|
@@ -46932,7 +47280,7 @@ var useFileExistence = (outName) => {
|
|
|
46932
47280
|
unsubscribeFromFileExistenceWatcher({ file: outName, clientId });
|
|
46933
47281
|
};
|
|
46934
47282
|
}, [clientId, outName]);
|
|
46935
|
-
|
|
47283
|
+
useEffect96(() => {
|
|
46936
47284
|
const listener = (event) => {
|
|
46937
47285
|
if (event.type !== "watched-file-deleted") {
|
|
46938
47286
|
return;
|
|
@@ -46949,7 +47297,7 @@ var useFileExistence = (outName) => {
|
|
|
46949
47297
|
unsub();
|
|
46950
47298
|
};
|
|
46951
47299
|
}, [outName, subscribeToEvent]);
|
|
46952
|
-
|
|
47300
|
+
useEffect96(() => {
|
|
46953
47301
|
const listener = (event) => {
|
|
46954
47302
|
if (event.type !== "watched-file-undeleted") {
|
|
46955
47303
|
return;
|
|
@@ -48812,7 +49160,7 @@ var RenderModal = ({
|
|
|
48812
49160
|
unresolved: unresolvedComposition
|
|
48813
49161
|
} = context;
|
|
48814
49162
|
const isMounted = useRef68(true);
|
|
48815
|
-
const [isVideo] =
|
|
49163
|
+
const [isVideo] = useState104(() => {
|
|
48816
49164
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
48817
49165
|
});
|
|
48818
49166
|
const [
|
|
@@ -48823,7 +49171,7 @@ var RenderModal = ({
|
|
|
48823
49171
|
initialVideoCodecForAudioTab,
|
|
48824
49172
|
initialVideoCodecForVideoTab
|
|
48825
49173
|
}
|
|
48826
|
-
] =
|
|
49174
|
+
] = useState104(() => {
|
|
48827
49175
|
return getDefaultCodecs({
|
|
48828
49176
|
defaultConfigurationVideoCodec,
|
|
48829
49177
|
compositionDefaultVideoCodec: resolvedComposition.defaultCodec,
|
|
@@ -48832,16 +49180,16 @@ var RenderModal = ({
|
|
|
48832
49180
|
});
|
|
48833
49181
|
});
|
|
48834
49182
|
const [state, dispatch2] = useReducer2(reducer2, initialState2);
|
|
48835
|
-
const [unclampedFrame, setFrame] =
|
|
48836
|
-
const [stillImageFormat, setStillImageFormat] =
|
|
48837
|
-
const [videoImageFormat, setVideoImageFormat] =
|
|
48838
|
-
const [sequenceImageFormat, setSequenceImageFormat] =
|
|
48839
|
-
const [concurrency, setConcurrency] =
|
|
48840
|
-
const [videoCodecForVideoTab, setVideoCodecForVideoTab] =
|
|
48841
|
-
const [userSelectedAudioCodec, setUserSelectedAudioCodec] =
|
|
48842
|
-
const [separateAudioTo, setSeparateAudioTo] =
|
|
48843
|
-
const [envVariables, setEnvVariables] =
|
|
48844
|
-
const [initialOutName] =
|
|
49183
|
+
const [unclampedFrame, setFrame] = useState104(() => initialFrame);
|
|
49184
|
+
const [stillImageFormat, setStillImageFormat] = useState104(() => initialStillImageFormat);
|
|
49185
|
+
const [videoImageFormat, setVideoImageFormat] = useState104(() => initialVideoImageFormat ?? resolvedComposition.defaultVideoImageFormat ?? renderDefaults.videoImageFormat);
|
|
49186
|
+
const [sequenceImageFormat, setSequenceImageFormat] = useState104(() => initialStillImageFormat === "jpeg" ? "jpeg" : "png");
|
|
49187
|
+
const [concurrency, setConcurrency] = useState104(() => initialConcurrency);
|
|
49188
|
+
const [videoCodecForVideoTab, setVideoCodecForVideoTab] = useState104(() => initialVideoCodecForVideoTab);
|
|
49189
|
+
const [userSelectedAudioCodec, setUserSelectedAudioCodec] = useState104(() => initialAudioCodec);
|
|
49190
|
+
const [separateAudioTo, setSeparateAudioTo] = useState104(null);
|
|
49191
|
+
const [envVariables, setEnvVariables] = useState104(() => envVariablesObjectToArray(initialEnvVariables).filter(([key6]) => key6 !== "NODE_ENV"));
|
|
49192
|
+
const [initialOutName] = useState104(() => {
|
|
48845
49193
|
return getDefaultOutLocation({
|
|
48846
49194
|
compositionName: resolvedComposition.id,
|
|
48847
49195
|
defaultExtension: initialRenderType === "still" ? initialStillImageFormat : isVideo ? BrowserSafeApis11.getFileExtensionFromCodec(initialVideoCodec, initialAudioCodec) : initialStillImageFormat,
|
|
@@ -48850,26 +49198,26 @@ var RenderModal = ({
|
|
|
48850
49198
|
outputLocation: renderDefaults.outputLocation
|
|
48851
49199
|
});
|
|
48852
49200
|
});
|
|
48853
|
-
const [videoCodecForAudioTab, setVideoCodecForAudioTab] =
|
|
48854
|
-
const [mutedState, setMuted] =
|
|
48855
|
-
const [repro, setRepro] =
|
|
48856
|
-
const [enforceAudioTrackState, setEnforceAudioTrackState] =
|
|
48857
|
-
const [forSeamlessAacConcatenation, setForSeamlessAacConcatenation] =
|
|
48858
|
-
const [sampleRate, setSampleRate] =
|
|
48859
|
-
const [renderMode, setRenderModeState] =
|
|
48860
|
-
const [jpegQuality, setJpegQuality] =
|
|
48861
|
-
const [scale, setScale] =
|
|
48862
|
-
const [logLevel, setLogLevel] =
|
|
48863
|
-
const [disallowParallelEncoding, setDisallowParallelEncoding] =
|
|
48864
|
-
const [disableWebSecurity, setDisableWebSecurity] =
|
|
48865
|
-
const [headless, setHeadless] =
|
|
48866
|
-
const [beepOnFinish, setBeepOnFinish] =
|
|
48867
|
-
const [ignoreCertificateErrors, setIgnoreCertificateErrors] =
|
|
48868
|
-
const [multiProcessOnLinux, setChromiumMultiProcessOnLinux] =
|
|
48869
|
-
const [darkMode, setDarkMode] =
|
|
48870
|
-
const [openGlOption, setOpenGlOption] =
|
|
48871
|
-
const [colorSpace, setColorSpace] =
|
|
48872
|
-
const [userAgent, setUserAgent] =
|
|
49201
|
+
const [videoCodecForAudioTab, setVideoCodecForAudioTab] = useState104(() => initialVideoCodecForAudioTab);
|
|
49202
|
+
const [mutedState, setMuted] = useState104(() => initialMuted);
|
|
49203
|
+
const [repro, setRepro] = useState104(() => initialRepro);
|
|
49204
|
+
const [enforceAudioTrackState, setEnforceAudioTrackState] = useState104(() => initialEnforceAudioTrack);
|
|
49205
|
+
const [forSeamlessAacConcatenation, setForSeamlessAacConcatenation] = useState104(() => initialForSeamlessAacConcatenation);
|
|
49206
|
+
const [sampleRate, setSampleRate] = useState104(() => initialSampleRate);
|
|
49207
|
+
const [renderMode, setRenderModeState] = useState104(initialRenderType);
|
|
49208
|
+
const [jpegQuality, setJpegQuality] = useState104(() => initialJpegQuality);
|
|
49209
|
+
const [scale, setScale] = useState104(() => initialScale);
|
|
49210
|
+
const [logLevel, setLogLevel] = useState104(() => initialLogLevel);
|
|
49211
|
+
const [disallowParallelEncoding, setDisallowParallelEncoding] = useState104(false);
|
|
49212
|
+
const [disableWebSecurity, setDisableWebSecurity] = useState104(() => initialDisableWebSecurity);
|
|
49213
|
+
const [headless, setHeadless] = useState104(() => initialHeadless);
|
|
49214
|
+
const [beepOnFinish, setBeepOnFinish] = useState104(() => initialBeep);
|
|
49215
|
+
const [ignoreCertificateErrors, setIgnoreCertificateErrors] = useState104(() => initialIgnoreCertificateErrors);
|
|
49216
|
+
const [multiProcessOnLinux, setChromiumMultiProcessOnLinux] = useState104(() => initialMultiProcessOnLinux);
|
|
49217
|
+
const [darkMode, setDarkMode] = useState104(() => initialDarkMode);
|
|
49218
|
+
const [openGlOption, setOpenGlOption] = useState104(() => initialGl ?? "default");
|
|
49219
|
+
const [colorSpace, setColorSpace] = useState104(() => initialColorSpace);
|
|
49220
|
+
const [userAgent, setUserAgent] = useState104(() => initialUserAgent === null ? null : initialUserAgent.trim() === "" ? null : initialUserAgent);
|
|
48873
49221
|
const chromiumOptions = useMemo183(() => {
|
|
48874
49222
|
return {
|
|
48875
49223
|
headless,
|
|
@@ -48889,30 +49237,30 @@ var RenderModal = ({
|
|
|
48889
49237
|
multiProcessOnLinux,
|
|
48890
49238
|
darkMode
|
|
48891
49239
|
]);
|
|
48892
|
-
const [outName, setOutName] =
|
|
48893
|
-
const [endFrameOrNull, setEndFrame] =
|
|
48894
|
-
const [startFrameOrNull, setStartFrame] =
|
|
48895
|
-
const [proResProfileSetting, setProResProfile] =
|
|
48896
|
-
const [x264PresetSetting, setx264Preset] =
|
|
48897
|
-
const [gopSize, setGopSize] =
|
|
48898
|
-
const [hardwareAcceleration, setHardwareAcceleration] =
|
|
48899
|
-
const [userPreferredPixelFormat, setPixelFormat] =
|
|
48900
|
-
const [preferredQualityControlType, setQualityControl] =
|
|
49240
|
+
const [outName, setOutName] = useState104(() => initialOutName);
|
|
49241
|
+
const [endFrameOrNull, setEndFrame] = useState104(() => outFrameMark ?? null);
|
|
49242
|
+
const [startFrameOrNull, setStartFrame] = useState104(() => inFrameMark ?? null);
|
|
49243
|
+
const [proResProfileSetting, setProResProfile] = useState104(() => initialProResProfile ?? resolvedComposition.defaultProResProfile ?? "hq");
|
|
49244
|
+
const [x264PresetSetting, setx264Preset] = useState104(() => initialx264Preset);
|
|
49245
|
+
const [gopSize, setGopSize] = useState104(() => initialGopSize);
|
|
49246
|
+
const [hardwareAcceleration, setHardwareAcceleration] = useState104(() => initialHardwareAcceleration);
|
|
49247
|
+
const [userPreferredPixelFormat, setPixelFormat] = useState104(() => initialPixelFormat ?? resolvedComposition.defaultPixelFormat ?? renderDefaults.pixelFormat);
|
|
49248
|
+
const [preferredQualityControlType, setQualityControl] = useState104(() => initialVideoBitrate === null ? "crf" : "bitrate");
|
|
48901
49249
|
const [
|
|
48902
49250
|
shouldHaveCustomTargetAudioBitrate,
|
|
48903
49251
|
setShouldHaveCustomTargetAudioBitrate
|
|
48904
|
-
] =
|
|
48905
|
-
const [customTargetAudioBitrate, setCustomTargetAudioBitrateValue] =
|
|
48906
|
-
const [customTargetVideoBitrate, setCustomTargetVideoBitrateValue] =
|
|
48907
|
-
const [encodingMaxRate, setEncodingMaxRate] =
|
|
48908
|
-
const [encodingBufferSize, setEncodingBufferSize] =
|
|
48909
|
-
const [limitNumberOfGifLoops, setLimitNumberOfGifLoops] =
|
|
48910
|
-
const [numberOfGifLoopsSetting, setNumberOfGifLoopsSetting] =
|
|
48911
|
-
const [delayRenderTimeout, setDelayRenderTimeout] =
|
|
48912
|
-
const [chromeMode, setChromeMode] =
|
|
48913
|
-
const [offthreadVideoCacheSizeInBytes, setOffthreadVideoCacheSizeInBytes] =
|
|
48914
|
-
const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] =
|
|
48915
|
-
const [offthreadVideoThreads, setOffthreadVideoThreads] =
|
|
49252
|
+
] = useState104(() => initialAudioBitrate !== null);
|
|
49253
|
+
const [customTargetAudioBitrate, setCustomTargetAudioBitrateValue] = useState104(() => initialAudioBitrate ?? "320K");
|
|
49254
|
+
const [customTargetVideoBitrate, setCustomTargetVideoBitrateValue] = useState104(() => initialVideoBitrate ?? "1M");
|
|
49255
|
+
const [encodingMaxRate, setEncodingMaxRate] = useState104(() => initialEncodingMaxRate ?? null);
|
|
49256
|
+
const [encodingBufferSize, setEncodingBufferSize] = useState104(() => initialEncodingBufferSize ?? null);
|
|
49257
|
+
const [limitNumberOfGifLoops, setLimitNumberOfGifLoops] = useState104(() => initialNumberOfGifLoops !== null);
|
|
49258
|
+
const [numberOfGifLoopsSetting, setNumberOfGifLoopsSetting] = useState104(() => initialNumberOfGifLoops ?? 0);
|
|
49259
|
+
const [delayRenderTimeout, setDelayRenderTimeout] = useState104(() => initialDelayRenderTimeout);
|
|
49260
|
+
const [chromeMode, setChromeMode] = useState104(() => initialChromeMode);
|
|
49261
|
+
const [offthreadVideoCacheSizeInBytes, setOffthreadVideoCacheSizeInBytes] = useState104(initialOffthreadVideoCacheSizeInBytes);
|
|
49262
|
+
const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] = useState104(initialMediaCacheSizeInBytes);
|
|
49263
|
+
const [offthreadVideoThreads, setOffthreadVideoThreads] = useState104(() => initialOffthreadVideoThreads);
|
|
48916
49264
|
const codec = useMemo183(() => {
|
|
48917
49265
|
if (renderMode === "audio") {
|
|
48918
49266
|
return videoCodecForAudioTab;
|
|
@@ -48999,11 +49347,11 @@ var RenderModal = ({
|
|
|
48999
49347
|
}
|
|
49000
49348
|
return null;
|
|
49001
49349
|
}, [codec, x264PresetSetting, renderMode]);
|
|
49002
|
-
const [inputProps, _setInputProps] =
|
|
49350
|
+
const [inputProps, _setInputProps] = useState104(() => defaultProps);
|
|
49003
49351
|
const setInputProps = useCallback178((updater) => {
|
|
49004
49352
|
_setInputProps(updater);
|
|
49005
49353
|
}, []);
|
|
49006
|
-
const [metadata] =
|
|
49354
|
+
const [metadata] = useState104(() => defaultMetadata);
|
|
49007
49355
|
const endFrame = useMemo183(() => {
|
|
49008
49356
|
if (endFrameOrNull === null) {
|
|
49009
49357
|
return resolvedComposition.durationInFrames - 1;
|
|
@@ -49136,7 +49484,7 @@ var RenderModal = ({
|
|
|
49136
49484
|
offthreadVideoThreads,
|
|
49137
49485
|
mediaCacheSizeInBytes
|
|
49138
49486
|
]);
|
|
49139
|
-
const [everyNthFrameSetting, setEveryNthFrameSetting] =
|
|
49487
|
+
const [everyNthFrameSetting, setEveryNthFrameSetting] = useState104(() => initialEveryNthFrame);
|
|
49140
49488
|
const everyNthFrame = useMemo183(() => {
|
|
49141
49489
|
if (codec === "gif") {
|
|
49142
49490
|
return everyNthFrameSetting;
|
|
@@ -49317,7 +49665,7 @@ var RenderModal = ({
|
|
|
49317
49665
|
offthreadVideoThreads,
|
|
49318
49666
|
mediaCacheSizeInBytes
|
|
49319
49667
|
]);
|
|
49320
|
-
|
|
49668
|
+
useEffect97(() => {
|
|
49321
49669
|
return () => {
|
|
49322
49670
|
isMounted.current = false;
|
|
49323
49671
|
};
|
|
@@ -49594,7 +49942,7 @@ var RenderModal = ({
|
|
|
49594
49942
|
videoBitrate,
|
|
49595
49943
|
x264Preset
|
|
49596
49944
|
]);
|
|
49597
|
-
const [commandCopiedAt, setCommandCopiedAt] =
|
|
49945
|
+
const [commandCopiedAt, setCommandCopiedAt] = useState104(null);
|
|
49598
49946
|
const renderDisabled = readOnlyStudio ? false : !outnameValidation.valid || state.type === "load";
|
|
49599
49947
|
const trigger = useCallback178(() => {
|
|
49600
49948
|
if (readOnlyStudio) {
|
|
@@ -49623,7 +49971,7 @@ var RenderModal = ({
|
|
|
49623
49971
|
readOnlyStudio,
|
|
49624
49972
|
renderMode
|
|
49625
49973
|
]);
|
|
49626
|
-
|
|
49974
|
+
useEffect97(() => {
|
|
49627
49975
|
if (commandCopiedAt === null) {
|
|
49628
49976
|
return;
|
|
49629
49977
|
}
|
|
@@ -49632,7 +49980,7 @@ var RenderModal = ({
|
|
|
49632
49980
|
}, 2000);
|
|
49633
49981
|
return () => clearTimeout(timeout);
|
|
49634
49982
|
}, [commandCopiedAt]);
|
|
49635
|
-
|
|
49983
|
+
useEffect97(() => {
|
|
49636
49984
|
if (renderDisabled) {
|
|
49637
49985
|
return;
|
|
49638
49986
|
}
|
|
@@ -49984,7 +50332,7 @@ import {
|
|
|
49984
50332
|
getDefaultVideoCodecForContainer,
|
|
49985
50333
|
isAudioOnlyContainer
|
|
49986
50334
|
} from "@remotion/web-renderer";
|
|
49987
|
-
import { useCallback as useCallback182, useContext as useContext122, useMemo as useMemo188, useState as
|
|
50335
|
+
import { useCallback as useCallback182, useContext as useContext122, useMemo as useMemo188, useState as useState108 } from "react";
|
|
49988
50336
|
|
|
49989
50337
|
// src/icons/certificate.tsx
|
|
49990
50338
|
import { jsx as jsx319 } from "react/jsx-runtime";
|
|
@@ -50003,15 +50351,15 @@ import {
|
|
|
50003
50351
|
getEncodableAudioCodecs,
|
|
50004
50352
|
getSupportedAudioCodecsForContainer
|
|
50005
50353
|
} from "@remotion/web-renderer";
|
|
50006
|
-
import { useEffect as
|
|
50354
|
+
import { useEffect as useEffect98, useRef as useRef69, useState as useState105 } from "react";
|
|
50007
50355
|
var useEncodableAudioCodecs = (container60) => {
|
|
50008
50356
|
const cacheRef = useRef69({});
|
|
50009
|
-
const [codecsByContainer, setCodecsByContainer] =
|
|
50357
|
+
const [codecsByContainer, setCodecsByContainer] = useState105(() => {
|
|
50010
50358
|
return {
|
|
50011
50359
|
[container60]: getSupportedAudioCodecsForContainer(container60)
|
|
50012
50360
|
};
|
|
50013
50361
|
});
|
|
50014
|
-
|
|
50362
|
+
useEffect98(() => {
|
|
50015
50363
|
const cached = cacheRef.current[container60];
|
|
50016
50364
|
if (cached) {
|
|
50017
50365
|
return;
|
|
@@ -50045,15 +50393,15 @@ import {
|
|
|
50045
50393
|
getEncodableVideoCodecs,
|
|
50046
50394
|
getSupportedVideoCodecsForContainer
|
|
50047
50395
|
} from "@remotion/web-renderer";
|
|
50048
|
-
import { useEffect as
|
|
50396
|
+
import { useEffect as useEffect99, useRef as useRef70, useState as useState106 } from "react";
|
|
50049
50397
|
var useEncodableVideoCodecs = (container60) => {
|
|
50050
50398
|
const cacheRef = useRef70({});
|
|
50051
|
-
const [codecsByContainer, setCodecsByContainer] =
|
|
50399
|
+
const [codecsByContainer, setCodecsByContainer] = useState106(() => {
|
|
50052
50400
|
return {
|
|
50053
50401
|
[container60]: getSupportedVideoCodecsForContainer(container60)
|
|
50054
50402
|
};
|
|
50055
50403
|
});
|
|
50056
|
-
|
|
50404
|
+
useEffect99(() => {
|
|
50057
50405
|
const cached = cacheRef.current[container60];
|
|
50058
50406
|
if (cached) {
|
|
50059
50407
|
return;
|
|
@@ -50741,7 +51089,7 @@ var WebRenderModalBasic = ({
|
|
|
50741
51089
|
};
|
|
50742
51090
|
|
|
50743
51091
|
// src/components/RenderModal/WebRenderModalLicense.tsx
|
|
50744
|
-
import { useCallback as useCallback180, useEffect as
|
|
51092
|
+
import { useCallback as useCallback180, useEffect as useEffect100, useState as useState107 } from "react";
|
|
50745
51093
|
|
|
50746
51094
|
// src/icons/check-circle-filled.tsx
|
|
50747
51095
|
import { jsx as jsx325 } from "react/jsx-runtime";
|
|
@@ -50961,9 +51309,9 @@ var WebRenderModalLicense = ({
|
|
|
50961
51309
|
setLicenseKey,
|
|
50962
51310
|
initialPublicLicenseKey
|
|
50963
51311
|
}) => {
|
|
50964
|
-
const [licenseValidation, setLicenseValidation] =
|
|
50965
|
-
const [isLoading, setIsLoading] =
|
|
50966
|
-
|
|
51312
|
+
const [licenseValidation, setLicenseValidation] = useState107({ valid: true, message: null, details: null });
|
|
51313
|
+
const [isLoading, setIsLoading] = useState107(false);
|
|
51314
|
+
useEffect100(() => {
|
|
50967
51315
|
if (licenseKey === null || licenseKey === "free-license") {
|
|
50968
51316
|
return setLicenseValidation({
|
|
50969
51317
|
valid: true,
|
|
@@ -51340,34 +51688,34 @@ var WebRenderModal = ({
|
|
|
51340
51688
|
resolved: { result: resolvedComposition },
|
|
51341
51689
|
unresolved: unresolvedComposition
|
|
51342
51690
|
} = context;
|
|
51343
|
-
const [isVideo] =
|
|
51691
|
+
const [isVideo] = useState108(() => {
|
|
51344
51692
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
51345
51693
|
});
|
|
51346
|
-
const [renderMode, setRenderMode] =
|
|
51347
|
-
const [tab, setTab] =
|
|
51348
|
-
const [imageFormat, setImageFormat] =
|
|
51349
|
-
const [frame2, setFrame] =
|
|
51350
|
-
const [logLevel, setLogLevel] =
|
|
51351
|
-
const [inputProps, _setInputProps] =
|
|
51694
|
+
const [renderMode, setRenderMode] = useState108(initialContainer && isAudioOnlyContainer(initialContainer) ? "audio" : isVideo ? "video" : "still");
|
|
51695
|
+
const [tab, setTab] = useState108("general");
|
|
51696
|
+
const [imageFormat, setImageFormat] = useState108(() => initialStillImageFormat ?? "png");
|
|
51697
|
+
const [frame2, setFrame] = useState108(() => initialFrame);
|
|
51698
|
+
const [logLevel, setLogLevel] = useState108(() => initialLogLevel);
|
|
51699
|
+
const [inputProps, _setInputProps] = useState108(() => defaultProps);
|
|
51352
51700
|
const setInputProps = useCallback182((updater) => {
|
|
51353
51701
|
_setInputProps(updater);
|
|
51354
51702
|
}, []);
|
|
51355
|
-
const [delayRenderTimeout, setDelayRenderTimeout] =
|
|
51356
|
-
const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] =
|
|
51357
|
-
const [codec, setCodec] =
|
|
51358
|
-
const [container61, setContainer] =
|
|
51359
|
-
const [audioCodec, setAudioCodec] =
|
|
51360
|
-
const [audioBitrate, setAudioBitrate] =
|
|
51361
|
-
const [videoBitrate, setVideoBitrate] =
|
|
51362
|
-
const [hardwareAcceleration, setHardwareAcceleration] =
|
|
51363
|
-
const [keyframeIntervalInSeconds, setKeyframeIntervalInSeconds] =
|
|
51364
|
-
const [startFrame, setStartFrame] =
|
|
51365
|
-
const [endFrame, setEndFrame] =
|
|
51366
|
-
const [transparent, setTransparent] =
|
|
51367
|
-
const [muted, setMuted] =
|
|
51368
|
-
const [scale, setScale] =
|
|
51369
|
-
const [licenseKey, setLicenseKey] =
|
|
51370
|
-
const [allowHtmlInCanvas, setAllowHtmlInCanvas] =
|
|
51703
|
+
const [delayRenderTimeout, setDelayRenderTimeout] = useState108(initialDelayRenderTimeout ?? 30000);
|
|
51704
|
+
const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] = useState108(initialMediaCacheSizeInBytes);
|
|
51705
|
+
const [codec, setCodec] = useState108(initialVideoCodec ?? "h264");
|
|
51706
|
+
const [container61, setContainer] = useState108(initialContainer ?? "mp4");
|
|
51707
|
+
const [audioCodec, setAudioCodec] = useState108(initialAudioCodec ?? "aac");
|
|
51708
|
+
const [audioBitrate, setAudioBitrate] = useState108(initialAudioBitrate ?? "medium");
|
|
51709
|
+
const [videoBitrate, setVideoBitrate] = useState108(initialVideoBitrate ?? "high");
|
|
51710
|
+
const [hardwareAcceleration, setHardwareAcceleration] = useState108(initialHardwareAcceleration ?? "no-preference");
|
|
51711
|
+
const [keyframeIntervalInSeconds, setKeyframeIntervalInSeconds] = useState108(initialKeyframeIntervalInSeconds ?? 5);
|
|
51712
|
+
const [startFrame, setStartFrame] = useState108(() => inFrameMark);
|
|
51713
|
+
const [endFrame, setEndFrame] = useState108(() => outFrameMark);
|
|
51714
|
+
const [transparent, setTransparent] = useState108(initialTransparent ?? false);
|
|
51715
|
+
const [muted, setMuted] = useState108(initialMuted ?? false);
|
|
51716
|
+
const [scale, setScale] = useState108(initialScale ?? 1);
|
|
51717
|
+
const [licenseKey, setLicenseKey] = useState108(initialLicenseKey);
|
|
51718
|
+
const [allowHtmlInCanvas, setAllowHtmlInCanvas] = useState108(initialAllowHtmlInCanvas ?? false);
|
|
51371
51719
|
const encodableAudioCodecs = useEncodableAudioCodecs(container61);
|
|
51372
51720
|
const encodableVideoCodecs = useEncodableVideoCodecs(container61);
|
|
51373
51721
|
const effectiveAudioCodec = useMemo188(() => {
|
|
@@ -51394,7 +51742,7 @@ var WebRenderModal = ({
|
|
|
51394
51742
|
}
|
|
51395
51743
|
return Math.max(0, Math.min(finalEndFrame, startFrame));
|
|
51396
51744
|
}, [finalEndFrame, startFrame]);
|
|
51397
|
-
const [initialOutNameState] =
|
|
51745
|
+
const [initialOutNameState] = useState108(() => {
|
|
51398
51746
|
if (initialDefaultOutName) {
|
|
51399
51747
|
return initialDefaultOutName;
|
|
51400
51748
|
}
|
|
@@ -51410,7 +51758,7 @@ var WebRenderModal = ({
|
|
|
51410
51758
|
}
|
|
51411
51759
|
return defaultOut;
|
|
51412
51760
|
});
|
|
51413
|
-
const [outName, setOutName] =
|
|
51761
|
+
const [outName, setOutName] = useState108(() => initialOutNameState);
|
|
51414
51762
|
const updateOutNameExtension = useCallback182((extension) => {
|
|
51415
51763
|
setOutName((prev) => getStringBeforeSuffix(prev) + "." + extension);
|
|
51416
51764
|
}, []);
|
|
@@ -51850,10 +52198,10 @@ var WebRenderModalWithLoader = (props) => {
|
|
|
51850
52198
|
import {
|
|
51851
52199
|
useCallback as useCallback183,
|
|
51852
52200
|
useContext as useContext123,
|
|
51853
|
-
useEffect as
|
|
52201
|
+
useEffect as useEffect101,
|
|
51854
52202
|
useMemo as useMemo189,
|
|
51855
52203
|
useRef as useRef71,
|
|
51856
|
-
useState as
|
|
52204
|
+
useState as useState109
|
|
51857
52205
|
} from "react";
|
|
51858
52206
|
import { Internals as Internals95 } from "remotion";
|
|
51859
52207
|
import { jsx as jsx330, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
@@ -51945,9 +52293,9 @@ var EasingEditorModal = ({ state }) => {
|
|
|
51945
52293
|
const { setPropStatuses } = useContext123(Internals95.VisualModeSettersContext);
|
|
51946
52294
|
const { overrideIdToNodePathMappings } = useContext123(Internals95.OverrideIdsToNodePathsGettersContext);
|
|
51947
52295
|
const svgRef = useRef71(null);
|
|
51948
|
-
const [bezier, setBezier] =
|
|
51949
|
-
const [saving, setSaving] =
|
|
51950
|
-
const [activeHandle, setActiveHandle] =
|
|
52296
|
+
const [bezier, setBezier] = useState109(() => easingToBezier(state.initialEasing));
|
|
52297
|
+
const [saving, setSaving] = useState109(false);
|
|
52298
|
+
const [activeHandle, setActiveHandle] = useState109(null);
|
|
51951
52299
|
const close = useCallback183(() => {
|
|
51952
52300
|
setSelectedModal(null);
|
|
51953
52301
|
}, [setSelectedModal]);
|
|
@@ -51988,7 +52336,7 @@ var EasingEditorModal = ({ state }) => {
|
|
|
51988
52336
|
return next;
|
|
51989
52337
|
});
|
|
51990
52338
|
}, [getValueFromPointer]);
|
|
51991
|
-
|
|
52339
|
+
useEffect101(() => {
|
|
51992
52340
|
if (activeHandle === null) {
|
|
51993
52341
|
return;
|
|
51994
52342
|
}
|
|
@@ -52324,7 +52672,7 @@ var EasingEditorModal = ({ state }) => {
|
|
|
52324
52672
|
};
|
|
52325
52673
|
|
|
52326
52674
|
// src/components/Timeline/KeyframeSettingsModal.tsx
|
|
52327
|
-
import { useCallback as useCallback184, useContext as useContext124, useMemo as useMemo190, useState as
|
|
52675
|
+
import { useCallback as useCallback184, useContext as useContext124, useMemo as useMemo190, useState as useState110 } from "react";
|
|
52328
52676
|
import { Internals as Internals96 } from "remotion";
|
|
52329
52677
|
import { jsx as jsx331, jsxs as jsxs179, Fragment as Fragment63 } from "react/jsx-runtime";
|
|
52330
52678
|
var container62 = {
|
|
@@ -52380,10 +52728,10 @@ var KeyframeSettingsModal = ({ state }) => {
|
|
|
52380
52728
|
const { setSelectedModal } = useContext124(ModalsContext);
|
|
52381
52729
|
const { setPropStatuses } = useContext124(Internals96.VisualModeSettersContext);
|
|
52382
52730
|
const { previewServerState } = useContext124(StudioServerConnectionCtx);
|
|
52383
|
-
const [left4, setLeft] =
|
|
52384
|
-
const [right5, setRight] =
|
|
52385
|
-
const [posterize, setPosterize] =
|
|
52386
|
-
const [saving, setSaving] =
|
|
52731
|
+
const [left4, setLeft] = useState110(state.status.clamping.left);
|
|
52732
|
+
const [right5, setRight] = useState110(state.status.clamping.right);
|
|
52733
|
+
const [posterize, setPosterize] = useState110(state.status.posterize ?? 0);
|
|
52734
|
+
const [saving, setSaving] = useState110(false);
|
|
52387
52735
|
const canEditClamping = state.status.interpolationFunction === "interpolate";
|
|
52388
52736
|
const close = useCallback184(() => {
|
|
52389
52737
|
setSelectedModal(null);
|
|
@@ -52543,7 +52891,7 @@ var KeyframeSettingsModal = ({ state }) => {
|
|
|
52543
52891
|
import { useCallback as useCallback187, useMemo as useMemo192 } from "react";
|
|
52544
52892
|
|
|
52545
52893
|
// src/components/CopyButton.tsx
|
|
52546
|
-
import { useCallback as useCallback185, useEffect as
|
|
52894
|
+
import { useCallback as useCallback185, useEffect as useEffect102, useState as useState111 } from "react";
|
|
52547
52895
|
import { jsx as jsx332, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
52548
52896
|
var iconStyle9 = {
|
|
52549
52897
|
width: 16,
|
|
@@ -52573,7 +52921,7 @@ var labelStyle6 = {
|
|
|
52573
52921
|
fontSize: 14
|
|
52574
52922
|
};
|
|
52575
52923
|
var CopyButton = ({ textToCopy, label: label13, labelWhenCopied }) => {
|
|
52576
|
-
const [copied, setCopied] =
|
|
52924
|
+
const [copied, setCopied] = useState111(false);
|
|
52577
52925
|
const onClick = useCallback185(() => {
|
|
52578
52926
|
copyText(textToCopy).then(() => {
|
|
52579
52927
|
setCopied(Date.now());
|
|
@@ -52581,7 +52929,7 @@ var CopyButton = ({ textToCopy, label: label13, labelWhenCopied }) => {
|
|
|
52581
52929
|
showNotification(`Could not copy: ${err.message}`, 2000);
|
|
52582
52930
|
});
|
|
52583
52931
|
}, [textToCopy]);
|
|
52584
|
-
|
|
52932
|
+
useEffect102(() => {
|
|
52585
52933
|
if (!copied) {
|
|
52586
52934
|
return;
|
|
52587
52935
|
}
|
|
@@ -52606,7 +52954,7 @@ var CopyButton = ({ textToCopy, label: label13, labelWhenCopied }) => {
|
|
|
52606
52954
|
};
|
|
52607
52955
|
|
|
52608
52956
|
// src/components/UpdateModal/OpenIssueButton.tsx
|
|
52609
|
-
import { useCallback as useCallback186, useMemo as useMemo191, useState as
|
|
52957
|
+
import { useCallback as useCallback186, useMemo as useMemo191, useState as useState112 } from "react";
|
|
52610
52958
|
import { jsx as jsx333 } from "react/jsx-runtime";
|
|
52611
52959
|
var svgStyle6 = {
|
|
52612
52960
|
width: "11px",
|
|
@@ -52621,7 +52969,7 @@ var buttonStyle7 = {
|
|
|
52621
52969
|
alignItems: "center"
|
|
52622
52970
|
};
|
|
52623
52971
|
var OpenIssueButton = ({ link: link4 }) => {
|
|
52624
|
-
const [hovered, setHovered] =
|
|
52972
|
+
const [hovered, setHovered] = useState112(false);
|
|
52625
52973
|
const buttonTooltip = `Open GitHub issue in new Tab`;
|
|
52626
52974
|
const handleClick = useCallback186(() => {
|
|
52627
52975
|
window.open(link4, "_blank");
|
|
@@ -52935,11 +53283,11 @@ var Modals = ({ readOnlyStudio }) => {
|
|
|
52935
53283
|
};
|
|
52936
53284
|
|
|
52937
53285
|
// src/components/SequencePropsSubscriptionProvider.tsx
|
|
52938
|
-
import { useState as
|
|
53286
|
+
import { useState as useState113, useCallback as useCallback188, useMemo as useMemo193 } from "react";
|
|
52939
53287
|
import { Internals as Internals97 } from "remotion";
|
|
52940
53288
|
import { jsx as jsx337 } from "react/jsx-runtime";
|
|
52941
53289
|
var SequencePropsSubscriptionProvider = ({ children }) => {
|
|
52942
|
-
const [overrideToNodePathMap, setOverrideIdToNodePathMap] =
|
|
53290
|
+
const [overrideToNodePathMap, setOverrideIdToNodePathMap] = useState113({});
|
|
52943
53291
|
const setOverrideIdToNodePath = useCallback188((overrideId, state) => {
|
|
52944
53292
|
setOverrideIdToNodePathMap((prev) => {
|
|
52945
53293
|
const existing = prev[overrideId];
|
|
@@ -52969,7 +53317,7 @@ import {
|
|
|
52969
53317
|
HtmlInCanvasCapture,
|
|
52970
53318
|
isHtmlInCanvasAvailable
|
|
52971
53319
|
} from "@remotion/canvas-capture";
|
|
52972
|
-
import { useEffect as
|
|
53320
|
+
import { useEffect as useEffect103, useMemo as useMemo194, useRef as useRef72 } from "react";
|
|
52973
53321
|
import { jsx as jsx338 } from "react/jsx-runtime";
|
|
52974
53322
|
var logCaptureError = (message, err) => {
|
|
52975
53323
|
console.error(message, err instanceof Error ? err.message : String(err));
|
|
@@ -52978,7 +53326,7 @@ var StudioCanvasCapture = ({ children, density }) => {
|
|
|
52978
53326
|
const captureRef = useRef72(null);
|
|
52979
53327
|
const isSupported = useMemo194(() => isHtmlInCanvasAvailable(), []);
|
|
52980
53328
|
const keybindings = useKeybinding();
|
|
52981
|
-
|
|
53329
|
+
useEffect103(() => {
|
|
52982
53330
|
if (!isSupported) {
|
|
52983
53331
|
return;
|
|
52984
53332
|
}
|
|
@@ -53020,7 +53368,7 @@ var background = {
|
|
|
53020
53368
|
var DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = 300;
|
|
53021
53369
|
var BUFFER_STATE_DELAY_IN_MILLISECONDS = typeof process.env.BUFFER_STATE_DELAY_IN_MILLISECONDS === "undefined" || process.env.BUFFER_STATE_DELAY_IN_MILLISECONDS === null ? DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS : Number(process.env.BUFFER_STATE_DELAY_IN_MILLISECONDS);
|
|
53022
53370
|
var Editor = ({ Root, readOnlyStudio }) => {
|
|
53023
|
-
const [drawElement, setDrawElement] =
|
|
53371
|
+
const [drawElement, setDrawElement] = useState114(null);
|
|
53024
53372
|
const size3 = PlayerInternals22.useElementSize(drawElement, {
|
|
53025
53373
|
triggerOnWindowResize: false,
|
|
53026
53374
|
shouldApplyCssTransforms: true
|
|
@@ -53045,7 +53393,7 @@ var Editor = ({ Root, readOnlyStudio }) => {
|
|
|
53045
53393
|
const MemoRoot = useMemo195(() => {
|
|
53046
53394
|
return React233.memo(Root);
|
|
53047
53395
|
}, [Root]);
|
|
53048
|
-
const [renderError, setRenderError] =
|
|
53396
|
+
const [renderError, setRenderError] = useState114(null);
|
|
53049
53397
|
const clearError = useCallback189(() => {
|
|
53050
53398
|
setRenderError(null);
|
|
53051
53399
|
}, []);
|
|
@@ -53109,7 +53457,7 @@ var Editor = ({ Root, readOnlyStudio }) => {
|
|
|
53109
53457
|
import { PlayerInternals as PlayerInternals23 } from "@remotion/player";
|
|
53110
53458
|
|
|
53111
53459
|
// src/state/preview-size.tsx
|
|
53112
|
-
import { useCallback as useCallback190, useContext as useContext126, useMemo as useMemo196, useState as
|
|
53460
|
+
import { useCallback as useCallback190, useContext as useContext126, useMemo as useMemo196, useState as useState115 } from "react";
|
|
53113
53461
|
import { Internals as Internals99 } from "remotion";
|
|
53114
53462
|
import { jsx as jsx340 } from "react/jsx-runtime";
|
|
53115
53463
|
var key6 = "remotion.previewSize";
|
|
@@ -53130,8 +53478,8 @@ var loadPreviewSizeOption = () => {
|
|
|
53130
53478
|
return JSON.parse(item2);
|
|
53131
53479
|
};
|
|
53132
53480
|
var PreviewSizeProvider = ({ children }) => {
|
|
53133
|
-
const [size3, setSizeState] =
|
|
53134
|
-
const [translation, setTranslation] =
|
|
53481
|
+
const [size3, setSizeState] = useState115(() => loadPreviewSizeOption());
|
|
53482
|
+
const [translation, setTranslation] = useState115(() => {
|
|
53135
53483
|
return {
|
|
53136
53484
|
x: 0,
|
|
53137
53485
|
y: 0
|
|
@@ -53166,10 +53514,10 @@ var PreviewSizeProvider = ({ children }) => {
|
|
|
53166
53514
|
};
|
|
53167
53515
|
|
|
53168
53516
|
// src/components/CheckerboardProvider.tsx
|
|
53169
|
-
import { useCallback as useCallback191, useMemo as useMemo197, useState as
|
|
53517
|
+
import { useCallback as useCallback191, useMemo as useMemo197, useState as useState116 } from "react";
|
|
53170
53518
|
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
53171
53519
|
var CheckerboardProvider = ({ children }) => {
|
|
53172
|
-
const [checkerboard, setCheckerboardState] =
|
|
53520
|
+
const [checkerboard, setCheckerboardState] = useState116(() => loadCheckerboardOption());
|
|
53173
53521
|
const setCheckerboard = useCallback191((newValue) => {
|
|
53174
53522
|
setCheckerboardState((prevState) => {
|
|
53175
53523
|
const newVal = newValue(prevState);
|
|
@@ -53190,12 +53538,12 @@ var CheckerboardProvider = ({ children }) => {
|
|
|
53190
53538
|
};
|
|
53191
53539
|
|
|
53192
53540
|
// src/components/MediaVolumeProvider.tsx
|
|
53193
|
-
import { useMemo as useMemo198, useState as
|
|
53541
|
+
import { useMemo as useMemo198, useState as useState117 } from "react";
|
|
53194
53542
|
import { Internals as Internals100 } from "remotion";
|
|
53195
53543
|
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
53196
53544
|
var MediaVolumeProvider = ({ children }) => {
|
|
53197
|
-
const [mediaMuted, setMediaMuted] =
|
|
53198
|
-
const [mediaVolume, setMediaVolume] =
|
|
53545
|
+
const [mediaMuted, setMediaMuted] = useState117(() => loadMuteOption());
|
|
53546
|
+
const [mediaVolume, setMediaVolume] = useState117(1);
|
|
53199
53547
|
const mediaVolumeContextValue = useMemo198(() => {
|
|
53200
53548
|
return {
|
|
53201
53549
|
mediaMuted,
|
|
@@ -53218,10 +53566,10 @@ var MediaVolumeProvider = ({ children }) => {
|
|
|
53218
53566
|
};
|
|
53219
53567
|
|
|
53220
53568
|
// src/components/ModalsProvider.tsx
|
|
53221
|
-
import { useMemo as useMemo199, useState as
|
|
53569
|
+
import { useMemo as useMemo199, useState as useState118 } from "react";
|
|
53222
53570
|
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
53223
53571
|
var ModalsProvider = ({ children }) => {
|
|
53224
|
-
const [modalContextType, setModalContextType] =
|
|
53572
|
+
const [modalContextType, setModalContextType] = useState118(null);
|
|
53225
53573
|
const modalsContext = useMemo199(() => {
|
|
53226
53574
|
return {
|
|
53227
53575
|
selectedModal: modalContextType,
|
|
@@ -53235,7 +53583,7 @@ var ModalsProvider = ({ children }) => {
|
|
|
53235
53583
|
};
|
|
53236
53584
|
|
|
53237
53585
|
// src/components/SetTimelineInOutProvider.tsx
|
|
53238
|
-
import { useEffect as
|
|
53586
|
+
import { useEffect as useEffect104, useMemo as useMemo200, useState as useState119 } from "react";
|
|
53239
53587
|
|
|
53240
53588
|
// src/state/marks.ts
|
|
53241
53589
|
var localStorageKey4 = () => `remotion.editor.marksv2`;
|
|
@@ -53253,13 +53601,13 @@ var loadMarks = () => {
|
|
|
53253
53601
|
// src/components/SetTimelineInOutProvider.tsx
|
|
53254
53602
|
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
53255
53603
|
var SetTimelineInOutProvider = ({ children }) => {
|
|
53256
|
-
const [inAndOutFrames, setInAndOutFrames] =
|
|
53604
|
+
const [inAndOutFrames, setInAndOutFrames] = useState119(() => loadMarks());
|
|
53257
53605
|
const setTimelineInOutContextValue = useMemo200(() => {
|
|
53258
53606
|
return {
|
|
53259
53607
|
setInAndOutFrames
|
|
53260
53608
|
};
|
|
53261
53609
|
}, []);
|
|
53262
|
-
|
|
53610
|
+
useEffect104(() => {
|
|
53263
53611
|
persistMarks(inAndOutFrames);
|
|
53264
53612
|
}, [inAndOutFrames]);
|
|
53265
53613
|
return /* @__PURE__ */ jsx344(TimelineInOutContext.Provider, {
|
|
@@ -53272,13 +53620,13 @@ var SetTimelineInOutProvider = ({ children }) => {
|
|
|
53272
53620
|
};
|
|
53273
53621
|
|
|
53274
53622
|
// src/components/ShowGuidesProvider.tsx
|
|
53275
|
-
import { useCallback as useCallback192, useMemo as useMemo201, useRef as useRef73, useState as
|
|
53623
|
+
import { useCallback as useCallback192, useMemo as useMemo201, useRef as useRef73, useState as useState120 } from "react";
|
|
53276
53624
|
import { jsx as jsx345 } from "react/jsx-runtime";
|
|
53277
53625
|
var ShowGuidesProvider = ({ children }) => {
|
|
53278
|
-
const [guidesList, setGuidesList] =
|
|
53279
|
-
const [draggingGuideId, setDraggingGuideId] =
|
|
53280
|
-
const [hoveredGuideId, setHoveredGuideId] =
|
|
53281
|
-
const [editorShowGuides, setEditorShowGuidesState] =
|
|
53626
|
+
const [guidesList, setGuidesList] = useState120(() => loadGuidesList());
|
|
53627
|
+
const [draggingGuideId, setDraggingGuideId] = useState120(null);
|
|
53628
|
+
const [hoveredGuideId, setHoveredGuideId] = useState120(null);
|
|
53629
|
+
const [editorShowGuides, setEditorShowGuidesState] = useState120(() => loadEditorShowGuidesOption());
|
|
53282
53630
|
const shouldCreateGuideRef = useRef73(false);
|
|
53283
53631
|
const shouldDeleteGuideRef = useRef73(false);
|
|
53284
53632
|
const setEditorShowGuides = useCallback192((newValue) => {
|
|
@@ -53315,10 +53663,10 @@ var ShowGuidesProvider = ({ children }) => {
|
|
|
53315
53663
|
};
|
|
53316
53664
|
|
|
53317
53665
|
// src/components/ShowOutlinesProvider.tsx
|
|
53318
|
-
import { useCallback as useCallback193, useMemo as useMemo202, useState as
|
|
53666
|
+
import { useCallback as useCallback193, useMemo as useMemo202, useState as useState121 } from "react";
|
|
53319
53667
|
import { jsx as jsx346 } from "react/jsx-runtime";
|
|
53320
53668
|
var ShowOutlinesProvider = ({ children }) => {
|
|
53321
|
-
const [editorShowOutlines, setEditorShowOutlinesState] =
|
|
53669
|
+
const [editorShowOutlines, setEditorShowOutlinesState] = useState121(() => loadEditorShowOutlinesOption());
|
|
53322
53670
|
const setEditorShowOutlines = useCallback193((newValue) => {
|
|
53323
53671
|
setEditorShowOutlinesState((prevState) => {
|
|
53324
53672
|
const newVal = newValue(prevState);
|
|
@@ -53339,10 +53687,10 @@ var ShowOutlinesProvider = ({ children }) => {
|
|
|
53339
53687
|
};
|
|
53340
53688
|
|
|
53341
53689
|
// src/components/ShowRulersProvider.tsx
|
|
53342
|
-
import { useCallback as useCallback194, useMemo as useMemo203, useState as
|
|
53690
|
+
import { useCallback as useCallback194, useMemo as useMemo203, useState as useState122 } from "react";
|
|
53343
53691
|
import { jsx as jsx347 } from "react/jsx-runtime";
|
|
53344
53692
|
var ShowRulersProvider = ({ children }) => {
|
|
53345
|
-
const [editorShowRulers, setEditorShowRulersState] =
|
|
53693
|
+
const [editorShowRulers, setEditorShowRulersState] = useState122(() => loadEditorShowRulersOption());
|
|
53346
53694
|
const setEditorShowRulers = useCallback194((newValue) => {
|
|
53347
53695
|
setEditorShowRulersState((prevState) => {
|
|
53348
53696
|
const newVal = newValue(prevState);
|
|
@@ -53363,11 +53711,11 @@ var ShowRulersProvider = ({ children }) => {
|
|
|
53363
53711
|
};
|
|
53364
53712
|
|
|
53365
53713
|
// src/components/VisualControls/VisualControlsUndoSync.tsx
|
|
53366
|
-
import { useContext as useContext127, useEffect as
|
|
53714
|
+
import { useContext as useContext127, useEffect as useEffect105 } from "react";
|
|
53367
53715
|
var VisualControlsUndoSync = () => {
|
|
53368
53716
|
const { subscribeToEvent } = useContext127(StudioServerConnectionCtx);
|
|
53369
53717
|
const { updateValue } = useContext127(SetVisualControlsContext);
|
|
53370
|
-
|
|
53718
|
+
useEffect105(() => {
|
|
53371
53719
|
const unsub = subscribeToEvent("visual-control-values-changed", (event) => {
|
|
53372
53720
|
if (event.type !== "visual-control-values-changed") {
|
|
53373
53721
|
return;
|
|
@@ -53382,10 +53730,10 @@ var VisualControlsUndoSync = () => {
|
|
|
53382
53730
|
};
|
|
53383
53731
|
|
|
53384
53732
|
// src/components/ZoomGesturesProvider.tsx
|
|
53385
|
-
import { useCallback as useCallback195, useMemo as useMemo204, useState as
|
|
53733
|
+
import { useCallback as useCallback195, useMemo as useMemo204, useState as useState123 } from "react";
|
|
53386
53734
|
import { jsx as jsx348 } from "react/jsx-runtime";
|
|
53387
53735
|
var ZoomGesturesProvider = ({ children }) => {
|
|
53388
|
-
const [editorZoomGestures, setEditorZoomGesturesState] =
|
|
53736
|
+
const [editorZoomGestures, setEditorZoomGesturesState] = useState123(() => loadEditorZoomGesturesOption());
|
|
53389
53737
|
const setEditorZoomGestures = useCallback195((newValue) => {
|
|
53390
53738
|
setEditorZoomGesturesState((prevState) => {
|
|
53391
53739
|
const newVal = newValue(prevState);
|
|
@@ -53532,15 +53880,15 @@ var ServerDisconnected = () => {
|
|
|
53532
53880
|
};
|
|
53533
53881
|
|
|
53534
53882
|
// src/FastRefreshProvider.tsx
|
|
53535
|
-
import { useCallback as useCallback196, useEffect as
|
|
53883
|
+
import { useCallback as useCallback196, useEffect as useEffect106, useMemo as useMemo205, useState as useState124 } from "react";
|
|
53536
53884
|
import { jsx as jsx351 } from "react/jsx-runtime";
|
|
53537
53885
|
var FastRefreshProvider = ({ children }) => {
|
|
53538
|
-
const [fastRefreshes, setFastRefreshes] =
|
|
53539
|
-
const [manualRefreshes, setManualRefreshes] =
|
|
53886
|
+
const [fastRefreshes, setFastRefreshes] = useState124(0);
|
|
53887
|
+
const [manualRefreshes, setManualRefreshes] = useState124(0);
|
|
53540
53888
|
const increaseManualRefreshes = useCallback196(() => {
|
|
53541
53889
|
setManualRefreshes((i) => i + 1);
|
|
53542
53890
|
}, []);
|
|
53543
|
-
|
|
53891
|
+
useEffect106(() => {
|
|
53544
53892
|
if (typeof __webpack_module__ !== "undefined") {
|
|
53545
53893
|
if (__webpack_module__.hot) {
|
|
53546
53894
|
__webpack_module__.hot.addStatusHandler((status) => {
|
|
@@ -53721,15 +54069,15 @@ var injectCSS = () => {
|
|
|
53721
54069
|
import {
|
|
53722
54070
|
useCallback as useCallback197,
|
|
53723
54071
|
useContext as useContext129,
|
|
53724
|
-
useEffect as
|
|
54072
|
+
useEffect as useEffect107,
|
|
53725
54073
|
useImperativeHandle as useImperativeHandle14,
|
|
53726
54074
|
useMemo as useMemo206,
|
|
53727
|
-
useState as
|
|
54075
|
+
useState as useState125
|
|
53728
54076
|
} from "react";
|
|
53729
54077
|
import { getInputProps as getInputProps2, Internals as Internals102 } from "remotion";
|
|
53730
54078
|
import { jsx as jsx352 } from "react/jsx-runtime";
|
|
53731
54079
|
var ResolveCompositionConfigInStudio = ({ children }) => {
|
|
53732
|
-
const [currentRenderModalComposition, setCurrentRenderModalComposition] =
|
|
54080
|
+
const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState125(null);
|
|
53733
54081
|
const { compositions, canvasContent, currentCompositionMetadata } = useContext129(Internals102.CompositionManager);
|
|
53734
54082
|
const { fastRefreshes, manualRefreshes } = useContext129(FastRefreshContext);
|
|
53735
54083
|
if (manualRefreshes) {}
|
|
@@ -53742,7 +54090,7 @@ var ResolveCompositionConfigInStudio = ({ children }) => {
|
|
|
53742
54090
|
const inputProps = useMemo206(() => {
|
|
53743
54091
|
return typeof window === "undefined" || env.isPlayer ? {} : getInputProps2() ?? {};
|
|
53744
54092
|
}, [env.isPlayer]);
|
|
53745
|
-
const [resolvedConfigs, setResolvedConfigs] =
|
|
54093
|
+
const [resolvedConfigs, setResolvedConfigs] = useState125({});
|
|
53746
54094
|
const selectedEditorProps = useMemo206(() => {
|
|
53747
54095
|
return selectedComposition ? allEditorProps[selectedComposition.id] ?? {} : {};
|
|
53748
54096
|
}, [allEditorProps, selectedComposition]);
|
|
@@ -53897,7 +54245,7 @@ var ResolveCompositionConfigInStudio = ({ children }) => {
|
|
|
53897
54245
|
}, [currentDefaultProps, inputProps]);
|
|
53898
54246
|
const canResolve = selectedComposition && Boolean(selectedComposition.calculateMetadata);
|
|
53899
54247
|
const shouldIgnoreUpdate = typeof window !== "undefined" && window.remotion_ignoreFastRefreshUpdate && fastRefreshes <= window.remotion_ignoreFastRefreshUpdate;
|
|
53900
|
-
|
|
54248
|
+
useEffect107(() => {
|
|
53901
54249
|
if (shouldIgnoreUpdate) {
|
|
53902
54250
|
return;
|
|
53903
54251
|
}
|
|
@@ -53929,7 +54277,7 @@ var ResolveCompositionConfigInStudio = ({ children }) => {
|
|
|
53929
54277
|
selectedComposition?.width,
|
|
53930
54278
|
shouldIgnoreUpdate
|
|
53931
54279
|
]);
|
|
53932
|
-
|
|
54280
|
+
useEffect107(() => {
|
|
53933
54281
|
if (renderModalComposition && !isTheSame) {
|
|
53934
54282
|
const combinedProps = {
|
|
53935
54283
|
...renderModalComposition.defaultProps ?? {},
|
|
@@ -54018,7 +54366,7 @@ var StudioInner = ({ rootComponent, readOnly }) => {
|
|
|
54018
54366
|
});
|
|
54019
54367
|
};
|
|
54020
54368
|
var Studio = ({ rootComponent, readOnly }) => {
|
|
54021
|
-
|
|
54369
|
+
useLayoutEffect6(() => {
|
|
54022
54370
|
injectCSS();
|
|
54023
54371
|
}, []);
|
|
54024
54372
|
return /* @__PURE__ */ jsx353(FastRefreshProvider, {
|