remotion 4.0.536 → 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/CompositionManagerContext.d.ts +3 -0
- package/dist/cjs/CompositionManagerContext.js +5 -3
- package/dist/cjs/CompositionManagerProvider.js +3 -1
- package/dist/cjs/HtmlInCanvas.js +66 -15
- package/dist/cjs/animated-image/AnimatedImage.js +11 -6
- package/dist/cjs/effects/use-memoized-effects.js +86 -44
- package/dist/cjs/internals.d.ts +3 -0
- package/dist/cjs/internals.js +1 -0
- package/dist/cjs/timeline-position-state.d.ts +1 -0
- package/dist/cjs/timeline-position-state.js +21 -1
- package/dist/cjs/use-current-frame.d.ts +1 -0
- package/dist/cjs/use-current-frame.js +14 -7
- 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/with-interactivity-schema.js +18 -16
- package/dist/esm/index.mjs +327 -243
- package/dist/esm/no-react.mjs +3 -3
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
|
@@ -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.
|