@remotion/studio 4.0.451 → 4.0.453
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/Studio.js +1 -1
- package/dist/audio-waveform-worker.d.ts +1 -0
- package/dist/audio-waveform-worker.js +102 -0
- package/dist/components/AudioWaveform.d.ts +2 -0
- package/dist/components/AudioWaveform.js +166 -18
- package/dist/components/Timeline/LoopedIndicator.js +5 -19
- package/dist/components/Timeline/TimelineSequence.js +18 -10
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +2 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +51 -12
- package/dist/components/Timeline/TimelineWidthProvider.js +1 -16
- package/dist/components/audio-waveform-worker-types.d.ts +28 -0
- package/dist/components/audio-waveform-worker-types.js +2 -0
- package/dist/components/draw-peaks.d.ts +1 -1
- package/dist/components/load-waveform-peaks.d.ts +11 -1
- package/dist/components/load-waveform-peaks.js +25 -24
- package/dist/components/looped-media-timeline.d.ts +6 -0
- package/dist/components/looped-media-timeline.js +14 -0
- package/dist/components/slice-waveform-peaks.d.ts +7 -0
- package/dist/components/slice-waveform-peaks.js +15 -0
- package/dist/components/waveform-peak-processor.d.ts +23 -0
- package/dist/components/waveform-peak-processor.js +77 -0
- package/dist/esm/audio-waveform-worker.mjs +345 -0
- package/dist/esm/{chunk-v2r2309d.js → chunk-hn4803e7.js} +1016 -717
- package/dist/esm/internals.mjs +1016 -717
- package/dist/esm/previewEntry.mjs +996 -697
- package/dist/esm/renderEntry.mjs +3 -3
- package/dist/helpers/calculate-timeline.js +16 -0
- package/dist/helpers/get-timeline-nestedness.js +2 -1
- package/dist/make-audio-waveform-worker.d.ts +1 -0
- package/dist/make-audio-waveform-worker.js +10 -0
- package/dist/renderEntry.js +2 -2
- package/package.json +18 -9
|
@@ -2734,13 +2734,13 @@ var enableHotMiddleware = () => {
|
|
|
2734
2734
|
};
|
|
2735
2735
|
|
|
2736
2736
|
// src/Studio.tsx
|
|
2737
|
-
import { useLayoutEffect as
|
|
2737
|
+
import { useLayoutEffect as useLayoutEffect5 } from "react";
|
|
2738
2738
|
import { createPortal } from "react-dom";
|
|
2739
2739
|
import { Internals as Internals70 } from "remotion";
|
|
2740
2740
|
|
|
2741
2741
|
// src/components/Editor.tsx
|
|
2742
2742
|
import { PlayerInternals as PlayerInternals19 } from "@remotion/player";
|
|
2743
|
-
import React189, { useCallback as useCallback150, useMemo as useMemo151, useState as
|
|
2743
|
+
import React189, { useCallback as useCallback150, useMemo as useMemo151, useState as useState99 } from "react";
|
|
2744
2744
|
import { Internals as Internals65 } from "remotion";
|
|
2745
2745
|
|
|
2746
2746
|
// src/helpers/noop.ts
|
|
@@ -2754,7 +2754,7 @@ var canvasRef = createRef2();
|
|
|
2754
2754
|
var drawRef = createRef2();
|
|
2755
2755
|
|
|
2756
2756
|
// src/state/timeline-zoom.tsx
|
|
2757
|
-
import { createContext as createContext5, useCallback as useCallback13, useMemo as useMemo12, useState as
|
|
2757
|
+
import { createContext as createContext5, useCallback as useCallback13, useMemo as useMemo12, useState as useState10 } from "react";
|
|
2758
2758
|
|
|
2759
2759
|
// src/components/Timeline/imperative-state.ts
|
|
2760
2760
|
var currentFrame = 0;
|
|
@@ -2850,10 +2850,10 @@ var timelineVerticalScroll = React20.createRef();
|
|
|
2850
2850
|
// src/components/Timeline/TimelineSlider.tsx
|
|
2851
2851
|
import {
|
|
2852
2852
|
createRef as createRef3,
|
|
2853
|
-
useContext as
|
|
2853
|
+
useContext as useContext3,
|
|
2854
2854
|
useEffect as useEffect11,
|
|
2855
2855
|
useImperativeHandle as useImperativeHandle2,
|
|
2856
|
-
useLayoutEffect
|
|
2856
|
+
useLayoutEffect,
|
|
2857
2857
|
useRef as useRef5
|
|
2858
2858
|
} from "react";
|
|
2859
2859
|
import { Internals as Internals3, useVideoConfig } from "remotion";
|
|
@@ -2888,7 +2888,7 @@ var TimelineSliderHandle = () => {
|
|
|
2888
2888
|
|
|
2889
2889
|
// src/components/Timeline/TimelineWidthProvider.tsx
|
|
2890
2890
|
import { PlayerInternals as PlayerInternals2 } from "@remotion/player";
|
|
2891
|
-
import { createContext as createContext4
|
|
2891
|
+
import { createContext as createContext4 } from "react";
|
|
2892
2892
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2893
2893
|
var TimelineWidthContext = createContext4(null);
|
|
2894
2894
|
var TimelineWidthProvider = ({ children }) => {
|
|
@@ -2896,19 +2896,8 @@ var TimelineWidthProvider = ({ children }) => {
|
|
|
2896
2896
|
triggerOnWindowResize: false,
|
|
2897
2897
|
shouldApplyCssTransforms: true
|
|
2898
2898
|
});
|
|
2899
|
-
const { zoom: zoomMap } = useContext3(TimelineZoomCtx);
|
|
2900
|
-
const [widthOverride, setWidthOverride] = useState10(null);
|
|
2901
|
-
const observedWidth = size2?.width ?? null;
|
|
2902
|
-
useLayoutEffect(() => {
|
|
2903
|
-
const actual = sliderAreaRef.current?.clientWidth ?? null;
|
|
2904
|
-
if (actual !== null && actual !== observedWidth) {
|
|
2905
|
-
setWidthOverride(actual);
|
|
2906
|
-
} else {
|
|
2907
|
-
setWidthOverride(null);
|
|
2908
|
-
}
|
|
2909
|
-
}, [observedWidth, zoomMap]);
|
|
2910
2899
|
return /* @__PURE__ */ jsx28(TimelineWidthContext.Provider, {
|
|
2911
|
-
value:
|
|
2900
|
+
value: size2?.width ?? null,
|
|
2912
2901
|
children
|
|
2913
2902
|
});
|
|
2914
2903
|
};
|
|
@@ -2930,7 +2919,7 @@ var line = {
|
|
|
2930
2919
|
var redrawTimelineSliderFast = createRef3();
|
|
2931
2920
|
var TimelineSlider = () => {
|
|
2932
2921
|
const videoConfig = Internals3.useUnsafeVideoConfig();
|
|
2933
|
-
const timelineWidth =
|
|
2922
|
+
const timelineWidth = useContext3(TimelineWidthContext);
|
|
2934
2923
|
if (videoConfig === null || timelineWidth === null) {
|
|
2935
2924
|
return null;
|
|
2936
2925
|
}
|
|
@@ -2940,14 +2929,14 @@ var Inner = () => {
|
|
|
2940
2929
|
const videoConfig = useVideoConfig();
|
|
2941
2930
|
const timelinePosition = Internals3.Timeline.useTimelinePosition();
|
|
2942
2931
|
const ref = useRef5(null);
|
|
2943
|
-
const timelineWidth =
|
|
2944
|
-
const { zoom: zoomMap } =
|
|
2945
|
-
const { canvasContent } =
|
|
2932
|
+
const timelineWidth = useContext3(TimelineWidthContext);
|
|
2933
|
+
const { zoom: zoomMap } = useContext3(TimelineZoomCtx);
|
|
2934
|
+
const { canvasContent } = useContext3(Internals3.CompositionManager);
|
|
2946
2935
|
if (timelineWidth === null) {
|
|
2947
2936
|
throw new Error("Unexpectedly did not have timeline width");
|
|
2948
2937
|
}
|
|
2949
2938
|
const zoomLevel = canvasContent?.type === "composition" ? zoomMap[canvasContent.compositionId] ?? TIMELINE_MIN_ZOOM : TIMELINE_MIN_ZOOM;
|
|
2950
|
-
|
|
2939
|
+
useLayoutEffect(() => {
|
|
2951
2940
|
const el = ref.current;
|
|
2952
2941
|
const measuredWidth = sliderAreaRef.current?.clientWidth;
|
|
2953
2942
|
if (!el || measuredWidth === undefined || measuredWidth === 0) {
|
|
@@ -3222,7 +3211,7 @@ var zoomAndPreserveCursor = ({
|
|
|
3222
3211
|
};
|
|
3223
3212
|
|
|
3224
3213
|
// src/components/ZoomPersistor.tsx
|
|
3225
|
-
import { useContext as
|
|
3214
|
+
import { useContext as useContext4, useEffect as useEffect12 } from "react";
|
|
3226
3215
|
import { Internals as Internals4 } from "remotion";
|
|
3227
3216
|
|
|
3228
3217
|
// src/components/load-canvas-content-from-url.ts
|
|
@@ -3264,8 +3253,8 @@ var getZoomFromLocalStorage = () => {
|
|
|
3264
3253
|
};
|
|
3265
3254
|
var ZoomPersistor = () => {
|
|
3266
3255
|
const [playing] = Internals4.Timeline.usePlayingState();
|
|
3267
|
-
const { zoom } =
|
|
3268
|
-
const { canvasContent } =
|
|
3256
|
+
const { zoom } = useContext4(TimelineZoomCtx);
|
|
3257
|
+
const { canvasContent } = useContext4(Internals4.CompositionManager);
|
|
3269
3258
|
const urlState = deriveCanvasContentFromUrl();
|
|
3270
3259
|
const isActive = urlState && urlState.type === "composition" && canvasContent && canvasContent.type === "composition" && urlState.compositionId === canvasContent.compositionId;
|
|
3271
3260
|
useEffect12(() => {
|
|
@@ -3288,7 +3277,7 @@ var TimelineZoomCtx = createContext5({
|
|
|
3288
3277
|
}
|
|
3289
3278
|
});
|
|
3290
3279
|
var TimelineZoomContext = ({ children }) => {
|
|
3291
|
-
const [zoom, setZoomState] =
|
|
3280
|
+
const [zoom, setZoomState] = useState10(() => getZoomFromLocalStorage());
|
|
3292
3281
|
const setZoom = useCallback13((compositionId, callback, options) => {
|
|
3293
3282
|
setZoomState((prevZoomMap) => {
|
|
3294
3283
|
const newZoomWithFloatingPointErrors = Math.min(TIMELINE_MAX_ZOOM, Math.max(TIMELINE_MIN_ZOOM, callback(prevZoomMap[compositionId] ?? TIMELINE_MIN_ZOOM)));
|
|
@@ -3319,11 +3308,11 @@ var TimelineZoomContext = ({ children }) => {
|
|
|
3319
3308
|
};
|
|
3320
3309
|
|
|
3321
3310
|
// src/components/EditorContent.tsx
|
|
3322
|
-
import { useContext as
|
|
3311
|
+
import { useContext as useContext80 } from "react";
|
|
3323
3312
|
import { Internals as Internals58 } from "remotion";
|
|
3324
3313
|
|
|
3325
3314
|
// src/helpers/is-current-selected-still.ts
|
|
3326
|
-
import { useContext as
|
|
3315
|
+
import { useContext as useContext5 } from "react";
|
|
3327
3316
|
import { Internals as Internals5 } from "remotion";
|
|
3328
3317
|
|
|
3329
3318
|
// src/helpers/is-composition-still.ts
|
|
@@ -3344,7 +3333,7 @@ var useIsStill = () => {
|
|
|
3344
3333
|
};
|
|
3345
3334
|
var useIsVideoComposition = () => {
|
|
3346
3335
|
const isStill = useIsStill();
|
|
3347
|
-
const { canvasContent } =
|
|
3336
|
+
const { canvasContent } = useContext5(Internals5.CompositionManager);
|
|
3348
3337
|
if (canvasContent === null) {
|
|
3349
3338
|
return false;
|
|
3350
3339
|
}
|
|
@@ -3355,17 +3344,17 @@ var useIsVideoComposition = () => {
|
|
|
3355
3344
|
};
|
|
3356
3345
|
|
|
3357
3346
|
// src/components/InitialCompositionLoader.tsx
|
|
3358
|
-
import { useCallback as useCallback33, useContext as
|
|
3347
|
+
import { useCallback as useCallback33, useContext as useContext15, useEffect as useEffect23 } from "react";
|
|
3359
3348
|
import { Internals as Internals14 } from "remotion";
|
|
3360
3349
|
|
|
3361
3350
|
// src/helpers/mobile-layout.ts
|
|
3362
|
-
import { useEffect as useEffect13, useRef as useRef6, useState as
|
|
3351
|
+
import { useEffect as useEffect13, useRef as useRef6, useState as useState11 } from "react";
|
|
3363
3352
|
var breakpoint = 900;
|
|
3364
3353
|
function getIsMobile() {
|
|
3365
3354
|
return window.innerWidth < breakpoint;
|
|
3366
3355
|
}
|
|
3367
3356
|
var useMobileLayout = () => {
|
|
3368
|
-
const [isMobile, setIsMobile] =
|
|
3357
|
+
const [isMobile, setIsMobile] = useState11(getIsMobile());
|
|
3369
3358
|
const isMobileRef = useRef6(isMobile);
|
|
3370
3359
|
useEffect13(() => {
|
|
3371
3360
|
function handleResize() {
|
|
@@ -3383,7 +3372,7 @@ var useMobileLayout = () => {
|
|
|
3383
3372
|
};
|
|
3384
3373
|
|
|
3385
3374
|
// src/state/folders.tsx
|
|
3386
|
-
import { createContext as createContext7, useMemo as useMemo13, useState as
|
|
3375
|
+
import { createContext as createContext7, useMemo as useMemo13, useState as useState12 } from "react";
|
|
3387
3376
|
|
|
3388
3377
|
// src/helpers/persist-open-folders.tsx
|
|
3389
3378
|
import { createContext as createContext6 } from "react";
|
|
@@ -3423,8 +3412,8 @@ var FolderContext = createContext7({
|
|
|
3423
3412
|
}
|
|
3424
3413
|
});
|
|
3425
3414
|
var FolderContextProvider = ({ children }) => {
|
|
3426
|
-
const [compositionFoldersExpanded, setCompositionFoldersExpanded] =
|
|
3427
|
-
const [assetFoldersExpanded, setAssetFoldersExpanded] =
|
|
3415
|
+
const [compositionFoldersExpanded, setCompositionFoldersExpanded] = useState12(() => loadExpandedFolders("compositions"));
|
|
3416
|
+
const [assetFoldersExpanded, setAssetFoldersExpanded] = useState12(() => loadExpandedFolders("assets"));
|
|
3428
3417
|
const value = useMemo13(() => {
|
|
3429
3418
|
return {
|
|
3430
3419
|
compositionFoldersExpanded,
|
|
@@ -3440,7 +3429,7 @@ var FolderContextProvider = ({ children }) => {
|
|
|
3440
3429
|
};
|
|
3441
3430
|
|
|
3442
3431
|
// src/state/sidebar.tsx
|
|
3443
|
-
import { createContext as createContext8, useMemo as useMemo14, useState as
|
|
3432
|
+
import { createContext as createContext8, useMemo as useMemo14, useState as useState13 } from "react";
|
|
3444
3433
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3445
3434
|
var storageKey = (sidebar) => {
|
|
3446
3435
|
if (sidebar === "right") {
|
|
@@ -3483,7 +3472,7 @@ var SidebarContext = createContext8({
|
|
|
3483
3472
|
});
|
|
3484
3473
|
var SidebarContextProvider = ({ children }) => {
|
|
3485
3474
|
const isMobileLayout = useMobileLayout();
|
|
3486
|
-
const [sidebarCollapsedState, setSidebarCollapsedState] =
|
|
3475
|
+
const [sidebarCollapsedState, setSidebarCollapsedState] = useState13(() => ({
|
|
3487
3476
|
left: getSavedCollapsedStateLeft(isMobileLayout),
|
|
3488
3477
|
right: getSavedCollapsedStateRight(isMobileLayout)
|
|
3489
3478
|
}));
|
|
@@ -3517,7 +3506,7 @@ var SidebarContextProvider = ({ children }) => {
|
|
|
3517
3506
|
};
|
|
3518
3507
|
|
|
3519
3508
|
// src/components/CompositionSelector.tsx
|
|
3520
|
-
import { useCallback as useCallback26, useContext as
|
|
3509
|
+
import { useCallback as useCallback26, useContext as useContext9, useMemo as useMemo26 } from "react";
|
|
3521
3510
|
import { Internals as Internals9 } from "remotion";
|
|
3522
3511
|
|
|
3523
3512
|
// src/helpers/create-folder-tree.ts
|
|
@@ -3713,11 +3702,11 @@ var ModalsContext = createContext9({
|
|
|
3713
3702
|
// src/components/CompositionSelectorItem.tsx
|
|
3714
3703
|
import {
|
|
3715
3704
|
useCallback as useCallback25,
|
|
3716
|
-
useContext as
|
|
3717
|
-
useLayoutEffect as
|
|
3705
|
+
useContext as useContext8,
|
|
3706
|
+
useLayoutEffect as useLayoutEffect2,
|
|
3718
3707
|
useMemo as useMemo25,
|
|
3719
3708
|
useRef as useRef13,
|
|
3720
|
-
useState as
|
|
3709
|
+
useState as useState21
|
|
3721
3710
|
} from "react";
|
|
3722
3711
|
|
|
3723
3712
|
// src/helpers/sidebar-scroll-into-view.ts
|
|
@@ -3863,7 +3852,7 @@ var FilmIcon = ({ color, ...props }) => {
|
|
|
3863
3852
|
};
|
|
3864
3853
|
|
|
3865
3854
|
// src/components/CompositionContextButton.tsx
|
|
3866
|
-
import { useCallback as useCallback22, useContext as
|
|
3855
|
+
import { useCallback as useCallback22, useContext as useContext6, useMemo as useMemo22 } from "react";
|
|
3867
3856
|
|
|
3868
3857
|
// src/helpers/client-id.tsx
|
|
3869
3858
|
import React28, { useCallback as useCallback16, useEffect as useEffect16, useMemo as useMemo16, useRef as useRef8 } from "react";
|
|
@@ -3874,7 +3863,7 @@ import {
|
|
|
3874
3863
|
createRef as createRef4,
|
|
3875
3864
|
useCallback as useCallback14,
|
|
3876
3865
|
useImperativeHandle as useImperativeHandle3,
|
|
3877
|
-
useState as
|
|
3866
|
+
useState as useState14
|
|
3878
3867
|
} from "react";
|
|
3879
3868
|
|
|
3880
3869
|
// src/components/Notifications/Notification.tsx
|
|
@@ -3936,7 +3925,7 @@ var showNotification = (content, durationInMs) => {
|
|
|
3936
3925
|
});
|
|
3937
3926
|
};
|
|
3938
3927
|
var NotificationCenter = () => {
|
|
3939
|
-
const [notifications, setNotifications] =
|
|
3928
|
+
const [notifications, setNotifications] = useState14([]);
|
|
3940
3929
|
const onRemove = useCallback14((id) => {
|
|
3941
3930
|
setNotifications((not) => {
|
|
3942
3931
|
return not.filter((n) => n.id !== id);
|
|
@@ -4008,7 +3997,7 @@ import React27, {
|
|
|
4008
3997
|
useImperativeHandle as useImperativeHandle4,
|
|
4009
3998
|
useMemo as useMemo15,
|
|
4010
3999
|
useRef as useRef7,
|
|
4011
|
-
useState as
|
|
4000
|
+
useState as useState15
|
|
4012
4001
|
} from "react";
|
|
4013
4002
|
|
|
4014
4003
|
// src/components/RenderQueue/client-render-queue.ts
|
|
@@ -4078,9 +4067,9 @@ var RenderQueueContext = React27.createContext({
|
|
|
4078
4067
|
});
|
|
4079
4068
|
var renderJobsRef = createRef5();
|
|
4080
4069
|
var RenderQueueContextProvider = ({ children }) => {
|
|
4081
|
-
const [serverJobs, setServerJobs] =
|
|
4082
|
-
const [clientJobs, setClientJobs] =
|
|
4083
|
-
const [currentlyProcessing, setCurrentlyProcessing] =
|
|
4070
|
+
const [serverJobs, setServerJobs] = useState15(window.remotion_initialRenderQueue ?? []);
|
|
4071
|
+
const [clientJobs, setClientJobs] = useState15(restorePersistedClientRenders);
|
|
4072
|
+
const [currentlyProcessing, setCurrentlyProcessing] = useState15(null);
|
|
4084
4073
|
const processJobCallbackRef = useRef7(null);
|
|
4085
4074
|
useEffect15(() => {
|
|
4086
4075
|
if (currentlyProcessing) {
|
|
@@ -4365,11 +4354,11 @@ var EllipsisIcon = (props) => {
|
|
|
4365
4354
|
|
|
4366
4355
|
// src/components/InlineDropdown.tsx
|
|
4367
4356
|
import { PlayerInternals as PlayerInternals4 } from "@remotion/player";
|
|
4368
|
-
import { useCallback as useCallback21, useMemo as useMemo21, useRef as useRef11, useState as
|
|
4357
|
+
import { useCallback as useCallback21, useMemo as useMemo21, useRef as useRef11, useState as useState19 } from "react";
|
|
4369
4358
|
import ReactDOM3 from "react-dom";
|
|
4370
4359
|
|
|
4371
4360
|
// src/components/InlineAction.tsx
|
|
4372
|
-
import { useCallback as useCallback17, useMemo as useMemo17, useState as
|
|
4361
|
+
import { useCallback as useCallback17, useMemo as useMemo17, useState as useState16 } from "react";
|
|
4373
4362
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
4374
4363
|
var InlineAction = ({
|
|
4375
4364
|
renderAction,
|
|
@@ -4378,7 +4367,7 @@ var InlineAction = ({
|
|
|
4378
4367
|
title: title2
|
|
4379
4368
|
}) => {
|
|
4380
4369
|
const { tabIndex } = useZIndex();
|
|
4381
|
-
const [hovered, setHovered] =
|
|
4370
|
+
const [hovered, setHovered] = useState16(false);
|
|
4382
4371
|
const onPointerEnter = useCallback17(() => {
|
|
4383
4372
|
setHovered(true);
|
|
4384
4373
|
}, []);
|
|
@@ -4424,7 +4413,7 @@ var getPortal = (i) => {
|
|
|
4424
4413
|
};
|
|
4425
4414
|
|
|
4426
4415
|
// src/components/NewComposition/MenuContent.tsx
|
|
4427
|
-
import { useCallback as useCallback20, useEffect as useEffect18, useMemo as useMemo20, useRef as useRef10, useState as
|
|
4416
|
+
import { useCallback as useCallback20, useEffect as useEffect18, useMemo as useMemo20, useRef as useRef10, useState as useState18 } from "react";
|
|
4428
4417
|
|
|
4429
4418
|
// src/components/Menu/MenuDivider.tsx
|
|
4430
4419
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
@@ -4442,7 +4431,7 @@ var MenuDivider = () => {
|
|
|
4442
4431
|
|
|
4443
4432
|
// src/components/Menu/MenuSubItem.tsx
|
|
4444
4433
|
import { PlayerInternals as PlayerInternals3 } from "@remotion/player";
|
|
4445
|
-
import { useCallback as useCallback19, useEffect as useEffect17, useMemo as useMemo19, useRef as useRef9, useState as
|
|
4434
|
+
import { useCallback as useCallback19, useEffect as useEffect17, useMemo as useMemo19, useRef as useRef9, useState as useState17 } from "react";
|
|
4446
4435
|
import ReactDOM2 from "react-dom";
|
|
4447
4436
|
|
|
4448
4437
|
// src/icons/caret.tsx
|
|
@@ -4574,7 +4563,7 @@ var MenuSubItem = ({
|
|
|
4574
4563
|
setSubMenuActivated,
|
|
4575
4564
|
disabled
|
|
4576
4565
|
}) => {
|
|
4577
|
-
const [hovered, setHovered] =
|
|
4566
|
+
const [hovered, setHovered] = useState17(false);
|
|
4578
4567
|
const ref = useRef9(null);
|
|
4579
4568
|
const size2 = PlayerInternals3.useElementSize(ref, {
|
|
4580
4569
|
triggerOnWindowResize: true,
|
|
@@ -4743,13 +4732,13 @@ var MenuContent = ({
|
|
|
4743
4732
|
const keybindings = useKeybinding();
|
|
4744
4733
|
const containerRef = useRef10(null);
|
|
4745
4734
|
const isMobileLayout = useMobileLayout();
|
|
4746
|
-
const [subMenuActivated, setSubMenuActivated] =
|
|
4735
|
+
const [subMenuActivated, setSubMenuActivated] = useState18(false);
|
|
4747
4736
|
const typeaheadQueryRef = useRef10("");
|
|
4748
4737
|
const typeaheadTimeoutRef = useRef10(null);
|
|
4749
4738
|
if (values[0].type === "divider") {
|
|
4750
4739
|
throw new Error("first value cant be divide");
|
|
4751
4740
|
}
|
|
4752
|
-
const [selectedItem, setSelectedItem] =
|
|
4741
|
+
const [selectedItem, setSelectedItem] = useState18(typeof preselectIndex === "number" && preselectIndex >= 0 ? values[preselectIndex].id : null);
|
|
4753
4742
|
const onEscape = useCallback20(() => {
|
|
4754
4743
|
onHide();
|
|
4755
4744
|
}, [onHide]);
|
|
@@ -5047,7 +5036,7 @@ var InlineDropdown = ({
|
|
|
5047
5036
|
...props
|
|
5048
5037
|
}) => {
|
|
5049
5038
|
const ref = useRef11(null);
|
|
5050
|
-
const [opened, setOpened] =
|
|
5039
|
+
const [opened, setOpened] = useState19({ type: "not-open" });
|
|
5051
5040
|
const { currentZIndex } = useZIndex();
|
|
5052
5041
|
const size2 = PlayerInternals4.useElementSize(ref, {
|
|
5053
5042
|
triggerOnWindowResize: true,
|
|
@@ -5149,7 +5138,7 @@ var CompositionContextButton = ({ visible, values }) => {
|
|
|
5149
5138
|
}
|
|
5150
5139
|
};
|
|
5151
5140
|
}, []);
|
|
5152
|
-
const connectionStatus =
|
|
5141
|
+
const connectionStatus = useContext6(StudioServerConnectionCtx).previewServerState.type;
|
|
5153
5142
|
const renderAction = useCallback22((color) => {
|
|
5154
5143
|
return /* @__PURE__ */ jsx48(EllipsisIcon, {
|
|
5155
5144
|
fill: color,
|
|
@@ -5167,12 +5156,12 @@ var CompositionContextButton = ({ visible, values }) => {
|
|
|
5167
5156
|
|
|
5168
5157
|
// src/components/ContextMenu.tsx
|
|
5169
5158
|
import { PlayerInternals as PlayerInternals5 } from "@remotion/player";
|
|
5170
|
-
import { useCallback as useCallback23, useEffect as useEffect19, useMemo as useMemo23, useRef as useRef12, useState as
|
|
5159
|
+
import { useCallback as useCallback23, useEffect as useEffect19, useMemo as useMemo23, useRef as useRef12, useState as useState20 } from "react";
|
|
5171
5160
|
import ReactDOM4 from "react-dom";
|
|
5172
5161
|
import { jsx as jsx49, jsxs as jsxs21, Fragment as Fragment5 } from "react/jsx-runtime";
|
|
5173
5162
|
var ContextMenu = ({ children, values }) => {
|
|
5174
5163
|
const ref = useRef12(null);
|
|
5175
|
-
const [opened, setOpened] =
|
|
5164
|
+
const [opened, setOpened] = useState20({ type: "not-open" });
|
|
5176
5165
|
const { currentZIndex } = useZIndex();
|
|
5177
5166
|
const style3 = useMemo23(() => {
|
|
5178
5167
|
return {};
|
|
@@ -5278,7 +5267,7 @@ var ContextMenu = ({ children, values }) => {
|
|
|
5278
5267
|
};
|
|
5279
5268
|
|
|
5280
5269
|
// src/components/SidebarRenderButton.tsx
|
|
5281
|
-
import { useCallback as useCallback24, useContext as
|
|
5270
|
+
import { useCallback as useCallback24, useContext as useContext7, useMemo as useMemo24 } from "react";
|
|
5282
5271
|
import { Internals as Internals7 } from "remotion";
|
|
5283
5272
|
|
|
5284
5273
|
// src/icons/render.tsx
|
|
@@ -5298,8 +5287,8 @@ var ThinRenderIcon = (props) => {
|
|
|
5298
5287
|
// src/components/SidebarRenderButton.tsx
|
|
5299
5288
|
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
5300
5289
|
var SidebarRenderButton = ({ composition, visible }) => {
|
|
5301
|
-
const { setSelectedModal } =
|
|
5302
|
-
const { setSidebarCollapsedState } =
|
|
5290
|
+
const { setSelectedModal } = useContext7(ModalsContext);
|
|
5291
|
+
const { setSidebarCollapsedState } = useContext7(SidebarContext);
|
|
5303
5292
|
const isMobileLayout = useMobileLayout();
|
|
5304
5293
|
const iconStyle = useMemo24(() => {
|
|
5305
5294
|
return {
|
|
@@ -5308,8 +5297,8 @@ var SidebarRenderButton = ({ composition, visible }) => {
|
|
|
5308
5297
|
}
|
|
5309
5298
|
};
|
|
5310
5299
|
}, []);
|
|
5311
|
-
const connectionStatus =
|
|
5312
|
-
const { props } =
|
|
5300
|
+
const connectionStatus = useContext7(StudioServerConnectionCtx).previewServerState.type;
|
|
5301
|
+
const { props } = useContext7(Internals7.EditorPropsContext);
|
|
5313
5302
|
const onClick = useCallback24((e) => {
|
|
5314
5303
|
const defaults = window.remotion_renderDefaults;
|
|
5315
5304
|
if (!defaults) {
|
|
@@ -5443,7 +5432,7 @@ var CompositionSelectorItem = ({
|
|
|
5443
5432
|
}
|
|
5444
5433
|
return false;
|
|
5445
5434
|
}, [item, currentComposition]);
|
|
5446
|
-
const [hovered, setHovered] =
|
|
5435
|
+
const [hovered, setHovered] = useState21(false);
|
|
5447
5436
|
const onPointerEnter = useCallback25(() => {
|
|
5448
5437
|
setHovered(true);
|
|
5449
5438
|
}, []);
|
|
@@ -5452,7 +5441,7 @@ var CompositionSelectorItem = ({
|
|
|
5452
5441
|
}, []);
|
|
5453
5442
|
const compositionRowRef = useRef13(null);
|
|
5454
5443
|
const compositionId = item.type === "composition" ? item.composition.id : null;
|
|
5455
|
-
|
|
5444
|
+
useLayoutEffect2(() => {
|
|
5456
5445
|
if (compositionId === null) {
|
|
5457
5446
|
return;
|
|
5458
5447
|
}
|
|
@@ -5489,7 +5478,7 @@ var CompositionSelectorItem = ({
|
|
|
5489
5478
|
onClick(evt);
|
|
5490
5479
|
}
|
|
5491
5480
|
}, [onClick]);
|
|
5492
|
-
const { setSelectedModal } =
|
|
5481
|
+
const { setSelectedModal } = useContext8(ModalsContext);
|
|
5493
5482
|
const contextMenu = useMemo25(() => {
|
|
5494
5483
|
if (item.type === "composition") {
|
|
5495
5484
|
return [
|
|
@@ -5747,7 +5736,7 @@ var CurrentComposition = () => {
|
|
|
5747
5736
|
// src/components/CompositionSelector.tsx
|
|
5748
5737
|
import { jsx as jsx54, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5749
5738
|
var useCompositionNavigation = () => {
|
|
5750
|
-
const { compositions, canvasContent } =
|
|
5739
|
+
const { compositions, canvasContent } = useContext9(Internals9.CompositionManager);
|
|
5751
5740
|
const selectComposition = useSelectComposition();
|
|
5752
5741
|
const navigateToNextComposition = useCallback26(() => {
|
|
5753
5742
|
if (!canvasContent || canvasContent.type !== "composition" || compositions.length <= 1) {
|
|
@@ -5820,9 +5809,9 @@ var getKeysToExpand = (initialFolderName, parentFolderName, initial = []) => {
|
|
|
5820
5809
|
return getKeysToExpand(name, parent, initial);
|
|
5821
5810
|
};
|
|
5822
5811
|
var CompositionSelector = () => {
|
|
5823
|
-
const { compositions, canvasContent, folders } =
|
|
5824
|
-
const { foldersExpanded } =
|
|
5825
|
-
const { setSelectedModal } =
|
|
5812
|
+
const { compositions, canvasContent, folders } = useContext9(Internals9.CompositionManager);
|
|
5813
|
+
const { foldersExpanded } = useContext9(ExpandedFoldersContext);
|
|
5814
|
+
const { setSelectedModal } = useContext9(ModalsContext);
|
|
5826
5815
|
const { tabIndex } = useZIndex();
|
|
5827
5816
|
const selectComposition = useSelectComposition();
|
|
5828
5817
|
const sortedCompositions = useMemo26(() => {
|
|
@@ -5892,10 +5881,10 @@ var CompositionSelector = () => {
|
|
|
5892
5881
|
};
|
|
5893
5882
|
|
|
5894
5883
|
// src/components/ExplorerPanel.tsx
|
|
5895
|
-
import { createRef as createRef6, useCallback as useCallback32, useImperativeHandle as useImperativeHandle6, useState as
|
|
5884
|
+
import { createRef as createRef6, useCallback as useCallback32, useImperativeHandle as useImperativeHandle6, useState as useState28 } from "react";
|
|
5896
5885
|
|
|
5897
5886
|
// src/components/AssetSelector.tsx
|
|
5898
|
-
import { useCallback as useCallback29, useContext as
|
|
5887
|
+
import { useCallback as useCallback29, useContext as useContext13, useMemo as useMemo30, useState as useState25 } from "react";
|
|
5899
5888
|
import { Internals as Internals12 } from "remotion";
|
|
5900
5889
|
|
|
5901
5890
|
// src/api/write-static-file.ts
|
|
@@ -5967,11 +5956,11 @@ var use_asset_drag_events_default = useAssetDragEvents;
|
|
|
5967
5956
|
// src/components/AssetSelectorItem.tsx
|
|
5968
5957
|
import React39, {
|
|
5969
5958
|
useCallback as useCallback28,
|
|
5970
|
-
useContext as
|
|
5971
|
-
useLayoutEffect as
|
|
5959
|
+
useContext as useContext10,
|
|
5960
|
+
useLayoutEffect as useLayoutEffect3,
|
|
5972
5961
|
useMemo as useMemo28,
|
|
5973
5962
|
useRef as useRef15,
|
|
5974
|
-
useState as
|
|
5963
|
+
useState as useState22
|
|
5975
5964
|
} from "react";
|
|
5976
5965
|
import { Internals as Internals10 } from "remotion";
|
|
5977
5966
|
import { NoReactInternals as NoReactInternals3 } from "remotion/no-react";
|
|
@@ -6357,7 +6346,7 @@ var AssetFolderItem = ({
|
|
|
6357
6346
|
setDropLocation,
|
|
6358
6347
|
readOnlyStudio
|
|
6359
6348
|
}) => {
|
|
6360
|
-
const [hovered, setHovered] =
|
|
6349
|
+
const [hovered, setHovered] = useState22(false);
|
|
6361
6350
|
const openFolderTimerRef = useRef15(null);
|
|
6362
6351
|
const { isDropDiv, onDragEnter, onDragLeave } = use_asset_drag_events_default({
|
|
6363
6352
|
name: item.name,
|
|
@@ -6486,13 +6475,13 @@ var AssetFolderTree = ({
|
|
|
6486
6475
|
};
|
|
6487
6476
|
var AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio }) => {
|
|
6488
6477
|
const isMobileLayout = useMobileLayout();
|
|
6489
|
-
const [hovered, setHovered] =
|
|
6490
|
-
const { setSidebarCollapsedState } =
|
|
6478
|
+
const [hovered, setHovered] = useState22(false);
|
|
6479
|
+
const { setSidebarCollapsedState } = useContext10(SidebarContext);
|
|
6491
6480
|
const onPointerEnter = useCallback28(() => {
|
|
6492
6481
|
setHovered(true);
|
|
6493
6482
|
}, []);
|
|
6494
|
-
const { setCanvasContent } =
|
|
6495
|
-
const { canvasContent } =
|
|
6483
|
+
const { setCanvasContent } = useContext10(Internals10.CompositionSetters);
|
|
6484
|
+
const { canvasContent } = useContext10(Internals10.CompositionManager);
|
|
6496
6485
|
const relativePath = useMemo28(() => {
|
|
6497
6486
|
return parentFolder ? parentFolder + "/" + item.name : item.name;
|
|
6498
6487
|
}, [parentFolder, item.name]);
|
|
@@ -6506,7 +6495,7 @@ var AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio }
|
|
|
6506
6495
|
setHovered(false);
|
|
6507
6496
|
}, []);
|
|
6508
6497
|
const rowRef = useRef15(null);
|
|
6509
|
-
|
|
6498
|
+
useLayoutEffect3(() => {
|
|
6510
6499
|
maybeScrollAssetSidebarRowIntoView({
|
|
6511
6500
|
element: rowRef.current,
|
|
6512
6501
|
assetPath: relativePath,
|
|
@@ -6623,11 +6612,11 @@ var AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio }
|
|
|
6623
6612
|
// src/components/CurrentAsset.tsx
|
|
6624
6613
|
import { formatBytes } from "@remotion/studio-shared";
|
|
6625
6614
|
import { ALL_FORMATS, Input, UrlSource } from "mediabunny";
|
|
6626
|
-
import { useContext as
|
|
6615
|
+
import { useContext as useContext12, useEffect as useEffect22, useMemo as useMemo29, useState as useState24 } from "react";
|
|
6627
6616
|
import { Internals as Internals11, staticFile } from "remotion";
|
|
6628
6617
|
|
|
6629
6618
|
// src/components/use-static-files.ts
|
|
6630
|
-
import React40, { createContext as createContext10, useContext as
|
|
6619
|
+
import React40, { createContext as createContext10, useContext as useContext11, useEffect as useEffect21, useState as useState23 } from "react";
|
|
6631
6620
|
import { useRemotionEnvironment } from "remotion";
|
|
6632
6621
|
|
|
6633
6622
|
// src/api/get-static-files.ts
|
|
@@ -6685,7 +6674,7 @@ var watchPublicFolder = (callback) => {
|
|
|
6685
6674
|
// src/components/use-static-files.ts
|
|
6686
6675
|
var StaticFilesContext = createContext10([]);
|
|
6687
6676
|
var StaticFilesProvider = ({ children }) => {
|
|
6688
|
-
const [files, setFiles] =
|
|
6677
|
+
const [files, setFiles] = useState23(() => getStaticFiles());
|
|
6689
6678
|
const env = useRemotionEnvironment();
|
|
6690
6679
|
useEffect21(() => {
|
|
6691
6680
|
if (!env.isStudio) {
|
|
@@ -6702,7 +6691,7 @@ var StaticFilesProvider = ({ children }) => {
|
|
|
6702
6691
|
return React40.createElement(StaticFilesContext.Provider, { value: files }, children);
|
|
6703
6692
|
};
|
|
6704
6693
|
var useStaticFiles = () => {
|
|
6705
|
-
return
|
|
6694
|
+
return useContext11(StaticFilesContext);
|
|
6706
6695
|
};
|
|
6707
6696
|
|
|
6708
6697
|
// src/components/CurrentAsset.tsx
|
|
@@ -6747,7 +6736,7 @@ var formatDuration = (seconds) => {
|
|
|
6747
6736
|
return `${String(m).padStart(2, "0")}:${sFixed}`;
|
|
6748
6737
|
};
|
|
6749
6738
|
var CurrentAsset = () => {
|
|
6750
|
-
const { canvasContent } =
|
|
6739
|
+
const { canvasContent } = useContext12(Internals11.CompositionManager);
|
|
6751
6740
|
const assetName = canvasContent?.type === "asset" ? canvasContent.asset : null;
|
|
6752
6741
|
const staticFiles = useStaticFiles();
|
|
6753
6742
|
const sizeInBytes = useMemo29(() => {
|
|
@@ -6757,7 +6746,7 @@ var CurrentAsset = () => {
|
|
|
6757
6746
|
const file = staticFiles.find((f) => f.name === assetName);
|
|
6758
6747
|
return file?.sizeInBytes ?? null;
|
|
6759
6748
|
}, [assetName, staticFiles]);
|
|
6760
|
-
const [mediaMetadata, setMediaMetadata] =
|
|
6749
|
+
const [mediaMetadata, setMediaMetadata] = useState24(null);
|
|
6761
6750
|
useEffect22(() => {
|
|
6762
6751
|
setMediaMetadata(null);
|
|
6763
6752
|
if (!assetName) {
|
|
@@ -6851,10 +6840,10 @@ var baseList = {
|
|
|
6851
6840
|
};
|
|
6852
6841
|
var AssetSelector = ({ readOnlyStudio }) => {
|
|
6853
6842
|
const { tabIndex } = useZIndex();
|
|
6854
|
-
const { canvasContent } =
|
|
6855
|
-
const { assetFoldersExpanded, setAssetFoldersExpanded } =
|
|
6856
|
-
const [dropLocation, setDropLocation] =
|
|
6857
|
-
const connectionStatus =
|
|
6843
|
+
const { canvasContent } = useContext13(Internals12.CompositionManager);
|
|
6844
|
+
const { assetFoldersExpanded, setAssetFoldersExpanded } = useContext13(FolderContext);
|
|
6845
|
+
const [dropLocation, setDropLocation] = useState25(null);
|
|
6846
|
+
const connectionStatus = useContext13(StudioServerConnectionCtx).previewServerState.type;
|
|
6858
6847
|
const shouldAllowUpload = connectionStatus === "connected" && !readOnlyStudio;
|
|
6859
6848
|
const showCurrentAsset = canvasContent?.type === "asset";
|
|
6860
6849
|
const list = useMemo30(() => {
|
|
@@ -6977,16 +6966,16 @@ var AssetSelector = ({ readOnlyStudio }) => {
|
|
|
6977
6966
|
// src/components/CompSelectorRef.tsx
|
|
6978
6967
|
import {
|
|
6979
6968
|
useCallback as useCallback30,
|
|
6980
|
-
useContext as
|
|
6969
|
+
useContext as useContext14,
|
|
6981
6970
|
useImperativeHandle as useImperativeHandle5,
|
|
6982
6971
|
useMemo as useMemo31,
|
|
6983
|
-
useState as
|
|
6972
|
+
useState as useState26
|
|
6984
6973
|
} from "react";
|
|
6985
6974
|
import { Internals as Internals13 } from "remotion";
|
|
6986
6975
|
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
6987
6976
|
var CompSelectorRef = ({ children }) => {
|
|
6988
|
-
const { compositions } =
|
|
6989
|
-
const [foldersExpanded, setFoldersExpanded] =
|
|
6977
|
+
const { compositions } = useContext14(Internals13.CompositionManager);
|
|
6978
|
+
const [foldersExpanded, setFoldersExpanded] = useState26(loadExpandedFolders("compositions"));
|
|
6990
6979
|
const selectComposition = useSelectComposition();
|
|
6991
6980
|
const toggleFolder = useCallback30((folderName, parentName) => {
|
|
6992
6981
|
setFoldersExpanded((p) => {
|
|
@@ -7059,7 +7048,7 @@ var CompSelectorRef = ({ children }) => {
|
|
|
7059
7048
|
};
|
|
7060
7049
|
|
|
7061
7050
|
// src/components/Tabs/index.tsx
|
|
7062
|
-
import { useCallback as useCallback31, useMemo as useMemo32, useState as
|
|
7051
|
+
import { useCallback as useCallback31, useMemo as useMemo32, useState as useState27 } from "react";
|
|
7063
7052
|
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
7064
7053
|
var tabsContainer = {
|
|
7065
7054
|
display: "flex",
|
|
@@ -7093,7 +7082,7 @@ var selectorButton = {
|
|
|
7093
7082
|
WebkitUserSelect: "none"
|
|
7094
7083
|
};
|
|
7095
7084
|
var Tab = ({ children, onClick, style: style3, selected }) => {
|
|
7096
|
-
const [hovered, setHovered] =
|
|
7085
|
+
const [hovered, setHovered] = useState27(false);
|
|
7097
7086
|
const { tabIndex } = useZIndex();
|
|
7098
7087
|
const onPointerEnter = useCallback31(() => {
|
|
7099
7088
|
setHovered(true);
|
|
@@ -7146,7 +7135,7 @@ var persistSelectedOptionsSidebarPanel = (panel) => {
|
|
|
7146
7135
|
};
|
|
7147
7136
|
var explorerSidebarTabs = createRef6();
|
|
7148
7137
|
var ExplorerPanel = ({ readOnlyStudio }) => {
|
|
7149
|
-
const [panel, setPanel] =
|
|
7138
|
+
const [panel, setPanel] = useState28(() => getSelectedPanel());
|
|
7150
7139
|
const onCompositionsSelected = useCallback32(() => {
|
|
7151
7140
|
setPanel("compositions");
|
|
7152
7141
|
persistSelectedOptionsSidebarPanel("compositions");
|
|
@@ -7199,8 +7188,8 @@ var ExplorerPanel = ({ readOnlyStudio }) => {
|
|
|
7199
7188
|
|
|
7200
7189
|
// src/components/InitialCompositionLoader.tsx
|
|
7201
7190
|
var useSelectAsset = () => {
|
|
7202
|
-
const { setCanvasContent } =
|
|
7203
|
-
const { setAssetFoldersExpanded } =
|
|
7191
|
+
const { setCanvasContent } = useContext15(Internals14.CompositionSetters);
|
|
7192
|
+
const { setAssetFoldersExpanded } = useContext15(FolderContext);
|
|
7204
7193
|
return useCallback33((asset) => {
|
|
7205
7194
|
setCanvasContent({ type: "asset", asset });
|
|
7206
7195
|
explorerSidebarTabs.current?.selectAssetsPanel();
|
|
@@ -7220,10 +7209,10 @@ var useSelectAsset = () => {
|
|
|
7220
7209
|
}, [setAssetFoldersExpanded, setCanvasContent]);
|
|
7221
7210
|
};
|
|
7222
7211
|
var useSelectComposition = () => {
|
|
7223
|
-
const { setCompositionFoldersExpanded } =
|
|
7224
|
-
const { setCanvasContent } =
|
|
7212
|
+
const { setCompositionFoldersExpanded } = useContext15(FolderContext);
|
|
7213
|
+
const { setCanvasContent } = useContext15(Internals14.CompositionSetters);
|
|
7225
7214
|
const isMobileLayout = useMobileLayout();
|
|
7226
|
-
const { setSidebarCollapsedState } =
|
|
7215
|
+
const { setSidebarCollapsedState } = useContext15(SidebarContext);
|
|
7227
7216
|
return useCallback33((c, push) => {
|
|
7228
7217
|
if (push) {
|
|
7229
7218
|
pushUrl(`/${c.id}`);
|
|
@@ -7254,8 +7243,8 @@ var useSelectComposition = () => {
|
|
|
7254
7243
|
]);
|
|
7255
7244
|
};
|
|
7256
7245
|
var InitialCompositionLoader = () => {
|
|
7257
|
-
const { compositions, canvasContent } =
|
|
7258
|
-
const { setCanvasContent } =
|
|
7246
|
+
const { compositions, canvasContent } = useContext15(Internals14.CompositionManager);
|
|
7247
|
+
const { setCanvasContent } = useContext15(Internals14.CompositionSetters);
|
|
7259
7248
|
const selectComposition = useSelectComposition();
|
|
7260
7249
|
const selectAsset = useSelectAsset();
|
|
7261
7250
|
const staticFiles = useStaticFiles();
|
|
@@ -7330,10 +7319,10 @@ var InitialCompositionLoader = () => {
|
|
|
7330
7319
|
};
|
|
7331
7320
|
|
|
7332
7321
|
// src/components/MenuToolbar.tsx
|
|
7333
|
-
import { useCallback as useCallback100, useMemo as useMemo105, useState as
|
|
7322
|
+
import { useCallback as useCallback100, useMemo as useMemo105, useState as useState70 } from "react";
|
|
7334
7323
|
|
|
7335
7324
|
// src/helpers/use-menu-structure.tsx
|
|
7336
|
-
import { useContext as
|
|
7325
|
+
import { useContext as useContext22, useMemo as useMemo42 } from "react";
|
|
7337
7326
|
import { Internals as Internals19 } from "remotion";
|
|
7338
7327
|
import { NoReactInternals as NoReactInternals5 } from "remotion/no-react";
|
|
7339
7328
|
|
|
@@ -7356,7 +7345,7 @@ import {
|
|
|
7356
7345
|
useEffect as useEffect24,
|
|
7357
7346
|
useImperativeHandle as useImperativeHandle7,
|
|
7358
7347
|
useRef as useRef16,
|
|
7359
|
-
useState as
|
|
7348
|
+
useState as useState29
|
|
7360
7349
|
} from "react";
|
|
7361
7350
|
import { AbsoluteFill as AbsoluteFill3 } from "remotion";
|
|
7362
7351
|
|
|
@@ -7403,7 +7392,7 @@ var ModalContainer = ({ children, onEscape, onOutsideClick, noZIndex }) => {
|
|
|
7403
7392
|
};
|
|
7404
7393
|
|
|
7405
7394
|
// src/components/ModalHeader.tsx
|
|
7406
|
-
import { useCallback as useCallback34, useContext as
|
|
7395
|
+
import { useCallback as useCallback34, useContext as useContext16 } from "react";
|
|
7407
7396
|
|
|
7408
7397
|
// src/components/NewComposition/CancelButton.tsx
|
|
7409
7398
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
@@ -7454,7 +7443,7 @@ var icon = {
|
|
|
7454
7443
|
width: 20
|
|
7455
7444
|
};
|
|
7456
7445
|
var ModalHeader = ({ title: title4, onClose }) => {
|
|
7457
|
-
const { setSelectedModal } =
|
|
7446
|
+
const { setSelectedModal } = useContext16(ModalsContext);
|
|
7458
7447
|
const onPress = useCallback34(() => {
|
|
7459
7448
|
setSelectedModal(null);
|
|
7460
7449
|
}, [setSelectedModal]);
|
|
@@ -7485,7 +7474,7 @@ var container18 = {
|
|
|
7485
7474
|
};
|
|
7486
7475
|
var askAiModalRef = createRef7();
|
|
7487
7476
|
var AskAiModal = () => {
|
|
7488
|
-
const [state, setState] =
|
|
7477
|
+
const [state, setState] = useState29("never-opened");
|
|
7489
7478
|
const iframe = useRef16(null);
|
|
7490
7479
|
useImperativeHandle7(askAiModalRef, () => ({
|
|
7491
7480
|
toggle: () => {
|
|
@@ -7552,7 +7541,7 @@ var AskAiModal = () => {
|
|
|
7552
7541
|
};
|
|
7553
7542
|
|
|
7554
7543
|
// src/components/SizeSelector.tsx
|
|
7555
|
-
import { useContext as
|
|
7544
|
+
import { useContext as useContext20, useMemo as useMemo39 } from "react";
|
|
7556
7545
|
import { Internals as Internals16 } from "remotion";
|
|
7557
7546
|
|
|
7558
7547
|
// src/icons/Checkmark.tsx
|
|
@@ -7597,7 +7586,7 @@ var ControlButton = (props) => {
|
|
|
7597
7586
|
|
|
7598
7587
|
// src/components/NewComposition/ComboBox.tsx
|
|
7599
7588
|
import { PlayerInternals as PlayerInternals6 } from "@remotion/player";
|
|
7600
|
-
import { useCallback as useCallback36, useEffect as useEffect25, useMemo as useMemo34, useRef as useRef17, useState as
|
|
7589
|
+
import { useCallback as useCallback36, useEffect as useEffect25, useMemo as useMemo34, useRef as useRef17, useState as useState30 } from "react";
|
|
7601
7590
|
import ReactDOM5 from "react-dom";
|
|
7602
7591
|
import { jsx as jsx69, jsxs as jsxs31, Fragment as Fragment8 } from "react/jsx-runtime";
|
|
7603
7592
|
var container19 = {
|
|
@@ -7616,8 +7605,8 @@ var label3 = {
|
|
|
7616
7605
|
textAlign: "left"
|
|
7617
7606
|
};
|
|
7618
7607
|
var Combobox = ({ values, selectedId, style: customStyle, title: title4 }) => {
|
|
7619
|
-
const [hovered, setIsHovered] =
|
|
7620
|
-
const [opened, setOpened] =
|
|
7608
|
+
const [hovered, setIsHovered] = useState30(false);
|
|
7609
|
+
const [opened, setOpened] = useState30(false);
|
|
7621
7610
|
const ref = useRef17(null);
|
|
7622
7611
|
const { tabIndex, currentZIndex } = useZIndex();
|
|
7623
7612
|
const size2 = PlayerInternals6.useElementSize(ref, {
|
|
@@ -7784,7 +7773,7 @@ var Combobox = ({ values, selectedId, style: customStyle, title: title4 }) => {
|
|
|
7784
7773
|
|
|
7785
7774
|
// src/components/Preview.tsx
|
|
7786
7775
|
import { PlayerInternals as PlayerInternals7 } from "@remotion/player";
|
|
7787
|
-
import { useContext as
|
|
7776
|
+
import { useContext as useContext19, useEffect as useEffect31, useMemo as useMemo38, useRef as useRef20 } from "react";
|
|
7788
7777
|
import { Internals as Internals15 } from "remotion";
|
|
7789
7778
|
|
|
7790
7779
|
// src/helpers/checkerboard-background.ts
|
|
@@ -7829,7 +7818,7 @@ var CheckerboardContext = createContext11({
|
|
|
7829
7818
|
});
|
|
7830
7819
|
|
|
7831
7820
|
// src/components/RenderPreview.tsx
|
|
7832
|
-
import { useContext as
|
|
7821
|
+
import { useContext as useContext17, useEffect as useEffect30, useState as useState35 } from "react";
|
|
7833
7822
|
|
|
7834
7823
|
// src/helpers/get-asset-metadata.ts
|
|
7835
7824
|
import { getVideoMetadata } from "@remotion/media-utils";
|
|
@@ -7916,7 +7905,7 @@ var getAssetMetadata = async (canvasContent, addTime) => {
|
|
|
7916
7905
|
import { formatBytes as formatBytes2 } from "@remotion/studio-shared";
|
|
7917
7906
|
|
|
7918
7907
|
// src/components/JSONViewer.tsx
|
|
7919
|
-
import { useEffect as useEffect28, useState as
|
|
7908
|
+
import { useEffect as useEffect28, useState as useState33 } from "react";
|
|
7920
7909
|
|
|
7921
7910
|
// src/components/NewComposition/RemTextarea.tsx
|
|
7922
7911
|
import {
|
|
@@ -7925,7 +7914,7 @@ import {
|
|
|
7925
7914
|
useImperativeHandle as useImperativeHandle9,
|
|
7926
7915
|
useMemo as useMemo36,
|
|
7927
7916
|
useRef as useRef19,
|
|
7928
|
-
useState as
|
|
7917
|
+
useState as useState32
|
|
7929
7918
|
} from "react";
|
|
7930
7919
|
|
|
7931
7920
|
// src/components/NewComposition/RemInput.tsx
|
|
@@ -7935,7 +7924,7 @@ import {
|
|
|
7935
7924
|
useImperativeHandle as useImperativeHandle8,
|
|
7936
7925
|
useMemo as useMemo35,
|
|
7937
7926
|
useRef as useRef18,
|
|
7938
|
-
useState as
|
|
7927
|
+
useState as useState31
|
|
7939
7928
|
} from "react";
|
|
7940
7929
|
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
7941
7930
|
var INPUT_HORIZONTAL_PADDING = 8;
|
|
@@ -7961,8 +7950,8 @@ var getInputBorderColor = ({
|
|
|
7961
7950
|
isHovered
|
|
7962
7951
|
}) => status === "warning" ? WARNING_COLOR : status === "error" ? FAIL_COLOR : isFocused ? SELECTED_BACKGROUND : isHovered ? INPUT_BORDER_COLOR_HOVERED : INPUT_BORDER_COLOR_UNHOVERED;
|
|
7963
7952
|
var RemInputForwardRef = ({ status, rightAlign, ...props }, ref) => {
|
|
7964
|
-
const [isFocused, setIsFocused] =
|
|
7965
|
-
const [isHovered, setIsHovered] =
|
|
7953
|
+
const [isFocused, setIsFocused] = useState31(false);
|
|
7954
|
+
const [isHovered, setIsHovered] = useState31(false);
|
|
7966
7955
|
const inputRef = useRef18(null);
|
|
7967
7956
|
const { tabIndex } = useZIndex();
|
|
7968
7957
|
const style5 = useMemo35(() => {
|
|
@@ -8019,8 +8008,8 @@ var inputBaseStyle2 = {
|
|
|
8019
8008
|
overflowX: "hidden"
|
|
8020
8009
|
};
|
|
8021
8010
|
var RemTextareaFRFunction = ({ status, ...props }, ref) => {
|
|
8022
|
-
const [isFocused, setIsFocused] =
|
|
8023
|
-
const [isHovered, setIsHovered] =
|
|
8011
|
+
const [isFocused, setIsFocused] = useState32(false);
|
|
8012
|
+
const [isHovered, setIsHovered] = useState32(false);
|
|
8024
8013
|
const inputRef = useRef19(null);
|
|
8025
8014
|
const { tabIndex } = useZIndex();
|
|
8026
8015
|
useImperativeHandle9(ref, () => {
|
|
@@ -8112,7 +8101,7 @@ var jsonStyle = {
|
|
|
8112
8101
|
flex: 1
|
|
8113
8102
|
};
|
|
8114
8103
|
var JSONViewer = ({ src }) => {
|
|
8115
|
-
const [json, setJson] =
|
|
8104
|
+
const [json, setJson] = useState33(null);
|
|
8116
8105
|
useEffect28(() => {
|
|
8117
8106
|
fetch(src).then((res) => res.json()).then((jsonRes) => {
|
|
8118
8107
|
setJson(JSON.stringify(jsonRes, null, 2));
|
|
@@ -8129,7 +8118,7 @@ var JSONViewer = ({ src }) => {
|
|
|
8129
8118
|
};
|
|
8130
8119
|
|
|
8131
8120
|
// src/components/TextViewer.tsx
|
|
8132
|
-
import { useEffect as useEffect29, useState as
|
|
8121
|
+
import { useEffect as useEffect29, useState as useState34 } from "react";
|
|
8133
8122
|
import { jsxs as jsxs32 } from "react/jsx-runtime";
|
|
8134
8123
|
var textStyle = {
|
|
8135
8124
|
margin: 14,
|
|
@@ -8139,7 +8128,7 @@ var textStyle = {
|
|
|
8139
8128
|
whiteSpace: "pre-wrap"
|
|
8140
8129
|
};
|
|
8141
8130
|
var TextViewer = ({ src }) => {
|
|
8142
|
-
const [txt, setTxt] =
|
|
8131
|
+
const [txt, setTxt] = useState34("");
|
|
8143
8132
|
useEffect29(() => {
|
|
8144
8133
|
fetch(src).then(async (res) => {
|
|
8145
8134
|
if (!res.ok || !res.body) {
|
|
@@ -8240,9 +8229,9 @@ var errMsgStyle = {
|
|
|
8240
8229
|
};
|
|
8241
8230
|
var RenderPreview = ({ path, assetMetadata, getBlob }) => {
|
|
8242
8231
|
const fileType = getPreviewFileType(path);
|
|
8243
|
-
const connectionStatus =
|
|
8244
|
-
const [blobUrl, setBlobUrl] =
|
|
8245
|
-
const [blobError, setBlobError] =
|
|
8232
|
+
const connectionStatus = useContext17(StudioServerConnectionCtx).previewServerState.type;
|
|
8233
|
+
const [blobUrl, setBlobUrl] = useState35(null);
|
|
8234
|
+
const [blobError, setBlobError] = useState35(null);
|
|
8246
8235
|
useEffect30(() => {
|
|
8247
8236
|
if (!getBlob) {
|
|
8248
8237
|
setBlobUrl(null);
|
|
@@ -8358,7 +8347,7 @@ var Spinner = ({ size: size2, duration }) => {
|
|
|
8358
8347
|
};
|
|
8359
8348
|
|
|
8360
8349
|
// src/components/StaticFilePreview.tsx
|
|
8361
|
-
import { useContext as
|
|
8350
|
+
import { useContext as useContext18 } from "react";
|
|
8362
8351
|
import { staticFile as staticFile3 } from "remotion";
|
|
8363
8352
|
import { jsx as jsx76, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
8364
8353
|
var msgStyle3 = {
|
|
@@ -8376,7 +8365,7 @@ var StaticFilePreview = ({ currentAsset, assetMetadata }) => {
|
|
|
8376
8365
|
const fileType = getPreviewFileType(currentAsset);
|
|
8377
8366
|
const staticFileSrc = staticFile3(currentAsset);
|
|
8378
8367
|
const staticFiles = useStaticFiles();
|
|
8379
|
-
const connectionStatus =
|
|
8368
|
+
const connectionStatus = useContext18(StudioServerConnectionCtx).previewServerState.type;
|
|
8380
8369
|
const exists = staticFiles.find((file) => file.name === currentAsset);
|
|
8381
8370
|
if (connectionStatus === "disconnected") {
|
|
8382
8371
|
return /* @__PURE__ */ jsx76("div", {
|
|
@@ -8515,7 +8504,7 @@ var VideoPreview = ({
|
|
|
8515
8504
|
});
|
|
8516
8505
|
};
|
|
8517
8506
|
var CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent, assetMetadata }) => {
|
|
8518
|
-
const { size: previewSize } =
|
|
8507
|
+
const { size: previewSize } = useContext19(Internals15.PreviewSizeContext);
|
|
8519
8508
|
const { centerX, centerY, yCorrection, xCorrection, scale } = useMemo38(() => {
|
|
8520
8509
|
if (contentDimensions === "none") {
|
|
8521
8510
|
return {
|
|
@@ -8594,7 +8583,7 @@ var CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent, a
|
|
|
8594
8583
|
});
|
|
8595
8584
|
};
|
|
8596
8585
|
var PortalContainer = ({ scale, xCorrection, yCorrection, contentDimensions }) => {
|
|
8597
|
-
const { checkerboard } =
|
|
8586
|
+
const { checkerboard } = useContext19(CheckerboardContext);
|
|
8598
8587
|
const style5 = useMemo38(() => {
|
|
8599
8588
|
return containerStyle({
|
|
8600
8589
|
checkerboard,
|
|
@@ -8686,8 +8675,8 @@ var getUniqueSizes = (size2) => {
|
|
|
8686
8675
|
};
|
|
8687
8676
|
var zoomableFileTypes = ["video", "image"];
|
|
8688
8677
|
var SizeSelector = () => {
|
|
8689
|
-
const { size: size2, setSize } =
|
|
8690
|
-
const { canvasContent } =
|
|
8678
|
+
const { size: size2, setSize } = useContext20(Internals16.PreviewSizeContext);
|
|
8679
|
+
const { canvasContent } = useContext20(Internals16.CompositionManager);
|
|
8691
8680
|
const style5 = useMemo39(() => {
|
|
8692
8681
|
return {
|
|
8693
8682
|
padding: CONTROL_BUTTON_PADDING
|
|
@@ -8785,7 +8774,7 @@ var TimelineOutPointer = (props) => {
|
|
|
8785
8774
|
};
|
|
8786
8775
|
|
|
8787
8776
|
// src/state/in-out.ts
|
|
8788
|
-
import { createContext as createContext12, useContext as
|
|
8777
|
+
import { createContext as createContext12, useContext as useContext21, useMemo as useMemo40 } from "react";
|
|
8789
8778
|
import { Internals as Internals17 } from "remotion";
|
|
8790
8779
|
var TimelineInOutContext = createContext12({});
|
|
8791
8780
|
var SetTimelineInOutContext = createContext12({
|
|
@@ -8795,7 +8784,7 @@ var SetTimelineInOutContext = createContext12({
|
|
|
8795
8784
|
});
|
|
8796
8785
|
var useTimelineInOutFramePosition = () => {
|
|
8797
8786
|
const videoConfig = Internals17.useUnsafeVideoConfig();
|
|
8798
|
-
const state =
|
|
8787
|
+
const state = useContext21(TimelineInOutContext);
|
|
8799
8788
|
const id = videoConfig?.id;
|
|
8800
8789
|
const durationInFrames = videoConfig?.durationInFrames;
|
|
8801
8790
|
return useMemo40(() => {
|
|
@@ -8812,7 +8801,7 @@ var useTimelineInOutFramePosition = () => {
|
|
|
8812
8801
|
}, [durationInFrames, id, state]);
|
|
8813
8802
|
};
|
|
8814
8803
|
var useTimelineSetInOutFramePosition = () => {
|
|
8815
|
-
const { setInAndOutFrames } =
|
|
8804
|
+
const { setInAndOutFrames } = useContext21(SetTimelineInOutContext);
|
|
8816
8805
|
return { setInAndOutFrames };
|
|
8817
8806
|
};
|
|
8818
8807
|
|
|
@@ -9356,18 +9345,18 @@ var getFileMenu = ({
|
|
|
9356
9345
|
};
|
|
9357
9346
|
};
|
|
9358
9347
|
var useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
9359
|
-
const { setSelectedModal } =
|
|
9360
|
-
const { checkerboard, setCheckerboard } =
|
|
9361
|
-
const { editorZoomGestures, setEditorZoomGestures } =
|
|
9362
|
-
const { editorShowRulers, setEditorShowRulers } =
|
|
9363
|
-
const { editorShowGuides, setEditorShowGuides } =
|
|
9364
|
-
const { size: size2, setSize } =
|
|
9365
|
-
const { type } =
|
|
9348
|
+
const { setSelectedModal } = useContext22(ModalsContext);
|
|
9349
|
+
const { checkerboard, setCheckerboard } = useContext22(CheckerboardContext);
|
|
9350
|
+
const { editorZoomGestures, setEditorZoomGestures } = useContext22(EditorZoomGesturesContext);
|
|
9351
|
+
const { editorShowRulers, setEditorShowRulers } = useContext22(EditorShowRulersContext);
|
|
9352
|
+
const { editorShowGuides, setEditorShowGuides } = useContext22(EditorShowGuidesContext);
|
|
9353
|
+
const { size: size2, setSize } = useContext22(Internals19.PreviewSizeContext);
|
|
9354
|
+
const { type } = useContext22(StudioServerConnectionCtx).previewServerState;
|
|
9366
9355
|
const {
|
|
9367
9356
|
setSidebarCollapsedState,
|
|
9368
9357
|
sidebarCollapsedStateLeft,
|
|
9369
9358
|
sidebarCollapsedStateRight
|
|
9370
|
-
} =
|
|
9359
|
+
} = useContext22(SidebarContext);
|
|
9371
9360
|
const sizes = useMemo42(() => getUniqueSizes(size2), [size2]);
|
|
9372
9361
|
const isFullscreenSupported = checkFullscreenSupport();
|
|
9373
9362
|
const { remotion_packageManager } = window;
|
|
@@ -10114,7 +10103,7 @@ var makeSearchResults = (actions, setSelectedModal) => {
|
|
|
10114
10103
|
|
|
10115
10104
|
// src/components/Menu/MenuItem.tsx
|
|
10116
10105
|
import { PlayerInternals as PlayerInternals9 } from "@remotion/player";
|
|
10117
|
-
import { useCallback as useCallback38, useMemo as useMemo43, useRef as useRef21, useState as
|
|
10106
|
+
import { useCallback as useCallback38, useMemo as useMemo43, useRef as useRef21, useState as useState36 } from "react";
|
|
10118
10107
|
import ReactDOM6 from "react-dom";
|
|
10119
10108
|
import { jsx as jsx84, jsxs as jsxs39, Fragment as Fragment13 } from "react/jsx-runtime";
|
|
10120
10109
|
var container21 = {
|
|
@@ -10140,7 +10129,7 @@ var MenuItem = ({
|
|
|
10140
10129
|
onNextMenu,
|
|
10141
10130
|
menu
|
|
10142
10131
|
}) => {
|
|
10143
|
-
const [hovered, setHovered] =
|
|
10132
|
+
const [hovered, setHovered] = useState36(false);
|
|
10144
10133
|
const ref = useRef21(null);
|
|
10145
10134
|
const size2 = PlayerInternals9.useElementSize(ref, {
|
|
10146
10135
|
triggerOnWindowResize: true,
|
|
@@ -10245,18 +10234,18 @@ var MenuItem = ({
|
|
|
10245
10234
|
// src/components/MenuBuildIndicator.tsx
|
|
10246
10235
|
import {
|
|
10247
10236
|
useCallback as useCallback40,
|
|
10248
|
-
useContext as
|
|
10237
|
+
useContext as useContext25,
|
|
10249
10238
|
useEffect as useEffect34,
|
|
10250
10239
|
useMemo as useMemo45,
|
|
10251
|
-
useState as
|
|
10240
|
+
useState as useState39
|
|
10252
10241
|
} from "react";
|
|
10253
10242
|
|
|
10254
10243
|
// src/components/MenuCompositionName.tsx
|
|
10255
|
-
import { useCallback as useCallback39, useContext as
|
|
10244
|
+
import { useCallback as useCallback39, useContext as useContext24, useMemo as useMemo44, useState as useState38 } from "react";
|
|
10256
10245
|
import { Internals as Internals21 } from "remotion";
|
|
10257
10246
|
|
|
10258
10247
|
// src/components/Timeline/use-resolved-stack.ts
|
|
10259
|
-
import { useContext as
|
|
10248
|
+
import { useContext as useContext23, useEffect as useEffect33, useState as useState37 } from "react";
|
|
10260
10249
|
import { Internals as Internals20 } from "remotion";
|
|
10261
10250
|
|
|
10262
10251
|
// src/components/Timeline/TimelineStack/get-stack.ts
|
|
@@ -10349,8 +10338,8 @@ var resolvedCache = new Map;
|
|
|
10349
10338
|
var inFlight = new Set;
|
|
10350
10339
|
var subscribers = new Map;
|
|
10351
10340
|
var useResolvedStack = (stack2) => {
|
|
10352
|
-
const updateResolvedStackTrace =
|
|
10353
|
-
const [value, setValue] =
|
|
10341
|
+
const updateResolvedStackTrace = useContext23(Internals20.SequenceStackTracesUpdateContext);
|
|
10342
|
+
const [value, setValue] = useState37(() => {
|
|
10354
10343
|
if (!stack2) {
|
|
10355
10344
|
return null;
|
|
10356
10345
|
}
|
|
@@ -10415,10 +10404,10 @@ var slashStyle = {
|
|
|
10415
10404
|
top: 1
|
|
10416
10405
|
};
|
|
10417
10406
|
var MenuCompositionName = () => {
|
|
10418
|
-
const { canvasContent, compositions } =
|
|
10419
|
-
const connectionStatus =
|
|
10420
|
-
const [opening, setOpening] =
|
|
10421
|
-
const [hovered, setHovered] =
|
|
10407
|
+
const { canvasContent, compositions } = useContext24(Internals21.CompositionManager);
|
|
10408
|
+
const connectionStatus = useContext24(StudioServerConnectionCtx).previewServerState.type;
|
|
10409
|
+
const [opening, setOpening] = useState38(false);
|
|
10410
|
+
const [hovered, setHovered] = useState38(false);
|
|
10422
10411
|
const composition = useMemo44(() => {
|
|
10423
10412
|
if (canvasContent === null || canvasContent.type !== "composition") {
|
|
10424
10413
|
return null;
|
|
@@ -10496,9 +10485,9 @@ var projectNameLinkHovered = {
|
|
|
10496
10485
|
textDecoration: "underline"
|
|
10497
10486
|
};
|
|
10498
10487
|
var MenuBuildIndicator = () => {
|
|
10499
|
-
const [isBuilding, setIsBuilding] =
|
|
10500
|
-
const [projectNameHovered, setProjectNameHovered] =
|
|
10501
|
-
const ctx =
|
|
10488
|
+
const [isBuilding, setIsBuilding] = useState39(false);
|
|
10489
|
+
const [projectNameHovered, setProjectNameHovered] = useState39(false);
|
|
10490
|
+
const ctx = useContext25(StudioServerConnectionCtx).previewServerState;
|
|
10502
10491
|
const showEditorLink = window.remotion_editorName && ctx.type === "connected";
|
|
10503
10492
|
const showGitLink = !showEditorLink && Boolean(window.remotion_gitSource);
|
|
10504
10493
|
const handleProjectNameClick = useCallback40(async () => {
|
|
@@ -10576,16 +10565,16 @@ var MenuBuildIndicator = () => {
|
|
|
10576
10565
|
};
|
|
10577
10566
|
|
|
10578
10567
|
// src/components/SidebarCollapserControls.tsx
|
|
10579
|
-
import { useCallback as useCallback97, useContext as
|
|
10568
|
+
import { useCallback as useCallback97, useContext as useContext64, useEffect as useEffect63 } from "react";
|
|
10580
10569
|
|
|
10581
10570
|
// src/components/TopPanel.tsx
|
|
10582
|
-
import React125, { useCallback as useCallback96, useContext as
|
|
10571
|
+
import React125, { useCallback as useCallback96, useContext as useContext63, useEffect as useEffect62, useMemo as useMemo103 } from "react";
|
|
10583
10572
|
import { Internals as Internals45 } from "remotion";
|
|
10584
10573
|
|
|
10585
10574
|
// src/helpers/use-breakpoint.ts
|
|
10586
|
-
import { useEffect as useEffect35, useRef as useRef22, useState as
|
|
10575
|
+
import { useEffect as useEffect35, useRef as useRef22, useState as useState40 } from "react";
|
|
10587
10576
|
function useBreakpoint(breakpoint2) {
|
|
10588
|
-
const [compactUI, setCompactUI] =
|
|
10577
|
+
const [compactUI, setCompactUI] = useState40(window.innerWidth < breakpoint2);
|
|
10589
10578
|
const compactUIRef = useRef22(compactUI);
|
|
10590
10579
|
useEffect35(() => {
|
|
10591
10580
|
function handleResize() {
|
|
@@ -10603,21 +10592,21 @@ function useBreakpoint(breakpoint2) {
|
|
|
10603
10592
|
}
|
|
10604
10593
|
|
|
10605
10594
|
// src/components/CanvasIfSizeIsAvailable.tsx
|
|
10606
|
-
import { useContext as
|
|
10595
|
+
import { useContext as useContext34, useMemo as useMemo53 } from "react";
|
|
10607
10596
|
import { Internals as Internals30 } from "remotion";
|
|
10608
10597
|
|
|
10609
10598
|
// src/components/CanvasOrLoading.tsx
|
|
10610
|
-
import { useContext as
|
|
10599
|
+
import { useContext as useContext33, useEffect as useEffect40 } from "react";
|
|
10611
10600
|
import { Internals as Internals29 } from "remotion";
|
|
10612
10601
|
|
|
10613
10602
|
// src/components/Canvas.tsx
|
|
10614
10603
|
import {
|
|
10615
10604
|
useCallback as useCallback44,
|
|
10616
|
-
useContext as
|
|
10605
|
+
useContext as useContext32,
|
|
10617
10606
|
useEffect as useEffect38,
|
|
10618
10607
|
useMemo as useMemo52,
|
|
10619
10608
|
useRef as useRef25,
|
|
10620
|
-
useState as
|
|
10609
|
+
useState as useState42
|
|
10621
10610
|
} from "react";
|
|
10622
10611
|
import { Internals as Internals27, watchStaticFile } from "remotion";
|
|
10623
10612
|
|
|
@@ -10752,19 +10741,19 @@ var applyZoomAroundFocalPoint = ({
|
|
|
10752
10741
|
};
|
|
10753
10742
|
|
|
10754
10743
|
// src/components/EditorGuides/index.tsx
|
|
10755
|
-
import { useContext as
|
|
10744
|
+
import { useContext as useContext28, useMemo as useMemo49 } from "react";
|
|
10756
10745
|
import { Internals as Internals24 } from "remotion";
|
|
10757
10746
|
|
|
10758
10747
|
// src/helpers/use-studio-canvas-dimensions.ts
|
|
10759
10748
|
import { PlayerInternals as PlayerInternals10 } from "@remotion/player";
|
|
10760
|
-
import { useContext as
|
|
10749
|
+
import { useContext as useContext26, useMemo as useMemo46 } from "react";
|
|
10761
10750
|
import { Internals as Internals23 } from "remotion";
|
|
10762
10751
|
var useStudioCanvasDimensions = ({
|
|
10763
10752
|
canvasSize,
|
|
10764
10753
|
contentDimensions,
|
|
10765
10754
|
assetMetadata
|
|
10766
10755
|
}) => {
|
|
10767
|
-
const { size: previewSize } =
|
|
10756
|
+
const { size: previewSize } = useContext26(Internals23.PreviewSizeContext);
|
|
10768
10757
|
const { centerX, centerY, scale } = useMemo46(() => {
|
|
10769
10758
|
if (contentDimensions === "none" || contentDimensions === null || assetMetadata && (assetMetadata.type === "not-found" || assetMetadata.type === "metadata-error") || !canvasSize) {
|
|
10770
10759
|
return {
|
|
@@ -10810,7 +10799,7 @@ var useStudioCanvasDimensions = ({
|
|
|
10810
10799
|
};
|
|
10811
10800
|
|
|
10812
10801
|
// src/components/EditorGuides/Guide.tsx
|
|
10813
|
-
import { memo, useCallback as useCallback41, useContext as
|
|
10802
|
+
import { memo, useCallback as useCallback41, useContext as useContext27, useMemo as useMemo48 } from "react";
|
|
10814
10803
|
import { NoReactInternals as NoReactInternals6 } from "remotion/no-react";
|
|
10815
10804
|
|
|
10816
10805
|
// src/components/ForceSpecificCursor.tsx
|
|
@@ -10858,7 +10847,7 @@ var GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
10858
10847
|
selectedGuideId,
|
|
10859
10848
|
setHoveredGuideId,
|
|
10860
10849
|
hoveredGuideId
|
|
10861
|
-
} =
|
|
10850
|
+
} = useContext27(EditorShowGuidesContext);
|
|
10862
10851
|
const onPointerEnter = useCallback41(() => {
|
|
10863
10852
|
setHoveredGuideId(() => guide.id);
|
|
10864
10853
|
}, [guide.id, setHoveredGuideId]);
|
|
@@ -10950,11 +10939,11 @@ var EditorGuides = ({ canvasSize, contentDimensions, assetMetadata }) => {
|
|
|
10950
10939
|
contentDimensions,
|
|
10951
10940
|
assetMetadata
|
|
10952
10941
|
});
|
|
10953
|
-
const { canvasContent } =
|
|
10942
|
+
const { canvasContent } = useContext28(Internals24.CompositionManager);
|
|
10954
10943
|
if (canvasContent === null || canvasContent.type !== "composition") {
|
|
10955
10944
|
throw new Error("Expected to be in a composition");
|
|
10956
10945
|
}
|
|
10957
|
-
const { guidesList } =
|
|
10946
|
+
const { guidesList } = useContext28(EditorShowGuidesContext);
|
|
10958
10947
|
const guidesForThisComposition = useMemo49(() => {
|
|
10959
10948
|
return guidesList.filter((guide) => {
|
|
10960
10949
|
return guide.compositionId === canvasContent.compositionId;
|
|
@@ -10975,7 +10964,7 @@ var EditorGuides_default = EditorGuides;
|
|
|
10975
10964
|
// src/components/EditorRuler/index.tsx
|
|
10976
10965
|
import {
|
|
10977
10966
|
useCallback as useCallback43,
|
|
10978
|
-
useContext as
|
|
10967
|
+
useContext as useContext30,
|
|
10979
10968
|
useEffect as useEffect37,
|
|
10980
10969
|
useMemo as useMemo51,
|
|
10981
10970
|
useRef as useRef24
|
|
@@ -11190,11 +11179,11 @@ var getRulerScaleRange = ({
|
|
|
11190
11179
|
// src/components/EditorRuler/Ruler.tsx
|
|
11191
11180
|
import {
|
|
11192
11181
|
useCallback as useCallback42,
|
|
11193
|
-
useContext as
|
|
11182
|
+
useContext as useContext29,
|
|
11194
11183
|
useEffect as useEffect36,
|
|
11195
11184
|
useMemo as useMemo50,
|
|
11196
11185
|
useRef as useRef23,
|
|
11197
|
-
useState as
|
|
11186
|
+
useState as useState41
|
|
11198
11187
|
} from "react";
|
|
11199
11188
|
import { Internals as Internals25 } from "remotion";
|
|
11200
11189
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
@@ -11220,12 +11209,12 @@ var Ruler = ({
|
|
|
11220
11209
|
setSelectedGuideId,
|
|
11221
11210
|
guidesList,
|
|
11222
11211
|
setEditorShowGuides
|
|
11223
|
-
} =
|
|
11212
|
+
} = useContext29(EditorShowGuidesContext);
|
|
11224
11213
|
const unsafeVideoConfig = Internals25.useUnsafeVideoConfig();
|
|
11225
11214
|
if (!unsafeVideoConfig) {
|
|
11226
11215
|
throw new Error("Video config not set");
|
|
11227
11216
|
}
|
|
11228
|
-
const [cursor, setCursor] =
|
|
11217
|
+
const [cursor, setCursor] = useState41(isVerticalRuler ? "ew-resize" : "ns-resize");
|
|
11229
11218
|
const selectedOrHoveredGuide = useMemo50(() => {
|
|
11230
11219
|
return guidesList.find((guide) => guide.id === selectedGuideId) ?? guidesList.find((guide) => guide.id === hoveredGuideId) ?? null;
|
|
11231
11220
|
}, [guidesList, hoveredGuideId, selectedGuideId]);
|
|
@@ -11345,7 +11334,7 @@ var EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef
|
|
|
11345
11334
|
setGuidesList,
|
|
11346
11335
|
selectedGuideId,
|
|
11347
11336
|
setSelectedGuideId
|
|
11348
|
-
} =
|
|
11337
|
+
} = useContext30(EditorShowGuidesContext);
|
|
11349
11338
|
const rulerMarkingGaps = useMemo51(() => {
|
|
11350
11339
|
const minimumGap = MINIMUM_RULER_MARKING_GAP_PX;
|
|
11351
11340
|
const predefinedGap = PREDEFINED_RULER_SCALE_GAPS.find((gap) => gap * scale > minimumGap);
|
|
@@ -11501,11 +11490,11 @@ var EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef
|
|
|
11501
11490
|
};
|
|
11502
11491
|
|
|
11503
11492
|
// src/components/EditorRuler/use-is-ruler-visible.ts
|
|
11504
|
-
import { useContext as
|
|
11493
|
+
import { useContext as useContext31 } from "react";
|
|
11505
11494
|
import { Internals as Internals26 } from "remotion";
|
|
11506
11495
|
var useIsRulerVisible = () => {
|
|
11507
|
-
const { canvasContent } =
|
|
11508
|
-
const { editorShowRulers } =
|
|
11496
|
+
const { canvasContent } = useContext31(Internals26.CompositionManager);
|
|
11497
|
+
const { editorShowRulers } = useContext31(EditorShowRulersContext);
|
|
11509
11498
|
return editorShowRulers && canvasContent && canvasContent.type === "composition";
|
|
11510
11499
|
};
|
|
11511
11500
|
|
|
@@ -11535,8 +11524,8 @@ var resetZoom = {
|
|
|
11535
11524
|
};
|
|
11536
11525
|
var ZOOM_PX_FACTOR = 0.003;
|
|
11537
11526
|
var Canvas = ({ canvasContent, size: size2 }) => {
|
|
11538
|
-
const { setSize, size: previewSize } =
|
|
11539
|
-
const { editorZoomGestures } =
|
|
11527
|
+
const { setSize, size: previewSize } = useContext32(Internals27.PreviewSizeContext);
|
|
11528
|
+
const { editorZoomGestures } = useContext32(EditorZoomGesturesContext);
|
|
11540
11529
|
const previewSnapshotRef = useRef25({
|
|
11541
11530
|
previewSize,
|
|
11542
11531
|
canvasSize: size2,
|
|
@@ -11548,8 +11537,8 @@ var Canvas = ({ canvasContent, size: size2 }) => {
|
|
|
11548
11537
|
const keybindings = useKeybinding();
|
|
11549
11538
|
const config = Internals27.useUnsafeVideoConfig();
|
|
11550
11539
|
const areRulersVisible = useIsRulerVisible();
|
|
11551
|
-
const { editorShowGuides } =
|
|
11552
|
-
const [assetResolution, setAssetResolution] =
|
|
11540
|
+
const { editorShowGuides } = useContext32(EditorShowGuidesContext);
|
|
11541
|
+
const [assetResolution, setAssetResolution] = useState42(null);
|
|
11553
11542
|
const contentDimensions = useMemo52(() => {
|
|
11554
11543
|
if ((canvasContent.type === "asset" || canvasContent.type === "output" || canvasContent.type === "output-blob") && assetResolution && assetResolution.type === "found") {
|
|
11555
11544
|
return assetResolution.dimensions;
|
|
@@ -12047,9 +12036,9 @@ var container24 = {
|
|
|
12047
12036
|
};
|
|
12048
12037
|
var CanvasOrLoading = ({ size: size2 }) => {
|
|
12049
12038
|
const resolved = Internals29.useResolvedVideoConfig(null);
|
|
12050
|
-
const { setZoom } =
|
|
12051
|
-
const { canvasContent } =
|
|
12052
|
-
const { error: renderError } =
|
|
12039
|
+
const { setZoom } = useContext33(TimelineZoomCtx);
|
|
12040
|
+
const { canvasContent } = useContext33(Internals29.CompositionManager);
|
|
12041
|
+
const { error: renderError } = useContext33(RenderErrorContext);
|
|
12053
12042
|
useEffect40(() => {
|
|
12054
12043
|
if (resolved?.type !== "success" && resolved?.type !== "success-and-refreshing") {
|
|
12055
12044
|
return;
|
|
@@ -12147,7 +12136,7 @@ var ErrorLoading = ({ error, calculateMetadataContext }) => {
|
|
|
12147
12136
|
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
12148
12137
|
var CanvasIfSizeIsAvailable = () => {
|
|
12149
12138
|
const rulersAreVisible = useIsRulerVisible();
|
|
12150
|
-
const context =
|
|
12139
|
+
const context = useContext34(Internals30.CurrentScaleContext);
|
|
12151
12140
|
const sizeWithRulersApplied = useMemo53(() => {
|
|
12152
12141
|
const size2 = context && context.type === "canvas-size" ? context.canvasSize : null;
|
|
12153
12142
|
if (!rulersAreVisible) {
|
|
@@ -12171,7 +12160,7 @@ var CanvasIfSizeIsAvailable = () => {
|
|
|
12171
12160
|
};
|
|
12172
12161
|
|
|
12173
12162
|
// src/components/CurrentCompositionSideEffects.tsx
|
|
12174
|
-
import { useCallback as useCallback45, useContext as
|
|
12163
|
+
import { useCallback as useCallback45, useContext as useContext35, useEffect as useEffect41 } from "react";
|
|
12175
12164
|
import { Internals as Internals31 } from "remotion";
|
|
12176
12165
|
|
|
12177
12166
|
// src/helpers/document-title.ts
|
|
@@ -12226,8 +12215,8 @@ var getProgressInBrackets = (selectedCompositionId, jobs) => {
|
|
|
12226
12215
|
|
|
12227
12216
|
// src/components/CurrentCompositionSideEffects.tsx
|
|
12228
12217
|
var TitleUpdater = () => {
|
|
12229
|
-
const renderQueue =
|
|
12230
|
-
const { canvasContent } =
|
|
12218
|
+
const renderQueue = useContext35(RenderQueueContext);
|
|
12219
|
+
const { canvasContent } = useContext35(Internals31.CompositionManager);
|
|
12231
12220
|
const { jobs } = renderQueue;
|
|
12232
12221
|
useEffect41(() => {
|
|
12233
12222
|
if (!canvasContent) {
|
|
@@ -12256,7 +12245,7 @@ var TitleUpdater = () => {
|
|
|
12256
12245
|
var CurrentCompositionKeybindings = ({ readOnlyStudio }) => {
|
|
12257
12246
|
const keybindings = useKeybinding();
|
|
12258
12247
|
const video = Internals31.useVideo();
|
|
12259
|
-
const { type } =
|
|
12248
|
+
const { type } = useContext35(StudioServerConnectionCtx).previewServerState;
|
|
12260
12249
|
const openRenderModal = useCallback45(() => {
|
|
12261
12250
|
if (!video) {
|
|
12262
12251
|
return;
|
|
@@ -12331,18 +12320,18 @@ function MobilePanel({
|
|
|
12331
12320
|
// src/components/ObserveDefaultPropsContext.tsx
|
|
12332
12321
|
import React65, {
|
|
12333
12322
|
useCallback as useCallback46,
|
|
12334
|
-
useContext as
|
|
12323
|
+
useContext as useContext36,
|
|
12335
12324
|
useEffect as useEffect42,
|
|
12336
12325
|
useMemo as useMemo54,
|
|
12337
|
-
useState as
|
|
12326
|
+
useState as useState43
|
|
12338
12327
|
} from "react";
|
|
12339
12328
|
import { Internals as Internals32 } from "remotion";
|
|
12340
12329
|
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
12341
12330
|
var ObserveDefaultPropsContext = React65.createContext(null);
|
|
12342
12331
|
var ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
|
|
12343
|
-
const { previewServerState, subscribeToEvent } =
|
|
12344
|
-
const { updateProps } =
|
|
12345
|
-
const [canSaveDefaultPropsObjectState, setCanSaveDefaultProps] =
|
|
12332
|
+
const { previewServerState, subscribeToEvent } = useContext36(StudioServerConnectionCtx);
|
|
12333
|
+
const { updateProps } = useContext36(Internals32.EditorPropsContext);
|
|
12334
|
+
const [canSaveDefaultPropsObjectState, setCanSaveDefaultProps] = useState43({});
|
|
12346
12335
|
const canSaveDefaultProps = useMemo54(() => {
|
|
12347
12336
|
if (compositionId === null) {
|
|
12348
12337
|
return null;
|
|
@@ -12416,10 +12405,10 @@ var ObserveDefaultProps = ({ compositionId, readOnlyStudio, children }) => {
|
|
|
12416
12405
|
import {
|
|
12417
12406
|
createRef as createRef10,
|
|
12418
12407
|
useCallback as useCallback87,
|
|
12419
|
-
useContext as
|
|
12408
|
+
useContext as useContext54,
|
|
12420
12409
|
useImperativeHandle as useImperativeHandle13,
|
|
12421
12410
|
useMemo as useMemo97,
|
|
12422
|
-
useState as
|
|
12411
|
+
useState as useState61
|
|
12423
12412
|
} from "react";
|
|
12424
12413
|
import { Internals as Internals36 } from "remotion";
|
|
12425
12414
|
|
|
@@ -12432,7 +12421,7 @@ import {
|
|
|
12432
12421
|
useImperativeHandle as useImperativeHandle11,
|
|
12433
12422
|
useMemo as useMemo56,
|
|
12434
12423
|
useRef as useRef26,
|
|
12435
|
-
useState as
|
|
12424
|
+
useState as useState45
|
|
12436
12425
|
} from "react";
|
|
12437
12426
|
import { useRemotionEnvironment as useRemotionEnvironment2 } from "remotion";
|
|
12438
12427
|
|
|
@@ -12454,10 +12443,10 @@ function getZodSchemaFromPrimitive(value, z) {
|
|
|
12454
12443
|
// src/components/get-zod-if-possible.tsx
|
|
12455
12444
|
import {
|
|
12456
12445
|
createContext as createContext17,
|
|
12457
|
-
useContext as
|
|
12446
|
+
useContext as useContext37,
|
|
12458
12447
|
useEffect as useEffect43,
|
|
12459
12448
|
useMemo as useMemo55,
|
|
12460
|
-
useState as
|
|
12449
|
+
useState as useState44
|
|
12461
12450
|
} from "react";
|
|
12462
12451
|
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
12463
12452
|
async function getZodIfPossible() {
|
|
@@ -12485,18 +12474,18 @@ var getZTypesIfPossible = async () => {
|
|
|
12485
12474
|
}
|
|
12486
12475
|
};
|
|
12487
12476
|
function useZodIfPossible() {
|
|
12488
|
-
const context =
|
|
12477
|
+
const context = useContext37(ZodContext);
|
|
12489
12478
|
return context?.zod ?? null;
|
|
12490
12479
|
}
|
|
12491
12480
|
var useZodTypesIfPossible = () => {
|
|
12492
|
-
const context =
|
|
12481
|
+
const context = useContext37(ZodContext);
|
|
12493
12482
|
return context?.zodTypes ?? null;
|
|
12494
12483
|
};
|
|
12495
12484
|
var ZodContext = createContext17(null);
|
|
12496
12485
|
var ZodProvider = ({ children }) => {
|
|
12497
|
-
const [zod, setZod] =
|
|
12498
|
-
const [zodV3, setZodV3] =
|
|
12499
|
-
const [zodTypes, setZodTypes] =
|
|
12486
|
+
const [zod, setZod] = useState44(null);
|
|
12487
|
+
const [zodV3, setZodV3] = useState44(null);
|
|
12488
|
+
const [zodTypes, setZodTypes] = useState44(null);
|
|
12500
12489
|
useEffect43(() => {
|
|
12501
12490
|
getZodIfPossible().then((z) => setZod(z));
|
|
12502
12491
|
}, []);
|
|
@@ -12572,7 +12561,7 @@ var SetVisualControlsContext = createContext18({
|
|
|
12572
12561
|
});
|
|
12573
12562
|
var VisualControlsProvider = ({ children }) => {
|
|
12574
12563
|
const imperativeHandles = useRef26({});
|
|
12575
|
-
const [handles, setHandles] =
|
|
12564
|
+
const [handles, setHandles] = useState45({});
|
|
12576
12565
|
const state = useMemo56(() => {
|
|
12577
12566
|
return {
|
|
12578
12567
|
handles
|
|
@@ -12674,10 +12663,10 @@ var VisualControlsProvider = ({ children }) => {
|
|
|
12674
12663
|
};
|
|
12675
12664
|
|
|
12676
12665
|
// src/components/DefaultPropsEditor.tsx
|
|
12677
|
-
import { useContext as
|
|
12666
|
+
import { useContext as useContext41 } from "react";
|
|
12678
12667
|
|
|
12679
12668
|
// src/components/RenderModal/DataEditor.tsx
|
|
12680
|
-
import React96, { useCallback as useCallback72, useContext as
|
|
12669
|
+
import React96, { useCallback as useCallback72, useContext as useContext40, useMemo as useMemo86, useState as useState56 } from "react";
|
|
12681
12670
|
import { getInputProps } from "remotion";
|
|
12682
12671
|
import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
|
|
12683
12672
|
|
|
@@ -12735,7 +12724,7 @@ var ValidationMessage = ({ message, align, type }) => {
|
|
|
12735
12724
|
};
|
|
12736
12725
|
|
|
12737
12726
|
// src/components/SegmentedControl.tsx
|
|
12738
|
-
import { useCallback as useCallback48, useMemo as useMemo58, useState as
|
|
12727
|
+
import { useCallback as useCallback48, useMemo as useMemo58, useState as useState46 } from "react";
|
|
12739
12728
|
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
12740
12729
|
var container27 = {
|
|
12741
12730
|
display: "flex",
|
|
@@ -12784,7 +12773,7 @@ var SegmentedControl = ({ items, needsWrapping }) => {
|
|
|
12784
12773
|
});
|
|
12785
12774
|
};
|
|
12786
12775
|
var Item = ({ selected, onClick, children }) => {
|
|
12787
|
-
const [hovered, setHovered] =
|
|
12776
|
+
const [hovered, setHovered] = useState46(false);
|
|
12788
12777
|
const { tabIndex } = useZIndex();
|
|
12789
12778
|
const onPointerEnter = useCallback48(() => {
|
|
12790
12779
|
setHovered(true);
|
|
@@ -12879,7 +12868,7 @@ var getRenderModalWarnings = ({
|
|
|
12879
12868
|
|
|
12880
12869
|
// src/components/RenderModal/RenderModalJSONPropsEditor.tsx
|
|
12881
12870
|
import React71, { useCallback as useCallback49, useEffect as useEffect45, useMemo as useMemo60 } from "react";
|
|
12882
|
-
import { useContext as
|
|
12871
|
+
import { useContext as useContext38 } from "react";
|
|
12883
12872
|
import { NoReactInternals as NoReactInternals9 } from "remotion/no-react";
|
|
12884
12873
|
|
|
12885
12874
|
// src/components/RenderModal/SchemaEditor/deep-equal.ts
|
|
@@ -13207,7 +13196,7 @@ var RenderModalJSONPropsEditor = ({
|
|
|
13207
13196
|
if (serializedJSON === null) {
|
|
13208
13197
|
throw new Error("expecting serializedJSON to be defined");
|
|
13209
13198
|
}
|
|
13210
|
-
const { subscribeToEvent } =
|
|
13199
|
+
const { subscribeToEvent } = useContext38(StudioServerConnectionCtx);
|
|
13211
13200
|
const [localValue, setLocalValue] = React71.useState(() => {
|
|
13212
13201
|
return parseJSON(serializedJSON.serializedString, schema);
|
|
13213
13202
|
});
|
|
@@ -13681,12 +13670,12 @@ var createZodValues = (schema, zodRuntime, zodTypes) => {
|
|
|
13681
13670
|
};
|
|
13682
13671
|
|
|
13683
13672
|
// src/components/RenderModal/SchemaEditor/Fieldset.tsx
|
|
13684
|
-
import { createContext as createContext19, useContext as
|
|
13673
|
+
import { createContext as createContext19, useContext as useContext39, useMemo as useMemo61 } from "react";
|
|
13685
13674
|
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
13686
13675
|
var SCHEMA_EDITOR_FIELDSET_PADDING = 10;
|
|
13687
13676
|
var AlreadyPaddedRightContext = createContext19(false);
|
|
13688
13677
|
var Fieldset = ({ children, shouldPad }) => {
|
|
13689
|
-
const alreadyPadded =
|
|
13678
|
+
const alreadyPadded = useContext39(AlreadyPaddedRightContext);
|
|
13690
13679
|
const style8 = useMemo61(() => {
|
|
13691
13680
|
if (shouldPad) {
|
|
13692
13681
|
return {
|
|
@@ -13711,7 +13700,7 @@ var Fieldset = ({ children, shouldPad }) => {
|
|
|
13711
13700
|
};
|
|
13712
13701
|
|
|
13713
13702
|
// src/components/RenderModal/SchemaEditor/SchemaLabel.tsx
|
|
13714
|
-
import { useCallback as useCallback51, useMemo as useMemo62, useState as
|
|
13703
|
+
import { useCallback as useCallback51, useMemo as useMemo62, useState as useState47 } from "react";
|
|
13715
13704
|
|
|
13716
13705
|
// src/components/RenderModal/InlineRemoveButton.tsx
|
|
13717
13706
|
import { useCallback as useCallback50 } from "react";
|
|
@@ -13763,7 +13752,7 @@ var compactStyles = {
|
|
|
13763
13752
|
flex: 1
|
|
13764
13753
|
};
|
|
13765
13754
|
var SchemaLabel = ({ jsonPath, onRemove, valid, suffix: suffix2, handleClick }) => {
|
|
13766
|
-
const [clickableButtonHovered, setClickableButtonHovered] =
|
|
13755
|
+
const [clickableButtonHovered, setClickableButtonHovered] = useState47(false);
|
|
13767
13756
|
const labelStyle4 = useMemo62(() => {
|
|
13768
13757
|
return {
|
|
13769
13758
|
fontFamily: "monospace",
|
|
@@ -13809,7 +13798,7 @@ var SchemaLabel = ({ jsonPath, onRemove, valid, suffix: suffix2, handleClick })
|
|
|
13809
13798
|
|
|
13810
13799
|
// src/components/RenderModal/SchemaEditor/ZodObjectEditor.tsx
|
|
13811
13800
|
import { useCallback as useCallback70 } from "react";
|
|
13812
|
-
import React94, { useMemo as useMemo83, useState as
|
|
13801
|
+
import React94, { useMemo as useMemo83, useState as useState55 } from "react";
|
|
13813
13802
|
|
|
13814
13803
|
// src/components/RenderModal/layout.ts
|
|
13815
13804
|
var optionRow = {
|
|
@@ -13855,7 +13844,7 @@ var fieldsetLabel = {
|
|
|
13855
13844
|
};
|
|
13856
13845
|
|
|
13857
13846
|
// src/components/RenderModal/SchemaEditor/SchemaSeparationLine.tsx
|
|
13858
|
-
import { useCallback as useCallback52, useMemo as useMemo63, useState as
|
|
13847
|
+
import { useCallback as useCallback52, useMemo as useMemo63, useState as useState48 } from "react";
|
|
13859
13848
|
|
|
13860
13849
|
// src/icons/plus.tsx
|
|
13861
13850
|
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
@@ -13890,8 +13879,8 @@ var arraySeparationLine = {
|
|
|
13890
13879
|
flexBasis: "100%"
|
|
13891
13880
|
};
|
|
13892
13881
|
var SchemaArrayItemSeparationLine = ({ onChange, index, schema, isLast, showAddButton }) => {
|
|
13893
|
-
const [outerHovered, setOuterHovered] =
|
|
13894
|
-
const [innerHovered, setInnerHovered] =
|
|
13882
|
+
const [outerHovered, setOuterHovered] = useState48(false);
|
|
13883
|
+
const [innerHovered, setInnerHovered] = useState48(false);
|
|
13895
13884
|
const zodTypes = useZodTypesIfPossible();
|
|
13896
13885
|
const z = useZodIfPossible();
|
|
13897
13886
|
if (!z) {
|
|
@@ -14031,7 +14020,7 @@ var SchemaVerticalGuide = ({ isRoot, children }) => {
|
|
|
14031
14020
|
};
|
|
14032
14021
|
|
|
14033
14022
|
// src/components/RenderModal/SchemaEditor/ZodArrayEditor.tsx
|
|
14034
|
-
import React79, { useCallback as useCallback55, useMemo as useMemo68, useState as
|
|
14023
|
+
import React79, { useCallback as useCallback55, useMemo as useMemo68, useState as useState50 } from "react";
|
|
14035
14024
|
|
|
14036
14025
|
// src/components/RenderModal/SchemaEditor/ZodArrayItemEditor.tsx
|
|
14037
14026
|
import { useCallback as useCallback53, useMemo as useMemo65 } from "react";
|
|
@@ -14068,7 +14057,7 @@ var ZodArrayItemEditor = ({ elementSchema, onChange, jsonPath, index, value, may
|
|
|
14068
14057
|
|
|
14069
14058
|
// src/components/RenderModal/InfoBubble.tsx
|
|
14070
14059
|
import { PlayerInternals as PlayerInternals11 } from "@remotion/player";
|
|
14071
|
-
import { useCallback as useCallback54, useEffect as useEffect46, useMemo as useMemo67, useRef as useRef27, useState as
|
|
14060
|
+
import { useCallback as useCallback54, useEffect as useEffect46, useMemo as useMemo67, useRef as useRef27, useState as useState49 } from "react";
|
|
14072
14061
|
import ReactDOM8 from "react-dom";
|
|
14073
14062
|
|
|
14074
14063
|
// src/components/RenderModal/InfoTooltip.tsx
|
|
@@ -14151,8 +14140,8 @@ var container28 = {
|
|
|
14151
14140
|
verticalAlign: "text-bottom"
|
|
14152
14141
|
};
|
|
14153
14142
|
var InfoBubble = ({ title: title4, children }) => {
|
|
14154
|
-
const [hovered, setIsHovered] =
|
|
14155
|
-
const [opened, setOpened] =
|
|
14143
|
+
const [hovered, setIsHovered] = useState49(false);
|
|
14144
|
+
const [opened, setOpened] = useState49(false);
|
|
14156
14145
|
const ref2 = useRef27(null);
|
|
14157
14146
|
const { tabIndex, currentZIndex } = useZIndex();
|
|
14158
14147
|
const size2 = PlayerInternals11.useElementSize(ref2, {
|
|
@@ -14339,7 +14328,7 @@ var ZodArrayEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad }) =
|
|
|
14339
14328
|
const onChange = useCallback55((updater, { shouldSave }) => {
|
|
14340
14329
|
setValue(updater, { shouldSave });
|
|
14341
14330
|
}, [setValue]);
|
|
14342
|
-
const [expanded, setExpanded] =
|
|
14331
|
+
const [expanded, setExpanded] = useState50(true);
|
|
14343
14332
|
const arrayElement = getArrayElement(schema);
|
|
14344
14333
|
const suffix2 = useMemo68(() => {
|
|
14345
14334
|
return expanded ? " [" : " [...] ";
|
|
@@ -14524,7 +14513,7 @@ var colorWithNewOpacity = (color, opacity, zodTypes) => {
|
|
|
14524
14513
|
};
|
|
14525
14514
|
|
|
14526
14515
|
// src/components/NewComposition/InputDragger.tsx
|
|
14527
|
-
import React82, { useCallback as useCallback57, useEffect as useEffect48, useMemo as useMemo70, useRef as useRef29, useState as
|
|
14516
|
+
import React82, { useCallback as useCallback57, useEffect as useEffect48, useMemo as useMemo70, useRef as useRef29, useState as useState51 } from "react";
|
|
14528
14517
|
import { interpolate as interpolate2 } from "remotion";
|
|
14529
14518
|
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
14530
14519
|
var isInt = (num) => {
|
|
@@ -14544,8 +14533,8 @@ var InputDraggerForwardRefFn = ({
|
|
|
14544
14533
|
small,
|
|
14545
14534
|
...props
|
|
14546
14535
|
}, ref2) => {
|
|
14547
|
-
const [inputFallback, setInputFallback] =
|
|
14548
|
-
const [dragging, setDragging] =
|
|
14536
|
+
const [inputFallback, setInputFallback] = useState51(false);
|
|
14537
|
+
const [dragging, setDragging] = useState51(false);
|
|
14549
14538
|
const fallbackRef = useRef29(null);
|
|
14550
14539
|
const pointerDownRef = useRef29(false);
|
|
14551
14540
|
const style8 = useMemo70(() => {
|
|
@@ -14715,7 +14704,7 @@ import {
|
|
|
14715
14704
|
useImperativeHandle as useImperativeHandle12,
|
|
14716
14705
|
useMemo as useMemo71,
|
|
14717
14706
|
useRef as useRef30,
|
|
14718
|
-
useState as
|
|
14707
|
+
useState as useState52
|
|
14719
14708
|
} from "react";
|
|
14720
14709
|
import { jsx as jsx121 } from "react/jsx-runtime";
|
|
14721
14710
|
var inputBaseStyle3 = {
|
|
@@ -14724,8 +14713,8 @@ var inputBaseStyle3 = {
|
|
|
14724
14713
|
borderWidth: 1
|
|
14725
14714
|
};
|
|
14726
14715
|
var RemInputTypeColorForwardRef = ({ status, ...props }, ref2) => {
|
|
14727
|
-
const [isFocused, setIsFocused] =
|
|
14728
|
-
const [isHovered, setIsHovered] =
|
|
14716
|
+
const [isFocused, setIsFocused] = useState52(false);
|
|
14717
|
+
const [isHovered, setIsHovered] = useState52(false);
|
|
14729
14718
|
const inputRef = useRef30(null);
|
|
14730
14719
|
const { tabIndex } = useZIndex();
|
|
14731
14720
|
const style8 = useMemo71(() => {
|
|
@@ -15076,7 +15065,7 @@ var ZodEnumEditor = ({ schema, jsonPath, setValue, value, onRemove }) => {
|
|
|
15076
15065
|
};
|
|
15077
15066
|
|
|
15078
15067
|
// src/components/RenderModal/SchemaEditor/ZodMatrixEditor.tsx
|
|
15079
|
-
import React88, { useMemo as useMemo76, useState as
|
|
15068
|
+
import React88, { useMemo as useMemo76, useState as useState53 } from "react";
|
|
15080
15069
|
import { useCallback as useCallback62 } from "react";
|
|
15081
15070
|
import { jsx as jsx127, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
15082
15071
|
var rowStyle = {
|
|
@@ -15089,7 +15078,7 @@ var ZodMatrixEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad })
|
|
|
15089
15078
|
setValue(updater, { shouldSave });
|
|
15090
15079
|
}, [setValue]);
|
|
15091
15080
|
const zodValidation = useMemo76(() => zodSafeParse(schema, value), [schema, value]);
|
|
15092
|
-
const [expanded, setExpanded] =
|
|
15081
|
+
const [expanded, setExpanded] = useState53(true);
|
|
15093
15082
|
const arrayElement = getArrayElement(schema);
|
|
15094
15083
|
const suffix2 = useMemo76(() => {
|
|
15095
15084
|
return expanded ? " [" : " [...] ";
|
|
@@ -15585,7 +15574,7 @@ var ZodTextareaEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad }
|
|
|
15585
15574
|
};
|
|
15586
15575
|
|
|
15587
15576
|
// src/components/RenderModal/SchemaEditor/ZodTupleEditor.tsx
|
|
15588
|
-
import React93, { useCallback as useCallback69, useMemo as useMemo82, useState as
|
|
15577
|
+
import React93, { useCallback as useCallback69, useMemo as useMemo82, useState as useState54 } from "react";
|
|
15589
15578
|
|
|
15590
15579
|
// src/components/RenderModal/SchemaEditor/ZodTupleItemEditor.tsx
|
|
15591
15580
|
import { useCallback as useCallback68, useMemo as useMemo81 } from "react";
|
|
@@ -15622,7 +15611,7 @@ var ZodTupleEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad }) =
|
|
|
15622
15611
|
setValue(updater, { shouldSave });
|
|
15623
15612
|
}, [setValue]);
|
|
15624
15613
|
const zodValidation = useMemo82(() => zodSafeParse(schema, value), [schema, value]);
|
|
15625
|
-
const [expanded, setExpanded] =
|
|
15614
|
+
const [expanded, setExpanded] = useState54(true);
|
|
15626
15615
|
const tupleItems = getTupleItems(schema);
|
|
15627
15616
|
const suffix2 = useMemo82(() => {
|
|
15628
15617
|
return expanded ? " [" : " [...] ";
|
|
@@ -16011,7 +16000,7 @@ var ZodObjectEditor = ({
|
|
|
16011
16000
|
mayPad,
|
|
16012
16001
|
discriminatedUnionReplacement
|
|
16013
16002
|
}) => {
|
|
16014
|
-
const [expanded, setExpanded] =
|
|
16003
|
+
const [expanded, setExpanded] = useState55(true);
|
|
16015
16004
|
const onChange = useCallback70((updater, { shouldSave }) => {
|
|
16016
16005
|
setValue(updater, { shouldSave });
|
|
16017
16006
|
}, [setValue]);
|
|
@@ -16320,8 +16309,8 @@ var DataEditor = ({
|
|
|
16320
16309
|
propsEditType,
|
|
16321
16310
|
canSaveDefaultProps
|
|
16322
16311
|
}) => {
|
|
16323
|
-
const [mode, setMode] =
|
|
16324
|
-
const [showWarning, setShowWarningWithoutPersistance] =
|
|
16312
|
+
const [mode, setMode] = useState56("schema");
|
|
16313
|
+
const [showWarning, setShowWarningWithoutPersistance] = useState56(() => getPersistedShowWarningState());
|
|
16325
16314
|
const jsonEditorSetValue = useCallback72((newProps) => {
|
|
16326
16315
|
setDefaultProps(typeof newProps === "function" ? newProps : () => newProps, { shouldSave: false });
|
|
16327
16316
|
}, [setDefaultProps]);
|
|
@@ -16373,7 +16362,7 @@ var DataEditor = ({
|
|
|
16373
16362
|
return val(prevVal);
|
|
16374
16363
|
});
|
|
16375
16364
|
}, []);
|
|
16376
|
-
const { previewServerState } =
|
|
16365
|
+
const { previewServerState } = useContext40(StudioServerConnectionCtx);
|
|
16377
16366
|
const modeItems = useMemo86(() => {
|
|
16378
16367
|
return [
|
|
16379
16368
|
{
|
|
@@ -16513,7 +16502,7 @@ var DefaultPropsEditor = ({
|
|
|
16513
16502
|
setDefaultProps,
|
|
16514
16503
|
propsEditType
|
|
16515
16504
|
}) => {
|
|
16516
|
-
const canSaveDefaultProps =
|
|
16505
|
+
const canSaveDefaultProps = useContext41(ObserveDefaultPropsContext);
|
|
16517
16506
|
if (canSaveDefaultProps === null) {
|
|
16518
16507
|
throw new Error("ObserveDefaultPropsContext is not set");
|
|
16519
16508
|
}
|
|
@@ -16726,16 +16715,16 @@ var SchemaResetButton = ({ onClick }) => {
|
|
|
16726
16715
|
};
|
|
16727
16716
|
|
|
16728
16717
|
// src/components/RenderQueue/index.tsx
|
|
16729
|
-
import React108, { useContext as
|
|
16718
|
+
import React108, { useContext as useContext50, useEffect as useEffect52, useMemo as useMemo94 } from "react";
|
|
16730
16719
|
import { Internals as Internals35 } from "remotion";
|
|
16731
16720
|
|
|
16732
16721
|
// src/components/RenderQueue/RenderQueueItem.tsx
|
|
16733
16722
|
import {
|
|
16734
16723
|
useCallback as useCallback84,
|
|
16735
|
-
useContext as
|
|
16724
|
+
useContext as useContext49,
|
|
16736
16725
|
useEffect as useEffect51,
|
|
16737
16726
|
useMemo as useMemo93,
|
|
16738
|
-
useState as
|
|
16727
|
+
useState as useState57
|
|
16739
16728
|
} from "react";
|
|
16740
16729
|
import { Internals as Internals34 } from "remotion";
|
|
16741
16730
|
|
|
@@ -16836,7 +16825,7 @@ import { useCallback as useCallback76, useMemo as useMemo87 } from "react";
|
|
|
16836
16825
|
|
|
16837
16826
|
// src/components/RenderQueue/ClientRenderQueueProcessor.tsx
|
|
16838
16827
|
import { renderMediaOnWeb, renderStillOnWeb } from "@remotion/web-renderer";
|
|
16839
|
-
import { useCallback as useCallback75, useContext as
|
|
16828
|
+
import { useCallback as useCallback75, useContext as useContext42, useEffect as useEffect50 } from "react";
|
|
16840
16829
|
|
|
16841
16830
|
// src/api/save-render-output.ts
|
|
16842
16831
|
var throwIfNotOk = async (response) => {
|
|
@@ -16901,7 +16890,7 @@ var ClientRenderQueueProcessor = () => {
|
|
|
16901
16890
|
markClientJobFailed,
|
|
16902
16891
|
markClientJobCancelled,
|
|
16903
16892
|
setProcessJobCallback
|
|
16904
|
-
} =
|
|
16893
|
+
} = useContext42(RenderQueueContext);
|
|
16905
16894
|
const processStillJob = useCallback75(async (job, signal) => {
|
|
16906
16895
|
const compositionRef = getCompositionForJob2(job.id);
|
|
16907
16896
|
if (!compositionRef) {
|
|
@@ -17092,13 +17081,13 @@ var RenderQueueDownloadItem = ({ job }) => {
|
|
|
17092
17081
|
};
|
|
17093
17082
|
|
|
17094
17083
|
// src/components/RenderQueue/RenderQueueError.tsx
|
|
17095
|
-
import { useCallback as useCallback77, useContext as
|
|
17084
|
+
import { useCallback as useCallback77, useContext as useContext43 } from "react";
|
|
17096
17085
|
import { jsx as jsx150 } from "react/jsx-runtime";
|
|
17097
17086
|
var outputLocation = {
|
|
17098
17087
|
...renderQueueItemSubtitleStyle
|
|
17099
17088
|
};
|
|
17100
17089
|
var RenderQueueError = ({ job }) => {
|
|
17101
|
-
const { setSelectedModal } =
|
|
17090
|
+
const { setSelectedModal } = useContext43(ModalsContext);
|
|
17102
17091
|
const { tabIndex } = useZIndex();
|
|
17103
17092
|
const onClick = useCallback77(() => {
|
|
17104
17093
|
setSelectedModal({
|
|
@@ -17120,11 +17109,11 @@ var RenderQueueError = ({ job }) => {
|
|
|
17120
17109
|
};
|
|
17121
17110
|
|
|
17122
17111
|
// src/components/RenderQueue/RenderQueueItemCancelButton.tsx
|
|
17123
|
-
import { useCallback as useCallback78, useContext as
|
|
17112
|
+
import { useCallback as useCallback78, useContext as useContext44, useMemo as useMemo88 } from "react";
|
|
17124
17113
|
import { jsx as jsx151 } from "react/jsx-runtime";
|
|
17125
17114
|
var RenderQueueCancelButton = ({ job }) => {
|
|
17126
17115
|
const isClientJob = isClientRenderJob(job);
|
|
17127
|
-
const { cancelClientJob } =
|
|
17116
|
+
const { cancelClientJob } = useContext44(RenderQueueContext);
|
|
17128
17117
|
const onClick = useCallback78((e) => {
|
|
17129
17118
|
e.stopPropagation();
|
|
17130
17119
|
if (isClientJob) {
|
|
@@ -17159,7 +17148,7 @@ var RenderQueueCancelButton = ({ job }) => {
|
|
|
17159
17148
|
};
|
|
17160
17149
|
|
|
17161
17150
|
// src/components/RenderQueue/RenderQueueItemStatus.tsx
|
|
17162
|
-
import React101, { useCallback as useCallback79, useContext as
|
|
17151
|
+
import React101, { useCallback as useCallback79, useContext as useContext45 } from "react";
|
|
17163
17152
|
|
|
17164
17153
|
// src/components/RenderQueue/CircularProgress.tsx
|
|
17165
17154
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
@@ -17204,7 +17193,7 @@ var invisibleStyle = {
|
|
|
17204
17193
|
display: "flex"
|
|
17205
17194
|
};
|
|
17206
17195
|
var RenderQueueItemStatus = ({ job }) => {
|
|
17207
|
-
const { setSelectedModal } =
|
|
17196
|
+
const { setSelectedModal } = useContext45(ModalsContext);
|
|
17208
17197
|
const [hovered, setHovered] = React101.useState(false);
|
|
17209
17198
|
const isClientJob = isClientRenderJob(job);
|
|
17210
17199
|
const onPointerEnter = useCallback79(() => {
|
|
@@ -17356,7 +17345,7 @@ var RenderQueueOutputName = ({ job }) => {
|
|
|
17356
17345
|
};
|
|
17357
17346
|
|
|
17358
17347
|
// src/components/RenderQueue/RenderQueueProgressMessage.tsx
|
|
17359
|
-
import { useCallback as useCallback81, useContext as
|
|
17348
|
+
import { useCallback as useCallback81, useContext as useContext46 } from "react";
|
|
17360
17349
|
|
|
17361
17350
|
// src/components/RenderQueue/client-render-progress.ts
|
|
17362
17351
|
var formatEtaString = (timeRemainingInMilliseconds) => {
|
|
@@ -17393,7 +17382,7 @@ var RenderQueueProgressMessage = ({ job }) => {
|
|
|
17393
17382
|
if (job.status !== "running") {
|
|
17394
17383
|
throw new Error("should not have rendered this component");
|
|
17395
17384
|
}
|
|
17396
|
-
const { setSelectedModal } =
|
|
17385
|
+
const { setSelectedModal } = useContext46(ModalsContext);
|
|
17397
17386
|
const { tabIndex } = useZIndex();
|
|
17398
17387
|
const isClientJob = isClientRenderJob(job);
|
|
17399
17388
|
const onClick = useCallback81(() => {
|
|
@@ -17414,14 +17403,14 @@ var RenderQueueProgressMessage = ({ job }) => {
|
|
|
17414
17403
|
};
|
|
17415
17404
|
|
|
17416
17405
|
// src/components/RenderQueue/RenderQueueRemoveItem.tsx
|
|
17417
|
-
import { useCallback as useCallback82, useContext as
|
|
17406
|
+
import { useCallback as useCallback82, useContext as useContext47, useMemo as useMemo91 } from "react";
|
|
17418
17407
|
import { Internals as Internals33 } from "remotion";
|
|
17419
17408
|
import { jsx as jsx157 } from "react/jsx-runtime";
|
|
17420
17409
|
var RenderQueueRemoveItem = ({ job }) => {
|
|
17421
17410
|
const isClientJob = isClientRenderJob(job);
|
|
17422
|
-
const { removeClientJob } =
|
|
17423
|
-
const { canvasContent } =
|
|
17424
|
-
const { setCanvasContent } =
|
|
17411
|
+
const { removeClientJob } = useContext47(RenderQueueContext);
|
|
17412
|
+
const { canvasContent } = useContext47(Internals33.CompositionManager);
|
|
17413
|
+
const { setCanvasContent } = useContext47(Internals33.CompositionSetters);
|
|
17425
17414
|
const onClick = useCallback82((e) => {
|
|
17426
17415
|
e.stopPropagation();
|
|
17427
17416
|
if (isClientJob) {
|
|
@@ -17463,7 +17452,7 @@ var RenderQueueRemoveItem = ({ job }) => {
|
|
|
17463
17452
|
};
|
|
17464
17453
|
|
|
17465
17454
|
// src/components/RenderQueue/RenderQueueRepeat.tsx
|
|
17466
|
-
import { useCallback as useCallback83, useContext as
|
|
17455
|
+
import { useCallback as useCallback83, useContext as useContext48, useMemo as useMemo92 } from "react";
|
|
17467
17456
|
|
|
17468
17457
|
// src/helpers/retry-payload.ts
|
|
17469
17458
|
import { NoReactInternals as NoReactInternals11 } from "remotion/no-react";
|
|
@@ -17667,9 +17656,9 @@ var makeClientRetryPayload = (job) => {
|
|
|
17667
17656
|
// src/components/RenderQueue/RenderQueueRepeat.tsx
|
|
17668
17657
|
import { jsx as jsx158 } from "react/jsx-runtime";
|
|
17669
17658
|
var RenderQueueRepeatItem = ({ job }) => {
|
|
17670
|
-
const { setSelectedModal } =
|
|
17659
|
+
const { setSelectedModal } = useContext48(ModalsContext);
|
|
17671
17660
|
const isMobileLayout = useMobileLayout();
|
|
17672
|
-
const { setSidebarCollapsedState } =
|
|
17661
|
+
const { setSidebarCollapsedState } = useContext48(SidebarContext);
|
|
17673
17662
|
const isClientJob = isClientRenderJob(job);
|
|
17674
17663
|
const onClick = useCallback83((e) => {
|
|
17675
17664
|
e.stopPropagation();
|
|
@@ -17752,8 +17741,8 @@ var subtitle3 = {
|
|
|
17752
17741
|
};
|
|
17753
17742
|
var SELECTED_CLASSNAME = "__remotion_selected_classname";
|
|
17754
17743
|
var RenderQueueItem = ({ job, selected }) => {
|
|
17755
|
-
const [hovered, setHovered] =
|
|
17756
|
-
const { setCanvasContent } =
|
|
17744
|
+
const [hovered, setHovered] = useState57(false);
|
|
17745
|
+
const { setCanvasContent } = useContext49(Internals34.CompositionSetters);
|
|
17757
17746
|
const isClientJob = isClientRenderJob(job);
|
|
17758
17747
|
const onPointerEnter = useCallback84(() => {
|
|
17759
17748
|
setHovered(true);
|
|
@@ -17919,9 +17908,9 @@ var renderQueue = {
|
|
|
17919
17908
|
overflowY: "auto"
|
|
17920
17909
|
};
|
|
17921
17910
|
var RenderQueue = () => {
|
|
17922
|
-
const connectionStatus =
|
|
17923
|
-
const { jobs } =
|
|
17924
|
-
const { canvasContent } =
|
|
17911
|
+
const connectionStatus = useContext50(StudioServerConnectionCtx).previewServerState.type;
|
|
17912
|
+
const { jobs } = useContext50(RenderQueueContext);
|
|
17913
|
+
const { canvasContent } = useContext50(Internals35.CompositionManager);
|
|
17925
17914
|
const previousJobCount = React108.useRef(jobs.length);
|
|
17926
17915
|
const jobCount = jobs.length;
|
|
17927
17916
|
const divRef = React108.useRef(null);
|
|
@@ -18004,7 +17993,7 @@ var RenderQueue = () => {
|
|
|
18004
17993
|
};
|
|
18005
17994
|
|
|
18006
17995
|
// src/components/RendersTab.tsx
|
|
18007
|
-
import { useContext as
|
|
17996
|
+
import { useContext as useContext51, useMemo as useMemo95 } from "react";
|
|
18008
17997
|
import { jsx as jsx162, jsxs as jsxs78, Fragment as Fragment21 } from "react/jsx-runtime";
|
|
18009
17998
|
var row4 = {
|
|
18010
17999
|
display: "flex",
|
|
@@ -18024,7 +18013,7 @@ var badge = {
|
|
|
18024
18013
|
alignItems: "center"
|
|
18025
18014
|
};
|
|
18026
18015
|
var RendersTab = ({ selected, onClick }) => {
|
|
18027
|
-
const { jobs } =
|
|
18016
|
+
const { jobs } = useContext51(RenderQueueContext);
|
|
18028
18017
|
const failedJobs = jobs.filter((j) => j.status === "failed").length;
|
|
18029
18018
|
const jobCount = jobs.length;
|
|
18030
18019
|
const badgeStyle = useMemo95(() => {
|
|
@@ -18059,10 +18048,10 @@ var RendersTab = ({ selected, onClick }) => {
|
|
|
18059
18048
|
};
|
|
18060
18049
|
|
|
18061
18050
|
// src/components/VisualControls/VisualControlsContent.tsx
|
|
18062
|
-
import React111, { useContext as
|
|
18051
|
+
import React111, { useContext as useContext53 } from "react";
|
|
18063
18052
|
|
|
18064
18053
|
// src/components/VisualControls/VisualControlHandle.tsx
|
|
18065
|
-
import { useCallback as useCallback86, useContext as
|
|
18054
|
+
import { useCallback as useCallback86, useContext as useContext52, useEffect as useEffect54, useState as useState60 } from "react";
|
|
18066
18055
|
import { NoReactInternals as NoReactInternals12 } from "remotion/no-react";
|
|
18067
18056
|
|
|
18068
18057
|
// src/fast-refresh-context.ts
|
|
@@ -18074,9 +18063,9 @@ var FastRefreshContext = createContext20({
|
|
|
18074
18063
|
});
|
|
18075
18064
|
|
|
18076
18065
|
// src/components/VisualControls/get-original-stack-trace.ts
|
|
18077
|
-
import { useEffect as useEffect53, useState as
|
|
18066
|
+
import { useEffect as useEffect53, useState as useState58 } from "react";
|
|
18078
18067
|
var useOriginalFileName = (stack2) => {
|
|
18079
|
-
const [originalFileName, setOriginalFileName] =
|
|
18068
|
+
const [originalFileName, setOriginalFileName] = useState58({ type: "loading" });
|
|
18080
18069
|
useEffect53(() => {
|
|
18081
18070
|
if (!stack2) {
|
|
18082
18071
|
return;
|
|
@@ -18098,7 +18087,7 @@ var useOriginalFileName = (stack2) => {
|
|
|
18098
18087
|
};
|
|
18099
18088
|
|
|
18100
18089
|
// src/components/VisualControls/ClickableFileName.tsx
|
|
18101
|
-
import { useCallback as useCallback85, useMemo as useMemo96, useState as
|
|
18090
|
+
import { useCallback as useCallback85, useMemo as useMemo96, useState as useState59 } from "react";
|
|
18102
18091
|
|
|
18103
18092
|
// src/components/Timeline/TimelineStack/source-attribution.ts
|
|
18104
18093
|
var getOriginalSourceAttribution = (originalLocation) => {
|
|
@@ -18123,7 +18112,7 @@ var container33 = {
|
|
|
18123
18112
|
var ClickableFileName = ({
|
|
18124
18113
|
originalFileName
|
|
18125
18114
|
}) => {
|
|
18126
|
-
const [titleHovered, setTitleHovered] =
|
|
18115
|
+
const [titleHovered, setTitleHovered] = useState59(false);
|
|
18127
18116
|
const hoverEffect = titleHovered && originalFileName.type === "loaded";
|
|
18128
18117
|
const onTitlePointerEnter = useCallback85(() => {
|
|
18129
18118
|
setTitleHovered(true);
|
|
@@ -18173,10 +18162,10 @@ var VisualControlHandle = ({ value, keyName }) => {
|
|
|
18173
18162
|
throw new Error("expected zod");
|
|
18174
18163
|
}
|
|
18175
18164
|
const zodTypes = useZodTypesIfPossible();
|
|
18176
|
-
const state =
|
|
18177
|
-
const { updateValue } =
|
|
18178
|
-
const { fastRefreshes, increaseManualRefreshes } =
|
|
18179
|
-
const [_saving, setSaving] =
|
|
18165
|
+
const state = useContext52(VisualControlsContext);
|
|
18166
|
+
const { updateValue } = useContext52(SetVisualControlsContext);
|
|
18167
|
+
const { fastRefreshes, increaseManualRefreshes } = useContext52(FastRefreshContext);
|
|
18168
|
+
const [_saving, setSaving] = useState60(false);
|
|
18180
18169
|
const currentValue = getVisualControlEditedValue({
|
|
18181
18170
|
handles: state.handles,
|
|
18182
18171
|
key: keyName
|
|
@@ -18265,7 +18254,7 @@ var container34 = {
|
|
|
18265
18254
|
overflowY: "auto"
|
|
18266
18255
|
};
|
|
18267
18256
|
var VisualControlsContent = () => {
|
|
18268
|
-
const { handles } =
|
|
18257
|
+
const { handles } = useContext53(VisualControlsContext);
|
|
18269
18258
|
const entries = Object.entries(handles);
|
|
18270
18259
|
return /* @__PURE__ */ jsx166("div", {
|
|
18271
18260
|
style: container34,
|
|
@@ -18308,10 +18297,10 @@ var persistSelectedOptionsSidebarPanel2 = (panel2) => {
|
|
|
18308
18297
|
};
|
|
18309
18298
|
var optionsSidebarTabs = createRef10();
|
|
18310
18299
|
var OptionsPanel = ({ readOnlyStudio }) => {
|
|
18311
|
-
const { props, updateProps } =
|
|
18300
|
+
const { props, updateProps } = useContext54(Internals36.EditorPropsContext);
|
|
18312
18301
|
const renderingAvailable = !readOnlyStudio || SHOW_BROWSER_RENDERING;
|
|
18313
18302
|
const isMobileLayout = useMobileLayout();
|
|
18314
|
-
const visualControlsTabActivated =
|
|
18303
|
+
const visualControlsTabActivated = useContext54(VisualControlsTabActivatedContext);
|
|
18315
18304
|
const container35 = useMemo97(() => ({
|
|
18316
18305
|
height: "100%",
|
|
18317
18306
|
width: "100%",
|
|
@@ -18320,7 +18309,7 @@ var OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
18320
18309
|
flexDirection: "column",
|
|
18321
18310
|
flex: 1
|
|
18322
18311
|
}), [isMobileLayout]);
|
|
18323
|
-
const [panel2, setPanel] =
|
|
18312
|
+
const [panel2, setPanel] = useState61(() => getSelectedPanel2(renderingAvailable));
|
|
18324
18313
|
const onPropsSelected = useCallback87(() => {
|
|
18325
18314
|
setPanel("input-props");
|
|
18326
18315
|
persistSelectedOptionsSidebarPanel2("input-props");
|
|
@@ -18341,7 +18330,7 @@ var OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
18341
18330
|
}
|
|
18342
18331
|
};
|
|
18343
18332
|
}, []);
|
|
18344
|
-
const { compositions, canvasContent } =
|
|
18333
|
+
const { compositions, canvasContent } = useContext54(Internals36.CompositionManager);
|
|
18345
18334
|
const composition = useMemo97(() => {
|
|
18346
18335
|
if (canvasContent === null || canvasContent.type !== "composition") {
|
|
18347
18336
|
return null;
|
|
@@ -18478,7 +18467,7 @@ var OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
18478
18467
|
};
|
|
18479
18468
|
|
|
18480
18469
|
// src/components/PreviewToolbar.tsx
|
|
18481
|
-
import { useContext as
|
|
18470
|
+
import { useContext as useContext60, useEffect as useEffect60, useRef as useRef33, useState as useState65 } from "react";
|
|
18482
18471
|
import { Internals as Internals44 } from "remotion";
|
|
18483
18472
|
|
|
18484
18473
|
// src/state/loop.ts
|
|
@@ -18492,7 +18481,7 @@ var loadLoopOption = () => {
|
|
|
18492
18481
|
};
|
|
18493
18482
|
|
|
18494
18483
|
// src/components/CheckboardToggle.tsx
|
|
18495
|
-
import { useCallback as useCallback88, useContext as
|
|
18484
|
+
import { useCallback as useCallback88, useContext as useContext55 } from "react";
|
|
18496
18485
|
import { NoReactInternals as NoReactInternals13 } from "remotion/no-react";
|
|
18497
18486
|
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
18498
18487
|
var accessibilityLabel2 = [
|
|
@@ -18500,7 +18489,7 @@ var accessibilityLabel2 = [
|
|
|
18500
18489
|
areKeyboardShortcutsDisabled() ? null : "(T)"
|
|
18501
18490
|
].filter(NoReactInternals13.truthy).join(" ");
|
|
18502
18491
|
var CheckboardToggle = () => {
|
|
18503
|
-
const { checkerboard, setCheckerboard } =
|
|
18492
|
+
const { checkerboard, setCheckerboard } = useContext55(CheckerboardContext);
|
|
18504
18493
|
const onClick = useCallback88(() => {
|
|
18505
18494
|
setCheckerboard((c) => {
|
|
18506
18495
|
return !c;
|
|
@@ -18531,10 +18520,10 @@ var CheckboardToggle = () => {
|
|
|
18531
18520
|
// src/components/FpsCounter.tsx
|
|
18532
18521
|
import {
|
|
18533
18522
|
useEffect as useEffect55,
|
|
18534
|
-
useLayoutEffect as
|
|
18523
|
+
useLayoutEffect as useLayoutEffect4,
|
|
18535
18524
|
useMemo as useMemo98,
|
|
18536
18525
|
useRef as useRef31,
|
|
18537
|
-
useState as
|
|
18526
|
+
useState as useState62
|
|
18538
18527
|
} from "react";
|
|
18539
18528
|
import { Internals as Internals37 } from "remotion";
|
|
18540
18529
|
import { jsxs as jsxs82 } from "react/jsx-runtime";
|
|
@@ -18552,17 +18541,17 @@ var FpsCounter = ({ playbackSpeed }) => {
|
|
|
18552
18541
|
const videoConfig = Internals37.useUnsafeVideoConfig();
|
|
18553
18542
|
const [playing] = Internals37.Timeline.usePlayingState();
|
|
18554
18543
|
const frame2 = Internals37.Timeline.useTimelinePosition();
|
|
18555
|
-
const [marker, rerender] =
|
|
18556
|
-
const [fps, setFps] =
|
|
18544
|
+
const [marker, rerender] = useState62({});
|
|
18545
|
+
const [fps, setFps] = useState62(0);
|
|
18557
18546
|
const previousUpdates = useRef31([]);
|
|
18558
18547
|
const fpsRef = useRef31(0);
|
|
18559
18548
|
const playingRef = useRef31(playing);
|
|
18560
|
-
|
|
18549
|
+
useLayoutEffect4(() => {
|
|
18561
18550
|
fpsRef.current = 0;
|
|
18562
18551
|
previousUpdates.current = [];
|
|
18563
18552
|
playingRef.current = playing;
|
|
18564
18553
|
}, [playing]);
|
|
18565
|
-
|
|
18554
|
+
useLayoutEffect4(() => {
|
|
18566
18555
|
if (playingRef.current === false)
|
|
18567
18556
|
return;
|
|
18568
18557
|
previousUpdates.current = pushWithMaxSize(previousUpdates.current, performance.now(), 15);
|
|
@@ -18612,7 +18601,7 @@ var FpsCounter = ({ playbackSpeed }) => {
|
|
|
18612
18601
|
};
|
|
18613
18602
|
|
|
18614
18603
|
// src/components/FullscreenToggle.tsx
|
|
18615
|
-
import { useCallback as useCallback89, useContext as
|
|
18604
|
+
import { useCallback as useCallback89, useContext as useContext56, useEffect as useEffect56 } from "react";
|
|
18616
18605
|
import { Internals as Internals38 } from "remotion";
|
|
18617
18606
|
import { NoReactInternals as NoReactInternals14 } from "remotion/no-react";
|
|
18618
18607
|
import { jsx as jsx169 } from "react/jsx-runtime";
|
|
@@ -18622,7 +18611,7 @@ var accessibilityLabel3 = [
|
|
|
18622
18611
|
].filter(NoReactInternals14.truthy).join(" ");
|
|
18623
18612
|
var FullScreenToggle = () => {
|
|
18624
18613
|
const keybindings = useKeybinding();
|
|
18625
|
-
const { setSize } =
|
|
18614
|
+
const { setSize } = useContext56(Internals38.PreviewSizeContext);
|
|
18626
18615
|
const onClick = useCallback89(() => {
|
|
18627
18616
|
drawRef.current?.requestFullscreen();
|
|
18628
18617
|
if (document.fullscreenElement)
|
|
@@ -18856,7 +18845,7 @@ var PlaybackRatePersistor = () => {
|
|
|
18856
18845
|
};
|
|
18857
18846
|
|
|
18858
18847
|
// src/components/PlaybackRateSelector.tsx
|
|
18859
|
-
import { useContext as
|
|
18848
|
+
import { useContext as useContext57, useMemo as useMemo99 } from "react";
|
|
18860
18849
|
import { Internals as Internals40 } from "remotion";
|
|
18861
18850
|
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
18862
18851
|
var commonPlaybackRates = [
|
|
@@ -18878,7 +18867,7 @@ var getPlaybackRateLabel = (playbackRate) => {
|
|
|
18878
18867
|
var accessibilityLabel5 = "Change the playback rate";
|
|
18879
18868
|
var comboStyle2 = { width: 80 };
|
|
18880
18869
|
var PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
|
|
18881
|
-
const { canvasContent } =
|
|
18870
|
+
const { canvasContent } = useContext57(Internals40.CompositionManager);
|
|
18882
18871
|
const isStill = useIsStill();
|
|
18883
18872
|
const style9 = useMemo99(() => {
|
|
18884
18873
|
return {
|
|
@@ -18928,7 +18917,7 @@ var PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
|
|
|
18928
18917
|
|
|
18929
18918
|
// src/components/PlayPause.tsx
|
|
18930
18919
|
import { PlayerInternals as PlayerInternals13 } from "@remotion/player";
|
|
18931
|
-
import { useCallback as useCallback93, useEffect as useEffect59, useState as
|
|
18920
|
+
import { useCallback as useCallback93, useEffect as useEffect59, useState as useState63 } from "react";
|
|
18932
18921
|
import { Internals as Internals41 } from "remotion";
|
|
18933
18922
|
|
|
18934
18923
|
// src/icons/jump-to-start.tsx
|
|
@@ -19025,7 +19014,7 @@ var iconButton = {
|
|
|
19025
19014
|
var PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds }) => {
|
|
19026
19015
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
19027
19016
|
const videoConfig = Internals41.useUnsafeVideoConfig();
|
|
19028
|
-
const [showBufferIndicator, setShowBufferState] =
|
|
19017
|
+
const [showBufferIndicator, setShowBufferState] = useState63(false);
|
|
19029
19018
|
const {
|
|
19030
19019
|
playing,
|
|
19031
19020
|
play,
|
|
@@ -19287,7 +19276,7 @@ var PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds }) => {
|
|
|
19287
19276
|
|
|
19288
19277
|
// src/components/RenderButton.tsx
|
|
19289
19278
|
import { PlayerInternals as PlayerInternals14 } from "@remotion/player";
|
|
19290
|
-
import { useCallback as useCallback94, useContext as
|
|
19279
|
+
import { useCallback as useCallback94, useContext as useContext58, useMemo as useMemo100, useRef as useRef32, useState as useState64 } from "react";
|
|
19291
19280
|
import ReactDOM9 from "react-dom";
|
|
19292
19281
|
import { Internals as Internals42 } from "remotion";
|
|
19293
19282
|
import { jsx as jsx180, jsxs as jsxs84, Fragment as Fragment24 } from "react/jsx-runtime";
|
|
@@ -19358,9 +19347,9 @@ var RenderButton = ({
|
|
|
19358
19347
|
readOnlyStudio
|
|
19359
19348
|
}) => {
|
|
19360
19349
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
19361
|
-
const { setSelectedModal } =
|
|
19362
|
-
const [preferredRenderType, setPreferredRenderType] =
|
|
19363
|
-
const [dropdownOpened, setDropdownOpened] =
|
|
19350
|
+
const { setSelectedModal } = useContext58(ModalsContext);
|
|
19351
|
+
const [preferredRenderType, setPreferredRenderType] = useState64(() => getInitialRenderType(readOnlyStudio));
|
|
19352
|
+
const [dropdownOpened, setDropdownOpened] = useState64(false);
|
|
19364
19353
|
const dropdownRef = useRef32(null);
|
|
19365
19354
|
const containerRef = useRef32(null);
|
|
19366
19355
|
const { currentZIndex } = useZIndex();
|
|
@@ -19397,7 +19386,7 @@ var RenderButton = ({
|
|
|
19397
19386
|
return !o;
|
|
19398
19387
|
});
|
|
19399
19388
|
}, [refresh]);
|
|
19400
|
-
const connectionStatus =
|
|
19389
|
+
const connectionStatus = useContext58(StudioServerConnectionCtx).previewServerState.type;
|
|
19401
19390
|
const canServerRender = connectionStatus === "connected";
|
|
19402
19391
|
const canRender = canServerRender || SHOW_BROWSER_RENDERING || readOnlyStudio;
|
|
19403
19392
|
const renderType = useMemo100(() => {
|
|
@@ -19427,7 +19416,7 @@ var RenderButton = ({
|
|
|
19427
19416
|
}, []);
|
|
19428
19417
|
const video = Internals42.useVideo();
|
|
19429
19418
|
const getCurrentFrame2 = PlayerInternals14.useFrameImperative();
|
|
19430
|
-
const { props } =
|
|
19419
|
+
const { props } = useContext58(Internals42.EditorPropsContext);
|
|
19431
19420
|
const openServerRenderModal = useCallback94((copyCommandOnly) => {
|
|
19432
19421
|
if (!video) {
|
|
19433
19422
|
return null;
|
|
@@ -19750,7 +19739,7 @@ var RenderButton = ({
|
|
|
19750
19739
|
};
|
|
19751
19740
|
|
|
19752
19741
|
// src/components/Timeline/TimelineZoomControls.tsx
|
|
19753
|
-
import { useCallback as useCallback95, useContext as
|
|
19742
|
+
import { useCallback as useCallback95, useContext as useContext59 } from "react";
|
|
19754
19743
|
import { Internals as Internals43 } from "remotion";
|
|
19755
19744
|
|
|
19756
19745
|
// src/icons/minus.tsx
|
|
@@ -19783,8 +19772,8 @@ var iconStyle4 = {
|
|
|
19783
19772
|
width: 14
|
|
19784
19773
|
};
|
|
19785
19774
|
var TimelineZoomControls = () => {
|
|
19786
|
-
const { canvasContent } =
|
|
19787
|
-
const { setZoom, zoom: zoomMap } =
|
|
19775
|
+
const { canvasContent } = useContext59(Internals43.CompositionManager);
|
|
19776
|
+
const { setZoom, zoom: zoomMap } = useContext59(TimelineZoomCtx);
|
|
19788
19777
|
const { tabIndex } = useZIndex();
|
|
19789
19778
|
const onMinusClicked = useCallback95(() => {
|
|
19790
19779
|
if (canvasContent === null || canvasContent.type !== "composition") {
|
|
@@ -19912,15 +19901,15 @@ var padding2 = {
|
|
|
19912
19901
|
};
|
|
19913
19902
|
var PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
19914
19903
|
const { playbackRate, setPlaybackRate } = Internals44.useTimelineContext();
|
|
19915
|
-
const { mediaMuted } =
|
|
19916
|
-
const { setMediaMuted } =
|
|
19917
|
-
const { canvasContent } =
|
|
19904
|
+
const { mediaMuted } = useContext60(Internals44.MediaVolumeContext);
|
|
19905
|
+
const { setMediaMuted } = useContext60(Internals44.SetMediaVolumeContext);
|
|
19906
|
+
const { canvasContent } = useContext60(Internals44.CompositionManager);
|
|
19918
19907
|
const isVideoComposition = useIsVideoComposition();
|
|
19919
19908
|
const previewToolbarRef = useRef33(null);
|
|
19920
19909
|
const leftScrollIndicatorRef = useRef33(null);
|
|
19921
19910
|
const rightScrollIndicatorRef = useRef33(null);
|
|
19922
19911
|
const isStill = useIsStill();
|
|
19923
|
-
const [loop, setLoop] =
|
|
19912
|
+
const [loop, setLoop] = useState65(loadLoopOption());
|
|
19924
19913
|
const isFullscreenSupported = checkFullscreenSupport();
|
|
19925
19914
|
const isMobileLayout = useMobileLayout();
|
|
19926
19915
|
useEffect60(() => {
|
|
@@ -20074,7 +20063,7 @@ var PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
20074
20063
|
};
|
|
20075
20064
|
|
|
20076
20065
|
// src/components/Splitter/SplitterContainer.tsx
|
|
20077
|
-
import { useMemo as useMemo101, useRef as useRef34, useState as
|
|
20066
|
+
import { useMemo as useMemo101, useRef as useRef34, useState as useState66 } from "react";
|
|
20078
20067
|
|
|
20079
20068
|
// src/state/timeline.ts
|
|
20080
20069
|
var localStorageKey4 = (id) => `remotion.editor.timelineFlex.${id}`;
|
|
@@ -20128,7 +20117,7 @@ var containerColumn = {
|
|
|
20128
20117
|
};
|
|
20129
20118
|
var SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, id }) => {
|
|
20130
20119
|
const [initialTimelineFlex, persistFlex] = useTimelineFlex(id);
|
|
20131
|
-
const [flexValue, setFlexValue] =
|
|
20120
|
+
const [flexValue, setFlexValue] = useState66(initialTimelineFlex ?? defaultFlex);
|
|
20132
20121
|
const ref2 = useRef34(null);
|
|
20133
20122
|
const isDragging = useRef34(false);
|
|
20134
20123
|
const value = useMemo101(() => {
|
|
@@ -20165,11 +20154,11 @@ var SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex,
|
|
|
20165
20154
|
};
|
|
20166
20155
|
|
|
20167
20156
|
// src/components/Splitter/SplitterElement.tsx
|
|
20168
|
-
import { useContext as
|
|
20157
|
+
import { useContext as useContext61, useMemo as useMemo102 } from "react";
|
|
20169
20158
|
import { interpolateColors, random } from "remotion";
|
|
20170
20159
|
import { jsx as jsx185, jsxs as jsxs87, Fragment as Fragment26 } from "react/jsx-runtime";
|
|
20171
20160
|
var SplitterElement = ({ children, type, sticky }) => {
|
|
20172
|
-
const context =
|
|
20161
|
+
const context = useContext61(SplitterContext);
|
|
20173
20162
|
const style9 = useMemo102(() => {
|
|
20174
20163
|
return {
|
|
20175
20164
|
flex: (type === "flexer" ? context.flexValue : 1 - context.flexValue) * 1000,
|
|
@@ -20203,7 +20192,7 @@ var SplitterElement = ({ children, type, sticky }) => {
|
|
|
20203
20192
|
|
|
20204
20193
|
// src/components/Splitter/SplitterHandle.tsx
|
|
20205
20194
|
import { PlayerInternals as PlayerInternals15 } from "@remotion/player";
|
|
20206
|
-
import { useContext as
|
|
20195
|
+
import { useContext as useContext62, useEffect as useEffect61, useRef as useRef35, useState as useState67 } from "react";
|
|
20207
20196
|
import { jsx as jsx186 } from "react/jsx-runtime";
|
|
20208
20197
|
var SPLITTER_HANDLE_SIZE = 3;
|
|
20209
20198
|
var containerRow2 = {
|
|
@@ -20213,11 +20202,11 @@ var containerColumn2 = {
|
|
|
20213
20202
|
width: SPLITTER_HANDLE_SIZE
|
|
20214
20203
|
};
|
|
20215
20204
|
var SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
20216
|
-
const context =
|
|
20205
|
+
const context = useContext62(SplitterContext);
|
|
20217
20206
|
if (!context) {
|
|
20218
20207
|
throw new Error("Cannot find splitter context");
|
|
20219
20208
|
}
|
|
20220
|
-
const [lastPointerUp, setLastPointerUp] =
|
|
20209
|
+
const [lastPointerUp, setLastPointerUp] = useState67(() => Date.now());
|
|
20221
20210
|
const ref2 = useRef35(null);
|
|
20222
20211
|
useEffect61(() => {
|
|
20223
20212
|
if (context.isDragging.current) {
|
|
@@ -20368,7 +20357,7 @@ var row5 = {
|
|
|
20368
20357
|
minHeight: 0
|
|
20369
20358
|
};
|
|
20370
20359
|
var useResponsiveSidebarStatus = () => {
|
|
20371
|
-
const { sidebarCollapsedStateLeft } =
|
|
20360
|
+
const { sidebarCollapsedStateLeft } = useContext63(SidebarContext);
|
|
20372
20361
|
const responsiveLeftStatus = useBreakpoint(1200) ? "collapsed" : "expanded";
|
|
20373
20362
|
const actualStateLeft = useMemo103(() => {
|
|
20374
20363
|
if (sidebarCollapsedStateLeft === "collapsed") {
|
|
@@ -20382,9 +20371,9 @@ var useResponsiveSidebarStatus = () => {
|
|
|
20382
20371
|
return actualStateLeft;
|
|
20383
20372
|
};
|
|
20384
20373
|
var TopPanelInner = ({ readOnlyStudio, onMounted, drawRef: drawRef2, bufferStateDelayInMilliseconds }) => {
|
|
20385
|
-
const { setSidebarCollapsedState, sidebarCollapsedStateRight } =
|
|
20374
|
+
const { setSidebarCollapsedState, sidebarCollapsedStateRight } = useContext63(SidebarContext);
|
|
20386
20375
|
const rulersAreVisible = useIsRulerVisible();
|
|
20387
|
-
const { canvasContent } =
|
|
20376
|
+
const { canvasContent } = useContext63(Internals45.CompositionManager);
|
|
20388
20377
|
const actualStateLeft = useResponsiveSidebarStatus();
|
|
20389
20378
|
const actualStateRight = useMemo103(() => {
|
|
20390
20379
|
if (sidebarCollapsedStateRight === "collapsed") {
|
|
@@ -20506,7 +20495,7 @@ var style9 = {
|
|
|
20506
20495
|
position: "relative"
|
|
20507
20496
|
};
|
|
20508
20497
|
var SidebarCollapserControls = () => {
|
|
20509
|
-
const { setSidebarCollapsedState, sidebarCollapsedStateRight } =
|
|
20498
|
+
const { setSidebarCollapsedState, sidebarCollapsedStateRight } = useContext64(SidebarContext);
|
|
20510
20499
|
const keybindings = useKeybinding();
|
|
20511
20500
|
const leftSidebarStatus = useResponsiveSidebarStatus();
|
|
20512
20501
|
const leftIcon = useCallback97((color) => {
|
|
@@ -20644,10 +20633,10 @@ var SidebarCollapserControls = () => {
|
|
|
20644
20633
|
// src/components/UndoRedoButtons.tsx
|
|
20645
20634
|
import {
|
|
20646
20635
|
useCallback as useCallback98,
|
|
20647
|
-
useContext as
|
|
20636
|
+
useContext as useContext65,
|
|
20648
20637
|
useEffect as useEffect64,
|
|
20649
20638
|
useRef as useRef36,
|
|
20650
|
-
useState as
|
|
20639
|
+
useState as useState68
|
|
20651
20640
|
} from "react";
|
|
20652
20641
|
|
|
20653
20642
|
// src/icons/redo.tsx
|
|
@@ -20683,9 +20672,9 @@ var iconStyle5 = {
|
|
|
20683
20672
|
height: 16
|
|
20684
20673
|
};
|
|
20685
20674
|
var UndoRedoButtons = () => {
|
|
20686
|
-
const [undoFile, setUndoFile] =
|
|
20687
|
-
const [redoFile, setRedoFile] =
|
|
20688
|
-
const { subscribeToEvent } =
|
|
20675
|
+
const [undoFile, setUndoFile] = useState68(null);
|
|
20676
|
+
const [redoFile, setRedoFile] = useState68(null);
|
|
20677
|
+
const { subscribeToEvent } = useContext65(StudioServerConnectionCtx);
|
|
20689
20678
|
const keybindings = useKeybinding();
|
|
20690
20679
|
const undoInFlight = useRef36(false);
|
|
20691
20680
|
const redoInFlight = useRef36(false);
|
|
@@ -20790,10 +20779,10 @@ var UndoRedoButtons = () => {
|
|
|
20790
20779
|
// src/components/UpdateCheck.tsx
|
|
20791
20780
|
import {
|
|
20792
20781
|
useCallback as useCallback99,
|
|
20793
|
-
useContext as
|
|
20782
|
+
useContext as useContext66,
|
|
20794
20783
|
useEffect as useEffect65,
|
|
20795
20784
|
useMemo as useMemo104,
|
|
20796
|
-
useState as
|
|
20785
|
+
useState as useState69
|
|
20797
20786
|
} from "react";
|
|
20798
20787
|
import { VERSION } from "remotion";
|
|
20799
20788
|
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
@@ -20809,10 +20798,10 @@ var buttonStyle3 = {
|
|
|
20809
20798
|
justifyContent: "center"
|
|
20810
20799
|
};
|
|
20811
20800
|
var UpdateCheck = () => {
|
|
20812
|
-
const [info, setInfo] =
|
|
20813
|
-
const { setSelectedModal } =
|
|
20801
|
+
const [info, setInfo] = useState69(null);
|
|
20802
|
+
const { setSelectedModal } = useContext66(ModalsContext);
|
|
20814
20803
|
const { tabIndex } = useZIndex();
|
|
20815
|
-
const [knownBugs, setKnownBugs] =
|
|
20804
|
+
const [knownBugs, setKnownBugs] = useState69(null);
|
|
20816
20805
|
const hasKnownBugs = useMemo104(() => {
|
|
20817
20806
|
return knownBugs && knownBugs.length > 0;
|
|
20818
20807
|
}, [knownBugs]);
|
|
@@ -20908,7 +20897,7 @@ var flex2 = {
|
|
|
20908
20897
|
flex: 1
|
|
20909
20898
|
};
|
|
20910
20899
|
var MenuToolbar = ({ readOnlyStudio }) => {
|
|
20911
|
-
const [selected, setSelected] =
|
|
20900
|
+
const [selected, setSelected] = useState70(null);
|
|
20912
20901
|
const mobileLayout = useMobileLayout();
|
|
20913
20902
|
const fixedWidthRight = useMemo105(() => {
|
|
20914
20903
|
return {
|
|
@@ -21014,7 +21003,7 @@ var MenuToolbar = ({ readOnlyStudio }) => {
|
|
|
21014
21003
|
};
|
|
21015
21004
|
|
|
21016
21005
|
// src/components/Timeline/Timeline.tsx
|
|
21017
|
-
import React152, { useContext as
|
|
21006
|
+
import React152, { useContext as useContext79, useMemo as useMemo123 } from "react";
|
|
21018
21007
|
import { Internals as Internals57 } from "remotion";
|
|
21019
21008
|
|
|
21020
21009
|
// src/helpers/get-sequence-visible-range.ts
|
|
@@ -21061,7 +21050,8 @@ var getTimelineNestedLevel = (sequence, allSequences, depth) => {
|
|
|
21061
21050
|
if (!parentSequence) {
|
|
21062
21051
|
throw new Error("has parentId but no parent");
|
|
21063
21052
|
}
|
|
21064
|
-
|
|
21053
|
+
const parentContributes = parentSequence.showInTimeline;
|
|
21054
|
+
return getTimelineNestedLevel(parentSequence, allSequences, parentContributes ? depth + 1 : depth);
|
|
21065
21055
|
};
|
|
21066
21056
|
|
|
21067
21057
|
// src/helpers/get-timeline-sequence-hash.ts
|
|
@@ -21110,6 +21100,19 @@ var getTimelineSequenceSequenceSortKey = (track, tracks, sameHashes = {}, nonceR
|
|
|
21110
21100
|
};
|
|
21111
21101
|
|
|
21112
21102
|
// src/helpers/calculate-timeline.ts
|
|
21103
|
+
var getInheritedLoopDisplay = (sequence, sequences) => {
|
|
21104
|
+
if (sequence.loopDisplay) {
|
|
21105
|
+
return sequence.loopDisplay;
|
|
21106
|
+
}
|
|
21107
|
+
if (!sequence.parent) {
|
|
21108
|
+
return;
|
|
21109
|
+
}
|
|
21110
|
+
const parent = sequences.find((s) => s.id === sequence.parent);
|
|
21111
|
+
if (!parent) {
|
|
21112
|
+
return;
|
|
21113
|
+
}
|
|
21114
|
+
return getInheritedLoopDisplay(parent, sequences);
|
|
21115
|
+
};
|
|
21113
21116
|
var calculateTimeline = ({
|
|
21114
21117
|
sequences
|
|
21115
21118
|
}) => {
|
|
@@ -21138,7 +21141,8 @@ var calculateTimeline = ({
|
|
|
21138
21141
|
sequence: {
|
|
21139
21142
|
...sequence,
|
|
21140
21143
|
from: visibleStart,
|
|
21141
|
-
duration: visibleDuration
|
|
21144
|
+
duration: visibleDuration,
|
|
21145
|
+
loopDisplay: sequence.type === "audio" || sequence.type === "video" ? getInheritedLoopDisplay(sequence, sortedSequences) : sequence.loopDisplay
|
|
21142
21146
|
},
|
|
21143
21147
|
depth: getTimelineNestedLevel(sequence, sortedSequences, 0),
|
|
21144
21148
|
hash: actualHash,
|
|
@@ -21165,7 +21169,7 @@ var calculateTimeline = ({
|
|
|
21165
21169
|
};
|
|
21166
21170
|
|
|
21167
21171
|
// src/components/ExpandedTracksProvider.tsx
|
|
21168
|
-
import { createContext as createContext21, useCallback as useCallback101, useMemo as useMemo106, useState as
|
|
21172
|
+
import { createContext as createContext21, useCallback as useCallback101, useMemo as useMemo106, useState as useState71 } from "react";
|
|
21169
21173
|
import { jsx as jsx194 } from "react/jsx-runtime";
|
|
21170
21174
|
var ExpandedTracksContext = createContext21({
|
|
21171
21175
|
expandedTracks: {},
|
|
@@ -21174,7 +21178,7 @@ var ExpandedTracksContext = createContext21({
|
|
|
21174
21178
|
}
|
|
21175
21179
|
});
|
|
21176
21180
|
var ExpandedTracksProvider = ({ children }) => {
|
|
21177
|
-
const [expandedTracks, setExpandedTracks] =
|
|
21181
|
+
const [expandedTracks, setExpandedTracks] = useState71({});
|
|
21178
21182
|
const toggleTrack = useCallback101((id) => {
|
|
21179
21183
|
setExpandedTracks((prev) => ({
|
|
21180
21184
|
...prev,
|
|
@@ -21231,16 +21235,16 @@ var MaxTimelineTracksReached = () => {
|
|
|
21231
21235
|
import { PlayerInternals as PlayerInternals16 } from "@remotion/player";
|
|
21232
21236
|
import {
|
|
21233
21237
|
useCallback as useCallback102,
|
|
21234
|
-
useContext as
|
|
21238
|
+
useContext as useContext69,
|
|
21235
21239
|
useEffect as useEffect66,
|
|
21236
21240
|
useMemo as useMemo108,
|
|
21237
21241
|
useRef as useRef37,
|
|
21238
|
-
useState as
|
|
21242
|
+
useState as useState72
|
|
21239
21243
|
} from "react";
|
|
21240
21244
|
import { Internals as Internals47, useVideoConfig as useVideoConfig4 } from "remotion";
|
|
21241
21245
|
|
|
21242
21246
|
// src/components/Timeline/TimelineInOutPointer.tsx
|
|
21243
|
-
import { createRef as createRef11, useContext as
|
|
21247
|
+
import { createRef as createRef11, useContext as useContext67 } from "react";
|
|
21244
21248
|
import { Internals as Internals46 } from "remotion";
|
|
21245
21249
|
import { jsx as jsx195, jsxs as jsxs93, Fragment as Fragment29 } from "react/jsx-runtime";
|
|
21246
21250
|
var areaHighlight = {
|
|
@@ -21255,7 +21259,7 @@ var outMarkerAreaRef = createRef11();
|
|
|
21255
21259
|
var TimelineInOutPointer = () => {
|
|
21256
21260
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
21257
21261
|
const videoConfig = Internals46.useUnsafeVideoConfig();
|
|
21258
|
-
const timelineWidth =
|
|
21262
|
+
const timelineWidth = useContext67(TimelineWidthContext);
|
|
21259
21263
|
if (!videoConfig || timelineWidth === null) {
|
|
21260
21264
|
return null;
|
|
21261
21265
|
}
|
|
@@ -21282,7 +21286,7 @@ var TimelineInOutPointer = () => {
|
|
|
21282
21286
|
};
|
|
21283
21287
|
|
|
21284
21288
|
// src/components/Timeline/TimelineInOutPointerHandle.tsx
|
|
21285
|
-
import { createRef as createRef12, useContext as
|
|
21289
|
+
import { createRef as createRef12, useContext as useContext68, useMemo as useMemo107 } from "react";
|
|
21286
21290
|
import { useVideoConfig as useVideoConfig3 } from "remotion";
|
|
21287
21291
|
import { jsx as jsx196 } from "react/jsx-runtime";
|
|
21288
21292
|
var line3 = {
|
|
@@ -21315,7 +21319,7 @@ var TimelineInOutPointerHandle = ({
|
|
|
21315
21319
|
type,
|
|
21316
21320
|
atFrame
|
|
21317
21321
|
}) => {
|
|
21318
|
-
const timelineWidth =
|
|
21322
|
+
const timelineWidth = useContext68(TimelineWidthContext);
|
|
21319
21323
|
if (timelineWidth === null) {
|
|
21320
21324
|
return null;
|
|
21321
21325
|
}
|
|
@@ -21351,8 +21355,8 @@ var getClientXWithScroll = (x) => {
|
|
|
21351
21355
|
};
|
|
21352
21356
|
var TimelineDragHandler = () => {
|
|
21353
21357
|
const video = Internals47.useUnsafeVideoConfig();
|
|
21354
|
-
const { zoom: zoomMap } =
|
|
21355
|
-
const { canvasContent } =
|
|
21358
|
+
const { zoom: zoomMap } = useContext69(TimelineZoomCtx);
|
|
21359
|
+
const { canvasContent } = useContext69(Internals47.CompositionManager);
|
|
21356
21360
|
const containerStyle2 = useMemo108(() => {
|
|
21357
21361
|
if (!canvasContent || canvasContent.type !== "composition") {
|
|
21358
21362
|
return {};
|
|
@@ -21380,10 +21384,10 @@ var Inner2 = () => {
|
|
|
21380
21384
|
});
|
|
21381
21385
|
const { isHighestContext } = useZIndex();
|
|
21382
21386
|
const setFrame = Internals47.useTimelineSetFrame();
|
|
21383
|
-
const [inOutDragging, setInOutDragging] =
|
|
21387
|
+
const [inOutDragging, setInOutDragging] = useState72({
|
|
21384
21388
|
dragging: false
|
|
21385
21389
|
});
|
|
21386
|
-
const timelineWidth =
|
|
21390
|
+
const timelineWidth = useContext69(TimelineWidthContext);
|
|
21387
21391
|
const get = useCallback102((frame2) => {
|
|
21388
21392
|
if (timelineWidth === null) {
|
|
21389
21393
|
throw new Error("timeline width is not yet determined");
|
|
@@ -21394,7 +21398,7 @@ var Inner2 = () => {
|
|
|
21394
21398
|
const left3 = size4?.left ?? 0;
|
|
21395
21399
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
21396
21400
|
const { setInAndOutFrames } = useTimelineSetInOutFramePosition();
|
|
21397
|
-
const [dragging, setDragging] =
|
|
21401
|
+
const [dragging, setDragging] = useState72({
|
|
21398
21402
|
dragging: false
|
|
21399
21403
|
});
|
|
21400
21404
|
const { playing, play, pause, seek } = PlayerInternals16.usePlayer();
|
|
@@ -21777,14 +21781,14 @@ import { PlayerInternals as PlayerInternals18 } from "@remotion/player";
|
|
|
21777
21781
|
import { useRef as useRef41 } from "react";
|
|
21778
21782
|
|
|
21779
21783
|
// src/components/Timeline/TimelineListItem.tsx
|
|
21780
|
-
import { useCallback as useCallback111, useContext as
|
|
21784
|
+
import { useCallback as useCallback111, useContext as useContext73, useMemo as useMemo116 } from "react";
|
|
21781
21785
|
import { Internals as Internals50 } from "remotion";
|
|
21782
21786
|
|
|
21783
21787
|
// src/components/Timeline/TimelineExpandedSection.tsx
|
|
21784
21788
|
import React139, { useMemo as useMemo113 } from "react";
|
|
21785
21789
|
|
|
21786
21790
|
// src/components/Timeline/TimelineFieldRow.tsx
|
|
21787
|
-
import { useCallback as useCallback107, useContext as
|
|
21791
|
+
import { useCallback as useCallback107, useContext as useContext70, useMemo as useMemo112 } from "react";
|
|
21788
21792
|
import { Internals as Internals48 } from "remotion";
|
|
21789
21793
|
|
|
21790
21794
|
// src/components/Timeline/TimelineBooleanField.tsx
|
|
@@ -21813,7 +21817,7 @@ var TimelineBooleanField = ({ field, codeValue, effectiveValue, canUpdate, onSav
|
|
|
21813
21817
|
};
|
|
21814
21818
|
|
|
21815
21819
|
// src/components/Timeline/TimelineNumberField.tsx
|
|
21816
|
-
import { useCallback as useCallback104, useMemo as useMemo109, useState as
|
|
21820
|
+
import { useCallback as useCallback104, useMemo as useMemo109, useState as useState73 } from "react";
|
|
21817
21821
|
|
|
21818
21822
|
// src/components/Timeline/timeline-field-utils.ts
|
|
21819
21823
|
var getDecimalPlaces = (num) => {
|
|
@@ -21836,7 +21840,7 @@ var TimelineNumberField = ({
|
|
|
21836
21840
|
onDragEnd,
|
|
21837
21841
|
codeValue
|
|
21838
21842
|
}) => {
|
|
21839
|
-
const [dragValue, setDragValue] =
|
|
21843
|
+
const [dragValue, setDragValue] = useState73(null);
|
|
21840
21844
|
const onValueChange = useCallback104((newVal) => {
|
|
21841
21845
|
setDragValue(newVal);
|
|
21842
21846
|
onDragValueChange(field.key, newVal);
|
|
@@ -21888,7 +21892,7 @@ var TimelineNumberField = ({
|
|
|
21888
21892
|
};
|
|
21889
21893
|
|
|
21890
21894
|
// src/components/Timeline/TimelineRotationField.tsx
|
|
21891
|
-
import { useCallback as useCallback105, useMemo as useMemo110, useState as
|
|
21895
|
+
import { useCallback as useCallback105, useMemo as useMemo110, useState as useState74 } from "react";
|
|
21892
21896
|
import { jsx as jsx200 } from "react/jsx-runtime";
|
|
21893
21897
|
var unitPattern = /^([+-]?(?:\d+\.?\d*|\.\d+))(deg|rad|turn|grad)$/;
|
|
21894
21898
|
var unitToDegrees = {
|
|
@@ -21918,7 +21922,7 @@ var TimelineRotationField = ({
|
|
|
21918
21922
|
onDragValueChange,
|
|
21919
21923
|
onDragEnd
|
|
21920
21924
|
}) => {
|
|
21921
|
-
const [dragValue, setDragValue] =
|
|
21925
|
+
const [dragValue, setDragValue] = useState74(null);
|
|
21922
21926
|
const degrees = useMemo110(() => parseCssRotationToDegrees(String(effectiveValue ?? "0deg")), [effectiveValue]);
|
|
21923
21927
|
const onValueChange = useCallback105((newVal) => {
|
|
21924
21928
|
setDragValue(newVal);
|
|
@@ -21976,7 +21980,7 @@ var TimelineRotationField = ({
|
|
|
21976
21980
|
};
|
|
21977
21981
|
|
|
21978
21982
|
// src/components/Timeline/TimelineTranslateField.tsx
|
|
21979
|
-
import { useCallback as useCallback106, useMemo as useMemo111, useState as
|
|
21983
|
+
import { useCallback as useCallback106, useMemo as useMemo111, useState as useState75 } from "react";
|
|
21980
21984
|
import { jsx as jsx201, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
21981
21985
|
var leftDraggerStyle = {
|
|
21982
21986
|
paddingLeft: 0
|
|
@@ -22005,8 +22009,8 @@ var TimelineTranslateField = ({
|
|
|
22005
22009
|
onDragValueChange,
|
|
22006
22010
|
onDragEnd
|
|
22007
22011
|
}) => {
|
|
22008
|
-
const [dragX, setDragX] =
|
|
22009
|
-
const [dragY, setDragY] =
|
|
22012
|
+
const [dragX, setDragX] = useState75(null);
|
|
22013
|
+
const [dragY, setDragY] = useState75(null);
|
|
22010
22014
|
const [codeX, codeY] = useMemo111(() => parseTranslate(String(effectiveValue ?? "0px 0px")), [effectiveValue]);
|
|
22011
22015
|
const makeString = useCallback106((x, y) => `${x}px ${y}px`, []);
|
|
22012
22016
|
const step = field.fieldSchema.type === "translate" ? field.fieldSchema.step ?? 1 : 1;
|
|
@@ -22280,7 +22284,7 @@ var TimelineFieldRow = ({
|
|
|
22280
22284
|
clearDragOverrides,
|
|
22281
22285
|
dragOverrides,
|
|
22282
22286
|
codeValues: allPropStatuses
|
|
22283
|
-
} =
|
|
22287
|
+
} = useContext70(Internals48.VisualModeOverridesContext);
|
|
22284
22288
|
const propStatuses = allPropStatuses[overrideId] ?? null;
|
|
22285
22289
|
const propStatus = propStatuses?.[field.key] ?? null;
|
|
22286
22290
|
const dragOverrideValue = useMemo112(() => {
|
|
@@ -22293,7 +22297,7 @@ var TimelineFieldRow = ({
|
|
|
22293
22297
|
defaultValue: field.fieldSchema.default,
|
|
22294
22298
|
shouldResortToDefaultValueIfUndefined: true
|
|
22295
22299
|
});
|
|
22296
|
-
const { setCodeValues } =
|
|
22300
|
+
const { setCodeValues } = useContext70(Internals48.VisualModeOverridesContext);
|
|
22297
22301
|
const onSave = useCallback107((key4, value) => {
|
|
22298
22302
|
if (!propStatuses || !validatedLocation || !nodePath) {
|
|
22299
22303
|
return Promise.reject(new Error("Cannot save"));
|
|
@@ -22507,7 +22511,7 @@ var TimelineLayerEye = ({ onInvoked, hidden, type }) => {
|
|
|
22507
22511
|
|
|
22508
22512
|
// src/components/Timeline/TimelineStack/index.tsx
|
|
22509
22513
|
import { SOURCE_MAP_ENDPOINT } from "@remotion/studio-shared";
|
|
22510
|
-
import { useCallback as useCallback109, useContext as
|
|
22514
|
+
import { useCallback as useCallback109, useContext as useContext71, useMemo as useMemo114, useState as useState76 } from "react";
|
|
22511
22515
|
import { SourceMapConsumer as SourceMapConsumer3 } from "source-map";
|
|
22512
22516
|
import { jsx as jsx206, jsxs as jsxs98, Fragment as Fragment30 } from "react/jsx-runtime";
|
|
22513
22517
|
var publicPath = window.remotion_publicPath === "/" ? "" : window.remotion_publicPath;
|
|
@@ -22516,11 +22520,11 @@ SourceMapConsumer3.initialize({
|
|
|
22516
22520
|
"lib/mappings.wasm": withoutSlashInTheEnd + SOURCE_MAP_ENDPOINT
|
|
22517
22521
|
});
|
|
22518
22522
|
var TimelineStack = ({ isCompact, sequence, originalLocation }) => {
|
|
22519
|
-
const [stackHovered, setStackHovered] =
|
|
22520
|
-
const [titleHovered, setTitleHovered] =
|
|
22521
|
-
const [opening, setOpening] =
|
|
22523
|
+
const [stackHovered, setStackHovered] = useState76(false);
|
|
22524
|
+
const [titleHovered, setTitleHovered] = useState76(false);
|
|
22525
|
+
const [opening, setOpening] = useState76(false);
|
|
22522
22526
|
const selectAsset = useSelectAsset();
|
|
22523
|
-
const connectionStatus =
|
|
22527
|
+
const connectionStatus = useContext71(StudioServerConnectionCtx).previewServerState.type;
|
|
22524
22528
|
const assetPath = useMemo114(() => {
|
|
22525
22529
|
if (sequence.type !== "video" && sequence.type !== "audio" && sequence.type !== "image") {
|
|
22526
22530
|
return null;
|
|
@@ -22671,15 +22675,15 @@ var TimelineStack = ({ isCompact, sequence, originalLocation }) => {
|
|
|
22671
22675
|
// src/components/Timeline/use-sequence-props-subscription.ts
|
|
22672
22676
|
import {
|
|
22673
22677
|
useCallback as useCallback110,
|
|
22674
|
-
useContext as
|
|
22678
|
+
useContext as useContext72,
|
|
22675
22679
|
useEffect as useEffect67,
|
|
22676
22680
|
useMemo as useMemo115,
|
|
22677
22681
|
useRef as useRef38,
|
|
22678
|
-
useState as
|
|
22682
|
+
useState as useState77
|
|
22679
22683
|
} from "react";
|
|
22680
22684
|
import { Internals as Internals49 } from "remotion";
|
|
22681
22685
|
var useSequencePropsSubscription = (sequence, originalLocation, visualModeEnabled) => {
|
|
22682
|
-
const { setCodeValues } =
|
|
22686
|
+
const { setCodeValues } = useContext72(Internals49.VisualModeOverridesContext);
|
|
22683
22687
|
const overrideId = sequence.controls?.overrideId ?? null;
|
|
22684
22688
|
const setPropStatusesForSequence = useCallback110((statuses) => {
|
|
22685
22689
|
if (!overrideId) {
|
|
@@ -22687,7 +22691,7 @@ var useSequencePropsSubscription = (sequence, originalLocation, visualModeEnable
|
|
|
22687
22691
|
}
|
|
22688
22692
|
setCodeValues(overrideId, statuses);
|
|
22689
22693
|
}, [overrideId, setCodeValues]);
|
|
22690
|
-
const { previewServerState: state, subscribeToEvent } =
|
|
22694
|
+
const { previewServerState: state, subscribeToEvent } = useContext72(StudioServerConnectionCtx);
|
|
22691
22695
|
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
22692
22696
|
const schemaFields = useMemo115(() => getSchemaFields(sequence.controls), [sequence.controls]);
|
|
22693
22697
|
const schemaKeysString = useMemo115(() => schemaFields ? schemaFields.map((f) => f.key).join(",") : null, [schemaFields]);
|
|
@@ -22711,8 +22715,8 @@ var useSequencePropsSubscription = (sequence, originalLocation, visualModeEnable
|
|
|
22711
22715
|
const currentLocationColumn = useRef38(locationColumn);
|
|
22712
22716
|
currentLocationColumn.current = locationColumn;
|
|
22713
22717
|
const nodePathRef = useRef38(null);
|
|
22714
|
-
const [nodePath, setNodePath] =
|
|
22715
|
-
const [jsxInMapCallback, setJsxInMapCallback] =
|
|
22718
|
+
const [nodePath, setNodePath] = useState77(null);
|
|
22719
|
+
const [jsxInMapCallback, setJsxInMapCallback] = useState77(false);
|
|
22716
22720
|
const isMountedRef = useRef38(true);
|
|
22717
22721
|
const setNodePathBoth = useCallback110((next) => {
|
|
22718
22722
|
nodePathRef.current = next;
|
|
@@ -22853,12 +22857,12 @@ var arrowButton = {
|
|
|
22853
22857
|
lineHeight: 1
|
|
22854
22858
|
};
|
|
22855
22859
|
var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
22856
|
-
const { previewServerState } =
|
|
22860
|
+
const { previewServerState } = useContext73(StudioServerConnectionCtx);
|
|
22857
22861
|
const visualModeEnvEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED);
|
|
22858
22862
|
const previewConnected = previewServerState.type === "connected";
|
|
22859
22863
|
const visualModeActive = visualModeEnvEnabled && previewConnected;
|
|
22860
|
-
const { hidden, setHidden } =
|
|
22861
|
-
const { expandedTracks, toggleTrack } =
|
|
22864
|
+
const { hidden, setHidden } = useContext73(Internals50.SequenceVisibilityToggleContext);
|
|
22865
|
+
const { expandedTracks, toggleTrack } = useContext73(ExpandedTracksContext);
|
|
22862
22866
|
const originalLocation = useResolvedStack(sequence.stack ?? null);
|
|
22863
22867
|
const { nodePath, jsxInMapCallback } = useSequencePropsSubscription(sequence, originalLocation, visualModeActive);
|
|
22864
22868
|
const validatedLocation = useMemo116(() => {
|
|
@@ -23061,7 +23065,7 @@ var TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
|
|
|
23061
23065
|
};
|
|
23062
23066
|
|
|
23063
23067
|
// src/components/Timeline/TimelineTimeIndicators.tsx
|
|
23064
|
-
import { useContext as
|
|
23068
|
+
import { useContext as useContext74, useEffect as useEffect69, useMemo as useMemo117, useRef as useRef40 } from "react";
|
|
23065
23069
|
import { Internals as Internals52 } from "remotion";
|
|
23066
23070
|
|
|
23067
23071
|
// src/components/TimeValue.tsx
|
|
@@ -23216,7 +23220,7 @@ var TimelineTimePadding = () => {
|
|
|
23216
23220
|
});
|
|
23217
23221
|
};
|
|
23218
23222
|
var TimelineTimeIndicators = () => {
|
|
23219
|
-
const sliderTrack =
|
|
23223
|
+
const sliderTrack = useContext74(TimelineWidthContext);
|
|
23220
23224
|
const video = Internals52.useVideo();
|
|
23221
23225
|
if (sliderTrack === null) {
|
|
23222
23226
|
return null;
|
|
@@ -23339,15 +23343,15 @@ var TimelineList = ({ timeline }) => {
|
|
|
23339
23343
|
};
|
|
23340
23344
|
|
|
23341
23345
|
// src/components/Timeline/TimelinePinchZoom.tsx
|
|
23342
|
-
import { useCallback as useCallback113, useContext as
|
|
23346
|
+
import { useCallback as useCallback113, useContext as useContext75, useEffect as useEffect70, useRef as useRef42 } from "react";
|
|
23343
23347
|
import { Internals as Internals53 } from "remotion";
|
|
23344
23348
|
var ZOOM_WHEEL_DELTA = 0.06;
|
|
23345
23349
|
var TimelinePinchZoom = () => {
|
|
23346
23350
|
const isVideoComposition = useIsVideoComposition();
|
|
23347
23351
|
const videoConfig = Internals53.useUnsafeVideoConfig();
|
|
23348
|
-
const { canvasContent } =
|
|
23349
|
-
const { zoom, setZoom } =
|
|
23350
|
-
const { editorZoomGestures } =
|
|
23352
|
+
const { canvasContent } = useContext75(Internals53.CompositionManager);
|
|
23353
|
+
const { zoom, setZoom } = useContext75(TimelineZoomCtx);
|
|
23354
|
+
const { editorZoomGestures } = useContext75(EditorZoomGesturesContext);
|
|
23351
23355
|
const zoomRef = useRef42(zoom);
|
|
23352
23356
|
zoomRef.current = zoom;
|
|
23353
23357
|
const pinchBaseZoomRef = useRef42(null);
|
|
@@ -23556,15 +23560,15 @@ var TimelinePinchZoom = () => {
|
|
|
23556
23560
|
};
|
|
23557
23561
|
|
|
23558
23562
|
// src/components/Timeline/TimelinePlayCursorSyncer.tsx
|
|
23559
|
-
import { useContext as
|
|
23563
|
+
import { useContext as useContext76, useEffect as useEffect71 } from "react";
|
|
23560
23564
|
import { Internals as Internals54 } from "remotion";
|
|
23561
23565
|
var lastTimelinePositionWhileScrolling = null;
|
|
23562
23566
|
var TimelinePlayCursorSyncer = () => {
|
|
23563
23567
|
const video = Internals54.useVideo();
|
|
23564
23568
|
const timelineContext = Internals54.useTimelineContext();
|
|
23565
23569
|
const timelinePosition = Internals54.Timeline.useTimelinePosition();
|
|
23566
|
-
const { canvasContent } =
|
|
23567
|
-
const { zoom: zoomMap } =
|
|
23570
|
+
const { canvasContent } = useContext76(Internals54.CompositionManager);
|
|
23571
|
+
const { zoom: zoomMap } = useContext76(TimelineZoomCtx);
|
|
23568
23572
|
const compositionId = canvasContent && canvasContent.type === "composition" ? canvasContent.compositionId : null;
|
|
23569
23573
|
const zoom = compositionId ? zoomMap[compositionId] ?? TIMELINE_MIN_ZOOM : null;
|
|
23570
23574
|
if (zoom && video) {
|
|
@@ -23650,10 +23654,10 @@ var TimelineScrollable = ({ children }) => {
|
|
|
23650
23654
|
};
|
|
23651
23655
|
|
|
23652
23656
|
// src/components/Timeline/TimelineTracks.tsx
|
|
23653
|
-
import { useContext as
|
|
23657
|
+
import { useContext as useContext78, useMemo as useMemo122 } from "react";
|
|
23654
23658
|
|
|
23655
23659
|
// src/components/Timeline/TimelineSequence.tsx
|
|
23656
|
-
import { useContext as
|
|
23660
|
+
import { useContext as useContext77, useMemo as useMemo121 } from "react";
|
|
23657
23661
|
import { Internals as Internals56, useCurrentFrame as useCurrentFrame2 } from "remotion";
|
|
23658
23662
|
|
|
23659
23663
|
// src/helpers/get-timeline-sequence-layout.ts
|
|
@@ -23725,7 +23729,7 @@ var getTimelineSequenceLayout = ({
|
|
|
23725
23729
|
// src/helpers/use-max-media-duration.ts
|
|
23726
23730
|
import { getVideoMetadata as getVideoMetadata2 } from "@remotion/media-utils";
|
|
23727
23731
|
import { ALL_FORMATS as ALL_FORMATS2, Input as Input2, InputDisposedError, UrlSource as UrlSource2 } from "mediabunny";
|
|
23728
|
-
import { useEffect as useEffect72, useState as
|
|
23732
|
+
import { useEffect as useEffect72, useState as useState78 } from "react";
|
|
23729
23733
|
var cache = new Map;
|
|
23730
23734
|
var getSrc = (s) => {
|
|
23731
23735
|
if (s.type === "video") {
|
|
@@ -23738,7 +23742,7 @@ var getSrc = (s) => {
|
|
|
23738
23742
|
};
|
|
23739
23743
|
var useMaxMediaDuration = (s, fps) => {
|
|
23740
23744
|
const src = getSrc(s);
|
|
23741
|
-
const [maxMediaDuration, setMaxMediaDuration] =
|
|
23745
|
+
const [maxMediaDuration, setMaxMediaDuration] = useState78(src ? cache.get(src) ?? null : Infinity);
|
|
23742
23746
|
useEffect72(() => {
|
|
23743
23747
|
if (!src) {
|
|
23744
23748
|
return;
|
|
@@ -23771,9 +23775,16 @@ var useMaxMediaDuration = (s, fps) => {
|
|
|
23771
23775
|
};
|
|
23772
23776
|
|
|
23773
23777
|
// src/components/AudioWaveform.tsx
|
|
23774
|
-
import { useEffect as useEffect73, useMemo as useMemo119, useRef as useRef43, useState as
|
|
23778
|
+
import { useEffect as useEffect73, useMemo as useMemo119, useRef as useRef43, useState as useState79 } from "react";
|
|
23775
23779
|
import { Internals as Internals55 } from "remotion";
|
|
23776
23780
|
|
|
23781
|
+
// src/make-audio-waveform-worker.ts
|
|
23782
|
+
var makeAudioWaveformWorker = () => {
|
|
23783
|
+
return new Worker(new URL("./audio-waveform-worker.mjs", import.meta.url), {
|
|
23784
|
+
type: "module"
|
|
23785
|
+
});
|
|
23786
|
+
};
|
|
23787
|
+
|
|
23777
23788
|
// src/components/parse-color.ts
|
|
23778
23789
|
var colorCache = new Map;
|
|
23779
23790
|
var parseColor = (color) => {
|
|
@@ -23849,12 +23860,107 @@ var drawBars = (canvas, peaks, color, volume, width) => {
|
|
|
23849
23860
|
|
|
23850
23861
|
// src/components/load-waveform-peaks.ts
|
|
23851
23862
|
import { ALL_FORMATS as ALL_FORMATS3, AudioSampleSink, Input as Input3, UrlSource as UrlSource3 } from "mediabunny";
|
|
23863
|
+
|
|
23864
|
+
// src/components/waveform-peak-processor.ts
|
|
23865
|
+
var emitWaveformProgress = ({
|
|
23866
|
+
completedPeaks,
|
|
23867
|
+
final,
|
|
23868
|
+
onProgress,
|
|
23869
|
+
peaks,
|
|
23870
|
+
totalPeaks
|
|
23871
|
+
}) => {
|
|
23872
|
+
onProgress?.({
|
|
23873
|
+
peaks,
|
|
23874
|
+
completedPeaks,
|
|
23875
|
+
totalPeaks,
|
|
23876
|
+
final
|
|
23877
|
+
});
|
|
23878
|
+
};
|
|
23879
|
+
var createWaveformPeakProcessor = ({
|
|
23880
|
+
totalPeaks,
|
|
23881
|
+
samplesPerPeak,
|
|
23882
|
+
onProgress,
|
|
23883
|
+
progressIntervalInMs,
|
|
23884
|
+
now
|
|
23885
|
+
}) => {
|
|
23886
|
+
const peaks = new Float32Array(totalPeaks);
|
|
23887
|
+
let peakIndex = 0;
|
|
23888
|
+
let peakMax = 0;
|
|
23889
|
+
let sampleInPeak = 0;
|
|
23890
|
+
let lastProgressAt = 0;
|
|
23891
|
+
let lastProgressPeak = 0;
|
|
23892
|
+
const emitProgress = (force) => {
|
|
23893
|
+
const timestamp = now();
|
|
23894
|
+
if (!force && peakIndex === lastProgressPeak && sampleInPeak === 0) {
|
|
23895
|
+
return;
|
|
23896
|
+
}
|
|
23897
|
+
if (!force && timestamp - lastProgressAt < progressIntervalInMs) {
|
|
23898
|
+
return;
|
|
23899
|
+
}
|
|
23900
|
+
lastProgressAt = timestamp;
|
|
23901
|
+
lastProgressPeak = peakIndex;
|
|
23902
|
+
emitWaveformProgress({
|
|
23903
|
+
peaks,
|
|
23904
|
+
completedPeaks: peakIndex,
|
|
23905
|
+
totalPeaks,
|
|
23906
|
+
final: force,
|
|
23907
|
+
onProgress
|
|
23908
|
+
});
|
|
23909
|
+
};
|
|
23910
|
+
return {
|
|
23911
|
+
peaks,
|
|
23912
|
+
processSampleChunk: (floats, channels) => {
|
|
23913
|
+
const frameCount = Math.floor(floats.length / Math.max(1, channels));
|
|
23914
|
+
for (let frame2 = 0;frame2 < frameCount; frame2++) {
|
|
23915
|
+
let framePeak = 0;
|
|
23916
|
+
for (let channel = 0;channel < channels; channel++) {
|
|
23917
|
+
const sampleIndex = frame2 * channels + channel;
|
|
23918
|
+
const abs = Math.abs(floats[sampleIndex] ?? 0);
|
|
23919
|
+
if (abs > framePeak) {
|
|
23920
|
+
framePeak = abs;
|
|
23921
|
+
}
|
|
23922
|
+
}
|
|
23923
|
+
if (framePeak > peakMax) {
|
|
23924
|
+
peakMax = framePeak;
|
|
23925
|
+
}
|
|
23926
|
+
sampleInPeak++;
|
|
23927
|
+
if (sampleInPeak >= samplesPerPeak) {
|
|
23928
|
+
if (peakIndex < totalPeaks) {
|
|
23929
|
+
peaks[peakIndex] = peakMax;
|
|
23930
|
+
}
|
|
23931
|
+
peakIndex++;
|
|
23932
|
+
peakMax = 0;
|
|
23933
|
+
sampleInPeak = 0;
|
|
23934
|
+
}
|
|
23935
|
+
}
|
|
23936
|
+
emitProgress(false);
|
|
23937
|
+
},
|
|
23938
|
+
finalize: () => {
|
|
23939
|
+
if (sampleInPeak > 0 && peakIndex < totalPeaks) {
|
|
23940
|
+
peaks[peakIndex] = peakMax;
|
|
23941
|
+
peakIndex++;
|
|
23942
|
+
}
|
|
23943
|
+
emitProgress(true);
|
|
23944
|
+
}
|
|
23945
|
+
};
|
|
23946
|
+
};
|
|
23947
|
+
|
|
23948
|
+
// src/components/load-waveform-peaks.ts
|
|
23852
23949
|
var TARGET_SAMPLE_RATE = 100;
|
|
23950
|
+
var DEFAULT_PROGRESS_INTERVAL_IN_MS = 50;
|
|
23853
23951
|
var peaksCache = new Map;
|
|
23854
|
-
async function loadWaveformPeaks(url, signal) {
|
|
23952
|
+
async function loadWaveformPeaks(url, signal, options) {
|
|
23855
23953
|
const cached = peaksCache.get(url);
|
|
23856
|
-
if (cached)
|
|
23954
|
+
if (cached) {
|
|
23955
|
+
emitWaveformProgress({
|
|
23956
|
+
peaks: cached,
|
|
23957
|
+
completedPeaks: cached.length,
|
|
23958
|
+
totalPeaks: cached.length,
|
|
23959
|
+
final: true,
|
|
23960
|
+
onProgress: options?.onProgress
|
|
23961
|
+
});
|
|
23857
23962
|
return cached;
|
|
23963
|
+
}
|
|
23858
23964
|
const input2 = new Input3({
|
|
23859
23965
|
formats: ALL_FORMATS3,
|
|
23860
23966
|
source: new UrlSource3(url)
|
|
@@ -23867,12 +23973,15 @@ async function loadWaveformPeaks(url, signal) {
|
|
|
23867
23973
|
const { sampleRate } = audioTrack;
|
|
23868
23974
|
const durationInSeconds = await audioTrack.computeDuration();
|
|
23869
23975
|
const totalPeaks = Math.ceil(durationInSeconds * TARGET_SAMPLE_RATE);
|
|
23870
|
-
const samplesPerPeak = Math.floor(sampleRate / TARGET_SAMPLE_RATE);
|
|
23871
|
-
const peaks = new Float32Array(totalPeaks);
|
|
23872
|
-
let peakIndex = 0;
|
|
23873
|
-
let peakMax = 0;
|
|
23874
|
-
let sampleInPeak = 0;
|
|
23976
|
+
const samplesPerPeak = Math.max(1, Math.floor(sampleRate / TARGET_SAMPLE_RATE));
|
|
23875
23977
|
const sink = new AudioSampleSink(audioTrack);
|
|
23978
|
+
const processor = createWaveformPeakProcessor({
|
|
23979
|
+
totalPeaks,
|
|
23980
|
+
samplesPerPeak,
|
|
23981
|
+
onProgress: options?.onProgress,
|
|
23982
|
+
progressIntervalInMs: options?.progressIntervalInMs ?? DEFAULT_PROGRESS_INTERVAL_IN_MS,
|
|
23983
|
+
now: () => Date.now()
|
|
23984
|
+
});
|
|
23876
23985
|
for await (const sample of sink.samples()) {
|
|
23877
23986
|
if (signal.aborted) {
|
|
23878
23987
|
sample.close();
|
|
@@ -23884,25 +23993,12 @@ async function loadWaveformPeaks(url, signal) {
|
|
|
23884
23993
|
});
|
|
23885
23994
|
const floats = new Float32Array(bytesNeeded / 4);
|
|
23886
23995
|
sample.copyTo(floats, { format: "f32", planeIndex: 0 });
|
|
23996
|
+
const channels = Math.max(1, sample.numberOfChannels);
|
|
23887
23997
|
sample.close();
|
|
23888
|
-
|
|
23889
|
-
const abs = Math.abs(floats[i]);
|
|
23890
|
-
if (abs > peakMax)
|
|
23891
|
-
peakMax = abs;
|
|
23892
|
-
sampleInPeak++;
|
|
23893
|
-
if (sampleInPeak >= samplesPerPeak) {
|
|
23894
|
-
if (peakIndex < totalPeaks) {
|
|
23895
|
-
peaks[peakIndex] = peakMax;
|
|
23896
|
-
}
|
|
23897
|
-
peakIndex++;
|
|
23898
|
-
peakMax = 0;
|
|
23899
|
-
sampleInPeak = 0;
|
|
23900
|
-
}
|
|
23901
|
-
}
|
|
23902
|
-
}
|
|
23903
|
-
if (sampleInPeak > 0 && peakIndex < totalPeaks) {
|
|
23904
|
-
peaks[peakIndex] = peakMax;
|
|
23998
|
+
processor.processSampleChunk(floats, channels);
|
|
23905
23999
|
}
|
|
24000
|
+
processor.finalize();
|
|
24001
|
+
const { peaks } = processor;
|
|
23906
24002
|
peaksCache.set(url, peaks);
|
|
23907
24003
|
return peaks;
|
|
23908
24004
|
} finally {
|
|
@@ -23910,8 +24006,50 @@ async function loadWaveformPeaks(url, signal) {
|
|
|
23910
24006
|
}
|
|
23911
24007
|
}
|
|
23912
24008
|
|
|
24009
|
+
// src/components/looped-media-timeline.ts
|
|
24010
|
+
var shouldTileLoopDisplay = (loopDisplay) => {
|
|
24011
|
+
return loopDisplay !== undefined && loopDisplay.numberOfTimes > 1;
|
|
24012
|
+
};
|
|
24013
|
+
var getLoopDisplayWidth = ({
|
|
24014
|
+
visualizationWidth,
|
|
24015
|
+
loopDisplay
|
|
24016
|
+
}) => {
|
|
24017
|
+
if (!shouldTileLoopDisplay(loopDisplay)) {
|
|
24018
|
+
return visualizationWidth;
|
|
24019
|
+
}
|
|
24020
|
+
return visualizationWidth / loopDisplay.numberOfTimes;
|
|
24021
|
+
};
|
|
24022
|
+
|
|
24023
|
+
// src/components/slice-waveform-peaks.ts
|
|
24024
|
+
var sliceWaveformPeaks = ({
|
|
24025
|
+
durationInFrames,
|
|
24026
|
+
fps,
|
|
24027
|
+
peaks,
|
|
24028
|
+
playbackRate,
|
|
24029
|
+
startFrom
|
|
24030
|
+
}) => {
|
|
24031
|
+
if (peaks.length === 0) {
|
|
24032
|
+
return peaks;
|
|
24033
|
+
}
|
|
24034
|
+
const startTimeInSeconds = startFrom / fps;
|
|
24035
|
+
const durationInSeconds = durationInFrames / fps * playbackRate;
|
|
24036
|
+
const startPeakIndex = Math.floor(startTimeInSeconds * TARGET_SAMPLE_RATE);
|
|
24037
|
+
const endPeakIndex = Math.ceil((startTimeInSeconds + durationInSeconds) * TARGET_SAMPLE_RATE);
|
|
24038
|
+
return peaks.subarray(Math.max(0, startPeakIndex), Math.min(peaks.length, endPeakIndex));
|
|
24039
|
+
};
|
|
24040
|
+
|
|
23913
24041
|
// src/components/AudioWaveform.tsx
|
|
23914
24042
|
import { jsx as jsx212, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
24043
|
+
var EMPTY_PEAKS = new Float32Array(0);
|
|
24044
|
+
var canRetryCanvasTransfer = (err) => {
|
|
24045
|
+
return err instanceof DOMException && err.name === "InvalidStateError";
|
|
24046
|
+
};
|
|
24047
|
+
var canUseAudioWaveformWorker = () => {
|
|
24048
|
+
if (typeof Worker === "undefined" || typeof OffscreenCanvas === "undefined" || typeof HTMLCanvasElement === "undefined") {
|
|
24049
|
+
return false;
|
|
24050
|
+
}
|
|
24051
|
+
return "transferControlToOffscreen" in HTMLCanvasElement.prototype;
|
|
24052
|
+
};
|
|
23915
24053
|
var container43 = {
|
|
23916
24054
|
display: "flex",
|
|
23917
24055
|
flexDirection: "row",
|
|
@@ -23930,11 +24068,41 @@ var errorMessage = {
|
|
|
23930
24068
|
opacity: 0.75
|
|
23931
24069
|
};
|
|
23932
24070
|
var waveformCanvasStyle = {
|
|
23933
|
-
pointerEvents: "none"
|
|
24071
|
+
pointerEvents: "none",
|
|
24072
|
+
width: "100%",
|
|
24073
|
+
height: "100%"
|
|
23934
24074
|
};
|
|
23935
24075
|
var volumeCanvasStyle = {
|
|
23936
24076
|
position: "absolute"
|
|
23937
24077
|
};
|
|
24078
|
+
var drawLoopedWaveform = ({
|
|
24079
|
+
canvas,
|
|
24080
|
+
peaks,
|
|
24081
|
+
volume,
|
|
24082
|
+
visualizationWidth,
|
|
24083
|
+
loopWidth
|
|
24084
|
+
}) => {
|
|
24085
|
+
const h = canvas.height;
|
|
24086
|
+
const w = Math.ceil(visualizationWidth);
|
|
24087
|
+
const targetCanvas = document.createElement("canvas");
|
|
24088
|
+
targetCanvas.width = Math.max(1, Math.ceil(loopWidth));
|
|
24089
|
+
targetCanvas.height = h;
|
|
24090
|
+
drawBars(targetCanvas, peaks, "rgba(255, 255, 255, 0.6)", volume, targetCanvas.width);
|
|
24091
|
+
canvas.width = w;
|
|
24092
|
+
canvas.height = h;
|
|
24093
|
+
const ctx = canvas.getContext("2d");
|
|
24094
|
+
if (!ctx) {
|
|
24095
|
+
throw new Error("Failed to get canvas context");
|
|
24096
|
+
}
|
|
24097
|
+
const pattern = ctx.createPattern(targetCanvas, "repeat-x");
|
|
24098
|
+
if (!pattern) {
|
|
24099
|
+
return;
|
|
24100
|
+
}
|
|
24101
|
+
pattern.setTransform(new DOMMatrix().scaleSelf(loopWidth / targetCanvas.width, 1));
|
|
24102
|
+
ctx.clearRect(0, 0, w, h);
|
|
24103
|
+
ctx.fillStyle = pattern;
|
|
24104
|
+
ctx.fillRect(0, 0, w, h);
|
|
24105
|
+
};
|
|
23938
24106
|
var AudioWaveform = ({
|
|
23939
24107
|
src,
|
|
23940
24108
|
startFrom,
|
|
@@ -23942,10 +24110,13 @@ var AudioWaveform = ({
|
|
|
23942
24110
|
visualizationWidth,
|
|
23943
24111
|
volume,
|
|
23944
24112
|
doesVolumeChange,
|
|
23945
|
-
playbackRate
|
|
24113
|
+
playbackRate,
|
|
24114
|
+
loopDisplay
|
|
23946
24115
|
}) => {
|
|
23947
|
-
const [peaks, setPeaks] =
|
|
23948
|
-
const [error, setError] =
|
|
24116
|
+
const [peaks, setPeaks] = useState79(null);
|
|
24117
|
+
const [error, setError] = useState79(null);
|
|
24118
|
+
const [waveformCanvasKey, setWaveformCanvasKey] = useState79(0);
|
|
24119
|
+
const canUseWorkerPath = useMemo119(() => canUseAudioWaveformWorker(), []);
|
|
23949
24120
|
const vidConf = Internals55.useUnsafeVideoConfig();
|
|
23950
24121
|
if (vidConf === null) {
|
|
23951
24122
|
throw new Error("Expected video config");
|
|
@@ -23953,8 +24124,15 @@ var AudioWaveform = ({
|
|
|
23953
24124
|
const containerRef = useRef43(null);
|
|
23954
24125
|
const waveformCanvas = useRef43(null);
|
|
23955
24126
|
const volumeCanvas = useRef43(null);
|
|
24127
|
+
const waveformWorker = useRef43(null);
|
|
24128
|
+
const hasTransferredCanvas = useRef43(false);
|
|
24129
|
+
const latestRequestId = useRef43(0);
|
|
23956
24130
|
useEffect73(() => {
|
|
24131
|
+
if (canUseWorkerPath) {
|
|
24132
|
+
return;
|
|
24133
|
+
}
|
|
23957
24134
|
const controller = new AbortController;
|
|
24135
|
+
setPeaks(null);
|
|
23958
24136
|
setError(null);
|
|
23959
24137
|
loadWaveformPeaks(src, controller.signal).then((p) => {
|
|
23960
24138
|
if (!controller.signal.aborted) {
|
|
@@ -23966,30 +24144,127 @@ var AudioWaveform = ({
|
|
|
23966
24144
|
}
|
|
23967
24145
|
});
|
|
23968
24146
|
return () => controller.abort();
|
|
23969
|
-
}, [src]);
|
|
24147
|
+
}, [canUseWorkerPath, src]);
|
|
24148
|
+
useEffect73(() => {
|
|
24149
|
+
if (!canUseWorkerPath) {
|
|
24150
|
+
return;
|
|
24151
|
+
}
|
|
24152
|
+
const canvasElement = waveformCanvas.current;
|
|
24153
|
+
if (!canvasElement || hasTransferredCanvas.current) {
|
|
24154
|
+
return;
|
|
24155
|
+
}
|
|
24156
|
+
const worker = makeAudioWaveformWorker();
|
|
24157
|
+
waveformWorker.current = worker;
|
|
24158
|
+
worker.addEventListener("message", (event) => {
|
|
24159
|
+
if (event.data.type === "error") {
|
|
24160
|
+
if (event.data.requestId !== latestRequestId.current) {
|
|
24161
|
+
return;
|
|
24162
|
+
}
|
|
24163
|
+
setError(new Error(event.data.message));
|
|
24164
|
+
}
|
|
24165
|
+
});
|
|
24166
|
+
let offscreen;
|
|
24167
|
+
try {
|
|
24168
|
+
offscreen = canvasElement.transferControlToOffscreen();
|
|
24169
|
+
} catch (err) {
|
|
24170
|
+
worker.terminate();
|
|
24171
|
+
waveformWorker.current = null;
|
|
24172
|
+
if (canRetryCanvasTransfer(err)) {
|
|
24173
|
+
setWaveformCanvasKey((key4) => key4 + 1);
|
|
24174
|
+
return;
|
|
24175
|
+
}
|
|
24176
|
+
throw err;
|
|
24177
|
+
}
|
|
24178
|
+
hasTransferredCanvas.current = true;
|
|
24179
|
+
worker.postMessage({ type: "init", canvas: offscreen }, [offscreen]);
|
|
24180
|
+
return () => {
|
|
24181
|
+
worker.postMessage({ type: "dispose" });
|
|
24182
|
+
worker.terminate();
|
|
24183
|
+
waveformWorker.current = null;
|
|
24184
|
+
hasTransferredCanvas.current = false;
|
|
24185
|
+
};
|
|
24186
|
+
}, [canUseWorkerPath, waveformCanvasKey]);
|
|
23970
24187
|
const portionPeaks = useMemo119(() => {
|
|
23971
|
-
if (
|
|
24188
|
+
if (canUseWorkerPath || !peaks) {
|
|
23972
24189
|
return null;
|
|
23973
24190
|
}
|
|
23974
|
-
|
|
23975
|
-
|
|
23976
|
-
|
|
23977
|
-
|
|
23978
|
-
|
|
23979
|
-
|
|
24191
|
+
return sliceWaveformPeaks({
|
|
24192
|
+
durationInFrames: shouldTileLoopDisplay(loopDisplay) ? loopDisplay.durationInFrames : durationInFrames,
|
|
24193
|
+
fps: vidConf.fps,
|
|
24194
|
+
peaks,
|
|
24195
|
+
playbackRate,
|
|
24196
|
+
startFrom
|
|
24197
|
+
});
|
|
24198
|
+
}, [
|
|
24199
|
+
canUseWorkerPath,
|
|
24200
|
+
durationInFrames,
|
|
24201
|
+
loopDisplay,
|
|
24202
|
+
peaks,
|
|
24203
|
+
playbackRate,
|
|
24204
|
+
startFrom,
|
|
24205
|
+
vidConf.fps
|
|
24206
|
+
]);
|
|
23980
24207
|
useEffect73(() => {
|
|
23981
24208
|
const { current: canvasElement } = waveformCanvas;
|
|
23982
24209
|
const { current: containerElement } = containerRef;
|
|
23983
|
-
if (!canvasElement || !containerElement
|
|
24210
|
+
if (!canvasElement || !containerElement) {
|
|
23984
24211
|
return;
|
|
23985
24212
|
}
|
|
23986
24213
|
const h = containerElement.clientHeight;
|
|
23987
24214
|
const w = Math.ceil(visualizationWidth);
|
|
24215
|
+
const vol = typeof volume === "number" ? volume : 1;
|
|
24216
|
+
if (canUseWorkerPath) {
|
|
24217
|
+
const worker = waveformWorker.current;
|
|
24218
|
+
if (!worker || !hasTransferredCanvas.current) {
|
|
24219
|
+
return;
|
|
24220
|
+
}
|
|
24221
|
+
latestRequestId.current += 1;
|
|
24222
|
+
setError(null);
|
|
24223
|
+
const message = {
|
|
24224
|
+
type: "render",
|
|
24225
|
+
requestId: latestRequestId.current,
|
|
24226
|
+
src,
|
|
24227
|
+
width: w,
|
|
24228
|
+
height: h,
|
|
24229
|
+
volume: vol,
|
|
24230
|
+
startFrom,
|
|
24231
|
+
durationInFrames,
|
|
24232
|
+
fps: vidConf.fps,
|
|
24233
|
+
playbackRate,
|
|
24234
|
+
loopDisplay
|
|
24235
|
+
};
|
|
24236
|
+
worker.postMessage(message);
|
|
24237
|
+
return;
|
|
24238
|
+
}
|
|
23988
24239
|
canvasElement.width = w;
|
|
23989
24240
|
canvasElement.height = h;
|
|
23990
|
-
|
|
23991
|
-
|
|
23992
|
-
|
|
24241
|
+
if (shouldTileLoopDisplay(loopDisplay)) {
|
|
24242
|
+
drawLoopedWaveform({
|
|
24243
|
+
canvas: canvasElement,
|
|
24244
|
+
peaks: portionPeaks ?? EMPTY_PEAKS,
|
|
24245
|
+
volume: vol,
|
|
24246
|
+
visualizationWidth,
|
|
24247
|
+
loopWidth: getLoopDisplayWidth({
|
|
24248
|
+
visualizationWidth,
|
|
24249
|
+
loopDisplay
|
|
24250
|
+
})
|
|
24251
|
+
});
|
|
24252
|
+
} else {
|
|
24253
|
+
drawBars(canvasElement, portionPeaks ?? EMPTY_PEAKS, "rgba(255, 255, 255, 0.6)", vol, w);
|
|
24254
|
+
}
|
|
24255
|
+
}, [
|
|
24256
|
+
canUseWorkerPath,
|
|
24257
|
+
durationInFrames,
|
|
24258
|
+
loopDisplay,
|
|
24259
|
+
playbackRate,
|
|
24260
|
+
portionPeaks,
|
|
24261
|
+
src,
|
|
24262
|
+
startFrom,
|
|
24263
|
+
vidConf.fps,
|
|
24264
|
+
visualizationWidth,
|
|
24265
|
+
volume,
|
|
24266
|
+
waveformCanvasKey
|
|
24267
|
+
]);
|
|
23993
24268
|
useEffect73(() => {
|
|
23994
24269
|
const { current: volumeCanvasElement } = volumeCanvas;
|
|
23995
24270
|
const { current: containerElement } = containerRef;
|
|
@@ -24031,7 +24306,7 @@ var AudioWaveform = ({
|
|
|
24031
24306
|
})
|
|
24032
24307
|
});
|
|
24033
24308
|
}
|
|
24034
|
-
if (!peaks) {
|
|
24309
|
+
if (!canUseWorkerPath && !peaks) {
|
|
24035
24310
|
return null;
|
|
24036
24311
|
}
|
|
24037
24312
|
return /* @__PURE__ */ jsxs102("div", {
|
|
@@ -24041,7 +24316,7 @@ var AudioWaveform = ({
|
|
|
24041
24316
|
/* @__PURE__ */ jsx212("canvas", {
|
|
24042
24317
|
ref: waveformCanvas,
|
|
24043
24318
|
style: waveformCanvasStyle
|
|
24044
|
-
}),
|
|
24319
|
+
}, waveformCanvasKey),
|
|
24045
24320
|
/* @__PURE__ */ jsx212("canvas", {
|
|
24046
24321
|
ref: volumeCanvas,
|
|
24047
24322
|
style: volumeCanvasStyle
|
|
@@ -24064,7 +24339,8 @@ var width = {
|
|
|
24064
24339
|
position: "relative"
|
|
24065
24340
|
};
|
|
24066
24341
|
var icon4 = {
|
|
24067
|
-
height: 12
|
|
24342
|
+
height: 12,
|
|
24343
|
+
filter: "drop-shadow(0 0 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8))"
|
|
24068
24344
|
};
|
|
24069
24345
|
var Icon = () => /* @__PURE__ */ jsx213("svg", {
|
|
24070
24346
|
viewBox: "0 0 512 512",
|
|
@@ -24074,44 +24350,23 @@ var Icon = () => /* @__PURE__ */ jsx213("svg", {
|
|
|
24074
24350
|
d: "M512 256c0 88.224-71.775 160-160 160H170.067l34.512 32.419c9.875 9.276 10.119 24.883.539 34.464l-10.775 10.775c-9.373 9.372-24.568 9.372-33.941 0l-92.686-92.686c-9.373-9.373-9.373-24.568 0-33.941l92.686-92.686c9.373-9.373 24.568-9.373 33.941 0l10.775 10.775c9.581 9.581 9.337 25.187-.539 34.464L170.067 352H352c52.935 0 96-43.065 96-96 0-13.958-2.996-27.228-8.376-39.204-4.061-9.039-2.284-19.626 4.723-26.633l12.183-12.183c11.499-11.499 30.965-8.526 38.312 5.982C505.814 205.624 512 230.103 512 256zM72.376 295.204C66.996 283.228 64 269.958 64 256c0-52.935 43.065-96 96-96h181.933l-34.512 32.419c-9.875 9.276-10.119 24.883-.539 34.464l10.775 10.775c9.373 9.372 24.568 9.372 33.941 0l92.686-92.686c9.373-9.373 9.373-24.568 0-33.941l-92.686-92.686c-9.373-9.373-24.568-9.373-33.941 0L306.882 29.12c-9.581 9.581-9.337 25.187.539 34.464L341.933 96H160C71.775 96 0 167.776 0 256c0 25.897 6.186 50.376 17.157 72.039 7.347 14.508 26.813 17.481 38.312 5.982l12.183-12.183c7.008-7.008 8.786-17.595 4.724-26.634z"
|
|
24075
24351
|
})
|
|
24076
24352
|
});
|
|
24077
|
-
var
|
|
24078
|
-
|
|
24079
|
-
height: 2,
|
|
24080
|
-
width: 1,
|
|
24081
|
-
background: LIGHT_COLOR
|
|
24082
|
-
};
|
|
24083
|
-
var bottomLine = {
|
|
24084
|
-
top: 0,
|
|
24085
|
-
height: 2,
|
|
24353
|
+
var verticalLine = {
|
|
24354
|
+
height: "100%",
|
|
24086
24355
|
width: 1,
|
|
24087
|
-
background:
|
|
24088
|
-
};
|
|
24089
|
-
var topContainer = {
|
|
24090
|
-
justifyContent: "flex-start",
|
|
24091
|
-
alignItems: "center"
|
|
24356
|
+
background: "rgb(255,255,255, 0.5)"
|
|
24092
24357
|
};
|
|
24093
24358
|
var centerContainer = {
|
|
24094
24359
|
justifyContent: "center",
|
|
24095
24360
|
alignItems: "center"
|
|
24096
24361
|
};
|
|
24097
|
-
var bottomContainer = {
|
|
24098
|
-
justifyContent: "flex-end",
|
|
24099
|
-
alignItems: "center"
|
|
24100
|
-
};
|
|
24101
24362
|
var LoopedIndicator = () => {
|
|
24102
24363
|
return /* @__PURE__ */ jsxs103("div", {
|
|
24103
24364
|
style: width,
|
|
24104
24365
|
children: [
|
|
24105
24366
|
/* @__PURE__ */ jsx213(AbsoluteFill5, {
|
|
24106
|
-
style:
|
|
24107
|
-
children: /* @__PURE__ */ jsx213("div", {
|
|
24108
|
-
style: topLine
|
|
24109
|
-
})
|
|
24110
|
-
}),
|
|
24111
|
-
/* @__PURE__ */ jsx213(AbsoluteFill5, {
|
|
24112
|
-
style: bottomContainer,
|
|
24367
|
+
style: centerContainer,
|
|
24113
24368
|
children: /* @__PURE__ */ jsx213("div", {
|
|
24114
|
-
style:
|
|
24369
|
+
style: verticalLine
|
|
24115
24370
|
})
|
|
24116
24371
|
}),
|
|
24117
24372
|
/* @__PURE__ */ jsx213(AbsoluteFill5, {
|
|
@@ -24225,7 +24480,7 @@ var TimelineSequenceFrame = ({ roundedFrame, premounted, postmounted }) => {
|
|
|
24225
24480
|
};
|
|
24226
24481
|
|
|
24227
24482
|
// src/components/Timeline/TimelineVideoInfo.tsx
|
|
24228
|
-
import { useEffect as useEffect75, useMemo as useMemo120, useRef as useRef45, useState as
|
|
24483
|
+
import { useEffect as useEffect75, useMemo as useMemo120, useRef as useRef45, useState as useState80 } from "react";
|
|
24229
24484
|
import { useVideoConfig as useVideoConfig5 } from "remotion";
|
|
24230
24485
|
|
|
24231
24486
|
// src/helpers/extract-frames.ts
|
|
@@ -24583,11 +24838,12 @@ var TimelineVideoInfo = ({
|
|
|
24583
24838
|
volume,
|
|
24584
24839
|
doesVolumeChange,
|
|
24585
24840
|
premountWidth,
|
|
24586
|
-
postmountWidth
|
|
24841
|
+
postmountWidth,
|
|
24842
|
+
loopDisplay
|
|
24587
24843
|
}) => {
|
|
24588
24844
|
const { fps } = useVideoConfig5();
|
|
24589
24845
|
const ref2 = useRef45(null);
|
|
24590
|
-
const [error, setError] =
|
|
24846
|
+
const [error, setError] = useState80(null);
|
|
24591
24847
|
const aspectRatio = useRef45(getAspectRatioFromCache(src));
|
|
24592
24848
|
useEffect75(() => {
|
|
24593
24849
|
if (error) {
|
|
@@ -24606,25 +24862,54 @@ var TimelineVideoInfo = ({
|
|
|
24606
24862
|
return;
|
|
24607
24863
|
}
|
|
24608
24864
|
current.appendChild(canvas);
|
|
24865
|
+
const loopWidth = getLoopDisplayWidth({
|
|
24866
|
+
visualizationWidth: naturalWidth,
|
|
24867
|
+
loopDisplay
|
|
24868
|
+
});
|
|
24869
|
+
const shouldRepeatVideo = shouldTileLoopDisplay(loopDisplay);
|
|
24870
|
+
const targetCanvas = shouldRepeatVideo ? document.createElement("canvas") : canvas;
|
|
24871
|
+
targetCanvas.width = shouldRepeatVideo ? Math.max(1, Math.ceil(loopWidth)) : canvas.width;
|
|
24872
|
+
targetCanvas.height = canvas.height;
|
|
24873
|
+
const targetCtx = shouldRepeatVideo ? targetCanvas.getContext("2d") : ctx;
|
|
24874
|
+
if (!targetCtx) {
|
|
24875
|
+
current.removeChild(canvas);
|
|
24876
|
+
return;
|
|
24877
|
+
}
|
|
24878
|
+
const repeatTarget = () => {
|
|
24879
|
+
if (!shouldRepeatVideo) {
|
|
24880
|
+
return;
|
|
24881
|
+
}
|
|
24882
|
+
const pattern = ctx.createPattern(targetCanvas, "repeat-x");
|
|
24883
|
+
if (!pattern) {
|
|
24884
|
+
return;
|
|
24885
|
+
}
|
|
24886
|
+
pattern.setTransform(new DOMMatrix().scaleSelf(loopWidth / targetCanvas.width, 1));
|
|
24887
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
24888
|
+
ctx.fillStyle = pattern;
|
|
24889
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
24890
|
+
};
|
|
24609
24891
|
const filledSlots = new Map;
|
|
24610
24892
|
const fromSeconds = trimBefore / fps;
|
|
24611
|
-
const
|
|
24893
|
+
const visibleDurationInFrames = shouldRepeatVideo && loopDisplay ? loopDisplay.durationInFrames : durationInFrames;
|
|
24894
|
+
const toSeconds = fromSeconds + visibleDurationInFrames * playbackRate / fps;
|
|
24895
|
+
const targetWidth = shouldRepeatVideo ? targetCanvas.width : naturalWidth;
|
|
24612
24896
|
if (aspectRatio.current !== null) {
|
|
24613
24897
|
ensureSlots({
|
|
24614
24898
|
filledSlots,
|
|
24615
|
-
naturalWidth,
|
|
24899
|
+
naturalWidth: targetWidth,
|
|
24616
24900
|
fromSeconds,
|
|
24617
24901
|
toSeconds,
|
|
24618
24902
|
aspectRatio: aspectRatio.current
|
|
24619
24903
|
});
|
|
24620
24904
|
fillWithCachedFrames({
|
|
24621
|
-
ctx,
|
|
24622
|
-
naturalWidth,
|
|
24905
|
+
ctx: targetCtx,
|
|
24906
|
+
naturalWidth: targetWidth,
|
|
24623
24907
|
filledSlots,
|
|
24624
24908
|
src,
|
|
24625
24909
|
segmentDuration: toSeconds - fromSeconds,
|
|
24626
24910
|
fromSeconds
|
|
24627
24911
|
});
|
|
24912
|
+
repeatTarget();
|
|
24628
24913
|
const unfilled = Array.from(filledSlots.keys()).filter((timestamp) => !filledSlots.get(timestamp));
|
|
24629
24914
|
if (unfilled.length === 0) {
|
|
24630
24915
|
return () => {
|
|
@@ -24642,7 +24927,7 @@ var TimelineVideoInfo = ({
|
|
|
24642
24927
|
filledSlots,
|
|
24643
24928
|
fromSeconds,
|
|
24644
24929
|
toSeconds,
|
|
24645
|
-
naturalWidth,
|
|
24930
|
+
naturalWidth: targetWidth,
|
|
24646
24931
|
aspectRatio: aspectRatio.current
|
|
24647
24932
|
});
|
|
24648
24933
|
return Array.from(filledSlots.keys()).map((timestamp) => timestamp / WEBCODECS_TIMESCALE);
|
|
@@ -24670,17 +24955,18 @@ var TimelineVideoInfo = ({
|
|
|
24670
24955
|
filledSlots,
|
|
24671
24956
|
fromSeconds,
|
|
24672
24957
|
toSeconds,
|
|
24673
|
-
naturalWidth,
|
|
24958
|
+
naturalWidth: targetWidth,
|
|
24674
24959
|
aspectRatio: aspectRatio.current
|
|
24675
24960
|
});
|
|
24676
24961
|
fillFrameWhereItFits({
|
|
24677
|
-
ctx,
|
|
24962
|
+
ctx: targetCtx,
|
|
24678
24963
|
filledSlots,
|
|
24679
|
-
visualizationWidth:
|
|
24964
|
+
visualizationWidth: targetWidth,
|
|
24680
24965
|
frame: transformed,
|
|
24681
24966
|
segmentDuration: toSeconds - fromSeconds,
|
|
24682
24967
|
fromSeconds
|
|
24683
24968
|
});
|
|
24969
|
+
repeatTarget();
|
|
24684
24970
|
} catch (e) {
|
|
24685
24971
|
if (frame2) {
|
|
24686
24972
|
frame2.close();
|
|
@@ -24696,13 +24982,14 @@ var TimelineVideoInfo = ({
|
|
|
24696
24982
|
return;
|
|
24697
24983
|
}
|
|
24698
24984
|
fillWithCachedFrames({
|
|
24699
|
-
ctx,
|
|
24700
|
-
naturalWidth,
|
|
24985
|
+
ctx: targetCtx,
|
|
24986
|
+
naturalWidth: targetWidth,
|
|
24701
24987
|
filledSlots,
|
|
24702
24988
|
src,
|
|
24703
24989
|
segmentDuration: toSeconds - fromSeconds,
|
|
24704
24990
|
fromSeconds
|
|
24705
24991
|
});
|
|
24992
|
+
repeatTarget();
|
|
24706
24993
|
}).catch((e) => {
|
|
24707
24994
|
setError(e);
|
|
24708
24995
|
});
|
|
@@ -24714,6 +25001,7 @@ var TimelineVideoInfo = ({
|
|
|
24714
25001
|
durationInFrames,
|
|
24715
25002
|
error,
|
|
24716
25003
|
fps,
|
|
25004
|
+
loopDisplay,
|
|
24717
25005
|
naturalWidth,
|
|
24718
25006
|
playbackRate,
|
|
24719
25007
|
src,
|
|
@@ -24745,7 +25033,8 @@ var TimelineVideoInfo = ({
|
|
|
24745
25033
|
durationInFrames,
|
|
24746
25034
|
volume,
|
|
24747
25035
|
doesVolumeChange,
|
|
24748
|
-
playbackRate
|
|
25036
|
+
playbackRate,
|
|
25037
|
+
loopDisplay
|
|
24749
25038
|
})
|
|
24750
25039
|
})
|
|
24751
25040
|
]
|
|
@@ -24758,7 +25047,7 @@ var AUDIO_GRADIENT = "linear-gradient(rgb(16 171 58), rgb(43 165 63) 60%)";
|
|
|
24758
25047
|
var VIDEO_GRADIENT = "linear-gradient(to top, #8e44ad, #9b59b6)";
|
|
24759
25048
|
var IMAGE_GRADIENT = "linear-gradient(to top, #2980b9, #3498db)";
|
|
24760
25049
|
var TimelineSequence = ({ s }) => {
|
|
24761
|
-
const windowWidth =
|
|
25050
|
+
const windowWidth = useContext77(TimelineWidthContext);
|
|
24762
25051
|
if (windowWidth === null) {
|
|
24763
25052
|
return null;
|
|
24764
25053
|
}
|
|
@@ -24770,29 +25059,37 @@ var TimelineSequence = ({ s }) => {
|
|
|
24770
25059
|
var Inner4 = ({ s, windowWidth }) => {
|
|
24771
25060
|
const video = Internals56.useVideo();
|
|
24772
25061
|
const maxMediaDuration = useMaxMediaDuration(s, video?.fps ?? 30);
|
|
25062
|
+
const effectiveMaxMediaDuration = s.loopDisplay ? null : maxMediaDuration;
|
|
24773
25063
|
if (!video) {
|
|
24774
25064
|
throw new TypeError("Expected video config");
|
|
24775
25065
|
}
|
|
24776
25066
|
const frame2 = useCurrentFrame2();
|
|
24777
25067
|
const relativeFrame = frame2 - s.from;
|
|
25068
|
+
const displayDurationInFrames = s.loopDisplay ? s.loopDisplay.durationInFrames * s.loopDisplay.numberOfTimes : s.duration;
|
|
24778
25069
|
const relativeFrameWithPremount = relativeFrame + (s.premountDisplay ?? 0);
|
|
24779
|
-
const relativeFrameWithPostmount = relativeFrame -
|
|
25070
|
+
const relativeFrameWithPostmount = relativeFrame - displayDurationInFrames;
|
|
24780
25071
|
const roundedFrame = Math.round(relativeFrame * 100) / 100;
|
|
24781
|
-
const isInRange = relativeFrame >= 0 && relativeFrame <
|
|
24782
|
-
const isPremounting = relativeFrameWithPremount >= 0 && relativeFrameWithPremount <
|
|
25072
|
+
const isInRange = relativeFrame >= 0 && relativeFrame < displayDurationInFrames;
|
|
25073
|
+
const isPremounting = relativeFrameWithPremount >= 0 && relativeFrameWithPremount < displayDurationInFrames && !isInRange;
|
|
24783
25074
|
const isPostmounting = relativeFrameWithPostmount >= 0 && relativeFrameWithPostmount < (s.postmountDisplay ?? 0) && !isInRange;
|
|
24784
25075
|
const { marginLeft, width: width2, naturalWidth, premountWidth, postmountWidth } = useMemo121(() => {
|
|
24785
25076
|
return getTimelineSequenceLayout({
|
|
24786
|
-
durationInFrames:
|
|
25077
|
+
durationInFrames: displayDurationInFrames,
|
|
24787
25078
|
startFrom: s.loopDisplay ? s.from + s.loopDisplay.startOffset : s.from,
|
|
24788
25079
|
startFromMedia: s.type === "sequence" || s.type === "image" ? 0 : s.startMediaFrom,
|
|
24789
|
-
maxMediaDuration,
|
|
25080
|
+
maxMediaDuration: effectiveMaxMediaDuration,
|
|
24790
25081
|
video,
|
|
24791
25082
|
windowWidth,
|
|
24792
25083
|
premountDisplay: s.premountDisplay,
|
|
24793
25084
|
postmountDisplay: s.postmountDisplay
|
|
24794
25085
|
});
|
|
24795
|
-
}, [
|
|
25086
|
+
}, [
|
|
25087
|
+
displayDurationInFrames,
|
|
25088
|
+
effectiveMaxMediaDuration,
|
|
25089
|
+
s,
|
|
25090
|
+
video,
|
|
25091
|
+
windowWidth
|
|
25092
|
+
]);
|
|
24796
25093
|
const style11 = useMemo121(() => {
|
|
24797
25094
|
return {
|
|
24798
25095
|
background: s.type === "audio" ? AUDIO_GRADIENT : s.type === "video" ? VIDEO_GRADIENT : s.type === "image" ? IMAGE_GRADIENT : BLUE,
|
|
@@ -24807,7 +25104,7 @@ var Inner4 = ({ s, windowWidth }) => {
|
|
|
24807
25104
|
opacity: isInRange ? 1 : 0.5
|
|
24808
25105
|
};
|
|
24809
25106
|
}, [isInRange, marginLeft, s.type, width2]);
|
|
24810
|
-
if (maxMediaDuration === null) {
|
|
25107
|
+
if (maxMediaDuration === null && !s.loopDisplay) {
|
|
24811
25108
|
return null;
|
|
24812
25109
|
}
|
|
24813
25110
|
return /* @__PURE__ */ jsxs106("div", {
|
|
@@ -24850,7 +25147,8 @@ var Inner4 = ({ s, windowWidth }) => {
|
|
|
24850
25147
|
startFrom: s.startMediaFrom,
|
|
24851
25148
|
durationInFrames: s.duration,
|
|
24852
25149
|
volume: s.volume,
|
|
24853
|
-
playbackRate: s.playbackRate
|
|
25150
|
+
playbackRate: s.playbackRate,
|
|
25151
|
+
loopDisplay: s.loopDisplay
|
|
24854
25152
|
}) : null,
|
|
24855
25153
|
s.type === "video" ? /* @__PURE__ */ jsx218(TimelineVideoInfo, {
|
|
24856
25154
|
src: s.src,
|
|
@@ -24862,7 +25160,8 @@ var Inner4 = ({ s, windowWidth }) => {
|
|
|
24862
25160
|
volume: s.volume,
|
|
24863
25161
|
doesVolumeChange: s.doesVolumeChange,
|
|
24864
25162
|
premountWidth: premountWidth ?? 0,
|
|
24865
|
-
postmountWidth: postmountWidth ?? 0
|
|
25163
|
+
postmountWidth: postmountWidth ?? 0,
|
|
25164
|
+
loopDisplay: s.loopDisplay
|
|
24866
25165
|
}) : null,
|
|
24867
25166
|
s.type === "image" ? /* @__PURE__ */ jsx218(TimelineImageInfo, {
|
|
24868
25167
|
src: s.src,
|
|
@@ -24902,8 +25201,8 @@ var getExpandedPlaceholderStyle = (controls) => ({
|
|
|
24902
25201
|
height: getExpandedTrackHeight(controls) + TIMELINE_ITEM_BORDER_BOTTOM
|
|
24903
25202
|
});
|
|
24904
25203
|
var TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
24905
|
-
const { expandedTracks } =
|
|
24906
|
-
const { previewServerState } =
|
|
25204
|
+
const { expandedTracks } = useContext78(ExpandedTracksContext);
|
|
25205
|
+
const { previewServerState } = useContext78(StudioServerConnectionCtx);
|
|
24907
25206
|
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
24908
25207
|
const timelineStyle = useMemo122(() => {
|
|
24909
25208
|
return {
|
|
@@ -24961,9 +25260,9 @@ var noop3 = () => {
|
|
|
24961
25260
|
return;
|
|
24962
25261
|
};
|
|
24963
25262
|
var TimelineInner = () => {
|
|
24964
|
-
const { sequences } =
|
|
24965
|
-
const { expandedTracks } =
|
|
24966
|
-
const { previewServerState } =
|
|
25263
|
+
const { sequences } = useContext79(Internals57.SequenceManager);
|
|
25264
|
+
const { expandedTracks } = useContext79(ExpandedTracksContext);
|
|
25265
|
+
const { previewServerState } = useContext79(StudioServerConnectionCtx);
|
|
24967
25266
|
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
24968
25267
|
const videoConfig = Internals57.useUnsafeVideoConfig();
|
|
24969
25268
|
const videoConfigIsNull = videoConfig === null;
|
|
@@ -25077,7 +25376,7 @@ var container46 = {
|
|
|
25077
25376
|
};
|
|
25078
25377
|
var EditorContent = ({ readOnlyStudio, children }) => {
|
|
25079
25378
|
const isStill = useIsStill();
|
|
25080
|
-
const { canvasContent } =
|
|
25379
|
+
const { canvasContent } = useContext80(Internals58.CompositionManager);
|
|
25081
25380
|
const showTimeline = canvasContent !== null && !isStill && canvasContent.type === "composition";
|
|
25082
25381
|
return /* @__PURE__ */ jsxs109("div", {
|
|
25083
25382
|
style: container46,
|
|
@@ -25114,11 +25413,11 @@ var EditorContent = ({ readOnlyStudio, children }) => {
|
|
|
25114
25413
|
};
|
|
25115
25414
|
|
|
25116
25415
|
// src/components/GlobalKeybindings.tsx
|
|
25117
|
-
import { useContext as
|
|
25416
|
+
import { useContext as useContext81, useEffect as useEffect76 } from "react";
|
|
25118
25417
|
var GlobalKeybindings = () => {
|
|
25119
25418
|
const keybindings = useKeybinding();
|
|
25120
|
-
const { setSelectedModal } =
|
|
25121
|
-
const { setCheckerboard } =
|
|
25419
|
+
const { setSelectedModal } = useContext81(ModalsContext);
|
|
25420
|
+
const { setCheckerboard } = useContext81(CheckerboardContext);
|
|
25122
25421
|
const { navigateToNextComposition, navigateToPreviousComposition } = useCompositionNavigation();
|
|
25123
25422
|
useEffect76(() => {
|
|
25124
25423
|
const nKey = keybindings.registerKeybinding({
|
|
@@ -25222,7 +25521,7 @@ var GlobalKeybindings = () => {
|
|
|
25222
25521
|
};
|
|
25223
25522
|
|
|
25224
25523
|
// src/components/Modals.tsx
|
|
25225
|
-
import { useContext as
|
|
25524
|
+
import { useContext as useContext95 } from "react";
|
|
25226
25525
|
|
|
25227
25526
|
// src/components/InstallPackage.tsx
|
|
25228
25527
|
import {
|
|
@@ -25231,7 +25530,7 @@ import {
|
|
|
25231
25530
|
extraPackages,
|
|
25232
25531
|
installableMap
|
|
25233
25532
|
} from "@remotion/studio-shared";
|
|
25234
|
-
import React156, { useCallback as useCallback115, useContext as
|
|
25533
|
+
import React156, { useCallback as useCallback115, useContext as useContext83, useEffect as useEffect77 } from "react";
|
|
25235
25534
|
import { VERSION as VERSION2 } from "remotion";
|
|
25236
25535
|
|
|
25237
25536
|
// src/api/install-package.ts
|
|
@@ -25319,10 +25618,10 @@ var ModalFooterContainer = ({ children }) => {
|
|
|
25319
25618
|
};
|
|
25320
25619
|
|
|
25321
25620
|
// src/components/NewComposition/DismissableModal.tsx
|
|
25322
|
-
import { useCallback as useCallback114, useContext as
|
|
25621
|
+
import { useCallback as useCallback114, useContext as useContext82 } from "react";
|
|
25323
25622
|
import { jsx as jsx226 } from "react/jsx-runtime";
|
|
25324
25623
|
var DismissableModal = ({ children }) => {
|
|
25325
|
-
const { setSelectedModal } =
|
|
25624
|
+
const { setSelectedModal } = useContext82(ModalsContext);
|
|
25326
25625
|
const onQuit = useCallback114(() => {
|
|
25327
25626
|
setSelectedModal(null);
|
|
25328
25627
|
}, [setSelectedModal]);
|
|
@@ -25346,7 +25645,7 @@ var text2 = {
|
|
|
25346
25645
|
var InstallPackageModal = ({ packageManager }) => {
|
|
25347
25646
|
const [state, setState] = React156.useState({ type: "idle" });
|
|
25348
25647
|
const [map, setMap] = React156.useState({});
|
|
25349
|
-
const { previewServerState: ctx } =
|
|
25648
|
+
const { previewServerState: ctx } = useContext83(StudioServerConnectionCtx);
|
|
25350
25649
|
const selectedPackages = Object.keys(map).filter((pkg) => map[pkg]);
|
|
25351
25650
|
const onClick = useCallback115(async () => {
|
|
25352
25651
|
if (state.type === "done") {
|
|
@@ -25516,10 +25815,10 @@ var InstallPackageModal = ({ packageManager }) => {
|
|
|
25516
25815
|
};
|
|
25517
25816
|
|
|
25518
25817
|
// src/components/NewComposition/DeleteComposition.tsx
|
|
25519
|
-
import { useCallback as useCallback117, useContext as
|
|
25818
|
+
import { useCallback as useCallback117, useContext as useContext86, useMemo as useMemo126 } from "react";
|
|
25520
25819
|
|
|
25521
25820
|
// src/components/RenderModal/ResolveCompositionBeforeModal.tsx
|
|
25522
|
-
import React157, { useContext as
|
|
25821
|
+
import React157, { useContext as useContext84, useEffect as useEffect78, useMemo as useMemo125 } from "react";
|
|
25523
25822
|
import { Internals as Internals59 } from "remotion";
|
|
25524
25823
|
import { jsx as jsx228, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
25525
25824
|
var loaderContainer2 = {
|
|
@@ -25541,7 +25840,7 @@ var loaderLabel2 = {
|
|
|
25541
25840
|
var ResolvedCompositionContext = React157.createContext(null);
|
|
25542
25841
|
var ResolveCompositionBeforeModal = ({ compositionId, children }) => {
|
|
25543
25842
|
const resolved = Internals59.useResolvedVideoConfig(compositionId);
|
|
25544
|
-
const unresolvedContext =
|
|
25843
|
+
const unresolvedContext = useContext84(Internals59.CompositionManager);
|
|
25545
25844
|
const unresolved = unresolvedContext.compositions.find((c) => compositionId === c.id);
|
|
25546
25845
|
useEffect78(() => {
|
|
25547
25846
|
const { current } = Internals59.resolveCompositionsRef;
|
|
@@ -25601,7 +25900,7 @@ var ResolveCompositionBeforeModal = ({ compositionId, children }) => {
|
|
|
25601
25900
|
};
|
|
25602
25901
|
|
|
25603
25902
|
// src/components/NewComposition/CodemodFooter.tsx
|
|
25604
|
-
import { useCallback as useCallback116, useContext as
|
|
25903
|
+
import { useCallback as useCallback116, useContext as useContext85, useEffect as useEffect79, useState as useState81 } from "react";
|
|
25605
25904
|
|
|
25606
25905
|
// src/components/NewComposition/DiffPreview.tsx
|
|
25607
25906
|
import { jsx as jsx229, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
@@ -25661,12 +25960,12 @@ var CodemodFooter = ({
|
|
|
25661
25960
|
submitLabel,
|
|
25662
25961
|
onSuccess
|
|
25663
25962
|
}) => {
|
|
25664
|
-
const [submitting, setSubmitting] =
|
|
25665
|
-
const { setSelectedModal } =
|
|
25666
|
-
const [codemodStatus, setCanApplyCodemod] =
|
|
25963
|
+
const [submitting, setSubmitting] = useState81(false);
|
|
25964
|
+
const { setSelectedModal } = useContext85(ModalsContext);
|
|
25965
|
+
const [codemodStatus, setCanApplyCodemod] = useState81({
|
|
25667
25966
|
type: "loading"
|
|
25668
25967
|
});
|
|
25669
|
-
const [projectInfo, setProjectInfo] =
|
|
25968
|
+
const [projectInfo, setProjectInfo] = useState81(null);
|
|
25670
25969
|
useEffect79(() => {
|
|
25671
25970
|
const controller = new AbortController;
|
|
25672
25971
|
getProjectInfo(controller.signal).then((info) => {
|
|
@@ -25787,7 +26086,7 @@ var content3 = {
|
|
|
25787
26086
|
minWidth: 500
|
|
25788
26087
|
};
|
|
25789
26088
|
var DeleteCompositionLoaded = ({ compositionId }) => {
|
|
25790
|
-
const context =
|
|
26089
|
+
const context = useContext86(ResolvedCompositionContext);
|
|
25791
26090
|
if (!context) {
|
|
25792
26091
|
throw new Error("Resolved composition context");
|
|
25793
26092
|
}
|
|
@@ -25862,7 +26161,7 @@ var DeleteComposition = ({ compositionId }) => {
|
|
|
25862
26161
|
};
|
|
25863
26162
|
|
|
25864
26163
|
// src/components/NewComposition/DuplicateComposition.tsx
|
|
25865
|
-
import { useCallback as useCallback119, useContext as
|
|
26164
|
+
import { useCallback as useCallback119, useContext as useContext87, useMemo as useMemo127, useState as useState82 } from "react";
|
|
25866
26165
|
import { Internals as Internals61 } from "remotion";
|
|
25867
26166
|
|
|
25868
26167
|
// src/helpers/validate-new-comp-data.ts
|
|
@@ -25968,19 +26267,19 @@ var comboBoxStyle = {
|
|
|
25968
26267
|
width: 190
|
|
25969
26268
|
};
|
|
25970
26269
|
var DuplicateCompositionLoaded = ({ initialType }) => {
|
|
25971
|
-
const context =
|
|
26270
|
+
const context = useContext87(ResolvedCompositionContext);
|
|
25972
26271
|
if (!context) {
|
|
25973
26272
|
throw new Error("Resolved composition context");
|
|
25974
26273
|
}
|
|
25975
26274
|
const { resolved, unresolved } = context;
|
|
25976
|
-
const [initialCompType] =
|
|
26275
|
+
const [initialCompType] = useState82(initialType);
|
|
25977
26276
|
const hadDimensionsDefined = unresolved.width && unresolved.height;
|
|
25978
26277
|
const hadFpsDefined = unresolved.fps !== undefined;
|
|
25979
26278
|
const hadDurationDefined = unresolved.durationInFrames !== undefined;
|
|
25980
|
-
const [selectedFrameRate, setFrameRate] =
|
|
25981
|
-
const { compositions } =
|
|
25982
|
-
const [type, setType] =
|
|
25983
|
-
const [newId, setName] =
|
|
26279
|
+
const [selectedFrameRate, setFrameRate] = useState82(resolved.result.fps);
|
|
26280
|
+
const { compositions } = useContext87(Internals61.CompositionManager);
|
|
26281
|
+
const [type, setType] = useState82(initialCompType);
|
|
26282
|
+
const [newId, setName] = useState82(() => {
|
|
25984
26283
|
const numberAtEnd = resolved.result.id.match(/([0-9]+)$/)?.[0];
|
|
25985
26284
|
let prefix = numberAtEnd ? Number(numberAtEnd) : 1;
|
|
25986
26285
|
const initialName = resolved.result.id.replace(/([0-9]+)$/, "");
|
|
@@ -25995,11 +26294,11 @@ var DuplicateCompositionLoaded = ({ initialType }) => {
|
|
|
25995
26294
|
}
|
|
25996
26295
|
return currentName;
|
|
25997
26296
|
});
|
|
25998
|
-
const [size4, setSize] =
|
|
26297
|
+
const [size4, setSize] = useState82(() => ({
|
|
25999
26298
|
width: resolved.result.width,
|
|
26000
26299
|
height: resolved.result.height
|
|
26001
26300
|
}));
|
|
26002
|
-
const [durationInFrames, setDurationInFrames] =
|
|
26301
|
+
const [durationInFrames, setDurationInFrames] = useState82(resolved.result.durationInFrames);
|
|
26003
26302
|
const onTypeChanged = useCallback119((newType) => {
|
|
26004
26303
|
setType(newType);
|
|
26005
26304
|
}, []);
|
|
@@ -26325,7 +26624,7 @@ var DuplicateComposition = ({ compositionId, compositionType }) => {
|
|
|
26325
26624
|
};
|
|
26326
26625
|
|
|
26327
26626
|
// src/components/NewComposition/RenameComposition.tsx
|
|
26328
|
-
import { useCallback as useCallback120, useContext as
|
|
26627
|
+
import { useCallback as useCallback120, useContext as useContext88, useMemo as useMemo128, useState as useState83 } from "react";
|
|
26329
26628
|
import { Internals as Internals62 } from "remotion";
|
|
26330
26629
|
import { jsx as jsx234, jsxs as jsxs118, Fragment as Fragment35 } from "react/jsx-runtime";
|
|
26331
26630
|
var content5 = {
|
|
@@ -26336,13 +26635,13 @@ var content5 = {
|
|
|
26336
26635
|
minWidth: 500
|
|
26337
26636
|
};
|
|
26338
26637
|
var RenameCompositionLoaded = () => {
|
|
26339
|
-
const context =
|
|
26638
|
+
const context = useContext88(ResolvedCompositionContext);
|
|
26340
26639
|
if (!context) {
|
|
26341
26640
|
throw new Error("Resolved composition context");
|
|
26342
26641
|
}
|
|
26343
26642
|
const { resolved } = context;
|
|
26344
|
-
const { compositions } =
|
|
26345
|
-
const [newId, setName] =
|
|
26643
|
+
const { compositions } = useContext88(Internals62.CompositionManager);
|
|
26644
|
+
const [newId, setName] = useState83(() => {
|
|
26346
26645
|
return resolved.result.id;
|
|
26347
26646
|
});
|
|
26348
26647
|
const onNameChange = useCallback120((e) => {
|
|
@@ -26436,7 +26735,7 @@ var RenameComposition = ({ compositionId }) => {
|
|
|
26436
26735
|
};
|
|
26437
26736
|
|
|
26438
26737
|
// src/components/OverrideInputProps.tsx
|
|
26439
|
-
import { useCallback as useCallback121, useContext as
|
|
26738
|
+
import { useCallback as useCallback121, useContext as useContext89, useMemo as useMemo129, useState as useState84 } from "react";
|
|
26440
26739
|
import { Internals as Internals63 } from "remotion";
|
|
26441
26740
|
import { jsx as jsx235, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
26442
26741
|
var style11 = {
|
|
@@ -26472,14 +26771,14 @@ var isValidJSON = (value) => {
|
|
|
26472
26771
|
}
|
|
26473
26772
|
};
|
|
26474
26773
|
var Inner5 = () => {
|
|
26475
|
-
const [value, setValue] =
|
|
26774
|
+
const [value, setValue] = useState84(() => {
|
|
26476
26775
|
const override = Internals63.getInputPropsOverride();
|
|
26477
26776
|
if (override) {
|
|
26478
26777
|
return JSON.stringify(override, null, 2);
|
|
26479
26778
|
}
|
|
26480
26779
|
return null;
|
|
26481
26780
|
});
|
|
26482
|
-
const { setSelectedModal } =
|
|
26781
|
+
const { setSelectedModal } = useContext89(ModalsContext);
|
|
26483
26782
|
const valid = useMemo129(() => {
|
|
26484
26783
|
if (!value)
|
|
26485
26784
|
return true;
|
|
@@ -26560,11 +26859,11 @@ var OverrideInputPropsModal = () => {
|
|
|
26560
26859
|
// src/components/QuickSwitcher/QuickSwitcherContent.tsx
|
|
26561
26860
|
import {
|
|
26562
26861
|
useCallback as useCallback122,
|
|
26563
|
-
useContext as
|
|
26862
|
+
useContext as useContext90,
|
|
26564
26863
|
useEffect as useEffect81,
|
|
26565
26864
|
useMemo as useMemo131,
|
|
26566
26865
|
useRef as useRef47,
|
|
26567
|
-
useState as
|
|
26866
|
+
useState as useState86
|
|
26568
26867
|
} from "react";
|
|
26569
26868
|
import { Internals as Internals64 } from "remotion";
|
|
26570
26869
|
|
|
@@ -27461,7 +27760,7 @@ var QuickSwitcherNoResults = ({ query, mode }) => {
|
|
|
27461
27760
|
};
|
|
27462
27761
|
|
|
27463
27762
|
// src/components/QuickSwitcher/QuickSwitcherResult.tsx
|
|
27464
|
-
import { useEffect as useEffect80, useMemo as useMemo130, useRef as useRef46, useState as
|
|
27763
|
+
import { useEffect as useEffect80, useMemo as useMemo130, useRef as useRef46, useState as useState85 } from "react";
|
|
27465
27764
|
import { jsx as jsx239, jsxs as jsxs122, Fragment as Fragment37 } from "react/jsx-runtime";
|
|
27466
27765
|
var container50 = {
|
|
27467
27766
|
paddingLeft: 16,
|
|
@@ -27490,7 +27789,7 @@ var labelContainer = {
|
|
|
27490
27789
|
paddingBottom: 5
|
|
27491
27790
|
};
|
|
27492
27791
|
var QuickSwitcherResult = ({ result, selected }) => {
|
|
27493
|
-
const [hovered, setIsHovered] =
|
|
27792
|
+
const [hovered, setIsHovered] = useState85(false);
|
|
27494
27793
|
const ref2 = useRef46(null);
|
|
27495
27794
|
const keybindings = useKeybinding();
|
|
27496
27795
|
useEffect80(() => {
|
|
@@ -27656,8 +27955,8 @@ var mapModeToQuery = (mode) => {
|
|
|
27656
27955
|
throw new Error("no mode" + mode);
|
|
27657
27956
|
};
|
|
27658
27957
|
var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }) => {
|
|
27659
|
-
const { compositions } =
|
|
27660
|
-
const [state, setState] =
|
|
27958
|
+
const { compositions } = useContext90(Internals64.CompositionManager);
|
|
27959
|
+
const [state, setState] = useState86(() => {
|
|
27661
27960
|
return {
|
|
27662
27961
|
query: mapModeToQuery(initialMode),
|
|
27663
27962
|
selectedIndex: 0
|
|
@@ -27675,8 +27974,8 @@ var QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio }
|
|
|
27675
27974
|
return;
|
|
27676
27975
|
}, []);
|
|
27677
27976
|
const actions = useMenuStructure(closeMenu, readOnlyStudio);
|
|
27678
|
-
const [docResults, setDocResults] =
|
|
27679
|
-
const { setSelectedModal } =
|
|
27977
|
+
const [docResults, setDocResults] = useState86({ type: "initial" });
|
|
27978
|
+
const { setSelectedModal } = useContext90(ModalsContext);
|
|
27680
27979
|
const keybindings = useKeybinding();
|
|
27681
27980
|
const mode = mapQueryToMode(state.query);
|
|
27682
27981
|
const actualQuery = useMemo131(() => {
|
|
@@ -27941,7 +28240,7 @@ var QuickSwitcher = ({ initialMode, invocationTimestamp, readOnlyStudio }) => {
|
|
|
27941
28240
|
var QuickSwitcher_default = QuickSwitcher;
|
|
27942
28241
|
|
|
27943
28242
|
// src/components/RenderModal/RenderStatusModal.tsx
|
|
27944
|
-
import { useCallback as useCallback124, useContext as
|
|
28243
|
+
import { useCallback as useCallback124, useContext as useContext91 } from "react";
|
|
27945
28244
|
|
|
27946
28245
|
// src/components/RenderModal/ClientRenderProgress.tsx
|
|
27947
28246
|
import { formatBytes as formatBytes3 } from "@remotion/studio-shared";
|
|
@@ -28331,8 +28630,8 @@ var buttonRow = {
|
|
|
28331
28630
|
var RenderStatusModal = ({
|
|
28332
28631
|
jobId
|
|
28333
28632
|
}) => {
|
|
28334
|
-
const { setSelectedModal } =
|
|
28335
|
-
const { jobs, removeClientJob, cancelClientJob } =
|
|
28633
|
+
const { setSelectedModal } = useContext91(ModalsContext);
|
|
28634
|
+
const { jobs, removeClientJob, cancelClientJob } = useContext91(RenderQueueContext);
|
|
28336
28635
|
const job = jobs.find((j) => j.id === jobId);
|
|
28337
28636
|
if (!job) {
|
|
28338
28637
|
throw new Error("job not found");
|
|
@@ -28441,12 +28740,12 @@ import { BrowserSafeApis as BrowserSafeApis11 } from "@remotion/renderer/client"
|
|
|
28441
28740
|
import { getDefaultOutLocation } from "@remotion/studio-shared";
|
|
28442
28741
|
import {
|
|
28443
28742
|
useCallback as useCallback142,
|
|
28444
|
-
useContext as
|
|
28743
|
+
useContext as useContext93,
|
|
28445
28744
|
useEffect as useEffect84,
|
|
28446
28745
|
useMemo as useMemo143,
|
|
28447
28746
|
useReducer as useReducer2,
|
|
28448
28747
|
useRef as useRef49,
|
|
28449
|
-
useState as
|
|
28748
|
+
useState as useState92
|
|
28450
28749
|
} from "react";
|
|
28451
28750
|
|
|
28452
28751
|
// src/helpers/convert-env-variables.ts
|
|
@@ -28714,9 +29013,9 @@ var makeReadOnlyStudioRenderCommand = ({
|
|
|
28714
29013
|
};
|
|
28715
29014
|
|
|
28716
29015
|
// src/helpers/render-modal-sections.ts
|
|
28717
|
-
import { useMemo as useMemo133, useState as
|
|
29016
|
+
import { useMemo as useMemo133, useState as useState87 } from "react";
|
|
28718
29017
|
var useRenderModalSections = (renderMode, codec) => {
|
|
28719
|
-
const [selectedTab, setTab] =
|
|
29018
|
+
const [selectedTab, setTab] = useState87("general");
|
|
28720
29019
|
const shownTabs = useMemo133(() => {
|
|
28721
29020
|
if (renderMode === "audio") {
|
|
28722
29021
|
return ["general", "data", "audio", "advanced"];
|
|
@@ -28809,7 +29108,7 @@ var GifIcon = (props) => /* @__PURE__ */ jsx250("svg", {
|
|
|
28809
29108
|
});
|
|
28810
29109
|
|
|
28811
29110
|
// src/components/Tabs/vertical.tsx
|
|
28812
|
-
import { useCallback as useCallback125, useMemo as useMemo134, useState as
|
|
29111
|
+
import { useCallback as useCallback125, useMemo as useMemo134, useState as useState88 } from "react";
|
|
28813
29112
|
import { jsx as jsx251 } from "react/jsx-runtime";
|
|
28814
29113
|
var selectorButton2 = {
|
|
28815
29114
|
border: "none",
|
|
@@ -28825,7 +29124,7 @@ var selectorButton2 = {
|
|
|
28825
29124
|
WebkitUserSelect: "none"
|
|
28826
29125
|
};
|
|
28827
29126
|
var VerticalTab = ({ children, onClick, style: style12, selected }) => {
|
|
28828
|
-
const [hovered, setHovered] =
|
|
29127
|
+
const [hovered, setHovered] = useState88(false);
|
|
28829
29128
|
const { tabIndex } = useZIndex();
|
|
28830
29129
|
const onPointerEnter = useCallback125(() => {
|
|
28831
29130
|
setHovered(true);
|
|
@@ -28855,7 +29154,7 @@ var VerticalTab = ({ children, onClick, style: style12, selected }) => {
|
|
|
28855
29154
|
|
|
28856
29155
|
// src/components/RenderModal/CrfSetting.tsx
|
|
28857
29156
|
import { BrowserSafeApis as BrowserSafeApis3 } from "@remotion/renderer/client";
|
|
28858
|
-
import { useState as
|
|
29157
|
+
import { useState as useState90 } from "react";
|
|
28859
29158
|
|
|
28860
29159
|
// src/components/RenderModal/NumberSetting.tsx
|
|
28861
29160
|
import { useCallback as useCallback127 } from "react";
|
|
@@ -28864,7 +29163,7 @@ import { useCallback as useCallback127 } from "react";
|
|
|
28864
29163
|
import { BrowserSafeApis as BrowserSafeApis2 } from "@remotion/renderer/client";
|
|
28865
29164
|
|
|
28866
29165
|
// src/components/RenderModal/CliCopyButton.tsx
|
|
28867
|
-
import { useCallback as useCallback126, useEffect as useEffect82, useMemo as useMemo135, useState as
|
|
29166
|
+
import { useCallback as useCallback126, useEffect as useEffect82, useMemo as useMemo135, useState as useState89 } from "react";
|
|
28868
29167
|
import { jsx as jsx252 } from "react/jsx-runtime";
|
|
28869
29168
|
var svgStyle = {
|
|
28870
29169
|
width: 16,
|
|
@@ -28891,8 +29190,8 @@ var buttonStyle5 = {
|
|
|
28891
29190
|
var CliCopyButton = ({
|
|
28892
29191
|
valueToCopy
|
|
28893
29192
|
}) => {
|
|
28894
|
-
const [copied, setCopied] =
|
|
28895
|
-
const [hovered, setHovered] =
|
|
29193
|
+
const [copied, setCopied] = useState89(false);
|
|
29194
|
+
const [hovered, setHovered] = useState89(false);
|
|
28896
29195
|
const fillColor = useMemo135(() => {
|
|
28897
29196
|
return hovered ? "white" : LIGHT_TEXT;
|
|
28898
29197
|
}, [hovered]);
|
|
@@ -29180,7 +29479,7 @@ var getDefaultCrfState = () => {
|
|
|
29180
29479
|
}, {});
|
|
29181
29480
|
};
|
|
29182
29481
|
var useCrfState = (codec) => {
|
|
29183
|
-
const [state, setState] =
|
|
29482
|
+
const [state, setState] = useState90(() => getDefaultCrfState());
|
|
29184
29483
|
const range = BrowserSafeApis3.getValidCrfRanges(codec);
|
|
29185
29484
|
const setCrf = (updater) => {
|
|
29186
29485
|
setState((q) => {
|
|
@@ -30452,10 +30751,10 @@ import { BrowserSafeApis as BrowserSafeApis7 } from "@remotion/renderer/client";
|
|
|
30452
30751
|
import { useCallback as useCallback134, useMemo as useMemo137 } from "react";
|
|
30453
30752
|
|
|
30454
30753
|
// src/helpers/use-file-existence.ts
|
|
30455
|
-
import { useContext as
|
|
30754
|
+
import { useContext as useContext92, useEffect as useEffect83, useRef as useRef48, useState as useState91 } from "react";
|
|
30456
30755
|
var useFileExistence = (outName) => {
|
|
30457
|
-
const [exists, setExists] =
|
|
30458
|
-
const { previewServerState: state, subscribeToEvent } =
|
|
30756
|
+
const [exists, setExists] = useState91(false);
|
|
30757
|
+
const { previewServerState: state, subscribeToEvent } = useContext92(StudioServerConnectionCtx);
|
|
30459
30758
|
const clientId = state.type === "connected" ? state.clientId : undefined;
|
|
30460
30759
|
const currentOutName = useRef48("");
|
|
30461
30760
|
currentOutName.current = outName;
|
|
@@ -31884,8 +32183,8 @@ var RenderModal = ({
|
|
|
31884
32183
|
initialChromeMode,
|
|
31885
32184
|
renderDefaults
|
|
31886
32185
|
}) => {
|
|
31887
|
-
const { setSelectedModal } =
|
|
31888
|
-
const context =
|
|
32186
|
+
const { setSelectedModal } = useContext93(ModalsContext);
|
|
32187
|
+
const context = useContext93(ResolvedCompositionContext);
|
|
31889
32188
|
if (!context) {
|
|
31890
32189
|
throw new Error("Should not be able to render without resolving comp first");
|
|
31891
32190
|
}
|
|
@@ -31894,7 +32193,7 @@ var RenderModal = ({
|
|
|
31894
32193
|
unresolved: unresolvedComposition
|
|
31895
32194
|
} = context;
|
|
31896
32195
|
const isMounted = useRef49(true);
|
|
31897
|
-
const [isVideo] =
|
|
32196
|
+
const [isVideo] = useState92(() => {
|
|
31898
32197
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
31899
32198
|
});
|
|
31900
32199
|
const [
|
|
@@ -31905,7 +32204,7 @@ var RenderModal = ({
|
|
|
31905
32204
|
initialVideoCodecForAudioTab,
|
|
31906
32205
|
initialVideoCodecForVideoTab
|
|
31907
32206
|
}
|
|
31908
|
-
] =
|
|
32207
|
+
] = useState92(() => {
|
|
31909
32208
|
return getDefaultCodecs({
|
|
31910
32209
|
defaultConfigurationVideoCodec,
|
|
31911
32210
|
compositionDefaultVideoCodec: resolvedComposition.defaultCodec,
|
|
@@ -31914,16 +32213,16 @@ var RenderModal = ({
|
|
|
31914
32213
|
});
|
|
31915
32214
|
});
|
|
31916
32215
|
const [state, dispatch] = useReducer2(reducer2, initialState2);
|
|
31917
|
-
const [unclampedFrame, setFrame] =
|
|
31918
|
-
const [stillImageFormat, setStillImageFormat] =
|
|
31919
|
-
const [videoImageFormat, setVideoImageFormat] =
|
|
31920
|
-
const [sequenceImageFormat, setSequenceImageFormat] =
|
|
31921
|
-
const [concurrency, setConcurrency] =
|
|
31922
|
-
const [videoCodecForVideoTab, setVideoCodecForVideoTab] =
|
|
31923
|
-
const [userSelectedAudioCodec, setUserSelectedAudioCodec] =
|
|
31924
|
-
const [separateAudioTo, setSeparateAudioTo] =
|
|
31925
|
-
const [envVariables, setEnvVariables] =
|
|
31926
|
-
const [initialOutName] =
|
|
32216
|
+
const [unclampedFrame, setFrame] = useState92(() => initialFrame);
|
|
32217
|
+
const [stillImageFormat, setStillImageFormat] = useState92(() => initialStillImageFormat);
|
|
32218
|
+
const [videoImageFormat, setVideoImageFormat] = useState92(() => initialVideoImageFormat ?? resolvedComposition.defaultVideoImageFormat ?? renderDefaults.videoImageFormat);
|
|
32219
|
+
const [sequenceImageFormat, setSequenceImageFormat] = useState92(() => initialStillImageFormat === "jpeg" ? "jpeg" : "png");
|
|
32220
|
+
const [concurrency, setConcurrency] = useState92(() => initialConcurrency);
|
|
32221
|
+
const [videoCodecForVideoTab, setVideoCodecForVideoTab] = useState92(() => initialVideoCodecForVideoTab);
|
|
32222
|
+
const [userSelectedAudioCodec, setUserSelectedAudioCodec] = useState92(() => initialAudioCodec);
|
|
32223
|
+
const [separateAudioTo, setSeparateAudioTo] = useState92(null);
|
|
32224
|
+
const [envVariables, setEnvVariables] = useState92(() => envVariablesObjectToArray(initialEnvVariables).filter(([key5]) => key5 !== "NODE_ENV"));
|
|
32225
|
+
const [initialOutName] = useState92(() => {
|
|
31927
32226
|
return getDefaultOutLocation({
|
|
31928
32227
|
compositionName: resolvedComposition.id,
|
|
31929
32228
|
defaultExtension: initialRenderType === "still" ? initialStillImageFormat : isVideo ? BrowserSafeApis11.getFileExtensionFromCodec(initialVideoCodec, initialAudioCodec) : initialStillImageFormat,
|
|
@@ -31932,26 +32231,26 @@ var RenderModal = ({
|
|
|
31932
32231
|
outputLocation: renderDefaults.outputLocation
|
|
31933
32232
|
});
|
|
31934
32233
|
});
|
|
31935
|
-
const [videoCodecForAudioTab, setVideoCodecForAudioTab] =
|
|
31936
|
-
const [mutedState, setMuted] =
|
|
31937
|
-
const [repro, setRepro] =
|
|
31938
|
-
const [enforceAudioTrackState, setEnforceAudioTrackState] =
|
|
31939
|
-
const [forSeamlessAacConcatenation, setForSeamlessAacConcatenation] =
|
|
31940
|
-
const [sampleRate, setSampleRate] =
|
|
31941
|
-
const [renderMode, setRenderModeState] =
|
|
31942
|
-
const [jpegQuality, setJpegQuality] =
|
|
31943
|
-
const [scale, setScale] =
|
|
31944
|
-
const [logLevel, setLogLevel] =
|
|
31945
|
-
const [disallowParallelEncoding, setDisallowParallelEncoding] =
|
|
31946
|
-
const [disableWebSecurity, setDisableWebSecurity] =
|
|
31947
|
-
const [headless, setHeadless] =
|
|
31948
|
-
const [beepOnFinish, setBeepOnFinish] =
|
|
31949
|
-
const [ignoreCertificateErrors, setIgnoreCertificateErrors] =
|
|
31950
|
-
const [multiProcessOnLinux, setChromiumMultiProcessOnLinux] =
|
|
31951
|
-
const [darkMode, setDarkMode] =
|
|
31952
|
-
const [openGlOption, setOpenGlOption] =
|
|
31953
|
-
const [colorSpace, setColorSpace] =
|
|
31954
|
-
const [userAgent, setUserAgent] =
|
|
32234
|
+
const [videoCodecForAudioTab, setVideoCodecForAudioTab] = useState92(() => initialVideoCodecForAudioTab);
|
|
32235
|
+
const [mutedState, setMuted] = useState92(() => initialMuted);
|
|
32236
|
+
const [repro, setRepro] = useState92(() => initialRepro);
|
|
32237
|
+
const [enforceAudioTrackState, setEnforceAudioTrackState] = useState92(() => initialEnforceAudioTrack);
|
|
32238
|
+
const [forSeamlessAacConcatenation, setForSeamlessAacConcatenation] = useState92(() => initialForSeamlessAacConcatenation);
|
|
32239
|
+
const [sampleRate, setSampleRate] = useState92(() => initialSampleRate);
|
|
32240
|
+
const [renderMode, setRenderModeState] = useState92(initialRenderType);
|
|
32241
|
+
const [jpegQuality, setJpegQuality] = useState92(() => initialJpegQuality);
|
|
32242
|
+
const [scale, setScale] = useState92(() => initialScale);
|
|
32243
|
+
const [logLevel, setLogLevel] = useState92(() => initialLogLevel);
|
|
32244
|
+
const [disallowParallelEncoding, setDisallowParallelEncoding] = useState92(false);
|
|
32245
|
+
const [disableWebSecurity, setDisableWebSecurity] = useState92(() => initialDisableWebSecurity);
|
|
32246
|
+
const [headless, setHeadless] = useState92(() => initialHeadless);
|
|
32247
|
+
const [beepOnFinish, setBeepOnFinish] = useState92(() => initialBeep);
|
|
32248
|
+
const [ignoreCertificateErrors, setIgnoreCertificateErrors] = useState92(() => initialIgnoreCertificateErrors);
|
|
32249
|
+
const [multiProcessOnLinux, setChromiumMultiProcessOnLinux] = useState92(() => initialMultiProcessOnLinux);
|
|
32250
|
+
const [darkMode, setDarkMode] = useState92(() => initialDarkMode);
|
|
32251
|
+
const [openGlOption, setOpenGlOption] = useState92(() => initialGl ?? "default");
|
|
32252
|
+
const [colorSpace, setColorSpace] = useState92(() => initialColorSpace);
|
|
32253
|
+
const [userAgent, setUserAgent] = useState92(() => initialUserAgent === null ? null : initialUserAgent.trim() === "" ? null : initialUserAgent);
|
|
31955
32254
|
const chromiumOptions = useMemo143(() => {
|
|
31956
32255
|
return {
|
|
31957
32256
|
headless,
|
|
@@ -31971,29 +32270,29 @@ var RenderModal = ({
|
|
|
31971
32270
|
multiProcessOnLinux,
|
|
31972
32271
|
darkMode
|
|
31973
32272
|
]);
|
|
31974
|
-
const [outName, setOutName] =
|
|
31975
|
-
const [endFrameOrNull, setEndFrame] =
|
|
31976
|
-
const [startFrameOrNull, setStartFrame] =
|
|
31977
|
-
const [proResProfileSetting, setProResProfile] =
|
|
31978
|
-
const [x264PresetSetting, setx264Preset] =
|
|
31979
|
-
const [hardwareAcceleration, setHardwareAcceleration] =
|
|
31980
|
-
const [userPreferredPixelFormat, setPixelFormat] =
|
|
31981
|
-
const [preferredQualityControlType, setQualityControl] =
|
|
32273
|
+
const [outName, setOutName] = useState92(() => initialOutName);
|
|
32274
|
+
const [endFrameOrNull, setEndFrame] = useState92(() => outFrameMark ?? null);
|
|
32275
|
+
const [startFrameOrNull, setStartFrame] = useState92(() => inFrameMark ?? null);
|
|
32276
|
+
const [proResProfileSetting, setProResProfile] = useState92(() => initialProResProfile ?? resolvedComposition.defaultProResProfile ?? "hq");
|
|
32277
|
+
const [x264PresetSetting, setx264Preset] = useState92(() => initialx264Preset);
|
|
32278
|
+
const [hardwareAcceleration, setHardwareAcceleration] = useState92(() => initialHardwareAcceleration);
|
|
32279
|
+
const [userPreferredPixelFormat, setPixelFormat] = useState92(() => initialPixelFormat ?? resolvedComposition.defaultPixelFormat ?? renderDefaults.pixelFormat);
|
|
32280
|
+
const [preferredQualityControlType, setQualityControl] = useState92(() => initialVideoBitrate === null ? "crf" : "bitrate");
|
|
31982
32281
|
const [
|
|
31983
32282
|
shouldHaveCustomTargetAudioBitrate,
|
|
31984
32283
|
setShouldHaveCustomTargetAudioBitrate
|
|
31985
|
-
] =
|
|
31986
|
-
const [customTargetAudioBitrate, setCustomTargetAudioBitrateValue] =
|
|
31987
|
-
const [customTargetVideoBitrate, setCustomTargetVideoBitrateValue] =
|
|
31988
|
-
const [encodingMaxRate, setEncodingMaxRate] =
|
|
31989
|
-
const [encodingBufferSize, setEncodingBufferSize] =
|
|
31990
|
-
const [limitNumberOfGifLoops, setLimitNumberOfGifLoops] =
|
|
31991
|
-
const [numberOfGifLoopsSetting, setNumberOfGifLoopsSetting] =
|
|
31992
|
-
const [delayRenderTimeout, setDelayRenderTimeout] =
|
|
31993
|
-
const [chromeMode, setChromeMode] =
|
|
31994
|
-
const [offthreadVideoCacheSizeInBytes, setOffthreadVideoCacheSizeInBytes] =
|
|
31995
|
-
const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] =
|
|
31996
|
-
const [offthreadVideoThreads, setOffthreadVideoThreads] =
|
|
32284
|
+
] = useState92(() => initialAudioBitrate !== null);
|
|
32285
|
+
const [customTargetAudioBitrate, setCustomTargetAudioBitrateValue] = useState92(() => initialAudioBitrate ?? "320K");
|
|
32286
|
+
const [customTargetVideoBitrate, setCustomTargetVideoBitrateValue] = useState92(() => initialVideoBitrate ?? "1M");
|
|
32287
|
+
const [encodingMaxRate, setEncodingMaxRate] = useState92(() => initialEncodingMaxRate ?? null);
|
|
32288
|
+
const [encodingBufferSize, setEncodingBufferSize] = useState92(() => initialEncodingBufferSize ?? null);
|
|
32289
|
+
const [limitNumberOfGifLoops, setLimitNumberOfGifLoops] = useState92(() => initialNumberOfGifLoops !== null);
|
|
32290
|
+
const [numberOfGifLoopsSetting, setNumberOfGifLoopsSetting] = useState92(() => initialNumberOfGifLoops ?? 0);
|
|
32291
|
+
const [delayRenderTimeout, setDelayRenderTimeout] = useState92(() => initialDelayRenderTimeout);
|
|
32292
|
+
const [chromeMode, setChromeMode] = useState92(() => initialChromeMode);
|
|
32293
|
+
const [offthreadVideoCacheSizeInBytes, setOffthreadVideoCacheSizeInBytes] = useState92(initialOffthreadVideoCacheSizeInBytes);
|
|
32294
|
+
const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] = useState92(initialMediaCacheSizeInBytes);
|
|
32295
|
+
const [offthreadVideoThreads, setOffthreadVideoThreads] = useState92(() => initialOffthreadVideoThreads);
|
|
31997
32296
|
const codec = useMemo143(() => {
|
|
31998
32297
|
if (renderMode === "audio") {
|
|
31999
32298
|
return videoCodecForAudioTab;
|
|
@@ -32080,11 +32379,11 @@ var RenderModal = ({
|
|
|
32080
32379
|
}
|
|
32081
32380
|
return null;
|
|
32082
32381
|
}, [codec, x264PresetSetting, renderMode]);
|
|
32083
|
-
const [inputProps, _setInputProps] =
|
|
32382
|
+
const [inputProps, _setInputProps] = useState92(() => defaultProps);
|
|
32084
32383
|
const setInputProps = useCallback142((updater) => {
|
|
32085
32384
|
_setInputProps(updater);
|
|
32086
32385
|
}, []);
|
|
32087
|
-
const [metadata] =
|
|
32386
|
+
const [metadata] = useState92(() => defaultMetadata);
|
|
32088
32387
|
const endFrame = useMemo143(() => {
|
|
32089
32388
|
if (endFrameOrNull === null) {
|
|
32090
32389
|
return resolvedComposition.durationInFrames - 1;
|
|
@@ -32163,7 +32462,7 @@ var RenderModal = ({
|
|
|
32163
32462
|
setStillImageFormat(format);
|
|
32164
32463
|
setDefaultOutName({ type: "still", imageFormat: format });
|
|
32165
32464
|
}, [setDefaultOutName]);
|
|
32166
|
-
const { setSidebarCollapsedState } =
|
|
32465
|
+
const { setSidebarCollapsedState } = useContext93(SidebarContext);
|
|
32167
32466
|
const onClickStill = useCallback142(() => {
|
|
32168
32467
|
setSidebarCollapsedState({ left: null, right: "expanded" });
|
|
32169
32468
|
persistSelectedOptionsSidebarPanel2("renders");
|
|
@@ -32217,7 +32516,7 @@ var RenderModal = ({
|
|
|
32217
32516
|
offthreadVideoThreads,
|
|
32218
32517
|
mediaCacheSizeInBytes
|
|
32219
32518
|
]);
|
|
32220
|
-
const [everyNthFrameSetting, setEveryNthFrameSetting] =
|
|
32519
|
+
const [everyNthFrameSetting, setEveryNthFrameSetting] = useState92(() => initialEveryNthFrame);
|
|
32221
32520
|
const everyNthFrame = useMemo143(() => {
|
|
32222
32521
|
if (codec === "gif") {
|
|
32223
32522
|
return everyNthFrameSetting;
|
|
@@ -32671,7 +32970,7 @@ var RenderModal = ({
|
|
|
32671
32970
|
videoBitrate,
|
|
32672
32971
|
x264Preset
|
|
32673
32972
|
]);
|
|
32674
|
-
const [commandCopiedAt, setCommandCopiedAt] =
|
|
32973
|
+
const [commandCopiedAt, setCommandCopiedAt] = useState92(null);
|
|
32675
32974
|
const renderDisabled = readOnlyStudio ? false : !outnameValidation.valid || state.type === "load";
|
|
32676
32975
|
const trigger = useCallback142(() => {
|
|
32677
32976
|
if (readOnlyStudio) {
|
|
@@ -33027,7 +33326,7 @@ import {
|
|
|
33027
33326
|
getDefaultVideoCodecForContainer,
|
|
33028
33327
|
isAudioOnlyContainer
|
|
33029
33328
|
} from "@remotion/web-renderer";
|
|
33030
|
-
import { useCallback as useCallback146, useContext as
|
|
33329
|
+
import { useCallback as useCallback146, useContext as useContext94, useMemo as useMemo148, useState as useState96 } from "react";
|
|
33031
33330
|
|
|
33032
33331
|
// src/icons/certificate.tsx
|
|
33033
33332
|
import { jsx as jsx276 } from "react/jsx-runtime";
|
|
@@ -33046,10 +33345,10 @@ import {
|
|
|
33046
33345
|
getEncodableAudioCodecs,
|
|
33047
33346
|
getSupportedAudioCodecsForContainer
|
|
33048
33347
|
} from "@remotion/web-renderer";
|
|
33049
|
-
import { useEffect as useEffect85, useRef as useRef50, useState as
|
|
33348
|
+
import { useEffect as useEffect85, useRef as useRef50, useState as useState93 } from "react";
|
|
33050
33349
|
var useEncodableAudioCodecs = (container61) => {
|
|
33051
33350
|
const cacheRef = useRef50({});
|
|
33052
|
-
const [codecsByContainer, setCodecsByContainer] =
|
|
33351
|
+
const [codecsByContainer, setCodecsByContainer] = useState93(() => {
|
|
33053
33352
|
return {
|
|
33054
33353
|
[container61]: getSupportedAudioCodecsForContainer(container61)
|
|
33055
33354
|
};
|
|
@@ -33088,10 +33387,10 @@ import {
|
|
|
33088
33387
|
getEncodableVideoCodecs,
|
|
33089
33388
|
getSupportedVideoCodecsForContainer
|
|
33090
33389
|
} from "@remotion/web-renderer";
|
|
33091
|
-
import { useEffect as useEffect86, useRef as useRef51, useState as
|
|
33390
|
+
import { useEffect as useEffect86, useRef as useRef51, useState as useState94 } from "react";
|
|
33092
33391
|
var useEncodableVideoCodecs = (container61) => {
|
|
33093
33392
|
const cacheRef = useRef51({});
|
|
33094
|
-
const [codecsByContainer, setCodecsByContainer] =
|
|
33393
|
+
const [codecsByContainer, setCodecsByContainer] = useState94(() => {
|
|
33095
33394
|
return {
|
|
33096
33395
|
[container61]: getSupportedVideoCodecsForContainer(container61)
|
|
33097
33396
|
};
|
|
@@ -33784,7 +34083,7 @@ var WebRenderModalBasic = ({
|
|
|
33784
34083
|
};
|
|
33785
34084
|
|
|
33786
34085
|
// src/components/RenderModal/WebRenderModalLicense.tsx
|
|
33787
|
-
import { useCallback as useCallback144, useEffect as useEffect87, useState as
|
|
34086
|
+
import { useCallback as useCallback144, useEffect as useEffect87, useState as useState95 } from "react";
|
|
33788
34087
|
|
|
33789
34088
|
// src/icons/check-circle-filled.tsx
|
|
33790
34089
|
import { jsx as jsx282 } from "react/jsx-runtime";
|
|
@@ -34004,8 +34303,8 @@ var WebRenderModalLicense = ({
|
|
|
34004
34303
|
setLicenseKey,
|
|
34005
34304
|
initialPublicLicenseKey
|
|
34006
34305
|
}) => {
|
|
34007
|
-
const [licenseValidation, setLicenseValidation] =
|
|
34008
|
-
const [isLoading, setIsLoading] =
|
|
34306
|
+
const [licenseValidation, setLicenseValidation] = useState95({ valid: true, message: null, details: null });
|
|
34307
|
+
const [isLoading, setIsLoading] = useState95(false);
|
|
34009
34308
|
useEffect87(() => {
|
|
34010
34309
|
if (licenseKey === null || licenseKey === "free-license") {
|
|
34011
34310
|
return setLicenseValidation({
|
|
@@ -34372,10 +34671,10 @@ var WebRenderModal = ({
|
|
|
34372
34671
|
initialMuted,
|
|
34373
34672
|
initialAllowHtmlInCanvas
|
|
34374
34673
|
}) => {
|
|
34375
|
-
const context =
|
|
34376
|
-
const { setSelectedModal } =
|
|
34377
|
-
const { setSidebarCollapsedState } =
|
|
34378
|
-
const { addClientStillJob, addClientVideoJob } =
|
|
34674
|
+
const context = useContext94(ResolvedCompositionContext);
|
|
34675
|
+
const { setSelectedModal } = useContext94(ModalsContext);
|
|
34676
|
+
const { setSidebarCollapsedState } = useContext94(SidebarContext);
|
|
34677
|
+
const { addClientStillJob, addClientVideoJob } = useContext94(RenderQueueContext);
|
|
34379
34678
|
if (!context) {
|
|
34380
34679
|
throw new Error("Should not be able to render without resolving comp first");
|
|
34381
34680
|
}
|
|
@@ -34383,34 +34682,34 @@ var WebRenderModal = ({
|
|
|
34383
34682
|
resolved: { result: resolvedComposition },
|
|
34384
34683
|
unresolved: unresolvedComposition
|
|
34385
34684
|
} = context;
|
|
34386
|
-
const [isVideo] =
|
|
34685
|
+
const [isVideo] = useState96(() => {
|
|
34387
34686
|
return typeof resolvedComposition.durationInFrames === "undefined" ? true : resolvedComposition.durationInFrames > 1;
|
|
34388
34687
|
});
|
|
34389
|
-
const [renderMode, setRenderMode] =
|
|
34390
|
-
const [tab, setTab] =
|
|
34391
|
-
const [imageFormat, setImageFormat] =
|
|
34392
|
-
const [frame2, setFrame] =
|
|
34393
|
-
const [logLevel, setLogLevel] =
|
|
34394
|
-
const [inputProps, _setInputProps] =
|
|
34688
|
+
const [renderMode, setRenderMode] = useState96(initialContainer && isAudioOnlyContainer(initialContainer) ? "audio" : isVideo ? "video" : "still");
|
|
34689
|
+
const [tab, setTab] = useState96("general");
|
|
34690
|
+
const [imageFormat, setImageFormat] = useState96(() => initialStillImageFormat ?? "png");
|
|
34691
|
+
const [frame2, setFrame] = useState96(() => initialFrame);
|
|
34692
|
+
const [logLevel, setLogLevel] = useState96(() => initialLogLevel);
|
|
34693
|
+
const [inputProps, _setInputProps] = useState96(() => defaultProps);
|
|
34395
34694
|
const setInputProps = useCallback146((updater) => {
|
|
34396
34695
|
_setInputProps(updater);
|
|
34397
34696
|
}, []);
|
|
34398
|
-
const [delayRenderTimeout, setDelayRenderTimeout] =
|
|
34399
|
-
const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] =
|
|
34400
|
-
const [codec, setCodec] =
|
|
34401
|
-
const [container62, setContainer] =
|
|
34402
|
-
const [audioCodec, setAudioCodec] =
|
|
34403
|
-
const [audioBitrate, setAudioBitrate] =
|
|
34404
|
-
const [videoBitrate, setVideoBitrate] =
|
|
34405
|
-
const [hardwareAcceleration, setHardwareAcceleration] =
|
|
34406
|
-
const [keyframeIntervalInSeconds, setKeyframeIntervalInSeconds] =
|
|
34407
|
-
const [startFrame, setStartFrame] =
|
|
34408
|
-
const [endFrame, setEndFrame] =
|
|
34409
|
-
const [transparent, setTransparent] =
|
|
34410
|
-
const [muted, setMuted] =
|
|
34411
|
-
const [scale, setScale] =
|
|
34412
|
-
const [licenseKey, setLicenseKey] =
|
|
34413
|
-
const [allowHtmlInCanvas, setAllowHtmlInCanvas] =
|
|
34697
|
+
const [delayRenderTimeout, setDelayRenderTimeout] = useState96(initialDelayRenderTimeout ?? 30000);
|
|
34698
|
+
const [mediaCacheSizeInBytes, setMediaCacheSizeInBytes] = useState96(initialMediaCacheSizeInBytes);
|
|
34699
|
+
const [codec, setCodec] = useState96(initialVideoCodec ?? "h264");
|
|
34700
|
+
const [container62, setContainer] = useState96(initialContainer ?? "mp4");
|
|
34701
|
+
const [audioCodec, setAudioCodec] = useState96(initialAudioCodec ?? "aac");
|
|
34702
|
+
const [audioBitrate, setAudioBitrate] = useState96(initialAudioBitrate ?? "medium");
|
|
34703
|
+
const [videoBitrate, setVideoBitrate] = useState96(initialVideoBitrate ?? "high");
|
|
34704
|
+
const [hardwareAcceleration, setHardwareAcceleration] = useState96(initialHardwareAcceleration ?? "no-preference");
|
|
34705
|
+
const [keyframeIntervalInSeconds, setKeyframeIntervalInSeconds] = useState96(initialKeyframeIntervalInSeconds ?? 5);
|
|
34706
|
+
const [startFrame, setStartFrame] = useState96(() => inFrameMark);
|
|
34707
|
+
const [endFrame, setEndFrame] = useState96(() => outFrameMark);
|
|
34708
|
+
const [transparent, setTransparent] = useState96(initialTransparent ?? false);
|
|
34709
|
+
const [muted, setMuted] = useState96(initialMuted ?? false);
|
|
34710
|
+
const [scale, setScale] = useState96(initialScale ?? 1);
|
|
34711
|
+
const [licenseKey, setLicenseKey] = useState96(initialLicenseKey);
|
|
34712
|
+
const [allowHtmlInCanvas, setAllowHtmlInCanvas] = useState96(initialAllowHtmlInCanvas ?? false);
|
|
34414
34713
|
const encodableAudioCodecs = useEncodableAudioCodecs(container62);
|
|
34415
34714
|
const encodableVideoCodecs = useEncodableVideoCodecs(container62);
|
|
34416
34715
|
const effectiveAudioCodec = useMemo148(() => {
|
|
@@ -34437,7 +34736,7 @@ var WebRenderModal = ({
|
|
|
34437
34736
|
}
|
|
34438
34737
|
return Math.max(0, Math.min(finalEndFrame, startFrame));
|
|
34439
34738
|
}, [finalEndFrame, startFrame]);
|
|
34440
|
-
const [initialOutNameState] =
|
|
34739
|
+
const [initialOutNameState] = useState96(() => {
|
|
34441
34740
|
if (initialDefaultOutName) {
|
|
34442
34741
|
return initialDefaultOutName;
|
|
34443
34742
|
}
|
|
@@ -34453,7 +34752,7 @@ var WebRenderModal = ({
|
|
|
34453
34752
|
}
|
|
34454
34753
|
return defaultOut;
|
|
34455
34754
|
});
|
|
34456
|
-
const [outName, setOutName] =
|
|
34755
|
+
const [outName, setOutName] = useState96(() => initialOutNameState);
|
|
34457
34756
|
const updateOutNameExtension = useCallback146((extension) => {
|
|
34458
34757
|
setOutName((prev) => getStringBeforeSuffix(prev) + "." + extension);
|
|
34459
34758
|
}, []);
|
|
@@ -34893,7 +35192,7 @@ var WebRenderModalWithLoader = (props) => {
|
|
|
34893
35192
|
import { useCallback as useCallback149, useMemo as useMemo150 } from "react";
|
|
34894
35193
|
|
|
34895
35194
|
// src/components/CopyButton.tsx
|
|
34896
|
-
import { useCallback as useCallback147, useEffect as useEffect88, useState as
|
|
35195
|
+
import { useCallback as useCallback147, useEffect as useEffect88, useState as useState97 } from "react";
|
|
34897
35196
|
import { jsx as jsx287, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
34898
35197
|
var iconStyle9 = {
|
|
34899
35198
|
width: 16,
|
|
@@ -34923,7 +35222,7 @@ var labelStyle5 = {
|
|
|
34923
35222
|
fontSize: 14
|
|
34924
35223
|
};
|
|
34925
35224
|
var CopyButton = ({ textToCopy, label: label13, labelWhenCopied }) => {
|
|
34926
|
-
const [copied, setCopied] =
|
|
35225
|
+
const [copied, setCopied] = useState97(false);
|
|
34927
35226
|
const onClick = useCallback147(() => {
|
|
34928
35227
|
copyText(textToCopy).then(() => {
|
|
34929
35228
|
setCopied(Date.now());
|
|
@@ -34956,7 +35255,7 @@ var CopyButton = ({ textToCopy, label: label13, labelWhenCopied }) => {
|
|
|
34956
35255
|
};
|
|
34957
35256
|
|
|
34958
35257
|
// src/components/UpdateModal/OpenIssueButton.tsx
|
|
34959
|
-
import { useCallback as useCallback148, useMemo as useMemo149, useState as
|
|
35258
|
+
import { useCallback as useCallback148, useMemo as useMemo149, useState as useState98 } from "react";
|
|
34960
35259
|
import { jsx as jsx288 } from "react/jsx-runtime";
|
|
34961
35260
|
var svgStyle2 = {
|
|
34962
35261
|
width: "11px",
|
|
@@ -34971,7 +35270,7 @@ var buttonStyle7 = {
|
|
|
34971
35270
|
alignItems: "center"
|
|
34972
35271
|
};
|
|
34973
35272
|
var OpenIssueButton = ({ link: link5 }) => {
|
|
34974
|
-
const [hovered, setHovered] =
|
|
35273
|
+
const [hovered, setHovered] = useState98(false);
|
|
34975
35274
|
const buttonTooltip = `Open GitHub issue in new Tab`;
|
|
34976
35275
|
const handleClick = useCallback148(() => {
|
|
34977
35276
|
window.open(link5, "_blank");
|
|
@@ -35172,8 +35471,8 @@ var UpdateModal = ({ info, knownBugs }) => {
|
|
|
35172
35471
|
// src/components/Modals.tsx
|
|
35173
35472
|
import { jsx as jsx291, jsxs as jsxs156, Fragment as Fragment53 } from "react/jsx-runtime";
|
|
35174
35473
|
var Modals = ({ readOnlyStudio }) => {
|
|
35175
|
-
const { selectedModal: modalContextType } =
|
|
35176
|
-
const canRender =
|
|
35474
|
+
const { selectedModal: modalContextType } = useContext95(ModalsContext);
|
|
35475
|
+
const canRender = useContext95(StudioServerConnectionCtx).previewServerState.type === "connected";
|
|
35177
35476
|
return /* @__PURE__ */ jsxs156(Fragment53, {
|
|
35178
35477
|
children: [
|
|
35179
35478
|
modalContextType && modalContextType.type === "duplicate-comp" && /* @__PURE__ */ jsx291(DuplicateComposition, {
|
|
@@ -35294,7 +35593,7 @@ var Editor = ({ Root, readOnlyStudio }) => {
|
|
|
35294
35593
|
const MemoRoot = useMemo151(() => {
|
|
35295
35594
|
return React189.memo(Root);
|
|
35296
35595
|
}, [Root]);
|
|
35297
|
-
const [renderError, setRenderError] =
|
|
35596
|
+
const [renderError, setRenderError] = useState99(null);
|
|
35298
35597
|
const clearError = useCallback150(() => {
|
|
35299
35598
|
setRenderError(null);
|
|
35300
35599
|
}, []);
|
|
@@ -35350,7 +35649,7 @@ var Editor = ({ Root, readOnlyStudio }) => {
|
|
|
35350
35649
|
import { PlayerInternals as PlayerInternals20 } from "@remotion/player";
|
|
35351
35650
|
|
|
35352
35651
|
// src/state/preview-size.tsx
|
|
35353
|
-
import { useCallback as useCallback151, useContext as
|
|
35652
|
+
import { useCallback as useCallback151, useContext as useContext96, useMemo as useMemo152, useState as useState100 } from "react";
|
|
35354
35653
|
import { Internals as Internals66 } from "remotion";
|
|
35355
35654
|
import { jsx as jsx293 } from "react/jsx-runtime";
|
|
35356
35655
|
var key5 = "remotion.previewSize";
|
|
@@ -35371,14 +35670,14 @@ var loadPreviewSizeOption = () => {
|
|
|
35371
35670
|
return JSON.parse(item2);
|
|
35372
35671
|
};
|
|
35373
35672
|
var PreviewSizeProvider = ({ children }) => {
|
|
35374
|
-
const [size4, setSizeState] =
|
|
35375
|
-
const [translation, setTranslation] =
|
|
35673
|
+
const [size4, setSizeState] = useState100(() => loadPreviewSizeOption());
|
|
35674
|
+
const [translation, setTranslation] = useState100(() => {
|
|
35376
35675
|
return {
|
|
35377
35676
|
x: 0,
|
|
35378
35677
|
y: 0
|
|
35379
35678
|
};
|
|
35380
35679
|
});
|
|
35381
|
-
const { editorZoomGestures } =
|
|
35680
|
+
const { editorZoomGestures } = useContext96(EditorZoomGesturesContext);
|
|
35382
35681
|
const setSize = useCallback151((newValue) => {
|
|
35383
35682
|
setSizeState((prevState) => {
|
|
35384
35683
|
const newVal = newValue(prevState);
|
|
@@ -35407,10 +35706,10 @@ var PreviewSizeProvider = ({ children }) => {
|
|
|
35407
35706
|
};
|
|
35408
35707
|
|
|
35409
35708
|
// src/components/CheckerboardProvider.tsx
|
|
35410
|
-
import { useCallback as useCallback152, useMemo as useMemo153, useState as
|
|
35709
|
+
import { useCallback as useCallback152, useMemo as useMemo153, useState as useState101 } from "react";
|
|
35411
35710
|
import { jsx as jsx294 } from "react/jsx-runtime";
|
|
35412
35711
|
var CheckerboardProvider = ({ children }) => {
|
|
35413
|
-
const [checkerboard, setCheckerboardState] =
|
|
35712
|
+
const [checkerboard, setCheckerboardState] = useState101(() => loadCheckerboardOption());
|
|
35414
35713
|
const setCheckerboard = useCallback152((newValue) => {
|
|
35415
35714
|
setCheckerboardState((prevState) => {
|
|
35416
35715
|
const newVal = newValue(prevState);
|
|
@@ -35431,12 +35730,12 @@ var CheckerboardProvider = ({ children }) => {
|
|
|
35431
35730
|
};
|
|
35432
35731
|
|
|
35433
35732
|
// src/components/MediaVolumeProvider.tsx
|
|
35434
|
-
import { useMemo as useMemo154, useState as
|
|
35733
|
+
import { useMemo as useMemo154, useState as useState102 } from "react";
|
|
35435
35734
|
import { Internals as Internals67 } from "remotion";
|
|
35436
35735
|
import { jsx as jsx295 } from "react/jsx-runtime";
|
|
35437
35736
|
var MediaVolumeProvider = ({ children }) => {
|
|
35438
|
-
const [mediaMuted, setMediaMuted] =
|
|
35439
|
-
const [mediaVolume, setMediaVolume] =
|
|
35737
|
+
const [mediaMuted, setMediaMuted] = useState102(() => loadMuteOption());
|
|
35738
|
+
const [mediaVolume, setMediaVolume] = useState102(1);
|
|
35440
35739
|
const mediaVolumeContextValue = useMemo154(() => {
|
|
35441
35740
|
return {
|
|
35442
35741
|
mediaMuted,
|
|
@@ -35459,10 +35758,10 @@ var MediaVolumeProvider = ({ children }) => {
|
|
|
35459
35758
|
};
|
|
35460
35759
|
|
|
35461
35760
|
// src/components/ModalsProvider.tsx
|
|
35462
|
-
import { useMemo as useMemo155, useState as
|
|
35761
|
+
import { useMemo as useMemo155, useState as useState103 } from "react";
|
|
35463
35762
|
import { jsx as jsx296 } from "react/jsx-runtime";
|
|
35464
35763
|
var ModalsProvider = ({ children }) => {
|
|
35465
|
-
const [modalContextType, setModalContextType] =
|
|
35764
|
+
const [modalContextType, setModalContextType] = useState103(null);
|
|
35466
35765
|
const modalsContext = useMemo155(() => {
|
|
35467
35766
|
return {
|
|
35468
35767
|
selectedModal: modalContextType,
|
|
@@ -35476,7 +35775,7 @@ var ModalsProvider = ({ children }) => {
|
|
|
35476
35775
|
};
|
|
35477
35776
|
|
|
35478
35777
|
// src/components/SetTimelineInOutProvider.tsx
|
|
35479
|
-
import { useEffect as useEffect89, useMemo as useMemo156, useState as
|
|
35778
|
+
import { useEffect as useEffect89, useMemo as useMemo156, useState as useState104 } from "react";
|
|
35480
35779
|
|
|
35481
35780
|
// src/state/marks.ts
|
|
35482
35781
|
var localStorageKey5 = () => `remotion.editor.marksv2`;
|
|
@@ -35494,7 +35793,7 @@ var loadMarks = () => {
|
|
|
35494
35793
|
// src/components/SetTimelineInOutProvider.tsx
|
|
35495
35794
|
import { jsx as jsx297 } from "react/jsx-runtime";
|
|
35496
35795
|
var SetTimelineInOutProvider = ({ children }) => {
|
|
35497
|
-
const [inAndOutFrames, setInAndOutFrames] =
|
|
35796
|
+
const [inAndOutFrames, setInAndOutFrames] = useState104(() => loadMarks());
|
|
35498
35797
|
const setTimelineInOutContextValue = useMemo156(() => {
|
|
35499
35798
|
return {
|
|
35500
35799
|
setInAndOutFrames
|
|
@@ -35513,13 +35812,13 @@ var SetTimelineInOutProvider = ({ children }) => {
|
|
|
35513
35812
|
};
|
|
35514
35813
|
|
|
35515
35814
|
// src/components/ShowGuidesProvider.tsx
|
|
35516
|
-
import { useCallback as useCallback153, useMemo as useMemo157, useRef as useRef52, useState as
|
|
35815
|
+
import { useCallback as useCallback153, useMemo as useMemo157, useRef as useRef52, useState as useState105 } from "react";
|
|
35517
35816
|
import { jsx as jsx298 } from "react/jsx-runtime";
|
|
35518
35817
|
var ShowGuidesProvider = ({ children }) => {
|
|
35519
|
-
const [guidesList, setGuidesList] =
|
|
35520
|
-
const [selectedGuideId, setSelectedGuideId] =
|
|
35521
|
-
const [hoveredGuideId, setHoveredGuideId] =
|
|
35522
|
-
const [editorShowGuides, setEditorShowGuidesState] =
|
|
35818
|
+
const [guidesList, setGuidesList] = useState105(() => loadGuidesList());
|
|
35819
|
+
const [selectedGuideId, setSelectedGuideId] = useState105(null);
|
|
35820
|
+
const [hoveredGuideId, setHoveredGuideId] = useState105(null);
|
|
35821
|
+
const [editorShowGuides, setEditorShowGuidesState] = useState105(() => loadEditorShowGuidesOption());
|
|
35523
35822
|
const shouldCreateGuideRef = useRef52(false);
|
|
35524
35823
|
const shouldDeleteGuideRef = useRef52(false);
|
|
35525
35824
|
const setEditorShowGuides = useCallback153((newValue) => {
|
|
@@ -35556,10 +35855,10 @@ var ShowGuidesProvider = ({ children }) => {
|
|
|
35556
35855
|
};
|
|
35557
35856
|
|
|
35558
35857
|
// src/components/ShowRulersProvider.tsx
|
|
35559
|
-
import { useCallback as useCallback154, useMemo as useMemo158, useState as
|
|
35858
|
+
import { useCallback as useCallback154, useMemo as useMemo158, useState as useState106 } from "react";
|
|
35560
35859
|
import { jsx as jsx299 } from "react/jsx-runtime";
|
|
35561
35860
|
var ShowRulersProvider = ({ children }) => {
|
|
35562
|
-
const [editorShowRulers, setEditorShowRulersState] =
|
|
35861
|
+
const [editorShowRulers, setEditorShowRulersState] = useState106(() => loadEditorShowRulersOption());
|
|
35563
35862
|
const setEditorShowRulers = useCallback154((newValue) => {
|
|
35564
35863
|
setEditorShowRulersState((prevState) => {
|
|
35565
35864
|
const newVal = newValue(prevState);
|
|
@@ -35580,10 +35879,10 @@ var ShowRulersProvider = ({ children }) => {
|
|
|
35580
35879
|
};
|
|
35581
35880
|
|
|
35582
35881
|
// src/components/VisualControls/VisualControlsUndoSync.tsx
|
|
35583
|
-
import { useContext as
|
|
35882
|
+
import { useContext as useContext97, useEffect as useEffect90 } from "react";
|
|
35584
35883
|
var VisualControlsUndoSync = () => {
|
|
35585
|
-
const { subscribeToEvent } =
|
|
35586
|
-
const { updateValue } =
|
|
35884
|
+
const { subscribeToEvent } = useContext97(StudioServerConnectionCtx);
|
|
35885
|
+
const { updateValue } = useContext97(SetVisualControlsContext);
|
|
35587
35886
|
useEffect90(() => {
|
|
35588
35887
|
const unsub = subscribeToEvent("visual-control-values-changed", (event) => {
|
|
35589
35888
|
if (event.type !== "visual-control-values-changed") {
|
|
@@ -35599,10 +35898,10 @@ var VisualControlsUndoSync = () => {
|
|
|
35599
35898
|
};
|
|
35600
35899
|
|
|
35601
35900
|
// src/components/ZoomGesturesProvider.tsx
|
|
35602
|
-
import { useCallback as useCallback155, useMemo as useMemo159, useState as
|
|
35901
|
+
import { useCallback as useCallback155, useMemo as useMemo159, useState as useState107 } from "react";
|
|
35603
35902
|
import { jsx as jsx300 } from "react/jsx-runtime";
|
|
35604
35903
|
var ZoomGesturesProvider = ({ children }) => {
|
|
35605
|
-
const [editorZoomGestures, setEditorZoomGesturesState] =
|
|
35904
|
+
const [editorZoomGestures, setEditorZoomGesturesState] = useState107(() => loadEditorZoomGesturesOption());
|
|
35606
35905
|
const setEditorZoomGestures = useCallback155((newValue) => {
|
|
35607
35906
|
setEditorZoomGesturesState((prevState) => {
|
|
35608
35907
|
const newVal = newValue(prevState);
|
|
@@ -35673,7 +35972,7 @@ var EditorContexts = ({ children, readOnlyStudio }) => {
|
|
|
35673
35972
|
};
|
|
35674
35973
|
|
|
35675
35974
|
// src/components/Notifications/ServerDisconnected.tsx
|
|
35676
|
-
import { useContext as
|
|
35975
|
+
import { useContext as useContext98 } from "react";
|
|
35677
35976
|
import { jsx as jsx302, jsxs as jsxs159 } from "react/jsx-runtime";
|
|
35678
35977
|
var container64 = {
|
|
35679
35978
|
position: "fixed",
|
|
@@ -35708,7 +36007,7 @@ window.addEventListener("beforeunload", () => {
|
|
|
35708
36007
|
pageIsGoingToReload = true;
|
|
35709
36008
|
});
|
|
35710
36009
|
var ServerDisconnected = () => {
|
|
35711
|
-
const { previewServerState: ctx } =
|
|
36010
|
+
const { previewServerState: ctx } = useContext98(StudioServerConnectionCtx);
|
|
35712
36011
|
const fav = document.getElementById("__remotion_favicon");
|
|
35713
36012
|
if (ctx.type !== "disconnected") {
|
|
35714
36013
|
fav.setAttribute("href", "/favicon.ico");
|
|
@@ -35747,11 +36046,11 @@ var ServerDisconnected = () => {
|
|
|
35747
36046
|
};
|
|
35748
36047
|
|
|
35749
36048
|
// src/FastRefreshProvider.tsx
|
|
35750
|
-
import { useCallback as useCallback156, useEffect as useEffect91, useMemo as useMemo160, useState as
|
|
36049
|
+
import { useCallback as useCallback156, useEffect as useEffect91, useMemo as useMemo160, useState as useState108 } from "react";
|
|
35751
36050
|
import { jsx as jsx303 } from "react/jsx-runtime";
|
|
35752
36051
|
var FastRefreshProvider = ({ children }) => {
|
|
35753
|
-
const [fastRefreshes, setFastRefreshes] =
|
|
35754
|
-
const [manualRefreshes, setManualRefreshes] =
|
|
36052
|
+
const [fastRefreshes, setFastRefreshes] = useState108(0);
|
|
36053
|
+
const [manualRefreshes, setManualRefreshes] = useState108(0);
|
|
35755
36054
|
const increaseManualRefreshes = useCallback156(() => {
|
|
35756
36055
|
setManualRefreshes((i) => i + 1);
|
|
35757
36056
|
}, []);
|
|
@@ -35938,29 +36237,29 @@ var injectCSS = () => {
|
|
|
35938
36237
|
// src/ResolveCompositionConfigInStudio.tsx
|
|
35939
36238
|
import {
|
|
35940
36239
|
useCallback as useCallback157,
|
|
35941
|
-
useContext as
|
|
36240
|
+
useContext as useContext99,
|
|
35942
36241
|
useEffect as useEffect92,
|
|
35943
36242
|
useImperativeHandle as useImperativeHandle15,
|
|
35944
36243
|
useMemo as useMemo161,
|
|
35945
|
-
useState as
|
|
36244
|
+
useState as useState109
|
|
35946
36245
|
} from "react";
|
|
35947
36246
|
import { getInputProps as getInputProps2, Internals as Internals69 } from "remotion";
|
|
35948
36247
|
import { jsx as jsx304 } from "react/jsx-runtime";
|
|
35949
36248
|
var ResolveCompositionConfigInStudio = ({ children }) => {
|
|
35950
|
-
const [currentRenderModalComposition, setCurrentRenderModalComposition] =
|
|
35951
|
-
const { compositions, canvasContent, currentCompositionMetadata } =
|
|
35952
|
-
const { fastRefreshes, manualRefreshes } =
|
|
36249
|
+
const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState109(null);
|
|
36250
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext99(Internals69.CompositionManager);
|
|
36251
|
+
const { fastRefreshes, manualRefreshes } = useContext99(FastRefreshContext);
|
|
35953
36252
|
if (manualRefreshes) {}
|
|
35954
36253
|
const selectedComposition = useMemo161(() => {
|
|
35955
36254
|
return compositions.find((c) => canvasContent && canvasContent.type === "composition" && canvasContent.compositionId === c.id);
|
|
35956
36255
|
}, [canvasContent, compositions]);
|
|
35957
36256
|
const renderModalComposition = compositions.find((c) => c.id === currentRenderModalComposition);
|
|
35958
|
-
const { props: allEditorProps } =
|
|
36257
|
+
const { props: allEditorProps } = useContext99(Internals69.EditorPropsContext);
|
|
35959
36258
|
const env = Internals69.getRemotionEnvironment();
|
|
35960
36259
|
const inputProps = useMemo161(() => {
|
|
35961
36260
|
return typeof window === "undefined" || env.isPlayer ? {} : getInputProps2() ?? {};
|
|
35962
36261
|
}, [env.isPlayer]);
|
|
35963
|
-
const [resolvedConfigs, setResolvedConfigs] =
|
|
36262
|
+
const [resolvedConfigs, setResolvedConfigs] = useState109({});
|
|
35964
36263
|
const selectedEditorProps = useMemo161(() => {
|
|
35965
36264
|
return selectedComposition ? allEditorProps[selectedComposition.id] ?? {} : {};
|
|
35966
36265
|
}, [allEditorProps, selectedComposition]);
|
|
@@ -36217,7 +36516,7 @@ var StudioInner = ({ rootComponent, readOnly, visualModeEnabled }) => {
|
|
|
36217
36516
|
videoEnabled: window.remotion_videoEnabled,
|
|
36218
36517
|
logLevel: window.remotion_logLevel ?? "info",
|
|
36219
36518
|
numberOfAudioTags: window.remotion_numberOfAudioTags,
|
|
36220
|
-
audioLatencyHint: window.remotion_audioLatencyHint ?? "
|
|
36519
|
+
audioLatencyHint: window.remotion_audioLatencyHint ?? "playback",
|
|
36221
36520
|
children: /* @__PURE__ */ jsx305(StaticFilesProvider, {
|
|
36222
36521
|
children: /* @__PURE__ */ jsx305(ResolveCompositionConfigInStudio, {
|
|
36223
36522
|
children: /* @__PURE__ */ jsxs160(EditorContexts, {
|
|
@@ -36236,7 +36535,7 @@ var StudioInner = ({ rootComponent, readOnly, visualModeEnabled }) => {
|
|
|
36236
36535
|
});
|
|
36237
36536
|
};
|
|
36238
36537
|
var Studio = ({ rootComponent, readOnly, visualModeEnabled }) => {
|
|
36239
|
-
|
|
36538
|
+
useLayoutEffect5(() => {
|
|
36240
36539
|
injectCSS();
|
|
36241
36540
|
}, []);
|
|
36242
36541
|
return /* @__PURE__ */ jsx305(FastRefreshProvider, {
|