@remotion/studio 4.0.475 → 4.0.477

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 (88) hide show
  1. package/dist/components/Canvas.js +40 -1
  2. package/dist/components/ColorPicker/ColorPickerPopup.d.ts +6 -0
  3. package/dist/components/ColorPicker/ColorPickerPopup.js +11 -6
  4. package/dist/components/ControlButton.d.ts +1 -0
  5. package/dist/components/ControlButton.js +7 -2
  6. package/dist/components/EditorGuides/Guide.js +122 -20
  7. package/dist/components/EditorRuler/Ruler.js +21 -15
  8. package/dist/components/EditorRuler/index.js +18 -10
  9. package/dist/components/GlobalKeybindings.js +12 -0
  10. package/dist/components/KeyboardShortcutsExplainer.js +24 -0
  11. package/dist/components/NewComposition/InputDragger.d.ts +6 -0
  12. package/dist/components/NewComposition/InputDragger.js +40 -14
  13. package/dist/components/NewComposition/RenameComposition.js +8 -1
  14. package/dist/components/NewComposition/RenameFolder.js +8 -1
  15. package/dist/components/NewComposition/RenameStaticFile.js +11 -1
  16. package/dist/components/Notifications/Notification.js +5 -4
  17. package/dist/components/Notifications/NotificationCenter.js +1 -1
  18. package/dist/components/ObserveDefaultPropsContext.js +6 -2
  19. package/dist/components/OutlineToggle.js +1 -1
  20. package/dist/components/PlayPause.js +22 -66
  21. package/dist/components/PreviewToolbar.js +15 -1
  22. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +2 -1
  23. package/dist/components/SelectedOutlineElement.d.ts +17 -0
  24. package/dist/components/SelectedOutlineElement.js +938 -0
  25. package/dist/components/SelectedOutlineOverlay.d.ts +4 -174
  26. package/dist/components/SelectedOutlineOverlay.js +310 -1392
  27. package/dist/components/SelectedOutlineUvControls.js +1 -1
  28. package/dist/components/ShowGuidesProvider.js +4 -4
  29. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -1
  30. package/dist/components/Timeline/SubscribeToNodePaths.js +2 -1
  31. package/dist/components/Timeline/Timeline.js +3 -1
  32. package/dist/components/Timeline/TimelineClipboardKeybindings.js +9 -10
  33. package/dist/components/Timeline/TimelineDeleteKeybindings.js +15 -4
  34. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +7 -11
  35. package/dist/components/Timeline/TimelineList.js +1 -1
  36. package/dist/components/Timeline/TimelineRotationField.js +17 -17
  37. package/dist/components/Timeline/TimelineScaleField.js +1 -1
  38. package/dist/components/Timeline/TimelineSelection.d.ts +27 -13
  39. package/dist/components/Timeline/TimelineSelection.js +47 -28
  40. package/dist/components/Timeline/TimelineSequence.js +169 -8
  41. package/dist/components/Timeline/TimelineSequenceFrame.d.ts +1 -0
  42. package/dist/components/Timeline/TimelineSequenceFrame.js +17 -6
  43. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  44. package/dist/components/Timeline/TimelineSequenceItem.js +294 -142
  45. package/dist/components/Timeline/TimelineSequenceName.d.ts +4 -2
  46. package/dist/components/Timeline/TimelineSequenceName.js +67 -2
  47. package/dist/components/Timeline/TimelineTransformOriginField.js +1 -1
  48. package/dist/components/Timeline/TimelineTranslateField.js +1 -1
  49. package/dist/components/Timeline/TimelineUvCoordinateField.js +1 -1
  50. package/dist/components/Timeline/delete-selected-timeline-item.js +4 -0
  51. package/dist/components/Timeline/disable-sequence-interactivity.d.ts +8 -0
  52. package/dist/components/Timeline/disable-sequence-interactivity.js +24 -0
  53. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +1 -2
  54. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +20 -0
  55. package/dist/components/Timeline/get-sequence-context-menu-items.js +160 -0
  56. package/dist/components/Timeline/reset-selected-timeline-props.js +2 -2
  57. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -1
  58. package/dist/components/Timeline/sequence-props-subscription-store.js +11 -3
  59. package/dist/components/Timeline/should-clear-selection-on-pointer-down.d.ts +2 -0
  60. package/dist/components/Timeline/should-clear-selection-on-pointer-down.js +16 -2
  61. package/dist/components/Timeline/timeline-rotation-utils.d.ts +1 -1
  62. package/dist/components/Timeline/timeline-rotation-utils.js +4 -2
  63. package/dist/components/Timeline/update-selected-easing.d.ts +4 -6
  64. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +2 -1
  65. package/dist/components/Timeline/use-sequence-props-subscription.js +3 -1
  66. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +37 -1
  67. package/dist/components/Timeline/use-timeline-keyframe-drag.js +290 -14
  68. package/dist/components/import-assets.d.ts +36 -8
  69. package/dist/components/import-assets.js +170 -10
  70. package/dist/components/selected-outline-drag.d.ts +117 -0
  71. package/dist/components/selected-outline-drag.js +427 -0
  72. package/dist/components/selected-outline-measurement.d.ts +67 -0
  73. package/dist/components/selected-outline-measurement.js +355 -0
  74. package/dist/components/selected-outline-types.d.ts +121 -0
  75. package/dist/components/selected-outline-types.js +15 -0
  76. package/dist/components/selected-outline-uv.d.ts +1 -0
  77. package/dist/components/selected-outline-uv.js +12 -0
  78. package/dist/esm/{chunk-qaqqvw4q.js → chunk-t8fjnw2d.js} +14059 -12029
  79. package/dist/esm/internals.mjs +14059 -12029
  80. package/dist/esm/previewEntry.mjs +14066 -12036
  81. package/dist/esm/renderEntry.mjs +1 -1
  82. package/dist/helpers/editor-guide-selection.d.ts +31 -0
  83. package/dist/helpers/editor-guide-selection.js +58 -0
  84. package/dist/helpers/editor-ruler.d.ts +3 -3
  85. package/dist/helpers/editor-ruler.js +16 -18
  86. package/dist/state/editor-guides.d.ts +2 -2
  87. package/dist/state/editor-guides.js +2 -2
  88. 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-qaqqvw4q.js").then(({ StudioInternals }) => {
212
+ import("./chunk-t8fjnw2d.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)) !== 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
  }
@@ -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.475",
6
+ "version": "4.0.477",
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.475",
29
- "@remotion/canvas-capture": "4.0.475",
30
- "@remotion/player": "4.0.475",
31
- "@remotion/media-utils": "4.0.475",
32
- "@remotion/renderer": "4.0.475",
33
- "@remotion/web-renderer": "4.0.475",
34
- "@remotion/studio-shared": "4.0.475",
35
- "@remotion/timeline-utils": "4.0.475",
36
- "@remotion/zod-types": "4.0.475",
28
+ "remotion": "4.0.477",
29
+ "@remotion/canvas-capture": "4.0.477",
30
+ "@remotion/player": "4.0.477",
31
+ "@remotion/media-utils": "4.0.477",
32
+ "@remotion/renderer": "4.0.477",
33
+ "@remotion/web-renderer": "4.0.477",
34
+ "@remotion/studio-shared": "4.0.477",
35
+ "@remotion/timeline-utils": "4.0.477",
36
+ "@remotion/zod-types": "4.0.477",
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.475",
47
+ "@remotion/eslint-config-internal": "4.0.477",
48
48
  "eslint": "9.19.0",
49
49
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
50
50
  },