@remotion/studio 4.0.100 → 4.0.103
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/.turbo/turbo-build.log +1 -1
- package/LICENSE.md +1 -1
- package/dist/components/Canvas.d.ts +2 -0
- package/dist/components/Canvas.js +1 -5
- package/dist/components/CanvasOrLoading.d.ts +4 -1
- package/dist/components/CanvasOrLoading.js +2 -2
- package/dist/components/Editor.js +29 -2
- package/dist/components/EditorContent.d.ts +1 -0
- package/dist/components/EditorContent.js +2 -2
- package/dist/components/EditorRuler/Ruler.d.ts +2 -1
- package/dist/components/EditorRuler/Ruler.js +11 -8
- package/dist/components/EditorRuler/index.d.ts +1 -1
- package/dist/components/EditorRuler/index.js +13 -15
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/components/OpenEditorButton.d.ts +3 -1
- package/dist/components/OpenEditorButton.js +31 -20
- package/dist/components/Timeline/TimelineStack/index.js +44 -13
- package/dist/components/TopPanel.d.ts +1 -0
- package/dist/components/TopPanel.js +12 -2
- package/dist/helpers/checkerboard-background.d.ts +1 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/editor-ruler.d.ts +6 -3
- package/dist/helpers/editor-ruler.js +3 -6
- package/dist/helpers/get-git-menu-item.d.ts +7 -0
- package/dist/helpers/get-git-menu-item.js +43 -0
- package/dist/helpers/render-modal-sections.d.ts +1 -0
- package/dist/helpers/use-menu-structure.js +2 -0
- package/dist/index.d.ts +1 -1
- package/package.json +7 -7
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
package/LICENSE.md
CHANGED
|
@@ -36,7 +36,7 @@ const resetZoom = {
|
|
|
36
36
|
right: layout_1.SPACING_UNIT * 2,
|
|
37
37
|
};
|
|
38
38
|
const ZOOM_PX_FACTOR = 0.003;
|
|
39
|
-
const Canvas = ({ canvasContent }) => {
|
|
39
|
+
const Canvas = ({ canvasContent, size }) => {
|
|
40
40
|
const { setSize, size: previewSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
|
|
41
41
|
const { editorZoomGestures } = (0, react_1.useContext)(editor_zoom_gestures_1.EditorZoomGesturesContext);
|
|
42
42
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
@@ -55,10 +55,6 @@ const Canvas = ({ canvasContent }) => {
|
|
|
55
55
|
}
|
|
56
56
|
return null;
|
|
57
57
|
}, [assetResolution, config, canvasContent]);
|
|
58
|
-
const size = player_1.PlayerInternals.useElementSize(canvas_ref_1.canvasRef, {
|
|
59
|
-
triggerOnWindowResize: false,
|
|
60
|
-
shouldApplyCssTransforms: true,
|
|
61
|
-
});
|
|
62
58
|
const isFit = previewSize.size === 'auto';
|
|
63
59
|
const onWheel = (0, react_1.useCallback)((e) => {
|
|
64
60
|
if (!editorZoomGestures) {
|
|
@@ -24,7 +24,7 @@ const container = {
|
|
|
24
24
|
backgroundColor: colors_1.BACKGROUND,
|
|
25
25
|
flexDirection: 'column',
|
|
26
26
|
};
|
|
27
|
-
const CanvasOrLoading = () => {
|
|
27
|
+
const CanvasOrLoading = ({ size }) => {
|
|
28
28
|
const resolved = remotion_1.Internals.useResolvedVideoConfig(null);
|
|
29
29
|
const [takesALongTime, setTakesALongTime] = (0, react_1.useState)(false);
|
|
30
30
|
const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
@@ -60,7 +60,7 @@ const CanvasOrLoading = () => {
|
|
|
60
60
|
if (!canvasContent) {
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
|
-
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, { canvasContent: canvasContent })] }));
|
|
63
|
+
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, { size: size, canvasContent: canvasContent })] }));
|
|
64
64
|
if (canvasContent.type === 'asset' || canvasContent.type === 'output') {
|
|
65
65
|
return content;
|
|
66
66
|
}
|
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.Editor = void 0;
|
|
4
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
6
29
|
const remotion_1 = require("remotion");
|
|
7
30
|
const colors_1 = require("../helpers/colors");
|
|
8
31
|
const noop_1 = require("../helpers/noop");
|
|
@@ -35,6 +58,10 @@ const Editor = ({ Root, readOnlyStudio, }) => {
|
|
|
35
58
|
window.removeEventListener('beforeunload', listenToChanges);
|
|
36
59
|
};
|
|
37
60
|
}, [readOnlyStudio]);
|
|
38
|
-
|
|
61
|
+
const [canvasMounted, setCanvasMounted] = react_1.default.useState(false);
|
|
62
|
+
const onMounted = (0, react_1.useCallback)(() => {
|
|
63
|
+
setCanvasMounted(true);
|
|
64
|
+
}, []);
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsxs)(timeline_zoom_1.TimelineZoomContext, { children: [(0, jsx_runtime_1.jsxs)("div", { style: background, children: [canvasMounted ? (0, jsx_runtime_1.jsx)(Root, {}) : null, (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, { onMounted: onMounted, readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {})] }), (0, jsx_runtime_1.jsx)(Modals_1.Modals, { readOnlyStudio: readOnlyStudio })] }) }));
|
|
39
66
|
};
|
|
40
67
|
exports.Editor = Editor;
|
|
@@ -19,11 +19,11 @@ const container = {
|
|
|
19
19
|
flex: 1,
|
|
20
20
|
height: 0,
|
|
21
21
|
};
|
|
22
|
-
const EditorContent = ({ readOnlyStudio }) => {
|
|
22
|
+
const EditorContent = ({ readOnlyStudio, onMounted }) => {
|
|
23
23
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
24
24
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
25
25
|
// Preventing multiple renders so the update check doesn't get rendered twice and needs to be aborted
|
|
26
26
|
const onlyTopPanel = canvasContent === null || isStill || canvasContent.type !== 'composition';
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(InitialCompositionLoader_1.InitialCompositionLoader, {}), (0, jsx_runtime_1.jsx)(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), onlyTopPanel ? ((0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, { readOnlyStudio: readOnlyStudio })) : ((0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, { readOnlyStudio: readOnlyStudio }) }), (0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(Timeline_1.Timeline, {}) })] }))] }));
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(InitialCompositionLoader_1.InitialCompositionLoader, {}), (0, jsx_runtime_1.jsx)(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), onlyTopPanel ? ((0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, { onMounted: onMounted, readOnlyStudio: readOnlyStudio })) : ((0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, { onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }), (0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(Timeline_1.Timeline, {}) })] }))] }));
|
|
28
28
|
};
|
|
29
29
|
exports.EditorContent = EditorContent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Size } from '@remotion/player';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
interface Point {
|
|
3
4
|
value: number;
|
|
@@ -8,9 +9,9 @@ interface RulerProps {
|
|
|
8
9
|
points: Point[];
|
|
9
10
|
originOffset: number;
|
|
10
11
|
startMarking: number;
|
|
11
|
-
containerRef: React.RefObject<HTMLDivElement>;
|
|
12
12
|
markingGaps: number;
|
|
13
13
|
orientation: 'horizontal' | 'vertical';
|
|
14
|
+
size: Size;
|
|
14
15
|
}
|
|
15
16
|
declare const Ruler: React.FC<RulerProps>;
|
|
16
17
|
export default Ruler;
|
|
@@ -10,8 +10,7 @@ const editor_rulers_1 = require("../../state/editor-rulers");
|
|
|
10
10
|
const makeGuideId = () => {
|
|
11
11
|
return Math.random().toString(36).substring(7);
|
|
12
12
|
};
|
|
13
|
-
const Ruler = ({ scale, points, originOffset, startMarking,
|
|
14
|
-
var _a;
|
|
13
|
+
const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, orientation, }) => {
|
|
15
14
|
const rulerCanvasRef = (0, react_1.useRef)(null);
|
|
16
15
|
const isVerticalRuler = orientation === 'vertical';
|
|
17
16
|
const { shouldCreateGuideRef, setGuidesList, selectedGuideId, hoveredGuideId, setSelectedGuideId, guidesList, setEditorShowGuides, } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
|
|
@@ -24,6 +23,8 @@ const Ruler = ({ scale, points, originOffset, startMarking, containerRef, markin
|
|
|
24
23
|
var _a, _b;
|
|
25
24
|
return ((_b = (_a = guidesList.find((guide) => guide.id === selectedGuideId)) !== null && _a !== void 0 ? _a : guidesList.find((guide) => guide.id === hoveredGuideId)) !== null && _b !== void 0 ? _b : null);
|
|
26
25
|
}, [guidesList, hoveredGuideId, selectedGuideId]);
|
|
26
|
+
const rulerWidth = isVerticalRuler ? editor_rulers_1.RULER_WIDTH : size.width - editor_rulers_1.RULER_WIDTH;
|
|
27
|
+
const rulerHeight = isVerticalRuler ? size.height - editor_rulers_1.RULER_WIDTH : editor_rulers_1.RULER_WIDTH;
|
|
27
28
|
(0, react_1.useEffect)(() => {
|
|
28
29
|
(0, editor_ruler_1.drawMarkingOnRulerCanvas)({
|
|
29
30
|
scale,
|
|
@@ -34,6 +35,8 @@ const Ruler = ({ scale, points, originOffset, startMarking, containerRef, markin
|
|
|
34
35
|
orientation,
|
|
35
36
|
rulerCanvasRef,
|
|
36
37
|
selectedGuide: selectedOrHoveredGuide,
|
|
38
|
+
canvasHeight: rulerHeight * window.devicePixelRatio,
|
|
39
|
+
canvasWidth: rulerWidth * window.devicePixelRatio,
|
|
37
40
|
});
|
|
38
41
|
}, [
|
|
39
42
|
scale,
|
|
@@ -43,15 +46,15 @@ const Ruler = ({ scale, points, originOffset, startMarking, containerRef, markin
|
|
|
43
46
|
markingGaps,
|
|
44
47
|
orientation,
|
|
45
48
|
selectedOrHoveredGuide,
|
|
49
|
+
size,
|
|
50
|
+
rulerHeight,
|
|
51
|
+
rulerWidth,
|
|
46
52
|
]);
|
|
47
|
-
const { width: canvasContainerWidth, height: canvasContainerHeight } = ((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || { width: 0, height: 0 };
|
|
48
|
-
const rulerWidth = isVerticalRuler ? editor_rulers_1.RULER_WIDTH : canvasContainerWidth;
|
|
49
|
-
const rulerHeight = isVerticalRuler ? canvasContainerHeight : editor_rulers_1.RULER_WIDTH;
|
|
50
53
|
const rulerStyle = (0, react_1.useMemo)(() => ({
|
|
51
54
|
position: 'absolute',
|
|
52
55
|
background: colors_1.BACKGROUND,
|
|
53
|
-
width:
|
|
54
|
-
height:
|
|
56
|
+
width: rulerWidth,
|
|
57
|
+
height: rulerHeight,
|
|
55
58
|
left: isVerticalRuler ? 0 : 'unset',
|
|
56
59
|
top: isVerticalRuler ? 'unset' : 0,
|
|
57
60
|
borderBottom: isVerticalRuler ? undefined : '1px solid ' + colors_1.RULER_COLOR,
|
|
@@ -100,6 +103,6 @@ const Ruler = ({ scale, points, originOffset, startMarking, containerRef, markin
|
|
|
100
103
|
setCursor(isVerticalRuler ? 'ew-resize' : 'ns-resize');
|
|
101
104
|
}
|
|
102
105
|
}, [selectedGuideId, isVerticalRuler]);
|
|
103
|
-
return ((0, jsx_runtime_1.jsx)("canvas", { ref: rulerCanvasRef, width: rulerWidth * devicePixelRatio, height: rulerHeight * devicePixelRatio, style: rulerStyle, onPointerDown: onMouseDown, onPointerEnter: changeCursor, onPointerLeave: changeCursor }));
|
|
106
|
+
return ((0, jsx_runtime_1.jsx)("canvas", { ref: rulerCanvasRef, width: rulerWidth * window.devicePixelRatio, height: rulerHeight * window.devicePixelRatio, style: rulerStyle, onPointerDown: onMouseDown, onPointerEnter: changeCursor, onPointerLeave: changeCursor }));
|
|
104
107
|
};
|
|
105
108
|
exports.default = Ruler;
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { AssetMetadata } from '../../helpers/get-asset-metadata';
|
|
4
4
|
import type { Dimensions } from '../../helpers/is-current-selected-still';
|
|
5
5
|
export declare const EditorRulers: React.FC<{
|
|
6
|
-
canvasSize: Size
|
|
6
|
+
canvasSize: Size;
|
|
7
7
|
contentDimensions: Dimensions | 'none' | null;
|
|
8
8
|
assetMetadata: AssetMetadata | null;
|
|
9
9
|
containerRef: React.RefObject<HTMLDivElement>;
|
|
@@ -23,7 +23,7 @@ const originBlockStyles = {
|
|
|
23
23
|
background: colors_1.BACKGROUND,
|
|
24
24
|
};
|
|
25
25
|
const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerRef }) => {
|
|
26
|
-
const { scale
|
|
26
|
+
const { scale } = (0, use_studio_canvas_dimensions_1.useStudioCanvasDimensions)({
|
|
27
27
|
canvasSize,
|
|
28
28
|
contentDimensions,
|
|
29
29
|
assetMetadata,
|
|
@@ -35,15 +35,15 @@ const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerR
|
|
|
35
35
|
return predefinedGap || editor_rulers_1.MAXIMUM_PREDEFINED_RULER_SCALE_GAP;
|
|
36
36
|
}, [scale]);
|
|
37
37
|
const horizontalRulerScaleRange = (0, react_1.useMemo)(() => (0, editor_ruler_1.getRulerScaleRange)({
|
|
38
|
-
canvasLength:
|
|
39
|
-
containerRef,
|
|
38
|
+
canvasLength: canvasSize.width,
|
|
40
39
|
scale,
|
|
41
|
-
|
|
40
|
+
canvasSize,
|
|
41
|
+
}), [canvasSize, scale]);
|
|
42
42
|
const verticalRulerScaleRange = (0, react_1.useMemo)(() => (0, editor_ruler_1.getRulerScaleRange)({
|
|
43
|
-
canvasLength:
|
|
44
|
-
containerRef,
|
|
43
|
+
canvasLength: canvasSize.height,
|
|
45
44
|
scale,
|
|
46
|
-
|
|
45
|
+
canvasSize,
|
|
46
|
+
}), [canvasSize, scale]);
|
|
47
47
|
const { points: horizontalRulerPoints, startMarking: horizontalRulerStartMarking, } = (0, react_1.useMemo)(() => (0, editor_ruler_1.getRulerPoints)({
|
|
48
48
|
rulerScaleRange: horizontalRulerScaleRange,
|
|
49
49
|
rulerMarkingGaps,
|
|
@@ -98,10 +98,8 @@ const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerR
|
|
|
98
98
|
return guide;
|
|
99
99
|
}
|
|
100
100
|
const position = guide.orientation === 'vertical'
|
|
101
|
-
? (mouseX - containerLeft) / scale -
|
|
102
|
-
|
|
103
|
-
: (mouseY - containerTop) / scale -
|
|
104
|
-
canvasDimensions.top / scale;
|
|
101
|
+
? (mouseX - containerLeft) / scale - canvasSize.left / scale
|
|
102
|
+
: (mouseY - containerTop) / scale - canvasSize.top / scale;
|
|
105
103
|
const desiredCursor = guide.orientation === 'vertical' ? 'ew-resize' : 'ns-resize';
|
|
106
104
|
if (document.body.style.cursor !== desiredCursor) {
|
|
107
105
|
document.body.style.cursor = desiredCursor;
|
|
@@ -118,11 +116,11 @@ const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerR
|
|
|
118
116
|
}, [
|
|
119
117
|
containerRef,
|
|
120
118
|
shouldDeleteGuideRef,
|
|
119
|
+
setGuidesList,
|
|
121
120
|
selectedGuideId,
|
|
122
121
|
scale,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
canvasDimensions.top,
|
|
122
|
+
canvasSize.left,
|
|
123
|
+
canvasSize.top,
|
|
126
124
|
]);
|
|
127
125
|
const onMouseUp = (0, react_1.useCallback)(() => {
|
|
128
126
|
setGuidesList((prevState) => {
|
|
@@ -162,6 +160,6 @@ const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerR
|
|
|
162
160
|
}
|
|
163
161
|
};
|
|
164
162
|
}, [selectedGuideId, onMouseMove, onMouseUp]);
|
|
165
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: originBlockStyles }), (0, jsx_runtime_1.jsx)(Ruler_1.default, { orientation: "horizontal", scale: scale, points: horizontalRulerPoints, startMarking: horizontalRulerStartMarking,
|
|
163
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: originBlockStyles }), (0, jsx_runtime_1.jsx)(Ruler_1.default, { orientation: "horizontal", scale: scale, points: horizontalRulerPoints, startMarking: horizontalRulerStartMarking, markingGaps: rulerMarkingGaps, originOffset: canvasSize.left, size: canvasSize }), (0, jsx_runtime_1.jsx)(Ruler_1.default, { orientation: "vertical", scale: scale, points: verticalRulerPoints, startMarking: verticalRulerStartMarking, markingGaps: rulerMarkingGaps, originOffset: canvasSize.top, size: canvasSize })] }));
|
|
166
164
|
};
|
|
167
165
|
exports.EditorRulers = EditorRulers;
|
|
@@ -40,6 +40,6 @@ const MenuBuildIndicator = () => {
|
|
|
40
40
|
window.remotion_finishedBuilding = undefined;
|
|
41
41
|
};
|
|
42
42
|
}, []);
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: cwd, title: window.remotion_cwd, children: [showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }) : null, isBuilding ? ((0, jsx_runtime_1.jsx)("div", { style: spinner, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize }) })) : ((0, jsx_runtime_1.jsx)("div", { style: noSpinner })), showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }) : null, window.remotion_projectName, showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.25 }) : null, showButton ? (0, jsx_runtime_1.jsx)(OpenEditorButton_1.OpenEditorButton, {}) : null] }));
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: cwd, title: window.remotion_cwd, children: [showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }) : null, isBuilding ? ((0, jsx_runtime_1.jsx)("div", { style: spinner, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize }) })) : ((0, jsx_runtime_1.jsx)("div", { style: noSpinner })), showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }) : null, window.remotion_projectName, showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.25 }) : null, showButton ? ((0, jsx_runtime_1.jsx)(OpenEditorButton_1.OpenEditorButton, { type: "editor" })) : window.remotion_gitSource ? ((0, jsx_runtime_1.jsx)(OpenEditorButton_1.OpenEditorButton, { type: "git" })) : null] }));
|
|
44
44
|
};
|
|
45
45
|
exports.MenuBuildIndicator = MenuBuildIndicator;
|
|
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
|
|
|
12
12
|
status: 'error' | 'warning' | 'ok';
|
|
13
13
|
isFocused: boolean;
|
|
14
14
|
isHovered: boolean;
|
|
15
|
-
}) => "
|
|
15
|
+
}) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
|
|
16
16
|
export declare const RemotionInput: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export {};
|
|
@@ -4,6 +4,7 @@ exports.OpenEditorButton = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const get_git_menu_item_1 = require("../helpers/get-git-menu-item");
|
|
7
8
|
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
8
9
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
9
10
|
const svgStyle = {
|
|
@@ -17,32 +18,42 @@ const buttonStyle = {
|
|
|
17
18
|
justifyContent: 'center',
|
|
18
19
|
alignItems: 'center',
|
|
19
20
|
};
|
|
20
|
-
const OpenEditorButton = () => {
|
|
21
|
+
const OpenEditorButton = ({ type }) => {
|
|
21
22
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
22
23
|
const svgFillColor = (0, react_1.useMemo)(() => {
|
|
23
24
|
return hovered ? 'white' : colors_1.LIGHT_TEXT;
|
|
24
25
|
}, [hovered]);
|
|
25
|
-
const handleClick = async () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
const handleClick = (0, react_1.useCallback)(async () => {
|
|
27
|
+
if (type === 'editor') {
|
|
28
|
+
await (0, open_in_editor_1.openInEditor)({
|
|
29
|
+
originalFileName: `${window.remotion_cwd}`,
|
|
30
|
+
originalLineNumber: 1,
|
|
31
|
+
originalColumnNumber: 1,
|
|
32
|
+
originalFunctionName: null,
|
|
33
|
+
originalScriptCode: null,
|
|
34
|
+
})
|
|
35
|
+
.then((res) => res.json())
|
|
36
|
+
.then(({ success }) => {
|
|
37
|
+
if (!success) {
|
|
38
|
+
(0, NotificationCenter_1.sendErrorNotification)(`Could not open ${window.remotion_editorName}`);
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
// eslint-disable-next-line no-console
|
|
43
|
+
console.error(err);
|
|
36
44
|
(0, NotificationCenter_1.sendErrorNotification)(`Could not open ${window.remotion_editorName}`);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (type === 'git') {
|
|
48
|
+
if (!window.remotion_gitSource) {
|
|
49
|
+
throw new Error('No git source');
|
|
37
50
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const buttonTooltip = `Open in ${window.remotion_editorName}`;
|
|
51
|
+
window.open((0, get_git_menu_item_1.getGitSourceBranchUrl)(window.remotion_gitSource), '_blank');
|
|
52
|
+
}
|
|
53
|
+
}, [type]);
|
|
54
|
+
const buttonTooltip = type === 'git'
|
|
55
|
+
? `Open ${(0, get_git_menu_item_1.getGitSourceName)(window.remotion_gitSource)} Repo`
|
|
56
|
+
: `Open in ${window.remotion_editorName}`;
|
|
46
57
|
const openInEditorSvg = ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: svgFillColor, d: "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z" }) }));
|
|
47
58
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
48
59
|
setHovered(true);
|
|
@@ -5,7 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const source_map_1 = require("source-map");
|
|
8
|
+
const client_id_1 = require("../../../helpers/client-id");
|
|
8
9
|
const colors_1 = require("../../../helpers/colors");
|
|
10
|
+
const get_git_menu_item_1 = require("../../../helpers/get-git-menu-item");
|
|
9
11
|
const open_in_editor_1 = require("../../../helpers/open-in-editor");
|
|
10
12
|
const url_state_1 = require("../../../helpers/url-state");
|
|
11
13
|
const InitialCompositionLoader_1 = require("../../InitialCompositionLoader");
|
|
@@ -24,6 +26,8 @@ const TimelineStack = ({ isCompact, sequence }) => {
|
|
|
24
26
|
const [titleHovered, setTitleHovered] = (0, react_1.useState)(false);
|
|
25
27
|
const [opening, setOpening] = (0, react_1.useState)(false);
|
|
26
28
|
const selectAsset = (0, InitialCompositionLoader_1.useSelectAsset)();
|
|
29
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
30
|
+
.previewServerState.type;
|
|
27
31
|
const assetPath = (0, react_1.useMemo)(() => {
|
|
28
32
|
if (sequence.type !== 'video' && sequence.type !== 'audio') {
|
|
29
33
|
return null;
|
|
@@ -60,7 +64,16 @@ const TimelineStack = ({ isCompact, sequence }) => {
|
|
|
60
64
|
setOpening(false);
|
|
61
65
|
}
|
|
62
66
|
}, []);
|
|
67
|
+
const canOpenInEditor = window.remotion_editorName &&
|
|
68
|
+
connectionStatus === 'connected' &&
|
|
69
|
+
originalLocation;
|
|
70
|
+
const canOpenInGitHub = window.remotion_gitSource && originalLocation;
|
|
71
|
+
const titleHoverable = (isCompact && (canOpenInEditor || canOpenInGitHub)) || assetPath;
|
|
72
|
+
const stackHoverable = !isCompact && (canOpenInEditor || canOpenInGitHub);
|
|
63
73
|
const onClickTitle = (0, react_1.useCallback)(() => {
|
|
74
|
+
if (!titleHoverable) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
64
77
|
if (assetPath) {
|
|
65
78
|
navigateToAsset(assetPath);
|
|
66
79
|
return;
|
|
@@ -68,14 +81,34 @@ const TimelineStack = ({ isCompact, sequence }) => {
|
|
|
68
81
|
if (!originalLocation) {
|
|
69
82
|
return;
|
|
70
83
|
}
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
if (canOpenInEditor) {
|
|
85
|
+
openEditor(originalLocation);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (canOpenInGitHub) {
|
|
89
|
+
window.open((0, get_git_menu_item_1.getGitRefUrl)(window.remotion_gitSource, originalLocation), '_blank');
|
|
90
|
+
}
|
|
91
|
+
}, [
|
|
92
|
+
assetPath,
|
|
93
|
+
canOpenInEditor,
|
|
94
|
+
canOpenInGitHub,
|
|
95
|
+
navigateToAsset,
|
|
96
|
+
openEditor,
|
|
97
|
+
originalLocation,
|
|
98
|
+
titleHoverable,
|
|
99
|
+
]);
|
|
73
100
|
const onClickStack = (0, react_1.useCallback)(() => {
|
|
74
101
|
if (!originalLocation) {
|
|
75
102
|
return;
|
|
76
103
|
}
|
|
77
|
-
|
|
78
|
-
|
|
104
|
+
if (canOpenInEditor) {
|
|
105
|
+
openEditor(originalLocation);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (canOpenInGitHub) {
|
|
109
|
+
window.open((0, get_git_menu_item_1.getGitRefUrl)(window.remotion_gitSource, originalLocation), '_blank');
|
|
110
|
+
}
|
|
111
|
+
}, [canOpenInEditor, canOpenInGitHub, openEditor, originalLocation]);
|
|
79
112
|
(0, react_1.useEffect)(() => {
|
|
80
113
|
if (!sequence.stack) {
|
|
81
114
|
return;
|
|
@@ -101,18 +134,16 @@ const TimelineStack = ({ isCompact, sequence }) => {
|
|
|
101
134
|
const onTitlePointerLeave = (0, react_1.useCallback)(() => {
|
|
102
135
|
setTitleHovered(false);
|
|
103
136
|
}, []);
|
|
104
|
-
const hoverable = (originalLocation && isCompact) ||
|
|
105
|
-
(assetPath && window.remotion_editorName);
|
|
106
137
|
const style = (0, react_1.useMemo)(() => {
|
|
107
138
|
return {
|
|
108
139
|
fontSize: 12,
|
|
109
140
|
color: opening
|
|
110
141
|
? colors_1.VERY_LIGHT_TEXT
|
|
111
|
-
: stackHovered &&
|
|
142
|
+
: stackHovered && stackHoverable
|
|
112
143
|
? colors_1.LIGHT_TEXT
|
|
113
144
|
: colors_1.VERY_LIGHT_TEXT,
|
|
114
145
|
marginLeft: 10,
|
|
115
|
-
cursor:
|
|
146
|
+
cursor: stackHoverable ? 'pointer' : undefined,
|
|
116
147
|
display: 'flex',
|
|
117
148
|
flexDirection: 'row',
|
|
118
149
|
alignItems: 'center',
|
|
@@ -121,9 +152,9 @@ const TimelineStack = ({ isCompact, sequence }) => {
|
|
|
121
152
|
overflow: 'hidden',
|
|
122
153
|
flexShrink: 100000,
|
|
123
154
|
};
|
|
124
|
-
}, [opening, stackHovered,
|
|
125
|
-
const
|
|
126
|
-
const hoverEffect = titleHovered &&
|
|
155
|
+
}, [opening, stackHovered, stackHoverable]);
|
|
156
|
+
const titleStyle = (0, react_1.useMemo)(() => {
|
|
157
|
+
const hoverEffect = titleHovered && titleHoverable;
|
|
127
158
|
return {
|
|
128
159
|
fontSize: 12,
|
|
129
160
|
whiteSpace: 'nowrap',
|
|
@@ -135,12 +166,12 @@ const TimelineStack = ({ isCompact, sequence }) => {
|
|
|
135
166
|
borderBottom: hoverEffect ? '1px solid #fff' : 'none',
|
|
136
167
|
cursor: hoverEffect ? 'pointer' : undefined,
|
|
137
168
|
};
|
|
138
|
-
}, [
|
|
169
|
+
}, [titleHoverable, isCompact, opening, titleHovered]);
|
|
139
170
|
const text = sequence.displayName.length > 1000
|
|
140
171
|
? sequence.displayName.slice(0, 1000) + '...'
|
|
141
172
|
: sequence.displayName;
|
|
142
173
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { onPointerEnter: onTitlePointerEnter, onPointerLeave: onTitlePointerLeave, title: originalLocation
|
|
143
174
|
? (0, source_attribution_1.getOriginalSourceAttribution)(originalLocation)
|
|
144
|
-
: text || '<Sequence>', style:
|
|
175
|
+
: text || '<Sequence>', style: titleStyle, onClick: onClickTitle, children: text || '<Sequence>' }), isCompact || !originalLocation ? null : ((0, jsx_runtime_1.jsx)("div", { onPointerEnter: onStackPointerEnter, onPointerLeave: onStackPointerLeave, onClick: onClickStack, style: style, children: (0, source_attribution_1.getOriginalSourceAttribution)(originalLocation) })), opening ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { duration: 0.5, size: 12 })] })) : null] }));
|
|
145
176
|
};
|
|
146
177
|
exports.TimelineStack = TimelineStack;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TopPanel = exports.useResponsiveSidebarStatus = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const player_1 = require("@remotion/player");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const use_breakpoint_1 = require("../helpers/use-breakpoint");
|
|
7
8
|
const editor_rulers_1 = require("../state/editor-rulers");
|
|
@@ -43,9 +44,10 @@ const useResponsiveSidebarStatus = () => {
|
|
|
43
44
|
return actualStateLeft;
|
|
44
45
|
};
|
|
45
46
|
exports.useResponsiveSidebarStatus = useResponsiveSidebarStatus;
|
|
46
|
-
const TopPanel = ({ readOnlyStudio }) => {
|
|
47
|
+
const TopPanel = ({ readOnlyStudio, onMounted }) => {
|
|
47
48
|
const { setSidebarCollapsedState, sidebarCollapsedStateRight } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
48
49
|
const rulersAreVisible = (0, use_is_ruler_visible_1.useIsRulerVisible)();
|
|
50
|
+
const ref = (0, react_1.useRef)(null);
|
|
49
51
|
const actualStateLeft = (0, exports.useResponsiveSidebarStatus)();
|
|
50
52
|
const actualStateRight = (0, react_1.useMemo)(() => {
|
|
51
53
|
if (sidebarCollapsedStateRight === 'collapsed') {
|
|
@@ -53,6 +55,14 @@ const TopPanel = ({ readOnlyStudio }) => {
|
|
|
53
55
|
}
|
|
54
56
|
return 'expanded';
|
|
55
57
|
}, [sidebarCollapsedStateRight]);
|
|
58
|
+
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
59
|
+
triggerOnWindowResize: false,
|
|
60
|
+
shouldApplyCssTransforms: true,
|
|
61
|
+
});
|
|
62
|
+
const hasSize = size !== null;
|
|
63
|
+
(0, react_1.useEffect)(() => {
|
|
64
|
+
onMounted();
|
|
65
|
+
}, [hasSize, onMounted]);
|
|
56
66
|
const canvasContainerStyle = (0, react_1.useMemo)(() => ({
|
|
57
67
|
flex: 1,
|
|
58
68
|
display: 'flex',
|
|
@@ -65,6 +75,6 @@ const TopPanel = ({ readOnlyStudio }) => {
|
|
|
65
75
|
const onCollapseRight = (0, react_1.useCallback)(() => {
|
|
66
76
|
setSidebarCollapsedState({ left: null, right: 'collapsed' });
|
|
67
77
|
}, [setSidebarCollapsedState]);
|
|
68
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: row, children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(ExplorerPanel_1.ExplorerPanel, {}) })) : null, actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, id: "canvas-to-right-sidebar", orientation: "vertical", children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)("div", { style: canvasContainerStyle, children: (0, jsx_runtime_1.jsx)(CanvasOrLoading_1.CanvasOrLoading, {}) }) }), actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) })) : null] }) })] }) }), (0, jsx_runtime_1.jsx)(PreviewToolbar_1.PreviewToolbar, { readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.CurrentCompositionKeybindings, { readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.TitleUpdater, {})] }));
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: row, children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(ExplorerPanel_1.ExplorerPanel, {}) })) : null, actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, id: "canvas-to-right-sidebar", orientation: "vertical", children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)("div", { ref: ref, style: canvasContainerStyle, children: size ? (0, jsx_runtime_1.jsx)(CanvasOrLoading_1.CanvasOrLoading, { size: size }) : null }) }), actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) })) : null] }) })] }) }), (0, jsx_runtime_1.jsx)(PreviewToolbar_1.PreviewToolbar, { readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.CurrentCompositionKeybindings, { readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.TitleUpdater, {})] }));
|
|
69
79
|
};
|
|
70
80
|
exports.TopPanel = TopPanel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const getCheckerboardBackgroundSize: (size: number) => string;
|
|
2
2
|
export declare const getCheckerboardBackgroundPos: (size: number) => string;
|
|
3
|
-
export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "
|
|
3
|
+
export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "black" | "white";
|
|
4
4
|
export declare const checkerboardBackgroundImage: (checkerboard: boolean) => "\n linear-gradient(\n 45deg,\n rgba(0, 0, 0, 0.1) 25%,\n transparent 25%\n ),\n linear-gradient(135deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%),\n linear-gradient(135deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%)\n " | undefined;
|
package/dist/helpers/colors.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ export declare const TIMELINE_TRACK_SEPARATOR = "rgba(0, 0, 0, 0.3)";
|
|
|
23
23
|
export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
|
|
24
24
|
selected: boolean;
|
|
25
25
|
hovered: boolean;
|
|
26
|
-
}) => "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)"
|
|
26
|
+
}) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Size } from '@remotion/player';
|
|
1
2
|
import type { Guide } from '../state/editor-guides';
|
|
2
|
-
export declare const drawMarkingOnRulerCanvas: ({ scale, points, startMarking, originOffset, markingGaps, orientation, rulerCanvasRef, selectedGuide, }: {
|
|
3
|
+
export declare const drawMarkingOnRulerCanvas: ({ scale, points, startMarking, originOffset, markingGaps, orientation, rulerCanvasRef, selectedGuide, canvasHeight, canvasWidth, }: {
|
|
3
4
|
scale: number;
|
|
4
5
|
points: Array<{
|
|
5
6
|
position: number;
|
|
@@ -11,6 +12,8 @@ export declare const drawMarkingOnRulerCanvas: ({ scale, points, startMarking, o
|
|
|
11
12
|
orientation: 'horizontal' | 'vertical';
|
|
12
13
|
rulerCanvasRef: React.RefObject<HTMLCanvasElement>;
|
|
13
14
|
selectedGuide: Guide | null;
|
|
15
|
+
canvasWidth: number;
|
|
16
|
+
canvasHeight: number;
|
|
14
17
|
}) => void;
|
|
15
18
|
export declare const getRulerPoints: ({ rulerScaleRange, rulerMarkingGaps, scale, }: {
|
|
16
19
|
rulerScaleRange: {
|
|
@@ -26,10 +29,10 @@ export declare const getRulerPoints: ({ rulerScaleRange, rulerMarkingGaps, scale
|
|
|
26
29
|
}[];
|
|
27
30
|
startMarking: number;
|
|
28
31
|
};
|
|
29
|
-
export declare const getRulerScaleRange: ({ canvasLength,
|
|
32
|
+
export declare const getRulerScaleRange: ({ canvasLength, scale, canvasSize, }: {
|
|
30
33
|
canvasLength: number;
|
|
31
|
-
containerRef: React.RefObject<HTMLDivElement>;
|
|
32
34
|
scale: number;
|
|
35
|
+
canvasSize: Size;
|
|
33
36
|
}) => {
|
|
34
37
|
start: number;
|
|
35
38
|
end: number;
|