@remotion/studio 4.0.504 → 4.0.505
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/AssetSelectorItem.js +2 -2
- package/dist/components/AudioWaveform.d.ts +1 -1
- package/dist/components/AudioWaveform.js +36 -3
- package/dist/components/CompositionContextButton.d.ts +1 -1
- package/dist/components/CompositionContextButton.js +2 -2
- package/dist/components/CompositionSelector.js +2 -2
- package/dist/components/CompositionSelectorItem.js +4 -4
- package/dist/components/ContextMenu.d.ts +5 -7
- package/dist/components/ContextMenu.js +54 -21
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EffectPickerModal.js +2 -2
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +14 -13
- package/dist/components/InlineDropdown.d.ts +3 -2
- package/dist/components/InlineDropdown.js +16 -5
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +2 -2
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.js +24 -34
- package/dist/components/InspectorSequenceSection.js +1 -1
- package/dist/components/Menu/MenuItem.js +16 -12
- package/dist/components/MenuBuildIndicator.js +11 -58
- package/dist/components/MenuCompositionName.js +3 -63
- package/dist/components/MenuToolbar.js +22 -2
- 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/menu-typeahead.d.ts +1 -1
- package/dist/components/PlayPause.js +2 -2
- package/dist/components/PlaybackRateSelector.js +3 -9
- package/dist/components/PreviewToolbar.js +7 -4
- package/dist/components/RenderButton.d.ts +1 -0
- package/dist/components/RenderButton.js +54 -37
- package/dist/components/SelectedOutlineElement.js +9 -10
- package/dist/components/SelectedOutlineOverlay.js +5 -1
- package/dist/components/SizeSelector.js +3 -9
- package/dist/components/Timeline/Timeline.js +4 -4
- package/dist/components/Timeline/TimelineDragHandler.js +3 -0
- package/dist/components/Timeline/TimelineEffectItem.js +6 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +6 -3
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +6 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +32 -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/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/TimelineSequence.js +34 -28
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +3 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +34 -23
- 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 +38 -5
- 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/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-height.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-height.js +3 -2
- package/dist/components/TimelineCombobox.d.ts +11 -0
- package/dist/components/TimelineCombobox.js +181 -0
- package/dist/components/TopPanel.js +6 -7
- package/dist/components/selected-outline-types.d.ts +1 -1
- package/dist/esm/{chunk-43m68z1k.js → chunk-7pgk8h5m.js} +7731 -7410
- package/dist/esm/internals.mjs +7731 -7410
- package/dist/esm/previewEntry.mjs +7547 -7226
- package/dist/esm/renderEntry.mjs +1 -1
- 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/use-is-fullscreen.d.ts +1 -0
- package/dist/helpers/use-is-fullscreen.js +25 -0
- package/dist/helpers/use-menu-structure.js +3 -10
- 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/package.json +12 -12
|
@@ -424,7 +424,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
424
424
|
relativePath,
|
|
425
425
|
});
|
|
426
426
|
}, [relativePath, setSelectedModal]);
|
|
427
|
-
const
|
|
427
|
+
const getContextMenuItems = (0, react_1.useCallback)(() => {
|
|
428
428
|
return (0, exports.getAssetContextMenuItems)({
|
|
429
429
|
relativePath,
|
|
430
430
|
fileManagerName,
|
|
@@ -455,7 +455,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
|
|
|
455
455
|
e.stopPropagation();
|
|
456
456
|
copyStaticFilePath();
|
|
457
457
|
}, [copyStaticFilePath]);
|
|
458
|
-
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, {
|
|
458
|
+
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("div", { ref: rowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, draggable: canDragAsset, onDragStart: onDragStart, onDragEnd: onDragEnd, tabIndex: tabIndex, title: item.name, children: [
|
|
459
459
|
jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { fileType: previewFileType, style: iconStyle, color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.name }), hovered && !isDragging ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
460
460
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, title: "Copy staticFile() path", renderAction: renderCopyAction, onClick: copyToClipboard }), fileExplorerDisabled ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
461
461
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, title: `Show in ${fileManagerName}`, renderAction: renderFileExplorerAction, onClick: revealInExplorer })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LoopDisplay } from 'remotion';
|
|
3
|
-
export declare const AudioWaveform: React.
|
|
3
|
+
export declare const AudioWaveform: React.NamedExoticComponent<{
|
|
4
4
|
readonly src: string;
|
|
5
5
|
readonly height: number;
|
|
6
6
|
readonly visualizationWidth: number;
|
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.AudioWaveform = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
38
|
const timeline_utils_1 = require("@remotion/timeline-utils");
|
|
6
|
-
const react_1 = require("react");
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
7
40
|
const remotion_1 = require("remotion");
|
|
8
41
|
const colors_1 = require("../helpers/colors");
|
|
9
42
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
@@ -76,7 +109,7 @@ const drawLoopedWaveform = ({ canvas, peaks, volume, visualizationWidth, loopWid
|
|
|
76
109
|
ctx.fillStyle = pattern;
|
|
77
110
|
ctx.fillRect(0, 0, w, h);
|
|
78
111
|
};
|
|
79
|
-
const
|
|
112
|
+
const AudioWaveformInner = ({ src, height, startFrom, durationInFrames, visualizationWidth, volume, doesVolumeChange, playbackRate, loopDisplay, }) => {
|
|
80
113
|
const [peaks, setPeaks] = (0, react_1.useState)(null);
|
|
81
114
|
const [error, setError] = (0, react_1.useState)(null);
|
|
82
115
|
const [waveformCanvasKey, setWaveformCanvasKey] = (0, react_1.useState)(0);
|
|
@@ -300,4 +333,4 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
300
333
|
return (jsx_runtime_1.jsxs("div", { style: getContainerStyle(height), children: [
|
|
301
334
|
jsx_runtime_1.jsx("canvas", { ref: waveformCanvas, style: waveformCanvasStyle }, waveformCanvasKey), shouldRenderVolumeOverlay ? (jsx_runtime_1.jsx("canvas", { ref: volumeCanvas, style: volumeCanvasStyle })) : null] }));
|
|
302
335
|
};
|
|
303
|
-
exports.AudioWaveform =
|
|
336
|
+
exports.AudioWaveform = react_1.default.memo(AudioWaveformInner);
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const client_id_1 = require("../helpers/client-id");
|
|
7
7
|
const ellipsis_1 = require("../icons/ellipsis");
|
|
8
8
|
const InlineDropdown_1 = require("./InlineDropdown");
|
|
9
|
-
const CompositionContextButton = ({ visible,
|
|
9
|
+
const CompositionContextButton = ({ visible, getItems }) => {
|
|
10
10
|
const iconStyle = (0, react_1.useMemo)(() => {
|
|
11
11
|
return {
|
|
12
12
|
style: {
|
|
@@ -22,6 +22,6 @@ const CompositionContextButton = ({ visible, values }) => {
|
|
|
22
22
|
if (!visible || connectionStatus !== 'connected') {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
return (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderAction,
|
|
25
|
+
return (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderAction, getItems: getItems, variant: null }));
|
|
26
26
|
};
|
|
27
27
|
exports.CompositionContextButton = CompositionContextButton;
|
|
@@ -90,7 +90,7 @@ const CompositionSelector = () => {
|
|
|
90
90
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
91
91
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
92
92
|
.previewServerState.type;
|
|
93
|
-
const
|
|
93
|
+
const getRootContextMenuItems = (0, react_1.useCallback)(() => {
|
|
94
94
|
return (0, root_composition_menu_items_1.getRootCompositionMenuItems)({
|
|
95
95
|
connectionStatus,
|
|
96
96
|
readOnlyStudio: window.remotion_isReadOnlyStudio,
|
|
@@ -234,7 +234,7 @@ const CompositionSelector = () => {
|
|
|
234
234
|
}
|
|
235
235
|
}, [compositions, stopCompositionListAutoScroll]);
|
|
236
236
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
237
|
-
jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef,
|
|
237
|
+
jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef, getItems: getRootContextMenuItems }), jsx_runtime_1.jsx(ExplorerQuickSwitcherTrigger_1.ExplorerQuickSwitcherTrigger, { mode: "compositions", showShortcut: true, tabIndex: tabIndex }), jsx_runtime_1.jsx("div", { ref: listRef, className: "__remotion-vertical-scrollbar", style: list, onDragOverCapture: onCompositionListDragOverCapture, onDragEndCapture: stopCompositionListAutoScroll, onDragOver: onRootDragOver, onDragLeave: onRootDragLeave, onDropCapture: stopCompositionListAutoScroll, onDrop: onRootDrop, children: items.map((c) => {
|
|
238
238
|
return (jsx_runtime_1.jsx(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: canvasContent && canvasContent.type === 'composition'
|
|
239
239
|
? canvasContent.compositionId
|
|
240
240
|
: null, selectComposition: selectComposition, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover, tabIndex: tabIndex, item: c }, c.key + c.type));
|
|
@@ -120,7 +120,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
120
120
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
121
121
|
.previewServerState.type;
|
|
122
122
|
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(item.type === 'composition' ? item.composition.stack : item.folder.stack);
|
|
123
|
-
const
|
|
123
|
+
const getContextMenuItems = (0, react_1.useCallback)(() => {
|
|
124
124
|
if (item.type === 'composition') {
|
|
125
125
|
return (0, composition_menu_items_1.getCompositionContextMenuItems)({
|
|
126
126
|
closeMenu: noop_1.noop,
|
|
@@ -241,13 +241,13 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
241
241
|
}, [clearRootDragHover, item, toggleFolder]);
|
|
242
242
|
if (item.type === 'folder') {
|
|
243
243
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
244
|
-
jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, {
|
|
244
|
+
jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("div", { style: style, className: "__remotion-composition-selector-item", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, onKeyDown: onKeyDown, onDragOver: onFolderDragOver, onDragLeave: onFolderDragLeave, onDrop: onFolderDrop, title: item.folderName, role: "button", children: [item.expanded ? (jsx_runtime_1.jsx(folder_1.ExpandedFolderIcon, { style: iconStyle, color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT })) : (jsx_runtime_1.jsx(folder_1.CollapsedFolderIcon, { color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle })), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.folderName }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(CompositionContextButton_1.CompositionContextButton, { getItems: getContextMenuItems, visible: hovered })
|
|
245
245
|
] }) }) }), item.expanded ? (jsx_runtime_1.jsx("div", { onDragOver: onFolderChildListDragOver, onDrop: onFolderDrop, children: item.items.map((childItem) => {
|
|
246
246
|
return (jsx_runtime_1.jsx(exports.CompositionSelectorItem, { currentComposition: currentComposition, selectComposition: selectComposition, item: childItem, tabIndex: tabIndex, level: level + 1, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover }, childItem.key + childItem.type));
|
|
247
247
|
}) })) : null] }));
|
|
248
248
|
}
|
|
249
|
-
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, {
|
|
250
|
-
jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { composition: item.composition, color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.composition.id }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(CompositionContextButton_1.CompositionContextButton, {
|
|
249
|
+
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("a", { ref: compositionRowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, onKeyDown: onKeyDown, draggable: !window.remotion_isReadOnlyStudio, onDragStart: onCompositionDragStart, onDragEnd: onCompositionDragEnd, type: "button", title: item.composition.id, className: "__remotion-composition __remotion-composition-selector-item", "data-compname": item.composition.id, children: [
|
|
250
|
+
jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { composition: item.composition, color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.composition.id }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(CompositionContextButton_1.CompositionContextButton, { getItems: getContextMenuItems, visible: hovered && !isDragging }), jsx_runtime_1.jsx(SidebarRenderButton_1.SidebarRenderButton, { visible: hovered && !isDragging, composition: item.composition })
|
|
251
251
|
] }) }) }));
|
|
252
252
|
};
|
|
253
253
|
exports.CompositionSelectorItem = CompositionSelectorItem;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
|
|
3
|
+
type ContextMenuItemsResult = false | readonly ComboboxValue[];
|
|
4
|
+
export type ContextMenuItemsFactory = (event: MouseEvent) => ContextMenuItemsResult | Promise<ContextMenuItemsResult>;
|
|
5
|
+
export declare const resolveContextMenuItems: (getItems: ContextMenuItemsFactory, event: MouseEvent) => Promise<readonly ComboboxValue[] | null>;
|
|
6
6
|
type ContextMenuProps = {
|
|
7
7
|
readonly children: React.ReactNode;
|
|
8
|
-
readonly
|
|
9
|
-
readonly onOpen: ContextMenuOpenHandler | null;
|
|
8
|
+
readonly getItems: ContextMenuItemsFactory;
|
|
10
9
|
readonly style?: React.CSSProperties;
|
|
11
10
|
readonly className?: string;
|
|
12
11
|
readonly onPointerDown?: React.PointerEventHandler<HTMLDivElement>;
|
|
@@ -14,7 +13,6 @@ type ContextMenuProps = {
|
|
|
14
13
|
export declare const ContextMenu: React.ForwardRefExoticComponent<ContextMenuProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
14
|
export declare const ContextMenuForTarget: React.FC<{
|
|
16
15
|
readonly triggerRef: React.RefObject<HTMLElement | SVGElement | null>;
|
|
17
|
-
readonly
|
|
18
|
-
readonly onOpen: ContextMenuTargetOpenHandler | null;
|
|
16
|
+
readonly getItems: ContextMenuItemsFactory;
|
|
19
17
|
}>;
|
|
20
18
|
export {};
|
|
@@ -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;
|
|
@@ -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,7 +150,7 @@ 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
|
};
|
|
@@ -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,5 +1,6 @@
|
|
|
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, unhoveredColor, ...props }: Omit<InlineActionProps, "onClick"> & {
|
|
4
|
+
readonly values?: ComboboxValue[] | undefined;
|
|
5
|
+
readonly getItems?: (() => ComboboxValue[]) | undefined;
|
|
5
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,8 @@ 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 InlineDropdown = ({ values, unhoveredColor, ...props }) => {
|
|
19
|
+
const InlineDropdown = ({ values, getItems, unhoveredColor, ...props }) => {
|
|
20
|
+
var _a, _b;
|
|
20
21
|
const ref = (0, react_1.useRef)(null);
|
|
21
22
|
const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
|
|
22
23
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
@@ -26,10 +27,20 @@ const InlineDropdown = ({ values, unhoveredColor, ...props }) => {
|
|
|
26
27
|
});
|
|
27
28
|
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
28
29
|
const onClick = (0, react_1.useCallback)((e) => {
|
|
30
|
+
var _a;
|
|
29
31
|
e.preventDefault();
|
|
30
32
|
e.stopPropagation();
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
const invocationValues = (_a = getItems === null || getItems === void 0 ? void 0 : getItems()) !== null && _a !== void 0 ? _a : null;
|
|
34
|
+
if ((invocationValues === null || invocationValues === void 0 ? void 0 : invocationValues.length) === 0) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setOpened({
|
|
38
|
+
type: 'open',
|
|
39
|
+
left: e.clientX,
|
|
40
|
+
top: e.clientY,
|
|
41
|
+
values: invocationValues,
|
|
42
|
+
});
|
|
43
|
+
}, [getItems]);
|
|
33
44
|
const spaceToBottom = (0, react_1.useMemo)(() => {
|
|
34
45
|
if (size && opened.type === 'open') {
|
|
35
46
|
return size.windowSize.height - opened.top;
|
|
@@ -80,8 +91,8 @@ const InlineDropdown = ({ values, unhoveredColor, ...props }) => {
|
|
|
80
91
|
setOpened({ type: 'not-open' });
|
|
81
92
|
}, []);
|
|
82
93
|
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))
|
|
94
|
+
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 && opened.type === 'open'
|
|
95
|
+
? 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
96
|
: null] }));
|
|
86
97
|
};
|
|
87
98
|
exports.InlineDropdown = InlineDropdown;
|
|
@@ -44,7 +44,7 @@ const ConnectedCompositionRow = ({ composition }) => {
|
|
|
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
|
};
|
|
@@ -72,7 +72,7 @@ const SequenceSourceActions = ({ selection, track, validatedSource }) => {
|
|
|
72
72
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
73
73
|
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
74
74
|
const propStatusesForOverride = (0, react_1.useMemo)(() => remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey), [propStatuses, selection.nodePathInfo.sequenceSubscriptionKey]);
|
|
75
|
-
const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.
|
|
75
|
+
const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.getSequenceFreezeFrameMenuItem)({
|
|
76
76
|
clientId: previewServerState.type === 'connected' && (0, interactivity_enabled_1.isStudioInteractivityEnabled)()
|
|
77
77
|
? previewServerState.clientId
|
|
78
78
|
: null,
|