remotion 4.0.531 → 4.0.533
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/CompositionManager.d.ts +6 -0
- package/dist/cjs/HtmlInCanvas.d.ts +2 -0
- package/dist/cjs/HtmlInCanvas.js +15 -3
- package/dist/cjs/Sequence.js +31 -2
- package/dist/cjs/SequenceManager.d.ts +28 -0
- package/dist/cjs/SequenceManager.js +293 -26
- package/dist/cjs/effects/use-memoized-effects.js +4 -2
- package/dist/cjs/internals.d.ts +3 -0
- package/dist/cjs/internals.js +3 -0
- package/dist/cjs/use-sequence-registration.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/with-interactivity-schema.js +5 -5
- package/dist/esm/index.mjs +428 -154
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -1561,7 +1561,7 @@ var Composition = (props) => {
|
|
|
1561
1561
|
};
|
|
1562
1562
|
|
|
1563
1563
|
// src/version.ts
|
|
1564
|
-
var VERSION = "4.0.
|
|
1564
|
+
var VERSION = "4.0.533";
|
|
1565
1565
|
|
|
1566
1566
|
// src/multiple-versions-warning.ts
|
|
1567
1567
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1599,9 +1599,10 @@ var Null = () => {
|
|
|
1599
1599
|
|
|
1600
1600
|
// src/Sequence.tsx
|
|
1601
1601
|
import {
|
|
1602
|
+
createContext as createContext20,
|
|
1602
1603
|
forwardRef as forwardRef3,
|
|
1603
1604
|
useCallback as useCallback6,
|
|
1604
|
-
useContext as
|
|
1605
|
+
useContext as useContext21,
|
|
1605
1606
|
useMemo as useMemo14,
|
|
1606
1607
|
useRef as useRef7,
|
|
1607
1608
|
useState as useState6
|
|
@@ -2583,10 +2584,10 @@ var SequenceOutlineInternals = {
|
|
|
2583
2584
|
};
|
|
2584
2585
|
|
|
2585
2586
|
// src/SequenceManager.tsx
|
|
2586
|
-
import React16, { useCallback as useCallback5, useMemo as useMemo11, useRef as useRef4, useState as useState4 } from "react";
|
|
2587
|
+
import React16, { useCallback as useCallback5, useContext as useContext16, useMemo as useMemo11, useRef as useRef4, useState as useState4 } from "react";
|
|
2587
2588
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2588
2589
|
var useIsomorphicLayoutEffect = typeof window === "undefined" ? React16.useEffect : React16.useLayoutEffect;
|
|
2589
|
-
var
|
|
2590
|
+
var defaultSequenceManager = {
|
|
2590
2591
|
registerSequence: () => {
|
|
2591
2592
|
throw new Error("SequenceManagerContext not initialized");
|
|
2592
2593
|
},
|
|
@@ -2595,7 +2596,34 @@ var SequenceManager = React16.createContext({
|
|
|
2595
2596
|
throw new Error("SequenceManagerContext not initialized");
|
|
2596
2597
|
},
|
|
2597
2598
|
sequences: []
|
|
2599
|
+
};
|
|
2600
|
+
var SequenceManagerActionsContext = React16.createContext({
|
|
2601
|
+
registerSequence: defaultSequenceManager.registerSequence,
|
|
2602
|
+
updateSequence: defaultSequenceManager.updateSequence,
|
|
2603
|
+
unregisterSequence: defaultSequenceManager.unregisterSequence
|
|
2604
|
+
});
|
|
2605
|
+
var SequenceManager = React16.createContext(defaultSequenceManager);
|
|
2606
|
+
var NativeSequenceManagerProvider = SequenceManager.Provider;
|
|
2607
|
+
var SequenceManagerProviderWithActions = ({ value, children }) => {
|
|
2608
|
+
const actions = useMemo11(() => ({
|
|
2609
|
+
registerSequence: value.registerSequence,
|
|
2610
|
+
updateSequence: value.updateSequence,
|
|
2611
|
+
unregisterSequence: value.unregisterSequence
|
|
2612
|
+
}), [value.registerSequence, value.updateSequence, value.unregisterSequence]);
|
|
2613
|
+
return /* @__PURE__ */ jsx10(SequenceManagerActionsContext.Provider, {
|
|
2614
|
+
value: actions,
|
|
2615
|
+
children: /* @__PURE__ */ jsx10(NativeSequenceManagerProvider, {
|
|
2616
|
+
value,
|
|
2617
|
+
children
|
|
2618
|
+
})
|
|
2619
|
+
});
|
|
2620
|
+
};
|
|
2621
|
+
Object.defineProperty(SequenceManager, "Provider", {
|
|
2622
|
+
value: SequenceManagerProviderWithActions
|
|
2598
2623
|
});
|
|
2624
|
+
var useSequenceManagerSequences = () => {
|
|
2625
|
+
return useContext16(SequenceManager).sequences;
|
|
2626
|
+
};
|
|
2599
2627
|
var SequenceManagerRefContext = React16.createContext({
|
|
2600
2628
|
current: []
|
|
2601
2629
|
});
|
|
@@ -2604,6 +2632,23 @@ var DisableSequenceRegistrationContext = React16.createContext(false);
|
|
|
2604
2632
|
var DisableSequenceRegistrationProvider = ({ children }) => {
|
|
2605
2633
|
return React16.createElement(DisableSequenceRegistrationContext.Provider, { value: true }, children);
|
|
2606
2634
|
};
|
|
2635
|
+
var VisualModeDragOverridesSubscriptionContext = React16.createContext(null);
|
|
2636
|
+
var ActiveFromDragOverrideKeysContext = React16.createContext(null);
|
|
2637
|
+
var SequenceManagerScopeProviders = ({ children, dragOverridesSubscription, fromKeys }) => {
|
|
2638
|
+
const manager = useContext16(SequenceManagerActionsContext);
|
|
2639
|
+
const scopedDragOverridesSubscription = useMemo11(() => ({ ...dragOverridesSubscription, manager }), [dragOverridesSubscription, manager]);
|
|
2640
|
+
const activeFromDragOverrideKeys = useMemo11(() => ({ manager, keys: fromKeys }), [fromKeys, manager]);
|
|
2641
|
+
return /* @__PURE__ */ jsx10(ActiveFromDragOverrideKeysContext.Provider, {
|
|
2642
|
+
value: activeFromDragOverrideKeys,
|
|
2643
|
+
children: /* @__PURE__ */ jsx10(VisualModeDragOverridesSubscriptionContext.Provider, {
|
|
2644
|
+
value: scopedDragOverridesSubscription,
|
|
2645
|
+
children
|
|
2646
|
+
})
|
|
2647
|
+
});
|
|
2648
|
+
};
|
|
2649
|
+
var emptyDragOverrides = {};
|
|
2650
|
+
var emptyFromOverrideKeys = new Set;
|
|
2651
|
+
var emptyEffectDragOverrides = {};
|
|
2607
2652
|
var makeSequencePropsSubscriptionKey = (key) => {
|
|
2608
2653
|
return `${key.absolutePath}\x00${key.nodePath.join(".")}\x00${key.sequenceKeys.join(".")}\x00${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
|
|
2609
2654
|
};
|
|
@@ -2621,6 +2666,44 @@ var VisualModeDragOverridesContext = React16.createContext({
|
|
|
2621
2666
|
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
2622
2667
|
}
|
|
2623
2668
|
});
|
|
2669
|
+
var useDragOverridesForNodePath = (nodePath) => {
|
|
2670
|
+
const subscription = useContext16(VisualModeDragOverridesSubscriptionContext);
|
|
2671
|
+
const manager = useContext16(SequenceManagerActionsContext);
|
|
2672
|
+
const scopedSubscription = subscription?.manager === manager ? subscription : null;
|
|
2673
|
+
const legacy = scopedSubscription === null ? useContext16(VisualModeDragOverridesContext) : null;
|
|
2674
|
+
const key = nodePath === null ? null : makeSequencePropsSubscriptionKey(nodePath);
|
|
2675
|
+
const subscribe = useCallback5((listener) => scopedSubscription?.subscribe(key, listener) ?? (() => {
|
|
2676
|
+
return;
|
|
2677
|
+
}), [key, scopedSubscription]);
|
|
2678
|
+
const getSnapshot = useCallback5(() => scopedSubscription?.getSnapshot(key) ?? emptyDragOverrides, [key, scopedSubscription]);
|
|
2679
|
+
const overrides = useSyncExternalStore2(subscribe, getSnapshot, getSnapshot);
|
|
2680
|
+
return legacy !== null && nodePath !== null ? legacy.getDragOverrides(nodePath) : overrides;
|
|
2681
|
+
};
|
|
2682
|
+
var useActiveFromDragOverrideKeys = () => {
|
|
2683
|
+
const snapshot = useContext16(ActiveFromDragOverrideKeysContext);
|
|
2684
|
+
const manager = useContext16(SequenceManagerActionsContext);
|
|
2685
|
+
return snapshot?.manager === manager ? snapshot.keys : emptyFromOverrideKeys;
|
|
2686
|
+
};
|
|
2687
|
+
var useEffectDragOverridesForNodePath = (nodePath, effectCount) => {
|
|
2688
|
+
const subscription = useContext16(VisualModeDragOverridesSubscriptionContext);
|
|
2689
|
+
const manager = useContext16(SequenceManagerActionsContext);
|
|
2690
|
+
const scopedSubscription = subscription?.manager === manager ? subscription : null;
|
|
2691
|
+
const legacy = scopedSubscription === null ? useContext16(VisualModeDragOverridesContext) : null;
|
|
2692
|
+
const key = nodePath === null ? null : makeSequencePropsSubscriptionKey(nodePath);
|
|
2693
|
+
const subscribe = useCallback5((listener) => scopedSubscription?.subscribeEffects(key, listener) ?? (() => {
|
|
2694
|
+
return;
|
|
2695
|
+
}), [key, scopedSubscription]);
|
|
2696
|
+
const getSnapshot = useCallback5(() => scopedSubscription?.getEffectSnapshot(key) ?? emptyEffectDragOverrides, [key, scopedSubscription]);
|
|
2697
|
+
const overrides = useSyncExternalStore2(subscribe, getSnapshot, getSnapshot);
|
|
2698
|
+
if (legacy !== null && nodePath !== null) {
|
|
2699
|
+
const legacyOverrides = {};
|
|
2700
|
+
for (let index = 0;index < effectCount; index++) {
|
|
2701
|
+
legacyOverrides[index] = legacy.getEffectDragOverrides(nodePath, index);
|
|
2702
|
+
}
|
|
2703
|
+
return legacyOverrides;
|
|
2704
|
+
}
|
|
2705
|
+
return overrides;
|
|
2706
|
+
};
|
|
2624
2707
|
var VisualModeSettersContext = React16.createContext({
|
|
2625
2708
|
setDragOverrides: () => {
|
|
2626
2709
|
throw new Error("VisualModeSettersContext not initialized");
|
|
@@ -2641,6 +2724,7 @@ var VisualModeSettersContext = React16.createContext({
|
|
|
2641
2724
|
throw new Error("VisualModeSettersContext not initialized");
|
|
2642
2725
|
}
|
|
2643
2726
|
});
|
|
2727
|
+
var VisualModeBatchSettersContext = React16.createContext(null);
|
|
2644
2728
|
var effectDragOverridesKey = (nodePath, effectIndex) => `${makeSequencePropsSubscriptionKey(nodePath)}.effects.${effectIndex}`;
|
|
2645
2729
|
var SequenceManagerProvider = ({ children }) => {
|
|
2646
2730
|
const { isStudio } = useRemotionEnvironment();
|
|
@@ -2650,45 +2734,185 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2650
2734
|
const [sequences, setSequences] = useState4([]);
|
|
2651
2735
|
const sequencesRef = useRef4(sequences);
|
|
2652
2736
|
sequencesRef.current = sequences;
|
|
2653
|
-
const [
|
|
2654
|
-
|
|
2655
|
-
|
|
2737
|
+
const [dragOverrideState, setDragOverrideState] = useState4(() => ({
|
|
2738
|
+
overrides: {},
|
|
2739
|
+
fromKeys: new Set
|
|
2740
|
+
}));
|
|
2741
|
+
const dragOverrides = dragOverrideState.overrides;
|
|
2742
|
+
const dragOverridesStore = useRef4({
|
|
2743
|
+
snapshot: dragOverrides,
|
|
2744
|
+
listeners: new Map
|
|
2745
|
+
});
|
|
2656
2746
|
const [effectDragOverridesState, setEffectDragOverridesState] = useState4({});
|
|
2747
|
+
const effectDragOverridesStore = useRef4({
|
|
2748
|
+
snapshot: effectDragOverridesState,
|
|
2749
|
+
byNode: new Map,
|
|
2750
|
+
listeners: new Map
|
|
2751
|
+
});
|
|
2657
2752
|
const [propStatuses, setPropStatusesMapState] = useState4({});
|
|
2658
2753
|
const propStatusesRef = useRef4(propStatuses);
|
|
2659
2754
|
propStatusesRef.current = propStatuses;
|
|
2660
|
-
const
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2755
|
+
const setDragOverridesBatch = useCallback5((overrides) => {
|
|
2756
|
+
setDragOverrideState((prevState) => {
|
|
2757
|
+
const prev = prevState.overrides;
|
|
2758
|
+
let next = null;
|
|
2759
|
+
let nextFromKeys = prevState.fromKeys;
|
|
2760
|
+
for (const { nodePath, key, value } of overrides) {
|
|
2761
|
+
const mapKey = makeSequencePropsSubscriptionKey(nodePath);
|
|
2762
|
+
const existing = (next ?? prev)[mapKey]?.[key];
|
|
2763
|
+
if (existing === value || existing?.type === "static" && value.type === "static" && Object.is(existing.value, value.value)) {
|
|
2764
|
+
continue;
|
|
2765
|
+
}
|
|
2766
|
+
if (next === null) {
|
|
2767
|
+
next = { ...prev };
|
|
2768
|
+
}
|
|
2769
|
+
if (next[mapKey] === prev[mapKey]) {
|
|
2770
|
+
next[mapKey] = { ...prev[mapKey] };
|
|
2771
|
+
}
|
|
2772
|
+
next[mapKey][key] = value;
|
|
2773
|
+
if (key === "from" && !nextFromKeys.has(mapKey)) {
|
|
2774
|
+
nextFromKeys = new Set(nextFromKeys);
|
|
2775
|
+
nextFromKeys.add(mapKey);
|
|
2776
|
+
}
|
|
2666
2777
|
}
|
|
2667
|
-
|
|
2778
|
+
return next === null ? prevState : { overrides: next, fromKeys: nextFromKeys };
|
|
2779
|
+
});
|
|
2780
|
+
}, []);
|
|
2781
|
+
const setDragOverrides = useCallback5((nodePath, key, value) => setDragOverridesBatch([{ nodePath, key, value }]), [setDragOverridesBatch]);
|
|
2782
|
+
const subscribeDragOverrides = useCallback5((key, listener) => {
|
|
2783
|
+
if (key === null) {
|
|
2784
|
+
return () => {
|
|
2785
|
+
return;
|
|
2786
|
+
};
|
|
2787
|
+
}
|
|
2788
|
+
let listeners = dragOverridesStore.current.listeners.get(key);
|
|
2789
|
+
if (!listeners) {
|
|
2790
|
+
listeners = new Set;
|
|
2791
|
+
dragOverridesStore.current.listeners.set(key, listeners);
|
|
2792
|
+
}
|
|
2793
|
+
listeners.add(listener);
|
|
2794
|
+
return () => {
|
|
2795
|
+
listeners.delete(listener);
|
|
2796
|
+
if (listeners.size === 0) {
|
|
2797
|
+
dragOverridesStore.current.listeners.delete(key);
|
|
2798
|
+
}
|
|
2799
|
+
};
|
|
2800
|
+
}, []);
|
|
2801
|
+
const getDragOverridesSnapshot = useCallback5((key) => {
|
|
2802
|
+
return key === null ? emptyDragOverrides : dragOverridesStore.current.snapshot[key] ?? emptyDragOverrides;
|
|
2803
|
+
}, []);
|
|
2804
|
+
useIsomorphicLayoutEffect(() => {
|
|
2805
|
+
const previous = dragOverridesStore.current.snapshot;
|
|
2806
|
+
dragOverridesStore.current.snapshot = dragOverrides;
|
|
2807
|
+
for (const key of new Set([
|
|
2808
|
+
...Object.keys(previous),
|
|
2809
|
+
...Object.keys(dragOverrides)
|
|
2810
|
+
])) {
|
|
2811
|
+
if (previous[key] !== dragOverrides[key]) {
|
|
2812
|
+
for (const listener of dragOverridesStore.current.listeners.get(key) ?? []) {
|
|
2813
|
+
listener();
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
}, [dragOverrides]);
|
|
2818
|
+
const subscribeEffectDragOverrides = useCallback5((key, listener) => {
|
|
2819
|
+
if (key === null) {
|
|
2820
|
+
return () => {
|
|
2821
|
+
return;
|
|
2822
|
+
};
|
|
2823
|
+
}
|
|
2824
|
+
let listeners = effectDragOverridesStore.current.listeners.get(key);
|
|
2825
|
+
if (!listeners) {
|
|
2826
|
+
listeners = new Set;
|
|
2827
|
+
effectDragOverridesStore.current.listeners.set(key, listeners);
|
|
2828
|
+
}
|
|
2829
|
+
listeners.add(listener);
|
|
2830
|
+
return () => {
|
|
2831
|
+
listeners.delete(listener);
|
|
2832
|
+
if (listeners.size === 0) {
|
|
2833
|
+
effectDragOverridesStore.current.listeners.delete(key);
|
|
2834
|
+
}
|
|
2835
|
+
};
|
|
2668
2836
|
}, []);
|
|
2837
|
+
const getEffectDragOverridesSnapshot = useCallback5((key) => {
|
|
2838
|
+
return key === null ? emptyEffectDragOverrides : effectDragOverridesStore.current.byNode.get(key) ?? emptyEffectDragOverrides;
|
|
2839
|
+
}, []);
|
|
2840
|
+
useIsomorphicLayoutEffect(() => {
|
|
2841
|
+
const previous = effectDragOverridesStore.current.snapshot;
|
|
2842
|
+
const byNode = new Map(effectDragOverridesStore.current.byNode);
|
|
2843
|
+
const changedNodes = new Set;
|
|
2844
|
+
for (const flatKey of new Set([
|
|
2845
|
+
...Object.keys(previous),
|
|
2846
|
+
...Object.keys(effectDragOverridesState)
|
|
2847
|
+
])) {
|
|
2848
|
+
if (previous[flatKey] === effectDragOverridesState[flatKey]) {
|
|
2849
|
+
continue;
|
|
2850
|
+
}
|
|
2851
|
+
const separator = flatKey.lastIndexOf(".effects.");
|
|
2852
|
+
if (separator === -1) {
|
|
2853
|
+
throw new Error("Invalid effect drag override key");
|
|
2854
|
+
}
|
|
2855
|
+
const nodeKey = flatKey.slice(0, separator);
|
|
2856
|
+
const effectIndex = flatKey.slice(separator + ".effects.".length);
|
|
2857
|
+
if (!changedNodes.has(nodeKey)) {
|
|
2858
|
+
byNode.set(nodeKey, { ...byNode.get(nodeKey) });
|
|
2859
|
+
changedNodes.add(nodeKey);
|
|
2860
|
+
}
|
|
2861
|
+
const next = byNode.get(nodeKey);
|
|
2862
|
+
if (effectDragOverridesState[flatKey] === undefined) {
|
|
2863
|
+
delete next[effectIndex];
|
|
2864
|
+
} else {
|
|
2865
|
+
next[effectIndex] = effectDragOverridesState[flatKey];
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
for (const nodeKey of changedNodes) {
|
|
2869
|
+
if (Object.keys(byNode.get(nodeKey)).length === 0) {
|
|
2870
|
+
byNode.delete(nodeKey);
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
effectDragOverridesStore.current.snapshot = effectDragOverridesState;
|
|
2874
|
+
effectDragOverridesStore.current.byNode = byNode;
|
|
2875
|
+
for (const nodeKey of changedNodes) {
|
|
2876
|
+
for (const listener of effectDragOverridesStore.current.listeners.get(nodeKey) ?? []) {
|
|
2877
|
+
listener();
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
}, [effectDragOverridesState]);
|
|
2669
2881
|
const clearDragOverrides = useCallback5((nodePath) => {
|
|
2670
|
-
|
|
2882
|
+
setDragOverrideState((prevState) => {
|
|
2883
|
+
const prev = prevState.overrides;
|
|
2671
2884
|
const key = makeSequencePropsSubscriptionKey(nodePath);
|
|
2672
2885
|
if (!prev[key]) {
|
|
2673
|
-
return
|
|
2886
|
+
return prevState;
|
|
2674
2887
|
}
|
|
2675
2888
|
const next = { ...prev };
|
|
2676
2889
|
delete next[key];
|
|
2677
|
-
|
|
2890
|
+
const nextFromKeys = prevState.fromKeys.has(key) ? new Set(prevState.fromKeys) : prevState.fromKeys;
|
|
2891
|
+
nextFromKeys.delete(key);
|
|
2892
|
+
return { overrides: next, fromKeys: nextFromKeys };
|
|
2678
2893
|
});
|
|
2679
2894
|
}, []);
|
|
2680
|
-
const
|
|
2895
|
+
const setEffectDragOverridesBatch = useCallback5((overrides) => {
|
|
2681
2896
|
setEffectDragOverridesState((prev) => {
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
[mapKey]
|
|
2686
|
-
|
|
2687
|
-
|
|
2897
|
+
let next = null;
|
|
2898
|
+
for (const { nodePath, effectIndex, key, value } of overrides) {
|
|
2899
|
+
const mapKey = effectDragOverridesKey(nodePath, effectIndex);
|
|
2900
|
+
const existing = (next ?? prev)[mapKey]?.[key];
|
|
2901
|
+
if (existing === value || existing?.type === "static" && value.type === "static" && Object.is(existing.value, value.value)) {
|
|
2902
|
+
continue;
|
|
2688
2903
|
}
|
|
2689
|
-
|
|
2904
|
+
if (next === null) {
|
|
2905
|
+
next = { ...prev };
|
|
2906
|
+
}
|
|
2907
|
+
if (next[mapKey] === prev[mapKey]) {
|
|
2908
|
+
next[mapKey] = { ...prev[mapKey] };
|
|
2909
|
+
}
|
|
2910
|
+
next[mapKey][key] = value;
|
|
2911
|
+
}
|
|
2912
|
+
return next ?? prev;
|
|
2690
2913
|
});
|
|
2691
2914
|
}, []);
|
|
2915
|
+
const setEffectDragOverrides = useCallback5((nodePath, effectIndex, key, value) => setEffectDragOverridesBatch([{ nodePath, effectIndex, key, value }]), [setEffectDragOverridesBatch]);
|
|
2692
2916
|
const clearEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
|
|
2693
2917
|
setEffectDragOverridesState((prev) => {
|
|
2694
2918
|
const mapKey = effectDragOverridesKey(nodePath, effectIndex);
|
|
@@ -2806,6 +3030,17 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2806
3030
|
unregisterSequence
|
|
2807
3031
|
};
|
|
2808
3032
|
}, [registerSequence, sequences, unregisterSequence, updateSequence]);
|
|
3033
|
+
const dragOverridesSubscription = useMemo11(() => ({
|
|
3034
|
+
subscribe: subscribeDragOverrides,
|
|
3035
|
+
getSnapshot: getDragOverridesSnapshot,
|
|
3036
|
+
subscribeEffects: subscribeEffectDragOverrides,
|
|
3037
|
+
getEffectSnapshot: getEffectDragOverridesSnapshot
|
|
3038
|
+
}), [
|
|
3039
|
+
getDragOverridesSnapshot,
|
|
3040
|
+
getEffectDragOverridesSnapshot,
|
|
3041
|
+
subscribeDragOverrides,
|
|
3042
|
+
subscribeEffectDragOverrides
|
|
3043
|
+
]);
|
|
2809
3044
|
const getDragOverrides = useCallback5((nodePath) => {
|
|
2810
3045
|
return dragOverrides[makeSequencePropsSubscriptionKey(nodePath)] ?? {};
|
|
2811
3046
|
}, [dragOverrides]);
|
|
@@ -2840,6 +3075,7 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2840
3075
|
setPropStatuses,
|
|
2841
3076
|
remapPropStatuses
|
|
2842
3077
|
]);
|
|
3078
|
+
const batchSettersContext = useMemo11(() => ({ setDragOverridesBatch, setEffectDragOverridesBatch }), [setDragOverridesBatch, setEffectDragOverridesBatch]);
|
|
2843
3079
|
const providers = /* @__PURE__ */ jsx10(SequenceManagerRefContext.Provider, {
|
|
2844
3080
|
value: sequencesRef,
|
|
2845
3081
|
children: /* @__PURE__ */ jsx10(SequenceManager.Provider, {
|
|
@@ -2848,11 +3084,18 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2848
3084
|
value: propStatusesRef,
|
|
2849
3085
|
children: /* @__PURE__ */ jsx10(VisualModePropStatusesContext.Provider, {
|
|
2850
3086
|
value: propStatusesContext,
|
|
2851
|
-
children: /* @__PURE__ */ jsx10(
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
3087
|
+
children: /* @__PURE__ */ jsx10(SequenceManagerScopeProviders, {
|
|
3088
|
+
dragOverridesSubscription,
|
|
3089
|
+
fromKeys: dragOverrideState.fromKeys,
|
|
3090
|
+
children: /* @__PURE__ */ jsx10(VisualModeDragOverridesContext.Provider, {
|
|
3091
|
+
value: dragOverridesContext,
|
|
3092
|
+
children: /* @__PURE__ */ jsx10(VisualModeSettersContext.Provider, {
|
|
3093
|
+
value: settersContext,
|
|
3094
|
+
children: /* @__PURE__ */ jsx10(VisualModeBatchSettersContext.Provider, {
|
|
3095
|
+
value: batchSettersContext,
|
|
3096
|
+
children
|
|
3097
|
+
})
|
|
3098
|
+
})
|
|
2856
3099
|
})
|
|
2857
3100
|
})
|
|
2858
3101
|
})
|
|
@@ -2889,7 +3132,7 @@ var useRequireToBeInsideSeries = () => {
|
|
|
2889
3132
|
};
|
|
2890
3133
|
|
|
2891
3134
|
// src/use-premounting.ts
|
|
2892
|
-
import { useContext as
|
|
3135
|
+
import { useContext as useContext17, useMemo as useMemo12 } from "react";
|
|
2893
3136
|
|
|
2894
3137
|
// src/PremountContext.tsx
|
|
2895
3138
|
import { createContext as createContext17 } from "react";
|
|
@@ -2914,14 +3157,14 @@ var usePremounting = ({
|
|
|
2914
3157
|
styleWhilePostmounted,
|
|
2915
3158
|
hideWhilePremounted
|
|
2916
3159
|
}) => {
|
|
2917
|
-
const parentPremountContext =
|
|
3160
|
+
const parentPremountContext = useContext17(PremountContext);
|
|
2918
3161
|
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
2919
3162
|
const environment = useRemotionEnvironment();
|
|
2920
3163
|
const { fps } = useVideoConfig();
|
|
2921
3164
|
const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? premountFor ?? fps : premountFor ?? 0;
|
|
2922
3165
|
const effectivePostmountFor = postmountFor ?? 0;
|
|
2923
3166
|
const endExclusive = from + durationInFrames;
|
|
2924
|
-
const sequenceContext =
|
|
3167
|
+
const sequenceContext = useContext17(SequenceContext);
|
|
2925
3168
|
const boundaryTolerance = getSequenceBoundaryTolerance({
|
|
2926
3169
|
absoluteFrame: useTimelinePosition(),
|
|
2927
3170
|
cumulatedFrom: sequenceContext ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom : 0,
|
|
@@ -2965,13 +3208,13 @@ var usePremounting = ({
|
|
|
2965
3208
|
};
|
|
2966
3209
|
|
|
2967
3210
|
// src/use-sequence-registration.ts
|
|
2968
|
-
import { useContext as
|
|
3211
|
+
import { useContext as useContext18, useEffect as useEffect4, useRef as useRef5 } from "react";
|
|
2969
3212
|
var useSequenceRegistration = ({
|
|
2970
3213
|
getSequence,
|
|
2971
3214
|
id
|
|
2972
3215
|
}) => {
|
|
2973
|
-
const { registerSequence, unregisterSequence, updateSequence } =
|
|
2974
|
-
const registrationDisabled =
|
|
3216
|
+
const { registerSequence, unregisterSequence, updateSequence } = useContext18(SequenceManagerActionsContext);
|
|
3217
|
+
const registrationDisabled = useContext18(DisableSequenceRegistrationContext);
|
|
2975
3218
|
const getSequenceRef = useRef5(getSequence);
|
|
2976
3219
|
getSequenceRef.current = getSequence;
|
|
2977
3220
|
const lastRegisteredGetterRef = useRef5(null);
|
|
@@ -3004,7 +3247,7 @@ var useSequenceRegistration = ({
|
|
|
3004
3247
|
import React18, {
|
|
3005
3248
|
createContext as createContext19,
|
|
3006
3249
|
forwardRef as forwardRef2,
|
|
3007
|
-
useContext as
|
|
3250
|
+
useContext as useContext20,
|
|
3008
3251
|
useLayoutEffect as useLayoutEffect4,
|
|
3009
3252
|
useMemo as useMemo13,
|
|
3010
3253
|
useState as useState5
|
|
@@ -3044,7 +3287,7 @@ var deleteNestedKey = (obj, keysToRemove) => {
|
|
|
3044
3287
|
};
|
|
3045
3288
|
|
|
3046
3289
|
// src/effects/use-memoized-effects.ts
|
|
3047
|
-
import { useContext as
|
|
3290
|
+
import { useContext as useContext19, useLayoutEffect as useLayoutEffect3, useRef as useRef6 } from "react";
|
|
3048
3291
|
|
|
3049
3292
|
// src/bezier.ts
|
|
3050
3293
|
var NEWTON_ITERATIONS = 4;
|
|
@@ -5040,6 +5283,7 @@ var OverrideIdsToNodePathsSettersContext = createContext18({
|
|
|
5040
5283
|
});
|
|
5041
5284
|
|
|
5042
5285
|
// src/effects/use-memoized-effects.ts
|
|
5286
|
+
var emptyDragOverrides2 = {};
|
|
5043
5287
|
var mergeOverrides = ({
|
|
5044
5288
|
descriptor,
|
|
5045
5289
|
propStatusOverrides,
|
|
@@ -5155,12 +5399,12 @@ var useMemoizedEffects = ({
|
|
|
5155
5399
|
overrideId
|
|
5156
5400
|
}) => {
|
|
5157
5401
|
const previousRef = useRef6(null);
|
|
5158
|
-
const { propStatuses } =
|
|
5159
|
-
const { getEffectDragOverrides } = useContext18(VisualModeDragOverridesContext);
|
|
5402
|
+
const { propStatuses } = useContext19(VisualModePropStatusesContext);
|
|
5160
5403
|
const frame = useCurrentFrame();
|
|
5161
|
-
const { overrideIdToNodePathMappings } =
|
|
5404
|
+
const { overrideIdToNodePathMappings } = useContext19(OverrideIdsToNodePathsGettersContext);
|
|
5162
5405
|
const previous = previousRef.current;
|
|
5163
5406
|
const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
|
|
5407
|
+
const effectDragOverrides = useEffectDragOverridesForNodePath(nodePath, effects.length);
|
|
5164
5408
|
const resolved = effects.map((descriptor, index) => {
|
|
5165
5409
|
if (nodePath === null) {
|
|
5166
5410
|
return {
|
|
@@ -5175,7 +5419,7 @@ var useMemoizedEffects = ({
|
|
|
5175
5419
|
effectIndex: index
|
|
5176
5420
|
});
|
|
5177
5421
|
const propStatusOverrides = effectStatus.type === "can-update-effect" ? resolvePropStatusOverrides(effectStatus.props, frame) : null;
|
|
5178
|
-
const dragOverridesMap =
|
|
5422
|
+
const dragOverridesMap = effectDragOverrides[index] ?? emptyDragOverrides2;
|
|
5179
5423
|
const dragOverrides = Object.keys(dragOverridesMap).length === 0 ? null : dragOverridesMap;
|
|
5180
5424
|
const { params, effectKey } = mergeOverrides({
|
|
5181
5425
|
descriptor,
|
|
@@ -5521,9 +5765,9 @@ var withInteractivitySchema = ({
|
|
|
5521
5765
|
} = props;
|
|
5522
5766
|
const cleanProps = propsWithoutInternalStack;
|
|
5523
5767
|
const env = useRemotionEnvironment();
|
|
5524
|
-
const canUseRemotionHooks =
|
|
5525
|
-
const disableInteractivity =
|
|
5526
|
-
const enableInteractivity =
|
|
5768
|
+
const canUseRemotionHooks = useContext20(CanUseRemotionHooks);
|
|
5769
|
+
const disableInteractivity = useContext20(DisableInteractivityContext);
|
|
5770
|
+
const enableInteractivity = useContext20(EnableInteractivityContext);
|
|
5527
5771
|
if (!env.isStudio && !enableInteractivity || env.isRendering || !canUseRemotionHooks || disableInteractivity) {
|
|
5528
5772
|
return React18.createElement(Component, {
|
|
5529
5773
|
...cleanProps,
|
|
@@ -5531,9 +5775,8 @@ var withInteractivitySchema = ({
|
|
|
5531
5775
|
ref
|
|
5532
5776
|
});
|
|
5533
5777
|
}
|
|
5534
|
-
const { propStatuses } =
|
|
5535
|
-
const
|
|
5536
|
-
const nodePathMapping = useContext19(OverrideIdsToNodePathsGettersContext);
|
|
5778
|
+
const { propStatuses } = useContext20(VisualModePropStatusesContext);
|
|
5779
|
+
const nodePathMapping = useContext20(OverrideIdsToNodePathsGettersContext);
|
|
5537
5780
|
const frame = useCurrentFrame();
|
|
5538
5781
|
const videoConfig = useUnsafeVideoConfig();
|
|
5539
5782
|
const durationInFrames = videoConfig?.durationInFrames;
|
|
@@ -5569,6 +5812,7 @@ var withInteractivitySchema = ({
|
|
|
5569
5812
|
return newOverrideId;
|
|
5570
5813
|
});
|
|
5571
5814
|
const nodePath = env.isReadOnlyStudio ? null : nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
|
|
5815
|
+
const dragOverrides = useDragOverridesForNodePath(nodePath);
|
|
5572
5816
|
const runtimeValues = flatKeys.map((key) => getRuntimeValueForSchemaKey({
|
|
5573
5817
|
flatSchema,
|
|
5574
5818
|
key,
|
|
@@ -5601,13 +5845,13 @@ var withInteractivitySchema = ({
|
|
|
5601
5845
|
return computeEffectiveSchemaValuesDotNotation({
|
|
5602
5846
|
schema: schemaWithSequenceName,
|
|
5603
5847
|
currentValue: currentRuntimeValueDotNotation,
|
|
5604
|
-
overrideValues:
|
|
5848
|
+
overrideValues: dragOverrides,
|
|
5605
5849
|
propStatus: nodePath === null ? undefined : getPropStatusesCtx(propStatuses, nodePath),
|
|
5606
5850
|
frame
|
|
5607
5851
|
});
|
|
5608
5852
|
}, [
|
|
5609
5853
|
currentRuntimeValueDotNotation,
|
|
5610
|
-
|
|
5854
|
+
dragOverrides,
|
|
5611
5855
|
nodePath,
|
|
5612
5856
|
propStatuses,
|
|
5613
5857
|
frame
|
|
@@ -5632,6 +5876,7 @@ var withInteractivitySchema = ({
|
|
|
5632
5876
|
|
|
5633
5877
|
// src/Sequence.tsx
|
|
5634
5878
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
5879
|
+
var SeriesContentVisibilityContext = createContext20(true);
|
|
5635
5880
|
var EMPTY_EFFECTS = [];
|
|
5636
5881
|
var RegularSequenceRefForwardingFunction = ({
|
|
5637
5882
|
from = 0,
|
|
@@ -5664,7 +5909,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5664
5909
|
}, ref) => {
|
|
5665
5910
|
const { layout = "absolute-fill" } = other;
|
|
5666
5911
|
const [id] = useState6(() => String(Math.random()));
|
|
5667
|
-
const parentSequence =
|
|
5912
|
+
const parentSequence = useContext21(SequenceContext);
|
|
5668
5913
|
const parentPlaybackRate = parentSequence?.playbackRate ?? 1;
|
|
5669
5914
|
const cumulativePlaybackRate = parentPlaybackRate * playbackRate;
|
|
5670
5915
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
@@ -5764,8 +6009,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5764
6009
|
const relativeFrom = effectiveRelativeFrom / parentPlaybackRate;
|
|
5765
6010
|
const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + relativeFrom;
|
|
5766
6011
|
const localClockEnd = loopPeriod === null ? actualDurationInFrames * playbackRate + trimBefore : Math.min(loopPeriod, actualDurationInFrames - loopOffset) * playbackRate + trimBefore;
|
|
5767
|
-
const sequenceRegistrationEnabled =
|
|
5768
|
-
const canvasOutlinesEnabled =
|
|
6012
|
+
const sequenceRegistrationEnabled = useContext21(SequenceRegistrationContext);
|
|
6013
|
+
const canvasOutlinesEnabled = useContext21(SequenceOutlineContext);
|
|
5769
6014
|
const env = useRemotionEnvironment();
|
|
5770
6015
|
const shouldDiscoverOutline = env.isStudio || canvasOutlinesEnabled;
|
|
5771
6016
|
const automaticOutlineRef = useMemo14(() => shouldDiscoverOutline && layout === "none" && !passedRefForOutline ? SequenceOutlineInternals.createRef() : null, [shouldDiscoverOutline, layout, passedRefForOutline]);
|
|
@@ -5838,7 +6083,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5838
6083
|
return name ?? "";
|
|
5839
6084
|
}, [name]);
|
|
5840
6085
|
const resolvedDocumentationLink = documentationLink ?? "https://www.remotion.dev/docs/sequence";
|
|
5841
|
-
const isInsideSeries =
|
|
6086
|
+
const isInsideSeries = useContext21(IsInsideSeriesContext);
|
|
5842
6087
|
const stackRef = useRef7(null);
|
|
5843
6088
|
stackRef.current = controls ? getStackForControls(controls) ?? stack ?? null : stack ?? null;
|
|
5844
6089
|
const registeredFrozenFrame = typeof freeze === "number" ? freeze : null;
|
|
@@ -5854,6 +6099,11 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5854
6099
|
const controlsComponentIdentity = controls?.componentIdentity;
|
|
5855
6100
|
const controlsComponentName = controls?.componentName;
|
|
5856
6101
|
const controlsVideoConfigValues = controls?.videoConfigValues;
|
|
6102
|
+
const isInsideNonPremountFreeze = useIsInsideNonPremountFreeze();
|
|
6103
|
+
const canInferDuration = (controlsComponentIdentity === "dev.remotion.remotion.Series" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries") && !loop && registeredFrozenFrame === null && !isInsideNonPremountFreeze && !hidden;
|
|
6104
|
+
const autoDuration = canInferDuration && durationInFrames === undefined;
|
|
6105
|
+
const isSeriesChild = controlsComponentIdentity === "dev.remotion.remotion.Series.Sequence" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Sequence" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Transition" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Overlay";
|
|
6106
|
+
const seriesContentVisible = useContext21(SeriesContentVisibilityContext);
|
|
5857
6107
|
const effectRuntimeValues = useMemo14(() => _remotionInternalEffects?.runtimeValues ?? null, [_remotionInternalEffects]);
|
|
5858
6108
|
const registrationControls = useMemo14(() => {
|
|
5859
6109
|
if (controlsSchema === undefined || controlsRuntimeValues === undefined || controlsOverrideId === undefined || controlsSupportsEffects === undefined || controlsComponentIdentity === undefined || controlsComponentName === undefined || controlsVideoConfigValues === undefined) {
|
|
@@ -5944,6 +6194,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5944
6194
|
sequencePlaybackRate: playbackRate,
|
|
5945
6195
|
trimBefore: registeredTrimBefore,
|
|
5946
6196
|
duration: actualDurationInFrames,
|
|
6197
|
+
...autoDuration ? { autoDuration: true } : {},
|
|
6198
|
+
...canInferDuration ? { canInferDuration: true } : {},
|
|
6199
|
+
...isSeriesChild ? { unclippedDuration: effectiveDurationInFrames } : {},
|
|
5947
6200
|
id,
|
|
5948
6201
|
displayName: timelineClipName,
|
|
5949
6202
|
documentationLink: resolvedDocumentationLink,
|
|
@@ -5969,6 +6222,10 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
5969
6222
|
playbackRate,
|
|
5970
6223
|
parentSequence?.id,
|
|
5971
6224
|
actualDurationInFrames,
|
|
6225
|
+
autoDuration,
|
|
6226
|
+
canInferDuration,
|
|
6227
|
+
isSeriesChild,
|
|
6228
|
+
effectiveDurationInFrames,
|
|
5972
6229
|
from,
|
|
5973
6230
|
registeredTrimBefore,
|
|
5974
6231
|
showInTimeline,
|
|
@@ -6000,7 +6257,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6000
6257
|
parentPlaybackRate,
|
|
6001
6258
|
durationInFrames: effectiveDurationInFrames
|
|
6002
6259
|
});
|
|
6003
|
-
const content2 = frameInParent - from < -boundaryTolerance ? null : frameInParent - endThreshold >= -boundaryTolerance ? null : children;
|
|
6260
|
+
const content2 = !seriesContentVisible || frameInParent - from < -boundaryTolerance ? null : frameInParent - endThreshold >= -boundaryTolerance ? null : children;
|
|
6004
6261
|
const frozenContent = content2 === null || typeof freeze === "undefined" || freeze === null ? content2 : /* @__PURE__ */ jsx12(Freeze, {
|
|
6005
6262
|
frame: freeze,
|
|
6006
6263
|
children: content2
|
|
@@ -6046,14 +6303,19 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6046
6303
|
children: null
|
|
6047
6304
|
}) : null;
|
|
6048
6305
|
}
|
|
6306
|
+
const retainSeriesRegistration = env.isStudio && canInferDuration;
|
|
6307
|
+
const sequenceContent = loopedContent === null ? retainSeriesRegistration ? children : null : other.layout === "none" ? loopedContent : /* @__PURE__ */ jsx12(AbsoluteFillElement, {
|
|
6308
|
+
ref: sequenceRef,
|
|
6309
|
+
style: defaultStyle,
|
|
6310
|
+
className: other.className,
|
|
6311
|
+
children: loopedContent
|
|
6312
|
+
});
|
|
6049
6313
|
const sequence = /* @__PURE__ */ jsx12(SequenceContext.Provider, {
|
|
6050
6314
|
value: contextValue,
|
|
6051
|
-
children:
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
children: loopedContent
|
|
6056
|
-
})
|
|
6315
|
+
children: retainSeriesRegistration ? /* @__PURE__ */ jsx12(SeriesContentVisibilityContext.Provider, {
|
|
6316
|
+
value: content2 !== null,
|
|
6317
|
+
children: sequenceContent
|
|
6318
|
+
}) : sequenceContent
|
|
6057
6319
|
});
|
|
6058
6320
|
return shouldDiscoverOutline ? /* @__PURE__ */ jsx12(SequenceOrderMarker, {
|
|
6059
6321
|
sequenceId: id,
|
|
@@ -7409,11 +7671,11 @@ var createEffect = (definition) => {
|
|
|
7409
7671
|
return factory;
|
|
7410
7672
|
};
|
|
7411
7673
|
// src/Artifact.tsx
|
|
7412
|
-
import { useContext as
|
|
7674
|
+
import { useContext as useContext22, useLayoutEffect as useLayoutEffect7, useState as useState9 } from "react";
|
|
7413
7675
|
|
|
7414
7676
|
// src/RenderAssetManager.tsx
|
|
7415
7677
|
import {
|
|
7416
|
-
createContext as
|
|
7678
|
+
createContext as createContext21,
|
|
7417
7679
|
useCallback as useCallback9,
|
|
7418
7680
|
useImperativeHandle as useImperativeHandle3,
|
|
7419
7681
|
useLayoutEffect as useLayoutEffect6,
|
|
@@ -7455,7 +7717,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
7455
7717
|
|
|
7456
7718
|
// src/RenderAssetManager.tsx
|
|
7457
7719
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
7458
|
-
var RenderAssetManager =
|
|
7720
|
+
var RenderAssetManager = createContext21({
|
|
7459
7721
|
registerRenderAsset: () => {
|
|
7460
7722
|
return;
|
|
7461
7723
|
},
|
|
@@ -7514,7 +7776,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
7514
7776
|
// src/Artifact.tsx
|
|
7515
7777
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
7516
7778
|
var Artifact = ({ filename, content: content2, downloadBehavior }) => {
|
|
7517
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
7779
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext22(RenderAssetManager);
|
|
7518
7780
|
const env = useRemotionEnvironment();
|
|
7519
7781
|
const frame = useCurrentFrame();
|
|
7520
7782
|
const [id] = useState9(() => {
|
|
@@ -7571,7 +7833,7 @@ var Artifact = ({ filename, content: content2, downloadBehavior }) => {
|
|
|
7571
7833
|
};
|
|
7572
7834
|
Artifact.Thumbnail = ArtifactThumbnail;
|
|
7573
7835
|
// src/audio/html5-audio.tsx
|
|
7574
|
-
import { forwardRef as forwardRef7, useCallback as useCallback16, useContext as
|
|
7836
|
+
import { forwardRef as forwardRef7, useCallback as useCallback16, useContext as useContext37 } from "react";
|
|
7575
7837
|
|
|
7576
7838
|
// src/absolute-src.ts
|
|
7577
7839
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -7613,9 +7875,9 @@ var getMediaTrimAfter = ({
|
|
|
7613
7875
|
};
|
|
7614
7876
|
|
|
7615
7877
|
// src/loop/index.tsx
|
|
7616
|
-
import React22, { createContext as
|
|
7878
|
+
import React22, { createContext as createContext22, useContext as useContext23, useMemo as useMemo19 } from "react";
|
|
7617
7879
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
7618
|
-
var LoopTimelineContext =
|
|
7880
|
+
var LoopTimelineContext = createContext22(null);
|
|
7619
7881
|
var useLoop = () => {
|
|
7620
7882
|
return React22.useContext(LoopContext);
|
|
7621
7883
|
};
|
|
@@ -7630,7 +7892,7 @@ var Loop = ({
|
|
|
7630
7892
|
}) => {
|
|
7631
7893
|
const currentFrame = useCurrentFrame();
|
|
7632
7894
|
const { durationInFrames: compDuration } = useVideoConfig();
|
|
7633
|
-
const parentSequence =
|
|
7895
|
+
const parentSequence = useContext23(SequenceContext);
|
|
7634
7896
|
const parentPlaybackRate = parentSequence?.playbackRate ?? 1;
|
|
7635
7897
|
const playbackRateValue = playbackRate ?? 1;
|
|
7636
7898
|
const iterationDurationInFrames = durationInFrames / playbackRateValue;
|
|
@@ -7702,7 +7964,7 @@ var Loop = ({
|
|
|
7702
7964
|
Loop.useLoop = useLoop;
|
|
7703
7965
|
|
|
7704
7966
|
// src/prefetch.ts
|
|
7705
|
-
import { useContext as
|
|
7967
|
+
import { useContext as useContext24 } from "react";
|
|
7706
7968
|
|
|
7707
7969
|
// src/playback-logging.ts
|
|
7708
7970
|
var playbackLogging = ({
|
|
@@ -7716,9 +7978,9 @@ var playbackLogging = ({
|
|
|
7716
7978
|
};
|
|
7717
7979
|
|
|
7718
7980
|
// src/prefetch-state.tsx
|
|
7719
|
-
import { createContext as
|
|
7981
|
+
import { createContext as createContext23, useEffect as useEffect7, useState as useState10 } from "react";
|
|
7720
7982
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
7721
|
-
var PreloadContext =
|
|
7983
|
+
var PreloadContext = createContext23({});
|
|
7722
7984
|
var preloads = {};
|
|
7723
7985
|
var updaters = [];
|
|
7724
7986
|
var setPreloads = (updater) => {
|
|
@@ -7758,7 +8020,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
7758
8020
|
return src.slice(0, hashIndex);
|
|
7759
8021
|
};
|
|
7760
8022
|
var usePreload = (src) => {
|
|
7761
|
-
const preloads2 =
|
|
8023
|
+
const preloads2 = useContext24(PreloadContext);
|
|
7762
8024
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
7763
8025
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
7764
8026
|
if (!preloads2[withoutHashFragment]) {
|
|
@@ -8043,7 +8305,7 @@ var resolveTrimProps = ({
|
|
|
8043
8305
|
};
|
|
8044
8306
|
|
|
8045
8307
|
// src/video/duration-state.tsx
|
|
8046
|
-
import { createContext as
|
|
8308
|
+
import { createContext as createContext24, useMemo as useMemo20, useReducer } from "react";
|
|
8047
8309
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
8048
8310
|
var durationReducer = (state, action) => {
|
|
8049
8311
|
switch (action.type) {
|
|
@@ -8061,7 +8323,7 @@ var durationReducer = (state, action) => {
|
|
|
8061
8323
|
return state;
|
|
8062
8324
|
}
|
|
8063
8325
|
};
|
|
8064
|
-
var DurationsContext =
|
|
8326
|
+
var DurationsContext = createContext24({
|
|
8065
8327
|
durations: {},
|
|
8066
8328
|
setDurations: () => {
|
|
8067
8329
|
throw new Error("context missing");
|
|
@@ -8085,7 +8347,7 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
8085
8347
|
import { useCallback as useCallback15 } from "react";
|
|
8086
8348
|
import React28, {
|
|
8087
8349
|
forwardRef as forwardRef5,
|
|
8088
|
-
useContext as
|
|
8350
|
+
useContext as useContext34,
|
|
8089
8351
|
useEffect as useEffect14,
|
|
8090
8352
|
useImperativeHandle as useImperativeHandle4,
|
|
8091
8353
|
useMemo as useMemo28,
|
|
@@ -8146,14 +8408,14 @@ var random = (seed, dummy) => {
|
|
|
8146
8408
|
};
|
|
8147
8409
|
|
|
8148
8410
|
// src/use-amplification.ts
|
|
8149
|
-
import { useContext as
|
|
8411
|
+
import { useContext as useContext26, useLayoutEffect as useLayoutEffect8, useRef as useRef15 } from "react";
|
|
8150
8412
|
|
|
8151
8413
|
// src/audio/shared-audio-tags.tsx
|
|
8152
8414
|
import React25, {
|
|
8153
|
-
createContext as
|
|
8415
|
+
createContext as createContext25,
|
|
8154
8416
|
createRef as createRef2,
|
|
8155
8417
|
useCallback as useCallback10,
|
|
8156
|
-
useContext as
|
|
8418
|
+
useContext as useContext25,
|
|
8157
8419
|
useEffect as useEffect8,
|
|
8158
8420
|
useMemo as useMemo22,
|
|
8159
8421
|
useRef as useRef13,
|
|
@@ -8435,8 +8697,8 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
8435
8697
|
}
|
|
8436
8698
|
return true;
|
|
8437
8699
|
};
|
|
8438
|
-
var SharedAudioContext =
|
|
8439
|
-
var SharedAudioTagsContext =
|
|
8700
|
+
var SharedAudioContext = createContext25(null);
|
|
8701
|
+
var SharedAudioTagsContext = createContext25(null);
|
|
8440
8702
|
var shouldSaveForLater = (state) => {
|
|
8441
8703
|
if (state === "suspended" || state === "running-to-suspended" || state === "interrupted") {
|
|
8442
8704
|
return true;
|
|
@@ -8679,7 +8941,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
8679
8941
|
const logLevel = useLogLevel();
|
|
8680
8942
|
const mountTime = useMountTime();
|
|
8681
8943
|
const env = useRemotionEnvironment();
|
|
8682
|
-
const audioCtx =
|
|
8944
|
+
const audioCtx = useContext25(SharedAudioContext);
|
|
8683
8945
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
8684
8946
|
const resume = audioCtx?.resume;
|
|
8685
8947
|
const [refs] = useState11(() => {
|
|
@@ -8862,8 +9124,8 @@ var useSharedAudio = ({
|
|
|
8862
9124
|
premounting,
|
|
8863
9125
|
postmounting
|
|
8864
9126
|
}) => {
|
|
8865
|
-
const audioCtx =
|
|
8866
|
-
const tagsCtx =
|
|
9127
|
+
const audioCtx = useContext25(SharedAudioContext);
|
|
9128
|
+
const tagsCtx = useContext25(SharedAudioTagsContext);
|
|
8867
9129
|
const [elem] = useState11(() => {
|
|
8868
9130
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
8869
9131
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
@@ -9052,7 +9314,7 @@ var useVolume = ({
|
|
|
9052
9314
|
const audioStuffRef = useRef15(null);
|
|
9053
9315
|
const currentVolumeRef = useRef15(volume);
|
|
9054
9316
|
currentVolumeRef.current = volume;
|
|
9055
|
-
const sharedAudioContext =
|
|
9317
|
+
const sharedAudioContext = useContext26(SharedAudioContext);
|
|
9056
9318
|
if (!sharedAudioContext) {
|
|
9057
9319
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
9058
9320
|
}
|
|
@@ -9118,19 +9380,19 @@ var useVolume = ({
|
|
|
9118
9380
|
};
|
|
9119
9381
|
|
|
9120
9382
|
// src/use-media-in-timeline.ts
|
|
9121
|
-
import { useCallback as useCallback11, useContext as
|
|
9383
|
+
import { useCallback as useCallback11, useContext as useContext28, useMemo as useMemo23 } from "react";
|
|
9122
9384
|
|
|
9123
9385
|
// src/audio/use-audio-frame.ts
|
|
9124
|
-
import { createContext as
|
|
9125
|
-
var Html5MediaTrimContext =
|
|
9386
|
+
import { createContext as createContext26, useContext as useContext27 } from "react";
|
|
9387
|
+
var Html5MediaTrimContext = createContext26(0);
|
|
9126
9388
|
var useMediaStartsAt = () => {
|
|
9127
|
-
const parentSequence =
|
|
9389
|
+
const parentSequence = useContext27(SequenceContext);
|
|
9128
9390
|
return parentSequence?.cumulatedNegativeFrom ?? 0;
|
|
9129
9391
|
};
|
|
9130
9392
|
var useFrameForVolumeProp = (behavior) => {
|
|
9131
9393
|
const loop = Loop.useLoop();
|
|
9132
|
-
const loopTimeline =
|
|
9133
|
-
const sequenceContext =
|
|
9394
|
+
const loopTimeline = useContext27(LoopTimelineContext);
|
|
9395
|
+
const sequenceContext = useContext27(SequenceContext);
|
|
9134
9396
|
const frame = useCurrentFrame();
|
|
9135
9397
|
const startsAt = useMediaStartsAt();
|
|
9136
9398
|
if (behavior === "repeat" || loop === null) {
|
|
@@ -9225,7 +9487,7 @@ var useBasicMediaInTimeline = ({
|
|
|
9225
9487
|
if (!src) {
|
|
9226
9488
|
throw new Error("No src passed");
|
|
9227
9489
|
}
|
|
9228
|
-
const parentSequence =
|
|
9490
|
+
const parentSequence = useContext28(SequenceContext);
|
|
9229
9491
|
const sequencePlaybackRate = parentSequence?.playbackRate ?? 1;
|
|
9230
9492
|
const duration = getTimelineDuration({
|
|
9231
9493
|
compositionDurationInFrames: sequenceDurationInFrames,
|
|
@@ -9303,14 +9565,14 @@ var useMediaInTimeline = ({
|
|
|
9303
9565
|
documentationLink,
|
|
9304
9566
|
muted
|
|
9305
9567
|
}) => {
|
|
9306
|
-
const parentSequence =
|
|
9307
|
-
const mediaTrimBefore =
|
|
9308
|
-
const sequenceRegistrationEnabled =
|
|
9568
|
+
const parentSequence = useContext28(SequenceContext);
|
|
9569
|
+
const mediaTrimBefore = useContext28(Html5MediaTrimContext);
|
|
9570
|
+
const sequenceRegistrationEnabled = useContext28(SequenceRegistrationContext);
|
|
9309
9571
|
const { durationInFrames } = useVideoConfig();
|
|
9310
9572
|
const mediaStartsAt = useMediaStartsAt();
|
|
9311
9573
|
const loopContext = Loop.useLoop();
|
|
9312
|
-
const loopTimeline =
|
|
9313
|
-
const canvasOutlinesEnabled =
|
|
9574
|
+
const loopTimeline = useContext28(LoopTimelineContext);
|
|
9575
|
+
const canvasOutlinesEnabled = useContext28(SequenceOutlineContext);
|
|
9314
9576
|
const { isStudio } = useRemotionEnvironment();
|
|
9315
9577
|
const automaticOutlineRef = useMemo23(() => mediaType === "video" && (isStudio || canvasOutlinesEnabled) ? SequenceOutlineInternals.createRef() : null, [canvasOutlinesEnabled, isStudio, mediaType]);
|
|
9316
9578
|
const {
|
|
@@ -9429,7 +9691,7 @@ var useMediaInTimeline = ({
|
|
|
9429
9691
|
// src/use-media-playback.ts
|
|
9430
9692
|
import {
|
|
9431
9693
|
useCallback as useCallback14,
|
|
9432
|
-
useContext as
|
|
9694
|
+
useContext as useContext31,
|
|
9433
9695
|
useEffect as useEffect12,
|
|
9434
9696
|
useLayoutEffect as useLayoutEffect10,
|
|
9435
9697
|
useRef as useRef18
|
|
@@ -9439,12 +9701,12 @@ import {
|
|
|
9439
9701
|
import { useCallback as useCallback13, useMemo as useMemo26, useRef as useRef16 } from "react";
|
|
9440
9702
|
|
|
9441
9703
|
// src/use-buffer-state.ts
|
|
9442
|
-
import { useContext as
|
|
9704
|
+
import { useContext as useContext30, useMemo as useMemo25 } from "react";
|
|
9443
9705
|
|
|
9444
9706
|
// src/buffering.tsx
|
|
9445
9707
|
import React26, {
|
|
9446
9708
|
useCallback as useCallback12,
|
|
9447
|
-
useContext as
|
|
9709
|
+
useContext as useContext29,
|
|
9448
9710
|
useEffect as useEffect9,
|
|
9449
9711
|
useLayoutEffect as useLayoutEffect9,
|
|
9450
9712
|
useMemo as useMemo24,
|
|
@@ -9509,8 +9771,8 @@ var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
|
9509
9771
|
};
|
|
9510
9772
|
var BufferingContextReact = React26.createContext(null);
|
|
9511
9773
|
var BufferingProvider = ({ children }) => {
|
|
9512
|
-
const { logLevel, mountTime } =
|
|
9513
|
-
const { isBuffering, setBuffering } =
|
|
9774
|
+
const { logLevel, mountTime } = useContext29(LogLevelContext);
|
|
9775
|
+
const { isBuffering, setBuffering } = useContext29(SetTimelineContext);
|
|
9514
9776
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime, setBuffering, isBuffering);
|
|
9515
9777
|
return /* @__PURE__ */ jsx21(BufferingContextReact.Provider, {
|
|
9516
9778
|
value: bufferManager,
|
|
@@ -9520,7 +9782,7 @@ var BufferingProvider = ({ children }) => {
|
|
|
9520
9782
|
|
|
9521
9783
|
// src/use-buffer-state.ts
|
|
9522
9784
|
var useBufferState = () => {
|
|
9523
|
-
const buffer =
|
|
9785
|
+
const buffer = useContext30(BufferingContextReact);
|
|
9524
9786
|
const logLevel = useLogLevel();
|
|
9525
9787
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
9526
9788
|
return useMemo25(() => ({
|
|
@@ -10043,7 +10305,7 @@ var useMediaPlayback = ({
|
|
|
10043
10305
|
const playing = usePlaying();
|
|
10044
10306
|
const playerBuffering = useBuffering();
|
|
10045
10307
|
const { fps } = useVideoConfig();
|
|
10046
|
-
const mediaTrimBefore =
|
|
10308
|
+
const mediaTrimBefore = useContext31(Html5MediaTrimContext);
|
|
10047
10309
|
const lastSeekDueToShift = useRef18(null);
|
|
10048
10310
|
const lastSeek = useRef18(null);
|
|
10049
10311
|
const logLevel = useLogLevel();
|
|
@@ -10089,7 +10351,7 @@ var useMediaPlayback = ({
|
|
|
10089
10351
|
logLevel,
|
|
10090
10352
|
mountTime
|
|
10091
10353
|
});
|
|
10092
|
-
const sequenceContext =
|
|
10354
|
+
const sequenceContext = useContext31(SequenceContext);
|
|
10093
10355
|
const playbackRate = localPlaybackRate * globalPlaybackRate * (sequenceContext?.playbackRate ?? 1);
|
|
10094
10356
|
const acceptableTimeShiftButLessThanDuration = (() => {
|
|
10095
10357
|
if (mediaRef.current?.duration) {
|
|
@@ -10253,7 +10515,7 @@ var useMediaPlayback = ({
|
|
|
10253
10515
|
};
|
|
10254
10516
|
|
|
10255
10517
|
// src/use-media-tag.ts
|
|
10256
|
-
import { useContext as
|
|
10518
|
+
import { useContext as useContext32, useEffect as useEffect13, useRef as useRef19 } from "react";
|
|
10257
10519
|
var useMediaTag = ({
|
|
10258
10520
|
mediaRef,
|
|
10259
10521
|
id,
|
|
@@ -10263,7 +10525,7 @@ var useMediaTag = ({
|
|
|
10263
10525
|
isPostmounting
|
|
10264
10526
|
}) => {
|
|
10265
10527
|
const { audioAndVideoTags, isPlaying } = useTimelineContext();
|
|
10266
|
-
const { subscribePlaying } =
|
|
10528
|
+
const { subscribePlaying } = useContext32(SetTimelineContext);
|
|
10267
10529
|
const isPlayingRef = useRef19(isPlaying);
|
|
10268
10530
|
isPlayingRef.current = isPlaying;
|
|
10269
10531
|
const logLevel = useLogLevel();
|
|
@@ -10327,12 +10589,12 @@ var useMediaTag = ({
|
|
|
10327
10589
|
};
|
|
10328
10590
|
|
|
10329
10591
|
// src/volume-position-state.ts
|
|
10330
|
-
import { createContext as
|
|
10331
|
-
var MediaVolumeContext =
|
|
10592
|
+
import { createContext as createContext27, useContext as useContext33, useMemo as useMemo27 } from "react";
|
|
10593
|
+
var MediaVolumeContext = createContext27({
|
|
10332
10594
|
playerMuted: false,
|
|
10333
10595
|
mediaVolume: 1
|
|
10334
10596
|
});
|
|
10335
|
-
var SetMediaVolumeContext =
|
|
10597
|
+
var SetMediaVolumeContext = createContext27({
|
|
10336
10598
|
setPlayerMuted: () => {
|
|
10337
10599
|
throw new Error("default");
|
|
10338
10600
|
},
|
|
@@ -10341,15 +10603,15 @@ var SetMediaVolumeContext = createContext26({
|
|
|
10341
10603
|
}
|
|
10342
10604
|
});
|
|
10343
10605
|
var useMediaVolumeState = () => {
|
|
10344
|
-
const { mediaVolume } =
|
|
10345
|
-
const { setMediaVolume } =
|
|
10606
|
+
const { mediaVolume } = useContext33(MediaVolumeContext);
|
|
10607
|
+
const { setMediaVolume } = useContext33(SetMediaVolumeContext);
|
|
10346
10608
|
return useMemo27(() => {
|
|
10347
10609
|
return [mediaVolume, setMediaVolume];
|
|
10348
10610
|
}, [mediaVolume, setMediaVolume]);
|
|
10349
10611
|
};
|
|
10350
10612
|
var usePlayerMutedState = () => {
|
|
10351
|
-
const { playerMuted } =
|
|
10352
|
-
const { setPlayerMuted } =
|
|
10613
|
+
const { playerMuted } = useContext33(MediaVolumeContext);
|
|
10614
|
+
const { setPlayerMuted } = useContext33(SetMediaVolumeContext);
|
|
10353
10615
|
return useMemo27(() => {
|
|
10354
10616
|
return [playerMuted, setPlayerMuted];
|
|
10355
10617
|
}, [playerMuted, setPlayerMuted]);
|
|
@@ -10439,7 +10701,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
10439
10701
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
10440
10702
|
}
|
|
10441
10703
|
const preloadedSrc = usePreload(src);
|
|
10442
|
-
const sequenceContext =
|
|
10704
|
+
const sequenceContext = useContext34(SequenceContext);
|
|
10443
10705
|
const { isStudio } = useRemotionEnvironment();
|
|
10444
10706
|
const [timelineId] = useState14(() => String(Math.random()));
|
|
10445
10707
|
const userPreferredVolume = evaluateVolume({
|
|
@@ -10593,7 +10855,7 @@ var AudioForPreview = forwardRef5(AudioForDevelopmentForwardRefFunction);
|
|
|
10593
10855
|
// src/audio/AudioForRendering.tsx
|
|
10594
10856
|
import {
|
|
10595
10857
|
forwardRef as forwardRef6,
|
|
10596
|
-
useContext as
|
|
10858
|
+
useContext as useContext36,
|
|
10597
10859
|
useEffect as useEffect15,
|
|
10598
10860
|
useImperativeHandle as useImperativeHandle5,
|
|
10599
10861
|
useLayoutEffect as useLayoutEffect11,
|
|
@@ -10602,11 +10864,11 @@ import {
|
|
|
10602
10864
|
} from "react";
|
|
10603
10865
|
|
|
10604
10866
|
// src/use-media-enabled.tsx
|
|
10605
|
-
import { createContext as
|
|
10867
|
+
import { createContext as createContext28, useContext as useContext35, useMemo as useMemo29 } from "react";
|
|
10606
10868
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10607
|
-
var MediaEnabledContext =
|
|
10869
|
+
var MediaEnabledContext = createContext28(null);
|
|
10608
10870
|
var useVideoEnabled = () => {
|
|
10609
|
-
const context =
|
|
10871
|
+
const context = useContext35(MediaEnabledContext);
|
|
10610
10872
|
if (!context) {
|
|
10611
10873
|
return window.remotion_videoEnabled;
|
|
10612
10874
|
}
|
|
@@ -10616,7 +10878,7 @@ var useVideoEnabled = () => {
|
|
|
10616
10878
|
return context.videoEnabled;
|
|
10617
10879
|
};
|
|
10618
10880
|
var useAudioEnabled = () => {
|
|
10619
|
-
const context =
|
|
10881
|
+
const context = useContext35(MediaEnabledContext);
|
|
10620
10882
|
if (!context) {
|
|
10621
10883
|
return window.remotion_audioEnabled;
|
|
10622
10884
|
}
|
|
@@ -10663,10 +10925,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
10663
10925
|
const absoluteFrame = useTimelinePosition();
|
|
10664
10926
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
10665
10927
|
const frame = useCurrentFrame();
|
|
10666
|
-
const sequenceContext =
|
|
10928
|
+
const sequenceContext = useContext36(SequenceContext);
|
|
10667
10929
|
const sequencePlaybackRate = sequenceContext?.playbackRate ?? 1;
|
|
10668
|
-
const audioStartFrame =
|
|
10669
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
10930
|
+
const audioStartFrame = useContext36(Html5MediaTrimContext);
|
|
10931
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
|
|
10670
10932
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
10671
10933
|
const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
10672
10934
|
props.src,
|
|
@@ -10779,7 +11041,7 @@ var AudioForRendering = forwardRef6(AudioForRenderingRefForwardingFunction);
|
|
|
10779
11041
|
// src/audio/html5-audio.tsx
|
|
10780
11042
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
10781
11043
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
10782
|
-
const audioTagsContext =
|
|
11044
|
+
const audioTagsContext = useContext37(SharedAudioTagsContext);
|
|
10783
11045
|
const propsWithFreeze = props;
|
|
10784
11046
|
const {
|
|
10785
11047
|
startFrom,
|
|
@@ -10805,7 +11067,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
10805
11067
|
if (typeof freeze !== "undefined") {
|
|
10806
11068
|
throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');
|
|
10807
11069
|
}
|
|
10808
|
-
const { durations, setDurations } =
|
|
11070
|
+
const { durations, setDurations } = useContext37(DurationsContext);
|
|
10809
11071
|
if (typeof props.src !== "string") {
|
|
10810
11072
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
10811
11073
|
}
|
|
@@ -11191,10 +11453,10 @@ Solid.displayName = "Solid";
|
|
|
11191
11453
|
addSequenceStackTraces(Solid);
|
|
11192
11454
|
// src/HtmlInCanvas.tsx
|
|
11193
11455
|
import {
|
|
11194
|
-
createContext as
|
|
11456
|
+
createContext as createContext29,
|
|
11195
11457
|
forwardRef as forwardRef9,
|
|
11196
11458
|
useCallback as useCallback18,
|
|
11197
|
-
useContext as
|
|
11459
|
+
useContext as useContext38,
|
|
11198
11460
|
useLayoutEffect as useLayoutEffect12,
|
|
11199
11461
|
useMemo as useMemo32,
|
|
11200
11462
|
useRef as useRef23
|
|
@@ -11223,6 +11485,14 @@ var isHtmlInCanvasSupported = () => {
|
|
|
11223
11485
|
cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function" && "transferControlToOffscreen" in HTMLCanvasElement.prototype;
|
|
11224
11486
|
return cachedSupport;
|
|
11225
11487
|
};
|
|
11488
|
+
var MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS = 157;
|
|
11489
|
+
var isHtmlInCanvasNestingSupported = () => {
|
|
11490
|
+
if (!isHtmlInCanvasSupported() || typeof navigator === "undefined") {
|
|
11491
|
+
return false;
|
|
11492
|
+
}
|
|
11493
|
+
const chromeVersion = navigator.userAgent.match(/(?:Chrome|Chromium)\/(\d+)/)?.[1];
|
|
11494
|
+
return chromeVersion !== undefined && Number(chromeVersion) >= MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS;
|
|
11495
|
+
};
|
|
11226
11496
|
var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas requires Chrome 149 or newer with Canvas Draw Element enabled at chrome://flags/#canvas-draw-element.";
|
|
11227
11497
|
var getHtmlInCanvasUnsupportedMessage = () => {
|
|
11228
11498
|
if (typeof document === "undefined") {
|
|
@@ -11298,7 +11568,7 @@ var defaultOnPaint = ({
|
|
|
11298
11568
|
ctx.reset();
|
|
11299
11569
|
ctx.drawElementImage(elementImage, 0, 0);
|
|
11300
11570
|
};
|
|
11301
|
-
var HtmlInCanvasAncestorContext =
|
|
11571
|
+
var HtmlInCanvasAncestorContext = createContext29(false);
|
|
11302
11572
|
var HtmlInCanvasContent = forwardRef9(({
|
|
11303
11573
|
width,
|
|
11304
11574
|
height,
|
|
@@ -11311,10 +11581,10 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
11311
11581
|
controls,
|
|
11312
11582
|
style
|
|
11313
11583
|
}, ref) => {
|
|
11314
|
-
const isInsideAncestorHtmlInCanvas =
|
|
11584
|
+
const isInsideAncestorHtmlInCanvas = useContext38(HtmlInCanvasAncestorContext);
|
|
11315
11585
|
assertHtmlInCanvasDimensions(width, height);
|
|
11316
|
-
if (isInsideAncestorHtmlInCanvas) {
|
|
11317
|
-
throw new Error(
|
|
11586
|
+
if (isInsideAncestorHtmlInCanvas && !isHtmlInCanvasNestingSupported()) {
|
|
11587
|
+
throw new Error(`Nested <HtmlInCanvas> components require Chrome ${MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS} or newer with HTML-in-canvas enabled.`);
|
|
11318
11588
|
}
|
|
11319
11589
|
const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
|
|
11320
11590
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
@@ -11690,7 +11960,8 @@ var HtmlInCanvasWrapped = withInteractivitySchema({
|
|
|
11690
11960
|
supportsEffects: true
|
|
11691
11961
|
});
|
|
11692
11962
|
var HtmlInCanvas = Object.assign(HtmlInCanvasWrapped, {
|
|
11693
|
-
isSupported: isHtmlInCanvasSupported
|
|
11963
|
+
isSupported: isHtmlInCanvasSupported,
|
|
11964
|
+
isNestingSupported: isHtmlInCanvasNestingSupported
|
|
11694
11965
|
});
|
|
11695
11966
|
HtmlInCanvas.displayName = "HtmlInCanvas";
|
|
11696
11967
|
addSequenceStackTraces(HtmlInCanvas);
|
|
@@ -11698,7 +11969,7 @@ addSequenceStackTraces(HtmlInCanvas);
|
|
|
11698
11969
|
import {
|
|
11699
11970
|
forwardRef as forwardRef10,
|
|
11700
11971
|
useCallback as useCallback19,
|
|
11701
|
-
useContext as
|
|
11972
|
+
useContext as useContext39,
|
|
11702
11973
|
useImperativeHandle as useImperativeHandle7,
|
|
11703
11974
|
useLayoutEffect as useLayoutEffect13,
|
|
11704
11975
|
useMemo as useMemo33,
|
|
@@ -11844,7 +12115,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
11844
12115
|
effects,
|
|
11845
12116
|
overrideId: controls?.overrideId ?? null
|
|
11846
12117
|
});
|
|
11847
|
-
const sequenceContext =
|
|
12118
|
+
const sequenceContext = useContext39(SequenceContext);
|
|
11848
12119
|
const pendingLoadDelayRef = useRef24(null);
|
|
11849
12120
|
const [isLoadPending, setIsLoadPending] = useState16(false);
|
|
11850
12121
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
@@ -12249,7 +12520,7 @@ var IFrame = forwardRef11(IFrameRefForwarding);
|
|
|
12249
12520
|
// src/Img.tsx
|
|
12250
12521
|
import {
|
|
12251
12522
|
useCallback as useCallback21,
|
|
12252
|
-
useContext as
|
|
12523
|
+
useContext as useContext40,
|
|
12253
12524
|
useLayoutEffect as useLayoutEffect14,
|
|
12254
12525
|
useMemo as useMemo34,
|
|
12255
12526
|
useRef as useRef25,
|
|
@@ -12276,7 +12547,7 @@ var ImgContent = ({
|
|
|
12276
12547
|
const imageRef = useRef25(null);
|
|
12277
12548
|
const errors = useRef25({});
|
|
12278
12549
|
const { delayPlayback } = useBufferState();
|
|
12279
|
-
const sequenceContext =
|
|
12550
|
+
const sequenceContext = useContext40(SequenceContext);
|
|
12280
12551
|
const [isLoading, setIsLoading] = useState18(false);
|
|
12281
12552
|
const _propsValid = true;
|
|
12282
12553
|
if (!_propsValid) {
|
|
@@ -12686,7 +12957,7 @@ var Img = withInteractivitySchema({
|
|
|
12686
12957
|
});
|
|
12687
12958
|
addSequenceStackTraces(Img);
|
|
12688
12959
|
// src/Interactive.tsx
|
|
12689
|
-
import React35, { forwardRef as forwardRef12, useCallback as useCallback22, useContext as
|
|
12960
|
+
import React35, { forwardRef as forwardRef12, useCallback as useCallback22, useContext as useContext41 } from "react";
|
|
12690
12961
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
12691
12962
|
var sourcePathToIdentityPrefix = (packageName) => {
|
|
12692
12963
|
if (packageName === "remotion") {
|
|
@@ -12773,7 +13044,7 @@ var withSchema = (untypedOptions) => {
|
|
|
12773
13044
|
...rest
|
|
12774
13045
|
} = options;
|
|
12775
13046
|
const ComponentWrappedInSequence = forwardRef12((props2, ref) => {
|
|
12776
|
-
const { canvasContent, compositions } =
|
|
13047
|
+
const { canvasContent, compositions } = useContext41(CompositionManager);
|
|
12777
13048
|
const componentIdentity = resolveComponentIdentity(Wrapped);
|
|
12778
13049
|
const isCurrentComposition = compositions.some((composition) => canvasContent?.type === "composition" && composition.id === canvasContent.compositionId && composition.componentFromProps === componentIdentity);
|
|
12779
13050
|
const {
|
|
@@ -13789,7 +14060,7 @@ var setupEnvVariables = () => {
|
|
|
13789
14060
|
};
|
|
13790
14061
|
|
|
13791
14062
|
// src/use-pixel-density.ts
|
|
13792
|
-
import React41, { useContext as
|
|
14063
|
+
import React41, { useContext as useContext42 } from "react";
|
|
13793
14064
|
var PixelDensityContext = React41.createContext(null);
|
|
13794
14065
|
var getBrowserPixelDensity = () => {
|
|
13795
14066
|
if (typeof window === "undefined") {
|
|
@@ -13798,8 +14069,8 @@ var getBrowserPixelDensity = () => {
|
|
|
13798
14069
|
return window.devicePixelRatio || 1;
|
|
13799
14070
|
};
|
|
13800
14071
|
var usePixelDensity = (options) => {
|
|
13801
|
-
const pixelDensity =
|
|
13802
|
-
const canUseRemotionHooks =
|
|
14072
|
+
const pixelDensity = useContext42(PixelDensityContext);
|
|
14073
|
+
const canUseRemotionHooks = useContext42(CanUseRemotionHooks);
|
|
13803
14074
|
if (pixelDensity !== null) {
|
|
13804
14075
|
return pixelDensity;
|
|
13805
14076
|
}
|
|
@@ -13821,7 +14092,7 @@ import { useCallback as useCallback26 } from "react";
|
|
|
13821
14092
|
// src/video/OffthreadVideoForRendering.tsx
|
|
13822
14093
|
import {
|
|
13823
14094
|
useCallback as useCallback24,
|
|
13824
|
-
useContext as
|
|
14095
|
+
useContext as useContext43,
|
|
13825
14096
|
useEffect as useEffect18,
|
|
13826
14097
|
useLayoutEffect as useLayoutEffect16,
|
|
13827
14098
|
useMemo as useMemo37,
|
|
@@ -13864,10 +14135,10 @@ var OffthreadVideoForRendering = ({
|
|
|
13864
14135
|
const frame = useCurrentFrame();
|
|
13865
14136
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
13866
14137
|
const videoConfig = useUnsafeVideoConfig();
|
|
13867
|
-
const sequenceContext =
|
|
14138
|
+
const sequenceContext = useContext43(SequenceContext);
|
|
13868
14139
|
const sequencePlaybackRate = sequenceContext?.playbackRate ?? 1;
|
|
13869
|
-
const audioStartFrame =
|
|
13870
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
14140
|
+
const audioStartFrame = useContext43(Html5MediaTrimContext);
|
|
14141
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext43(RenderAssetManager);
|
|
13871
14142
|
if (!src) {
|
|
13872
14143
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
13873
14144
|
}
|
|
@@ -14049,7 +14320,7 @@ var OffthreadVideoForRendering = ({
|
|
|
14049
14320
|
import React43, {
|
|
14050
14321
|
forwardRef as forwardRef13,
|
|
14051
14322
|
useCallback as useCallback25,
|
|
14052
|
-
useContext as
|
|
14323
|
+
useContext as useContext44,
|
|
14053
14324
|
useEffect as useEffect20,
|
|
14054
14325
|
useImperativeHandle as useImperativeHandle9,
|
|
14055
14326
|
useMemo as useMemo38,
|
|
@@ -14105,7 +14376,7 @@ class MediaPlaybackError extends Error {
|
|
|
14105
14376
|
// src/video/VideoForPreview.tsx
|
|
14106
14377
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
14107
14378
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
14108
|
-
const context =
|
|
14379
|
+
const context = useContext44(SharedAudioContext);
|
|
14109
14380
|
if (!context) {
|
|
14110
14381
|
throw new Error("SharedAudioContext not found");
|
|
14111
14382
|
}
|
|
@@ -14162,7 +14433,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
14162
14433
|
}
|
|
14163
14434
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
14164
14435
|
const { fps, durationInFrames } = useVideoConfig();
|
|
14165
|
-
const parentSequence =
|
|
14436
|
+
const parentSequence = useContext44(SequenceContext);
|
|
14166
14437
|
const { isStudio } = useRemotionEnvironment();
|
|
14167
14438
|
const logLevel = useLogLevel();
|
|
14168
14439
|
const mountTime = useMountTime();
|
|
@@ -14688,11 +14959,14 @@ var Internals = {
|
|
|
14688
14959
|
CompositionSetters,
|
|
14689
14960
|
VisualModePropStatusesContext,
|
|
14690
14961
|
VisualModePropStatusesRefContext,
|
|
14962
|
+
VisualModeBatchSettersContext,
|
|
14691
14963
|
VisualModeDragOverridesContext,
|
|
14692
14964
|
VisualModeSettersContext,
|
|
14693
14965
|
SequenceManager,
|
|
14694
14966
|
SequenceManagerProvider,
|
|
14695
14967
|
SequenceManagerRefContext,
|
|
14968
|
+
useActiveFromDragOverrideKeys,
|
|
14969
|
+
useSequenceManagerSequences,
|
|
14696
14970
|
SequenceRegistrationContext,
|
|
14697
14971
|
DisableSequenceRegistrationProvider,
|
|
14698
14972
|
CommitOrderInternals,
|
|
@@ -15122,12 +15396,12 @@ var Still = (props2) => {
|
|
|
15122
15396
|
};
|
|
15123
15397
|
addSequenceStackTraces(Still);
|
|
15124
15398
|
// src/video/html5-video.tsx
|
|
15125
|
-
import { forwardRef as forwardRef16, useCallback as useCallback27, useContext as
|
|
15399
|
+
import { forwardRef as forwardRef16, useCallback as useCallback27, useContext as useContext46 } from "react";
|
|
15126
15400
|
|
|
15127
15401
|
// src/video/VideoForRendering.tsx
|
|
15128
15402
|
import {
|
|
15129
15403
|
forwardRef as forwardRef15,
|
|
15130
|
-
useContext as
|
|
15404
|
+
useContext as useContext45,
|
|
15131
15405
|
useEffect as useEffect21,
|
|
15132
15406
|
useImperativeHandle as useImperativeHandle10,
|
|
15133
15407
|
useLayoutEffect as useLayoutEffect17,
|
|
@@ -15283,14 +15557,14 @@ var VideoForRenderingForwardFunction = ({
|
|
|
15283
15557
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
15284
15558
|
const videoConfig = useUnsafeVideoConfig();
|
|
15285
15559
|
const videoRef = useRef28(null);
|
|
15286
|
-
const sequenceContext =
|
|
15560
|
+
const sequenceContext = useContext45(SequenceContext);
|
|
15287
15561
|
const sequencePlaybackRate = sequenceContext?.playbackRate ?? 1;
|
|
15288
|
-
const audioStartFrame =
|
|
15562
|
+
const audioStartFrame = useContext45(Html5MediaTrimContext);
|
|
15289
15563
|
const environment = useRemotionEnvironment();
|
|
15290
15564
|
const logLevel = useLogLevel();
|
|
15291
15565
|
const mountTime = useMountTime();
|
|
15292
15566
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
15293
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
15567
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext45(RenderAssetManager);
|
|
15294
15568
|
const id = useMemo41(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
15295
15569
|
props2.src,
|
|
15296
15570
|
sequenceContext?.cumulatedFrom,
|
|
@@ -15508,7 +15782,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
15508
15782
|
if (environment.isClientSideRendering) {
|
|
15509
15783
|
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");
|
|
15510
15784
|
}
|
|
15511
|
-
const { durations, setDurations } =
|
|
15785
|
+
const { durations, setDurations } = useContext46(DurationsContext);
|
|
15512
15786
|
if (typeof ref === "string") {
|
|
15513
15787
|
throw new Error("string refs are not supported");
|
|
15514
15788
|
}
|