@remotion/studio 4.0.476 → 4.0.478

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 (74) hide show
  1. package/dist/components/Canvas.js +40 -1
  2. package/dist/components/CanvasIfSizeIsAvailable.js +2 -6
  3. package/dist/components/ControlButton.d.ts +1 -0
  4. package/dist/components/ControlButton.js +7 -2
  5. package/dist/components/EditorGuides/Guide.js +151 -21
  6. package/dist/components/EditorRuler/Ruler.js +20 -24
  7. package/dist/components/EditorRuler/index.js +26 -13
  8. package/dist/components/InlineAction.js +1 -0
  9. package/dist/components/MenuToolbar.d.ts +1 -0
  10. package/dist/components/MenuToolbar.js +4 -1
  11. package/dist/components/OutlineToggle.js +1 -1
  12. package/dist/components/SelectedOutlineElement.d.ts +17 -0
  13. package/dist/components/SelectedOutlineElement.js +1009 -0
  14. package/dist/components/SelectedOutlineOverlay.d.ts +4 -210
  15. package/dist/components/SelectedOutlineOverlay.js +68 -1637
  16. package/dist/components/SelectedOutlineUvControls.js +1 -1
  17. package/dist/components/ShowGuidesProvider.js +4 -4
  18. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -1
  19. package/dist/components/Timeline/SubscribeToNodePaths.js +2 -1
  20. package/dist/components/Timeline/Timeline.js +3 -1
  21. package/dist/components/Timeline/TimelineClipboardKeybindings.js +9 -10
  22. package/dist/components/Timeline/TimelineDeleteKeybindings.js +15 -4
  23. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +7 -11
  24. package/dist/components/Timeline/TimelineList.js +1 -1
  25. package/dist/components/Timeline/TimelineSelection.d.ts +27 -13
  26. package/dist/components/Timeline/TimelineSelection.js +47 -28
  27. package/dist/components/Timeline/TimelineSequence.js +156 -3
  28. package/dist/components/Timeline/TimelineSequenceFrame.d.ts +1 -0
  29. package/dist/components/Timeline/TimelineSequenceFrame.js +17 -6
  30. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  31. package/dist/components/Timeline/TimelineSequenceItem.js +90 -130
  32. package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
  33. package/dist/components/Timeline/TimelineVideoInfo.js +93 -8
  34. package/dist/components/Timeline/delete-selected-timeline-item.js +4 -0
  35. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +8 -2
  36. package/dist/components/Timeline/duplicate-selected-timeline-item.js +32 -3
  37. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +20 -0
  38. package/dist/components/Timeline/get-sequence-context-menu-items.js +160 -0
  39. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -1
  40. package/dist/components/Timeline/sequence-props-subscription-store.js +11 -3
  41. package/dist/components/Timeline/should-clear-selection-on-pointer-down.d.ts +2 -0
  42. package/dist/components/Timeline/should-clear-selection-on-pointer-down.js +16 -2
  43. package/dist/components/Timeline/timeline-video-filmstrip-times.d.ts +17 -0
  44. package/dist/components/Timeline/timeline-video-filmstrip-times.js +22 -0
  45. package/dist/components/Timeline/update-selected-easing.d.ts +4 -6
  46. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +2 -1
  47. package/dist/components/Timeline/use-sequence-props-subscription.js +3 -1
  48. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +37 -1
  49. package/dist/components/Timeline/use-timeline-keyframe-drag.js +282 -1
  50. package/dist/components/import-assets.d.ts +45 -8
  51. package/dist/components/import-assets.js +227 -12
  52. package/dist/components/selected-outline-drag.d.ts +140 -0
  53. package/dist/components/selected-outline-drag.js +475 -0
  54. package/dist/components/selected-outline-measurement.d.ts +67 -0
  55. package/dist/components/selected-outline-measurement.js +355 -0
  56. package/dist/components/selected-outline-types.d.ts +121 -0
  57. package/dist/components/selected-outline-types.js +15 -0
  58. package/dist/components/selected-outline-uv.d.ts +1 -0
  59. package/dist/components/selected-outline-uv.js +12 -0
  60. package/dist/error-overlay/remotion-overlay/Overlay.js +3 -0
  61. package/dist/esm/{chunk-0atarw3p.js → chunk-hrw9799x.js} +12812 -11386
  62. package/dist/esm/internals.mjs +12812 -11386
  63. package/dist/esm/previewEntry.mjs +21059 -19629
  64. package/dist/esm/renderEntry.mjs +1 -1
  65. package/dist/helpers/editor-guide-selection.d.ts +31 -0
  66. package/dist/helpers/editor-guide-selection.js +58 -0
  67. package/dist/helpers/editor-ruler.d.ts +3 -3
  68. package/dist/helpers/editor-ruler.js +16 -18
  69. package/dist/helpers/get-preview-file-type.js +1 -1
  70. package/dist/helpers/ruler-canvas-size.d.ts +5 -0
  71. package/dist/helpers/ruler-canvas-size.js +17 -0
  72. package/dist/state/editor-guides.d.ts +2 -2
  73. package/dist/state/editor-guides.js +2 -2
  74. package/package.json +11 -11
