@remotion/cli 4.0.63 → 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.
- package/dist/better-opn/index.d.ts +2 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/editor/components/AudioWaveform.js +2 -1
- package/dist/editor/components/Canvas.js +10 -1
- package/dist/editor/components/CompositionSelectorItem.js +42 -1
- package/dist/editor/components/ContextMenu.d.ts +6 -0
- package/dist/editor/components/ContextMenu.js +91 -0
- package/dist/editor/components/CurrentComposition.d.ts +1 -0
- package/dist/editor/components/EditorContexts.js +3 -1
- package/dist/editor/components/EditorGuides/Guide.d.ts +13 -0
- package/dist/editor/components/EditorGuides/Guide.js +91 -0
- package/dist/editor/components/EditorGuides/index.d.ts +10 -0
- package/dist/editor/components/EditorGuides/index.js +32 -0
- package/dist/editor/components/EditorRuler/Ruler.d.ts +1 -0
- package/dist/editor/components/EditorRuler/Ruler.js +81 -16
- package/dist/editor/components/EditorRuler/index.js +117 -48
- package/dist/editor/components/EditorRuler/use-is-ruler-visible.d.ts +1 -0
- package/dist/editor/components/EditorRuler/use-is-ruler-visible.js +12 -0
- package/dist/editor/components/Menu/MenuItem.js +6 -3
- package/dist/editor/components/Menu/MenuSubItem.d.ts +2 -1
- package/dist/editor/components/Menu/MenuSubItem.js +2 -2
- package/dist/editor/components/NewComposition/ComboBox.d.ts +1 -1
- package/dist/editor/components/NewComposition/InputDragger.js +4 -1
- package/dist/editor/components/NewComposition/MenuContent.js +3 -3
- package/dist/editor/components/NewComposition/NewCompCode.d.ts +1 -0
- package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
- package/dist/editor/components/ShowGuidesProvider.js +20 -1
- package/dist/editor/components/Splitter/SplitterHandle.js +3 -0
- package/dist/editor/components/Timeline/TimelineDragHandler.js +85 -5
- package/dist/editor/components/Timeline/TimelineInOutPointerHandle.js +2 -1
- package/dist/editor/components/TopPanel.js +10 -5
- package/dist/editor/components/UpdateCheck.d.ts +1 -0
- package/dist/editor/helpers/colors.d.ts +6 -1
- package/dist/editor/helpers/colors.js +7 -2
- package/dist/editor/helpers/convert-env-variables.d.ts +2 -8
- package/dist/editor/helpers/editor-ruler.d.ts +20 -1
- package/dist/editor/helpers/editor-ruler.js +120 -20
- package/dist/editor/helpers/presets-labels.d.ts +1 -1
- package/dist/editor/helpers/render-modal-sections.d.ts +1 -0
- package/dist/editor/helpers/use-menu-structure.js +41 -1
- package/dist/editor/helpers/use-studio-canvas-dimensions.d.ts +16 -0
- package/dist/editor/helpers/use-studio-canvas-dimensions.js +59 -0
- package/dist/editor/icons/Checkmark.d.ts +1 -0
- package/dist/editor/state/editor-guides.d.ts +19 -3
- package/dist/editor/state/editor-guides.js +19 -2
- package/dist/get-cli-options.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/preview-server/public-folder.js +1 -1
- package/dist/preview-server/routes.d.ts +1 -0
- package/package.json +8 -8
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
export declare const envVariablesObjectToArray: (envVariables: Record<string, string>) => [
|
|
2
|
-
|
|
3
|
-
string
|
|
4
|
-
][];
|
|
5
|
-
export declare const envVariablesArrayToObject: (envVariables: [
|
|
6
|
-
string,
|
|
7
|
-
string
|
|
8
|
-
][]) => Record<string, string>;
|
|
1
|
+
export declare const envVariablesObjectToArray: (envVariables: Record<string, string>) => [string, string][];
|
|
2
|
+
export declare const envVariablesArrayToObject: (envVariables: [string, string][]) => Record<string, string>;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
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, }: {
|
|
2
14
|
scale: number;
|
|
3
15
|
points: Array<{
|
|
4
16
|
position: number;
|
|
@@ -9,6 +21,7 @@ export declare const drawMarkingOnRulerCanvas: ({ scale, points, startMarking, o
|
|
|
9
21
|
markingGaps: number;
|
|
10
22
|
orientation: 'horizontal' | 'vertical';
|
|
11
23
|
rulerCanvasRef: React.RefObject<HTMLCanvasElement>;
|
|
24
|
+
selectedGuide: Guide | null;
|
|
12
25
|
}) => void;
|
|
13
26
|
export declare const getRulerPoints: ({ rulerScaleRange, rulerMarkingGaps, scale, }: {
|
|
14
27
|
rulerScaleRange: {
|
|
@@ -24,6 +37,11 @@ export declare const getRulerPoints: ({ rulerScaleRange, rulerMarkingGaps, scale
|
|
|
24
37
|
}[];
|
|
25
38
|
startMarking: number;
|
|
26
39
|
};
|
|
40
|
+
export declare const rulerValueToPosition: ({ value, startMarking, scale, }: {
|
|
41
|
+
value: number;
|
|
42
|
+
startMarking: number;
|
|
43
|
+
scale: number;
|
|
44
|
+
}) => number;
|
|
27
45
|
export declare const getRulerScaleRange: ({ canvasLength, containerRef, scale, }: {
|
|
28
46
|
canvasLength: number;
|
|
29
47
|
containerRef: React.RefObject<HTMLDivElement>;
|
|
@@ -32,3 +50,4 @@ export declare const getRulerScaleRange: ({ canvasLength, containerRef, scale, }
|
|
|
32
50
|
start: number;
|
|
33
51
|
end: number;
|
|
34
52
|
};
|
|
53
|
+
export {};
|
|
@@ -1,8 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRulerScaleRange = exports.getRulerPoints = exports.drawMarkingOnRulerCanvas = void 0;
|
|
3
|
+
exports.getRulerScaleRange = exports.rulerValueToPosition = exports.getRulerPoints = exports.drawMarkingOnRulerCanvas = exports.drawGuide = void 0;
|
|
4
4
|
const editor_rulers_1 = require("../state/editor-rulers");
|
|
5
|
-
const
|
|
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, }) => {
|
|
6
84
|
const canvas = rulerCanvasRef.current;
|
|
7
85
|
if (!canvas)
|
|
8
86
|
return;
|
|
@@ -15,12 +93,13 @@ const drawMarkingOnRulerCanvas = ({ scale, points, startMarking, originOffset, m
|
|
|
15
93
|
canvas.height = canvasHeight;
|
|
16
94
|
context.scale(window.devicePixelRatio, window.devicePixelRatio);
|
|
17
95
|
context.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
18
|
-
context.strokeStyle =
|
|
96
|
+
context.strokeStyle = colors_1.RULER_COLOR;
|
|
19
97
|
context.lineWidth = 1;
|
|
20
98
|
context.beginPath();
|
|
21
|
-
|
|
22
|
-
context.lineWidth = 1;
|
|
99
|
+
console.log(points);
|
|
23
100
|
points.forEach((point) => {
|
|
101
|
+
context.strokeStyle = colors_1.RULER_COLOR;
|
|
102
|
+
context.lineWidth = 1;
|
|
24
103
|
const originDistance = point.position + originOffset - startMarking * scale;
|
|
25
104
|
context.beginPath();
|
|
26
105
|
if (orientation === 'horizontal') {
|
|
@@ -32,46 +111,67 @@ const drawMarkingOnRulerCanvas = ({ scale, points, startMarking, originOffset, m
|
|
|
32
111
|
context.lineTo(canvasWidth, originDistance);
|
|
33
112
|
}
|
|
34
113
|
for (let i = 1; i < 5; i++) {
|
|
114
|
+
const markingOffsetXY = i * markingGaps * scale;
|
|
35
115
|
if (orientation === 'horizontal') {
|
|
36
|
-
context.moveTo(originDistance +
|
|
37
|
-
context.lineTo(originDistance +
|
|
116
|
+
context.moveTo(originDistance + markingOffsetXY / 5, 0);
|
|
117
|
+
context.lineTo(originDistance + markingOffsetXY / 5, 4);
|
|
38
118
|
}
|
|
39
119
|
else {
|
|
40
|
-
context.moveTo(0, originDistance +
|
|
41
|
-
context.lineTo(4, originDistance +
|
|
120
|
+
context.moveTo(0, originDistance + markingOffsetXY / 5);
|
|
121
|
+
context.lineTo(4, originDistance + markingOffsetXY / 5);
|
|
42
122
|
}
|
|
43
123
|
}
|
|
44
124
|
context.stroke();
|
|
45
125
|
context.font = '10px Arial, Helvetica, sans-serif';
|
|
46
126
|
context.textAlign = 'left';
|
|
47
|
-
context.fillStyle =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
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
|
+
});
|
|
56
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
|
+
}
|
|
57
148
|
};
|
|
58
149
|
exports.drawMarkingOnRulerCanvas = drawMarkingOnRulerCanvas;
|
|
59
150
|
const getRulerPoints = ({ rulerScaleRange, rulerMarkingGaps, scale, }) => {
|
|
60
151
|
const points = [];
|
|
61
152
|
const startPoint = Math.ceil(rulerScaleRange.start / rulerMarkingGaps);
|
|
62
153
|
const endPoint = Math.floor(rulerScaleRange.end / rulerMarkingGaps);
|
|
154
|
+
const startMarking = startPoint * rulerMarkingGaps;
|
|
63
155
|
for (let i = startPoint; i <= endPoint; i++) {
|
|
64
156
|
points.push({
|
|
65
157
|
value: i * rulerMarkingGaps,
|
|
66
|
-
position: (
|
|
158
|
+
position: (0, exports.rulerValueToPosition)({
|
|
159
|
+
scale,
|
|
160
|
+
startMarking,
|
|
161
|
+
value: i * rulerMarkingGaps,
|
|
162
|
+
}),
|
|
67
163
|
});
|
|
68
164
|
}
|
|
69
165
|
return {
|
|
70
166
|
points,
|
|
71
|
-
startMarking
|
|
167
|
+
startMarking,
|
|
72
168
|
};
|
|
73
169
|
};
|
|
74
170
|
exports.getRulerPoints = getRulerPoints;
|
|
171
|
+
const rulerValueToPosition = ({ value, startMarking, scale, }) => {
|
|
172
|
+
return (value + startMarking) * scale;
|
|
173
|
+
};
|
|
174
|
+
exports.rulerValueToPosition = rulerValueToPosition;
|
|
75
175
|
const getRulerScaleRange = ({ canvasLength, containerRef, scale, }) => {
|
|
76
176
|
var _a, _b;
|
|
77
177
|
const scaleRangeBeyondCanvas = (((_b = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) ||
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { X264Preset } from '@remotion/renderer';
|
|
2
|
-
export declare const labelx264Preset: (profile: X264Preset) => "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
2
|
+
export declare const labelx264Preset: (profile: X264Preset) => "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
@@ -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;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
type
|
|
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 = {
|
|
3
10
|
editorShowGuides: boolean;
|
|
4
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>;
|
|
5
20
|
};
|
|
6
21
|
export declare const persistEditorShowGuidesOption: (option: boolean) => void;
|
|
7
22
|
export declare const loadEditorShowGuidesOption: () => boolean;
|
|
8
|
-
export declare const
|
|
9
|
-
export
|
|
23
|
+
export declare const persistGuidesList: (guides: Guide[]) => void;
|
|
24
|
+
export declare const loadGuidesList: () => Guide[];
|
|
25
|
+
export declare const EditorShowGuidesContext: import("react").Context<GuideState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EditorShowGuidesContext = exports.loadEditorShowGuidesOption = exports.persistEditorShowGuidesOption = void 0;
|
|
3
|
+
exports.EditorShowGuidesContext = exports.loadGuidesList = exports.persistGuidesList = exports.loadEditorShowGuidesOption = exports.persistEditorShowGuidesOption = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const persistEditorShowGuidesOption = (option) => {
|
|
6
6
|
localStorage.setItem('remotion.editorShowGuides', String(option));
|
|
@@ -11,7 +11,24 @@ const loadEditorShowGuidesOption = () => {
|
|
|
11
11
|
return item === 'true';
|
|
12
12
|
};
|
|
13
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;
|
|
14
23
|
exports.EditorShowGuidesContext = (0, react_1.createContext)({
|
|
15
|
-
editorShowGuides:
|
|
24
|
+
editorShowGuides: false,
|
|
16
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,
|
|
17
34
|
});
|
|
@@ -17,7 +17,7 @@ export declare const getCliOptions: (options: {
|
|
|
17
17
|
crf: import("@remotion/renderer").Crf | null;
|
|
18
18
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
19
19
|
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
20
|
-
x264Preset: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
20
|
+
x264Preset: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
21
21
|
everyNthFrame: number;
|
|
22
22
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
23
23
|
stillFrame: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export declare const CliInternals: {
|
|
|
87
87
|
crf: import("@remotion/renderer").Crf | null;
|
|
88
88
|
pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
89
89
|
proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
|
|
90
|
-
x264Preset: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
90
|
+
x264Preset: "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
91
91
|
everyNthFrame: number;
|
|
92
92
|
numberOfGifLoops: import("./config/number-of-gif-loops").Loop;
|
|
93
93
|
stillFrame: number;
|
|
@@ -118,7 +118,7 @@ export declare const CliInternals: {
|
|
|
118
118
|
"pixel-format": "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
119
119
|
"image-format": "png" | "jpeg" | "pdf" | "webp" | "none";
|
|
120
120
|
"prores-profile": "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy";
|
|
121
|
-
"x264-preset": "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "
|
|
121
|
+
"x264-preset": "medium" | "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "slow" | "slower" | "veryslow" | "placebo";
|
|
122
122
|
"bundle-cache": string;
|
|
123
123
|
"env-file": string;
|
|
124
124
|
"ignore-certificate-errors": string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "4.0.
|
|
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.
|
|
39
|
-
"@remotion/
|
|
40
|
-
"@remotion/
|
|
41
|
-
"
|
|
42
|
-
"remotion": "4.0.
|
|
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/zod-types": "4.0.
|
|
69
|
-
"@remotion/tailwind": "4.0.
|
|
68
|
+
"@remotion/zod-types": "4.0.65",
|
|
69
|
+
"@remotion/tailwind": "4.0.65"
|
|
70
70
|
},
|
|
71
71
|
"keywords": [
|
|
72
72
|
"remotion",
|