remotion 4.0.474 → 4.0.475
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/Img.d.ts +6 -0
- package/dist/cjs/Interactive.d.ts +56 -0
- package/dist/cjs/Interactive.js +119 -0
- package/dist/cjs/animated-image/AnimatedImage.js +1 -1
- package/dist/cjs/canvas-image/CanvasImage.d.ts +6 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/internals.d.ts +18 -0
- package/dist/cjs/interpolate-colors.d.ts +2 -3
- package/dist/cjs/interpolate-colors.js +1 -0
- package/dist/cjs/interpolate-keyframed-status.js +1 -0
- package/dist/cjs/interpolate.js +147 -0
- package/dist/cjs/no-react.d.ts +6 -0
- package/dist/cjs/sequence-field-schema.d.ts +32 -1
- package/dist/cjs/sequence-field-schema.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +360 -122
- package/dist/esm/no-react.mjs +139 -0
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -1291,7 +1291,7 @@ var addSequenceStackTraces = (component) => {
|
|
|
1291
1291
|
};
|
|
1292
1292
|
|
|
1293
1293
|
// src/version.ts
|
|
1294
|
-
var VERSION = "4.0.
|
|
1294
|
+
var VERSION = "4.0.475";
|
|
1295
1295
|
|
|
1296
1296
|
// src/multiple-versions-warning.ts
|
|
1297
1297
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1719,6 +1719,12 @@ var PremountContext = createContext14({
|
|
|
1719
1719
|
|
|
1720
1720
|
// src/sequence-field-schema.ts
|
|
1721
1721
|
var sequenceVisualStyleSchema = {
|
|
1722
|
+
"style.transformOrigin": {
|
|
1723
|
+
type: "transform-origin",
|
|
1724
|
+
step: 1,
|
|
1725
|
+
default: "50% 50%",
|
|
1726
|
+
description: "Transform origin"
|
|
1727
|
+
},
|
|
1722
1728
|
"style.translate": {
|
|
1723
1729
|
type: "translate",
|
|
1724
1730
|
step: 1,
|
|
@@ -2297,6 +2303,32 @@ var lengthUnits = new Set([
|
|
|
2297
2303
|
"vw"
|
|
2298
2304
|
]);
|
|
2299
2305
|
var cssNumberRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/;
|
|
2306
|
+
var transformOriginKeywords = new Set([
|
|
2307
|
+
"left",
|
|
2308
|
+
"center",
|
|
2309
|
+
"right",
|
|
2310
|
+
"top",
|
|
2311
|
+
"bottom"
|
|
2312
|
+
]);
|
|
2313
|
+
var transformOriginKeywordOptions = (keyword) => {
|
|
2314
|
+
if (keyword === "left") {
|
|
2315
|
+
return [{ axis: "x", value: { value: 0, unit: "%" } }];
|
|
2316
|
+
}
|
|
2317
|
+
if (keyword === "right") {
|
|
2318
|
+
return [{ axis: "x", value: { value: 100, unit: "%" } }];
|
|
2319
|
+
}
|
|
2320
|
+
if (keyword === "top") {
|
|
2321
|
+
return [{ axis: "y", value: { value: 0, unit: "%" } }];
|
|
2322
|
+
}
|
|
2323
|
+
if (keyword === "bottom") {
|
|
2324
|
+
return [{ axis: "y", value: { value: 100, unit: "%" } }];
|
|
2325
|
+
}
|
|
2326
|
+
return [
|
|
2327
|
+
{ axis: "x", value: { value: 50, unit: "%" } },
|
|
2328
|
+
{ axis: "y", value: { value: 50, unit: "%" } }
|
|
2329
|
+
];
|
|
2330
|
+
};
|
|
2331
|
+
var transformOriginCenter = { value: 50, unit: "%" };
|
|
2300
2332
|
var stringifyNumber = (value) => {
|
|
2301
2333
|
return String(normalizeNumber(value));
|
|
2302
2334
|
};
|
|
@@ -2321,6 +2353,110 @@ var parseStringInterpolationComponent = (component, value) => {
|
|
|
2321
2353
|
}
|
|
2322
2354
|
throw new TypeError(`Cannot interpolate "${value}" because "${unit}" is not a supported translate or rotate unit`);
|
|
2323
2355
|
};
|
|
2356
|
+
var parseTransformOriginLengthPercentage = ({
|
|
2357
|
+
component,
|
|
2358
|
+
value,
|
|
2359
|
+
allowPercentage
|
|
2360
|
+
}) => {
|
|
2361
|
+
const match = cssNumberRegex.exec(component);
|
|
2362
|
+
if (match === null) {
|
|
2363
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not a supported transform-origin ${allowPercentage ? "length-percentage" : "z length"}`);
|
|
2364
|
+
}
|
|
2365
|
+
const unit = match[2] ?? null;
|
|
2366
|
+
const numberValue = Number(match[1]);
|
|
2367
|
+
if (!Number.isFinite(numberValue)) {
|
|
2368
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not finite`);
|
|
2369
|
+
}
|
|
2370
|
+
if (unit === null || !lengthUnits.has(unit) || !allowPercentage && unit === "%") {
|
|
2371
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not a supported transform-origin ${allowPercentage ? "length-percentage" : "z length"}`);
|
|
2372
|
+
}
|
|
2373
|
+
return { value: numberValue, unit };
|
|
2374
|
+
};
|
|
2375
|
+
var parseTransformOriginToken = (component, value) => {
|
|
2376
|
+
const lower = component.toLowerCase();
|
|
2377
|
+
if (transformOriginKeywords.has(lower)) {
|
|
2378
|
+
return { type: "keyword", keyword: lower };
|
|
2379
|
+
}
|
|
2380
|
+
return {
|
|
2381
|
+
type: "length-percentage",
|
|
2382
|
+
parsed: parseTransformOriginLengthPercentage({
|
|
2383
|
+
component,
|
|
2384
|
+
value,
|
|
2385
|
+
allowPercentage: true
|
|
2386
|
+
})
|
|
2387
|
+
};
|
|
2388
|
+
};
|
|
2389
|
+
var parseTwoTransformOriginKeywords = (first, second, value) => {
|
|
2390
|
+
const candidates = [];
|
|
2391
|
+
for (const firstOption of transformOriginKeywordOptions(first)) {
|
|
2392
|
+
for (const secondOption of transformOriginKeywordOptions(second)) {
|
|
2393
|
+
if (firstOption.axis === secondOption.axis) {
|
|
2394
|
+
continue;
|
|
2395
|
+
}
|
|
2396
|
+
candidates.push(firstOption.axis === "x" ? [firstOption.value, secondOption.value] : [secondOption.value, firstOption.value]);
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
if (candidates.length === 0) {
|
|
2400
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${first} ${second}" is not a valid transform-origin keyword pair`);
|
|
2401
|
+
}
|
|
2402
|
+
return candidates[0];
|
|
2403
|
+
};
|
|
2404
|
+
var parseTransformOriginXY = (parts, value) => {
|
|
2405
|
+
if (parts.length === 1) {
|
|
2406
|
+
const token = parseTransformOriginToken(parts[0], value);
|
|
2407
|
+
if (token.type === "length-percentage") {
|
|
2408
|
+
return [token.parsed, transformOriginCenter];
|
|
2409
|
+
}
|
|
2410
|
+
if (token.keyword === "top" || token.keyword === "bottom") {
|
|
2411
|
+
return [
|
|
2412
|
+
transformOriginCenter,
|
|
2413
|
+
transformOriginKeywordOptions(token.keyword)[0].value
|
|
2414
|
+
];
|
|
2415
|
+
}
|
|
2416
|
+
return [
|
|
2417
|
+
transformOriginKeywordOptions(token.keyword)[0].value,
|
|
2418
|
+
transformOriginCenter
|
|
2419
|
+
];
|
|
2420
|
+
}
|
|
2421
|
+
const first = parseTransformOriginToken(parts[0], value);
|
|
2422
|
+
const second = parseTransformOriginToken(parts[1], value);
|
|
2423
|
+
if (first.type === "length-percentage" && second.type === "length-percentage") {
|
|
2424
|
+
return [first.parsed, second.parsed];
|
|
2425
|
+
}
|
|
2426
|
+
if (first.type === "keyword" && second.type === "keyword") {
|
|
2427
|
+
return parseTwoTransformOriginKeywords(first.keyword, second.keyword, value);
|
|
2428
|
+
}
|
|
2429
|
+
const keyword = first.type === "keyword" ? first : second.type === "keyword" ? second : null;
|
|
2430
|
+
const length = first.type === "length-percentage" ? first.parsed : second.type === "length-percentage" ? second.parsed : null;
|
|
2431
|
+
if (keyword === null || length === null) {
|
|
2432
|
+
throw new Error("Expected a keyword and a length-percentage value");
|
|
2433
|
+
}
|
|
2434
|
+
const keywordIsFirst = first.type === "keyword";
|
|
2435
|
+
if (keyword.keyword === "left" || keyword.keyword === "right") {
|
|
2436
|
+
if (!keywordIsFirst) {
|
|
2437
|
+
throw new TypeError(`Cannot interpolate "${value}" because horizontal transform-origin keywords must come before a length-percentage value`);
|
|
2438
|
+
}
|
|
2439
|
+
return [transformOriginKeywordOptions(keyword.keyword)[0].value, length];
|
|
2440
|
+
}
|
|
2441
|
+
if (keyword.keyword === "top" || keyword.keyword === "bottom") {
|
|
2442
|
+
return [length, transformOriginKeywordOptions(keyword.keyword)[0].value];
|
|
2443
|
+
}
|
|
2444
|
+
return keywordIsFirst ? [transformOriginCenter, length] : [length, transformOriginCenter];
|
|
2445
|
+
};
|
|
2446
|
+
var parseTransformOriginValue = (output, parts) => {
|
|
2447
|
+
const [x, y] = parseTransformOriginXY(parts.slice(0, 2), output);
|
|
2448
|
+
const z = parts[2] === undefined ? { value: 0, unit: null } : parseTransformOriginLengthPercentage({
|
|
2449
|
+
component: parts[2],
|
|
2450
|
+
value: output,
|
|
2451
|
+
allowPercentage: false
|
|
2452
|
+
});
|
|
2453
|
+
return {
|
|
2454
|
+
kind: "translate",
|
|
2455
|
+
values: [x.value, y.value, z.value],
|
|
2456
|
+
units: [x.unit, y.unit, z.unit],
|
|
2457
|
+
dimensions: parts[2] === undefined ? 2 : 3
|
|
2458
|
+
};
|
|
2459
|
+
};
|
|
2324
2460
|
var parseStringInterpolationValue = (output) => {
|
|
2325
2461
|
if (typeof output === "number") {
|
|
2326
2462
|
if (!Number.isFinite(output)) {
|
|
@@ -2337,6 +2473,9 @@ var parseStringInterpolationValue = (output) => {
|
|
|
2337
2473
|
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
2338
2474
|
throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
2339
2475
|
}
|
|
2476
|
+
if (parts.some((part) => transformOriginKeywords.has(part.toLowerCase()))) {
|
|
2477
|
+
return parseTransformOriginValue(output, parts);
|
|
2478
|
+
}
|
|
2340
2479
|
const parsed = parts.map((part) => parseStringInterpolationComponent(part, output));
|
|
2341
2480
|
const [{ kind }] = parsed;
|
|
2342
2481
|
for (const part of parsed) {
|
|
@@ -3094,6 +3233,7 @@ function processColor(color) {
|
|
|
3094
3233
|
var interpolateColorsRGB = (value, inputRange, colors, options) => {
|
|
3095
3234
|
const [r, g, b2, a2] = [red, green, blue, opacity].map((f) => {
|
|
3096
3235
|
const unrounded = interpolate(value, inputRange, colors.map((c2) => f(c2)), {
|
|
3236
|
+
easing: options?.easing,
|
|
3097
3237
|
extrapolateLeft: "clamp",
|
|
3098
3238
|
extrapolateRight: "clamp",
|
|
3099
3239
|
posterize: options?.posterize
|
|
@@ -3149,6 +3289,7 @@ var interpolateKeyframedStatus = ({
|
|
|
3149
3289
|
}
|
|
3150
3290
|
try {
|
|
3151
3291
|
return interpolateColors(frame, inputRange, outputs, {
|
|
3292
|
+
easing: easing.map(easingToFn),
|
|
3152
3293
|
posterize: status.posterize
|
|
3153
3294
|
});
|
|
3154
3295
|
} catch {
|
|
@@ -4611,7 +4752,7 @@ var animatedImageSchema = {
|
|
|
4611
4752
|
max: 10,
|
|
4612
4753
|
step: 0.1,
|
|
4613
4754
|
default: 1,
|
|
4614
|
-
description: "Playback
|
|
4755
|
+
description: "Playback rate",
|
|
4615
4756
|
hiddenFromList: false,
|
|
4616
4757
|
keyframable: false
|
|
4617
4758
|
},
|
|
@@ -9202,22 +9343,118 @@ var Img = wrapInSchema({
|
|
|
9202
9343
|
supportsEffects: true
|
|
9203
9344
|
});
|
|
9204
9345
|
addSequenceStackTraces(Img);
|
|
9346
|
+
// src/Interactive.tsx
|
|
9347
|
+
import React29, { forwardRef as forwardRef12, useCallback as useCallback19, useRef as useRef25 } from "react";
|
|
9348
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
9349
|
+
var interactiveElementSchema = {
|
|
9350
|
+
durationInFrames: durationInFramesField,
|
|
9351
|
+
from: fromField,
|
|
9352
|
+
...sequenceVisualStyleSchema,
|
|
9353
|
+
hidden: hiddenField
|
|
9354
|
+
};
|
|
9355
|
+
var setRef = (ref, value) => {
|
|
9356
|
+
if (typeof ref === "function") {
|
|
9357
|
+
ref(value);
|
|
9358
|
+
} else if (ref) {
|
|
9359
|
+
ref.current = value;
|
|
9360
|
+
}
|
|
9361
|
+
};
|
|
9362
|
+
var makeInteractiveElement = (tag, displayName) => {
|
|
9363
|
+
const Inner = forwardRef12((propsWithControls, ref) => {
|
|
9364
|
+
const {
|
|
9365
|
+
durationInFrames,
|
|
9366
|
+
from,
|
|
9367
|
+
hidden,
|
|
9368
|
+
name,
|
|
9369
|
+
showInTimeline,
|
|
9370
|
+
stack,
|
|
9371
|
+
_experimentalControls,
|
|
9372
|
+
...props2
|
|
9373
|
+
} = propsWithControls;
|
|
9374
|
+
const refForOutline = useRef25(null);
|
|
9375
|
+
const callbackRef = useCallback19((element) => {
|
|
9376
|
+
refForOutline.current = element;
|
|
9377
|
+
setRef(ref, element);
|
|
9378
|
+
}, [ref]);
|
|
9379
|
+
return /* @__PURE__ */ jsx29(Sequence, {
|
|
9380
|
+
layout: "none",
|
|
9381
|
+
from: from ?? 0,
|
|
9382
|
+
durationInFrames: durationInFrames ?? Infinity,
|
|
9383
|
+
hidden,
|
|
9384
|
+
name: name ?? displayName,
|
|
9385
|
+
showInTimeline: showInTimeline ?? true,
|
|
9386
|
+
_experimentalControls,
|
|
9387
|
+
_remotionInternalStack: stack,
|
|
9388
|
+
_remotionInternalRefForOutline: refForOutline,
|
|
9389
|
+
children: React29.createElement(tag, {
|
|
9390
|
+
...props2,
|
|
9391
|
+
ref: callbackRef
|
|
9392
|
+
})
|
|
9393
|
+
});
|
|
9394
|
+
});
|
|
9395
|
+
Inner.displayName = displayName;
|
|
9396
|
+
const Wrapped = wrapInSchema({
|
|
9397
|
+
Component: Inner,
|
|
9398
|
+
schema: interactiveElementSchema,
|
|
9399
|
+
supportsEffects: false
|
|
9400
|
+
});
|
|
9401
|
+
Wrapped.displayName = displayName;
|
|
9402
|
+
addSequenceStackTraces(Wrapped);
|
|
9403
|
+
return Wrapped;
|
|
9404
|
+
};
|
|
9405
|
+
var Interactive = {
|
|
9406
|
+
A: makeInteractiveElement("a", "<Interactive.A>"),
|
|
9407
|
+
Article: makeInteractiveElement("article", "<Interactive.Article>"),
|
|
9408
|
+
Aside: makeInteractiveElement("aside", "<Interactive.Aside>"),
|
|
9409
|
+
Button: makeInteractiveElement("button", "<Interactive.Button>"),
|
|
9410
|
+
Circle: makeInteractiveElement("circle", "<Interactive.Circle>"),
|
|
9411
|
+
Code: makeInteractiveElement("code", "<Interactive.Code>"),
|
|
9412
|
+
Div: makeInteractiveElement("div", "<Interactive.Div>"),
|
|
9413
|
+
Ellipse: makeInteractiveElement("ellipse", "<Interactive.Ellipse>"),
|
|
9414
|
+
Em: makeInteractiveElement("em", "<Interactive.Em>"),
|
|
9415
|
+
Footer: makeInteractiveElement("footer", "<Interactive.Footer>"),
|
|
9416
|
+
G: makeInteractiveElement("g", "<Interactive.G>"),
|
|
9417
|
+
H1: makeInteractiveElement("h1", "<Interactive.H1>"),
|
|
9418
|
+
H2: makeInteractiveElement("h2", "<Interactive.H2>"),
|
|
9419
|
+
H3: makeInteractiveElement("h3", "<Interactive.H3>"),
|
|
9420
|
+
H4: makeInteractiveElement("h4", "<Interactive.H4>"),
|
|
9421
|
+
H5: makeInteractiveElement("h5", "<Interactive.H5>"),
|
|
9422
|
+
H6: makeInteractiveElement("h6", "<Interactive.H6>"),
|
|
9423
|
+
Header: makeInteractiveElement("header", "<Interactive.Header>"),
|
|
9424
|
+
Label: makeInteractiveElement("label", "<Interactive.Label>"),
|
|
9425
|
+
Li: makeInteractiveElement("li", "<Interactive.Li>"),
|
|
9426
|
+
Line: makeInteractiveElement("line", "<Interactive.Line>"),
|
|
9427
|
+
Main: makeInteractiveElement("main", "<Interactive.Main>"),
|
|
9428
|
+
Nav: makeInteractiveElement("nav", "<Interactive.Nav>"),
|
|
9429
|
+
Ol: makeInteractiveElement("ol", "<Interactive.Ol>"),
|
|
9430
|
+
P: makeInteractiveElement("p", "<Interactive.P>"),
|
|
9431
|
+
Path: makeInteractiveElement("path", "<Interactive.Path>"),
|
|
9432
|
+
Pre: makeInteractiveElement("pre", "<Interactive.Pre>"),
|
|
9433
|
+
Rect: makeInteractiveElement("rect", "<Interactive.Rect>"),
|
|
9434
|
+
Section: makeInteractiveElement("section", "<Interactive.Section>"),
|
|
9435
|
+
Small: makeInteractiveElement("small", "<Interactive.Small>"),
|
|
9436
|
+
Span: makeInteractiveElement("span", "<Interactive.Span>"),
|
|
9437
|
+
Strong: makeInteractiveElement("strong", "<Interactive.Strong>"),
|
|
9438
|
+
Svg: makeInteractiveElement("svg", "<Interactive.Svg>"),
|
|
9439
|
+
Text: makeInteractiveElement("text", "<Interactive.Text>"),
|
|
9440
|
+
Ul: makeInteractiveElement("ul", "<Interactive.Ul>")
|
|
9441
|
+
};
|
|
9205
9442
|
// src/internals.ts
|
|
9206
9443
|
import { createRef as createRef3 } from "react";
|
|
9207
9444
|
|
|
9208
9445
|
// src/CompositionManager.tsx
|
|
9209
|
-
import
|
|
9210
|
-
var compositionsRef =
|
|
9446
|
+
import React30 from "react";
|
|
9447
|
+
var compositionsRef = React30.createRef();
|
|
9211
9448
|
|
|
9212
9449
|
// src/CompositionManagerProvider.tsx
|
|
9213
9450
|
import {
|
|
9214
|
-
useCallback as
|
|
9451
|
+
useCallback as useCallback20,
|
|
9215
9452
|
useImperativeHandle as useImperativeHandle8,
|
|
9216
9453
|
useMemo as useMemo32,
|
|
9217
|
-
useRef as
|
|
9454
|
+
useRef as useRef26,
|
|
9218
9455
|
useState as useState18
|
|
9219
9456
|
} from "react";
|
|
9220
|
-
import { jsx as
|
|
9457
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
9221
9458
|
var CompositionManagerProvider = ({
|
|
9222
9459
|
children,
|
|
9223
9460
|
onlyRenderComposition,
|
|
@@ -9228,15 +9465,15 @@ var CompositionManagerProvider = ({
|
|
|
9228
9465
|
const [folders, setFolders] = useState18([]);
|
|
9229
9466
|
const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
|
|
9230
9467
|
const [compositions, setCompositions] = useState18(initialCompositions);
|
|
9231
|
-
const currentcompositionsRef =
|
|
9232
|
-
const updateCompositions =
|
|
9468
|
+
const currentcompositionsRef = useRef26(compositions);
|
|
9469
|
+
const updateCompositions = useCallback20((updateComps) => {
|
|
9233
9470
|
setCompositions((comps) => {
|
|
9234
9471
|
const updated = updateComps(comps);
|
|
9235
9472
|
currentcompositionsRef.current = updated;
|
|
9236
9473
|
return updated;
|
|
9237
9474
|
});
|
|
9238
9475
|
}, []);
|
|
9239
|
-
const registerComposition =
|
|
9476
|
+
const registerComposition = useCallback20((comp) => {
|
|
9240
9477
|
updateCompositions((comps) => {
|
|
9241
9478
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
9242
9479
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -9244,12 +9481,12 @@ var CompositionManagerProvider = ({
|
|
|
9244
9481
|
return [...comps, comp];
|
|
9245
9482
|
});
|
|
9246
9483
|
}, [updateCompositions]);
|
|
9247
|
-
const unregisterComposition =
|
|
9484
|
+
const unregisterComposition = useCallback20((id) => {
|
|
9248
9485
|
setCompositions((comps) => {
|
|
9249
9486
|
return comps.filter((c2) => c2.id !== id);
|
|
9250
9487
|
});
|
|
9251
9488
|
}, []);
|
|
9252
|
-
const registerFolder =
|
|
9489
|
+
const registerFolder = useCallback20((name, parent, nonce, stack) => {
|
|
9253
9490
|
setFolders((prevFolders) => {
|
|
9254
9491
|
return [
|
|
9255
9492
|
...prevFolders,
|
|
@@ -9262,7 +9499,7 @@ var CompositionManagerProvider = ({
|
|
|
9262
9499
|
];
|
|
9263
9500
|
});
|
|
9264
9501
|
}, []);
|
|
9265
|
-
const unregisterFolder =
|
|
9502
|
+
const unregisterFolder = useCallback20((name, parent) => {
|
|
9266
9503
|
setFolders((prevFolders) => {
|
|
9267
9504
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
9268
9505
|
});
|
|
@@ -9296,9 +9533,9 @@ var CompositionManagerProvider = ({
|
|
|
9296
9533
|
canvasContent
|
|
9297
9534
|
};
|
|
9298
9535
|
}, [compositions, folders, currentCompositionMetadata, canvasContent]);
|
|
9299
|
-
return /* @__PURE__ */
|
|
9536
|
+
return /* @__PURE__ */ jsx30(CompositionManager.Provider, {
|
|
9300
9537
|
value: compositionManagerContextValue,
|
|
9301
|
-
children: /* @__PURE__ */
|
|
9538
|
+
children: /* @__PURE__ */ jsx30(CompositionSetters.Provider, {
|
|
9302
9539
|
value: compositionManagerSetters,
|
|
9303
9540
|
children
|
|
9304
9541
|
})
|
|
@@ -9404,8 +9641,8 @@ var getPreviewDomElement = () => {
|
|
|
9404
9641
|
};
|
|
9405
9642
|
|
|
9406
9643
|
// src/max-video-cache-size.ts
|
|
9407
|
-
import
|
|
9408
|
-
var MaxMediaCacheSizeContext =
|
|
9644
|
+
import React31 from "react";
|
|
9645
|
+
var MaxMediaCacheSizeContext = React31.createContext(null);
|
|
9409
9646
|
|
|
9410
9647
|
// src/register-root.ts
|
|
9411
9648
|
var Root = null;
|
|
@@ -9443,7 +9680,7 @@ import { useMemo as useMemo34 } from "react";
|
|
|
9443
9680
|
|
|
9444
9681
|
// src/use-media-enabled.tsx
|
|
9445
9682
|
import { createContext as createContext24, useContext as useContext34, useMemo as useMemo33 } from "react";
|
|
9446
|
-
import { jsx as
|
|
9683
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
9447
9684
|
var MediaEnabledContext = createContext24(null);
|
|
9448
9685
|
var useVideoEnabled = () => {
|
|
9449
9686
|
const context = useContext34(MediaEnabledContext);
|
|
@@ -9471,14 +9708,14 @@ var MediaEnabledProvider = ({
|
|
|
9471
9708
|
audioEnabled
|
|
9472
9709
|
}) => {
|
|
9473
9710
|
const value = useMemo33(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
9474
|
-
return /* @__PURE__ */
|
|
9711
|
+
return /* @__PURE__ */ jsx31(MediaEnabledContext.Provider, {
|
|
9475
9712
|
value,
|
|
9476
9713
|
children
|
|
9477
9714
|
});
|
|
9478
9715
|
};
|
|
9479
9716
|
|
|
9480
9717
|
// src/RemotionRoot.tsx
|
|
9481
|
-
import { jsx as
|
|
9718
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
9482
9719
|
var RemotionRootContexts = ({
|
|
9483
9720
|
children,
|
|
9484
9721
|
numberOfAudioTags,
|
|
@@ -9498,25 +9735,25 @@ var RemotionRootContexts = ({
|
|
|
9498
9735
|
const logging = useMemo34(() => {
|
|
9499
9736
|
return { logLevel, mountTime: Date.now() };
|
|
9500
9737
|
}, [logLevel]);
|
|
9501
|
-
return /* @__PURE__ */
|
|
9738
|
+
return /* @__PURE__ */ jsx32(LogLevelContext.Provider, {
|
|
9502
9739
|
value: logging,
|
|
9503
|
-
children: /* @__PURE__ */
|
|
9740
|
+
children: /* @__PURE__ */ jsx32(NonceContext.Provider, {
|
|
9504
9741
|
value: nonceContext,
|
|
9505
|
-
children: /* @__PURE__ */
|
|
9742
|
+
children: /* @__PURE__ */ jsx32(TimelineContextProvider, {
|
|
9506
9743
|
frameState,
|
|
9507
|
-
children: /* @__PURE__ */
|
|
9744
|
+
children: /* @__PURE__ */ jsx32(MediaEnabledProvider, {
|
|
9508
9745
|
videoEnabled,
|
|
9509
9746
|
audioEnabled,
|
|
9510
|
-
children: /* @__PURE__ */
|
|
9511
|
-
children: /* @__PURE__ */
|
|
9512
|
-
children: /* @__PURE__ */
|
|
9513
|
-
children: /* @__PURE__ */
|
|
9514
|
-
children: /* @__PURE__ */
|
|
9515
|
-
children: /* @__PURE__ */
|
|
9747
|
+
children: /* @__PURE__ */ jsx32(EditorPropsProvider, {
|
|
9748
|
+
children: /* @__PURE__ */ jsx32(PrefetchProvider, {
|
|
9749
|
+
children: /* @__PURE__ */ jsx32(SequenceManagerProvider, {
|
|
9750
|
+
children: /* @__PURE__ */ jsx32(DurationsContextProvider, {
|
|
9751
|
+
children: /* @__PURE__ */ jsx32(BufferingProvider, {
|
|
9752
|
+
children: /* @__PURE__ */ jsx32(SharedAudioContextProvider, {
|
|
9516
9753
|
audioLatencyHint,
|
|
9517
9754
|
audioEnabled,
|
|
9518
9755
|
previewSampleRate,
|
|
9519
|
-
children: /* @__PURE__ */
|
|
9756
|
+
children: /* @__PURE__ */ jsx32(SharedAudioTagsContextProvider, {
|
|
9520
9757
|
numberOfAudioTags,
|
|
9521
9758
|
children
|
|
9522
9759
|
})
|
|
@@ -9710,8 +9947,8 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
9710
9947
|
};
|
|
9711
9948
|
|
|
9712
9949
|
// src/sequence-stack-traces.ts
|
|
9713
|
-
import
|
|
9714
|
-
var SequenceStackTracesUpdateContext =
|
|
9950
|
+
import React33 from "react";
|
|
9951
|
+
var SequenceStackTracesUpdateContext = React33.createContext(() => {});
|
|
9715
9952
|
|
|
9716
9953
|
// src/setup-env-variables.ts
|
|
9717
9954
|
var getEnvVariables = () => {
|
|
@@ -9741,8 +9978,8 @@ var setupEnvVariables = () => {
|
|
|
9741
9978
|
};
|
|
9742
9979
|
|
|
9743
9980
|
// src/use-current-scale.ts
|
|
9744
|
-
import
|
|
9745
|
-
var CurrentScaleContext =
|
|
9981
|
+
import React34, { createContext as createContext25 } from "react";
|
|
9982
|
+
var CurrentScaleContext = React34.createContext(null);
|
|
9746
9983
|
var PreviewSizeContext = createContext25({
|
|
9747
9984
|
setSize: () => {
|
|
9748
9985
|
return;
|
|
@@ -9767,8 +10004,8 @@ var calculateScale = ({
|
|
|
9767
10004
|
return Number(previewSize);
|
|
9768
10005
|
};
|
|
9769
10006
|
var useCurrentScale = (options) => {
|
|
9770
|
-
const hasContext =
|
|
9771
|
-
const zoomContext =
|
|
10007
|
+
const hasContext = React34.useContext(CurrentScaleContext);
|
|
10008
|
+
const zoomContext = React34.useContext(PreviewSizeContext);
|
|
9772
10009
|
const config = useUnsafeVideoConfig();
|
|
9773
10010
|
const env = useRemotionEnvironment();
|
|
9774
10011
|
if (hasContext === null || config === null || zoomContext === null) {
|
|
@@ -9798,8 +10035,8 @@ var useCurrentScale = (options) => {
|
|
|
9798
10035
|
};
|
|
9799
10036
|
|
|
9800
10037
|
// src/use-pixel-density.ts
|
|
9801
|
-
import
|
|
9802
|
-
var PixelDensityContext =
|
|
10038
|
+
import React35, { useContext as useContext35 } from "react";
|
|
10039
|
+
var PixelDensityContext = React35.createContext(null);
|
|
9803
10040
|
var getBrowserPixelDensity = () => {
|
|
9804
10041
|
if (typeof window === "undefined") {
|
|
9805
10042
|
return 1;
|
|
@@ -9825,11 +10062,11 @@ var usePixelDensity = (options) => {
|
|
|
9825
10062
|
};
|
|
9826
10063
|
|
|
9827
10064
|
// src/video/OffthreadVideo.tsx
|
|
9828
|
-
import { useCallback as
|
|
10065
|
+
import { useCallback as useCallback23 } from "react";
|
|
9829
10066
|
|
|
9830
10067
|
// src/video/OffthreadVideoForRendering.tsx
|
|
9831
10068
|
import {
|
|
9832
|
-
useCallback as
|
|
10069
|
+
useCallback as useCallback21,
|
|
9833
10070
|
useContext as useContext36,
|
|
9834
10071
|
useEffect as useEffect18,
|
|
9835
10072
|
useLayoutEffect as useLayoutEffect11,
|
|
@@ -9848,7 +10085,7 @@ var getOffthreadVideoSource = ({
|
|
|
9848
10085
|
};
|
|
9849
10086
|
|
|
9850
10087
|
// src/video/OffthreadVideoForRendering.tsx
|
|
9851
|
-
import { jsx as
|
|
10088
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
9852
10089
|
var OffthreadVideoForRendering = ({
|
|
9853
10090
|
onError,
|
|
9854
10091
|
volume: volumeProp,
|
|
@@ -10022,7 +10259,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10022
10259
|
continueRender2,
|
|
10023
10260
|
delayRender2
|
|
10024
10261
|
]);
|
|
10025
|
-
const onErr =
|
|
10262
|
+
const onErr = useCallback21(() => {
|
|
10026
10263
|
if (onError) {
|
|
10027
10264
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
10028
10265
|
} else {
|
|
@@ -10032,7 +10269,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10032
10269
|
const className = useMemo35(() => {
|
|
10033
10270
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
10034
10271
|
}, [props2.className]);
|
|
10035
|
-
const onImageFrame =
|
|
10272
|
+
const onImageFrame = useCallback21((img) => {
|
|
10036
10273
|
if (onVideoFrame) {
|
|
10037
10274
|
onVideoFrame(img);
|
|
10038
10275
|
}
|
|
@@ -10041,7 +10278,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10041
10278
|
return null;
|
|
10042
10279
|
}
|
|
10043
10280
|
continueRender2(imageSrc.handle);
|
|
10044
|
-
return /* @__PURE__ */
|
|
10281
|
+
return /* @__PURE__ */ jsx33(Img, {
|
|
10045
10282
|
src: imageSrc.src,
|
|
10046
10283
|
delayRenderRetries,
|
|
10047
10284
|
delayRenderTimeoutInMilliseconds,
|
|
@@ -10053,14 +10290,14 @@ var OffthreadVideoForRendering = ({
|
|
|
10053
10290
|
};
|
|
10054
10291
|
|
|
10055
10292
|
// src/video/VideoForPreview.tsx
|
|
10056
|
-
import
|
|
10057
|
-
forwardRef as
|
|
10058
|
-
useCallback as
|
|
10293
|
+
import React37, {
|
|
10294
|
+
forwardRef as forwardRef13,
|
|
10295
|
+
useCallback as useCallback22,
|
|
10059
10296
|
useContext as useContext37,
|
|
10060
10297
|
useEffect as useEffect20,
|
|
10061
10298
|
useImperativeHandle as useImperativeHandle9,
|
|
10062
10299
|
useMemo as useMemo36,
|
|
10063
|
-
useRef as
|
|
10300
|
+
useRef as useRef27,
|
|
10064
10301
|
useState as useState20
|
|
10065
10302
|
} from "react";
|
|
10066
10303
|
|
|
@@ -10110,13 +10347,13 @@ class MediaPlaybackError extends Error {
|
|
|
10110
10347
|
}
|
|
10111
10348
|
|
|
10112
10349
|
// src/video/VideoForPreview.tsx
|
|
10113
|
-
import { jsx as
|
|
10350
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
10114
10351
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
10115
10352
|
const context = useContext37(SharedAudioContext);
|
|
10116
10353
|
if (!context) {
|
|
10117
10354
|
throw new Error("SharedAudioContext not found");
|
|
10118
10355
|
}
|
|
10119
|
-
const videoRef =
|
|
10356
|
+
const videoRef = useRef27(null);
|
|
10120
10357
|
const sharedSource = useMemo36(() => {
|
|
10121
10358
|
if (!context.audioContext) {
|
|
10122
10359
|
return null;
|
|
@@ -10126,7 +10363,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
10126
10363
|
ref: videoRef
|
|
10127
10364
|
});
|
|
10128
10365
|
}, [context.audioContext]);
|
|
10129
|
-
const effectToUse =
|
|
10366
|
+
const effectToUse = React37.useInsertionEffect ?? React37.useLayoutEffect;
|
|
10130
10367
|
effectToUse(() => {
|
|
10131
10368
|
return () => {
|
|
10132
10369
|
requestAnimationFrame(() => {
|
|
@@ -10184,7 +10421,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
10184
10421
|
mediaVolume
|
|
10185
10422
|
});
|
|
10186
10423
|
warnAboutTooHighVolume(userPreferredVolume);
|
|
10187
|
-
const getStack =
|
|
10424
|
+
const getStack = useCallback22(() => {
|
|
10188
10425
|
return _remotionInternalStack ?? null;
|
|
10189
10426
|
}, [_remotionInternalStack]);
|
|
10190
10427
|
useMediaInTimeline({
|
|
@@ -10289,7 +10526,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
10289
10526
|
current.removeEventListener("error", errorHandler);
|
|
10290
10527
|
};
|
|
10291
10528
|
}, [onError, src]);
|
|
10292
|
-
const currentOnDurationCallback =
|
|
10529
|
+
const currentOnDurationCallback = useRef27(onDuration);
|
|
10293
10530
|
currentOnDurationCallback.current = onDuration;
|
|
10294
10531
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
10295
10532
|
useEffect20(() => {
|
|
@@ -10330,7 +10567,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
10330
10567
|
requestsVideoFrame: Boolean(onVideoFrame),
|
|
10331
10568
|
isClientSideRendering: false
|
|
10332
10569
|
});
|
|
10333
|
-
return /* @__PURE__ */
|
|
10570
|
+
return /* @__PURE__ */ jsx34("video", {
|
|
10334
10571
|
ref: videoRef,
|
|
10335
10572
|
muted: muted || mediaMuted || userPreferredVolume <= 0,
|
|
10336
10573
|
playsInline: true,
|
|
@@ -10342,10 +10579,10 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
10342
10579
|
...nativeProps
|
|
10343
10580
|
});
|
|
10344
10581
|
};
|
|
10345
|
-
var VideoForPreview =
|
|
10582
|
+
var VideoForPreview = forwardRef13(VideoForDevelopmentRefForwardingFunction);
|
|
10346
10583
|
|
|
10347
10584
|
// src/video/OffthreadVideo.tsx
|
|
10348
|
-
import { jsx as
|
|
10585
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
10349
10586
|
var InnerOffthreadVideo = (props2) => {
|
|
10350
10587
|
const {
|
|
10351
10588
|
startFrom,
|
|
@@ -10362,7 +10599,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
10362
10599
|
if (environment.isClientSideRendering) {
|
|
10363
10600
|
throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
10364
10601
|
}
|
|
10365
|
-
const onDuration =
|
|
10602
|
+
const onDuration = useCallback23(() => {
|
|
10366
10603
|
return;
|
|
10367
10604
|
}, []);
|
|
10368
10605
|
if (typeof props2.src !== "string") {
|
|
@@ -10376,13 +10613,13 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
10376
10613
|
trimAfter
|
|
10377
10614
|
});
|
|
10378
10615
|
if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
|
|
10379
|
-
return /* @__PURE__ */
|
|
10616
|
+
return /* @__PURE__ */ jsx35(Sequence, {
|
|
10380
10617
|
layout: "none",
|
|
10381
10618
|
from: 0 - (trimBeforeValue ?? 0),
|
|
10382
10619
|
showInTimeline: false,
|
|
10383
10620
|
durationInFrames: trimAfterValue,
|
|
10384
10621
|
name,
|
|
10385
|
-
children: /* @__PURE__ */
|
|
10622
|
+
children: /* @__PURE__ */ jsx35(InnerOffthreadVideo, {
|
|
10386
10623
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
10387
10624
|
...otherProps,
|
|
10388
10625
|
trimAfter: undefined,
|
|
@@ -10397,7 +10634,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
10397
10634
|
}
|
|
10398
10635
|
validateMediaProps(props2, "Video");
|
|
10399
10636
|
if (environment.isRendering) {
|
|
10400
|
-
return /* @__PURE__ */
|
|
10637
|
+
return /* @__PURE__ */ jsx35(OffthreadVideoForRendering, {
|
|
10401
10638
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
10402
10639
|
...otherProps,
|
|
10403
10640
|
trimAfter: undefined,
|
|
@@ -10419,7 +10656,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
10419
10656
|
delayRenderTimeoutInMilliseconds,
|
|
10420
10657
|
...propsForPreview
|
|
10421
10658
|
} = otherProps;
|
|
10422
|
-
return /* @__PURE__ */
|
|
10659
|
+
return /* @__PURE__ */ jsx35(VideoForPreview, {
|
|
10423
10660
|
_remotionInternalStack: stack ?? null,
|
|
10424
10661
|
onDuration,
|
|
10425
10662
|
onlyWarnForMediaSeekingError: true,
|
|
@@ -10468,7 +10705,7 @@ var OffthreadVideo = ({
|
|
|
10468
10705
|
if (imageFormat) {
|
|
10469
10706
|
throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
|
|
10470
10707
|
}
|
|
10471
|
-
return /* @__PURE__ */
|
|
10708
|
+
return /* @__PURE__ */ jsx35(InnerOffthreadVideo, {
|
|
10472
10709
|
acceptableTimeShiftInSeconds,
|
|
10473
10710
|
allowAmplificationDuringRender: allowAmplificationDuringRender ?? true,
|
|
10474
10711
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
@@ -10541,23 +10778,23 @@ var watchStaticFile = (fileName, callback) => {
|
|
|
10541
10778
|
};
|
|
10542
10779
|
|
|
10543
10780
|
// src/wrap-remotion-context.tsx
|
|
10544
|
-
import
|
|
10545
|
-
import { jsx as
|
|
10781
|
+
import React39, { useMemo as useMemo37 } from "react";
|
|
10782
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
10546
10783
|
function useRemotionContexts() {
|
|
10547
|
-
const compositionManagerCtx =
|
|
10548
|
-
const timelineContext =
|
|
10549
|
-
const setTimelineContext =
|
|
10550
|
-
const sequenceContext =
|
|
10551
|
-
const nonceContext =
|
|
10552
|
-
const canUseRemotionHooksContext =
|
|
10553
|
-
const preloadContext =
|
|
10554
|
-
const resolveCompositionContext =
|
|
10555
|
-
const renderAssetManagerContext =
|
|
10556
|
-
const sequenceManagerContext =
|
|
10557
|
-
const sequenceManagerRefContext =
|
|
10558
|
-
const visualModePropStatusesRefContext =
|
|
10559
|
-
const bufferManagerContext =
|
|
10560
|
-
const logLevelContext =
|
|
10784
|
+
const compositionManagerCtx = React39.useContext(CompositionManager);
|
|
10785
|
+
const timelineContext = React39.useContext(TimelineContext);
|
|
10786
|
+
const setTimelineContext = React39.useContext(SetTimelineContext);
|
|
10787
|
+
const sequenceContext = React39.useContext(SequenceContext);
|
|
10788
|
+
const nonceContext = React39.useContext(NonceContext);
|
|
10789
|
+
const canUseRemotionHooksContext = React39.useContext(CanUseRemotionHooks);
|
|
10790
|
+
const preloadContext = React39.useContext(PreloadContext);
|
|
10791
|
+
const resolveCompositionContext = React39.useContext(ResolveCompositionContext);
|
|
10792
|
+
const renderAssetManagerContext = React39.useContext(RenderAssetManager);
|
|
10793
|
+
const sequenceManagerContext = React39.useContext(SequenceManager);
|
|
10794
|
+
const sequenceManagerRefContext = React39.useContext(SequenceManagerRefContext);
|
|
10795
|
+
const visualModePropStatusesRefContext = React39.useContext(VisualModePropStatusesRefContext);
|
|
10796
|
+
const bufferManagerContext = React39.useContext(BufferingContextReact);
|
|
10797
|
+
const logLevelContext = React39.useContext(LogLevelContext);
|
|
10561
10798
|
return useMemo37(() => ({
|
|
10562
10799
|
compositionManagerCtx,
|
|
10563
10800
|
timelineContext,
|
|
@@ -10592,33 +10829,33 @@ function useRemotionContexts() {
|
|
|
10592
10829
|
}
|
|
10593
10830
|
var RemotionContextProvider = (props2) => {
|
|
10594
10831
|
const { children, contexts } = props2;
|
|
10595
|
-
return /* @__PURE__ */
|
|
10832
|
+
return /* @__PURE__ */ jsx36(LogLevelContext.Provider, {
|
|
10596
10833
|
value: contexts.logLevelContext,
|
|
10597
|
-
children: /* @__PURE__ */
|
|
10834
|
+
children: /* @__PURE__ */ jsx36(CanUseRemotionHooks.Provider, {
|
|
10598
10835
|
value: contexts.canUseRemotionHooksContext,
|
|
10599
|
-
children: /* @__PURE__ */
|
|
10836
|
+
children: /* @__PURE__ */ jsx36(NonceContext.Provider, {
|
|
10600
10837
|
value: contexts.nonceContext,
|
|
10601
|
-
children: /* @__PURE__ */
|
|
10838
|
+
children: /* @__PURE__ */ jsx36(PreloadContext.Provider, {
|
|
10602
10839
|
value: contexts.preloadContext,
|
|
10603
|
-
children: /* @__PURE__ */
|
|
10840
|
+
children: /* @__PURE__ */ jsx36(CompositionManager.Provider, {
|
|
10604
10841
|
value: contexts.compositionManagerCtx,
|
|
10605
|
-
children: /* @__PURE__ */
|
|
10842
|
+
children: /* @__PURE__ */ jsx36(SequenceManagerRefContext.Provider, {
|
|
10606
10843
|
value: contexts.sequenceManagerRefContext,
|
|
10607
|
-
children: /* @__PURE__ */
|
|
10844
|
+
children: /* @__PURE__ */ jsx36(SequenceManager.Provider, {
|
|
10608
10845
|
value: contexts.sequenceManagerContext,
|
|
10609
|
-
children: /* @__PURE__ */
|
|
10846
|
+
children: /* @__PURE__ */ jsx36(VisualModePropStatusesRefContext.Provider, {
|
|
10610
10847
|
value: contexts.visualModePropStatusesRefContext,
|
|
10611
|
-
children: /* @__PURE__ */
|
|
10848
|
+
children: /* @__PURE__ */ jsx36(RenderAssetManager.Provider, {
|
|
10612
10849
|
value: contexts.renderAssetManagerContext,
|
|
10613
|
-
children: /* @__PURE__ */
|
|
10850
|
+
children: /* @__PURE__ */ jsx36(ResolveCompositionContext.Provider, {
|
|
10614
10851
|
value: contexts.resolveCompositionContext,
|
|
10615
|
-
children: /* @__PURE__ */
|
|
10852
|
+
children: /* @__PURE__ */ jsx36(TimelineContext.Provider, {
|
|
10616
10853
|
value: contexts.timelineContext,
|
|
10617
|
-
children: /* @__PURE__ */
|
|
10854
|
+
children: /* @__PURE__ */ jsx36(SetTimelineContext.Provider, {
|
|
10618
10855
|
value: contexts.setTimelineContext,
|
|
10619
|
-
children: /* @__PURE__ */
|
|
10856
|
+
children: /* @__PURE__ */ jsx36(SequenceContext.Provider, {
|
|
10620
10857
|
value: contexts.sequenceContext,
|
|
10621
|
-
children: /* @__PURE__ */
|
|
10858
|
+
children: /* @__PURE__ */ jsx36(BufferingContextReact.Provider, {
|
|
10622
10859
|
value: contexts.bufferManagerContext,
|
|
10623
10860
|
children
|
|
10624
10861
|
})
|
|
@@ -10813,16 +11050,16 @@ var validateFrame = ({
|
|
|
10813
11050
|
// src/series/index.tsx
|
|
10814
11051
|
import {
|
|
10815
11052
|
Children,
|
|
10816
|
-
forwardRef as
|
|
11053
|
+
forwardRef as forwardRef14,
|
|
10817
11054
|
useMemo as useMemo38
|
|
10818
11055
|
} from "react";
|
|
10819
11056
|
|
|
10820
11057
|
// src/series/flatten-children.tsx
|
|
10821
|
-
import
|
|
11058
|
+
import React40 from "react";
|
|
10822
11059
|
var flattenChildren = (children) => {
|
|
10823
|
-
const childrenArray =
|
|
11060
|
+
const childrenArray = React40.Children.toArray(children);
|
|
10824
11061
|
return childrenArray.reduce((flatChildren, child) => {
|
|
10825
|
-
if (child.type ===
|
|
11062
|
+
if (child.type === React40.Fragment) {
|
|
10826
11063
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
10827
11064
|
}
|
|
10828
11065
|
flatChildren.push(child);
|
|
@@ -10831,14 +11068,14 @@ var flattenChildren = (children) => {
|
|
|
10831
11068
|
};
|
|
10832
11069
|
|
|
10833
11070
|
// src/series/index.tsx
|
|
10834
|
-
import { jsx as
|
|
11071
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
10835
11072
|
var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
10836
11073
|
useRequireToBeInsideSeries();
|
|
10837
|
-
return /* @__PURE__ */
|
|
11074
|
+
return /* @__PURE__ */ jsx37(IsNotInsideSeriesProvider, {
|
|
10838
11075
|
children
|
|
10839
11076
|
});
|
|
10840
11077
|
};
|
|
10841
|
-
var SeriesSequence =
|
|
11078
|
+
var SeriesSequence = forwardRef14(SeriesSequenceRefForwardingFunction);
|
|
10842
11079
|
var SequenceWithoutSchemaWithRef = SequenceWithoutSchema;
|
|
10843
11080
|
var SeriesInner = (props2) => {
|
|
10844
11081
|
const childrenValue = useMemo38(() => {
|
|
@@ -10882,7 +11119,7 @@ var SeriesInner = (props2) => {
|
|
|
10882
11119
|
}
|
|
10883
11120
|
const currentStartFrame = startFrame + offset;
|
|
10884
11121
|
startFrame += durationInFramesProp + offset;
|
|
10885
|
-
return /* @__PURE__ */
|
|
11122
|
+
return /* @__PURE__ */ jsx37(SequenceWithoutSchemaWithRef, {
|
|
10886
11123
|
ref: castedChild.ref,
|
|
10887
11124
|
name: name || "<Series.Sequence>",
|
|
10888
11125
|
_remotionInternalDocumentationLink: name ? undefined : "https://www.remotion.dev/docs/series",
|
|
@@ -10893,8 +11130,8 @@ var SeriesInner = (props2) => {
|
|
|
10893
11130
|
});
|
|
10894
11131
|
});
|
|
10895
11132
|
}, [props2.children]);
|
|
10896
|
-
return /* @__PURE__ */
|
|
10897
|
-
children: /* @__PURE__ */
|
|
11133
|
+
return /* @__PURE__ */ jsx37(IsInsideSeriesContainer, {
|
|
11134
|
+
children: /* @__PURE__ */ jsx37(Sequence, {
|
|
10898
11135
|
layout: "none",
|
|
10899
11136
|
name: "<Series>",
|
|
10900
11137
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/series",
|
|
@@ -11242,27 +11479,27 @@ var staticFile = (path) => {
|
|
|
11242
11479
|
return preparsed;
|
|
11243
11480
|
};
|
|
11244
11481
|
// src/Still.tsx
|
|
11245
|
-
import
|
|
11482
|
+
import React42 from "react";
|
|
11246
11483
|
var Still = (props2) => {
|
|
11247
11484
|
const newProps = {
|
|
11248
11485
|
...props2,
|
|
11249
11486
|
durationInFrames: 1,
|
|
11250
11487
|
fps: 1
|
|
11251
11488
|
};
|
|
11252
|
-
return
|
|
11489
|
+
return React42.createElement(Composition, newProps);
|
|
11253
11490
|
};
|
|
11254
11491
|
// src/video/html5-video.tsx
|
|
11255
|
-
import { forwardRef as
|
|
11492
|
+
import { forwardRef as forwardRef16, useCallback as useCallback24, useContext as useContext39 } from "react";
|
|
11256
11493
|
|
|
11257
11494
|
// src/video/VideoForRendering.tsx
|
|
11258
11495
|
import {
|
|
11259
|
-
forwardRef as
|
|
11496
|
+
forwardRef as forwardRef15,
|
|
11260
11497
|
useContext as useContext38,
|
|
11261
11498
|
useEffect as useEffect21,
|
|
11262
11499
|
useImperativeHandle as useImperativeHandle10,
|
|
11263
11500
|
useLayoutEffect as useLayoutEffect12,
|
|
11264
11501
|
useMemo as useMemo39,
|
|
11265
|
-
useRef as
|
|
11502
|
+
useRef as useRef28
|
|
11266
11503
|
} from "react";
|
|
11267
11504
|
|
|
11268
11505
|
// src/video/seek-until-right.ts
|
|
@@ -11390,7 +11627,7 @@ var seekToTimeMultipleUntilRight = ({
|
|
|
11390
11627
|
};
|
|
11391
11628
|
|
|
11392
11629
|
// src/video/VideoForRendering.tsx
|
|
11393
|
-
import { jsx as
|
|
11630
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
11394
11631
|
var VideoForRenderingForwardFunction = ({
|
|
11395
11632
|
onError,
|
|
11396
11633
|
volume: volumeProp,
|
|
@@ -11412,7 +11649,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
11412
11649
|
const frame = useCurrentFrame();
|
|
11413
11650
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
11414
11651
|
const videoConfig = useUnsafeVideoConfig();
|
|
11415
|
-
const videoRef =
|
|
11652
|
+
const videoRef = useRef28(null);
|
|
11416
11653
|
const sequenceContext = useContext38(SequenceContext);
|
|
11417
11654
|
const mediaStartsAt = useMediaStartsAt();
|
|
11418
11655
|
const environment = useRemotionEnvironment();
|
|
@@ -11603,16 +11840,16 @@ var VideoForRenderingForwardFunction = ({
|
|
|
11603
11840
|
delayRender2
|
|
11604
11841
|
]);
|
|
11605
11842
|
}
|
|
11606
|
-
return /* @__PURE__ */
|
|
11843
|
+
return /* @__PURE__ */ jsx38("video", {
|
|
11607
11844
|
ref: videoRef,
|
|
11608
11845
|
disableRemotePlayback: true,
|
|
11609
11846
|
...props2
|
|
11610
11847
|
});
|
|
11611
11848
|
};
|
|
11612
|
-
var VideoForRendering =
|
|
11849
|
+
var VideoForRendering = forwardRef15(VideoForRenderingForwardFunction);
|
|
11613
11850
|
|
|
11614
11851
|
// src/video/html5-video.tsx
|
|
11615
|
-
import { jsx as
|
|
11852
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
11616
11853
|
var VideoForwardingFunction = (props2, ref) => {
|
|
11617
11854
|
const {
|
|
11618
11855
|
startFrom,
|
|
@@ -11642,7 +11879,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11642
11879
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
11643
11880
|
}
|
|
11644
11881
|
const preloadedSrc = usePreload(props2.src);
|
|
11645
|
-
const onDuration =
|
|
11882
|
+
const onDuration = useCallback24((src, durationInSeconds) => {
|
|
11646
11883
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
11647
11884
|
}, [setDurations]);
|
|
11648
11885
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
@@ -11655,7 +11892,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11655
11892
|
});
|
|
11656
11893
|
if (loop && durationFetched !== undefined) {
|
|
11657
11894
|
if (!Number.isFinite(durationFetched)) {
|
|
11658
|
-
return /* @__PURE__ */
|
|
11895
|
+
return /* @__PURE__ */ jsx39(Html5Video, {
|
|
11659
11896
|
...propsOtherThanLoop,
|
|
11660
11897
|
ref,
|
|
11661
11898
|
stack,
|
|
@@ -11663,7 +11900,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11663
11900
|
});
|
|
11664
11901
|
}
|
|
11665
11902
|
const mediaDuration = durationFetched * fps;
|
|
11666
|
-
return /* @__PURE__ */
|
|
11903
|
+
return /* @__PURE__ */ jsx39(Loop, {
|
|
11667
11904
|
durationInFrames: calculateMediaDuration({
|
|
11668
11905
|
trimAfter: trimAfterValue,
|
|
11669
11906
|
mediaDurationInFrames: mediaDuration,
|
|
@@ -11673,7 +11910,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11673
11910
|
layout: "none",
|
|
11674
11911
|
name,
|
|
11675
11912
|
showInTimeline: false,
|
|
11676
|
-
children: /* @__PURE__ */
|
|
11913
|
+
children: /* @__PURE__ */ jsx39(Html5Video, {
|
|
11677
11914
|
...propsOtherThanLoop,
|
|
11678
11915
|
ref,
|
|
11679
11916
|
stack,
|
|
@@ -11682,13 +11919,13 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11682
11919
|
});
|
|
11683
11920
|
}
|
|
11684
11921
|
if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
|
|
11685
|
-
return /* @__PURE__ */
|
|
11922
|
+
return /* @__PURE__ */ jsx39(Sequence, {
|
|
11686
11923
|
layout: "none",
|
|
11687
11924
|
from: 0 - (trimBeforeValue ?? 0),
|
|
11688
11925
|
showInTimeline: false,
|
|
11689
11926
|
durationInFrames: trimAfterValue === undefined ? undefined : trimAfterValue / (props2.playbackRate ?? 1),
|
|
11690
11927
|
name,
|
|
11691
|
-
children: /* @__PURE__ */
|
|
11928
|
+
children: /* @__PURE__ */ jsx39(Html5Video, {
|
|
11692
11929
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
11693
11930
|
onVideoFrame,
|
|
11694
11931
|
...otherProps,
|
|
@@ -11703,14 +11940,14 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11703
11940
|
volume: props2.volume
|
|
11704
11941
|
}, "Html5Video");
|
|
11705
11942
|
if (environment.isRendering) {
|
|
11706
|
-
return /* @__PURE__ */
|
|
11943
|
+
return /* @__PURE__ */ jsx39(VideoForRendering, {
|
|
11707
11944
|
onDuration,
|
|
11708
11945
|
onVideoFrame: onVideoFrame ?? null,
|
|
11709
11946
|
...otherProps,
|
|
11710
11947
|
ref
|
|
11711
11948
|
});
|
|
11712
11949
|
}
|
|
11713
|
-
return /* @__PURE__ */
|
|
11950
|
+
return /* @__PURE__ */ jsx39(VideoForPreview, {
|
|
11714
11951
|
onlyWarnForMediaSeekingError: false,
|
|
11715
11952
|
...otherProps,
|
|
11716
11953
|
ref,
|
|
@@ -11723,7 +11960,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11723
11960
|
onAutoPlayError: onAutoPlayError ?? undefined
|
|
11724
11961
|
});
|
|
11725
11962
|
};
|
|
11726
|
-
var Html5Video =
|
|
11963
|
+
var Html5Video = forwardRef16(VideoForwardingFunction);
|
|
11727
11964
|
addSequenceStackTraces(Html5Video);
|
|
11728
11965
|
var Video = Html5Video;
|
|
11729
11966
|
// src/index.ts
|
|
@@ -11793,6 +12030,7 @@ export {
|
|
|
11793
12030
|
MediaPlaybackError,
|
|
11794
12031
|
Loop,
|
|
11795
12032
|
Internals,
|
|
12033
|
+
Interactive,
|
|
11796
12034
|
Img,
|
|
11797
12035
|
IFrame,
|
|
11798
12036
|
HtmlInCanvas,
|