@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
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
9
9
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
10
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
10
11
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
11
12
|
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
12
13
|
const call_delete_keyframe_1 = require("../Timeline/call-delete-keyframe");
|
|
@@ -53,7 +54,9 @@ const TrashIcon = ({ color }) => {
|
|
|
53
54
|
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 448 512", style: removeKeyframeIcon, children: jsx_runtime_1.jsx("path", { fill: color, d: "M160.5 27.4c2-6.8 8.3-11.4 15.3-11.4l96.4 0c7.1 0 13.3 4.6 15.3 11.4l11 36.6-149 0 11-36.6zM116.1 64L16 64C7.2 64 0 71.2 0 80S7.2 96 16 96l416 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-100.1 0-13.7-45.8C312.1-2.1 293.4-16 272.2-16l-96.4 0c-21.2 0-39.9 13.9-46 34.2L116.1 64zM28.7 144L51.6 452.7c2.5 33.4 30.3 59.3 63.8 59.3l217.1 0c33.5 0 61.3-25.9 63.8-59.3l22.9-308.7-32.1 0-22.7 306.4c-1.2 16.7-15.2 29.6-31.9 29.6l-217.1 0c-16.8 0-30.7-12.9-31.9-29.6L60.8 144 28.7 144z" }) }));
|
|
54
55
|
};
|
|
55
56
|
const KeyframeInspector = ({ selection }) => {
|
|
57
|
+
var _a;
|
|
56
58
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
59
|
+
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);
|
|
57
60
|
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
58
61
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
59
62
|
const { clearDragOverrides, clearEffectDragOverrides, setDragOverrides, setEffectDragOverrides, setPropStatuses, } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -81,7 +84,7 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
81
84
|
if (keyframeField.type === 'sequence') {
|
|
82
85
|
const sequenceFields = (0, timeline_layout_1.getFieldsToShow)({
|
|
83
86
|
schema: track.sequence.controls.schema,
|
|
84
|
-
currentRuntimeValueDotNotation:
|
|
87
|
+
currentRuntimeValueDotNotation: runtimeValues,
|
|
85
88
|
getDragOverrides,
|
|
86
89
|
propStatuses,
|
|
87
90
|
nodePath,
|
|
@@ -148,6 +151,7 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
148
151
|
getDragOverrides,
|
|
149
152
|
getEffectDragOverrides,
|
|
150
153
|
propStatuses,
|
|
154
|
+
runtimeValues,
|
|
151
155
|
selection,
|
|
152
156
|
track,
|
|
153
157
|
]);
|
|
@@ -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,
|
|
@@ -33,6 +33,7 @@ export type InspectorInlineActionSegment = {
|
|
|
33
33
|
export type InspectorInlineActionProps = {
|
|
34
34
|
readonly children: React.ReactNode;
|
|
35
35
|
readonly disabled: boolean;
|
|
36
|
+
readonly iconContainerStyle?: React.CSSProperties;
|
|
36
37
|
readonly onClick: React.MouseEventHandler<HTMLButtonElement> | null;
|
|
37
38
|
readonly renderIcon?: (color: string) => React.ReactNode;
|
|
38
39
|
readonly size?: 'default' | 'compact';
|
|
@@ -7,6 +7,7 @@ exports.InspectorDefaultPropsWarnings = exports.InspectorInlineAction = exports.
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const colors_1 = require("../../helpers/colors");
|
|
10
|
+
const hoverable_1 = require("../../helpers/hoverable");
|
|
10
11
|
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
11
12
|
const layout_1 = require("../layout");
|
|
12
13
|
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
@@ -49,11 +50,9 @@ const INLINE_LABEL_BUTTON_MARGIN = 4;
|
|
|
49
50
|
const inlineLabelButton = {
|
|
50
51
|
alignItems: 'center',
|
|
51
52
|
appearance: 'none',
|
|
52
|
-
backgroundColor: colors_1.TRANSPARENT,
|
|
53
53
|
border: 'none',
|
|
54
54
|
borderRadius: 4,
|
|
55
55
|
boxSizing: 'border-box',
|
|
56
|
-
color: colors_1.LIGHT_TEXT,
|
|
57
56
|
cursor: 'default',
|
|
58
57
|
display: 'flex',
|
|
59
58
|
fontFamily: 'sans-serif',
|
|
@@ -74,7 +73,6 @@ const compactInlineLabelButton = {
|
|
|
74
73
|
height: layout_1.COMPACT_INLINE_ROW_HEIGHT,
|
|
75
74
|
};
|
|
76
75
|
const inlineLabelText = {
|
|
77
|
-
color: colors_1.LIGHT_TEXT,
|
|
78
76
|
flex: 1,
|
|
79
77
|
fontFamily: 'sans-serif',
|
|
80
78
|
fontSize: 13,
|
|
@@ -117,54 +115,46 @@ const segmentedTrailingAction = {
|
|
|
117
115
|
padding: 0,
|
|
118
116
|
width: 28,
|
|
119
117
|
};
|
|
120
|
-
const
|
|
121
|
-
...inlineLabelIcon,
|
|
122
|
-
opacity: 0,
|
|
123
|
-
};
|
|
124
|
-
const InspectorInlineAction = ({ children, disabled, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
|
|
125
|
-
const [hovered, setHovered] = react_1.default.useState(false);
|
|
126
|
-
const color = hovered && !disabled ? colors_1.WHITE : colors_1.LIGHT_TEXT;
|
|
118
|
+
const InspectorInlineAction = ({ children, disabled, iconContainerStyle, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
|
|
127
119
|
const isSegmented = variant.type === 'segmented';
|
|
120
|
+
// A non-clickable single action (onClick === null) never shows a hover
|
|
121
|
+
// effect. In the segmented variant, the main segment highlights whenever
|
|
122
|
+
// the group is hovered, even if it is not clickable itself.
|
|
123
|
+
const showsHover = !disabled && (onClick !== null || isSegmented);
|
|
128
124
|
const buttonStyle = react_1.default.useMemo(() => ({
|
|
129
125
|
...(disabled ? inlineLabelButtonDisabled : inlineLabelButton),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
127
|
+
idleBackground: colors_1.TRANSPARENT,
|
|
128
|
+
hoverBackground: showsHover
|
|
129
|
+
? (0, colors_1.getBackgroundFromHoverState)({ hovered: true, selected: false })
|
|
130
|
+
: colors_1.TRANSPARENT,
|
|
131
|
+
idleColor: colors_1.LIGHT_TEXT,
|
|
132
|
+
hoverColor: showsHover ? colors_1.WHITE : colors_1.LIGHT_TEXT,
|
|
133
133
|
}),
|
|
134
|
-
color,
|
|
135
134
|
...(size === 'compact' ? compactInlineLabelButton : null),
|
|
136
135
|
...(isSegmented ? segmentedMainAction : null),
|
|
137
136
|
...style,
|
|
138
|
-
}), [
|
|
139
|
-
const
|
|
140
|
-
...inlineLabelText,
|
|
141
|
-
color,
|
|
142
|
-
}), [color]);
|
|
143
|
-
const onPointerEnter = react_1.default.useCallback(() => {
|
|
144
|
-
setHovered(true);
|
|
145
|
-
}, []);
|
|
146
|
-
const onPointerLeave = react_1.default.useCallback(() => {
|
|
147
|
-
setHovered(false);
|
|
148
|
-
}, []);
|
|
149
|
-
const mainContent = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderIcon ? (jsx_runtime_1.jsx("span", { style: inlineLabelIcon, children: renderIcon(color) })) : null, jsx_runtime_1.jsx("span", { style: textStyle, children: children })
|
|
137
|
+
}), [disabled, showsHover, isSegmented, size, style]);
|
|
138
|
+
const mainContent = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderIcon ? (jsx_runtime_1.jsx("span", { style: { ...inlineLabelIcon, ...iconContainerStyle }, children: renderIcon(colors_1.CURRENT_COLOR) })) : null, jsx_runtime_1.jsx("span", { style: inlineLabelText, children: children })
|
|
150
139
|
] }));
|
|
151
|
-
const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className:
|
|
140
|
+
const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className: `__remotion-inspector-inline-action ${hoverable_1.HOVERABLE_CLASS_NAME}`, type: "button", disabled: disabled, style: buttonStyle, title: title, onClick: onClick, children: mainContent })) : (jsx_runtime_1.jsx("div", { className: hoverable_1.HOVERABLE_CLASS_NAME, style: buttonStyle, title: title, children: mainContent }));
|
|
152
141
|
if (variant.type === 'segmented') {
|
|
153
|
-
const trailingColor = hovered && !variant.trailing.disabled ? colors_1.WHITE : colors_1.LIGHT_TEXT;
|
|
154
142
|
const trailingStyle = {
|
|
155
143
|
...segmentedTrailingAction,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
:
|
|
159
|
-
|
|
160
|
-
selected: false,
|
|
161
|
-
|
|
144
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
145
|
+
idleBackground: colors_1.TRANSPARENT,
|
|
146
|
+
hoverBackground: variant.trailing.disabled
|
|
147
|
+
? colors_1.TRANSPARENT
|
|
148
|
+
: (0, colors_1.getBackgroundFromHoverState)({ hovered: true, selected: false }),
|
|
149
|
+
idleColor: colors_1.LIGHT_TEXT,
|
|
150
|
+
hoverColor: variant.trailing.disabled ? colors_1.LIGHT_TEXT : colors_1.WHITE,
|
|
151
|
+
}),
|
|
162
152
|
height: size === 'compact'
|
|
163
153
|
? layout_1.COMPACT_INLINE_ROW_HEIGHT
|
|
164
154
|
: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
|
|
165
155
|
opacity: variant.trailing.disabled ? 0.35 : 1,
|
|
166
156
|
};
|
|
167
|
-
return (jsx_runtime_1.jsxs("div", {
|
|
157
|
+
return (jsx_runtime_1.jsxs("div", { className: hoverable_1.HOVER_GROUP_CLASS_NAME, style: segmentedInlineAction, children: [mainAction, jsx_runtime_1.jsx("button", { type: "button", className: hoverable_1.HOVERABLE_CLASS_NAME, disabled: variant.trailing.disabled, style: trailingStyle, title: variant.trailing.title, onClick: variant.trailing.onClick, children: jsx_runtime_1.jsx("span", { className: hoverable_1.HOVER_GROUP_REVEAL_CLASS_NAME, style: inlineLabelIcon, children: variant.trailing.renderIcon(colors_1.CURRENT_COLOR) }) })
|
|
168
158
|
] }));
|
|
169
159
|
}
|
|
170
160
|
return mainAction;
|
|
@@ -21,7 +21,7 @@ const useCompositionActions = () => {
|
|
|
21
21
|
const [isAddingSolid, setIsAddingSolid] = (0, react_1.useState)(false);
|
|
22
22
|
const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
|
|
23
23
|
const [isAddingComposition, setIsAddingComposition] = (0, react_1.useState)(false);
|
|
24
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
24
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
25
25
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
26
26
|
const previewConnected = previewServerState.type === 'connected';
|
|
27
27
|
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
@@ -121,6 +121,7 @@ const useCompositionActions = () => {
|
|
|
121
121
|
destinationDimensions: null,
|
|
122
122
|
dropPosition: null,
|
|
123
123
|
from: null,
|
|
124
|
+
preferCompositionStart: null,
|
|
124
125
|
svgImportMode: 'image',
|
|
125
126
|
});
|
|
126
127
|
}
|
|
@@ -145,6 +146,7 @@ const useCompositionActions = () => {
|
|
|
145
146
|
destinationDimensions: null,
|
|
146
147
|
dropPosition: null,
|
|
147
148
|
from: null,
|
|
149
|
+
preferCompositionStart: null,
|
|
148
150
|
});
|
|
149
151
|
}
|
|
150
152
|
finally {
|
|
@@ -198,6 +200,7 @@ const useCompositionActions = () => {
|
|
|
198
200
|
compositionId: currentCompositionId,
|
|
199
201
|
dropPosition: null,
|
|
200
202
|
from: null,
|
|
203
|
+
preferCompositionStart: null,
|
|
201
204
|
});
|
|
202
205
|
}
|
|
203
206
|
catch (error) {
|
|
@@ -230,7 +230,7 @@ const hasSequenceControls = (sequence) => {
|
|
|
230
230
|
exports.hasSequenceControls = hasSequenceControls;
|
|
231
231
|
const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderTransformControls, }) => {
|
|
232
232
|
var _a;
|
|
233
|
-
const { tree, propStatuses } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
233
|
+
const { tree, propStatuses, runtimeValues } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
234
234
|
sequence,
|
|
235
235
|
nodePathInfo,
|
|
236
236
|
includeTextContent: true,
|
|
@@ -242,9 +242,9 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
242
242
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
243
243
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
244
244
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
245
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
245
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
246
246
|
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
247
|
-
const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls);
|
|
247
|
+
const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls, runtimeValues);
|
|
248
248
|
const assetSelectionInitialQuery = (0, asset_search_1.getAssetSearchQueryForComponent)(sequence.controls.componentIdentity);
|
|
249
249
|
const getSourceAction = (0, react_1.useCallback)((src) => {
|
|
250
250
|
var _a;
|
|
@@ -266,7 +266,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
266
266
|
jsx_runtime_1.jsx("span", { style: remoteSourceLeading, children: parts.leading }), jsx_runtime_1.jsx("span", { style: remoteSourceTrailing, children: parts.trailing })
|
|
267
267
|
] })),
|
|
268
268
|
disabled: false,
|
|
269
|
-
onClick:
|
|
269
|
+
onClick: () => (0, timeline_asset_link_1.openTimelineAssetLink)(linkInfo, selectAsset),
|
|
270
270
|
title: linkInfo.href,
|
|
271
271
|
};
|
|
272
272
|
}
|
|
@@ -412,7 +412,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
412
412
|
});
|
|
413
413
|
const borderRadiusConversion = (0, border_radius_representation_1.getBorderRadiusConversion)(sequencePropStatuses, getDragOverrides(nodePathInfo.sequenceSubscriptionKey));
|
|
414
414
|
const inlineCaptionValue = ((_a = schema.captions) === null || _a === void 0 ? void 0 : _a.type) === 'remotion-captions'
|
|
415
|
-
?
|
|
415
|
+
? runtimeValues.captions
|
|
416
416
|
: null;
|
|
417
417
|
const inlineCaptions = Array.isArray(inlineCaptionValue)
|
|
418
418
|
? inlineCaptionValue
|
|
@@ -73,7 +73,7 @@ const InstallPackageModal = ({ packageManager }) => {
|
|
|
73
73
|
}
|
|
74
74
|
setState({ type: 'installing' });
|
|
75
75
|
try {
|
|
76
|
-
await (0, install_package_1.installPackages)(selectedPackages);
|
|
76
|
+
await (0, install_package_1.installPackages)(selectedPackages.map((name) => ({ name, version: null })));
|
|
77
77
|
setState({ type: 'done' });
|
|
78
78
|
}
|
|
79
79
|
catch (err) {
|
|
@@ -9,6 +9,7 @@ const player_1 = require("@remotion/player");
|
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
11
|
const colors_1 = require("../../helpers/colors");
|
|
12
|
+
const hoverable_1 = require("../../helpers/hoverable");
|
|
12
13
|
const pointer_session_1 = require("../../helpers/pointer-session");
|
|
13
14
|
const z_index_1 = require("../../state/z-index");
|
|
14
15
|
const MenuContent_1 = require("../NewComposition/MenuContent");
|
|
@@ -17,7 +18,6 @@ const portals_1 = require("./portals");
|
|
|
17
18
|
const styles_1 = require("./styles");
|
|
18
19
|
const container = {
|
|
19
20
|
fontSize: 13,
|
|
20
|
-
color: colors_1.WHITE_ALPHA_80,
|
|
21
21
|
paddingLeft: 10,
|
|
22
22
|
paddingRight: 10,
|
|
23
23
|
cursor: 'default',
|
|
@@ -28,7 +28,6 @@ const container = {
|
|
|
28
28
|
border: 'none',
|
|
29
29
|
};
|
|
30
30
|
const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered, onItemQuit, onPreviousMenu, onNextMenu, menu, }) => {
|
|
31
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
32
31
|
const ref = (0, react_1.useRef)(null);
|
|
33
32
|
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
34
33
|
triggerOnWindowResize: true,
|
|
@@ -38,13 +37,20 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
|
|
|
38
37
|
const containerStyle = (0, react_1.useMemo)(() => {
|
|
39
38
|
return {
|
|
40
39
|
...container,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
41
|
+
idleBackground: (0, colors_1.getBackgroundFromHoverState)({
|
|
42
|
+
hovered: false,
|
|
43
|
+
selected,
|
|
44
|
+
}),
|
|
45
|
+
hoverBackground: (0, colors_1.getBackgroundFromHoverState)({
|
|
46
|
+
hovered: true,
|
|
47
|
+
selected,
|
|
48
|
+
}),
|
|
49
|
+
idleColor: selected ? colors_1.WHITE : colors_1.WHITE_ALPHA_80,
|
|
50
|
+
hoverColor: colors_1.WHITE,
|
|
45
51
|
}),
|
|
46
52
|
};
|
|
47
|
-
}, [
|
|
53
|
+
}, [selected]);
|
|
48
54
|
const portalStyle = (0, react_1.useMemo)(() => {
|
|
49
55
|
if (!selected || !size) {
|
|
50
56
|
return null;
|
|
@@ -55,13 +61,11 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
|
|
|
55
61
|
top: size.top + size.height,
|
|
56
62
|
};
|
|
57
63
|
}, [selected, size]);
|
|
64
|
+
// Not for styling (which is done via CSS :hover), but for switching
|
|
65
|
+
// between menus when a menu is already open.
|
|
58
66
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
59
67
|
onItemHovered(id);
|
|
60
|
-
setHovered(true);
|
|
61
68
|
}, [id, onItemHovered]);
|
|
62
|
-
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
63
|
-
setHovered(false);
|
|
64
|
-
}, []);
|
|
65
69
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
66
70
|
// Prevent deselection of currently selected items
|
|
67
71
|
e.stopPropagation();
|
|
@@ -105,7 +109,7 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
|
|
|
105
109
|
};
|
|
106
110
|
}, [size]);
|
|
107
111
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
108
|
-
jsx_runtime_1.jsx("button", { ref: ref, role: "button", tabIndex: tabIndex, onPointerEnter: onPointerEnter,
|
|
112
|
+
jsx_runtime_1.jsx("button", { ref: ref, role: "button", tabIndex: tabIndex, onPointerEnter: onPointerEnter, onPointerDown: onPointerDown, onClick: onClick, style: containerStyle, type: "button", className: `${is_menu_item_1.MENU_INITIATOR_CLASSNAME} ${hoverable_1.HOVERABLE_CLASS_NAME}`, children: itemName }), portalStyle
|
|
109
113
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { className: "css-reset", style: outerStyle, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onItemQuit, onOutsideClick: onItemQuit, children: jsx_runtime_1.jsx("div", { style: portalStyle, onPointerDown: onMenuPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: onPreviousMenu, onPreviousMenu: onNextMenu, values: menu.items, onHide: onItemQuit, leaveLeftSpace: menu.leaveLeftPadding, preselectIndex: false, topItemCanBeUnselected: true, fixedHeight: null }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
110
114
|
: null] }));
|
|
111
115
|
};
|
|
@@ -3,13 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MenuBuildIndicator = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const client_id_1 = require("../helpers/client-id");
|
|
7
6
|
const colors_1 = require("../helpers/colors");
|
|
8
|
-
const
|
|
9
|
-
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
7
|
+
const InspectorOpenInEditor_1 = require("./InspectorOpenInEditor");
|
|
10
8
|
const layout_1 = require("./layout");
|
|
11
9
|
const MenuCompositionName_1 = require("./MenuCompositionName");
|
|
12
|
-
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
13
10
|
const Spinner_1 = require("./Spinner");
|
|
14
11
|
const cwd = {
|
|
15
12
|
fontSize: 13,
|
|
@@ -18,6 +15,7 @@ const cwd = {
|
|
|
18
15
|
alignItems: 'center',
|
|
19
16
|
justifyContent: 'center',
|
|
20
17
|
userSelect: 'none',
|
|
18
|
+
whiteSpace: 'nowrap',
|
|
21
19
|
};
|
|
22
20
|
const spinnerSize = 14;
|
|
23
21
|
const spinner = {
|
|
@@ -28,60 +26,15 @@ const noSpinner = {
|
|
|
28
26
|
position: 'relative',
|
|
29
27
|
width: spinnerSize,
|
|
30
28
|
};
|
|
31
|
-
const projectNameLinkBase = {
|
|
32
|
-
color: 'inherit',
|
|
33
|
-
textDecoration: 'none',
|
|
34
|
-
cursor: 'pointer',
|
|
35
|
-
fontSize: 'inherit',
|
|
36
|
-
textUnderlineOffset: 2,
|
|
37
|
-
};
|
|
38
|
-
const projectNameLink = {
|
|
39
|
-
...projectNameLinkBase,
|
|
40
|
-
};
|
|
41
|
-
const projectNameLinkHovered = {
|
|
42
|
-
...projectNameLinkBase,
|
|
43
|
-
textDecoration: 'underline',
|
|
44
|
-
};
|
|
45
29
|
const MenuBuildIndicator = ({ mobileLayout }) => {
|
|
46
30
|
const [isBuilding, setIsBuilding] = (0, react_1.useState)(false);
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
originalFileName: `${window.remotion_cwd}`,
|
|
55
|
-
originalLineNumber: 1,
|
|
56
|
-
originalColumnNumber: 1,
|
|
57
|
-
originalFunctionName: null,
|
|
58
|
-
originalScriptCode: null,
|
|
59
|
-
}, null)
|
|
60
|
-
.then(({ success }) => {
|
|
61
|
-
if (!success) {
|
|
62
|
-
(0, NotificationCenter_1.showNotification)(`Could not open ${window.remotion_editorName}`, 2000);
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
.catch((err) => {
|
|
66
|
-
// eslint-disable-next-line no-console
|
|
67
|
-
console.error(err);
|
|
68
|
-
(0, NotificationCenter_1.showNotification)(`Could not open ${window.remotion_editorName}`, 2000);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
else if (showGitLink) {
|
|
72
|
-
window.open((0, get_git_menu_item_1.getGitSourceBranchUrl)(window.remotion_gitSource), '_blank');
|
|
73
|
-
}
|
|
74
|
-
}, [showEditorLink, showGitLink]);
|
|
75
|
-
const projectNameTitle = (0, react_1.useMemo)(() => {
|
|
76
|
-
if (showEditorLink) {
|
|
77
|
-
return `Open in ${window.remotion_editorName}`;
|
|
78
|
-
}
|
|
79
|
-
if (showGitLink) {
|
|
80
|
-
return `Open ${(0, get_git_menu_item_1.getGitSourceName)(window.remotion_gitSource)} Repo`;
|
|
81
|
-
}
|
|
82
|
-
return undefined;
|
|
83
|
-
}, [showEditorLink, showGitLink]);
|
|
84
|
-
const isClickable = showEditorLink || showGitLink;
|
|
31
|
+
const folderLocation = (0, react_1.useMemo)(() => {
|
|
32
|
+
return {
|
|
33
|
+
source: window.remotion_cwd,
|
|
34
|
+
line: 1,
|
|
35
|
+
column: 1,
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
85
38
|
(0, react_1.useEffect)(() => {
|
|
86
39
|
window.remotion_isBuilding = () => {
|
|
87
40
|
setIsBuilding(true);
|
|
@@ -94,8 +47,9 @@ const MenuBuildIndicator = ({ mobileLayout }) => {
|
|
|
94
47
|
window.remotion_finishedBuilding = undefined;
|
|
95
48
|
};
|
|
96
49
|
}, []);
|
|
97
|
-
return (jsx_runtime_1.jsxs("div", { style: cwd, title: window.remotion_cwd, children: [
|
|
50
|
+
return (jsx_runtime_1.jsxs("div", { style: cwd, title: window.remotion_cwd, children: [
|
|
51
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: mobileLayout ? 0.5 : 2 }), window.remotion_projectName, jsx_runtime_1.jsx(MenuCompositionName_1.MenuCompositionName, {}), jsx_runtime_1.jsx(InspectorOpenInEditor_1.InspectorOpenInEditor, { location: folderLocation }), mobileLayout ? null : jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), mobileLayout ? (isBuilding ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
98
52
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx("div", { style: spinner, children: jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize, color: colors_1.WHITE_ALPHA_80 }) })
|
|
99
|
-
] })) : null] }));
|
|
53
|
+
] })) : null) : isBuilding ? (jsx_runtime_1.jsx("div", { style: spinner, children: jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize, color: colors_1.WHITE_ALPHA_80 }) })) : (jsx_runtime_1.jsx("div", { style: noSpinner }))] }));
|
|
100
54
|
};
|
|
101
55
|
exports.MenuBuildIndicator = MenuBuildIndicator;
|
|
@@ -4,13 +4,7 @@ exports.MenuCompositionName = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
-
const client_id_1 = require("../helpers/client-id");
|
|
8
7
|
const colors_1 = require("../helpers/colors");
|
|
9
|
-
const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
|
|
10
|
-
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
11
|
-
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
12
|
-
const actions_1 = require("./RenderQueue/actions");
|
|
13
|
-
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
14
8
|
const baseStyle = {
|
|
15
9
|
color: 'inherit',
|
|
16
10
|
textDecoration: 'none',
|
|
@@ -22,14 +16,6 @@ const compositionNameStyle = {
|
|
|
22
16
|
...baseStyle,
|
|
23
17
|
cursor: 'default',
|
|
24
18
|
};
|
|
25
|
-
const clickableStyle = {
|
|
26
|
-
...baseStyle,
|
|
27
|
-
cursor: 'pointer',
|
|
28
|
-
};
|
|
29
|
-
const clickableHoveredStyle = {
|
|
30
|
-
...clickableStyle,
|
|
31
|
-
textDecoration: 'underline',
|
|
32
|
-
};
|
|
33
19
|
const slashStyle = {
|
|
34
20
|
color: colors_1.LIGHT_TEXT,
|
|
35
21
|
marginInline: 4,
|
|
@@ -37,12 +23,8 @@ const slashStyle = {
|
|
|
37
23
|
top: 1,
|
|
38
24
|
};
|
|
39
25
|
const MenuCompositionName = () => {
|
|
40
|
-
var _a
|
|
26
|
+
var _a;
|
|
41
27
|
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
42
|
-
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
43
|
-
.previewServerState.type;
|
|
44
|
-
const [opening, setOpening] = (0, react_1.useState)(false);
|
|
45
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
46
28
|
const composition = (0, react_1.useMemo)(() => {
|
|
47
29
|
var _a;
|
|
48
30
|
if (canvasContent === null || canvasContent.type !== 'composition') {
|
|
@@ -51,54 +33,12 @@ const MenuCompositionName = () => {
|
|
|
51
33
|
return ((_a = compositions.find((c) => c.id === canvasContent.compositionId)) !== null && _a !== void 0 ? _a : null);
|
|
52
34
|
}, [canvasContent, compositions]);
|
|
53
35
|
const asset = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
|
|
54
|
-
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = composition === null || composition === void 0 ? void 0 : composition.stack) !== null && _a !== void 0 ? _a : null);
|
|
55
|
-
const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
|
|
56
|
-
const canOpenComposition = resolvedLocation &&
|
|
57
|
-
window.remotion_editorName &&
|
|
58
|
-
connectionStatus === 'connected';
|
|
59
|
-
const canOpenAsset = asset !== null &&
|
|
60
|
-
window.remotion_publicFolderExists !== null &&
|
|
61
|
-
connectionStatus === 'connected';
|
|
62
|
-
const canOpen = canOpenComposition || canOpenAsset;
|
|
63
|
-
const handleClick = (0, react_1.useCallback)(async () => {
|
|
64
|
-
if (!canOpen || opening) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
setOpening(true);
|
|
68
|
-
try {
|
|
69
|
-
if (asset !== null && window.remotion_publicFolderExists !== null) {
|
|
70
|
-
await (0, actions_1.openInFileExplorer)({
|
|
71
|
-
directory: `${window.remotion_publicFolderExists}/${asset}`,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
else if (resolvedLocation) {
|
|
75
|
-
await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation, null);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
80
|
-
}
|
|
81
|
-
finally {
|
|
82
|
-
setOpening(false);
|
|
83
|
-
}
|
|
84
|
-
}, [asset, canOpen, opening, resolvedLocation]);
|
|
85
36
|
if (!composition && asset === null) {
|
|
86
37
|
return null;
|
|
87
38
|
}
|
|
88
|
-
const name = (
|
|
89
|
-
const title = composition
|
|
90
|
-
? canOpenComposition
|
|
91
|
-
? `Open in ${window.remotion_editorName}`
|
|
92
|
-
: composition.id
|
|
93
|
-
: canOpenAsset
|
|
94
|
-
? `Show in ${fileManagerName}`
|
|
95
|
-
: (asset !== null && asset !== void 0 ? asset : undefined);
|
|
39
|
+
const name = (_a = composition === null || composition === void 0 ? void 0 : composition.id) !== null && _a !== void 0 ? _a : asset;
|
|
96
40
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
97
|
-
jsx_runtime_1.jsx("span", { style: slashStyle, children: "/" }), jsx_runtime_1.jsx("
|
|
98
|
-
? hovered
|
|
99
|
-
? clickableHoveredStyle
|
|
100
|
-
: clickableStyle
|
|
101
|
-
: compositionNameStyle, title: title, onClick: handleClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: name })
|
|
41
|
+
jsx_runtime_1.jsx("span", { style: slashStyle, children: "/" }), jsx_runtime_1.jsx("span", { style: compositionNameStyle, children: name })
|
|
102
42
|
] }));
|
|
103
43
|
};
|
|
104
44
|
exports.MenuCompositionName = MenuCompositionName;
|
|
@@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MenuToolbar = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
6
7
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
7
8
|
const client_id_1 = require("../helpers/client-id");
|
|
8
9
|
const colors_1 = require("../helpers/colors");
|
|
9
10
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
11
|
+
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
12
|
const use_menu_structure_1 = require("../helpers/use-menu-structure");
|
|
13
|
+
const search_1 = require("../icons/search");
|
|
14
|
+
const modals_1 = require("../state/modals");
|
|
15
|
+
const InlineAction_1 = require("./InlineAction");
|
|
11
16
|
const layout_1 = require("./layout");
|
|
12
17
|
const menu_toolbar_height_1 = require("./menu-toolbar-height");
|
|
13
18
|
const MenuItem_1 = require("./Menu/MenuItem");
|
|
@@ -34,6 +39,7 @@ const flex = {
|
|
|
34
39
|
const MenuToolbar = ({ readOnlyStudio }) => {
|
|
35
40
|
const [selected, setSelected] = (0, react_1.useState)(null);
|
|
36
41
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
42
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
37
43
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
38
44
|
const canUndoAndRedo = !readOnlyStudio ||
|
|
39
45
|
(previewServerState.type === 'connected' &&
|
|
@@ -104,9 +110,23 @@ const MenuToolbar = ({ readOnlyStudio }) => {
|
|
|
104
110
|
// Prevent deselection of currently selected items
|
|
105
111
|
e.stopPropagation();
|
|
106
112
|
}, []);
|
|
113
|
+
const openQuickSwitcher = (0, react_1.useCallback)(() => {
|
|
114
|
+
setSelectedModal({
|
|
115
|
+
type: 'quick-switcher',
|
|
116
|
+
mode: 'compositions',
|
|
117
|
+
invocationTimestamp: Date.now(),
|
|
118
|
+
assetSelection: null,
|
|
119
|
+
compositionSelection: null,
|
|
120
|
+
});
|
|
121
|
+
}, [setSelectedModal]);
|
|
122
|
+
const renderSearchIcon = (0, react_1.useCallback)((color) => {
|
|
123
|
+
return jsx_runtime_1.jsx(search_1.SearchIcon, { color: color, width: 18, height: 18 });
|
|
124
|
+
}, []);
|
|
125
|
+
const searchTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
|
|
126
|
+
? 'Quick Switcher'
|
|
127
|
+
: `Quick Switcher (${ShortcutHint_1.cmdOrCtrlCharacter}+K)`;
|
|
107
128
|
return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", className: "css-reset", style: row, onPointerDown: onPointerDown, children: [
|
|
108
|
-
jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [
|
|
109
|
-
jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "left" }), structure.map((s) => {
|
|
129
|
+
jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [mobileLayout ? (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openQuickSwitcher, renderAction: renderSearchIcon, title: searchTooltip })) : (jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "left" })), structure.map((s) => {
|
|
110
130
|
return (jsx_runtime_1.jsx(MenuItem_1.MenuItem, { selected: selected === s.id, onItemSelected: itemClicked, onItemHovered: itemHovered, id: s.id, label: s.label, onItemQuit: onItemQuit, menu: s, onPreviousMenu: onPreviousMenu, onNextMenu: onNextMenu, leaveLeftPadding: s.leaveLeftPadding }, s.id));
|
|
111
131
|
}), readOnlyStudio || browserStudioOperations ? null : jsx_runtime_1.jsx(UpdateCheck_1.UpdateCheck, {})] }), mobileLayout ? null : jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsx(MenuBuildIndicator_1.MenuBuildIndicator, { mobileLayout: mobileLayout }), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsxs("div", { style: fixedWidthRight, children: [canUndoAndRedo ? jsx_runtime_1.jsx(UndoRedoButtons_1.UndoRedoButtons, {}) : null, jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "right" })
|
|
112
132
|
] })
|
|
@@ -10,7 +10,11 @@ const content = {
|
|
|
10
10
|
fontSize: 13,
|
|
11
11
|
minWidth: 500,
|
|
12
12
|
};
|
|
13
|
-
const ModalFooterContainer = ({ children, style }) => {
|
|
14
|
-
return (jsx_runtime_1.jsx("div", { style: {
|
|
13
|
+
const ModalFooterContainer = ({ children, noBorder, style }) => {
|
|
14
|
+
return (jsx_runtime_1.jsx("div", { style: {
|
|
15
|
+
...content,
|
|
16
|
+
...style,
|
|
17
|
+
borderTop: noBorder ? undefined : colors_1.BORDER_BLACK,
|
|
18
|
+
}, children: children }));
|
|
15
19
|
};
|
|
16
20
|
exports.ModalFooterContainer = ModalFooterContainer;
|
|
@@ -24,7 +24,7 @@ const icon = {
|
|
|
24
24
|
width: 20,
|
|
25
25
|
};
|
|
26
26
|
const ModalHeader = ({ title, onClose }) => {
|
|
27
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
27
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
28
28
|
const onPress = (0, react_1.useCallback)(() => {
|
|
29
29
|
setSelectedModal(null);
|
|
30
30
|
}, [setSelectedModal]);
|