@remotion/promo-pages 4.0.459 → 4.0.461
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/Homepage.js +580 -331
- package/dist/design.js +353 -179
- package/dist/experts.js +353 -179
- package/dist/homepage/Pricing.js +353 -179
- package/dist/prompts/PromptsGallery.js +353 -179
- package/dist/prompts/PromptsShow.js +387 -213
- package/dist/prompts/PromptsSubmit.js +387 -213
- package/dist/team.js +353 -179
- package/dist/template-modal-content.js +353 -179
- package/dist/templates.js +354 -179
- package/package.json +14 -14
package/dist/team.js
CHANGED
|
@@ -5937,6 +5937,7 @@ import {
|
|
|
5937
5937
|
} from "react";
|
|
5938
5938
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
5939
5939
|
import { useEffect as useEffect3, useMemo as useMemo10, useRef as useRef4 } from "react";
|
|
5940
|
+
import { useRef as useRef5 } from "react";
|
|
5940
5941
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5941
5942
|
import {
|
|
5942
5943
|
forwardRef as forwardRef3,
|
|
@@ -5945,7 +5946,6 @@ import {
|
|
|
5945
5946
|
useMemo as useMemo16,
|
|
5946
5947
|
useState as useState6
|
|
5947
5948
|
} from "react";
|
|
5948
|
-
import { useRef as useRef5 } from "react";
|
|
5949
5949
|
import { useContext as useContext14, useMemo as useMemo13 } from "react";
|
|
5950
5950
|
import { useContext as useContext13 } from "react";
|
|
5951
5951
|
import { useContext as useContext12, useMemo as useMemo12 } from "react";
|
|
@@ -5954,6 +5954,7 @@ import { createContext as createContext14 } from "react";
|
|
|
5954
5954
|
import React12, { useCallback as useCallback5, useMemo as useMemo14, useRef as useRef6, useState as useState4 } from "react";
|
|
5955
5955
|
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5956
5956
|
import React13, { forwardRef as forwardRef2, useState as useState5, useContext as useContext15, useMemo as useMemo15 } from "react";
|
|
5957
|
+
import { createContext as createContext15 } from "react";
|
|
5957
5958
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5958
5959
|
import {
|
|
5959
5960
|
forwardRef as forwardRef4,
|
|
@@ -5967,7 +5968,7 @@ import React15, { useCallback as useCallback6, useImperativeHandle, useRef as us
|
|
|
5967
5968
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5968
5969
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5969
5970
|
import {
|
|
5970
|
-
createContext as
|
|
5971
|
+
createContext as createContext16,
|
|
5971
5972
|
forwardRef as forwardRef5,
|
|
5972
5973
|
useCallback as useCallback7,
|
|
5973
5974
|
useContext as useContext17,
|
|
@@ -5979,7 +5980,7 @@ import {
|
|
|
5979
5980
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
5980
5981
|
import { useContext as useContext18, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
|
|
5981
5982
|
import {
|
|
5982
|
-
createContext as
|
|
5983
|
+
createContext as createContext17,
|
|
5983
5984
|
useCallback as useCallback8,
|
|
5984
5985
|
useImperativeHandle as useImperativeHandle3,
|
|
5985
5986
|
useLayoutEffect as useLayoutEffect4,
|
|
@@ -5989,12 +5990,12 @@ import {
|
|
|
5989
5990
|
} from "react";
|
|
5990
5991
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5991
5992
|
import { forwardRef as forwardRef8, useCallback as useCallback13, useContext as useContext30 } from "react";
|
|
5992
|
-
import React17, { createContext as
|
|
5993
|
+
import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
|
|
5993
5994
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5994
5995
|
import { useContext as useContext19 } from "react";
|
|
5995
|
-
import { createContext as
|
|
5996
|
+
import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
|
|
5996
5997
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
5997
|
-
import { createContext as
|
|
5998
|
+
import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
|
|
5998
5999
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
5999
6000
|
import React23, {
|
|
6000
6001
|
forwardRef as forwardRef6,
|
|
@@ -6007,7 +6008,7 @@ import React23, {
|
|
|
6007
6008
|
} from "react";
|
|
6008
6009
|
import { useContext as useContext21, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
|
|
6009
6010
|
import React20, {
|
|
6010
|
-
createContext as
|
|
6011
|
+
createContext as createContext21,
|
|
6011
6012
|
createRef as createRef2,
|
|
6012
6013
|
useCallback as useCallback9,
|
|
6013
6014
|
useContext as useContext20,
|
|
@@ -6043,7 +6044,7 @@ import React22 from "react";
|
|
|
6043
6044
|
import { useEffect as useEffect10, useState as useState15 } from "react";
|
|
6044
6045
|
import { useEffect as useEffect11, useRef as useRef16 } from "react";
|
|
6045
6046
|
import { useEffect as useEffect13 } from "react";
|
|
6046
|
-
import { createContext as
|
|
6047
|
+
import { createContext as createContext22, useContext as useContext27, useMemo as useMemo27 } from "react";
|
|
6047
6048
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
6048
6049
|
import {
|
|
6049
6050
|
forwardRef as forwardRef7,
|
|
@@ -6079,16 +6080,15 @@ import {
|
|
|
6079
6080
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
6080
6081
|
import React29 from "react";
|
|
6081
6082
|
import { useMemo as useMemo322 } from "react";
|
|
6082
|
-
import { createContext as
|
|
6083
|
+
import { createContext as createContext23, useContext as useContext32, useMemo as useMemo31 } from "react";
|
|
6083
6084
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
6084
6085
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
6085
6086
|
import React31 from "react";
|
|
6086
|
-
import React32, { createContext as
|
|
6087
|
-
import { useContext as useContext33 } from "react";
|
|
6087
|
+
import React32, { createContext as createContext24 } from "react";
|
|
6088
6088
|
import { useCallback as useCallback18 } from "react";
|
|
6089
6089
|
import {
|
|
6090
6090
|
useCallback as useCallback17,
|
|
6091
|
-
useContext as
|
|
6091
|
+
useContext as useContext33,
|
|
6092
6092
|
useEffect as useEffect16,
|
|
6093
6093
|
useLayoutEffect as useLayoutEffect11,
|
|
6094
6094
|
useMemo as useMemo33,
|
|
@@ -6097,7 +6097,7 @@ import {
|
|
|
6097
6097
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
6098
6098
|
import React34, {
|
|
6099
6099
|
forwardRef as forwardRef10,
|
|
6100
|
-
useContext as
|
|
6100
|
+
useContext as useContext34,
|
|
6101
6101
|
useEffect as useEffect18,
|
|
6102
6102
|
useImperativeHandle as useImperativeHandle8,
|
|
6103
6103
|
useMemo as useMemo34,
|
|
@@ -6111,14 +6111,14 @@ import React36, { useMemo as useMemo35 } from "react";
|
|
|
6111
6111
|
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
6112
6112
|
import { Children, forwardRef as forwardRef11, useMemo as useMemo36 } from "react";
|
|
6113
6113
|
import React37 from "react";
|
|
6114
|
-
import React38, { createContext as
|
|
6114
|
+
import React38, { createContext as createContext25 } from "react";
|
|
6115
6115
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
6116
6116
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
6117
6117
|
import React40 from "react";
|
|
6118
|
-
import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as
|
|
6118
|
+
import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as useContext36 } from "react";
|
|
6119
6119
|
import {
|
|
6120
6120
|
forwardRef as forwardRef12,
|
|
6121
|
-
useContext as
|
|
6121
|
+
useContext as useContext35,
|
|
6122
6122
|
useEffect as useEffect19,
|
|
6123
6123
|
useImperativeHandle as useImperativeHandle9,
|
|
6124
6124
|
useLayoutEffect as useLayoutEffect12,
|
|
@@ -7399,6 +7399,39 @@ var useCurrentFrame = () => {
|
|
|
7399
7399
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
7400
7400
|
return frame - contextOffset;
|
|
7401
7401
|
};
|
|
7402
|
+
var flattenEffects = (effects) => {
|
|
7403
|
+
const out = [];
|
|
7404
|
+
for (const item of effects) {
|
|
7405
|
+
if (Array.isArray(item)) {
|
|
7406
|
+
for (const inner of item) {
|
|
7407
|
+
out.push(inner);
|
|
7408
|
+
}
|
|
7409
|
+
} else {
|
|
7410
|
+
out.push(item);
|
|
7411
|
+
}
|
|
7412
|
+
}
|
|
7413
|
+
return out;
|
|
7414
|
+
};
|
|
7415
|
+
var groupByBackend = (effects) => {
|
|
7416
|
+
const runs = [];
|
|
7417
|
+
let current = [];
|
|
7418
|
+
let currentBackend = null;
|
|
7419
|
+
for (const eff of effects) {
|
|
7420
|
+
const { backend } = eff.definition;
|
|
7421
|
+
if (currentBackend === null || backend === currentBackend) {
|
|
7422
|
+
current.push(eff);
|
|
7423
|
+
currentBackend = backend;
|
|
7424
|
+
} else {
|
|
7425
|
+
runs.push({ backend: currentBackend, effects: current });
|
|
7426
|
+
current = [eff];
|
|
7427
|
+
currentBackend = backend;
|
|
7428
|
+
}
|
|
7429
|
+
}
|
|
7430
|
+
if (currentBackend !== null && current.length > 0) {
|
|
7431
|
+
runs.push({ backend: currentBackend, effects: current });
|
|
7432
|
+
}
|
|
7433
|
+
return runs;
|
|
7434
|
+
};
|
|
7402
7435
|
|
|
7403
7436
|
class CanvasPool {
|
|
7404
7437
|
width;
|
|
@@ -7472,39 +7505,6 @@ class CanvasPool {
|
|
|
7472
7505
|
}
|
|
7473
7506
|
}
|
|
7474
7507
|
}
|
|
7475
|
-
var flattenEffects = (effects) => {
|
|
7476
|
-
const out = [];
|
|
7477
|
-
for (const item of effects) {
|
|
7478
|
-
if (Array.isArray(item)) {
|
|
7479
|
-
for (const inner of item) {
|
|
7480
|
-
out.push(inner);
|
|
7481
|
-
}
|
|
7482
|
-
} else {
|
|
7483
|
-
out.push(item);
|
|
7484
|
-
}
|
|
7485
|
-
}
|
|
7486
|
-
return out;
|
|
7487
|
-
};
|
|
7488
|
-
var groupByBackend = (effects) => {
|
|
7489
|
-
const runs = [];
|
|
7490
|
-
let current = [];
|
|
7491
|
-
let currentBackend = null;
|
|
7492
|
-
for (const eff of effects) {
|
|
7493
|
-
const { backend } = eff.definition;
|
|
7494
|
-
if (currentBackend === null || backend === currentBackend) {
|
|
7495
|
-
current.push(eff);
|
|
7496
|
-
currentBackend = backend;
|
|
7497
|
-
} else {
|
|
7498
|
-
runs.push({ backend: currentBackend, effects: current });
|
|
7499
|
-
current = [eff];
|
|
7500
|
-
currentBackend = backend;
|
|
7501
|
-
}
|
|
7502
|
-
}
|
|
7503
|
-
if (currentBackend !== null && current.length > 0) {
|
|
7504
|
-
runs.push({ backend: currentBackend, effects: current });
|
|
7505
|
-
}
|
|
7506
|
-
return runs;
|
|
7507
|
-
};
|
|
7508
7508
|
var devicePromise = null;
|
|
7509
7509
|
var getGpuDevice = () => {
|
|
7510
7510
|
if (devicePromise) {
|
|
@@ -7556,8 +7556,7 @@ var runEffectChain = async ({
|
|
|
7556
7556
|
}) => {
|
|
7557
7557
|
const runId = ++state.currentRunId;
|
|
7558
7558
|
const isCancelled = () => state.currentRunId !== runId;
|
|
7559
|
-
const
|
|
7560
|
-
const runs = groupByBackend(flattened);
|
|
7559
|
+
const runs = groupByBackend(effects);
|
|
7561
7560
|
let currentImage = source;
|
|
7562
7561
|
let lastTarget = null;
|
|
7563
7562
|
if (runs.length === 0) {
|
|
@@ -7651,12 +7650,29 @@ var useEffectChainState = () => {
|
|
|
7651
7650
|
}
|
|
7652
7651
|
}), []);
|
|
7653
7652
|
};
|
|
7653
|
+
var useMemoizedEffects = (effects) => {
|
|
7654
|
+
const previousRef = useRef5(null);
|
|
7655
|
+
const previous = previousRef.current;
|
|
7656
|
+
const isSame = previous !== null && previous.length === effects.length && previous.every((p, i) => p.definition === effects[i].definition && p.effectKey === effects[i].effectKey);
|
|
7657
|
+
if (isSame) {
|
|
7658
|
+
return previous;
|
|
7659
|
+
}
|
|
7660
|
+
const next = effects.map((e) => ({
|
|
7661
|
+
definition: e.definition,
|
|
7662
|
+
stack: e.stack,
|
|
7663
|
+
effectKey: e.effectKey,
|
|
7664
|
+
params: e.params,
|
|
7665
|
+
memoized: true
|
|
7666
|
+
}));
|
|
7667
|
+
previousRef.current = next;
|
|
7668
|
+
return next;
|
|
7669
|
+
};
|
|
7654
7670
|
var componentsToAddStacksTo = [];
|
|
7655
7671
|
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
7656
7672
|
var addSequenceStackTraces = (component) => {
|
|
7657
7673
|
componentsToAddStacksTo.push(component);
|
|
7658
7674
|
};
|
|
7659
|
-
var VERSION = "4.0.
|
|
7675
|
+
var VERSION = "4.0.461";
|
|
7660
7676
|
var checkMultipleRemotionVersions = () => {
|
|
7661
7677
|
if (typeof globalThis === "undefined") {
|
|
7662
7678
|
return;
|
|
@@ -7684,20 +7700,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
7684
7700
|
}
|
|
7685
7701
|
set();
|
|
7686
7702
|
};
|
|
7687
|
-
var useMemoizedEffects = (effects) => {
|
|
7688
|
-
const previousRef = useRef5(null);
|
|
7689
|
-
const previous = previousRef.current;
|
|
7690
|
-
const isSame = previous !== null && previous.length === effects.length && previous.every((p, i) => p.definition === effects[i].definition && p.stack === effects[i].stack);
|
|
7691
|
-
if (isSame) {
|
|
7692
|
-
return previous;
|
|
7693
|
-
}
|
|
7694
|
-
const next = effects.map((e) => ({
|
|
7695
|
-
definition: e.definition,
|
|
7696
|
-
stack: e.stack
|
|
7697
|
-
}));
|
|
7698
|
-
previousRef.current = next;
|
|
7699
|
-
return next;
|
|
7700
|
-
};
|
|
7701
7703
|
var useUnsafeVideoConfig = () => {
|
|
7702
7704
|
const context = useContext12(SequenceContext);
|
|
7703
7705
|
const ctxWidth = context?.width ?? null;
|
|
@@ -7855,6 +7857,22 @@ var sequenceStyleSchema = {
|
|
|
7855
7857
|
step: 0.01,
|
|
7856
7858
|
default: 1,
|
|
7857
7859
|
description: "Opacity"
|
|
7860
|
+
},
|
|
7861
|
+
premountFor: {
|
|
7862
|
+
type: "number",
|
|
7863
|
+
default: 0,
|
|
7864
|
+
description: "Premount For",
|
|
7865
|
+
min: 0,
|
|
7866
|
+
step: 1
|
|
7867
|
+
},
|
|
7868
|
+
postmountFor: {
|
|
7869
|
+
type: "hidden"
|
|
7870
|
+
},
|
|
7871
|
+
styleWhilePremounted: {
|
|
7872
|
+
type: "hidden"
|
|
7873
|
+
},
|
|
7874
|
+
styleWhilePostmounted: {
|
|
7875
|
+
type: "hidden"
|
|
7858
7876
|
}
|
|
7859
7877
|
};
|
|
7860
7878
|
var sequenceSchema = {
|
|
@@ -7875,6 +7893,9 @@ var sequenceSchemaDefaultLayoutNone = {
|
|
|
7875
7893
|
default: "none"
|
|
7876
7894
|
}
|
|
7877
7895
|
};
|
|
7896
|
+
var nodePathToString = (nodePath) => {
|
|
7897
|
+
return nodePath.join(".");
|
|
7898
|
+
};
|
|
7878
7899
|
var SequenceManager = React12.createContext({
|
|
7879
7900
|
registerSequence: () => {
|
|
7880
7901
|
throw new Error("SequenceManagerContext not initialized");
|
|
@@ -7890,60 +7911,73 @@ var SequenceVisibilityToggleContext = React12.createContext({
|
|
|
7890
7911
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
7891
7912
|
}
|
|
7892
7913
|
});
|
|
7893
|
-
var
|
|
7894
|
-
|
|
7914
|
+
var getCodeValuesCtx = (codeValues, nodePath) => {
|
|
7915
|
+
const status = codeValues[nodePathToString(nodePath)];
|
|
7916
|
+
if (!status) {
|
|
7917
|
+
return;
|
|
7918
|
+
}
|
|
7919
|
+
if (!status.canUpdate) {
|
|
7920
|
+
return;
|
|
7921
|
+
}
|
|
7922
|
+
return status.props;
|
|
7923
|
+
};
|
|
7924
|
+
var VisualModeCodeValuesContext = React12.createContext({
|
|
7925
|
+
getCodeValues: () => {
|
|
7926
|
+
throw new Error("VisualModeCodeValuesContext not initialized");
|
|
7927
|
+
}
|
|
7928
|
+
});
|
|
7929
|
+
var VisualModeDragOverridesContext = React12.createContext({
|
|
7930
|
+
getDragOverrides: () => {
|
|
7931
|
+
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
7932
|
+
}
|
|
7933
|
+
});
|
|
7934
|
+
var VisualModeSettersContext = React12.createContext({
|
|
7895
7935
|
setDragOverrides: () => {
|
|
7896
|
-
throw new Error("
|
|
7936
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7897
7937
|
},
|
|
7898
7938
|
clearDragOverrides: () => {
|
|
7899
|
-
throw new Error("
|
|
7939
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7900
7940
|
},
|
|
7901
|
-
codeValues: {},
|
|
7902
7941
|
setCodeValues: () => {
|
|
7903
|
-
throw new Error("
|
|
7904
|
-
}
|
|
7905
|
-
visualModeEnabled: false
|
|
7942
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7943
|
+
}
|
|
7906
7944
|
});
|
|
7907
|
-
var SequenceManagerProvider = ({ children
|
|
7945
|
+
var SequenceManagerProvider = ({ children }) => {
|
|
7908
7946
|
const [sequences, setSequences] = useState4([]);
|
|
7909
7947
|
const [hidden, setHidden] = useState4({});
|
|
7910
7948
|
const [dragOverrides, setControlOverrides] = useState4({});
|
|
7911
7949
|
const controlOverridesRef = useRef6(dragOverrides);
|
|
7912
7950
|
controlOverridesRef.current = dragOverrides;
|
|
7913
7951
|
const [codeValues, setCodeValuesMapState] = useState4({});
|
|
7914
|
-
const setDragOverrides = useCallback5((
|
|
7952
|
+
const setDragOverrides = useCallback5((nodePath, key, value) => {
|
|
7915
7953
|
setControlOverrides((prev) => ({
|
|
7916
7954
|
...prev,
|
|
7917
|
-
[
|
|
7918
|
-
...prev[
|
|
7955
|
+
[nodePathToString(nodePath)]: {
|
|
7956
|
+
...prev[nodePathToString(nodePath)],
|
|
7919
7957
|
[key]: value
|
|
7920
7958
|
}
|
|
7921
7959
|
}));
|
|
7922
7960
|
}, []);
|
|
7923
|
-
const clearDragOverrides = useCallback5((
|
|
7961
|
+
const clearDragOverrides = useCallback5((nodePath) => {
|
|
7924
7962
|
setControlOverrides((prev) => {
|
|
7925
|
-
|
|
7963
|
+
const key = nodePathToString(nodePath);
|
|
7964
|
+
if (!prev[key]) {
|
|
7926
7965
|
return prev;
|
|
7927
7966
|
}
|
|
7928
7967
|
const next = { ...prev };
|
|
7929
|
-
delete next[
|
|
7968
|
+
delete next[key];
|
|
7930
7969
|
return next;
|
|
7931
7970
|
});
|
|
7932
7971
|
}, []);
|
|
7933
|
-
const setCodeValues = useCallback5((
|
|
7972
|
+
const setCodeValues = useCallback5((nodePath, values) => {
|
|
7934
7973
|
setCodeValuesMapState((prev) => {
|
|
7935
|
-
|
|
7974
|
+
const key = nodePathToString(nodePath);
|
|
7975
|
+
const prevKey = prev[key];
|
|
7976
|
+
const newKey = values(prevKey);
|
|
7977
|
+
if (prevKey === newKey) {
|
|
7936
7978
|
return prev;
|
|
7937
7979
|
}
|
|
7938
|
-
|
|
7939
|
-
if (!(sequenceId in prev)) {
|
|
7940
|
-
return prev;
|
|
7941
|
-
}
|
|
7942
|
-
const next = { ...prev };
|
|
7943
|
-
delete next[sequenceId];
|
|
7944
|
-
return next;
|
|
7945
|
-
}
|
|
7946
|
-
return { ...prev, [sequenceId]: values };
|
|
7980
|
+
return { ...prev, [key]: newKey };
|
|
7947
7981
|
});
|
|
7948
7982
|
}, []);
|
|
7949
7983
|
const registerSequence = useCallback5((seq) => {
|
|
@@ -7967,40 +8001,85 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
7967
8001
|
setHidden
|
|
7968
8002
|
};
|
|
7969
8003
|
}, [hidden]);
|
|
7970
|
-
const
|
|
8004
|
+
const getDragOverrides = useCallback5((nodePath) => {
|
|
8005
|
+
return dragOverrides[nodePathToString(nodePath)] ?? {};
|
|
8006
|
+
}, [dragOverrides]);
|
|
8007
|
+
const getCodeValues = useCallback5((nodePath) => {
|
|
8008
|
+
return getCodeValuesCtx(codeValues, nodePath);
|
|
8009
|
+
}, [codeValues]);
|
|
8010
|
+
const codeValuesContext = useMemo14(() => {
|
|
8011
|
+
return {
|
|
8012
|
+
getCodeValues
|
|
8013
|
+
};
|
|
8014
|
+
}, [getCodeValues]);
|
|
8015
|
+
const dragOverridesContext = useMemo14(() => {
|
|
8016
|
+
return {
|
|
8017
|
+
getDragOverrides
|
|
8018
|
+
};
|
|
8019
|
+
}, [getDragOverrides]);
|
|
8020
|
+
const settersContext = useMemo14(() => {
|
|
7971
8021
|
return {
|
|
7972
|
-
visualModeEnabled,
|
|
7973
|
-
dragOverrides,
|
|
7974
8022
|
setDragOverrides,
|
|
7975
8023
|
clearDragOverrides,
|
|
7976
|
-
codeValues,
|
|
7977
8024
|
setCodeValues
|
|
7978
8025
|
};
|
|
7979
|
-
}, [
|
|
7980
|
-
visualModeEnabled,
|
|
7981
|
-
dragOverrides,
|
|
7982
|
-
setDragOverrides,
|
|
7983
|
-
clearDragOverrides,
|
|
7984
|
-
codeValues,
|
|
7985
|
-
setCodeValues
|
|
7986
|
-
]);
|
|
8026
|
+
}, [setDragOverrides, clearDragOverrides, setCodeValues]);
|
|
7987
8027
|
return /* @__PURE__ */ jsx112(SequenceManager.Provider, {
|
|
7988
8028
|
value: sequenceContext,
|
|
7989
8029
|
children: /* @__PURE__ */ jsx112(SequenceVisibilityToggleContext.Provider, {
|
|
7990
8030
|
value: hiddenContext,
|
|
7991
|
-
children: /* @__PURE__ */ jsx112(
|
|
7992
|
-
value:
|
|
7993
|
-
children
|
|
8031
|
+
children: /* @__PURE__ */ jsx112(VisualModeCodeValuesContext.Provider, {
|
|
8032
|
+
value: codeValuesContext,
|
|
8033
|
+
children: /* @__PURE__ */ jsx112(VisualModeDragOverridesContext.Provider, {
|
|
8034
|
+
value: dragOverridesContext,
|
|
8035
|
+
children: /* @__PURE__ */ jsx112(VisualModeSettersContext.Provider, {
|
|
8036
|
+
value: settersContext,
|
|
8037
|
+
children
|
|
8038
|
+
})
|
|
8039
|
+
})
|
|
7994
8040
|
})
|
|
7995
8041
|
})
|
|
7996
8042
|
});
|
|
7997
8043
|
};
|
|
7998
8044
|
var ENABLE_V5_BREAKING_CHANGES = false;
|
|
8045
|
+
var deleteNestedKey = (obj, keysToRemove) => {
|
|
8046
|
+
for (const key of keysToRemove) {
|
|
8047
|
+
const parts = key.split(".");
|
|
8048
|
+
const parents = [obj];
|
|
8049
|
+
let current = obj;
|
|
8050
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
8051
|
+
const part = parts[i];
|
|
8052
|
+
const next = current[part];
|
|
8053
|
+
if (next === undefined || next === null) {
|
|
8054
|
+
current = null;
|
|
8055
|
+
break;
|
|
8056
|
+
}
|
|
8057
|
+
current = next;
|
|
8058
|
+
parents.push(current);
|
|
8059
|
+
}
|
|
8060
|
+
if (current === null) {
|
|
8061
|
+
continue;
|
|
8062
|
+
}
|
|
8063
|
+
delete current[parts[parts.length - 1]];
|
|
8064
|
+
for (let i = parents.length - 1;i > 0; i--) {
|
|
8065
|
+
const parent = parents[i];
|
|
8066
|
+
if (Object.keys(parent).length === 0) {
|
|
8067
|
+
const parentKey = parts[i - 1];
|
|
8068
|
+
delete parents[i - 1][parentKey];
|
|
8069
|
+
} else {
|
|
8070
|
+
break;
|
|
8071
|
+
}
|
|
8072
|
+
}
|
|
8073
|
+
}
|
|
8074
|
+
return obj;
|
|
8075
|
+
};
|
|
7999
8076
|
var flattenActiveSchema = (schema, resolve) => {
|
|
8000
8077
|
const out = {};
|
|
8001
8078
|
for (const key of Object.keys(schema)) {
|
|
8002
8079
|
const field = schema[key];
|
|
8003
|
-
if (field.type === "
|
|
8080
|
+
if (field.type === "hidden") {
|
|
8081
|
+
continue;
|
|
8082
|
+
} else if (field.type === "enum") {
|
|
8004
8083
|
out[key] = field;
|
|
8005
8084
|
const current = resolve(key) ?? field.default;
|
|
8006
8085
|
const variant = field.variants[current];
|
|
@@ -8035,6 +8114,44 @@ var getFlatSchemaWithAllKeys = (schema) => {
|
|
|
8035
8114
|
}
|
|
8036
8115
|
return out;
|
|
8037
8116
|
};
|
|
8117
|
+
var OverrideIdsToNodePathsGettersContext = createContext15({
|
|
8118
|
+
overrideIdToNodePathMappings: {}
|
|
8119
|
+
});
|
|
8120
|
+
var OverrideIdsToNodePathsSettersContext = createContext15({
|
|
8121
|
+
setOverrideIdToNodePath: () => {
|
|
8122
|
+
throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
|
|
8123
|
+
}
|
|
8124
|
+
});
|
|
8125
|
+
var findPropsToDelete = ({
|
|
8126
|
+
schema,
|
|
8127
|
+
key,
|
|
8128
|
+
value
|
|
8129
|
+
}) => {
|
|
8130
|
+
const fieldSchema = schema[key];
|
|
8131
|
+
if (!fieldSchema) {
|
|
8132
|
+
throw new Error("Key " + JSON.stringify(key) + " not found in schema");
|
|
8133
|
+
}
|
|
8134
|
+
if (typeof value !== "string") {
|
|
8135
|
+
throw new Error("Value must be a string, but is " + JSON.stringify(value));
|
|
8136
|
+
}
|
|
8137
|
+
if (fieldSchema.type !== "enum") {
|
|
8138
|
+
throw new Error("Key " + JSON.stringify(key) + " is not an enum");
|
|
8139
|
+
}
|
|
8140
|
+
const currentVariant = fieldSchema.variants[value];
|
|
8141
|
+
if (!currentVariant) {
|
|
8142
|
+
throw new Error("Value for " + JSON.stringify(key) + " must be one of " + Object.keys(fieldSchema.variants).map((v) => JSON.stringify(v)).join(", ") + ", got " + JSON.stringify(value));
|
|
8143
|
+
}
|
|
8144
|
+
const otherVariants = Object.keys(fieldSchema.variants).filter((v) => v !== value);
|
|
8145
|
+
const otherKeys = new Set;
|
|
8146
|
+
for (const variant of otherVariants) {
|
|
8147
|
+
const otherVariant = fieldSchema.variants[variant];
|
|
8148
|
+
const keys = Object.keys(otherVariant);
|
|
8149
|
+
for (const k of keys) {
|
|
8150
|
+
otherKeys.add(k);
|
|
8151
|
+
}
|
|
8152
|
+
}
|
|
8153
|
+
return [...otherKeys];
|
|
8154
|
+
};
|
|
8038
8155
|
var getEffectiveVisualModeValue = ({
|
|
8039
8156
|
codeValue,
|
|
8040
8157
|
runtimeValue,
|
|
@@ -8080,17 +8197,38 @@ var computeEffectiveSchemaValuesDotNotation = ({
|
|
|
8080
8197
|
propStatus
|
|
8081
8198
|
}) => {
|
|
8082
8199
|
const merged = {};
|
|
8200
|
+
const propsToDelete = new Set;
|
|
8083
8201
|
for (const key of Object.keys(currentValue)) {
|
|
8084
8202
|
const codeValueStatus = propStatus?.[key] ?? null;
|
|
8085
|
-
|
|
8203
|
+
const field = findFieldInSchema(schema, key);
|
|
8204
|
+
if (field?.type === "hidden") {
|
|
8205
|
+
continue;
|
|
8206
|
+
}
|
|
8207
|
+
const value = getEffectiveVisualModeValue({
|
|
8086
8208
|
codeValue: codeValueStatus,
|
|
8087
8209
|
runtimeValue: currentValue[key],
|
|
8088
8210
|
dragOverrideValue: overrideValues[key],
|
|
8089
|
-
defaultValue:
|
|
8211
|
+
defaultValue: field?.default,
|
|
8090
8212
|
shouldResortToDefaultValueIfUndefined: false
|
|
8091
8213
|
});
|
|
8214
|
+
if (value === undefined) {
|
|
8215
|
+
propsToDelete.add(key);
|
|
8216
|
+
}
|
|
8217
|
+
merged[key] = value;
|
|
8092
8218
|
}
|
|
8093
|
-
|
|
8219
|
+
for (const key of Object.keys(overrideValues)) {
|
|
8220
|
+
if (schema[key]?.type === "enum") {
|
|
8221
|
+
const propsToDeleteForKey = findPropsToDelete({
|
|
8222
|
+
schema,
|
|
8223
|
+
key,
|
|
8224
|
+
value: merged[key]
|
|
8225
|
+
});
|
|
8226
|
+
for (const propToDelete of propsToDeleteForKey) {
|
|
8227
|
+
propsToDelete.add(propToDelete);
|
|
8228
|
+
}
|
|
8229
|
+
}
|
|
8230
|
+
}
|
|
8231
|
+
return { merged, propsToDelete };
|
|
8094
8232
|
};
|
|
8095
8233
|
var getNestedValue = (obj, key) => {
|
|
8096
8234
|
const parts = key.split(".");
|
|
@@ -8115,7 +8253,8 @@ var selectActiveKeys = (schema, values) => {
|
|
|
8115
8253
|
var mergeValues = ({
|
|
8116
8254
|
props,
|
|
8117
8255
|
valuesDotNotation,
|
|
8118
|
-
schemaKeys
|
|
8256
|
+
schemaKeys,
|
|
8257
|
+
propsToDelete
|
|
8119
8258
|
}) => {
|
|
8120
8259
|
const merged = { ...props };
|
|
8121
8260
|
for (const key of schemaKeys) {
|
|
@@ -8137,31 +8276,45 @@ var mergeValues = ({
|
|
|
8137
8276
|
}
|
|
8138
8277
|
current[parts[parts.length - 1]] = value;
|
|
8139
8278
|
}
|
|
8279
|
+
deleteNestedKey(merged, propsToDelete);
|
|
8140
8280
|
return merged;
|
|
8141
8281
|
};
|
|
8282
|
+
var stackToOverrideMap = {};
|
|
8142
8283
|
var wrapInSchema = (Component, schema) => {
|
|
8143
|
-
if (typeof process === "undefined" || !process.env?.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
8144
|
-
return Component;
|
|
8145
|
-
}
|
|
8146
8284
|
const flatSchema = getFlatSchemaWithAllKeys(schema);
|
|
8147
8285
|
const flatKeys = Object.keys(flatSchema);
|
|
8148
8286
|
const Wrapped = forwardRef2((props, ref) => {
|
|
8149
8287
|
const env = useRemotionEnvironment();
|
|
8150
|
-
|
|
8151
|
-
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !visualModeEnabled) {
|
|
8288
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
|
|
8152
8289
|
return React13.createElement(Component, {
|
|
8153
8290
|
...props,
|
|
8154
8291
|
_experimentalControls: null,
|
|
8155
8292
|
ref
|
|
8156
8293
|
});
|
|
8157
8294
|
}
|
|
8295
|
+
const { getCodeValues } = useContext15(VisualModeCodeValuesContext);
|
|
8296
|
+
const { getDragOverrides } = useContext15(VisualModeDragOverridesContext);
|
|
8297
|
+
const nodePathMapping = useContext15(OverrideIdsToNodePathsGettersContext);
|
|
8158
8298
|
if (props._experimentalControls) {
|
|
8159
8299
|
return React13.createElement(Component, {
|
|
8160
8300
|
...props,
|
|
8161
8301
|
ref
|
|
8162
8302
|
});
|
|
8163
8303
|
}
|
|
8164
|
-
const [overrideId] = useState5(() =>
|
|
8304
|
+
const [overrideId] = useState5(() => {
|
|
8305
|
+
const { stack } = props;
|
|
8306
|
+
if (!stack) {
|
|
8307
|
+
return String(Math.random());
|
|
8308
|
+
}
|
|
8309
|
+
const existingOverrideId = stackToOverrideMap[stack];
|
|
8310
|
+
if (existingOverrideId) {
|
|
8311
|
+
return existingOverrideId;
|
|
8312
|
+
}
|
|
8313
|
+
const newOverrideId = String(Math.random());
|
|
8314
|
+
stackToOverrideMap[stack] = newOverrideId;
|
|
8315
|
+
return newOverrideId;
|
|
8316
|
+
});
|
|
8317
|
+
const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
|
|
8165
8318
|
const runtimeValues = flatKeys.map((k) => getNestedValue(props, k));
|
|
8166
8319
|
const currentRuntimeValueDotNotation = useMemo15(() => readValuesFromProps(props, flatKeys), runtimeValues);
|
|
8167
8320
|
const controls = useMemo15(() => {
|
|
@@ -8171,19 +8324,25 @@ var wrapInSchema = (Component, schema) => {
|
|
|
8171
8324
|
overrideId
|
|
8172
8325
|
};
|
|
8173
8326
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
8174
|
-
const valuesDotNotation = useMemo15(() => {
|
|
8327
|
+
const { merged: valuesDotNotation, propsToDelete } = useMemo15(() => {
|
|
8175
8328
|
return computeEffectiveSchemaValuesDotNotation({
|
|
8176
8329
|
schema,
|
|
8177
8330
|
currentValue: currentRuntimeValueDotNotation,
|
|
8178
|
-
overrideValues:
|
|
8179
|
-
propStatus:
|
|
8331
|
+
overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
|
|
8332
|
+
propStatus: nodePath === null ? undefined : getCodeValues(nodePath)
|
|
8180
8333
|
});
|
|
8181
|
-
}, [
|
|
8334
|
+
}, [
|
|
8335
|
+
currentRuntimeValueDotNotation,
|
|
8336
|
+
getDragOverrides,
|
|
8337
|
+
nodePath,
|
|
8338
|
+
getCodeValues
|
|
8339
|
+
]);
|
|
8182
8340
|
const activeKeys = selectActiveKeys(schema, valuesDotNotation);
|
|
8183
8341
|
const mergedProps = mergeValues({
|
|
8184
8342
|
props,
|
|
8185
8343
|
valuesDotNotation,
|
|
8186
|
-
schemaKeys: activeKeys
|
|
8344
|
+
schemaKeys: activeKeys,
|
|
8345
|
+
propsToDelete
|
|
8187
8346
|
});
|
|
8188
8347
|
return React13.createElement(Component, {
|
|
8189
8348
|
...mergedProps,
|
|
@@ -8279,7 +8438,6 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8279
8438
|
}, [name]);
|
|
8280
8439
|
const env = useRemotionEnvironment();
|
|
8281
8440
|
const inheritedStack = other?.stack ?? null;
|
|
8282
|
-
const memoizedEffects = useMemoizedEffects(flattenEffects(_experimentalEffects ?? []));
|
|
8283
8441
|
useEffect5(() => {
|
|
8284
8442
|
if (!env.isStudio) {
|
|
8285
8443
|
return;
|
|
@@ -8288,7 +8446,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8288
8446
|
registerSequence({
|
|
8289
8447
|
type: isMedia.type,
|
|
8290
8448
|
controls: controls ?? null,
|
|
8291
|
-
effects:
|
|
8449
|
+
effects: _experimentalEffects ?? [],
|
|
8292
8450
|
displayName: timelineClipName,
|
|
8293
8451
|
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
8294
8452
|
duration: actualDurationInFrames,
|
|
@@ -8326,7 +8484,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8326
8484
|
premountDisplay: premountDisplay ?? null,
|
|
8327
8485
|
postmountDisplay: postmountDisplay ?? null,
|
|
8328
8486
|
controls: controls ?? null,
|
|
8329
|
-
effects:
|
|
8487
|
+
effects: _experimentalEffects ?? []
|
|
8330
8488
|
});
|
|
8331
8489
|
return () => {
|
|
8332
8490
|
unregisterSequence(id);
|
|
@@ -8351,7 +8509,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8351
8509
|
env.isStudio,
|
|
8352
8510
|
inheritedStack,
|
|
8353
8511
|
controls,
|
|
8354
|
-
|
|
8512
|
+
_experimentalEffects,
|
|
8355
8513
|
isMedia
|
|
8356
8514
|
]);
|
|
8357
8515
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
@@ -8842,7 +9000,7 @@ var defaultOnPaint = ({
|
|
|
8842
9000
|
const transform = ctx.drawElementImage(elementImage, 0, 0);
|
|
8843
9001
|
element.style.transform = transform.toString();
|
|
8844
9002
|
};
|
|
8845
|
-
var HtmlInCanvasAncestorContext =
|
|
9003
|
+
var HtmlInCanvasAncestorContext = createContext16(false);
|
|
8846
9004
|
var HtmlInCanvasInner = forwardRef5(({
|
|
8847
9005
|
width,
|
|
8848
9006
|
height,
|
|
@@ -8876,8 +9034,9 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8876
9034
|
}, [ref]);
|
|
8877
9035
|
const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
|
|
8878
9036
|
const chainState = useEffectChainState();
|
|
8879
|
-
const
|
|
8880
|
-
effectsRef
|
|
9037
|
+
const memoizedEffects = useMemoizedEffects(flattenEffects(effects));
|
|
9038
|
+
const effectsRef = useRef9(memoizedEffects);
|
|
9039
|
+
effectsRef.current = memoizedEffects;
|
|
8881
9040
|
const frameRef = useRef9(frame);
|
|
8882
9041
|
frameRef.current = frame;
|
|
8883
9042
|
const onPaintRef = useRef9(onPaint);
|
|
@@ -8977,7 +9136,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8977
9136
|
return;
|
|
8978
9137
|
}
|
|
8979
9138
|
canvas.requestPaint?.();
|
|
8980
|
-
}, [onPaint]);
|
|
9139
|
+
}, [onPaint, memoizedEffects]);
|
|
8981
9140
|
useLayoutEffect3(() => {
|
|
8982
9141
|
const canvas = canvas2dRef.current;
|
|
8983
9142
|
if (!canvas) {
|
|
@@ -9004,7 +9163,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
9004
9163
|
durationInFrames: resolvedDuration,
|
|
9005
9164
|
name: "<HtmlInCanvas>",
|
|
9006
9165
|
_experimentalControls: controls,
|
|
9007
|
-
_experimentalEffects:
|
|
9166
|
+
_experimentalEffects: memoizedEffects,
|
|
9008
9167
|
layout: "none",
|
|
9009
9168
|
...sequenceProps,
|
|
9010
9169
|
children: /* @__PURE__ */ jsx15(HtmlInCanvasAncestorContext.Provider, {
|
|
@@ -9059,7 +9218,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
9059
9218
|
}
|
|
9060
9219
|
validateContent(artifact.content);
|
|
9061
9220
|
};
|
|
9062
|
-
var RenderAssetManager =
|
|
9221
|
+
var RenderAssetManager = createContext17({
|
|
9063
9222
|
registerRenderAsset: () => {
|
|
9064
9223
|
return;
|
|
9065
9224
|
},
|
|
@@ -9197,7 +9356,7 @@ var calculateMediaDuration = ({
|
|
|
9197
9356
|
const actualDuration = duration / playbackRate;
|
|
9198
9357
|
return Math.floor(actualDuration);
|
|
9199
9358
|
};
|
|
9200
|
-
var LoopContext =
|
|
9359
|
+
var LoopContext = createContext18(null);
|
|
9201
9360
|
var useLoop = () => {
|
|
9202
9361
|
return React17.useContext(LoopContext);
|
|
9203
9362
|
};
|
|
@@ -9268,7 +9427,7 @@ var playbackLogging = ({
|
|
|
9268
9427
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
9269
9428
|
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
9270
9429
|
};
|
|
9271
|
-
var PreloadContext =
|
|
9430
|
+
var PreloadContext = createContext19({});
|
|
9272
9431
|
var preloads = {};
|
|
9273
9432
|
var updaters = [];
|
|
9274
9433
|
var setPreloads = (updater) => {
|
|
@@ -9589,7 +9748,7 @@ var durationReducer = (state, action) => {
|
|
|
9589
9748
|
return state;
|
|
9590
9749
|
}
|
|
9591
9750
|
};
|
|
9592
|
-
var DurationsContext =
|
|
9751
|
+
var DurationsContext = createContext20({
|
|
9593
9752
|
durations: {},
|
|
9594
9753
|
setDurations: () => {
|
|
9595
9754
|
throw new Error("context missing");
|
|
@@ -9803,8 +9962,8 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
9803
9962
|
}
|
|
9804
9963
|
return true;
|
|
9805
9964
|
};
|
|
9806
|
-
var SharedAudioContext =
|
|
9807
|
-
var SharedAudioTagsContext =
|
|
9965
|
+
var SharedAudioContext = createContext21(null);
|
|
9966
|
+
var SharedAudioTagsContext = createContext21(null);
|
|
9808
9967
|
var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled }) => {
|
|
9809
9968
|
const logLevel = useLogLevel();
|
|
9810
9969
|
const ctxAndGain = useSingletonAudioContext({
|
|
@@ -9849,8 +10008,9 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9849
10008
|
if (!ctxAndGain) {
|
|
9850
10009
|
throw new Error("Audio context not found");
|
|
9851
10010
|
}
|
|
10011
|
+
const saveForLater = ctxAndGain.audioContext.state === "suspended" && !isResuming.current;
|
|
9852
10012
|
if (duration > 0) {
|
|
9853
|
-
if (
|
|
10013
|
+
if (saveForLater) {
|
|
9854
10014
|
nodesToResume.current.set(node, {
|
|
9855
10015
|
scheduledTime,
|
|
9856
10016
|
offset,
|
|
@@ -9868,7 +10028,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9868
10028
|
const prev = prevEndTimes.current;
|
|
9869
10029
|
const scheduledMismatch = prev.scheduledEndTime !== null && Math.abs(scheduledTime - prev.scheduledEndTime) > 0.001;
|
|
9870
10030
|
const mediaMismatch = prev.mediaEndTime !== null && Math.abs(mediaTime - prev.mediaEndTime) > 0.001;
|
|
9871
|
-
Log.verbose({ logLevel, tag: "audio-scheduling" }, "scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s", scheduledMismatch ? "color: red; font-weight: bold" : "", scheduledTime.toFixed(4), "", scheduledEndTime.toFixed(4), mediaMismatch ? "color: red; font-weight: bold" : "", mediaTime.toFixed(4), "", mediaEndTime.toFixed(4), duration < 0 ? "color: red; font-weight: bold" : timeDiff < 0 ? "color: red; font-weight: bold" : "color: blue; font-weight: bold", duration < 0 ? "missed " + Math.abs(offset).toFixed(2) + "s" : Math.abs(timeDiff).toFixed(2) + (timeDiff < 0 ? " delay" : " ahead"), "", "current=" + currentTime.toFixed(4), "offset=" + offset.toFixed(4), "latency=" + latency.toFixed(4), "state=" + ctxAndGain.audioContext.state, originalUnloopedMediaTimestamp !== mediaTime ? "original_ts=" + originalUnloopedMediaTimestamp.toFixed(4) : "");
|
|
10031
|
+
Log.verbose({ logLevel, tag: "audio-scheduling" }, "scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s %s %s", scheduledMismatch ? "color: red; font-weight: bold" : "", scheduledTime.toFixed(4), "", scheduledEndTime.toFixed(4), mediaMismatch ? "color: red; font-weight: bold" : "", mediaTime.toFixed(4), "", mediaEndTime.toFixed(4), duration < 0 ? "color: red; font-weight: bold" : timeDiff < 0 ? "color: red; font-weight: bold" : "color: blue; font-weight: bold", duration < 0 ? "missed " + Math.abs(offset).toFixed(2) + "s" : Math.abs(timeDiff).toFixed(2) + (timeDiff < 0 ? " delay" : " ahead"), "", "current=" + currentTime.toFixed(4), "actualcurrent=" + ctxAndGain.audioContext.currentTime.toFixed(4), "offset=" + offset.toFixed(4), "latency=" + latency.toFixed(4), "state=" + ctxAndGain.audioContext.state, originalUnloopedMediaTimestamp !== mediaTime ? "original_ts=" + originalUnloopedMediaTimestamp.toFixed(4) : "", "action=" + (saveForLater ? "schedule" : "start"), "");
|
|
9872
10032
|
prev.scheduledEndTime = scheduledEndTime;
|
|
9873
10033
|
prev.mediaEndTime = mediaEndTime;
|
|
9874
10034
|
return duration > 0 ? {
|
|
@@ -9888,6 +10048,13 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9888
10048
|
return Promise.resolve();
|
|
9889
10049
|
}
|
|
9890
10050
|
audioContextIsPlayingEventually.current = true;
|
|
10051
|
+
ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
|
|
10052
|
+
ctxAndGain.gainNode.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
|
|
10053
|
+
ctxAndGain.gainNode.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
|
|
10054
|
+
nodesToResume.current.forEach((r2, node) => {
|
|
10055
|
+
node.start(r2.scheduledTime, r2.offset, r2.duration);
|
|
10056
|
+
});
|
|
10057
|
+
nodesToResume.current.clear();
|
|
9891
10058
|
const resumePromise = ctxAndGain.audioContext.resume();
|
|
9892
10059
|
isResuming.current = new Promise((resolve) => {
|
|
9893
10060
|
waitUntilActuallyResumed(ctxAndGain.audioContext, logLevel).then(resolve);
|
|
@@ -9898,11 +10065,6 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9898
10065
|
}).finally(() => {
|
|
9899
10066
|
isResuming.current = null;
|
|
9900
10067
|
});
|
|
9901
|
-
ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
|
|
9902
|
-
ctxAndGain.gainNode.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
|
|
9903
|
-
ctxAndGain.gainNode.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
|
|
9904
|
-
nodesToResume.current.forEach((r2, node) => node.start(r2.scheduledTime, r2.offset, r2.duration));
|
|
9905
|
-
nodesToResume.current.clear();
|
|
9906
10068
|
return resumePromise.catch(() => {});
|
|
9907
10069
|
}, [ctxAndGain, logLevel]);
|
|
9908
10070
|
const getIsResumingAudioContext = useCallback9(() => {
|
|
@@ -10704,9 +10866,14 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
10704
10866
|
}
|
|
10705
10867
|
};
|
|
10706
10868
|
}
|
|
10869
|
+
let unblocked = false;
|
|
10707
10870
|
setBlocks((b) => [...b, block]);
|
|
10708
10871
|
return {
|
|
10709
10872
|
unblock: () => {
|
|
10873
|
+
if (unblocked) {
|
|
10874
|
+
return;
|
|
10875
|
+
}
|
|
10876
|
+
unblocked = true;
|
|
10710
10877
|
setBlocks((b) => {
|
|
10711
10878
|
const newArr = b.filter((bx) => bx !== block);
|
|
10712
10879
|
if (newArr.length === b.length) {
|
|
@@ -10800,18 +10967,30 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
10800
10967
|
};
|
|
10801
10968
|
var useBufferState = () => {
|
|
10802
10969
|
const buffer = useContext25(BufferingContextReact);
|
|
10970
|
+
const logLevel = useLogLevel();
|
|
10803
10971
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
10804
10972
|
return useMemo25(() => ({
|
|
10805
10973
|
delayPlayback: () => {
|
|
10806
10974
|
if (!addBlock) {
|
|
10807
10975
|
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");
|
|
10808
10976
|
}
|
|
10977
|
+
Log.trace({ logLevel, tag: "[buffer-state]" }, "Adding buffer handle", new Error().stack);
|
|
10809
10978
|
const { unblock } = addBlock({
|
|
10810
10979
|
id: String(Math.random())
|
|
10811
10980
|
});
|
|
10812
|
-
|
|
10981
|
+
let unblocked = false;
|
|
10982
|
+
return {
|
|
10983
|
+
unblock: () => {
|
|
10984
|
+
if (unblocked) {
|
|
10985
|
+
return;
|
|
10986
|
+
}
|
|
10987
|
+
unblocked = true;
|
|
10988
|
+
Log.trace({ logLevel, tag: "[buffer-state]" }, "Removing buffer handle");
|
|
10989
|
+
unblock();
|
|
10990
|
+
}
|
|
10991
|
+
};
|
|
10813
10992
|
}
|
|
10814
|
-
}), [addBlock]);
|
|
10993
|
+
}), [addBlock, logLevel]);
|
|
10815
10994
|
};
|
|
10816
10995
|
var isSafariWebkit = () => {
|
|
10817
10996
|
const isSafari2 = /^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);
|
|
@@ -11579,11 +11758,11 @@ var useMediaTag = ({
|
|
|
11579
11758
|
env.isPlayer
|
|
11580
11759
|
]);
|
|
11581
11760
|
};
|
|
11582
|
-
var MediaVolumeContext =
|
|
11761
|
+
var MediaVolumeContext = createContext22({
|
|
11583
11762
|
mediaMuted: false,
|
|
11584
11763
|
mediaVolume: 1
|
|
11585
11764
|
});
|
|
11586
|
-
var SetMediaVolumeContext =
|
|
11765
|
+
var SetMediaVolumeContext = createContext22({
|
|
11587
11766
|
setMediaMuted: () => {
|
|
11588
11767
|
throw new Error("default");
|
|
11589
11768
|
},
|
|
@@ -12389,10 +12568,13 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
12389
12568
|
};
|
|
12390
12569
|
var defineEffect = (definition) => definition;
|
|
12391
12570
|
var createDescriptor = (definition, params) => {
|
|
12571
|
+
const widened = definition;
|
|
12392
12572
|
return {
|
|
12393
|
-
definition,
|
|
12573
|
+
definition: widened,
|
|
12394
12574
|
params,
|
|
12395
|
-
stack: new Error().stack
|
|
12575
|
+
stack: new Error().stack,
|
|
12576
|
+
effectKey: widened.calculateKey(params),
|
|
12577
|
+
memoized: false
|
|
12396
12578
|
};
|
|
12397
12579
|
};
|
|
12398
12580
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
@@ -12417,7 +12599,7 @@ var waitForRoot = (fn) => {
|
|
|
12417
12599
|
listeners = listeners.filter((l) => l !== fn);
|
|
12418
12600
|
};
|
|
12419
12601
|
};
|
|
12420
|
-
var MediaEnabledContext =
|
|
12602
|
+
var MediaEnabledContext = createContext23(null);
|
|
12421
12603
|
var useVideoEnabled = () => {
|
|
12422
12604
|
const context = useContext32(MediaEnabledContext);
|
|
12423
12605
|
if (!context) {
|
|
@@ -12456,8 +12638,7 @@ var RemotionRootContexts = ({
|
|
|
12456
12638
|
audioLatencyHint,
|
|
12457
12639
|
videoEnabled,
|
|
12458
12640
|
audioEnabled,
|
|
12459
|
-
frameState
|
|
12460
|
-
visualModeEnabled
|
|
12641
|
+
frameState
|
|
12461
12642
|
}) => {
|
|
12462
12643
|
const nonceContext = useMemo322(() => {
|
|
12463
12644
|
let counter = 0;
|
|
@@ -12480,7 +12661,6 @@ var RemotionRootContexts = ({
|
|
|
12480
12661
|
children: /* @__PURE__ */ jsx29(EditorPropsProvider, {
|
|
12481
12662
|
children: /* @__PURE__ */ jsx29(PrefetchProvider, {
|
|
12482
12663
|
children: /* @__PURE__ */ jsx29(SequenceManagerProvider, {
|
|
12483
|
-
visualModeEnabled,
|
|
12484
12664
|
children: /* @__PURE__ */ jsx29(DurationsContextProvider, {
|
|
12485
12665
|
children: /* @__PURE__ */ jsx29(BufferingProvider, {
|
|
12486
12666
|
children: /* @__PURE__ */ jsx29(SharedAudioContextProvider, {
|
|
@@ -12699,7 +12879,7 @@ var setupEnvVariables = () => {
|
|
|
12699
12879
|
});
|
|
12700
12880
|
};
|
|
12701
12881
|
var CurrentScaleContext = React32.createContext(null);
|
|
12702
|
-
var PreviewSizeContext =
|
|
12882
|
+
var PreviewSizeContext = createContext24({
|
|
12703
12883
|
setSize: () => {
|
|
12704
12884
|
return;
|
|
12705
12885
|
},
|
|
@@ -12722,14 +12902,6 @@ var calculateScale = ({
|
|
|
12722
12902
|
}
|
|
12723
12903
|
return Number(previewSize);
|
|
12724
12904
|
};
|
|
12725
|
-
var useSequenceControlOverride = (key) => {
|
|
12726
|
-
const seqContext = useContext33(SequenceContext);
|
|
12727
|
-
const { dragOverrides: overrides } = useContext33(VisualModeOverridesContext);
|
|
12728
|
-
if (!seqContext) {
|
|
12729
|
-
return;
|
|
12730
|
-
}
|
|
12731
|
-
return overrides[seqContext.id]?.[key];
|
|
12732
|
-
};
|
|
12733
12905
|
var getOffthreadVideoSource = ({
|
|
12734
12906
|
src,
|
|
12735
12907
|
transparent,
|
|
@@ -12761,9 +12933,9 @@ var OffthreadVideoForRendering = ({
|
|
|
12761
12933
|
const frame = useCurrentFrame();
|
|
12762
12934
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
12763
12935
|
const videoConfig = useUnsafeVideoConfig();
|
|
12764
|
-
const sequenceContext =
|
|
12936
|
+
const sequenceContext = useContext33(SequenceContext);
|
|
12765
12937
|
const mediaStartsAt = useMediaStartsAt();
|
|
12766
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
12938
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
|
|
12767
12939
|
if (!src) {
|
|
12768
12940
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
12769
12941
|
}
|
|
@@ -12975,7 +13147,7 @@ class MediaPlaybackError extends Error {
|
|
|
12975
13147
|
}
|
|
12976
13148
|
}
|
|
12977
13149
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
12978
|
-
const context =
|
|
13150
|
+
const context = useContext34(SharedAudioContext);
|
|
12979
13151
|
if (!context) {
|
|
12980
13152
|
throw new Error("SharedAudioContext not found");
|
|
12981
13153
|
}
|
|
@@ -13031,8 +13203,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
13031
13203
|
}
|
|
13032
13204
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
13033
13205
|
const { fps, durationInFrames } = useVideoConfig();
|
|
13034
|
-
const parentSequence =
|
|
13035
|
-
const { hidden } =
|
|
13206
|
+
const parentSequence = useContext34(SequenceContext);
|
|
13207
|
+
const { hidden } = useContext34(SequenceVisibilityToggleContext);
|
|
13036
13208
|
const logLevel = useLogLevel();
|
|
13037
13209
|
const mountTime = useMountTime();
|
|
13038
13210
|
const [timelineId] = useState21(() => String(Math.random()));
|
|
@@ -13456,7 +13628,9 @@ var Internals = {
|
|
|
13456
13628
|
VideoForPreview,
|
|
13457
13629
|
CompositionManager,
|
|
13458
13630
|
CompositionSetters,
|
|
13459
|
-
|
|
13631
|
+
VisualModeCodeValuesContext,
|
|
13632
|
+
VisualModeDragOverridesContext,
|
|
13633
|
+
VisualModeSettersContext,
|
|
13460
13634
|
SequenceManager,
|
|
13461
13635
|
SequenceStackTracesUpdateContext,
|
|
13462
13636
|
SequenceVisibilityToggleContext,
|
|
@@ -13465,7 +13639,6 @@ var Internals = {
|
|
|
13465
13639
|
sequenceStyleSchema,
|
|
13466
13640
|
flattenActiveSchema,
|
|
13467
13641
|
getFlatSchemaWithAllKeys,
|
|
13468
|
-
useSequenceControlOverride,
|
|
13469
13642
|
RemotionRootContexts,
|
|
13470
13643
|
CompositionManagerProvider,
|
|
13471
13644
|
useVideo,
|
|
@@ -13558,7 +13731,11 @@ var Internals = {
|
|
|
13558
13731
|
useMemoizedEffects,
|
|
13559
13732
|
defineEffect,
|
|
13560
13733
|
createDescriptor,
|
|
13561
|
-
computeEffectiveSchemaValuesDotNotation
|
|
13734
|
+
computeEffectiveSchemaValuesDotNotation,
|
|
13735
|
+
OverrideIdsToNodePathsGettersContext,
|
|
13736
|
+
OverrideIdsToNodePathsSettersContext,
|
|
13737
|
+
findPropsToDelete,
|
|
13738
|
+
flattenEffects
|
|
13562
13739
|
};
|
|
13563
13740
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
13564
13741
|
var PERCENTAGE = NUMBER + "%";
|
|
@@ -13596,7 +13773,7 @@ var flattenChildren = (children) => {
|
|
|
13596
13773
|
return flatChildren;
|
|
13597
13774
|
}, []);
|
|
13598
13775
|
};
|
|
13599
|
-
var IsInsideSeriesContext =
|
|
13776
|
+
var IsInsideSeriesContext = createContext25(false);
|
|
13600
13777
|
var IsInsideSeriesContainer = ({ children }) => {
|
|
13601
13778
|
return /* @__PURE__ */ jsx34(IsInsideSeriesContext.Provider, {
|
|
13602
13779
|
value: true,
|
|
@@ -13638,9 +13815,6 @@ var SeriesInner = (props2) => {
|
|
|
13638
13815
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`);
|
|
13639
13816
|
}
|
|
13640
13817
|
const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
|
|
13641
|
-
if (!castedChild?.props.children) {
|
|
13642
|
-
throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
|
|
13643
|
-
}
|
|
13644
13818
|
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
13645
13819
|
const {
|
|
13646
13820
|
durationInFrames,
|
|
@@ -14156,13 +14330,13 @@ var VideoForRenderingForwardFunction = ({
|
|
|
14156
14330
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
14157
14331
|
const videoConfig = useUnsafeVideoConfig();
|
|
14158
14332
|
const videoRef = useRef23(null);
|
|
14159
|
-
const sequenceContext =
|
|
14333
|
+
const sequenceContext = useContext35(SequenceContext);
|
|
14160
14334
|
const mediaStartsAt = useMediaStartsAt();
|
|
14161
14335
|
const environment = useRemotionEnvironment();
|
|
14162
14336
|
const logLevel = useLogLevel();
|
|
14163
14337
|
const mountTime = useMountTime();
|
|
14164
14338
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
14165
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
14339
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext35(RenderAssetManager);
|
|
14166
14340
|
const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
14167
14341
|
props2.src,
|
|
14168
14342
|
sequenceContext?.cumulatedFrom,
|
|
@@ -14372,7 +14546,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
14372
14546
|
if (environment.isClientSideRendering) {
|
|
14373
14547
|
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");
|
|
14374
14548
|
}
|
|
14375
|
-
const { durations, setDurations } =
|
|
14549
|
+
const { durations, setDurations } = useContext36(DurationsContext);
|
|
14376
14550
|
if (typeof ref === "string") {
|
|
14377
14551
|
throw new Error("string refs are not supported");
|
|
14378
14552
|
}
|