@remotion/studio 4.0.441 → 4.0.443

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 (40) hide show
  1. package/dist/components/AudioWaveform.js +67 -61
  2. package/dist/components/Editor.js +7 -4
  3. package/dist/components/EditorGuides/Guide.js +2 -1
  4. package/dist/components/EditorRuler/Ruler.js +2 -1
  5. package/dist/components/EditorRuler/index.js +4 -7
  6. package/dist/components/ForceSpecificCursor.d.ts +3 -0
  7. package/dist/components/ForceSpecificCursor.js +68 -0
  8. package/dist/components/MenuBuildIndicator.js +58 -3
  9. package/dist/components/MenuCompositionName.d.ts +2 -0
  10. package/dist/components/MenuCompositionName.js +80 -0
  11. package/dist/components/NewComposition/InputDragger.js +3 -0
  12. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +10 -3
  13. package/dist/components/Splitter/SplitterHandle.js +3 -0
  14. package/dist/components/Timeline/Timeline.js +3 -3
  15. package/dist/components/Timeline/TimelineDragHandler.js +4 -0
  16. package/dist/components/Timeline/TimelineRotationField.js +11 -0
  17. package/dist/components/Timeline/TimelineSequence.js +1 -1
  18. package/dist/components/Timeline/TimelineStack/index.js +2 -1
  19. package/dist/components/Timeline/TimelineVideoInfo.d.ts +4 -0
  20. package/dist/components/Timeline/TimelineVideoInfo.js +31 -12
  21. package/dist/components/Timeline/TimelineWidthProvider.js +16 -1
  22. package/dist/components/draw-peaks.d.ts +1 -0
  23. package/dist/components/draw-peaks.js +61 -0
  24. package/dist/components/load-waveform-peaks.d.ts +3 -0
  25. package/dist/components/load-waveform-peaks.js +67 -0
  26. package/dist/components/parse-color.d.ts +1 -0
  27. package/dist/components/parse-color.js +17 -0
  28. package/dist/esm/{chunk-1x2ychmc.js → chunk-cpv44d93.js} +3613 -3340
  29. package/dist/esm/internals.mjs +3613 -3340
  30. package/dist/esm/previewEntry.mjs +3405 -3132
  31. package/dist/esm/renderEntry.mjs +1 -1
  32. package/dist/helpers/calculate-timeline.d.ts +1 -2
  33. package/dist/helpers/calculate-timeline.js +2 -23
  34. package/dist/helpers/timeline-layout.d.ts +4 -1
  35. package/dist/helpers/timeline-layout.js +10 -4
  36. package/package.json +9 -9
  37. package/dist/components/AudioWaveformBar.d.ts +0 -14
  38. package/dist/components/AudioWaveformBar.js +0 -33
  39. package/dist/components/OpenEditorButton.d.ts +0 -3
  40. package/dist/components/OpenEditorButton.js +0 -67
