remotion 4.0.535 → 4.0.537
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/cjs/AbsoluteFill.d.ts +1 -1
- package/dist/cjs/CompositionManagerContext.d.ts +3 -0
- package/dist/cjs/CompositionManagerContext.js +5 -3
- package/dist/cjs/CompositionManagerProvider.js +3 -1
- package/dist/cjs/HtmlInCanvas.d.ts +4 -2
- package/dist/cjs/HtmlInCanvas.js +70 -19
- package/dist/cjs/Img.d.ts +4 -2
- package/dist/cjs/Img.js +2 -2
- package/dist/cjs/Interactive.d.ts +21 -7
- package/dist/cjs/Interactive.js +22 -1
- package/dist/cjs/Sequence.js +47 -3
- package/dist/cjs/SequenceActivityBoundary.js +14 -1
- package/dist/cjs/SequenceActivityBudget.js +26 -11
- package/dist/cjs/SequenceActivitySuspensionProvider.d.ts +4 -0
- package/dist/cjs/SequenceActivitySuspensionProvider.js +45 -0
- package/dist/cjs/SequenceManager.d.ts +5 -0
- package/dist/cjs/SequenceManager.js +22 -4
- package/dist/cjs/Track.js +1 -2
- package/dist/cjs/animated-image/AnimatedImage.d.ts +3 -2
- package/dist/cjs/animated-image/AnimatedImage.js +17 -10
- package/dist/cjs/animated-image/canvas.d.ts +2 -1
- package/dist/cjs/animated-image/canvas.js +2 -2
- package/dist/cjs/animated-image/props.d.ts +2 -1
- package/dist/cjs/asset-types.d.ts +4 -0
- package/dist/cjs/audio/shared-audio-tags.d.ts +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +1 -1
- package/dist/cjs/canvas-image/CanvasImage.d.ts +3 -2
- package/dist/cjs/canvas-image/CanvasImage.js +4 -4
- package/dist/cjs/canvas-image/props.d.ts +2 -1
- package/dist/cjs/effects/Solid.d.ts +3 -2
- package/dist/cjs/effects/Solid.js +4 -4
- package/dist/cjs/effects/effect-types.d.ts +4 -0
- package/dist/cjs/effects/index.d.ts +1 -1
- package/dist/cjs/effects/run-effect-chain.d.ts +3 -1
- package/dist/cjs/effects/run-effect-chain.js +94 -56
- package/dist/cjs/effects/use-effect-chain-state.d.ts +2 -1
- package/dist/cjs/effects/use-effect-chain-state.js +11 -2
- package/dist/cjs/effects/use-memoized-effects.js +86 -44
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/interactivity-schema.d.ts +5 -5
- package/dist/cjs/interactivity-schema.js +2 -1
- package/dist/cjs/internals.d.ts +11 -10
- package/dist/cjs/internals.js +1 -1
- package/dist/cjs/interpolate.js +8 -1
- package/dist/cjs/no-react.d.ts +1 -1
- package/dist/cjs/sequence-activity-context.d.ts +1 -1
- package/dist/cjs/sequence-activity-context.js +4 -3
- package/dist/cjs/sequence-activity-defaults.d.ts +1 -1
- package/dist/cjs/sequence-activity-defaults.js +1 -1
- package/dist/cjs/timeline-position-state.d.ts +1 -0
- package/dist/cjs/timeline-position-state.js +21 -1
- package/dist/cjs/timeline-track-context.d.ts +0 -1
- package/dist/cjs/timeline-track-context.js +1 -2
- package/dist/cjs/use-current-frame.d.ts +1 -0
- package/dist/cjs/use-current-frame.js +14 -7
- package/dist/cjs/use-schema.js +3 -1
- package/dist/cjs/use-timeline-seek.d.ts +1 -0
- package/dist/cjs/use-timeline-seek.js +10 -0
- package/dist/cjs/validation/validate-duration-in-frames.js +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/seek-until-right.js +11 -7
- package/dist/cjs/with-interactivity-schema.js +18 -16
- package/dist/cjs/wrap-remotion-context.d.ts +0 -1
- package/dist/cjs/wrap-remotion-context.js +1 -4
- package/dist/esm/index.mjs +951 -720
- package/dist/esm/no-react.mjs +7 -6
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/cjs/nonce.d.ts +0 -11
- package/dist/cjs/nonce.js +0 -42
- package/dist/cjs/sequence-order-marker.d.ts +0 -58
- package/dist/cjs/sequence-order-marker.js +0 -44
package/dist/esm/index.mjs
CHANGED
|
@@ -27,6 +27,7 @@ __export(exports_timeline_position_state, {
|
|
|
27
27
|
usePlaying: () => usePlaying,
|
|
28
28
|
useTimelineContext: () => useTimelineContext,
|
|
29
29
|
useTimelinePosition: () => useTimelinePosition,
|
|
30
|
+
useTimelinePositionWithOptionalSubscription: () => useTimelinePositionWithOptionalSubscription,
|
|
30
31
|
useTimelineSeekFrame: () => useTimelineSeekFrame,
|
|
31
32
|
useTimelineSetFrameWithoutSeek: () => useTimelineSetFrameWithoutSeek
|
|
32
33
|
});
|
|
@@ -284,13 +285,15 @@ class CompositionErrorBoundary extends React5.Component {
|
|
|
284
285
|
// src/CompositionManagerContext.tsx
|
|
285
286
|
import { createContext as createContext7 } from "react";
|
|
286
287
|
var getAssetPreviewCompositionId = (asset) => `asset:${asset}`;
|
|
287
|
-
var
|
|
288
|
+
var defaultCompositionManagerContext = {
|
|
288
289
|
compositions: [],
|
|
289
290
|
folders: [],
|
|
290
291
|
currentCompositionMetadata: null,
|
|
291
292
|
currentAssetMetadata: null,
|
|
292
293
|
canvasContent: null
|
|
293
|
-
}
|
|
294
|
+
};
|
|
295
|
+
var CompositionManager = createContext7(defaultCompositionManagerContext);
|
|
296
|
+
var CompositionManagerRefContext = createContext7({ current: defaultCompositionManagerContext });
|
|
294
297
|
var CompositionSetters = createContext7({
|
|
295
298
|
setCanvasContent: () => {
|
|
296
299
|
return;
|
|
@@ -761,12 +764,12 @@ function validateDurationInFrames(durationInFrames, options) {
|
|
|
761
764
|
if (durationInFrames <= 0) {
|
|
762
765
|
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
763
766
|
}
|
|
764
|
-
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
765
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
766
|
-
}
|
|
767
767
|
if (!Number.isFinite(durationInFrames)) {
|
|
768
768
|
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
769
769
|
}
|
|
770
|
+
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
771
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
772
|
+
}
|
|
770
773
|
}
|
|
771
774
|
|
|
772
775
|
// src/validation/validate-fps.ts
|
|
@@ -1741,7 +1744,7 @@ var getStackForControls = (controls) => {
|
|
|
1741
1744
|
};
|
|
1742
1745
|
|
|
1743
1746
|
// src/version.ts
|
|
1744
|
-
var VERSION = "4.0.
|
|
1747
|
+
var VERSION = "4.0.537";
|
|
1745
1748
|
|
|
1746
1749
|
// src/multiple-versions-warning.ts
|
|
1747
1750
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1778,15 +1781,15 @@ var Null = () => {
|
|
|
1778
1781
|
};
|
|
1779
1782
|
|
|
1780
1783
|
// src/Sequence.tsx
|
|
1781
|
-
import {
|
|
1782
|
-
createContext as
|
|
1784
|
+
import React26, {
|
|
1785
|
+
createContext as createContext28,
|
|
1783
1786
|
forwardRef as forwardRef3,
|
|
1784
1787
|
useCallback as useCallback7,
|
|
1785
|
-
useContext as
|
|
1788
|
+
useContext as useContext28,
|
|
1786
1789
|
useLayoutEffect as useLayoutEffect8,
|
|
1787
|
-
useMemo as
|
|
1790
|
+
useMemo as useMemo20,
|
|
1788
1791
|
useRef as useRef8,
|
|
1789
|
-
useState as
|
|
1792
|
+
useState as useState9
|
|
1790
1793
|
} from "react";
|
|
1791
1794
|
|
|
1792
1795
|
// src/DefaultPremountContext.ts
|
|
@@ -1805,17 +1808,18 @@ var DEFAULT_PREMOUNT_IN_SECONDS = ENABLE_V5_BREAKING_CHANGES ? 2 : 0;
|
|
|
1805
1808
|
var DefaultPremountContext = createContext17(DEFAULT_PREMOUNT_IN_SECONDS);
|
|
1806
1809
|
|
|
1807
1810
|
// src/freeze.tsx
|
|
1808
|
-
import { createContext as
|
|
1811
|
+
import { createContext as createContext21, useContext as useContext17, useMemo as useMemo11 } from "react";
|
|
1809
1812
|
|
|
1810
1813
|
// src/sequence-activity-context.ts
|
|
1811
1814
|
import { createContext as createContext18, useContext as useContext11 } from "react";
|
|
1812
1815
|
|
|
1813
1816
|
// src/sequence-activity-defaults.ts
|
|
1814
|
-
var DEFAULT_SEQUENCE_ACTIVITY_LIMIT =
|
|
1817
|
+
var DEFAULT_SEQUENCE_ACTIVITY_LIMIT = Infinity;
|
|
1815
1818
|
|
|
1816
1819
|
// src/sequence-activity-context.ts
|
|
1817
1820
|
var SequenceActivityContext = createContext18(false);
|
|
1818
1821
|
var SequenceActivityDormantContext = createContext18(false);
|
|
1822
|
+
var SequenceActivitySuspensionContext = createContext18(false);
|
|
1819
1823
|
var SequenceActivitySettingsContext = createContext18(null);
|
|
1820
1824
|
var SequenceActivityTimelineContext = createContext18(null);
|
|
1821
1825
|
var SequenceActivityAbsoluteTimeContext = createContext18(null);
|
|
@@ -1824,7 +1828,7 @@ var SequenceContent = ({ children }) => {
|
|
|
1824
1828
|
};
|
|
1825
1829
|
|
|
1826
1830
|
// src/timeline-position-state.ts
|
|
1827
|
-
import { useContext as useContext14 } from "react";
|
|
1831
|
+
import { createContext as createContext20, useContext as useContext14 } from "react";
|
|
1828
1832
|
|
|
1829
1833
|
// src/TimelineContext.tsx
|
|
1830
1834
|
import {
|
|
@@ -1867,11 +1871,21 @@ var createRuntimeValueStore = (initialSnapshot) => {
|
|
|
1867
1871
|
import { useMemo as useMemo9, useRef as useRef2 } from "react";
|
|
1868
1872
|
var useTimelineSeek = (setFrame) => {
|
|
1869
1873
|
const revision = useRef2(0);
|
|
1874
|
+
const listeners = useRef2(new Set);
|
|
1870
1875
|
return useMemo9(() => ({
|
|
1871
1876
|
revision,
|
|
1872
1877
|
seekFrame: (frame) => {
|
|
1873
1878
|
revision.current++;
|
|
1879
|
+
for (const listener of listeners.current) {
|
|
1880
|
+
listener();
|
|
1881
|
+
}
|
|
1874
1882
|
setFrame(frame);
|
|
1883
|
+
},
|
|
1884
|
+
subscribe: (listener) => {
|
|
1885
|
+
listeners.current.add(listener);
|
|
1886
|
+
return () => {
|
|
1887
|
+
listeners.current.delete(listener);
|
|
1888
|
+
};
|
|
1875
1889
|
}
|
|
1876
1890
|
}), [setFrame]);
|
|
1877
1891
|
};
|
|
@@ -2009,6 +2023,7 @@ var useBuffering = () => {
|
|
|
2009
2023
|
};
|
|
2010
2024
|
|
|
2011
2025
|
// src/timeline-position-state.ts
|
|
2026
|
+
var UnsubscribedTimelineContext = createContext20(null);
|
|
2012
2027
|
var makeKey = () => {
|
|
2013
2028
|
return `remotion.time-all`;
|
|
2014
2029
|
};
|
|
@@ -2038,6 +2053,9 @@ var useTimelinePositionFromContext = (state) => {
|
|
|
2038
2053
|
const videoConfig = useVideo();
|
|
2039
2054
|
const env = useRemotionEnvironment();
|
|
2040
2055
|
const dormant = useContext14(SequenceActivityDormantContext);
|
|
2056
|
+
if (state === null) {
|
|
2057
|
+
return 0;
|
|
2058
|
+
}
|
|
2041
2059
|
if (!videoConfig) {
|
|
2042
2060
|
return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
|
|
2043
2061
|
}
|
|
@@ -2063,6 +2081,15 @@ var useTimelinePosition = () => {
|
|
|
2063
2081
|
const state = useTimelineContext();
|
|
2064
2082
|
return useTimelinePositionFromContext(state);
|
|
2065
2083
|
};
|
|
2084
|
+
var useTimelinePositionWithOptionalSubscription = (subscribe) => {
|
|
2085
|
+
const dormant = useContext14(SequenceActivityDormantContext);
|
|
2086
|
+
const state = useContext14(subscribe ? dormant ? SequenceActivityTimelineContext : TimelineContext : UnsubscribedTimelineContext);
|
|
2087
|
+
const frame = useTimelinePositionFromContext(state);
|
|
2088
|
+
if (subscribe && state === null) {
|
|
2089
|
+
throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
2090
|
+
}
|
|
2091
|
+
return frame;
|
|
2092
|
+
};
|
|
2066
2093
|
var useIsInsideFreeze = () => {
|
|
2067
2094
|
return useTimelineContext().isInsideFreeze;
|
|
2068
2095
|
};
|
|
@@ -2085,7 +2112,7 @@ var useTimelineSeekFrame = () => {
|
|
|
2085
2112
|
|
|
2086
2113
|
// src/use-current-frame.ts
|
|
2087
2114
|
import { useContext as useContext15 } from "react";
|
|
2088
|
-
var
|
|
2115
|
+
var useCurrentFrameWithOptionalSubscription = (subscribe) => {
|
|
2089
2116
|
const canUseRemotionHooks = useContext15(CanUseRemotionHooks);
|
|
2090
2117
|
const env = useRemotionEnvironment();
|
|
2091
2118
|
if (!canUseRemotionHooks) {
|
|
@@ -2094,11 +2121,17 @@ var useCurrentFrame = () => {
|
|
|
2094
2121
|
}
|
|
2095
2122
|
throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
|
|
2096
2123
|
}
|
|
2097
|
-
const frame =
|
|
2124
|
+
const frame = useTimelinePositionWithOptionalSubscription(subscribe);
|
|
2098
2125
|
const context = useContext15(SequenceContext);
|
|
2126
|
+
if (!subscribe) {
|
|
2127
|
+
return 0;
|
|
2128
|
+
}
|
|
2099
2129
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
2100
2130
|
return (frame - contextOffset) * (context?.playbackRate ?? 1);
|
|
2101
2131
|
};
|
|
2132
|
+
var useCurrentFrame = () => {
|
|
2133
|
+
return useCurrentFrameWithOptionalSubscription(true);
|
|
2134
|
+
};
|
|
2102
2135
|
|
|
2103
2136
|
// src/use-video-config.ts
|
|
2104
2137
|
import { useContext as useContext16 } from "react";
|
|
@@ -2124,7 +2157,7 @@ var useVideoConfig = () => {
|
|
|
2124
2157
|
|
|
2125
2158
|
// src/freeze.tsx
|
|
2126
2159
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2127
|
-
var NonPremountFreezeContext =
|
|
2160
|
+
var NonPremountFreezeContext = createContext21(false);
|
|
2128
2161
|
var useIsInsideNonPremountFreeze = () => useContext17(NonPremountFreezeContext);
|
|
2129
2162
|
var Freeze = ({
|
|
2130
2163
|
frame: frameToFreeze,
|
|
@@ -2451,7 +2484,7 @@ var childrenSchema = {
|
|
|
2451
2484
|
var premountSchema = {
|
|
2452
2485
|
premountFor: {
|
|
2453
2486
|
type: "number",
|
|
2454
|
-
default:
|
|
2487
|
+
default: undefined,
|
|
2455
2488
|
description: "Premount For",
|
|
2456
2489
|
min: 0,
|
|
2457
2490
|
step: 1,
|
|
@@ -2659,8 +2692,8 @@ var sequenceSchemaDefaultLayoutNone = {
|
|
|
2659
2692
|
};
|
|
2660
2693
|
|
|
2661
2694
|
// src/loop/loop-context.ts
|
|
2662
|
-
import { createContext as
|
|
2663
|
-
var LoopContext =
|
|
2695
|
+
import { createContext as createContext22 } from "react";
|
|
2696
|
+
var LoopContext = createContext22(null);
|
|
2664
2697
|
|
|
2665
2698
|
// src/resolve-sequence-duration.ts
|
|
2666
2699
|
var resolveSequenceContentDuration = ({
|
|
@@ -2765,6 +2798,16 @@ var SequenceOutlineInternals = {
|
|
|
2765
2798
|
// src/SequenceActivityBoundary.tsx
|
|
2766
2799
|
import React18, { useContext as useContext18, useMemo as useMemo12 } from "react";
|
|
2767
2800
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2801
|
+
var suspendedActivity = { then: () => {
|
|
2802
|
+
return;
|
|
2803
|
+
} };
|
|
2804
|
+
var SuspendSequenceActivity = ({ children, dormant }) => {
|
|
2805
|
+
const suspended = useContext18(SequenceActivitySuspensionContext);
|
|
2806
|
+
if (dormant && suspended) {
|
|
2807
|
+
throw suspendedActivity;
|
|
2808
|
+
}
|
|
2809
|
+
return children;
|
|
2810
|
+
};
|
|
2768
2811
|
var areActivityChildrenEqual = (previous, next) => {
|
|
2769
2812
|
if (Object.is(previous, next)) {
|
|
2770
2813
|
return true;
|
|
@@ -2806,7 +2849,10 @@ var SequenceActivityBoundary = ({ children, dormant, frame }) => {
|
|
|
2806
2849
|
value: dormant ? dormantTimeline : absoluteTime,
|
|
2807
2850
|
children: /* @__PURE__ */ jsx12(React18.Activity, {
|
|
2808
2851
|
mode: dormant && !parentDormant ? "hidden" : "visible",
|
|
2809
|
-
children
|
|
2852
|
+
children: /* @__PURE__ */ jsx12(SuspendSequenceActivity, {
|
|
2853
|
+
dormant,
|
|
2854
|
+
children
|
|
2855
|
+
})
|
|
2810
2856
|
})
|
|
2811
2857
|
})
|
|
2812
2858
|
})
|
|
@@ -2816,7 +2862,7 @@ var SequenceActivityBoundary = ({ children, dormant, frame }) => {
|
|
|
2816
2862
|
};
|
|
2817
2863
|
|
|
2818
2864
|
// src/SequenceActivityBudget.tsx
|
|
2819
|
-
import React19, { createContext as
|
|
2865
|
+
import React19, { createContext as createContext23, useContext as useContext19, useMemo as useMemo13, useState as useState4 } from "react";
|
|
2820
2866
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2821
2867
|
var useCommitEffect = React19.useInsertionEffect ?? React19.useLayoutEffect;
|
|
2822
2868
|
var createActivityBudget = () => {
|
|
@@ -2825,13 +2871,17 @@ var createActivityBudget = () => {
|
|
|
2825
2871
|
let frame = {};
|
|
2826
2872
|
let limit = DEFAULT_SEQUENCE_ACTIVITY_LIMIT;
|
|
2827
2873
|
let scheduled = false;
|
|
2874
|
+
let suspended = false;
|
|
2828
2875
|
const schedule = () => {
|
|
2829
|
-
if (scheduled) {
|
|
2876
|
+
if (scheduled || suspended) {
|
|
2830
2877
|
return;
|
|
2831
2878
|
}
|
|
2832
2879
|
scheduled = true;
|
|
2833
2880
|
queueMicrotask(() => {
|
|
2834
2881
|
scheduled = false;
|
|
2882
|
+
if (suspended) {
|
|
2883
|
+
return;
|
|
2884
|
+
}
|
|
2835
2885
|
const ranked = [...candidates.values()].filter((candidate) => candidate.end > candidate.from).map((candidate) => {
|
|
2836
2886
|
const currentFrame = frame[candidate.compositionId] ?? 0;
|
|
2837
2887
|
return {
|
|
@@ -2865,6 +2915,12 @@ var createActivityBudget = () => {
|
|
|
2865
2915
|
};
|
|
2866
2916
|
return {
|
|
2867
2917
|
...registry,
|
|
2918
|
+
setSuspended: (next) => {
|
|
2919
|
+
if (suspended !== next) {
|
|
2920
|
+
suspended = next;
|
|
2921
|
+
schedule();
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2868
2924
|
setLimit: (next) => {
|
|
2869
2925
|
if (limit !== next) {
|
|
2870
2926
|
limit = next;
|
|
@@ -2885,25 +2941,27 @@ var createActivityBudget = () => {
|
|
|
2885
2941
|
}
|
|
2886
2942
|
};
|
|
2887
2943
|
};
|
|
2888
|
-
var ActivityBudgetContext =
|
|
2889
|
-
var InactiveTimelineContext =
|
|
2944
|
+
var ActivityBudgetContext = createContext23(null);
|
|
2945
|
+
var InactiveTimelineContext = createContext23(null);
|
|
2890
2946
|
var emptySelection = new Set;
|
|
2891
|
-
var ActivitySelectionContext =
|
|
2947
|
+
var ActivitySelectionContext = createContext23(emptySelection);
|
|
2892
2948
|
var SequenceActivityBudgetProvider = ({ children }) => {
|
|
2893
2949
|
const enabled = useContext19(SequenceActivityContext);
|
|
2894
2950
|
const settings = useContext19(SequenceActivitySettingsContext);
|
|
2951
|
+
const suspended = useContext19(SequenceActivitySuspensionContext);
|
|
2895
2952
|
const limit = settings?.limit ?? DEFAULT_SEQUENCE_ACTIVITY_LIMIT;
|
|
2896
|
-
const admitting = enabled && limit > 0;
|
|
2953
|
+
const admitting = enabled && limit > 0 && limit !== Infinity;
|
|
2897
2954
|
const [budget] = useState4(createActivityBudget);
|
|
2898
|
-
const timeline = useContext19(admitting ? TimelineContext : InactiveTimelineContext);
|
|
2955
|
+
const timeline = useContext19(admitting && !suspended ? TimelineContext : InactiveTimelineContext);
|
|
2899
2956
|
const selected = useSyncExternalStore2(budget.subscribe, budget.getSnapshot, budget.getSnapshot);
|
|
2900
2957
|
const admitted = useMemo13(() => !admitting ? emptySelection : selected.size > limit ? new Set([...selected].slice(0, limit)) : selected, [admitting, limit, selected]);
|
|
2901
2958
|
useCommitEffect(() => {
|
|
2959
|
+
budget.setSuspended(suspended);
|
|
2902
2960
|
budget.setLimit(admitting ? limit : 0);
|
|
2903
2961
|
if (admitting && timeline !== null) {
|
|
2904
2962
|
budget.setFrame(timeline.frame);
|
|
2905
2963
|
}
|
|
2906
|
-
}, [admitting, budget, limit, timeline]);
|
|
2964
|
+
}, [admitting, budget, limit, suspended, timeline]);
|
|
2907
2965
|
return /* @__PURE__ */ jsx13(ActivityBudgetContext.Provider, {
|
|
2908
2966
|
value: admitting ? budget : null,
|
|
2909
2967
|
children: /* @__PURE__ */ jsx13(ActivitySelectionContext.Provider, {
|
|
@@ -2916,7 +2974,7 @@ var useSequenceActivityAdmission = (candidate) => {
|
|
|
2916
2974
|
const budget = useContext19(ActivityBudgetContext);
|
|
2917
2975
|
const enabled = useContext19(SequenceActivityContext);
|
|
2918
2976
|
const settings = useContext19(SequenceActivitySettingsContext);
|
|
2919
|
-
const unlimited = enabled && settings?.limit ===
|
|
2977
|
+
const unlimited = enabled && (settings?.limit ?? DEFAULT_SEQUENCE_ACTIVITY_LIMIT) === Infinity;
|
|
2920
2978
|
const selected = useContext19(ActivitySelectionContext);
|
|
2921
2979
|
const id = candidate?.id ?? null;
|
|
2922
2980
|
const parent = candidate?.parent ?? null;
|
|
@@ -2933,7 +2991,7 @@ var useSequenceActivityAdmission = (candidate) => {
|
|
|
2933
2991
|
};
|
|
2934
2992
|
|
|
2935
2993
|
// src/SequenceManager.tsx
|
|
2936
|
-
import
|
|
2994
|
+
import React23, { useCallback as useCallback6, useContext as useContext23, useMemo as useMemo15, useRef as useRef5, useState as useState7 } from "react";
|
|
2937
2995
|
|
|
2938
2996
|
// src/sequence-registry-context.tsx
|
|
2939
2997
|
import React20, { useContext as useContext20 } from "react";
|
|
@@ -2969,17 +3027,59 @@ var DisableSequenceRegistrationContext = React20.createContext(false);
|
|
|
2969
3027
|
var DisableSequenceRegistrationProvider = ({ children }) => {
|
|
2970
3028
|
return React20.createElement(DisableSequenceRegistrationContext.Provider, { value: true }, children);
|
|
2971
3029
|
};
|
|
2972
|
-
// src/
|
|
2973
|
-
import
|
|
3030
|
+
// src/SequenceActivitySuspensionProvider.tsx
|
|
3031
|
+
import { useContext as useContext21, useEffect as useEffect5, useState as useState5 } from "react";
|
|
2974
3032
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2975
|
-
var
|
|
3033
|
+
var SequenceActivitySuspensionProvider = ({ children }) => {
|
|
3034
|
+
const enabled = useContext21(SequenceActivityContext);
|
|
3035
|
+
const { isPlaying, subscribePlaying, seek } = useContext21(SetTimelineContext);
|
|
3036
|
+
const [suspended, setSuspended] = useState5(false);
|
|
3037
|
+
useEffect5(() => {
|
|
3038
|
+
if (!enabled) {
|
|
3039
|
+
setSuspended(false);
|
|
3040
|
+
return;
|
|
3041
|
+
}
|
|
3042
|
+
let timeout = null;
|
|
3043
|
+
const update = () => {
|
|
3044
|
+
setSuspended(isPlaying() || timeout !== null);
|
|
3045
|
+
};
|
|
3046
|
+
const unsubscribePlaying = subscribePlaying(update);
|
|
3047
|
+
const unsubscribeSeek = seek?.subscribe(() => {
|
|
3048
|
+
setSuspended(true);
|
|
3049
|
+
if (timeout !== null) {
|
|
3050
|
+
clearTimeout(timeout);
|
|
3051
|
+
}
|
|
3052
|
+
timeout = setTimeout(() => {
|
|
3053
|
+
timeout = null;
|
|
3054
|
+
update();
|
|
3055
|
+
}, 150);
|
|
3056
|
+
});
|
|
3057
|
+
update();
|
|
3058
|
+
return () => {
|
|
3059
|
+
unsubscribePlaying();
|
|
3060
|
+
unsubscribeSeek?.();
|
|
3061
|
+
if (timeout !== null) {
|
|
3062
|
+
clearTimeout(timeout);
|
|
3063
|
+
}
|
|
3064
|
+
};
|
|
3065
|
+
}, [enabled, isPlaying, seek, subscribePlaying]);
|
|
3066
|
+
return /* @__PURE__ */ jsx14(SequenceActivitySuspensionContext.Provider, {
|
|
3067
|
+
value: suspended,
|
|
3068
|
+
children
|
|
3069
|
+
});
|
|
3070
|
+
};
|
|
3071
|
+
|
|
3072
|
+
// src/SequenceRegistryProvider.tsx
|
|
3073
|
+
import React22, { useCallback as useCallback5, useContext as useContext22, useMemo as useMemo14, useRef as useRef4, useState as useState6 } from "react";
|
|
3074
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3075
|
+
var useIsomorphicLayoutEffect3 = typeof window === "undefined" ? React22.useEffect : React22.useLayoutEffect;
|
|
2976
3076
|
var SequenceManagerRefProvider = withCommittedMetadata(SequenceManagerRefContext.Provider);
|
|
2977
3077
|
var SequenceRegistryProvider = ({ children }) => {
|
|
2978
3078
|
const { isStudio } = useRemotionEnvironment();
|
|
2979
|
-
const sequenceRegistrationEnabled =
|
|
3079
|
+
const sequenceRegistrationEnabled = useContext22(SequenceRegistrationContext);
|
|
2980
3080
|
const shouldObserveCommits = isStudio || sequenceRegistrationEnabled;
|
|
2981
|
-
const [sequenceManagerId] =
|
|
2982
|
-
const [commitRegistrationEnabled, setCommitRegistrationEnabled] =
|
|
3081
|
+
const [sequenceManagerId] = useState6(() => String(Math.random()));
|
|
3082
|
+
const [commitRegistrationEnabled, setCommitRegistrationEnabled] = useState6(() => shouldObserveCommits && isCommitRegistrationObserverInstalled());
|
|
2983
3083
|
const observedCommitRef = useRef4(false);
|
|
2984
3084
|
const rootObservationFailedRef = useRef4(false);
|
|
2985
3085
|
const committedRegistrationIdsRef = useRef4(new Set);
|
|
@@ -2992,7 +3092,7 @@ var SequenceRegistryProvider = ({ children }) => {
|
|
|
2992
3092
|
const registrationUnmountedRef = useRef4(false);
|
|
2993
3093
|
const committedOrderRef = useRef4(null);
|
|
2994
3094
|
const committedOrderIdsRef = useRef4(null);
|
|
2995
|
-
const [registry] =
|
|
3095
|
+
const [registry] = useState6(() => createRegistryStore([]));
|
|
2996
3096
|
const setSequences = registry.setSnapshot;
|
|
2997
3097
|
const sequencesRef = useMemo14(() => ({
|
|
2998
3098
|
get current() {
|
|
@@ -3195,16 +3295,16 @@ var SequenceRegistryProvider = ({ children }) => {
|
|
|
3195
3295
|
sequenceManagerId,
|
|
3196
3296
|
shouldObserveCommits
|
|
3197
3297
|
]);
|
|
3198
|
-
return /* @__PURE__ */
|
|
3298
|
+
return /* @__PURE__ */ jsx15(SequenceManagerRefProvider, {
|
|
3199
3299
|
value: sequencesRef,
|
|
3200
3300
|
_remotionCommitMetadata: metadata,
|
|
3201
|
-
children: /* @__PURE__ */
|
|
3301
|
+
children: /* @__PURE__ */ jsx15(SequenceRegistryScopeContext.Provider, {
|
|
3202
3302
|
value: registryScope,
|
|
3203
|
-
children: /* @__PURE__ */
|
|
3303
|
+
children: /* @__PURE__ */ jsx15(SequenceManagerActionsContext.Provider, {
|
|
3204
3304
|
value: actions,
|
|
3205
|
-
children: /* @__PURE__ */
|
|
3305
|
+
children: /* @__PURE__ */ jsx15(SequenceRegistryContext.Provider, {
|
|
3206
3306
|
value: registry,
|
|
3207
|
-
children: /* @__PURE__ */
|
|
3307
|
+
children: /* @__PURE__ */ jsx15(SequenceCommitRegistrationContext.Provider, {
|
|
3208
3308
|
value: commitRegistrationEnabled,
|
|
3209
3309
|
children
|
|
3210
3310
|
})
|
|
@@ -3215,25 +3315,28 @@ var SequenceRegistryProvider = ({ children }) => {
|
|
|
3215
3315
|
};
|
|
3216
3316
|
|
|
3217
3317
|
// src/SequenceManager.tsx
|
|
3218
|
-
import { jsx as
|
|
3219
|
-
var useIsomorphicLayoutEffect4 = typeof window === "undefined" ?
|
|
3220
|
-
var
|
|
3221
|
-
var
|
|
3318
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
3319
|
+
var useIsomorphicLayoutEffect4 = typeof window === "undefined" ? React23.useEffect : React23.useLayoutEffect;
|
|
3320
|
+
var useCommitEffect2 = React23.useInsertionEffect ?? useIsomorphicLayoutEffect4;
|
|
3321
|
+
var VisualModeDragOverridesSubscriptionContext = React23.createContext(null);
|
|
3322
|
+
var ActiveFromDragOverrideKeysContext = React23.createContext(null);
|
|
3222
3323
|
var SequenceManagerScopeProviders = ({ children, dragOverridesSubscription, fromKeys }) => {
|
|
3223
3324
|
const { isStudio } = useRemotionEnvironment();
|
|
3224
|
-
const activitySettings =
|
|
3225
|
-
const commitRegistrationEnabled =
|
|
3226
|
-
const manager =
|
|
3325
|
+
const activitySettings = useContext23(SequenceActivitySettingsContext);
|
|
3326
|
+
const commitRegistrationEnabled = useContext23(SequenceCommitRegistrationContext);
|
|
3327
|
+
const manager = useContext23(SequenceManagerActionsContext);
|
|
3227
3328
|
const scopedDragOverridesSubscription = useMemo15(() => ({ ...dragOverridesSubscription, manager }), [dragOverridesSubscription, manager]);
|
|
3228
3329
|
const activeFromDragOverrideKeys = useMemo15(() => ({ manager, keys: fromKeys }), [fromKeys, manager]);
|
|
3229
|
-
return /* @__PURE__ */
|
|
3330
|
+
return /* @__PURE__ */ jsx16(ActiveFromDragOverrideKeysContext.Provider, {
|
|
3230
3331
|
value: activeFromDragOverrideKeys,
|
|
3231
|
-
children: /* @__PURE__ */
|
|
3332
|
+
children: /* @__PURE__ */ jsx16(VisualModeDragOverridesSubscriptionContext.Provider, {
|
|
3232
3333
|
value: scopedDragOverridesSubscription,
|
|
3233
|
-
children: /* @__PURE__ */
|
|
3234
|
-
value: activitySettings?.
|
|
3235
|
-
children: /* @__PURE__ */
|
|
3236
|
-
children
|
|
3334
|
+
children: /* @__PURE__ */ jsx16(SequenceActivityContext.Provider, {
|
|
3335
|
+
value: (activitySettings?.limit ?? DEFAULT_SEQUENCE_ACTIVITY_LIMIT) > 0 && isStudio && commitRegistrationEnabled && typeof React23.Activity !== "undefined",
|
|
3336
|
+
children: /* @__PURE__ */ jsx16(SequenceActivitySuspensionProvider, {
|
|
3337
|
+
children: /* @__PURE__ */ jsx16(SequenceActivityBudgetProvider, {
|
|
3338
|
+
children
|
|
3339
|
+
})
|
|
3237
3340
|
})
|
|
3238
3341
|
})
|
|
3239
3342
|
})
|
|
@@ -3245,10 +3348,10 @@ var emptyEffectDragOverrides = {};
|
|
|
3245
3348
|
var makeSequencePropsSubscriptionKey = (key) => {
|
|
3246
3349
|
return `${key.absolutePath}\x00${key.nodePath.join(".")}\x00${key.sequenceKeys.join(".")}\x00${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
|
|
3247
3350
|
};
|
|
3248
|
-
var VisualModePropStatusesContext =
|
|
3351
|
+
var VisualModePropStatusesContext = React23.createContext({
|
|
3249
3352
|
propStatuses: {}
|
|
3250
3353
|
});
|
|
3251
|
-
var VisualModePropStatusesRefContext =
|
|
3354
|
+
var VisualModePropStatusesRefContext = React23.createContext({
|
|
3252
3355
|
current: {}
|
|
3253
3356
|
});
|
|
3254
3357
|
var defaultVisualModeDragOverrides = {
|
|
@@ -3259,36 +3362,48 @@ var defaultVisualModeDragOverrides = {
|
|
|
3259
3362
|
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
3260
3363
|
}
|
|
3261
3364
|
};
|
|
3262
|
-
var VisualModeDragOverridesContext =
|
|
3263
|
-
var VisualModeDragOverridesRefContext =
|
|
3365
|
+
var VisualModeDragOverridesContext = React23.createContext(defaultVisualModeDragOverrides);
|
|
3366
|
+
var VisualModeDragOverridesRefContext = React23.createContext({ current: defaultVisualModeDragOverrides });
|
|
3367
|
+
var useDragOverrideSnapshot = (subscribe, getSnapshot) => {
|
|
3368
|
+
const dormant = useContext23(SequenceActivityDormantContext);
|
|
3369
|
+
const [, forceUpdate] = useState7(0);
|
|
3370
|
+
const snapshot = useSyncExternalStore2(subscribe, getSnapshot, getSnapshot);
|
|
3371
|
+
useCommitEffect2(() => {
|
|
3372
|
+
if (!dormant) {
|
|
3373
|
+
return;
|
|
3374
|
+
}
|
|
3375
|
+
return subscribe(() => forceUpdate((current) => current + 1));
|
|
3376
|
+
}, [dormant, subscribe]);
|
|
3377
|
+
return snapshot;
|
|
3378
|
+
};
|
|
3264
3379
|
var useDragOverridesForNodePath = (nodePath) => {
|
|
3265
|
-
const subscription =
|
|
3266
|
-
const manager =
|
|
3380
|
+
const subscription = useContext23(VisualModeDragOverridesSubscriptionContext);
|
|
3381
|
+
const manager = useContext23(SequenceManagerActionsContext);
|
|
3267
3382
|
const scopedSubscription = subscription?.manager === manager ? subscription : null;
|
|
3268
3383
|
const key = nodePath === null ? null : makeSequencePropsSubscriptionKey(nodePath);
|
|
3269
3384
|
const subscribe = useCallback6((listener) => scopedSubscription?.subscribe(key, listener) ?? (() => {
|
|
3270
3385
|
return;
|
|
3271
3386
|
}), [key, scopedSubscription]);
|
|
3272
3387
|
const getSnapshot = useCallback6(() => scopedSubscription?.getSnapshot(key) ?? emptyDragOverrides, [key, scopedSubscription]);
|
|
3273
|
-
return
|
|
3388
|
+
return useDragOverrideSnapshot(subscribe, getSnapshot);
|
|
3274
3389
|
};
|
|
3275
3390
|
var useActiveFromDragOverrideKeys = () => {
|
|
3276
|
-
const snapshot =
|
|
3277
|
-
const manager =
|
|
3391
|
+
const snapshot = useContext23(ActiveFromDragOverrideKeysContext);
|
|
3392
|
+
const manager = useContext23(SequenceManagerActionsContext);
|
|
3278
3393
|
return snapshot?.manager === manager ? snapshot.keys : emptyFromOverrideKeys;
|
|
3279
3394
|
};
|
|
3280
3395
|
var useEffectDragOverridesForNodePath = (nodePath) => {
|
|
3281
|
-
const subscription =
|
|
3282
|
-
const manager =
|
|
3396
|
+
const subscription = useContext23(VisualModeDragOverridesSubscriptionContext);
|
|
3397
|
+
const manager = useContext23(SequenceManagerActionsContext);
|
|
3283
3398
|
const scopedSubscription = subscription?.manager === manager ? subscription : null;
|
|
3284
3399
|
const key = nodePath === null ? null : makeSequencePropsSubscriptionKey(nodePath);
|
|
3285
3400
|
const subscribe = useCallback6((listener) => scopedSubscription?.subscribeEffects(key, listener) ?? (() => {
|
|
3286
3401
|
return;
|
|
3287
3402
|
}), [key, scopedSubscription]);
|
|
3288
3403
|
const getSnapshot = useCallback6(() => scopedSubscription?.getEffectSnapshot(key) ?? emptyEffectDragOverrides, [key, scopedSubscription]);
|
|
3289
|
-
return
|
|
3404
|
+
return useDragOverrideSnapshot(subscribe, getSnapshot);
|
|
3290
3405
|
};
|
|
3291
|
-
var VisualModeSettersContext =
|
|
3406
|
+
var VisualModeSettersContext = React23.createContext({
|
|
3292
3407
|
setDragOverrides: () => {
|
|
3293
3408
|
throw new Error("VisualModeSettersContext not initialized");
|
|
3294
3409
|
},
|
|
@@ -3308,10 +3423,10 @@ var VisualModeSettersContext = React22.createContext({
|
|
|
3308
3423
|
throw new Error("VisualModeSettersContext not initialized");
|
|
3309
3424
|
}
|
|
3310
3425
|
});
|
|
3311
|
-
var VisualModeBatchSettersContext =
|
|
3426
|
+
var VisualModeBatchSettersContext = React23.createContext(null);
|
|
3312
3427
|
var effectDragOverridesKey = (nodePath, effectIndex) => `${makeSequencePropsSubscriptionKey(nodePath)}.effects.${effectIndex}`;
|
|
3313
3428
|
var SequenceManagerProvider = ({ children }) => {
|
|
3314
|
-
const [dragOverrideState, setDragOverrideState] =
|
|
3429
|
+
const [dragOverrideState, setDragOverrideState] = useState7(() => ({
|
|
3315
3430
|
overrides: {},
|
|
3316
3431
|
fromKeys: new Set
|
|
3317
3432
|
}));
|
|
@@ -3320,13 +3435,13 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
3320
3435
|
snapshot: dragOverrides,
|
|
3321
3436
|
listeners: new Map
|
|
3322
3437
|
});
|
|
3323
|
-
const [effectDragOverridesState, setEffectDragOverridesState] =
|
|
3438
|
+
const [effectDragOverridesState, setEffectDragOverridesState] = useState7({});
|
|
3324
3439
|
const effectDragOverridesStore = useRef5({
|
|
3325
3440
|
snapshot: effectDragOverridesState,
|
|
3326
3441
|
byNode: new Map,
|
|
3327
3442
|
listeners: new Map
|
|
3328
3443
|
});
|
|
3329
|
-
const [propStatuses, setPropStatusesMapState] =
|
|
3444
|
+
const [propStatuses, setPropStatusesMapState] = useState7({});
|
|
3330
3445
|
const propStatusesRef = useRef5(propStatuses);
|
|
3331
3446
|
useIsomorphicLayoutEffect4(() => {
|
|
3332
3447
|
propStatusesRef.current = propStatuses;
|
|
@@ -3578,21 +3693,21 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
3578
3693
|
remapPropStatuses
|
|
3579
3694
|
]);
|
|
3580
3695
|
const batchSettersContext = useMemo15(() => ({ setDragOverridesBatch, setEffectDragOverridesBatch }), [setDragOverridesBatch, setEffectDragOverridesBatch]);
|
|
3581
|
-
return /* @__PURE__ */
|
|
3582
|
-
children: /* @__PURE__ */
|
|
3696
|
+
return /* @__PURE__ */ jsx16(SequenceRegistryProvider, {
|
|
3697
|
+
children: /* @__PURE__ */ jsx16(VisualModePropStatusesRefContext.Provider, {
|
|
3583
3698
|
value: propStatusesRef,
|
|
3584
|
-
children: /* @__PURE__ */
|
|
3699
|
+
children: /* @__PURE__ */ jsx16(VisualModePropStatusesContext.Provider, {
|
|
3585
3700
|
value: propStatusesContext,
|
|
3586
|
-
children: /* @__PURE__ */
|
|
3701
|
+
children: /* @__PURE__ */ jsx16(SequenceManagerScopeProviders, {
|
|
3587
3702
|
dragOverridesSubscription,
|
|
3588
3703
|
fromKeys: dragOverrideState.fromKeys,
|
|
3589
|
-
children: /* @__PURE__ */
|
|
3704
|
+
children: /* @__PURE__ */ jsx16(VisualModeDragOverridesContext.Provider, {
|
|
3590
3705
|
value: dragOverridesContext,
|
|
3591
|
-
children: /* @__PURE__ */
|
|
3706
|
+
children: /* @__PURE__ */ jsx16(VisualModeDragOverridesRefContext.Provider, {
|
|
3592
3707
|
value: dragOverridesRef,
|
|
3593
|
-
children: /* @__PURE__ */
|
|
3708
|
+
children: /* @__PURE__ */ jsx16(VisualModeSettersContext.Provider, {
|
|
3594
3709
|
value: settersContext,
|
|
3595
|
-
children: /* @__PURE__ */
|
|
3710
|
+
children: /* @__PURE__ */ jsx16(VisualModeBatchSettersContext.Provider, {
|
|
3596
3711
|
value: batchSettersContext,
|
|
3597
3712
|
children
|
|
3598
3713
|
})
|
|
@@ -3606,16 +3721,15 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
3606
3721
|
};
|
|
3607
3722
|
|
|
3608
3723
|
// src/timeline-track-context.ts
|
|
3609
|
-
import { createContext as
|
|
3610
|
-
var TimelineTrackContext =
|
|
3611
|
-
var ExperimentalTracksEnabledContext = createContext23(false);
|
|
3724
|
+
import { createContext as createContext24 } from "react";
|
|
3725
|
+
var TimelineTrackContext = createContext24(null);
|
|
3612
3726
|
|
|
3613
3727
|
// src/use-premounting.ts
|
|
3614
|
-
import { useContext as
|
|
3728
|
+
import { useContext as useContext24, useMemo as useMemo16 } from "react";
|
|
3615
3729
|
|
|
3616
3730
|
// src/PremountContext.tsx
|
|
3617
|
-
import { createContext as
|
|
3618
|
-
var PremountContext =
|
|
3731
|
+
import { createContext as createContext25 } from "react";
|
|
3732
|
+
var PremountContext = createContext25({
|
|
3619
3733
|
premountFramesRemaining: 0
|
|
3620
3734
|
});
|
|
3621
3735
|
|
|
@@ -3630,15 +3744,15 @@ var usePremounting = ({
|
|
|
3630
3744
|
styleWhilePostmounted,
|
|
3631
3745
|
hideWhilePremounted
|
|
3632
3746
|
}) => {
|
|
3633
|
-
const parentPremountContext =
|
|
3747
|
+
const parentPremountContext = useContext24(PremountContext);
|
|
3634
3748
|
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
3635
3749
|
const environment = useRemotionEnvironment();
|
|
3636
3750
|
const { fps } = useVideoConfig();
|
|
3637
|
-
const defaultPremountInSeconds =
|
|
3751
|
+
const defaultPremountInSeconds = useContext24(DefaultPremountContext);
|
|
3638
3752
|
const effectivePremountFor = premountFor ?? Math.round(defaultPremountInSeconds * fps);
|
|
3639
3753
|
const effectivePostmountFor = postmountFor ?? 0;
|
|
3640
3754
|
const endExclusive = from + durationInFrames;
|
|
3641
|
-
const sequenceContext =
|
|
3755
|
+
const sequenceContext = useContext24(SequenceContext);
|
|
3642
3756
|
const boundaryTolerance = getSequenceBoundaryTolerance({
|
|
3643
3757
|
absoluteFrame: useTimelinePosition(),
|
|
3644
3758
|
cumulatedFrom: sequenceContext ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom : 0,
|
|
@@ -3682,15 +3796,15 @@ var usePremounting = ({
|
|
|
3682
3796
|
};
|
|
3683
3797
|
|
|
3684
3798
|
// src/use-sequence-registration.ts
|
|
3685
|
-
import { useContext as
|
|
3686
|
-
var useIsomorphicLayoutEffect5 = typeof window === "undefined" ?
|
|
3799
|
+
import { useContext as useContext25, useEffect as useEffect6, useLayoutEffect as useLayoutEffect5, useMemo as useMemo17, useRef as useRef6 } from "react";
|
|
3800
|
+
var useIsomorphicLayoutEffect5 = typeof window === "undefined" ? useEffect6 : useLayoutEffect5;
|
|
3687
3801
|
var useSequenceRegistration = ({
|
|
3688
3802
|
getSequence,
|
|
3689
3803
|
id
|
|
3690
3804
|
}) => {
|
|
3691
|
-
const { registerSequence, unregisterSequence, updateSequence } =
|
|
3692
|
-
const registrationDisabled =
|
|
3693
|
-
const commitRegistrationEnabled =
|
|
3805
|
+
const { registerSequence, unregisterSequence, updateSequence } = useContext25(SequenceManagerActionsContext);
|
|
3806
|
+
const registrationDisabled = useContext25(DisableSequenceRegistrationContext);
|
|
3807
|
+
const commitRegistrationEnabled = useContext25(SequenceCommitRegistrationContext);
|
|
3694
3808
|
const getSequenceRef = useRef6(getSequence);
|
|
3695
3809
|
useIsomorphicLayoutEffect5(() => {
|
|
3696
3810
|
getSequenceRef.current = getSequence;
|
|
@@ -3698,7 +3812,7 @@ var useSequenceRegistration = ({
|
|
|
3698
3812
|
const lastRegisteredGetterRef = useRef6(null);
|
|
3699
3813
|
const registrationEnabled = getSequence !== null && !registrationDisabled && !commitRegistrationEnabled;
|
|
3700
3814
|
const registration = useMemo17(() => commitRegistrationEnabled && !registrationDisabled && getSequence !== null ? getSequence() : null, [commitRegistrationEnabled, getSequence, registrationDisabled]);
|
|
3701
|
-
|
|
3815
|
+
useEffect6(() => {
|
|
3702
3816
|
if (!registrationEnabled) {
|
|
3703
3817
|
return;
|
|
3704
3818
|
}
|
|
@@ -3729,13 +3843,13 @@ var useSequenceRegistration = ({
|
|
|
3729
3843
|
};
|
|
3730
3844
|
|
|
3731
3845
|
// src/with-interactivity-schema.ts
|
|
3732
|
-
import
|
|
3733
|
-
createContext as
|
|
3846
|
+
import React25, {
|
|
3847
|
+
createContext as createContext27,
|
|
3734
3848
|
forwardRef as forwardRef2,
|
|
3735
|
-
useContext as
|
|
3849
|
+
useContext as useContext27,
|
|
3736
3850
|
useLayoutEffect as useLayoutEffect7,
|
|
3737
|
-
useMemo as
|
|
3738
|
-
useState as
|
|
3851
|
+
useMemo as useMemo19,
|
|
3852
|
+
useState as useState8
|
|
3739
3853
|
} from "react";
|
|
3740
3854
|
|
|
3741
3855
|
// src/delete-nested-key.ts
|
|
@@ -3772,7 +3886,7 @@ var deleteNestedKey = (obj, keysToRemove) => {
|
|
|
3772
3886
|
};
|
|
3773
3887
|
|
|
3774
3888
|
// src/effects/use-memoized-effects.ts
|
|
3775
|
-
import
|
|
3889
|
+
import React24, { useContext as useContext26, useLayoutEffect as useLayoutEffect6, useMemo as useMemo18, useRef as useRef7 } from "react";
|
|
3776
3890
|
|
|
3777
3891
|
// src/evaluate-source-expressions.ts
|
|
3778
3892
|
var evaluateSourceNumericValue = (expression, config) => {
|
|
@@ -4224,7 +4338,8 @@ var parseStringInterpolationValue = (output, outputType) => {
|
|
|
4224
4338
|
}
|
|
4225
4339
|
const parts = output.trim().split(/\s+/);
|
|
4226
4340
|
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
4227
|
-
|
|
4341
|
+
const ErrorType = outputType === undefined && parts.some((part) => !cssNumberRegex.test(part) && !transformOriginKeywords.has(part.toLowerCase())) ? UnsupportedStringInterpolationValueError : TypeError;
|
|
4342
|
+
throw new ErrorType(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
4228
4343
|
}
|
|
4229
4344
|
if (parts.some((part) => transformOriginKeywords.has(part.toLowerCase()))) {
|
|
4230
4345
|
if (outputType !== undefined) {
|
|
@@ -5877,11 +5992,11 @@ var getEffectiveVisualModeValue = ({
|
|
|
5877
5992
|
};
|
|
5878
5993
|
|
|
5879
5994
|
// src/sequence-node-path.tsx
|
|
5880
|
-
import { createContext as
|
|
5881
|
-
var OverrideIdsToNodePathsGettersContext =
|
|
5995
|
+
import { createContext as createContext26 } from "react";
|
|
5996
|
+
var OverrideIdsToNodePathsGettersContext = createContext26({
|
|
5882
5997
|
overrideIdToNodePathMappings: {}
|
|
5883
5998
|
});
|
|
5884
|
-
var OverrideIdsToNodePathsSettersContext =
|
|
5999
|
+
var OverrideIdsToNodePathsSettersContext = createContext26({
|
|
5885
6000
|
setOverrideIdToNodePath: () => {
|
|
5886
6001
|
throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
|
|
5887
6002
|
}
|
|
@@ -5889,7 +6004,16 @@ var OverrideIdsToNodePathsSettersContext = createContext25({
|
|
|
5889
6004
|
|
|
5890
6005
|
// src/effects/use-memoized-effects.ts
|
|
5891
6006
|
var emptyDragOverrides2 = {};
|
|
5892
|
-
var useCacheCommitEffect =
|
|
6007
|
+
var useCacheCommitEffect = React24.useInsertionEffect ?? useLayoutEffect6;
|
|
6008
|
+
var areEffectParamsEqual = (previous, next) => {
|
|
6009
|
+
if (Object.is(previous, next)) {
|
|
6010
|
+
return true;
|
|
6011
|
+
}
|
|
6012
|
+
if (previous === null || next === null || typeof previous !== "object" || typeof next !== "object" || Object.getPrototypeOf(previous) !== Object.prototype || Object.getPrototypeOf(next) !== Object.prototype) {
|
|
6013
|
+
return false;
|
|
6014
|
+
}
|
|
6015
|
+
return areRegistryEntriesEqual(previous, next);
|
|
6016
|
+
};
|
|
5893
6017
|
var mergeOverrides = ({
|
|
5894
6018
|
descriptor,
|
|
5895
6019
|
propStatusOverrides,
|
|
@@ -5952,13 +6076,12 @@ var resolvePropStatusOverrides = (propStatus, frame) => {
|
|
|
5952
6076
|
return hasAny ? out : null;
|
|
5953
6077
|
};
|
|
5954
6078
|
var useMemoizedEffectDefinitions = (effects) => {
|
|
5955
|
-
const activityDormant =
|
|
6079
|
+
const activityDormant = useContext26(SequenceActivityDormantContext);
|
|
5956
6080
|
const previousRef = useRef7(null);
|
|
5957
|
-
const definitions = effects.map((descriptor) => descriptor.definition);
|
|
5958
6081
|
const previous = previousRef.current;
|
|
5959
|
-
const isSame = previous !== null && previous.definitions.length ===
|
|
6082
|
+
const isSame = previous !== null && previous.definitions.length === effects.length && previous.definitions.every((definition, i) => definition === effects[i].definition);
|
|
5960
6083
|
const controllers = isSame ? previous.controllers : effects.map((effect) => createRuntimeValueStore(effect.params));
|
|
5961
|
-
const stableDefinitions = isSame ? previous.definitions : Object.assign(
|
|
6084
|
+
const stableDefinitions = isSame ? previous.definitions : Object.assign(effects.map((descriptor) => descriptor.definition), {
|
|
5962
6085
|
runtimeValues: controllers.map((controller) => controller.store)
|
|
5963
6086
|
});
|
|
5964
6087
|
useCacheCommitEffect(() => {
|
|
@@ -5966,6 +6089,9 @@ var useMemoizedEffectDefinitions = (effects) => {
|
|
|
5966
6089
|
if (!activityDormant || controllers.length === 0) {
|
|
5967
6090
|
return;
|
|
5968
6091
|
}
|
|
6092
|
+
if (controllers.every((controller, index) => areEffectParamsEqual(controller.store.getSnapshot(), effects[index]?.params))) {
|
|
6093
|
+
return;
|
|
6094
|
+
}
|
|
5969
6095
|
let cancelled = false;
|
|
5970
6096
|
queueMicrotask(() => {
|
|
5971
6097
|
if (cancelled) {
|
|
@@ -5974,15 +6100,9 @@ var useMemoizedEffectDefinitions = (effects) => {
|
|
|
5974
6100
|
controllers.forEach((controller, index) => {
|
|
5975
6101
|
const snapshot = effects[index]?.params;
|
|
5976
6102
|
const currentSnapshot = controller.store.getSnapshot();
|
|
5977
|
-
if (
|
|
6103
|
+
if (areEffectParamsEqual(snapshot, currentSnapshot)) {
|
|
5978
6104
|
return;
|
|
5979
6105
|
}
|
|
5980
|
-
if (snapshot !== null && currentSnapshot !== null && typeof snapshot === "object" && typeof currentSnapshot === "object") {
|
|
5981
|
-
const keys = Object.keys(snapshot);
|
|
5982
|
-
if (keys.length === Object.keys(currentSnapshot).length && keys.every((key) => Object.prototype.hasOwnProperty.call(currentSnapshot, key) && Object.is(snapshot[key], currentSnapshot[key]))) {
|
|
5983
|
-
return;
|
|
5984
|
-
}
|
|
5985
|
-
}
|
|
5986
6106
|
controller.setSnapshot(snapshot);
|
|
5987
6107
|
});
|
|
5988
6108
|
});
|
|
@@ -5993,7 +6113,9 @@ var useMemoizedEffectDefinitions = (effects) => {
|
|
|
5993
6113
|
useLayoutEffect6(() => {
|
|
5994
6114
|
stableDefinitions.forEach((_definition, index) => {
|
|
5995
6115
|
const snapshot = effects[index]?.params;
|
|
5996
|
-
controllers[index].
|
|
6116
|
+
if (!areEffectParamsEqual(controllers[index].store.getSnapshot(), snapshot)) {
|
|
6117
|
+
controllers[index].setSnapshot(snapshot);
|
|
6118
|
+
}
|
|
5997
6119
|
});
|
|
5998
6120
|
}, [controllers, effects, stableDefinitions]);
|
|
5999
6121
|
return stableDefinitions;
|
|
@@ -6038,46 +6160,60 @@ var useMemoizedEffects = ({
|
|
|
6038
6160
|
videoConfigValues
|
|
6039
6161
|
}) => {
|
|
6040
6162
|
const previousRef = useRef7(null);
|
|
6041
|
-
const { propStatuses } =
|
|
6042
|
-
const
|
|
6043
|
-
const { overrideIdToNodePathMappings } = useContext25(OverrideIdsToNodePathsGettersContext);
|
|
6163
|
+
const { propStatuses } = useContext26(VisualModePropStatusesContext);
|
|
6164
|
+
const { overrideIdToNodePathMappings } = useContext26(OverrideIdsToNodePathsGettersContext);
|
|
6044
6165
|
const previous = previousRef.current;
|
|
6045
6166
|
const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
|
|
6046
6167
|
const effectDragOverrides = useEffectDragOverridesForNodePath(nodePath);
|
|
6047
|
-
const
|
|
6168
|
+
const effectPropStatuses = useMemo18(() => Array.from({ length: effects.length }, (_, effectIndex) => {
|
|
6048
6169
|
if (nodePath === null) {
|
|
6049
|
-
return
|
|
6050
|
-
descriptor,
|
|
6051
|
-
params: descriptor.params,
|
|
6052
|
-
effectKey: descriptor.effectKey
|
|
6053
|
-
};
|
|
6170
|
+
return null;
|
|
6054
6171
|
}
|
|
6055
|
-
const
|
|
6172
|
+
const status = getEffectPropStatusesCtx({
|
|
6056
6173
|
propStatuses,
|
|
6057
6174
|
nodePath: { ...nodePath, videoConfigValues },
|
|
6058
|
-
effectIndex
|
|
6175
|
+
effectIndex
|
|
6059
6176
|
});
|
|
6060
|
-
|
|
6177
|
+
return status.type === "can-update-effect" ? status.props : null;
|
|
6178
|
+
}), [effects.length, nodePath, propStatuses, videoConfigValues]);
|
|
6179
|
+
const animatedEffects = useMemo18(() => effectPropStatuses.map((status, index) => Object.values(status ?? {}).some((prop) => prop.status === "keyframed") || Object.values(effectDragOverrides[index] ?? emptyDragOverrides2).some((override) => override.type === "keyframed")), [effectDragOverrides, effectPropStatuses]);
|
|
6180
|
+
const frame = useCurrentFrameWithOptionalSubscription(animatedEffects.some(Boolean));
|
|
6181
|
+
const prepared = effects.map((descriptor, index) => {
|
|
6182
|
+
const propStatus = effectPropStatuses[index];
|
|
6061
6183
|
const dragOverridesMap = effectDragOverrides[index] ?? emptyDragOverrides2;
|
|
6062
6184
|
const dragOverrides = Object.keys(dragOverridesMap).length === 0 ? null : dragOverridesMap;
|
|
6185
|
+
const effectFrame = animatedEffects[index] ? frame : null;
|
|
6186
|
+
const cached = previous?.prepared[index];
|
|
6187
|
+
if (cached && cached.definition === descriptor.definition && cached.sourceKey === descriptor.effectKey && areEffectParamsEqual(cached.params, descriptor.params) && cached.propStatus === propStatus && cached.dragOverrides === dragOverrides && cached.frame === effectFrame) {
|
|
6188
|
+
return cached;
|
|
6189
|
+
}
|
|
6190
|
+
const propStatusOverrides = resolvePropStatusOverrides(propStatus ?? undefined, frame);
|
|
6063
6191
|
const { params, effectKey } = mergeOverrides({
|
|
6064
6192
|
descriptor,
|
|
6065
6193
|
propStatusOverrides,
|
|
6066
6194
|
dragOverrides,
|
|
6067
6195
|
frame
|
|
6068
6196
|
});
|
|
6069
|
-
return {
|
|
6197
|
+
return {
|
|
6198
|
+
definition: descriptor.definition,
|
|
6199
|
+
sourceKey: descriptor.effectKey,
|
|
6200
|
+
params: descriptor.params !== null && typeof descriptor.params === "object" && Object.getPrototypeOf(descriptor.params) === Object.prototype ? { ...descriptor.params } : descriptor.params,
|
|
6201
|
+
propStatus,
|
|
6202
|
+
dragOverrides,
|
|
6203
|
+
frame: effectFrame,
|
|
6204
|
+
value: cached?.value.definition === descriptor.definition && cached.value.effectKey === effectKey ? cached.value : {
|
|
6205
|
+
definition: descriptor.definition,
|
|
6206
|
+
effectKey,
|
|
6207
|
+
params,
|
|
6208
|
+
memoized: true
|
|
6209
|
+
}
|
|
6210
|
+
};
|
|
6070
6211
|
});
|
|
6071
|
-
const isSame = previous !== null && previous.length ===
|
|
6072
|
-
const next = isSame ? previous :
|
|
6073
|
-
definition: descriptor.definition,
|
|
6074
|
-
effectKey,
|
|
6075
|
-
params,
|
|
6076
|
-
memoized: true
|
|
6077
|
-
}));
|
|
6212
|
+
const isSame = previous !== null && previous.effects.length === prepared.length && previous.effects.every((effect, i) => effect === prepared[i].value);
|
|
6213
|
+
const next = isSame ? previous.effects : prepared.map((effect) => effect.value);
|
|
6078
6214
|
useCacheCommitEffect(() => {
|
|
6079
|
-
previousRef.current = next;
|
|
6080
|
-
}, [next]);
|
|
6215
|
+
previousRef.current = { prepared, effects: next };
|
|
6216
|
+
}, [next, prepared]);
|
|
6081
6217
|
return next;
|
|
6082
6218
|
};
|
|
6083
6219
|
|
|
@@ -6358,7 +6494,7 @@ var computeEffectiveSchemaValuesDotNotation = ({
|
|
|
6358
6494
|
});
|
|
6359
6495
|
value = dragOverride.type === "resolved" ? dragOverride.value : currentValue[key];
|
|
6360
6496
|
} else if (isKeyframedStatus(status)) {
|
|
6361
|
-
if (field?.type === "array"
|
|
6497
|
+
if (field?.type === "array") {
|
|
6362
6498
|
value = currentValue[key];
|
|
6363
6499
|
} else {
|
|
6364
6500
|
const dragOverride = resolveDragOverrideValue({
|
|
@@ -6478,13 +6614,13 @@ var mergeValues = ({
|
|
|
6478
6614
|
deleteNestedKey(merged, propsToDeleteWithoutTextContent);
|
|
6479
6615
|
return merged;
|
|
6480
6616
|
};
|
|
6481
|
-
var DisableInteractivityContext =
|
|
6617
|
+
var DisableInteractivityContext = createContext27(false);
|
|
6482
6618
|
var DisableInteractivityProvider = ({ children }) => {
|
|
6483
|
-
return
|
|
6619
|
+
return React25.createElement(DisableInteractivityContext.Provider, { value: true }, children);
|
|
6484
6620
|
};
|
|
6485
|
-
var EnableInteractivityContext =
|
|
6621
|
+
var EnableInteractivityContext = createContext27(false);
|
|
6486
6622
|
var EnableInteractivityProvider = ({ children }) => {
|
|
6487
|
-
return
|
|
6623
|
+
return React25.createElement(EnableInteractivityContext.Provider, { value: true }, children);
|
|
6488
6624
|
};
|
|
6489
6625
|
var withInteractivitySchema = ({
|
|
6490
6626
|
Component,
|
|
@@ -6505,32 +6641,31 @@ var withInteractivitySchema = ({
|
|
|
6505
6641
|
const cleanProps = propsWithoutInternalStack;
|
|
6506
6642
|
const env = useRemotionEnvironment();
|
|
6507
6643
|
const pendingDeletions = usePendingSequenceDeletions();
|
|
6508
|
-
const canUseRemotionHooks =
|
|
6509
|
-
const disableInteractivity =
|
|
6510
|
-
const enableInteractivity =
|
|
6644
|
+
const canUseRemotionHooks = useContext27(CanUseRemotionHooks);
|
|
6645
|
+
const disableInteractivity = useContext27(DisableInteractivityContext);
|
|
6646
|
+
const enableInteractivity = useContext27(EnableInteractivityContext);
|
|
6511
6647
|
if (!env.isStudio && !enableInteractivity || env.isRendering || !canUseRemotionHooks || disableInteractivity) {
|
|
6512
|
-
return
|
|
6648
|
+
return React25.createElement(Component, {
|
|
6513
6649
|
...cleanProps,
|
|
6514
6650
|
controls: null,
|
|
6515
6651
|
ref
|
|
6516
6652
|
});
|
|
6517
6653
|
}
|
|
6518
|
-
const { propStatuses } =
|
|
6519
|
-
const nodePathMapping =
|
|
6520
|
-
const frame = useCurrentFrame();
|
|
6654
|
+
const { propStatuses } = useContext27(VisualModePropStatusesContext);
|
|
6655
|
+
const nodePathMapping = useContext27(OverrideIdsToNodePathsGettersContext);
|
|
6521
6656
|
const videoConfig = useUnsafeVideoConfig();
|
|
6522
6657
|
const durationInFrames = videoConfig?.durationInFrames;
|
|
6523
6658
|
const fps = videoConfig?.fps;
|
|
6524
6659
|
const height = videoConfig?.height;
|
|
6525
6660
|
const width = videoConfig?.width;
|
|
6526
|
-
const videoConfigValues =
|
|
6661
|
+
const videoConfigValues = useMemo19(() => durationInFrames === undefined || fps === undefined || height === undefined || width === undefined ? null : {
|
|
6527
6662
|
durationInFrames,
|
|
6528
6663
|
fps,
|
|
6529
6664
|
height,
|
|
6530
6665
|
width
|
|
6531
6666
|
}, [durationInFrames, fps, height, width]);
|
|
6532
6667
|
const passedControls = cleanProps.controls;
|
|
6533
|
-
const resolvedPassedControls =
|
|
6668
|
+
const resolvedPassedControls = useMemo19(() => {
|
|
6534
6669
|
if (!passedControls || getStackForControls(passedControls) !== null || internalStack === undefined) {
|
|
6535
6670
|
return passedControls;
|
|
6536
6671
|
}
|
|
@@ -6539,13 +6674,13 @@ var withInteractivitySchema = ({
|
|
|
6539
6674
|
return controlsWithStack;
|
|
6540
6675
|
}, [internalStack, passedControls]);
|
|
6541
6676
|
if (resolvedPassedControls) {
|
|
6542
|
-
return
|
|
6677
|
+
return React25.createElement(Component, {
|
|
6543
6678
|
...cleanProps,
|
|
6544
6679
|
controls: resolvedPassedControls,
|
|
6545
6680
|
ref
|
|
6546
6681
|
});
|
|
6547
6682
|
}
|
|
6548
|
-
const [overrideId] =
|
|
6683
|
+
const [overrideId] = useState8(() => {
|
|
6549
6684
|
if (!internalStack) {
|
|
6550
6685
|
return String(Math.random());
|
|
6551
6686
|
}
|
|
@@ -6559,17 +6694,23 @@ var withInteractivitySchema = ({
|
|
|
6559
6694
|
});
|
|
6560
6695
|
const nodePath = env.isReadOnlyStudio ? null : nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
|
|
6561
6696
|
const dragOverrides = useDragOverridesForNodePath(nodePath);
|
|
6697
|
+
const propStatus = useMemo19(() => nodePath === null ? undefined : getPropStatusesCtx(propStatuses, {
|
|
6698
|
+
...nodePath,
|
|
6699
|
+
videoConfigValues
|
|
6700
|
+
}), [nodePath, propStatuses, videoConfigValues]);
|
|
6701
|
+
const needsFrame = flatKeys.some((key) => propStatus?.[key]?.status === "keyframed" || dragOverrides[key]?.type === "keyframed");
|
|
6702
|
+
const frame = useCurrentFrameWithOptionalSubscription(needsFrame);
|
|
6562
6703
|
const runtimeValues = flatKeys.map((key) => getRuntimeValueForSchemaKey({
|
|
6563
6704
|
flatSchema,
|
|
6564
6705
|
key,
|
|
6565
6706
|
props: cleanProps
|
|
6566
6707
|
}));
|
|
6567
|
-
const currentRuntimeValueDotNotation =
|
|
6568
|
-
const [runtimeValueStore] =
|
|
6708
|
+
const currentRuntimeValueDotNotation = useMemo19(() => readValuesFromProps(cleanProps, flatKeys, flatSchema), runtimeValues);
|
|
6709
|
+
const [runtimeValueStore] = useState8(() => createRuntimeValueStore(currentRuntimeValueDotNotation));
|
|
6569
6710
|
useLayoutEffect7(() => {
|
|
6570
6711
|
runtimeValueStore.setSnapshot(currentRuntimeValueDotNotation);
|
|
6571
6712
|
}, [currentRuntimeValueDotNotation, runtimeValueStore]);
|
|
6572
|
-
const controls =
|
|
6713
|
+
const controls = useMemo19(() => {
|
|
6573
6714
|
const controlsForRender = {
|
|
6574
6715
|
schema: schemaWithSequenceName,
|
|
6575
6716
|
currentRuntimeValueDotNotation,
|
|
@@ -6592,25 +6733,15 @@ var withInteractivitySchema = ({
|
|
|
6592
6733
|
useLayoutEffect7(() => {
|
|
6593
6734
|
OptimisticSequenceDeletion.register(internalStack ?? null, nodePath);
|
|
6594
6735
|
}, [internalStack, nodePath]);
|
|
6595
|
-
const { merged: valuesDotNotation, propsToDelete } =
|
|
6736
|
+
const { merged: valuesDotNotation, propsToDelete } = useMemo19(() => {
|
|
6596
6737
|
return computeEffectiveSchemaValuesDotNotation({
|
|
6597
6738
|
schema: schemaWithSequenceName,
|
|
6598
6739
|
currentValue: currentRuntimeValueDotNotation,
|
|
6599
6740
|
overrideValues: dragOverrides,
|
|
6600
|
-
propStatus
|
|
6601
|
-
...nodePath,
|
|
6602
|
-
videoConfigValues
|
|
6603
|
-
}),
|
|
6741
|
+
propStatus,
|
|
6604
6742
|
frame
|
|
6605
6743
|
});
|
|
6606
|
-
}, [
|
|
6607
|
-
currentRuntimeValueDotNotation,
|
|
6608
|
-
dragOverrides,
|
|
6609
|
-
nodePath,
|
|
6610
|
-
propStatuses,
|
|
6611
|
-
videoConfigValues,
|
|
6612
|
-
frame
|
|
6613
|
-
]);
|
|
6744
|
+
}, [currentRuntimeValueDotNotation, dragOverrides, propStatus, frame]);
|
|
6614
6745
|
const activeKeys = selectActiveKeys(schemaWithSequenceName, valuesDotNotation);
|
|
6615
6746
|
const mergedProps = mergeValues({
|
|
6616
6747
|
flatSchema,
|
|
@@ -6622,7 +6753,7 @@ var withInteractivitySchema = ({
|
|
|
6622
6753
|
if (OptimisticSequenceDeletion.isDeleted(nodePath, pendingDeletions)) {
|
|
6623
6754
|
return null;
|
|
6624
6755
|
}
|
|
6625
|
-
return
|
|
6756
|
+
return React25.createElement(Component, {
|
|
6626
6757
|
...mergedProps,
|
|
6627
6758
|
controls,
|
|
6628
6759
|
ref
|
|
@@ -6633,8 +6764,8 @@ var withInteractivitySchema = ({
|
|
|
6633
6764
|
};
|
|
6634
6765
|
|
|
6635
6766
|
// src/Sequence.tsx
|
|
6636
|
-
import { jsx as
|
|
6637
|
-
var SeriesContentVisibilityContext =
|
|
6767
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
6768
|
+
var SeriesContentVisibilityContext = createContext28(true);
|
|
6638
6769
|
var SequenceContextProvider = withCommittedMetadata(SequenceContext.Provider);
|
|
6639
6770
|
var EMPTY_EFFECTS = [];
|
|
6640
6771
|
var RegularSequenceRefForwardingFunction = ({
|
|
@@ -6667,13 +6798,15 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6667
6798
|
...other
|
|
6668
6799
|
}, ref) => {
|
|
6669
6800
|
const { layout = "absolute-fill" } = other;
|
|
6670
|
-
const [id] =
|
|
6671
|
-
const parentSequence =
|
|
6672
|
-
const activityRequested =
|
|
6673
|
-
const parentDormant =
|
|
6801
|
+
const [id] = useState9(() => String(Math.random()));
|
|
6802
|
+
const parentSequence = useContext28(SequenceContext);
|
|
6803
|
+
const activityRequested = useContext28(SequenceActivityContext);
|
|
6804
|
+
const parentDormant = useContext28(SequenceActivityDormantContext);
|
|
6805
|
+
const activitySuspended = useContext28(SequenceActivitySuspensionContext);
|
|
6806
|
+
const hadActivity = useRef8(false);
|
|
6674
6807
|
const env = useRemotionEnvironment();
|
|
6675
6808
|
const activityEnabled = activityRequested && env.isStudio && !env.isRendering;
|
|
6676
|
-
const timelineTrack =
|
|
6809
|
+
const timelineTrack = useContext28(TimelineTrackContext);
|
|
6677
6810
|
const timelineTrackRole = timelineTrackItem?.role ?? "clip";
|
|
6678
6811
|
const seriesOffset = timelineTrackItem?.seriesOffset ?? null;
|
|
6679
6812
|
const parentPlaybackRate = parentSequence?.playbackRate ?? 1;
|
|
@@ -6777,16 +6910,16 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6777
6910
|
const relativeFrom = effectiveRelativeFrom / parentPlaybackRate;
|
|
6778
6911
|
const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + relativeFrom;
|
|
6779
6912
|
const localClockEnd = loopPeriod === null ? actualDurationInFrames * playbackRate + trimBefore : Math.min(loopPeriod, actualDurationInFrames - loopOffset) * playbackRate + trimBefore;
|
|
6780
|
-
const sequenceRegistrationEnabled =
|
|
6781
|
-
const canvasOutlinesEnabled =
|
|
6913
|
+
const sequenceRegistrationEnabled = useContext28(SequenceRegistrationContext);
|
|
6914
|
+
const canvasOutlinesEnabled = useContext28(SequenceOutlineContext);
|
|
6782
6915
|
const shouldDiscoverOutline = env.isStudio || canvasOutlinesEnabled;
|
|
6783
|
-
const automaticOutlineRef =
|
|
6916
|
+
const automaticOutlineRef = useMemo20(() => shouldDiscoverOutline && layout === "none" ? SequenceOutlineInternals.createRef() : null, [shouldDiscoverOutline, layout]);
|
|
6784
6917
|
const wrapperRefForOutline = useRef8(null);
|
|
6785
6918
|
const refForOutline = layout === "none" ? automaticOutlineRef : wrapperRefForOutline;
|
|
6786
|
-
const premounting =
|
|
6919
|
+
const premounting = useMemo20(() => {
|
|
6787
6920
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
6788
6921
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
6789
|
-
const postmounting =
|
|
6922
|
+
const postmounting = useMemo20(() => {
|
|
6790
6923
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
6791
6924
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
6792
6925
|
const currentSequenceStart = cumulatedFrom + relativeFrom;
|
|
@@ -6794,7 +6927,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6794
6927
|
const parentFirstFrame = parentSequence ? parentSequenceStart - parentSequence.cumulatedNegativeFrom / parentPlaybackRate : 0;
|
|
6795
6928
|
const firstFrame = Math.max(0, parentFirstFrame, cumulatedFrom + clockFrom / parentPlaybackRate);
|
|
6796
6929
|
const cumulatedNegativeFrom = (currentSequenceStart - firstFrame) * cumulativePlaybackRate;
|
|
6797
|
-
const contextValue =
|
|
6930
|
+
const contextValue = useMemo20(() => {
|
|
6798
6931
|
return {
|
|
6799
6932
|
playbackRate: cumulativePlaybackRate,
|
|
6800
6933
|
absoluteFrom,
|
|
@@ -6827,7 +6960,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6827
6960
|
postmountDisplay,
|
|
6828
6961
|
cumulatedNegativeFrom
|
|
6829
6962
|
]);
|
|
6830
|
-
const loopContextValue =
|
|
6963
|
+
const loopContextValue = useMemo20(() => {
|
|
6831
6964
|
if (loopPeriod === null) {
|
|
6832
6965
|
return null;
|
|
6833
6966
|
}
|
|
@@ -6836,7 +6969,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6836
6969
|
durationInFrames: contentDurationInFrames
|
|
6837
6970
|
};
|
|
6838
6971
|
}, [contentDurationInFrames, loopIteration, loopPeriod]);
|
|
6839
|
-
const resolvedLoopDisplay =
|
|
6972
|
+
const resolvedLoopDisplay = useMemo20(() => {
|
|
6840
6973
|
if (loopDisplay || loopPeriod === null) {
|
|
6841
6974
|
return loopDisplay;
|
|
6842
6975
|
}
|
|
@@ -6846,12 +6979,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6846
6979
|
durationInFrames: loopPeriod
|
|
6847
6980
|
};
|
|
6848
6981
|
}, [actualDurationInFrames, loopDisplay, loopPeriod]);
|
|
6849
|
-
const timelineClipName =
|
|
6982
|
+
const timelineClipName = useMemo20(() => {
|
|
6850
6983
|
return name ?? "";
|
|
6851
6984
|
}, [name]);
|
|
6852
6985
|
const resolvedDocumentationLink = documentationLink ?? "https://www.remotion.dev/docs/sequence";
|
|
6853
|
-
const isInsideSeries =
|
|
6854
|
-
const singleChildComponent =
|
|
6986
|
+
const isInsideSeries = useContext28(IsInsideSeriesContext);
|
|
6987
|
+
const singleChildComponent = useMemo20(() => childComponentOverride === undefined ? getSingleChildComponent(children) : childComponentOverride, [children, childComponentOverride]);
|
|
6855
6988
|
const registrationStack = controls ? getStackForControls(controls) ?? stack ?? null : stack ?? null;
|
|
6856
6989
|
const getStack = useCallback7(() => registrationStack, [registrationStack]);
|
|
6857
6990
|
const registeredFrozenFrame = typeof freeze === "number" ? freeze : null;
|
|
@@ -6877,9 +7010,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6877
7010
|
const canInferDuration = (controlsComponentIdentity === "dev.remotion.remotion.Series" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries") && !loop && registeredFrozenFrame === null && !isInsideNonPremountFreeze && !hidden;
|
|
6878
7011
|
const autoDuration = canInferDuration && durationInFrames === undefined;
|
|
6879
7012
|
const isSeriesChild = controlsComponentIdentity === "dev.remotion.remotion.Series.Sequence" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Sequence" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Transition" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Overlay";
|
|
6880
|
-
const seriesContentVisible =
|
|
6881
|
-
const effectRuntimeValues =
|
|
6882
|
-
const registrationControls =
|
|
7013
|
+
const seriesContentVisible = useContext28(SeriesContentVisibilityContext);
|
|
7014
|
+
const effectRuntimeValues = useMemo20(() => _remotionInternalEffects?.runtimeValues ?? null, [_remotionInternalEffects]);
|
|
7015
|
+
const registrationControls = useMemo20(() => {
|
|
6883
7016
|
if (controlsSchema === undefined || controlsRuntimeValues === undefined || controlsOverrideId === undefined || controlsSupportsEffects === undefined || controlsComponentIdentity === undefined || controlsComponentName === undefined || controlsVideoConfigValues === undefined) {
|
|
6884
7017
|
return null;
|
|
6885
7018
|
}
|
|
@@ -7056,13 +7189,17 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7056
7189
|
from: firstFrame,
|
|
7057
7190
|
end: cumulatedFrom + (from + actualDurationInFrames) / parentPlaybackRate
|
|
7058
7191
|
} : null);
|
|
7059
|
-
const renderActivity = activityEnabled && (!activityDormant || admitted);
|
|
7192
|
+
const renderActivity = activityEnabled && (!activityDormant || admitted || activitySuspended && hadActivity.current);
|
|
7193
|
+
const useCommitEffect = React26.useInsertionEffect ?? useLayoutEffect8;
|
|
7194
|
+
useCommitEffect(() => {
|
|
7195
|
+
hadActivity.current = renderActivity;
|
|
7196
|
+
}, [renderActivity]);
|
|
7060
7197
|
const content = (activityEnabled ? renderActivity : contentVisible) ? children : null;
|
|
7061
|
-
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */
|
|
7198
|
+
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */ jsx17(Freeze, {
|
|
7062
7199
|
frame: freeze,
|
|
7063
7200
|
children: content
|
|
7064
7201
|
});
|
|
7065
|
-
const loopedContent = frozenContent === null || loopContextValue === null ? frozenContent : /* @__PURE__ */
|
|
7202
|
+
const loopedContent = frozenContent === null || loopContextValue === null ? frozenContent : /* @__PURE__ */ jsx17(LoopContext.Provider, {
|
|
7066
7203
|
value: loopContextValue,
|
|
7067
7204
|
children: frozenContent
|
|
7068
7205
|
});
|
|
@@ -7082,7 +7219,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7082
7219
|
ref.current = node;
|
|
7083
7220
|
}
|
|
7084
7221
|
}, [ref]);
|
|
7085
|
-
const defaultStyle =
|
|
7222
|
+
const defaultStyle = useMemo20(() => {
|
|
7086
7223
|
return {
|
|
7087
7224
|
flexDirection: undefined,
|
|
7088
7225
|
...width ? { width } : {},
|
|
@@ -7096,44 +7233,44 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7096
7233
|
if (ref !== null && layout === "none") {
|
|
7097
7234
|
throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
|
|
7098
7235
|
}
|
|
7099
|
-
const metadata =
|
|
7236
|
+
const metadata = useMemo20(() => shouldDiscoverOutline || registration !== null ? {
|
|
7100
7237
|
type: "sequence",
|
|
7101
7238
|
id,
|
|
7102
7239
|
value: registration,
|
|
7103
7240
|
outlineChildrenRef: automaticOutlineRef
|
|
7104
7241
|
} : null, [automaticOutlineRef, id, registration, shouldDiscoverOutline]);
|
|
7105
7242
|
if (hidden) {
|
|
7106
|
-
return shouldDiscoverOutline || registration !== null ? /* @__PURE__ */
|
|
7243
|
+
return shouldDiscoverOutline || registration !== null ? /* @__PURE__ */ jsx17(SequenceContextProvider, {
|
|
7107
7244
|
value: contextValue,
|
|
7108
7245
|
_remotionCommitMetadata: metadata,
|
|
7109
7246
|
children: null
|
|
7110
7247
|
}) : null;
|
|
7111
7248
|
}
|
|
7112
7249
|
const retainSeriesRegistration = env.isStudio && canInferDuration;
|
|
7113
|
-
const contentForLayout = renderActivity ? /* @__PURE__ */
|
|
7250
|
+
const contentForLayout = renderActivity ? /* @__PURE__ */ jsx17(SequenceActivityContent, {
|
|
7114
7251
|
dormant: activityDormant,
|
|
7115
7252
|
children: loopedContent
|
|
7116
7253
|
}) : loopedContent;
|
|
7117
|
-
const renderedContent = loopedContent === null ? retainSeriesRegistration ? children : null : other.layout === "none" ? contentForLayout : /* @__PURE__ */
|
|
7254
|
+
const renderedContent = loopedContent === null ? retainSeriesRegistration ? children : null : other.layout === "none" ? contentForLayout : /* @__PURE__ */ jsx17(AbsoluteFillElement, {
|
|
7118
7255
|
ref: sequenceRef,
|
|
7119
7256
|
style: defaultStyle,
|
|
7120
7257
|
className: other.className,
|
|
7121
7258
|
children: contentForLayout
|
|
7122
7259
|
});
|
|
7123
|
-
const activityContent = renderActivity ? /* @__PURE__ */
|
|
7260
|
+
const activityContent = renderActivity ? /* @__PURE__ */ jsx17(SequenceActivityBoundary, {
|
|
7124
7261
|
dormant: activityDormant,
|
|
7125
7262
|
frame: firstFrame,
|
|
7126
7263
|
children: renderedContent
|
|
7127
7264
|
}) : renderedContent;
|
|
7128
|
-
const sequenceContent = /* @__PURE__ */
|
|
7265
|
+
const sequenceContent = /* @__PURE__ */ jsx17(SequenceContextProvider, {
|
|
7129
7266
|
value: contextValue,
|
|
7130
7267
|
_remotionCommitMetadata: metadata,
|
|
7131
|
-
children: retainSeriesRegistration ? /* @__PURE__ */
|
|
7268
|
+
children: retainSeriesRegistration ? /* @__PURE__ */ jsx17(SeriesContentVisibilityContext.Provider, {
|
|
7132
7269
|
value: renderActivity || contentVisible,
|
|
7133
7270
|
children: activityContent
|
|
7134
7271
|
}) : activityContent
|
|
7135
7272
|
});
|
|
7136
|
-
const sequence = /* @__PURE__ */
|
|
7273
|
+
const sequence = /* @__PURE__ */ jsx17(TimelineTrackContext.Provider, {
|
|
7137
7274
|
value: timelineTrackRole === "track" || timelineTrackRole === "clip" && !showInTimeline ? timelineTrack : null,
|
|
7138
7275
|
children: sequenceContent
|
|
7139
7276
|
});
|
|
@@ -7174,11 +7311,11 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
7174
7311
|
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
7175
7312
|
hideWhilePremounted: "opacity"
|
|
7176
7313
|
});
|
|
7177
|
-
return /* @__PURE__ */
|
|
7314
|
+
return /* @__PURE__ */ jsx17(Freeze, {
|
|
7178
7315
|
frame: freezeFrame,
|
|
7179
7316
|
active: isPremountingOrPostmounting,
|
|
7180
7317
|
_remotionInternalIsPremounting: premountingActive,
|
|
7181
|
-
children: /* @__PURE__ */
|
|
7318
|
+
children: /* @__PURE__ */ jsx17(RegularSequence, {
|
|
7182
7319
|
ref,
|
|
7183
7320
|
from,
|
|
7184
7321
|
durationInFrames,
|
|
@@ -7195,18 +7332,18 @@ var PremountedPostmountedSequence = forwardRef3(PremountedPostmountedSequenceRef
|
|
|
7195
7332
|
var SequenceRefForwardingFunction = (props, ref) => {
|
|
7196
7333
|
const env = useRemotionEnvironment();
|
|
7197
7334
|
const { fps } = useVideoConfig();
|
|
7198
|
-
const defaultPremountInSeconds =
|
|
7335
|
+
const defaultPremountInSeconds = useContext28(DefaultPremountContext);
|
|
7199
7336
|
if (props.layout !== "none" && !env.isRendering) {
|
|
7200
7337
|
const effectivePremountFor = props.premountFor ?? Math.round(defaultPremountInSeconds * fps);
|
|
7201
7338
|
if (effectivePremountFor || props.postmountFor) {
|
|
7202
|
-
return /* @__PURE__ */
|
|
7339
|
+
return /* @__PURE__ */ jsx17(PremountedPostmountedSequence, {
|
|
7203
7340
|
ref,
|
|
7204
7341
|
...props,
|
|
7205
7342
|
premountFor: effectivePremountFor
|
|
7206
7343
|
});
|
|
7207
7344
|
}
|
|
7208
7345
|
}
|
|
7209
|
-
return /* @__PURE__ */
|
|
7346
|
+
return /* @__PURE__ */ jsx17(RegularSequence, {
|
|
7210
7347
|
...props,
|
|
7211
7348
|
ref
|
|
7212
7349
|
});
|
|
@@ -7230,7 +7367,7 @@ var SequenceWithoutFrom = withInteractivitySchema({
|
|
|
7230
7367
|
|
|
7231
7368
|
// src/AbsoluteFill.tsx
|
|
7232
7369
|
import { useCallback as useCallback8 } from "react";
|
|
7233
|
-
import { jsx as
|
|
7370
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
7234
7371
|
var absoluteFillSchema = {
|
|
7235
7372
|
...baseSchema,
|
|
7236
7373
|
...premountSchema,
|
|
@@ -7290,11 +7427,11 @@ var AbsoluteFillWithTiming = ({
|
|
|
7290
7427
|
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
7291
7428
|
hideWhilePremounted: "opacity"
|
|
7292
7429
|
});
|
|
7293
|
-
return /* @__PURE__ */
|
|
7430
|
+
return /* @__PURE__ */ jsx18(Freeze, {
|
|
7294
7431
|
frame: freezeFrame,
|
|
7295
7432
|
active: isPremountingOrPostmounting,
|
|
7296
7433
|
_remotionInternalIsPremounting: premountingActive,
|
|
7297
|
-
children: /* @__PURE__ */
|
|
7434
|
+
children: /* @__PURE__ */ jsx18(Sequence, {
|
|
7298
7435
|
layout: "none",
|
|
7299
7436
|
from: from ?? 0,
|
|
7300
7437
|
trimBefore,
|
|
@@ -7312,7 +7449,7 @@ var AbsoluteFillWithTiming = ({
|
|
|
7312
7449
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
7313
7450
|
_remotionInternalIsPremounting: premountingActive,
|
|
7314
7451
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
7315
|
-
children: /* @__PURE__ */
|
|
7452
|
+
children: /* @__PURE__ */ jsx18(AbsoluteFillElement, {
|
|
7316
7453
|
ref: callbackRef,
|
|
7317
7454
|
...divProps,
|
|
7318
7455
|
style: premountingStyle ?? undefined,
|
|
@@ -7346,13 +7483,13 @@ var AbsoluteFillInner = ({
|
|
|
7346
7483
|
setRef(ref, element);
|
|
7347
7484
|
}, [ref]);
|
|
7348
7485
|
if (videoConfig === null) {
|
|
7349
|
-
return hidden ? null : /* @__PURE__ */
|
|
7486
|
+
return hidden ? null : /* @__PURE__ */ jsx18(AbsoluteFillElement, {
|
|
7350
7487
|
ref: callbackRef,
|
|
7351
7488
|
...divProps,
|
|
7352
7489
|
children
|
|
7353
7490
|
});
|
|
7354
7491
|
}
|
|
7355
|
-
return /* @__PURE__ */
|
|
7492
|
+
return /* @__PURE__ */ jsx18(AbsoluteFillWithTiming, {
|
|
7356
7493
|
...divProps,
|
|
7357
7494
|
ref: callbackRef,
|
|
7358
7495
|
from,
|
|
@@ -7384,15 +7521,14 @@ addSequenceStackTraces(AbsoluteFill);
|
|
|
7384
7521
|
// src/animated-image/AnimatedImage.tsx
|
|
7385
7522
|
import {
|
|
7386
7523
|
forwardRef as forwardRef4,
|
|
7387
|
-
useEffect as useEffect7,
|
|
7388
7524
|
useImperativeHandle as useImperativeHandle2,
|
|
7389
7525
|
useLayoutEffect as useLayoutEffect9,
|
|
7390
7526
|
useRef as useRef11,
|
|
7391
|
-
useState as
|
|
7527
|
+
useState as useState10
|
|
7392
7528
|
} from "react";
|
|
7393
7529
|
|
|
7394
7530
|
// src/use-crop-style.ts
|
|
7395
|
-
import { useMemo as
|
|
7531
|
+
import { useMemo as useMemo21 } from "react";
|
|
7396
7532
|
var useCropStyle = ({
|
|
7397
7533
|
cropLeft,
|
|
7398
7534
|
cropRight,
|
|
@@ -7402,7 +7538,7 @@ var useCropStyle = ({
|
|
|
7402
7538
|
componentName
|
|
7403
7539
|
}) => {
|
|
7404
7540
|
validateSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }, componentName);
|
|
7405
|
-
return
|
|
7541
|
+
return useMemo21(() => {
|
|
7406
7542
|
const cropClipPath = getSequenceCropClipPath({
|
|
7407
7543
|
...resolveSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }),
|
|
7408
7544
|
style
|
|
@@ -7415,7 +7551,7 @@ var useCropStyle = ({
|
|
|
7415
7551
|
};
|
|
7416
7552
|
|
|
7417
7553
|
// src/animated-image/canvas.tsx
|
|
7418
|
-
import
|
|
7554
|
+
import React28, { useCallback as useCallback9, useImperativeHandle, useMemo as useMemo23, useRef as useRef10 } from "react";
|
|
7419
7555
|
|
|
7420
7556
|
// src/calculate-image-fit.ts
|
|
7421
7557
|
var calculateImageFit = (fit, imageSize, canvasSize) => {
|
|
@@ -7626,6 +7762,8 @@ var getGpuDevice = () => {
|
|
|
7626
7762
|
// src/effects/run-effect-chain.ts
|
|
7627
7763
|
var createEffectChainState = (width, height) => {
|
|
7628
7764
|
const state = {
|
|
7765
|
+
width,
|
|
7766
|
+
height,
|
|
7629
7767
|
pool: new CanvasPool(width, height, (canvas) => {
|
|
7630
7768
|
const dead = state.cleanupRegistry.filter((entry) => entry.target === canvas);
|
|
7631
7769
|
state.cleanupRegistry = state.cleanupRegistry.filter((entry) => entry.target !== canvas);
|
|
@@ -7668,15 +7806,7 @@ var ensureSetup = (state, def, target) => {
|
|
|
7668
7806
|
state.cleanupRegistry.push({ definition: widened, state: setupState, target });
|
|
7669
7807
|
return setupState;
|
|
7670
7808
|
};
|
|
7671
|
-
var
|
|
7672
|
-
state,
|
|
7673
|
-
source,
|
|
7674
|
-
effects,
|
|
7675
|
-
output,
|
|
7676
|
-
width,
|
|
7677
|
-
height
|
|
7678
|
-
}) => {
|
|
7679
|
-
const runId = ++state.currentRunId;
|
|
7809
|
+
var runEffectChainWithoutResize = async ({ state, source, effects, output, width, height }, initialFlipSourceY, runId) => {
|
|
7680
7810
|
const isCancelled = () => state.currentRunId !== runId;
|
|
7681
7811
|
const enabledEffects = effects.filter((e) => !e.params.disabled);
|
|
7682
7812
|
const runs = groupByBackend(enabledEffects);
|
|
@@ -7705,51 +7835,57 @@ var runEffectChain = async ({
|
|
|
7705
7835
|
if (isCancelled()) {
|
|
7706
7836
|
return false;
|
|
7707
7837
|
}
|
|
7708
|
-
let flipWebGLSourceY =
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
let
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
const
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
lastTarget = currentImage ?? lastTarget;
|
|
7736
|
-
const nextRun = runs[runIndex + 1];
|
|
7737
|
-
if (nextRun && nextRun.backend !== run.backend && lastTarget) {
|
|
7738
|
-
if (run.backend === "2d" && nextRun.backend === "webgl2") {
|
|
7739
|
-
currentImage = lastTarget;
|
|
7740
|
-
flipWebGLSourceY = true;
|
|
7741
|
-
} else {
|
|
7742
|
-
const bitmap = await createImageBitmap(lastTarget);
|
|
7743
|
-
if (isCancelled()) {
|
|
7744
|
-
bitmap.close();
|
|
7745
|
-
return false;
|
|
7838
|
+
let flipWebGLSourceY = initialFlipSourceY;
|
|
7839
|
+
let bridgeBitmap = null;
|
|
7840
|
+
try {
|
|
7841
|
+
for (let runIndex = 0;runIndex < runs.length; runIndex++) {
|
|
7842
|
+
const run = runs[runIndex];
|
|
7843
|
+
let canvasIndex = 0;
|
|
7844
|
+
for (const eff of run.effects) {
|
|
7845
|
+
const dst = state.pool.getCanvas(run.backend, canvasIndex);
|
|
7846
|
+
const def = eff.definition;
|
|
7847
|
+
if (run.backend === "webgl2") {
|
|
7848
|
+
state.pool.assertContextNotLost(dst);
|
|
7849
|
+
}
|
|
7850
|
+
const setupState = ensureSetup(state, def, dst);
|
|
7851
|
+
def.apply({
|
|
7852
|
+
source: currentImage,
|
|
7853
|
+
target: dst,
|
|
7854
|
+
state: setupState,
|
|
7855
|
+
params: eff.params,
|
|
7856
|
+
width: state.width,
|
|
7857
|
+
height: state.height,
|
|
7858
|
+
gpuDevice,
|
|
7859
|
+
flipSourceY: run.backend === "webgl2" ? flipWebGLSourceY : false
|
|
7860
|
+
});
|
|
7861
|
+
bridgeBitmap?.close();
|
|
7862
|
+
bridgeBitmap = null;
|
|
7863
|
+
if (run.backend === "webgl2") {
|
|
7864
|
+
flipWebGLSourceY = true;
|
|
7746
7865
|
}
|
|
7747
|
-
currentImage =
|
|
7748
|
-
|
|
7749
|
-
|
|
7866
|
+
currentImage = dst;
|
|
7867
|
+
canvasIndex = canvasIndex === 0 ? 1 : 0;
|
|
7868
|
+
}
|
|
7869
|
+
lastTarget = currentImage ?? lastTarget;
|
|
7870
|
+
const nextRun = runs[runIndex + 1];
|
|
7871
|
+
if (nextRun && nextRun.backend !== run.backend && lastTarget) {
|
|
7872
|
+
if (run.backend === "2d" && nextRun.backend === "webgl2") {
|
|
7873
|
+
currentImage = lastTarget;
|
|
7874
|
+
flipWebGLSourceY = true;
|
|
7875
|
+
} else {
|
|
7876
|
+
bridgeBitmap = await createImageBitmap(lastTarget);
|
|
7877
|
+
if (isCancelled()) {
|
|
7878
|
+
return false;
|
|
7879
|
+
}
|
|
7880
|
+
currentImage = bridgeBitmap;
|
|
7881
|
+
if (nextRun.backend === "webgl2") {
|
|
7882
|
+
flipWebGLSourceY = false;
|
|
7883
|
+
}
|
|
7750
7884
|
}
|
|
7751
7885
|
}
|
|
7752
7886
|
}
|
|
7887
|
+
} finally {
|
|
7888
|
+
bridgeBitmap?.close();
|
|
7753
7889
|
}
|
|
7754
7890
|
if (!lastTarget) {
|
|
7755
7891
|
return true;
|
|
@@ -7762,14 +7898,41 @@ var runEffectChain = async ({
|
|
|
7762
7898
|
outCtx.drawImage(lastTarget, 0, 0, width, height);
|
|
7763
7899
|
return true;
|
|
7764
7900
|
};
|
|
7901
|
+
var runEffectChain = async (options) => {
|
|
7902
|
+
const { state, source, width, height, effects } = options;
|
|
7903
|
+
const runId = ++state.currentRunId;
|
|
7904
|
+
if (state.width === width && state.height === height || !effects.some((effect) => !effect.params.disabled)) {
|
|
7905
|
+
return runEffectChainWithoutResize(options, true, runId);
|
|
7906
|
+
}
|
|
7907
|
+
const firstEnabledEffect = effects.find((effect) => !effect.params.disabled);
|
|
7908
|
+
const resized = await createImageBitmap(source, {
|
|
7909
|
+
resizeWidth: state.width,
|
|
7910
|
+
resizeHeight: state.height,
|
|
7911
|
+
imageOrientation: firstEnabledEffect.definition.backend === "webgl2" ? "flipY" : "none"
|
|
7912
|
+
});
|
|
7913
|
+
try {
|
|
7914
|
+
if (state.currentRunId !== runId) {
|
|
7915
|
+
return false;
|
|
7916
|
+
}
|
|
7917
|
+
return await runEffectChainWithoutResize({ ...options, source: resized }, false, runId);
|
|
7918
|
+
} finally {
|
|
7919
|
+
resized.close();
|
|
7920
|
+
}
|
|
7921
|
+
};
|
|
7765
7922
|
|
|
7766
7923
|
// src/effects/use-effect-chain-state.ts
|
|
7767
|
-
import { useEffect as
|
|
7768
|
-
var useEffectChainState = () => {
|
|
7924
|
+
import { useEffect as useEffect7, useMemo as useMemo22, useRef as useRef9 } from "react";
|
|
7925
|
+
var useEffectChainState = (effectsOutputSize = null) => {
|
|
7926
|
+
const effectWidth = effectsOutputSize?.width;
|
|
7927
|
+
const effectHeight = effectsOutputSize?.height;
|
|
7928
|
+
if (effectsOutputSize) {
|
|
7929
|
+
validateDimension(effectWidth, "effectsOutputSize.width", "on an effect-capable component");
|
|
7930
|
+
validateDimension(effectHeight, "effectsOutputSize.height", "on an effect-capable component");
|
|
7931
|
+
}
|
|
7769
7932
|
const chainStateRef = useRef9(null);
|
|
7770
7933
|
const sizeRef = useRef9(null);
|
|
7771
7934
|
const unmountedRef = useRef9(false);
|
|
7772
|
-
|
|
7935
|
+
useEffect7(() => {
|
|
7773
7936
|
unmountedRef.current = false;
|
|
7774
7937
|
return () => {
|
|
7775
7938
|
unmountedRef.current = true;
|
|
@@ -7780,8 +7943,10 @@ var useEffectChainState = () => {
|
|
|
7780
7943
|
}
|
|
7781
7944
|
};
|
|
7782
7945
|
}, []);
|
|
7783
|
-
return
|
|
7946
|
+
return useMemo22(() => ({
|
|
7784
7947
|
get: (width, height) => {
|
|
7948
|
+
width = effectWidth ?? width;
|
|
7949
|
+
height = effectHeight ?? height;
|
|
7785
7950
|
if (unmountedRef.current) {
|
|
7786
7951
|
return null;
|
|
7787
7952
|
}
|
|
@@ -7794,15 +7959,15 @@ var useEffectChainState = () => {
|
|
|
7794
7959
|
}
|
|
7795
7960
|
return chainStateRef.current;
|
|
7796
7961
|
}
|
|
7797
|
-
}), []);
|
|
7962
|
+
}), [effectWidth, effectHeight]);
|
|
7798
7963
|
};
|
|
7799
7964
|
|
|
7800
7965
|
// src/animated-image/canvas.tsx
|
|
7801
|
-
import { jsx as
|
|
7802
|
-
var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, ...props }, ref) => {
|
|
7966
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
7967
|
+
var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, effectsOutputSize, ...props }, ref) => {
|
|
7803
7968
|
const canvasRef = useRef10(null);
|
|
7804
|
-
const chainState = useEffectChainState();
|
|
7805
|
-
const sourceCanvas =
|
|
7969
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
7970
|
+
const sourceCanvas = useMemo23(() => {
|
|
7806
7971
|
if (typeof document === "undefined") {
|
|
7807
7972
|
return null;
|
|
7808
7973
|
}
|
|
@@ -7860,14 +8025,14 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
|
|
|
7860
8025
|
}
|
|
7861
8026
|
};
|
|
7862
8027
|
}, [draw]);
|
|
7863
|
-
return /* @__PURE__ */
|
|
8028
|
+
return /* @__PURE__ */ jsx19("canvas", {
|
|
7864
8029
|
ref: canvasRef,
|
|
7865
8030
|
className,
|
|
7866
8031
|
style,
|
|
7867
8032
|
...props
|
|
7868
8033
|
});
|
|
7869
8034
|
};
|
|
7870
|
-
var Canvas =
|
|
8035
|
+
var Canvas = React28.forwardRef(CanvasRefForwardingFunction);
|
|
7871
8036
|
|
|
7872
8037
|
// src/animated-image/create-image-decoder.ts
|
|
7873
8038
|
var createImageDecoder = async ({
|
|
@@ -8099,7 +8264,7 @@ var resolveAnimatedImageSource = (src) => {
|
|
|
8099
8264
|
};
|
|
8100
8265
|
|
|
8101
8266
|
// src/animated-image/AnimatedImage.tsx
|
|
8102
|
-
import { jsx as
|
|
8267
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
8103
8268
|
import { createElement } from "react";
|
|
8104
8269
|
var animatedImageSchema = {
|
|
8105
8270
|
src: {
|
|
@@ -8138,12 +8303,14 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8138
8303
|
fit = "fill",
|
|
8139
8304
|
requestInit,
|
|
8140
8305
|
effects,
|
|
8306
|
+
effectsOutputSize,
|
|
8141
8307
|
controls,
|
|
8142
8308
|
...props
|
|
8143
8309
|
}, canvasRef) => {
|
|
8144
8310
|
const resolvedSrc = resolveAnimatedImageSource(src);
|
|
8145
|
-
const [decodedImage, setDecodedImage] =
|
|
8311
|
+
const [decodedImage, setDecodedImage] = useState10(null);
|
|
8146
8312
|
const imageDecoder = decodedImage?.decoder ?? null;
|
|
8313
|
+
const activeDecoderRef = useRef11(null);
|
|
8147
8314
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
8148
8315
|
const frame = useCurrentFrame();
|
|
8149
8316
|
const { fps } = useVideoConfig();
|
|
@@ -8166,12 +8333,13 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8166
8333
|
}
|
|
8167
8334
|
return c;
|
|
8168
8335
|
}, []);
|
|
8169
|
-
const [initialLoopBehavior] =
|
|
8336
|
+
const [initialLoopBehavior] = useState10(() => loopBehavior);
|
|
8170
8337
|
useLayoutEffect9(() => {
|
|
8171
8338
|
const decodeHandle = delayRender(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`);
|
|
8172
8339
|
const controller = new AbortController;
|
|
8173
8340
|
let cancelled = false;
|
|
8174
8341
|
let continued = false;
|
|
8342
|
+
let decoder = null;
|
|
8175
8343
|
const continueRenderOnce = () => {
|
|
8176
8344
|
if (continued) {
|
|
8177
8345
|
return;
|
|
@@ -8190,6 +8358,8 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8190
8358
|
d.close();
|
|
8191
8359
|
return;
|
|
8192
8360
|
}
|
|
8361
|
+
decoder = d;
|
|
8362
|
+
activeDecoderRef.current = d;
|
|
8193
8363
|
setDecodedImage({ decoder: d, handle: decodeHandle });
|
|
8194
8364
|
}).catch((err) => {
|
|
8195
8365
|
if (cancelled) {
|
|
@@ -8208,6 +8378,8 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8208
8378
|
});
|
|
8209
8379
|
return () => {
|
|
8210
8380
|
cancelled = true;
|
|
8381
|
+
activeDecoderRef.current = null;
|
|
8382
|
+
decoder?.close();
|
|
8211
8383
|
controller.abort();
|
|
8212
8384
|
continueRenderOnce();
|
|
8213
8385
|
};
|
|
@@ -8220,13 +8392,8 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8220
8392
|
delayRender,
|
|
8221
8393
|
cancelRender
|
|
8222
8394
|
]);
|
|
8223
|
-
useEffect7(() => {
|
|
8224
|
-
return () => {
|
|
8225
|
-
imageDecoder?.close();
|
|
8226
|
-
};
|
|
8227
|
-
}, [imageDecoder]);
|
|
8228
8395
|
useLayoutEffect9(() => {
|
|
8229
|
-
if (!imageDecoder || !decodedImage) {
|
|
8396
|
+
if (!imageDecoder || !decodedImage || activeDecoderRef.current !== imageDecoder) {
|
|
8230
8397
|
return;
|
|
8231
8398
|
}
|
|
8232
8399
|
const delay = delayRender(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
|
|
@@ -8273,14 +8440,17 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8273
8440
|
fit,
|
|
8274
8441
|
width,
|
|
8275
8442
|
height,
|
|
8276
|
-
cancelRender
|
|
8443
|
+
cancelRender,
|
|
8444
|
+
effectsOutputSize?.width,
|
|
8445
|
+
effectsOutputSize?.height
|
|
8277
8446
|
]);
|
|
8278
|
-
return /* @__PURE__ */
|
|
8447
|
+
return /* @__PURE__ */ jsx20(Canvas, {
|
|
8279
8448
|
ref,
|
|
8280
8449
|
width,
|
|
8281
8450
|
height,
|
|
8282
8451
|
fit,
|
|
8283
8452
|
effects: memoizedEffects,
|
|
8453
|
+
effectsOutputSize: effectsOutputSize ?? null,
|
|
8284
8454
|
...props
|
|
8285
8455
|
});
|
|
8286
8456
|
});
|
|
@@ -8308,6 +8478,7 @@ var AnimatedImageInner = ({
|
|
|
8308
8478
|
cropBottom,
|
|
8309
8479
|
requestInit,
|
|
8310
8480
|
effects = [],
|
|
8481
|
+
effectsOutputSize,
|
|
8311
8482
|
controls,
|
|
8312
8483
|
ref,
|
|
8313
8484
|
...sequenceProps
|
|
@@ -8361,11 +8532,11 @@ var AnimatedImageInner = ({
|
|
|
8361
8532
|
requestInit,
|
|
8362
8533
|
...canvasProps
|
|
8363
8534
|
};
|
|
8364
|
-
return /* @__PURE__ */
|
|
8535
|
+
return /* @__PURE__ */ jsx20(Freeze, {
|
|
8365
8536
|
frame: freezeFrame,
|
|
8366
8537
|
active: isPremountingOrPostmounting,
|
|
8367
8538
|
_remotionInternalIsPremounting: premountingActive,
|
|
8368
|
-
children: /* @__PURE__ */
|
|
8539
|
+
children: /* @__PURE__ */ jsx20(Sequence, {
|
|
8369
8540
|
layout: "none",
|
|
8370
8541
|
from: from ?? 0,
|
|
8371
8542
|
playbackRate,
|
|
@@ -8379,11 +8550,12 @@ var AnimatedImageInner = ({
|
|
|
8379
8550
|
_remotionInternalIsPremounting: premountingActive,
|
|
8380
8551
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
8381
8552
|
...sequenceProps,
|
|
8382
|
-
children: /* @__PURE__ */
|
|
8383
|
-
children: /* @__PURE__ */
|
|
8553
|
+
children: /* @__PURE__ */ jsx20(SequenceContent, {
|
|
8554
|
+
children: /* @__PURE__ */ jsx20(AnimatedImageContent, {
|
|
8384
8555
|
...animatedImageProps,
|
|
8385
8556
|
ref: actualRef,
|
|
8386
8557
|
effects,
|
|
8558
|
+
effectsOutputSize: effectsOutputSize ?? null,
|
|
8387
8559
|
controls
|
|
8388
8560
|
})
|
|
8389
8561
|
})
|
|
@@ -8398,8 +8570,8 @@ var AnimatedImageWithIntrinsicDuration = (props) => {
|
|
|
8398
8570
|
requestInitRef.current = requestInit;
|
|
8399
8571
|
const onErrorRef = useRef11(props.onError);
|
|
8400
8572
|
onErrorRef.current = props.onError;
|
|
8401
|
-
const [duration, setDuration] =
|
|
8402
|
-
const [failedHandle, setFailedHandle] =
|
|
8573
|
+
const [duration, setDuration] = useState10(null);
|
|
8574
|
+
const [failedHandle, setFailedHandle] = useState10(null);
|
|
8403
8575
|
useLayoutEffect9(() => {
|
|
8404
8576
|
const handle = delayRender(`Finding duration of <AnimatedImage src="${src}" />`);
|
|
8405
8577
|
const controller = new AbortController;
|
|
@@ -8444,7 +8616,7 @@ var AnimatedImageWithIntrinsicDuration = (props) => {
|
|
|
8444
8616
|
if (duration === null || failedHandle !== null) {
|
|
8445
8617
|
return null;
|
|
8446
8618
|
}
|
|
8447
|
-
return /* @__PURE__ */
|
|
8619
|
+
return /* @__PURE__ */ jsx20(AnimatedImageInner, {
|
|
8448
8620
|
...props,
|
|
8449
8621
|
durationInFrames: duration.durationInFrames
|
|
8450
8622
|
});
|
|
@@ -8458,7 +8630,7 @@ var AnimatedImageComponent = (props) => {
|
|
|
8458
8630
|
key: `${resolvedSrc}-${requestInitKey}-${props.trimBefore ?? 0}`
|
|
8459
8631
|
});
|
|
8460
8632
|
}
|
|
8461
|
-
return /* @__PURE__ */
|
|
8633
|
+
return /* @__PURE__ */ jsx20(AnimatedImageInner, {
|
|
8462
8634
|
...props
|
|
8463
8635
|
});
|
|
8464
8636
|
};
|
|
@@ -8503,17 +8675,17 @@ var createEffect = (definition) => {
|
|
|
8503
8675
|
return factory;
|
|
8504
8676
|
};
|
|
8505
8677
|
// src/Artifact.tsx
|
|
8506
|
-
import { useContext as
|
|
8678
|
+
import { useContext as useContext29, useLayoutEffect as useLayoutEffect11, useState as useState12 } from "react";
|
|
8507
8679
|
|
|
8508
8680
|
// src/RenderAssetManager.tsx
|
|
8509
8681
|
import {
|
|
8510
|
-
createContext as
|
|
8682
|
+
createContext as createContext29,
|
|
8511
8683
|
useCallback as useCallback10,
|
|
8512
8684
|
useImperativeHandle as useImperativeHandle3,
|
|
8513
8685
|
useLayoutEffect as useLayoutEffect10,
|
|
8514
|
-
useMemo as
|
|
8686
|
+
useMemo as useMemo24,
|
|
8515
8687
|
useRef as useRef12,
|
|
8516
|
-
useState as
|
|
8688
|
+
useState as useState11
|
|
8517
8689
|
} from "react";
|
|
8518
8690
|
|
|
8519
8691
|
// src/validation/validate-artifact.ts
|
|
@@ -8548,8 +8720,8 @@ var validateRenderAsset = (artifact) => {
|
|
|
8548
8720
|
};
|
|
8549
8721
|
|
|
8550
8722
|
// src/RenderAssetManager.tsx
|
|
8551
|
-
import { jsx as
|
|
8552
|
-
var RenderAssetManager =
|
|
8723
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
8724
|
+
var RenderAssetManager = createContext29({
|
|
8553
8725
|
registerRenderAsset: () => {
|
|
8554
8726
|
return;
|
|
8555
8727
|
},
|
|
@@ -8559,7 +8731,7 @@ var RenderAssetManager = createContext28({
|
|
|
8559
8731
|
renderAssets: []
|
|
8560
8732
|
});
|
|
8561
8733
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
8562
|
-
const [renderAssets, setRenderAssets] =
|
|
8734
|
+
const [renderAssets, setRenderAssets] = useState11([]);
|
|
8563
8735
|
const renderAssetsRef = useRef12([]);
|
|
8564
8736
|
const registerRenderAsset = useCallback10((renderAsset) => {
|
|
8565
8737
|
validateRenderAsset(renderAsset);
|
|
@@ -8592,14 +8764,14 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
8592
8764
|
};
|
|
8593
8765
|
}
|
|
8594
8766
|
}, []);
|
|
8595
|
-
const contextValue =
|
|
8767
|
+
const contextValue = useMemo24(() => {
|
|
8596
8768
|
return {
|
|
8597
8769
|
registerRenderAsset,
|
|
8598
8770
|
unregisterRenderAsset,
|
|
8599
8771
|
renderAssets
|
|
8600
8772
|
};
|
|
8601
8773
|
}, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
|
|
8602
|
-
return /* @__PURE__ */
|
|
8774
|
+
return /* @__PURE__ */ jsx21(RenderAssetManager.Provider, {
|
|
8603
8775
|
value: contextValue,
|
|
8604
8776
|
children
|
|
8605
8777
|
});
|
|
@@ -8608,10 +8780,10 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
8608
8780
|
// src/Artifact.tsx
|
|
8609
8781
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
8610
8782
|
var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
8611
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
8783
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext29(RenderAssetManager);
|
|
8612
8784
|
const env = useRemotionEnvironment();
|
|
8613
8785
|
const frame = useCurrentFrame();
|
|
8614
|
-
const [id] =
|
|
8786
|
+
const [id] = useState12(() => {
|
|
8615
8787
|
return String(Math.random());
|
|
8616
8788
|
});
|
|
8617
8789
|
useLayoutEffect11(() => {
|
|
@@ -8665,7 +8837,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
8665
8837
|
};
|
|
8666
8838
|
Artifact.Thumbnail = ArtifactThumbnail;
|
|
8667
8839
|
// src/audio/html5-audio.tsx
|
|
8668
|
-
import { forwardRef as forwardRef7, useCallback as useCallback17, useContext as
|
|
8840
|
+
import { forwardRef as forwardRef7, useCallback as useCallback17, useContext as useContext44 } from "react";
|
|
8669
8841
|
|
|
8670
8842
|
// src/absolute-src.ts
|
|
8671
8843
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -8707,11 +8879,11 @@ var getMediaTrimAfter = ({
|
|
|
8707
8879
|
};
|
|
8708
8880
|
|
|
8709
8881
|
// src/loop/index.tsx
|
|
8710
|
-
import
|
|
8711
|
-
import { jsx as
|
|
8712
|
-
var LoopTimelineContext =
|
|
8882
|
+
import React29, { createContext as createContext30, useContext as useContext30, useMemo as useMemo25 } from "react";
|
|
8883
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
8884
|
+
var LoopTimelineContext = createContext30(null);
|
|
8713
8885
|
var useLoop = () => {
|
|
8714
|
-
return
|
|
8886
|
+
return React29.useContext(LoopContext);
|
|
8715
8887
|
};
|
|
8716
8888
|
var Loop = ({
|
|
8717
8889
|
durationInFrames,
|
|
@@ -8724,7 +8896,7 @@ var Loop = ({
|
|
|
8724
8896
|
}) => {
|
|
8725
8897
|
const currentFrame = useCurrentFrame();
|
|
8726
8898
|
const { durationInFrames: compDuration } = useVideoConfig();
|
|
8727
|
-
const parentSequence =
|
|
8899
|
+
const parentSequence = useContext30(SequenceContext);
|
|
8728
8900
|
const parentPlaybackRate = parentSequence?.playbackRate ?? 1;
|
|
8729
8901
|
const playbackRateValue = playbackRate ?? 1;
|
|
8730
8902
|
const iterationDurationInFrames = durationInFrames / playbackRateValue;
|
|
@@ -8753,20 +8925,20 @@ var Loop = ({
|
|
|
8753
8925
|
const iteration = Math.max(0, Math.min(actualTimes - 1, isAtBoundary ? nearestIteration : Math.floor(loopsElapsed)));
|
|
8754
8926
|
const start = isAtBoundary ? currentFrame : iteration * iterationDurationInFrames;
|
|
8755
8927
|
const from = Math.max(0, Math.min(start, maxFrame));
|
|
8756
|
-
const loopDisplay =
|
|
8928
|
+
const loopDisplay = useMemo25(() => {
|
|
8757
8929
|
return {
|
|
8758
8930
|
numberOfTimes: Math.min(compDuration / iterationDurationInFrames, times),
|
|
8759
8931
|
startOffset: -from,
|
|
8760
8932
|
durationInFrames: iterationDurationInFrames
|
|
8761
8933
|
};
|
|
8762
8934
|
}, [compDuration, from, iterationDurationInFrames, times]);
|
|
8763
|
-
const loopContext =
|
|
8935
|
+
const loopContext = useMemo25(() => {
|
|
8764
8936
|
return {
|
|
8765
8937
|
iteration,
|
|
8766
8938
|
durationInFrames
|
|
8767
8939
|
};
|
|
8768
8940
|
}, [iteration, durationInFrames]);
|
|
8769
|
-
const timelineContext =
|
|
8941
|
+
const timelineContext = useMemo25(() => ({
|
|
8770
8942
|
startFrame: loopStartFrame,
|
|
8771
8943
|
firstVisibleFrame,
|
|
8772
8944
|
endFrame,
|
|
@@ -8775,11 +8947,11 @@ var Loop = ({
|
|
|
8775
8947
|
if (actualTimes === 0) {
|
|
8776
8948
|
return null;
|
|
8777
8949
|
}
|
|
8778
|
-
return /* @__PURE__ */
|
|
8950
|
+
return /* @__PURE__ */ jsx22(LoopTimelineContext.Provider, {
|
|
8779
8951
|
value: timelineContext,
|
|
8780
|
-
children: /* @__PURE__ */
|
|
8952
|
+
children: /* @__PURE__ */ jsx22(LoopContext.Provider, {
|
|
8781
8953
|
value: loopContext,
|
|
8782
|
-
children: /* @__PURE__ */
|
|
8954
|
+
children: /* @__PURE__ */ jsx22(Sequence, {
|
|
8783
8955
|
durationInFrames,
|
|
8784
8956
|
from,
|
|
8785
8957
|
name: name ?? "<Loop>",
|
|
@@ -8796,7 +8968,7 @@ var Loop = ({
|
|
|
8796
8968
|
Loop.useLoop = useLoop;
|
|
8797
8969
|
|
|
8798
8970
|
// src/prefetch.ts
|
|
8799
|
-
import { useContext as
|
|
8971
|
+
import { useContext as useContext31 } from "react";
|
|
8800
8972
|
|
|
8801
8973
|
// src/playback-logging.ts
|
|
8802
8974
|
var playbackLogging = ({
|
|
@@ -8810,9 +8982,9 @@ var playbackLogging = ({
|
|
|
8810
8982
|
};
|
|
8811
8983
|
|
|
8812
8984
|
// src/prefetch-state.tsx
|
|
8813
|
-
import { createContext as
|
|
8814
|
-
import { jsx as
|
|
8815
|
-
var PreloadContext =
|
|
8985
|
+
import { createContext as createContext31, useEffect as useEffect8, useState as useState13 } from "react";
|
|
8986
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
8987
|
+
var PreloadContext = createContext31({});
|
|
8816
8988
|
var preloads = {};
|
|
8817
8989
|
var updaters = [];
|
|
8818
8990
|
var setPreloads = (updater) => {
|
|
@@ -8820,7 +8992,7 @@ var setPreloads = (updater) => {
|
|
|
8820
8992
|
updaters.forEach((u) => u());
|
|
8821
8993
|
};
|
|
8822
8994
|
var PrefetchProvider = ({ children }) => {
|
|
8823
|
-
const [_preloads, _setPreloads] =
|
|
8995
|
+
const [_preloads, _setPreloads] = useState13(() => preloads);
|
|
8824
8996
|
useEffect8(() => {
|
|
8825
8997
|
const updaterFunction = () => {
|
|
8826
8998
|
_setPreloads(preloads);
|
|
@@ -8830,7 +9002,7 @@ var PrefetchProvider = ({ children }) => {
|
|
|
8830
9002
|
updaters = updaters.filter((u) => u !== updaterFunction);
|
|
8831
9003
|
};
|
|
8832
9004
|
}, []);
|
|
8833
|
-
return /* @__PURE__ */
|
|
9005
|
+
return /* @__PURE__ */ jsx23(PreloadContext.Provider, {
|
|
8834
9006
|
value: _preloads,
|
|
8835
9007
|
children
|
|
8836
9008
|
});
|
|
@@ -8852,7 +9024,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
8852
9024
|
return src.slice(0, hashIndex);
|
|
8853
9025
|
};
|
|
8854
9026
|
var usePreload = (src) => {
|
|
8855
|
-
const preloads =
|
|
9027
|
+
const preloads = useContext31(PreloadContext);
|
|
8856
9028
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
8857
9029
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
8858
9030
|
if (!preloads[withoutHashFragment]) {
|
|
@@ -9137,8 +9309,8 @@ var resolveTrimProps = ({
|
|
|
9137
9309
|
};
|
|
9138
9310
|
|
|
9139
9311
|
// src/video/duration-state.tsx
|
|
9140
|
-
import { createContext as
|
|
9141
|
-
import { jsx as
|
|
9312
|
+
import { createContext as createContext32, useMemo as useMemo26, useReducer } from "react";
|
|
9313
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
9142
9314
|
var durationReducer = (state, action) => {
|
|
9143
9315
|
switch (action.type) {
|
|
9144
9316
|
case "got-duration": {
|
|
@@ -9155,7 +9327,7 @@ var durationReducer = (state, action) => {
|
|
|
9155
9327
|
return state;
|
|
9156
9328
|
}
|
|
9157
9329
|
};
|
|
9158
|
-
var DurationsContext =
|
|
9330
|
+
var DurationsContext = createContext32({
|
|
9159
9331
|
durations: {},
|
|
9160
9332
|
setDurations: () => {
|
|
9161
9333
|
throw new Error("context missing");
|
|
@@ -9163,13 +9335,13 @@ var DurationsContext = createContext31({
|
|
|
9163
9335
|
});
|
|
9164
9336
|
var DurationsContextProvider = ({ children }) => {
|
|
9165
9337
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
9166
|
-
const value =
|
|
9338
|
+
const value = useMemo26(() => {
|
|
9167
9339
|
return {
|
|
9168
9340
|
durations,
|
|
9169
9341
|
setDurations
|
|
9170
9342
|
};
|
|
9171
9343
|
}, [durations]);
|
|
9172
|
-
return /* @__PURE__ */
|
|
9344
|
+
return /* @__PURE__ */ jsx24(DurationsContext.Provider, {
|
|
9173
9345
|
value,
|
|
9174
9346
|
children
|
|
9175
9347
|
});
|
|
@@ -9177,14 +9349,14 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
9177
9349
|
|
|
9178
9350
|
// src/audio/AudioForPreview.tsx
|
|
9179
9351
|
import { useCallback as useCallback16 } from "react";
|
|
9180
|
-
import
|
|
9352
|
+
import React35, {
|
|
9181
9353
|
forwardRef as forwardRef5,
|
|
9182
|
-
useContext as
|
|
9354
|
+
useContext as useContext41,
|
|
9183
9355
|
useEffect as useEffect15,
|
|
9184
9356
|
useImperativeHandle as useImperativeHandle4,
|
|
9185
|
-
useMemo as
|
|
9357
|
+
useMemo as useMemo34,
|
|
9186
9358
|
useRef as useRef21,
|
|
9187
|
-
useState as
|
|
9359
|
+
useState as useState17
|
|
9188
9360
|
} from "react";
|
|
9189
9361
|
|
|
9190
9362
|
// src/get-cross-origin-value.ts
|
|
@@ -9240,18 +9412,18 @@ var random = (seed, dummy) => {
|
|
|
9240
9412
|
};
|
|
9241
9413
|
|
|
9242
9414
|
// src/use-amplification.ts
|
|
9243
|
-
import { useContext as
|
|
9415
|
+
import { useContext as useContext33, useLayoutEffect as useLayoutEffect12, useRef as useRef16 } from "react";
|
|
9244
9416
|
|
|
9245
9417
|
// src/audio/shared-audio-tags.tsx
|
|
9246
|
-
import
|
|
9247
|
-
createContext as
|
|
9418
|
+
import React32, {
|
|
9419
|
+
createContext as createContext33,
|
|
9248
9420
|
createRef as createRef2,
|
|
9249
9421
|
useCallback as useCallback11,
|
|
9250
|
-
useContext as
|
|
9422
|
+
useContext as useContext32,
|
|
9251
9423
|
useEffect as useEffect9,
|
|
9252
|
-
useMemo as
|
|
9424
|
+
useMemo as useMemo28,
|
|
9253
9425
|
useRef as useRef14,
|
|
9254
|
-
useState as
|
|
9426
|
+
useState as useState14
|
|
9255
9427
|
} from "react";
|
|
9256
9428
|
|
|
9257
9429
|
// src/play-and-handle-not-allowed-error.ts
|
|
@@ -9354,7 +9526,7 @@ var makeSharedElementSourceNode = ({
|
|
|
9354
9526
|
};
|
|
9355
9527
|
|
|
9356
9528
|
// src/audio/use-audio-context.ts
|
|
9357
|
-
import { useMemo as
|
|
9529
|
+
import { useMemo as useMemo27, useRef as useRef13 } from "react";
|
|
9358
9530
|
var warned = false;
|
|
9359
9531
|
var warnOnce = (logLevel) => {
|
|
9360
9532
|
if (warned) {
|
|
@@ -9376,7 +9548,7 @@ var useSingletonAudioContext = ({
|
|
|
9376
9548
|
if (sampleRate !== initialSampleRate.current) {
|
|
9377
9549
|
throw new Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${initialSampleRate.current} Hz, but ${sampleRate} Hz was passed later.`);
|
|
9378
9550
|
}
|
|
9379
|
-
const context =
|
|
9551
|
+
const context = useMemo27(() => {
|
|
9380
9552
|
if (env.isRendering) {
|
|
9381
9553
|
return null;
|
|
9382
9554
|
}
|
|
@@ -9513,7 +9685,7 @@ var waitUntilActuallyResumed = (audioContext, logLevel, signal, isAutoPlayAttemp
|
|
|
9513
9685
|
};
|
|
9514
9686
|
|
|
9515
9687
|
// src/audio/shared-audio-tags.tsx
|
|
9516
|
-
import { jsx as
|
|
9688
|
+
import { jsx as jsx25, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
9517
9689
|
var EMPTY_AUDIO = "data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV";
|
|
9518
9690
|
var compareProps = (obj1, obj2) => {
|
|
9519
9691
|
const keysA = Object.keys(obj1).sort();
|
|
@@ -9540,8 +9712,8 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
9540
9712
|
}
|
|
9541
9713
|
return true;
|
|
9542
9714
|
};
|
|
9543
|
-
var SharedAudioContext =
|
|
9544
|
-
var SharedAudioTagsContext =
|
|
9715
|
+
var SharedAudioContext = createContext33(null);
|
|
9716
|
+
var SharedAudioTagsContext = createContext33(null);
|
|
9545
9717
|
var shouldSaveForLater = (state) => {
|
|
9546
9718
|
if (state === "suspended" || state === "running-to-suspended" || state === "interrupted") {
|
|
9547
9719
|
return true;
|
|
@@ -9574,9 +9746,9 @@ var SharedAudioContextProvider = ({
|
|
|
9574
9746
|
const isResuming = useRef14(null);
|
|
9575
9747
|
const nextResumeAttemptId = useRef14(0);
|
|
9576
9748
|
const nextResumeIsAutoPlayAttempt = useRef14(false);
|
|
9577
|
-
const audioSyncAnchor =
|
|
9749
|
+
const audioSyncAnchor = useMemo28(() => ({ value: 0 }), []);
|
|
9578
9750
|
const audioSyncAnchorListeners = useRef14([]);
|
|
9579
|
-
const audioSyncAnchorEmitter =
|
|
9751
|
+
const audioSyncAnchorEmitter = useMemo28(() => {
|
|
9580
9752
|
return {
|
|
9581
9753
|
dispatch: (event) => {
|
|
9582
9754
|
audioSyncAnchorListeners.current.forEach((l) => l(event));
|
|
@@ -9594,9 +9766,9 @@ var SharedAudioContextProvider = ({
|
|
|
9594
9766
|
const prevEndTimes = useRef14({ scheduledEndTime: null, mediaEndTime: null });
|
|
9595
9767
|
const nodesToResume = useRef14(new Map);
|
|
9596
9768
|
const unscheduleAudioNode = useCallback11((node) => {
|
|
9597
|
-
nodesToResume.current.delete(node);
|
|
9769
|
+
return nodesToResume.current.delete(node);
|
|
9598
9770
|
}, []);
|
|
9599
|
-
const scheduleAudioNode =
|
|
9771
|
+
const scheduleAudioNode = useMemo28(() => {
|
|
9600
9772
|
return ({
|
|
9601
9773
|
node,
|
|
9602
9774
|
mediaTimestamp,
|
|
@@ -9741,7 +9913,7 @@ var SharedAudioContextProvider = ({
|
|
|
9741
9913
|
ctxAndGain.suspend().catch(() => {});
|
|
9742
9914
|
};
|
|
9743
9915
|
}, [ctxAndGain, _experimentalKeepAudioContextAlive]);
|
|
9744
|
-
const audioContextValue =
|
|
9916
|
+
const audioContextValue = useMemo28(() => {
|
|
9745
9917
|
return {
|
|
9746
9918
|
sampleRate,
|
|
9747
9919
|
audioContext: ctxAndGain?.audioContext ?? null,
|
|
@@ -9770,24 +9942,24 @@ var SharedAudioContextProvider = ({
|
|
|
9770
9942
|
unscheduleAudioNode,
|
|
9771
9943
|
_experimentalKeepAudioContextAlive
|
|
9772
9944
|
]);
|
|
9773
|
-
return /* @__PURE__ */
|
|
9945
|
+
return /* @__PURE__ */ jsx25(SharedAudioContext.Provider, {
|
|
9774
9946
|
value: audioContextValue,
|
|
9775
9947
|
children
|
|
9776
9948
|
});
|
|
9777
9949
|
};
|
|
9778
9950
|
var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
9779
9951
|
const audios = useRef14([]);
|
|
9780
|
-
const [initialNumberOfAudioTags] =
|
|
9952
|
+
const [initialNumberOfAudioTags] = useState14(numberOfAudioTags);
|
|
9781
9953
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
9782
9954
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
9783
9955
|
}
|
|
9784
9956
|
const logLevel = useLogLevel();
|
|
9785
9957
|
const mountTime = useMountTime();
|
|
9786
9958
|
const env = useRemotionEnvironment();
|
|
9787
|
-
const audioCtx =
|
|
9959
|
+
const audioCtx = useContext32(SharedAudioContext);
|
|
9788
9960
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
9789
9961
|
const resume = audioCtx?.resume;
|
|
9790
|
-
const [refs] =
|
|
9962
|
+
const [refs] = useState14(() => {
|
|
9791
9963
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
9792
9964
|
const ref = createRef2();
|
|
9793
9965
|
return {
|
|
@@ -9803,7 +9975,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
9803
9975
|
for (const { mediaElementSourceNode } of refs) {
|
|
9804
9976
|
mediaElementSourceNode?.setAudioContext(audioContext);
|
|
9805
9977
|
}
|
|
9806
|
-
const effectToUse =
|
|
9978
|
+
const effectToUse = React32.useInsertionEffect ?? React32.useLayoutEffect;
|
|
9807
9979
|
effectToUse(() => {
|
|
9808
9980
|
return () => {
|
|
9809
9981
|
requestAnimationFrame(() => {
|
|
@@ -9929,7 +10101,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
9929
10101
|
});
|
|
9930
10102
|
resume?.();
|
|
9931
10103
|
}, [logLevel, mountTime, refs, env.isPlayer, resume]);
|
|
9932
|
-
const audioTagsValue =
|
|
10104
|
+
const audioTagsValue = useMemo28(() => {
|
|
9933
10105
|
return {
|
|
9934
10106
|
registerAudio,
|
|
9935
10107
|
unregisterAudio,
|
|
@@ -9944,9 +10116,9 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
9944
10116
|
unregisterAudio,
|
|
9945
10117
|
updateAudio
|
|
9946
10118
|
]);
|
|
9947
|
-
const sharedAudioTagElements =
|
|
10119
|
+
const sharedAudioTagElements = useMemo28(() => {
|
|
9948
10120
|
return refs.map(({ id, ref }) => {
|
|
9949
|
-
return /* @__PURE__ */
|
|
10121
|
+
return /* @__PURE__ */ jsx25("audio", {
|
|
9950
10122
|
ref,
|
|
9951
10123
|
preload: "metadata",
|
|
9952
10124
|
src: EMPTY_AUDIO
|
|
@@ -9967,13 +10139,13 @@ var useSharedAudio = ({
|
|
|
9967
10139
|
premounting,
|
|
9968
10140
|
postmounting
|
|
9969
10141
|
}) => {
|
|
9970
|
-
const audioCtx =
|
|
9971
|
-
const tagsCtx =
|
|
9972
|
-
const [elem] =
|
|
10142
|
+
const audioCtx = useContext32(SharedAudioContext);
|
|
10143
|
+
const tagsCtx = useContext32(SharedAudioTagsContext);
|
|
10144
|
+
const [elem] = useState14(() => {
|
|
9973
10145
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
9974
10146
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
9975
10147
|
}
|
|
9976
|
-
const el =
|
|
10148
|
+
const el = React32.createRef();
|
|
9977
10149
|
const mediaElementSourceNode = makeSharedElementSourceNode({
|
|
9978
10150
|
audioContext: audioCtx?.audioContext ?? null,
|
|
9979
10151
|
ref: el
|
|
@@ -9993,7 +10165,7 @@ var useSharedAudio = ({
|
|
|
9993
10165
|
};
|
|
9994
10166
|
});
|
|
9995
10167
|
elem.mediaElementSourceNode?.setAudioContext(audioCtx?.audioContext ?? null);
|
|
9996
|
-
const effectToUse =
|
|
10168
|
+
const effectToUse = React32.useInsertionEffect ?? React32.useLayoutEffect;
|
|
9997
10169
|
if (typeof document !== "undefined") {
|
|
9998
10170
|
effectToUse(() => {
|
|
9999
10171
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
@@ -10157,7 +10329,7 @@ var useVolume = ({
|
|
|
10157
10329
|
const audioStuffRef = useRef16(null);
|
|
10158
10330
|
const currentVolumeRef = useRef16(volume);
|
|
10159
10331
|
currentVolumeRef.current = volume;
|
|
10160
|
-
const sharedAudioContext =
|
|
10332
|
+
const sharedAudioContext = useContext33(SharedAudioContext);
|
|
10161
10333
|
if (!sharedAudioContext) {
|
|
10162
10334
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
10163
10335
|
}
|
|
@@ -10223,19 +10395,19 @@ var useVolume = ({
|
|
|
10223
10395
|
};
|
|
10224
10396
|
|
|
10225
10397
|
// src/use-media-in-timeline.ts
|
|
10226
|
-
import { useCallback as useCallback12, useContext as
|
|
10398
|
+
import { useCallback as useCallback12, useContext as useContext35, useMemo as useMemo29 } from "react";
|
|
10227
10399
|
|
|
10228
10400
|
// src/audio/use-audio-frame.ts
|
|
10229
|
-
import { createContext as
|
|
10230
|
-
var Html5MediaTrimContext =
|
|
10401
|
+
import { createContext as createContext34, useContext as useContext34 } from "react";
|
|
10402
|
+
var Html5MediaTrimContext = createContext34(0);
|
|
10231
10403
|
var useMediaStartsAt = () => {
|
|
10232
|
-
const parentSequence =
|
|
10404
|
+
const parentSequence = useContext34(SequenceContext);
|
|
10233
10405
|
return parentSequence?.cumulatedNegativeFrom ?? 0;
|
|
10234
10406
|
};
|
|
10235
10407
|
var useFrameForVolumeProp = (behavior) => {
|
|
10236
10408
|
const loop = Loop.useLoop();
|
|
10237
|
-
const loopTimeline =
|
|
10238
|
-
const sequenceContext =
|
|
10409
|
+
const loopTimeline = useContext34(LoopTimelineContext);
|
|
10410
|
+
const sequenceContext = useContext34(SequenceContext);
|
|
10239
10411
|
const frame = useCurrentFrame();
|
|
10240
10412
|
const startsAt = useMediaStartsAt();
|
|
10241
10413
|
if (behavior === "repeat" || loop === null) {
|
|
@@ -10303,7 +10475,7 @@ var useBasicMediaInTimeline = ({
|
|
|
10303
10475
|
if (!src) {
|
|
10304
10476
|
throw new Error("No src passed");
|
|
10305
10477
|
}
|
|
10306
|
-
const parentSequence =
|
|
10478
|
+
const parentSequence = useContext35(SequenceContext);
|
|
10307
10479
|
const duration = getTimelineDuration({
|
|
10308
10480
|
compositionDurationInFrames: sequenceDurationInFrames,
|
|
10309
10481
|
playbackRate,
|
|
@@ -10313,7 +10485,7 @@ var useBasicMediaInTimeline = ({
|
|
|
10313
10485
|
loop
|
|
10314
10486
|
});
|
|
10315
10487
|
const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
|
|
10316
|
-
const memoizedResult =
|
|
10488
|
+
const memoizedResult = useMemo29(() => {
|
|
10317
10489
|
return {
|
|
10318
10490
|
duration,
|
|
10319
10491
|
finalDisplayName: displayName ?? getAssetDisplayName(src),
|
|
@@ -10339,17 +10511,17 @@ var useMediaInTimelineRegistration = ({
|
|
|
10339
10511
|
documentationLink,
|
|
10340
10512
|
muted
|
|
10341
10513
|
}) => {
|
|
10342
|
-
const parentSequence =
|
|
10343
|
-
const timelineTrack =
|
|
10344
|
-
const mediaTrimBefore =
|
|
10345
|
-
const sequenceRegistrationEnabled =
|
|
10514
|
+
const parentSequence = useContext35(SequenceContext);
|
|
10515
|
+
const timelineTrack = useContext35(TimelineTrackContext);
|
|
10516
|
+
const mediaTrimBefore = useContext35(Html5MediaTrimContext);
|
|
10517
|
+
const sequenceRegistrationEnabled = useContext35(SequenceRegistrationContext);
|
|
10346
10518
|
const { durationInFrames } = useVideoConfig();
|
|
10347
10519
|
const mediaStartsAt = useMediaStartsAt();
|
|
10348
|
-
const canvasOutlinesEnabled =
|
|
10520
|
+
const canvasOutlinesEnabled = useContext35(SequenceOutlineContext);
|
|
10349
10521
|
const { isStudio } = useRemotionEnvironment();
|
|
10350
10522
|
const stack = getStack();
|
|
10351
10523
|
const getStackForRegistration = useCallback12(() => stack, [stack]);
|
|
10352
|
-
const automaticOutlineRef =
|
|
10524
|
+
const automaticOutlineRef = useMemo29(() => mediaType === "video" && (isStudio || canvasOutlinesEnabled) ? SequenceOutlineInternals.createRef() : null, [canvasOutlinesEnabled, isStudio, mediaType]);
|
|
10353
10525
|
const { duration, finalDisplayName } = useBasicMediaInTimeline({
|
|
10354
10526
|
src,
|
|
10355
10527
|
displayName,
|
|
@@ -10430,30 +10602,30 @@ var useMediaInTimelineRegistration = ({
|
|
|
10430
10602
|
// src/use-media-playback.ts
|
|
10431
10603
|
import {
|
|
10432
10604
|
useCallback as useCallback15,
|
|
10433
|
-
useContext as
|
|
10605
|
+
useContext as useContext38,
|
|
10434
10606
|
useEffect as useEffect13,
|
|
10435
10607
|
useLayoutEffect as useLayoutEffect14,
|
|
10436
10608
|
useRef as useRef19
|
|
10437
10609
|
} from "react";
|
|
10438
10610
|
|
|
10439
10611
|
// src/buffer-until-first-frame.ts
|
|
10440
|
-
import { useCallback as useCallback14, useMemo as
|
|
10612
|
+
import { useCallback as useCallback14, useMemo as useMemo32, useRef as useRef17 } from "react";
|
|
10441
10613
|
|
|
10442
10614
|
// src/use-buffer-state.ts
|
|
10443
|
-
import { useContext as
|
|
10615
|
+
import { useContext as useContext37, useMemo as useMemo31 } from "react";
|
|
10444
10616
|
|
|
10445
10617
|
// src/buffering.tsx
|
|
10446
|
-
import
|
|
10618
|
+
import React33, {
|
|
10447
10619
|
useCallback as useCallback13,
|
|
10448
|
-
useContext as
|
|
10620
|
+
useContext as useContext36,
|
|
10449
10621
|
useEffect as useEffect10,
|
|
10450
10622
|
useLayoutEffect as useLayoutEffect13,
|
|
10451
|
-
useMemo as
|
|
10452
|
-
useState as
|
|
10623
|
+
useMemo as useMemo30,
|
|
10624
|
+
useState as useState15
|
|
10453
10625
|
} from "react";
|
|
10454
|
-
import { jsx as
|
|
10626
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
10455
10627
|
var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
10456
|
-
const [blockCount, setBlockCount] =
|
|
10628
|
+
const [blockCount, setBlockCount] = useState15(0);
|
|
10457
10629
|
const env = useRemotionEnvironment();
|
|
10458
10630
|
const rendering = env.isRendering;
|
|
10459
10631
|
const addBlock = useCallback13(() => {
|
|
@@ -10506,14 +10678,14 @@ var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
|
10506
10678
|
}
|
|
10507
10679
|
}, [blockCount]);
|
|
10508
10680
|
}
|
|
10509
|
-
return
|
|
10681
|
+
return useMemo30(() => ({ addBlock }), [addBlock]);
|
|
10510
10682
|
};
|
|
10511
|
-
var BufferingContextReact =
|
|
10683
|
+
var BufferingContextReact = React33.createContext(null);
|
|
10512
10684
|
var BufferingProvider = ({ children }) => {
|
|
10513
|
-
const { logLevel, mountTime } =
|
|
10514
|
-
const { isBuffering, setBuffering } =
|
|
10685
|
+
const { logLevel, mountTime } = useContext36(LogLevelContext);
|
|
10686
|
+
const { isBuffering, setBuffering } = useContext36(SetTimelineContext);
|
|
10515
10687
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime, setBuffering, isBuffering);
|
|
10516
|
-
return /* @__PURE__ */
|
|
10688
|
+
return /* @__PURE__ */ jsx26(BufferingContextReact.Provider, {
|
|
10517
10689
|
value: bufferManager,
|
|
10518
10690
|
children
|
|
10519
10691
|
});
|
|
@@ -10521,10 +10693,10 @@ var BufferingProvider = ({ children }) => {
|
|
|
10521
10693
|
|
|
10522
10694
|
// src/use-buffer-state.ts
|
|
10523
10695
|
var useBufferState = () => {
|
|
10524
|
-
const buffer =
|
|
10696
|
+
const buffer = useContext37(BufferingContextReact);
|
|
10525
10697
|
const logLevel = useLogLevel();
|
|
10526
10698
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
10527
|
-
return
|
|
10699
|
+
return useMemo31(() => ({
|
|
10528
10700
|
delayPlayback: () => {
|
|
10529
10701
|
if (!addBlock) {
|
|
10530
10702
|
throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
|
|
@@ -10632,7 +10804,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
10632
10804
|
onVariableFpsVideoDetected,
|
|
10633
10805
|
pauseWhenBuffering
|
|
10634
10806
|
]);
|
|
10635
|
-
return
|
|
10807
|
+
return useMemo32(() => {
|
|
10636
10808
|
return {
|
|
10637
10809
|
isBuffering: () => bufferingRef.current,
|
|
10638
10810
|
bufferUntilFirstFrame
|
|
@@ -10709,9 +10881,9 @@ var getMediaSyncAction = (input) => {
|
|
|
10709
10881
|
};
|
|
10710
10882
|
|
|
10711
10883
|
// src/media-tag-current-time-timestamp.ts
|
|
10712
|
-
import
|
|
10884
|
+
import React34 from "react";
|
|
10713
10885
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
10714
|
-
const lastUpdate =
|
|
10886
|
+
const lastUpdate = React34.useRef({
|
|
10715
10887
|
time: mediaRef.current?.currentTime ?? 0,
|
|
10716
10888
|
lastUpdate: performance.now()
|
|
10717
10889
|
});
|
|
@@ -10745,7 +10917,7 @@ var seek = ({
|
|
|
10745
10917
|
};
|
|
10746
10918
|
|
|
10747
10919
|
// src/use-media-buffering.ts
|
|
10748
|
-
import { useEffect as useEffect11, useState as
|
|
10920
|
+
import { useEffect as useEffect11, useState as useState16 } from "react";
|
|
10749
10921
|
var useMediaBuffering = ({
|
|
10750
10922
|
element,
|
|
10751
10923
|
shouldBuffer,
|
|
@@ -10756,7 +10928,7 @@ var useMediaBuffering = ({
|
|
|
10756
10928
|
src
|
|
10757
10929
|
}) => {
|
|
10758
10930
|
const buffer = useBufferState();
|
|
10759
|
-
const [isBuffering, setIsBuffering] =
|
|
10931
|
+
const [isBuffering, setIsBuffering] = useState16(false);
|
|
10760
10932
|
useEffect11(() => {
|
|
10761
10933
|
let cleanupFns = [];
|
|
10762
10934
|
const { current } = element;
|
|
@@ -11044,7 +11216,7 @@ var useMediaPlayback = ({
|
|
|
11044
11216
|
const playing = usePlaying();
|
|
11045
11217
|
const playerBuffering = useBuffering();
|
|
11046
11218
|
const { fps } = useVideoConfig();
|
|
11047
|
-
const mediaTrimBefore =
|
|
11219
|
+
const mediaTrimBefore = useContext38(Html5MediaTrimContext);
|
|
11048
11220
|
const lastSeekDueToShift = useRef19(null);
|
|
11049
11221
|
const lastSeek = useRef19(null);
|
|
11050
11222
|
const logLevel = useLogLevel();
|
|
@@ -11090,7 +11262,7 @@ var useMediaPlayback = ({
|
|
|
11090
11262
|
logLevel,
|
|
11091
11263
|
mountTime
|
|
11092
11264
|
});
|
|
11093
|
-
const sequenceContext =
|
|
11265
|
+
const sequenceContext = useContext38(SequenceContext);
|
|
11094
11266
|
const playbackRate = localPlaybackRate * globalPlaybackRate * (sequenceContext?.playbackRate ?? 1);
|
|
11095
11267
|
const acceptableTimeShiftButLessThanDuration = (() => {
|
|
11096
11268
|
if (mediaRef.current?.duration) {
|
|
@@ -11254,7 +11426,7 @@ var useMediaPlayback = ({
|
|
|
11254
11426
|
};
|
|
11255
11427
|
|
|
11256
11428
|
// src/use-media-tag.ts
|
|
11257
|
-
import { useContext as
|
|
11429
|
+
import { useContext as useContext39, useEffect as useEffect14, useRef as useRef20 } from "react";
|
|
11258
11430
|
var useMediaTag = ({
|
|
11259
11431
|
mediaRef,
|
|
11260
11432
|
id,
|
|
@@ -11264,7 +11436,7 @@ var useMediaTag = ({
|
|
|
11264
11436
|
isPostmounting
|
|
11265
11437
|
}) => {
|
|
11266
11438
|
const { audioAndVideoTags, isPlaying } = useTimelineContext();
|
|
11267
|
-
const { subscribePlaying } =
|
|
11439
|
+
const { subscribePlaying } = useContext39(SetTimelineContext);
|
|
11268
11440
|
const isPlayingRef = useRef20(isPlaying);
|
|
11269
11441
|
isPlayingRef.current = isPlaying;
|
|
11270
11442
|
const logLevel = useLogLevel();
|
|
@@ -11328,12 +11500,12 @@ var useMediaTag = ({
|
|
|
11328
11500
|
};
|
|
11329
11501
|
|
|
11330
11502
|
// src/volume-position-state.ts
|
|
11331
|
-
import { createContext as
|
|
11332
|
-
var MediaVolumeContext =
|
|
11503
|
+
import { createContext as createContext35, useContext as useContext40, useMemo as useMemo33 } from "react";
|
|
11504
|
+
var MediaVolumeContext = createContext35({
|
|
11333
11505
|
playerMuted: false,
|
|
11334
11506
|
mediaVolume: 1
|
|
11335
11507
|
});
|
|
11336
|
-
var SetMediaVolumeContext =
|
|
11508
|
+
var SetMediaVolumeContext = createContext35({
|
|
11337
11509
|
setPlayerMuted: () => {
|
|
11338
11510
|
throw new Error("default");
|
|
11339
11511
|
},
|
|
@@ -11342,16 +11514,16 @@ var SetMediaVolumeContext = createContext34({
|
|
|
11342
11514
|
}
|
|
11343
11515
|
});
|
|
11344
11516
|
var useMediaVolumeState = () => {
|
|
11345
|
-
const { mediaVolume } =
|
|
11346
|
-
const { setMediaVolume } =
|
|
11347
|
-
return
|
|
11517
|
+
const { mediaVolume } = useContext40(MediaVolumeContext);
|
|
11518
|
+
const { setMediaVolume } = useContext40(SetMediaVolumeContext);
|
|
11519
|
+
return useMemo33(() => {
|
|
11348
11520
|
return [mediaVolume, setMediaVolume];
|
|
11349
11521
|
}, [mediaVolume, setMediaVolume]);
|
|
11350
11522
|
};
|
|
11351
11523
|
var usePlayerMutedState = () => {
|
|
11352
|
-
const { playerMuted } =
|
|
11353
|
-
const { setPlayerMuted } =
|
|
11354
|
-
return
|
|
11524
|
+
const { playerMuted } = useContext40(MediaVolumeContext);
|
|
11525
|
+
const { setPlayerMuted } = useContext40(SetMediaVolumeContext);
|
|
11526
|
+
return useMemo33(() => {
|
|
11355
11527
|
return [playerMuted, setPlayerMuted];
|
|
11356
11528
|
}, [playerMuted, setPlayerMuted]);
|
|
11357
11529
|
};
|
|
@@ -11421,9 +11593,9 @@ var useMediaAudioState = ({
|
|
|
11421
11593
|
};
|
|
11422
11594
|
|
|
11423
11595
|
// src/audio/AudioForPreview.tsx
|
|
11424
|
-
import { jsx as
|
|
11596
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
11425
11597
|
var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
11426
|
-
const [initialShouldPreMountAudioElements] =
|
|
11598
|
+
const [initialShouldPreMountAudioElements] = useState17(props.shouldPreMountAudioTags);
|
|
11427
11599
|
if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
|
|
11428
11600
|
throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
|
|
11429
11601
|
}
|
|
@@ -11466,14 +11638,14 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11466
11638
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
11467
11639
|
}
|
|
11468
11640
|
const preloadedSrc = usePreload(src);
|
|
11469
|
-
const sequenceContext =
|
|
11641
|
+
const sequenceContext = useContext41(SequenceContext);
|
|
11470
11642
|
warnAboutTooHighVolume(userPreferredVolume);
|
|
11471
11643
|
const crossOriginValue = getCrossOriginValue({
|
|
11472
11644
|
crossOrigin,
|
|
11473
11645
|
requestsVideoFrame: false,
|
|
11474
11646
|
isClientSideRendering: false
|
|
11475
11647
|
});
|
|
11476
|
-
const propsToPass =
|
|
11648
|
+
const propsToPass = useMemo34(() => {
|
|
11477
11649
|
return {
|
|
11478
11650
|
muted: isMutedForPlayback,
|
|
11479
11651
|
src: preloadedSrc,
|
|
@@ -11488,7 +11660,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11488
11660
|
preloadedSrc,
|
|
11489
11661
|
crossOriginValue
|
|
11490
11662
|
]);
|
|
11491
|
-
const id =
|
|
11663
|
+
const id = useMemo34(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
11492
11664
|
src,
|
|
11493
11665
|
sequenceContext?.relativeFrom,
|
|
11494
11666
|
sequenceContext?.cumulatedFrom,
|
|
@@ -11534,7 +11706,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11534
11706
|
volume: userPreferredVolume,
|
|
11535
11707
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
11536
11708
|
});
|
|
11537
|
-
const effectToUse =
|
|
11709
|
+
const effectToUse = React35.useInsertionEffect ?? React35.useLayoutEffect;
|
|
11538
11710
|
effectToUse(() => {
|
|
11539
11711
|
return () => {
|
|
11540
11712
|
requestAnimationFrame(() => {
|
|
@@ -11567,7 +11739,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11567
11739
|
if (initialShouldPreMountAudioElements) {
|
|
11568
11740
|
return null;
|
|
11569
11741
|
}
|
|
11570
|
-
const audio = /* @__PURE__ */
|
|
11742
|
+
const audio = /* @__PURE__ */ jsx27("audio", {
|
|
11571
11743
|
ref: audioRef,
|
|
11572
11744
|
preload: "metadata",
|
|
11573
11745
|
crossOrigin: crossOriginValue,
|
|
@@ -11587,8 +11759,8 @@ var AudioForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
11587
11759
|
showInTimeline,
|
|
11588
11760
|
loopVolumeCurveBehavior
|
|
11589
11761
|
} = props;
|
|
11590
|
-
const [timelineId] =
|
|
11591
|
-
const sequenceContext =
|
|
11762
|
+
const [timelineId] = useState17(() => String(Math.random()));
|
|
11763
|
+
const sequenceContext = useContext41(SequenceContext);
|
|
11592
11764
|
const { isStudio } = useRemotionEnvironment();
|
|
11593
11765
|
const [mediaVolume] = useMediaVolumeState();
|
|
11594
11766
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
@@ -11619,17 +11791,17 @@ var AudioForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
11619
11791
|
documentationLink: "https://www.remotion.dev/docs/html5-audio",
|
|
11620
11792
|
muted: isMutedForTimeline
|
|
11621
11793
|
});
|
|
11622
|
-
const metadata =
|
|
11794
|
+
const metadata = useMemo34(() => isStudio || registration !== null ? {
|
|
11623
11795
|
type: "sequence",
|
|
11624
11796
|
id: timelineId,
|
|
11625
11797
|
value: registration,
|
|
11626
11798
|
outlineChildrenRef: null
|
|
11627
11799
|
} : null, [isStudio, registration, timelineId]);
|
|
11628
|
-
return /* @__PURE__ */
|
|
11800
|
+
return /* @__PURE__ */ jsx27(CommittedMetadataProvider, {
|
|
11629
11801
|
value: null,
|
|
11630
11802
|
_remotionCommitMetadata: metadata,
|
|
11631
|
-
children: /* @__PURE__ */
|
|
11632
|
-
children: /* @__PURE__ */
|
|
11803
|
+
children: /* @__PURE__ */ jsx27(SequenceContent, {
|
|
11804
|
+
children: /* @__PURE__ */ jsx27(AudioForPreviewContent, {
|
|
11633
11805
|
...props,
|
|
11634
11806
|
ref,
|
|
11635
11807
|
timelineId,
|
|
@@ -11644,20 +11816,20 @@ var AudioForPreview = forwardRef5(AudioForPreviewRefForwardingFunction);
|
|
|
11644
11816
|
// src/audio/AudioForRendering.tsx
|
|
11645
11817
|
import {
|
|
11646
11818
|
forwardRef as forwardRef6,
|
|
11647
|
-
useContext as
|
|
11819
|
+
useContext as useContext43,
|
|
11648
11820
|
useEffect as useEffect16,
|
|
11649
11821
|
useImperativeHandle as useImperativeHandle5,
|
|
11650
11822
|
useLayoutEffect as useLayoutEffect15,
|
|
11651
|
-
useMemo as
|
|
11823
|
+
useMemo as useMemo36,
|
|
11652
11824
|
useRef as useRef22
|
|
11653
11825
|
} from "react";
|
|
11654
11826
|
|
|
11655
11827
|
// src/use-media-enabled.tsx
|
|
11656
|
-
import { createContext as
|
|
11657
|
-
import { jsx as
|
|
11658
|
-
var MediaEnabledContext =
|
|
11828
|
+
import { createContext as createContext36, useContext as useContext42, useMemo as useMemo35 } from "react";
|
|
11829
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
11830
|
+
var MediaEnabledContext = createContext36(null);
|
|
11659
11831
|
var useVideoEnabled = () => {
|
|
11660
|
-
const context =
|
|
11832
|
+
const context = useContext42(MediaEnabledContext);
|
|
11661
11833
|
if (!context) {
|
|
11662
11834
|
return window.remotion_videoEnabled;
|
|
11663
11835
|
}
|
|
@@ -11667,7 +11839,7 @@ var useVideoEnabled = () => {
|
|
|
11667
11839
|
return context.videoEnabled;
|
|
11668
11840
|
};
|
|
11669
11841
|
var useAudioEnabled = () => {
|
|
11670
|
-
const context =
|
|
11842
|
+
const context = useContext42(MediaEnabledContext);
|
|
11671
11843
|
if (!context) {
|
|
11672
11844
|
return window.remotion_audioEnabled;
|
|
11673
11845
|
}
|
|
@@ -11681,15 +11853,15 @@ var MediaEnabledProvider = ({
|
|
|
11681
11853
|
videoEnabled,
|
|
11682
11854
|
audioEnabled
|
|
11683
11855
|
}) => {
|
|
11684
|
-
const value =
|
|
11685
|
-
return /* @__PURE__ */
|
|
11856
|
+
const value = useMemo35(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
11857
|
+
return /* @__PURE__ */ jsx28(MediaEnabledContext.Provider, {
|
|
11686
11858
|
value,
|
|
11687
11859
|
children
|
|
11688
11860
|
});
|
|
11689
11861
|
};
|
|
11690
11862
|
|
|
11691
11863
|
// src/audio/AudioForRendering.tsx
|
|
11692
|
-
import { jsx as
|
|
11864
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
11693
11865
|
var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
11694
11866
|
const audioRef = useRef22(null);
|
|
11695
11867
|
const {
|
|
@@ -11714,12 +11886,12 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11714
11886
|
const absoluteFrame = useTimelinePosition();
|
|
11715
11887
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
11716
11888
|
const frame = useCurrentFrame();
|
|
11717
|
-
const sequenceContext =
|
|
11889
|
+
const sequenceContext = useContext43(SequenceContext);
|
|
11718
11890
|
const sequencePlaybackRate = sequenceContext?.playbackRate ?? 1;
|
|
11719
|
-
const audioStartFrame =
|
|
11720
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
11891
|
+
const audioStartFrame = useContext43(Html5MediaTrimContext);
|
|
11892
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext43(RenderAssetManager);
|
|
11721
11893
|
const { delayRender, continueRender } = useDelayRender();
|
|
11722
|
-
const id =
|
|
11894
|
+
const id = useMemo36(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
11723
11895
|
props.src,
|
|
11724
11896
|
sequenceContext?.relativeFrom,
|
|
11725
11897
|
sequenceContext?.cumulatedFrom,
|
|
@@ -11819,7 +11991,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11819
11991
|
if (!needsToRenderAudioTag) {
|
|
11820
11992
|
return null;
|
|
11821
11993
|
}
|
|
11822
|
-
return /* @__PURE__ */
|
|
11994
|
+
return /* @__PURE__ */ jsx29("audio", {
|
|
11823
11995
|
ref: audioRef,
|
|
11824
11996
|
...nativeProps,
|
|
11825
11997
|
onError: onNativeError
|
|
@@ -11828,9 +12000,9 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11828
12000
|
var AudioForRendering = forwardRef6(AudioForRenderingRefForwardingFunction);
|
|
11829
12001
|
|
|
11830
12002
|
// src/audio/html5-audio.tsx
|
|
11831
|
-
import { jsx as
|
|
12003
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
11832
12004
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
11833
|
-
const audioTagsContext =
|
|
12005
|
+
const audioTagsContext = useContext44(SharedAudioTagsContext);
|
|
11834
12006
|
const propsWithFreeze = props;
|
|
11835
12007
|
const {
|
|
11836
12008
|
startFrom,
|
|
@@ -11856,7 +12028,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11856
12028
|
if (typeof freeze !== "undefined") {
|
|
11857
12029
|
throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');
|
|
11858
12030
|
}
|
|
11859
|
-
const { durations, setDurations } =
|
|
12031
|
+
const { durations, setDurations } = useContext44(DurationsContext);
|
|
11860
12032
|
if (typeof props.src !== "string") {
|
|
11861
12033
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
11862
12034
|
}
|
|
@@ -11900,13 +12072,13 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11900
12072
|
const loopDuration = effectiveTrimAfter ?? (durationFetched === undefined ? undefined : durationFetched * fps);
|
|
11901
12073
|
if (loop && loopDuration !== undefined) {
|
|
11902
12074
|
if (!Number.isFinite(loopDuration)) {
|
|
11903
|
-
return /* @__PURE__ */
|
|
12075
|
+
return /* @__PURE__ */ jsx30(Html5Audio, {
|
|
11904
12076
|
...propsOtherThanLoop,
|
|
11905
12077
|
ref,
|
|
11906
12078
|
_remotionInternalNativeLoopPassed: true
|
|
11907
12079
|
});
|
|
11908
12080
|
}
|
|
11909
|
-
return /* @__PURE__ */
|
|
12081
|
+
return /* @__PURE__ */ jsx30(Loop, {
|
|
11910
12082
|
layout: "none",
|
|
11911
12083
|
durationInFrames: calculateMediaDuration({
|
|
11912
12084
|
trimAfter: effectiveTrimAfter,
|
|
@@ -11914,7 +12086,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11914
12086
|
playbackRate: props.playbackRate ?? 1,
|
|
11915
12087
|
trimBefore: trimBeforeValue
|
|
11916
12088
|
}),
|
|
11917
|
-
children: /* @__PURE__ */
|
|
12089
|
+
children: /* @__PURE__ */ jsx30(Html5Audio, {
|
|
11918
12090
|
...propsOtherThanLoop,
|
|
11919
12091
|
ref,
|
|
11920
12092
|
_remotionInternalNativeLoopPassed: true
|
|
@@ -11922,15 +12094,15 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11922
12094
|
});
|
|
11923
12095
|
}
|
|
11924
12096
|
if (typeof trimBeforeValue !== "undefined" || typeof effectiveTrimAfter !== "undefined") {
|
|
11925
|
-
return /* @__PURE__ */
|
|
12097
|
+
return /* @__PURE__ */ jsx30(Html5MediaTrimContext.Provider, {
|
|
11926
12098
|
value: trimBeforeValue ?? 0,
|
|
11927
|
-
children: /* @__PURE__ */
|
|
12099
|
+
children: /* @__PURE__ */ jsx30(Sequence, {
|
|
11928
12100
|
layout: "none",
|
|
11929
12101
|
from: 0 - (trimBeforeValue ?? 0),
|
|
11930
12102
|
showInTimeline: false,
|
|
11931
12103
|
durationInFrames: effectiveTrimAfter === undefined ? undefined : (trimBeforeValue ?? 0) + (effectiveTrimAfter - (trimBeforeValue ?? 0)) / (props.playbackRate ?? 1),
|
|
11932
12104
|
name,
|
|
11933
|
-
children: /* @__PURE__ */
|
|
12105
|
+
children: /* @__PURE__ */ jsx30(Html5Audio, {
|
|
11934
12106
|
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
11935
12107
|
pauseWhenBuffering: shouldPauseWhenBuffering,
|
|
11936
12108
|
...otherProps,
|
|
@@ -11945,7 +12117,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11945
12117
|
volume: props.volume
|
|
11946
12118
|
}, "Html5Audio");
|
|
11947
12119
|
if (environment.isRendering) {
|
|
11948
|
-
return /* @__PURE__ */
|
|
12120
|
+
return /* @__PURE__ */ jsx30(AudioForRendering, {
|
|
11949
12121
|
onDuration,
|
|
11950
12122
|
...props,
|
|
11951
12123
|
ref,
|
|
@@ -11953,7 +12125,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11953
12125
|
_remotionInternalNeedsDurationCalculation: Boolean(loop)
|
|
11954
12126
|
});
|
|
11955
12127
|
}
|
|
11956
|
-
return /* @__PURE__ */
|
|
12128
|
+
return /* @__PURE__ */ jsx30(AudioForPreview, {
|
|
11957
12129
|
_remotionInternalNativeLoopPassed: props._remotionInternalNativeLoopPassed ?? false,
|
|
11958
12130
|
_remotionInternalStack: _remotionInternalStack ?? null,
|
|
11959
12131
|
shouldPreMountAudioTags: audioTagsContext !== null && audioTagsContext.numberOfAudioTags > 0,
|
|
@@ -11975,11 +12147,11 @@ import {
|
|
|
11975
12147
|
useCallback as useCallback18,
|
|
11976
12148
|
useEffect as useEffect17,
|
|
11977
12149
|
useImperativeHandle as useImperativeHandle6,
|
|
11978
|
-
useMemo as
|
|
12150
|
+
useMemo as useMemo37,
|
|
11979
12151
|
useRef as useRef23,
|
|
11980
|
-
useState as
|
|
12152
|
+
useState as useState18
|
|
11981
12153
|
} from "react";
|
|
11982
|
-
import { jsx as
|
|
12154
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
11983
12155
|
var resolveSolidPixelDensity = (pixelDensity) => {
|
|
11984
12156
|
if (pixelDensity === undefined) {
|
|
11985
12157
|
return 1;
|
|
@@ -12033,6 +12205,7 @@ var SolidInner = ({
|
|
|
12033
12205
|
width,
|
|
12034
12206
|
height,
|
|
12035
12207
|
effects = [],
|
|
12208
|
+
effectsOutputSize = null,
|
|
12036
12209
|
className,
|
|
12037
12210
|
style,
|
|
12038
12211
|
pixelDensity,
|
|
@@ -12044,13 +12217,13 @@ var SolidInner = ({
|
|
|
12044
12217
|
const resolvedPixelDensity = resolveSolidPixelDensity(pixelDensity);
|
|
12045
12218
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
12046
12219
|
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
12047
|
-
const [outputCanvas, setOutputCanvas] =
|
|
12220
|
+
const [outputCanvas, setOutputCanvas] = useState18(null);
|
|
12048
12221
|
const memoizedEffects = useMemoizedEffects({
|
|
12049
12222
|
effects,
|
|
12050
12223
|
overrideId: overrideId ?? null,
|
|
12051
12224
|
videoConfigValues
|
|
12052
12225
|
});
|
|
12053
|
-
const sourceCanvas =
|
|
12226
|
+
const sourceCanvas = useMemo37(() => {
|
|
12054
12227
|
if (typeof document === "undefined") {
|
|
12055
12228
|
return null;
|
|
12056
12229
|
}
|
|
@@ -12059,7 +12232,7 @@ var SolidInner = ({
|
|
|
12059
12232
|
canvas.height = 1;
|
|
12060
12233
|
return canvas;
|
|
12061
12234
|
}, []);
|
|
12062
|
-
const chainState = useEffectChainState();
|
|
12235
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
12063
12236
|
const canvasRef = useCallback18((canvas) => {
|
|
12064
12237
|
setOutputCanvas(canvas);
|
|
12065
12238
|
if (typeof reference === "function") {
|
|
@@ -12118,14 +12291,14 @@ var SolidInner = ({
|
|
|
12118
12291
|
cancelRender,
|
|
12119
12292
|
memoizedEffects
|
|
12120
12293
|
]);
|
|
12121
|
-
const canvasStyle =
|
|
12294
|
+
const canvasStyle = useMemo37(() => {
|
|
12122
12295
|
return {
|
|
12123
12296
|
width,
|
|
12124
12297
|
height,
|
|
12125
12298
|
...style ?? {}
|
|
12126
12299
|
};
|
|
12127
12300
|
}, [height, style, width]);
|
|
12128
|
-
return /* @__PURE__ */
|
|
12301
|
+
return /* @__PURE__ */ jsx31("canvas", {
|
|
12129
12302
|
ref: canvasRef,
|
|
12130
12303
|
width: canvasWidth,
|
|
12131
12304
|
height: canvasHeight,
|
|
@@ -12135,6 +12308,7 @@ var SolidInner = ({
|
|
|
12135
12308
|
};
|
|
12136
12309
|
var SolidOuter = forwardRef8(({
|
|
12137
12310
|
effects = [],
|
|
12311
|
+
effectsOutputSize = null,
|
|
12138
12312
|
controls,
|
|
12139
12313
|
color,
|
|
12140
12314
|
height,
|
|
@@ -12196,11 +12370,11 @@ var SolidOuter = forwardRef8(({
|
|
|
12196
12370
|
style: premountingStyle,
|
|
12197
12371
|
componentName: "<Solid />"
|
|
12198
12372
|
});
|
|
12199
|
-
return /* @__PURE__ */
|
|
12373
|
+
return /* @__PURE__ */ jsx31(Freeze, {
|
|
12200
12374
|
frame: freezeFrame,
|
|
12201
12375
|
active: isPremountingOrPostmounting,
|
|
12202
12376
|
_remotionInternalIsPremounting: premountingActive,
|
|
12203
|
-
children: /* @__PURE__ */
|
|
12377
|
+
children: /* @__PURE__ */ jsx31(Sequence, {
|
|
12204
12378
|
layout: "none",
|
|
12205
12379
|
from,
|
|
12206
12380
|
trimBefore,
|
|
@@ -12219,8 +12393,8 @@ var SolidOuter = forwardRef8(({
|
|
|
12219
12393
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
12220
12394
|
_remotionInternalIsPremounting: premountingActive,
|
|
12221
12395
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
12222
|
-
children: /* @__PURE__ */
|
|
12223
|
-
children: /* @__PURE__ */
|
|
12396
|
+
children: /* @__PURE__ */ jsx31(SequenceContent, {
|
|
12397
|
+
children: /* @__PURE__ */ jsx31(SolidInner, {
|
|
12224
12398
|
reference: actualRef,
|
|
12225
12399
|
videoConfigValues: controls?.videoConfigValues ?? null,
|
|
12226
12400
|
overrideId: controls?.overrideId ?? null,
|
|
@@ -12230,6 +12404,7 @@ var SolidOuter = forwardRef8(({
|
|
|
12230
12404
|
className,
|
|
12231
12405
|
style: croppedStyle ?? undefined,
|
|
12232
12406
|
effects,
|
|
12407
|
+
effectsOutputSize,
|
|
12233
12408
|
pixelDensity
|
|
12234
12409
|
})
|
|
12235
12410
|
})
|
|
@@ -12247,15 +12422,15 @@ Solid.displayName = "Solid";
|
|
|
12247
12422
|
addSequenceStackTraces(Solid);
|
|
12248
12423
|
// src/HtmlInCanvas.tsx
|
|
12249
12424
|
import {
|
|
12250
|
-
createContext as
|
|
12425
|
+
createContext as createContext37,
|
|
12251
12426
|
forwardRef as forwardRef9,
|
|
12252
12427
|
useCallback as useCallback19,
|
|
12253
|
-
useContext as
|
|
12428
|
+
useContext as useContext45,
|
|
12254
12429
|
useLayoutEffect as useLayoutEffect16,
|
|
12255
|
-
useMemo as
|
|
12430
|
+
useMemo as useMemo38,
|
|
12256
12431
|
useRef as useRef24
|
|
12257
12432
|
} from "react";
|
|
12258
|
-
import { jsx as
|
|
12433
|
+
import { jsx as jsx32, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
12259
12434
|
var transferredOffscreenCanvases = new WeakMap;
|
|
12260
12435
|
var getTransferredOffscreenCanvas = (canvas) => {
|
|
12261
12436
|
const existing = transferredOffscreenCanvases.get(canvas);
|
|
@@ -12362,11 +12537,12 @@ var defaultOnPaint = ({
|
|
|
12362
12537
|
ctx.reset();
|
|
12363
12538
|
ctx.drawElementImage(elementImage, 0, 0);
|
|
12364
12539
|
};
|
|
12365
|
-
var HtmlInCanvasAncestorContext =
|
|
12540
|
+
var HtmlInCanvasAncestorContext = createContext37(null);
|
|
12366
12541
|
var HtmlInCanvasContent = forwardRef9(({
|
|
12367
12542
|
width,
|
|
12368
12543
|
height,
|
|
12369
12544
|
effects,
|
|
12545
|
+
effectsOutputSize,
|
|
12370
12546
|
children,
|
|
12371
12547
|
canvasSiblings,
|
|
12372
12548
|
onPaint,
|
|
@@ -12376,7 +12552,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12376
12552
|
style,
|
|
12377
12553
|
renderFrame
|
|
12378
12554
|
}, ref) => {
|
|
12379
|
-
const ancestorPaintState =
|
|
12555
|
+
const ancestorPaintState = useContext45(HtmlInCanvasAncestorContext);
|
|
12380
12556
|
assertHtmlInCanvasDimensions(width, height);
|
|
12381
12557
|
if (ancestorPaintState && !isHtmlInCanvasNestingSupported()) {
|
|
12382
12558
|
throw new Error(`Nested <HtmlInCanvas> components require Chrome ${MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS} or newer with HTML-in-canvas enabled.`);
|
|
@@ -12388,7 +12564,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12388
12564
|
const { isClientSideRendering, isRendering } = useRemotionEnvironment();
|
|
12389
12565
|
const canRetryMissingPaintRecord = !isRendering || isClientSideRendering;
|
|
12390
12566
|
const usesDirectLayoutCanvas = onPaint === undefined && onInit === undefined;
|
|
12391
|
-
const paintTargetMode = usesDirectLayoutCanvas ? "direct" : isRendering ? "copied" : "transferred";
|
|
12567
|
+
const paintTargetMode = ancestorPaintState ? "copied" : usesDirectLayoutCanvas ? "direct" : isRendering ? "copied" : "transferred";
|
|
12392
12568
|
if (!isHtmlInCanvasSupported()) {
|
|
12393
12569
|
cancelRender(new Error(getHtmlInCanvasUnsupportedMessage()));
|
|
12394
12570
|
}
|
|
@@ -12397,7 +12573,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12397
12573
|
const paintTargetRef = useRef24(null);
|
|
12398
12574
|
const divRef = useRef24(null);
|
|
12399
12575
|
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}-${paintTargetMode}`;
|
|
12400
|
-
const paintState =
|
|
12576
|
+
const paintState = useMemo38(() => {
|
|
12401
12577
|
const state = {
|
|
12402
12578
|
pendingChildren: 0,
|
|
12403
12579
|
generation: 0,
|
|
@@ -12440,7 +12616,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12440
12616
|
ref.current = node;
|
|
12441
12617
|
}
|
|
12442
12618
|
}, [ref, paintTargetMode]);
|
|
12443
|
-
const chainState = useEffectChainState();
|
|
12619
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
12444
12620
|
const memoizedEffects = useMemoizedEffects({
|
|
12445
12621
|
effects,
|
|
12446
12622
|
overrideId: controls?.overrideId ?? null,
|
|
@@ -12455,6 +12631,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12455
12631
|
const initializedRef = useRef24(false);
|
|
12456
12632
|
const onInitCleanupRef = useRef24(null);
|
|
12457
12633
|
const unmountedRef = useRef24(false);
|
|
12634
|
+
const effectScratchCanvasesRef = useRef24(null);
|
|
12458
12635
|
const paintingTargets = useRef24(new WeakMap);
|
|
12459
12636
|
const onPaintCb = useCallback19(async () => {
|
|
12460
12637
|
if (isRendering && paintState.pendingChildren > 0) {
|
|
@@ -12550,6 +12727,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12550
12727
|
}
|
|
12551
12728
|
throw error;
|
|
12552
12729
|
}
|
|
12730
|
+
let effectSourceCanvas = null;
|
|
12553
12731
|
try {
|
|
12554
12732
|
const currentOnPaint = onPaintRef.current;
|
|
12555
12733
|
if (currentOnPaint) {
|
|
@@ -12565,6 +12743,41 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12565
12743
|
if (paintResult) {
|
|
12566
12744
|
await paintResult;
|
|
12567
12745
|
}
|
|
12746
|
+
} else if (paintTarget instanceof HTMLCanvasElement && effectsRef.current.some((effect) => !effect.params.disabled)) {
|
|
12747
|
+
effectScratchCanvasesRef.current ??= {
|
|
12748
|
+
source: document.createElement("canvas"),
|
|
12749
|
+
previousOutput: document.createElement("canvas")
|
|
12750
|
+
};
|
|
12751
|
+
const { source: effectSource, previousOutput } = effectScratchCanvasesRef.current;
|
|
12752
|
+
resizePaintTarget({
|
|
12753
|
+
target: effectSource,
|
|
12754
|
+
width: canvasWidth,
|
|
12755
|
+
height: canvasHeight
|
|
12756
|
+
});
|
|
12757
|
+
resizePaintTarget({
|
|
12758
|
+
target: previousOutput,
|
|
12759
|
+
width: canvasWidth,
|
|
12760
|
+
height: canvasHeight
|
|
12761
|
+
});
|
|
12762
|
+
const effectSourceCtx = effectSource.getContext("2d");
|
|
12763
|
+
const previousOutputCtx = previousOutput.getContext("2d");
|
|
12764
|
+
const paintTargetCtx = paintTarget.getContext("2d");
|
|
12765
|
+
if (!effectSourceCtx || !previousOutputCtx || !paintTargetCtx) {
|
|
12766
|
+
throw new Error("Failed to acquire 2D context for <HtmlInCanvas> canvas");
|
|
12767
|
+
}
|
|
12768
|
+
previousOutputCtx.reset();
|
|
12769
|
+
previousOutputCtx.drawImage(paintTarget, 0, 0);
|
|
12770
|
+
defaultOnPaint({
|
|
12771
|
+
canvas: paintTarget,
|
|
12772
|
+
element,
|
|
12773
|
+
elementImage: elImage,
|
|
12774
|
+
pixelDensity: resolvedPixelDensity
|
|
12775
|
+
});
|
|
12776
|
+
effectSourceCtx.reset();
|
|
12777
|
+
effectSourceCtx.drawImage(paintTarget, 0, 0);
|
|
12778
|
+
paintTargetCtx.reset();
|
|
12779
|
+
paintTargetCtx.drawImage(previousOutput, 0, 0);
|
|
12780
|
+
effectSourceCanvas = effectSource;
|
|
12568
12781
|
} else {
|
|
12569
12782
|
defaultOnPaint({
|
|
12570
12783
|
canvas: paintTarget,
|
|
@@ -12577,7 +12790,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12577
12790
|
if (state) {
|
|
12578
12791
|
await runEffectChain({
|
|
12579
12792
|
state,
|
|
12580
|
-
source: paintTarget,
|
|
12793
|
+
source: effectSourceCanvas ?? paintTarget,
|
|
12581
12794
|
effects: effectsRef.current,
|
|
12582
12795
|
output: paintTarget,
|
|
12583
12796
|
width: canvasWidth,
|
|
@@ -12697,13 +12910,13 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12697
12910
|
isRendering,
|
|
12698
12911
|
ancestorPaintState
|
|
12699
12912
|
]);
|
|
12700
|
-
const innerStyle =
|
|
12913
|
+
const innerStyle = useMemo38(() => {
|
|
12701
12914
|
return {
|
|
12702
12915
|
width,
|
|
12703
12916
|
height
|
|
12704
12917
|
};
|
|
12705
12918
|
}, [width, height]);
|
|
12706
|
-
const canvasStyle =
|
|
12919
|
+
const canvasStyle = useMemo38(() => {
|
|
12707
12920
|
return {
|
|
12708
12921
|
width,
|
|
12709
12922
|
height,
|
|
@@ -12713,7 +12926,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12713
12926
|
return /* @__PURE__ */ jsxs3(HtmlInCanvasAncestorContext.Provider, {
|
|
12714
12927
|
value: paintState,
|
|
12715
12928
|
children: [
|
|
12716
|
-
/* @__PURE__ */
|
|
12929
|
+
/* @__PURE__ */ jsx32("canvas", {
|
|
12717
12930
|
ref: paintTargetMode === "copied" ? canvas2dRef : setVisibleCanvasRef,
|
|
12718
12931
|
width: canvasWidth,
|
|
12719
12932
|
height: canvasHeight,
|
|
@@ -12723,16 +12936,19 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12723
12936
|
visibility: "hidden",
|
|
12724
12937
|
pointerEvents: "none"
|
|
12725
12938
|
} : canvasStyle,
|
|
12726
|
-
children:
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12939
|
+
children: /* @__PURE__ */ jsxs3(DefaultPremountContext.Provider, {
|
|
12940
|
+
value: 0,
|
|
12941
|
+
children: [
|
|
12942
|
+
/* @__PURE__ */ jsx32("div", {
|
|
12943
|
+
ref: divRef,
|
|
12944
|
+
style: paintTargetMode === "copied" ? { ...innerStyle, visibility: "visible" } : innerStyle,
|
|
12945
|
+
children
|
|
12946
|
+
}),
|
|
12947
|
+
canvasSiblings
|
|
12948
|
+
]
|
|
12949
|
+
})
|
|
12734
12950
|
}, canvasSizeKey),
|
|
12735
|
-
paintTargetMode === "copied" ? /* @__PURE__ */
|
|
12951
|
+
paintTargetMode === "copied" ? /* @__PURE__ */ jsx32("canvas", {
|
|
12736
12952
|
ref: setVisibleCanvasRef,
|
|
12737
12953
|
width: canvasWidth,
|
|
12738
12954
|
height: canvasHeight,
|
|
@@ -12744,7 +12960,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12744
12960
|
HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
|
|
12745
12961
|
var HtmlInCanvasContentForRendering = forwardRef9((props, ref) => {
|
|
12746
12962
|
const frame = useCurrentFrame();
|
|
12747
|
-
return /* @__PURE__ */
|
|
12963
|
+
return /* @__PURE__ */ jsx32(HtmlInCanvasContent, {
|
|
12748
12964
|
...props,
|
|
12749
12965
|
ref,
|
|
12750
12966
|
renderFrame: frame
|
|
@@ -12755,6 +12971,7 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
12755
12971
|
width,
|
|
12756
12972
|
height,
|
|
12757
12973
|
effects = [],
|
|
12974
|
+
effectsOutputSize,
|
|
12758
12975
|
children,
|
|
12759
12976
|
onPaint,
|
|
12760
12977
|
onInit,
|
|
@@ -12816,11 +13033,11 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
12816
13033
|
style: premountingStyle,
|
|
12817
13034
|
componentName: "<HtmlInCanvas />"
|
|
12818
13035
|
});
|
|
12819
|
-
return /* @__PURE__ */
|
|
13036
|
+
return /* @__PURE__ */ jsx32(Freeze, {
|
|
12820
13037
|
frame: freezeFrame,
|
|
12821
13038
|
active: isPremountingOrPostmounting,
|
|
12822
13039
|
_remotionInternalIsPremounting: premountingActive,
|
|
12823
|
-
children: /* @__PURE__ */
|
|
13040
|
+
children: /* @__PURE__ */ jsx32(Sequence, {
|
|
12824
13041
|
layout: "none",
|
|
12825
13042
|
durationInFrames,
|
|
12826
13043
|
name: name ?? "<HtmlInCanvas>",
|
|
@@ -12832,12 +13049,13 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
12832
13049
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
12833
13050
|
_remotionInternalIsPremounting: premountingActive,
|
|
12834
13051
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
12835
|
-
children: /* @__PURE__ */
|
|
13052
|
+
children: /* @__PURE__ */ jsx32(Content, {
|
|
12836
13053
|
ref: setCanvasRef,
|
|
12837
13054
|
renderFrame: null,
|
|
12838
13055
|
width,
|
|
12839
13056
|
height,
|
|
12840
13057
|
effects,
|
|
13058
|
+
effectsOutputSize: effectsOutputSize ?? null,
|
|
12841
13059
|
onPaint,
|
|
12842
13060
|
onInit,
|
|
12843
13061
|
pixelDensity,
|
|
@@ -12885,12 +13103,12 @@ addSequenceStackTraces(HtmlInCanvas);
|
|
|
12885
13103
|
import {
|
|
12886
13104
|
forwardRef as forwardRef10,
|
|
12887
13105
|
useCallback as useCallback20,
|
|
12888
|
-
useContext as
|
|
13106
|
+
useContext as useContext46,
|
|
12889
13107
|
useImperativeHandle as useImperativeHandle7,
|
|
12890
13108
|
useLayoutEffect as useLayoutEffect17,
|
|
12891
|
-
useMemo as
|
|
13109
|
+
useMemo as useMemo39,
|
|
12892
13110
|
useRef as useRef25,
|
|
12893
|
-
useState as
|
|
13111
|
+
useState as useState19
|
|
12894
13112
|
} from "react";
|
|
12895
13113
|
|
|
12896
13114
|
// src/truncate-src-for-label.ts
|
|
@@ -12905,7 +13123,7 @@ function truncateSrcForLabel(src) {
|
|
|
12905
13123
|
}
|
|
12906
13124
|
|
|
12907
13125
|
// src/canvas-image/CanvasImage.tsx
|
|
12908
|
-
import { jsx as
|
|
13126
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
12909
13127
|
var canvasImageSchema = {
|
|
12910
13128
|
src: {
|
|
12911
13129
|
type: "asset",
|
|
@@ -13010,6 +13228,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13010
13228
|
height,
|
|
13011
13229
|
fit = "fill",
|
|
13012
13230
|
effects,
|
|
13231
|
+
effectsOutputSize,
|
|
13013
13232
|
controls,
|
|
13014
13233
|
onError,
|
|
13015
13234
|
className,
|
|
@@ -13023,18 +13242,18 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13023
13242
|
}, ref) => {
|
|
13024
13243
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
13025
13244
|
const { delayPlayback } = useBufferState();
|
|
13026
|
-
const [outputCanvas, setOutputCanvas] =
|
|
13027
|
-
const [loadedImage, setLoadedImage] =
|
|
13245
|
+
const [outputCanvas, setOutputCanvas] = useState19(null);
|
|
13246
|
+
const [loadedImage, setLoadedImage] = useState19(null);
|
|
13028
13247
|
const actualSrc = usePreload(src);
|
|
13029
|
-
const chainState = useEffectChainState();
|
|
13248
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
13030
13249
|
const memoizedEffects = useMemoizedEffects({
|
|
13031
13250
|
effects,
|
|
13032
13251
|
overrideId: controls?.overrideId ?? null,
|
|
13033
13252
|
videoConfigValues: controls?.videoConfigValues ?? null
|
|
13034
13253
|
});
|
|
13035
|
-
const sequenceContext =
|
|
13254
|
+
const sequenceContext = useContext46(SequenceContext);
|
|
13036
13255
|
const pendingLoadDelayRef = useRef25(null);
|
|
13037
|
-
const [isLoadPending, setIsLoadPending] =
|
|
13256
|
+
const [isLoadPending, setIsLoadPending] = useState19(false);
|
|
13038
13257
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
13039
13258
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
13040
13259
|
const continuePendingLoadDelay = useCallback20(({ markAsReady }) => {
|
|
@@ -13049,7 +13268,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13049
13268
|
continueRender(pending.handle);
|
|
13050
13269
|
pendingLoadDelayRef.current = null;
|
|
13051
13270
|
}, [continueRender]);
|
|
13052
|
-
const sourceCanvas =
|
|
13271
|
+
const sourceCanvas = useMemo39(() => {
|
|
13053
13272
|
if (typeof document === "undefined") {
|
|
13054
13273
|
return null;
|
|
13055
13274
|
}
|
|
@@ -13225,7 +13444,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13225
13444
|
sourceCanvas,
|
|
13226
13445
|
width
|
|
13227
13446
|
]);
|
|
13228
|
-
return /* @__PURE__ */
|
|
13447
|
+
return /* @__PURE__ */ jsx33("canvas", {
|
|
13229
13448
|
...canvasProps,
|
|
13230
13449
|
ref: canvasRef,
|
|
13231
13450
|
width,
|
|
@@ -13243,6 +13462,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13243
13462
|
height,
|
|
13244
13463
|
fit,
|
|
13245
13464
|
effects = [],
|
|
13465
|
+
effectsOutputSize,
|
|
13246
13466
|
className,
|
|
13247
13467
|
style,
|
|
13248
13468
|
id,
|
|
@@ -13275,7 +13495,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13275
13495
|
if (!src) {
|
|
13276
13496
|
throw new Error('No "src" prop was passed to <CanvasImage>.');
|
|
13277
13497
|
}
|
|
13278
|
-
const isMedia =
|
|
13498
|
+
const isMedia = useMemo39(() => ({
|
|
13279
13499
|
type: "image",
|
|
13280
13500
|
src
|
|
13281
13501
|
}), [src]);
|
|
@@ -13314,11 +13534,11 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13314
13534
|
style: premountingStyle,
|
|
13315
13535
|
componentName: _remotionInternalCropComponentName ?? "<CanvasImage />"
|
|
13316
13536
|
});
|
|
13317
|
-
return /* @__PURE__ */
|
|
13537
|
+
return /* @__PURE__ */ jsx33(Freeze, {
|
|
13318
13538
|
frame: freezeFrame,
|
|
13319
13539
|
active: isPremountingOrPostmounting,
|
|
13320
13540
|
_remotionInternalIsPremounting: premountingActive,
|
|
13321
|
-
children: /* @__PURE__ */
|
|
13541
|
+
children: /* @__PURE__ */ jsx33(Sequence, {
|
|
13322
13542
|
layout: "none",
|
|
13323
13543
|
from: from ?? 0,
|
|
13324
13544
|
trimBefore,
|
|
@@ -13336,8 +13556,8 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13336
13556
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
13337
13557
|
_remotionInternalIsPremounting: premountingActive,
|
|
13338
13558
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
13339
|
-
children: /* @__PURE__ */
|
|
13340
|
-
children: /* @__PURE__ */
|
|
13559
|
+
children: /* @__PURE__ */ jsx33(SequenceContent, {
|
|
13560
|
+
children: /* @__PURE__ */ jsx33(CanvasImageContent, {
|
|
13341
13561
|
ref: actualRef,
|
|
13342
13562
|
src,
|
|
13343
13563
|
crossOrigin,
|
|
@@ -13345,6 +13565,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13345
13565
|
height,
|
|
13346
13566
|
fit,
|
|
13347
13567
|
effects,
|
|
13568
|
+
effectsOutputSize: effectsOutputSize ?? null,
|
|
13348
13569
|
controls,
|
|
13349
13570
|
className,
|
|
13350
13571
|
style: croppedStyle ?? undefined,
|
|
@@ -13402,7 +13623,7 @@ var getStaticFiles = () => {
|
|
|
13402
13623
|
};
|
|
13403
13624
|
// src/IFrame.tsx
|
|
13404
13625
|
import { forwardRef as forwardRef11, useCallback as useCallback21, useLayoutEffect as useLayoutEffect18, useRef as useRef26 } from "react";
|
|
13405
|
-
import { jsx as
|
|
13626
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
13406
13627
|
var IFrameRefForwarding = ({
|
|
13407
13628
|
onLoad,
|
|
13408
13629
|
onError,
|
|
@@ -13456,7 +13677,7 @@ var IFrameRefForwarding = ({
|
|
|
13456
13677
|
console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
|
|
13457
13678
|
}
|
|
13458
13679
|
}, [onError, continueRender, src, srcDoc]);
|
|
13459
|
-
return /* @__PURE__ */
|
|
13680
|
+
return /* @__PURE__ */ jsx34("iframe", {
|
|
13460
13681
|
referrerPolicy: "strict-origin-when-cross-origin",
|
|
13461
13682
|
...props,
|
|
13462
13683
|
ref,
|
|
@@ -13468,13 +13689,13 @@ var IFrame = forwardRef11(IFrameRefForwarding);
|
|
|
13468
13689
|
// src/Img.tsx
|
|
13469
13690
|
import {
|
|
13470
13691
|
useCallback as useCallback22,
|
|
13471
|
-
useContext as
|
|
13692
|
+
useContext as useContext47,
|
|
13472
13693
|
useLayoutEffect as useLayoutEffect19,
|
|
13473
|
-
useMemo as
|
|
13694
|
+
useMemo as useMemo40,
|
|
13474
13695
|
useRef as useRef27,
|
|
13475
|
-
useState as
|
|
13696
|
+
useState as useState20
|
|
13476
13697
|
} from "react";
|
|
13477
|
-
import { jsx as
|
|
13698
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
13478
13699
|
function exponentialBackoff2(errorCount) {
|
|
13479
13700
|
return 1000 * 2 ** (errorCount - 1);
|
|
13480
13701
|
}
|
|
@@ -13495,8 +13716,8 @@ var ImgContent = ({
|
|
|
13495
13716
|
const imageRef = useRef27(null);
|
|
13496
13717
|
const errors = useRef27({});
|
|
13497
13718
|
const { delayPlayback } = useBufferState();
|
|
13498
|
-
const sequenceContext =
|
|
13499
|
-
const [isLoading, setIsLoading] =
|
|
13719
|
+
const sequenceContext = useContext47(SequenceContext);
|
|
13720
|
+
const [isLoading, setIsLoading] = useState20(false);
|
|
13500
13721
|
const _propsValid = true;
|
|
13501
13722
|
if (!_propsValid) {
|
|
13502
13723
|
throw new Error("typecheck error");
|
|
@@ -13628,7 +13849,7 @@ var ImgContent = ({
|
|
|
13628
13849
|
requestsVideoFrame: false,
|
|
13629
13850
|
isClientSideRendering
|
|
13630
13851
|
});
|
|
13631
|
-
return /* @__PURE__ */
|
|
13852
|
+
return /* @__PURE__ */ jsx35("img", {
|
|
13632
13853
|
...props,
|
|
13633
13854
|
ref: imageCallbackRef,
|
|
13634
13855
|
crossOrigin: crossOriginValue,
|
|
@@ -13661,7 +13882,7 @@ var NativeImgInner = ({
|
|
|
13661
13882
|
if (!src) {
|
|
13662
13883
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
13663
13884
|
}
|
|
13664
|
-
const isMedia =
|
|
13885
|
+
const isMedia = useMemo40(() => ({
|
|
13665
13886
|
type: "image",
|
|
13666
13887
|
src
|
|
13667
13888
|
}), [src]);
|
|
@@ -13695,11 +13916,11 @@ var NativeImgInner = ({
|
|
|
13695
13916
|
style: premountingStyle,
|
|
13696
13917
|
componentName: "<Img />"
|
|
13697
13918
|
});
|
|
13698
|
-
return /* @__PURE__ */
|
|
13919
|
+
return /* @__PURE__ */ jsx35(Freeze, {
|
|
13699
13920
|
frame: freezeFrame,
|
|
13700
13921
|
active: isPremountingOrPostmounting,
|
|
13701
13922
|
_remotionInternalIsPremounting: premountingActive,
|
|
13702
|
-
children: /* @__PURE__ */
|
|
13923
|
+
children: /* @__PURE__ */ jsx35(Sequence, {
|
|
13703
13924
|
layout: "none",
|
|
13704
13925
|
from: from ?? 0,
|
|
13705
13926
|
trimBefore,
|
|
@@ -13716,8 +13937,8 @@ var NativeImgInner = ({
|
|
|
13716
13937
|
controls,
|
|
13717
13938
|
showInTimeline: showInTimeline ?? true,
|
|
13718
13939
|
hidden,
|
|
13719
|
-
children: /* @__PURE__ */
|
|
13720
|
-
children: /* @__PURE__ */
|
|
13940
|
+
children: /* @__PURE__ */ jsx35(SequenceContent, {
|
|
13941
|
+
children: /* @__PURE__ */ jsx35(ImgContent, {
|
|
13721
13942
|
src,
|
|
13722
13943
|
style: croppedStyle ?? undefined,
|
|
13723
13944
|
...props
|
|
@@ -13786,6 +14007,7 @@ var getFitFromObjectFit = (style) => {
|
|
|
13786
14007
|
};
|
|
13787
14008
|
var ImgInner = ({
|
|
13788
14009
|
effects = [],
|
|
14010
|
+
effectsOutputSize,
|
|
13789
14011
|
ref,
|
|
13790
14012
|
hidden,
|
|
13791
14013
|
name,
|
|
@@ -13818,7 +14040,7 @@ var ImgInner = ({
|
|
|
13818
14040
|
}) => {
|
|
13819
14041
|
const shouldPauseWhenLoading = resolveV5Default(pauseWhenLoading);
|
|
13820
14042
|
if (effects.length === 0) {
|
|
13821
|
-
return /* @__PURE__ */
|
|
14043
|
+
return /* @__PURE__ */ jsx35(NativeImgInner, {
|
|
13822
14044
|
...props,
|
|
13823
14045
|
ref,
|
|
13824
14046
|
hidden,
|
|
@@ -13863,12 +14085,13 @@ var ImgInner = ({
|
|
|
13863
14085
|
const canvasHeight = typeof height === "number" ? height : undefined;
|
|
13864
14086
|
const canvasProps = props;
|
|
13865
14087
|
const canvasFit = getFitFromObjectFit(style) ?? "fill";
|
|
13866
|
-
return /* @__PURE__ */
|
|
14088
|
+
return /* @__PURE__ */ jsx35(CanvasImageWithPrivateProps, {
|
|
13867
14089
|
src,
|
|
13868
14090
|
width: canvasWidth,
|
|
13869
14091
|
height: canvasHeight,
|
|
13870
14092
|
fit: canvasFit,
|
|
13871
14093
|
effects,
|
|
14094
|
+
effectsOutputSize,
|
|
13872
14095
|
className,
|
|
13873
14096
|
style,
|
|
13874
14097
|
cropLeft,
|
|
@@ -13907,8 +14130,8 @@ var Img = withInteractivitySchema({
|
|
|
13907
14130
|
});
|
|
13908
14131
|
addSequenceStackTraces(Img);
|
|
13909
14132
|
// src/Interactive.tsx
|
|
13910
|
-
import
|
|
13911
|
-
import { jsx as
|
|
14133
|
+
import React42, { forwardRef as forwardRef12, useCallback as useCallback23, useContext as useContext48 } from "react";
|
|
14134
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
13912
14135
|
var sourcePathToIdentityPrefix = (packageName) => {
|
|
13913
14136
|
if (packageName === "remotion") {
|
|
13914
14137
|
return "dev.remotion.remotion";
|
|
@@ -13995,7 +14218,7 @@ var withSchema = (untypedOptions) => {
|
|
|
13995
14218
|
...rest
|
|
13996
14219
|
} = options;
|
|
13997
14220
|
const ComponentWrappedInSequence = forwardRef12((props, ref) => {
|
|
13998
|
-
const { canvasContent, compositions } =
|
|
14221
|
+
const { canvasContent, compositions } = useContext48(CompositionManager);
|
|
13999
14222
|
const componentIdentity = resolveComponentIdentity(Wrapped);
|
|
14000
14223
|
const isCurrentComposition = compositions.some((composition) => canvasContent?.type === "composition" && composition.id === canvasContent.compositionId && composition.componentFromProps === componentIdentity);
|
|
14001
14224
|
const { width, height, ...propsWithoutDimensions } = props;
|
|
@@ -14054,10 +14277,10 @@ var withSchema = (untypedOptions) => {
|
|
|
14054
14277
|
style: premountingStyle,
|
|
14055
14278
|
componentName
|
|
14056
14279
|
});
|
|
14057
|
-
return /* @__PURE__ */
|
|
14280
|
+
return /* @__PURE__ */ jsx36(Freeze, {
|
|
14058
14281
|
frame: freezeFrame,
|
|
14059
14282
|
active: isPremountingOrPostmounting,
|
|
14060
|
-
children: /* @__PURE__ */
|
|
14283
|
+
children: /* @__PURE__ */ jsx36(SequenceWithoutSchema, {
|
|
14061
14284
|
_remotionInternalSingleChildComponent: isCurrentComposition ? null : componentIdentity,
|
|
14062
14285
|
layout,
|
|
14063
14286
|
...layout === "absolute-fill" ? {
|
|
@@ -14074,14 +14297,14 @@ var withSchema = (untypedOptions) => {
|
|
|
14074
14297
|
freeze,
|
|
14075
14298
|
hidden,
|
|
14076
14299
|
name: name ?? componentName,
|
|
14077
|
-
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive-
|
|
14300
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive-create",
|
|
14078
14301
|
showInTimeline: isCurrentComposition ? false : showInTimeline,
|
|
14079
14302
|
controls,
|
|
14080
14303
|
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
14081
14304
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
14082
14305
|
_remotionInternalIsPremounting: premountingActive,
|
|
14083
14306
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
14084
|
-
children:
|
|
14307
|
+
children: React42.createElement(Component, {
|
|
14085
14308
|
...componentPropsWithoutCropping,
|
|
14086
14309
|
...layout === "none" ? { style: croppedStyle ?? undefined, ref } : {}
|
|
14087
14310
|
})
|
|
@@ -14104,6 +14327,15 @@ var withSchema = (untypedOptions) => {
|
|
|
14104
14327
|
addSequenceStackTraces(Wrapped);
|
|
14105
14328
|
return Wrapped;
|
|
14106
14329
|
};
|
|
14330
|
+
var create = (untypedOptions) => {
|
|
14331
|
+
const options = untypedOptions;
|
|
14332
|
+
return withSchema({
|
|
14333
|
+
...options,
|
|
14334
|
+
wrapInSequence: true,
|
|
14335
|
+
schema: options.schema ?? {},
|
|
14336
|
+
componentName: options.componentName ?? (options.Component.displayName || options.Component.name?.replace(/(.+)Inner$/, "$1") || "Component")
|
|
14337
|
+
});
|
|
14338
|
+
};
|
|
14107
14339
|
var makeInteractiveElement = (tag, displayName, schema) => {
|
|
14108
14340
|
const Inner = forwardRef12((propsWithControls, ref) => {
|
|
14109
14341
|
const {
|
|
@@ -14161,11 +14393,11 @@ var makeInteractiveElement = (tag, displayName, schema) => {
|
|
|
14161
14393
|
const callbackRef = useCallback23((element) => {
|
|
14162
14394
|
setRef2(ref, element);
|
|
14163
14395
|
}, [ref]);
|
|
14164
|
-
return /* @__PURE__ */
|
|
14396
|
+
return /* @__PURE__ */ jsx36(Freeze, {
|
|
14165
14397
|
frame: freezeFrame,
|
|
14166
14398
|
active: isPremountingOrPostmounting,
|
|
14167
14399
|
_remotionInternalIsPremounting: premountingActive,
|
|
14168
|
-
children: /* @__PURE__ */
|
|
14400
|
+
children: /* @__PURE__ */ jsx36(Sequence, {
|
|
14169
14401
|
layout: "none",
|
|
14170
14402
|
from: from ?? 0,
|
|
14171
14403
|
trimBefore,
|
|
@@ -14182,7 +14414,7 @@ var makeInteractiveElement = (tag, displayName, schema) => {
|
|
|
14182
14414
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
14183
14415
|
_remotionInternalIsPremounting: premountingActive,
|
|
14184
14416
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
14185
|
-
children:
|
|
14417
|
+
children: React42.createElement(tag, {
|
|
14186
14418
|
...props,
|
|
14187
14419
|
style: croppedStyle ?? undefined,
|
|
14188
14420
|
ref: callbackRef
|
|
@@ -14228,6 +14460,7 @@ var Interactive = {
|
|
|
14228
14460
|
premountSchema,
|
|
14229
14461
|
sequenceSchema,
|
|
14230
14462
|
withSchema,
|
|
14463
|
+
create,
|
|
14231
14464
|
_internalMakeRemotionComponentIdentity: makeRemotionComponentIdentity,
|
|
14232
14465
|
A: makeInteractiveTextElement("a", "<Interactive.A>"),
|
|
14233
14466
|
Article: makeInteractiveTextElement("article", "<Interactive.Article>"),
|
|
@@ -14277,16 +14510,16 @@ var getAudioSyncAnchorTolerance = (audioContext) => {
|
|
|
14277
14510
|
};
|
|
14278
14511
|
|
|
14279
14512
|
// src/CompositionManager.tsx
|
|
14280
|
-
import
|
|
14281
|
-
var compositionsRef =
|
|
14513
|
+
import React43 from "react";
|
|
14514
|
+
var compositionsRef = React43.createRef();
|
|
14282
14515
|
|
|
14283
14516
|
// src/CompositionManagerProvider.tsx
|
|
14284
14517
|
import {
|
|
14285
14518
|
useCallback as useCallback25,
|
|
14286
14519
|
useImperativeHandle as useImperativeHandle9,
|
|
14287
|
-
useMemo as
|
|
14520
|
+
useMemo as useMemo42,
|
|
14288
14521
|
useRef as useRef29,
|
|
14289
|
-
useState as
|
|
14522
|
+
useState as useState22
|
|
14290
14523
|
} from "react";
|
|
14291
14524
|
|
|
14292
14525
|
// src/CompositionRegistryProvider.tsx
|
|
@@ -14296,17 +14529,17 @@ import {
|
|
|
14296
14529
|
useEffect as useEffect18,
|
|
14297
14530
|
useImperativeHandle as useImperativeHandle8,
|
|
14298
14531
|
useLayoutEffect as useLayoutEffect20,
|
|
14299
|
-
useMemo as
|
|
14532
|
+
useMemo as useMemo41,
|
|
14300
14533
|
useRef as useRef28,
|
|
14301
|
-
useState as
|
|
14534
|
+
useState as useState21
|
|
14302
14535
|
} from "react";
|
|
14303
|
-
import { jsx as
|
|
14536
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
14304
14537
|
var useIsomorphicLayoutEffect6 = typeof window === "undefined" ? useEffect18 : useLayoutEffect20;
|
|
14305
14538
|
var CompositionRegistryFallbackProvider = withCommittedMetadata(CompositionRegistryFallbackContext.Provider);
|
|
14306
14539
|
var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushSnapshotRef) => {
|
|
14307
14540
|
const { isStudio } = useRemotionEnvironment();
|
|
14308
|
-
const [managerId] =
|
|
14309
|
-
const [useCommitObserver, setUseCommitObserver] =
|
|
14541
|
+
const [managerId] = useState21(() => String(Math.random()));
|
|
14542
|
+
const [useCommitObserver, setUseCommitObserver] = useState21(() => isStudio && isCommitRegistrationObserverInstalled());
|
|
14310
14543
|
const observedCommitRef = useRef28(false);
|
|
14311
14544
|
const observerFailedRef = useRef28(false);
|
|
14312
14545
|
const unmountedRef = useRef28(false);
|
|
@@ -14343,7 +14576,7 @@ var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushS
|
|
|
14343
14576
|
observedCommitRef.current = true;
|
|
14344
14577
|
queueSnapshot(snapshot);
|
|
14345
14578
|
}, [queueSnapshot]);
|
|
14346
|
-
const fallbackRegistry =
|
|
14579
|
+
const fallbackRegistry = useMemo41(() => {
|
|
14347
14580
|
const entries = new Map;
|
|
14348
14581
|
const getSnapshot = () => {
|
|
14349
14582
|
const compositions = [];
|
|
@@ -14414,12 +14647,12 @@ var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushS
|
|
|
14414
14647
|
}
|
|
14415
14648
|
};
|
|
14416
14649
|
}, [isStudio, useCommitObserver]);
|
|
14417
|
-
const metadata =
|
|
14650
|
+
const metadata = useMemo41(() => isStudio ? {
|
|
14418
14651
|
type: "composition-manager",
|
|
14419
14652
|
id: managerId,
|
|
14420
14653
|
onCommit: useCommitObserver ? onObservedSnapshot : null
|
|
14421
14654
|
} : null, [isStudio, managerId, onObservedSnapshot, useCommitObserver]);
|
|
14422
|
-
return /* @__PURE__ */
|
|
14655
|
+
return /* @__PURE__ */ jsx37(CompositionRegistryFallbackProvider, {
|
|
14423
14656
|
value: useCommitObserver ? null : fallbackRegistry,
|
|
14424
14657
|
_remotionCommitMetadata: metadata,
|
|
14425
14658
|
children
|
|
@@ -14427,7 +14660,7 @@ var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushS
|
|
|
14427
14660
|
});
|
|
14428
14661
|
|
|
14429
14662
|
// src/CompositionManagerProvider.tsx
|
|
14430
|
-
import { jsx as
|
|
14663
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
14431
14664
|
var CompositionManagerProvider = ({
|
|
14432
14665
|
children,
|
|
14433
14666
|
onlyRenderComposition,
|
|
@@ -14438,8 +14671,8 @@ var CompositionManagerProvider = ({
|
|
|
14438
14671
|
const committedKeysRef = useRef29(new Set);
|
|
14439
14672
|
const flushSnapshotRef = useRef29(null);
|
|
14440
14673
|
const committedDescriptorsRef = useRef29(new Map);
|
|
14441
|
-
const [registrationError, setRegistrationError] =
|
|
14442
|
-
const [registry] =
|
|
14674
|
+
const [registrationError, setRegistrationError] = useState22(null);
|
|
14675
|
+
const [registry] = useState22(() => createRegistryStore({
|
|
14443
14676
|
compositions: initialCompositions.map((composition, order) => ({
|
|
14444
14677
|
...composition,
|
|
14445
14678
|
order
|
|
@@ -14447,8 +14680,8 @@ var CompositionManagerProvider = ({
|
|
|
14447
14680
|
folders: []
|
|
14448
14681
|
}));
|
|
14449
14682
|
const { compositions, folders } = useSyncExternalStore2(registry.subscribe, registry.getSnapshot, registry.getSnapshot);
|
|
14450
|
-
const [canvasContent, setCanvasContent] =
|
|
14451
|
-
const [currentAssetMetadata, setCurrentAssetMetadata] =
|
|
14683
|
+
const [canvasContent, setCanvasContent] = useState22(initialCanvasContent);
|
|
14684
|
+
const [currentAssetMetadata, setCurrentAssetMetadata] = useState22(null);
|
|
14452
14685
|
const onCommitRegistrations = useCallback25((pending) => {
|
|
14453
14686
|
const previousKeys = committedKeysRef.current;
|
|
14454
14687
|
const previousDescriptors = committedDescriptorsRef.current;
|
|
@@ -14501,12 +14734,12 @@ var CompositionManagerProvider = ({
|
|
|
14501
14734
|
}
|
|
14502
14735
|
};
|
|
14503
14736
|
}, [registry]);
|
|
14504
|
-
const compositionManagerSetters =
|
|
14737
|
+
const compositionManagerSetters = useMemo42(() => ({
|
|
14505
14738
|
setCanvasContent,
|
|
14506
14739
|
setCurrentAssetMetadata,
|
|
14507
14740
|
onlyRenderComposition
|
|
14508
14741
|
}), [onlyRenderComposition]);
|
|
14509
|
-
const compositionManagerContextValue =
|
|
14742
|
+
const compositionManagerContextValue = useMemo42(() => {
|
|
14510
14743
|
return {
|
|
14511
14744
|
compositions,
|
|
14512
14745
|
folders,
|
|
@@ -14521,17 +14754,22 @@ var CompositionManagerProvider = ({
|
|
|
14521
14754
|
currentAssetMetadata,
|
|
14522
14755
|
canvasContent
|
|
14523
14756
|
]);
|
|
14757
|
+
const compositionManagerRef = useRef29(compositionManagerContextValue);
|
|
14758
|
+
compositionManagerRef.current = compositionManagerContextValue;
|
|
14524
14759
|
if (registrationError !== null) {
|
|
14525
14760
|
throw registrationError;
|
|
14526
14761
|
}
|
|
14527
|
-
return /* @__PURE__ */
|
|
14762
|
+
return /* @__PURE__ */ jsx38(CompositionRegistryProvider, {
|
|
14528
14763
|
ref: flushSnapshotRef,
|
|
14529
14764
|
onSnapshot: onCommitRegistrations,
|
|
14530
|
-
children: /* @__PURE__ */
|
|
14765
|
+
children: /* @__PURE__ */ jsx38(CompositionManager.Provider, {
|
|
14531
14766
|
value: compositionManagerContextValue,
|
|
14532
|
-
children: /* @__PURE__ */
|
|
14533
|
-
value:
|
|
14534
|
-
children
|
|
14767
|
+
children: /* @__PURE__ */ jsx38(CompositionManagerRefContext.Provider, {
|
|
14768
|
+
value: compositionManagerRef,
|
|
14769
|
+
children: /* @__PURE__ */ jsx38(CompositionSetters.Provider, {
|
|
14770
|
+
value: compositionManagerSetters,
|
|
14771
|
+
children
|
|
14772
|
+
})
|
|
14535
14773
|
})
|
|
14536
14774
|
})
|
|
14537
14775
|
});
|
|
@@ -14626,8 +14864,8 @@ var getPreviewDomElement = () => {
|
|
|
14626
14864
|
};
|
|
14627
14865
|
|
|
14628
14866
|
// src/max-video-cache-size.ts
|
|
14629
|
-
import
|
|
14630
|
-
var MaxMediaCacheSizeContext =
|
|
14867
|
+
import React44 from "react";
|
|
14868
|
+
var MaxMediaCacheSizeContext = React44.createContext(null);
|
|
14631
14869
|
|
|
14632
14870
|
// src/media-resource-manager.ts
|
|
14633
14871
|
var disposeResource = (resource) => {
|
|
@@ -14780,8 +15018,8 @@ var waitForRoot = (fn) => {
|
|
|
14780
15018
|
};
|
|
14781
15019
|
|
|
14782
15020
|
// src/RemotionRoot.tsx
|
|
14783
|
-
import { useMemo as
|
|
14784
|
-
import { jsx as
|
|
15021
|
+
import { useMemo as useMemo43 } from "react";
|
|
15022
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
14785
15023
|
var RemotionRootContexts = ({
|
|
14786
15024
|
children,
|
|
14787
15025
|
numberOfAudioTags,
|
|
@@ -14793,29 +15031,29 @@ var RemotionRootContexts = ({
|
|
|
14793
15031
|
frameState,
|
|
14794
15032
|
_experimentalKeepAudioContextAlive
|
|
14795
15033
|
}) => {
|
|
14796
|
-
const logging =
|
|
15034
|
+
const logging = useMemo43(() => {
|
|
14797
15035
|
return { logLevel, mountTime: Date.now() };
|
|
14798
15036
|
}, [logLevel]);
|
|
14799
|
-
return /* @__PURE__ */
|
|
15037
|
+
return /* @__PURE__ */ jsx39(LogLevelContext.Provider, {
|
|
14800
15038
|
value: logging,
|
|
14801
|
-
children: /* @__PURE__ */
|
|
15039
|
+
children: /* @__PURE__ */ jsx39(TimelineContextProvider, {
|
|
14802
15040
|
frameState,
|
|
14803
|
-
children: /* @__PURE__ */
|
|
15041
|
+
children: /* @__PURE__ */ jsx39(MediaEnabledProvider, {
|
|
14804
15042
|
videoEnabled,
|
|
14805
15043
|
audioEnabled,
|
|
14806
|
-
children: /* @__PURE__ */
|
|
14807
|
-
children: /* @__PURE__ */
|
|
14808
|
-
children: /* @__PURE__ */
|
|
14809
|
-
children: /* @__PURE__ */
|
|
14810
|
-
children: /* @__PURE__ */
|
|
14811
|
-
children: /* @__PURE__ */
|
|
15044
|
+
children: /* @__PURE__ */ jsx39(EditorPropsProvider, {
|
|
15045
|
+
children: /* @__PURE__ */ jsx39(PrefetchProvider, {
|
|
15046
|
+
children: /* @__PURE__ */ jsx39(SequenceManagerProvider, {
|
|
15047
|
+
children: /* @__PURE__ */ jsx39(DurationsContextProvider, {
|
|
15048
|
+
children: /* @__PURE__ */ jsx39(BufferingProvider, {
|
|
15049
|
+
children: /* @__PURE__ */ jsx39(SharedAudioContextProvider, {
|
|
14812
15050
|
audioLatencyHint,
|
|
14813
15051
|
audioEnabled,
|
|
14814
15052
|
previewSampleRate,
|
|
14815
15053
|
_experimentalKeepAudioContextAlive,
|
|
14816
|
-
children: /* @__PURE__ */
|
|
15054
|
+
children: /* @__PURE__ */ jsx39(SharedAudioTagsContextProvider, {
|
|
14817
15055
|
numberOfAudioTags,
|
|
14818
|
-
children: /* @__PURE__ */
|
|
15056
|
+
children: /* @__PURE__ */ jsx39(VideoProvider, {
|
|
14819
15057
|
children
|
|
14820
15058
|
})
|
|
14821
15059
|
})
|
|
@@ -14831,7 +15069,7 @@ var RemotionRootContexts = ({
|
|
|
14831
15069
|
};
|
|
14832
15070
|
|
|
14833
15071
|
// src/render-resource-manager.ts
|
|
14834
|
-
import
|
|
15072
|
+
import React46 from "react";
|
|
14835
15073
|
var makeRenderResourceManager = () => {
|
|
14836
15074
|
const resources = new Map;
|
|
14837
15075
|
let disposed = false;
|
|
@@ -14872,7 +15110,7 @@ var makeRenderResourceManager = () => {
|
|
|
14872
15110
|
}
|
|
14873
15111
|
};
|
|
14874
15112
|
};
|
|
14875
|
-
var RenderResourceManagerContext =
|
|
15113
|
+
var RenderResourceManagerContext = React46.createContext(null);
|
|
14876
15114
|
|
|
14877
15115
|
// src/codec.ts
|
|
14878
15116
|
var validCodecs = [
|
|
@@ -15063,8 +15301,8 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
15063
15301
|
};
|
|
15064
15302
|
|
|
15065
15303
|
// src/sequence-stack-traces.ts
|
|
15066
|
-
import
|
|
15067
|
-
var SequenceStackTracesUpdateContext =
|
|
15304
|
+
import React47 from "react";
|
|
15305
|
+
var SequenceStackTracesUpdateContext = React47.createContext(() => {});
|
|
15068
15306
|
|
|
15069
15307
|
// src/setup-env-variables.ts
|
|
15070
15308
|
var getEnvVariables = () => {
|
|
@@ -15094,8 +15332,8 @@ var setupEnvVariables = () => {
|
|
|
15094
15332
|
};
|
|
15095
15333
|
|
|
15096
15334
|
// src/Track.tsx
|
|
15097
|
-
import {
|
|
15098
|
-
import { jsx as
|
|
15335
|
+
import { useMemo as useMemo44, useState as useState23 } from "react";
|
|
15336
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
15099
15337
|
var {
|
|
15100
15338
|
freeze: _freeze,
|
|
15101
15339
|
layout: _layout,
|
|
@@ -15111,12 +15349,11 @@ var TrackWithoutSchema = ({
|
|
|
15111
15349
|
layout = "none",
|
|
15112
15350
|
...props
|
|
15113
15351
|
}) => {
|
|
15114
|
-
const [id] =
|
|
15115
|
-
const
|
|
15116
|
-
|
|
15117
|
-
return /* @__PURE__ */ jsx39(TimelineTrackContext.Provider, {
|
|
15352
|
+
const [id] = useState23(() => String(Math.random()));
|
|
15353
|
+
const value = useMemo44(() => ({ id, name }), [id, name]);
|
|
15354
|
+
return /* @__PURE__ */ jsx40(TimelineTrackContext.Provider, {
|
|
15118
15355
|
value,
|
|
15119
|
-
children: /* @__PURE__ */
|
|
15356
|
+
children: /* @__PURE__ */ jsx40(SequenceWithoutSchema, {
|
|
15120
15357
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/track",
|
|
15121
15358
|
...props,
|
|
15122
15359
|
name,
|
|
@@ -15127,7 +15364,7 @@ var TrackWithoutSchema = ({
|
|
|
15127
15364
|
});
|
|
15128
15365
|
};
|
|
15129
15366
|
var Track = withInteractivitySchema({
|
|
15130
|
-
Component: (props) => /* @__PURE__ */
|
|
15367
|
+
Component: (props) => /* @__PURE__ */ jsx40(TrackWithoutSchema, {
|
|
15131
15368
|
...props,
|
|
15132
15369
|
layout: "none"
|
|
15133
15370
|
}),
|
|
@@ -15139,8 +15376,8 @@ var Track = withInteractivitySchema({
|
|
|
15139
15376
|
addSequenceStackTraces(Track);
|
|
15140
15377
|
|
|
15141
15378
|
// src/use-pixel-density.ts
|
|
15142
|
-
import
|
|
15143
|
-
var PixelDensityContext =
|
|
15379
|
+
import React49, { useContext as useContext49 } from "react";
|
|
15380
|
+
var PixelDensityContext = React49.createContext(null);
|
|
15144
15381
|
var getBrowserPixelDensity = () => {
|
|
15145
15382
|
if (typeof window === "undefined") {
|
|
15146
15383
|
return 1;
|
|
@@ -15174,8 +15411,8 @@ import {
|
|
|
15174
15411
|
useContext as useContext50,
|
|
15175
15412
|
useEffect as useEffect19,
|
|
15176
15413
|
useLayoutEffect as useLayoutEffect21,
|
|
15177
|
-
useMemo as
|
|
15178
|
-
useState as
|
|
15414
|
+
useMemo as useMemo45,
|
|
15415
|
+
useState as useState24
|
|
15179
15416
|
} from "react";
|
|
15180
15417
|
|
|
15181
15418
|
// src/video/offthread-video-source.ts
|
|
@@ -15189,7 +15426,7 @@ var getOffthreadVideoSource = ({
|
|
|
15189
15426
|
};
|
|
15190
15427
|
|
|
15191
15428
|
// src/video/OffthreadVideoForRendering.tsx
|
|
15192
|
-
import { jsx as
|
|
15429
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
15193
15430
|
var OffthreadVideoForRendering = ({
|
|
15194
15431
|
onError,
|
|
15195
15432
|
volume: volumeProp,
|
|
@@ -15221,7 +15458,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15221
15458
|
if (!src) {
|
|
15222
15459
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
15223
15460
|
}
|
|
15224
|
-
const id =
|
|
15461
|
+
const id = useMemo45(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
15225
15462
|
src,
|
|
15226
15463
|
sequenceContext?.cumulatedFrom,
|
|
15227
15464
|
sequenceContext?.relativeFrom,
|
|
@@ -15277,14 +15514,14 @@ var OffthreadVideoForRendering = ({
|
|
|
15277
15514
|
sequencePlaybackRate,
|
|
15278
15515
|
audioStreamIndex
|
|
15279
15516
|
]);
|
|
15280
|
-
const currentTime =
|
|
15517
|
+
const currentTime = useMemo45(() => {
|
|
15281
15518
|
return getExpectedMediaFrameUncorrected({
|
|
15282
15519
|
frame,
|
|
15283
15520
|
playbackRate: playbackRate || 1,
|
|
15284
15521
|
startFrom: audioStartFrame
|
|
15285
15522
|
}) / videoConfig.fps;
|
|
15286
15523
|
}, [frame, audioStartFrame, playbackRate, videoConfig.fps]);
|
|
15287
|
-
const actualSrc =
|
|
15524
|
+
const actualSrc = useMemo45(() => {
|
|
15288
15525
|
return getOffthreadVideoSource({
|
|
15289
15526
|
src,
|
|
15290
15527
|
currentTime,
|
|
@@ -15292,7 +15529,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15292
15529
|
toneMapped
|
|
15293
15530
|
});
|
|
15294
15531
|
}, [toneMapped, currentTime, src, transparent]);
|
|
15295
|
-
const [imageSrc, setImageSrc] =
|
|
15532
|
+
const [imageSrc, setImageSrc] = useState24(null);
|
|
15296
15533
|
const { delayRender, continueRender } = useDelayRender();
|
|
15297
15534
|
useLayoutEffect21(() => {
|
|
15298
15535
|
if (!window.remotion_videoEnabled) {
|
|
@@ -15372,7 +15609,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15372
15609
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
15373
15610
|
}
|
|
15374
15611
|
}, [imageSrc, onError]);
|
|
15375
|
-
const className =
|
|
15612
|
+
const className = useMemo45(() => {
|
|
15376
15613
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props.className].filter(truthy).join(" ");
|
|
15377
15614
|
}, [props.className]);
|
|
15378
15615
|
const onImageFrame = useCallback26((img) => {
|
|
@@ -15384,7 +15621,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15384
15621
|
return null;
|
|
15385
15622
|
}
|
|
15386
15623
|
continueRender(imageSrc.handle);
|
|
15387
|
-
return /* @__PURE__ */
|
|
15624
|
+
return /* @__PURE__ */ jsx41(Img, {
|
|
15388
15625
|
src: imageSrc.src,
|
|
15389
15626
|
delayRenderRetries,
|
|
15390
15627
|
delayRenderTimeoutInMilliseconds,
|
|
@@ -15396,15 +15633,15 @@ var OffthreadVideoForRendering = ({
|
|
|
15396
15633
|
};
|
|
15397
15634
|
|
|
15398
15635
|
// src/video/VideoForPreview.tsx
|
|
15399
|
-
import
|
|
15636
|
+
import React51, {
|
|
15400
15637
|
forwardRef as forwardRef14,
|
|
15401
15638
|
useCallback as useCallback27,
|
|
15402
15639
|
useContext as useContext51,
|
|
15403
15640
|
useEffect as useEffect21,
|
|
15404
15641
|
useImperativeHandle as useImperativeHandle10,
|
|
15405
|
-
useMemo as
|
|
15642
|
+
useMemo as useMemo46,
|
|
15406
15643
|
useRef as useRef30,
|
|
15407
|
-
useState as
|
|
15644
|
+
useState as useState25
|
|
15408
15645
|
} from "react";
|
|
15409
15646
|
|
|
15410
15647
|
// src/video/emit-video-frame.ts
|
|
@@ -15453,14 +15690,14 @@ class MediaPlaybackError extends Error {
|
|
|
15453
15690
|
}
|
|
15454
15691
|
|
|
15455
15692
|
// src/video/VideoForPreview.tsx
|
|
15456
|
-
import { jsx as
|
|
15693
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
15457
15694
|
var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
15458
15695
|
const context = useContext51(SharedAudioContext);
|
|
15459
15696
|
if (!context) {
|
|
15460
15697
|
throw new Error("SharedAudioContext not found");
|
|
15461
15698
|
}
|
|
15462
15699
|
const videoRef = useRef30(null);
|
|
15463
|
-
const sharedSource =
|
|
15700
|
+
const sharedSource = useMemo46(() => {
|
|
15464
15701
|
if (!context.audioContext) {
|
|
15465
15702
|
return null;
|
|
15466
15703
|
}
|
|
@@ -15469,7 +15706,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15469
15706
|
ref: videoRef
|
|
15470
15707
|
});
|
|
15471
15708
|
}, [context.audioContext]);
|
|
15472
|
-
const effectToUse =
|
|
15709
|
+
const effectToUse = React51.useInsertionEffect ?? React51.useLayoutEffect;
|
|
15473
15710
|
effectToUse(() => {
|
|
15474
15711
|
return () => {
|
|
15475
15712
|
requestAnimationFrame(() => {
|
|
@@ -15561,7 +15798,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15561
15798
|
useImperativeHandle10(ref, () => {
|
|
15562
15799
|
return videoRef.current;
|
|
15563
15800
|
}, []);
|
|
15564
|
-
|
|
15801
|
+
useState25(() => playbackLogging({
|
|
15565
15802
|
logLevel,
|
|
15566
15803
|
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
15567
15804
|
tag: "video",
|
|
@@ -15638,7 +15875,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15638
15875
|
current.preload = "auto";
|
|
15639
15876
|
}
|
|
15640
15877
|
}, []);
|
|
15641
|
-
const actualStyle =
|
|
15878
|
+
const actualStyle = useMemo46(() => {
|
|
15642
15879
|
return {
|
|
15643
15880
|
...style
|
|
15644
15881
|
};
|
|
@@ -15648,7 +15885,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15648
15885
|
requestsVideoFrame: Boolean(onVideoFrame),
|
|
15649
15886
|
isClientSideRendering: false
|
|
15650
15887
|
});
|
|
15651
|
-
const video = /* @__PURE__ */
|
|
15888
|
+
const video = /* @__PURE__ */ jsx42("video", {
|
|
15652
15889
|
...nativeProps,
|
|
15653
15890
|
ref: videoRef,
|
|
15654
15891
|
muted: isMutedForPlayback,
|
|
@@ -15675,7 +15912,7 @@ var VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
15675
15912
|
loopVolumeCurveBehavior,
|
|
15676
15913
|
onlyWarnForMediaSeekingError
|
|
15677
15914
|
} = props;
|
|
15678
|
-
const [timelineId] =
|
|
15915
|
+
const [timelineId] = useState25(() => String(Math.random()));
|
|
15679
15916
|
const parentSequence = useContext51(SequenceContext);
|
|
15680
15917
|
const { isStudio } = useRemotionEnvironment();
|
|
15681
15918
|
const [mediaVolume] = useMediaVolumeState();
|
|
@@ -15707,17 +15944,17 @@ var VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
15707
15944
|
documentationLink: onlyWarnForMediaSeekingError ? "https://www.remotion.dev/docs/offthreadvideo" : "https://www.remotion.dev/docs/html5-video",
|
|
15708
15945
|
muted: isMutedForTimeline
|
|
15709
15946
|
});
|
|
15710
|
-
const metadata =
|
|
15947
|
+
const metadata = useMemo46(() => isStudio || automaticOutlineRef || registration !== null ? {
|
|
15711
15948
|
type: "sequence",
|
|
15712
15949
|
id: timelineId,
|
|
15713
15950
|
value: registration,
|
|
15714
15951
|
outlineChildrenRef: automaticOutlineRef
|
|
15715
15952
|
} : null, [automaticOutlineRef, isStudio, registration, timelineId]);
|
|
15716
|
-
return /* @__PURE__ */
|
|
15953
|
+
return /* @__PURE__ */ jsx42(CommittedMetadataProvider, {
|
|
15717
15954
|
value: null,
|
|
15718
15955
|
_remotionCommitMetadata: metadata,
|
|
15719
|
-
children: /* @__PURE__ */
|
|
15720
|
-
children: /* @__PURE__ */
|
|
15956
|
+
children: /* @__PURE__ */ jsx42(SequenceContent, {
|
|
15957
|
+
children: /* @__PURE__ */ jsx42(VideoForPreviewContent, {
|
|
15721
15958
|
...props,
|
|
15722
15959
|
ref,
|
|
15723
15960
|
timelineId,
|
|
@@ -15730,7 +15967,7 @@ var VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
15730
15967
|
var VideoForPreview = forwardRef14(VideoForPreviewRefForwardingFunction);
|
|
15731
15968
|
|
|
15732
15969
|
// src/video/OffthreadVideo.tsx
|
|
15733
|
-
import { jsx as
|
|
15970
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
15734
15971
|
var InnerOffthreadVideo = (props) => {
|
|
15735
15972
|
const {
|
|
15736
15973
|
startFrom,
|
|
@@ -15774,15 +16011,15 @@ var InnerOffthreadVideo = (props) => {
|
|
|
15774
16011
|
trimBefore: trimBeforeValue
|
|
15775
16012
|
});
|
|
15776
16013
|
if (typeof trimBeforeValue !== "undefined" || typeof effectiveTrimAfter !== "undefined") {
|
|
15777
|
-
return /* @__PURE__ */
|
|
16014
|
+
return /* @__PURE__ */ jsx43(Html5MediaTrimContext.Provider, {
|
|
15778
16015
|
value: trimBeforeValue ?? 0,
|
|
15779
|
-
children: /* @__PURE__ */
|
|
16016
|
+
children: /* @__PURE__ */ jsx43(Sequence, {
|
|
15780
16017
|
layout: "none",
|
|
15781
16018
|
from: 0 - (trimBeforeValue ?? 0),
|
|
15782
16019
|
showInTimeline: false,
|
|
15783
16020
|
durationInFrames: effectiveTrimAfter === undefined ? undefined : (trimBeforeValue ?? 0) + (effectiveTrimAfter - (trimBeforeValue ?? 0)) / (props.playbackRate ?? 1),
|
|
15784
16021
|
name,
|
|
15785
|
-
children: /* @__PURE__ */
|
|
16022
|
+
children: /* @__PURE__ */ jsx43(InnerOffthreadVideo, {
|
|
15786
16023
|
pauseWhenBuffering: shouldPauseWhenBuffering,
|
|
15787
16024
|
...otherProps,
|
|
15788
16025
|
trimAfter: undefined,
|
|
@@ -15799,7 +16036,7 @@ var InnerOffthreadVideo = (props) => {
|
|
|
15799
16036
|
}
|
|
15800
16037
|
validateMediaProps(props, "Video");
|
|
15801
16038
|
if (environment.isRendering) {
|
|
15802
|
-
return /* @__PURE__ */
|
|
16039
|
+
return /* @__PURE__ */ jsx43(OffthreadVideoForRendering, {
|
|
15803
16040
|
pauseWhenBuffering: shouldPauseWhenBuffering,
|
|
15804
16041
|
...otherProps,
|
|
15805
16042
|
trimAfter: undefined,
|
|
@@ -15822,7 +16059,7 @@ var InnerOffthreadVideo = (props) => {
|
|
|
15822
16059
|
delayRenderTimeoutInMilliseconds,
|
|
15823
16060
|
...propsForPreview
|
|
15824
16061
|
} = otherProps;
|
|
15825
|
-
return /* @__PURE__ */
|
|
16062
|
+
return /* @__PURE__ */ jsx43(VideoForPreview, {
|
|
15826
16063
|
_remotionInternalStack: _remotionInternalStack ?? null,
|
|
15827
16064
|
onDuration,
|
|
15828
16065
|
onlyWarnForMediaSeekingError: true,
|
|
@@ -15872,7 +16109,7 @@ var OffthreadVideo = ({
|
|
|
15872
16109
|
if (imageFormat) {
|
|
15873
16110
|
throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
|
|
15874
16111
|
}
|
|
15875
|
-
return /* @__PURE__ */
|
|
16112
|
+
return /* @__PURE__ */ jsx43(InnerOffthreadVideo, {
|
|
15876
16113
|
acceptableTimeShiftInSeconds,
|
|
15877
16114
|
allowAmplificationDuringRender: allowAmplificationDuringRender ?? true,
|
|
15878
16115
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
@@ -15946,39 +16183,37 @@ var watchStaticFile = (fileName, callback) => {
|
|
|
15946
16183
|
};
|
|
15947
16184
|
|
|
15948
16185
|
// src/wrap-remotion-context.tsx
|
|
15949
|
-
import
|
|
15950
|
-
import { jsx as
|
|
16186
|
+
import React53, { useCallback as useCallback29, useMemo as useMemo47, useRef as useRef31, useState as useState26 } from "react";
|
|
16187
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
15951
16188
|
function useRemotionContexts() {
|
|
15952
|
-
const compositionManagerCtx =
|
|
15953
|
-
const videoContext =
|
|
15954
|
-
const timelineContext =
|
|
15955
|
-
const setTimelineContext =
|
|
15956
|
-
const sequenceContext =
|
|
15957
|
-
const defaultPremountInSeconds =
|
|
15958
|
-
const
|
|
15959
|
-
const
|
|
15960
|
-
const
|
|
15961
|
-
const
|
|
15962
|
-
const
|
|
15963
|
-
const
|
|
15964
|
-
const
|
|
15965
|
-
const
|
|
15966
|
-
const
|
|
15967
|
-
const
|
|
15968
|
-
const
|
|
15969
|
-
const
|
|
15970
|
-
const
|
|
15971
|
-
const
|
|
15972
|
-
const
|
|
15973
|
-
|
|
15974
|
-
return useMemo46(() => ({
|
|
16189
|
+
const compositionManagerCtx = React53.useContext(CompositionManager);
|
|
16190
|
+
const videoContext = React53.useContext(VideoContext);
|
|
16191
|
+
const timelineContext = React53.useContext(TimelineContext);
|
|
16192
|
+
const setTimelineContext = React53.useContext(SetTimelineContext);
|
|
16193
|
+
const sequenceContext = React53.useContext(SequenceContext);
|
|
16194
|
+
const defaultPremountInSeconds = React53.useContext(DefaultPremountContext);
|
|
16195
|
+
const timelineTrackContext = React53.useContext(TimelineTrackContext);
|
|
16196
|
+
const canUseRemotionHooksContext = React53.useContext(CanUseRemotionHooks);
|
|
16197
|
+
const preloadContext = React53.useContext(PreloadContext);
|
|
16198
|
+
const resolveCompositionContext = React53.useContext(ResolveCompositionContext);
|
|
16199
|
+
const renderAssetManagerContext = React53.useContext(RenderAssetManager);
|
|
16200
|
+
const sequenceManagerActionsContext = React53.useContext(SequenceManagerActionsContext);
|
|
16201
|
+
const sequenceManagerRefContext = React53.useContext(SequenceManagerRefContext);
|
|
16202
|
+
const sequenceRegistryContext = React53.useContext(SequenceRegistryContext);
|
|
16203
|
+
const sequenceRegistryScopeContext = React53.useContext(SequenceRegistryScopeContext);
|
|
16204
|
+
const sequenceRegistrationContext = React53.useContext(SequenceRegistrationContext);
|
|
16205
|
+
const disableSequenceRegistrationContext = React53.useContext(DisableSequenceRegistrationContext);
|
|
16206
|
+
const remotionEnvironmentContext = React53.useContext(RemotionEnvironmentContext);
|
|
16207
|
+
const visualModePropStatusesRefContext = React53.useContext(VisualModePropStatusesRefContext);
|
|
16208
|
+
const bufferManagerContext = React53.useContext(BufferingContextReact);
|
|
16209
|
+
const logLevelContext = React53.useContext(LogLevelContext);
|
|
16210
|
+
return useMemo47(() => ({
|
|
15975
16211
|
compositionManagerCtx,
|
|
15976
16212
|
videoContext,
|
|
15977
16213
|
timelineContext,
|
|
15978
16214
|
setTimelineContext,
|
|
15979
16215
|
sequenceContext,
|
|
15980
16216
|
defaultPremountInSeconds,
|
|
15981
|
-
experimentalTracksEnabled,
|
|
15982
16217
|
timelineTrackContext,
|
|
15983
16218
|
canUseRemotionHooksContext,
|
|
15984
16219
|
preloadContext,
|
|
@@ -15999,7 +16234,6 @@ function useRemotionContexts() {
|
|
|
15999
16234
|
videoContext,
|
|
16000
16235
|
sequenceContext,
|
|
16001
16236
|
defaultPremountInSeconds,
|
|
16002
|
-
experimentalTracksEnabled,
|
|
16003
16237
|
timelineTrackContext,
|
|
16004
16238
|
setTimelineContext,
|
|
16005
16239
|
timelineContext,
|
|
@@ -16024,8 +16258,8 @@ var ForwardedSequenceRegistry = ({
|
|
|
16024
16258
|
contexts,
|
|
16025
16259
|
children
|
|
16026
16260
|
}) => {
|
|
16027
|
-
const [scopeId] =
|
|
16028
|
-
const [observerAvailable, setObserverAvailable] =
|
|
16261
|
+
const [scopeId] = useState26(() => String(Math.random()));
|
|
16262
|
+
const [observerAvailable, setObserverAvailable] = useState26(isCommitRegistrationObserverInstalled);
|
|
16029
16263
|
const observedCommitRef = useRef31(false);
|
|
16030
16264
|
const observerFailedRef = useRef31(false);
|
|
16031
16265
|
const unmountedRef = useRef31(false);
|
|
@@ -16041,7 +16275,7 @@ var ForwardedSequenceRegistry = ({
|
|
|
16041
16275
|
observedCommitRef.current = true;
|
|
16042
16276
|
scope?.onCommitSequences(scopeId, sequences, sequenceIds);
|
|
16043
16277
|
}, [scope, scopeId]);
|
|
16044
|
-
const useIsomorphicLayoutEffect = typeof window === "undefined" ?
|
|
16278
|
+
const useIsomorphicLayoutEffect = typeof window === "undefined" ? React53.useEffect : React53.useLayoutEffect;
|
|
16045
16279
|
useIsomorphicLayoutEffect(() => {
|
|
16046
16280
|
if (scope === null || typeof window === "undefined") {
|
|
16047
16281
|
return;
|
|
@@ -16080,19 +16314,19 @@ var ForwardedSequenceRegistry = ({
|
|
|
16080
16314
|
});
|
|
16081
16315
|
};
|
|
16082
16316
|
}, [scope, scopeId, registry, commitRegistrationEnabled]);
|
|
16083
|
-
const metadata =
|
|
16317
|
+
const metadata = useMemo47(() => ({
|
|
16084
16318
|
type: "sequence-manager",
|
|
16085
16319
|
id: scopeId,
|
|
16086
16320
|
onCommit: commitRegistrationEnabled ? onCommitSequences : null
|
|
16087
16321
|
}), [commitRegistrationEnabled, onCommitSequences, scopeId]);
|
|
16088
|
-
return /* @__PURE__ */
|
|
16322
|
+
return /* @__PURE__ */ jsx44(SequenceRegistryScopeProvider, {
|
|
16089
16323
|
value: scope,
|
|
16090
16324
|
_remotionCommitMetadata: metadata,
|
|
16091
|
-
children: /* @__PURE__ */
|
|
16325
|
+
children: /* @__PURE__ */ jsx44(SequenceManagerActionsContext.Provider, {
|
|
16092
16326
|
value: contexts.sequenceManagerActionsContext,
|
|
16093
|
-
children: /* @__PURE__ */
|
|
16327
|
+
children: /* @__PURE__ */ jsx44(SequenceRegistryContext.Provider, {
|
|
16094
16328
|
value: registry,
|
|
16095
|
-
children: /* @__PURE__ */
|
|
16329
|
+
children: /* @__PURE__ */ jsx44(SequenceCommitRegistrationContext.Provider, {
|
|
16096
16330
|
value: commitRegistrationEnabled,
|
|
16097
16331
|
children
|
|
16098
16332
|
})
|
|
@@ -16102,48 +16336,45 @@ var ForwardedSequenceRegistry = ({
|
|
|
16102
16336
|
};
|
|
16103
16337
|
var RemotionContextProvider = (props) => {
|
|
16104
16338
|
const { children, contexts } = props;
|
|
16105
|
-
return /* @__PURE__ */
|
|
16339
|
+
return /* @__PURE__ */ jsx44(LogLevelContext.Provider, {
|
|
16106
16340
|
value: contexts.logLevelContext,
|
|
16107
|
-
children: /* @__PURE__ */
|
|
16341
|
+
children: /* @__PURE__ */ jsx44(CanUseRemotionHooks.Provider, {
|
|
16108
16342
|
value: contexts.canUseRemotionHooksContext,
|
|
16109
|
-
children: /* @__PURE__ */
|
|
16343
|
+
children: /* @__PURE__ */ jsx44(PreloadContext.Provider, {
|
|
16110
16344
|
value: contexts.preloadContext,
|
|
16111
|
-
children: /* @__PURE__ */
|
|
16345
|
+
children: /* @__PURE__ */ jsx44(CompositionManager.Provider, {
|
|
16112
16346
|
value: contexts.compositionManagerCtx,
|
|
16113
|
-
children: /* @__PURE__ */
|
|
16347
|
+
children: /* @__PURE__ */ jsx44(SequenceManagerRefContext.Provider, {
|
|
16114
16348
|
value: contexts.sequenceManagerRefContext,
|
|
16115
|
-
children: /* @__PURE__ */
|
|
16349
|
+
children: /* @__PURE__ */ jsx44(RemotionEnvironmentContext.Provider, {
|
|
16116
16350
|
value: contexts.remotionEnvironmentContext,
|
|
16117
|
-
children: /* @__PURE__ */
|
|
16351
|
+
children: /* @__PURE__ */ jsx44(SequenceRegistrationContext.Provider, {
|
|
16118
16352
|
value: contexts.sequenceRegistrationContext,
|
|
16119
|
-
children: /* @__PURE__ */
|
|
16353
|
+
children: /* @__PURE__ */ jsx44(DisableSequenceRegistrationContext.Provider, {
|
|
16120
16354
|
value: contexts.disableSequenceRegistrationContext,
|
|
16121
|
-
children: /* @__PURE__ */
|
|
16355
|
+
children: /* @__PURE__ */ jsx44(ForwardedSequenceRegistry, {
|
|
16122
16356
|
contexts,
|
|
16123
|
-
children: /* @__PURE__ */
|
|
16357
|
+
children: /* @__PURE__ */ jsx44(VisualModePropStatusesRefContext.Provider, {
|
|
16124
16358
|
value: contexts.visualModePropStatusesRefContext,
|
|
16125
|
-
children: /* @__PURE__ */
|
|
16359
|
+
children: /* @__PURE__ */ jsx44(RenderAssetManager.Provider, {
|
|
16126
16360
|
value: contexts.renderAssetManagerContext,
|
|
16127
|
-
children: /* @__PURE__ */
|
|
16361
|
+
children: /* @__PURE__ */ jsx44(ResolveCompositionContext.Provider, {
|
|
16128
16362
|
value: contexts.resolveCompositionContext,
|
|
16129
|
-
children: /* @__PURE__ */
|
|
16363
|
+
children: /* @__PURE__ */ jsx44(TimelineContext.Provider, {
|
|
16130
16364
|
value: contexts.timelineContext,
|
|
16131
|
-
children: /* @__PURE__ */
|
|
16365
|
+
children: /* @__PURE__ */ jsx44(SetTimelineContext.Provider, {
|
|
16132
16366
|
value: contexts.setTimelineContext,
|
|
16133
|
-
children: /* @__PURE__ */
|
|
16367
|
+
children: /* @__PURE__ */ jsx44(SequenceContext.Provider, {
|
|
16134
16368
|
value: contexts.sequenceContext,
|
|
16135
|
-
children: /* @__PURE__ */
|
|
16369
|
+
children: /* @__PURE__ */ jsx44(BufferingContextReact.Provider, {
|
|
16136
16370
|
value: contexts.bufferManagerContext,
|
|
16137
|
-
children: /* @__PURE__ */
|
|
16138
|
-
value: contexts.
|
|
16139
|
-
children: /* @__PURE__ */
|
|
16140
|
-
value: contexts.
|
|
16141
|
-
children: /* @__PURE__ */
|
|
16142
|
-
value: contexts.
|
|
16143
|
-
children
|
|
16144
|
-
value: contexts.videoContext,
|
|
16145
|
-
children
|
|
16146
|
-
})
|
|
16371
|
+
children: /* @__PURE__ */ jsx44(TimelineTrackContext.Provider, {
|
|
16372
|
+
value: contexts.timelineTrackContext,
|
|
16373
|
+
children: /* @__PURE__ */ jsx44(DefaultPremountContext.Provider, {
|
|
16374
|
+
value: contexts.defaultPremountInSeconds,
|
|
16375
|
+
children: /* @__PURE__ */ jsx44(VideoContext.Provider, {
|
|
16376
|
+
value: contexts.videoContext,
|
|
16377
|
+
children
|
|
16147
16378
|
})
|
|
16148
16379
|
})
|
|
16149
16380
|
})
|
|
@@ -16202,6 +16433,7 @@ var Internals = {
|
|
|
16202
16433
|
resolveTrimProps,
|
|
16203
16434
|
VideoForPreview,
|
|
16204
16435
|
CompositionManager,
|
|
16436
|
+
CompositionManagerRefContext,
|
|
16205
16437
|
CompositionSetters,
|
|
16206
16438
|
VisualModePropStatusesContext,
|
|
16207
16439
|
VisualModePropStatusesRefContext,
|
|
@@ -16250,7 +16482,6 @@ var Internals = {
|
|
|
16250
16482
|
truthy,
|
|
16251
16483
|
SequenceContext,
|
|
16252
16484
|
TimelineTrackContext,
|
|
16253
|
-
ExperimentalTracksEnabledContext,
|
|
16254
16485
|
TrackWithoutSchema,
|
|
16255
16486
|
PremountContext,
|
|
16256
16487
|
usePremounting,
|
|
@@ -16383,17 +16614,17 @@ Object.assign(Internals, { useSyncExternalStore: useSyncExternalStore2 });
|
|
|
16383
16614
|
// src/font-face-registry.ts
|
|
16384
16615
|
var fontDataByUrl = new Map;
|
|
16385
16616
|
// src/series/index.tsx
|
|
16386
|
-
import
|
|
16617
|
+
import React55, {
|
|
16387
16618
|
forwardRef as forwardRef15,
|
|
16388
|
-
useMemo as
|
|
16619
|
+
useMemo as useMemo48
|
|
16389
16620
|
} from "react";
|
|
16390
16621
|
|
|
16391
16622
|
// src/series/flatten-children.tsx
|
|
16392
|
-
import
|
|
16623
|
+
import React54 from "react";
|
|
16393
16624
|
var flattenChildren = (children) => {
|
|
16394
|
-
const childrenArray =
|
|
16625
|
+
const childrenArray = React54.Children.toArray(children);
|
|
16395
16626
|
return childrenArray.reduce((flatChildren, child) => {
|
|
16396
|
-
if (child.type ===
|
|
16627
|
+
if (child.type === React54.Fragment) {
|
|
16397
16628
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
16398
16629
|
}
|
|
16399
16630
|
flatChildren.push(child);
|
|
@@ -16402,7 +16633,7 @@ var flattenChildren = (children) => {
|
|
|
16402
16633
|
};
|
|
16403
16634
|
|
|
16404
16635
|
// src/series/index.tsx
|
|
16405
|
-
import { jsx as
|
|
16636
|
+
import { jsx as jsx45, jsxs as jsxs4, Fragment } from "react/jsx-runtime";
|
|
16406
16637
|
var seriesSequenceSchema = {
|
|
16407
16638
|
durationInFrames: Interactive.baseSchema.durationInFrames,
|
|
16408
16639
|
name: Interactive.sequenceSchema.name,
|
|
@@ -16418,7 +16649,7 @@ var SeriesSequenceInner = forwardRef15(({ offset = 0, className = "", _remotionI
|
|
|
16418
16649
|
if (_remotionInternalRender) {
|
|
16419
16650
|
return _remotionInternalRender({ ...props, offset, className: className || undefined }, ref);
|
|
16420
16651
|
}
|
|
16421
|
-
return /* @__PURE__ */
|
|
16652
|
+
return /* @__PURE__ */ jsx45(IsNotInsideSeriesProvider, {
|
|
16422
16653
|
children: props.children
|
|
16423
16654
|
});
|
|
16424
16655
|
});
|
|
@@ -16457,7 +16688,7 @@ var validateSeriesSequenceProps = ({
|
|
|
16457
16688
|
};
|
|
16458
16689
|
var SeriesInner = (props) => {
|
|
16459
16690
|
const pendingDeletions = usePendingSequenceDeletions();
|
|
16460
|
-
const childrenValue =
|
|
16691
|
+
const childrenValue = useMemo48(() => {
|
|
16461
16692
|
const flattenedChildren = flattenChildren(props.children).filter((child) => !OptimisticSequenceDeletion.isElementDeleted(child, pendingDeletions));
|
|
16462
16693
|
const renderChildren = (i, startFrame) => {
|
|
16463
16694
|
if (i === flattenedChildren.length) {
|
|
@@ -16481,7 +16712,7 @@ var SeriesInner = (props) => {
|
|
|
16481
16712
|
index: i,
|
|
16482
16713
|
childrenLength: flattenedChildren.length
|
|
16483
16714
|
});
|
|
16484
|
-
return
|
|
16715
|
+
return React55.cloneElement(castedElement, {
|
|
16485
16716
|
_remotionInternalRender: (resolvedProps, ref) => {
|
|
16486
16717
|
const durationInFramesProp = resolvedProps.durationInFrames;
|
|
16487
16718
|
const timelineDurationInFrames = durationInFramesProp / (resolvedProps.playbackRate ?? 1);
|
|
@@ -16507,7 +16738,7 @@ var SeriesInner = (props) => {
|
|
|
16507
16738
|
const nextStartFrame = startFrame + timelineDurationInFrames + offset;
|
|
16508
16739
|
return /* @__PURE__ */ jsxs4(Fragment, {
|
|
16509
16740
|
children: [
|
|
16510
|
-
/* @__PURE__ */
|
|
16741
|
+
/* @__PURE__ */ jsx45(SequenceWithoutSchemaWithRef, {
|
|
16511
16742
|
ref,
|
|
16512
16743
|
name: name || "<Series.Sequence>",
|
|
16513
16744
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/series",
|
|
@@ -16519,7 +16750,7 @@ var SeriesInner = (props) => {
|
|
|
16519
16750
|
role: "clip",
|
|
16520
16751
|
seriesOffset: offset
|
|
16521
16752
|
},
|
|
16522
|
-
children: /* @__PURE__ */
|
|
16753
|
+
children: /* @__PURE__ */ jsx45(IsNotInsideSeriesProvider, {
|
|
16523
16754
|
children: sequenceChildren
|
|
16524
16755
|
})
|
|
16525
16756
|
}),
|
|
@@ -16531,12 +16762,12 @@ var SeriesInner = (props) => {
|
|
|
16531
16762
|
};
|
|
16532
16763
|
return renderChildren(0, 0);
|
|
16533
16764
|
}, [props.children, pendingDeletions]);
|
|
16534
|
-
return /* @__PURE__ */
|
|
16765
|
+
return /* @__PURE__ */ jsx45(TrackWithoutSchema, {
|
|
16535
16766
|
layout: "none",
|
|
16536
16767
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/series",
|
|
16537
16768
|
...props,
|
|
16538
16769
|
name: props.name ?? "<Series>",
|
|
16539
|
-
children: /* @__PURE__ */
|
|
16770
|
+
children: /* @__PURE__ */ jsx45(IsInsideSeriesContainer, {
|
|
16540
16771
|
children: childrenValue
|
|
16541
16772
|
})
|
|
16542
16773
|
});
|
|
@@ -16650,14 +16881,14 @@ var staticFile = (path) => {
|
|
|
16650
16881
|
return preparsed;
|
|
16651
16882
|
};
|
|
16652
16883
|
// src/Still.tsx
|
|
16653
|
-
import
|
|
16884
|
+
import React56 from "react";
|
|
16654
16885
|
var Still = (props) => {
|
|
16655
16886
|
const newProps = {
|
|
16656
16887
|
...props,
|
|
16657
16888
|
durationInFrames: 1,
|
|
16658
16889
|
fps: 1
|
|
16659
16890
|
};
|
|
16660
|
-
return
|
|
16891
|
+
return React56.createElement(Composition, newProps);
|
|
16661
16892
|
};
|
|
16662
16893
|
addSequenceStackTraces(Still);
|
|
16663
16894
|
// src/video/html5-video.tsx
|
|
@@ -16670,7 +16901,7 @@ import {
|
|
|
16670
16901
|
useEffect as useEffect22,
|
|
16671
16902
|
useImperativeHandle as useImperativeHandle11,
|
|
16672
16903
|
useLayoutEffect as useLayoutEffect22,
|
|
16673
|
-
useMemo as
|
|
16904
|
+
useMemo as useMemo49,
|
|
16674
16905
|
useRef as useRef32
|
|
16675
16906
|
} from "react";
|
|
16676
16907
|
|
|
@@ -16690,13 +16921,6 @@ var seekToTime = ({
|
|
|
16690
16921
|
cancel: () => {}
|
|
16691
16922
|
};
|
|
16692
16923
|
}
|
|
16693
|
-
seek({
|
|
16694
|
-
logLevel,
|
|
16695
|
-
mediaRef: element,
|
|
16696
|
-
time: desiredTime,
|
|
16697
|
-
why: "Seeking during rendering",
|
|
16698
|
-
mountTime
|
|
16699
|
-
});
|
|
16700
16924
|
let cancel;
|
|
16701
16925
|
let cancelSeeked = null;
|
|
16702
16926
|
const prom = new Promise((resolve) => {
|
|
@@ -16722,6 +16946,13 @@ var seekToTime = ({
|
|
|
16722
16946
|
element.removeEventListener("seeked", onDone);
|
|
16723
16947
|
};
|
|
16724
16948
|
});
|
|
16949
|
+
seek({
|
|
16950
|
+
logLevel,
|
|
16951
|
+
mediaRef: element,
|
|
16952
|
+
time: desiredTime,
|
|
16953
|
+
why: "Seeking during rendering",
|
|
16954
|
+
mountTime
|
|
16955
|
+
});
|
|
16725
16956
|
return {
|
|
16726
16957
|
wait: Promise.all([prom, waitForSeekedEvent]).then(([time]) => time),
|
|
16727
16958
|
cancel: () => {
|
|
@@ -16799,7 +17030,7 @@ var seekToTimeMultipleUntilRight = ({
|
|
|
16799
17030
|
};
|
|
16800
17031
|
|
|
16801
17032
|
// src/video/VideoForRendering.tsx
|
|
16802
|
-
import { jsx as
|
|
17033
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
16803
17034
|
var VideoForRenderingForwardFunction = ({
|
|
16804
17035
|
onError,
|
|
16805
17036
|
volume: volumeProp,
|
|
@@ -16830,7 +17061,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
16830
17061
|
const mountTime = useMountTime();
|
|
16831
17062
|
const { delayRender, continueRender } = useDelayRender();
|
|
16832
17063
|
const { registerRenderAsset, unregisterRenderAsset } = useContext52(RenderAssetManager);
|
|
16833
|
-
const id =
|
|
17064
|
+
const id = useMemo49(() => `video-${random(props.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
16834
17065
|
props.src,
|
|
16835
17066
|
sequenceContext?.cumulatedFrom,
|
|
16836
17067
|
sequenceContext?.relativeFrom,
|
|
@@ -17014,7 +17245,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
17014
17245
|
delayRender
|
|
17015
17246
|
]);
|
|
17016
17247
|
}
|
|
17017
|
-
return /* @__PURE__ */
|
|
17248
|
+
return /* @__PURE__ */ jsx46("video", {
|
|
17018
17249
|
ref: videoRef,
|
|
17019
17250
|
disableRemotePlayback: true,
|
|
17020
17251
|
...props
|
|
@@ -17023,7 +17254,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
17023
17254
|
var VideoForRendering = forwardRef16(VideoForRenderingForwardFunction);
|
|
17024
17255
|
|
|
17025
17256
|
// src/video/html5-video.tsx
|
|
17026
|
-
import { jsx as
|
|
17257
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
17027
17258
|
var VideoForwardingFunction = (props, ref) => {
|
|
17028
17259
|
const {
|
|
17029
17260
|
startFrom,
|
|
@@ -17080,14 +17311,14 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17080
17311
|
const loopDuration = effectiveTrimAfter ?? (durationFetched === undefined ? undefined : durationFetched * fps);
|
|
17081
17312
|
if (loop && loopDuration !== undefined) {
|
|
17082
17313
|
if (!Number.isFinite(loopDuration)) {
|
|
17083
|
-
return /* @__PURE__ */
|
|
17314
|
+
return /* @__PURE__ */ jsx47(Html5Video, {
|
|
17084
17315
|
...propsOtherThanLoop,
|
|
17085
17316
|
ref,
|
|
17086
17317
|
_remotionInternalStack,
|
|
17087
17318
|
_remotionInternalNativeLoopPassed: true
|
|
17088
17319
|
});
|
|
17089
17320
|
}
|
|
17090
|
-
return /* @__PURE__ */
|
|
17321
|
+
return /* @__PURE__ */ jsx47(Loop, {
|
|
17091
17322
|
durationInFrames: calculateMediaDuration({
|
|
17092
17323
|
trimAfter: effectiveTrimAfter,
|
|
17093
17324
|
mediaDurationInFrames: loopDuration,
|
|
@@ -17097,7 +17328,7 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17097
17328
|
layout: "none",
|
|
17098
17329
|
name,
|
|
17099
17330
|
showInTimeline: false,
|
|
17100
|
-
children: /* @__PURE__ */
|
|
17331
|
+
children: /* @__PURE__ */ jsx47(Html5Video, {
|
|
17101
17332
|
...propsOtherThanLoop,
|
|
17102
17333
|
ref,
|
|
17103
17334
|
_remotionInternalStack,
|
|
@@ -17106,15 +17337,15 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17106
17337
|
});
|
|
17107
17338
|
}
|
|
17108
17339
|
if (typeof trimBeforeValue !== "undefined" || typeof effectiveTrimAfter !== "undefined") {
|
|
17109
|
-
return /* @__PURE__ */
|
|
17340
|
+
return /* @__PURE__ */ jsx47(Html5MediaTrimContext.Provider, {
|
|
17110
17341
|
value: trimBeforeValue ?? 0,
|
|
17111
|
-
children: /* @__PURE__ */
|
|
17342
|
+
children: /* @__PURE__ */ jsx47(Sequence, {
|
|
17112
17343
|
layout: "none",
|
|
17113
17344
|
from: 0 - (trimBeforeValue ?? 0),
|
|
17114
17345
|
showInTimeline: false,
|
|
17115
17346
|
durationInFrames: effectiveTrimAfter === undefined ? undefined : (trimBeforeValue ?? 0) + (effectiveTrimAfter - (trimBeforeValue ?? 0)) / (props.playbackRate ?? 1),
|
|
17116
17347
|
name,
|
|
17117
|
-
children: /* @__PURE__ */
|
|
17348
|
+
children: /* @__PURE__ */ jsx47(Html5Video, {
|
|
17118
17349
|
pauseWhenBuffering: shouldPauseWhenBuffering,
|
|
17119
17350
|
onVideoFrame,
|
|
17120
17351
|
...otherProps,
|
|
@@ -17131,14 +17362,14 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17131
17362
|
volume: props.volume
|
|
17132
17363
|
}, "Html5Video");
|
|
17133
17364
|
if (environment.isRendering) {
|
|
17134
|
-
return /* @__PURE__ */
|
|
17365
|
+
return /* @__PURE__ */ jsx47(VideoForRendering, {
|
|
17135
17366
|
onDuration,
|
|
17136
17367
|
onVideoFrame: onVideoFrame ?? null,
|
|
17137
17368
|
...otherProps,
|
|
17138
17369
|
ref
|
|
17139
17370
|
});
|
|
17140
17371
|
}
|
|
17141
|
-
return /* @__PURE__ */
|
|
17372
|
+
return /* @__PURE__ */ jsx47(VideoForPreview, {
|
|
17142
17373
|
onlyWarnForMediaSeekingError: false,
|
|
17143
17374
|
...otherProps,
|
|
17144
17375
|
ref,
|