@remotion/studio 4.0.504 → 4.0.506
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/api/install-package.d.ts +2 -3
- package/dist/api/install-package.js +1 -3
- package/dist/api/visual-control.d.ts +3 -0
- package/dist/api/visual-control.js +3 -0
- package/dist/components/AssetSelectorItem.js +3 -3
- package/dist/components/AudioWaveform.d.ts +1 -1
- package/dist/components/AudioWaveform.js +36 -3
- package/dist/components/Canvas.js +2 -0
- package/dist/components/CompositionContextButton.d.ts +1 -1
- package/dist/components/CompositionContextButton.js +2 -2
- package/dist/components/CompositionSelector.js +3 -3
- package/dist/components/CompositionSelectorItem.js +5 -5
- package/dist/components/ConfigureDefaultEditorModal.d.ts +3 -1
- package/dist/components/ConfigureDefaultEditorModal.js +90 -32
- package/dist/components/ConfigureLicenseModal.d.ts +2 -1
- package/dist/components/ConfigureLicenseModal.js +40 -32
- package/dist/components/ConfirmationDialog.js +2 -2
- package/dist/components/ContextMenu.d.ts +5 -7
- package/dist/components/ContextMenu.js +54 -21
- package/dist/components/Editor.js +2 -0
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EffectPickerModal.js +3 -3
- package/dist/components/GlobalKeybindings.js +3 -2
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +14 -13
- package/dist/components/InlineCaptionInspector.d.ts +2 -2
- package/dist/components/InlineDropdown.d.ts +4 -2
- package/dist/components/InlineDropdown.js +23 -6
- package/dist/components/InspectorOpenInEditor.d.ts +1 -0
- package/dist/components/InspectorOpenInEditor.js +33 -9
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +15 -1
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -3
- package/dist/components/InspectorPanel/EasingInspector.js +7 -4
- package/dist/components/InspectorPanel/KeyframeInspector.js +5 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.d.ts +1 -0
- package/dist/components/InspectorPanel/common.js +25 -35
- package/dist/components/InspectorPanel/use-composition-actions.js +4 -1
- package/dist/components/InspectorSequenceSection.js +5 -5
- package/dist/components/InstallPackage.js +1 -1
- package/dist/components/Menu/MenuItem.js +16 -12
- package/dist/components/MenuBuildIndicator.js +12 -58
- package/dist/components/MenuCompositionName.js +3 -63
- package/dist/components/MenuToolbar.js +22 -2
- package/dist/components/ModalFooter.d.ts +1 -0
- package/dist/components/ModalFooter.js +6 -2
- package/dist/components/ModalHeader.js +1 -1
- package/dist/components/Modals.js +18 -7
- package/dist/components/ModalsProvider.js +5 -6
- package/dist/components/NewComposition/CodemodFooter.js +1 -1
- package/dist/components/NewComposition/DismissableModal.js +1 -1
- package/dist/components/NewComposition/InputDragger.d.ts +1 -0
- package/dist/components/NewComposition/InputDragger.js +5 -4
- package/dist/components/NewComposition/MenuContent.d.ts +1 -1
- package/dist/components/NewComposition/RenameStaticFile.js +1 -1
- package/dist/components/NewComposition/menu-typeahead.d.ts +1 -1
- package/dist/components/OverrideInputProps.js +1 -1
- package/dist/components/PlayPause.js +3 -2
- package/dist/components/PlaybackKeyboardShortcutsManager.js +7 -5
- package/dist/components/PlaybackRateSelector.js +3 -9
- package/dist/components/PreviewToolbar.js +7 -4
- package/dist/components/PreviewToolbarOverflowButton.js +4 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/RenderButton.d.ts +3 -2
- package/dist/components/RenderButton.js +95 -43
- package/dist/components/RenderModal/RenderStatusModal.js +1 -1
- package/dist/components/RenderModal/ServerRenderModal.js +1 -1
- package/dist/components/RenderModal/WebRenderModal.js +3 -2
- package/dist/components/RenderQueue/RenderQueueError.js +1 -1
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
- package/dist/components/RenderQueue/RenderQueueProgressMessage.js +1 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
- package/dist/components/SelectedOutlineElement.js +10 -11
- package/dist/components/SelectedOutlineOverlay.js +67 -20
- package/dist/components/SettingsModal.d.ts +7 -0
- package/dist/components/SettingsModal.js +50 -0
- package/dist/components/SettingsModalFooter.d.ts +4 -0
- package/dist/components/SettingsModalFooter.js +46 -0
- package/dist/components/SidebarRenderButton.js +1 -1
- package/dist/components/SizeSelector.js +3 -9
- package/dist/components/SvgImportDialog.js +2 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/Timeline.js +5 -4
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +6 -3
- package/dist/components/Timeline/TimelineEffectItem.js +6 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +11 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +6 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +32 -1
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
- package/dist/components/Timeline/TimelineFontFamilyField.js +3 -1
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.js +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +4 -2
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +30 -28
- package/dist/components/Timeline/TimelineList.d.ts +1 -0
- package/dist/components/Timeline/TimelineList.js +2 -3
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequence.js +34 -28
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +3 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +61 -56
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +10 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +64 -12
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +39 -6
- package/dist/components/Timeline/TimelineTimeIndicators.js +36 -3
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +36 -3
- package/dist/components/Timeline/TimelineZoomControls.d.ts +2 -2
- package/dist/components/Timeline/TimelineZoomControls.js +39 -12
- package/dist/components/Timeline/reset-selected-timeline-props.js +1 -1
- package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +1 -1
- package/dist/components/Timeline/timeline-asset-link.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +2 -2
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +1 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -18
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +5 -0
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-height.js +23 -2
- package/dist/components/TimelineCombobox.d.ts +11 -0
- package/dist/components/TimelineCombobox.js +181 -0
- package/dist/components/TimelineInOutToggle.js +5 -1
- package/dist/components/TopPanel.js +22 -7
- package/dist/components/UpdateCheck.js +1 -1
- package/dist/components/effect-drag-and-drop.js +1 -1
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +12 -2
- package/dist/components/import-assets.d.ts +18 -6
- package/dist/components/import-assets.js +76 -32
- package/dist/components/selected-outline-types.d.ts +1 -1
- package/dist/esm/{chunk-43m68z1k.js → chunk-b49ec3nz.js} +12436 -11482
- package/dist/esm/internals.mjs +12436 -11482
- package/dist/esm/previewEntry.mjs +9671 -8717
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/client-id.d.ts +3 -1
- package/dist/helpers/client-id.js +21 -4
- package/dist/helpers/hoverable.d.ts +11 -0
- package/dist/helpers/hoverable.js +70 -0
- package/dist/helpers/inject-css.js +3 -0
- package/dist/helpers/install-required-package.d.ts +3 -3
- package/dist/helpers/install-required-package.js +1 -6
- package/dist/helpers/studio-fit-padding.d.ts +1 -1
- package/dist/helpers/studio-fit-padding.js +1 -1
- package/dist/helpers/timeline-layout.d.ts +2 -1
- package/dist/helpers/timeline-layout.js +5 -2
- package/dist/helpers/use-is-fullscreen.d.ts +1 -0
- package/dist/helpers/use-is-fullscreen.js +25 -0
- package/dist/helpers/use-menu-structure.js +26 -43
- package/dist/helpers/use-runtime-values.d.ts +11 -0
- package/dist/helpers/use-runtime-values.js +76 -0
- package/dist/icons/apps.d.ts +2 -0
- package/dist/icons/apps.js +7 -0
- package/dist/icons/browse-elements.d.ts +4 -0
- package/dist/icons/browse-elements.js +10 -0
- package/dist/icons/canvas-zoom.d.ts +10 -0
- package/dist/icons/canvas-zoom.js +21 -0
- package/dist/icons/playback-rate.d.ts +5 -0
- package/dist/icons/playback-rate.js +31 -0
- package/dist/icons/search.d.ts +5 -0
- package/dist/icons/search.js +10 -0
- package/dist/state/modals.d.ts +5 -6
- package/dist/state/modals.js +5 -3
- package/package.json +12 -12
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.ContextMenuForTarget = exports.ContextMenu = void 0;
|
|
39
|
+
exports.ContextMenuForTarget = exports.ContextMenu = exports.resolveContextMenuItems = void 0;
|
|
40
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
41
|
const player_1 = require("@remotion/player");
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
@@ -47,6 +47,14 @@ const z_index_1 = require("../state/z-index");
|
|
|
47
47
|
const portals_1 = require("./Menu/portals");
|
|
48
48
|
const styles_1 = require("./Menu/styles");
|
|
49
49
|
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
50
|
+
const resolveContextMenuItems = async (getItems, event) => {
|
|
51
|
+
const result = await getItems(event);
|
|
52
|
+
if (result === false || result.length === 0) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return [...result];
|
|
56
|
+
};
|
|
57
|
+
exports.resolveContextMenuItems = resolveContextMenuItems;
|
|
50
58
|
const contextMenuFullScreenOverlay = {
|
|
51
59
|
...styles_1.fullScreenOverlay,
|
|
52
60
|
pointerEvents: 'none',
|
|
@@ -62,7 +70,7 @@ const notifyContextMenuOpened = (id) => {
|
|
|
62
70
|
detail: id,
|
|
63
71
|
}));
|
|
64
72
|
};
|
|
65
|
-
const ContextMenuPortal = ({ sizeSource, currentZIndex, onHide, opened
|
|
73
|
+
const ContextMenuPortal = ({ sizeSource, currentZIndex, onHide, opened }) => {
|
|
66
74
|
const menuRef = (0, react_1.useRef)(null);
|
|
67
75
|
const size = player_1.PlayerInternals.useElementSize(sizeSource, {
|
|
68
76
|
triggerOnWindowResize: true,
|
|
@@ -154,11 +162,14 @@ const ContextMenuPortal = ({ sizeSource, currentZIndex, onHide, opened, values }
|
|
|
154
162
|
if (!portalStyle) {
|
|
155
163
|
return null;
|
|
156
164
|
}
|
|
157
|
-
return react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: contextMenuFullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: contextMenuOuterPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, outsideClickButton: "primary", children: jsx_runtime_1.jsx("div", { ref: menuRef, 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));
|
|
165
|
+
return react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: contextMenuFullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: contextMenuOuterPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, outsideClickButton: "primary", children: jsx_runtime_1.jsx("div", { ref: menuRef, style: portalStyle, onPointerDown: onMenuPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: opened.values, onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex));
|
|
158
166
|
};
|
|
159
|
-
exports.ContextMenu = react_1.default.forwardRef(({ children,
|
|
167
|
+
exports.ContextMenu = react_1.default.forwardRef(({ children, getItems, style = undefined, className = undefined, onPointerDown = undefined, }, forwardedRef) => {
|
|
160
168
|
const ref = (0, react_1.useRef)(null);
|
|
161
169
|
const idRef = (0, react_1.useRef)(nextContextMenuId++);
|
|
170
|
+
const invocationRef = (0, react_1.useRef)(0);
|
|
171
|
+
const getItemsRef = (0, react_1.useRef)(getItems);
|
|
172
|
+
getItemsRef.current = getItems;
|
|
162
173
|
const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
|
|
163
174
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
164
175
|
const setRef = (0, react_1.useCallback)((node) => {
|
|
@@ -177,21 +188,34 @@ exports.ContextMenu = react_1.default.forwardRef(({ children, values, onOpen, st
|
|
|
177
188
|
if (!current) {
|
|
178
189
|
return;
|
|
179
190
|
}
|
|
180
|
-
const onClick = (e) => {
|
|
191
|
+
const onClick = async (e) => {
|
|
181
192
|
e.preventDefault();
|
|
182
193
|
e.stopPropagation();
|
|
183
|
-
|
|
194
|
+
const currentInvocation = ++invocationRef.current;
|
|
195
|
+
const values = await (0, exports.resolveContextMenuItems)(getItemsRef.current, e);
|
|
196
|
+
if (currentInvocation !== invocationRef.current || values === null) {
|
|
184
197
|
return false;
|
|
185
198
|
}
|
|
186
199
|
notifyContextMenuOpened(idRef.current);
|
|
187
|
-
setOpened({
|
|
200
|
+
setOpened({
|
|
201
|
+
type: 'open',
|
|
202
|
+
left: e.clientX,
|
|
203
|
+
top: e.clientY,
|
|
204
|
+
values,
|
|
205
|
+
});
|
|
188
206
|
return false;
|
|
189
207
|
};
|
|
190
208
|
current.addEventListener('contextmenu', onClick);
|
|
191
209
|
return () => {
|
|
192
210
|
current.removeEventListener('contextmenu', onClick);
|
|
193
211
|
};
|
|
194
|
-
}, [
|
|
212
|
+
}, []);
|
|
213
|
+
(0, react_1.useEffect)(() => {
|
|
214
|
+
const invocation = invocationRef;
|
|
215
|
+
return () => {
|
|
216
|
+
invocation.current++;
|
|
217
|
+
};
|
|
218
|
+
}, []);
|
|
195
219
|
const onHide = (0, react_1.useCallback)(() => {
|
|
196
220
|
setOpened({ type: 'not-open' });
|
|
197
221
|
}, []);
|
|
@@ -208,13 +232,15 @@ exports.ContextMenu = react_1.default.forwardRef(({ children, values, onOpen, st
|
|
|
208
232
|
};
|
|
209
233
|
}, [onHide]);
|
|
210
234
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
211
|
-
jsx_runtime_1.jsx("div", { ref: setRef, onContextMenu: () => false, style: style, className: className, onPointerDown: onPointerDown, children: children }), opened.type === 'open' ? (jsx_runtime_1.jsx(ContextMenuPortal, { sizeSource: ref, currentZIndex: currentZIndex, onHide: onHide, opened: opened
|
|
235
|
+
jsx_runtime_1.jsx("div", { ref: setRef, onContextMenu: () => false, style: style, className: className, onPointerDown: onPointerDown, children: children }), opened.type === 'open' ? (jsx_runtime_1.jsx(ContextMenuPortal, { sizeSource: ref, currentZIndex: currentZIndex, onHide: onHide, opened: opened })) : null] }));
|
|
212
236
|
});
|
|
213
237
|
exports.ContextMenu.displayName = 'ContextMenu';
|
|
214
|
-
const ContextMenuForTarget = ({ triggerRef,
|
|
238
|
+
const ContextMenuForTarget = ({ triggerRef, getItems }) => {
|
|
215
239
|
const idRef = (0, react_1.useRef)(nextContextMenuId++);
|
|
240
|
+
const invocationRef = (0, react_1.useRef)(0);
|
|
241
|
+
const getItemsRef = (0, react_1.useRef)(getItems);
|
|
242
|
+
getItemsRef.current = getItems;
|
|
216
243
|
const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
|
|
217
|
-
const [openedValues, setOpenedValues] = (0, react_1.useState)(values);
|
|
218
244
|
const [body, setBody] = (0, react_1.useState)(null);
|
|
219
245
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
220
246
|
(0, react_1.useEffect)(() => {
|
|
@@ -231,24 +257,31 @@ const ContextMenuForTarget = ({ triggerRef, values, onOpen }) => {
|
|
|
231
257
|
const e = event;
|
|
232
258
|
e.preventDefault();
|
|
233
259
|
e.stopPropagation();
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
const nextValues = Array.isArray(result) ? result : values;
|
|
239
|
-
if (nextValues.length === 0) {
|
|
260
|
+
const currentInvocation = ++invocationRef.current;
|
|
261
|
+
const values = await (0, exports.resolveContextMenuItems)(getItemsRef.current, e);
|
|
262
|
+
if (currentInvocation !== invocationRef.current || values === null) {
|
|
240
263
|
return false;
|
|
241
264
|
}
|
|
242
265
|
notifyContextMenuOpened(idRef.current);
|
|
243
|
-
|
|
244
|
-
|
|
266
|
+
setOpened({
|
|
267
|
+
type: 'open',
|
|
268
|
+
left: e.clientX,
|
|
269
|
+
top: e.clientY,
|
|
270
|
+
values,
|
|
271
|
+
});
|
|
245
272
|
return false;
|
|
246
273
|
};
|
|
247
274
|
current.addEventListener('contextmenu', onClick);
|
|
248
275
|
return () => {
|
|
249
276
|
current.removeEventListener('contextmenu', onClick);
|
|
250
277
|
};
|
|
251
|
-
}, [
|
|
278
|
+
}, [triggerRef]);
|
|
279
|
+
(0, react_1.useEffect)(() => {
|
|
280
|
+
const invocation = invocationRef;
|
|
281
|
+
return () => {
|
|
282
|
+
invocation.current++;
|
|
283
|
+
};
|
|
284
|
+
}, []);
|
|
252
285
|
const onHide = (0, react_1.useCallback)(() => {
|
|
253
286
|
setOpened({ type: 'not-open' });
|
|
254
287
|
}, []);
|
|
@@ -264,6 +297,6 @@ const ContextMenuForTarget = ({ triggerRef, values, onOpen }) => {
|
|
|
264
297
|
window.removeEventListener(contextMenuOpenedEvent, onOtherContextMenuOpened);
|
|
265
298
|
};
|
|
266
299
|
}, [onHide]);
|
|
267
|
-
return opened.type === 'open' ? (jsx_runtime_1.jsx(ContextMenuPortal, { sizeSource: body, currentZIndex: currentZIndex, onHide: onHide, opened: opened
|
|
300
|
+
return opened.type === 'open' ? (jsx_runtime_1.jsx(ContextMenuPortal, { sizeSource: body, currentZIndex: currentZIndex, onHide: onHide, opened: opened })) : null;
|
|
268
301
|
};
|
|
269
302
|
exports.ContextMenuForTarget = ContextMenuForTarget;
|
|
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
const player_1 = require("@remotion/player");
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
40
40
|
const remotion_1 = require("remotion");
|
|
41
|
+
const client_id_1 = require("../helpers/client-id");
|
|
41
42
|
const colors_1 = require("../helpers/colors");
|
|
42
43
|
const noop_1 = require("../helpers/noop");
|
|
43
44
|
const studio_fit_padding_1 = require("../helpers/studio-fit-padding");
|
|
@@ -62,6 +63,7 @@ const background = {
|
|
|
62
63
|
position: 'absolute',
|
|
63
64
|
};
|
|
64
65
|
const Editor = ({ Root, readOnlyStudio }) => {
|
|
66
|
+
(0, client_id_1.useStudioConfigRevision)();
|
|
65
67
|
const [drawElement, setDrawElement] = (0, react_1.useState)(null);
|
|
66
68
|
const size = player_1.PlayerInternals.useElementSize(drawElement, {
|
|
67
69
|
triggerOnWindowResize: false,
|
|
@@ -165,7 +165,7 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
165
165
|
.filter(no_react_1.NoReactInternals.truthy)
|
|
166
166
|
.join(' ');
|
|
167
167
|
}, [activeClassName]);
|
|
168
|
-
const
|
|
168
|
+
const getContextMenuItems = (0, react_1.useCallback)(() => {
|
|
169
169
|
return [
|
|
170
170
|
{
|
|
171
171
|
id: '1',
|
|
@@ -191,6 +191,6 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
191
191
|
},
|
|
192
192
|
];
|
|
193
193
|
}, [clearSelection, guide.id, selected, setGuidesList]);
|
|
194
|
-
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, {
|
|
194
|
+
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: jsx_runtime_1.jsx("div", { style: guideStyle, onPointerDown: onPointerDown, onClick: onClick, className: "__remotion_editor_guide", [should_clear_selection_on_pointer_down_1.PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: 'true', onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsx("div", { style: guideContentStyle, className: guideClassName }) }) }));
|
|
195
195
|
};
|
|
196
196
|
exports.default = (0, react_1.memo)(GuideComp);
|
|
@@ -131,7 +131,7 @@ const EffectPickerResult = ({ item, selected, onSelected }) => {
|
|
|
131
131
|
const onClick = (0, react_1.useCallback)(() => {
|
|
132
132
|
onSelected(item);
|
|
133
133
|
}, [item, onSelected]);
|
|
134
|
-
const
|
|
134
|
+
const getContextMenuItems = (0, react_1.useCallback)(() => {
|
|
135
135
|
const documentationLink = (0, studio_shared_1.getEffectDocumentationLink)(item);
|
|
136
136
|
return [
|
|
137
137
|
{
|
|
@@ -150,12 +150,12 @@ const EffectPickerResult = ({ item, selected, onSelected }) => {
|
|
|
150
150
|
},
|
|
151
151
|
];
|
|
152
152
|
}, [item]);
|
|
153
|
-
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, {
|
|
153
|
+
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: jsx_runtime_1.jsxs("div", { ref: ref, style: style, onClick: onClick, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [
|
|
154
154
|
jsx_runtime_1.jsx(effects_1.EffectsIcon, { color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: labelContainer, children: jsx_runtime_1.jsx("div", { style: labelStyle, children: item.label }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: category, children: item.category })
|
|
155
155
|
] }) }));
|
|
156
156
|
};
|
|
157
157
|
const EffectPickerContent = ({ state }) => {
|
|
158
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
158
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
159
159
|
const [aboutEffectsHovered, setAboutEffectsHovered] = (0, react_1.useState)(false);
|
|
160
160
|
const [query, setQuery] = (0, react_1.useState)('');
|
|
161
161
|
const [selectedIndex, setSelectedIndex] = (0, react_1.useState)(0);
|
|
@@ -24,7 +24,7 @@ const sequencePropShortcuts = {
|
|
|
24
24
|
const hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
25
25
|
const GlobalKeybindings = () => {
|
|
26
26
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
27
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
27
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
28
28
|
const { setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
29
29
|
const { setEditorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
30
30
|
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
@@ -58,7 +58,8 @@ const GlobalKeybindings = () => {
|
|
|
58
58
|
if (!(track === null || track === void 0 ? void 0 : track.sequence.controls)) {
|
|
59
59
|
return false;
|
|
60
60
|
}
|
|
61
|
-
const { schema,
|
|
61
|
+
const { schema, runtimeValues } = track.sequence.controls;
|
|
62
|
+
const currentRuntimeValueDotNotation = runtimeValues.getSnapshot();
|
|
62
63
|
if (!hasOwnProperty(schema, fieldKey) &&
|
|
63
64
|
!hasOwnProperty(currentRuntimeValueDotNotation, fieldKey)) {
|
|
64
65
|
return false;
|
|
@@ -7,4 +7,4 @@ export type InlineActionProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
7
7
|
readonly variant: 'compact' | null;
|
|
8
8
|
readonly style?: React.CSSProperties;
|
|
9
9
|
};
|
|
10
|
-
export declare const InlineAction: ({ renderAction, onClick, disabled, title, unhoveredColor, variant, style: customStyle, ...buttonProps }: InlineActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const InlineAction: ({ renderAction, onClick, disabled, title, unhoveredColor, variant, style: customStyle, className, ...buttonProps }: InlineActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,23 +4,14 @@ exports.InlineAction = 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 hoverable_1 = require("../helpers/hoverable");
|
|
7
8
|
const z_index_1 = require("../state/z-index");
|
|
8
|
-
const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor = colors_1.LIGHT_TEXT, variant, style: customStyle, ...buttonProps }) => {
|
|
9
|
+
const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor = colors_1.LIGHT_TEXT, variant, style: customStyle, className, ...buttonProps }) => {
|
|
9
10
|
var _a;
|
|
10
11
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
11
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
12
|
-
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
13
|
-
setHovered(true);
|
|
14
|
-
}, []);
|
|
15
|
-
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
16
|
-
setHovered(false);
|
|
17
|
-
}, []);
|
|
18
12
|
const style = (0, react_1.useMemo)(() => {
|
|
19
13
|
return {
|
|
20
14
|
border: 'none',
|
|
21
|
-
background: disabled
|
|
22
|
-
? colors_1.TRANSPARENT
|
|
23
|
-
: (0, colors_1.getBackgroundFromHoverState)({ hovered, selected: false }),
|
|
24
15
|
height: 24,
|
|
25
16
|
width: variant === 'compact' ? 14 : 24,
|
|
26
17
|
padding: 0,
|
|
@@ -30,9 +21,19 @@ const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor =
|
|
|
30
21
|
borderRadius: 3,
|
|
31
22
|
opacity: disabled ? 0.5 : 1,
|
|
32
23
|
pointerEvents: disabled ? 'none' : 'auto',
|
|
24
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
25
|
+
idleBackground: colors_1.TRANSPARENT,
|
|
26
|
+
hoverBackground: disabled
|
|
27
|
+
? colors_1.TRANSPARENT
|
|
28
|
+
: (0, colors_1.getBackgroundFromHoverState)({ hovered: true, selected: false }),
|
|
29
|
+
idleColor: unhoveredColor,
|
|
30
|
+
hoverColor: disabled ? unhoveredColor : colors_1.WHITE,
|
|
31
|
+
}),
|
|
33
32
|
...customStyle,
|
|
34
33
|
};
|
|
35
|
-
}, [customStyle, disabled,
|
|
36
|
-
return (jsx_runtime_1.jsx("button", { ...buttonProps, type: "button",
|
|
34
|
+
}, [customStyle, disabled, unhoveredColor, variant]);
|
|
35
|
+
return (jsx_runtime_1.jsx("button", { ...buttonProps, type: "button", className: className
|
|
36
|
+
? `${hoverable_1.HOVERABLE_CLASS_NAME} ${className}`
|
|
37
|
+
: hoverable_1.HOVERABLE_CLASS_NAME, disabled: disabled, onClick: onClick, style: style, tabIndex: tabIndex, title: title, "aria-label": (_a = buttonProps['aria-label']) !== null && _a !== void 0 ? _a : title, children: renderAction(colors_1.CURRENT_COLOR) }));
|
|
37
38
|
};
|
|
38
39
|
exports.InlineAction = InlineAction;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Caption } from '@remotion/captions';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SequencePropsSubscriptionKey, SequenceRegistrationControls } from 'remotion';
|
|
4
4
|
import type { CodePosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
5
5
|
export declare const InlineCaptionInspector: React.FC<{
|
|
6
6
|
readonly captions: Caption[];
|
|
7
|
-
readonly controls:
|
|
7
|
+
readonly controls: SequenceRegistrationControls;
|
|
8
8
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
9
9
|
readonly readOnlyStudio: boolean;
|
|
10
10
|
readonly validatedLocation: CodePosition;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type InlineActionProps } from './InlineAction';
|
|
2
2
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
3
|
-
export declare const InlineDropdown: ({ values, unhoveredColor, ...props }: Omit<InlineActionProps, "onClick"> & {
|
|
4
|
-
readonly values
|
|
3
|
+
export declare const InlineDropdown: ({ values, getItems, onOpenChange, unhoveredColor, ...props }: Omit<InlineActionProps, "onClick"> & {
|
|
4
|
+
readonly values?: ComboboxValue[] | undefined;
|
|
5
|
+
readonly getItems?: (() => ComboboxValue[]) | undefined;
|
|
6
|
+
readonly onOpenChange?: ((open: boolean) => void) | undefined;
|
|
5
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,12 @@ const InlineAction_1 = require("./InlineAction");
|
|
|
16
16
|
const portals_1 = require("./Menu/portals");
|
|
17
17
|
const styles_1 = require("./Menu/styles");
|
|
18
18
|
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
19
|
-
const
|
|
19
|
+
const container = {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
height: 24,
|
|
22
|
+
};
|
|
23
|
+
const InlineDropdown = ({ values, getItems, onOpenChange, unhoveredColor, ...props }) => {
|
|
24
|
+
var _a, _b;
|
|
20
25
|
const ref = (0, react_1.useRef)(null);
|
|
21
26
|
const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
|
|
22
27
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
@@ -26,10 +31,21 @@ const InlineDropdown = ({ values, unhoveredColor, ...props }) => {
|
|
|
26
31
|
});
|
|
27
32
|
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
28
33
|
const onClick = (0, react_1.useCallback)((e) => {
|
|
34
|
+
var _a;
|
|
29
35
|
e.preventDefault();
|
|
30
36
|
e.stopPropagation();
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
const invocationValues = (_a = getItems === null || getItems === void 0 ? void 0 : getItems()) !== null && _a !== void 0 ? _a : null;
|
|
38
|
+
if ((invocationValues === null || invocationValues === void 0 ? void 0 : invocationValues.length) === 0) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setOpened({
|
|
42
|
+
type: 'open',
|
|
43
|
+
left: e.clientX,
|
|
44
|
+
top: e.clientY,
|
|
45
|
+
values: invocationValues,
|
|
46
|
+
});
|
|
47
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(true);
|
|
48
|
+
}, [getItems, onOpenChange]);
|
|
33
49
|
const spaceToBottom = (0, react_1.useMemo)(() => {
|
|
34
50
|
if (size && opened.type === 'open') {
|
|
35
51
|
return size.windowSize.height - opened.top;
|
|
@@ -78,10 +94,11 @@ const InlineDropdown = ({ values, unhoveredColor, ...props }) => {
|
|
|
78
94
|
}, [opened, size, isMobileLayout, spaceToTop, spaceToBottom]);
|
|
79
95
|
const onHide = (0, react_1.useCallback)(() => {
|
|
80
96
|
setOpened({ type: 'not-open' });
|
|
81
|
-
|
|
97
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
|
|
98
|
+
}, [onOpenChange]);
|
|
82
99
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
83
|
-
jsx_runtime_1.jsx("div", { ref: ref, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, unhoveredColor: opened.type === 'open' ? colors_1.WHITE : unhoveredColor, ...props }) }), portalStyle
|
|
84
|
-
? 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))
|
|
100
|
+
jsx_runtime_1.jsx("div", { ref: ref, style: container, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, unhoveredColor: opened.type === 'open' ? colors_1.WHITE : unhoveredColor, ...props }) }), portalStyle && opened.type === 'open'
|
|
101
|
+
? 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: (_b = (_a = opened.values) !== null && _a !== void 0 ? _a : values) !== null && _b !== void 0 ? _b : [], onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
85
102
|
: null] }));
|
|
86
103
|
};
|
|
87
104
|
exports.InlineDropdown = InlineDropdown;
|
|
@@ -15,17 +15,21 @@ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
|
15
15
|
const use_default_editor_info_1 = require("./use-default-editor-info");
|
|
16
16
|
const splitButton = {
|
|
17
17
|
alignItems: 'center',
|
|
18
|
+
borderRadius: 3,
|
|
18
19
|
display: 'inline-flex',
|
|
19
20
|
flexDirection: 'row',
|
|
20
21
|
flexShrink: 0,
|
|
22
|
+
gap: 1,
|
|
21
23
|
height: 24,
|
|
24
|
+
overflow: 'hidden',
|
|
22
25
|
};
|
|
23
26
|
const mainButtonBase = {
|
|
24
27
|
alignItems: 'center',
|
|
25
28
|
background: colors_1.TRANSPARENT,
|
|
26
29
|
border: 'none',
|
|
27
|
-
borderRadius:
|
|
30
|
+
borderRadius: '3px 0 0 3px',
|
|
28
31
|
color: colors_1.LIGHT_TEXT,
|
|
32
|
+
columnGap: 4,
|
|
29
33
|
display: 'inline-flex',
|
|
30
34
|
fontFamily: 'sans-serif',
|
|
31
35
|
fontSize: 11,
|
|
@@ -42,12 +46,13 @@ const menuLabel = {
|
|
|
42
46
|
};
|
|
43
47
|
const editorButtonIconSize = 18;
|
|
44
48
|
const editorMenuIconSize = 18;
|
|
45
|
-
const InspectorOpenInEditor = ({ location }) => {
|
|
49
|
+
const InspectorOpenInEditor = ({ label, location }) => {
|
|
46
50
|
var _a;
|
|
47
51
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
48
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
52
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
49
53
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
50
54
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
55
|
+
const [dropdownOpened, setDropdownOpened] = (0, react_1.useState)(false);
|
|
51
56
|
const editorPickerAvailable = (0, use_default_editor_info_1.canUseEditorPicker)(previewServerState.type === 'connected');
|
|
52
57
|
const editorInfo = (0, use_default_editor_info_1.useDefaultEditorInfo)(editorPickerAvailable);
|
|
53
58
|
const openWithEditor = (0, react_1.useCallback)(async (editorId) => {
|
|
@@ -68,18 +73,30 @@ const InspectorOpenInEditor = ({ location }) => {
|
|
|
68
73
|
event.stopPropagation();
|
|
69
74
|
openWithEditor(null).catch(() => undefined);
|
|
70
75
|
}, [openWithEditor]);
|
|
76
|
+
const mainHovered = hovered && !dropdownOpened;
|
|
71
77
|
const mainButtonStyle = (0, react_1.useMemo)(() => {
|
|
72
78
|
return {
|
|
73
79
|
...mainButtonBase,
|
|
74
80
|
background: (0, colors_1.getBackgroundFromHoverState)({
|
|
75
|
-
hovered,
|
|
81
|
+
hovered: mainHovered,
|
|
76
82
|
selected: false,
|
|
77
83
|
}),
|
|
78
|
-
color:
|
|
84
|
+
color: mainHovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
|
|
79
85
|
opacity: canOpenDefault ? 1 : 0.5,
|
|
80
86
|
pointerEvents: canOpenDefault ? 'auto' : 'none',
|
|
81
87
|
};
|
|
82
|
-
}, [canOpenDefault,
|
|
88
|
+
}, [canOpenDefault, mainHovered]);
|
|
89
|
+
const dropdownForegroundColor = hovered || dropdownOpened ? colors_1.WHITE : colors_1.LIGHT_TEXT;
|
|
90
|
+
const dropdownStyle = (0, react_1.useMemo)(() => {
|
|
91
|
+
return {
|
|
92
|
+
background: (0, colors_1.getBackgroundFromHoverState)({
|
|
93
|
+
hovered,
|
|
94
|
+
selected: dropdownOpened,
|
|
95
|
+
}),
|
|
96
|
+
borderRadius: '0 3px 3px 0',
|
|
97
|
+
color: dropdownForegroundColor,
|
|
98
|
+
};
|
|
99
|
+
}, [dropdownForegroundColor, dropdownOpened, hovered]);
|
|
83
100
|
const renderDropdownAction = (0, react_1.useCallback)((color) => {
|
|
84
101
|
return jsx_runtime_1.jsx(caret_1.CaretDown, { color: color, small: true });
|
|
85
102
|
}, []);
|
|
@@ -110,7 +127,13 @@ const InspectorOpenInEditor = ({ location }) => {
|
|
|
110
127
|
label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Set default editor..." }),
|
|
111
128
|
leftItem: null,
|
|
112
129
|
onClick: () => {
|
|
113
|
-
|
|
130
|
+
var _a;
|
|
131
|
+
var _b;
|
|
132
|
+
setSelectedModal({
|
|
133
|
+
type: 'settings',
|
|
134
|
+
initialTab: 'apps',
|
|
135
|
+
initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
|
|
136
|
+
});
|
|
114
137
|
},
|
|
115
138
|
quickSwitcherLabel: null,
|
|
116
139
|
subMenu: null,
|
|
@@ -128,8 +151,9 @@ const InspectorOpenInEditor = ({ location }) => {
|
|
|
128
151
|
if (!editorPickerAvailable) {
|
|
129
152
|
return null;
|
|
130
153
|
}
|
|
131
|
-
return (jsx_runtime_1.jsxs("div", { style: splitButton, children: [
|
|
132
|
-
jsx_runtime_1.
|
|
154
|
+
return (jsx_runtime_1.jsxs("div", { style: splitButton, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [
|
|
155
|
+
jsx_runtime_1.jsxs("button", { "aria-label": `Open in ${editorName}`, disabled: !canOpenDefault, onClick: onOpenDefault, style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${editorName}`, type: "button", children: [label, jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: preferredEditorId, size: editorButtonIconSize })
|
|
156
|
+
] }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { onOpenChange: setDropdownOpened, renderAction: renderDropdownAction, style: dropdownStyle, title: "Open in another editor", unhoveredColor: dropdownForegroundColor, values: menuItems, variant: "compact" })
|
|
133
157
|
] }));
|
|
134
158
|
};
|
|
135
159
|
exports.InspectorOpenInEditor = InspectorOpenInEditor;
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
8
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
9
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
9
10
|
const align_bottom_1 = require("../../icons/align-bottom");
|
|
10
11
|
const align_center_horizontal_1 = require("../../icons/align-center-horizontal");
|
|
11
12
|
const align_center_vertical_1 = require("../../icons/align-center-vertical");
|
|
@@ -48,6 +49,7 @@ const AlignmentButton = ({ onClick, title, Icon, disabled }) => {
|
|
|
48
49
|
};
|
|
49
50
|
const AlignmentControls = ({ track }) => {
|
|
50
51
|
var _a;
|
|
52
|
+
const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)(track.sequence.controls);
|
|
51
53
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
52
54
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
53
55
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
@@ -79,7 +81,7 @@ const AlignmentControls = ({ track }) => {
|
|
|
79
81
|
const dragOverrides = (_b = getDragOverrides(nodePath)) !== null && _b !== void 0 ? _b : {};
|
|
80
82
|
const activeSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
|
|
81
83
|
schema: track.sequence.controls.schema,
|
|
82
|
-
currentRuntimeValueDotNotation:
|
|
84
|
+
currentRuntimeValueDotNotation: runtimeValues,
|
|
83
85
|
dragOverrides,
|
|
84
86
|
propStatus: nodePropStatuses,
|
|
85
87
|
frame: sourceFrame,
|
|
@@ -176,6 +178,7 @@ const AlignmentControls = ({ track }) => {
|
|
|
176
178
|
currentCompositionMetadata,
|
|
177
179
|
timelinePosition,
|
|
178
180
|
propStatuses,
|
|
181
|
+
runtimeValues,
|
|
179
182
|
getDragOverrides,
|
|
180
183
|
setPropStatuses,
|
|
181
184
|
]);
|
|
@@ -192,7 +195,7 @@ const AlignmentControls = ({ track }) => {
|
|
|
192
195
|
const renderDragOverrides = (_a = getDragOverrides(renderNodePath)) !== null && _a !== void 0 ? _a : {};
|
|
193
196
|
const renderActiveSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
|
|
194
197
|
schema: track.sequence.controls.schema,
|
|
195
|
-
currentRuntimeValueDotNotation:
|
|
198
|
+
currentRuntimeValueDotNotation: runtimeValues,
|
|
196
199
|
dragOverrides: renderDragOverrides,
|
|
197
200
|
propStatus: renderNodePropStatuses,
|
|
198
201
|
frame: renderSourceFrame,
|
|
@@ -4,6 +4,7 @@ exports.CompositionInspector = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
7
|
+
const browse_elements_1 = require("../../icons/browse-elements");
|
|
7
8
|
const frame_1 = require("../../icons/frame");
|
|
8
9
|
const solid_1 = require("../../icons/solid");
|
|
9
10
|
const video_1 = require("../../icons/video");
|
|
@@ -26,13 +27,26 @@ const actionIconStyle = {
|
|
|
26
27
|
height: 18,
|
|
27
28
|
width: 18,
|
|
28
29
|
};
|
|
30
|
+
const browseElementsIconStyle = {
|
|
31
|
+
height: 22,
|
|
32
|
+
width: 22,
|
|
33
|
+
};
|
|
34
|
+
const browseElementsIconContainerStyle = {
|
|
35
|
+
height: 22,
|
|
36
|
+
marginLeft: -2,
|
|
37
|
+
marginRight: -2,
|
|
38
|
+
width: 22,
|
|
39
|
+
};
|
|
29
40
|
const CompositionActions = ({ readOnlyStudio }) => {
|
|
30
41
|
const { canInsertAsset, canInsertComposition, canInsertSolid, canShowInsertAsset, canShowInsertComposition, canShowInsertSolid, insertAsset, insertComposition, insertSolid, } = (0, use_composition_actions_1.useCompositionActions)();
|
|
42
|
+
const openElementsLibrary = (0, react_1.useCallback)(() => {
|
|
43
|
+
window.open('https://www.remotion.dev/elements', '_blank', 'noopener,noreferrer');
|
|
44
|
+
}, []);
|
|
31
45
|
if ((readOnlyStudio && !canShowInsertSolid) ||
|
|
32
46
|
(!canShowInsertAsset && !canShowInsertComposition && !canShowInsertSolid)) {
|
|
33
47
|
return null;
|
|
34
48
|
}
|
|
35
|
-
return (jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null] }));
|
|
49
|
+
return (jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, iconContainerStyle: browseElementsIconContainerStyle, onClick: openElementsLibrary, renderIcon: (color) => (jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle })), title: "Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition.", children: "Browse Elements..." })) : null] }));
|
|
36
50
|
};
|
|
37
51
|
const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
|
|
38
52
|
var _a;
|
|
@@ -40,11 +40,11 @@ const ConnectedCompositionsSection = ({ connectedCompositions }) => {
|
|
|
40
40
|
exports.ConnectedCompositionsSection = ConnectedCompositionsSection;
|
|
41
41
|
const ConnectedCompositionRow = ({ composition }) => {
|
|
42
42
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
43
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
43
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
44
44
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
45
45
|
.previewServerState.type;
|
|
46
46
|
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(composition.stack);
|
|
47
|
-
const
|
|
47
|
+
const getContextMenuItems = (0, react_1.useCallback)(() => (0, composition_menu_items_1.getCompositionContextMenuItems)({
|
|
48
48
|
closeMenu: noop_1.noop,
|
|
49
49
|
composition,
|
|
50
50
|
connectionStatus,
|
|
@@ -53,5 +53,5 @@ const ConnectedCompositionRow = ({ composition }) => {
|
|
|
53
53
|
resolvedLocation,
|
|
54
54
|
setSelectedModal,
|
|
55
55
|
}), [composition, connectionStatus, resolvedLocation, setSelectedModal]);
|
|
56
|
-
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, {
|
|
56
|
+
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, style: compositionContextMenuStyle, children: jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => selectComposition(composition, true), renderIcon: (color) => (jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: color, composition: composition, style: compositionIconStyle })), children: composition.id }) }));
|
|
57
57
|
};
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
9
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
9
10
|
const plus_1 = require("../../icons/plus");
|
|
10
11
|
const render_frame_1 = require("../../state/render-frame");
|
|
11
12
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
@@ -26,8 +27,9 @@ const addKeyframeIcon = {
|
|
|
26
27
|
width: 18,
|
|
27
28
|
};
|
|
28
29
|
const EasingInspector = ({ selection }) => {
|
|
29
|
-
var _a, _b;
|
|
30
|
+
var _a, _b, _c;
|
|
30
31
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
32
|
+
const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)((_a = track === null || track === void 0 ? void 0 : track.sequence.controls) !== null && _a !== void 0 ? _a : null);
|
|
31
33
|
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
32
34
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
33
35
|
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
@@ -44,7 +46,7 @@ const EasingInspector = ({ selection }) => {
|
|
|
44
46
|
overrideIdsToNodePaths: overrideIdToNodePathMappings,
|
|
45
47
|
propStatuses,
|
|
46
48
|
}), [overrideIdToNodePathMappings, propStatuses, selection, sequences]);
|
|
47
|
-
const initialEasing = (
|
|
49
|
+
const initialEasing = (_b = easingUpdate === null || easingUpdate === void 0 ? void 0 : easingUpdate.currentEasing) !== null && _b !== void 0 ? _b : null;
|
|
48
50
|
const easingDetails = (0, react_1.useMemo)(() => {
|
|
49
51
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
50
52
|
if (easingUpdate === null || track === null) {
|
|
@@ -61,7 +63,7 @@ const EasingInspector = ({ selection }) => {
|
|
|
61
63
|
}
|
|
62
64
|
const sequenceFields = (0, timeline_layout_1.getFieldsToShow)({
|
|
63
65
|
schema: track.sequence.controls.schema,
|
|
64
|
-
currentRuntimeValueDotNotation:
|
|
66
|
+
currentRuntimeValueDotNotation: runtimeValues,
|
|
65
67
|
getDragOverrides,
|
|
66
68
|
propStatuses,
|
|
67
69
|
nodePath: easingUpdate.nodePath,
|
|
@@ -100,9 +102,10 @@ const EasingInspector = ({ selection }) => {
|
|
|
100
102
|
getDragOverrides,
|
|
101
103
|
getEffectDragOverrides,
|
|
102
104
|
propStatuses,
|
|
105
|
+
runtimeValues,
|
|
103
106
|
track,
|
|
104
107
|
]);
|
|
105
|
-
const fieldLabel = (
|
|
108
|
+
const fieldLabel = (_c = easingDetails === null || easingDetails === void 0 ? void 0 : easingDetails.fieldLabel) !== null && _c !== void 0 ? _c : null;
|
|
106
109
|
const currentEasingSelection = (0, react_1.useMemo)(() => {
|
|
107
110
|
if (easingUpdate === null || track === null) {
|
|
108
111
|
return null;
|