@@ -208,7 +208,7 @@ var renderContent = (Root) => {
208
208
  renderToDOM(/* @__PURE__ */ jsx("div", {
209
209
  children: /* @__PURE__ */ jsx(DelayedSpinner, {})
210
210
  }));
211
- import("./chunk-1x2ychmc.js").then(({ StudioInternals }) => {
211
+ import("./chunk-cpv44d93.js").then(({ StudioInternals }) => {
212
212
  window.remotion_isStudio = true;
213
213
  window.remotion_isReadOnlyStudio = true;
214
214
  window.remotion_inputProps = "{}";
@@ -1,6 +1,5 @@
1
1
  import type { TSequence } from 'remotion';
2
2
  import type { TrackWithHash } from './get-timeline-sequence-sort-key';
3
- export declare const calculateTimeline: ({ sequences, sequenceDuration, }: {
3
+ export declare const calculateTimeline: ({ sequences, }: {
4
4
  sequences: TSequence[];
5
- sequenceDuration: number;
6
5
  }) => TrackWithHash[];
@@ -6,32 +6,11 @@ const get_timeline_nestedness_1 = require("./get-timeline-nestedness");
6
6
  const get_timeline_sequence_hash_1 = require("./get-timeline-sequence-hash");
7
7
  const get_timeline_sequence_sort_key_1 = require("./get-timeline-sequence-sort-key");
8
8
  const sort_by_nonce_history_1 = require("./sort-by-nonce-history");
9
- const calculateTimeline = ({ sequences, sequenceDuration, }) => {
9
+ const calculateTimeline = ({ sequences, }) => {
10
10
  const sortedSequences = (0, sort_by_nonce_history_1.sortItemsByNonceHistory)(sequences);
11
11
  const tracks = [];
12
12
  if (sortedSequences.length === 0) {
13
- return [
14
- {
15
- sequence: {
16
- displayName: '',
17
- duration: sequenceDuration,
18
- from: 0,
19
- id: 'seq',
20
- parent: null,
21
- type: 'sequence',
22
- rootId: '-',
23
- showInTimeline: true,
24
- nonce: [[0, 0]],
25
- loopDisplay: undefined,
26
- stack: null,
27
- premountDisplay: null,
28
- postmountDisplay: null,
29
- controls: null,
30
- },
31
- depth: 0,
32
- hash: '-',
33
- },
34
- ];
13
+ return [];
35
14
  }
36
15
  const sameHashes = {};
37
16
  const hashesUsedInRoot = {};
@@ -16,4 +16,7 @@ export type SchemaFieldInfo = {
16
16
  };
17
17
  export declare const getSchemaFields: (controls: SequenceControls | null) => SchemaFieldInfo[] | null;
18
18
  export declare const getExpandedTrackHeight: (controls: SequenceControls | null) => number;
19
- export declare const getTimelineLayerHeight: (type: "audio" | "image" | "other" | "sequence" | "video") => 25 | 50;
19
+ export declare const TIMELINE_LAYER_HEIGHT_VIDEO = 75;
20
+ export declare const TIMELINE_LAYER_HEIGHT_IMAGE = 50;
21
+ export declare const TIMELINE_LAYER_HEIGHT_AUDIO = 25;
22
+ export declare const getTimelineLayerHeight: (type: "audio" | "image" | "other" | "sequence" | "video") => 25 | 50 | 75;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTimelineLayerHeight = exports.getExpandedTrackHeight = exports.getSchemaFields = exports.UNSUPPORTED_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.TIMELINE_TRACK_EXPANDED_HEIGHT = exports.TIMELINE_ITEM_BORDER_BOTTOM = exports.TIMELINE_BORDER = exports.TIMELINE_PADDING = void 0;
3
+ exports.getTimelineLayerHeight = exports.TIMELINE_LAYER_HEIGHT_AUDIO = exports.TIMELINE_LAYER_HEIGHT_IMAGE = exports.TIMELINE_LAYER_HEIGHT_VIDEO = exports.getExpandedTrackHeight = exports.getSchemaFields = exports.UNSUPPORTED_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.TIMELINE_TRACK_EXPANDED_HEIGHT = exports.TIMELINE_ITEM_BORDER_BOTTOM = exports.TIMELINE_BORDER = exports.TIMELINE_PADDING = void 0;
4
4
  exports.TIMELINE_PADDING = 16;
5
5
  exports.TIMELINE_BORDER = 1;
6
6
  exports.TIMELINE_ITEM_BORDER_BOTTOM = 1;
@@ -43,10 +43,16 @@ const getExpandedTrackHeight = (controls) => {
43
43
  return fields.reduce((sum, f) => sum + f.rowHeight, 0) + separators;
44
44
  };
45
45
  exports.getExpandedTrackHeight = getExpandedTrackHeight;
46
+ exports.TIMELINE_LAYER_HEIGHT_VIDEO = 75;
47
+ exports.TIMELINE_LAYER_HEIGHT_IMAGE = 50;
48
+ exports.TIMELINE_LAYER_HEIGHT_AUDIO = 25;
46
49
  const getTimelineLayerHeight = (type) => {
47
- if (type === 'video' || type === 'image') {
48
- return 50;
50
+ if (type === 'video') {
51
+ return exports.TIMELINE_LAYER_HEIGHT_VIDEO;
49
52
  }
50
- return 25;
53
+ if (type === 'image') {
54
+ return exports.TIMELINE_LAYER_HEIGHT_IMAGE;
55
+ }
56
+ return exports.TIMELINE_LAYER_HEIGHT_AUDIO;
51
57
  };
52
58
  exports.getTimelineLayerHeight = getTimelineLayerHeight;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
4
4
  },
5
5
  "name": "@remotion/studio",
6
- "version": "4.0.441",
6
+ "version": "4.0.443",
7
7
  "description": "APIs for interacting with the Remotion Studio",
8
8
  "main": "dist",
9
9
  "sideEffects": false,
@@ -26,13 +26,13 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "semver": "7.5.3",
29
- "remotion": "4.0.441",
30
- "@remotion/player": "4.0.441",
31
- "@remotion/media-utils": "4.0.441",
32
- "@remotion/renderer": "4.0.441",
33
- "@remotion/web-renderer": "4.0.441",
34
- "@remotion/studio-shared": "4.0.441",
35
- "@remotion/zod-types": "4.0.441",
29
+ "remotion": "4.0.443",
30
+ "@remotion/player": "4.0.443",
31
+ "@remotion/media-utils": "4.0.443",
32
+ "@remotion/renderer": "4.0.443",
33
+ "@remotion/web-renderer": "4.0.443",
34
+ "@remotion/studio-shared": "4.0.443",
35
+ "@remotion/zod-types": "4.0.443",
36
36
  "mediabunny": "1.39.2",
37
37
  "memfs": "3.4.3",
38
38
  "source-map": "0.7.3",
@@ -43,7 +43,7 @@
43
43
  "react": "19.2.3",
44
44
  "react-dom": "19.2.3",
45
45
  "@types/semver": "^7.3.4",
46
- "@remotion/eslint-config-internal": "4.0.441",
46
+ "@remotion/eslint-config-internal": "4.0.443",
47
47
  "eslint": "9.19.0",
48
48
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
49
49
  },
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- export declare const WAVEFORM_BAR_LENGTH = 2;
3
- export declare const WAVEFORM_BAR_MARGIN = 1;
4
- /**
5
- *
6
- * consider a sinus wave with an amplitude going from [-1, 1].
7
- * if we sample it infinitely, and convert all negative samples from negative to positive
8
- * what is the average of all samples?
9
- *
10
- * Answer: 2 / Math.PI = 0.6366
11
- */
12
- export declare const AudioWaveformBar: React.FC<{
13
- readonly amplitude: number;
14
- }>;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AudioWaveformBar = exports.WAVEFORM_BAR_MARGIN = exports.WAVEFORM_BAR_LENGTH = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const timeline_layout_1 = require("../helpers/timeline-layout");
7
- exports.WAVEFORM_BAR_LENGTH = 2;
8
- exports.WAVEFORM_BAR_MARGIN = 1;
9
- const container = {
10
- width: exports.WAVEFORM_BAR_LENGTH,
11
- backgroundColor: 'rgba(255, 255, 255, 0.6)',
12
- marginLeft: exports.WAVEFORM_BAR_MARGIN,
13
- borderRadius: 2,
14
- };
15
- // Sonnet:
16
- /**
17
- *
18
- * consider a sinus wave with an amplitude going from [-1, 1].
19
- * if we sample it infinitely, and convert all negative samples from negative to positive
20
- * what is the average of all samples?
21
- *
22
- * Answer: 2 / Math.PI = 0.6366
23
- */
24
- const AudioWaveformBar = ({ amplitude }) => {
25
- const style = (0, react_1.useMemo)(() => {
26
- return {
27
- ...container,
28
- height: (0, timeline_layout_1.getTimelineLayerHeight)('other') * amplitude * (1 / 0.6366),
29
- };
30
- }, [amplitude]);
31
- return jsx_runtime_1.jsx("div", { style: style });
32
- };
33
- exports.AudioWaveformBar = AudioWaveformBar;
@@ -1,3 +0,0 @@
1
- export declare const OpenEditorButton: React.FC<{
2
- type: 'git' | 'editor';
3
- }>;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenEditorButton = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const colors_1 = require("../helpers/colors");
7
- const get_git_menu_item_1 = require("../helpers/get-git-menu-item");
8
- const open_in_editor_1 = require("../helpers/open-in-editor");
9
- const NotificationCenter_1 = require("./Notifications/NotificationCenter");
10
- const svgStyle = {
11
- width: 11,
12
- height: 11,
13
- };
14
- const buttonStyle = {
15
- border: 'none',
16
- height: '20px',
17
- display: 'flex',
18
- paddingInline: '6px',
19
- justifyContent: 'center',
20
- alignItems: 'center',
21
- };
22
- const OpenEditorButton = ({ type }) => {
23
- const [hovered, setHovered] = (0, react_1.useState)(false);
24
- const svgFillColor = (0, react_1.useMemo)(() => {
25
- return hovered ? 'white' : colors_1.LIGHT_TEXT;
26
- }, [hovered]);
27
- const handleClick = (0, react_1.useCallback)(async () => {
28
- if (type === 'editor') {
29
- await (0, open_in_editor_1.openInEditor)({
30
- originalFileName: `${window.remotion_cwd}`,
31
- originalLineNumber: 1,
32
- originalColumnNumber: 1,
33
- originalFunctionName: null,
34
- originalScriptCode: null,
35
- })
36
- .then((res) => res.json())
37
- .then(({ success }) => {
38
- if (!success) {
39
- (0, NotificationCenter_1.showNotification)(`Could not open ${window.remotion_editorName}`, 2000);
40
- }
41
- })
42
- .catch((err) => {
43
- // eslint-disable-next-line no-console
44
- console.error(err);
45
- (0, NotificationCenter_1.showNotification)(`Could not open ${window.remotion_editorName}`, 2000);
46
- });
47
- }
48
- if (type === 'git') {
49
- if (!window.remotion_gitSource) {
50
- throw new Error('No git source');
51
- }
52
- window.open((0, get_git_menu_item_1.getGitSourceBranchUrl)(window.remotion_gitSource), '_blank');
53
- }
54
- }, [type]);
55
- const buttonTooltip = type === 'git'
56
- ? `Open ${(0, get_git_menu_item_1.getGitSourceName)(window.remotion_gitSource)} Repo`
57
- : `Open in ${window.remotion_editorName}`;
58
- const openInEditorSvg = (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: svgStyle, children: jsx_runtime_1.jsx("path", { fill: svgFillColor, d: "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z" }) }));
59
- const onPointerEnter = (0, react_1.useCallback)(() => {
60
- setHovered(true);
61
- }, []);
62
- const onPointerLeave = (0, react_1.useCallback)(() => {
63
- setHovered(false);
64
- }, []);
65
- return (jsx_runtime_1.jsx("button", { title: buttonTooltip, type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: buttonStyle, onClick: handleClick, children: openInEditorSvg }));
66
- };
67
- exports.OpenEditorButton = OpenEditorButton;