@@ -209,7 +209,7 @@ var renderContent = (Root) => {
209
209
  renderToDOM(/* @__PURE__ */ jsx("div", {
210
210
  children: /* @__PURE__ */ jsx(DelayedSpinner, {})
211
211
  }));
212
- import("./chunk-0atarw3p.js").then(({ StudioInternals }) => {
212
+ import("./chunk-hrw9799x.js").then(({ StudioInternals }) => {
213
213
  window.remotion_isStudio = true;
214
214
  window.remotion_isReadOnlyStudio = true;
215
215
  window.remotion_inputProps = "{}";
@@ -0,0 +1,31 @@
1
+ import type { Guide } from '../state/editor-guides';
2
+ export type GuidePointerDownPosition = {
3
+ readonly guideId: string;
4
+ readonly clientX: number;
5
+ readonly clientY: number;
6
+ };
7
+ export type RulerGuideHighlight = {
8
+ readonly guide: Guide;
9
+ readonly color: string;
10
+ };
11
+ type SelectedTimelineItem = {
12
+ readonly type: string;
13
+ readonly guideId?: string;
14
+ };
15
+ export declare const isGuidePointerUpAClick: ({ pointerDownPosition, guideId, clientX, clientY, }: {
16
+ readonly pointerDownPosition: GuidePointerDownPosition | null;
17
+ readonly guideId: string;
18
+ readonly clientX: number;
19
+ readonly clientY: number;
20
+ }) => boolean;
21
+ export declare const getEditorGuideColor: ({ selected, active, }: {
22
+ readonly selected: boolean;
23
+ readonly active: boolean;
24
+ }) => "#0b84f3" | "#7e1219" | "#d22d3a";
25
+ export declare const getRulerGuideHighlight: ({ guidesList, selectedItems, hoveredGuideId, draggingGuideId, }: {
26
+ readonly guidesList: readonly Guide[];
27
+ readonly selectedItems: readonly SelectedTimelineItem[];
28
+ readonly hoveredGuideId: string | null;
29
+ readonly draggingGuideId: string | null;
30
+ }) => RulerGuideHighlight | null;
31
+ export {};
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRulerGuideHighlight = exports.getEditorGuideColor = exports.isGuidePointerUpAClick = void 0;
4
+ const colors_1 = require("./colors");
5
+ const GUIDE_CLICK_THRESHOLD_PX = 3;
6
+ const isGuidePointerUpAClick = ({ pointerDownPosition, guideId, clientX, clientY, }) => {
7
+ if (pointerDownPosition === null || pointerDownPosition.guideId !== guideId) {
8
+ return false;
9
+ }
10
+ return (Math.abs(clientX - pointerDownPosition.clientX) <=
11
+ GUIDE_CLICK_THRESHOLD_PX &&
12
+ Math.abs(clientY - pointerDownPosition.clientY) <= GUIDE_CLICK_THRESHOLD_PX);
13
+ };
14
+ exports.isGuidePointerUpAClick = isGuidePointerUpAClick;
15
+ const getEditorGuideColor = ({ selected, active, }) => {
16
+ if (selected) {
17
+ return colors_1.BLUE;
18
+ }
19
+ return active ? colors_1.SELECTED_GUIDE : colors_1.UNSELECTED_GUIDE;
20
+ };
21
+ exports.getEditorGuideColor = getEditorGuideColor;
22
+ const findGuide = (guidesList, guideId) => {
23
+ var _a;
24
+ if (guideId === null) {
25
+ return null;
26
+ }
27
+ return (_a = guidesList.find((guide) => guide.id === guideId && guide.show)) !== null && _a !== void 0 ? _a : null;
28
+ };
29
+ const getRulerGuideHighlight = ({ guidesList, selectedItems, hoveredGuideId, draggingGuideId, }) => {
30
+ var _a;
31
+ var _b;
32
+ const selectedGuideId = selectedItems.length === 1 && ((_a = selectedItems[0]) === null || _a === void 0 ? void 0 : _a.type) === 'guide'
33
+ ? ((_b = selectedItems[0].guideId) !== null && _b !== void 0 ? _b : null)
34
+ : null;
35
+ const selectedGuide = findGuide(guidesList, selectedGuideId);
36
+ if (selectedGuide) {
37
+ return {
38
+ guide: selectedGuide,
39
+ color: colors_1.BLUE,
40
+ };
41
+ }
42
+ const draggingGuide = findGuide(guidesList, draggingGuideId);
43
+ if (draggingGuide) {
44
+ return {
45
+ guide: draggingGuide,
46
+ color: colors_1.SELECTED_GUIDE,
47
+ };
48
+ }
49
+ const hoveredGuide = findGuide(guidesList, hoveredGuideId);
50
+ if (hoveredGuide) {
51
+ return {
52
+ guide: hoveredGuide,
53
+ color: colors_1.SELECTED_GUIDE,
54
+ };
55
+ }
56
+ return null;
57
+ };
58
+ exports.getRulerGuideHighlight = getRulerGuideHighlight;
@@ -1,6 +1,6 @@
1
1
  import type { Size } from '@remotion/player';
2
- import type { Guide } from '../state/editor-guides';
3
- export declare const drawMarkingOnRulerCanvas: ({ scale, points, startMarking, originOffset, markingGaps, orientation, rulerCanvasRef, selectedGuide, canvasHeight, canvasWidth, }: {
2
+ import type { RulerGuideHighlight } from './editor-guide-selection';
3
+ export declare const drawMarkingOnRulerCanvas: ({ scale, points, startMarking, originOffset, markingGaps, orientation, rulerCanvasRef, guideHighlight, canvasHeight, canvasWidth, }: {
4
4
  scale: number;
5
5
  points: {
6
6
  position: number;
@@ -11,7 +11,7 @@ export declare const drawMarkingOnRulerCanvas: ({ scale, points, startMarking, o
11
11
  markingGaps: number;
12
12
  orientation: "horizontal" | "vertical";
13
13
  rulerCanvasRef: import("react").RefObject<HTMLCanvasElement | null>;
14
- selectedGuide: Guide | null;
14
+ guideHighlight: RulerGuideHighlight | null;
15
15
  canvasWidth: number;
16
16
  canvasHeight: number;
17
17
  }) => void;
@@ -28,9 +28,10 @@ const drawGradient = ({ orientation, context, originDistance, canvasHeight, canv
28
28
  context.fillStyle = grd;
29
29
  context.fillRect(startX, startY, endX - startX, endY - startY);
30
30
  };
31
- const drawGuide = ({ selectedGuide, scale, startMarking, context, canvasHeight, canvasWidth, orientation, originOffset, }) => {
31
+ const drawGuide = ({ guideHighlight, scale, startMarking, context, canvasHeight, canvasWidth, orientation, originOffset, }) => {
32
+ const { guide, color } = guideHighlight;
32
33
  const originDistance = rulerValueToPosition({
33
- value: selectedGuide.position,
34
+ value: guide.position,
34
35
  startMarking,
35
36
  scale,
36
37
  }) +
@@ -43,43 +44,40 @@ const drawGuide = ({ selectedGuide, scale, startMarking, context, canvasHeight,
43
44
  originDistance,
44
45
  canvasWidth,
45
46
  });
46
- context.strokeStyle = colors_1.SELECTED_GUIDE;
47
+ context.strokeStyle = color;
47
48
  context.lineWidth = 1;
48
49
  context.beginPath();
49
- if (orientation === 'horizontal' &&
50
- selectedGuide.orientation === 'horizontal') {
50
+ if (orientation === 'horizontal' && guide.orientation === 'horizontal') {
51
51
  return;
52
52
  }
53
- if (orientation === 'vertical' && selectedGuide.orientation === 'vertical') {
53
+ if (orientation === 'vertical' && guide.orientation === 'vertical') {
54
54
  return;
55
55
  }
56
- if (orientation === 'vertical' &&
57
- selectedGuide.orientation === 'horizontal') {
56
+ if (orientation === 'vertical' && guide.orientation === 'horizontal') {
58
57
  context.moveTo(0, originDistance);
59
58
  context.lineTo(canvasWidth, originDistance);
60
59
  drawLabel({
61
60
  context,
62
- label: selectedGuide.position.toString(),
61
+ label: guide.position.toString(),
63
62
  originDistance,
64
63
  orientation,
65
- color: colors_1.SELECTED_GUIDE,
64
+ color,
66
65
  });
67
66
  }
68
- else if (orientation === 'horizontal' &&
69
- selectedGuide.orientation === 'vertical') {
67
+ else if (orientation === 'horizontal' && guide.orientation === 'vertical') {
70
68
  context.moveTo(originDistance, 0);
71
69
  context.lineTo(originDistance, canvasHeight);
72
70
  drawLabel({
73
71
  context,
74
- label: selectedGuide.position.toString(),
72
+ label: guide.position.toString(),
75
73
  originDistance,
76
74
  orientation,
77
- color: colors_1.SELECTED_GUIDE,
75
+ color,
78
76
  });
79
77
  }
80
78
  context.stroke();
81
79
  };
82
- const drawMarkingOnRulerCanvas = ({ scale, points, startMarking, originOffset, markingGaps, orientation, rulerCanvasRef, selectedGuide, canvasHeight, canvasWidth, }) => {
80
+ const drawMarkingOnRulerCanvas = ({ scale, points, startMarking, originOffset, markingGaps, orientation, rulerCanvasRef, guideHighlight, canvasHeight, canvasWidth, }) => {
83
81
  const canvas = rulerCanvasRef.current;
84
82
  if (!canvas)
85
83
  return;
@@ -129,15 +127,15 @@ const drawMarkingOnRulerCanvas = ({ scale, points, startMarking, originOffset, m
129
127
  color: colors_1.RULER_COLOR,
130
128
  });
131
129
  });
132
- if (selectedGuide && orientation !== selectedGuide.orientation) {
130
+ if (guideHighlight && orientation !== guideHighlight.guide.orientation) {
133
131
  drawGuide({
134
132
  canvasHeight,
135
133
  canvasWidth,
136
134
  context,
137
- orientation,
135
+ guideHighlight,
138
136
  originOffset,
139
137
  scale,
140
- selectedGuide,
138
+ orientation,
141
139
  startMarking,
142
140
  });
143
141
  }
@@ -8,7 +8,7 @@ const getPreviewFileType = (fileName) => {
8
8
  }
9
9
  const audioExtensions = ['mp3', 'wav', 'ogg', 'aac'];
10
10
  const videoExtensions = ['mp4', 'avi', 'mkv', 'mov', 'webm'];
11
- const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
11
+ const imageExtensions = ['jpg', 'jpeg', 'png', 'apng', 'gif', 'bmp'];
12
12
  const fileExtension = (_a = fileName.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
13
13
  if (fileExtension === undefined) {
14
14
  throw new Error('File extension is undefined');
@@ -0,0 +1,5 @@
1
+ import type { Size } from '@remotion/player';
2
+ export declare const applyRulerInsetsToCanvasSize: ({ rulersAreVisible, size, }: {
3
+ readonly rulersAreVisible: boolean;
4
+ readonly size: Size;
5
+ }) => Size;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyRulerInsetsToCanvasSize = void 0;
4
+ const editor_rulers_1 = require("../state/editor-rulers");
5
+ const applyRulerInsetsToCanvasSize = ({ rulersAreVisible, size, }) => {
6
+ if (!rulersAreVisible) {
7
+ return size;
8
+ }
9
+ return {
10
+ ...size,
11
+ left: size.left + editor_rulers_1.RULER_WIDTH,
12
+ top: size.top + editor_rulers_1.RULER_WIDTH,
13
+ width: size.width - editor_rulers_1.RULER_WIDTH,
14
+ height: size.height - editor_rulers_1.RULER_WIDTH,
15
+ };
16
+ };
17
+ exports.applyRulerInsetsToCanvasSize = applyRulerInsetsToCanvasSize;
@@ -10,8 +10,8 @@ export type GuideState = {
10
10
  setEditorShowGuides: (cb: (prevState: boolean) => boolean) => void;
11
11
  guidesList: Guide[];
12
12
  setGuidesList: (cb: (prevState: Guide[]) => Guide[]) => void;
13
- selectedGuideId: string | null;
14
- setSelectedGuideId: (cb: (prevState: string | null) => string | null) => void;
13
+ draggingGuideId: string | null;
14
+ setDraggingGuideId: (cb: (prevState: string | null) => string | null) => void;
15
15
  setHoveredGuideId: (cb: (prevState: string | null) => string | null) => void;
16
16
  hoveredGuideId: string | null;
17
17
  shouldCreateGuideRef: React.MutableRefObject<boolean>;
@@ -25,8 +25,8 @@ exports.EditorShowGuidesContext = (0, react_1.createContext)({
25
25
  setEditorShowGuides: () => undefined,
26
26
  guidesList: [],
27
27
  setGuidesList: () => undefined,
28
- selectedGuideId: null,
29
- setSelectedGuideId: () => undefined,
28
+ draggingGuideId: null,
29
+ setDraggingGuideId: () => undefined,
30
30
  shouldCreateGuideRef: { current: false },
31
31
  shouldDeleteGuideRef: { current: false },
32
32
  hoveredGuideId: null,
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.476",
6
+ "version": "4.0.478",
7
7
  "description": "APIs for interacting with the Remotion Studio",
8
8
  "main": "dist",
9
9
  "scripts": {
@@ -25,15 +25,15 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "semver": "7.5.3",
28
- "remotion": "4.0.476",
29
- "@remotion/canvas-capture": "4.0.476",
30
- "@remotion/player": "4.0.476",
31
- "@remotion/media-utils": "4.0.476",
32
- "@remotion/renderer": "4.0.476",
33
- "@remotion/web-renderer": "4.0.476",
34
- "@remotion/studio-shared": "4.0.476",
35
- "@remotion/timeline-utils": "4.0.476",
36
- "@remotion/zod-types": "4.0.476",
28
+ "remotion": "4.0.478",
29
+ "@remotion/canvas-capture": "4.0.478",
30
+ "@remotion/player": "4.0.478",
31
+ "@remotion/media-utils": "4.0.478",
32
+ "@remotion/renderer": "4.0.478",
33
+ "@remotion/web-renderer": "4.0.478",
34
+ "@remotion/studio-shared": "4.0.478",
35
+ "@remotion/timeline-utils": "4.0.478",
36
+ "@remotion/zod-types": "4.0.478",
37
37
  "@jridgewell/trace-mapping": "0.3.31",
38
38
  "mediabunny": "1.45.0",
39
39
  "memfs": "3.4.3",
@@ -44,7 +44,7 @@
44
44
  "react": "19.2.3",
45
45
  "react-dom": "19.2.3",
46
46
  "@types/semver": "7.5.3",
47
- "@remotion/eslint-config-internal": "4.0.476",
47
+ "@remotion/eslint-config-internal": "4.0.478",
48
48
  "eslint": "9.19.0",
49
49
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
50
50
  },