@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/homepage/Pricing.js
CHANGED
|
@@ -5756,6 +5756,7 @@ import {
|
|
|
5756
5756
|
} from "react";
|
|
5757
5757
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
5758
5758
|
import { useEffect as useEffect3, useMemo as useMemo10, useRef as useRef4 } from "react";
|
|
5759
|
+
import { useRef as useRef5 } from "react";
|
|
5759
5760
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
5760
5761
|
import {
|
|
5761
5762
|
forwardRef as forwardRef3,
|
|
@@ -5764,7 +5765,6 @@ import {
|
|
|
5764
5765
|
useMemo as useMemo16,
|
|
5765
5766
|
useState as useState6
|
|
5766
5767
|
} from "react";
|
|
5767
|
-
import { useRef as useRef5 } from "react";
|
|
5768
5768
|
import { useContext as useContext14, useMemo as useMemo13 } from "react";
|
|
5769
5769
|
import { useContext as useContext13 } from "react";
|
|
5770
5770
|
import { useContext as useContext12, useMemo as useMemo12 } from "react";
|
|
@@ -5773,6 +5773,7 @@ import { createContext as createContext14 } from "react";
|
|
|
5773
5773
|
import React12, { useCallback as useCallback5, useMemo as useMemo14, useRef as useRef6, useState as useState4 } from "react";
|
|
5774
5774
|
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5775
5775
|
import React13, { forwardRef as forwardRef2, useState as useState5, useContext as useContext15, useMemo as useMemo15 } from "react";
|
|
5776
|
+
import { createContext as createContext15 } from "react";
|
|
5776
5777
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5777
5778
|
import {
|
|
5778
5779
|
forwardRef as forwardRef4,
|
|
@@ -5786,7 +5787,7 @@ import React15, { useCallback as useCallback6, useImperativeHandle, useRef as us
|
|
|
5786
5787
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
5787
5788
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
5788
5789
|
import {
|
|
5789
|
-
createContext as
|
|
5790
|
+
createContext as createContext16,
|
|
5790
5791
|
forwardRef as forwardRef5,
|
|
5791
5792
|
useCallback as useCallback7,
|
|
5792
5793
|
useContext as useContext17,
|
|
@@ -5798,7 +5799,7 @@ import {
|
|
|
5798
5799
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
5799
5800
|
import { useContext as useContext18, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
|
|
5800
5801
|
import {
|
|
5801
|
-
createContext as
|
|
5802
|
+
createContext as createContext17,
|
|
5802
5803
|
useCallback as useCallback8,
|
|
5803
5804
|
useImperativeHandle as useImperativeHandle3,
|
|
5804
5805
|
useLayoutEffect as useLayoutEffect4,
|
|
@@ -5808,12 +5809,12 @@ import {
|
|
|
5808
5809
|
} from "react";
|
|
5809
5810
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5810
5811
|
import { forwardRef as forwardRef8, useCallback as useCallback13, useContext as useContext30 } from "react";
|
|
5811
|
-
import React17, { createContext as
|
|
5812
|
+
import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
|
|
5812
5813
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5813
5814
|
import { useContext as useContext19 } from "react";
|
|
5814
|
-
import { createContext as
|
|
5815
|
+
import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
|
|
5815
5816
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
5816
|
-
import { createContext as
|
|
5817
|
+
import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
|
|
5817
5818
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
5818
5819
|
import React23, {
|
|
5819
5820
|
forwardRef as forwardRef6,
|
|
@@ -5826,7 +5827,7 @@ import React23, {
|
|
|
5826
5827
|
} from "react";
|
|
5827
5828
|
import { useContext as useContext21, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
|
|
5828
5829
|
import React20, {
|
|
5829
|
-
createContext as
|
|
5830
|
+
createContext as createContext21,
|
|
5830
5831
|
createRef as createRef2,
|
|
5831
5832
|
useCallback as useCallback9,
|
|
5832
5833
|
useContext as useContext20,
|
|
@@ -5862,7 +5863,7 @@ import React22 from "react";
|
|
|
5862
5863
|
import { useEffect as useEffect10, useState as useState15 } from "react";
|
|
5863
5864
|
import { useEffect as useEffect11, useRef as useRef16 } from "react";
|
|
5864
5865
|
import { useEffect as useEffect13 } from "react";
|
|
5865
|
-
import { createContext as
|
|
5866
|
+
import { createContext as createContext22, useContext as useContext27, useMemo as useMemo27 } from "react";
|
|
5866
5867
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
5867
5868
|
import {
|
|
5868
5869
|
forwardRef as forwardRef7,
|
|
@@ -5898,16 +5899,15 @@ import {
|
|
|
5898
5899
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
5899
5900
|
import React29 from "react";
|
|
5900
5901
|
import { useMemo as useMemo322 } from "react";
|
|
5901
|
-
import { createContext as
|
|
5902
|
+
import { createContext as createContext23, useContext as useContext32, useMemo as useMemo31 } from "react";
|
|
5902
5903
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5903
5904
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
5904
5905
|
import React31 from "react";
|
|
5905
|
-
import React32, { createContext as
|
|
5906
|
-
import { useContext as useContext33 } from "react";
|
|
5906
|
+
import React32, { createContext as createContext24 } from "react";
|
|
5907
5907
|
import { useCallback as useCallback18 } from "react";
|
|
5908
5908
|
import {
|
|
5909
5909
|
useCallback as useCallback17,
|
|
5910
|
-
useContext as
|
|
5910
|
+
useContext as useContext33,
|
|
5911
5911
|
useEffect as useEffect16,
|
|
5912
5912
|
useLayoutEffect as useLayoutEffect11,
|
|
5913
5913
|
useMemo as useMemo33,
|
|
@@ -5916,7 +5916,7 @@ import {
|
|
|
5916
5916
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
5917
5917
|
import React34, {
|
|
5918
5918
|
forwardRef as forwardRef10,
|
|
5919
|
-
useContext as
|
|
5919
|
+
useContext as useContext34,
|
|
5920
5920
|
useEffect as useEffect18,
|
|
5921
5921
|
useImperativeHandle as useImperativeHandle8,
|
|
5922
5922
|
useMemo as useMemo34,
|
|
@@ -5930,14 +5930,14 @@ import React36, { useMemo as useMemo35 } from "react";
|
|
|
5930
5930
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5931
5931
|
import { Children, forwardRef as forwardRef11, useMemo as useMemo36 } from "react";
|
|
5932
5932
|
import React37 from "react";
|
|
5933
|
-
import React38, { createContext as
|
|
5933
|
+
import React38, { createContext as createContext25 } from "react";
|
|
5934
5934
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
5935
5935
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
5936
5936
|
import React40 from "react";
|
|
5937
|
-
import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as
|
|
5937
|
+
import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as useContext36 } from "react";
|
|
5938
5938
|
import {
|
|
5939
5939
|
forwardRef as forwardRef12,
|
|
5940
|
-
useContext as
|
|
5940
|
+
useContext as useContext35,
|
|
5941
5941
|
useEffect as useEffect19,
|
|
5942
5942
|
useImperativeHandle as useImperativeHandle9,
|
|
5943
5943
|
useLayoutEffect as useLayoutEffect12,
|
|
@@ -7218,6 +7218,39 @@ var useCurrentFrame = () => {
|
|
|
7218
7218
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
7219
7219
|
return frame - contextOffset;
|
|
7220
7220
|
};
|
|
7221
|
+
var flattenEffects = (effects) => {
|
|
7222
|
+
const out = [];
|
|
7223
|
+
for (const item of effects) {
|
|
7224
|
+
if (Array.isArray(item)) {
|
|
7225
|
+
for (const inner of item) {
|
|
7226
|
+
out.push(inner);
|
|
7227
|
+
}
|
|
7228
|
+
} else {
|
|
7229
|
+
out.push(item);
|
|
7230
|
+
}
|
|
7231
|
+
}
|
|
7232
|
+
return out;
|
|
7233
|
+
};
|
|
7234
|
+
var groupByBackend = (effects) => {
|
|
7235
|
+
const runs = [];
|
|
7236
|
+
let current = [];
|
|
7237
|
+
let currentBackend = null;
|
|
7238
|
+
for (const eff of effects) {
|
|
7239
|
+
const { backend } = eff.definition;
|
|
7240
|
+
if (currentBackend === null || backend === currentBackend) {
|
|
7241
|
+
current.push(eff);
|
|
7242
|
+
currentBackend = backend;
|
|
7243
|
+
} else {
|
|
7244
|
+
runs.push({ backend: currentBackend, effects: current });
|
|
7245
|
+
current = [eff];
|
|
7246
|
+
currentBackend = backend;
|
|
7247
|
+
}
|
|
7248
|
+
}
|
|
7249
|
+
if (currentBackend !== null && current.length > 0) {
|
|
7250
|
+
runs.push({ backend: currentBackend, effects: current });
|
|
7251
|
+
}
|
|
7252
|
+
return runs;
|
|
7253
|
+
};
|
|
7221
7254
|
|
|
7222
7255
|
class CanvasPool {
|
|
7223
7256
|
width;
|
|
@@ -7291,39 +7324,6 @@ class CanvasPool {
|
|
|
7291
7324
|
}
|
|
7292
7325
|
}
|
|
7293
7326
|
}
|
|
7294
|
-
var flattenEffects = (effects) => {
|
|
7295
|
-
const out = [];
|
|
7296
|
-
for (const item of effects) {
|
|
7297
|
-
if (Array.isArray(item)) {
|
|
7298
|
-
for (const inner of item) {
|
|
7299
|
-
out.push(inner);
|
|
7300
|
-
}
|
|
7301
|
-
} else {
|
|
7302
|
-
out.push(item);
|
|
7303
|
-
}
|
|
7304
|
-
}
|
|
7305
|
-
return out;
|
|
7306
|
-
};
|
|
7307
|
-
var groupByBackend = (effects) => {
|
|
7308
|
-
const runs = [];
|
|
7309
|
-
let current = [];
|
|
7310
|
-
let currentBackend = null;
|
|
7311
|
-
for (const eff of effects) {
|
|
7312
|
-
const { backend } = eff.definition;
|
|
7313
|
-
if (currentBackend === null || backend === currentBackend) {
|
|
7314
|
-
current.push(eff);
|
|
7315
|
-
currentBackend = backend;
|
|
7316
|
-
} else {
|
|
7317
|
-
runs.push({ backend: currentBackend, effects: current });
|
|
7318
|
-
current = [eff];
|
|
7319
|
-
currentBackend = backend;
|
|
7320
|
-
}
|
|
7321
|
-
}
|
|
7322
|
-
if (currentBackend !== null && current.length > 0) {
|
|
7323
|
-
runs.push({ backend: currentBackend, effects: current });
|
|
7324
|
-
}
|
|
7325
|
-
return runs;
|
|
7326
|
-
};
|
|
7327
7327
|
var devicePromise = null;
|
|
7328
7328
|
var getGpuDevice = () => {
|
|
7329
7329
|
if (devicePromise) {
|
|
@@ -7375,8 +7375,7 @@ var runEffectChain = async ({
|
|
|
7375
7375
|
}) => {
|
|
7376
7376
|
const runId = ++state.currentRunId;
|
|
7377
7377
|
const isCancelled = () => state.currentRunId !== runId;
|
|
7378
|
-
const
|
|
7379
|
-
const runs = groupByBackend(flattened);
|
|
7378
|
+
const runs = groupByBackend(effects);
|
|
7380
7379
|
let currentImage = source;
|
|
7381
7380
|
let lastTarget = null;
|
|
7382
7381
|
if (runs.length === 0) {
|
|
@@ -7470,12 +7469,29 @@ var useEffectChainState = () => {
|
|
|
7470
7469
|
}
|
|
7471
7470
|
}), []);
|
|
7472
7471
|
};
|
|
7472
|
+
var useMemoizedEffects = (effects) => {
|
|
7473
|
+
const previousRef = useRef5(null);
|
|
7474
|
+
const previous = previousRef.current;
|
|
7475
|
+
const isSame = previous !== null && previous.length === effects.length && previous.every((p, i) => p.definition === effects[i].definition && p.effectKey === effects[i].effectKey);
|
|
7476
|
+
if (isSame) {
|
|
7477
|
+
return previous;
|
|
7478
|
+
}
|
|
7479
|
+
const next = effects.map((e) => ({
|
|
7480
|
+
definition: e.definition,
|
|
7481
|
+
stack: e.stack,
|
|
7482
|
+
effectKey: e.effectKey,
|
|
7483
|
+
params: e.params,
|
|
7484
|
+
memoized: true
|
|
7485
|
+
}));
|
|
7486
|
+
previousRef.current = next;
|
|
7487
|
+
return next;
|
|
7488
|
+
};
|
|
7473
7489
|
var componentsToAddStacksTo = [];
|
|
7474
7490
|
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
7475
7491
|
var addSequenceStackTraces = (component) => {
|
|
7476
7492
|
componentsToAddStacksTo.push(component);
|
|
7477
7493
|
};
|
|
7478
|
-
var VERSION = "4.0.
|
|
7494
|
+
var VERSION = "4.0.461";
|
|
7479
7495
|
var checkMultipleRemotionVersions = () => {
|
|
7480
7496
|
if (typeof globalThis === "undefined") {
|
|
7481
7497
|
return;
|
|
@@ -7503,20 +7519,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
7503
7519
|
}
|
|
7504
7520
|
set();
|
|
7505
7521
|
};
|
|
7506
|
-
var useMemoizedEffects = (effects) => {
|
|
7507
|
-
const previousRef = useRef5(null);
|
|
7508
|
-
const previous = previousRef.current;
|
|
7509
|
-
const isSame = previous !== null && previous.length === effects.length && previous.every((p, i) => p.definition === effects[i].definition && p.stack === effects[i].stack);
|
|
7510
|
-
if (isSame) {
|
|
7511
|
-
return previous;
|
|
7512
|
-
}
|
|
7513
|
-
const next = effects.map((e) => ({
|
|
7514
|
-
definition: e.definition,
|
|
7515
|
-
stack: e.stack
|
|
7516
|
-
}));
|
|
7517
|
-
previousRef.current = next;
|
|
7518
|
-
return next;
|
|
7519
|
-
};
|
|
7520
7522
|
var useUnsafeVideoConfig = () => {
|
|
7521
7523
|
const context = useContext12(SequenceContext);
|
|
7522
7524
|
const ctxWidth = context?.width ?? null;
|
|
@@ -7674,6 +7676,22 @@ var sequenceStyleSchema = {
|
|
|
7674
7676
|
step: 0.01,
|
|
7675
7677
|
default: 1,
|
|
7676
7678
|
description: "Opacity"
|
|
7679
|
+
},
|
|
7680
|
+
premountFor: {
|
|
7681
|
+
type: "number",
|
|
7682
|
+
default: 0,
|
|
7683
|
+
description: "Premount For",
|
|
7684
|
+
min: 0,
|
|
7685
|
+
step: 1
|
|
7686
|
+
},
|
|
7687
|
+
postmountFor: {
|
|
7688
|
+
type: "hidden"
|
|
7689
|
+
},
|
|
7690
|
+
styleWhilePremounted: {
|
|
7691
|
+
type: "hidden"
|
|
7692
|
+
},
|
|
7693
|
+
styleWhilePostmounted: {
|
|
7694
|
+
type: "hidden"
|
|
7677
7695
|
}
|
|
7678
7696
|
};
|
|
7679
7697
|
var sequenceSchema = {
|
|
@@ -7694,6 +7712,9 @@ var sequenceSchemaDefaultLayoutNone = {
|
|
|
7694
7712
|
default: "none"
|
|
7695
7713
|
}
|
|
7696
7714
|
};
|
|
7715
|
+
var nodePathToString = (nodePath) => {
|
|
7716
|
+
return nodePath.join(".");
|
|
7717
|
+
};
|
|
7697
7718
|
var SequenceManager = React12.createContext({
|
|
7698
7719
|
registerSequence: () => {
|
|
7699
7720
|
throw new Error("SequenceManagerContext not initialized");
|
|
@@ -7709,60 +7730,73 @@ var SequenceVisibilityToggleContext = React12.createContext({
|
|
|
7709
7730
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
7710
7731
|
}
|
|
7711
7732
|
});
|
|
7712
|
-
var
|
|
7713
|
-
|
|
7733
|
+
var getCodeValuesCtx = (codeValues, nodePath) => {
|
|
7734
|
+
const status = codeValues[nodePathToString(nodePath)];
|
|
7735
|
+
if (!status) {
|
|
7736
|
+
return;
|
|
7737
|
+
}
|
|
7738
|
+
if (!status.canUpdate) {
|
|
7739
|
+
return;
|
|
7740
|
+
}
|
|
7741
|
+
return status.props;
|
|
7742
|
+
};
|
|
7743
|
+
var VisualModeCodeValuesContext = React12.createContext({
|
|
7744
|
+
getCodeValues: () => {
|
|
7745
|
+
throw new Error("VisualModeCodeValuesContext not initialized");
|
|
7746
|
+
}
|
|
7747
|
+
});
|
|
7748
|
+
var VisualModeDragOverridesContext = React12.createContext({
|
|
7749
|
+
getDragOverrides: () => {
|
|
7750
|
+
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
7751
|
+
}
|
|
7752
|
+
});
|
|
7753
|
+
var VisualModeSettersContext = React12.createContext({
|
|
7714
7754
|
setDragOverrides: () => {
|
|
7715
|
-
throw new Error("
|
|
7755
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7716
7756
|
},
|
|
7717
7757
|
clearDragOverrides: () => {
|
|
7718
|
-
throw new Error("
|
|
7758
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7719
7759
|
},
|
|
7720
|
-
codeValues: {},
|
|
7721
7760
|
setCodeValues: () => {
|
|
7722
|
-
throw new Error("
|
|
7723
|
-
}
|
|
7724
|
-
visualModeEnabled: false
|
|
7761
|
+
throw new Error("VisualModeSettersContext not initialized");
|
|
7762
|
+
}
|
|
7725
7763
|
});
|
|
7726
|
-
var SequenceManagerProvider = ({ children
|
|
7764
|
+
var SequenceManagerProvider = ({ children }) => {
|
|
7727
7765
|
const [sequences, setSequences] = useState4([]);
|
|
7728
7766
|
const [hidden, setHidden] = useState4({});
|
|
7729
7767
|
const [dragOverrides, setControlOverrides] = useState4({});
|
|
7730
7768
|
const controlOverridesRef = useRef6(dragOverrides);
|
|
7731
7769
|
controlOverridesRef.current = dragOverrides;
|
|
7732
7770
|
const [codeValues, setCodeValuesMapState] = useState4({});
|
|
7733
|
-
const setDragOverrides = useCallback5((
|
|
7771
|
+
const setDragOverrides = useCallback5((nodePath, key, value) => {
|
|
7734
7772
|
setControlOverrides((prev) => ({
|
|
7735
7773
|
...prev,
|
|
7736
|
-
[
|
|
7737
|
-
...prev[
|
|
7774
|
+
[nodePathToString(nodePath)]: {
|
|
7775
|
+
...prev[nodePathToString(nodePath)],
|
|
7738
7776
|
[key]: value
|
|
7739
7777
|
}
|
|
7740
7778
|
}));
|
|
7741
7779
|
}, []);
|
|
7742
|
-
const clearDragOverrides = useCallback5((
|
|
7780
|
+
const clearDragOverrides = useCallback5((nodePath) => {
|
|
7743
7781
|
setControlOverrides((prev) => {
|
|
7744
|
-
|
|
7782
|
+
const key = nodePathToString(nodePath);
|
|
7783
|
+
if (!prev[key]) {
|
|
7745
7784
|
return prev;
|
|
7746
7785
|
}
|
|
7747
7786
|
const next = { ...prev };
|
|
7748
|
-
delete next[
|
|
7787
|
+
delete next[key];
|
|
7749
7788
|
return next;
|
|
7750
7789
|
});
|
|
7751
7790
|
}, []);
|
|
7752
|
-
const setCodeValues = useCallback5((
|
|
7791
|
+
const setCodeValues = useCallback5((nodePath, values) => {
|
|
7753
7792
|
setCodeValuesMapState((prev) => {
|
|
7754
|
-
|
|
7793
|
+
const key = nodePathToString(nodePath);
|
|
7794
|
+
const prevKey = prev[key];
|
|
7795
|
+
const newKey = values(prevKey);
|
|
7796
|
+
if (prevKey === newKey) {
|
|
7755
7797
|
return prev;
|
|
7756
7798
|
}
|
|
7757
|
-
|
|
7758
|
-
if (!(sequenceId in prev)) {
|
|
7759
|
-
return prev;
|
|
7760
|
-
}
|
|
7761
|
-
const next = { ...prev };
|
|
7762
|
-
delete next[sequenceId];
|
|
7763
|
-
return next;
|
|
7764
|
-
}
|
|
7765
|
-
return { ...prev, [sequenceId]: values };
|
|
7799
|
+
return { ...prev, [key]: newKey };
|
|
7766
7800
|
});
|
|
7767
7801
|
}, []);
|
|
7768
7802
|
const registerSequence = useCallback5((seq) => {
|
|
@@ -7786,40 +7820,85 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
7786
7820
|
setHidden
|
|
7787
7821
|
};
|
|
7788
7822
|
}, [hidden]);
|
|
7789
|
-
const
|
|
7823
|
+
const getDragOverrides = useCallback5((nodePath) => {
|
|
7824
|
+
return dragOverrides[nodePathToString(nodePath)] ?? {};
|
|
7825
|
+
}, [dragOverrides]);
|
|
7826
|
+
const getCodeValues = useCallback5((nodePath) => {
|
|
7827
|
+
return getCodeValuesCtx(codeValues, nodePath);
|
|
7828
|
+
}, [codeValues]);
|
|
7829
|
+
const codeValuesContext = useMemo14(() => {
|
|
7830
|
+
return {
|
|
7831
|
+
getCodeValues
|
|
7832
|
+
};
|
|
7833
|
+
}, [getCodeValues]);
|
|
7834
|
+
const dragOverridesContext = useMemo14(() => {
|
|
7835
|
+
return {
|
|
7836
|
+
getDragOverrides
|
|
7837
|
+
};
|
|
7838
|
+
}, [getDragOverrides]);
|
|
7839
|
+
const settersContext = useMemo14(() => {
|
|
7790
7840
|
return {
|
|
7791
|
-
visualModeEnabled,
|
|
7792
|
-
dragOverrides,
|
|
7793
7841
|
setDragOverrides,
|
|
7794
7842
|
clearDragOverrides,
|
|
7795
|
-
codeValues,
|
|
7796
7843
|
setCodeValues
|
|
7797
7844
|
};
|
|
7798
|
-
}, [
|
|
7799
|
-
visualModeEnabled,
|
|
7800
|
-
dragOverrides,
|
|
7801
|
-
setDragOverrides,
|
|
7802
|
-
clearDragOverrides,
|
|
7803
|
-
codeValues,
|
|
7804
|
-
setCodeValues
|
|
7805
|
-
]);
|
|
7845
|
+
}, [setDragOverrides, clearDragOverrides, setCodeValues]);
|
|
7806
7846
|
return /* @__PURE__ */ jsx112(SequenceManager.Provider, {
|
|
7807
7847
|
value: sequenceContext,
|
|
7808
7848
|
children: /* @__PURE__ */ jsx112(SequenceVisibilityToggleContext.Provider, {
|
|
7809
7849
|
value: hiddenContext,
|
|
7810
|
-
children: /* @__PURE__ */ jsx112(
|
|
7811
|
-
value:
|
|
7812
|
-
children
|
|
7850
|
+
children: /* @__PURE__ */ jsx112(VisualModeCodeValuesContext.Provider, {
|
|
7851
|
+
value: codeValuesContext,
|
|
7852
|
+
children: /* @__PURE__ */ jsx112(VisualModeDragOverridesContext.Provider, {
|
|
7853
|
+
value: dragOverridesContext,
|
|
7854
|
+
children: /* @__PURE__ */ jsx112(VisualModeSettersContext.Provider, {
|
|
7855
|
+
value: settersContext,
|
|
7856
|
+
children
|
|
7857
|
+
})
|
|
7858
|
+
})
|
|
7813
7859
|
})
|
|
7814
7860
|
})
|
|
7815
7861
|
});
|
|
7816
7862
|
};
|
|
7817
7863
|
var ENABLE_V5_BREAKING_CHANGES = false;
|
|
7864
|
+
var deleteNestedKey = (obj, keysToRemove) => {
|
|
7865
|
+
for (const key of keysToRemove) {
|
|
7866
|
+
const parts = key.split(".");
|
|
7867
|
+
const parents = [obj];
|
|
7868
|
+
let current = obj;
|
|
7869
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
7870
|
+
const part = parts[i];
|
|
7871
|
+
const next = current[part];
|
|
7872
|
+
if (next === undefined || next === null) {
|
|
7873
|
+
current = null;
|
|
7874
|
+
break;
|
|
7875
|
+
}
|
|
7876
|
+
current = next;
|
|
7877
|
+
parents.push(current);
|
|
7878
|
+
}
|
|
7879
|
+
if (current === null) {
|
|
7880
|
+
continue;
|
|
7881
|
+
}
|
|
7882
|
+
delete current[parts[parts.length - 1]];
|
|
7883
|
+
for (let i = parents.length - 1;i > 0; i--) {
|
|
7884
|
+
const parent = parents[i];
|
|
7885
|
+
if (Object.keys(parent).length === 0) {
|
|
7886
|
+
const parentKey = parts[i - 1];
|
|
7887
|
+
delete parents[i - 1][parentKey];
|
|
7888
|
+
} else {
|
|
7889
|
+
break;
|
|
7890
|
+
}
|
|
7891
|
+
}
|
|
7892
|
+
}
|
|
7893
|
+
return obj;
|
|
7894
|
+
};
|
|
7818
7895
|
var flattenActiveSchema = (schema, resolve) => {
|
|
7819
7896
|
const out = {};
|
|
7820
7897
|
for (const key of Object.keys(schema)) {
|
|
7821
7898
|
const field = schema[key];
|
|
7822
|
-
if (field.type === "
|
|
7899
|
+
if (field.type === "hidden") {
|
|
7900
|
+
continue;
|
|
7901
|
+
} else if (field.type === "enum") {
|
|
7823
7902
|
out[key] = field;
|
|
7824
7903
|
const current = resolve(key) ?? field.default;
|
|
7825
7904
|
const variant = field.variants[current];
|
|
@@ -7854,6 +7933,44 @@ var getFlatSchemaWithAllKeys = (schema) => {
|
|
|
7854
7933
|
}
|
|
7855
7934
|
return out;
|
|
7856
7935
|
};
|
|
7936
|
+
var OverrideIdsToNodePathsGettersContext = createContext15({
|
|
7937
|
+
overrideIdToNodePathMappings: {}
|
|
7938
|
+
});
|
|
7939
|
+
var OverrideIdsToNodePathsSettersContext = createContext15({
|
|
7940
|
+
setOverrideIdToNodePath: () => {
|
|
7941
|
+
throw new Error("OverrideIdsToNodePathsSettersContext not initialized");
|
|
7942
|
+
}
|
|
7943
|
+
});
|
|
7944
|
+
var findPropsToDelete = ({
|
|
7945
|
+
schema,
|
|
7946
|
+
key,
|
|
7947
|
+
value
|
|
7948
|
+
}) => {
|
|
7949
|
+
const fieldSchema = schema[key];
|
|
7950
|
+
if (!fieldSchema) {
|
|
7951
|
+
throw new Error("Key " + JSON.stringify(key) + " not found in schema");
|
|
7952
|
+
}
|
|
7953
|
+
if (typeof value !== "string") {
|
|
7954
|
+
throw new Error("Value must be a string, but is " + JSON.stringify(value));
|
|
7955
|
+
}
|
|
7956
|
+
if (fieldSchema.type !== "enum") {
|
|
7957
|
+
throw new Error("Key " + JSON.stringify(key) + " is not an enum");
|
|
7958
|
+
}
|
|
7959
|
+
const currentVariant = fieldSchema.variants[value];
|
|
7960
|
+
if (!currentVariant) {
|
|
7961
|
+
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));
|
|
7962
|
+
}
|
|
7963
|
+
const otherVariants = Object.keys(fieldSchema.variants).filter((v) => v !== value);
|
|
7964
|
+
const otherKeys = new Set;
|
|
7965
|
+
for (const variant of otherVariants) {
|
|
7966
|
+
const otherVariant = fieldSchema.variants[variant];
|
|
7967
|
+
const keys = Object.keys(otherVariant);
|
|
7968
|
+
for (const k of keys) {
|
|
7969
|
+
otherKeys.add(k);
|
|
7970
|
+
}
|
|
7971
|
+
}
|
|
7972
|
+
return [...otherKeys];
|
|
7973
|
+
};
|
|
7857
7974
|
var getEffectiveVisualModeValue = ({
|
|
7858
7975
|
codeValue,
|
|
7859
7976
|
runtimeValue,
|
|
@@ -7899,17 +8016,38 @@ var computeEffectiveSchemaValuesDotNotation = ({
|
|
|
7899
8016
|
propStatus
|
|
7900
8017
|
}) => {
|
|
7901
8018
|
const merged = {};
|
|
8019
|
+
const propsToDelete = new Set;
|
|
7902
8020
|
for (const key of Object.keys(currentValue)) {
|
|
7903
8021
|
const codeValueStatus = propStatus?.[key] ?? null;
|
|
7904
|
-
|
|
8022
|
+
const field = findFieldInSchema(schema, key);
|
|
8023
|
+
if (field?.type === "hidden") {
|
|
8024
|
+
continue;
|
|
8025
|
+
}
|
|
8026
|
+
const value = getEffectiveVisualModeValue({
|
|
7905
8027
|
codeValue: codeValueStatus,
|
|
7906
8028
|
runtimeValue: currentValue[key],
|
|
7907
8029
|
dragOverrideValue: overrideValues[key],
|
|
7908
|
-
defaultValue:
|
|
8030
|
+
defaultValue: field?.default,
|
|
7909
8031
|
shouldResortToDefaultValueIfUndefined: false
|
|
7910
8032
|
});
|
|
8033
|
+
if (value === undefined) {
|
|
8034
|
+
propsToDelete.add(key);
|
|
8035
|
+
}
|
|
8036
|
+
merged[key] = value;
|
|
7911
8037
|
}
|
|
7912
|
-
|
|
8038
|
+
for (const key of Object.keys(overrideValues)) {
|
|
8039
|
+
if (schema[key]?.type === "enum") {
|
|
8040
|
+
const propsToDeleteForKey = findPropsToDelete({
|
|
8041
|
+
schema,
|
|
8042
|
+
key,
|
|
8043
|
+
value: merged[key]
|
|
8044
|
+
});
|
|
8045
|
+
for (const propToDelete of propsToDeleteForKey) {
|
|
8046
|
+
propsToDelete.add(propToDelete);
|
|
8047
|
+
}
|
|
8048
|
+
}
|
|
8049
|
+
}
|
|
8050
|
+
return { merged, propsToDelete };
|
|
7913
8051
|
};
|
|
7914
8052
|
var getNestedValue = (obj, key) => {
|
|
7915
8053
|
const parts = key.split(".");
|
|
@@ -7934,7 +8072,8 @@ var selectActiveKeys = (schema, values) => {
|
|
|
7934
8072
|
var mergeValues = ({
|
|
7935
8073
|
props,
|
|
7936
8074
|
valuesDotNotation,
|
|
7937
|
-
schemaKeys
|
|
8075
|
+
schemaKeys,
|
|
8076
|
+
propsToDelete
|
|
7938
8077
|
}) => {
|
|
7939
8078
|
const merged = { ...props };
|
|
7940
8079
|
for (const key of schemaKeys) {
|
|
@@ -7956,31 +8095,45 @@ var mergeValues = ({
|
|
|
7956
8095
|
}
|
|
7957
8096
|
current[parts[parts.length - 1]] = value;
|
|
7958
8097
|
}
|
|
8098
|
+
deleteNestedKey(merged, propsToDelete);
|
|
7959
8099
|
return merged;
|
|
7960
8100
|
};
|
|
8101
|
+
var stackToOverrideMap = {};
|
|
7961
8102
|
var wrapInSchema = (Component, schema) => {
|
|
7962
|
-
if (typeof process === "undefined" || !process.env?.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
7963
|
-
return Component;
|
|
7964
|
-
}
|
|
7965
8103
|
const flatSchema = getFlatSchemaWithAllKeys(schema);
|
|
7966
8104
|
const flatKeys = Object.keys(flatSchema);
|
|
7967
8105
|
const Wrapped = forwardRef2((props, ref) => {
|
|
7968
8106
|
const env = useRemotionEnvironment();
|
|
7969
|
-
|
|
7970
|
-
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !visualModeEnabled) {
|
|
8107
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
|
|
7971
8108
|
return React13.createElement(Component, {
|
|
7972
8109
|
...props,
|
|
7973
8110
|
_experimentalControls: null,
|
|
7974
8111
|
ref
|
|
7975
8112
|
});
|
|
7976
8113
|
}
|
|
8114
|
+
const { getCodeValues } = useContext15(VisualModeCodeValuesContext);
|
|
8115
|
+
const { getDragOverrides } = useContext15(VisualModeDragOverridesContext);
|
|
8116
|
+
const nodePathMapping = useContext15(OverrideIdsToNodePathsGettersContext);
|
|
7977
8117
|
if (props._experimentalControls) {
|
|
7978
8118
|
return React13.createElement(Component, {
|
|
7979
8119
|
...props,
|
|
7980
8120
|
ref
|
|
7981
8121
|
});
|
|
7982
8122
|
}
|
|
7983
|
-
const [overrideId] = useState5(() =>
|
|
8123
|
+
const [overrideId] = useState5(() => {
|
|
8124
|
+
const { stack } = props;
|
|
8125
|
+
if (!stack) {
|
|
8126
|
+
return String(Math.random());
|
|
8127
|
+
}
|
|
8128
|
+
const existingOverrideId = stackToOverrideMap[stack];
|
|
8129
|
+
if (existingOverrideId) {
|
|
8130
|
+
return existingOverrideId;
|
|
8131
|
+
}
|
|
8132
|
+
const newOverrideId = String(Math.random());
|
|
8133
|
+
stackToOverrideMap[stack] = newOverrideId;
|
|
8134
|
+
return newOverrideId;
|
|
8135
|
+
});
|
|
8136
|
+
const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
|
|
7984
8137
|
const runtimeValues = flatKeys.map((k) => getNestedValue(props, k));
|
|
7985
8138
|
const currentRuntimeValueDotNotation = useMemo15(() => readValuesFromProps(props, flatKeys), runtimeValues);
|
|
7986
8139
|
const controls = useMemo15(() => {
|
|
@@ -7990,19 +8143,25 @@ var wrapInSchema = (Component, schema) => {
|
|
|
7990
8143
|
overrideId
|
|
7991
8144
|
};
|
|
7992
8145
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
7993
|
-
const valuesDotNotation = useMemo15(() => {
|
|
8146
|
+
const { merged: valuesDotNotation, propsToDelete } = useMemo15(() => {
|
|
7994
8147
|
return computeEffectiveSchemaValuesDotNotation({
|
|
7995
8148
|
schema,
|
|
7996
8149
|
currentValue: currentRuntimeValueDotNotation,
|
|
7997
|
-
overrideValues:
|
|
7998
|
-
propStatus:
|
|
8150
|
+
overrideValues: nodePath === null ? {} : getDragOverrides(nodePath),
|
|
8151
|
+
propStatus: nodePath === null ? undefined : getCodeValues(nodePath)
|
|
7999
8152
|
});
|
|
8000
|
-
}, [
|
|
8153
|
+
}, [
|
|
8154
|
+
currentRuntimeValueDotNotation,
|
|
8155
|
+
getDragOverrides,
|
|
8156
|
+
nodePath,
|
|
8157
|
+
getCodeValues
|
|
8158
|
+
]);
|
|
8001
8159
|
const activeKeys = selectActiveKeys(schema, valuesDotNotation);
|
|
8002
8160
|
const mergedProps = mergeValues({
|
|
8003
8161
|
props,
|
|
8004
8162
|
valuesDotNotation,
|
|
8005
|
-
schemaKeys: activeKeys
|
|
8163
|
+
schemaKeys: activeKeys,
|
|
8164
|
+
propsToDelete
|
|
8006
8165
|
});
|
|
8007
8166
|
return React13.createElement(Component, {
|
|
8008
8167
|
...mergedProps,
|
|
@@ -8098,7 +8257,6 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8098
8257
|
}, [name]);
|
|
8099
8258
|
const env = useRemotionEnvironment();
|
|
8100
8259
|
const inheritedStack = other?.stack ?? null;
|
|
8101
|
-
const memoizedEffects = useMemoizedEffects(flattenEffects(_experimentalEffects ?? []));
|
|
8102
8260
|
useEffect5(() => {
|
|
8103
8261
|
if (!env.isStudio) {
|
|
8104
8262
|
return;
|
|
@@ -8107,7 +8265,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8107
8265
|
registerSequence({
|
|
8108
8266
|
type: isMedia.type,
|
|
8109
8267
|
controls: controls ?? null,
|
|
8110
|
-
effects:
|
|
8268
|
+
effects: _experimentalEffects ?? [],
|
|
8111
8269
|
displayName: timelineClipName,
|
|
8112
8270
|
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
8113
8271
|
duration: actualDurationInFrames,
|
|
@@ -8145,7 +8303,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8145
8303
|
premountDisplay: premountDisplay ?? null,
|
|
8146
8304
|
postmountDisplay: postmountDisplay ?? null,
|
|
8147
8305
|
controls: controls ?? null,
|
|
8148
|
-
effects:
|
|
8306
|
+
effects: _experimentalEffects ?? []
|
|
8149
8307
|
});
|
|
8150
8308
|
return () => {
|
|
8151
8309
|
unregisterSequence(id);
|
|
@@ -8170,7 +8328,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8170
8328
|
env.isStudio,
|
|
8171
8329
|
inheritedStack,
|
|
8172
8330
|
controls,
|
|
8173
|
-
|
|
8331
|
+
_experimentalEffects,
|
|
8174
8332
|
isMedia
|
|
8175
8333
|
]);
|
|
8176
8334
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
@@ -8661,7 +8819,7 @@ var defaultOnPaint = ({
|
|
|
8661
8819
|
const transform = ctx.drawElementImage(elementImage, 0, 0);
|
|
8662
8820
|
element.style.transform = transform.toString();
|
|
8663
8821
|
};
|
|
8664
|
-
var HtmlInCanvasAncestorContext =
|
|
8822
|
+
var HtmlInCanvasAncestorContext = createContext16(false);
|
|
8665
8823
|
var HtmlInCanvasInner = forwardRef5(({
|
|
8666
8824
|
width,
|
|
8667
8825
|
height,
|
|
@@ -8695,8 +8853,9 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8695
8853
|
}, [ref]);
|
|
8696
8854
|
const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
|
|
8697
8855
|
const chainState = useEffectChainState();
|
|
8698
|
-
const
|
|
8699
|
-
effectsRef
|
|
8856
|
+
const memoizedEffects = useMemoizedEffects(flattenEffects(effects));
|
|
8857
|
+
const effectsRef = useRef9(memoizedEffects);
|
|
8858
|
+
effectsRef.current = memoizedEffects;
|
|
8700
8859
|
const frameRef = useRef9(frame);
|
|
8701
8860
|
frameRef.current = frame;
|
|
8702
8861
|
const onPaintRef = useRef9(onPaint);
|
|
@@ -8796,7 +8955,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8796
8955
|
return;
|
|
8797
8956
|
}
|
|
8798
8957
|
canvas.requestPaint?.();
|
|
8799
|
-
}, [onPaint]);
|
|
8958
|
+
}, [onPaint, memoizedEffects]);
|
|
8800
8959
|
useLayoutEffect3(() => {
|
|
8801
8960
|
const canvas = canvas2dRef.current;
|
|
8802
8961
|
if (!canvas) {
|
|
@@ -8823,7 +8982,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
8823
8982
|
durationInFrames: resolvedDuration,
|
|
8824
8983
|
name: "<HtmlInCanvas>",
|
|
8825
8984
|
_experimentalControls: controls,
|
|
8826
|
-
_experimentalEffects:
|
|
8985
|
+
_experimentalEffects: memoizedEffects,
|
|
8827
8986
|
layout: "none",
|
|
8828
8987
|
...sequenceProps,
|
|
8829
8988
|
children: /* @__PURE__ */ jsx15(HtmlInCanvasAncestorContext.Provider, {
|
|
@@ -8878,7 +9037,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
8878
9037
|
}
|
|
8879
9038
|
validateContent(artifact.content);
|
|
8880
9039
|
};
|
|
8881
|
-
var RenderAssetManager =
|
|
9040
|
+
var RenderAssetManager = createContext17({
|
|
8882
9041
|
registerRenderAsset: () => {
|
|
8883
9042
|
return;
|
|
8884
9043
|
},
|
|
@@ -9016,7 +9175,7 @@ var calculateMediaDuration = ({
|
|
|
9016
9175
|
const actualDuration = duration / playbackRate;
|
|
9017
9176
|
return Math.floor(actualDuration);
|
|
9018
9177
|
};
|
|
9019
|
-
var LoopContext =
|
|
9178
|
+
var LoopContext = createContext18(null);
|
|
9020
9179
|
var useLoop = () => {
|
|
9021
9180
|
return React17.useContext(LoopContext);
|
|
9022
9181
|
};
|
|
@@ -9087,7 +9246,7 @@ var playbackLogging = ({
|
|
|
9087
9246
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
9088
9247
|
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
9089
9248
|
};
|
|
9090
|
-
var PreloadContext =
|
|
9249
|
+
var PreloadContext = createContext19({});
|
|
9091
9250
|
var preloads = {};
|
|
9092
9251
|
var updaters = [];
|
|
9093
9252
|
var setPreloads = (updater) => {
|
|
@@ -9408,7 +9567,7 @@ var durationReducer = (state, action) => {
|
|
|
9408
9567
|
return state;
|
|
9409
9568
|
}
|
|
9410
9569
|
};
|
|
9411
|
-
var DurationsContext =
|
|
9570
|
+
var DurationsContext = createContext20({
|
|
9412
9571
|
durations: {},
|
|
9413
9572
|
setDurations: () => {
|
|
9414
9573
|
throw new Error("context missing");
|
|
@@ -9622,8 +9781,8 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
9622
9781
|
}
|
|
9623
9782
|
return true;
|
|
9624
9783
|
};
|
|
9625
|
-
var SharedAudioContext =
|
|
9626
|
-
var SharedAudioTagsContext =
|
|
9784
|
+
var SharedAudioContext = createContext21(null);
|
|
9785
|
+
var SharedAudioTagsContext = createContext21(null);
|
|
9627
9786
|
var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled }) => {
|
|
9628
9787
|
const logLevel = useLogLevel();
|
|
9629
9788
|
const ctxAndGain = useSingletonAudioContext({
|
|
@@ -9668,8 +9827,9 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9668
9827
|
if (!ctxAndGain) {
|
|
9669
9828
|
throw new Error("Audio context not found");
|
|
9670
9829
|
}
|
|
9830
|
+
const saveForLater = ctxAndGain.audioContext.state === "suspended" && !isResuming.current;
|
|
9671
9831
|
if (duration > 0) {
|
|
9672
|
-
if (
|
|
9832
|
+
if (saveForLater) {
|
|
9673
9833
|
nodesToResume.current.set(node, {
|
|
9674
9834
|
scheduledTime,
|
|
9675
9835
|
offset,
|
|
@@ -9687,7 +9847,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9687
9847
|
const prev = prevEndTimes.current;
|
|
9688
9848
|
const scheduledMismatch = prev.scheduledEndTime !== null && Math.abs(scheduledTime - prev.scheduledEndTime) > 0.001;
|
|
9689
9849
|
const mediaMismatch = prev.mediaEndTime !== null && Math.abs(mediaTime - prev.mediaEndTime) > 0.001;
|
|
9690
|
-
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) : "");
|
|
9850
|
+
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"), "");
|
|
9691
9851
|
prev.scheduledEndTime = scheduledEndTime;
|
|
9692
9852
|
prev.mediaEndTime = mediaEndTime;
|
|
9693
9853
|
return duration > 0 ? {
|
|
@@ -9707,6 +9867,13 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9707
9867
|
return Promise.resolve();
|
|
9708
9868
|
}
|
|
9709
9869
|
audioContextIsPlayingEventually.current = true;
|
|
9870
|
+
ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
|
|
9871
|
+
ctxAndGain.gainNode.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
|
|
9872
|
+
ctxAndGain.gainNode.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
|
|
9873
|
+
nodesToResume.current.forEach((r2, node) => {
|
|
9874
|
+
node.start(r2.scheduledTime, r2.offset, r2.duration);
|
|
9875
|
+
});
|
|
9876
|
+
nodesToResume.current.clear();
|
|
9710
9877
|
const resumePromise = ctxAndGain.audioContext.resume();
|
|
9711
9878
|
isResuming.current = new Promise((resolve) => {
|
|
9712
9879
|
waitUntilActuallyResumed(ctxAndGain.audioContext, logLevel).then(resolve);
|
|
@@ -9717,11 +9884,6 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
9717
9884
|
}).finally(() => {
|
|
9718
9885
|
isResuming.current = null;
|
|
9719
9886
|
});
|
|
9720
|
-
ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
|
|
9721
|
-
ctxAndGain.gainNode.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
|
|
9722
|
-
ctxAndGain.gainNode.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
|
|
9723
|
-
nodesToResume.current.forEach((r2, node) => node.start(r2.scheduledTime, r2.offset, r2.duration));
|
|
9724
|
-
nodesToResume.current.clear();
|
|
9725
9887
|
return resumePromise.catch(() => {});
|
|
9726
9888
|
}, [ctxAndGain, logLevel]);
|
|
9727
9889
|
const getIsResumingAudioContext = useCallback9(() => {
|
|
@@ -10523,9 +10685,14 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
10523
10685
|
}
|
|
10524
10686
|
};
|
|
10525
10687
|
}
|
|
10688
|
+
let unblocked = false;
|
|
10526
10689
|
setBlocks((b) => [...b, block]);
|
|
10527
10690
|
return {
|
|
10528
10691
|
unblock: () => {
|
|
10692
|
+
if (unblocked) {
|
|
10693
|
+
return;
|
|
10694
|
+
}
|
|
10695
|
+
unblocked = true;
|
|
10529
10696
|
setBlocks((b) => {
|
|
10530
10697
|
const newArr = b.filter((bx) => bx !== block);
|
|
10531
10698
|
if (newArr.length === b.length) {
|
|
@@ -10619,18 +10786,30 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
10619
10786
|
};
|
|
10620
10787
|
var useBufferState = () => {
|
|
10621
10788
|
const buffer = useContext25(BufferingContextReact);
|
|
10789
|
+
const logLevel = useLogLevel();
|
|
10622
10790
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
10623
10791
|
return useMemo25(() => ({
|
|
10624
10792
|
delayPlayback: () => {
|
|
10625
10793
|
if (!addBlock) {
|
|
10626
10794
|
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");
|
|
10627
10795
|
}
|
|
10796
|
+
Log.trace({ logLevel, tag: "[buffer-state]" }, "Adding buffer handle", new Error().stack);
|
|
10628
10797
|
const { unblock } = addBlock({
|
|
10629
10798
|
id: String(Math.random())
|
|
10630
10799
|
});
|
|
10631
|
-
|
|
10800
|
+
let unblocked = false;
|
|
10801
|
+
return {
|
|
10802
|
+
unblock: () => {
|
|
10803
|
+
if (unblocked) {
|
|
10804
|
+
return;
|
|
10805
|
+
}
|
|
10806
|
+
unblocked = true;
|
|
10807
|
+
Log.trace({ logLevel, tag: "[buffer-state]" }, "Removing buffer handle");
|
|
10808
|
+
unblock();
|
|
10809
|
+
}
|
|
10810
|
+
};
|
|
10632
10811
|
}
|
|
10633
|
-
}), [addBlock]);
|
|
10812
|
+
}), [addBlock, logLevel]);
|
|
10634
10813
|
};
|
|
10635
10814
|
var isSafariWebkit = () => {
|
|
10636
10815
|
const isSafari2 = /^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);
|
|
@@ -11398,11 +11577,11 @@ var useMediaTag = ({
|
|
|
11398
11577
|
env.isPlayer
|
|
11399
11578
|
]);
|
|
11400
11579
|
};
|
|
11401
|
-
var MediaVolumeContext =
|
|
11580
|
+
var MediaVolumeContext = createContext22({
|
|
11402
11581
|
mediaMuted: false,
|
|
11403
11582
|
mediaVolume: 1
|
|
11404
11583
|
});
|
|
11405
|
-
var SetMediaVolumeContext =
|
|
11584
|
+
var SetMediaVolumeContext = createContext22({
|
|
11406
11585
|
setMediaMuted: () => {
|
|
11407
11586
|
throw new Error("default");
|
|
11408
11587
|
},
|
|
@@ -12208,10 +12387,13 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
12208
12387
|
};
|
|
12209
12388
|
var defineEffect = (definition) => definition;
|
|
12210
12389
|
var createDescriptor = (definition, params) => {
|
|
12390
|
+
const widened = definition;
|
|
12211
12391
|
return {
|
|
12212
|
-
definition,
|
|
12392
|
+
definition: widened,
|
|
12213
12393
|
params,
|
|
12214
|
-
stack: new Error().stack
|
|
12394
|
+
stack: new Error().stack,
|
|
12395
|
+
effectKey: widened.calculateKey(params),
|
|
12396
|
+
memoized: false
|
|
12215
12397
|
};
|
|
12216
12398
|
};
|
|
12217
12399
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
@@ -12236,7 +12418,7 @@ var waitForRoot = (fn) => {
|
|
|
12236
12418
|
listeners = listeners.filter((l) => l !== fn);
|
|
12237
12419
|
};
|
|
12238
12420
|
};
|
|
12239
|
-
var MediaEnabledContext =
|
|
12421
|
+
var MediaEnabledContext = createContext23(null);
|
|
12240
12422
|
var useVideoEnabled = () => {
|
|
12241
12423
|
const context = useContext32(MediaEnabledContext);
|
|
12242
12424
|
if (!context) {
|
|
@@ -12275,8 +12457,7 @@ var RemotionRootContexts = ({
|
|
|
12275
12457
|
audioLatencyHint,
|
|
12276
12458
|
videoEnabled,
|
|
12277
12459
|
audioEnabled,
|
|
12278
|
-
frameState
|
|
12279
|
-
visualModeEnabled
|
|
12460
|
+
frameState
|
|
12280
12461
|
}) => {
|
|
12281
12462
|
const nonceContext = useMemo322(() => {
|
|
12282
12463
|
let counter = 0;
|
|
@@ -12299,7 +12480,6 @@ var RemotionRootContexts = ({
|
|
|
12299
12480
|
children: /* @__PURE__ */ jsx29(EditorPropsProvider, {
|
|
12300
12481
|
children: /* @__PURE__ */ jsx29(PrefetchProvider, {
|
|
12301
12482
|
children: /* @__PURE__ */ jsx29(SequenceManagerProvider, {
|
|
12302
|
-
visualModeEnabled,
|
|
12303
12483
|
children: /* @__PURE__ */ jsx29(DurationsContextProvider, {
|
|
12304
12484
|
children: /* @__PURE__ */ jsx29(BufferingProvider, {
|
|
12305
12485
|
children: /* @__PURE__ */ jsx29(SharedAudioContextProvider, {
|
|
@@ -12518,7 +12698,7 @@ var setupEnvVariables = () => {
|
|
|
12518
12698
|
});
|
|
12519
12699
|
};
|
|
12520
12700
|
var CurrentScaleContext = React32.createContext(null);
|
|
12521
|
-
var PreviewSizeContext =
|
|
12701
|
+
var PreviewSizeContext = createContext24({
|
|
12522
12702
|
setSize: () => {
|
|
12523
12703
|
return;
|
|
12524
12704
|
},
|
|
@@ -12541,14 +12721,6 @@ var calculateScale = ({
|
|
|
12541
12721
|
}
|
|
12542
12722
|
return Number(previewSize);
|
|
12543
12723
|
};
|
|
12544
|
-
var useSequenceControlOverride = (key) => {
|
|
12545
|
-
const seqContext = useContext33(SequenceContext);
|
|
12546
|
-
const { dragOverrides: overrides } = useContext33(VisualModeOverridesContext);
|
|
12547
|
-
if (!seqContext) {
|
|
12548
|
-
return;
|
|
12549
|
-
}
|
|
12550
|
-
return overrides[seqContext.id]?.[key];
|
|
12551
|
-
};
|
|
12552
12724
|
var getOffthreadVideoSource = ({
|
|
12553
12725
|
src,
|
|
12554
12726
|
transparent,
|
|
@@ -12580,9 +12752,9 @@ var OffthreadVideoForRendering = ({
|
|
|
12580
12752
|
const frame = useCurrentFrame();
|
|
12581
12753
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
12582
12754
|
const videoConfig = useUnsafeVideoConfig();
|
|
12583
|
-
const sequenceContext =
|
|
12755
|
+
const sequenceContext = useContext33(SequenceContext);
|
|
12584
12756
|
const mediaStartsAt = useMediaStartsAt();
|
|
12585
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
12757
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
|
|
12586
12758
|
if (!src) {
|
|
12587
12759
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
12588
12760
|
}
|
|
@@ -12794,7 +12966,7 @@ class MediaPlaybackError extends Error {
|
|
|
12794
12966
|
}
|
|
12795
12967
|
}
|
|
12796
12968
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
12797
|
-
const context =
|
|
12969
|
+
const context = useContext34(SharedAudioContext);
|
|
12798
12970
|
if (!context) {
|
|
12799
12971
|
throw new Error("SharedAudioContext not found");
|
|
12800
12972
|
}
|
|
@@ -12850,8 +13022,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
12850
13022
|
}
|
|
12851
13023
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
12852
13024
|
const { fps, durationInFrames } = useVideoConfig();
|
|
12853
|
-
const parentSequence =
|
|
12854
|
-
const { hidden } =
|
|
13025
|
+
const parentSequence = useContext34(SequenceContext);
|
|
13026
|
+
const { hidden } = useContext34(SequenceVisibilityToggleContext);
|
|
12855
13027
|
const logLevel = useLogLevel();
|
|
12856
13028
|
const mountTime = useMountTime();
|
|
12857
13029
|
const [timelineId] = useState21(() => String(Math.random()));
|
|
@@ -13275,7 +13447,9 @@ var Internals = {
|
|
|
13275
13447
|
VideoForPreview,
|
|
13276
13448
|
CompositionManager,
|
|
13277
13449
|
CompositionSetters,
|
|
13278
|
-
|
|
13450
|
+
VisualModeCodeValuesContext,
|
|
13451
|
+
VisualModeDragOverridesContext,
|
|
13452
|
+
VisualModeSettersContext,
|
|
13279
13453
|
SequenceManager,
|
|
13280
13454
|
SequenceStackTracesUpdateContext,
|
|
13281
13455
|
SequenceVisibilityToggleContext,
|
|
@@ -13284,7 +13458,6 @@ var Internals = {
|
|
|
13284
13458
|
sequenceStyleSchema,
|
|
13285
13459
|
flattenActiveSchema,
|
|
13286
13460
|
getFlatSchemaWithAllKeys,
|
|
13287
|
-
useSequenceControlOverride,
|
|
13288
13461
|
RemotionRootContexts,
|
|
13289
13462
|
CompositionManagerProvider,
|
|
13290
13463
|
useVideo,
|
|
@@ -13377,7 +13550,11 @@ var Internals = {
|
|
|
13377
13550
|
useMemoizedEffects,
|
|
13378
13551
|
defineEffect,
|
|
13379
13552
|
createDescriptor,
|
|
13380
|
-
computeEffectiveSchemaValuesDotNotation
|
|
13553
|
+
computeEffectiveSchemaValuesDotNotation,
|
|
13554
|
+
OverrideIdsToNodePathsGettersContext,
|
|
13555
|
+
OverrideIdsToNodePathsSettersContext,
|
|
13556
|
+
findPropsToDelete,
|
|
13557
|
+
flattenEffects
|
|
13381
13558
|
};
|
|
13382
13559
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
13383
13560
|
var PERCENTAGE = NUMBER + "%";
|
|
@@ -13415,7 +13592,7 @@ var flattenChildren = (children) => {
|
|
|
13415
13592
|
return flatChildren;
|
|
13416
13593
|
}, []);
|
|
13417
13594
|
};
|
|
13418
|
-
var IsInsideSeriesContext =
|
|
13595
|
+
var IsInsideSeriesContext = createContext25(false);
|
|
13419
13596
|
var IsInsideSeriesContainer = ({ children }) => {
|
|
13420
13597
|
return /* @__PURE__ */ jsx34(IsInsideSeriesContext.Provider, {
|
|
13421
13598
|
value: true,
|
|
@@ -13457,9 +13634,6 @@ var SeriesInner = (props2) => {
|
|
|
13457
13634
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`);
|
|
13458
13635
|
}
|
|
13459
13636
|
const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
|
|
13460
|
-
if (!castedChild?.props.children) {
|
|
13461
|
-
throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
|
|
13462
|
-
}
|
|
13463
13637
|
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
13464
13638
|
const {
|
|
13465
13639
|
durationInFrames,
|
|
@@ -13975,13 +14149,13 @@ var VideoForRenderingForwardFunction = ({
|
|
|
13975
14149
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
13976
14150
|
const videoConfig = useUnsafeVideoConfig();
|
|
13977
14151
|
const videoRef = useRef23(null);
|
|
13978
|
-
const sequenceContext =
|
|
14152
|
+
const sequenceContext = useContext35(SequenceContext);
|
|
13979
14153
|
const mediaStartsAt = useMediaStartsAt();
|
|
13980
14154
|
const environment = useRemotionEnvironment();
|
|
13981
14155
|
const logLevel = useLogLevel();
|
|
13982
14156
|
const mountTime = useMountTime();
|
|
13983
14157
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
13984
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
14158
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext35(RenderAssetManager);
|
|
13985
14159
|
const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
13986
14160
|
props2.src,
|
|
13987
14161
|
sequenceContext?.cumulatedFrom,
|
|
@@ -14191,7 +14365,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
14191
14365
|
if (environment.isClientSideRendering) {
|
|
14192
14366
|
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");
|
|
14193
14367
|
}
|
|
14194
|
-
const { durations, setDurations } =
|
|
14368
|
+
const { durations, setDurations } = useContext36(DurationsContext);
|
|
14195
14369
|
if (typeof ref === "string") {
|
|
14196
14370
|
throw new Error("string refs are not supported");
|
|
14197
14371
|
}
|