@remotion/studio 4.0.458 → 4.0.460

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 (66) hide show
  1. package/dist/audio-waveform-worker.js +4 -4
  2. package/dist/components/AudioWaveform.js +4 -4
  3. package/dist/components/Checkbox.d.ts +7 -0
  4. package/dist/components/Checkbox.js +38 -24
  5. package/dist/components/Editor.js +10 -9
  6. package/dist/components/ExpandedTracksProvider.d.ts +9 -4
  7. package/dist/components/ExpandedTracksProvider.js +45 -15
  8. package/dist/components/MenuBuildIndicator.js +0 -1
  9. package/dist/components/NewComposition/ComboBox.d.ts +1 -0
  10. package/dist/components/NewComposition/ComboBox.js +14 -5
  11. package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
  12. package/dist/components/SequencePropsSubscriptionProvider.js +26 -0
  13. package/dist/components/Timeline/SequencePropsObserver.d.ts +1 -0
  14. package/dist/components/Timeline/SequencePropsObserver.js +24 -0
  15. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +7 -0
  16. package/dist/components/Timeline/SubscribeToNodePaths.js +15 -0
  17. package/dist/components/Timeline/Timeline.js +28 -48
  18. package/dist/components/Timeline/TimelineBooleanField.js +1 -1
  19. package/dist/components/Timeline/TimelineEnumField.js +18 -10
  20. package/dist/components/Timeline/TimelineExpandArrowButton.d.ts +1 -0
  21. package/dist/components/Timeline/TimelineExpandArrowButton.js +5 -3
  22. package/dist/components/Timeline/TimelineExpandedRow.d.ts +6 -6
  23. package/dist/components/Timeline/TimelineExpandedRow.js +4 -5
  24. package/dist/components/Timeline/TimelineExpandedSection.d.ts +2 -2
  25. package/dist/components/Timeline/TimelineExpandedSection.js +20 -9
  26. package/dist/components/Timeline/TimelineFieldRow.d.ts +2 -3
  27. package/dist/components/Timeline/TimelineFieldRow.js +23 -20
  28. package/dist/components/Timeline/TimelineHeightContainer.d.ts +7 -0
  29. package/dist/components/Timeline/TimelineHeightContainer.js +18 -0
  30. package/dist/components/Timeline/TimelineList.js +1 -1
  31. package/dist/components/Timeline/TimelineListItem.d.ts +2 -0
  32. package/dist/components/Timeline/TimelineListItem.js +27 -13
  33. package/dist/components/Timeline/TimelineSchemaField.js +4 -1
  34. package/dist/components/Timeline/TimelineTracks.js +18 -7
  35. package/dist/components/Timeline/TimelineVideoInfo.js +25 -140
  36. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +10 -13
  37. package/dist/components/Timeline/sequence-props-subscription-store.js +56 -123
  38. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +6 -6
  39. package/dist/components/Timeline/use-sequence-props-subscription.js +25 -55
  40. package/dist/components/Timeline/use-timeline-height.d.ts +5 -0
  41. package/dist/components/Timeline/use-timeline-height.js +48 -0
  42. package/dist/components/draw-peaks.js +7 -0
  43. package/dist/esm/audio-waveform-worker.mjs +9 -14
  44. package/dist/esm/{chunk-261b3aa0.js → chunk-nrgs0ad5.js} +2810 -2975
  45. package/dist/esm/internals.mjs +2810 -2975
  46. package/dist/esm/previewEntry.mjs +2809 -2974
  47. package/dist/esm/renderEntry.mjs +1 -1
  48. package/dist/helpers/calculate-timeline.d.ts +3 -2
  49. package/dist/helpers/calculate-timeline.js +21 -2
  50. package/dist/helpers/get-timeline-sequence-layout.js +3 -3
  51. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +6 -1
  52. package/dist/helpers/timeline-layout.d.ts +18 -9
  53. package/dist/helpers/timeline-layout.js +24 -16
  54. package/dist/icons/Checkmark.d.ts +4 -1
  55. package/dist/icons/Checkmark.js +1 -5
  56. package/dist/icons/caret.d.ts +3 -1
  57. package/dist/icons/caret.js +5 -2
  58. package/package.json +10 -9
  59. package/dist/components/looped-media-timeline.d.ts +0 -6
  60. package/dist/components/looped-media-timeline.js +0 -14
  61. package/dist/helpers/extract-frames.d.ts +0 -18
  62. package/dist/helpers/extract-frames.js +0 -87
  63. package/dist/helpers/frame-database.d.ts +0 -16
  64. package/dist/helpers/frame-database.js +0 -65
  65. package/dist/helpers/resize-video-frame.d.ts +0 -4
  66. package/dist/helpers/resize-video-frame.js +0 -39
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useTimelineHeight = void 0;
4
+ const react_1 = require("react");
5
+ const remotion_1 = require("remotion");
6
+ const client_id_1 = require("../../helpers/client-id");
7
+ const timeline_layout_1 = require("../../helpers/timeline-layout");
8
+ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
9
+ const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
10
+ const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
11
+ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
12
+ const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
13
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
14
+ const { getDragOverrides, getCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeGettersContext);
15
+ const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) &&
16
+ previewServerState.type === 'connected';
17
+ return (0, react_1.useMemo)(() => {
18
+ const tracksHeight = shown.reduce((acc, track) => {
19
+ const isExpanded = visualModeEnabled &&
20
+ track.nodePathInfo !== null &&
21
+ getIsExpanded(track.nodePathInfo);
22
+ const layerHeight = (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type) +
23
+ timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM;
24
+ const expandedHeight = isExpanded && track.nodePathInfo
25
+ ? (0, timeline_layout_1.getExpandedTrackHeight)({
26
+ sequence: track.sequence,
27
+ nodePathInfo: track.nodePathInfo,
28
+ getIsExpanded,
29
+ getDragOverrides,
30
+ getCodeValues,
31
+ }) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM
32
+ : 0;
33
+ return acc + layerHeight + expandedHeight;
34
+ }, 0);
35
+ return (tracksHeight +
36
+ timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM +
37
+ (hasBeenCut ? MaxTimelineTracks_1.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) +
38
+ TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT);
39
+ }, [
40
+ shown,
41
+ hasBeenCut,
42
+ visualModeEnabled,
43
+ getIsExpanded,
44
+ getDragOverrides,
45
+ getCodeValues,
46
+ ]);
47
+ };
48
+ exports.useTimelineHeight = useTimelineHeight;
@@ -10,6 +10,13 @@ const drawBars = (canvas, peaks, color, volume, width) => {
10
10
  }
