remotion 4.0.538 → 4.0.539
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/AbsoluteFillElement.js +7 -2
- package/dist/cjs/animated-image/decode-image.js +2 -0
- package/dist/cjs/effects/create-curve-sampler.d.ts +1 -0
- package/dist/cjs/effects/create-curve-sampler.js +100 -0
- package/dist/cjs/effects/effect-source-observer.d.ts +13 -0
- package/dist/cjs/effects/effect-source-observer.js +177 -0
- package/dist/cjs/effects/run-effect-chain.js +3 -0
- package/dist/cjs/effects/use-memoized-effects.js +6 -1
- package/dist/cjs/internals.d.ts +4 -0
- package/dist/cjs/internals.js +4 -0
- package/dist/cjs/interpolate-colors.js +11 -7
- package/dist/cjs/interpolate.js +37 -33
- package/dist/cjs/nonce.d.ts +11 -0
- package/dist/cjs/nonce.js +42 -0
- package/dist/cjs/prefetch.js +30 -5
- package/dist/cjs/sequence-order-marker.d.ts +58 -0
- package/dist/cjs/sequence-order-marker.js +44 -0
- package/dist/cjs/spring/index.js +1 -3
- package/dist/cjs/use-lazy-component.js +5 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +559 -322
- package/dist/esm/no-react.mjs +47 -30
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -493,7 +493,7 @@ var hasTailwindClassName = ({
|
|
|
493
493
|
};
|
|
494
494
|
var AbsoluteFillElementRefForwarding = (props, ref) => {
|
|
495
495
|
const { style, ...other } = props;
|
|
496
|
-
const
|
|
496
|
+
const defaultStyle = useMemo2(() => {
|
|
497
497
|
return {
|
|
498
498
|
position: "absolute",
|
|
499
499
|
top: hasTailwindClassName({
|
|
@@ -552,10 +552,15 @@ var AbsoluteFillElementRefForwarding = (props, ref) => {
|
|
|
552
552
|
"flex-col-reverse"
|
|
553
553
|
],
|
|
554
554
|
type: "exact"
|
|
555
|
-
}) ? undefined : "column"
|
|
555
|
+
}) ? undefined : "column"
|
|
556
|
+
};
|
|
557
|
+
}, [other.className]);
|
|
558
|
+
const actualStyle = useMemo2(() => {
|
|
559
|
+
return {
|
|
560
|
+
...defaultStyle,
|
|
556
561
|
...style
|
|
557
562
|
};
|
|
558
|
-
}, [
|
|
563
|
+
}, [defaultStyle, style]);
|
|
559
564
|
return /* @__PURE__ */ jsx5("div", {
|
|
560
565
|
ref,
|
|
561
566
|
style: actualStyle,
|
|
@@ -1523,9 +1528,6 @@ var useLazyComponent = ({
|
|
|
1523
1528
|
]);
|
|
1524
1529
|
const lazy = useMemo7(() => {
|
|
1525
1530
|
if ("component" in compProps) {
|
|
1526
|
-
if (typeof document === "undefined" || noSuspense) {
|
|
1527
|
-
return compProps.component;
|
|
1528
|
-
}
|
|
1529
1531
|
return Wrapper;
|
|
1530
1532
|
}
|
|
1531
1533
|
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
@@ -1536,6 +1538,9 @@ var useLazyComponent = ({
|
|
|
1536
1538
|
}
|
|
1537
1539
|
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
1538
1540
|
}, [lazyComponentFromProps, componentStore, Wrapper]);
|
|
1541
|
+
if ("component" in compProps && (typeof document === "undefined" || noSuspense)) {
|
|
1542
|
+
return compProps.component;
|
|
1543
|
+
}
|
|
1539
1544
|
return lazy;
|
|
1540
1545
|
};
|
|
1541
1546
|
|
|
@@ -1742,7 +1747,7 @@ var getStackForControls = (controls) => {
|
|
|
1742
1747
|
};
|
|
1743
1748
|
|
|
1744
1749
|
// src/version.ts
|
|
1745
|
-
var VERSION = "4.0.
|
|
1750
|
+
var VERSION = "4.0.539";
|
|
1746
1751
|
|
|
1747
1752
|
// src/multiple-versions-warning.ts
|
|
1748
1753
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1779,14 +1784,14 @@ var Null = () => {
|
|
|
1779
1784
|
};
|
|
1780
1785
|
|
|
1781
1786
|
// src/Sequence.tsx
|
|
1782
|
-
import
|
|
1787
|
+
import React27, {
|
|
1783
1788
|
createContext as createContext28,
|
|
1784
1789
|
forwardRef as forwardRef3,
|
|
1785
1790
|
useContext as useContext28,
|
|
1786
|
-
useLayoutEffect as
|
|
1787
|
-
useMemo as
|
|
1791
|
+
useLayoutEffect as useLayoutEffect9,
|
|
1792
|
+
useMemo as useMemo21,
|
|
1788
1793
|
useRef as useRef8,
|
|
1789
|
-
useState as
|
|
1794
|
+
useState as useState10
|
|
1790
1795
|
} from "react";
|
|
1791
1796
|
|
|
1792
1797
|
// src/DefaultPremountContext.ts
|
|
@@ -3909,13 +3914,13 @@ var useSequenceRegistration = ({
|
|
|
3909
3914
|
};
|
|
3910
3915
|
|
|
3911
3916
|
// src/with-interactivity-schema.ts
|
|
3912
|
-
import
|
|
3917
|
+
import React26, {
|
|
3913
3918
|
createContext as createContext27,
|
|
3914
3919
|
forwardRef as forwardRef2,
|
|
3915
3920
|
useContext as useContext27,
|
|
3916
|
-
useLayoutEffect as
|
|
3917
|
-
useMemo as
|
|
3918
|
-
useState as
|
|
3921
|
+
useLayoutEffect as useLayoutEffect8,
|
|
3922
|
+
useMemo as useMemo20,
|
|
3923
|
+
useState as useState9
|
|
3919
3924
|
} from "react";
|
|
3920
3925
|
|
|
3921
3926
|
// src/delete-nested-key.ts
|
|
@@ -3952,7 +3957,7 @@ var deleteNestedKey = (obj, keysToRemove) => {
|
|
|
3952
3957
|
};
|
|
3953
3958
|
|
|
3954
3959
|
// src/effects/use-memoized-effects.ts
|
|
3955
|
-
import
|
|
3960
|
+
import React25, { useContext as useContext26, useLayoutEffect as useLayoutEffect7, useMemo as useMemo19, useRef as useRef7 } from "react";
|
|
3956
3961
|
|
|
3957
3962
|
// src/evaluate-source-expressions.ts
|
|
3958
3963
|
var evaluateSourceNumericValue = (expression, config) => {
|
|
@@ -4560,6 +4565,20 @@ var interpolateSegment = ({
|
|
|
4560
4565
|
output
|
|
4561
4566
|
});
|
|
4562
4567
|
};
|
|
4568
|
+
var getInputForInterpolation = ({
|
|
4569
|
+
input,
|
|
4570
|
+
inputRange,
|
|
4571
|
+
options
|
|
4572
|
+
}) => {
|
|
4573
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
4574
|
+
const inputMin = inputRange[0];
|
|
4575
|
+
const inputMax = inputRange[inputRange.length - 1];
|
|
4576
|
+
if (inputRange.length === 1 || !(posterizedInput < inputMin && options?.extrapolateLeft === "wrap" || posterizedInput > inputMax && options?.extrapolateRight === "wrap")) {
|
|
4577
|
+
return posterizedInput;
|
|
4578
|
+
}
|
|
4579
|
+
const range = inputMax - inputMin;
|
|
4580
|
+
return ((posterizedInput - inputMin) % range + range) % range + inputMin;
|
|
4581
|
+
};
|
|
4563
4582
|
var interpolateNumber = ({
|
|
4564
4583
|
input,
|
|
4565
4584
|
inputRange,
|
|
@@ -4579,14 +4598,18 @@ var interpolateNumber = ({
|
|
|
4579
4598
|
if (options?.extrapolateRight !== undefined) {
|
|
4580
4599
|
extrapolateRight = options.extrapolateRight;
|
|
4581
4600
|
}
|
|
4582
|
-
const
|
|
4583
|
-
|
|
4601
|
+
const resolvedInput = getInputForInterpolation({
|
|
4602
|
+
input,
|
|
4603
|
+
inputRange,
|
|
4604
|
+
options: options ?? null
|
|
4605
|
+
});
|
|
4606
|
+
const range = findRange(resolvedInput, inputRange);
|
|
4584
4607
|
const easing = resolveEasingForSegment({
|
|
4585
4608
|
easing: easingOption,
|
|
4586
4609
|
segmentIndex: range
|
|
4587
4610
|
});
|
|
4588
4611
|
let result = interpolateSegment({
|
|
4589
|
-
input:
|
|
4612
|
+
input: resolvedInput,
|
|
4590
4613
|
inputRange: [inputRange[range], inputRange[range + 1]],
|
|
4591
4614
|
outputRange: [outputRange[range], outputRange[range + 1]],
|
|
4592
4615
|
easing,
|
|
@@ -4603,11 +4626,11 @@ var interpolateNumber = ({
|
|
|
4603
4626
|
continue;
|
|
4604
4627
|
}
|
|
4605
4628
|
const previousSegmentEnd = inputRange[segmentIndex + 1];
|
|
4606
|
-
if (
|
|
4629
|
+
if (resolvedInput <= previousSegmentEnd) {
|
|
4607
4630
|
continue;
|
|
4608
4631
|
}
|
|
4609
4632
|
const continuedSegmentValue = interpolateSegment({
|
|
4610
|
-
input:
|
|
4633
|
+
input: resolvedInput,
|
|
4611
4634
|
inputRange: [inputRange[segmentIndex], previousSegmentEnd],
|
|
4612
4635
|
outputRange: [outputRange[segmentIndex], outputRange[segmentIndex + 1]],
|
|
4613
4636
|
easing: previousEasing,
|
|
@@ -4628,8 +4651,12 @@ var interpolateString = ({
|
|
|
4628
4651
|
}) => {
|
|
4629
4652
|
const initiallyParsedOutputRange = outputRange.map((output) => parseStringInterpolationValue(output, outputType));
|
|
4630
4653
|
const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
|
|
4631
|
-
const
|
|
4632
|
-
|
|
4654
|
+
const resolvedInput = getInputForInterpolation({
|
|
4655
|
+
input,
|
|
4656
|
+
inputRange,
|
|
4657
|
+
options: options ?? null
|
|
4658
|
+
});
|
|
4659
|
+
const segmentIndex = inputRange.length === 1 ? 0 : findRange(resolvedInput, inputRange);
|
|
4633
4660
|
const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed, index) => {
|
|
4634
4661
|
if (parsed.kind !== "rotate") {
|
|
4635
4662
|
return parsed;
|
|
@@ -4753,31 +4780,24 @@ var interpolateDiscreteValue = ({
|
|
|
4753
4780
|
throw new TypeError(typeof outputRange[0] === "boolean" ? "Booleans can only be interpolated using Easing.step1" : "Non-numeric strings can only be interpolated using Easing.step1");
|
|
4754
4781
|
}
|
|
4755
4782
|
}
|
|
4756
|
-
const
|
|
4783
|
+
const resolvedInput = getInputForInterpolation({
|
|
4784
|
+
input,
|
|
4785
|
+
inputRange,
|
|
4786
|
+
options: options ?? null
|
|
4787
|
+
});
|
|
4757
4788
|
const inputMin = inputRange[0];
|
|
4758
4789
|
const inputMax = inputRange[inputRange.length - 1];
|
|
4759
|
-
let resolvedInput = posterizedInput;
|
|
4760
4790
|
if (resolvedInput < inputMin) {
|
|
4761
4791
|
if (options?.extrapolateLeft === "identity") {
|
|
4762
4792
|
throw new TypeError(typeof outputRange[0] === "boolean" ? 'extrapolateLeft: "identity" is not supported for booleans' : 'extrapolateLeft: "identity" is not supported for non-numeric strings');
|
|
4763
4793
|
}
|
|
4764
|
-
|
|
4765
|
-
const wrapRange = inputMax - inputMin;
|
|
4766
|
-
resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
|
|
4767
|
-
} else {
|
|
4768
|
-
return outputRange[0];
|
|
4769
|
-
}
|
|
4794
|
+
return outputRange[0];
|
|
4770
4795
|
}
|
|
4771
4796
|
if (resolvedInput > inputMax) {
|
|
4772
4797
|
if (options?.extrapolateRight === "identity") {
|
|
4773
4798
|
throw new TypeError(typeof outputRange[0] === "boolean" ? 'extrapolateRight: "identity" is not supported for booleans' : 'extrapolateRight: "identity" is not supported for non-numeric strings');
|
|
4774
4799
|
}
|
|
4775
|
-
|
|
4776
|
-
const wrapRange = inputMax - inputMin;
|
|
4777
|
-
resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
|
|
4778
|
-
} else {
|
|
4779
|
-
return outputRange[outputRange.length - 1];
|
|
4780
|
-
}
|
|
4800
|
+
return outputRange[outputRange.length - 1];
|
|
4781
4801
|
}
|
|
4782
4802
|
const range = findRange(resolvedInput, inputRange);
|
|
4783
4803
|
return resolvedInput >= inputRange[range + 1] ? outputRange[range + 1] : outputRange[range];
|
|
@@ -5254,7 +5274,7 @@ function spring({
|
|
|
5254
5274
|
frame: durationProcessed,
|
|
5255
5275
|
config
|
|
5256
5276
|
});
|
|
5257
|
-
const inner = config.overshootClamping ?
|
|
5277
|
+
const inner = config.overshootClamping ? Math.min(spr.current, 1) : spr.current;
|
|
5258
5278
|
const interpolated = from === 0 && to === 1 ? inner : interpolate(inner, [0, 1], [from, to]);
|
|
5259
5279
|
return interpolated;
|
|
5260
5280
|
}
|
|
@@ -5489,14 +5509,16 @@ function parseModernComponent(str, percentScale) {
|
|
|
5489
5509
|
function parseHueAngle(str) {
|
|
5490
5510
|
if (str === "none")
|
|
5491
5511
|
return 0;
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
if (str.endsWith("
|
|
5496
|
-
|
|
5497
|
-
if (str.endsWith("turn"))
|
|
5498
|
-
|
|
5499
|
-
|
|
5512
|
+
let degrees = Number.parseFloat(str);
|
|
5513
|
+
if (str.endsWith("grad")) {
|
|
5514
|
+
degrees *= 0.9;
|
|
5515
|
+
} else if (str.endsWith("rad")) {
|
|
5516
|
+
degrees = degrees * 180 / Math.PI;
|
|
5517
|
+
} else if (str.endsWith("turn")) {
|
|
5518
|
+
degrees *= 360;
|
|
5519
|
+
}
|
|
5520
|
+
const normalized = degrees % 360;
|
|
5521
|
+
return normalized < 0 ? (normalized + 360) % 360 : normalized;
|
|
5500
5522
|
}
|
|
5501
5523
|
function parseModernAlpha(str) {
|
|
5502
5524
|
if (str === undefined || str === "none")
|
|
@@ -6073,9 +6095,131 @@ var OverrideIdsToNodePathsSettersContext = createContext26({
|
|
|
6073
6095
|
}
|
|
6074
6096
|
});
|
|
6075
6097
|
|
|
6098
|
+
// src/effects/effect-source-observer.ts
|
|
6099
|
+
import React24, { useLayoutEffect as useLayoutEffect6, useMemo as useMemo18, useState as useState8 } from "react";
|
|
6100
|
+
var observers = new Map;
|
|
6101
|
+
var redrawListeners = new Map;
|
|
6102
|
+
var identities = new WeakMap;
|
|
6103
|
+
var inspectedChains = new WeakMap;
|
|
6104
|
+
var sourceChainOwners = new Map;
|
|
6105
|
+
var useIdentityCommitEffect = React24.useInsertionEffect ?? useLayoutEffect6;
|
|
6106
|
+
var subscribeToEffectSource = ({
|
|
6107
|
+
sequenceKey,
|
|
6108
|
+
effectIndex,
|
|
6109
|
+
onSource
|
|
6110
|
+
}) => {
|
|
6111
|
+
let sequence = observers.get(sequenceKey);
|
|
6112
|
+
if (!sequence) {
|
|
6113
|
+
sequence = new Map;
|
|
6114
|
+
observers.set(sequenceKey, sequence);
|
|
6115
|
+
}
|
|
6116
|
+
let listeners = sequence.get(effectIndex);
|
|
6117
|
+
if (!listeners) {
|
|
6118
|
+
listeners = new Set;
|
|
6119
|
+
sequence.set(effectIndex, listeners);
|
|
6120
|
+
}
|
|
6121
|
+
listeners.add(onSource);
|
|
6122
|
+
redrawListeners.get(sequenceKey)?.forEach((redraw) => redraw());
|
|
6123
|
+
return () => {
|
|
6124
|
+
listeners.delete(onSource);
|
|
6125
|
+
if (listeners.size === 0) {
|
|
6126
|
+
sequence.delete(effectIndex);
|
|
6127
|
+
}
|
|
6128
|
+
if (sequence.size === 0) {
|
|
6129
|
+
observers.delete(sequenceKey);
|
|
6130
|
+
}
|
|
6131
|
+
};
|
|
6132
|
+
};
|
|
6133
|
+
var publishEffectSource = (effect, source, chain) => {
|
|
6134
|
+
if (observers.size === 0) {
|
|
6135
|
+
return;
|
|
6136
|
+
}
|
|
6137
|
+
const identity = identities.get(effect);
|
|
6138
|
+
if (!identity) {
|
|
6139
|
+
return;
|
|
6140
|
+
}
|
|
6141
|
+
const listeners = observers.get(identity.sequenceKey)?.get(identity.effectIndex);
|
|
6142
|
+
if (!listeners || listeners.size === 0) {
|
|
6143
|
+
return;
|
|
6144
|
+
}
|
|
6145
|
+
let inspected = inspectedChains.get(chain);
|
|
6146
|
+
if (!inspected) {
|
|
6147
|
+
inspected = new Map;
|
|
6148
|
+
inspectedChains.set(chain, inspected);
|
|
6149
|
+
}
|
|
6150
|
+
const key = `${identity.sequenceKey}\x00${identity.effectIndex}`;
|
|
6151
|
+
inspected.set(key, identity);
|
|
6152
|
+
sourceChainOwners.set(key, chain);
|
|
6153
|
+
listeners.forEach((listener) => {
|
|
6154
|
+
try {
|
|
6155
|
+
listener(source);
|
|
6156
|
+
} catch {}
|
|
6157
|
+
});
|
|
6158
|
+
};
|
|
6159
|
+
var invalidateEffectChainSources = (chain) => {
|
|
6160
|
+
const inspected = inspectedChains.get(chain);
|
|
6161
|
+
inspectedChains.delete(chain);
|
|
6162
|
+
inspected?.forEach((identity, key) => {
|
|
6163
|
+
if (sourceChainOwners.get(key) !== chain) {
|
|
6164
|
+
return;
|
|
6165
|
+
}
|
|
6166
|
+
sourceChainOwners.delete(key);
|
|
6167
|
+
observers.get(identity.sequenceKey)?.get(identity.effectIndex)?.forEach((listener) => {
|
|
6168
|
+
try {
|
|
6169
|
+
listener(null);
|
|
6170
|
+
} catch {}
|
|
6171
|
+
});
|
|
6172
|
+
});
|
|
6173
|
+
};
|
|
6174
|
+
var useEffectSourceInspection = (effects, sequenceKey) => {
|
|
6175
|
+
const [revision, setRevision] = useState8(0);
|
|
6176
|
+
useLayoutEffect6(() => {
|
|
6177
|
+
if (sequenceKey === null) {
|
|
6178
|
+
return;
|
|
6179
|
+
}
|
|
6180
|
+
let listeners = redrawListeners.get(sequenceKey);
|
|
6181
|
+
if (!listeners) {
|
|
6182
|
+
listeners = new Set;
|
|
6183
|
+
redrawListeners.set(sequenceKey, listeners);
|
|
6184
|
+
}
|
|
6185
|
+
const redraw = () => setRevision((previous) => previous + 1);
|
|
6186
|
+
listeners.add(redraw);
|
|
6187
|
+
if (observers.has(sequenceKey)) {
|
|
6188
|
+
redraw();
|
|
6189
|
+
}
|
|
6190
|
+
return () => {
|
|
6191
|
+
listeners.delete(redraw);
|
|
6192
|
+
if (listeners.size === 0) {
|
|
6193
|
+
redrawListeners.delete(sequenceKey);
|
|
6194
|
+
observers.get(sequenceKey)?.forEach((sourceListeners) => {
|
|
6195
|
+
sourceListeners.forEach((listener) => {
|
|
6196
|
+
try {
|
|
6197
|
+
listener(null);
|
|
6198
|
+
} catch {}
|
|
6199
|
+
});
|
|
6200
|
+
});
|
|
6201
|
+
}
|
|
6202
|
+
};
|
|
6203
|
+
}, [sequenceKey]);
|
|
6204
|
+
useIdentityCommitEffect(() => {
|
|
6205
|
+
if (sequenceKey === null) {
|
|
6206
|
+
return;
|
|
6207
|
+
}
|
|
6208
|
+
effects.forEach((effect, effectIndex) => {
|
|
6209
|
+
identities.set(effect, { sequenceKey, effectIndex });
|
|
6210
|
+
});
|
|
6211
|
+
return () => {
|
|
6212
|
+
effects.forEach((effect) => identities.delete(effect));
|
|
6213
|
+
};
|
|
6214
|
+
}, [effects, sequenceKey]);
|
|
6215
|
+
return useMemo18(() => {
|
|
6216
|
+
return sequenceKey === null || revision === 0 ? effects : effects.slice();
|
|
6217
|
+
}, [effects, revision, sequenceKey]);
|
|
6218
|
+
};
|
|
6219
|
+
|
|
6076
6220
|
// src/effects/use-memoized-effects.ts
|
|
6077
6221
|
var emptyDragOverrides2 = {};
|
|
6078
|
-
var useCacheCommitEffect =
|
|
6222
|
+
var useCacheCommitEffect = React25.useInsertionEffect ?? useLayoutEffect7;
|
|
6079
6223
|
var areEffectParamsEqual = (previous, next) => {
|
|
6080
6224
|
if (Object.is(previous, next)) {
|
|
6081
6225
|
return true;
|
|
@@ -6181,7 +6325,7 @@ var useMemoizedEffectDefinitions = (effects) => {
|
|
|
6181
6325
|
cancelled = true;
|
|
6182
6326
|
};
|
|
6183
6327
|
}, [activityDormant, controllers, effects, stableDefinitions]);
|
|
6184
|
-
|
|
6328
|
+
useLayoutEffect7(() => {
|
|
6185
6329
|
stableDefinitions.forEach((_definition, index) => {
|
|
6186
6330
|
const snapshot = effects[index]?.params;
|
|
6187
6331
|
if (!areEffectParamsEqual(controllers[index].store.getSnapshot(), snapshot)) {
|
|
@@ -6243,12 +6387,13 @@ var useMemoizedEffects = ({
|
|
|
6243
6387
|
videoConfigValues
|
|
6244
6388
|
}) => {
|
|
6245
6389
|
const previousRef = useRef7(null);
|
|
6390
|
+
const { isStudio } = useRemotionEnvironment();
|
|
6246
6391
|
const { overrideIdToNodePathMappings } = useContext26(OverrideIdsToNodePathsGettersContext);
|
|
6247
6392
|
const previous = previousRef.current;
|
|
6248
6393
|
const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
|
|
6249
6394
|
const effectDragOverrides = useEffectDragOverridesForNodePath(nodePath);
|
|
6250
6395
|
const sequenceStatus = usePropStatusForNodePath(nodePath);
|
|
6251
|
-
const effectPropStatuses =
|
|
6396
|
+
const effectPropStatuses = useMemo19(() => Array.from({ length: effects.length }, (_, effectIndex) => {
|
|
6252
6397
|
if (nodePath === null) {
|
|
6253
6398
|
return null;
|
|
6254
6399
|
}
|
|
@@ -6259,7 +6404,7 @@ var useMemoizedEffects = ({
|
|
|
6259
6404
|
});
|
|
6260
6405
|
return status.type === "can-update-effect" ? status.props : null;
|
|
6261
6406
|
}), [effects.length, nodePath, sequenceStatus, videoConfigValues]);
|
|
6262
|
-
const animatedEffects =
|
|
6407
|
+
const animatedEffects = useMemo19(() => effectPropStatuses.map((status, index) => Object.values(status ?? {}).some((prop) => prop.status === "keyframed") || Object.values(effectDragOverrides[index] ?? emptyDragOverrides2).some((override) => override.type === "keyframed")), [effectDragOverrides, effectPropStatuses]);
|
|
6263
6408
|
const frame = useCurrentFrameWithOptionalSubscription(animatedEffects.some(Boolean));
|
|
6264
6409
|
const prepared = effects.map((descriptor, index) => {
|
|
6265
6410
|
const propStatus = effectPropStatuses[index];
|
|
@@ -6297,7 +6442,7 @@ var useMemoizedEffects = ({
|
|
|
6297
6442
|
useCacheCommitEffect(() => {
|
|
6298
6443
|
previousRef.current = { prepared, effects: next };
|
|
6299
6444
|
}, [next, prepared]);
|
|
6300
|
-
return next;
|
|
6445
|
+
return useEffectSourceInspection(next, isStudio && nodePath !== null ? makeSequencePropsSubscriptionKey({ ...nodePath, videoConfigValues }) : null);
|
|
6301
6446
|
};
|
|
6302
6447
|
|
|
6303
6448
|
// src/flatten-schema.ts
|
|
@@ -6699,11 +6844,11 @@ var mergeValues = ({
|
|
|
6699
6844
|
};
|
|
6700
6845
|
var DisableInteractivityContext = createContext27(false);
|
|
6701
6846
|
var DisableInteractivityProvider = ({ children }) => {
|
|
6702
|
-
return
|
|
6847
|
+
return React26.createElement(DisableInteractivityContext.Provider, { value: true }, children);
|
|
6703
6848
|
};
|
|
6704
6849
|
var EnableInteractivityContext = createContext27(false);
|
|
6705
6850
|
var EnableInteractivityProvider = ({ children }) => {
|
|
6706
|
-
return
|
|
6851
|
+
return React26.createElement(EnableInteractivityContext.Provider, { value: true }, children);
|
|
6707
6852
|
};
|
|
6708
6853
|
var withInteractivitySchema = ({
|
|
6709
6854
|
Component,
|
|
@@ -6728,7 +6873,7 @@ var withInteractivitySchema = ({
|
|
|
6728
6873
|
const disableInteractivity = useContext27(DisableInteractivityContext);
|
|
6729
6874
|
const enableInteractivity = useContext27(EnableInteractivityContext);
|
|
6730
6875
|
if (!env.isStudio && !enableInteractivity || env.isRendering || !canUseRemotionHooks || disableInteractivity) {
|
|
6731
|
-
return
|
|
6876
|
+
return React26.createElement(Component, {
|
|
6732
6877
|
...cleanProps,
|
|
6733
6878
|
controls: null,
|
|
6734
6879
|
ref
|
|
@@ -6740,14 +6885,14 @@ var withInteractivitySchema = ({
|
|
|
6740
6885
|
const fps = videoConfig?.fps;
|
|
6741
6886
|
const height = videoConfig?.height;
|
|
6742
6887
|
const width = videoConfig?.width;
|
|
6743
|
-
const videoConfigValues =
|
|
6888
|
+
const videoConfigValues = useMemo20(() => durationInFrames === undefined || fps === undefined || height === undefined || width === undefined ? null : {
|
|
6744
6889
|
durationInFrames,
|
|
6745
6890
|
fps,
|
|
6746
6891
|
height,
|
|
6747
6892
|
width
|
|
6748
6893
|
}, [durationInFrames, fps, height, width]);
|
|
6749
6894
|
const passedControls = cleanProps.controls;
|
|
6750
|
-
const resolvedPassedControls =
|
|
6895
|
+
const resolvedPassedControls = useMemo20(() => {
|
|
6751
6896
|
if (!passedControls || getStackForControls(passedControls) !== null || internalStack === undefined) {
|
|
6752
6897
|
return passedControls;
|
|
6753
6898
|
}
|
|
@@ -6756,13 +6901,13 @@ var withInteractivitySchema = ({
|
|
|
6756
6901
|
return controlsWithStack;
|
|
6757
6902
|
}, [internalStack, passedControls]);
|
|
6758
6903
|
if (resolvedPassedControls) {
|
|
6759
|
-
return
|
|
6904
|
+
return React26.createElement(Component, {
|
|
6760
6905
|
...cleanProps,
|
|
6761
6906
|
controls: resolvedPassedControls,
|
|
6762
6907
|
ref
|
|
6763
6908
|
});
|
|
6764
6909
|
}
|
|
6765
|
-
const [overrideId] =
|
|
6910
|
+
const [overrideId] = useState9(() => {
|
|
6766
6911
|
if (!internalStack) {
|
|
6767
6912
|
return String(Math.random());
|
|
6768
6913
|
}
|
|
@@ -6777,7 +6922,7 @@ var withInteractivitySchema = ({
|
|
|
6777
6922
|
const nodePath = env.isReadOnlyStudio ? null : nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
|
|
6778
6923
|
const dragOverrides = useDragOverridesForNodePath(nodePath);
|
|
6779
6924
|
const sequenceStatus = usePropStatusForNodePath(nodePath);
|
|
6780
|
-
const propStatus =
|
|
6925
|
+
const propStatus = useMemo20(() => getPropStatusesForSequenceStatus(sequenceStatus, videoConfigValues), [sequenceStatus, videoConfigValues]);
|
|
6781
6926
|
const needsFrame = flatKeys.some((key) => propStatus?.[key]?.status === "keyframed" || dragOverrides[key]?.type === "keyframed");
|
|
6782
6927
|
const frame = useCurrentFrameWithOptionalSubscription(needsFrame);
|
|
6783
6928
|
const runtimeValues = flatKeys.map((key) => getRuntimeValueForSchemaKey({
|
|
@@ -6785,12 +6930,12 @@ var withInteractivitySchema = ({
|
|
|
6785
6930
|
key,
|
|
6786
6931
|
props: cleanProps
|
|
6787
6932
|
}));
|
|
6788
|
-
const currentRuntimeValueDotNotation =
|
|
6789
|
-
const [runtimeValueStore] =
|
|
6790
|
-
|
|
6933
|
+
const currentRuntimeValueDotNotation = useMemo20(() => readValuesFromProps(cleanProps, flatKeys, flatSchema), runtimeValues);
|
|
6934
|
+
const [runtimeValueStore] = useState9(() => createRuntimeValueStore(currentRuntimeValueDotNotation));
|
|
6935
|
+
useLayoutEffect8(() => {
|
|
6791
6936
|
runtimeValueStore.setSnapshot(currentRuntimeValueDotNotation);
|
|
6792
6937
|
}, [currentRuntimeValueDotNotation, runtimeValueStore]);
|
|
6793
|
-
const controls =
|
|
6938
|
+
const controls = useMemo20(() => {
|
|
6794
6939
|
const controlsForRender = {
|
|
6795
6940
|
schema: schemaWithSequenceName,
|
|
6796
6941
|
currentRuntimeValueDotNotation,
|
|
@@ -6810,10 +6955,10 @@ var withInteractivitySchema = ({
|
|
|
6810
6955
|
runtimeValueStore.store,
|
|
6811
6956
|
videoConfigValues
|
|
6812
6957
|
]);
|
|
6813
|
-
|
|
6958
|
+
useLayoutEffect8(() => {
|
|
6814
6959
|
OptimisticSequenceDeletion.register(internalStack ?? null, nodePath);
|
|
6815
6960
|
}, [internalStack, nodePath]);
|
|
6816
|
-
const { merged: valuesDotNotation, propsToDelete } =
|
|
6961
|
+
const { merged: valuesDotNotation, propsToDelete } = useMemo20(() => {
|
|
6817
6962
|
return computeEffectiveSchemaValuesDotNotation({
|
|
6818
6963
|
schema: schemaWithSequenceName,
|
|
6819
6964
|
currentValue: currentRuntimeValueDotNotation,
|
|
@@ -6833,7 +6978,7 @@ var withInteractivitySchema = ({
|
|
|
6833
6978
|
if (OptimisticSequenceDeletion.isDeleted(nodePath, pendingDeletions)) {
|
|
6834
6979
|
return null;
|
|
6835
6980
|
}
|
|
6836
|
-
return
|
|
6981
|
+
return React26.createElement(Component, {
|
|
6837
6982
|
...mergedProps,
|
|
6838
6983
|
controls,
|
|
6839
6984
|
ref
|
|
@@ -6895,7 +7040,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6895
7040
|
...other
|
|
6896
7041
|
}, ref) => {
|
|
6897
7042
|
const { layout = "absolute-fill" } = other;
|
|
6898
|
-
const [id] =
|
|
7043
|
+
const [id] = useState10(() => String(Math.random()));
|
|
6899
7044
|
const parentSequence = useContext28(SequenceContext);
|
|
6900
7045
|
const activityRequested = useContext28(SequenceActivityContext);
|
|
6901
7046
|
const parentDormant = useContext28(SequenceActivityDormantContext);
|
|
@@ -6979,7 +7124,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6979
7124
|
if (lastPlaybackRate.current.frame !== absoluteFrame && lastPlaybackRate.current.playbackRate !== playbackRate) {
|
|
6980
7125
|
throw new Error('The "playbackRate" prop of <Sequence /> must be constant. Animating playbackRate is not supported.');
|
|
6981
7126
|
}
|
|
6982
|
-
|
|
7127
|
+
useLayoutEffect9(() => {
|
|
6983
7128
|
lastPlaybackRate.current = { playbackRate, frame: absoluteFrame };
|
|
6984
7129
|
}, [absoluteFrame, playbackRate]);
|
|
6985
7130
|
const videoConfig = useVideoConfig();
|
|
@@ -7010,13 +7155,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7010
7155
|
const sequenceRegistrationEnabled = useContext28(SequenceRegistrationContext);
|
|
7011
7156
|
const canvasOutlinesEnabled = useContext28(SequenceOutlineContext);
|
|
7012
7157
|
const shouldDiscoverOutline = env.isStudio || canvasOutlinesEnabled;
|
|
7013
|
-
const automaticOutlineRef =
|
|
7158
|
+
const automaticOutlineRef = useMemo21(() => shouldDiscoverOutline && layout === "none" ? SequenceOutlineInternals.createRef() : null, [shouldDiscoverOutline, layout]);
|
|
7014
7159
|
const wrapperRefForOutline = useRef8(null);
|
|
7015
7160
|
const refForOutline = layout === "none" ? automaticOutlineRef : wrapperRefForOutline;
|
|
7016
|
-
const premounting =
|
|
7161
|
+
const premounting = useMemo21(() => {
|
|
7017
7162
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
7018
7163
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
7019
|
-
const postmounting =
|
|
7164
|
+
const postmounting = useMemo21(() => {
|
|
7020
7165
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
7021
7166
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
7022
7167
|
const currentSequenceStart = cumulatedFrom + relativeFrom;
|
|
@@ -7024,7 +7169,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7024
7169
|
const parentFirstFrame = parentSequence ? parentSequenceStart - parentSequence.cumulatedNegativeFrom / parentPlaybackRate : 0;
|
|
7025
7170
|
const firstFrame = Math.max(0, parentFirstFrame, cumulatedFrom + clockFrom / parentPlaybackRate);
|
|
7026
7171
|
const cumulatedNegativeFrom = (currentSequenceStart - firstFrame) * cumulativePlaybackRate;
|
|
7027
|
-
const contextValue =
|
|
7172
|
+
const contextValue = useMemo21(() => {
|
|
7028
7173
|
return {
|
|
7029
7174
|
playbackRate: cumulativePlaybackRate,
|
|
7030
7175
|
absoluteFrom,
|
|
@@ -7057,7 +7202,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7057
7202
|
postmountDisplay,
|
|
7058
7203
|
cumulatedNegativeFrom
|
|
7059
7204
|
]);
|
|
7060
|
-
const loopContextValue =
|
|
7205
|
+
const loopContextValue = useMemo21(() => {
|
|
7061
7206
|
if (loopPeriod === null) {
|
|
7062
7207
|
return null;
|
|
7063
7208
|
}
|
|
@@ -7066,7 +7211,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7066
7211
|
durationInFrames: contentDurationInFrames
|
|
7067
7212
|
};
|
|
7068
7213
|
}, [contentDurationInFrames, loopIteration, loopPeriod]);
|
|
7069
|
-
const resolvedLoopDisplay =
|
|
7214
|
+
const resolvedLoopDisplay = useMemo21(() => {
|
|
7070
7215
|
if (loopDisplay || loopPeriod === null) {
|
|
7071
7216
|
return loopDisplay;
|
|
7072
7217
|
}
|
|
@@ -7076,21 +7221,21 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7076
7221
|
durationInFrames: loopPeriod
|
|
7077
7222
|
};
|
|
7078
7223
|
}, [actualDurationInFrames, loopDisplay, loopPeriod]);
|
|
7079
|
-
const timelineClipName =
|
|
7224
|
+
const timelineClipName = useMemo21(() => {
|
|
7080
7225
|
return name ?? "";
|
|
7081
7226
|
}, [name]);
|
|
7082
7227
|
const resolvedDocumentationLink = documentationLink ?? "https://www.remotion.dev/docs/sequence";
|
|
7083
7228
|
const isInsideSeries = useContext28(IsInsideSeriesContext);
|
|
7084
|
-
const singleChildComponent =
|
|
7229
|
+
const singleChildComponent = useMemo21(() => childComponentOverride === undefined ? getSingleChildComponent(children) : childComponentOverride, [children, childComponentOverride]);
|
|
7085
7230
|
const registrationStack = controls ? getStackForControls(controls) ?? stack ?? null : stack ?? null;
|
|
7086
|
-
const getStack =
|
|
7231
|
+
const getStack = useMemo21(() => getSequenceStack.bind(null, registrationStack), [registrationStack]);
|
|
7087
7232
|
const registeredFrozenFrame = typeof freeze === "number" ? freeze : null;
|
|
7088
7233
|
const currentFrame = registeredFrozenFrame ?? (absoluteFrame - currentSequenceStart) * cumulativePlaybackRate;
|
|
7089
7234
|
const currentFrameRef = useRef8(currentFrame);
|
|
7090
|
-
|
|
7235
|
+
useLayoutEffect9(() => {
|
|
7091
7236
|
currentFrameRef.current = currentFrame;
|
|
7092
7237
|
}, [currentFrame]);
|
|
7093
|
-
const getCurrentFrame =
|
|
7238
|
+
const getCurrentFrame = useMemo21(() => getSequenceCurrentFrame.bind(null, currentFrameRef), [currentFrameRef]);
|
|
7094
7239
|
const registeredTrimBefore = trimBefore === 0 ? null : trimBefore;
|
|
7095
7240
|
const parentCumulatedNegativeFrom = parentSequence?.cumulatedNegativeFrom ?? 0;
|
|
7096
7241
|
const startMediaFrom = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom - cumulatedNegativeFrom : null;
|
|
@@ -7108,8 +7253,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7108
7253
|
const autoDuration = canInferDuration && durationInFrames === undefined;
|
|
7109
7254
|
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";
|
|
7110
7255
|
const seriesContentVisible = useContext28(SeriesContentVisibilityContext);
|
|
7111
|
-
const effectRuntimeValues =
|
|
7112
|
-
const registrationControls =
|
|
7256
|
+
const effectRuntimeValues = useMemo21(() => _remotionInternalEffects?.runtimeValues ?? null, [_remotionInternalEffects]);
|
|
7257
|
+
const registrationControls = useMemo21(() => {
|
|
7113
7258
|
if (controlsSchema === undefined || controlsRuntimeValues === undefined || controlsOverrideId === undefined || controlsSupportsEffects === undefined || controlsComponentIdentity === undefined || controlsComponentName === undefined || controlsVideoConfigValues === undefined) {
|
|
7114
7259
|
return null;
|
|
7115
7260
|
}
|
|
@@ -7131,7 +7276,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7131
7276
|
controlsSchema,
|
|
7132
7277
|
controlsSupportsEffects
|
|
7133
7278
|
]);
|
|
7134
|
-
const sequenceForRegistration =
|
|
7279
|
+
const sequenceForRegistration = useMemo21(() => {
|
|
7135
7280
|
const trackRegistration = timelineTrack ? {
|
|
7136
7281
|
timelineTrack: {
|
|
7137
7282
|
...timelineTrack,
|
|
@@ -7265,7 +7410,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7265
7410
|
frozenMediaFrame,
|
|
7266
7411
|
singleChildComponent
|
|
7267
7412
|
]);
|
|
7268
|
-
const getSequenceForRegistration =
|
|
7413
|
+
const getSequenceForRegistration = useMemo21(() => getSequenceRegistration.bind(null, sequenceForRegistration), [sequenceForRegistration]);
|
|
7269
7414
|
const registration = useSequenceRegistration({
|
|
7270
7415
|
getSequence: env.isStudio || sequenceRegistrationEnabled ? getSequenceForRegistration : null,
|
|
7271
7416
|
id
|
|
@@ -7288,7 +7433,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7288
7433
|
end: cumulatedFrom + (from + actualDurationInFrames) / parentPlaybackRate
|
|
7289
7434
|
} : null);
|
|
7290
7435
|
const renderActivity = activityEnabled && (!activityDormant || admitted || activitySuspended && hadActivity.current);
|
|
7291
|
-
const useCommitEffect =
|
|
7436
|
+
const useCommitEffect = React27.useInsertionEffect ?? useLayoutEffect9;
|
|
7292
7437
|
useCommitEffect(() => {
|
|
7293
7438
|
hadActivity.current = renderActivity;
|
|
7294
7439
|
}, [renderActivity]);
|
|
@@ -7309,8 +7454,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7309
7454
|
bottom: resolvedCropBottom,
|
|
7310
7455
|
style: styleIfThere
|
|
7311
7456
|
});
|
|
7312
|
-
const sequenceRef =
|
|
7313
|
-
const defaultStyle =
|
|
7457
|
+
const sequenceRef = useMemo21(() => setSequenceWrapperRef.bind(null, ref, wrapperRefForOutline), [ref, wrapperRefForOutline]);
|
|
7458
|
+
const defaultStyle = useMemo21(() => {
|
|
7314
7459
|
return {
|
|
7315
7460
|
flexDirection: undefined,
|
|
7316
7461
|
...width ? { width } : {},
|
|
@@ -7324,7 +7469,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7324
7469
|
if (ref !== null && layout === "none") {
|
|
7325
7470
|
throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
|
|
7326
7471
|
}
|
|
7327
|
-
const metadata =
|
|
7472
|
+
const metadata = useMemo21(() => shouldDiscoverOutline || registration !== null ? {
|
|
7328
7473
|
type: "sequence",
|
|
7329
7474
|
id,
|
|
7330
7475
|
value: registration,
|
|
@@ -7613,13 +7758,13 @@ addSequenceStackTraces(AbsoluteFill);
|
|
|
7613
7758
|
import {
|
|
7614
7759
|
forwardRef as forwardRef4,
|
|
7615
7760
|
useImperativeHandle as useImperativeHandle2,
|
|
7616
|
-
useLayoutEffect as
|
|
7761
|
+
useLayoutEffect as useLayoutEffect10,
|
|
7617
7762
|
useRef as useRef11,
|
|
7618
|
-
useState as
|
|
7763
|
+
useState as useState11
|
|
7619
7764
|
} from "react";
|
|
7620
7765
|
|
|
7621
7766
|
// src/use-crop-style.ts
|
|
7622
|
-
import { useMemo as
|
|
7767
|
+
import { useMemo as useMemo22 } from "react";
|
|
7623
7768
|
var useCropStyle = ({
|
|
7624
7769
|
cropLeft,
|
|
7625
7770
|
cropRight,
|
|
@@ -7629,7 +7774,7 @@ var useCropStyle = ({
|
|
|
7629
7774
|
componentName
|
|
7630
7775
|
}) => {
|
|
7631
7776
|
validateSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }, componentName);
|
|
7632
|
-
return
|
|
7777
|
+
return useMemo22(() => {
|
|
7633
7778
|
const cropClipPath = getSequenceCropClipPath({
|
|
7634
7779
|
...resolveSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }),
|
|
7635
7780
|
style
|
|
@@ -7642,7 +7787,7 @@ var useCropStyle = ({
|
|
|
7642
7787
|
};
|
|
7643
7788
|
|
|
7644
7789
|
// src/animated-image/canvas.tsx
|
|
7645
|
-
import
|
|
7790
|
+
import React29, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo24, useRef as useRef10 } from "react";
|
|
7646
7791
|
|
|
7647
7792
|
// src/calculate-image-fit.ts
|
|
7648
7793
|
var calculateImageFit = (fit, imageSize, canvasSize) => {
|
|
@@ -7873,6 +8018,7 @@ var createEffectChainState = (width, height) => {
|
|
|
7873
8018
|
};
|
|
7874
8019
|
var cleanupEffectChainState = (state) => {
|
|
7875
8020
|
state.currentRunId++;
|
|
8021
|
+
invalidateEffectChainSources(state);
|
|
7876
8022
|
try {
|
|
7877
8023
|
for (const entry of state.cleanupRegistry) {
|
|
7878
8024
|
entry.definition.cleanup(entry.state);
|
|
@@ -7939,6 +8085,7 @@ var runEffectChainWithoutResize = async ({ state, source, effects, output, width
|
|
|
7939
8085
|
state.pool.assertContextNotLost(dst);
|
|
7940
8086
|
}
|
|
7941
8087
|
const setupState = ensureSetup(state, def, dst);
|
|
8088
|
+
publishEffectSource(eff, currentImage, state);
|
|
7942
8089
|
def.apply({
|
|
7943
8090
|
source: currentImage,
|
|
7944
8091
|
target: dst,
|
|
@@ -8012,7 +8159,7 @@ var runEffectChain = async (options) => {
|
|
|
8012
8159
|
};
|
|
8013
8160
|
|
|
8014
8161
|
// src/effects/use-effect-chain-state.ts
|
|
8015
|
-
import { useEffect as useEffect7, useMemo as
|
|
8162
|
+
import { useEffect as useEffect7, useMemo as useMemo23, useRef as useRef9 } from "react";
|
|
8016
8163
|
var useEffectChainState = (effectsOutputSize = null) => {
|
|
8017
8164
|
const effectWidth = effectsOutputSize?.width;
|
|
8018
8165
|
const effectHeight = effectsOutputSize?.height;
|
|
@@ -8034,7 +8181,7 @@ var useEffectChainState = (effectsOutputSize = null) => {
|
|
|
8034
8181
|
}
|
|
8035
8182
|
};
|
|
8036
8183
|
}, []);
|
|
8037
|
-
return
|
|
8184
|
+
return useMemo23(() => ({
|
|
8038
8185
|
get: (width, height) => {
|
|
8039
8186
|
width = effectWidth ?? width;
|
|
8040
8187
|
height = effectHeight ?? height;
|
|
@@ -8058,7 +8205,7 @@ import { jsx as jsx19 } from "react/jsx-runtime";
|
|
|
8058
8205
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, effectsOutputSize, ...props }, ref) => {
|
|
8059
8206
|
const canvasRef = useRef10(null);
|
|
8060
8207
|
const chainState = useEffectChainState(effectsOutputSize);
|
|
8061
|
-
const sourceCanvas =
|
|
8208
|
+
const sourceCanvas = useMemo24(() => {
|
|
8062
8209
|
if (typeof document === "undefined") {
|
|
8063
8210
|
return null;
|
|
8064
8211
|
}
|
|
@@ -8123,7 +8270,7 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
|
|
|
8123
8270
|
...props
|
|
8124
8271
|
});
|
|
8125
8272
|
};
|
|
8126
|
-
var Canvas =
|
|
8273
|
+
var Canvas = React29.forwardRef(CanvasRefForwardingFunction);
|
|
8127
8274
|
|
|
8128
8275
|
// src/animated-image/create-image-decoder.ts
|
|
8129
8276
|
var createImageDecoder = async ({
|
|
@@ -8213,6 +8360,7 @@ var decodeImage = async ({
|
|
|
8213
8360
|
continue;
|
|
8214
8361
|
}
|
|
8215
8362
|
const item = sortByClosestToCurrentTime[i];
|
|
8363
|
+
item.frame?.close();
|
|
8216
8364
|
item.frame = null;
|
|
8217
8365
|
}
|
|
8218
8366
|
};
|
|
@@ -8399,7 +8547,7 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8399
8547
|
...props
|
|
8400
8548
|
}, canvasRef) => {
|
|
8401
8549
|
const resolvedSrc = resolveAnimatedImageSource(src);
|
|
8402
|
-
const [decodedImage, setDecodedImage] =
|
|
8550
|
+
const [decodedImage, setDecodedImage] = useState11(null);
|
|
8403
8551
|
const imageDecoder = decodedImage?.decoder ?? null;
|
|
8404
8552
|
const activeDecoderRef = useRef11(null);
|
|
8405
8553
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
@@ -8424,8 +8572,8 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8424
8572
|
}
|
|
8425
8573
|
return c;
|
|
8426
8574
|
}, []);
|
|
8427
|
-
const [initialLoopBehavior] =
|
|
8428
|
-
|
|
8575
|
+
const [initialLoopBehavior] = useState11(() => loopBehavior);
|
|
8576
|
+
useLayoutEffect10(() => {
|
|
8429
8577
|
const decodeHandle = delayRender(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`);
|
|
8430
8578
|
const controller = new AbortController;
|
|
8431
8579
|
let cancelled = false;
|
|
@@ -8483,7 +8631,7 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8483
8631
|
delayRender,
|
|
8484
8632
|
cancelRender
|
|
8485
8633
|
]);
|
|
8486
|
-
|
|
8634
|
+
useLayoutEffect10(() => {
|
|
8487
8635
|
if (!imageDecoder || !decodedImage || activeDecoderRef.current !== imageDecoder) {
|
|
8488
8636
|
return;
|
|
8489
8637
|
}
|
|
@@ -8661,9 +8809,9 @@ var AnimatedImageWithIntrinsicDuration = (props) => {
|
|
|
8661
8809
|
requestInitRef.current = requestInit;
|
|
8662
8810
|
const onErrorRef = useRef11(props.onError);
|
|
8663
8811
|
onErrorRef.current = props.onError;
|
|
8664
|
-
const [duration, setDuration] =
|
|
8665
|
-
const [failedHandle, setFailedHandle] =
|
|
8666
|
-
|
|
8812
|
+
const [duration, setDuration] = useState11(null);
|
|
8813
|
+
const [failedHandle, setFailedHandle] = useState11(null);
|
|
8814
|
+
useLayoutEffect10(() => {
|
|
8667
8815
|
const handle = delayRender(`Finding duration of <AnimatedImage src="${src}" />`);
|
|
8668
8816
|
const controller = new AbortController;
|
|
8669
8817
|
let cancelled = false;
|
|
@@ -8696,7 +8844,7 @@ var AnimatedImageWithIntrinsicDuration = (props) => {
|
|
|
8696
8844
|
continueRender(handle);
|
|
8697
8845
|
};
|
|
8698
8846
|
}, [cancelRender, continueRender, delayRender, fps, src, trimBefore]);
|
|
8699
|
-
|
|
8847
|
+
useLayoutEffect10(() => {
|
|
8700
8848
|
if (duration !== null) {
|
|
8701
8849
|
continueRender(duration.handle);
|
|
8702
8850
|
}
|
|
@@ -8766,17 +8914,17 @@ var createEffect = (definition) => {
|
|
|
8766
8914
|
return factory;
|
|
8767
8915
|
};
|
|
8768
8916
|
// src/Artifact.tsx
|
|
8769
|
-
import { useContext as useContext29, useLayoutEffect as
|
|
8917
|
+
import { useContext as useContext29, useLayoutEffect as useLayoutEffect12, useState as useState13 } from "react";
|
|
8770
8918
|
|
|
8771
8919
|
// src/RenderAssetManager.tsx
|
|
8772
8920
|
import {
|
|
8773
8921
|
createContext as createContext29,
|
|
8774
8922
|
useCallback as useCallback8,
|
|
8775
8923
|
useImperativeHandle as useImperativeHandle3,
|
|
8776
|
-
useLayoutEffect as
|
|
8777
|
-
useMemo as
|
|
8924
|
+
useLayoutEffect as useLayoutEffect11,
|
|
8925
|
+
useMemo as useMemo25,
|
|
8778
8926
|
useRef as useRef12,
|
|
8779
|
-
useState as
|
|
8927
|
+
useState as useState12
|
|
8780
8928
|
} from "react";
|
|
8781
8929
|
|
|
8782
8930
|
// src/validation/validate-artifact.ts
|
|
@@ -8822,7 +8970,7 @@ var RenderAssetManager = createContext29({
|
|
|
8822
8970
|
renderAssets: []
|
|
8823
8971
|
});
|
|
8824
8972
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
8825
|
-
const [renderAssets, setRenderAssets] =
|
|
8973
|
+
const [renderAssets, setRenderAssets] = useState12([]);
|
|
8826
8974
|
const renderAssetsRef = useRef12([]);
|
|
8827
8975
|
const registerRenderAsset = useCallback8((renderAsset) => {
|
|
8828
8976
|
validateRenderAsset(renderAsset);
|
|
@@ -8845,7 +8993,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
8845
8993
|
renderAssetsRef.current = renderAssetsRef.current.filter((a) => a.id !== id);
|
|
8846
8994
|
setRenderAssets(renderAssetsRef.current);
|
|
8847
8995
|
}, []);
|
|
8848
|
-
|
|
8996
|
+
useLayoutEffect11(() => {
|
|
8849
8997
|
if (typeof window !== "undefined") {
|
|
8850
8998
|
window.remotion_collectAssets = () => {
|
|
8851
8999
|
const assets = renderAssetsRef.current;
|
|
@@ -8855,7 +9003,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
8855
9003
|
};
|
|
8856
9004
|
}
|
|
8857
9005
|
}, []);
|
|
8858
|
-
const contextValue =
|
|
9006
|
+
const contextValue = useMemo25(() => {
|
|
8859
9007
|
return {
|
|
8860
9008
|
registerRenderAsset,
|
|
8861
9009
|
unregisterRenderAsset,
|
|
@@ -8874,10 +9022,10 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
8874
9022
|
const { registerRenderAsset, unregisterRenderAsset } = useContext29(RenderAssetManager);
|
|
8875
9023
|
const env = useRemotionEnvironment();
|
|
8876
9024
|
const frame = useCurrentFrame();
|
|
8877
|
-
const [id] =
|
|
9025
|
+
const [id] = useState13(() => {
|
|
8878
9026
|
return String(Math.random());
|
|
8879
9027
|
});
|
|
8880
|
-
|
|
9028
|
+
useLayoutEffect12(() => {
|
|
8881
9029
|
if (!env.isRendering) {
|
|
8882
9030
|
return;
|
|
8883
9031
|
}
|
|
@@ -8928,7 +9076,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
8928
9076
|
};
|
|
8929
9077
|
Artifact.Thumbnail = ArtifactThumbnail;
|
|
8930
9078
|
// src/audio/html5-audio.tsx
|
|
8931
|
-
import { forwardRef as forwardRef7, useCallback as useCallback15, useContext as useContext44, useMemo as
|
|
9079
|
+
import { forwardRef as forwardRef7, useCallback as useCallback15, useContext as useContext44, useMemo as useMemo38 } from "react";
|
|
8932
9080
|
|
|
8933
9081
|
// src/absolute-src.ts
|
|
8934
9082
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -8970,11 +9118,11 @@ var getMediaTrimAfter = ({
|
|
|
8970
9118
|
};
|
|
8971
9119
|
|
|
8972
9120
|
// src/loop/index.tsx
|
|
8973
|
-
import
|
|
9121
|
+
import React30, { createContext as createContext30, useContext as useContext30, useMemo as useMemo26 } from "react";
|
|
8974
9122
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
8975
9123
|
var LoopTimelineContext = createContext30(null);
|
|
8976
9124
|
var useLoop = () => {
|
|
8977
|
-
return
|
|
9125
|
+
return React30.useContext(LoopContext);
|
|
8978
9126
|
};
|
|
8979
9127
|
var Loop = ({
|
|
8980
9128
|
durationInFrames,
|
|
@@ -9016,20 +9164,20 @@ var Loop = ({
|
|
|
9016
9164
|
const iteration = Math.max(0, Math.min(actualTimes - 1, isAtBoundary ? nearestIteration : Math.floor(loopsElapsed)));
|
|
9017
9165
|
const start = isAtBoundary ? currentFrame : iteration * iterationDurationInFrames;
|
|
9018
9166
|
const from = Math.max(0, Math.min(start, maxFrame));
|
|
9019
|
-
const loopDisplay =
|
|
9167
|
+
const loopDisplay = useMemo26(() => {
|
|
9020
9168
|
return {
|
|
9021
9169
|
numberOfTimes: Math.min(compDuration / iterationDurationInFrames, times),
|
|
9022
9170
|
startOffset: -from,
|
|
9023
9171
|
durationInFrames: iterationDurationInFrames
|
|
9024
9172
|
};
|
|
9025
9173
|
}, [compDuration, from, iterationDurationInFrames, times]);
|
|
9026
|
-
const loopContext =
|
|
9174
|
+
const loopContext = useMemo26(() => {
|
|
9027
9175
|
return {
|
|
9028
9176
|
iteration,
|
|
9029
9177
|
durationInFrames
|
|
9030
9178
|
};
|
|
9031
9179
|
}, [iteration, durationInFrames]);
|
|
9032
|
-
const timelineContext =
|
|
9180
|
+
const timelineContext = useMemo26(() => ({
|
|
9033
9181
|
startFrame: loopStartFrame,
|
|
9034
9182
|
firstVisibleFrame,
|
|
9035
9183
|
endFrame,
|
|
@@ -9073,7 +9221,7 @@ var playbackLogging = ({
|
|
|
9073
9221
|
};
|
|
9074
9222
|
|
|
9075
9223
|
// src/prefetch-state.tsx
|
|
9076
|
-
import { createContext as createContext31, useEffect as useEffect8, useState as
|
|
9224
|
+
import { createContext as createContext31, useEffect as useEffect8, useState as useState14 } from "react";
|
|
9077
9225
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
9078
9226
|
var PreloadContext = createContext31({});
|
|
9079
9227
|
var preloads = {};
|
|
@@ -9083,7 +9231,7 @@ var setPreloads = (updater) => {
|
|
|
9083
9231
|
updaters.forEach((u) => u());
|
|
9084
9232
|
};
|
|
9085
9233
|
var PrefetchProvider = ({ children }) => {
|
|
9086
|
-
const [_preloads, _setPreloads] =
|
|
9234
|
+
const [_preloads, _setPreloads] = useState14(() => preloads);
|
|
9087
9235
|
useEffect8(() => {
|
|
9088
9236
|
const updaterFunction = () => {
|
|
9089
9237
|
_setPreloads(preloads);
|
|
@@ -9126,6 +9274,7 @@ var usePreload = (src) => {
|
|
|
9126
9274
|
}
|
|
9127
9275
|
return preloads[withoutHashFragment];
|
|
9128
9276
|
};
|
|
9277
|
+
var activePrefetches = new Map;
|
|
9129
9278
|
var blobToBase64 = function(blob) {
|
|
9130
9279
|
const reader = new FileReader;
|
|
9131
9280
|
return new Promise((resolve, reject) => {
|
|
@@ -9197,6 +9346,7 @@ var prefetch = (src, options) => {
|
|
|
9197
9346
|
return;
|
|
9198
9347
|
});
|
|
9199
9348
|
const controller = new AbortController;
|
|
9349
|
+
const prefetchId = Symbol("prefetch");
|
|
9200
9350
|
let reader = null;
|
|
9201
9351
|
fetch(srcWithoutHash, {
|
|
9202
9352
|
signal: controller.signal,
|
|
@@ -9236,6 +9386,9 @@ var prefetch = (src, options) => {
|
|
|
9236
9386
|
return URL.createObjectURL(actualBlob);
|
|
9237
9387
|
}).then((url) => {
|
|
9238
9388
|
if (canceled) {
|
|
9389
|
+
if (url && method === "blob-url") {
|
|
9390
|
+
URL.revokeObjectURL(url);
|
|
9391
|
+
}
|
|
9239
9392
|
return;
|
|
9240
9393
|
}
|
|
9241
9394
|
playbackLogging({
|
|
@@ -9245,6 +9398,9 @@ var prefetch = (src, options) => {
|
|
|
9245
9398
|
mountTime: null
|
|
9246
9399
|
});
|
|
9247
9400
|
objectUrl = url;
|
|
9401
|
+
const prefetchesForSrc = activePrefetches.get(srcWithoutHash) ?? new Map;
|
|
9402
|
+
prefetchesForSrc.set(prefetchId, objectUrl);
|
|
9403
|
+
activePrefetches.set(srcWithoutHash, prefetchesForSrc);
|
|
9248
9404
|
setPreloads((p) => ({
|
|
9249
9405
|
...p,
|
|
9250
9406
|
[srcWithoutHash]: objectUrl
|
|
@@ -9258,6 +9414,10 @@ var prefetch = (src, options) => {
|
|
|
9258
9414
|
});
|
|
9259
9415
|
return {
|
|
9260
9416
|
free: () => {
|
|
9417
|
+
if (canceled) {
|
|
9418
|
+
return;
|
|
9419
|
+
}
|
|
9420
|
+
canceled = true;
|
|
9261
9421
|
playbackLogging({
|
|
9262
9422
|
logLevel,
|
|
9263
9423
|
tag: "prefetch",
|
|
@@ -9268,16 +9428,25 @@ var prefetch = (src, options) => {
|
|
|
9268
9428
|
if (method === "blob-url") {
|
|
9269
9429
|
URL.revokeObjectURL(objectUrl);
|
|
9270
9430
|
}
|
|
9431
|
+
const prefetchesForSrc = activePrefetches.get(srcWithoutHash);
|
|
9432
|
+
prefetchesForSrc?.delete(prefetchId);
|
|
9433
|
+
const remainingUrl = prefetchesForSrc ? [...prefetchesForSrc.values()].pop() : undefined;
|
|
9434
|
+
if (prefetchesForSrc?.size === 0) {
|
|
9435
|
+
activePrefetches.delete(srcWithoutHash);
|
|
9436
|
+
}
|
|
9271
9437
|
setPreloads((p) => {
|
|
9438
|
+
if (p[srcWithoutHash] === remainingUrl) {
|
|
9439
|
+
return p;
|
|
9440
|
+
}
|
|
9272
9441
|
const copy = { ...p };
|
|
9273
|
-
|
|
9442
|
+
if (remainingUrl === undefined) {
|
|
9443
|
+
delete copy[srcWithoutHash];
|
|
9444
|
+
} else {
|
|
9445
|
+
copy[srcWithoutHash] = remainingUrl;
|
|
9446
|
+
}
|
|
9274
9447
|
return copy;
|
|
9275
9448
|
});
|
|
9276
9449
|
} else {
|
|
9277
|
-
if (canceled) {
|
|
9278
|
-
return;
|
|
9279
|
-
}
|
|
9280
|
-
canceled = true;
|
|
9281
9450
|
const cancellationError = new Error("free() called");
|
|
9282
9451
|
reject(cancellationError);
|
|
9283
9452
|
try {
|
|
@@ -9400,7 +9569,7 @@ var resolveTrimProps = ({
|
|
|
9400
9569
|
};
|
|
9401
9570
|
|
|
9402
9571
|
// src/video/duration-state.tsx
|
|
9403
|
-
import { createContext as createContext32, useMemo as
|
|
9572
|
+
import { createContext as createContext32, useMemo as useMemo27, useReducer } from "react";
|
|
9404
9573
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
9405
9574
|
var durationReducer = (state, action) => {
|
|
9406
9575
|
switch (action.type) {
|
|
@@ -9429,7 +9598,7 @@ var DurationsContext = createContext32({
|
|
|
9429
9598
|
});
|
|
9430
9599
|
var DurationsContextProvider = ({ children }) => {
|
|
9431
9600
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
9432
|
-
const value =
|
|
9601
|
+
const value = useMemo27(() => {
|
|
9433
9602
|
return {
|
|
9434
9603
|
durations,
|
|
9435
9604
|
setDurations
|
|
@@ -9443,12 +9612,12 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
9443
9612
|
|
|
9444
9613
|
// src/audio/AudioForPreview.tsx
|
|
9445
9614
|
import { useCallback as useCallback14 } from "react";
|
|
9446
|
-
import
|
|
9615
|
+
import React36, {
|
|
9447
9616
|
forwardRef as forwardRef5,
|
|
9448
9617
|
useContext as useContext41,
|
|
9449
9618
|
useImperativeHandle as useImperativeHandle4,
|
|
9450
|
-
useMemo as
|
|
9451
|
-
useState as
|
|
9619
|
+
useMemo as useMemo35,
|
|
9620
|
+
useState as useState18
|
|
9452
9621
|
} from "react";
|
|
9453
9622
|
|
|
9454
9623
|
// src/get-cross-origin-value.ts
|
|
@@ -9504,18 +9673,18 @@ var random = (seed, dummy) => {
|
|
|
9504
9673
|
};
|
|
9505
9674
|
|
|
9506
9675
|
// src/use-amplification.ts
|
|
9507
|
-
import { useContext as useContext33, useLayoutEffect as
|
|
9676
|
+
import { useContext as useContext33, useLayoutEffect as useLayoutEffect13, useRef as useRef16 } from "react";
|
|
9508
9677
|
|
|
9509
9678
|
// src/audio/shared-audio-tags.tsx
|
|
9510
|
-
import
|
|
9679
|
+
import React33, {
|
|
9511
9680
|
createContext as createContext33,
|
|
9512
9681
|
createRef as createRef2,
|
|
9513
9682
|
useCallback as useCallback9,
|
|
9514
9683
|
useContext as useContext32,
|
|
9515
9684
|
useEffect as useEffect9,
|
|
9516
|
-
useMemo as
|
|
9685
|
+
useMemo as useMemo29,
|
|
9517
9686
|
useRef as useRef14,
|
|
9518
|
-
useState as
|
|
9687
|
+
useState as useState15
|
|
9519
9688
|
} from "react";
|
|
9520
9689
|
|
|
9521
9690
|
// src/play-and-handle-not-allowed-error.ts
|
|
@@ -9618,7 +9787,7 @@ var makeSharedElementSourceNode = ({
|
|
|
9618
9787
|
};
|
|
9619
9788
|
|
|
9620
9789
|
// src/audio/use-audio-context.ts
|
|
9621
|
-
import { useMemo as
|
|
9790
|
+
import { useMemo as useMemo28, useRef as useRef13 } from "react";
|
|
9622
9791
|
var warned = false;
|
|
9623
9792
|
var warnOnce = (logLevel) => {
|
|
9624
9793
|
if (warned) {
|
|
@@ -9640,7 +9809,7 @@ var useSingletonAudioContext = ({
|
|
|
9640
9809
|
if (sampleRate !== initialSampleRate.current) {
|
|
9641
9810
|
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.`);
|
|
9642
9811
|
}
|
|
9643
|
-
const context =
|
|
9812
|
+
const context = useMemo28(() => {
|
|
9644
9813
|
if (env.isRendering) {
|
|
9645
9814
|
return null;
|
|
9646
9815
|
}
|
|
@@ -9838,9 +10007,9 @@ var SharedAudioContextProvider = ({
|
|
|
9838
10007
|
const isResuming = useRef14(null);
|
|
9839
10008
|
const nextResumeAttemptId = useRef14(0);
|
|
9840
10009
|
const nextResumeIsAutoPlayAttempt = useRef14(false);
|
|
9841
|
-
const audioSyncAnchor =
|
|
10010
|
+
const audioSyncAnchor = useMemo29(() => ({ value: 0 }), []);
|
|
9842
10011
|
const audioSyncAnchorListeners = useRef14([]);
|
|
9843
|
-
const audioSyncAnchorEmitter =
|
|
10012
|
+
const audioSyncAnchorEmitter = useMemo29(() => {
|
|
9844
10013
|
return {
|
|
9845
10014
|
dispatch: (event) => {
|
|
9846
10015
|
audioSyncAnchorListeners.current.forEach((l) => l(event));
|
|
@@ -9860,7 +10029,7 @@ var SharedAudioContextProvider = ({
|
|
|
9860
10029
|
const unscheduleAudioNode = useCallback9((node) => {
|
|
9861
10030
|
return nodesToResume.current.delete(node);
|
|
9862
10031
|
}, []);
|
|
9863
|
-
const scheduleAudioNode =
|
|
10032
|
+
const scheduleAudioNode = useMemo29(() => {
|
|
9864
10033
|
return ({
|
|
9865
10034
|
node,
|
|
9866
10035
|
mediaTimestamp,
|
|
@@ -10005,7 +10174,7 @@ var SharedAudioContextProvider = ({
|
|
|
10005
10174
|
ctxAndGain.suspend().catch(() => {});
|
|
10006
10175
|
};
|
|
10007
10176
|
}, [ctxAndGain, _experimentalKeepAudioContextAlive]);
|
|
10008
|
-
const audioContextValue =
|
|
10177
|
+
const audioContextValue = useMemo29(() => {
|
|
10009
10178
|
return {
|
|
10010
10179
|
sampleRate,
|
|
10011
10180
|
audioContext: ctxAndGain?.audioContext ?? null,
|
|
@@ -10041,7 +10210,7 @@ var SharedAudioContextProvider = ({
|
|
|
10041
10210
|
};
|
|
10042
10211
|
var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
10043
10212
|
const audios = useRef14([]);
|
|
10044
|
-
const [initialNumberOfAudioTags] =
|
|
10213
|
+
const [initialNumberOfAudioTags] = useState15(numberOfAudioTags);
|
|
10045
10214
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
10046
10215
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
10047
10216
|
}
|
|
@@ -10051,7 +10220,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10051
10220
|
const audioCtx = useContext32(SharedAudioContext);
|
|
10052
10221
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
10053
10222
|
const resume = audioCtx?.resume;
|
|
10054
|
-
const [refs] =
|
|
10223
|
+
const [refs] = useState15(() => {
|
|
10055
10224
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
10056
10225
|
const ref = createRef2();
|
|
10057
10226
|
return {
|
|
@@ -10067,7 +10236,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10067
10236
|
for (const { mediaElementSourceNode } of refs) {
|
|
10068
10237
|
mediaElementSourceNode?.setAudioContext(audioContext);
|
|
10069
10238
|
}
|
|
10070
|
-
const effectToUse =
|
|
10239
|
+
const effectToUse = React33.useInsertionEffect ?? React33.useLayoutEffect;
|
|
10071
10240
|
effectToUse(() => {
|
|
10072
10241
|
return () => {
|
|
10073
10242
|
requestAnimationFrame(() => {
|
|
@@ -10193,7 +10362,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10193
10362
|
});
|
|
10194
10363
|
resume?.();
|
|
10195
10364
|
}, [logLevel, mountTime, refs, env.isPlayer, resume]);
|
|
10196
|
-
const audioTagsValue =
|
|
10365
|
+
const audioTagsValue = useMemo29(() => {
|
|
10197
10366
|
return {
|
|
10198
10367
|
registerAudio,
|
|
10199
10368
|
unregisterAudio,
|
|
@@ -10208,7 +10377,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10208
10377
|
unregisterAudio,
|
|
10209
10378
|
updateAudio
|
|
10210
10379
|
]);
|
|
10211
|
-
const sharedAudioTagElements =
|
|
10380
|
+
const sharedAudioTagElements = useMemo29(() => {
|
|
10212
10381
|
return refs.map(({ id, ref }) => {
|
|
10213
10382
|
return /* @__PURE__ */ jsx25("audio", {
|
|
10214
10383
|
ref,
|
|
@@ -10238,11 +10407,11 @@ var useSharedAudio = ({
|
|
|
10238
10407
|
}) => {
|
|
10239
10408
|
const audioCtx = useContext32(SharedAudioContext);
|
|
10240
10409
|
const tagsCtx = useContext32(SharedAudioTagsContext);
|
|
10241
|
-
const [elem] =
|
|
10410
|
+
const [elem] = useState15(() => {
|
|
10242
10411
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
10243
10412
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
10244
10413
|
}
|
|
10245
|
-
const el =
|
|
10414
|
+
const el = React33.createRef();
|
|
10246
10415
|
const mediaElementSourceNode = makeSharedElementSourceNode({
|
|
10247
10416
|
audioContext: audioCtx?.audioContext ?? null,
|
|
10248
10417
|
ref: el
|
|
@@ -10262,7 +10431,7 @@ var useSharedAudio = ({
|
|
|
10262
10431
|
};
|
|
10263
10432
|
});
|
|
10264
10433
|
elem.mediaElementSourceNode?.setAudioContext(audioCtx?.audioContext ?? null);
|
|
10265
|
-
const effectToUse =
|
|
10434
|
+
const effectToUse = React33.useInsertionEffect ?? React33.useLayoutEffect;
|
|
10266
10435
|
if (typeof document !== "undefined") {
|
|
10267
10436
|
effectToUse(() => {
|
|
10268
10437
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
@@ -10428,7 +10597,7 @@ var useVolume = ({
|
|
|
10428
10597
|
}
|
|
10429
10598
|
const { audioContext, gainNode: masterGainNode } = sharedAudioContext;
|
|
10430
10599
|
if (typeof window !== "undefined") {
|
|
10431
|
-
|
|
10600
|
+
useLayoutEffect13(() => {
|
|
10432
10601
|
if (!audioContext) {
|
|
10433
10602
|
return;
|
|
10434
10603
|
}
|
|
@@ -10516,7 +10685,7 @@ var scheduleMediaSourceCleanup = (cleanup) => {
|
|
|
10516
10685
|
};
|
|
10517
10686
|
|
|
10518
10687
|
// src/use-media-in-timeline.ts
|
|
10519
|
-
import { useCallback as useCallback10, useContext as useContext35, useMemo as
|
|
10688
|
+
import { useCallback as useCallback10, useContext as useContext35, useMemo as useMemo30 } from "react";
|
|
10520
10689
|
|
|
10521
10690
|
// src/audio/use-audio-frame.ts
|
|
10522
10691
|
import { createContext as createContext34, useContext as useContext34 } from "react";
|
|
@@ -10606,7 +10775,7 @@ var useBasicMediaInTimeline = ({
|
|
|
10606
10775
|
loop
|
|
10607
10776
|
});
|
|
10608
10777
|
const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
|
|
10609
|
-
const memoizedResult =
|
|
10778
|
+
const memoizedResult = useMemo30(() => {
|
|
10610
10779
|
return {
|
|
10611
10780
|
duration,
|
|
10612
10781
|
finalDisplayName: displayName ?? getAssetDisplayName(src),
|
|
@@ -10642,7 +10811,7 @@ var useMediaInTimelineRegistration = ({
|
|
|
10642
10811
|
const { isStudio } = useRemotionEnvironment();
|
|
10643
10812
|
const stack = getStack();
|
|
10644
10813
|
const getStackForRegistration = useCallback10(() => stack, [stack]);
|
|
10645
|
-
const automaticOutlineRef =
|
|
10814
|
+
const automaticOutlineRef = useMemo30(() => mediaType === "video" && (isStudio || canvasOutlinesEnabled) ? SequenceOutlineInternals.createRef() : null, [canvasOutlinesEnabled, isStudio, mediaType]);
|
|
10646
10815
|
const { duration, finalDisplayName } = useBasicMediaInTimeline({
|
|
10647
10816
|
src,
|
|
10648
10817
|
displayName,
|
|
@@ -10725,28 +10894,28 @@ import {
|
|
|
10725
10894
|
useCallback as useCallback13,
|
|
10726
10895
|
useContext as useContext38,
|
|
10727
10896
|
useEffect as useEffect14,
|
|
10728
|
-
useLayoutEffect as
|
|
10897
|
+
useLayoutEffect as useLayoutEffect15,
|
|
10729
10898
|
useRef as useRef20
|
|
10730
10899
|
} from "react";
|
|
10731
10900
|
|
|
10732
10901
|
// src/buffer-until-first-frame.ts
|
|
10733
|
-
import { useCallback as useCallback12, useMemo as
|
|
10902
|
+
import { useCallback as useCallback12, useMemo as useMemo33, useRef as useRef18 } from "react";
|
|
10734
10903
|
|
|
10735
10904
|
// src/use-buffer-state.ts
|
|
10736
|
-
import { useContext as useContext37, useMemo as
|
|
10905
|
+
import { useContext as useContext37, useMemo as useMemo32 } from "react";
|
|
10737
10906
|
|
|
10738
10907
|
// src/buffering.tsx
|
|
10739
|
-
import
|
|
10908
|
+
import React34, {
|
|
10740
10909
|
useCallback as useCallback11,
|
|
10741
10910
|
useContext as useContext36,
|
|
10742
10911
|
useEffect as useEffect11,
|
|
10743
|
-
useLayoutEffect as
|
|
10744
|
-
useMemo as
|
|
10745
|
-
useState as
|
|
10912
|
+
useLayoutEffect as useLayoutEffect14,
|
|
10913
|
+
useMemo as useMemo31,
|
|
10914
|
+
useState as useState16
|
|
10746
10915
|
} from "react";
|
|
10747
10916
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
10748
10917
|
var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
10749
|
-
const [blockCount, setBlockCount] =
|
|
10918
|
+
const [blockCount, setBlockCount] = useState16(0);
|
|
10750
10919
|
const env = useRemotionEnvironment();
|
|
10751
10920
|
const rendering = env.isRendering;
|
|
10752
10921
|
const addBlock = useCallback11(() => {
|
|
@@ -10784,7 +10953,7 @@ var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
|
10784
10953
|
}
|
|
10785
10954
|
}, [blockCount]);
|
|
10786
10955
|
if (typeof window !== "undefined") {
|
|
10787
|
-
|
|
10956
|
+
useLayoutEffect14(() => {
|
|
10788
10957
|
if (rendering) {
|
|
10789
10958
|
return;
|
|
10790
10959
|
}
|
|
@@ -10799,9 +10968,9 @@ var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
|
10799
10968
|
}
|
|
10800
10969
|
}, [blockCount]);
|
|
10801
10970
|
}
|
|
10802
|
-
return
|
|
10971
|
+
return useMemo31(() => ({ addBlock }), [addBlock]);
|
|
10803
10972
|
};
|
|
10804
|
-
var BufferingContextReact =
|
|
10973
|
+
var BufferingContextReact = React34.createContext(null);
|
|
10805
10974
|
var BufferingProvider = ({ children }) => {
|
|
10806
10975
|
const { logLevel, mountTime } = useContext36(LogLevelContext);
|
|
10807
10976
|
const { isBuffering, setBuffering } = useContext36(SetTimelineContext);
|
|
@@ -10817,7 +10986,7 @@ var useBufferState = () => {
|
|
|
10817
10986
|
const buffer = useContext37(BufferingContextReact);
|
|
10818
10987
|
const logLevel = useLogLevel();
|
|
10819
10988
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
10820
|
-
return
|
|
10989
|
+
return useMemo32(() => ({
|
|
10821
10990
|
delayPlayback: () => {
|
|
10822
10991
|
if (!addBlock) {
|
|
10823
10992
|
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");
|
|
@@ -10925,7 +11094,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
10925
11094
|
onVariableFpsVideoDetected,
|
|
10926
11095
|
pauseWhenBuffering
|
|
10927
11096
|
]);
|
|
10928
|
-
return
|
|
11097
|
+
return useMemo33(() => {
|
|
10929
11098
|
return {
|
|
10930
11099
|
isBuffering: () => bufferingRef.current,
|
|
10931
11100
|
bufferUntilFirstFrame
|
|
@@ -11002,9 +11171,9 @@ var getMediaSyncAction = (input) => {
|
|
|
11002
11171
|
};
|
|
11003
11172
|
|
|
11004
11173
|
// src/media-tag-current-time-timestamp.ts
|
|
11005
|
-
import
|
|
11174
|
+
import React35 from "react";
|
|
11006
11175
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
11007
|
-
const lastUpdate =
|
|
11176
|
+
const lastUpdate = React35.useRef({
|
|
11008
11177
|
time: mediaRef.current?.currentTime ?? 0,
|
|
11009
11178
|
lastUpdate: performance.now()
|
|
11010
11179
|
});
|
|
@@ -11038,7 +11207,7 @@ var seek = ({
|
|
|
11038
11207
|
};
|
|
11039
11208
|
|
|
11040
11209
|
// src/use-media-buffering.ts
|
|
11041
|
-
import { useEffect as useEffect12, useState as
|
|
11210
|
+
import { useEffect as useEffect12, useState as useState17 } from "react";
|
|
11042
11211
|
var useMediaBuffering = ({
|
|
11043
11212
|
element,
|
|
11044
11213
|
shouldBuffer,
|
|
@@ -11049,7 +11218,7 @@ var useMediaBuffering = ({
|
|
|
11049
11218
|
src
|
|
11050
11219
|
}) => {
|
|
11051
11220
|
const buffer = useBufferState();
|
|
11052
|
-
const [isBuffering, setIsBuffering] =
|
|
11221
|
+
const [isBuffering, setIsBuffering] = useState17(false);
|
|
11053
11222
|
useEffect12(() => {
|
|
11054
11223
|
let cleanupFns = [];
|
|
11055
11224
|
const { current } = element;
|
|
@@ -11392,7 +11561,7 @@ var useMediaPlayback = ({
|
|
|
11392
11561
|
return acceptableTimeshift ?? DEFAULT_ACCEPTABLE_TIMESHIFT_WITH_AMPLIFICATION;
|
|
11393
11562
|
})();
|
|
11394
11563
|
const env = useRemotionEnvironment();
|
|
11395
|
-
|
|
11564
|
+
useLayoutEffect15(() => {
|
|
11396
11565
|
const playbackRateToSet = Math.max(0, playbackRate);
|
|
11397
11566
|
if (mediaRef.current && mediaRef.current.defaultPlaybackRate !== playbackRateToSet) {
|
|
11398
11567
|
mediaRef.current.defaultPlaybackRate = playbackRateToSet;
|
|
@@ -11621,7 +11790,7 @@ var useMediaTag = ({
|
|
|
11621
11790
|
};
|
|
11622
11791
|
|
|
11623
11792
|
// src/volume-position-state.ts
|
|
11624
|
-
import { createContext as createContext35, useContext as useContext40, useMemo as
|
|
11793
|
+
import { createContext as createContext35, useContext as useContext40, useMemo as useMemo34 } from "react";
|
|
11625
11794
|
var MediaVolumeContext = createContext35({
|
|
11626
11795
|
playerMuted: false,
|
|
11627
11796
|
mediaVolume: 1
|
|
@@ -11637,14 +11806,14 @@ var SetMediaVolumeContext = createContext35({
|
|
|
11637
11806
|
var useMediaVolumeState = () => {
|
|
11638
11807
|
const { mediaVolume } = useContext40(MediaVolumeContext);
|
|
11639
11808
|
const { setMediaVolume } = useContext40(SetMediaVolumeContext);
|
|
11640
|
-
return
|
|
11809
|
+
return useMemo34(() => {
|
|
11641
11810
|
return [mediaVolume, setMediaVolume];
|
|
11642
11811
|
}, [mediaVolume, setMediaVolume]);
|
|
11643
11812
|
};
|
|
11644
11813
|
var usePlayerMutedState = () => {
|
|
11645
11814
|
const { playerMuted } = useContext40(MediaVolumeContext);
|
|
11646
11815
|
const { setPlayerMuted } = useContext40(SetMediaVolumeContext);
|
|
11647
|
-
return
|
|
11816
|
+
return useMemo34(() => {
|
|
11648
11817
|
return [playerMuted, setPlayerMuted];
|
|
11649
11818
|
}, [playerMuted, setPlayerMuted]);
|
|
11650
11819
|
};
|
|
@@ -11716,7 +11885,7 @@ var useMediaAudioState = ({
|
|
|
11716
11885
|
// src/audio/AudioForPreview.tsx
|
|
11717
11886
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
11718
11887
|
var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
11719
|
-
const [initialShouldPreMountAudioElements] =
|
|
11888
|
+
const [initialShouldPreMountAudioElements] = useState18(props.shouldPreMountAudioTags);
|
|
11720
11889
|
if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
|
|
11721
11890
|
throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
|
|
11722
11891
|
}
|
|
@@ -11766,7 +11935,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11766
11935
|
requestsVideoFrame: false,
|
|
11767
11936
|
isClientSideRendering: false
|
|
11768
11937
|
});
|
|
11769
|
-
const propsToPass =
|
|
11938
|
+
const propsToPass = useMemo35(() => {
|
|
11770
11939
|
return {
|
|
11771
11940
|
muted: isMutedForPlayback,
|
|
11772
11941
|
src: preloadedSrc,
|
|
@@ -11781,7 +11950,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11781
11950
|
preloadedSrc,
|
|
11782
11951
|
crossOriginValue
|
|
11783
11952
|
]);
|
|
11784
|
-
const id =
|
|
11953
|
+
const id = useMemo35(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
11785
11954
|
src,
|
|
11786
11955
|
sequenceContext?.relativeFrom,
|
|
11787
11956
|
sequenceContext?.cumulatedFrom,
|
|
@@ -11827,7 +11996,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11827
11996
|
volume: userPreferredVolume,
|
|
11828
11997
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
11829
11998
|
});
|
|
11830
|
-
const effectToUse =
|
|
11999
|
+
const effectToUse = React36.useInsertionEffect ?? React36.useLayoutEffect;
|
|
11831
12000
|
effectToUse(() => {
|
|
11832
12001
|
return scheduleMediaSourceCleanup.bind(null, cleanupOnMediaTagUnmount);
|
|
11833
12002
|
}, [cleanupOnMediaTagUnmount]);
|
|
@@ -11858,7 +12027,7 @@ var AudioForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
11858
12027
|
showInTimeline,
|
|
11859
12028
|
loopVolumeCurveBehavior
|
|
11860
12029
|
} = props;
|
|
11861
|
-
const [timelineId] =
|
|
12030
|
+
const [timelineId] = useState18(() => String(Math.random()));
|
|
11862
12031
|
const sequenceContext = useContext41(SequenceContext);
|
|
11863
12032
|
const { isStudio } = useRemotionEnvironment();
|
|
11864
12033
|
const [mediaVolume] = useMediaVolumeState();
|
|
@@ -11890,7 +12059,7 @@ var AudioForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
11890
12059
|
documentationLink: "https://www.remotion.dev/docs/html5-audio",
|
|
11891
12060
|
muted: isMutedForTimeline
|
|
11892
12061
|
});
|
|
11893
|
-
const metadata =
|
|
12062
|
+
const metadata = useMemo35(() => isStudio || registration !== null ? {
|
|
11894
12063
|
type: "sequence",
|
|
11895
12064
|
id: timelineId,
|
|
11896
12065
|
value: registration,
|
|
@@ -11913,18 +12082,18 @@ var AudioForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
11913
12082
|
var AudioForPreview = forwardRef5(AudioForPreviewRefForwardingFunction);
|
|
11914
12083
|
|
|
11915
12084
|
// src/audio/AudioForRendering.tsx
|
|
11916
|
-
import
|
|
12085
|
+
import React37, {
|
|
11917
12086
|
forwardRef as forwardRef6,
|
|
11918
12087
|
useContext as useContext43,
|
|
11919
12088
|
useEffect as useEffect16,
|
|
11920
12089
|
useImperativeHandle as useImperativeHandle5,
|
|
11921
|
-
useLayoutEffect as
|
|
11922
|
-
useMemo as
|
|
12090
|
+
useLayoutEffect as useLayoutEffect16,
|
|
12091
|
+
useMemo as useMemo37,
|
|
11923
12092
|
useRef as useRef22
|
|
11924
12093
|
} from "react";
|
|
11925
12094
|
|
|
11926
12095
|
// src/use-media-enabled.tsx
|
|
11927
|
-
import { createContext as createContext36, useContext as useContext42, useMemo as
|
|
12096
|
+
import { createContext as createContext36, useContext as useContext42, useMemo as useMemo36 } from "react";
|
|
11928
12097
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
11929
12098
|
var MediaEnabledContext = createContext36(null);
|
|
11930
12099
|
var useVideoEnabled = () => {
|
|
@@ -11952,7 +12121,7 @@ var MediaEnabledProvider = ({
|
|
|
11952
12121
|
videoEnabled,
|
|
11953
12122
|
audioEnabled
|
|
11954
12123
|
}) => {
|
|
11955
|
-
const value =
|
|
12124
|
+
const value = useMemo36(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
11956
12125
|
return /* @__PURE__ */ jsx28(MediaEnabledContext.Provider, {
|
|
11957
12126
|
value,
|
|
11958
12127
|
children
|
|
@@ -11991,7 +12160,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11991
12160
|
const sequencePlaybackRate = sequenceContext?.playbackRate ?? 1;
|
|
11992
12161
|
const audioStartFrame = useContext43(Html5MediaTrimContext);
|
|
11993
12162
|
const { delayRender, continueRender } = useDelayRender();
|
|
11994
|
-
const id =
|
|
12163
|
+
const id = useMemo37(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
11995
12164
|
props.src,
|
|
11996
12165
|
sequenceContext?.relativeFrom,
|
|
11997
12166
|
sequenceContext?.cumulatedFrom,
|
|
@@ -12053,7 +12222,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
12053
12222
|
]);
|
|
12054
12223
|
const { src } = props;
|
|
12055
12224
|
const needsToRenderAudioTag = ref || _remotionInternalNeedsDurationCalculation;
|
|
12056
|
-
|
|
12225
|
+
useLayoutEffect16(() => {
|
|
12057
12226
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
12058
12227
|
return;
|
|
12059
12228
|
}
|
|
@@ -12099,7 +12268,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
12099
12268
|
onError: onNativeError
|
|
12100
12269
|
});
|
|
12101
12270
|
};
|
|
12102
|
-
var MemoAudioForRendering =
|
|
12271
|
+
var MemoAudioForRendering = React37.memo(forwardRef6(AudioForRenderingRefForwardingFunction));
|
|
12103
12272
|
var AudioForRendering = forwardRef6((props, ref) => {
|
|
12104
12273
|
const { registerRenderAsset, unregisterRenderAsset } = useContext43(RenderAssetManager);
|
|
12105
12274
|
return /* @__PURE__ */ jsx29(MemoAudioForRendering, {
|
|
@@ -12158,7 +12327,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
12158
12327
|
console.warn(errMessage);
|
|
12159
12328
|
}
|
|
12160
12329
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
12161
|
-
const onDuration =
|
|
12330
|
+
const onDuration = useMemo38(() => onMediaDuration.bind(null, setDurations), [setDurations]);
|
|
12162
12331
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
12163
12332
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
12164
12333
|
if (durationInFrames !== undefined) {
|
|
@@ -12256,9 +12425,9 @@ import {
|
|
|
12256
12425
|
useCallback as useCallback16,
|
|
12257
12426
|
useEffect as useEffect17,
|
|
12258
12427
|
useImperativeHandle as useImperativeHandle6,
|
|
12259
|
-
useMemo as
|
|
12428
|
+
useMemo as useMemo39,
|
|
12260
12429
|
useRef as useRef23,
|
|
12261
|
-
useState as
|
|
12430
|
+
useState as useState19
|
|
12262
12431
|
} from "react";
|
|
12263
12432
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
12264
12433
|
var resolveSolidPixelDensity = (pixelDensity) => {
|
|
@@ -12326,13 +12495,13 @@ var SolidInner = ({
|
|
|
12326
12495
|
const resolvedPixelDensity = resolveSolidPixelDensity(pixelDensity);
|
|
12327
12496
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
12328
12497
|
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
12329
|
-
const [outputCanvas, setOutputCanvas] =
|
|
12498
|
+
const [outputCanvas, setOutputCanvas] = useState19(null);
|
|
12330
12499
|
const memoizedEffects = useMemoizedEffects({
|
|
12331
12500
|
effects,
|
|
12332
12501
|
overrideId: overrideId ?? null,
|
|
12333
12502
|
videoConfigValues
|
|
12334
12503
|
});
|
|
12335
|
-
const sourceCanvas =
|
|
12504
|
+
const sourceCanvas = useMemo39(() => {
|
|
12336
12505
|
if (typeof document === "undefined") {
|
|
12337
12506
|
return null;
|
|
12338
12507
|
}
|
|
@@ -12400,7 +12569,7 @@ var SolidInner = ({
|
|
|
12400
12569
|
cancelRender,
|
|
12401
12570
|
memoizedEffects
|
|
12402
12571
|
]);
|
|
12403
|
-
const canvasStyle =
|
|
12572
|
+
const canvasStyle = useMemo39(() => {
|
|
12404
12573
|
return {
|
|
12405
12574
|
width,
|
|
12406
12575
|
height,
|
|
@@ -12535,8 +12704,8 @@ import {
|
|
|
12535
12704
|
forwardRef as forwardRef9,
|
|
12536
12705
|
useCallback as useCallback17,
|
|
12537
12706
|
useContext as useContext45,
|
|
12538
|
-
useLayoutEffect as
|
|
12539
|
-
useMemo as
|
|
12707
|
+
useLayoutEffect as useLayoutEffect17,
|
|
12708
|
+
useMemo as useMemo40,
|
|
12540
12709
|
useRef as useRef24
|
|
12541
12710
|
} from "react";
|
|
12542
12711
|
|
|
@@ -12748,7 +12917,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12748
12917
|
const paintTargetRef = useRef24(null);
|
|
12749
12918
|
const divRef = useRef24(null);
|
|
12750
12919
|
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}-${paintTargetMode}`;
|
|
12751
|
-
const paintState =
|
|
12920
|
+
const paintState = useMemo40(() => {
|
|
12752
12921
|
const state = {
|
|
12753
12922
|
pendingChildren: 0,
|
|
12754
12923
|
generation: 0,
|
|
@@ -13013,13 +13182,13 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13013
13182
|
paintState,
|
|
13014
13183
|
ancestorPaintState
|
|
13015
13184
|
]);
|
|
13016
|
-
|
|
13185
|
+
useLayoutEffect17(() => {
|
|
13017
13186
|
return () => {
|
|
13018
13187
|
paintState.release?.();
|
|
13019
13188
|
paintState.release = null;
|
|
13020
13189
|
};
|
|
13021
13190
|
}, [paintState]);
|
|
13022
|
-
|
|
13191
|
+
useLayoutEffect17(() => {
|
|
13023
13192
|
const placeholder = canvas2dRef.current;
|
|
13024
13193
|
if (!placeholder) {
|
|
13025
13194
|
throw new Error("Canvas not found");
|
|
@@ -13047,7 +13216,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13047
13216
|
};
|
|
13048
13217
|
}, [onPaintCb, cancelRender, canvasWidth, canvasHeight, paintTargetMode]);
|
|
13049
13218
|
const onPaintChangedRef = useRef24(false);
|
|
13050
|
-
|
|
13219
|
+
useLayoutEffect17(() => {
|
|
13051
13220
|
if (!onPaintChangedRef.current) {
|
|
13052
13221
|
onPaintChangedRef.current = true;
|
|
13053
13222
|
return;
|
|
@@ -13058,7 +13227,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13058
13227
|
}
|
|
13059
13228
|
canvas.requestPaint?.();
|
|
13060
13229
|
}, [onPaint, memoizedEffects]);
|
|
13061
|
-
|
|
13230
|
+
useLayoutEffect17(() => {
|
|
13062
13231
|
const canvas = canvas2dRef.current;
|
|
13063
13232
|
if (!canvas) {
|
|
13064
13233
|
return;
|
|
@@ -13085,13 +13254,13 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13085
13254
|
isRendering,
|
|
13086
13255
|
ancestorPaintState
|
|
13087
13256
|
]);
|
|
13088
|
-
const innerStyle =
|
|
13257
|
+
const innerStyle = useMemo40(() => {
|
|
13089
13258
|
return {
|
|
13090
13259
|
width,
|
|
13091
13260
|
height
|
|
13092
13261
|
};
|
|
13093
13262
|
}, [width, height]);
|
|
13094
|
-
const canvasStyle =
|
|
13263
|
+
const canvasStyle = useMemo40(() => {
|
|
13095
13264
|
return {
|
|
13096
13265
|
width,
|
|
13097
13266
|
height,
|
|
@@ -13293,10 +13462,10 @@ import {
|
|
|
13293
13462
|
forwardRef as forwardRef10,
|
|
13294
13463
|
useContext as useContext46,
|
|
13295
13464
|
useImperativeHandle as useImperativeHandle7,
|
|
13296
|
-
useLayoutEffect as
|
|
13297
|
-
useMemo as
|
|
13465
|
+
useLayoutEffect as useLayoutEffect18,
|
|
13466
|
+
useMemo as useMemo41,
|
|
13298
13467
|
useRef as useRef25,
|
|
13299
|
-
useState as
|
|
13468
|
+
useState as useState20
|
|
13300
13469
|
} from "react";
|
|
13301
13470
|
|
|
13302
13471
|
// src/truncate-src-for-label.ts
|
|
@@ -13450,8 +13619,8 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13450
13619
|
}, ref) => {
|
|
13451
13620
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
13452
13621
|
const { delayPlayback } = useBufferState();
|
|
13453
|
-
const [outputCanvas, setOutputCanvas] =
|
|
13454
|
-
const [loadedImage, setLoadedImage] =
|
|
13622
|
+
const [outputCanvas, setOutputCanvas] = useState20(null);
|
|
13623
|
+
const [loadedImage, setLoadedImage] = useState20(null);
|
|
13455
13624
|
const actualSrc = usePreload(src);
|
|
13456
13625
|
const chainState = useEffectChainState(effectsOutputSize);
|
|
13457
13626
|
const memoizedEffects = useMemoizedEffects({
|
|
@@ -13461,18 +13630,18 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13461
13630
|
});
|
|
13462
13631
|
const sequenceContext = useContext46(SequenceContext);
|
|
13463
13632
|
const pendingLoadDelayRef = useRef25(null);
|
|
13464
|
-
const [isLoadPending, setIsLoadPending] =
|
|
13633
|
+
const [isLoadPending, setIsLoadPending] = useState20(false);
|
|
13465
13634
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
13466
13635
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
13467
|
-
const continuePendingLoadDelay =
|
|
13468
|
-
const sourceCanvas =
|
|
13636
|
+
const continuePendingLoadDelay = useMemo41(() => continueImageLoadDelay.bind(null, pendingLoadDelayRef, setIsLoadPending, continueRender), [continueRender]);
|
|
13637
|
+
const sourceCanvas = useMemo41(() => {
|
|
13469
13638
|
if (typeof document === "undefined") {
|
|
13470
13639
|
return null;
|
|
13471
13640
|
}
|
|
13472
13641
|
return document.createElement("canvas");
|
|
13473
13642
|
}, []);
|
|
13474
|
-
const canvasRef =
|
|
13475
|
-
|
|
13643
|
+
const canvasRef = useMemo41(() => setCanvasRef.bind(null, setOutputCanvas, ref), [ref]);
|
|
13644
|
+
useLayoutEffect18(() => {
|
|
13476
13645
|
if (!pauseWhenLoading || !isLoadPending || isPremounting || isPostmounting) {
|
|
13477
13646
|
return;
|
|
13478
13647
|
}
|
|
@@ -13484,7 +13653,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13484
13653
|
isPremounting,
|
|
13485
13654
|
pauseWhenLoading
|
|
13486
13655
|
]);
|
|
13487
|
-
|
|
13656
|
+
useLayoutEffect18(() => {
|
|
13488
13657
|
const handle = delayRender(`Rendering <CanvasImage> with src="${truncateSrcForLabel(actualSrc)}"`, {
|
|
13489
13658
|
retries: delayRenderRetries ?? undefined,
|
|
13490
13659
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
@@ -13547,7 +13716,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13547
13716
|
maxRetries,
|
|
13548
13717
|
onError
|
|
13549
13718
|
]);
|
|
13550
|
-
|
|
13719
|
+
useLayoutEffect18(() => {
|
|
13551
13720
|
if (!loadedImage || !outputCanvas || !sourceCanvas) {
|
|
13552
13721
|
return;
|
|
13553
13722
|
}
|
|
@@ -13685,7 +13854,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13685
13854
|
if (!src) {
|
|
13686
13855
|
throw new Error('No "src" prop was passed to <CanvasImage>.');
|
|
13687
13856
|
}
|
|
13688
|
-
const isMedia =
|
|
13857
|
+
const isMedia = useMemo41(() => ({
|
|
13689
13858
|
type: "image",
|
|
13690
13859
|
src
|
|
13691
13860
|
}), [src]);
|
|
@@ -13812,7 +13981,7 @@ var getStaticFiles = () => {
|
|
|
13812
13981
|
return window.remotion_staticFiles;
|
|
13813
13982
|
};
|
|
13814
13983
|
// src/IFrame.tsx
|
|
13815
|
-
import { forwardRef as forwardRef11, useCallback as useCallback18, useLayoutEffect as
|
|
13984
|
+
import { forwardRef as forwardRef11, useCallback as useCallback18, useLayoutEffect as useLayoutEffect19, useRef as useRef26 } from "react";
|
|
13816
13985
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
13817
13986
|
var IFrameRefForwarding = ({
|
|
13818
13987
|
onLoad,
|
|
@@ -13825,7 +13994,7 @@ var IFrameRefForwarding = ({
|
|
|
13825
13994
|
const handle = useRef26(null);
|
|
13826
13995
|
const loadedSource = useRef26(null);
|
|
13827
13996
|
const { src, srcDoc } = props;
|
|
13828
|
-
|
|
13997
|
+
useLayoutEffect19(() => {
|
|
13829
13998
|
if (loadedSource.current?.src === src && loadedSource.current?.srcDoc === srcDoc && loadedSource.current !== null) {
|
|
13830
13999
|
return;
|
|
13831
14000
|
}
|
|
@@ -13879,10 +14048,10 @@ var IFrame = forwardRef11(IFrameRefForwarding);
|
|
|
13879
14048
|
// src/Img.tsx
|
|
13880
14049
|
import {
|
|
13881
14050
|
useContext as useContext47,
|
|
13882
|
-
useLayoutEffect as
|
|
13883
|
-
useMemo as
|
|
14051
|
+
useLayoutEffect as useLayoutEffect20,
|
|
14052
|
+
useMemo as useMemo42,
|
|
13884
14053
|
useRef as useRef27,
|
|
13885
|
-
useState as
|
|
14054
|
+
useState as useState21
|
|
13886
14055
|
} from "react";
|
|
13887
14056
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
13888
14057
|
function exponentialBackoff2(errorCount) {
|
|
@@ -14020,18 +14189,18 @@ var ImgContent = ({
|
|
|
14020
14189
|
const errors = useRef27({});
|
|
14021
14190
|
const { delayPlayback } = useBufferState();
|
|
14022
14191
|
const sequenceContext = useContext47(SequenceContext);
|
|
14023
|
-
const [isLoading, setIsLoading] =
|
|
14192
|
+
const [isLoading, setIsLoading] = useState21(false);
|
|
14024
14193
|
const _propsValid = true;
|
|
14025
14194
|
if (!_propsValid) {
|
|
14026
14195
|
throw new Error("typecheck error");
|
|
14027
14196
|
}
|
|
14028
|
-
const imageCallbackRef =
|
|
14197
|
+
const imageCallbackRef = useMemo42(() => setImageRef.bind(null, imageRef, ref ?? null), [ref]);
|
|
14029
14198
|
const actualSrc = usePreload(src);
|
|
14030
|
-
const retryIn =
|
|
14199
|
+
const retryIn = useMemo42(() => retryImage.bind(null, imageRef), []);
|
|
14031
14200
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
14032
14201
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
14033
14202
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
14034
|
-
const didGetError =
|
|
14203
|
+
const didGetError = useMemo42(() => handleImageError.bind(null, {
|
|
14035
14204
|
errors,
|
|
14036
14205
|
imageRef,
|
|
14037
14206
|
onError: onError ?? null,
|
|
@@ -14041,7 +14210,7 @@ var ImgContent = ({
|
|
|
14041
14210
|
retryIn
|
|
14042
14211
|
}), [cancelRender, maxRetries, onError, onImageError, retryIn]);
|
|
14043
14212
|
if (typeof window !== "undefined") {
|
|
14044
|
-
|
|
14213
|
+
useLayoutEffect20(() => {
|
|
14045
14214
|
if (!pauseWhenLoading || !isLoading || isPremounting || isPostmounting) {
|
|
14046
14215
|
return;
|
|
14047
14216
|
}
|
|
@@ -14053,7 +14222,7 @@ var ImgContent = ({
|
|
|
14053
14222
|
isPremounting,
|
|
14054
14223
|
pauseWhenLoading
|
|
14055
14224
|
]);
|
|
14056
|
-
|
|
14225
|
+
useLayoutEffect20(loadImage2.bind(null, {
|
|
14057
14226
|
imageRef,
|
|
14058
14227
|
errors,
|
|
14059
14228
|
actualSrc,
|
|
@@ -14111,7 +14280,7 @@ var NativeImgInner = ({
|
|
|
14111
14280
|
if (!src) {
|
|
14112
14281
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
14113
14282
|
}
|
|
14114
|
-
const isMedia =
|
|
14283
|
+
const isMedia = useMemo42(() => ({
|
|
14115
14284
|
type: "image",
|
|
14116
14285
|
src
|
|
14117
14286
|
}), [src]);
|
|
@@ -14359,7 +14528,7 @@ var Img = withInteractivitySchema({
|
|
|
14359
14528
|
});
|
|
14360
14529
|
addSequenceStackTraces(Img);
|
|
14361
14530
|
// src/Interactive.tsx
|
|
14362
|
-
import
|
|
14531
|
+
import React43, { forwardRef as forwardRef12, useCallback as useCallback19, useContext as useContext48 } from "react";
|
|
14363
14532
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
14364
14533
|
var sourcePathToIdentityPrefix = (packageName) => {
|
|
14365
14534
|
if (packageName === "remotion") {
|
|
@@ -14533,7 +14702,7 @@ var withSchema = (untypedOptions) => {
|
|
|
14533
14702
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
14534
14703
|
_remotionInternalIsPremounting: premountingActive,
|
|
14535
14704
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
14536
|
-
children:
|
|
14705
|
+
children: React43.createElement(Component, {
|
|
14537
14706
|
...componentPropsWithoutCropping,
|
|
14538
14707
|
...layout === "none" ? { style: croppedStyle ?? undefined, ref } : {}
|
|
14539
14708
|
})
|
|
@@ -14643,7 +14812,7 @@ var makeInteractiveElement = (tag, displayName, schema) => {
|
|
|
14643
14812
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
14644
14813
|
_remotionInternalIsPremounting: premountingActive,
|
|
14645
14814
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
14646
|
-
children:
|
|
14815
|
+
children: React43.createElement(tag, {
|
|
14647
14816
|
...props,
|
|
14648
14817
|
style: croppedStyle ?? undefined,
|
|
14649
14818
|
ref: callbackRef
|
|
@@ -14739,16 +14908,16 @@ var getAudioSyncAnchorTolerance = (audioContext) => {
|
|
|
14739
14908
|
};
|
|
14740
14909
|
|
|
14741
14910
|
// src/CompositionManager.tsx
|
|
14742
|
-
import
|
|
14743
|
-
var compositionsRef =
|
|
14911
|
+
import React44 from "react";
|
|
14912
|
+
var compositionsRef = React44.createRef();
|
|
14744
14913
|
|
|
14745
14914
|
// src/CompositionManagerProvider.tsx
|
|
14746
14915
|
import {
|
|
14747
14916
|
useCallback as useCallback21,
|
|
14748
14917
|
useImperativeHandle as useImperativeHandle9,
|
|
14749
|
-
useMemo as
|
|
14918
|
+
useMemo as useMemo44,
|
|
14750
14919
|
useRef as useRef29,
|
|
14751
|
-
useState as
|
|
14920
|
+
useState as useState23
|
|
14752
14921
|
} from "react";
|
|
14753
14922
|
|
|
14754
14923
|
// src/CompositionRegistryProvider.tsx
|
|
@@ -14757,18 +14926,18 @@ import {
|
|
|
14757
14926
|
useCallback as useCallback20,
|
|
14758
14927
|
useEffect as useEffect18,
|
|
14759
14928
|
useImperativeHandle as useImperativeHandle8,
|
|
14760
|
-
useLayoutEffect as
|
|
14761
|
-
useMemo as
|
|
14929
|
+
useLayoutEffect as useLayoutEffect21,
|
|
14930
|
+
useMemo as useMemo43,
|
|
14762
14931
|
useRef as useRef28,
|
|
14763
|
-
useState as
|
|
14932
|
+
useState as useState22
|
|
14764
14933
|
} from "react";
|
|
14765
14934
|
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
14766
|
-
var useIsomorphicLayoutEffect6 = typeof window === "undefined" ? useEffect18 :
|
|
14935
|
+
var useIsomorphicLayoutEffect6 = typeof window === "undefined" ? useEffect18 : useLayoutEffect21;
|
|
14767
14936
|
var CompositionRegistryFallbackProvider = withCommittedMetadata(CompositionRegistryFallbackContext.Provider);
|
|
14768
14937
|
var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushSnapshotRef) => {
|
|
14769
14938
|
const { isStudio } = useRemotionEnvironment();
|
|
14770
|
-
const [managerId] =
|
|
14771
|
-
const [useCommitObserver, setUseCommitObserver] =
|
|
14939
|
+
const [managerId] = useState22(() => String(Math.random()));
|
|
14940
|
+
const [useCommitObserver, setUseCommitObserver] = useState22(() => isStudio && isCommitRegistrationObserverInstalled());
|
|
14772
14941
|
const observedCommitRef = useRef28(false);
|
|
14773
14942
|
const observerFailedRef = useRef28(false);
|
|
14774
14943
|
const unmountedRef = useRef28(false);
|
|
@@ -14805,7 +14974,7 @@ var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushS
|
|
|
14805
14974
|
observedCommitRef.current = true;
|
|
14806
14975
|
queueSnapshot(snapshot);
|
|
14807
14976
|
}, [queueSnapshot]);
|
|
14808
|
-
const fallbackRegistry =
|
|
14977
|
+
const fallbackRegistry = useMemo43(() => {
|
|
14809
14978
|
const entries = new Map;
|
|
14810
14979
|
const getSnapshot = () => {
|
|
14811
14980
|
const compositions = [];
|
|
@@ -14876,7 +15045,7 @@ var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushS
|
|
|
14876
15045
|
}
|
|
14877
15046
|
};
|
|
14878
15047
|
}, [isStudio, useCommitObserver]);
|
|
14879
|
-
const metadata =
|
|
15048
|
+
const metadata = useMemo43(() => isStudio ? {
|
|
14880
15049
|
type: "composition-manager",
|
|
14881
15050
|
id: managerId,
|
|
14882
15051
|
onCommit: useCommitObserver ? onObservedSnapshot : null
|
|
@@ -14900,8 +15069,8 @@ var CompositionManagerProvider = ({
|
|
|
14900
15069
|
const committedKeysRef = useRef29(new Set);
|
|
14901
15070
|
const flushSnapshotRef = useRef29(null);
|
|
14902
15071
|
const committedDescriptorsRef = useRef29(new Map);
|
|
14903
|
-
const [registrationError, setRegistrationError] =
|
|
14904
|
-
const [registry] =
|
|
15072
|
+
const [registrationError, setRegistrationError] = useState23(null);
|
|
15073
|
+
const [registry] = useState23(() => createRegistryStore({
|
|
14905
15074
|
compositions: initialCompositions.map((composition, order) => ({
|
|
14906
15075
|
...composition,
|
|
14907
15076
|
order
|
|
@@ -14909,8 +15078,8 @@ var CompositionManagerProvider = ({
|
|
|
14909
15078
|
folders: []
|
|
14910
15079
|
}));
|
|
14911
15080
|
const { compositions, folders } = useSyncExternalStore2(registry.subscribe, registry.getSnapshot, registry.getSnapshot);
|
|
14912
|
-
const [canvasContent, setCanvasContent] =
|
|
14913
|
-
const [currentAssetMetadata, setCurrentAssetMetadata] =
|
|
15081
|
+
const [canvasContent, setCanvasContent] = useState23(initialCanvasContent);
|
|
15082
|
+
const [currentAssetMetadata, setCurrentAssetMetadata] = useState23(null);
|
|
14914
15083
|
const onCommitRegistrations = useCallback21((pending) => {
|
|
14915
15084
|
const previousKeys = committedKeysRef.current;
|
|
14916
15085
|
const previousDescriptors = committedDescriptorsRef.current;
|
|
@@ -14963,12 +15132,12 @@ var CompositionManagerProvider = ({
|
|
|
14963
15132
|
}
|
|
14964
15133
|
};
|
|
14965
15134
|
}, [registry]);
|
|
14966
|
-
const compositionManagerSetters =
|
|
15135
|
+
const compositionManagerSetters = useMemo44(() => ({
|
|
14967
15136
|
setCanvasContent,
|
|
14968
15137
|
setCurrentAssetMetadata,
|
|
14969
15138
|
onlyRenderComposition
|
|
14970
15139
|
}), [onlyRenderComposition]);
|
|
14971
|
-
const compositionManagerContextValue =
|
|
15140
|
+
const compositionManagerContextValue = useMemo44(() => {
|
|
14972
15141
|
return {
|
|
14973
15142
|
compositions,
|
|
14974
15143
|
folders,
|
|
@@ -15116,6 +15285,72 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
15116
15285
|
`;
|
|
15117
15286
|
};
|
|
15118
15287
|
|
|
15288
|
+
// src/effects/create-curve-sampler.ts
|
|
15289
|
+
var createCurveSampler = (points, interpolation) => {
|
|
15290
|
+
const distances = points.slice(1).map((point, index) => Math.hypot(point[0] - points[index][0], point[1] - points[index][1]));
|
|
15291
|
+
const tangents = points.map(() => [0, 0]);
|
|
15292
|
+
if (interpolation === "smooth" && points.length > 2) {
|
|
15293
|
+
for (let axis = 0;axis < 2; axis++) {
|
|
15294
|
+
const slopes = distances.map((distance, index) => (points[index + 1][axis] - points[index][axis]) / distance);
|
|
15295
|
+
const curvatures = new Array(points.length).fill(0);
|
|
15296
|
+
const upper = new Array(points.length).fill(0);
|
|
15297
|
+
for (let index = 1;index < points.length - 1; index++) {
|
|
15298
|
+
const diagonal = 2 * (distances[index - 1] + distances[index]) - distances[index - 1] * upper[index - 1];
|
|
15299
|
+
upper[index] = distances[index] / diagonal;
|
|
15300
|
+
curvatures[index] = (6 * (slopes[index] - slopes[index - 1]) - distances[index - 1] * curvatures[index - 1]) / diagonal;
|
|
15301
|
+
}
|
|
15302
|
+
for (let index = points.length - 2;index > 0; index--) {
|
|
15303
|
+
curvatures[index] -= upper[index] * curvatures[index + 1];
|
|
15304
|
+
}
|
|
15305
|
+
for (let index = 0;index < points.length; index++) {
|
|
15306
|
+
tangents[index][axis] = index === 0 ? slopes[0] - distances[0] * curvatures[1] / 6 : slopes[index - 1] + distances[index - 1] * (curvatures[index - 1] + 2 * curvatures[index]) / 6;
|
|
15307
|
+
}
|
|
15308
|
+
}
|
|
15309
|
+
for (let index = 0;index < points.length; index++) {
|
|
15310
|
+
const maxTangent = 3 * Math.min(index === 0 ? Infinity : (points[index][0] - points[index - 1][0]) / distances[index - 1], index === points.length - 1 ? Infinity : (points[index + 1][0] - points[index][0]) / distances[index]);
|
|
15311
|
+
if (tangents[index][0] > maxTangent) {
|
|
15312
|
+
tangents[index][1] *= maxTangent / tangents[index][0];
|
|
15313
|
+
}
|
|
15314
|
+
tangents[index][0] = Math.max(0, Math.min(maxTangent, tangents[index][0]));
|
|
15315
|
+
}
|
|
15316
|
+
}
|
|
15317
|
+
return (input) => {
|
|
15318
|
+
if (input <= points[0][0])
|
|
15319
|
+
return points[0][1];
|
|
15320
|
+
if (input >= points[points.length - 1][0]) {
|
|
15321
|
+
return points[points.length - 1][1];
|
|
15322
|
+
}
|
|
15323
|
+
const index = points.findIndex((point) => point[0] > input) - 1;
|
|
15324
|
+
const start = points[index];
|
|
15325
|
+
const end = points[index + 1];
|
|
15326
|
+
if (input === start[0])
|
|
15327
|
+
return start[1];
|
|
15328
|
+
if (interpolation === "linear" || points.length === 2) {
|
|
15329
|
+
return start[1] + (end[1] - start[1]) * ((input - start[0]) / (end[0] - start[0]));
|
|
15330
|
+
}
|
|
15331
|
+
const handleLength = distances[index] / 3;
|
|
15332
|
+
const firstX = start[0] + handleLength * tangents[index][0];
|
|
15333
|
+
const secondX = end[0] - handleLength * tangents[index + 1][0];
|
|
15334
|
+
let low = 0;
|
|
15335
|
+
let high = 1;
|
|
15336
|
+
for (let iteration = 0;iteration < 32; iteration++) {
|
|
15337
|
+
const candidate = (low + high) / 2;
|
|
15338
|
+
const inverse = 1 - candidate;
|
|
15339
|
+
const x = inverse ** 3 * start[0] + 3 * inverse ** 2 * candidate * firstX + 3 * inverse * candidate ** 2 * secondX + candidate ** 3 * end[0];
|
|
15340
|
+
if (x < input)
|
|
15341
|
+
low = candidate;
|
|
15342
|
+
else
|
|
15343
|
+
high = candidate;
|
|
15344
|
+
}
|
|
15345
|
+
const progress = (low + high) / 2;
|
|
15346
|
+
const remaining = 1 - progress;
|
|
15347
|
+
const firstY = start[1] + handleLength * tangents[index][1];
|
|
15348
|
+
const secondY = end[1] - handleLength * tangents[index + 1][1];
|
|
15349
|
+
const value = remaining ** 3 * start[1] + 3 * remaining ** 2 * progress * firstY + 3 * remaining * progress ** 2 * secondY + progress ** 3 * end[1];
|
|
15350
|
+
return Math.max(0, Math.min(1, value));
|
|
15351
|
+
};
|
|
15352
|
+
};
|
|
15353
|
+
|
|
15119
15354
|
// src/get-preview-dom-element.ts
|
|
15120
15355
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
15121
15356
|
var getPreviewDomElement = () => {
|
|
@@ -15123,8 +15358,8 @@ var getPreviewDomElement = () => {
|
|
|
15123
15358
|
};
|
|
15124
15359
|
|
|
15125
15360
|
// src/max-video-cache-size.ts
|
|
15126
|
-
import
|
|
15127
|
-
var MaxMediaCacheSizeContext =
|
|
15361
|
+
import React45 from "react";
|
|
15362
|
+
var MaxMediaCacheSizeContext = React45.createContext(null);
|
|
15128
15363
|
|
|
15129
15364
|
// src/media-resource-manager.ts
|
|
15130
15365
|
var disposeResource = (resource) => {
|
|
@@ -15281,7 +15516,7 @@ var waitForRoot = (fn) => {
|
|
|
15281
15516
|
};
|
|
15282
15517
|
|
|
15283
15518
|
// src/RemotionRoot.tsx
|
|
15284
|
-
import { useMemo as
|
|
15519
|
+
import { useMemo as useMemo45 } from "react";
|
|
15285
15520
|
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
15286
15521
|
var RemotionRootContexts = ({
|
|
15287
15522
|
children,
|
|
@@ -15294,7 +15529,7 @@ var RemotionRootContexts = ({
|
|
|
15294
15529
|
frameState,
|
|
15295
15530
|
_experimentalKeepAudioContextAlive
|
|
15296
15531
|
}) => {
|
|
15297
|
-
const logging =
|
|
15532
|
+
const logging = useMemo45(() => {
|
|
15298
15533
|
return { logLevel, mountTime: Date.now() };
|
|
15299
15534
|
}, [logLevel]);
|
|
15300
15535
|
return /* @__PURE__ */ jsx40(LogLevelContext.Provider, {
|
|
@@ -15332,7 +15567,7 @@ var RemotionRootContexts = ({
|
|
|
15332
15567
|
};
|
|
15333
15568
|
|
|
15334
15569
|
// src/render-resource-manager.ts
|
|
15335
|
-
import
|
|
15570
|
+
import React47 from "react";
|
|
15336
15571
|
var makeRenderResourceManager = () => {
|
|
15337
15572
|
const resources = new Map;
|
|
15338
15573
|
let disposed = false;
|
|
@@ -15373,7 +15608,7 @@ var makeRenderResourceManager = () => {
|
|
|
15373
15608
|
}
|
|
15374
15609
|
};
|
|
15375
15610
|
};
|
|
15376
|
-
var RenderResourceManagerContext =
|
|
15611
|
+
var RenderResourceManagerContext = React47.createContext(null);
|
|
15377
15612
|
|
|
15378
15613
|
// src/codec.ts
|
|
15379
15614
|
var validCodecs = [
|
|
@@ -15564,8 +15799,8 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
15564
15799
|
};
|
|
15565
15800
|
|
|
15566
15801
|
// src/sequence-stack-traces.ts
|
|
15567
|
-
import
|
|
15568
|
-
var SequenceStackTracesUpdateContext =
|
|
15802
|
+
import React48 from "react";
|
|
15803
|
+
var SequenceStackTracesUpdateContext = React48.createContext(() => {});
|
|
15569
15804
|
|
|
15570
15805
|
// src/setup-env-variables.ts
|
|
15571
15806
|
var getEnvVariables = () => {
|
|
@@ -15595,7 +15830,7 @@ var setupEnvVariables = () => {
|
|
|
15595
15830
|
};
|
|
15596
15831
|
|
|
15597
15832
|
// src/Track.tsx
|
|
15598
|
-
import { useMemo as
|
|
15833
|
+
import { useMemo as useMemo46, useState as useState24 } from "react";
|
|
15599
15834
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
15600
15835
|
var {
|
|
15601
15836
|
freeze: _freeze,
|
|
@@ -15612,8 +15847,8 @@ var TrackWithoutSchema = ({
|
|
|
15612
15847
|
layout = "none",
|
|
15613
15848
|
...props
|
|
15614
15849
|
}) => {
|
|
15615
|
-
const [id] =
|
|
15616
|
-
const value =
|
|
15850
|
+
const [id] = useState24(() => String(Math.random()));
|
|
15851
|
+
const value = useMemo46(() => ({ id, name }), [id, name]);
|
|
15617
15852
|
return /* @__PURE__ */ jsx41(TimelineTrackContext.Provider, {
|
|
15618
15853
|
value,
|
|
15619
15854
|
children: /* @__PURE__ */ jsx41(SequenceWithoutSchema, {
|
|
@@ -15639,8 +15874,8 @@ var Track = withInteractivitySchema({
|
|
|
15639
15874
|
addSequenceStackTraces(Track);
|
|
15640
15875
|
|
|
15641
15876
|
// src/use-pixel-density.ts
|
|
15642
|
-
import
|
|
15643
|
-
var PixelDensityContext =
|
|
15877
|
+
import React50, { useContext as useContext49 } from "react";
|
|
15878
|
+
var PixelDensityContext = React50.createContext(null);
|
|
15644
15879
|
var getBrowserPixelDensity = () => {
|
|
15645
15880
|
if (typeof window === "undefined") {
|
|
15646
15881
|
return 1;
|
|
@@ -15673,9 +15908,9 @@ import {
|
|
|
15673
15908
|
useCallback as useCallback22,
|
|
15674
15909
|
useContext as useContext50,
|
|
15675
15910
|
useEffect as useEffect19,
|
|
15676
|
-
useLayoutEffect as
|
|
15677
|
-
useMemo as
|
|
15678
|
-
useState as
|
|
15911
|
+
useLayoutEffect as useLayoutEffect22,
|
|
15912
|
+
useMemo as useMemo47,
|
|
15913
|
+
useState as useState25
|
|
15679
15914
|
} from "react";
|
|
15680
15915
|
|
|
15681
15916
|
// src/video/offthread-video-source.ts
|
|
@@ -15721,7 +15956,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15721
15956
|
if (!src) {
|
|
15722
15957
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
15723
15958
|
}
|
|
15724
|
-
const id =
|
|
15959
|
+
const id = useMemo47(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
15725
15960
|
src,
|
|
15726
15961
|
sequenceContext?.cumulatedFrom,
|
|
15727
15962
|
sequenceContext?.relativeFrom,
|
|
@@ -15779,14 +16014,14 @@ var OffthreadVideoForRendering = ({
|
|
|
15779
16014
|
audioStreamIndex,
|
|
15780
16015
|
preservePitch
|
|
15781
16016
|
]);
|
|
15782
|
-
const currentTime =
|
|
16017
|
+
const currentTime = useMemo47(() => {
|
|
15783
16018
|
return getExpectedMediaFrameUncorrected({
|
|
15784
16019
|
frame,
|
|
15785
16020
|
playbackRate: playbackRate || 1,
|
|
15786
16021
|
startFrom: audioStartFrame
|
|
15787
16022
|
}) / videoConfig.fps;
|
|
15788
16023
|
}, [frame, audioStartFrame, playbackRate, videoConfig.fps]);
|
|
15789
|
-
const actualSrc =
|
|
16024
|
+
const actualSrc = useMemo47(() => {
|
|
15790
16025
|
return getOffthreadVideoSource({
|
|
15791
16026
|
src,
|
|
15792
16027
|
currentTime,
|
|
@@ -15794,9 +16029,9 @@ var OffthreadVideoForRendering = ({
|
|
|
15794
16029
|
toneMapped
|
|
15795
16030
|
});
|
|
15796
16031
|
}, [toneMapped, currentTime, src, transparent]);
|
|
15797
|
-
const [imageSrc, setImageSrc] =
|
|
16032
|
+
const [imageSrc, setImageSrc] = useState25(null);
|
|
15798
16033
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
15799
|
-
|
|
16034
|
+
useLayoutEffect22(() => {
|
|
15800
16035
|
if (!window.remotion_videoEnabled) {
|
|
15801
16036
|
return;
|
|
15802
16037
|
}
|
|
@@ -15875,7 +16110,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15875
16110
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
15876
16111
|
}
|
|
15877
16112
|
}, [imageSrc, onError, cancelRender]);
|
|
15878
|
-
const className =
|
|
16113
|
+
const className = useMemo47(() => {
|
|
15879
16114
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props.className].filter(truthy).join(" ");
|
|
15880
16115
|
}, [props.className]);
|
|
15881
16116
|
const onImageFrame = useCallback22((img) => {
|
|
@@ -15899,15 +16134,15 @@ var OffthreadVideoForRendering = ({
|
|
|
15899
16134
|
};
|
|
15900
16135
|
|
|
15901
16136
|
// src/video/VideoForPreview.tsx
|
|
15902
|
-
import
|
|
16137
|
+
import React52, {
|
|
15903
16138
|
forwardRef as forwardRef14,
|
|
15904
16139
|
useCallback as useCallback23,
|
|
15905
16140
|
useContext as useContext51,
|
|
15906
16141
|
useEffect as useEffect21,
|
|
15907
16142
|
useImperativeHandle as useImperativeHandle10,
|
|
15908
|
-
useMemo as
|
|
16143
|
+
useMemo as useMemo48,
|
|
15909
16144
|
useRef as useRef30,
|
|
15910
|
-
useState as
|
|
16145
|
+
useState as useState26
|
|
15911
16146
|
} from "react";
|
|
15912
16147
|
|
|
15913
16148
|
// src/video/emit-video-frame.ts
|
|
@@ -15963,7 +16198,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15963
16198
|
throw new Error("SharedAudioContext not found");
|
|
15964
16199
|
}
|
|
15965
16200
|
const videoRef = useRef30(null);
|
|
15966
|
-
const sharedSource =
|
|
16201
|
+
const sharedSource = useMemo48(() => {
|
|
15967
16202
|
if (!context.audioContext) {
|
|
15968
16203
|
return null;
|
|
15969
16204
|
}
|
|
@@ -15972,7 +16207,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15972
16207
|
ref: videoRef
|
|
15973
16208
|
});
|
|
15974
16209
|
}, [context.audioContext]);
|
|
15975
|
-
const effectToUse =
|
|
16210
|
+
const effectToUse = React52.useInsertionEffect ?? React52.useLayoutEffect;
|
|
15976
16211
|
effectToUse(() => {
|
|
15977
16212
|
return scheduleMediaSourceCleanup.bind(null, sharedSource?.cleanup ?? null);
|
|
15978
16213
|
}, [sharedSource]);
|
|
@@ -16060,7 +16295,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
16060
16295
|
useImperativeHandle10(ref, () => {
|
|
16061
16296
|
return videoRef.current;
|
|
16062
16297
|
}, []);
|
|
16063
|
-
|
|
16298
|
+
useState26(() => playbackLogging({
|
|
16064
16299
|
logLevel,
|
|
16065
16300
|
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
16066
16301
|
tag: "video",
|
|
@@ -16119,7 +16354,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
16119
16354
|
current.preload = "auto";
|
|
16120
16355
|
}
|
|
16121
16356
|
}, []);
|
|
16122
|
-
const actualStyle =
|
|
16357
|
+
const actualStyle = useMemo48(() => {
|
|
16123
16358
|
return {
|
|
16124
16359
|
...style
|
|
16125
16360
|
};
|
|
@@ -16156,7 +16391,7 @@ var VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
16156
16391
|
loopVolumeCurveBehavior,
|
|
16157
16392
|
onlyWarnForMediaSeekingError
|
|
16158
16393
|
} = props;
|
|
16159
|
-
const [timelineId] =
|
|
16394
|
+
const [timelineId] = useState26(() => String(Math.random()));
|
|
16160
16395
|
const parentSequence = useContext51(SequenceContext);
|
|
16161
16396
|
const { isStudio } = useRemotionEnvironment();
|
|
16162
16397
|
const [mediaVolume] = useMediaVolumeState();
|
|
@@ -16188,7 +16423,7 @@ var VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
16188
16423
|
documentationLink: onlyWarnForMediaSeekingError ? "https://www.remotion.dev/docs/offthreadvideo" : "https://www.remotion.dev/docs/html5-video",
|
|
16189
16424
|
muted: isMutedForTimeline
|
|
16190
16425
|
});
|
|
16191
|
-
const metadata =
|
|
16426
|
+
const metadata = useMemo48(() => isStudio || automaticOutlineRef || registration !== null ? {
|
|
16192
16427
|
type: "sequence",
|
|
16193
16428
|
id: timelineId,
|
|
16194
16429
|
value: registration,
|
|
@@ -16427,31 +16662,31 @@ var watchStaticFile = (fileName, callback) => {
|
|
|
16427
16662
|
};
|
|
16428
16663
|
|
|
16429
16664
|
// src/wrap-remotion-context.tsx
|
|
16430
|
-
import
|
|
16665
|
+
import React54, { useCallback as useCallback25, useMemo as useMemo49, useRef as useRef31, useState as useState27 } from "react";
|
|
16431
16666
|
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
16432
16667
|
function useRemotionContexts() {
|
|
16433
|
-
const compositionManagerCtx =
|
|
16434
|
-
const videoContext =
|
|
16435
|
-
const timelineContext =
|
|
16436
|
-
const setTimelineContext =
|
|
16437
|
-
const sequenceContext =
|
|
16438
|
-
const defaultPremountInSeconds =
|
|
16439
|
-
const timelineTrackContext =
|
|
16440
|
-
const canUseRemotionHooksContext =
|
|
16441
|
-
const preloadContext =
|
|
16442
|
-
const resolveCompositionContext =
|
|
16443
|
-
const renderAssetManagerContext =
|
|
16444
|
-
const sequenceManagerActionsContext =
|
|
16445
|
-
const sequenceManagerRefContext =
|
|
16446
|
-
const sequenceRegistryContext =
|
|
16447
|
-
const sequenceRegistryScopeContext =
|
|
16448
|
-
const sequenceRegistrationContext =
|
|
16449
|
-
const disableSequenceRegistrationContext =
|
|
16450
|
-
const remotionEnvironmentContext =
|
|
16451
|
-
const visualModePropStatusesRefContext =
|
|
16452
|
-
const bufferManagerContext =
|
|
16453
|
-
const logLevelContext =
|
|
16454
|
-
return
|
|
16668
|
+
const compositionManagerCtx = React54.useContext(CompositionManager);
|
|
16669
|
+
const videoContext = React54.useContext(VideoContext);
|
|
16670
|
+
const timelineContext = React54.useContext(TimelineContext);
|
|
16671
|
+
const setTimelineContext = React54.useContext(SetTimelineContext);
|
|
16672
|
+
const sequenceContext = React54.useContext(SequenceContext);
|
|
16673
|
+
const defaultPremountInSeconds = React54.useContext(DefaultPremountContext);
|
|
16674
|
+
const timelineTrackContext = React54.useContext(TimelineTrackContext);
|
|
16675
|
+
const canUseRemotionHooksContext = React54.useContext(CanUseRemotionHooks);
|
|
16676
|
+
const preloadContext = React54.useContext(PreloadContext);
|
|
16677
|
+
const resolveCompositionContext = React54.useContext(ResolveCompositionContext);
|
|
16678
|
+
const renderAssetManagerContext = React54.useContext(RenderAssetManager);
|
|
16679
|
+
const sequenceManagerActionsContext = React54.useContext(SequenceManagerActionsContext);
|
|
16680
|
+
const sequenceManagerRefContext = React54.useContext(SequenceManagerRefContext);
|
|
16681
|
+
const sequenceRegistryContext = React54.useContext(SequenceRegistryContext);
|
|
16682
|
+
const sequenceRegistryScopeContext = React54.useContext(SequenceRegistryScopeContext);
|
|
16683
|
+
const sequenceRegistrationContext = React54.useContext(SequenceRegistrationContext);
|
|
16684
|
+
const disableSequenceRegistrationContext = React54.useContext(DisableSequenceRegistrationContext);
|
|
16685
|
+
const remotionEnvironmentContext = React54.useContext(RemotionEnvironmentContext);
|
|
16686
|
+
const visualModePropStatusesRefContext = React54.useContext(VisualModePropStatusesRefContext);
|
|
16687
|
+
const bufferManagerContext = React54.useContext(BufferingContextReact);
|
|
16688
|
+
const logLevelContext = React54.useContext(LogLevelContext);
|
|
16689
|
+
return useMemo49(() => ({
|
|
16455
16690
|
compositionManagerCtx,
|
|
16456
16691
|
videoContext,
|
|
16457
16692
|
timelineContext,
|
|
@@ -16502,8 +16737,8 @@ var ForwardedSequenceRegistry = ({
|
|
|
16502
16737
|
contexts,
|
|
16503
16738
|
children
|
|
16504
16739
|
}) => {
|
|
16505
|
-
const [scopeId] =
|
|
16506
|
-
const [observerAvailable, setObserverAvailable] =
|
|
16740
|
+
const [scopeId] = useState27(() => String(Math.random()));
|
|
16741
|
+
const [observerAvailable, setObserverAvailable] = useState27(isCommitRegistrationObserverInstalled);
|
|
16507
16742
|
const observedCommitRef = useRef31(false);
|
|
16508
16743
|
const observerFailedRef = useRef31(false);
|
|
16509
16744
|
const unmountedRef = useRef31(false);
|
|
@@ -16519,7 +16754,7 @@ var ForwardedSequenceRegistry = ({
|
|
|
16519
16754
|
observedCommitRef.current = true;
|
|
16520
16755
|
scope?.onCommitSequences(scopeId, sequences, sequenceIds);
|
|
16521
16756
|
}, [scope, scopeId]);
|
|
16522
|
-
const useIsomorphicLayoutEffect = typeof window === "undefined" ?
|
|
16757
|
+
const useIsomorphicLayoutEffect = typeof window === "undefined" ? React54.useEffect : React54.useLayoutEffect;
|
|
16523
16758
|
useIsomorphicLayoutEffect(() => {
|
|
16524
16759
|
if (scope === null || typeof window === "undefined") {
|
|
16525
16760
|
return;
|
|
@@ -16558,7 +16793,7 @@ var ForwardedSequenceRegistry = ({
|
|
|
16558
16793
|
});
|
|
16559
16794
|
};
|
|
16560
16795
|
}, [scope, scopeId, registry, commitRegistrationEnabled]);
|
|
16561
|
-
const metadata =
|
|
16796
|
+
const metadata = useMemo49(() => ({
|
|
16562
16797
|
type: "sequence-manager",
|
|
16563
16798
|
id: scopeId,
|
|
16564
16799
|
onCommit: commitRegistrationEnabled ? onCommitSequences : null
|
|
@@ -16832,8 +17067,10 @@ var Internals = {
|
|
|
16832
17067
|
cleanupEffectChainState,
|
|
16833
17068
|
runEffectChain,
|
|
16834
17069
|
useMemoizedEffects,
|
|
17070
|
+
subscribeToEffectSource,
|
|
16835
17071
|
useMemoizedEffectDefinitions,
|
|
16836
17072
|
createEffect,
|
|
17073
|
+
createCurveSampler,
|
|
16837
17074
|
createWebGLContextError,
|
|
16838
17075
|
createWebGL2ContextError,
|
|
16839
17076
|
computeEffectiveSchemaValuesDotNotation,
|
|
@@ -16862,17 +17099,17 @@ Object.assign(Internals, { useSyncExternalStore: useSyncExternalStore2 });
|
|
|
16862
17099
|
// src/font-face-registry.ts
|
|
16863
17100
|
var fontDataByUrl = new Map;
|
|
16864
17101
|
// src/series/index.tsx
|
|
16865
|
-
import
|
|
17102
|
+
import React56, {
|
|
16866
17103
|
forwardRef as forwardRef15,
|
|
16867
|
-
useMemo as
|
|
17104
|
+
useMemo as useMemo50
|
|
16868
17105
|
} from "react";
|
|
16869
17106
|
|
|
16870
17107
|
// src/series/flatten-children.tsx
|
|
16871
|
-
import
|
|
17108
|
+
import React55 from "react";
|
|
16872
17109
|
var flattenChildren = (children) => {
|
|
16873
|
-
const childrenArray =
|
|
17110
|
+
const childrenArray = React55.Children.toArray(children);
|
|
16874
17111
|
return childrenArray.reduce((flatChildren, child) => {
|
|
16875
|
-
if (child.type ===
|
|
17112
|
+
if (child.type === React55.Fragment) {
|
|
16876
17113
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
16877
17114
|
}
|
|
16878
17115
|
flatChildren.push(child);
|
|
@@ -16936,7 +17173,7 @@ var validateSeriesSequenceProps = ({
|
|
|
16936
17173
|
};
|
|
16937
17174
|
var SeriesInner = (props) => {
|
|
16938
17175
|
const pendingDeletions = usePendingSequenceDeletions();
|
|
16939
|
-
const childrenValue =
|
|
17176
|
+
const childrenValue = useMemo50(() => {
|
|
16940
17177
|
const flattenedChildren = flattenChildren(props.children).filter((child) => !OptimisticSequenceDeletion.isElementDeleted(child, pendingDeletions));
|
|
16941
17178
|
const renderChildren = (i, startFrame) => {
|
|
16942
17179
|
if (i === flattenedChildren.length) {
|
|
@@ -16960,7 +17197,7 @@ var SeriesInner = (props) => {
|
|
|
16960
17197
|
index: i,
|
|
16961
17198
|
childrenLength: flattenedChildren.length
|
|
16962
17199
|
});
|
|
16963
|
-
return
|
|
17200
|
+
return React56.cloneElement(castedElement, {
|
|
16964
17201
|
_remotionInternalRender: (resolvedProps, ref) => {
|
|
16965
17202
|
const durationInFramesProp = resolvedProps.durationInFrames;
|
|
16966
17203
|
const timelineDurationInFrames = durationInFramesProp / (resolvedProps.playbackRate ?? 1);
|
|
@@ -17129,18 +17366,18 @@ var staticFile = (path) => {
|
|
|
17129
17366
|
return preparsed;
|
|
17130
17367
|
};
|
|
17131
17368
|
// src/Still.tsx
|
|
17132
|
-
import
|
|
17369
|
+
import React57 from "react";
|
|
17133
17370
|
var Still = (props) => {
|
|
17134
17371
|
const newProps = {
|
|
17135
17372
|
...props,
|
|
17136
17373
|
durationInFrames: 1,
|
|
17137
17374
|
fps: 1
|
|
17138
17375
|
};
|
|
17139
|
-
return
|
|
17376
|
+
return React57.createElement(Composition, newProps);
|
|
17140
17377
|
};
|
|
17141
17378
|
addSequenceStackTraces(Still);
|
|
17142
17379
|
// src/video/html5-video.tsx
|
|
17143
|
-
import { forwardRef as forwardRef17, useContext as useContext53, useMemo as
|
|
17380
|
+
import { forwardRef as forwardRef17, useContext as useContext53, useMemo as useMemo52 } from "react";
|
|
17144
17381
|
|
|
17145
17382
|
// src/video/VideoForRendering.tsx
|
|
17146
17383
|
import {
|
|
@@ -17148,8 +17385,8 @@ import {
|
|
|
17148
17385
|
useContext as useContext52,
|
|
17149
17386
|
useEffect as useEffect22,
|
|
17150
17387
|
useImperativeHandle as useImperativeHandle11,
|
|
17151
|
-
useLayoutEffect as
|
|
17152
|
-
useMemo as
|
|
17388
|
+
useLayoutEffect as useLayoutEffect23,
|
|
17389
|
+
useMemo as useMemo51,
|
|
17153
17390
|
useRef as useRef32
|
|
17154
17391
|
} from "react";
|
|
17155
17392
|
|
|
@@ -17309,7 +17546,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
17309
17546
|
const mountTime = useMountTime();
|
|
17310
17547
|
const { delayRender, continueRender } = useDelayRender();
|
|
17311
17548
|
const { registerRenderAsset, unregisterRenderAsset } = useContext52(RenderAssetManager);
|
|
17312
|
-
const id =
|
|
17549
|
+
const id = useMemo51(() => `video-${random(props.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
17313
17550
|
props.src,
|
|
17314
17551
|
sequenceContext?.cumulatedFrom,
|
|
17315
17552
|
sequenceContext?.relativeFrom,
|
|
@@ -17461,7 +17698,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
17461
17698
|
]);
|
|
17462
17699
|
const { src } = props;
|
|
17463
17700
|
if (environment.isRendering) {
|
|
17464
|
-
|
|
17701
|
+
useLayoutEffect23(() => {
|
|
17465
17702
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
17466
17703
|
return;
|
|
17467
17704
|
}
|
|
@@ -17536,7 +17773,7 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17536
17773
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
17537
17774
|
}
|
|
17538
17775
|
const preloadedSrc = usePreload(props.src);
|
|
17539
|
-
const onDuration =
|
|
17776
|
+
const onDuration = useMemo52(() => onMediaDuration.bind(null, setDurations), [setDurations]);
|
|
17540
17777
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
17541
17778
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
17542
17779
|
if (durationInFrames !== undefined) {
|