@remotion/cli 4.0.62 → 4.0.65

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 (55) hide show
  1. package/dist/config/image-format.d.ts +1 -1
  2. package/dist/config/index.d.ts +1 -1
  3. package/dist/editor/components/AudioWaveform.js +2 -1
  4. package/dist/editor/components/Canvas.js +10 -1
  5. package/dist/editor/components/CompositionSelectorItem.js +42 -1
  6. package/dist/editor/components/ContextMenu.d.ts +6 -0
  7. package/dist/editor/components/ContextMenu.js +91 -0
  8. package/dist/editor/components/EditorContexts.js +3 -1
  9. package/dist/editor/components/EditorGuides/Guide.d.ts +13 -0
  10. package/dist/editor/components/EditorGuides/Guide.js +91 -0
  11. package/dist/editor/components/EditorGuides/index.d.ts +10 -0
  12. package/dist/editor/components/EditorGuides/index.js +32 -0
  13. package/dist/editor/components/EditorRuler/Ruler.d.ts +17 -0
  14. package/dist/editor/components/EditorRuler/Ruler.js +105 -0
  15. package/dist/editor/components/EditorRuler/index.d.ts +10 -0
  16. package/dist/editor/components/EditorRuler/index.js +167 -0
  17. package/dist/editor/components/EditorRuler/use-is-ruler-visible.d.ts +1 -0
  18. package/dist/editor/components/EditorRuler/use-is-ruler-visible.js +12 -0
  19. package/dist/editor/components/Menu/MenuItem.js +6 -3
  20. package/dist/editor/components/Menu/MenuSubItem.d.ts +2 -1
  21. package/dist/editor/components/Menu/MenuSubItem.js +2 -2
  22. package/dist/editor/components/NewComposition/ComboBox.d.ts +1 -1
  23. package/dist/editor/components/NewComposition/InputDragger.js +4 -1
  24. package/dist/editor/components/NewComposition/MenuContent.js +3 -3
  25. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  26. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  27. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  28. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  29. package/dist/editor/components/ShowGuidesProvider.d.ts +4 -0
  30. package/dist/editor/components/ShowGuidesProvider.js +43 -0
  31. package/dist/editor/components/ShowRulersProvider.d.ts +4 -0
  32. package/dist/editor/components/ShowRulersProvider.js +24 -0
  33. package/dist/editor/components/Splitter/SplitterHandle.js +3 -0
  34. package/dist/editor/components/Timeline/TimelineDragHandler.js +85 -5
  35. package/dist/editor/components/Timeline/TimelineInOutPointerHandle.js +2 -1
  36. package/dist/editor/components/TopPanel.js +10 -5
  37. package/dist/editor/helpers/colors.d.ts +6 -1
  38. package/dist/editor/helpers/colors.js +7 -2
  39. package/dist/editor/helpers/editor-ruler.d.ts +53 -0
  40. package/dist/editor/helpers/editor-ruler.js +184 -0
  41. package/dist/editor/helpers/use-menu-structure.js +41 -1
  42. package/dist/editor/helpers/use-studio-canvas-dimensions.d.ts +16 -0
  43. package/dist/editor/helpers/use-studio-canvas-dimensions.js +59 -0
  44. package/dist/editor/state/editor-guides.d.ts +25 -0
  45. package/dist/editor/state/editor-guides.js +34 -0
  46. package/dist/editor/state/editor-rulers.d.ts +14 -0
  47. package/dist/editor/state/editor-rulers.js +24 -0
  48. package/dist/get-cli-options.d.ts +1 -1
  49. package/dist/index.d.ts +5 -5
  50. package/dist/index.js +1 -1
  51. package/dist/lambda-command.d.ts +2 -1
  52. package/dist/lambda-command.js +2 -2
  53. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  54. package/dist/preview-server/public-folder.js +1 -1
  55. package/package.json +8 -8
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBackgroundFromHoverState = exports.BLUE_DISABLED = exports.BLUE = exports.WARNING_COLOR = exports.FAIL_COLOR = exports.TIMELINE_BACKGROUND = exports.INPUT_BORDER_COLOR_HOVERED = exports.INPUT_BORDER_COLOR_UNHOVERED = exports.CLEAR_HOVER = exports.VERY_LIGHT_TEXT = exports.LIGHT_TEXT = exports.SELECTED_BACKGROUND = exports.LIGHT_COLOR = exports.BORDER_COLOR = exports.INPUT_BACKGROUND = exports.BACKGROUND = void 0;
4
- exports.BACKGROUND = '#1f2428';
3
+ exports.getBackgroundFromHoverState = exports.SELECTED_GUIDE = exports.UNSELECTED_GUIDE = exports.LIGHT_TRANSPARENT = exports.BLUE_DISABLED = exports.BLUE = exports.WARNING_COLOR = exports.FAIL_COLOR = exports.TIMELINE_BACKGROUND = exports.INPUT_BORDER_COLOR_HOVERED = exports.INPUT_BORDER_COLOR_UNHOVERED = exports.CLEAR_HOVER = exports.VERY_LIGHT_TEXT = exports.RULER_COLOR = exports.LIGHT_TEXT = exports.SELECTED_BACKGROUND = exports.LIGHT_COLOR = exports.BORDER_COLOR = exports.INPUT_BACKGROUND = exports.BACKGROUND__TRANSPARENT = exports.BACKGROUND = void 0;
4
+ exports.BACKGROUND = 'rgb(31,36,40)';
5
+ exports.BACKGROUND__TRANSPARENT = 'rgba(31,36,40, 0)';
5
6
  exports.INPUT_BACKGROUND = '#2f363d';
