remotion 4.0.494 → 4.0.496
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/HtmlInCanvas.js +5 -5
- package/dist/cjs/Img.js +3 -1
- package/dist/cjs/Interactive.d.ts +4 -6
- package/dist/cjs/Interactive.js +46 -37
- package/dist/cjs/Sequence.js +12 -33
- package/dist/cjs/interactivity-schema.d.ts +12 -0
- package/dist/cjs/interactivity-schema.js +10 -3
- package/dist/cjs/internals.d.ts +57 -1
- package/dist/cjs/internals.js +3 -0
- package/dist/cjs/no-react.d.ts +2 -0
- package/dist/cjs/use-current-scale.d.ts +8 -1
- package/dist/cjs/use-current-scale.js +1 -1
- package/dist/cjs/use-premounting.d.ts +19 -0
- package/dist/cjs/use-premounting.js +62 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +293 -224
- package/dist/esm/no-react.mjs +12 -4
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -1310,7 +1310,7 @@ var getSingleChildComponent = (children) => {
|
|
|
1310
1310
|
};
|
|
1311
1311
|
|
|
1312
1312
|
// src/version.ts
|
|
1313
|
-
var VERSION = "4.0.
|
|
1313
|
+
var VERSION = "4.0.496";
|
|
1314
1314
|
|
|
1315
1315
|
// src/multiple-versions-warning.ts
|
|
1316
1316
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1350,9 +1350,9 @@ var Null = () => {
|
|
|
1350
1350
|
import {
|
|
1351
1351
|
forwardRef as forwardRef3,
|
|
1352
1352
|
useCallback as useCallback6,
|
|
1353
|
-
useContext as
|
|
1353
|
+
useContext as useContext18,
|
|
1354
1354
|
useEffect as useEffect3,
|
|
1355
|
-
useMemo as
|
|
1355
|
+
useMemo as useMemo15,
|
|
1356
1356
|
useRef as useRef6,
|
|
1357
1357
|
useState as useState5
|
|
1358
1358
|
} from "react";
|
|
@@ -1862,15 +1862,19 @@ var premountSchema = {
|
|
|
1862
1862
|
description: "Premount For",
|
|
1863
1863
|
min: 0,
|
|
1864
1864
|
step: 1,
|
|
1865
|
-
hiddenFromList: false
|
|
1865
|
+
hiddenFromList: false,
|
|
1866
|
+
keyframable: false
|
|
1866
1867
|
},
|
|
1867
1868
|
postmountFor: {
|
|
1868
1869
|
type: "number",
|
|
1869
1870
|
default: 0,
|
|
1870
1871
|
min: 0,
|
|
1871
1872
|
step: 1,
|
|
1872
|
-
hiddenFromList: true
|
|
1873
|
-
|
|
1873
|
+
hiddenFromList: true,
|
|
1874
|
+
keyframable: false
|
|
1875
|
+
}
|
|
1876
|
+
};
|
|
1877
|
+
var premountStyleSchema = {
|
|
1874
1878
|
styleWhilePremounted: {
|
|
1875
1879
|
type: "hidden"
|
|
1876
1880
|
},
|
|
@@ -1878,10 +1882,13 @@ var premountSchema = {
|
|
|
1878
1882
|
type: "hidden"
|
|
1879
1883
|
}
|
|
1880
1884
|
};
|
|
1881
|
-
var sequencePremountSchema =
|
|
1885
|
+
var sequencePremountSchema = {
|
|
1886
|
+
...premountSchema,
|
|
1887
|
+
...premountStyleSchema
|
|
1888
|
+
};
|
|
1882
1889
|
var sequenceStyleSchema = {
|
|
1883
1890
|
...transformSchema,
|
|
1884
|
-
...
|
|
1891
|
+
...sequencePremountSchema
|
|
1885
1892
|
};
|
|
1886
1893
|
var hiddenField = {
|
|
1887
1894
|
type: "boolean",
|
|
@@ -1967,12 +1974,6 @@ var sequenceSchemaDefaultLayoutNone = {
|
|
|
1967
1974
|
}
|
|
1968
1975
|
};
|
|
1969
1976
|
|
|
1970
|
-
// src/PremountContext.tsx
|
|
1971
|
-
import { createContext as createContext14 } from "react";
|
|
1972
|
-
var PremountContext = createContext14({
|
|
1973
|
-
premountFramesRemaining: 0
|
|
1974
|
-
});
|
|
1975
|
-
|
|
1976
1977
|
// src/SequenceManager.tsx
|
|
1977
1978
|
import React12, { useCallback as useCallback5, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
1978
1979
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
@@ -2157,9 +2158,9 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2157
2158
|
};
|
|
2158
2159
|
|
|
2159
2160
|
// src/series/is-inside-series.tsx
|
|
2160
|
-
import React13, { createContext as
|
|
2161
|
+
import React13, { createContext as createContext14 } from "react";
|
|
2161
2162
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2162
|
-
var IsInsideSeriesContext =
|
|
2163
|
+
var IsInsideSeriesContext = createContext14(false);
|
|
2163
2164
|
var IsInsideSeriesContainer = ({ children }) => {
|
|
2164
2165
|
return /* @__PURE__ */ jsx11(IsInsideSeriesContext.Provider, {
|
|
2165
2166
|
value: true,
|
|
@@ -2179,11 +2180,73 @@ var useRequireToBeInsideSeries = () => {
|
|
|
2179
2180
|
}
|
|
2180
2181
|
};
|
|
2181
2182
|
|
|
2183
|
+
// src/use-premounting.ts
|
|
2184
|
+
import { useContext as useContext15, useMemo as useMemo13 } from "react";
|
|
2185
|
+
|
|
2186
|
+
// src/PremountContext.tsx
|
|
2187
|
+
import { createContext as createContext15 } from "react";
|
|
2188
|
+
var PremountContext = createContext15({
|
|
2189
|
+
premountFramesRemaining: 0
|
|
2190
|
+
});
|
|
2191
|
+
|
|
2182
2192
|
// src/v5-flag.ts
|
|
2183
2193
|
var ENABLE_V5_BREAKING_CHANGES = false;
|
|
2184
2194
|
|
|
2195
|
+
// src/use-premounting.ts
|
|
2196
|
+
var usePremounting = ({
|
|
2197
|
+
from,
|
|
2198
|
+
durationInFrames,
|
|
2199
|
+
premountFor,
|
|
2200
|
+
postmountFor,
|
|
2201
|
+
style,
|
|
2202
|
+
styleWhilePremounted,
|
|
2203
|
+
styleWhilePostmounted,
|
|
2204
|
+
hideWhilePremounted
|
|
2205
|
+
}) => {
|
|
2206
|
+
const parentPremountContext = useContext15(PremountContext);
|
|
2207
|
+
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
2208
|
+
const environment = useRemotionEnvironment();
|
|
2209
|
+
const { fps } = useVideoConfig();
|
|
2210
|
+
const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? premountFor ?? fps : premountFor ?? 0;
|
|
2211
|
+
const effectivePostmountFor = postmountFor ?? 0;
|
|
2212
|
+
const endThreshold = Math.ceil(from + durationInFrames - 1);
|
|
2213
|
+
const premountingActive = !environment.isRendering && frame < from && frame >= from - effectivePremountFor;
|
|
2214
|
+
const postmountingActive = !environment.isRendering && frame > endThreshold && frame <= endThreshold + effectivePostmountFor;
|
|
2215
|
+
const isPremountingOrPostmounting = premountingActive || postmountingActive;
|
|
2216
|
+
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
2217
|
+
const premountingStyle = useMemo13(() => {
|
|
2218
|
+
if (!isPremountingOrPostmounting) {
|
|
2219
|
+
return style;
|
|
2220
|
+
}
|
|
2221
|
+
return {
|
|
2222
|
+
...style,
|
|
2223
|
+
...hideWhilePremounted === "opacity" ? { opacity: 0 } : { display: "none" },
|
|
2224
|
+
pointerEvents: "none",
|
|
2225
|
+
...premountingActive ? styleWhilePremounted : {},
|
|
2226
|
+
...postmountingActive ? styleWhilePostmounted : {}
|
|
2227
|
+
};
|
|
2228
|
+
}, [
|
|
2229
|
+
isPremountingOrPostmounting,
|
|
2230
|
+
hideWhilePremounted,
|
|
2231
|
+
postmountingActive,
|
|
2232
|
+
premountingActive,
|
|
2233
|
+
style,
|
|
2234
|
+
styleWhilePostmounted,
|
|
2235
|
+
styleWhilePremounted
|
|
2236
|
+
]);
|
|
2237
|
+
return {
|
|
2238
|
+
effectivePremountFor,
|
|
2239
|
+
effectivePostmountFor,
|
|
2240
|
+
premountingActive,
|
|
2241
|
+
postmountingActive,
|
|
2242
|
+
isPremountingOrPostmounting,
|
|
2243
|
+
freezeFrame,
|
|
2244
|
+
premountingStyle
|
|
2245
|
+
};
|
|
2246
|
+
};
|
|
2247
|
+
|
|
2185
2248
|
// src/with-interactivity-schema.ts
|
|
2186
|
-
import React14, { forwardRef as forwardRef2, useContext as
|
|
2249
|
+
import React14, { forwardRef as forwardRef2, useContext as useContext17, useMemo as useMemo14, useState as useState4 } from "react";
|
|
2187
2250
|
|
|
2188
2251
|
// src/delete-nested-key.ts
|
|
2189
2252
|
var deleteNestedKey = (obj, keysToRemove) => {
|
|
@@ -2219,7 +2282,7 @@ var deleteNestedKey = (obj, keysToRemove) => {
|
|
|
2219
2282
|
};
|
|
2220
2283
|
|
|
2221
2284
|
// src/effects/use-memoized-effects.ts
|
|
2222
|
-
import { useContext as
|
|
2285
|
+
import { useContext as useContext16, useRef as useRef5 } from "react";
|
|
2223
2286
|
|
|
2224
2287
|
// src/bezier.ts
|
|
2225
2288
|
var NEWTON_ITERATIONS = 4;
|
|
@@ -4041,10 +4104,10 @@ var useMemoizedEffects = ({
|
|
|
4041
4104
|
overrideId
|
|
4042
4105
|
}) => {
|
|
4043
4106
|
const previousRef = useRef5(null);
|
|
4044
|
-
const { propStatuses } =
|
|
4045
|
-
const { getEffectDragOverrides } =
|
|
4107
|
+
const { propStatuses } = useContext16(VisualModePropStatusesContext);
|
|
4108
|
+
const { getEffectDragOverrides } = useContext16(VisualModeDragOverridesContext);
|
|
4046
4109
|
const frame = useCurrentFrame();
|
|
4047
|
-
const { overrideIdToNodePathMappings } =
|
|
4110
|
+
const { overrideIdToNodePathMappings } = useContext16(OverrideIdsToNodePathsGettersContext);
|
|
4048
4111
|
const previous = previousRef.current;
|
|
4049
4112
|
const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
|
|
4050
4113
|
const resolved = effects.map((descriptor, index) => {
|
|
@@ -4396,9 +4459,9 @@ var withInteractivitySchema = ({
|
|
|
4396
4459
|
ref
|
|
4397
4460
|
});
|
|
4398
4461
|
}
|
|
4399
|
-
const { propStatuses } =
|
|
4400
|
-
const { getDragOverrides } =
|
|
4401
|
-
const nodePathMapping =
|
|
4462
|
+
const { propStatuses } = useContext17(VisualModePropStatusesContext);
|
|
4463
|
+
const { getDragOverrides } = useContext17(VisualModeDragOverridesContext);
|
|
4464
|
+
const nodePathMapping = useContext17(OverrideIdsToNodePathsGettersContext);
|
|
4402
4465
|
const frame = useCurrentFrame();
|
|
4403
4466
|
if (props.controls) {
|
|
4404
4467
|
return React14.createElement(Component, {
|
|
@@ -4425,8 +4488,8 @@ var withInteractivitySchema = ({
|
|
|
4425
4488
|
key,
|
|
4426
4489
|
props
|
|
4427
4490
|
}));
|
|
4428
|
-
const currentRuntimeValueDotNotation =
|
|
4429
|
-
const controls =
|
|
4491
|
+
const currentRuntimeValueDotNotation = useMemo14(() => readValuesFromProps(props, flatKeys, flatSchema), runtimeValues);
|
|
4492
|
+
const controls = useMemo14(() => {
|
|
4430
4493
|
return {
|
|
4431
4494
|
schema: schemaWithSequenceName,
|
|
4432
4495
|
currentRuntimeValueDotNotation,
|
|
@@ -4436,7 +4499,7 @@ var withInteractivitySchema = ({
|
|
|
4436
4499
|
componentName
|
|
4437
4500
|
};
|
|
4438
4501
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
4439
|
-
const { merged: valuesDotNotation, propsToDelete } =
|
|
4502
|
+
const { merged: valuesDotNotation, propsToDelete } = useMemo14(() => {
|
|
4440
4503
|
return computeEffectiveSchemaValuesDotNotation({
|
|
4441
4504
|
schema: schemaWithSequenceName,
|
|
4442
4505
|
currentValue: currentRuntimeValueDotNotation,
|
|
@@ -4497,7 +4560,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4497
4560
|
}, ref) => {
|
|
4498
4561
|
const { layout = "absolute-fill" } = other;
|
|
4499
4562
|
const [id] = useState5(() => String(Math.random()));
|
|
4500
|
-
const parentSequence =
|
|
4563
|
+
const parentSequence = useContext18(SequenceContext);
|
|
4501
4564
|
const { rootId } = useTimelineContext();
|
|
4502
4565
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
4503
4566
|
const nonce = useNonce();
|
|
@@ -4548,13 +4611,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4548
4611
|
const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + effectiveRelativeFrom;
|
|
4549
4612
|
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - effectiveRelativeFrom, durationInFrames) : durationInFrames;
|
|
4550
4613
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
4551
|
-
const { registerSequence, unregisterSequence } =
|
|
4614
|
+
const { registerSequence, unregisterSequence } = useContext18(SequenceManager);
|
|
4552
4615
|
const wrapperRefForOutline = useRef6(null);
|
|
4553
4616
|
const refForOutline = other.layout === "none" ? passedRefForOutline ?? null : passedRefForOutline ?? wrapperRefForOutline;
|
|
4554
|
-
const premounting =
|
|
4617
|
+
const premounting = useMemo15(() => {
|
|
4555
4618
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
4556
4619
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
4557
|
-
const postmounting =
|
|
4620
|
+
const postmounting = useMemo15(() => {
|
|
4558
4621
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
4559
4622
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
4560
4623
|
const currentSequenceStart = cumulatedFrom + effectiveRelativeFrom;
|
|
@@ -4562,7 +4625,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4562
4625
|
const parentFirstFrame = parentSequence ? parentSequenceStart - parentSequence.cumulatedNegativeFrom : 0;
|
|
4563
4626
|
const firstFrame = Math.max(0, parentFirstFrame, currentSequenceStart);
|
|
4564
4627
|
const cumulatedNegativeFrom = currentSequenceStart - firstFrame;
|
|
4565
|
-
const contextValue =
|
|
4628
|
+
const contextValue = useMemo15(() => {
|
|
4566
4629
|
return {
|
|
4567
4630
|
absoluteFrom,
|
|
4568
4631
|
cumulatedFrom,
|
|
@@ -4593,12 +4656,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4593
4656
|
postmountDisplay,
|
|
4594
4657
|
cumulatedNegativeFrom
|
|
4595
4658
|
]);
|
|
4596
|
-
const timelineClipName =
|
|
4659
|
+
const timelineClipName = useMemo15(() => {
|
|
4597
4660
|
return name ?? "";
|
|
4598
4661
|
}, [name]);
|
|
4599
4662
|
const resolvedDocumentationLink = documentationLink ?? "https://www.remotion.dev/docs/sequence";
|
|
4600
4663
|
const env = useRemotionEnvironment();
|
|
4601
|
-
const isInsideSeries =
|
|
4664
|
+
const isInsideSeries = useContext18(IsInsideSeriesContext);
|
|
4602
4665
|
const inheritedStack = other?.stack ?? null;
|
|
4603
4666
|
const stackRef = useRef6(null);
|
|
4604
4667
|
stackRef.current = stack ?? inheritedStack;
|
|
@@ -4746,7 +4809,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4746
4809
|
ref.current = node;
|
|
4747
4810
|
}
|
|
4748
4811
|
}, [ref]);
|
|
4749
|
-
const defaultStyle =
|
|
4812
|
+
const defaultStyle = useMemo15(() => {
|
|
4750
4813
|
return {
|
|
4751
4814
|
flexDirection: undefined,
|
|
4752
4815
|
...width ? { width } : {},
|
|
@@ -4772,8 +4835,6 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4772
4835
|
};
|
|
4773
4836
|
var RegularSequence = forwardRef3(RegularSequenceRefForwardingFunction);
|
|
4774
4837
|
var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
4775
|
-
const parentPremountContext = useContext17(PremountContext);
|
|
4776
|
-
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
4777
4838
|
if (props.layout === "none") {
|
|
4778
4839
|
throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
|
|
4779
4840
|
}
|
|
@@ -4787,34 +4848,30 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
4787
4848
|
styleWhilePostmounted,
|
|
4788
4849
|
...otherProps
|
|
4789
4850
|
} = props;
|
|
4790
|
-
const
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
4794
|
-
const isFreezingActive = premountingActive || postmountingActive;
|
|
4795
|
-
const style = useMemo14(() => {
|
|
4796
|
-
return {
|
|
4797
|
-
...passedStyle,
|
|
4798
|
-
opacity: premountingActive || postmountingActive ? 0 : passedStyle?.opacity,
|
|
4799
|
-
pointerEvents: premountingActive || postmountingActive ? "none" : passedStyle?.pointerEvents ?? undefined,
|
|
4800
|
-
...premountingActive ? styleWhilePremounted : {},
|
|
4801
|
-
...postmountingActive ? styleWhilePostmounted : {}
|
|
4802
|
-
};
|
|
4803
|
-
}, [
|
|
4804
|
-
passedStyle,
|
|
4805
|
-
premountingActive,
|
|
4851
|
+
const {
|
|
4852
|
+
freezeFrame,
|
|
4853
|
+
isPremountingOrPostmounting,
|
|
4806
4854
|
postmountingActive,
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4855
|
+
premountingActive,
|
|
4856
|
+
premountingStyle
|
|
4857
|
+
} = usePremounting({
|
|
4858
|
+
from,
|
|
4859
|
+
durationInFrames,
|
|
4860
|
+
premountFor,
|
|
4861
|
+
postmountFor,
|
|
4862
|
+
style: passedStyle ?? null,
|
|
4863
|
+
styleWhilePremounted: styleWhilePremounted ?? null,
|
|
4864
|
+
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
4865
|
+
hideWhilePremounted: "opacity"
|
|
4866
|
+
});
|
|
4810
4867
|
return /* @__PURE__ */ jsx12(Freeze, {
|
|
4811
4868
|
frame: freezeFrame,
|
|
4812
|
-
active:
|
|
4869
|
+
active: isPremountingOrPostmounting,
|
|
4813
4870
|
children: /* @__PURE__ */ jsx12(SequenceInner, {
|
|
4814
4871
|
ref,
|
|
4815
4872
|
from,
|
|
4816
4873
|
durationInFrames,
|
|
4817
|
-
style,
|
|
4874
|
+
style: premountingStyle ?? undefined,
|
|
4818
4875
|
_remotionInternalPremountDisplay: premountFor,
|
|
4819
4876
|
_remotionInternalPostmountDisplay: postmountFor,
|
|
4820
4877
|
_remotionInternalIsPremounting: premountingActive,
|
|
@@ -4869,7 +4926,7 @@ import {
|
|
|
4869
4926
|
} from "react";
|
|
4870
4927
|
|
|
4871
4928
|
// src/animated-image/canvas.tsx
|
|
4872
|
-
import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as
|
|
4929
|
+
import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo17, useRef as useRef8 } from "react";
|
|
4873
4930
|
|
|
4874
4931
|
// src/calculate-image-fit.ts
|
|
4875
4932
|
var calculateImageFit = (fit, imageSize, canvasSize) => {
|
|
@@ -5165,7 +5222,7 @@ var runEffectChain = async ({
|
|
|
5165
5222
|
};
|
|
5166
5223
|
|
|
5167
5224
|
// src/effects/use-effect-chain-state.ts
|
|
5168
|
-
import { useEffect as useEffect4, useMemo as
|
|
5225
|
+
import { useEffect as useEffect4, useMemo as useMemo16, useRef as useRef7 } from "react";
|
|
5169
5226
|
var useEffectChainState = () => {
|
|
5170
5227
|
const chainStateRef = useRef7(null);
|
|
5171
5228
|
const sizeRef = useRef7(null);
|
|
@@ -5176,7 +5233,7 @@ var useEffectChainState = () => {
|
|
|
5176
5233
|
}
|
|
5177
5234
|
};
|
|
5178
5235
|
}, []);
|
|
5179
|
-
return
|
|
5236
|
+
return useMemo16(() => ({
|
|
5180
5237
|
get: (width, height) => {
|
|
5181
5238
|
if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
|
|
5182
5239
|
if (chainStateRef.current) {
|
|
@@ -5195,7 +5252,7 @@ import { jsx as jsx13 } from "react/jsx-runtime";
|
|
|
5195
5252
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, ...props }, ref) => {
|
|
5196
5253
|
const canvasRef = useRef8(null);
|
|
5197
5254
|
const chainState = useEffectChainState();
|
|
5198
|
-
const sourceCanvas =
|
|
5255
|
+
const sourceCanvas = useMemo17(() => {
|
|
5199
5256
|
if (typeof document === "undefined") {
|
|
5200
5257
|
return null;
|
|
5201
5258
|
}
|
|
@@ -5693,7 +5750,7 @@ var createEffect = (definition) => {
|
|
|
5693
5750
|
return factory;
|
|
5694
5751
|
};
|
|
5695
5752
|
// src/Artifact.tsx
|
|
5696
|
-
import { useContext as
|
|
5753
|
+
import { useContext as useContext19, useLayoutEffect as useLayoutEffect4, useState as useState8 } from "react";
|
|
5697
5754
|
|
|
5698
5755
|
// src/RenderAssetManager.tsx
|
|
5699
5756
|
import {
|
|
@@ -5701,7 +5758,7 @@ import {
|
|
|
5701
5758
|
useCallback as useCallback8,
|
|
5702
5759
|
useImperativeHandle as useImperativeHandle3,
|
|
5703
5760
|
useLayoutEffect as useLayoutEffect3,
|
|
5704
|
-
useMemo as
|
|
5761
|
+
useMemo as useMemo18,
|
|
5705
5762
|
useRef as useRef10,
|
|
5706
5763
|
useState as useState7
|
|
5707
5764
|
} from "react";
|
|
@@ -5782,7 +5839,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
5782
5839
|
};
|
|
5783
5840
|
}
|
|
5784
5841
|
}, []);
|
|
5785
|
-
const contextValue =
|
|
5842
|
+
const contextValue = useMemo18(() => {
|
|
5786
5843
|
return {
|
|
5787
5844
|
registerRenderAsset,
|
|
5788
5845
|
unregisterRenderAsset,
|
|
@@ -5798,7 +5855,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
5798
5855
|
// src/Artifact.tsx
|
|
5799
5856
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
5800
5857
|
var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
5801
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
5858
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext19(RenderAssetManager);
|
|
5802
5859
|
const env = useRemotionEnvironment();
|
|
5803
5860
|
const frame = useCurrentFrame();
|
|
5804
5861
|
const [id] = useState8(() => {
|
|
@@ -5855,7 +5912,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
5855
5912
|
};
|
|
5856
5913
|
Artifact.Thumbnail = ArtifactThumbnail;
|
|
5857
5914
|
// src/audio/html5-audio.tsx
|
|
5858
|
-
import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as
|
|
5915
|
+
import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as useContext31 } from "react";
|
|
5859
5916
|
|
|
5860
5917
|
// src/absolute-src.ts
|
|
5861
5918
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -5887,7 +5944,7 @@ var calculateMediaDuration = ({
|
|
|
5887
5944
|
};
|
|
5888
5945
|
|
|
5889
5946
|
// src/loop/index.tsx
|
|
5890
|
-
import React17, { createContext as createContext18, useMemo as
|
|
5947
|
+
import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
|
|
5891
5948
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5892
5949
|
var LoopContext = createContext18(null);
|
|
5893
5950
|
var useLoop = () => {
|
|
@@ -5923,14 +5980,14 @@ var Loop = ({
|
|
|
5923
5980
|
const iteration = Math.floor(currentFrame / durationInFrames);
|
|
5924
5981
|
const start = iteration * durationInFrames;
|
|
5925
5982
|
const from = Math.min(start, maxFrame);
|
|
5926
|
-
const loopDisplay =
|
|
5983
|
+
const loopDisplay = useMemo19(() => {
|
|
5927
5984
|
return {
|
|
5928
5985
|
numberOfTimes: Math.min(compDuration / durationInFrames, times),
|
|
5929
5986
|
startOffset: -from,
|
|
5930
5987
|
durationInFrames
|
|
5931
5988
|
};
|
|
5932
5989
|
}, [compDuration, durationInFrames, from, times]);
|
|
5933
|
-
const loopContext =
|
|
5990
|
+
const loopContext = useMemo19(() => {
|
|
5934
5991
|
return {
|
|
5935
5992
|
iteration: Math.floor(currentFrame / durationInFrames),
|
|
5936
5993
|
durationInFrames
|
|
@@ -5954,7 +6011,7 @@ var Loop = ({
|
|
|
5954
6011
|
Loop.useLoop = useLoop;
|
|
5955
6012
|
|
|
5956
6013
|
// src/prefetch.ts
|
|
5957
|
-
import { useContext as
|
|
6014
|
+
import { useContext as useContext20 } from "react";
|
|
5958
6015
|
|
|
5959
6016
|
// src/playback-logging.ts
|
|
5960
6017
|
var playbackLogging = ({
|
|
@@ -6010,7 +6067,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
6010
6067
|
return src.slice(0, hashIndex);
|
|
6011
6068
|
};
|
|
6012
6069
|
var usePreload = (src) => {
|
|
6013
|
-
const preloads2 =
|
|
6070
|
+
const preloads2 = useContext20(PreloadContext);
|
|
6014
6071
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
6015
6072
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
6016
6073
|
if (!preloads2[withoutHashFragment]) {
|
|
@@ -6295,7 +6352,7 @@ var resolveTrimProps = ({
|
|
|
6295
6352
|
};
|
|
6296
6353
|
|
|
6297
6354
|
// src/video/duration-state.tsx
|
|
6298
|
-
import { createContext as createContext20, useMemo as
|
|
6355
|
+
import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
|
|
6299
6356
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
6300
6357
|
var durationReducer = (state, action) => {
|
|
6301
6358
|
switch (action.type) {
|
|
@@ -6321,7 +6378,7 @@ var DurationsContext = createContext20({
|
|
|
6321
6378
|
});
|
|
6322
6379
|
var DurationsContextProvider = ({ children }) => {
|
|
6323
6380
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
6324
|
-
const value =
|
|
6381
|
+
const value = useMemo20(() => {
|
|
6325
6382
|
return {
|
|
6326
6383
|
durations,
|
|
6327
6384
|
setDurations
|
|
@@ -6337,10 +6394,10 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
6337
6394
|
import { useCallback as useCallback13 } from "react";
|
|
6338
6395
|
import React23, {
|
|
6339
6396
|
forwardRef as forwardRef5,
|
|
6340
|
-
useContext as
|
|
6397
|
+
useContext as useContext29,
|
|
6341
6398
|
useEffect as useEffect14,
|
|
6342
6399
|
useImperativeHandle as useImperativeHandle4,
|
|
6343
|
-
useMemo as
|
|
6400
|
+
useMemo as useMemo28,
|
|
6344
6401
|
useRef as useRef19,
|
|
6345
6402
|
useState as useState14
|
|
6346
6403
|
} from "react";
|
|
@@ -6364,16 +6421,16 @@ var getCrossOriginValue = ({
|
|
|
6364
6421
|
};
|
|
6365
6422
|
|
|
6366
6423
|
// src/use-amplification.ts
|
|
6367
|
-
import { useContext as
|
|
6424
|
+
import { useContext as useContext22, useLayoutEffect as useLayoutEffect5, useRef as useRef14 } from "react";
|
|
6368
6425
|
|
|
6369
6426
|
// src/audio/shared-audio-tags.tsx
|
|
6370
6427
|
import React20, {
|
|
6371
6428
|
createContext as createContext21,
|
|
6372
6429
|
createRef as createRef2,
|
|
6373
6430
|
useCallback as useCallback9,
|
|
6374
|
-
useContext as
|
|
6431
|
+
useContext as useContext21,
|
|
6375
6432
|
useEffect as useEffect7,
|
|
6376
|
-
useMemo as
|
|
6433
|
+
useMemo as useMemo22,
|
|
6377
6434
|
useRef as useRef12,
|
|
6378
6435
|
useState as useState10
|
|
6379
6436
|
} from "react";
|
|
@@ -6474,7 +6531,7 @@ var makeSharedElementSourceNode = ({
|
|
|
6474
6531
|
};
|
|
6475
6532
|
|
|
6476
6533
|
// src/audio/use-audio-context.ts
|
|
6477
|
-
import { useMemo as
|
|
6534
|
+
import { useMemo as useMemo21, useRef as useRef11 } from "react";
|
|
6478
6535
|
var warned = false;
|
|
6479
6536
|
var warnOnce = (logLevel) => {
|
|
6480
6537
|
if (warned) {
|
|
@@ -6496,7 +6553,7 @@ var useSingletonAudioContext = ({
|
|
|
6496
6553
|
if (sampleRate !== initialSampleRate.current) {
|
|
6497
6554
|
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.`);
|
|
6498
6555
|
}
|
|
6499
|
-
const context =
|
|
6556
|
+
const context = useMemo21(() => {
|
|
6500
6557
|
if (env.isRendering) {
|
|
6501
6558
|
return null;
|
|
6502
6559
|
}
|
|
@@ -6635,9 +6692,9 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6635
6692
|
});
|
|
6636
6693
|
const audioContextIsPlayingEventually = useRef12(false);
|
|
6637
6694
|
const isResuming = useRef12(null);
|
|
6638
|
-
const audioSyncAnchor =
|
|
6695
|
+
const audioSyncAnchor = useMemo22(() => ({ value: 0 }), []);
|
|
6639
6696
|
const audioSyncAnchorListeners = useRef12([]);
|
|
6640
|
-
const audioSyncAnchorEmitter =
|
|
6697
|
+
const audioSyncAnchorEmitter = useMemo22(() => {
|
|
6641
6698
|
return {
|
|
6642
6699
|
dispatch: (event) => {
|
|
6643
6700
|
audioSyncAnchorListeners.current.forEach((l) => l(event));
|
|
@@ -6657,7 +6714,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6657
6714
|
const unscheduleAudioNode = useCallback9((node) => {
|
|
6658
6715
|
nodesToResume.current.delete(node);
|
|
6659
6716
|
}, []);
|
|
6660
|
-
const scheduleAudioNode =
|
|
6717
|
+
const scheduleAudioNode = useMemo22(() => {
|
|
6661
6718
|
return ({
|
|
6662
6719
|
node,
|
|
6663
6720
|
mediaTimestamp,
|
|
@@ -6749,7 +6806,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6749
6806
|
audioContextIsPlayingEventually.current = false;
|
|
6750
6807
|
return ctxAndGain.suspend();
|
|
6751
6808
|
}, [ctxAndGain]);
|
|
6752
|
-
const audioContextValue =
|
|
6809
|
+
const audioContextValue = useMemo22(() => {
|
|
6753
6810
|
return {
|
|
6754
6811
|
audioContext: ctxAndGain?.audioContext ?? null,
|
|
6755
6812
|
getAudioContextState: () => ctxAndGain?.getState() ?? null,
|
|
@@ -6786,10 +6843,10 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6786
6843
|
const logLevel = useLogLevel();
|
|
6787
6844
|
const mountTime = useMountTime();
|
|
6788
6845
|
const env = useRemotionEnvironment();
|
|
6789
|
-
const audioCtx =
|
|
6846
|
+
const audioCtx = useContext21(SharedAudioContext);
|
|
6790
6847
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
6791
6848
|
const resume = audioCtx?.resume;
|
|
6792
|
-
const refs =
|
|
6849
|
+
const refs = useMemo22(() => {
|
|
6793
6850
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
6794
6851
|
const ref = createRef2();
|
|
6795
6852
|
return {
|
|
@@ -6928,7 +6985,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6928
6985
|
});
|
|
6929
6986
|
resume?.();
|
|
6930
6987
|
}, [logLevel, mountTime, refs, env.isPlayer, resume]);
|
|
6931
|
-
const audioTagsValue =
|
|
6988
|
+
const audioTagsValue = useMemo22(() => {
|
|
6932
6989
|
return {
|
|
6933
6990
|
registerAudio,
|
|
6934
6991
|
unregisterAudio,
|
|
@@ -6943,7 +7000,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6943
7000
|
unregisterAudio,
|
|
6944
7001
|
updateAudio
|
|
6945
7002
|
]);
|
|
6946
|
-
const sharedAudioTagElements =
|
|
7003
|
+
const sharedAudioTagElements = useMemo22(() => {
|
|
6947
7004
|
return refs.map(({ id, ref }) => {
|
|
6948
7005
|
return /* @__PURE__ */ jsx19("audio", {
|
|
6949
7006
|
ref,
|
|
@@ -6966,8 +7023,8 @@ var useSharedAudio = ({
|
|
|
6966
7023
|
premounting,
|
|
6967
7024
|
postmounting
|
|
6968
7025
|
}) => {
|
|
6969
|
-
const audioCtx =
|
|
6970
|
-
const tagsCtx =
|
|
7026
|
+
const audioCtx = useContext21(SharedAudioContext);
|
|
7027
|
+
const tagsCtx = useContext21(SharedAudioTagsContext);
|
|
6971
7028
|
const [elem] = useState10(() => {
|
|
6972
7029
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
6973
7030
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
@@ -7153,7 +7210,7 @@ var useVolume = ({
|
|
|
7153
7210
|
const audioStuffRef = useRef14(null);
|
|
7154
7211
|
const currentVolumeRef = useRef14(volume);
|
|
7155
7212
|
currentVolumeRef.current = volume;
|
|
7156
|
-
const sharedAudioContext =
|
|
7213
|
+
const sharedAudioContext = useContext22(SharedAudioContext);
|
|
7157
7214
|
if (!sharedAudioContext) {
|
|
7158
7215
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
7159
7216
|
}
|
|
@@ -7219,12 +7276,12 @@ var useVolume = ({
|
|
|
7219
7276
|
};
|
|
7220
7277
|
|
|
7221
7278
|
// src/use-media-in-timeline.ts
|
|
7222
|
-
import { useContext as
|
|
7279
|
+
import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState11 } from "react";
|
|
7223
7280
|
|
|
7224
7281
|
// src/audio/use-audio-frame.ts
|
|
7225
|
-
import { useContext as
|
|
7282
|
+
import { useContext as useContext23 } from "react";
|
|
7226
7283
|
var useMediaStartsAt = () => {
|
|
7227
|
-
const parentSequence =
|
|
7284
|
+
const parentSequence = useContext23(SequenceContext);
|
|
7228
7285
|
return parentSequence?.cumulatedNegativeFrom ?? 0;
|
|
7229
7286
|
};
|
|
7230
7287
|
var useFrameForVolumeProp = (behavior) => {
|
|
@@ -7321,7 +7378,7 @@ var useBasicMediaInTimeline = ({
|
|
|
7321
7378
|
if (!src) {
|
|
7322
7379
|
throw new Error("No src passed");
|
|
7323
7380
|
}
|
|
7324
|
-
const parentSequence =
|
|
7381
|
+
const parentSequence = useContext24(SequenceContext);
|
|
7325
7382
|
const [initialVolume] = useState11(() => volume);
|
|
7326
7383
|
const duration = getTimelineDuration({
|
|
7327
7384
|
compositionDurationInFrames: sequenceDurationInFrames,
|
|
@@ -7331,7 +7388,7 @@ var useBasicMediaInTimeline = ({
|
|
|
7331
7388
|
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
|
|
7332
7389
|
loop
|
|
7333
7390
|
});
|
|
7334
|
-
const volumes =
|
|
7391
|
+
const volumes = useMemo23(() => {
|
|
7335
7392
|
if (typeof volume === "number") {
|
|
7336
7393
|
return volume;
|
|
7337
7394
|
}
|
|
@@ -7352,7 +7409,7 @@ var useBasicMediaInTimeline = ({
|
|
|
7352
7409
|
const nonce = useNonce();
|
|
7353
7410
|
const { rootId } = useTimelineContext();
|
|
7354
7411
|
const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
|
|
7355
|
-
const memoizedResult =
|
|
7412
|
+
const memoizedResult = useMemo23(() => {
|
|
7356
7413
|
return {
|
|
7357
7414
|
volumes,
|
|
7358
7415
|
duration,
|
|
@@ -7393,9 +7450,9 @@ var useMediaInTimeline = ({
|
|
|
7393
7450
|
documentationLink,
|
|
7394
7451
|
refForOutline
|
|
7395
7452
|
}) => {
|
|
7396
|
-
const parentSequence =
|
|
7453
|
+
const parentSequence = useContext24(SequenceContext);
|
|
7397
7454
|
const startsAt = useMediaStartsAt();
|
|
7398
|
-
const { registerSequence, unregisterSequence } =
|
|
7455
|
+
const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
|
|
7399
7456
|
const { durationInFrames } = useVideoConfig();
|
|
7400
7457
|
const mediaStartsAt = useMediaStartsAt();
|
|
7401
7458
|
const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
|
|
@@ -7483,25 +7540,25 @@ var useMediaInTimeline = ({
|
|
|
7483
7540
|
// src/use-media-playback.ts
|
|
7484
7541
|
import {
|
|
7485
7542
|
useCallback as useCallback12,
|
|
7486
|
-
useContext as
|
|
7543
|
+
useContext as useContext27,
|
|
7487
7544
|
useEffect as useEffect12,
|
|
7488
7545
|
useLayoutEffect as useLayoutEffect7,
|
|
7489
7546
|
useRef as useRef18
|
|
7490
7547
|
} from "react";
|
|
7491
7548
|
|
|
7492
7549
|
// src/buffer-until-first-frame.ts
|
|
7493
|
-
import { useCallback as useCallback11, useMemo as
|
|
7550
|
+
import { useCallback as useCallback11, useMemo as useMemo26, useRef as useRef16 } from "react";
|
|
7494
7551
|
|
|
7495
7552
|
// src/use-buffer-state.ts
|
|
7496
|
-
import { useContext as
|
|
7553
|
+
import { useContext as useContext26, useMemo as useMemo25 } from "react";
|
|
7497
7554
|
|
|
7498
7555
|
// src/buffering.tsx
|
|
7499
7556
|
import React21, {
|
|
7500
7557
|
useCallback as useCallback10,
|
|
7501
|
-
useContext as
|
|
7558
|
+
useContext as useContext25,
|
|
7502
7559
|
useEffect as useEffect9,
|
|
7503
7560
|
useLayoutEffect as useLayoutEffect6,
|
|
7504
|
-
useMemo as
|
|
7561
|
+
useMemo as useMemo24,
|
|
7505
7562
|
useRef as useRef15,
|
|
7506
7563
|
useState as useState12
|
|
7507
7564
|
} from "react";
|
|
@@ -7587,13 +7644,13 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
7587
7644
|
}
|
|
7588
7645
|
}, [blocks]);
|
|
7589
7646
|
}
|
|
7590
|
-
return
|
|
7647
|
+
return useMemo24(() => {
|
|
7591
7648
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
7592
7649
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
7593
7650
|
};
|
|
7594
7651
|
var BufferingContextReact = React21.createContext(null);
|
|
7595
7652
|
var BufferingProvider = ({ children }) => {
|
|
7596
|
-
const { logLevel, mountTime } =
|
|
7653
|
+
const { logLevel, mountTime } = useContext25(LogLevelContext);
|
|
7597
7654
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
7598
7655
|
return /* @__PURE__ */ jsx20(BufferingContextReact.Provider, {
|
|
7599
7656
|
value: bufferManager,
|
|
@@ -7621,10 +7678,10 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
7621
7678
|
|
|
7622
7679
|
// src/use-buffer-state.ts
|
|
7623
7680
|
var useBufferState = () => {
|
|
7624
|
-
const buffer =
|
|
7681
|
+
const buffer = useContext26(BufferingContextReact);
|
|
7625
7682
|
const logLevel = useLogLevel();
|
|
7626
7683
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
7627
|
-
return
|
|
7684
|
+
return useMemo25(() => ({
|
|
7628
7685
|
delayPlayback: () => {
|
|
7629
7686
|
if (!addBlock) {
|
|
7630
7687
|
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");
|
|
@@ -7734,7 +7791,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
7734
7791
|
onVariableFpsVideoDetected,
|
|
7735
7792
|
pauseWhenBuffering
|
|
7736
7793
|
]);
|
|
7737
|
-
return
|
|
7794
|
+
return useMemo26(() => {
|
|
7738
7795
|
return {
|
|
7739
7796
|
isBuffering: () => bufferingRef.current,
|
|
7740
7797
|
bufferUntilFirstFrame
|
|
@@ -8127,7 +8184,7 @@ var useMediaPlayback = ({
|
|
|
8127
8184
|
const frame = useCurrentFrame();
|
|
8128
8185
|
const absoluteFrame = useTimelinePosition();
|
|
8129
8186
|
const [playing] = usePlayingState();
|
|
8130
|
-
const buffering =
|
|
8187
|
+
const buffering = useContext27(BufferingContextReact);
|
|
8131
8188
|
const { fps } = useVideoConfig();
|
|
8132
8189
|
const mediaStartsAt = useMediaStartsAt();
|
|
8133
8190
|
const lastSeekDueToShift = useRef18(null);
|
|
@@ -8414,7 +8471,7 @@ var useMediaTag = ({
|
|
|
8414
8471
|
};
|
|
8415
8472
|
|
|
8416
8473
|
// src/volume-position-state.ts
|
|
8417
|
-
import { createContext as createContext22, useContext as
|
|
8474
|
+
import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
|
|
8418
8475
|
var MediaVolumeContext = createContext22({
|
|
8419
8476
|
playerMuted: false,
|
|
8420
8477
|
mediaVolume: 1
|
|
@@ -8428,16 +8485,16 @@ var SetMediaVolumeContext = createContext22({
|
|
|
8428
8485
|
}
|
|
8429
8486
|
});
|
|
8430
8487
|
var useMediaVolumeState = () => {
|
|
8431
|
-
const { mediaVolume } =
|
|
8432
|
-
const { setMediaVolume } =
|
|
8433
|
-
return
|
|
8488
|
+
const { mediaVolume } = useContext28(MediaVolumeContext);
|
|
8489
|
+
const { setMediaVolume } = useContext28(SetMediaVolumeContext);
|
|
8490
|
+
return useMemo27(() => {
|
|
8434
8491
|
return [mediaVolume, setMediaVolume];
|
|
8435
8492
|
}, [mediaVolume, setMediaVolume]);
|
|
8436
8493
|
};
|
|
8437
8494
|
var usePlayerMutedState = () => {
|
|
8438
|
-
const { playerMuted } =
|
|
8439
|
-
const { setPlayerMuted } =
|
|
8440
|
-
return
|
|
8495
|
+
const { playerMuted } = useContext28(MediaVolumeContext);
|
|
8496
|
+
const { setPlayerMuted } = useContext28(SetMediaVolumeContext);
|
|
8497
|
+
return useMemo27(() => {
|
|
8441
8498
|
return [playerMuted, setPlayerMuted];
|
|
8442
8499
|
}, [playerMuted, setPlayerMuted]);
|
|
8443
8500
|
};
|
|
@@ -8496,7 +8553,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
8496
8553
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
8497
8554
|
}
|
|
8498
8555
|
const preloadedSrc = usePreload(src);
|
|
8499
|
-
const sequenceContext =
|
|
8556
|
+
const sequenceContext = useContext29(SequenceContext);
|
|
8500
8557
|
const [timelineId] = useState14(() => String(Math.random()));
|
|
8501
8558
|
const userPreferredVolume = evaluateVolume({
|
|
8502
8559
|
frame: volumePropFrame,
|
|
@@ -8509,7 +8566,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
8509
8566
|
requestsVideoFrame: false,
|
|
8510
8567
|
isClientSideRendering: false
|
|
8511
8568
|
});
|
|
8512
|
-
const propsToPass =
|
|
8569
|
+
const propsToPass = useMemo28(() => {
|
|
8513
8570
|
return {
|
|
8514
8571
|
muted: muted || playerMuted || userPreferredVolume <= 0,
|
|
8515
8572
|
src: preloadedSrc,
|
|
@@ -8526,7 +8583,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
8526
8583
|
userPreferredVolume,
|
|
8527
8584
|
crossOriginValue
|
|
8528
8585
|
]);
|
|
8529
|
-
const id =
|
|
8586
|
+
const id = useMemo28(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
8530
8587
|
src,
|
|
8531
8588
|
sequenceContext?.relativeFrom,
|
|
8532
8589
|
sequenceContext?.cumulatedFrom,
|
|
@@ -8636,11 +8693,11 @@ var AudioForPreview = forwardRef5(AudioForDevelopmentForwardRefFunction);
|
|
|
8636
8693
|
// src/audio/AudioForRendering.tsx
|
|
8637
8694
|
import {
|
|
8638
8695
|
forwardRef as forwardRef6,
|
|
8639
|
-
useContext as
|
|
8696
|
+
useContext as useContext30,
|
|
8640
8697
|
useEffect as useEffect15,
|
|
8641
8698
|
useImperativeHandle as useImperativeHandle5,
|
|
8642
8699
|
useLayoutEffect as useLayoutEffect8,
|
|
8643
|
-
useMemo as
|
|
8700
|
+
useMemo as useMemo29,
|
|
8644
8701
|
useRef as useRef20
|
|
8645
8702
|
} from "react";
|
|
8646
8703
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
@@ -8668,10 +8725,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
8668
8725
|
const absoluteFrame = useTimelinePosition();
|
|
8669
8726
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
8670
8727
|
const frame = useCurrentFrame();
|
|
8671
|
-
const sequenceContext =
|
|
8672
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
8728
|
+
const sequenceContext = useContext30(SequenceContext);
|
|
8729
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
|
|
8673
8730
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
8674
|
-
const id =
|
|
8731
|
+
const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
8675
8732
|
props.src,
|
|
8676
8733
|
sequenceContext?.relativeFrom,
|
|
8677
8734
|
sequenceContext?.cumulatedFrom,
|
|
@@ -8781,7 +8838,7 @@ var AudioForRendering = forwardRef6(AudioForRenderingRefForwardingFunction);
|
|
|
8781
8838
|
// src/audio/html5-audio.tsx
|
|
8782
8839
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
8783
8840
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
8784
|
-
const audioTagsContext =
|
|
8841
|
+
const audioTagsContext = useContext31(SharedAudioTagsContext);
|
|
8785
8842
|
const propsWithFreeze = props;
|
|
8786
8843
|
const {
|
|
8787
8844
|
startFrom,
|
|
@@ -8805,7 +8862,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
8805
8862
|
if (typeof freeze !== "undefined") {
|
|
8806
8863
|
throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');
|
|
8807
8864
|
}
|
|
8808
|
-
const { durations, setDurations } =
|
|
8865
|
+
const { durations, setDurations } = useContext31(DurationsContext);
|
|
8809
8866
|
if (typeof props.src !== "string") {
|
|
8810
8867
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
8811
8868
|
}
|
|
@@ -8910,7 +8967,7 @@ import {
|
|
|
8910
8967
|
useCallback as useCallback15,
|
|
8911
8968
|
useEffect as useEffect16,
|
|
8912
8969
|
useImperativeHandle as useImperativeHandle6,
|
|
8913
|
-
useMemo as
|
|
8970
|
+
useMemo as useMemo30,
|
|
8914
8971
|
useRef as useRef21,
|
|
8915
8972
|
useState as useState15
|
|
8916
8973
|
} from "react";
|
|
@@ -8978,7 +9035,7 @@ var SolidInner = ({
|
|
|
8978
9035
|
effects,
|
|
8979
9036
|
overrideId: overrideId ?? null
|
|
8980
9037
|
});
|
|
8981
|
-
const sourceCanvas =
|
|
9038
|
+
const sourceCanvas = useMemo30(() => {
|
|
8982
9039
|
if (typeof document === "undefined") {
|
|
8983
9040
|
return null;
|
|
8984
9041
|
}
|
|
@@ -9046,7 +9103,7 @@ var SolidInner = ({
|
|
|
9046
9103
|
cancelRender2,
|
|
9047
9104
|
memoizedEffects
|
|
9048
9105
|
]);
|
|
9049
|
-
const canvasStyle =
|
|
9106
|
+
const canvasStyle = useMemo30(() => {
|
|
9050
9107
|
return {
|
|
9051
9108
|
width,
|
|
9052
9109
|
height,
|
|
@@ -9125,9 +9182,9 @@ import {
|
|
|
9125
9182
|
createContext as createContext23,
|
|
9126
9183
|
forwardRef as forwardRef9,
|
|
9127
9184
|
useCallback as useCallback16,
|
|
9128
|
-
useContext as
|
|
9185
|
+
useContext as useContext32,
|
|
9129
9186
|
useLayoutEffect as useLayoutEffect9,
|
|
9130
|
-
useMemo as
|
|
9187
|
+
useMemo as useMemo31,
|
|
9131
9188
|
useRef as useRef22
|
|
9132
9189
|
} from "react";
|
|
9133
9190
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
@@ -9206,12 +9263,12 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9206
9263
|
controls,
|
|
9207
9264
|
style
|
|
9208
9265
|
}, ref) => {
|
|
9209
|
-
const ancestor =
|
|
9266
|
+
const ancestor = useContext32(HtmlInCanvasAncestorContext);
|
|
9210
9267
|
assertHtmlInCanvasDimensions(width, height);
|
|
9211
9268
|
const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
|
|
9212
9269
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
9213
9270
|
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
9214
|
-
const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
9271
|
+
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
9215
9272
|
const { isClientSideRendering, isRendering } = useRemotionEnvironment();
|
|
9216
9273
|
const canRetryMissingPaintRecord = !isRendering || isClientSideRendering;
|
|
9217
9274
|
const usesDirectLayoutCanvas = onPaint === undefined && onInit === undefined;
|
|
@@ -9265,7 +9322,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9265
9322
|
if (!placeholderCanvas) {
|
|
9266
9323
|
throw new Error("Canvas not found");
|
|
9267
9324
|
}
|
|
9268
|
-
const handle =
|
|
9325
|
+
const handle = delayRender2("onPaint");
|
|
9269
9326
|
if (!initializedRef.current) {
|
|
9270
9327
|
const currentOnInit = onInitRef.current;
|
|
9271
9328
|
if (!currentOnInit) {
|
|
@@ -9366,6 +9423,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9366
9423
|
chainState,
|
|
9367
9424
|
continueRender2,
|
|
9368
9425
|
cancelRender2,
|
|
9426
|
+
delayRender2,
|
|
9369
9427
|
resolvedPixelDensity,
|
|
9370
9428
|
canRetryMissingPaintRecord
|
|
9371
9429
|
]);
|
|
@@ -9417,28 +9475,28 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
9417
9475
|
if (!canvas) {
|
|
9418
9476
|
return;
|
|
9419
9477
|
}
|
|
9420
|
-
const handle =
|
|
9478
|
+
const handle = delayRender2("waiting for first paint after canvas resize");
|
|
9421
9479
|
canvas.addEventListener("paint", () => {
|
|
9422
9480
|
continueRender2(handle);
|
|
9423
9481
|
}, { once: true });
|
|
9424
9482
|
return () => {
|
|
9425
9483
|
continueRender2(handle);
|
|
9426
9484
|
};
|
|
9427
|
-
}, [width, height, continueRender2, canvasSizeKey]);
|
|
9428
|
-
const innerStyle =
|
|
9485
|
+
}, [width, height, continueRender2, delayRender2, canvasSizeKey]);
|
|
9486
|
+
const innerStyle = useMemo31(() => {
|
|
9429
9487
|
return {
|
|
9430
9488
|
width,
|
|
9431
9489
|
height
|
|
9432
9490
|
};
|
|
9433
9491
|
}, [width, height]);
|
|
9434
|
-
const canvasStyle =
|
|
9492
|
+
const canvasStyle = useMemo31(() => {
|
|
9435
9493
|
return {
|
|
9436
9494
|
width,
|
|
9437
9495
|
height,
|
|
9438
9496
|
...style ?? {}
|
|
9439
9497
|
};
|
|
9440
9498
|
}, [height, style, width]);
|
|
9441
|
-
const ancestorValue =
|
|
9499
|
+
const ancestorValue = useMemo31(() => {
|
|
9442
9500
|
return {
|
|
9443
9501
|
requestParentPaint: () => {
|
|
9444
9502
|
canvas2dRef.current?.requestPaint?.();
|
|
@@ -9538,10 +9596,10 @@ addSequenceStackTraces(HtmlInCanvas);
|
|
|
9538
9596
|
import {
|
|
9539
9597
|
forwardRef as forwardRef10,
|
|
9540
9598
|
useCallback as useCallback17,
|
|
9541
|
-
useContext as
|
|
9599
|
+
useContext as useContext33,
|
|
9542
9600
|
useImperativeHandle as useImperativeHandle7,
|
|
9543
9601
|
useLayoutEffect as useLayoutEffect10,
|
|
9544
|
-
useMemo as
|
|
9602
|
+
useMemo as useMemo32,
|
|
9545
9603
|
useRef as useRef23,
|
|
9546
9604
|
useState as useState16
|
|
9547
9605
|
} from "react";
|
|
@@ -9668,7 +9726,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
9668
9726
|
effects,
|
|
9669
9727
|
overrideId: controls?.overrideId ?? null
|
|
9670
9728
|
});
|
|
9671
|
-
const sequenceContext =
|
|
9729
|
+
const sequenceContext = useContext33(SequenceContext);
|
|
9672
9730
|
const pendingLoadDelayRef = useRef23(null);
|
|
9673
9731
|
const [isLoadPending, setIsLoadPending] = useState16(false);
|
|
9674
9732
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
@@ -9685,7 +9743,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
9685
9743
|
continueRender2(pending.handle);
|
|
9686
9744
|
pendingLoadDelayRef.current = null;
|
|
9687
9745
|
}, [continueRender2]);
|
|
9688
|
-
const sourceCanvas =
|
|
9746
|
+
const sourceCanvas = useMemo32(() => {
|
|
9689
9747
|
if (typeof document === "undefined") {
|
|
9690
9748
|
return null;
|
|
9691
9749
|
}
|
|
@@ -10024,7 +10082,7 @@ var IFrame = forwardRef11(IFrameRefForwarding);
|
|
|
10024
10082
|
// src/Img.tsx
|
|
10025
10083
|
import {
|
|
10026
10084
|
useCallback as useCallback19,
|
|
10027
|
-
useContext as
|
|
10085
|
+
useContext as useContext34,
|
|
10028
10086
|
useLayoutEffect as useLayoutEffect11,
|
|
10029
10087
|
useRef as useRef24,
|
|
10030
10088
|
useState as useState18
|
|
@@ -10050,7 +10108,7 @@ var ImgContent = ({
|
|
|
10050
10108
|
const imageRef = useRef24(null);
|
|
10051
10109
|
const errors = useRef24({});
|
|
10052
10110
|
const { delayPlayback } = useBufferState();
|
|
10053
|
-
const sequenceContext =
|
|
10111
|
+
const sequenceContext = useContext34(SequenceContext);
|
|
10054
10112
|
const [isLoading, setIsLoading] = useState18(false);
|
|
10055
10113
|
const _propsValid = true;
|
|
10056
10114
|
if (!_propsValid) {
|
|
@@ -10402,7 +10460,10 @@ var makeRemotionComponentIdentity = ({
|
|
|
10402
10460
|
};
|
|
10403
10461
|
var interactiveElementSchema = {
|
|
10404
10462
|
...baseSchema,
|
|
10405
|
-
...transformSchema
|
|
10463
|
+
...transformSchema
|
|
10464
|
+
};
|
|
10465
|
+
var interactiveTextElementSchema = {
|
|
10466
|
+
...interactiveElementSchema,
|
|
10406
10467
|
...textSchema,
|
|
10407
10468
|
...textContentSchema
|
|
10408
10469
|
};
|
|
@@ -10418,7 +10479,7 @@ var withSchema = (options) => {
|
|
|
10418
10479
|
addSequenceStackTraces(Wrapped);
|
|
10419
10480
|
return Wrapped;
|
|
10420
10481
|
};
|
|
10421
|
-
var makeInteractiveElement = (tag, displayName) => {
|
|
10482
|
+
var makeInteractiveElement = (tag, displayName, schema) => {
|
|
10422
10483
|
const Inner = forwardRef12((propsWithControls, ref) => {
|
|
10423
10484
|
const {
|
|
10424
10485
|
durationInFrames,
|
|
@@ -10464,12 +10525,18 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
10464
10525
|
packageName: "remotion",
|
|
10465
10526
|
componentName: displayName.slice(1, -1)
|
|
10466
10527
|
}),
|
|
10467
|
-
schema
|
|
10528
|
+
schema,
|
|
10468
10529
|
supportsEffects: false
|
|
10469
10530
|
});
|
|
10470
10531
|
Wrapped.displayName = displayName;
|
|
10471
10532
|
return Wrapped;
|
|
10472
10533
|
};
|
|
10534
|
+
var makeInteractiveTextElement = (tag, displayName) => {
|
|
10535
|
+
return makeInteractiveElement(tag, displayName, interactiveTextElementSchema);
|
|
10536
|
+
};
|
|
10537
|
+
var makeInteractiveNonTextElement = (tag, displayName) => {
|
|
10538
|
+
return makeInteractiveElement(tag, displayName, interactiveElementSchema);
|
|
10539
|
+
};
|
|
10473
10540
|
var Interactive = {
|
|
10474
10541
|
baseSchema,
|
|
10475
10542
|
transformSchema,
|
|
@@ -10478,41 +10545,41 @@ var Interactive = {
|
|
|
10478
10545
|
sequenceSchema,
|
|
10479
10546
|
withSchema,
|
|
10480
10547
|
_internalMakeRemotionComponentIdentity: makeRemotionComponentIdentity,
|
|
10481
|
-
A:
|
|
10482
|
-
Article:
|
|
10483
|
-
Aside:
|
|
10484
|
-
Button:
|
|
10485
|
-
Circle:
|
|
10486
|
-
Code:
|
|
10487
|
-
Div:
|
|
10488
|
-
Ellipse:
|
|
10489
|
-
Em:
|
|
10490
|
-
Footer:
|
|
10491
|
-
G:
|
|
10492
|
-
H1:
|
|
10493
|
-
H2:
|
|
10494
|
-
H3:
|
|
10495
|
-
H4:
|
|
10496
|
-
H5:
|
|
10497
|
-
H6:
|
|
10498
|
-
Header:
|
|
10499
|
-
Label:
|
|
10500
|
-
Li:
|
|
10501
|
-
Line:
|
|
10502
|
-
Main:
|
|
10503
|
-
Nav:
|
|
10504
|
-
Ol:
|
|
10505
|
-
P:
|
|
10506
|
-
Path:
|
|
10507
|
-
Pre:
|
|
10508
|
-
Rect:
|
|
10509
|
-
Section:
|
|
10510
|
-
Small:
|
|
10511
|
-
Span:
|
|
10512
|
-
Strong:
|
|
10513
|
-
Svg:
|
|
10514
|
-
Text:
|
|
10515
|
-
Ul:
|
|
10548
|
+
A: makeInteractiveTextElement("a", "<Interactive.A>"),
|
|
10549
|
+
Article: makeInteractiveTextElement("article", "<Interactive.Article>"),
|
|
10550
|
+
Aside: makeInteractiveTextElement("aside", "<Interactive.Aside>"),
|
|
10551
|
+
Button: makeInteractiveTextElement("button", "<Interactive.Button>"),
|
|
10552
|
+
Circle: makeInteractiveNonTextElement("circle", "<Interactive.Circle>"),
|
|
10553
|
+
Code: makeInteractiveTextElement("code", "<Interactive.Code>"),
|
|
10554
|
+
Div: makeInteractiveTextElement("div", "<Interactive.Div>"),
|
|
10555
|
+
Ellipse: makeInteractiveNonTextElement("ellipse", "<Interactive.Ellipse>"),
|
|
10556
|
+
Em: makeInteractiveTextElement("em", "<Interactive.Em>"),
|
|
10557
|
+
Footer: makeInteractiveTextElement("footer", "<Interactive.Footer>"),
|
|
10558
|
+
G: makeInteractiveNonTextElement("g", "<Interactive.G>"),
|
|
10559
|
+
H1: makeInteractiveTextElement("h1", "<Interactive.H1>"),
|
|
10560
|
+
H2: makeInteractiveTextElement("h2", "<Interactive.H2>"),
|
|
10561
|
+
H3: makeInteractiveTextElement("h3", "<Interactive.H3>"),
|
|
10562
|
+
H4: makeInteractiveTextElement("h4", "<Interactive.H4>"),
|
|
10563
|
+
H5: makeInteractiveTextElement("h5", "<Interactive.H5>"),
|
|
10564
|
+
H6: makeInteractiveTextElement("h6", "<Interactive.H6>"),
|
|
10565
|
+
Header: makeInteractiveTextElement("header", "<Interactive.Header>"),
|
|
10566
|
+
Label: makeInteractiveTextElement("label", "<Interactive.Label>"),
|
|
10567
|
+
Li: makeInteractiveTextElement("li", "<Interactive.Li>"),
|
|
10568
|
+
Line: makeInteractiveNonTextElement("line", "<Interactive.Line>"),
|
|
10569
|
+
Main: makeInteractiveTextElement("main", "<Interactive.Main>"),
|
|
10570
|
+
Nav: makeInteractiveTextElement("nav", "<Interactive.Nav>"),
|
|
10571
|
+
Ol: makeInteractiveTextElement("ol", "<Interactive.Ol>"),
|
|
10572
|
+
P: makeInteractiveTextElement("p", "<Interactive.P>"),
|
|
10573
|
+
Path: makeInteractiveNonTextElement("path", "<Interactive.Path>"),
|
|
10574
|
+
Pre: makeInteractiveTextElement("pre", "<Interactive.Pre>"),
|
|
10575
|
+
Rect: makeInteractiveNonTextElement("rect", "<Interactive.Rect>"),
|
|
10576
|
+
Section: makeInteractiveTextElement("section", "<Interactive.Section>"),
|
|
10577
|
+
Small: makeInteractiveTextElement("small", "<Interactive.Small>"),
|
|
10578
|
+
Span: makeInteractiveTextElement("span", "<Interactive.Span>"),
|
|
10579
|
+
Strong: makeInteractiveTextElement("strong", "<Interactive.Strong>"),
|
|
10580
|
+
Svg: makeInteractiveNonTextElement("svg", "<Interactive.Svg>"),
|
|
10581
|
+
Text: makeInteractiveTextElement("text", "<Interactive.Text>"),
|
|
10582
|
+
Ul: makeInteractiveTextElement("ul", "<Interactive.Ul>")
|
|
10516
10583
|
};
|
|
10517
10584
|
// src/internals.ts
|
|
10518
10585
|
import { createRef as createRef3 } from "react";
|
|
@@ -10525,7 +10592,7 @@ var compositionsRef = React31.createRef();
|
|
|
10525
10592
|
import {
|
|
10526
10593
|
useCallback as useCallback21,
|
|
10527
10594
|
useImperativeHandle as useImperativeHandle8,
|
|
10528
|
-
useMemo as
|
|
10595
|
+
useMemo as useMemo33,
|
|
10529
10596
|
useRef as useRef26,
|
|
10530
10597
|
useState as useState19
|
|
10531
10598
|
} from "react";
|
|
@@ -10584,7 +10651,7 @@ var CompositionManagerProvider = ({
|
|
|
10584
10651
|
getCompositions: () => currentcompositionsRef.current
|
|
10585
10652
|
};
|
|
10586
10653
|
}, []);
|
|
10587
|
-
const compositionManagerSetters =
|
|
10654
|
+
const compositionManagerSetters = useMemo33(() => {
|
|
10588
10655
|
return {
|
|
10589
10656
|
registerComposition,
|
|
10590
10657
|
unregisterComposition,
|
|
@@ -10600,7 +10667,7 @@ var CompositionManagerProvider = ({
|
|
|
10600
10667
|
unregisterFolder,
|
|
10601
10668
|
onlyRenderComposition
|
|
10602
10669
|
]);
|
|
10603
|
-
const compositionManagerContextValue =
|
|
10670
|
+
const compositionManagerContextValue = useMemo33(() => {
|
|
10604
10671
|
return {
|
|
10605
10672
|
compositions,
|
|
10606
10673
|
folders,
|
|
@@ -10719,14 +10786,14 @@ var waitForRoot = (fn) => {
|
|
|
10719
10786
|
};
|
|
10720
10787
|
|
|
10721
10788
|
// src/RemotionRoot.tsx
|
|
10722
|
-
import { useMemo as
|
|
10789
|
+
import { useMemo as useMemo35 } from "react";
|
|
10723
10790
|
|
|
10724
10791
|
// src/use-media-enabled.tsx
|
|
10725
|
-
import { createContext as createContext24, useContext as
|
|
10792
|
+
import { createContext as createContext24, useContext as useContext35, useMemo as useMemo34 } from "react";
|
|
10726
10793
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
10727
10794
|
var MediaEnabledContext = createContext24(null);
|
|
10728
10795
|
var useVideoEnabled = () => {
|
|
10729
|
-
const context =
|
|
10796
|
+
const context = useContext35(MediaEnabledContext);
|
|
10730
10797
|
if (!context) {
|
|
10731
10798
|
return window.remotion_videoEnabled;
|
|
10732
10799
|
}
|
|
@@ -10736,7 +10803,7 @@ var useVideoEnabled = () => {
|
|
|
10736
10803
|
return context.videoEnabled;
|
|
10737
10804
|
};
|
|
10738
10805
|
var useAudioEnabled = () => {
|
|
10739
|
-
const context =
|
|
10806
|
+
const context = useContext35(MediaEnabledContext);
|
|
10740
10807
|
if (!context) {
|
|
10741
10808
|
return window.remotion_audioEnabled;
|
|
10742
10809
|
}
|
|
@@ -10750,7 +10817,7 @@ var MediaEnabledProvider = ({
|
|
|
10750
10817
|
videoEnabled,
|
|
10751
10818
|
audioEnabled
|
|
10752
10819
|
}) => {
|
|
10753
|
-
const value =
|
|
10820
|
+
const value = useMemo34(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
10754
10821
|
return /* @__PURE__ */ jsx31(MediaEnabledContext.Provider, {
|
|
10755
10822
|
value,
|
|
10756
10823
|
children
|
|
@@ -10769,13 +10836,13 @@ var RemotionRootContexts = ({
|
|
|
10769
10836
|
audioEnabled,
|
|
10770
10837
|
frameState
|
|
10771
10838
|
}) => {
|
|
10772
|
-
const nonceContext =
|
|
10839
|
+
const nonceContext = useMemo35(() => {
|
|
10773
10840
|
let counter = 0;
|
|
10774
10841
|
return {
|
|
10775
10842
|
getNonce: () => counter++
|
|
10776
10843
|
};
|
|
10777
10844
|
}, []);
|
|
10778
|
-
const logging =
|
|
10845
|
+
const logging = useMemo35(() => {
|
|
10779
10846
|
return { logLevel, mountTime: Date.now() };
|
|
10780
10847
|
}, [logLevel]);
|
|
10781
10848
|
return /* @__PURE__ */ jsx32(LogLevelContext.Provider, {
|
|
@@ -11081,7 +11148,7 @@ var useCurrentScale = (options) => {
|
|
|
11081
11148
|
return hasContext.scale;
|
|
11082
11149
|
}
|
|
11083
11150
|
return calculateScale({
|
|
11084
|
-
canvasSize: hasContext.
|
|
11151
|
+
canvasSize: hasContext.canvasSizeForAuto,
|
|
11085
11152
|
compositionHeight: config.height,
|
|
11086
11153
|
compositionWidth: config.width,
|
|
11087
11154
|
previewSize: zoomContext.size.size
|
|
@@ -11089,7 +11156,7 @@ var useCurrentScale = (options) => {
|
|
|
11089
11156
|
};
|
|
11090
11157
|
|
|
11091
11158
|
// src/use-pixel-density.ts
|
|
11092
|
-
import React36, { useContext as
|
|
11159
|
+
import React36, { useContext as useContext36 } from "react";
|
|
11093
11160
|
var PixelDensityContext = React36.createContext(null);
|
|
11094
11161
|
var getBrowserPixelDensity = () => {
|
|
11095
11162
|
if (typeof window === "undefined") {
|
|
@@ -11098,8 +11165,8 @@ var getBrowserPixelDensity = () => {
|
|
|
11098
11165
|
return window.devicePixelRatio || 1;
|
|
11099
11166
|
};
|
|
11100
11167
|
var usePixelDensity = (options) => {
|
|
11101
|
-
const pixelDensity =
|
|
11102
|
-
const canUseRemotionHooks =
|
|
11168
|
+
const pixelDensity = useContext36(PixelDensityContext);
|
|
11169
|
+
const canUseRemotionHooks = useContext36(CanUseRemotionHooks);
|
|
11103
11170
|
if (pixelDensity !== null) {
|
|
11104
11171
|
return pixelDensity;
|
|
11105
11172
|
}
|
|
@@ -11121,10 +11188,10 @@ import { useCallback as useCallback24 } from "react";
|
|
|
11121
11188
|
// src/video/OffthreadVideoForRendering.tsx
|
|
11122
11189
|
import {
|
|
11123
11190
|
useCallback as useCallback22,
|
|
11124
|
-
useContext as
|
|
11191
|
+
useContext as useContext37,
|
|
11125
11192
|
useEffect as useEffect17,
|
|
11126
11193
|
useLayoutEffect as useLayoutEffect12,
|
|
11127
|
-
useMemo as
|
|
11194
|
+
useMemo as useMemo36,
|
|
11128
11195
|
useState as useState20
|
|
11129
11196
|
} from "react";
|
|
11130
11197
|
|
|
@@ -11164,13 +11231,13 @@ var OffthreadVideoForRendering = ({
|
|
|
11164
11231
|
const frame = useCurrentFrame();
|
|
11165
11232
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
11166
11233
|
const videoConfig = useUnsafeVideoConfig();
|
|
11167
|
-
const sequenceContext =
|
|
11234
|
+
const sequenceContext = useContext37(SequenceContext);
|
|
11168
11235
|
const mediaStartsAt = useMediaStartsAt();
|
|
11169
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
11236
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext37(RenderAssetManager);
|
|
11170
11237
|
if (!src) {
|
|
11171
11238
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
11172
11239
|
}
|
|
11173
|
-
const id =
|
|
11240
|
+
const id = useMemo36(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
11174
11241
|
src,
|
|
11175
11242
|
sequenceContext?.cumulatedFrom,
|
|
11176
11243
|
sequenceContext?.relativeFrom,
|
|
@@ -11225,14 +11292,14 @@ var OffthreadVideoForRendering = ({
|
|
|
11225
11292
|
sequenceContext?.cumulatedNegativeFrom,
|
|
11226
11293
|
audioStreamIndex
|
|
11227
11294
|
]);
|
|
11228
|
-
const currentTime =
|
|
11295
|
+
const currentTime = useMemo36(() => {
|
|
11229
11296
|
return getExpectedMediaFrameUncorrected({
|
|
11230
11297
|
frame,
|
|
11231
11298
|
playbackRate: playbackRate || 1,
|
|
11232
11299
|
startFrom: -mediaStartsAt
|
|
11233
11300
|
}) / videoConfig.fps;
|
|
11234
11301
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
11235
|
-
const actualSrc =
|
|
11302
|
+
const actualSrc = useMemo36(() => {
|
|
11236
11303
|
return getOffthreadVideoSource({
|
|
11237
11304
|
src,
|
|
11238
11305
|
currentTime,
|
|
@@ -11320,7 +11387,7 @@ var OffthreadVideoForRendering = ({
|
|
|
11320
11387
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
11321
11388
|
}
|
|
11322
11389
|
}, [imageSrc, onError]);
|
|
11323
|
-
const className =
|
|
11390
|
+
const className = useMemo36(() => {
|
|
11324
11391
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
11325
11392
|
}, [props2.className]);
|
|
11326
11393
|
const onImageFrame = useCallback22((img) => {
|
|
@@ -11347,10 +11414,10 @@ var OffthreadVideoForRendering = ({
|
|
|
11347
11414
|
import React38, {
|
|
11348
11415
|
forwardRef as forwardRef13,
|
|
11349
11416
|
useCallback as useCallback23,
|
|
11350
|
-
useContext as
|
|
11417
|
+
useContext as useContext38,
|
|
11351
11418
|
useEffect as useEffect19,
|
|
11352
11419
|
useImperativeHandle as useImperativeHandle9,
|
|
11353
|
-
useMemo as
|
|
11420
|
+
useMemo as useMemo37,
|
|
11354
11421
|
useRef as useRef27,
|
|
11355
11422
|
useState as useState21
|
|
11356
11423
|
} from "react";
|
|
@@ -11403,12 +11470,12 @@ class MediaPlaybackError extends Error {
|
|
|
11403
11470
|
// src/video/VideoForPreview.tsx
|
|
11404
11471
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
11405
11472
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
11406
|
-
const context =
|
|
11473
|
+
const context = useContext38(SharedAudioContext);
|
|
11407
11474
|
if (!context) {
|
|
11408
11475
|
throw new Error("SharedAudioContext not found");
|
|
11409
11476
|
}
|
|
11410
11477
|
const videoRef = useRef27(null);
|
|
11411
|
-
const sharedSource =
|
|
11478
|
+
const sharedSource = useMemo37(() => {
|
|
11412
11479
|
if (!context.audioContext) {
|
|
11413
11480
|
return null;
|
|
11414
11481
|
}
|
|
@@ -11460,7 +11527,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11460
11527
|
}
|
|
11461
11528
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
11462
11529
|
const { fps, durationInFrames } = useVideoConfig();
|
|
11463
|
-
const parentSequence =
|
|
11530
|
+
const parentSequence = useContext38(SequenceContext);
|
|
11464
11531
|
const logLevel = useLogLevel();
|
|
11465
11532
|
const mountTime = useMountTime();
|
|
11466
11533
|
const [timelineId] = useState21(() => String(Math.random()));
|
|
@@ -11611,7 +11678,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11611
11678
|
current.preload = "auto";
|
|
11612
11679
|
}
|
|
11613
11680
|
}, []);
|
|
11614
|
-
const actualStyle =
|
|
11681
|
+
const actualStyle = useMemo37(() => {
|
|
11615
11682
|
return {
|
|
11616
11683
|
...style
|
|
11617
11684
|
};
|
|
@@ -11833,7 +11900,7 @@ var watchStaticFile = (fileName, callback) => {
|
|
|
11833
11900
|
};
|
|
11834
11901
|
|
|
11835
11902
|
// src/wrap-remotion-context.tsx
|
|
11836
|
-
import React40, { useMemo as
|
|
11903
|
+
import React40, { useMemo as useMemo38 } from "react";
|
|
11837
11904
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
11838
11905
|
function useRemotionContexts() {
|
|
11839
11906
|
const compositionManagerCtx = React40.useContext(CompositionManager);
|
|
@@ -11850,7 +11917,7 @@ function useRemotionContexts() {
|
|
|
11850
11917
|
const visualModePropStatusesRefContext = React40.useContext(VisualModePropStatusesRefContext);
|
|
11851
11918
|
const bufferManagerContext = React40.useContext(BufferingContextReact);
|
|
11852
11919
|
const logLevelContext = React40.useContext(LogLevelContext);
|
|
11853
|
-
return
|
|
11920
|
+
return useMemo38(() => ({
|
|
11854
11921
|
compositionManagerCtx,
|
|
11855
11922
|
timelineContext,
|
|
11856
11923
|
setTimelineContext,
|
|
@@ -11963,6 +12030,7 @@ var Internals = {
|
|
|
11963
12030
|
textSchema,
|
|
11964
12031
|
transformSchema,
|
|
11965
12032
|
premountSchema,
|
|
12033
|
+
premountStyleSchema,
|
|
11966
12034
|
flattenActiveSchema,
|
|
11967
12035
|
getFlatSchemaWithAllKeys,
|
|
11968
12036
|
RemotionRootContexts,
|
|
@@ -11976,6 +12044,7 @@ var Internals = {
|
|
|
11976
12044
|
truthy,
|
|
11977
12045
|
SequenceContext,
|
|
11978
12046
|
PremountContext,
|
|
12047
|
+
usePremounting,
|
|
11979
12048
|
useRemotionContexts,
|
|
11980
12049
|
RemotionContextProvider,
|
|
11981
12050
|
CSSUtils: exports_default_css,
|
|
@@ -12087,7 +12156,7 @@ var Internals = {
|
|
|
12087
12156
|
// src/series/index.tsx
|
|
12088
12157
|
import React42, {
|
|
12089
12158
|
forwardRef as forwardRef14,
|
|
12090
|
-
useMemo as
|
|
12159
|
+
useMemo as useMemo39
|
|
12091
12160
|
} from "react";
|
|
12092
12161
|
|
|
12093
12162
|
// src/series/flatten-children.tsx
|
|
@@ -12162,7 +12231,7 @@ var validateSeriesSequenceProps = ({
|
|
|
12162
12231
|
return offset;
|
|
12163
12232
|
};
|
|
12164
12233
|
var SeriesInner = (props2) => {
|
|
12165
|
-
const childrenValue =
|
|
12234
|
+
const childrenValue = useMemo39(() => {
|
|
12166
12235
|
const flattenedChildren = flattenChildren(props2.children);
|
|
12167
12236
|
const renderChildren = (i, startFrame) => {
|
|
12168
12237
|
if (i === flattenedChildren.length) {
|
|
@@ -12351,16 +12420,16 @@ var Still = (props2) => {
|
|
|
12351
12420
|
};
|
|
12352
12421
|
addSequenceStackTraces(Still);
|
|
12353
12422
|
// src/video/html5-video.tsx
|
|
12354
|
-
import { forwardRef as forwardRef16, useCallback as useCallback25, useContext as
|
|
12423
|
+
import { forwardRef as forwardRef16, useCallback as useCallback25, useContext as useContext40 } from "react";
|
|
12355
12424
|
|
|
12356
12425
|
// src/video/VideoForRendering.tsx
|
|
12357
12426
|
import {
|
|
12358
12427
|
forwardRef as forwardRef15,
|
|
12359
|
-
useContext as
|
|
12428
|
+
useContext as useContext39,
|
|
12360
12429
|
useEffect as useEffect20,
|
|
12361
12430
|
useImperativeHandle as useImperativeHandle10,
|
|
12362
12431
|
useLayoutEffect as useLayoutEffect13,
|
|
12363
|
-
useMemo as
|
|
12432
|
+
useMemo as useMemo40,
|
|
12364
12433
|
useRef as useRef28
|
|
12365
12434
|
} from "react";
|
|
12366
12435
|
|
|
@@ -12512,14 +12581,14 @@ var VideoForRenderingForwardFunction = ({
|
|
|
12512
12581
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
12513
12582
|
const videoConfig = useUnsafeVideoConfig();
|
|
12514
12583
|
const videoRef = useRef28(null);
|
|
12515
|
-
const sequenceContext =
|
|
12584
|
+
const sequenceContext = useContext39(SequenceContext);
|
|
12516
12585
|
const mediaStartsAt = useMediaStartsAt();
|
|
12517
12586
|
const environment = useRemotionEnvironment();
|
|
12518
12587
|
const logLevel = useLogLevel();
|
|
12519
12588
|
const mountTime = useMountTime();
|
|
12520
12589
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
12521
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
12522
|
-
const id =
|
|
12590
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext39(RenderAssetManager);
|
|
12591
|
+
const id = useMemo40(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
12523
12592
|
props2.src,
|
|
12524
12593
|
sequenceContext?.cumulatedFrom,
|
|
12525
12594
|
sequenceContext?.relativeFrom,
|
|
@@ -12733,7 +12802,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
12733
12802
|
if (environment.isClientSideRendering) {
|
|
12734
12803
|
throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
12735
12804
|
}
|
|
12736
|
-
const { durations, setDurations } =
|
|
12805
|
+
const { durations, setDurations } = useContext40(DurationsContext);
|
|
12737
12806
|
if (typeof ref === "string") {
|
|
12738
12807
|
throw new Error("string refs are not supported");
|
|
12739
12808
|
}
|