@remotion/studio 4.0.469 → 4.0.471
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/Studio.js +1 -1
- package/dist/api/save-render-output.js +3 -12
- package/dist/components/AudioWaveform.js +19 -2
- package/dist/components/ContextMenu.d.ts +7 -2
- package/dist/components/ContextMenu.js +53 -9
- package/dist/components/EditorContent.js +5 -4
- package/dist/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/MenuBuildIndicator.js +0 -1
- package/dist/components/NewComposition/InputDragger.js +1 -0
- package/dist/components/Preview.js +6 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +49 -0
- package/dist/components/SelectedOutlineOverlay.js +710 -0
- package/dist/components/Timeline/Timeline.js +102 -13
- package/dist/components/Timeline/TimelineDeleteKeybindings.d.ts +2 -0
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +101 -0
- package/dist/components/Timeline/TimelineDragHandler.js +20 -244
- package/dist/components/Timeline/{TimelineEffectGroupRow.d.ts → TimelineEffectItem.d.ts} +1 -1
- package/dist/components/Timeline/TimelineEffectItem.js +323 -0
- package/dist/components/Timeline/{TimelineEffectFieldRow.d.ts → TimelineEffectPropItem.d.ts} +2 -1
- package/dist/components/Timeline/{TimelineEffectFieldRow.js → TimelineEffectPropItem.js} +97 -8
- package/dist/components/Timeline/TimelineExpandArrowButton.js +5 -1
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +37 -5
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +9 -7
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.d.ts +2 -0
- package/dist/components/Timeline/TimelineInOutDragHandler.js +324 -0
- package/dist/components/Timeline/TimelineInOutPointer.js +3 -1
- package/dist/components/Timeline/TimelineInOutPointerHandle.d.ts +1 -0
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +5 -4
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +17 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +222 -0
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +7 -6
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +8 -0
- package/dist/components/Timeline/TimelineKeyframedValue.js +36 -0
- package/dist/components/Timeline/TimelineList.js +3 -15
- package/dist/components/Timeline/TimelineRowChrome.d.ts +6 -1
- package/dist/components/Timeline/TimelineRowChrome.js +25 -7
- package/dist/components/Timeline/TimelineSelection.d.ts +53 -9
- package/dist/components/Timeline/TimelineSelection.js +305 -48
- package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequence.js +18 -6
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/{TimelineListItem.d.ts → TimelineSequenceItem.d.ts} +2 -1
- package/dist/components/Timeline/{TimelineListItem.js → TimelineSequenceItem.js} +140 -34
- package/dist/components/Timeline/{TimelineFieldRow.d.ts → TimelineSequencePropItem.d.ts} +2 -1
- package/dist/components/Timeline/{TimelineFieldRow.js → TimelineSequencePropItem.js} +81 -5
- package/dist/components/Timeline/TimelineTimeIndicators.js +0 -1
- package/dist/components/Timeline/TimelineTrack.js +3 -1
- package/dist/components/Timeline/TimelineTranslateField.js +14 -22
- package/dist/components/Timeline/call-add-keyframe.d.ts +23 -0
- package/dist/components/Timeline/call-add-keyframe.js +54 -0
- package/dist/components/Timeline/call-delete-keyframe.d.ts +37 -0
- package/dist/components/Timeline/call-delete-keyframe.js +122 -0
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +21 -0
- package/dist/components/Timeline/delete-selected-keyframe.js +92 -0
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +17 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +178 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +13 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +66 -0
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +7 -0
- package/dist/components/Timeline/find-track-for-node-path-info.js +13 -0
- package/dist/components/Timeline/get-keyframe-navigation.d.ts +9 -0
- package/dist/components/Timeline/get-keyframe-navigation.js +26 -0
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.d.ts +8 -0
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +26 -0
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +38 -0
- package/dist/components/Timeline/reset-selected-timeline-props.js +143 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +14 -2
- package/dist/components/Timeline/save-sequence-prop.js +42 -7
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -2
- package/dist/components/Timeline/sequence-props-subscription-store.js +2 -1
- package/dist/components/Timeline/timeline-row-layout.d.ts +1 -0
- package/dist/components/Timeline/timeline-row-layout.js +2 -1
- package/dist/components/Timeline/timeline-scroll-logic.js +3 -3
- package/dist/components/Timeline/timeline-translate-utils.d.ts +2 -0
- package/dist/components/Timeline/timeline-translate-utils.js +20 -0
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +10 -3
- package/dist/components/Timeline/use-sequence-props-subscription.js +2 -1
- package/dist/components/composition-menu-items.js +32 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +0 -1
- package/dist/esm/{chunk-1mp51e0w.js → chunk-z0z9d4r0.js} +10422 -5958
- package/dist/esm/internals.mjs +10422 -5958
- package/dist/esm/previewEntry.mjs +10419 -5953
- package/dist/esm/renderEntry.mjs +3 -1
- package/dist/helpers/format-file-location.d.ts +9 -0
- package/dist/helpers/format-file-location.js +27 -0
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
- package/dist/helpers/get-box-quads-polyfill-internals.js +2395 -0
- package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
- package/dist/helpers/get-box-quads-ponyfill.js +23 -0
- package/dist/helpers/get-left-of-timeline-slider.js +1 -1
- package/dist/helpers/get-timeline-sequence-layout.js +10 -11
- package/dist/helpers/open-in-editor.d.ts +20 -2
- package/dist/helpers/open-in-editor.js +53 -30
- package/dist/helpers/use-menu-structure.js +8 -17
- package/dist/renderEntry.js +2 -2
- package/dist/state/z-index.js +5 -2
- package/package.json +10 -10
- package/dist/components/Timeline/TimelineEffectGroupRow.js +0 -153
package/dist/Studio.js
CHANGED
|
@@ -17,7 +17,7 @@ const getServerDisconnectedDomElement = () => {
|
|
|
17
17
|
};
|
|
18
18
|
const StudioInner = ({ rootComponent, readOnly }) => {
|
|
19
19
|
var _a, _b;
|
|
20
|
-
return (jsx_runtime_1.jsx(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: jsx_runtime_1.jsx(remotion_1.Internals.RemotionRootContexts, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: (_a = window.remotion_logLevel) !== null && _a !== void 0 ? _a : 'info', numberOfAudioTags: window.remotion_numberOfAudioTags, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'playback', children: jsx_runtime_1.jsx(use_static_files_1.StaticFilesProvider, { children: jsx_runtime_1.jsx(ResolveCompositionConfigInStudio_1.ResolveCompositionConfigInStudio, { children: jsx_runtime_1.jsxs(EditorContexts_1.EditorContexts, { readOnlyStudio: readOnly, children: [
|
|
20
|
+
return (jsx_runtime_1.jsx(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: jsx_runtime_1.jsx(remotion_1.Internals.RemotionRootContexts, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: (_a = window.remotion_logLevel) !== null && _a !== void 0 ? _a : 'info', numberOfAudioTags: window.remotion_numberOfAudioTags, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'playback', previewSampleRate: window.remotion_previewSampleRate, children: jsx_runtime_1.jsx(use_static_files_1.StaticFilesProvider, { children: jsx_runtime_1.jsx(ResolveCompositionConfigInStudio_1.ResolveCompositionConfigInStudio, { children: jsx_runtime_1.jsxs(EditorContexts_1.EditorContexts, { readOnlyStudio: readOnly, children: [
|
|
21
21
|
jsx_runtime_1.jsx(Editor_1.Editor, { readOnlyStudio: readOnly, Root: rootComponent }), readOnly
|
|
22
22
|
? null
|
|
23
23
|
: (0, react_dom_1.createPortal)(jsx_runtime_1.jsx(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }) }) }) }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.unregisterClientRender = exports.registerClientRender = exports.saveOutputFile = void 0;
|
|
4
|
+
const call_api_1 = require("../components/call-api");
|
|
4
5
|
const throwIfNotOk = async (response) => {
|
|
5
6
|
if (!response.ok) {
|
|
6
7
|
try {
|
|
@@ -26,20 +27,10 @@ const saveOutputFile = async ({ blob, filePath, }) => {
|
|
|
26
27
|
};
|
|
27
28
|
exports.saveOutputFile = saveOutputFile;
|
|
28
29
|
const registerClientRender = async (render) => {
|
|
29
|
-
|
|
30
|
-
method: 'POST',
|
|
31
|
-
headers: { 'Content-Type': 'application/json' },
|
|
32
|
-
body: JSON.stringify(render),
|
|
33
|
-
});
|
|
34
|
-
await throwIfNotOk(response);
|
|
30
|
+
await (0, call_api_1.callApi)('/api/register-client-render', render);
|
|
35
31
|
};
|
|
36
32
|
exports.registerClientRender = registerClientRender;
|
|
37
33
|
const unregisterClientRender = async (id) => {
|
|
38
|
-
|
|
39
|
-
method: 'POST',
|
|
40
|
-
headers: { 'Content-Type': 'application/json' },
|
|
41
|
-
body: JSON.stringify({ id }),
|
|
42
|
-
});
|
|
43
|
-
await throwIfNotOk(response);
|
|
34
|
+
await (0, call_api_1.callApi)('/api/unregister-client-render', { id });
|
|
44
35
|
};
|
|
45
36
|
exports.unregisterClientRender = unregisterClientRender;
|
|
@@ -41,6 +41,9 @@ const errorMessage = {
|
|
|
41
41
|
maxWidth: 450,
|
|
42
42
|
opacity: 0.75,
|
|
43
43
|
};
|
|
44
|
+
const getWaveformErrorMessage = () => {
|
|
45
|
+
return new Error('No waveform available. The audio could not be decoded or may not support CORS.');
|
|
46
|
+
};
|
|
44
47
|
const waveformCanvasStyle = {
|
|
45
48
|
pointerEvents: 'none',
|
|
46
49
|
width: '100%',
|
|
@@ -121,6 +124,7 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
121
124
|
return;
|
|
122
125
|
}
|
|
123
126
|
const worker = (0, timeline_utils_1.makeAudioWaveformWorker)();
|
|
127
|
+
let workerFailed = false;
|
|
124
128
|
waveformWorker.current = worker;
|
|
125
129
|
worker.addEventListener('message', (event) => {
|
|
126
130
|
if (event.data.type === 'error') {
|
|
@@ -130,6 +134,17 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
130
134
|
setError(new Error(event.data.message));
|
|
131
135
|
}
|
|
132
136
|
});
|
|
137
|
+
worker.addEventListener('error', (event) => {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
workerFailed = true;
|
|
140
|
+
if (worker !== waveformWorker.current) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
worker.terminate();
|
|
144
|
+
waveformWorker.current = null;
|
|
145
|
+
hasTransferredCanvas.current = false;
|
|
146
|
+
setError(getWaveformErrorMessage());
|
|
147
|
+
});
|
|
133
148
|
let offscreen;
|
|
134
149
|
try {
|
|
135
150
|
offscreen = canvasElement.transferControlToOffscreen();
|
|
@@ -146,7 +161,9 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
146
161
|
hasTransferredCanvas.current = true;
|
|
147
162
|
worker.postMessage({ type: 'init', canvas: offscreen }, [offscreen]);
|
|
148
163
|
return () => {
|
|
149
|
-
|
|
164
|
+
if (!workerFailed) {
|
|
165
|
+
worker.postMessage({ type: 'dispose' });
|
|
166
|
+
}
|
|
150
167
|
worker.terminate();
|
|
151
168
|
waveformWorker.current = null;
|
|
152
169
|
hasTransferredCanvas.current = false;
|
|
@@ -277,7 +294,7 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
277
294
|
if (error) {
|
|
278
295
|
// eslint-disable-next-line no-console
|
|
279
296
|
console.error(error);
|
|
280
|
-
return (jsx_runtime_1.jsx("div", { style: getContainerStyle(height), children: jsx_runtime_1.jsx("div", { style: errorMessage, children: "No waveform available.
|
|
297
|
+
return (jsx_runtime_1.jsx("div", { style: getContainerStyle(height), children: jsx_runtime_1.jsx("div", { style: errorMessage, children: "No waveform available. The audio could not be decoded or may not support CORS." }) }));
|
|
281
298
|
}
|
|
282
299
|
if (!canUseWorkerPath && !peaks) {
|
|
283
300
|
return null;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
3
|
-
|
|
3
|
+
type ContextMenuProps = {
|
|
4
4
|
readonly children: React.ReactNode;
|
|
5
5
|
readonly values: ComboboxValue[];
|
|
6
6
|
readonly onOpen: (() => void) | null;
|
|
7
|
-
|
|
7
|
+
readonly style?: React.CSSProperties;
|
|
8
|
+
readonly className?: string;
|
|
9
|
+
readonly onPointerDown?: React.PointerEventHandler<HTMLDivElement>;
|
|
10
|
+
};
|
|
11
|
+
export declare const ContextMenu: React.ForwardRefExoticComponent<ContextMenuProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export {};
|
|
@@ -1,4 +1,37 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
@@ -6,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
39
|
exports.ContextMenu = void 0;
|
|
7
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
41
|
const player_1 = require("@remotion/player");
|
|
9
|
-
const react_1 = require("react");
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
10
43
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
44
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
12
45
|
const noop_1 = require("../helpers/noop");
|
|
@@ -14,13 +47,20 @@ const z_index_1 = require("../state/z-index");
|
|
|
14
47
|
const portals_1 = require("./Menu/portals");
|
|
15
48
|
const styles_1 = require("./Menu/styles");
|
|
16
49
|
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
17
|
-
|
|
50
|
+
exports.ContextMenu = react_1.default.forwardRef(({ children, values, onOpen, style = undefined, className = undefined, onPointerDown = undefined, }, forwardedRef) => {
|
|
18
51
|
const ref = (0, react_1.useRef)(null);
|
|
19
52
|
const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
|
|
20
53
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
54
|
+
const setRef = (0, react_1.useCallback)((node) => {
|
|
55
|
+
ref.current = node;
|
|
56
|
+
if (typeof forwardedRef === 'function') {
|
|
57
|
+
forwardedRef(node);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (forwardedRef) {
|
|
61
|
+
forwardedRef.current = node;
|
|
62
|
+
}
|
|
63
|
+
}, [forwardedRef]);
|
|
24
64
|
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
25
65
|
triggerOnWindowResize: true,
|
|
26
66
|
shouldApplyCssTransforms: true,
|
|
@@ -92,9 +132,13 @@ const ContextMenu = ({ children, values, onOpen }) => {
|
|
|
92
132
|
const onHide = (0, react_1.useCallback)(() => {
|
|
93
133
|
setOpened({ type: 'not-open' });
|
|
94
134
|
}, []);
|
|
135
|
+
// Prevent deselection of a selected item
|
|
136
|
+
const onMenuPointerDown = (0, react_1.useCallback)((e) => {
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
}, []);
|
|
95
139
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
96
|
-
jsx_runtime_1.jsx("div", { ref:
|
|
97
|
-
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
140
|
+
jsx_runtime_1.jsx("div", { ref: setRef, onContextMenu: () => false, style: style, className: className, onPointerDown: onPointerDown, children: children }), portalStyle
|
|
141
|
+
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, onPointerDown: onMenuPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
98
142
|
: null] }));
|
|
99
|
-
};
|
|
100
|
-
exports.ContextMenu = ContextMenu;
|
|
143
|
+
});
|
|
144
|
+
exports.ContextMenu.displayName = 'ContextMenu';
|
|
@@ -11,6 +11,7 @@ const SplitterElement_1 = require("./Splitter/SplitterElement");
|
|
|
11
11
|
const SplitterHandle_1 = require("./Splitter/SplitterHandle");
|
|
12
12
|
const Timeline_1 = require("./Timeline/Timeline");
|
|
13
13
|
const TimelineEmptyState_1 = require("./Timeline/TimelineEmptyState");
|
|
14
|
+
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
14
15
|
const noop = () => undefined;
|
|
15
16
|
const container = {
|
|
16
17
|
display: 'flex',
|
|
@@ -21,10 +22,10 @@ const container = {
|
|
|
21
22
|
const EditorContent = ({ readOnlyStudio, children }) => {
|
|
22
23
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
23
24
|
const showTimeline = canvasContent !== null && canvasContent.type === 'composition';
|
|
24
|
-
|
|
25
|
-
jsx_runtime_1.jsx(
|
|
26
|
-
jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: children }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: showTimeline ? jsx_runtime_1.jsx(Timeline_1.Timeline, {}) : jsx_runtime_1.jsx(TimelineEmptyState_1.TimelineEmptyState, {}) })
|
|
27
|
-
] })
|
|
25
|
+
const content = (jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, children: [
|
|
26
|
+
jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: children }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: showTimeline ? jsx_runtime_1.jsx(Timeline_1.Timeline, {}) : jsx_runtime_1.jsx(TimelineEmptyState_1.TimelineEmptyState, {}) })
|
|
28
27
|
] }));
|
|
28
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
29
|
+
jsx_runtime_1.jsx(InitialCompositionLoader_1.InitialCompositionLoader, {}), jsx_runtime_1.jsx(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), showTimeline ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionProvider, { children: content })) : (content)] }));
|
|
29
30
|
};
|
|
30
31
|
exports.EditorContent = EditorContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SetStateAction } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { ComboboxValue } from '../NewComposition/ComboBox';
|
|
4
|
-
export type MenuId = 'remotion' | 'file' | 'view' | 'composition' | '
|
|
4
|
+
export type MenuId = 'remotion' | 'file' | 'view' | 'composition' | 'tools' | 'help';
|
|
5
5
|
export type Menu = {
|
|
6
6
|
id: MenuId;
|
|
7
7
|
label: React.ReactNode;
|
|
@@ -56,7 +56,6 @@ const MenuBuildIndicator = () => {
|
|
|
56
56
|
originalFunctionName: null,
|
|
57
57
|
originalScriptCode: null,
|
|
58
58
|
})
|
|
59
|
-
.then((res) => res.json())
|
|
60
59
|
.then(({ success }) => {
|
|
61
60
|
if (!success) {
|
|
62
61
|
(0, NotificationCenter_1.showNotification)(`Could not open ${window.remotion_editorName}`, 2000);
|
|
@@ -120,6 +120,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
120
120
|
return Math.ceil(val * factor) / factor;
|
|
121
121
|
};
|
|
122
122
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
123
|
+
e.stopPropagation();
|
|
123
124
|
pointerDownRef.current = true;
|
|
124
125
|
const target = e.currentTarget;
|
|
125
126
|
const { pageX, pageY, button } = e;
|
|
@@ -11,6 +11,7 @@ const colors_1 = require("../helpers/colors");
|
|
|
11
11
|
const checkerboard_1 = require("../state/checkerboard");
|
|
12
12
|
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
13
13
|
const RenderPreview_1 = require("./RenderPreview");
|
|
14
|
+
const SelectedOutlineOverlay_1 = require("./SelectedOutlineOverlay");
|
|
14
15
|
const Spinner_1 = require("./Spinner");
|
|
15
16
|
const StaticFilePreview_1 = require("./StaticFilePreview");
|
|
16
17
|
const centeredContainer = {
|
|
@@ -71,6 +72,7 @@ const containerStyle = (options) => {
|
|
|
71
72
|
width: options.width,
|
|
72
73
|
height: options.height,
|
|
73
74
|
display: 'flex',
|
|
75
|
+
overflow: 'hidden',
|
|
74
76
|
position: 'absolute',
|
|
75
77
|
backgroundColor: (0, checkerboard_background_1.checkerboardBackgroundColor)(options.checkerboard),
|
|
76
78
|
backgroundImage: (0, checkerboard_background_1.checkerboardBackgroundImage)(options.checkerboard),
|
|
@@ -121,7 +123,7 @@ const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent,
|
|
|
121
123
|
position: 'absolute',
|
|
122
124
|
left: centerX - previewSize.translation.x,
|
|
123
125
|
top: centerY - previewSize.translation.y,
|
|
124
|
-
overflow: 'hidden',
|
|
126
|
+
overflow: canvasContent.type === 'composition' ? 'visible' : 'hidden',
|
|
125
127
|
justifyContent: canvasContent.type === 'asset' ? 'center' : 'flex-start',
|
|
126
128
|
alignItems: canvasContent.type === 'asset' &&
|
|
127
129
|
(0, exports.getPreviewFileType)(canvasContent.asset) === 'audio'
|
|
@@ -146,7 +148,9 @@ const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent,
|
|
|
146
148
|
if (canvasContent.type === 'output-blob') {
|
|
147
149
|
return (jsx_runtime_1.jsx("div", { style: outer, children: jsx_runtime_1.jsx(RenderPreview_1.RenderPreview, { path: canvasContent.displayName, assetMetadata: assetMetadata, getBlob: canvasContent.getBlob }) }));
|
|
148
150
|
}
|
|
149
|
-
return (jsx_runtime_1.
|
|
151
|
+
return (jsx_runtime_1.jsxs("div", { style: outer, children: [
|
|
152
|
+
jsx_runtime_1.jsx(PortalContainer, { contentDimensions: contentDimensions, scale: scale, xCorrection: xCorrection, yCorrection: yCorrection }), jsx_runtime_1.jsx(SelectedOutlineOverlay_1.SelectedOutlineOverlay, { scale: scale })
|
|
153
|
+
] }));
|
|
150
154
|
};
|
|
151
155
|
const PortalContainer = ({ scale, xCorrection, yCorrection, contentDimensions }) => {
|
|
152
156
|
const { checkerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CanUpdateSequencePropStatusTrue, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
3
|
+
import { type TimelineSelection } from './Timeline/TimelineSelection';
|
|
4
|
+
type OutlinePoint = {
|
|
5
|
+
readonly x: number;
|
|
6
|
+
readonly y: number;
|
|
7
|
+
};
|
|
8
|
+
type UvCoordinate = readonly [number, number];
|
|
9
|
+
type SelectedOutlineDragTarget = {
|
|
10
|
+
readonly codeValue: CanUpdateSequencePropStatusTrue;
|
|
11
|
+
readonly clientId: string;
|
|
12
|
+
readonly fieldDefault: string | undefined;
|
|
13
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
14
|
+
readonly schema: SequenceSchema;
|
|
15
|
+
};
|
|
16
|
+
export type SelectedOutlineDragState = {
|
|
17
|
+
readonly defaultValue: string | null;
|
|
18
|
+
readonly key: string;
|
|
19
|
+
readonly startX: number;
|
|
20
|
+
readonly startY: number;
|
|
21
|
+
readonly target: SelectedOutlineDragTarget;
|
|
22
|
+
};
|
|
23
|
+
export declare const getUvHandlePosition: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], uv: UvCoordinate) => OutlinePoint;
|
|
24
|
+
export declare const getUvCoordinateForPoint: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint], point: OutlinePoint) => UvCoordinate;
|
|
25
|
+
type SelectedEffectFields = {
|
|
26
|
+
allFields: boolean;
|
|
27
|
+
fieldKeys: Set<string>;
|
|
28
|
+
};
|
|
29
|
+
export declare const getSelectedEffectFieldsBySequenceKey: (selectedItems: readonly TimelineSelection[]) => Map<string, Map<number, SelectedEffectFields>>;
|
|
30
|
+
export declare const getSelectedOutlineDragValues: ({ dragStates, deltaX, deltaY, }: {
|
|
31
|
+
readonly dragStates: readonly SelectedOutlineDragState[];
|
|
32
|
+
readonly deltaX: number;
|
|
33
|
+
readonly deltaY: number;
|
|
34
|
+
}) => Map<string, string>;
|
|
35
|
+
export declare const getSelectedOutlineDragChanges: ({ dragStates, lastValues, }: {
|
|
36
|
+
readonly dragStates: readonly SelectedOutlineDragState[];
|
|
37
|
+
readonly lastValues: ReadonlyMap<string, string>;
|
|
38
|
+
}) => {
|
|
39
|
+
fileName: string;
|
|
40
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
41
|
+
fieldKey: string;
|
|
42
|
+
value: string;
|
|
43
|
+
defaultValue: string | null;
|
|
44
|
+
schema: SequenceSchema;
|
|
45
|
+
}[];
|
|
46
|
+
export declare const SelectedOutlineOverlay: React.FC<{
|
|
47
|
+
readonly scale: number;
|
|
48
|
+
}>;
|
|
49
|
+
export {};
|