remotion 4.0.535 → 4.0.537
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/AbsoluteFill.d.ts +1 -1
- package/dist/cjs/CompositionManagerContext.d.ts +3 -0
- package/dist/cjs/CompositionManagerContext.js +5 -3
- package/dist/cjs/CompositionManagerProvider.js +3 -1
- package/dist/cjs/HtmlInCanvas.d.ts +4 -2
- package/dist/cjs/HtmlInCanvas.js +70 -19
- package/dist/cjs/Img.d.ts +4 -2
- package/dist/cjs/Img.js +2 -2
- package/dist/cjs/Interactive.d.ts +21 -7
- package/dist/cjs/Interactive.js +22 -1
- package/dist/cjs/Sequence.js +47 -3
- package/dist/cjs/SequenceActivityBoundary.js +14 -1
- package/dist/cjs/SequenceActivityBudget.js +26 -11
- package/dist/cjs/SequenceActivitySuspensionProvider.d.ts +4 -0
- package/dist/cjs/SequenceActivitySuspensionProvider.js +45 -0
- package/dist/cjs/SequenceManager.d.ts +5 -0
- package/dist/cjs/SequenceManager.js +22 -4
- package/dist/cjs/Track.js +1 -2
- package/dist/cjs/animated-image/AnimatedImage.d.ts +3 -2
- package/dist/cjs/animated-image/AnimatedImage.js +17 -10
- package/dist/cjs/animated-image/canvas.d.ts +2 -1
- package/dist/cjs/animated-image/canvas.js +2 -2
- package/dist/cjs/animated-image/props.d.ts +2 -1
- package/dist/cjs/asset-types.d.ts +4 -0
- package/dist/cjs/audio/shared-audio-tags.d.ts +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +1 -1
- package/dist/cjs/canvas-image/CanvasImage.d.ts +3 -2
- package/dist/cjs/canvas-image/CanvasImage.js +4 -4
- package/dist/cjs/canvas-image/props.d.ts +2 -1
- package/dist/cjs/effects/Solid.d.ts +3 -2
- package/dist/cjs/effects/Solid.js +4 -4
- package/dist/cjs/effects/effect-types.d.ts +4 -0
- package/dist/cjs/effects/index.d.ts +1 -1
- package/dist/cjs/effects/run-effect-chain.d.ts +3 -1
- package/dist/cjs/effects/run-effect-chain.js +94 -56
- package/dist/cjs/effects/use-effect-chain-state.d.ts +2 -1
- package/dist/cjs/effects/use-effect-chain-state.js +11 -2
- package/dist/cjs/effects/use-memoized-effects.js +86 -44
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/interactivity-schema.d.ts +5 -5
- package/dist/cjs/interactivity-schema.js +2 -1
- package/dist/cjs/internals.d.ts +11 -10
- package/dist/cjs/internals.js +1 -1
- package/dist/cjs/interpolate.js +8 -1
- package/dist/cjs/no-react.d.ts +1 -1
- package/dist/cjs/sequence-activity-context.d.ts +1 -1
- package/dist/cjs/sequence-activity-context.js +4 -3
- package/dist/cjs/sequence-activity-defaults.d.ts +1 -1
- package/dist/cjs/sequence-activity-defaults.js +1 -1
- package/dist/cjs/timeline-position-state.d.ts +1 -0
- package/dist/cjs/timeline-position-state.js +21 -1
- package/dist/cjs/timeline-track-context.d.ts +0 -1
- package/dist/cjs/timeline-track-context.js +1 -2
- package/dist/cjs/use-current-frame.d.ts +1 -0
- package/dist/cjs/use-current-frame.js +14 -7
- package/dist/cjs/use-schema.js +3 -1
- package/dist/cjs/use-timeline-seek.d.ts +1 -0
- package/dist/cjs/use-timeline-seek.js +10 -0
- package/dist/cjs/validation/validate-duration-in-frames.js +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/seek-until-right.js +11 -7
- package/dist/cjs/with-interactivity-schema.js +18 -16
- package/dist/cjs/wrap-remotion-context.d.ts +0 -1
- package/dist/cjs/wrap-remotion-context.js +1 -4
- package/dist/esm/index.mjs +951 -720
- package/dist/esm/no-react.mjs +7 -6
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/cjs/nonce.d.ts +0 -11
- package/dist/cjs/nonce.js +0 -42
- package/dist/cjs/sequence-order-marker.d.ts +0 -58
- package/dist/cjs/sequence-order-marker.js +0 -44
|
@@ -2,8 +2,8 @@ import type { TimelineContextValue } from './TimelineContext.js';
|
|
|
2
2
|
export { DEFAULT_SEQUENCE_ACTIVITY_LIMIT } from './sequence-activity-defaults.js';
|
|
3
3
|
export declare const SequenceActivityContext: import("react").Context<boolean>;
|
|
4
4
|
export declare const SequenceActivityDormantContext: import("react").Context<boolean>;
|
|
5
|
+
export declare const SequenceActivitySuspensionContext: import("react").Context<boolean>;
|
|
5
6
|
export declare const SequenceActivitySettingsContext: import("react").Context<{
|
|
6
|
-
readonly enabled: boolean;
|
|
7
7
|
readonly limit: number;
|
|
8
8
|
} | null>;
|
|
9
9
|
export declare const SequenceActivityTimelineContext: import("react").Context<TimelineContextValue | null>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SequenceContent = exports.SequenceActivityAbsoluteTimeContext = exports.SequenceActivityTimelineContext = exports.SequenceActivitySettingsContext = exports.SequenceActivityDormantContext = exports.SequenceActivityContext = exports.DEFAULT_SEQUENCE_ACTIVITY_LIMIT = void 0;
|
|
3
|
+
exports.SequenceContent = exports.SequenceActivityAbsoluteTimeContext = exports.SequenceActivityTimelineContext = exports.SequenceActivitySettingsContext = exports.SequenceActivitySuspensionContext = exports.SequenceActivityDormantContext = exports.SequenceActivityContext = exports.DEFAULT_SEQUENCE_ACTIVITY_LIMIT = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const sequence_activity_defaults_js_1 = require("./sequence-activity-defaults.js");
|
|
6
6
|
Object.defineProperty(exports, "DEFAULT_SEQUENCE_ACTIVITY_LIMIT", { enumerable: true, get: function () { return sequence_activity_defaults_js_1.DEFAULT_SEQUENCE_ACTIVITY_LIMIT; } });
|
|
7
|
-
//
|
|
8
|
-
//
|
|
7
|
+
// Hidden Activity trees register on commit, so Sequence Activity is disabled
|
|
8
|
+
// when the sequence manager falls back to effects.
|
|
9
9
|
exports.SequenceActivityContext = (0, react_1.createContext)(false);
|
|
10
10
|
exports.SequenceActivityDormantContext = (0, react_1.createContext)(false);
|
|
11
|
+
exports.SequenceActivitySuspensionContext = (0, react_1.createContext)(false);
|
|
11
12
|
exports.SequenceActivitySettingsContext = (0, react_1.createContext)(null);
|
|
12
13
|
// React propagates changed ancestor contexts through hidden Activity trees,
|
|
13
14
|
// even when a nested provider keeps their value stable. Use separate context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DEFAULT_SEQUENCE_ACTIVITY_LIMIT
|
|
1
|
+
export declare const DEFAULT_SEQUENCE_ACTIVITY_LIMIT: number;
|
|
@@ -11,6 +11,7 @@ export declare const clampFrameToCompositionRange: (frame: number, durationInFra
|
|
|
11
11
|
export declare const useTimelineContext: () => TimelineContextValue;
|
|
12
12
|
export declare const usePlaybackRate: () => PlaybackRateContextValue;
|
|
13
13
|
export declare const useTimelinePosition: () => number;
|
|
14
|
+
export declare const useTimelinePositionWithOptionalSubscription: (subscribe: boolean) => number;
|
|
14
15
|
export declare const useIsInsideFreeze: () => boolean;
|
|
15
16
|
export declare const useAbsoluteTimelinePosition: () => number;
|
|
16
17
|
export declare const useTimelineSetFrameWithoutSeek: () => (u: import("react").SetStateAction<Record<string, number>>) => void;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useBuffering = exports.usePlaying = exports.useTimelineSeekFrame = exports.useTimelineSetFrameWithoutSeek = exports.useAbsoluteTimelinePosition = exports.useIsInsideFreeze = exports.useTimelinePosition = exports.usePlaybackRate = exports.useTimelineContext = exports.clampFrameToCompositionRange = exports.getFrameForComposition = exports.getInitialFrameState = exports.persistCurrentFrame = void 0;
|
|
3
|
+
exports.useBuffering = exports.usePlaying = exports.useTimelineSeekFrame = exports.useTimelineSetFrameWithoutSeek = exports.useAbsoluteTimelinePosition = exports.useIsInsideFreeze = exports.useTimelinePositionWithOptionalSubscription = exports.useTimelinePosition = exports.usePlaybackRate = exports.useTimelineContext = exports.clampFrameToCompositionRange = exports.getFrameForComposition = exports.getInitialFrameState = exports.persistCurrentFrame = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const sequence_activity_context_js_1 = require("./sequence-activity-context.js");
|
|
6
6
|
const TimelineContext_js_1 = require("./TimelineContext.js");
|
|
7
7
|
const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
|
|
8
8
|
const use_video_js_1 = require("./use-video.js");
|
|
9
|
+
// Reading TimelineContext and ignoring its value would still schedule frame
|
|
10
|
+
// updates. Inactive subscribers must read a separate, never-changing context.
|
|
11
|
+
const UnsubscribedTimelineContext = (0, react_1.createContext)(null);
|
|
9
12
|
const makeKey = () => {
|
|
10
13
|
return `remotion.time-all`;
|
|
11
14
|
};
|
|
@@ -42,6 +45,9 @@ const useTimelinePositionFromContext = (state) => {
|
|
|
42
45
|
const videoConfig = (0, use_video_js_1.useVideo)();
|
|
43
46
|
const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
|
|
44
47
|
const dormant = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityDormantContext);
|
|
48
|
+
if (state === null) {
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
45
51
|
if (!videoConfig) {
|
|
46
52
|
return typeof window === 'undefined'
|
|
47
53
|
? 0
|
|
@@ -76,6 +82,20 @@ const useTimelinePosition = () => {
|
|
|
76
82
|
return useTimelinePositionFromContext(state);
|
|
77
83
|
};
|
|
78
84
|
exports.useTimelinePosition = useTimelinePosition;
|
|
85
|
+
const useTimelinePositionWithOptionalSubscription = (subscribe) => {
|
|
86
|
+
const dormant = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityDormantContext);
|
|
87
|
+
const state = (0, react_1.useContext)(subscribe
|
|
88
|
+
? dormant
|
|
89
|
+
? sequence_activity_context_js_1.SequenceActivityTimelineContext
|
|
90
|
+
: TimelineContext_js_1.TimelineContext
|
|
91
|
+
: UnsubscribedTimelineContext);
|
|
92
|
+
const frame = useTimelinePositionFromContext(state);
|
|
93
|
+
if (subscribe && state === null) {
|
|
94
|
+
throw new Error('TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.');
|
|
95
|
+
}
|
|
96
|
+
return frame;
|
|
97
|
+
};
|
|
98
|
+
exports.useTimelinePositionWithOptionalSubscription = useTimelinePositionWithOptionalSubscription;
|
|
79
99
|
const useIsInsideFreeze = () => {
|
|
80
100
|
return (0, exports.useTimelineContext)().isInsideFreeze;
|
|
81
101
|
};
|
|
@@ -7,4 +7,3 @@ export type TimelineTrackItem = TimelineTrack & {
|
|
|
7
7
|
readonly seriesOffset: number | null;
|
|
8
8
|
};
|
|
9
9
|
export declare const TimelineTrackContext: import("react").Context<TimelineTrack | null>;
|
|
10
|
-
export declare const ExperimentalTracksEnabledContext: import("react").Context<boolean>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TimelineTrackContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
exports.TimelineTrackContext = (0, react_1.createContext)(null);
|
|
6
|
-
exports.ExperimentalTracksEnabledContext = (0, react_1.createContext)(false);
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCurrentFrame = void 0;
|
|
3
|
+
exports.useCurrentFrame = exports.useCurrentFrameWithOptionalSubscription = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js");
|
|
6
6
|
const SequenceContext_js_1 = require("./SequenceContext.js");
|
|
7
7
|
const timeline_position_state_js_1 = require("./timeline-position-state.js");
|
|
8
8
|
const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
|
|
9
|
-
|
|
10
|
-
* @description Retrieves the current frame of the video within a component. Frames are 0-indexed, and if the component is wrapped in a `<Sequence>`, it returns the frame relative to when the Sequence starts.
|
|
11
|
-
* @see [Documentation](https://www.remotion.dev/docs/use-current-frame)
|
|
12
|
-
*/
|
|
13
|
-
const useCurrentFrame = () => {
|
|
9
|
+
const useCurrentFrameWithOptionalSubscription = (subscribe) => {
|
|
14
10
|
var _a;
|
|
15
11
|
const canUseRemotionHooks = (0, react_1.useContext)(CanUseRemotionHooks_js_1.CanUseRemotionHooks);
|
|
16
12
|
const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
|
|
@@ -20,11 +16,22 @@ const useCurrentFrame = () => {
|
|
|
20
16
|
}
|
|
21
17
|
throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
|
|
22
18
|
}
|
|
23
|
-
const frame = (0, timeline_position_state_js_1.
|
|
19
|
+
const frame = (0, timeline_position_state_js_1.useTimelinePositionWithOptionalSubscription)(subscribe);
|
|
24
20
|
const context = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
21
|
+
if (!subscribe) {
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
25
24
|
const contextOffset = context
|
|
26
25
|
? context.cumulatedFrom + context.relativeFrom
|
|
27
26
|
: 0;
|
|
28
27
|
return (frame - contextOffset) * ((_a = context === null || context === void 0 ? void 0 : context.playbackRate) !== null && _a !== void 0 ? _a : 1);
|
|
29
28
|
};
|
|
29
|
+
exports.useCurrentFrameWithOptionalSubscription = useCurrentFrameWithOptionalSubscription;
|
|
30
|
+
/*
|
|
31
|
+
* @description Retrieves the current frame of the video within a component. Frames are 0-indexed, and if the component is wrapped in a `<Sequence>`, it returns the frame relative to when the Sequence starts.
|
|
32
|
+
* @see [Documentation](https://www.remotion.dev/docs/use-current-frame)
|
|
33
|
+
*/
|
|
34
|
+
const useCurrentFrame = () => {
|
|
35
|
+
return (0, exports.useCurrentFrameWithOptionalSubscription)(true);
|
|
36
|
+
};
|
|
30
37
|
exports.useCurrentFrame = useCurrentFrame;
|
package/dist/cjs/use-schema.js
CHANGED
|
@@ -106,7 +106,9 @@ const computeEffectiveSchemaValuesDotNotation = ({ schema, currentValue, overrid
|
|
|
106
106
|
: currentValue[key];
|
|
107
107
|
}
|
|
108
108
|
else if ((0, exports.isKeyframedStatus)(status)) {
|
|
109
|
-
|
|
109
|
+
// keyframable controls authoring new keyframes in Studio. Existing
|
|
110
|
+
// keyframes still need to follow the preview clock and drag overrides.
|
|
111
|
+
if ((field === null || field === void 0 ? void 0 : field.type) === 'array') {
|
|
110
112
|
value = currentValue[key];
|
|
111
113
|
}
|
|
112
114
|
else {
|
|
@@ -2,5 +2,6 @@ import type { RefObject, SetStateAction } from 'react';
|
|
|
2
2
|
export type TimelineSeek = {
|
|
3
3
|
readonly revision: RefObject<number>;
|
|
4
4
|
readonly seekFrame: (frame: SetStateAction<Record<string, number>>) => void;
|
|
5
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
5
6
|
};
|
|
6
7
|
export declare const useTimelineSeek: (setFrame: (frame: SetStateAction<Record<string, number>>) => void) => TimelineSeek;
|
|
@@ -6,13 +6,23 @@ const react_1 = require("react");
|
|
|
6
6
|
// outside the React updater: updaters may be deferred or run more than once.
|
|
7
7
|
const useTimelineSeek = (setFrame) => {
|
|
8
8
|
const revision = (0, react_1.useRef)(0);
|
|
9
|
+
const listeners = (0, react_1.useRef)(new Set());
|
|
9
10
|
return (0, react_1.useMemo)(() => ({
|
|
10
11
|
revision,
|
|
11
12
|
seekFrame: (frame) => {
|
|
12
13
|
// Even a same-frame seek is a boundary for the next media update.
|
|
13
14
|
revision.current++;
|
|
15
|
+
for (const listener of listeners.current) {
|
|
16
|
+
listener();
|
|
17
|
+
}
|
|
14
18
|
setFrame(frame);
|
|
15
19
|
},
|
|
20
|
+
subscribe: (listener) => {
|
|
21
|
+
listeners.current.add(listener);
|
|
22
|
+
return () => {
|
|
23
|
+
listeners.current.delete(listener);
|
|
24
|
+
};
|
|
25
|
+
},
|
|
16
26
|
}), [setFrame]);
|
|
17
27
|
};
|
|
18
28
|
exports.useTimelineSeek = useTimelineSeek;
|
|
@@ -12,10 +12,10 @@ function validateDurationInFrames(durationInFrames, options) {
|
|
|
12
12
|
if (durationInFrames <= 0) {
|
|
13
13
|
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
14
14
|
}
|
|
15
|
-
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
16
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
17
|
-
}
|
|
18
15
|
if (!Number.isFinite(durationInFrames)) {
|
|
19
16
|
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
20
17
|
}
|
|
18
|
+
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
19
|
+
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
20
|
+
}
|
|
21
21
|
}
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -13,13 +13,6 @@ const seekToTime = ({ element, desiredTime, logLevel, mountTime, }) => {
|
|
|
13
13
|
cancel: () => { },
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
(0, seek_1.seek)({
|
|
17
|
-
logLevel,
|
|
18
|
-
mediaRef: element,
|
|
19
|
-
time: desiredTime,
|
|
20
|
-
why: 'Seeking during rendering',
|
|
21
|
-
mountTime,
|
|
22
|
-
});
|
|
23
16
|
let cancel;
|
|
24
17
|
let cancelSeeked = null;
|
|
25
18
|
const prom = new Promise((resolve) => {
|
|
@@ -45,6 +38,17 @@ const seekToTime = ({ element, desiredTime, logLevel, mountTime, }) => {
|
|
|
45
38
|
element.removeEventListener('seeked', onDone);
|
|
46
39
|
};
|
|
47
40
|
});
|
|
41
|
+
// Register both listeners before seeking. The compositor can present the
|
|
42
|
+
// frame while the main thread is still setting currentTime. Registering a
|
|
43
|
+
// video frame callback afterwards would wait for another frame, which a
|
|
44
|
+
// paused video will never produce.
|
|
45
|
+
(0, seek_1.seek)({
|
|
46
|
+
logLevel,
|
|
47
|
+
mediaRef: element,
|
|
48
|
+
time: desiredTime,
|
|
49
|
+
why: 'Seeking during rendering',
|
|
50
|
+
mountTime,
|
|
51
|
+
});
|
|
48
52
|
return {
|
|
49
53
|
wait: Promise.all([prom, waitForSeekedEvent]).then(([time]) => time),
|
|
50
54
|
cancel: () => {
|
|
@@ -171,8 +171,6 @@ const withInteractivitySchema = ({ Component, componentName, componentIdentity =
|
|
|
171
171
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
172
172
|
const nodePathMapping = (0, react_1.useContext)(sequence_node_path_js_1.OverrideIdsToNodePathsGettersContext);
|
|
173
173
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
174
|
-
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
175
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
176
174
|
const videoConfig = (0, use_unsafe_video_config_js_1.useUnsafeVideoConfig)();
|
|
177
175
|
const durationInFrames = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames;
|
|
178
176
|
const fps = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.fps;
|
|
@@ -229,6 +227,22 @@ const withInteractivitySchema = ({ Component, componentName, componentIdentity =
|
|
|
229
227
|
: ((_a = nodePathMapping.overrideIdToNodePathMappings[overrideId]) !== null && _a !== void 0 ? _a : null);
|
|
230
228
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
231
229
|
const dragOverrides = (0, SequenceManager_js_1.useDragOverridesForNodePath)(nodePath);
|
|
230
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
231
|
+
const propStatus = (0, react_1.useMemo)(() => nodePath === null
|
|
232
|
+
? undefined
|
|
233
|
+
: (0, use_memoized_effects_js_1.getPropStatusesCtx)(propStatuses, {
|
|
234
|
+
...nodePath,
|
|
235
|
+
videoConfigValues,
|
|
236
|
+
}), [nodePath, propStatuses, videoConfigValues]);
|
|
237
|
+
// Runtime props already update through their owner. Only overrides with
|
|
238
|
+
// keyframes need this wrapper to subscribe to the advancing clock.
|
|
239
|
+
const needsFrame = flatKeys.some((key) => {
|
|
240
|
+
var _a, _b;
|
|
241
|
+
return ((_a = propStatus === null || propStatus === void 0 ? void 0 : propStatus[key]) === null || _a === void 0 ? void 0 : _a.status) === 'keyframed' ||
|
|
242
|
+
((_b = dragOverrides[key]) === null || _b === void 0 ? void 0 : _b.type) === 'keyframed';
|
|
243
|
+
});
|
|
244
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
245
|
+
const frame = (0, use_current_frame_js_1.useCurrentFrameWithOptionalSubscription)(needsFrame);
|
|
232
246
|
// Read the runtime values for every flat key from the JSX props,
|
|
233
247
|
// memoized on the leaf values so the object reference is stable
|
|
234
248
|
// when nothing changed — otherwise downstream `useMemo`s churn and
|
|
@@ -284,22 +298,10 @@ const withInteractivitySchema = ({ Component, componentName, componentIdentity =
|
|
|
284
298
|
schema: schemaWithSequenceName,
|
|
285
299
|
currentValue: currentRuntimeValueDotNotation,
|
|
286
300
|
overrideValues: dragOverrides,
|
|
287
|
-
propStatus
|
|
288
|
-
? undefined
|
|
289
|
-
: (0, use_memoized_effects_js_1.getPropStatusesCtx)(propStatuses, {
|
|
290
|
-
...nodePath,
|
|
291
|
-
videoConfigValues,
|
|
292
|
-
}),
|
|
301
|
+
propStatus,
|
|
293
302
|
frame,
|
|
294
303
|
});
|
|
295
|
-
}, [
|
|
296
|
-
currentRuntimeValueDotNotation,
|
|
297
|
-
dragOverrides,
|
|
298
|
-
nodePath,
|
|
299
|
-
propStatuses,
|
|
300
|
-
videoConfigValues,
|
|
301
|
-
frame,
|
|
302
|
-
]);
|
|
304
|
+
}, [currentRuntimeValueDotNotation, dragOverrides, propStatus, frame]);
|
|
303
305
|
// 4. Eliminate values forbidden by the resolved discriminated union.
|
|
304
306
|
const activeKeys = (0, exports.selectActiveKeys)(schemaWithSequenceName, valuesDotNotation);
|
|
305
307
|
// 5. Apply the active values back onto the props.
|
|
@@ -9,7 +9,6 @@ export declare function useRemotionContexts(): {
|
|
|
9
9
|
setTimelineContext: import("./TimelineContext.js").SetTimelineContextValue;
|
|
10
10
|
sequenceContext: import("./SequenceContext.js").SequenceContextType | null;
|
|
11
11
|
defaultPremountInSeconds: number;
|
|
12
|
-
experimentalTracksEnabled: boolean;
|
|
13
12
|
timelineTrackContext: import("./timeline-track-context.js").TimelineTrack | null;
|
|
14
13
|
canUseRemotionHooksContext: boolean;
|
|
15
14
|
preloadContext: {
|
|
@@ -62,7 +62,6 @@ function useRemotionContexts() {
|
|
|
62
62
|
const setTimelineContext = react_1.default.useContext(TimelineContext_js_1.SetTimelineContext);
|
|
63
63
|
const sequenceContext = react_1.default.useContext(SequenceContext_js_1.SequenceContext);
|
|
64
64
|
const defaultPremountInSeconds = react_1.default.useContext(DefaultPremountContext_js_1.DefaultPremountContext);
|
|
65
|
-
const experimentalTracksEnabled = react_1.default.useContext(timeline_track_context_js_1.ExperimentalTracksEnabledContext);
|
|
66
65
|
const timelineTrackContext = react_1.default.useContext(timeline_track_context_js_1.TimelineTrackContext);
|
|
67
66
|
const canUseRemotionHooksContext = react_1.default.useContext(CanUseRemotionHooks_js_1.CanUseRemotionHooks);
|
|
68
67
|
const preloadContext = react_1.default.useContext(prefetch_state_js_1.PreloadContext);
|
|
@@ -85,7 +84,6 @@ function useRemotionContexts() {
|
|
|
85
84
|
setTimelineContext,
|
|
86
85
|
sequenceContext,
|
|
87
86
|
defaultPremountInSeconds,
|
|
88
|
-
experimentalTracksEnabled,
|
|
89
87
|
timelineTrackContext,
|
|
90
88
|
canUseRemotionHooksContext,
|
|
91
89
|
preloadContext,
|
|
@@ -106,7 +104,6 @@ function useRemotionContexts() {
|
|
|
106
104
|
videoContext,
|
|
107
105
|
sequenceContext,
|
|
108
106
|
defaultPremountInSeconds,
|
|
109
|
-
experimentalTracksEnabled,
|
|
110
107
|
timelineTrackContext,
|
|
111
108
|
setTimelineContext,
|
|
112
109
|
timelineContext,
|
|
@@ -200,6 +197,6 @@ const ForwardedSequenceRegistry = ({ contexts, children, }) => {
|
|
|
200
197
|
};
|
|
201
198
|
const RemotionContextProvider = (props) => {
|
|
202
199
|
const { children, contexts } = props;
|
|
203
|
-
return (jsx_runtime_1.jsx(log_level_context_js_1.LogLevelContext.Provider, { value: contexts.logLevelContext, children: jsx_runtime_1.jsx(CanUseRemotionHooks_js_1.CanUseRemotionHooks.Provider, { value: contexts.canUseRemotionHooksContext, children: jsx_runtime_1.jsx(prefetch_state_js_1.PreloadContext.Provider, { value: contexts.preloadContext, children: jsx_runtime_1.jsx(CompositionManagerContext_js_1.CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceManagerRefContext.Provider, { value: contexts.sequenceManagerRefContext, children: jsx_runtime_1.jsx(remotion_environment_context_js_1.RemotionEnvironmentContext.Provider, { value: contexts.remotionEnvironmentContext, children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceRegistrationContext.Provider, { value: contexts.sequenceRegistrationContext, children: jsx_runtime_1.jsx(SequenceManager_js_1.DisableSequenceRegistrationContext.Provider, { value: contexts.disableSequenceRegistrationContext, children: jsx_runtime_1.jsx(ForwardedSequenceRegistry, { contexts: contexts, children: jsx_runtime_1.jsx(SequenceManager_js_1.VisualModePropStatusesRefContext.Provider, { value: contexts.visualModePropStatusesRefContext, children: jsx_runtime_1.jsx(RenderAssetManager_js_1.RenderAssetManager.Provider, { value: contexts.renderAssetManagerContext, children: jsx_runtime_1.jsx(ResolveCompositionConfig_js_1.ResolveCompositionContext.Provider, { value: contexts.resolveCompositionContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContext.Provider, { value: contexts.timelineContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: jsx_runtime_1.jsx(SequenceContext_js_1.SequenceContext.Provider, { value: contexts.sequenceContext, children: jsx_runtime_1.jsx(buffering_js_1.BufferingContextReact.Provider, { value: contexts.bufferManagerContext, children: jsx_runtime_1.jsx(timeline_track_context_js_1.
|
|
200
|
+
return (jsx_runtime_1.jsx(log_level_context_js_1.LogLevelContext.Provider, { value: contexts.logLevelContext, children: jsx_runtime_1.jsx(CanUseRemotionHooks_js_1.CanUseRemotionHooks.Provider, { value: contexts.canUseRemotionHooksContext, children: jsx_runtime_1.jsx(prefetch_state_js_1.PreloadContext.Provider, { value: contexts.preloadContext, children: jsx_runtime_1.jsx(CompositionManagerContext_js_1.CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceManagerRefContext.Provider, { value: contexts.sequenceManagerRefContext, children: jsx_runtime_1.jsx(remotion_environment_context_js_1.RemotionEnvironmentContext.Provider, { value: contexts.remotionEnvironmentContext, children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceRegistrationContext.Provider, { value: contexts.sequenceRegistrationContext, children: jsx_runtime_1.jsx(SequenceManager_js_1.DisableSequenceRegistrationContext.Provider, { value: contexts.disableSequenceRegistrationContext, children: jsx_runtime_1.jsx(ForwardedSequenceRegistry, { contexts: contexts, children: jsx_runtime_1.jsx(SequenceManager_js_1.VisualModePropStatusesRefContext.Provider, { value: contexts.visualModePropStatusesRefContext, children: jsx_runtime_1.jsx(RenderAssetManager_js_1.RenderAssetManager.Provider, { value: contexts.renderAssetManagerContext, children: jsx_runtime_1.jsx(ResolveCompositionConfig_js_1.ResolveCompositionContext.Provider, { value: contexts.resolveCompositionContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContext.Provider, { value: contexts.timelineContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: jsx_runtime_1.jsx(SequenceContext_js_1.SequenceContext.Provider, { value: contexts.sequenceContext, children: jsx_runtime_1.jsx(buffering_js_1.BufferingContextReact.Provider, { value: contexts.bufferManagerContext, children: jsx_runtime_1.jsx(timeline_track_context_js_1.TimelineTrackContext.Provider, { value: contexts.timelineTrackContext, children: jsx_runtime_1.jsx(DefaultPremountContext_js_1.DefaultPremountContext.Provider, { value: contexts.defaultPremountInSeconds, children: jsx_runtime_1.jsx(use_video_js_1.VideoContext.Provider, { value: contexts.videoContext, children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
204
201
|
};
|
|
205
202
|
exports.RemotionContextProvider = RemotionContextProvider;
|