6
7
  exports.BORDER_COLOR = '#000';
7
8
  exports.LIGHT_COLOR = '#ddd';
8
9
  exports.SELECTED_BACKGROUND = 'hsla(0, 0%, 100%, 0.15)';
9
10
  exports.LIGHT_TEXT = '#A6A7A9';
11
+ exports.RULER_COLOR = '#808080';
10
12
  exports.VERY_LIGHT_TEXT = 'rgba(255, 255, 255, 0.3)';
11
13
  const SELECTED_HOVER_BACKGROUND = 'hsla(0, 0%, 100%, 0.25)';
12
14
  exports.CLEAR_HOVER = 'rgba(255, 255, 255, 0.06)';
@@ -17,6 +19,9 @@ exports.FAIL_COLOR = '#ff3232';
17
19
  exports.WARNING_COLOR = '#f1c40f';
18
20
  exports.BLUE = '#0b84f3';
19
21
  exports.BLUE_DISABLED = '#284f73';
22
+ exports.LIGHT_TRANSPARENT = 'rgba(255, 255, 255, 0.7)';
23
+ exports.UNSELECTED_GUIDE = '#7e1219';
24
+ exports.SELECTED_GUIDE = '#d22d3a';
20
25
  const getBackgroundFromHoverState = ({ selected, hovered, }) => {
21
26
  if (selected) {
22
27
  if (hovered) {
@@ -0,0 +1,53 @@
1
+ import type { Guide } from '../state/editor-guides';
2
+ type Orientation = 'horizontal' | 'vertical';
3
+ export declare const drawGuide: ({ selectedGuide, scale, startMarking, context, canvasHeight, canvasWidth, orientation, originOffset, }: {
4
+ selectedGuide: Guide;
5
+ scale: number;
6
+ startMarking: number;
7
+ context: CanvasRenderingContext2D;
8
+ canvasHeight: number;
9
+ canvasWidth: number;
10
+ orientation: Orientation;
11
+ originOffset: number;
12
+ }) => void;
13
+ export declare const drawMarkingOnRulerCanvas: ({ scale, points, startMarking, originOffset, markingGaps, orientation, rulerCanvasRef, selectedGuide, }: {
14
+ scale: number;
15
+ points: Array<{
16
+ position: number;
17
+ value: number;
18
+ }>;
19
+ startMarking: number;
20
+ originOffset: number;
21
+ markingGaps: number;
22
+ orientation: 'horizontal' | 'vertical';
23
+ rulerCanvasRef: React.RefObject<HTMLCanvasElement>;
24
+ selectedGuide: Guide | null;
25
+ }) => void;
26
+ export declare const getRulerPoints: ({ rulerScaleRange, rulerMarkingGaps, scale, }: {
27
+ rulerScaleRange: {
28
+ start: number;
29
+ end: number;
30
+ };
31
+ rulerMarkingGaps: number;
32
+ scale: number;
33
+ }) => {
34
+ points: {
35
+ value: number;
36
+ position: number;
37
+ }[];
38
+ startMarking: number;
39
+ };
40
+ export declare const rulerValueToPosition: ({ value, startMarking, scale, }: {
41
+ value: number;
42
+ startMarking: number;
43
+ scale: number;
44
+ }) => number;
45
+ export declare const getRulerScaleRange: ({ canvasLength, containerRef, scale, }: {
46
+ canvasLength: number;
47
+ containerRef: React.RefObject<HTMLDivElement>;
48
+ scale: number;
49
+ }) => {
50
+ start: number;
51
+ end: number;
52
+ };
53
+ export {};
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRulerScaleRange = exports.rulerValueToPosition = exports.getRulerPoints = exports.drawMarkingOnRulerCanvas = exports.drawGuide = void 0;
4
+ const editor_rulers_1 = require("../state/editor-rulers");
5
+ const colors_1 = require("./colors");
6
+ const drawLabel = ({ orientation, context, label, originDistance, color, }) => {
7
+ context.fillStyle = color;
8
+ if (orientation === 'horizontal') {
9
+ context.fillText(label, originDistance + 4, 16);
10
+ }
11
+ else {
12
+ context.rotate(-Math.PI / 2);
13
+ context.fillText(label, -originDistance + 4, 16);
14
+ context.rotate(Math.PI / 2);
15
+ }
16
+ };
17
+ const drawGradient = ({ orientation, context, originDistance, canvasHeight, canvasWidth, }) => {
18
+ const size = 250;
19
+ const startX = orientation === 'horizontal' ? originDistance - size / 2 : 0;
20
+ const startY = orientation === 'horizontal' ? 0 : originDistance - size / 2;
21
+ const endX = orientation === 'horizontal' ? originDistance + size / 2 : canvasWidth;
22
+ const endY = orientation === 'horizontal' ? canvasHeight : originDistance + size / 2;
23
+ const grd = context.createLinearGradient(startX, startY, endX, endY);
24
+ grd.addColorStop(0, colors_1.BACKGROUND__TRANSPARENT);
25
+ grd.addColorStop(0.25, colors_1.BACKGROUND);
26
+ grd.addColorStop(0.75, colors_1.BACKGROUND);
27
+ grd.addColorStop(1, colors_1.BACKGROUND__TRANSPARENT);
28
+ context.fillStyle = grd;
29
+ context.fillRect(startX, startY, endX - startX, endY - startY);
30
+ };
31
+ const drawGuide = ({ selectedGuide, scale, startMarking, context, canvasHeight, canvasWidth, orientation, originOffset, }) => {
32
+ const originDistance = (0, exports.rulerValueToPosition)({
33
+ value: selectedGuide.position,
34
+ startMarking,
35
+ scale,
36
+ }) +
37
+ originOffset -
38
+ startMarking * scale;
39
+ drawGradient({
40
+ canvasHeight,
41
+ context,
42
+ orientation,
43
+ originDistance,
44
+ canvasWidth,
45
+ });
46
+ context.strokeStyle = colors_1.SELECTED_GUIDE;
47
+ context.lineWidth = 1;
48
+ context.beginPath();
49
+ if (orientation === 'horizontal' &&
50
+ selectedGuide.orientation === 'horizontal') {
51
+ return;
52
+ }
53
+ if (orientation === 'vertical' && selectedGuide.orientation === 'vertical') {
54
+ return;
55
+ }
56
+ if (orientation === 'vertical' &&
57
+ selectedGuide.orientation === 'horizontal') {
58
+ context.moveTo(0, originDistance);
59
+ context.lineTo(canvasWidth, originDistance);
60
+ drawLabel({
61
+ context,
62
+ label: selectedGuide.position.toString(),
63
+ originDistance,
64
+ orientation,
65
+ color: colors_1.SELECTED_GUIDE,
66
+ });
67
+ }
68
+ else if (orientation === 'horizontal' &&
69
+ selectedGuide.orientation === 'vertical') {
70
+ context.moveTo(originDistance, 0);
71
+ context.lineTo(originDistance, canvasHeight);
72
+ drawLabel({
73
+ context,
74
+ label: selectedGuide.position.toString(),
75
+ originDistance,
76
+ orientation,
77
+ color: colors_1.SELECTED_GUIDE,
78
+ });
79
+ }
80
+ context.stroke();
81
+ };
82
+ exports.drawGuide = drawGuide;
83
+ const drawMarkingOnRulerCanvas = ({ scale, points, startMarking, originOffset, markingGaps, orientation, rulerCanvasRef, selectedGuide, }) => {
84
+ const canvas = rulerCanvasRef.current;
85
+ if (!canvas)
86
+ return;
87
+ const context = canvas.getContext('2d');
88
+ if (!context)
89
+ return;
90
+ const canvasWidth = canvas.clientWidth * window.devicePixelRatio;
91
+ const canvasHeight = canvas.clientHeight * window.devicePixelRatio;
92
+ canvas.width = canvasWidth;
93
+ canvas.height = canvasHeight;
94
+ context.scale(window.devicePixelRatio, window.devicePixelRatio);
95
+ context.clearRect(0, 0, canvasWidth, canvasHeight);
96
+ context.strokeStyle = colors_1.RULER_COLOR;
97
+ context.lineWidth = 1;
98
+ context.beginPath();
99
+ console.log(points);
100
+ points.forEach((point) => {
101
+ context.strokeStyle = colors_1.RULER_COLOR;
102
+ context.lineWidth = 1;
103
+ const originDistance = point.position + originOffset - startMarking * scale;
104
+ context.beginPath();
105
+ if (orientation === 'horizontal') {
106
+ context.moveTo(originDistance, 0);
107
+ context.lineTo(originDistance, canvasHeight);
108
+ }
109
+ else {
110
+ context.moveTo(0, originDistance);
111
+ context.lineTo(canvasWidth, originDistance);
112
+ }
113
+ for (let i = 1; i < 5; i++) {
114
+ const markingOffsetXY = i * markingGaps * scale;
115
+ if (orientation === 'horizontal') {
116
+ context.moveTo(originDistance + markingOffsetXY / 5, 0);
117
+ context.lineTo(originDistance + markingOffsetXY / 5, 4);
118
+ }
119
+ else {
120
+ context.moveTo(0, originDistance + markingOffsetXY / 5);
121
+ context.lineTo(4, originDistance + markingOffsetXY / 5);
122
+ }
123
+ }
124
+ context.stroke();
125
+ context.font = '10px Arial, Helvetica, sans-serif';
126
+ context.textAlign = 'left';
127
+ context.fillStyle = colors_1.RULER_COLOR;
128
+ drawLabel({
129
+ orientation,
130
+ context,
131
+ label: point.value.toString(),
132
+ originDistance,
133
+ color: colors_1.RULER_COLOR,
134
+ });
135
+ });
136
+ if (selectedGuide && orientation !== selectedGuide.orientation) {
137
+ (0, exports.drawGuide)({
138
+ canvasHeight,
139
+ canvasWidth,
140
+ context,
141
+ orientation,
142
+ originOffset,
143
+ scale,
144
+ selectedGuide,
145
+ startMarking,
146
+ });
147
+ }
148
+ };
149
+ exports.drawMarkingOnRulerCanvas = drawMarkingOnRulerCanvas;
150
+ const getRulerPoints = ({ rulerScaleRange, rulerMarkingGaps, scale, }) => {
151
+ const points = [];
152
+ const startPoint = Math.ceil(rulerScaleRange.start / rulerMarkingGaps);
153
+ const endPoint = Math.floor(rulerScaleRange.end / rulerMarkingGaps);
154
+ const startMarking = startPoint * rulerMarkingGaps;
155
+ for (let i = startPoint; i <= endPoint; i++) {
156
+ points.push({
157
+ value: i * rulerMarkingGaps,
158
+ position: (0, exports.rulerValueToPosition)({
159
+ scale,
160
+ startMarking,
161
+ value: i * rulerMarkingGaps,
162
+ }),
163
+ });
164
+ }
165
+ return {
166
+ points,
167
+ startMarking,
168
+ };
169
+ };
170
+ exports.getRulerPoints = getRulerPoints;
171
+ const rulerValueToPosition = ({ value, startMarking, scale, }) => {
172
+ return (value + startMarking) * scale;
173
+ };
174
+ exports.rulerValueToPosition = rulerValueToPosition;
175
+ const getRulerScaleRange = ({ canvasLength, containerRef, scale, }) => {
176
+ var _a, _b;
177
+ const scaleRangeBeyondCanvas = (((_b = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) ||
178
+ editor_rulers_1.MINIMUM_VISIBLE_CANVAS_SIZE - editor_rulers_1.MINIMUM_VISIBLE_CANVAS_SIZE) / scale;
179
+ return {
180
+ start: -scaleRangeBeyondCanvas,
181
+ end: scaleRangeBeyondCanvas + canvasLength,
182
+ };
183
+ };
184
+ exports.getRulerScaleRange = getRulerScaleRange;
@@ -13,6 +13,8 @@ const TimelineInOutToggle_1 = require("../components/TimelineInOutToggle");
13
13
  const Checkmark_1 = require("../icons/Checkmark");
14
14
  const canvas_ref_1 = require("../state/canvas-ref");
15
15
  const checkerboard_1 = require("../state/checkerboard");
16
+ const editor_guides_1 = require("../state/editor-guides");
17
+ const editor_rulers_1 = require("../state/editor-rulers");
16
18
  const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
17
19
  const modals_1 = require("../state/modals");
18
20
  const preview_size_1 = require("../state/preview-size");
@@ -33,6 +35,8 @@ const useMenuStructure = (closeMenu) => {
33
35
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
34
36
  const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
35
37
  const { editorZoomGestures, setEditorZoomGestures } = (0, react_1.useContext)(editor_zoom_gestures_1.EditorZoomGesturesContext);
38
+ const { editorShowRulers, setEditorShowRulers } = (0, react_1.useContext)(editor_rulers_1.EditorShowRulersContext);
39
+ const { editorShowGuides, setEditorShowGuides } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
36
40
  const { size, setSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
37
41
  const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
38
42
  const { setSidebarCollapsedState, sidebarCollapsedStateLeft, sidebarCollapsedStateRight, } = (0, react_1.useContext)(sidebar_1.SidebarContext);
@@ -242,6 +246,38 @@ const useMenuStructure = (closeMenu) => {
242
246
  ? 'Disable Zoom and Pan Gestures'
243
247
  : 'Enable Zoom and Pan Gestures',
244
248
  },
249
+ {
250
+ id: 'show-rulers',
251
+ keyHint: null,
252
+ label: 'Show Rulers',
253
+ onClick: () => {
254
+ closeMenu();
255
+ setEditorShowRulers((c) => !c);
256
+ },
257
+ type: 'item',
258
+ value: 'show-ruler',
259
+ leftItem: editorShowRulers ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
260
+ subMenu: null,
261
+ quickSwitcherLabel: editorShowRulers
262
+ ? 'Hide Rulers'
263
+ : 'Show Rulers',
264
+ },
265
+ {
266
+ id: 'show-guides',
267
+ keyHint: null,
268
+ label: 'Show Guides',
269
+ onClick: () => {
270
+ closeMenu();
271
+ setEditorShowGuides((c) => !c);
272
+ },
273
+ type: 'item',
274
+ value: 'show-guides',
275
+ leftItem: editorShowGuides ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
276
+ subMenu: null,
277
+ quickSwitcherLabel: editorShowGuides
278
+ ? 'Hide Guides'
279
+ : 'Show Guides',
280
+ },
245
281
  {
246
282
  id: 'timeline-divider-1',
247
283
  type: 'divider',
@@ -671,6 +707,10 @@ const useMenuStructure = (closeMenu) => {
671
707
  setEditorZoomGestures,
672
708
  setSidebarCollapsedState,
673
709
  setCheckerboard,
710
+ editorShowRulers,
711
+ setEditorShowRulers,
712
+ editorShowGuides,
713
+ setEditorShowGuides,
674
714
  ]);
675
715
  return structure;
676
716
  };
@@ -706,7 +746,7 @@ const itemToSearchResult = (item, setSelectedModal, prefixes) => {
706
746
  id: item.id,
707
747
  onSelected: () => {
708
748
  setSelectedModal(null);
709
- item.onClick(item.id);
749
+ item.onClick(item.id, null);
710
750
  },
711
751
  title: [...prefixes, getItemLabel(item)].join(': '),
712
752
  },
@@ -0,0 +1,16 @@
1
+ import type { Size } from '@remotion/player';
2
+ import type { AssetMetadata } from './get-asset-metadata';
3
+ import type { Dimensions } from './is-current-selected-still';
4
+ export declare const useStudioCanvasDimensions: ({ canvasSize, contentDimensions, assetMetadata, }: {
5
+ canvasSize: Size | null;
6
+ contentDimensions: Dimensions | 'none' | null;
7
+ assetMetadata: AssetMetadata | null;
8
+ }) => {
9
+ canvasDimensions: {
10
+ left: number;
11
+ top: number;
12
+ width: number;
13
+ height: number;
14
+ };
15
+ scale: number;
16
+ };
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useStudioCanvasDimensions = void 0;
4
+ const player_1 = require("@remotion/player");
5
+ const react_1 = require("react");
6
+ const preview_size_1 = require("../state/preview-size");
7
+ const useStudioCanvasDimensions = ({ canvasSize, contentDimensions, assetMetadata, }) => {
8
+ const { size: previewSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
9
+ const { centerX, centerY, scale } = (0, react_1.useMemo)(() => {
10
+ if (contentDimensions === 'none' ||
11
+ contentDimensions === null ||
12
+ (assetMetadata && assetMetadata.type === 'not-found') ||
13
+ !canvasSize) {
14
+ return {
15
+ centerX: previewSize.translation.x,
16
+ centerY: previewSize.translation.y,
17
+ scale: 1,
18
+ };
19
+ }
20
+ return player_1.PlayerInternals.calculateCanvasTransformation({
21
+ canvasSize,
22
+ compositionHeight: contentDimensions.height,
23
+ compositionWidth: contentDimensions.width,
24
+ previewSize: previewSize.size,
25
+ });
26
+ }, [
27
+ canvasSize,
28
+ contentDimensions,
29
+ previewSize.size,
30
+ previewSize.translation.y,
31
+ previewSize.translation.x,
32
+ assetMetadata,
33
+ ]);
34
+ const canvasDimensions = (0, react_1.useMemo)(() => {
35
+ return {
36
+ left: centerX - previewSize.translation.x,
37
+ top: centerY - previewSize.translation.y,
38
+ width: contentDimensions === 'none' || !contentDimensions
39
+ ? (canvasSize === null || canvasSize === void 0 ? void 0 : canvasSize.width) || 0
40
+ : contentDimensions.width * scale,
41
+ height: contentDimensions === 'none' || !contentDimensions
42
+ ? (canvasSize === null || canvasSize === void 0 ? void 0 : canvasSize.height) || 0
43
+ : contentDimensions.height * scale,
44
+ };
45
+ }, [
46
+ scale,
47
+ centerX,
48
+ previewSize.translation.x,
49
+ previewSize.translation.y,
50
+ centerY,
51
+ canvasSize,
52
+ contentDimensions,
53
+ ]);
54
+ return {
55
+ canvasDimensions,
56
+ scale,
57
+ };
58
+ };
59
+ exports.useStudioCanvasDimensions = useStudioCanvasDimensions;
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ export type Guide = {
3
+ orientation: 'horizontal' | 'vertical';
4
+ position: number;
5
+ show: boolean;
6
+ id: string;
7
+ compositionId: string;
8
+ };
9
+ export type GuideState = {
10
+ editorShowGuides: boolean;
11
+ setEditorShowGuides: (cb: (prevState: boolean) => boolean) => void;
12
+ guidesList: Guide[];
13
+ setGuidesList: (cb: (prevState: Guide[]) => Guide[]) => void;
14
+ selectedGuideId: string | null;
15
+ setSelectedGuideId: (cb: (prevState: string | null) => string | null) => void;
16
+ setHoveredGuideId: (cb: (prevState: string | null) => string | null) => void;
17
+ hoveredGuideId: string | null;
18
+ shouldCreateGuideRef: React.MutableRefObject<boolean>;
19
+ shouldDeleteGuideRef: React.MutableRefObject<boolean>;
20
+ };
21
+ export declare const persistEditorShowGuidesOption: (option: boolean) => void;
22
+ export declare const loadEditorShowGuidesOption: () => boolean;
23
+ export declare const persistGuidesList: (guides: Guide[]) => void;
24
+ export declare const loadGuidesList: () => Guide[];
25
+ export declare const EditorShowGuidesContext: import("react").Context<GuideState>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditorShowGuidesContext = exports.loadGuidesList = exports.persistGuidesList = exports.loadEditorShowGuidesOption = exports.persistEditorShowGuidesOption = void 0;
4
+ const react_1 = require("react");
5
+ const persistEditorShowGuidesOption = (option) => {
6
+ localStorage.setItem('remotion.editorShowGuides', String(option));
7
+ };
8
+ exports.persistEditorShowGuidesOption = persistEditorShowGuidesOption;
9
+ const loadEditorShowGuidesOption = () => {
10
+ const item = localStorage.getItem('remotion.editorShowGuides');
11
+ return item === 'true';
12
+ };
13
+ exports.loadEditorShowGuidesOption = loadEditorShowGuidesOption;
14
+ const persistGuidesList = (guides) => {
15
+ localStorage.setItem('remotion.guidesList', JSON.stringify(guides));
16
+ };
17
+ exports.persistGuidesList = persistGuidesList;
18
+ const loadGuidesList = () => {
19
+ const item = localStorage.getItem('remotion.guidesList');
20
+ return item ? JSON.parse(item) : [];
21
+ };
22
+ exports.loadGuidesList = loadGuidesList;
23
+ exports.EditorShowGuidesContext = (0, react_1.createContext)({
24
+ editorShowGuides: false,
25
+ setEditorShowGuides: () => undefined,
26
+ guidesList: [],
27
+ setGuidesList: () => undefined,
28
+ selectedGuideId: null,
29
+ setSelectedGuideId: () => undefined,
30
+ shouldCreateGuideRef: { current: false },
31
+ shouldDeleteGuideRef: { current: false },
32
+ hoveredGuideId: null,
33
+ setHoveredGuideId: () => undefined,
34
+ });
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ type State = {
3
+ editorShowRulers: boolean;
4
+ setEditorShowRulers: (cb: (prevState: boolean) => boolean) => void;
5
+ };
6
+ export declare const persistEditorShowRulersOption: (option: boolean) => void;
7
+ export declare const loadEditorShowRulersOption: () => boolean;
8
+ export declare const EditorShowRulersContext: import("react").Context<State>;
9
+ export declare const RULER_WIDTH = 20;
10
+ export declare const MINIMUM_VISIBLE_CANVAS_SIZE = 50;
11
+ export declare const PREDEFINED_RULER_SCALE_GAPS: number[];
12
+ export declare const MAXIMUM_PREDEFINED_RULER_SCALE_GAP = 5000;
13
+ export declare const MINIMUM_RULER_MARKING_GAP_PX = 50;
14
+ export {};
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MINIMUM_RULER_MARKING_GAP_PX = exports.MAXIMUM_PREDEFINED_RULER_SCALE_GAP = exports.PREDEFINED_RULER_SCALE_GAPS = exports.MINIMUM_VISIBLE_CANVAS_SIZE = exports.RULER_WIDTH = exports.EditorShowRulersContext = exports.loadEditorShowRulersOption = exports.persistEditorShowRulersOption = void 0;
4
+ const react_1 = require("react");
5
+ const persistEditorShowRulersOption = (option) => {
6
+ localStorage.setItem('remotion.editorShowRulers', String(option));
7
+ };
8
+ exports.persistEditorShowRulersOption = persistEditorShowRulersOption;
9
+ const loadEditorShowRulersOption = () => {
10
+ const item = localStorage.getItem('remotion.editorShowRulers');
11
+ return item === 'true';
12
+ };
13
+ exports.loadEditorShowRulersOption = loadEditorShowRulersOption;
14
+ exports.EditorShowRulersContext = (0, react_1.createContext)({
15
+ editorShowRulers: (0, exports.loadEditorShowRulersOption)(),
16
+ setEditorShowRulers: () => undefined,
17
+ });
18
+ exports.RULER_WIDTH = 20;
19
+ exports.MINIMUM_VISIBLE_CANVAS_SIZE = 50;
20
+ exports.PREDEFINED_RULER_SCALE_GAPS = [
21
+ 1, 2, 5, 10, 20, 50, 100, 250, 500, 1000, 2000, 5000,
22
+ ];
23
+ exports.MAXIMUM_PREDEFINED_RULER_SCALE_GAP = 5000;
24
+ exports.MINIMUM_RULER_MARKING_GAP_PX = 50;
@@ -34,7 +34,7 @@ export declare const getCliOptions: (options: {
34
34
  videoBitrate: string | null;
35
35
  height: number | null;
36
36
  width: number | null;
37
- configFileImageFormat: "none" | "png" | "jpeg" | undefined;
37
+ configFileImageFormat: "png" | "jpeg" | "none" | undefined;
38
38
  offthreadVideoCacheSizeInBytes: number | null;
39
39
  deleteAfter: ("1-day" | "3-days" | "7-days" | "30-days") | null;
40
40
  colorSpace: "default" | "bt709";
package/dist/index.d.ts CHANGED
@@ -104,7 +104,7 @@ export declare const CliInternals: {
104
104
  videoBitrate: string | null;
105
105
  height: number | null;
106
106
  width: number | null;
107
- configFileImageFormat: "none" | "png" | "jpeg" | undefined;
107
+ configFileImageFormat: "png" | "jpeg" | "none" | undefined;
108
108
  offthreadVideoCacheSizeInBytes: number | null;
109
109
  deleteAfter: ("1-day" | "3-days" | "7-days" | "30-days") | null;
110
110
  colorSpace: "default" | "bt709";
@@ -116,7 +116,7 @@ export declare const CliInternals: {
116
116
  parsedCli: {
117
117
  "browser-executable": import("@remotion/renderer").BrowserExecutable;
118
118
  "pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
119
- "image-format": "none" | "png" | "jpeg" | "pdf" | "webp";
119
+ "image-format": "png" | "jpeg" | "pdf" | "webp" | "none";
120
120
  "prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
121
121
  "x264-preset": "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
122
122
  "bundle-cache": string;
@@ -187,7 +187,7 @@ export declare const CliInternals: {
187
187
  downloadName: string | null;
188
188
  outName: string | null;
189
189
  configImageFormat: "png" | "jpeg" | "pdf" | "webp" | null;
190
- cliFlag: "none" | "png" | "jpeg" | "pdf" | "webp" | null;
190
+ cliFlag: "png" | "jpeg" | "pdf" | "webp" | "none" | null;
191
191
  isLambda: boolean;
192
192
  fromUi: "png" | "jpeg" | "pdf" | "webp" | null;
193
193
  }) => {
@@ -202,8 +202,8 @@ export declare const CliInternals: {
202
202
  };
203
203
  getVideoImageFormat: ({ codec, uiImageFormat, }: {
204
204
  codec: import("@remotion/renderer").CodecOrUndefined;
205
- uiImageFormat: "none" | "png" | "jpeg" | null;
206
- }) => "none" | "png" | "jpeg";
205
+ uiImageFormat: "png" | "jpeg" | "none" | null;
206
+ }) => "png" | "jpeg" | "none";
207
207
  printCompositions: (compositions: import("remotion").VideoConfig[]) => void;
208
208
  getFinalOutputCodec: ({ cliFlag, configFile, downloadName, outName, uiCodec, compositionCodec, }: {
209
209
  cliFlag: import("@remotion/renderer").CodecOrUndefined;
package/dist/index.js CHANGED
@@ -76,7 +76,7 @@ const cli = async () => {
76
76
  await (0, studio_1.studioCommand)(remotionRoot, args, logLevel);
77
77
  }
78
78
  else if (command === 'lambda') {
79
- await (0, lambda_command_1.lambdaCommand)(remotionRoot, args);
79
+ await (0, lambda_command_1.lambdaCommand)(remotionRoot, args, logLevel);
80
80
  }
81
81
  else if (command === 'cloudrun') {
82
82
  await (0, cloudrun_command_1.cloudrunCommand)(remotionRoot, args, logLevel);
@@ -1 +1,2 @@
1
- export declare const lambdaCommand: (remotionRoot: string, args: string[]) => Promise<never>;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const lambdaCommand: (remotionRoot: string, args: string[], logLevel: LogLevel) => Promise<never>;
@@ -4,13 +4,13 @@ exports.lambdaCommand = void 0;
4
4
  const log_1 = require("./log");
5
5
  const get_package_manager_1 = require("./preview-server/get-package-manager");
6
6
  const update_available_1 = require("./preview-server/update-available");
7
- const lambdaCommand = async (remotionRoot, args) => {
7
+ const lambdaCommand = async (remotionRoot, args, logLevel) => {
8
8
  try {
9
9
  const path = require.resolve('@remotion/lambda', {
10
10
  paths: [remotionRoot],
11
11
  });
12
12
  const { LambdaInternals } = require(path);
13
- await LambdaInternals.executeCommand(args, remotionRoot);
13
+ await LambdaInternals.executeCommand(args, remotionRoot, logLevel);
14
14
  process.exit(0);
15
15
  }
16
16
  catch (err) {
@@ -11,5 +11,5 @@ type Range = {
11
11
  type Ranges = Range[] & {
12
12
  type?: string;
13
13
  };
14
- export declare function parseRange(size: number, str: string | string[]): -1 | -2 | Ranges;
14
+ export declare function parseRange(size: number, str: string | string[]): -1 | Ranges | -2;
15
15
  export {};
@@ -19,7 +19,7 @@ const fetchFolder = ({ publicDir, staticHash, }) => {
19
19
  folder: '.',
20
20
  startPath: publicDir,
21
21
  staticHash,
22
- limit: 1000,
22
+ limit: 10000,
23
23
  }).map((f) => {
24
24
  return {
25
25
  ...f,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.0.62",
3
+ "version": "4.0.65",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -35,11 +35,11 @@
35
35
  "prompts": "2.4.1",
36
36
  "semver": "7.5.3",
37
37
  "source-map": "0.6.1",
38
- "@remotion/bundler": "4.0.62",
39
- "@remotion/player": "4.0.62",
40
- "remotion": "4.0.62",
41
- "@remotion/media-utils": "4.0.62",
42
- "@remotion/renderer": "4.0.62"
38
+ "@remotion/bundler": "4.0.65",
39
+ "@remotion/media-utils": "4.0.65",
40
+ "@remotion/renderer": "4.0.65",
41
+ "remotion": "4.0.65",
42
+ "@remotion/player": "4.0.65"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=16.8.0",
@@ -65,8 +65,8 @@
65
65
  "react-dom": "18.2.0",
66
66
  "vitest": "0.31.1",
67
67
  "zod": "^3.22.3",
68
- "@remotion/tailwind": "4.0.62",
69
- "@remotion/zod-types": "4.0.62"
68
+ "@remotion/zod-types": "4.0.65",
69
+ "@remotion/tailwind": "4.0.65"
70
70
  },
71
71
  "keywords": [
72
72
  "remotion",