@remotion/studio 4.0.481 → 4.0.482
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/components/Editor.js +1 -1
- package/dist/components/GlobalKeybindings.js +1 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +3 -2
- package/dist/components/MediaVolumeProvider.js +4 -4
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
- package/dist/components/NewComposition/CodemodFooter.js +25 -3
- package/dist/components/NewComposition/InputDragger.d.ts +4 -0
- package/dist/components/NewComposition/InputDragger.js +18 -2
- package/dist/components/NewComposition/NewComposition.d.ts +2 -0
- package/dist/components/NewComposition/NewComposition.js +178 -0
- package/dist/components/PreviewToolbar.js +3 -3
- package/dist/components/SelectedOutlineOverlay.d.ts +6 -0
- package/dist/components/SelectedOutlineOverlay.js +18 -2
- package/dist/components/Timeline/TimelineSelection.d.ts +6 -3
- package/dist/components/Timeline/TimelineSelection.js +81 -36
- package/dist/components/Timeline/TimelineSequenceItem.js +1 -3
- package/dist/components/Timeline/timeline-field-display-utils.js +3 -0
- package/dist/components/composition-menu-items.js +17 -0
- package/dist/esm/{chunk-4rq5gt8c.js → chunk-nkqfa5bw.js} +1598 -1182
- package/dist/esm/internals.mjs +1598 -1182
- package/dist/esm/previewEntry.mjs +1605 -1189
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.js +6 -2
- package/dist/helpers/get-sequence-visible-range.d.ts +1 -0
- package/dist/helpers/get-sequence-visible-range.js +15 -1
- package/dist/state/modals.d.ts +2 -0
- package/package.json +11 -11
- package/dist/components/Timeline/TimelineItemStack.d.ts +0 -5
- package/dist/components/Timeline/TimelineItemStack.js +0 -29
|
@@ -107,6 +107,6 @@ const Editor = ({ Root, readOnlyStudio }) => {
|
|
|
107
107
|
] }) })
|
|
108
108
|
] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
|
|
109
109
|
] }) }) }));
|
|
110
|
-
return canvas_capture_enabled_1.CANVAS_CAPTURE_ENABLED ? (jsx_runtime_1.jsx(StudioCanvasCapture_1.StudioCanvasCapture, { density:
|
|
110
|
+
return canvas_capture_enabled_1.CANVAS_CAPTURE_ENABLED ? (jsx_runtime_1.jsx(StudioCanvasCapture_1.StudioCanvasCapture, { density: 1.5, children: editor })) : (editor);
|
|
111
111
|
};
|
|
112
112
|
exports.Editor = Editor;
|
|
@@ -92,7 +92,7 @@ const SequenceExpandedInspector = ({ track }) => {
|
|
|
92
92
|
if (sequenceSelected) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
selectItems([sequenceSelection]);
|
|
95
|
+
selectItems([sequenceSelection], { reveal: true });
|
|
96
96
|
}, [selectItems, sequenceSelected, sequenceSelection]);
|
|
97
97
|
if (previewServerState.type !== 'connected') {
|
|
98
98
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Studio server disconnected" });
|
|
@@ -112,6 +112,7 @@ const SequenceSelectionInspector = ({ selection }) => {
|
|
|
112
112
|
if (!track) {
|
|
113
113
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
const stackKey = track.sequence.getStack();
|
|
116
|
+
return (jsx_runtime_1.jsx(SequenceExpandedInspector, { track: track }, stackKey !== null && stackKey !== void 0 ? stackKey : track.sequence.id));
|
|
116
117
|
};
|
|
117
118
|
exports.SequenceSelectionInspector = SequenceSelectionInspector;
|
|
@@ -6,17 +6,17 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const mute_1 = require("../state/mute");
|
|
8
8
|
const MediaVolumeProvider = ({ children }) => {
|
|
9
|
-
const [
|
|
9
|
+
const [playerMuted, setPlayerMuted] = (0, react_1.useState)(() => (0, mute_1.loadMuteOption)());
|
|
10
10
|
const [mediaVolume, setMediaVolume] = (0, react_1.useState)(1);
|
|
11
11
|
const mediaVolumeContextValue = (0, react_1.useMemo)(() => {
|
|
12
12
|
return {
|
|
13
|
-
|
|
13
|
+
playerMuted,
|
|
14
14
|
mediaVolume,
|
|
15
15
|
};
|
|
16
|
-
}, [
|
|
16
|
+
}, [playerMuted, mediaVolume]);
|
|
17
17
|
const setMediaVolumeContextValue = (0, react_1.useMemo)(() => {
|
|
18
18
|
return {
|
|
19
|
-
|
|
19
|
+
setPlayerMuted,
|
|
20
20
|
setMediaVolume,
|
|
21
21
|
};
|
|
22
22
|
}, []);
|
|
@@ -15,6 +15,7 @@ const InstallPackage_1 = require("./InstallPackage");
|
|
|
15
15
|
const DeleteComposition_1 = require("./NewComposition/DeleteComposition");
|
|
16
16
|
const DeleteFolder_1 = require("./NewComposition/DeleteFolder");
|
|
17
17
|
const DuplicateComposition_1 = require("./NewComposition/DuplicateComposition");
|
|
18
|
+
const NewComposition_1 = require("./NewComposition/NewComposition");
|
|
18
19
|
const RenameComposition_1 = require("./NewComposition/RenameComposition");
|
|
19
20
|
const RenameFolder_1 = require("./NewComposition/RenameFolder");
|
|
20
21
|
const RenameStaticFile_1 = require("./NewComposition/RenameStaticFile");
|
|
@@ -30,7 +31,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
30
31
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
31
32
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
32
33
|
'connected';
|
|
33
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'keyframe-settings' && (jsx_runtime_1.jsx(KeyframeSettingsModal_1.KeyframeSettingsModal, { state: modalContextType })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
34
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, {})), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'keyframe-settings' && (jsx_runtime_1.jsx(KeyframeSettingsModal_1.KeyframeSettingsModal, { state: modalContextType })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
34
35
|
modalContextType.type === 'server-render' &&
|
|
35
36
|
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), process.env.ASK_AI_ENABLED && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
36
37
|
};
|
|
@@ -13,7 +13,7 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
|
13
13
|
const actions_1 = require("../RenderQueue/actions");
|
|
14
14
|
const use_resolved_stack_1 = require("../Timeline/use-resolved-stack");
|
|
15
15
|
const DiffPreview_1 = require("./DiffPreview");
|
|
16
|
-
const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, onSuccess, }) => {
|
|
16
|
+
const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, onSuccess, fallbackToRootFile = false, }) => {
|
|
17
17
|
var _a;
|
|
18
18
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
19
19
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -68,6 +68,22 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
68
68
|
}, [codemod, symbolicatedStack]);
|
|
69
69
|
(0, react_1.useEffect)(() => {
|
|
70
70
|
if (!stack) {
|
|
71
|
+
if (fallbackToRootFile) {
|
|
72
|
+
const rootFileAbortController = new AbortController();
|
|
73
|
+
let rootFileAborted = false;
|
|
74
|
+
getCanApplyCodemod(rootFileAbortController.signal)
|
|
75
|
+
.then(() => undefined)
|
|
76
|
+
.catch((err) => {
|
|
77
|
+
if (rootFileAborted) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
(0, NotificationCenter_1.showNotification)(`${errorNotification}: ${err.message}`, 3000);
|
|
81
|
+
});
|
|
82
|
+
return () => {
|
|
83
|
+
rootFileAborted = true;
|
|
84
|
+
rootFileAbortController.abort();
|
|
85
|
+
};
|
|
86
|
+
}
|
|
71
87
|
setCanApplyCodemod({
|
|
72
88
|
type: 'fail',
|
|
73
89
|
error: 'Could not determine where this item is defined',
|
|
@@ -98,10 +114,16 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
98
114
|
aborted = true;
|
|
99
115
|
abortController.abort();
|
|
100
116
|
};
|
|
101
|
-
}, [
|
|
117
|
+
}, [
|
|
118
|
+
errorNotification,
|
|
119
|
+
fallbackToRootFile,
|
|
120
|
+
getCanApplyCodemod,
|
|
121
|
+
stack,
|
|
122
|
+
symbolicatedStack,
|
|
123
|
+
]);
|
|
102
124
|
const disabled = !valid ||
|
|
103
125
|
submitting ||
|
|
104
|
-
symbolicatedStack === null ||
|
|
126
|
+
(symbolicatedStack === null && !fallbackToRootFile) ||
|
|
105
127
|
codemodStatus.type !== 'success';
|
|
106
128
|
const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
|
|
107
129
|
(0, react_1.useEffect)(() => {
|
|
@@ -6,6 +6,10 @@ export declare const deriveInputDraggerStep: ({ min, snapToStep, step, }: {
|
|
|
6
6
|
readonly snapToStep: boolean;
|
|
7
7
|
readonly step: string | number | undefined;
|
|
8
8
|
}) => string | number;
|
|
9
|
+
export declare const deriveInputDraggerDragStartValue: ({ min, value, }: {
|
|
10
|
+
readonly min: string | number | undefined;
|
|
11
|
+
readonly value: string | number | readonly string[] | undefined;
|
|
12
|
+
}) => number;
|
|
9
13
|
export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
10
14
|
readonly onValueChange: (newVal: number) => void;
|
|
11
15
|
readonly onValueChangeEnd?: ((newVal: number) => void) | undefined;
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InputDragger = exports.deriveInputDraggerStep = void 0;
|
|
36
|
+
exports.InputDragger = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
@@ -64,6 +64,18 @@ const deriveInputDraggerStep = ({ min, snapToStep, step, }) => {
|
|
|
64
64
|
return 0.0001;
|
|
65
65
|
};
|
|
66
66
|
exports.deriveInputDraggerStep = deriveInputDraggerStep;
|
|
67
|
+
const deriveInputDraggerDragStartValue = ({ min, value, }) => {
|
|
68
|
+
const numericValue = Number(value);
|
|
69
|
+
if (Number.isFinite(numericValue)) {
|
|
70
|
+
return numericValue;
|
|
71
|
+
}
|
|
72
|
+
const numericMin = Number(min);
|
|
73
|
+
if (Number.isFinite(numericMin)) {
|
|
74
|
+
return numericMin;
|
|
75
|
+
}
|
|
76
|
+
return 0;
|
|
77
|
+
};
|
|
78
|
+
exports.deriveInputDraggerDragStartValue = deriveInputDraggerDragStartValue;
|
|
67
79
|
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, ...props }, ref) => {
|
|
68
80
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
69
81
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
@@ -152,6 +164,10 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
152
164
|
const step = Number(_step !== null && _step !== void 0 ? _step : 1);
|
|
153
165
|
const min = Number(_min !== null && _min !== void 0 ? _min : 0);
|
|
154
166
|
const max = Number(_max !== null && _max !== void 0 ? _max : Infinity);
|
|
167
|
+
const dragStartValue = (0, exports.deriveInputDraggerDragStartValue)({
|
|
168
|
+
min: _min,
|
|
169
|
+
value,
|
|
170
|
+
});
|
|
155
171
|
if (distanceFromStart > 4) {
|
|
156
172
|
(0, input_dragger_click_lock_1.setClickLock)(true);
|
|
157
173
|
setDragging(true);
|
|
@@ -159,7 +175,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
159
175
|
target.blur();
|
|
160
176
|
}
|
|
161
177
|
const diff = (0, remotion_1.interpolate)(xDistance, [-5, -4, 0, 4, 5], [-step, 0, 0, 0, step]);
|
|
162
|
-
const newValue = Math.min(max, Math.max(min,
|
|
178
|
+
const newValue = Math.min(max, Math.max(min, dragStartValue + diff));
|
|
163
179
|
const nextValue = snapToStep
|
|
164
180
|
? roundToStep(newValue, step)
|
|
165
181
|
: dragDecimalPlaces === undefined
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NewComposition = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const url_state_1 = require("../../helpers/url-state");
|
|
8
|
+
const validate_new_comp_data_1 = require("../../helpers/validate-new-comp-data");
|
|
9
|
+
const layout_1 = require("../layout");
|
|
10
|
+
const ModalFooter_1 = require("../ModalFooter");
|
|
11
|
+
const ModalHeader_1 = require("../ModalHeader");
|
|
12
|
+
const layout_2 = require("../RenderModal/layout");
|
|
13
|
+
const CodemodFooter_1 = require("./CodemodFooter");
|
|
14
|
+
const DismissableModal_1 = require("./DismissableModal");
|
|
15
|
+
const InputDragger_1 = require("./InputDragger");
|
|
16
|
+
const NewCompDuration_1 = require("./NewCompDuration");
|
|
17
|
+
const RemInput_1 = require("./RemInput");
|
|
18
|
+
const ValidationMessage_1 = require("./ValidationMessage");
|
|
19
|
+
const content = {
|
|
20
|
+
padding: 12,
|
|
21
|
+
paddingRight: 12,
|
|
22
|
+
flex: 1,
|
|
23
|
+
fontSize: 13,
|
|
24
|
+
minWidth: 500,
|
|
25
|
+
};
|
|
26
|
+
const toPascalCase = (value) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const words = (_a = value.match(/[a-zA-Z0-9]+/g)) !== null && _a !== void 0 ? _a : [];
|
|
29
|
+
const candidate = words
|
|
30
|
+
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)
|
|
31
|
+
.join('');
|
|
32
|
+
if (!candidate) {
|
|
33
|
+
return 'NewComposition';
|
|
34
|
+
}
|
|
35
|
+
if (/^[0-9]/.test(candidate)) {
|
|
36
|
+
return `Composition${candidate}`;
|
|
37
|
+
}
|
|
38
|
+
return candidate;
|
|
39
|
+
};
|
|
40
|
+
const waitForComposition = (compositionId) => {
|
|
41
|
+
return new Promise((resolve) => {
|
|
42
|
+
const started = Date.now();
|
|
43
|
+
const interval = window.setInterval(() => {
|
|
44
|
+
var _a;
|
|
45
|
+
var _b;
|
|
46
|
+
const compositionNames = (_b = (_a = window.remotion_getCompositionNames) === null || _a === void 0 ? void 0 : _a.call(window)) !== null && _b !== void 0 ? _b : [];
|
|
47
|
+
if (compositionNames.includes(compositionId) ||
|
|
48
|
+
Date.now() - started > 10000) {
|
|
49
|
+
window.clearInterval(interval);
|
|
50
|
+
resolve();
|
|
51
|
+
}
|
|
52
|
+
}, 100);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const getUniqueCompositionName = (compositions) => {
|
|
56
|
+
let counter = 1;
|
|
57
|
+
while (true) {
|
|
58
|
+
const name = counter === 1 ? 'NewComposition' : `NewComposition${counter}`;
|
|
59
|
+
const err = (0, validate_new_comp_data_1.validateCompositionName)(name, compositions);
|
|
60
|
+
if (!err) {
|
|
61
|
+
return name;
|
|
62
|
+
}
|
|
63
|
+
counter++;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const NewCompositionLoaded = () => {
|
|
67
|
+
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
68
|
+
const [newId, setName] = (0, react_1.useState)(() => getUniqueCompositionName(compositions));
|
|
69
|
+
const [selectedFrameRate, setFrameRate] = (0, react_1.useState)(30);
|
|
70
|
+
const [size, setSize] = (0, react_1.useState)(() => ({
|
|
71
|
+
width: 1920,
|
|
72
|
+
height: 1080,
|
|
73
|
+
}));
|
|
74
|
+
const [durationInFrames, setDurationInFrames] = (0, react_1.useState)(150);
|
|
75
|
+
const onWidthChanged = (0, react_1.useCallback)((newValue) => {
|
|
76
|
+
setSize((s) => {
|
|
77
|
+
return {
|
|
78
|
+
height: s.height,
|
|
79
|
+
width: Number(newValue),
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}, []);
|
|
83
|
+
const onWidthDirectlyChanged = (0, react_1.useCallback)((newWidth) => {
|
|
84
|
+
setSize((s) => {
|
|
85
|
+
return {
|
|
86
|
+
height: s.height,
|
|
87
|
+
width: newWidth,
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}, []);
|
|
91
|
+
const onHeightDirectlyChanged = (0, react_1.useCallback)((newHeight) => {
|
|
92
|
+
setSize((s) => {
|
|
93
|
+
return {
|
|
94
|
+
width: s.width,
|
|
95
|
+
height: newHeight,
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}, []);
|
|
99
|
+
const onHeightChanged = (0, react_1.useCallback)((newValue) => {
|
|
100
|
+
setSize((s) => {
|
|
101
|
+
return {
|
|
102
|
+
width: s.width,
|
|
103
|
+
height: Number(newValue),
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
}, []);
|
|
107
|
+
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
108
|
+
setName(e.target.value);
|
|
109
|
+
}, []);
|
|
110
|
+
const onTextFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
111
|
+
setFrameRate(Number(newFps));
|
|
112
|
+
}, []);
|
|
113
|
+
const onFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
114
|
+
setFrameRate(newFps);
|
|
115
|
+
}, []);
|
|
116
|
+
const compNameErrMessage = (0, validate_new_comp_data_1.validateCompositionName)(newId, compositions);
|
|
117
|
+
const compWidthErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Width', size.width);
|
|
118
|
+
const compHeightErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Height', size.height);
|
|
119
|
+
const componentName = toPascalCase(newId);
|
|
120
|
+
const valid = compNameErrMessage === null &&
|
|
121
|
+
compWidthErrMessage === null &&
|
|
122
|
+
compHeightErrMessage === null;
|
|
123
|
+
const codemod = (0, react_1.useMemo)(() => {
|
|
124
|
+
return {
|
|
125
|
+
type: 'new-composition',
|
|
126
|
+
newDurationInFrames: Number(durationInFrames),
|
|
127
|
+
newFps: Number(selectedFrameRate),
|
|
128
|
+
newHeight: Number(size.height),
|
|
129
|
+
newWidth: Number(size.width),
|
|
130
|
+
newId,
|
|
131
|
+
componentName,
|
|
132
|
+
componentImportPath: `./${componentName}`,
|
|
133
|
+
};
|
|
134
|
+
}, [
|
|
135
|
+
componentName,
|
|
136
|
+
durationInFrames,
|
|
137
|
+
newId,
|
|
138
|
+
selectedFrameRate,
|
|
139
|
+
size.height,
|
|
140
|
+
size.width,
|
|
141
|
+
]);
|
|
142
|
+
const onSuccess = (0, react_1.useCallback)(() => {
|
|
143
|
+
waitForComposition(newId).then(() => {
|
|
144
|
+
(0, url_state_1.pushUrl)(`/${newId}`);
|
|
145
|
+
});
|
|
146
|
+
}, [newId]);
|
|
147
|
+
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
}, []);
|
|
150
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
151
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "New composition" }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
152
|
+
jsx_runtime_1.jsxs("div", { style: content, children: [
|
|
153
|
+
jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
154
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
|
|
155
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
156
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })
|
|
157
|
+
] })) : null] }) })
|
|
158
|
+
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
159
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
|
|
160
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
161
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })
|
|
162
|
+
] })) : null] })
|
|
163
|
+
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
164
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
|
|
165
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
166
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })
|
|
167
|
+
] })) : null] })
|
|
168
|
+
] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
169
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })
|
|
170
|
+
] })
|
|
171
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: "Creating composition...", errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: null, valid: valid, onSuccess: onSuccess, fallbackToRootFile: true }) })
|
|
172
|
+
] })
|
|
173
|
+
] }));
|
|
174
|
+
};
|
|
175
|
+
const NewComposition = () => {
|
|
176
|
+
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { children: jsx_runtime_1.jsx(NewCompositionLoaded, {}) }));
|
|
177
|
+
};
|
|
178
|
+
exports.NewComposition = NewComposition;
|
|
@@ -83,8 +83,8 @@ const PreviewToolbarControl = ({ children }) => {
|
|
|
83
83
|
};
|
|
84
84
|
const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
85
85
|
const { playbackRate, setPlaybackRate } = remotion_1.Internals.usePlaybackRate();
|
|
86
|
-
const {
|
|
87
|
-
const {
|
|
86
|
+
const { playerMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
|
|
87
|
+
const { setPlayerMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
|
|
88
88
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
89
89
|
const isVideoComposition = (0, is_current_selected_still_1.useIsVideoComposition)();
|
|
90
90
|
const previewToolbarRef = (0, react_1.useRef)(null);
|
|
@@ -163,7 +163,7 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
163
163
|
jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
164
164
|
jsx_runtime_1.jsx("div", { style: padding }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineZoomControls_1.TimelineZoomControls, {}) })
|
|
165
165
|
] }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), isVideoComposition ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
166
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted:
|
|
166
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted: playerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
|
|
167
167
|
] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
168
168
|
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, {}) })
|
|
169
169
|
] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, {}) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout && (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type SelectedOutline } from './selected-outline-geometry';
|
|
3
|
+
import { type SelectedOutlineTarget } from './selected-outline-types';
|
|
2
4
|
export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutlineActiveSchema, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold, selectedOutlineUvSnapThresholdPx, selectedOutlineTransformOriginSnapThresholdPx, snapSelectedOutlineRotationDeltaDegrees, snapSelectedOutlineUv, snapSelectedOutlineTransformOriginUv, } from './selected-outline-drag';
|
|
3
5
|
export { getOutlineSelectionInteraction, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
|
|
4
6
|
export { selectedOutlineDragThresholdPx } from './selected-outline-types';
|
|
5
7
|
export type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineScaleDragState, } from './selected-outline-types';
|
|
8
|
+
export declare const orderOutlinesForRendering: ({ outlines, targetsByKey, }: {
|
|
9
|
+
readonly outlines: readonly SelectedOutline[];
|
|
10
|
+
readonly targetsByKey: ReadonlyMap<string, SelectedOutlineTarget>;
|
|
11
|
+
}) => readonly SelectedOutline[];
|
|
6
12
|
export declare const SelectedOutlineOverlay: React.FC<{
|
|
7
13
|
readonly scale: number;
|
|
8
14
|
}>;
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.SelectedOutlineOverlay = exports.selectedOutlineDragThresholdPx = exports.getTransformedSvgViewportPoints = exports.getSequencesWithSelectableOutlines = exports.getSelectedSequenceKeys = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationDeltaDegrees = exports.getSelectedOutlineRotationCornerInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineUv = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.selectedOutlineUvSnapThresholdPx = exports.isSelectedOutlineDragPastThreshold = exports.getSelectedOutlineTransformOriginLockedAxis = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineActiveSchema = exports.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = void 0;
|
|
36
|
+
exports.SelectedOutlineOverlay = exports.orderOutlinesForRendering = exports.selectedOutlineDragThresholdPx = exports.getTransformedSvgViewportPoints = exports.getSequencesWithSelectableOutlines = exports.getSelectedSequenceKeys = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationDeltaDegrees = exports.getSelectedOutlineRotationCornerInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineUv = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.selectedOutlineUvSnapThresholdPx = exports.isSelectedOutlineDragPastThreshold = exports.getSelectedOutlineTransformOriginLockedAxis = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineActiveSchema = exports.compensateTranslateForTransformOrigin = exports.applySelectedOutlineTransformOriginAxisLock = exports.applySelectedOutlineDragAxisLock = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const player_1 = require("@remotion/player");
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
@@ -95,6 +95,16 @@ const outlineContainer = {
|
|
|
95
95
|
pointerEvents: 'none',
|
|
96
96
|
overflow: 'visible',
|
|
97
97
|
};
|
|
98
|
+
const orderOutlinesForRendering = ({ outlines, targetsByKey, }) => {
|
|
99
|
+
return [...outlines].sort((a, b) => {
|
|
100
|
+
var _a, _b;
|
|
101
|
+
var _c, _d;
|
|
102
|
+
const aSelected = (_c = (_a = targetsByKey.get(a.key)) === null || _a === void 0 ? void 0 : _a.selected) !== null && _c !== void 0 ? _c : false;
|
|
103
|
+
const bSelected = (_d = (_b = targetsByKey.get(b.key)) === null || _b === void 0 ? void 0 : _b.selected) !== null && _d !== void 0 ? _d : false;
|
|
104
|
+
return Number(aSelected) - Number(bSelected);
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
exports.orderOutlinesForRendering = orderOutlinesForRendering;
|
|
98
108
|
const SelectedOutlineOverlay = ({ scale }) => {
|
|
99
109
|
const { selectedItems, selectItem } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
100
110
|
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
@@ -120,6 +130,9 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
120
130
|
setHoveredOutlineKey(null);
|
|
121
131
|
}
|
|
122
132
|
}, []);
|
|
133
|
+
const selectOutlineItem = (0, react_1.useCallback)((item, interaction) => {
|
|
134
|
+
selectItem(item, interaction, undefined, { reveal: true });
|
|
135
|
+
}, [selectItem]);
|
|
123
136
|
const outlineTargets = (0, react_1.useMemo)(() => {
|
|
124
137
|
if (!editorShowOutlines) {
|
|
125
138
|
return [];
|
|
@@ -363,6 +376,9 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
363
376
|
const targetsByKey = (0, react_1.useMemo)(() => {
|
|
364
377
|
return new Map(outlineTargets.map((target) => [target.key, target]));
|
|
365
378
|
}, [outlineTargets]);
|
|
379
|
+
const outlinesForRendering = (0, react_1.useMemo)(() => {
|
|
380
|
+
return (0, exports.orderOutlinesForRendering)({ outlines, targetsByKey });
|
|
381
|
+
}, [outlines, targetsByKey]);
|
|
366
382
|
const allDragTargets = (0, react_1.useMemo)(() => {
|
|
367
383
|
return outlineTargets.flatMap((target) => (target.selected || target.containsSelection) && target.drag !== null
|
|
368
384
|
? [target.drag]
|
|
@@ -622,6 +638,6 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
622
638
|
if (outlineTargets.length === 0) {
|
|
623
639
|
return null;
|
|
624
640
|
}
|
|
625
|
-
return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [
|
|
641
|
+
return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineElement, { allDragTargets: allDragTargets, allRotationDragTargets: allRotationDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered: hoveredOutlineKey === outline.key, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: setHoveredOutlineKey, onSelect: selectOutlineItem, scale: scale, target: targetsByKey.get(outline.key) }, outline.key))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleConnectionLayer, { outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-connection-lines`))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleCircleLayer, { onDraggingChange: onDraggingChange, onSelect: selectOutlineItem, outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-handles`)))] }));
|
|
626
642
|
};
|
|
627
643
|
exports.SelectedOutlineOverlay = SelectedOutlineOverlay;
|
|
@@ -116,10 +116,10 @@ type TimelineSelectionContextValue = {
|
|
|
116
116
|
readonly canSelect: boolean;
|
|
117
117
|
readonly selectedItems: readonly TimelineSelection[];
|
|
118
118
|
readonly isSelected: (item: TimelineSelection) => boolean;
|
|
119
|
-
readonly selectItem: (item: TimelineSelection, interaction?: TimelineSelectionInteraction, allSelectableItems?: readonly TimelineSelection[]) => void;
|
|
120
|
-
readonly selectItems: (items: readonly TimelineSelection[]) => void;
|
|
119
|
+
readonly selectItem: (item: TimelineSelection, interaction?: TimelineSelectionInteraction, allSelectableItems?: readonly TimelineSelection[], options?: TimelineSelectionOptions) => void;
|
|
120
|
+
readonly selectItems: (items: readonly TimelineSelection[], options?: TimelineSelectionOptions) => void;
|
|
121
121
|
readonly registerMarqueeSelectableItem: (item: TimelineSelection, getRect: () => DOMRect | null) => () => void;
|
|
122
|
-
readonly registerFocusableItem: (item: TimelineSelection,
|
|
122
|
+
readonly registerFocusableItem: (item: TimelineSelection, getElement: () => Element | null) => () => void;
|
|
123
123
|
readonly getMarqueeSelection: (marqueeRect: TimelineMarqueeRect, lockedSelectionKind: TimelineMarqueeSelectionKind | null) => {
|
|
124
124
|
readonly lockedSelectionKind: TimelineMarqueeSelectionKind | null;
|
|
125
125
|
readonly selectedItems: readonly TimelineSelection[];
|
|
@@ -131,6 +131,9 @@ export declare const TimelineSelectionOrderProvider: React.FC<{
|
|
|
131
131
|
readonly children: React.ReactNode;
|
|
132
132
|
readonly items: readonly TimelineSelection[];
|
|
133
133
|
}>;
|
|
134
|
+
type TimelineSelectionOptions = {
|
|
135
|
+
readonly reveal?: boolean;
|
|
136
|
+
};
|
|
134
137
|
export declare const getTimelineSelectionFromNodePathInfo: (nodePathInfo: SequenceNodePathInfo | null) => TimelineSelection | null;
|
|
135
138
|
export declare const getTimelineSelectionKey: (item: TimelineSelection) => string;
|
|
136
139
|
export declare const getSelectableTimelineSequenceSelections: (tracks: readonly Pick<TrackWithHash, "nodePathInfo">[]) => TimelineSelection[];
|