@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/experts.js
CHANGED
|
@@ -954,6 +954,7 @@ import {
|
|
|
954
954
|
} from "react";
|
|
955
955
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
956
956
|
import { useEffect as useEffect3, useMemo as useMemo10, useRef as useRef4 } from "react";
|
|
957
|
+
import { useRef as useRef5 } from "react";
|
|
957
958
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
958
959
|
import {
|
|
959
960
|
forwardRef as forwardRef3,
|
|
@@ -962,7 +963,6 @@ import {
|
|
|
962
963
|
useMemo as useMemo16,
|
|
963
964
|
useState as useState6
|
|
964
965
|
} from "react";
|
|
965
|
-
import { useRef as useRef5 } from "react";
|
|
966
966
|
import { useContext as useContext14, useMemo as useMemo13 } from "react";
|
|
967
967
|
import { useContext as useContext13 } from "react";
|
|
968
968
|
import { useContext as useContext12, useMemo as useMemo12 } from "react";
|
|
@@ -971,6 +971,7 @@ import { createContext as createContext14 } from "react";
|
|
|
971
971
|
import React12, { useCallback as useCallback5, useMemo as useMemo14, useRef as useRef6, useState as useState4 } from "react";
|
|
972
972
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
973
973
|
import React13, { forwardRef as forwardRef2, useState as useState5, useContext as useContext15, useMemo as useMemo15 } from "react";
|
|
974
|
+
import { createContext as createContext15 } from "react";
|
|
974
975
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
975
976
|
import {
|
|
976
977
|
forwardRef as forwardRef4,
|
|
@@ -984,7 +985,7 @@ import React15, { useCallback as useCallback6, useImperativeHandle, useRef as us
|
|
|
984
985
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
985
986
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
986
987
|
import {
|
|
987
|
-
createContext as
|
|
988
|
+
createContext as createContext16,
|
|
988
989
|
forwardRef as forwardRef5,
|
|
989
990
|
useCallback as useCallback7,
|
|
990
991
|
useContext as useContext17,
|
|
@@ -996,7 +997,7 @@ import {
|
|
|
996
997
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
997
998
|
import { useContext as useContext18, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
|
|
998
999
|
import {
|
|
999
|
-
createContext as
|
|
1000
|
+
createContext as createContext17,
|
|
1000
1001
|
useCallback as useCallback8,
|
|
1001
1002
|
useImperativeHandle as useImperativeHandle3,
|
|
1002
1003
|
useLayoutEffect as useLayoutEffect4,
|
|
@@ -1006,12 +1007,12 @@ import {
|
|
|
1006
1007
|
} from "react";
|
|
1007
1008
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1008
1009
|
import { forwardRef as forwardRef8, useCallback as useCallback13, useContext as useContext30 } from "react";
|
|
1009
|
-
import React17, { createContext as
|
|
1010
|
+
import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
|
|
1010
1011
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1011
1012
|
import { useContext as useContext19 } from "react";
|
|
1012
|
-
import { createContext as
|
|
1013
|
+
import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
|
|
1013
1014
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1014
|
-
import { createContext as
|
|
1015
|
+
import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
|
|
1015
1016
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1016
1017
|
import React23, {
|
|
1017
1018
|
forwardRef as forwardRef6,
|
|
@@ -1024,7 +1025,7 @@ import React23, {
|
|
|
1024
1025
|
} from "react";
|
|
1025
1026
|
import { useContext as useContext21, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
|
|
1026
1027
|
import React20, {
|
|
1027
|
-
createContext as
|
|
1028
|
+
createContext as createContext21,
|
|
1028
1029
|
createRef as createRef2,
|
|
1029
1030
|
useCallback as useCallback9,
|
|
1030
1031
|
useContext as useContext20,
|
|
@@ -1060,7 +1061,7 @@ import React22 from "react";
|
|
|
1060
1061
|
import { useEffect as useEffect10, useState as useState15 } from "react";
|
|
1061
1062
|
import { useEffect as useEffect11, useRef as useRef16 } from "react";
|
|
1062
1063
|
import { useEffect as useEffect13 } from "react";
|
|
1063
|
-
import { createContext as
|
|
1064
|
+
import { createContext as createContext22, useContext as useContext27, useMemo as useMemo27 } from "react";
|
|
1064
1065
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
1065
1066
|
import {
|
|
1066
1067
|
forwardRef as forwardRef7,
|
|
@@ -1096,16 +1097,15 @@ import {
|
|
|
1096
1097
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1097
1098
|
import React29 from "react";
|
|
1098
1099
|
import { useMemo as useMemo32 } from "react";
|
|
1099
|
-
import { createContext as
|
|
1100
|
+
import { createContext as createContext23, useContext as useContext32, useMemo as useMemo31 } from "react";
|
|
1100
1101
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1101
1102
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1102
1103
|
import React31 from "react";
|
|
1103
|
-
import React32, { createContext as
|
|
1104
|
-
import { useContext as useContext33 } from "react";
|
|
1104
|
+
import React32, { createContext as createContext24 } from "react";
|
|
1105
1105
|
import { useCallback as useCallback18 } from "react";
|
|
1106
1106
|
import {
|
|
1107
1107
|
useCallback as useCallback17,
|
|
1108
|
-
useContext as
|
|
1108
|
+
useContext as useContext33,
|
|
1109
1109
|
useEffect as useEffect16,
|
|
1110
1110
|
useLayoutEffect as useLayoutEffect11,
|
|
1111
1111
|
useMemo as useMemo33,
|
|
@@ -1114,7 +1114,7 @@ import {
|
|
|
1114
1114
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1115
1115
|
import React34, {
|
|
1116
1116
|
forwardRef as forwardRef10,
|
|
1117
|
-
useContext as
|
|
1117
|
+
useContext as useContext34,
|
|
1118
1118
|
useEffect as useEffect18,
|
|
1119
1119
|
useImperativeHandle as useImperativeHandle8,
|
|
1120
1120
|
useMemo as useMemo34,
|
|
@@ -1128,14 +1128,14 @@ import React36, { useMemo as useMemo35 } from "react";
|
|
|
1128
1128
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1129
1129
|
import { Children, forwardRef as forwardRef11, useMemo as useMemo36 } from "react";
|
|
1130
1130
|
import React37 from "react";
|
|
1131
|
-
import React38, { createContext as
|
|
1131
|
+
import React38, { createContext as createContext25 } from "react";
|
|
1132
1132
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1133
1133
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1134
1134
|
import React40 from "react";
|
|
1135
|
-
import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as
|
|
1135
|
+
import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as useContext36 } from "react";
|
|
1136
1136
|
import {
|
|
1137
1137
|
forwardRef as forwardRef12,
|
|
1138
|
-
useContext as
|
|
1138
|
+
useContext as useContext35,
|
|
1139
1139
|
useEffect as useEffect19,
|
|
1140
1140
|
useImperativeHandle as useImperativeHandle9,
|
|
1141
1141
|
useLayoutEffect as useLayoutEffect12,
|
|
@@ -2416,6 +2416,39 @@ var useCurrentFrame = () => {
|
|
|
2416
2416
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
2417
2417
|
return frame - contextOffset;
|
|
2418
2418
|
};
|
|
2419
|
+
var flattenEffects = (effects) => {
|
|
2420
|
+
const out = [];
|
|
2421
|
+
for (const item of effects) {
|
|
2422
|
+
if (Array.isArray(item)) {
|
|
2423
|
+
for (const inner of item) {
|
|
2424
|
+
out.push(inner);
|
|
2425
|
+
}
|
|
2426
|
+
} else {
|
|
2427
|
+
out.push(item);
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
return out;
|
|
2431
|
+
};
|
|
2432
|
+
var groupByBackend = (effects) => {
|
|
2433
|
+
const runs = [];
|
|
2434
|
+
let current = [];
|
|
2435
|
+
let currentBackend = null;
|
|
2436
|
+
for (const eff of effects) {
|
|
2437
|
+
const { backend } = eff.definition;
|
|
2438
|
+
if (currentBackend === null || backend === currentBackend) {
|
|
2439
|
+
current.push(eff);
|
|
2440
|
+
currentBackend = backend;
|
|
2441
|
+
} else {
|
|
2442
|
+
runs.push({ backend: currentBackend, effects: current });
|
|
2443
|
+
current = [eff];
|
|
2444
|
+
currentBackend = backend;
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
if (currentBackend !== null && current.length > 0) {
|
|
2448
|
+
runs.push({ backend: currentBackend, effects: current });
|
|
2449
|
+
}
|
|
2450
|
+
return runs;
|
|
2451
|
+
};
|
|
2419
2452
|
|
|
2420
2453
|
class CanvasPool {
|
|
2421
2454
|
width;
|
|
@@ -2489,39 +2522,6 @@ class CanvasPool {
|
|
|
2489
2522
|
}
|
|
2490
2523
|
}
|
|
2491
2524
|
}
|
|
2492
|
-
var flattenEffects = (effects) => {
|
|
2493
|
-
const out = [];
|
|
2494
|
-
for (const item of effects) {
|
|
2495
|
-
if (Array.isArray(item)) {
|
|
2496
|
-
for (const inner of item) {
|
|
2497
|
-
out.push(inner);
|
|
2498
|
-
}
|
|
2499
|
-
} else {
|
|
2500
|
-
out.push(item);
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
return out;
|
|
2504
|
-
};
|
|
2505
|
-
var groupByBackend = (effects) => {
|
|
2506
|
-
const runs = [];
|
|
2507
|
-
let current = [];
|
|
2508
|
-
let currentBackend = null;
|
|
2509
|
-
for (const eff of effects) {
|
|
2510
|
-
const { backend } = eff.definition;
|
|
2511
|
-
if (currentBackend === null || backend === currentBackend) {
|
|
2512
|
-
current.push(eff);
|
|
2513
|
-
currentBackend = backend;
|
|
2514
|
-
} else {
|
|
2515
|
-
runs.push({ backend: currentBackend, effects: current });
|
|
2516
|
-
current = [eff];
|
|
2517
|
-
currentBackend = backend;
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
if (currentBackend !== null && current.length > 0) {
|
|
2521
|
-
runs.push({ backend: currentBackend, effects: current });
|
|
2522
|
-
}
|
|
2523
|
-
return runs;
|
|
2524
|
-
};
|
|
2525
2525
|
var devicePromise = null;
|
|
2526
2526
|
var getGpuDevice = () => {
|
|
2527
2527
|
if (devicePromise) {
|
|
@@ -2573,8 +2573,7 @@ var runEffectChain = async ({
|
|
|
2573
2573
|
}) => {
|
|
2574
2574
|
const runId = ++state.currentRunId;
|
|
2575
2575
|
const isCancelled = () => state.currentRunId !== runId;
|
|
2576
|
-
const
|
|
2577
|
-
const runs = groupByBackend(flattened);
|
|
2576
|
+
const runs = groupByBackend(effects);
|
|
2578
2577
|
let currentImage = source;
|
|
2579
2578
|
let lastTarget = null;
|
|
2580
2579
|
if (runs.length === 0) {
|
|
@@ -2668,12 +2667,29 @@ var useEffectChainState = () => {
|
|
|
2668
2667
|
}
|
|
2669
2668
|
}), []);
|
|
2670
2669
|
};
|
|
2670
|
+
var useMemoizedEffects = (effects) => {
|
|
2671
|
+
const previousRef = useRef5(null);
|
|
2672
|
+
const previous = previousRef.current;
|
|
2673
|
+
const isSame = previous !== null && previous.length === effects.length && previous.every((p, i) => p.definition === effects[i].definition && p.effectKey === effects[i].effectKey);
|
|
2674
|
+
if (isSame) {
|
|
2675
|
+
return previous;
|
|
2676
|
+
}
|
|
2677
|
+
const next = effects.map((e) => ({
|
|
2678
|
+
definition: e.definition,
|
|
2679
|
+
stack: e.stack,
|
|
2680
|
+
effectKey: e.effectKey,
|
|
2681
|
+
params: e.params,
|
|
2682
|
+
memoized: true
|
|
2683
|
+
}));
|
|
2684
|
+
previousRef.current = next;
|
|
2685
|
+
return next;
|
|
2686
|
+
};
|
|
2671
2687
|
var componentsToAddStacksTo = [];
|
|
2672
2688
|
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
2673
2689
|
var addSequenceStackTraces = (component) => {
|
|
2674
2690
|
componentsToAddStacksTo.push(component);
|
|
2675
2691
|
};
|
|
2676
|
-
var VERSION = "4.0.
|
|
2692
|
+
var VERSION = "4.0.461";
|
|
2677
2693
|
var checkMultipleRemotionVersions = () => {
|
|
2678
2694
|
if (typeof globalThis === "undefined") {
|
|
2679
2695
|
return;
|
|
@@ -2701,20 +2717,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2701
2717
|
}
|
|
2702
2718
|
set();
|
|
2703
2719
|
};
|
|
2704
|
-
var useMemoizedEffects = (effects) => {
|
|
2705
|
-
const previousRef = useRef5(null);
|
|
2706
|
-
const previous = previousRef.current;
|
|
2707
|
-
const isSame = previous !== null && previous.length === effects.length && previous.every((p, i) => p.definition === effects[i].definition && p.stack === effects[i].stack);
|
|
2708
|
-
if (isSame) {
|
|
2709
|
-
return previous;
|
|
2710
|
-
}
|
|
2711
|
-
const next = effects.map((e) => ({
|
|
2712
|
-
definition: e.definition,
|
|
2713
|
-
stack: e.stack
|
|
2714
|
-
}));
|
|
2715
|
-
previousRef.current = next;
|
|
2716
|
-
return next;
|
|
2717
|
-
};
|
|
2718
2720
|
var useUnsafeVideoConfig = () => {
|
|
2719
2721
|
const context = useContext12(SequenceContext);
|
|
2720
2722
|
const ctxWidth = context?.width ?? null;
|
|
@@ -2872,6 +2874,22 @@ var sequenceStyleSchema = {
|
|
|
2872
2874
|
step: 0.01,
|
|
2873
2875
|
default: 1,
|
|
2874
2876
|
description: "Opacity"
|
|
2877
|
+
},
|
|
2878
|
+
premountFor: {
|
|
2879
|
+
type: "number",
|
|
2880
|
+
default: 0,
|
|
2881
|
+
description: "Premount For",
|
|
2882
|
+
min: 0,
|
|
2883
|
+
step: 1
|
|
2884
|
+
},
|
|
2885
|
+
postmountFor: {
|
|
2886
|
+
type: "hidden"
|
|
2887
|
+
},
|
|
2888
|
+
styleWhilePremounted: {
|
|
2889
|
+
type: "hidden"
|
|
2890
|
+
},
|
|
2891
|
+
styleWhilePostmounted: {
|
|
2892
|
+
type: "hidden"
|
|
2875
2893
|
}
|
|
2876
2894
|
};
|
|
2877
2895
|
var sequenceSchema = {
|
|
@@ -2892,6 +2910,9 @@ var sequenceSchemaDefaultLayoutNone = {
|
|
|
2892
2910
|
default: "none"
|
|
2893
2911
|
}
|
|
2894
2912
|
};
|
|
2913
|
+
var nodePathToString = (nodePath) => {
|
|
2914
|
+
return nodePath.join(".");
|
|
2915
|
+
};
|
|
2895
2916
|
var SequenceManager = React12.createContext({
|
|
2896
2917
|
registerSequence: () => {
|
|
2897
2918
|
throw new Error("SequenceManagerContext not initialized");
|
|
@@ -2907,60 +2928,73 @@ var SequenceVisibilityToggleContext = React12.createContext({
|
|
|
2907
2928
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
2908
2929
|
}
|
|
2909
2930
|
});
|
|
2910
|
-
var
|
|
2911
|
-
|
|
2931
|
+
var getCodeValuesCtx = (codeValues, nodePath) => {
|
|
2932
|
+
const status = codeValues[nodePathToString(nodePath)];
|
|
2933
|
+
if (!status) {
|
|
2934
|
+
return;
|
|
2935
|
+
}
|
|
2936
|
+
if (!status.canUpdate) {
|
|
2937
|
+
return;
|
|
2938
|
+
}
|
|
2939
|
+
return status.props;
|
|
2940
|
+
};
|
|
2941
|
+
var VisualModeCodeValuesContext = React12.createContext({
|
|
2942
|
+
getCodeValues: () => {
|
|
2943
|
+
throw new Error("VisualModeCodeValuesContext not initialized");
|
|
2944
|
+
}
|
|
2945
|
+
});
|
|
2946
|
+
var VisualModeDragOverridesContext = React12.createContext({
|
|
2947
|
+
getDragOverrides: () => {
|
|
2948
|
+
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
2949
|
+
}
|
|
2950
|
+
});
|
|
2951
|
+
var VisualModeSettersContext = React12.createContext({
|
|
2912
2952
|
setDragOverrides: () => {
|
|
2913
|
-
throw new Error("
|
|
2953
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
2914
2954
|
},
|
|
2915
2955
|
clearDragOverrides: () => {
|
|
2916
|
-
throw new Error("
|
|
2956
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
2917
2957
|
},
|
|
2918
|
-
codeValues: {},
|
|
2919
2958
|
setCodeValues: () => {
|
|
2920
|
-
throw new Error("
|
|
2921
|
-
}
|
|
2922
|
-
visualModeEnabled: false
|
|
2959
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
2960
|
+
}
|
|
2923
2961
|
});
|
|
2924
|
-
var SequenceManagerProvider = ({ children
|
|
2962
|
+
var SequenceManagerProvider = ({ children }) => {
|
|
2925
2963
|
const [sequences, setSequences] = useState4([]);
|
|
2926
2964
|
const [hidden, setHidden] = useState4({});
|
|
2927
2965
|
const [dragOverrides, setControlOverrides] = useState4({});
|
|
2928
2966
|
const controlOverridesRef = useRef6(dragOverrides);
|
|
2929
2967
|
controlOverridesRef.current = dragOverrides;
|
|
2930
2968
|
const [codeValues, setCodeValuesMapState] = useState4({});
|
|
2931
|
-
const setDragOverrides = useCallback5((
|
|
2969
|
+
const setDragOverrides = useCallback5((nodePath, key, value) => {
|
|
2932
2970
|
setControlOverrides((prev) => ({
|
|
2933
2971
|
...prev,
|
|
2934
|
-
[
|
|
2935
|
-
...prev[
|
|
2972
|
+
[nodePathToString(nodePath)]: {
|
|
2973
|
+
...prev[nodePathToString(nodePath)],
|
|
2936
2974
|
[key]: value
|
|
2937
2975
|
}
|
|
2938
2976
|
}));
|
|
2939
2977
|
}, []);
|
|
2940
|
-
const clearDragOverrides = useCallback5((
|
|
2978
|
+
const clearDragOverrides = useCallback5((nodePath) => {
|
|
2941
2979
|
setControlOverrides((prev) => {
|
|
2942
|
-
|
|
2980
|
+
const key = nodePathToString(nodePath);
|
|
2981
|
+
if (!prev[key]) {
|
|
2943
2982
|
return prev;
|
|
2944
2983
|
}
|
|
2945
2984
|
const next = { ...prev };
|
|
2946
|
-
delete next[
|
|
2985
|
+
delete next[key];
|
|
2947
2986
|
return next;
|
|
2948
2987
|
});
|
|
2949
2988
|
}, []);
|
|
2950
|
-
const setCodeValues = useCallback5((
|
|
2989
|
+
const setCodeValues = useCallback5((nodePath, values) => {
|
|
2951
2990
|
setCodeValuesMapState((prev) => {
|
|
2952
|
-
|
|
2991
|
+
const key = nodePathToString(nodePath);
|
|
2992
|
+
const prevKey = prev[key];
|
|
2993
|
+
const newKey = values(prevKey);
|
|
2994
|
+
if (prevKey === newKey) {
|
|
2953
2995
|
return prev;
|
|
2954
2996
|
}
|
|
2955
|
-
|
|
2956
|
-
if (!(sequenceId in prev)) {
|
|
2957
|
-
return prev;
|
|
2958
|
-
}
|
|
2959
|
-
const next = { ...prev };
|
|
2960
|
-
delete next[sequenceId];
|
|
2961
|
-
return next;
|
|
2962
|
-
}
|
|
2963
|
-
return { ...prev, [sequenceId]: values };
|
|
2997
|
+
return { ...prev, [key]: newKey };
|
|
2964
2998
|
});
|
|
2965
2999
|
}, []);
|
|
2966
3000
|
const registerSequence = useCallback5((seq) => {
|
|
@@ -2984,40 +3018,85 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
2984
3018
|
setHidden
|
|
2985
3019
|
};
|
|
2986
3020
|
}, [hidden]);
|
|
2987
|
-
const
|
|
3021
|
+
const getDragOverrides = useCallback5((nodePath) => {
|
|
3022
|
+
return dragOverrides[nodePathToString(nodePath)] ?? {};
|
|
3023
|
+
}, [dragOverrides]);
|
|
3024
|
+
const getCodeValues = useCallback5((nodePath) => {
|
|
3025
|
+
return getCodeValuesCtx(codeValues, nodePath);
|
|
3026
|
+
}, [codeValues]);
|
|
3027
|
+
const codeValuesContext = useMemo14(() => {
|
|
3028
|
+
return {
|
|
3029
|
+
getCodeValues
|
|
3030
|
+
};
|
|
3031
|
+
}, [getCodeValues]);
|
|
3032
|
+
const dragOverridesContext = useMemo14(() => {
|
|
3033
|
+
return {
|
|
3034
|
+
getDragOverrides
|
|
3035
|
+
};
|
|
3036
|
+
}, [getDragOverrides]);
|
|
3037
|
+
const settersContext = useMemo14(() => {
|
|
2988
3038
|
return {
|
|
2989
|
-
visualModeEnabled,
|
|
2990
|
-
dragOverrides,
|
|
2991
3039
|
setDragOverrides,
|
|
2992
3040
|
clearDragOverrides,
|
|
2993
|
-
codeValues,
|
|
2994
3041
|
setCodeValues
|
|
2995
3042
|
};
|
|
2996
|
-
}, [
|
|
2997
|
-
visualModeEnabled,
|
|
2998
|
-
dragOverrides,
|
|
2999
|
-
setDragOverrides,
|
|
3000
|
-
clearDragOverrides,
|
|
3001
|
-
codeValues,
|
|
3002
|
-
setCodeValues
|
|
3003
|
-
]);
|
|
3043
|
+
}, [setDragOverrides, clearDragOverrides, setCodeValues]);
|
|
3004
3044
|
return /* @__PURE__ */ jsx11(SequenceManager.Provider, {
|
|
3005
3045
|
value: sequenceContext,
|
|
3006
3046
|
children: /* @__PURE__ */ jsx11(SequenceVisibilityToggleContext.Provider, {
|
|
3007
3047
|
value: hiddenContext,
|
|
3008
|
-
children: /* @__PURE__ */ jsx11(
|
|
3009
|
-
value:
|
|
3010
|
-
children
|
|
3048
|
+
children: /* @__PURE__ */ jsx11(VisualModeCodeValuesContext.Provider, {
|
|
3049
|
+
value: codeValuesContext,
|
|
3050
|
+
children: /* @__PURE__ */ jsx11(VisualModeDragOverridesContext.Provider, {
|
|
3051
|
+
value: dragOverridesContext,
|
|
3052
|
+
children: /* @__PURE__ */ jsx11(VisualModeSettersContext.Provider, {
|
|
3053
|
+
value: settersContext,
|
|
3054
|
+
children
|
|
3055
|
+
})
|
|
3056
|
+
})
|
|
3011
3057
|
})
|
|
3012
3058
|
})
|
|
3013
3059
|
});
|
|
3014
3060
|
};
|
|
3015
3061
|
var ENABLE_V5_BREAKING_CHANGES = false;
|
|
3062
|
+
var deleteNestedKey = (obj, keysToRemove) => {
|
|
3063
|
+
for (const key of keysToRemove) {
|
|
3064
|
+
const parts = key.split(".");
|
|
3065
|
+
const parents = [obj];
|
|
3066
|
+
let current = obj;
|
|
3067
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
3068
|
+
const part = parts[i];
|
|
3069
|
+
const next = current[part];
|
|
3070
|
+
if (next === undefined || next === null) {
|
|
3071
|
+
current = null;
|
|
3072
|
+
break;
|
|
3073
|
+
}
|
|
3074
|
+
current = next;
|
|
3075
|
+
parents.push(current);
|
|
3076
|
+
}
|
|
3077
|
+
if (current === null) {
|
|
3078
|
+
continue;
|
|
3079
|
+
}
|
|
3080
|
+
delete current[parts[parts.length - 1]];
|
|
3081
|
+
for (let i = parents.length - 1;i > 0; i--) {
|
|
3082
|
+
const parent = parents[i];
|
|
3083
|
+
if (Object.keys(parent).length === 0) {
|
|
3084
|
+
const parentKey = parts[i - 1];
|
|
3085
|
+
delete parents[i - 1][parentKey];
|
|
3086
|
+
} else {
|
|
3087
|
+
break;
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
return obj;
|
|
3092
|
+
};
|
|
3016
3093
|
var flattenActiveSchema = (schema, resolve) => {
|
|
3017
3094
|
const out = {};
|
|
3018
3095
|
for (const key of Object.keys(schema)) {
|
|
3019
3096
|
const field = schema[key];
|
|
3020
|
-
if (field.type === "
|
|
3097
|
+
if (field.type === "hidden") {
|
|
3098
|
+
continue;
|
|
3099
|
+
} else if (field.type === "enum") {
|
|
3021
3100
|
out[key] = field;
|
|
3022
3101
|
const current = resolve(key) ?? field.default;
|
|
3023
3102
|
const variant = field.variants[current];
|
|
@@ -3052,6 +3131,44 @@ var getFlatSchemaWithAllKeys = (schema) => {
|
|
|
3052
3131
|
}
|
|
3053
3132
|
return out;
|
|
3054
3133
|
};
|
|
3134
|
+
var OverrideIdsToNodePathsGettersContext = createContext15({
|
|
3135
|
+
overrideIdToNodePathMappings: {}
|
|
3136
|
+
});
|
|
3137
|
+
var OverrideIdsToNodePathsSettersContext = createContext15({
|
|
3138
|
+
setOverrideIdToNodePath: () => {
|
|
3139
|
+
throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
|
|
3140
|
+
}
|
|
3141
|
+
});
|
|
3142
|
+
var findPropsToDelete = ({
|
|
3143
|
+
schema,
|
|
3144
|
+
key,
|
|
3145
|
+
value
|
|
3146
|
+
}) => {
|
|
3147
|
+
const fieldSchema = schema[key];
|
|
3148
|
+
if (!fieldSchema) {
|
|
3149
|
+
throw new Error("Key " + JSON.stringify(key) + " not found in schema");
|
|
3150
|
+
}
|
|
3151
|
+
if (typeof value !== "string") {
|
|
3152
|
+
throw new Error("Value must be a string, but is " + JSON.stringify(value));
|
|
3153
|
+
}
|
|
3154
|
+
if (fieldSchema.type !== "enum") {
|
|
3155
|
+
throw new Error("Key " + JSON.stringify(key) + " is not an enum");
|
|
3156
|
+
}
|
|
3157
|
+
const currentVariant = fieldSchema.variants[value];
|
|
3158
|
+
if (!currentVariant) {
|
|
3159
|
+
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));
|
|
3160
|
+
}
|
|
3161
|
+
const otherVariants = Object.keys(fieldSchema.variants).filter((v) => v !== value);
|
|
3162
|
+
const otherKeys = new Set;
|
|
3163
|
+
for (const variant of otherVariants) {
|
|
3164
|
+
const otherVariant = fieldSchema.variants[variant];
|
|
3165
|
+
const keys = Object.keys(otherVariant);
|
|
3166
|
+
for (const k of keys) {
|
|
3167
|
+
otherKeys.add(k);
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
return [...otherKeys];
|
|
3171
|
+
};
|
|
3055
3172
|
var getEffectiveVisualModeValue = ({
|
|
3056
3173
|
codeValue,
|
|
3057
3174
|
runtimeValue,
|
|
@@ -3097,17 +3214,38 @@ var computeEffectiveSchemaValuesDotNotation = ({
|
|
|
3097
3214
|
propStatus
|
|
3098
3215
|
}) => {
|
|
3099
3216
|
const merged = {};
|
|
3217
|
+
const propsToDelete = new Set;
|
|
3100
3218
|
for (const key of Object.keys(currentValue)) {
|
|
3101
3219
|
const codeValueStatus = propStatus?.[key] ?? null;
|
|
3102
|
-
|
|
3220
|
+
const field = findFieldInSchema(schema, key);
|
|
3221
|
+
if (field?.type === "hidden") {
|
|
3222
|
+
continue;
|
|
3223
|
+
}
|
|
3224
|
+
const value = getEffectiveVisualModeValue({
|
|
3103
3225
|
codeValue: codeValueStatus,
|
|
3104
3226
|
runtimeValue: currentValue[key],
|
|
3105
3227
|
dragOverrideValue: overrideValues[key],
|
|
3106
|
-
defaultValue:
|
|
3228
|
+
defaultValue: field?.default,
|
|
3107
3229
|
shouldResortToDefaultValueIfUndefined: false
|
|
3108
3230
|
});
|
|
3231
|
+
if (value === undefined) {
|
|
3232
|
+
propsToDelete.add(key);
|
|
3233
|
+
}
|
|
3234
|
+
merged[key] = value;
|
|
3109
3235
|
}
|
|
3110
|
-
|
|
3236
|
+
for (const key of Object.keys(overrideValues)) {
|
|
3237
|
+
if (schema[key]?.type === "enum") {
|
|
3238
|
+
const propsToDeleteForKey = findPropsToDelete({
|
|
3239
|
+
schema,
|
|
3240
|
+
key,
|
|
3241
|
+
value: merged[key]
|
|
3242
|
+
});
|
|
3243
|
+
for (const propToDelete of propsToDeleteForKey) {
|
|
3244
|
+
propsToDelete.add(propToDelete);
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
return { merged, propsToDelete };
|
|
3111
3249
|
};
|
|
3112
3250
|
var getNestedValue = (obj, key) => {
|
|
3113
3251
|
const parts = key.split(".");
|
|
@@ -3132,7 +3270,8 @@ var selectActiveKeys = (schema, values) => {
|
|
|
3132
3270
|
var mergeValues = ({
|
|
3133
3271
|
props,
|
|
3134
3272
|
valuesDotNotation,
|
|
3135
|
-
schemaKeys
|
|
3273
|
+
schemaKeys,
|
|
3274
|
+
propsToDelete
|
|
3136
3275
|
}) => {
|
|
3137
3276
|
const merged = { ...props };
|
|
3138
3277
|
for (const key of schemaKeys) {
|
|
@@ -3154,31 +3293,45 @@ var mergeValues = ({
|
|
|
3154
3293
|
}
|
|
3155
3294
|
current[parts[parts.length - 1]] = value;
|
|
3156
3295
|
}
|
|
3296
|
+
deleteNestedKey(merged, propsToDelete);
|
|
3157
3297
|
return merged;
|
|
3158
3298
|
};
|
|
3299
|
+
var stackToOverrideMap = {};
|
|
3159
3300
|
var wrapInSchema = (Component, schema) => {
|
|
3160
|
-
if (typeof process === "undefined" || !process.env?.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
3161
|
-
return Component;
|
|
3162
|
-
}
|
|
3163
3301
|
const flatSchema = getFlatSchemaWithAllKeys(schema);
|
|
3164
3302
|
const flatKeys = Object.keys(flatSchema);
|
|
3165
3303
|
const Wrapped = forwardRef2((props, ref) => {
|
|
3166
3304
|
const env = useRemotionEnvironment();
|
|
3167
|
-
|
|
3168
|
-
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !visualModeEnabled) {
|
|
3305
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
|
|
3169
3306
|
return React13.createElement(Component, {
|
|
3170
3307
|
...props,
|
|
3171
3308
|
_experimentalControls: null,
|
|
3172
3309
|
ref
|
|
3173
3310
|
});
|
|
3174
3311
|
}
|
|
3312
|
+
const { getCodeValues } = useContext15(VisualModeCodeValuesContext);
|
|
3313
|
+
const { getDragOverrides } = useContext15(VisualModeDragOverridesContext);
|
|
3314
|
+
const nodePathMapping = useContext15(OverrideIdsToNodePathsGettersContext);
|
|
3175
3315
|
if (props._experimentalControls) {
|
|
3176
3316
|
return React13.createElement(Component, {
|
|
3177
3317
|
...props,
|
|
3178
3318
|
ref
|
|
3179
3319
|
});
|
|
3180
3320
|
}
|
|
3181
|
-
const [overrideId] = useState5(() =>
|
|
3321
|
+
const [overrideId] = useState5(() => {
|
|
3322
|
+
const { stack } = props;
|
|
3323
|
+
if (!stack) {
|
|
3324
|
+
return String(Math.random());
|
|
3325
|
+
}
|
|
3326
|
+
const existingOverrideId = stackToOverrideMap[stack];
|
|
3327
|
+
if (existingOverrideId) {
|
|
3328
|
+
return existingOverrideId;
|
|
3329
|
+
}
|
|
3330
|
+
const newOverrideId = String(Math.random());
|
|
3331
|
+
stackToOverrideMap[stack] = newOverrideId;
|
|
3332
|
+
return newOverrideId;
|
|
3333
|
+
});
|
|
3334
|
+
const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
|
|
3182
3335
|
const runtimeValues = flatKeys.map((k) => getNestedValue(props, k));
|
|
3183
3336
|
const currentRuntimeValueDotNotation = useMemo15(() => readValuesFromProps(props, flatKeys), runtimeValues);
|
|
3184
3337
|
const controls = useMemo15(() => {
|
|
@@ -3188,19 +3341,25 @@ var wrapInSchema = (Component, schema) => {
|
|
|
3188
3341
|
overrideId
|
|
3189
3342
|
};
|
|
3190
3343
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
3191
|
-
const valuesDotNotation = useMemo15(() => {
|
|
3344
|
+
const { merged: valuesDotNotation, propsToDelete } = useMemo15(() => {
|
|
3192
3345
|
return computeEffectiveSchemaValuesDotNotation({
|
|
3193
3346
|
schema,
|
|
3194
3347
|
currentValue: currentRuntimeValueDotNotation,
|
|
3195
|
-
overrideValues:
|
|
3196
|
-
propStatus:
|
|
3348
|
+
overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
|
|
3349
|
+
propStatus: nodePath === null ? undefined : getCodeValues(nodePath)
|
|
3197
3350
|
});
|
|
3198
|
-
}, [
|
|
3351
|
+
}, [
|
|
3352
|
+
currentRuntimeValueDotNotation,
|
|
3353
|
+
getDragOverrides,
|
|
3354
|
+
nodePath,
|
|
3355
|
+
getCodeValues
|
|
3356
|
+
]);
|
|
3199
3357
|
const activeKeys = selectActiveKeys(schema, valuesDotNotation);
|
|
3200
3358
|
const mergedProps = mergeValues({
|
|
3201
3359
|
props,
|
|
3202
3360
|
valuesDotNotation,
|
|
3203
|
-
schemaKeys: activeKeys
|
|
3361
|
+
schemaKeys: activeKeys,
|
|
3362
|
+
propsToDelete
|
|
3204
3363
|
});
|
|
3205
3364
|
return React13.createElement(Component, {
|
|
3206
3365
|
...mergedProps,
|
|
@@ -3296,7 +3455,6 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3296
3455
|
}, [name]);
|
|
3297
3456
|
const env = useRemotionEnvironment();
|
|
3298
3457
|
const inheritedStack = other?.stack ?? null;
|
|
3299
|
-
const memoizedEffects = useMemoizedEffects(flattenEffects(_experimentalEffects ?? []));
|
|
3300
3458
|
useEffect5(() => {
|
|
3301
3459
|
if (!env.isStudio) {
|
|
3302
3460
|
return;
|
|
@@ -3305,7 +3463,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3305
3463
|
registerSequence({
|
|
3306
3464
|
type: isMedia.type,
|
|
3307
3465
|
controls: controls ?? null,
|
|
3308
|
-
effects:
|
|
3466
|
+
effects: _experimentalEffects ?? [],
|
|
3309
3467
|
displayName: timelineClipName,
|
|
3310
3468
|
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
3311
3469
|
duration: actualDurationInFrames,
|
|
@@ -3343,7 +3501,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3343
3501
|
premountDisplay: premountDisplay ?? null,
|
|
3344
3502
|
postmountDisplay: postmountDisplay ?? null,
|
|
3345
3503
|
controls: controls ?? null,
|
|
3346
|
-
effects:
|
|
3504
|
+
effects: _experimentalEffects ?? []
|
|
3347
3505
|
});
|
|
3348
3506
|
return () => {
|
|
3349
3507
|
unregisterSequence(id);
|
|
@@ -3368,7 +3526,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3368
3526
|
env.isStudio,
|
|
3369
3527
|
inheritedStack,
|
|
3370
3528
|
controls,
|
|
3371
|
-
|
|
3529
|
+
_experimentalEffects,
|
|
3372
3530
|
isMedia
|
|
3373
3531
|
]);
|
|
3374
3532
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
@@ -3859,7 +4017,7 @@ var defaultOnPaint = ({
|
|
|
3859
4017
|
const transform = ctx.drawElementImage(elementImage, 0, 0);
|
|
3860
4018
|
element.style.transform = transform.toString();
|
|
3861
4019
|
};
|
|
3862
|
-
var HtmlInCanvasAncestorContext =
|
|
4020
|
+
var HtmlInCanvasAncestorContext = createContext16(false);
|
|
3863
4021
|
var HtmlInCanvasInner = forwardRef5(({
|
|
3864
4022
|
width,
|
|
3865
4023
|
height,
|
|
@@ -3893,8 +4051,9 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
3893
4051
|
}, [ref]);
|
|
3894
4052
|
const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
|
|
3895
4053
|
const chainState = useEffectChainState();
|
|
3896
|
-
const
|
|
3897
|
-
effectsRef
|
|
4054
|
+
const memoizedEffects = useMemoizedEffects(flattenEffects(effects));
|
|
4055
|
+
const effectsRef = useRef9(memoizedEffects);
|
|
4056
|
+
effectsRef.current = memoizedEffects;
|
|
3898
4057
|
const frameRef = useRef9(frame);
|
|
3899
4058
|
frameRef.current = frame;
|
|
3900
4059
|
const onPaintRef = useRef9(onPaint);
|
|
@@ -3994,7 +4153,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
3994
4153
|
return;
|
|
3995
4154
|
}
|
|
3996
4155
|
canvas.requestPaint?.();
|
|
3997
|
-
}, [onPaint]);
|
|
4156
|
+
}, [onPaint, memoizedEffects]);
|
|
3998
4157
|
useLayoutEffect3(() => {
|
|
3999
4158
|
const canvas = canvas2dRef.current;
|
|
4000
4159
|
if (!canvas) {
|
|
@@ -4021,7 +4180,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
4021
4180
|
durationInFrames: resolvedDuration,
|
|
4022
4181
|
name: "<HtmlInCanvas>",
|
|
4023
4182
|
_experimentalControls: controls,
|
|
4024
|
-
_experimentalEffects:
|
|
4183
|
+
_experimentalEffects: memoizedEffects,
|
|
4025
4184
|
layout: "none",
|
|
4026
4185
|
...sequenceProps,
|
|
4027
4186
|
children: /* @__PURE__ */ jsx15(HtmlInCanvasAncestorContext.Provider, {
|
|
@@ -4076,7 +4235,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
4076
4235
|
}
|
|
4077
4236
|
validateContent(artifact.content);
|
|
4078
4237
|
};
|
|
4079
|
-
var RenderAssetManager =
|
|
4238
|
+
var RenderAssetManager = createContext17({
|
|
4080
4239
|
registerRenderAsset: () => {
|
|
4081
4240
|
return;
|
|
4082
4241
|
},
|
|
@@ -4214,7 +4373,7 @@ var calculateMediaDuration = ({
|
|
|
4214
4373
|
const actualDuration = duration / playbackRate;
|
|
4215
4374
|
return Math.floor(actualDuration);
|
|
4216
4375
|
};
|
|
4217
|
-
var LoopContext =
|
|
4376
|
+
var LoopContext = createContext18(null);
|
|
4218
4377
|
var useLoop = () => {
|
|
4219
4378
|
return React17.useContext(LoopContext);
|
|
4220
4379
|
};
|
|
@@ -4285,7 +4444,7 @@ var playbackLogging = ({
|
|
|
4285
4444
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
4286
4445
|
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
4287
4446
|
};
|
|
4288
|
-
var PreloadContext =
|
|
4447
|
+
var PreloadContext = createContext19({});
|
|
4289
4448
|
var preloads = {};
|
|
4290
4449
|
var updaters = [];
|
|
4291
4450
|
var setPreloads = (updater) => {
|
|
@@ -4606,7 +4765,7 @@ var durationReducer = (state, action) => {
|
|
|
4606
4765
|
return state;
|
|
4607
4766
|
}
|
|
4608
4767
|
};
|
|
4609
|
-
var DurationsContext =
|
|
4768
|
+
var DurationsContext = createContext20({
|
|
4610
4769
|
durations: {},
|
|
4611
4770
|
setDurations: () => {
|
|
4612
4771
|
throw new Error("context missing");
|
|
@@ -4820,8 +4979,8 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
4820
4979
|
}
|
|
4821
4980
|
return true;
|
|
4822
4981
|
};
|
|
4823
|
-
var SharedAudioContext =
|
|
4824
|
-
var SharedAudioTagsContext =
|
|
4982
|
+
var SharedAudioContext = createContext21(null);
|
|
4983
|
+
var SharedAudioTagsContext = createContext21(null);
|
|
4825
4984
|
var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled }) => {
|
|
4826
4985
|
const logLevel = useLogLevel();
|
|
4827
4986
|
const ctxAndGain = useSingletonAudioContext({
|
|
@@ -4866,8 +5025,9 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
4866
5025
|
if (!ctxAndGain) {
|
|
4867
5026
|
throw new Error("Audio context not found");
|
|
4868
5027
|
}
|
|
5028
|
+
const saveForLater = ctxAndGain.audioContext.state === "suspended" && !isResuming.current;
|
|
4869
5029
|
if (duration > 0) {
|
|
4870
|
-
if (
|
|
5030
|
+
if (saveForLater) {
|
|
4871
5031
|
nodesToResume.current.set(node, {
|
|
4872
5032
|
scheduledTime,
|
|
4873
5033
|
offset,
|
|
@@ -4885,7 +5045,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
4885
5045
|
const prev = prevEndTimes.current;
|
|
4886
5046
|
const scheduledMismatch = prev.scheduledEndTime !== null && Math.abs(scheduledTime - prev.scheduledEndTime) > 0.001;
|
|
4887
5047
|
const mediaMismatch = prev.mediaEndTime !== null && Math.abs(mediaTime - prev.mediaEndTime) > 0.001;
|
|
4888
|
-
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) : "");
|
|
5048
|
+
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"), "");
|
|
4889
5049
|
prev.scheduledEndTime = scheduledEndTime;
|
|
4890
5050
|
prev.mediaEndTime = mediaEndTime;
|
|
4891
5051
|
return duration > 0 ? {
|
|
@@ -4905,6 +5065,13 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
4905
5065
|
return Promise.resolve();
|
|
4906
5066
|
}
|
|
4907
5067
|
audioContextIsPlayingEventually.current = true;
|
|
5068
|
+
ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
|
|
5069
|
+
ctxAndGain.gainNode.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
|
|
5070
|
+
ctxAndGain.gainNode.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
|
|
5071
|
+
nodesToResume.current.forEach((r, node) => {
|
|
5072
|
+
node.start(r.scheduledTime, r.offset, r.duration);
|
|
5073
|
+
});
|
|
5074
|
+
nodesToResume.current.clear();
|
|
4908
5075
|
const resumePromise = ctxAndGain.audioContext.resume();
|
|
4909
5076
|
isResuming.current = new Promise((resolve) => {
|
|
4910
5077
|
waitUntilActuallyResumed(ctxAndGain.audioContext, logLevel).then(resolve);
|
|
@@ -4915,11 +5082,6 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
4915
5082
|
}).finally(() => {
|
|
4916
5083
|
isResuming.current = null;
|
|
4917
5084
|
});
|
|
4918
|
-
ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
|
|
4919
|
-
ctxAndGain.gainNode.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
|
|
4920
|
-
ctxAndGain.gainNode.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
|
|
4921
|
-
nodesToResume.current.forEach((r, node) => node.start(r.scheduledTime, r.offset, r.duration));
|
|
4922
|
-
nodesToResume.current.clear();
|
|
4923
5085
|
return resumePromise.catch(() => {});
|
|
4924
5086
|
}, [ctxAndGain, logLevel]);
|
|
4925
5087
|
const getIsResumingAudioContext = useCallback9(() => {
|
|
@@ -5721,9 +5883,14 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
5721
5883
|
}
|
|
5722
5884
|
};
|
|
5723
5885
|
}
|
|
5886
|
+
let unblocked = false;
|
|
5724
5887
|
setBlocks((b) => [...b, block]);
|
|
5725
5888
|
return {
|
|
5726
5889
|
unblock: () => {
|
|
5890
|
+
if (unblocked) {
|
|
5891
|
+
return;
|
|
5892
|
+
}
|
|
5893
|
+
unblocked = true;
|
|
5727
5894
|
setBlocks((b) => {
|
|
5728
5895
|
const newArr = b.filter((bx) => bx !== block);
|
|
5729
5896
|
if (newArr.length === b.length) {
|
|
@@ -5817,18 +5984,30 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
5817
5984
|
};
|
|
5818
5985
|
var useBufferState = () => {
|
|
5819
5986
|
const buffer = useContext25(BufferingContextReact);
|
|
5987
|
+
const logLevel = useLogLevel();
|
|
5820
5988
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
5821
5989
|
return useMemo25(() => ({
|
|
5822
5990
|
delayPlayback: () => {
|
|
5823
5991
|
if (!addBlock) {
|
|
5824
5992
|
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");
|
|
5825
5993
|
}
|
|
5994
|
+
Log.trace({ logLevel, tag: "[buffer-state]" }, "Adding buffer handle", new Error().stack);
|
|
5826
5995
|
const { unblock } = addBlock({
|
|
5827
5996
|
id: String(Math.random())
|
|
5828
5997
|
});
|
|
5829
|
-
|
|
5998
|
+
let unblocked = false;
|
|
5999
|
+
return {
|
|
6000
|
+
unblock: () => {
|
|
6001
|
+
if (unblocked) {
|
|
6002
|
+
return;
|
|
6003
|
+
}
|
|
6004
|
+
unblocked = true;
|
|
6005
|
+
Log.trace({ logLevel, tag: "[buffer-state]" }, "Removing buffer handle");
|
|
6006
|
+
unblock();
|
|
6007
|
+
}
|
|
6008
|
+
};
|
|
5830
6009
|
}
|
|
5831
|
-
}), [addBlock]);
|
|
6010
|
+
}), [addBlock, logLevel]);
|
|
5832
6011
|
};
|
|
5833
6012
|
var isSafariWebkit = () => {
|
|
5834
6013
|
const isSafari2 = /^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);
|
|
@@ -6596,11 +6775,11 @@ var useMediaTag = ({
|
|
|
6596
6775
|
env.isPlayer
|
|
6597
6776
|
]);
|
|
6598
6777
|
};
|
|
6599
|
-
var MediaVolumeContext =
|
|
6778
|
+
var MediaVolumeContext = createContext22({
|
|
6600
6779
|
mediaMuted: false,
|
|
6601
6780
|
mediaVolume: 1
|
|
6602
6781
|
});
|
|
6603
|
-
var SetMediaVolumeContext =
|
|
6782
|
+
var SetMediaVolumeContext = createContext22({
|
|
6604
6783
|
setMediaMuted: () => {
|
|
6605
6784
|
throw new Error("default");
|
|
6606
6785
|
},
|
|
@@ -7406,10 +7585,13 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
7406
7585
|
};
|
|
7407
7586
|
var defineEffect = (definition) => definition;
|
|
7408
7587
|
var createDescriptor = (definition, params) => {
|
|
7588
|
+
const widened = definition;
|
|
7409
7589
|
return {
|
|
7410
|
-
definition,
|
|
7590
|
+
definition: widened,
|
|
7411
7591
|
params,
|
|
7412
|
-
stack: new Error().stack
|
|
7592
|
+
stack: new Error().stack,
|
|
7593
|
+
effectKey: widened.calculateKey(params),
|
|
7594
|
+
memoized: false
|
|
7413
7595
|
};
|
|
7414
7596
|
};
|
|
7415
7597
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
@@ -7434,7 +7616,7 @@ var waitForRoot = (fn) => {
|
|
|
7434
7616
|
listeners = listeners.filter((l) => l !== fn);
|
|
7435
7617
|
};
|
|
7436
7618
|
};
|
|
7437
|
-
var MediaEnabledContext =
|
|
7619
|
+
var MediaEnabledContext = createContext23(null);
|
|
7438
7620
|
var useVideoEnabled = () => {
|
|
7439
7621
|
const context = useContext32(MediaEnabledContext);
|
|
7440
7622
|
if (!context) {
|
|
@@ -7473,8 +7655,7 @@ var RemotionRootContexts = ({
|
|
|
7473
7655
|
audioLatencyHint,
|
|
7474
7656
|
videoEnabled,
|
|
7475
7657
|
audioEnabled,
|
|
7476
|
-
frameState
|
|
7477
|
-
visualModeEnabled
|
|
7658
|
+
frameState
|
|
7478
7659
|
}) => {
|
|
7479
7660
|
const nonceContext = useMemo32(() => {
|
|
7480
7661
|
let counter = 0;
|
|
@@ -7497,7 +7678,6 @@ var RemotionRootContexts = ({
|
|
|
7497
7678
|
children: /* @__PURE__ */ jsx29(EditorPropsProvider, {
|
|
7498
7679
|
children: /* @__PURE__ */ jsx29(PrefetchProvider, {
|
|
7499
7680
|
children: /* @__PURE__ */ jsx29(SequenceManagerProvider, {
|
|
7500
|
-
visualModeEnabled,
|
|
7501
7681
|
children: /* @__PURE__ */ jsx29(DurationsContextProvider, {
|
|
7502
7682
|
children: /* @__PURE__ */ jsx29(BufferingProvider, {
|
|
7503
7683
|
children: /* @__PURE__ */ jsx29(SharedAudioContextProvider, {
|
|
@@ -7716,7 +7896,7 @@ var setupEnvVariables = () => {
|
|
|
7716
7896
|
});
|
|
7717
7897
|
};
|
|
7718
7898
|
var CurrentScaleContext = React32.createContext(null);
|
|
7719
|
-
var PreviewSizeContext =
|
|
7899
|
+
var PreviewSizeContext = createContext24({
|
|
7720
7900
|
setSize: () => {
|
|
7721
7901
|
return;
|
|
7722
7902
|
},
|
|
@@ -7739,14 +7919,6 @@ var calculateScale = ({
|
|
|
7739
7919
|
}
|
|
7740
7920
|
return Number(previewSize);
|
|
7741
7921
|
};
|
|
7742
|
-
var useSequenceControlOverride = (key) => {
|
|
7743
|
-
const seqContext = useContext33(SequenceContext);
|
|
7744
|
-
const { dragOverrides: overrides } = useContext33(VisualModeOverridesContext);
|
|
7745
|
-
if (!seqContext) {
|
|
7746
|
-
return;
|
|
7747
|
-
}
|
|
7748
|
-
return overrides[seqContext.id]?.[key];
|
|
7749
|
-
};
|
|
7750
7922
|
var getOffthreadVideoSource = ({
|
|
7751
7923
|
src,
|
|
7752
7924
|
transparent,
|
|
@@ -7778,9 +7950,9 @@ var OffthreadVideoForRendering = ({
|
|
|
7778
7950
|
const frame = useCurrentFrame();
|
|
7779
7951
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
7780
7952
|
const videoConfig = useUnsafeVideoConfig();
|
|
7781
|
-
const sequenceContext =
|
|
7953
|
+
const sequenceContext = useContext33(SequenceContext);
|
|
7782
7954
|
const mediaStartsAt = useMediaStartsAt();
|
|
7783
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
7955
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
|
|
7784
7956
|
if (!src) {
|
|
7785
7957
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
7786
7958
|
}
|
|
@@ -7992,7 +8164,7 @@ class MediaPlaybackError extends Error {
|
|
|
7992
8164
|
}
|
|
7993
8165
|
}
|
|
7994
8166
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
7995
|
-
const context =
|
|
8167
|
+
const context = useContext34(SharedAudioContext);
|
|
7996
8168
|
if (!context) {
|
|
7997
8169
|
throw new Error("SharedAudioContext not found");
|
|
7998
8170
|
}
|
|
@@ -8048,8 +8220,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8048
8220
|
}
|
|
8049
8221
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
8050
8222
|
const { fps, durationInFrames } = useVideoConfig();
|
|
8051
|
-
const parentSequence =
|
|
8052
|
-
const { hidden } =
|
|
8223
|
+
const parentSequence = useContext34(SequenceContext);
|
|
8224
|
+
const { hidden } = useContext34(SequenceVisibilityToggleContext);
|
|
8053
8225
|
const logLevel = useLogLevel();
|
|
8054
8226
|
const mountTime = useMountTime();
|
|
8055
8227
|
const [timelineId] = useState21(() => String(Math.random()));
|
|
@@ -8473,7 +8645,9 @@ var Internals = {
|
|
|
8473
8645
|
VideoForPreview,
|
|
8474
8646
|
CompositionManager,
|
|
8475
8647
|
CompositionSetters,
|
|
8476
|
-
|
|
8648
|
+
VisualModeCodeValuesContext,
|
|
8649
|
+
VisualModeDragOverridesContext,
|
|
8650
|
+
VisualModeSettersContext,
|
|
8477
8651
|
SequenceManager,
|
|
8478
8652
|
SequenceStackTracesUpdateContext,
|
|
8479
8653
|
SequenceVisibilityToggleContext,
|
|
@@ -8482,7 +8656,6 @@ var Internals = {
|
|
|
8482
8656
|
sequenceStyleSchema,
|
|
8483
8657
|
flattenActiveSchema,
|
|
8484
8658
|
getFlatSchemaWithAllKeys,
|
|
8485
|
-
useSequenceControlOverride,
|
|
8486
8659
|
RemotionRootContexts,
|
|
8487
8660
|
CompositionManagerProvider,
|
|
8488
8661
|
useVideo,
|
|
@@ -8575,7 +8748,11 @@ var Internals = {
|
|
|
8575
8748
|
useMemoizedEffects,
|
|
8576
8749
|
defineEffect,
|
|
8577
8750
|
createDescriptor,
|
|
8578
|
-
computeEffectiveSchemaValuesDotNotation
|
|
8751
|
+
computeEffectiveSchemaValuesDotNotation,
|
|
8752
|
+
OverrideIdsToNodePathsGettersContext,
|
|
8753
|
+
OverrideIdsToNodePathsSettersContext,
|
|
8754
|
+
findPropsToDelete,
|
|
8755
|
+
flattenEffects
|
|
8579
8756
|
};
|
|
8580
8757
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
8581
8758
|
var PERCENTAGE = NUMBER + "%";
|
|
@@ -8613,7 +8790,7 @@ var flattenChildren = (children) => {
|
|
|
8613
8790
|
return flatChildren;
|
|
8614
8791
|
}, []);
|
|
8615
8792
|
};
|
|
8616
|
-
var IsInsideSeriesContext =
|
|
8793
|
+
var IsInsideSeriesContext = createContext25(false);
|
|
8617
8794
|
var IsInsideSeriesContainer = ({ children }) => {
|
|
8618
8795
|
return /* @__PURE__ */ jsx34(IsInsideSeriesContext.Provider, {
|
|
8619
8796
|
value: true,
|
|
@@ -8655,9 +8832,6 @@ var SeriesInner = (props2) => {
|
|
|
8655
8832
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`);
|
|
8656
8833
|
}
|
|
8657
8834
|
const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
|
|
8658
|
-
if (!castedChild?.props.children) {
|
|
8659
|
-
throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
|
|
8660
|
-
}
|
|
8661
8835
|
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
8662
8836
|
const {
|
|
8663
8837
|
durationInFrames,
|
|
@@ -9173,13 +9347,13 @@ var VideoForRenderingForwardFunction = ({
|
|
|
9173
9347
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
9174
9348
|
const videoConfig = useUnsafeVideoConfig();
|
|
9175
9349
|
const videoRef = useRef23(null);
|
|
9176
|
-
const sequenceContext =
|
|
9350
|
+
const sequenceContext = useContext35(SequenceContext);
|
|
9177
9351
|
const mediaStartsAt = useMediaStartsAt();
|
|
9178
9352
|
const environment = useRemotionEnvironment();
|
|
9179
9353
|
const logLevel = useLogLevel();
|
|
9180
9354
|
const mountTime = useMountTime();
|
|
9181
9355
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
9182
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
9356
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext35(RenderAssetManager);
|
|
9183
9357
|
const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
9184
9358
|
props2.src,
|
|
9185
9359
|
sequenceContext?.cumulatedFrom,
|
|
@@ -9389,7 +9563,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
9389
9563
|
if (environment.isClientSideRendering) {
|
|
9390
9564
|
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");
|
|
9391
9565
|
}
|
|
9392
|
-
const { durations, setDurations } =
|
|
9566
|
+
const { durations, setDurations } = useContext36(DurationsContext);
|
|
9393
9567
|
if (typeof ref === "string") {
|
|
9394
9568
|
throw new Error("string refs are not supported");
|
|
9395
9569
|
}
|