11
11
  const { height } = canvas;
12
12
  const w = canvas.width;
13
+ // Skip drawing when the target canvas has not been laid out yet.
14
+ // `createImageData(0, h)` / `(w, 0)` throws a DOMException, which
15
+ // surfaces in Studio's console for compositions with many audio
16
+ // sequences — some segments are 0 px wide at certain zoom levels.
17
+ if (w === 0 || height === 0) {
18
+ return;
19
+ }
13
20
  ctx.clearRect(0, 0, w, height);
14
21
  if (volume === 0)
15
22
  return;
@@ -1,3 +1,9 @@
1
+ // src/audio-waveform-worker.ts
2
+ import {
3
+ getLoopDisplayWidth,
4
+ shouldTileLoopDisplay
5
+ } from "@remotion/timeline-utils";
6
+
1
7
  // src/components/parse-color.ts
2
8
  var colorCache = new Map;
3
9
  var parseColor = (color) => {
@@ -22,6 +28,9 @@ var drawBars = (canvas, peaks, color, volume, width) => {
22
28
  }
23
29
  const { height } = canvas;
24
30
  const w = canvas.width;
31
+ if (w === 0 || height === 0) {
32
+ return;
33
+ }
25
34
  ctx.clearRect(0, 0, w, height);
26
35
  if (volume === 0)
27
36
  return;
@@ -225,20 +234,6 @@ async function loadWaveformPeaks(url, signal, options) {
225
234
  }
226
235
  }
227
236
 
228
- // src/components/looped-media-timeline.ts
229
- var shouldTileLoopDisplay = (loopDisplay) => {
230
- return loopDisplay !== undefined && loopDisplay.numberOfTimes > 1;
231
- };
232
- var getLoopDisplayWidth = ({
233
- visualizationWidth,
234
- loopDisplay
235
- }) => {
236
- if (!shouldTileLoopDisplay(loopDisplay)) {
237
- return visualizationWidth;
238
- }
239
- return visualizationWidth / loopDisplay.numberOfTimes;
240
- };
241
-
242
237
  // src/components/slice-waveform-peaks.ts
243
238
  var sliceWaveformPeaks = ({
244
239
  durationInFrames,