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.
@@ -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: nodePath === null
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.