@remotion/studio 4.0.432 → 4.0.433

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.
Files changed (53) hide show
  1. package/dist/Studio.js +1 -3
  2. package/dist/components/CompositionSelector.js +16 -9
  3. package/dist/components/CurrentComposition.js +2 -5
  4. package/dist/components/EditorContent.js +4 -5
  5. package/dist/components/NewComposition/DuplicateComposition.js +4 -1
  6. package/dist/components/NewComposition/InputDragger.d.ts +1 -0
  7. package/dist/components/NewComposition/InputDragger.js +27 -8
  8. package/dist/components/OptionsPanel.js +1 -1
  9. package/dist/components/PlaybackRatePersistor.js +1 -1
  10. package/dist/components/PreviewToolbar.js +4 -2
  11. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -1
  12. package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +3 -1
  13. package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +3 -1
  14. package/dist/components/RenderModal/SchemaEditor/ZodTupleEditor.js +3 -1
  15. package/dist/components/RenderModal/WebRenderModalAudio.js +2 -0
  16. package/dist/components/RenderModal/WebRenderModalBasic.js +8 -1
  17. package/dist/components/RendersTab.js +1 -9
  18. package/dist/components/Timeline/TimelineBooleanField.d.ts +9 -0
  19. package/dist/components/Timeline/TimelineBooleanField.js +20 -0
  20. package/dist/components/Timeline/TimelineEmptyState.d.ts +2 -0
  21. package/dist/components/Timeline/TimelineEmptyState.js +15 -0
  22. package/dist/components/Timeline/TimelineExpandedSection.d.ts +5 -0
  23. package/dist/components/Timeline/TimelineExpandedSection.js +45 -7
  24. package/dist/components/Timeline/TimelineFieldRow.d.ts +3 -0
  25. package/dist/components/Timeline/TimelineFieldRow.js +17 -12
  26. package/dist/components/Timeline/TimelineListItem.d.ts +1 -0
  27. package/dist/components/Timeline/TimelineListItem.js +7 -7
  28. package/dist/components/Timeline/TimelineNumberField.d.ts +11 -0
  29. package/dist/components/Timeline/TimelineNumberField.js +53 -0
  30. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +1 -1
  31. package/dist/components/Timeline/TimelineRotationField.d.ts +11 -0
  32. package/dist/components/Timeline/TimelineRotationField.js +64 -0
  33. package/dist/components/Timeline/TimelineSchemaField.d.ts +1 -3
  34. package/dist/components/Timeline/TimelineSchemaField.js +19 -74
  35. package/dist/components/Timeline/TimelineTranslateField.d.ts +11 -0
  36. package/dist/components/Timeline/TimelineTranslateField.js +115 -0
  37. package/dist/components/Timeline/timeline-field-utils.d.ts +2 -0
  38. package/dist/components/Timeline/timeline-field-utils.js +12 -0
  39. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +2 -1
  40. package/dist/components/Timeline/use-sequence-props-subscription.js +32 -12
  41. package/dist/esm/{chunk-t28xqw5n.js → chunk-bd1bkakk.js} +2697 -2266
  42. package/dist/esm/internals.mjs +2697 -2266
  43. package/dist/esm/previewEntry.mjs +2702 -2271
  44. package/dist/esm/renderEntry.mjs +1 -3
  45. package/dist/helpers/calculate-timeline.js +17 -11
  46. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +1 -1
  47. package/dist/helpers/get-timeline-sequence-sort-key.js +6 -3
  48. package/dist/helpers/inject-css.js +6 -1
  49. package/dist/helpers/sort-by-nonce-history.d.ts +5 -0
  50. package/dist/helpers/sort-by-nonce-history.js +73 -0
  51. package/dist/helpers/timeline-layout.js +8 -2
  52. package/dist/renderEntry.js +2 -2
  53. package/package.json +11 -11
@@ -43,6 +43,14 @@ const useSequencePropsSubscription = (sequence, originalLocation) => {
43
43
  currentLocationLine.current = locationLine;
44
44
  const currentLocationColumn = (0, react_1.useRef)(locationColumn);
45
45
  currentLocationColumn.current = locationColumn;
46
+ const nodePathRef = (0, react_1.useRef)(null);
47
+ const isMountedRef = (0, react_1.useRef)(true);
48
+ (0, react_1.useEffect)(() => {
49
+ isMountedRef.current = true;
50
+ return () => {
51
+ isMountedRef.current = false;
52
+ };
53
+ }, []);
46
54
  (0, react_1.useEffect)(() => {
47
55
  if (!clientId ||
48
56
  !locationSource ||
@@ -67,25 +75,36 @@ const useSequencePropsSubscription = (sequence, originalLocation) => {
67
75
  return;
68
76
  }
69
77
  if (result.canUpdate) {
78
+ nodePathRef.current = result.nodePath;
70
79
  setPropStatusesForSequence(result.props);
71
80
  }
72
81
  else {
82
+ nodePathRef.current = null;
73
83
  setPropStatusesForSequence(null);
74
84
  }
75
85
  })
76
- .catch(() => {
86
+ .catch((err) => {
87
+ nodePathRef.current = null;
88
+ remotion_1.Internals.Log.error(err);
77
89
  setPropStatusesForSequence(null);
78
90
  });
79
91
  return () => {
80
- setPropStatusesForSequence(null);
81
- (0, call_api_1.callApi)('/api/unsubscribe-from-sequence-props', {
82
- fileName: locationSource,
83
- line: locationLine,
84
- column: locationColumn,
85
- clientId,
86
- }).catch(() => {
87
- // Ignore unsubscribe errors
88
- });
92
+ const currentNodePath = nodePathRef.current;
93
+ // Only clear props on true unmount, not on re-subscribe due to
94
+ // line number changes — avoids flicker while re-subscribing.
95
+ if (!isMountedRef.current) {
96
+ setPropStatusesForSequence(null);
97
+ }
98
+ nodePathRef.current = null;
99
+ if (currentNodePath) {
100
+ (0, call_api_1.callApi)('/api/unsubscribe-from-sequence-props', {
101
+ fileName: locationSource,
102
+ nodePath: currentNodePath,
103
+ clientId,
104
+ }).catch(() => {
105
+ // Ignore unsubscribe errors
106
+ });
107
+ }
89
108
  };
90
109
  }, [
91
110
  clientId,
@@ -104,8 +123,8 @@ const useSequencePropsSubscription = (sequence, originalLocation) => {
104
123
  return;
105
124
  }
106
125
  if (event.fileName !== currentLocationSource.current ||
107
- event.line !== currentLocationLine.current ||
108
- event.column !== currentLocationColumn.current) {
126
+ !nodePathRef.current ||
127
+ JSON.stringify(event.nodePath) !== JSON.stringify(nodePathRef.current)) {
109
128
  return;
110
129
  }
111
130
  if (event.result.canUpdate) {
@@ -126,5 +145,6 @@ const useSequencePropsSubscription = (sequence, originalLocation) => {
126
145
  subscribeToEvent,
127
146
  setPropStatusesForSequence,
128
147
  ]);
148
+ return nodePathRef.current;
129
149
  };
130
150
  exports.useSequencePropsSubscription = useSequencePropsSubscription;