@remotion/studio 4.0.523 → 4.0.524
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/ActionTooltip.d.ts +9 -0
- package/dist/components/ActionTooltip.js +143 -0
- package/dist/components/Canvas.js +3 -2
- package/dist/components/CheckboardToggle.js +7 -10
- package/dist/components/ElementInstallConfirmation.js +6 -41
- package/dist/components/FullscreenToggle.js +5 -8
- package/dist/components/GlobalKeybindings.js +57 -0
- package/dist/components/InspectorSequenceSection.js +5 -5
- package/dist/components/LazySyntaxHighlightedSource.d.ts +4 -0
- package/dist/components/LazySyntaxHighlightedSource.js +43 -0
- package/dist/components/LoopToggle.js +8 -2
- package/dist/components/MenuToolbar.js +6 -4
- package/dist/components/MuteToggle.d.ts +1 -0
- package/dist/components/MuteToggle.js +16 -6
- package/dist/components/NewComposition/NewComposition.d.ts +1 -0
- package/dist/components/NewComposition/NewComposition.js +5 -4
- package/dist/components/NewComposition/NewFolder.js +2 -4
- package/dist/components/NewComposition/RenameComposition.js +3 -2
- package/dist/components/NewComposition/RenameFolder.js +2 -4
- package/dist/components/NewComposition/SlugPreview.d.ts +7 -0
- package/dist/components/NewComposition/SlugPreview.js +18 -0
- package/dist/components/OutlineToggle.js +16 -10
- package/dist/components/PlayPause.js +7 -1
- package/dist/components/PlaybackKeyboardShortcutsManager.d.ts +2 -0
- package/dist/components/PlaybackKeyboardShortcutsManager.js +36 -1
- package/dist/components/PlaybackRateSelector.js +2 -2
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/PreviewToolbarOverflowButton.js +8 -2
- package/dist/components/RenderQueue/CaptionQueueItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +2 -1
- package/dist/components/RulersAndGuidesToggle.js +7 -1
- package/dist/components/SettingsButton.js +8 -6
- package/dist/components/SettingsModal.js +1 -1
- package/dist/components/SidebarCollapserControls.js +13 -16
- package/dist/components/SizeSelector.js +2 -2
- package/dist/components/SnappingToggle.js +6 -8
- package/dist/components/StudioSettings.js +32 -18
- package/dist/components/SyntaxHighlightedSource.d.ts +5 -0
- package/dist/components/{HighlightedElementSource.js → SyntaxHighlightedSource.js} +2 -2
- package/dist/components/Timeline/Timeline.js +47 -39
- package/dist/components/Timeline/TimelineLayerChildren.js +12 -9
- package/dist/components/Timeline/TimelineZoomControls.js +2 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +8 -5
- package/dist/components/TimelineCombobox.d.ts +1 -0
- package/dist/components/TimelineCombobox.js +8 -4
- package/dist/components/TimelineInOutToggle.js +8 -15
- package/dist/components/handle-drop.js +3 -2
- package/dist/components/keyboard-shortcuts.d.ts +4 -4
- package/dist/components/keyboard-shortcuts.js +23 -9
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -18
- package/dist/esm/LazyModels-hc33szyn.mjs +11 -0
- package/dist/esm/LazyModels-sg40rjw6.mjs +11 -0
- package/dist/esm/{HighlightedElementSource-jfc66k4p.mjs → SyntaxHighlightedSource-3xks91rz.mjs} +4 -4
- package/dist/esm/{TranscriptionModal-916jqhry.mjs → TranscriptionModal-3ctnxpt6.mjs} +7 -7
- package/dist/esm/{VideoMattingModal-2tm79s9b.mjs → VideoMattingModal-b0r7e60n.mjs} +7 -7
- package/dist/esm/{index-te66vvrp.mjs → index-1b9skrrd.mjs} +4 -4
- package/dist/esm/{index-1x7bsdh6.mjs → index-2j3d1g81.mjs} +2 -2
- package/dist/esm/{index-hy4xcgty.mjs → index-9qtvmwtx.mjs} +1 -1
- package/dist/esm/{index-6cvm9a65.mjs → index-c37kme2v.mjs} +842 -556
- package/dist/esm/{index-5qddp5h7.mjs → index-e3zwf3e7.mjs} +1 -1
- package/dist/esm/{index-x7t2y7ws.mjs → index-er3mh6em.mjs} +3584 -3090
- package/dist/esm/{index-jg13hf2g.mjs → index-k426ye99.mjs} +2 -1
- package/dist/esm/{index-sgtmgc4h.mjs → index-q2epbw93.mjs} +3 -3
- package/dist/esm/{index-3hgr6gjx.mjs → index-q5xv20xx.mjs} +1 -1
- package/dist/esm/{index-czwvnn9g.mjs → index-wbmp5srk.mjs} +1 -1
- package/dist/esm/{index-xhe2m2qr.mjs → index-yfrysr5f.mjs} +18 -10
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/internals.mjs +8 -8
- package/dist/esm/previewEntry.mjs +8 -8
- package/dist/esm/renderEntry.mjs +3 -3
- package/dist/helpers/colors.d.ts +1 -0
- package/dist/helpers/colors.js +4 -3
- package/dist/helpers/inject-css.js +2 -2
- package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -0
- package/dist/helpers/prism-vsc-dark-plus.js +305 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/use-create-composition.d.ts +1 -0
- package/dist/helpers/use-create-composition.js +12 -7
- package/dist/helpers/use-keybinding.d.ts +1 -1
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
- package/dist/helpers/use-menu-structure.js +1 -1
- package/dist/helpers/use-rename-composition.d.ts +1 -0
- package/dist/helpers/use-rename-composition.js +11 -5
- package/dist/icons/skills.js +1 -1
- package/dist/renderEntry.js +2 -2
- package/package.json +20 -20
- package/dist/components/HighlightedElementSource.d.ts +0 -5
- package/dist/esm/LazyModels-2trdm224.mjs +0 -11
- package/dist/esm/LazyModels-fjb5ckaq.mjs +0 -11
- package/dist/helpers/prism-tomorrow.d.ts +0 -1
- package/dist/helpers/prism-tomorrow.js +0 -151
- /package/dist/esm/{resolve-composition-component-location-14148845.mjs → resolve-composition-component-location-bt2d6qxq.mjs} +0 -0
|
@@ -104,6 +104,6 @@ const SettingsModal = ({ initialPublicLicenseKey, initialTab }) => {
|
|
|
104
104
|
}, [initialPublicLicenseKey, setPublicLicenseKey]);
|
|
105
105
|
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { panelStyle: render_modals_1.outerModalStyle, children: jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
106
106
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Settings", onClose: dismiss }), jsx_runtime_1.jsxs("div", { style: render_modals_1.horizontalLayout, children: [
|
|
107
|
-
jsx_runtime_1.jsxs("div", { style: settingsLeftSidebar, children: [isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === '
|
|
107
|
+
jsx_runtime_1.jsxs("div", { style: settingsLeftSidebar, children: [isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'studio', onClick: () => selectTab('studio'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(remotion_triangle_1.RemotionTriangleIcon, { color: color, style: render_modals_1.icon }) })), children: "Studio" })), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'rendering', onClick: () => selectTab('rendering'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: render_modals_1.icon }) })), children: "Defaults" })), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'shortcuts', onClick: () => selectTab('shortcuts'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(keyboard_1.KeyboardIcon, { color: color, style: keyboardIcon }) })), children: "Shortcuts" }), showPackages ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'packages', onClick: () => selectTab('packages'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(package_1.PackageIcon, { color: color, style: render_modals_1.icon }) })), children: "Packages" })) : null, isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'skills', onClick: () => selectTab('skills'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(skills_1.SkillsIcon, { color: color, style: skillsIcon }) })), children: "Skills" })), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'models', onClick: () => selectTab('models'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(models_1.ModelsIcon, { color: color, style: render_modals_1.icon }) })), children: "Models" }), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'apps', onClick: () => selectTab('apps'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(apps_1.AppsIcon, { color: color, style: appsIcon }) })), children: "Apps" })), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'license', onClick: () => selectTab('license'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(license_1.LicenseIcon, { color: color, style: render_modals_1.icon }) })), children: "License" })), showUpdates ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'updates', onClick: () => selectTab('updates'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(cloud_download_1.CloudDownloadIcon, { color: color, style: render_modals_1.icon }) })), children: "Updates" })) : null] }), openedTabs.includes('packages') ? (jsx_runtime_1.jsx("div", { style: tab === 'packages' ? render_modals_1.optionsPanel : hiddenPanel, children: jsx_runtime_1.jsx(InstallPackage_1.InstallPackageSettings, { footerContainer: packagesFooterContainer, packageManager: packageManager }) })) : null, openedTabs.includes('apps') ? (jsx_runtime_1.jsx("div", { style: tab === 'apps' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ConfigureDefaultEditorModal_1.DefaultEditorSettings, {}) })) : null, openedTabs.includes('models') ? (jsx_runtime_1.jsx("div", { style: tab === 'models' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ModelsSettings_1.ModelsSettings, {}) })) : null, openedTabs.includes('license') ? (jsx_runtime_1.jsx("div", { style: tab === 'license' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ConfigureLicenseModal_1.LicenseSettings, {}) })) : null, openedTabs.includes('skills') ? (jsx_runtime_1.jsx("div", { style: tab === 'skills' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(SkillsSettings_1.SkillsSettings, {}) })) : null, openedTabs.includes('shortcuts') ? (jsx_runtime_1.jsx("div", { style: tab === 'shortcuts' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(KeyboardShortcutsSettings_1.KeyboardShortcutsSettings, {}) })) : null, openedTabs.includes('rendering') ? (jsx_runtime_1.jsx("div", { style: tab === 'rendering' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(RenderingSettings_1.RenderingSettings, {}) })) : null, openedTabs.includes('studio') ? (jsx_runtime_1.jsx("div", { style: tab === 'studio' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(StudioSettings_1.StudioSettings, {}) })) : null, showUpdates && openedTabs.includes('updates') ? (jsx_runtime_1.jsx("div", { style: tab === 'updates' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(UpdatesSettings_1.UpdatesSettings, {}) })) : null] }), tab === 'packages' ? (jsx_runtime_1.jsx("div", { ref: setPackagesFooterContainer })) : isBrowserStudio || tab === 'models' || tab === 'updates' ? null : (jsx_runtime_1.jsx(SettingsModalFooter_1.SettingsModalFooter, { showLicenseFaq: tab === 'license' }))] }) }));
|
|
108
108
|
};
|
|
109
109
|
exports.SettingsModal = SettingsModal;
|
|
@@ -7,6 +7,7 @@ const colors_1 = require("../helpers/colors");
|
|
|
7
7
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
8
|
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
9
9
|
const sidebar_1 = require("../state/sidebar");
|
|
10
|
+
const ActionTooltip_1 = require("./ActionTooltip");
|
|
10
11
|
const InlineAction_1 = require("./InlineAction");
|
|
11
12
|
const TopPanel_1 = require("./TopPanel");
|
|
12
13
|
const style = {
|
|
@@ -123,14 +124,13 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
123
124
|
right.unregister();
|
|
124
125
|
};
|
|
125
126
|
}, [keybindings, side, toggleBoth, toggleLeft, toggleRight]);
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
: `Toggle Right Sidebar (${rightShortcut})`;
|
|
127
|
+
const action = side === 'left' ? 'toggleLeftSidebar' : 'toggleRightSidebar';
|
|
128
|
+
const shortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)(action);
|
|
129
|
+
const ariaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)(action);
|
|
130
|
+
const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
|
|
131
|
+
const expanded = (side === 'left' ? leftSidebarStatus : sidebarCollapsedStateRight) ===
|
|
132
|
+
'expanded' && sidebarCollapsedDuringDrag !== side;
|
|
133
|
+
const label = `${expanded ? 'Collapse' : 'Expand'} ${side} sidebar`;
|
|
134
134
|
const colorStyle = (0, react_1.useCallback)((color) => {
|
|
135
135
|
return {
|
|
136
136
|
...style,
|
|
@@ -138,14 +138,11 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
138
138
|
};
|
|
139
139
|
}, []);
|
|
140
140
|
const toggleLeftAction = (0, react_1.useCallback)((color) => {
|
|
141
|
-
return (jsx_runtime_1.jsx("div", { "data-sidebar-toggle": "left", style: colorStyle(color),
|
|
142
|
-
}, [colorStyle, leftIcon
|
|
141
|
+
return (jsx_runtime_1.jsx("div", { "data-sidebar-toggle": "left", style: colorStyle(color), children: jsx_runtime_1.jsx("div", { style: leftIcon(color) }) }));
|
|
142
|
+
}, [colorStyle, leftIcon]);
|
|
143
143
|
const toggleRightAction = (0, react_1.useCallback)((color) => {
|
|
144
|
-
return (jsx_runtime_1.jsx("div", { "data-sidebar-toggle": "right", style: colorStyle(color),
|
|
145
|
-
}, [colorStyle, rightIcon
|
|
146
|
-
|
|
147
|
-
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: toggleLeft, renderAction: toggleLeftAction, style: { marginRight: 4 } }));
|
|
148
|
-
}
|
|
149
|
-
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: toggleRight, renderAction: toggleRightAction }));
|
|
144
|
+
return (jsx_runtime_1.jsx("div", { "data-sidebar-toggle": "right", style: colorStyle(color), children: jsx_runtime_1.jsx("div", { style: rightIcon(color) }) }));
|
|
145
|
+
}, [colorStyle, rightIcon]);
|
|
146
|
+
return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: label, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: side === 'left' ? toggleLeft : toggleRight, renderAction: side === 'left' ? toggleLeftAction : toggleRightAction, style: side === 'left' ? { marginRight: 4 } : undefined, "aria-label": label, "aria-expanded": expanded, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaShortcut || undefined }) }));
|
|
150
147
|
};
|
|
151
148
|
exports.SidebarCollapserControl = SidebarCollapserControl;
|
|
@@ -48,7 +48,7 @@ const getPreviewSizeLabel = (previewSize) => {
|
|
|
48
48
|
return `${(previewSize.size * 100).toFixed(0)}%`;
|
|
49
49
|
};
|
|
50
50
|
exports.getPreviewSizeLabel = getPreviewSizeLabel;
|
|
51
|
-
const accessibilityLabel = '
|
|
51
|
+
const accessibilityLabel = 'Zoom';
|
|
52
52
|
const getUniqueSizes = (size) => {
|
|
53
53
|
const customPreviewSizes = [size, ...commonPreviewSizes];
|
|
54
54
|
const uniqueSizes = [];
|
|
@@ -126,6 +126,6 @@ const SizeSelector = () => {
|
|
|
126
126
|
if (!zoomable) {
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
129
|
-
return (jsx_runtime_1.jsx(TimelineCombobox_1.TimelineCombobox, { title: accessibilityLabel, selectedId: selectedId, values: items, renderLeftItem: (color) => selectedId === 'auto' ? (jsx_runtime_1.jsx(canvas_zoom_1.CanvasFitIcon, { color: color })) : Number(selectedId) < 1 ? (jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomOutIcon, { color: color })) : (jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomIcon, { color: color })), unhoveredIconColor: colors_1.WHITE_ALPHA_80 }));
|
|
129
|
+
return (jsx_runtime_1.jsx(TimelineCombobox_1.TimelineCombobox, { title: accessibilityLabel, tooltipDelay: 800, selectedId: selectedId, values: items, renderLeftItem: (color) => selectedId === 'auto' ? (jsx_runtime_1.jsx(canvas_zoom_1.CanvasFitIcon, { color: color })) : Number(selectedId) < 1 ? (jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomOutIcon, { color: color })) : (jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomIcon, { color: color })), unhoveredIconColor: colors_1.WHITE_ALPHA_80 }));
|
|
130
130
|
};
|
|
131
131
|
exports.SizeSelector = SizeSelector;
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SnappingToggle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const no_react_1 = require("remotion/no-react");
|
|
7
6
|
const colors_1 = require("../helpers/colors");
|
|
8
7
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
9
8
|
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
10
9
|
const magnet_1 = require("../icons/magnet");
|
|
11
10
|
const editor_snapping_1 = require("../state/editor-snapping");
|
|
11
|
+
const ActionTooltip_1 = require("./ActionTooltip");
|
|
12
12
|
const ControlButton_1 = require("./ControlButton");
|
|
13
13
|
const SnappingToggle = () => {
|
|
14
14
|
const { editorSnapping, setEditorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
@@ -17,12 +17,10 @@ const SnappingToggle = () => {
|
|
|
17
17
|
}, [setEditorSnapping]);
|
|
18
18
|
const shortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleSnapping');
|
|
19
19
|
const ariaKeyShortcuts = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('toggleSnapping');
|
|
20
|
-
const accessibilityLabel =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.join(' ');
|
|
26
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": editorSnapping, "aria-keyshortcuts": ariaKeyShortcuts || undefined, onClick: onClick, children: (color) => (jsx_runtime_1.jsx(magnet_1.MagnetIcon, { style: { width: 18, height: 18, transform: 'translateY(1px)' }, color: editorSnapping ? colors_1.BLUE : color, "aria-hidden": "true", focusable: "false" })) }));
|
|
20
|
+
const accessibilityLabel = editorSnapping
|
|
21
|
+
? 'Disable snapping'
|
|
22
|
+
: 'Enable snapping';
|
|
23
|
+
const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
|
|
24
|
+
return (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: accessibilityLabel, shortcut: shortcutsDisabled ? null : shortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": accessibilityLabel, "aria-pressed": editorSnapping, "aria-keyshortcuts": shortcutsDisabled ? undefined : ariaKeyShortcuts || undefined, onClick: onClick, children: (color) => (jsx_runtime_1.jsx(magnet_1.MagnetIcon, { style: { width: 18, height: 18, transform: 'translateY(1px)' }, color: editorSnapping ? colors_1.BLUE : color, "aria-hidden": "true", focusable: "false" })) }) }));
|
|
27
25
|
};
|
|
28
26
|
exports.SnappingToggle = SnappingToggle;
|
|
@@ -3,20 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StudioSettings = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const client_1 = require("@remotion/renderer/client");
|
|
6
|
-
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
6
|
const react_1 = require("react");
|
|
8
7
|
const colors_1 = require("../helpers/colors");
|
|
9
8
|
const undo_1 = require("../icons/undo");
|
|
10
9
|
const Button_1 = require("./Button");
|
|
10
|
+
const Checkbox_1 = require("./Checkbox");
|
|
11
11
|
const ConfigSelect_1 = require("./ConfigSelect");
|
|
12
12
|
const styles_1 = require("./InspectorPanel/styles");
|
|
13
13
|
const layout_1 = require("./layout");
|
|
14
14
|
const InputDragger_1 = require("./NewComposition/InputDragger");
|
|
15
15
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
16
|
+
const InfoBubble_1 = require("./RenderModal/InfoBubble");
|
|
16
17
|
const layout_2 = require("./RenderModal/layout");
|
|
17
18
|
const SettingsContext_1 = require("./SettingsContext");
|
|
18
19
|
const use_auto_save_config_1 = require("./use-auto-save-config");
|
|
19
20
|
const container = {
|
|
21
|
+
alignSelf: 'flex-start',
|
|
20
22
|
display: 'flex',
|
|
21
23
|
flex: 1,
|
|
22
24
|
flexDirection: 'column',
|
|
@@ -47,11 +49,10 @@ const initialSettings = {
|
|
|
47
49
|
numberOfSharedAudioTags: null,
|
|
48
50
|
rspack: null,
|
|
49
51
|
};
|
|
50
|
-
const ConfigNumber = ({
|
|
51
|
-
const resolvedDefaultLabel = defaultLabel !== null && defaultLabel !== void 0 ? defaultLabel : String(defaultValue);
|
|
52
|
+
const ConfigNumber = ({ defaultValue, name, onChange, onChangeEnd, value, }) => {
|
|
52
53
|
return (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
53
54
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: name }), jsx_runtime_1.jsxs("div", { style: { ...layout_2.rightRow, gap: 6 }, children: [
|
|
54
|
-
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": name, buttonStyle: { textAlign: 'right', width: 140 }, formatter: () => value === null ? `Default (${
|
|
55
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": name, buttonStyle: { textAlign: 'right', width: 140 }, formatter: () => value === null ? `Default (${defaultValue})` : String(value), min: 0, onTextChange: () => undefined, onValueChange: onChange, onValueChangeEnd: onChangeEnd, placeholder: `Default (${defaultValue})`, rightAlign: true, status: "ok", step: 1, value: value !== null && value !== void 0 ? value : defaultValue }), jsx_runtime_1.jsx(Button_1.Button, { disabled: value === null, onClick: () => onChangeEnd(null), size: "compact", style: { color: colors_1.LIGHT_TEXT }, title: `Use default (${defaultValue})`, children: jsx_runtime_1.jsx(undo_1.UndoIcon, { style: resetIcon }) })
|
|
55
56
|
] })
|
|
56
57
|
] }));
|
|
57
58
|
};
|
|
@@ -59,20 +60,19 @@ const StudioSettings = () => {
|
|
|
59
60
|
var _a;
|
|
60
61
|
const { error: settingsError, revision, studioRuntimeConfig } = (0, SettingsContext_1.useSettings)();
|
|
61
62
|
const [settings, setSettings] = (0, react_1.useState)(initialSettings);
|
|
62
|
-
const [committedNumberSettings, setCommittedNumberSettings] = (0, react_1.useState)({
|
|
63
|
+
const [committedNumberSettings, setCommittedNumberSettings] = (0, react_1.useState)({ numberOfSharedAudioTags: null });
|
|
63
64
|
const [editedSetters, setEditedSetters] = (0, react_1.useState)(() => new Set());
|
|
64
65
|
const [syncedRevision, setSyncedRevision] = (0, react_1.useState)(-1);
|
|
65
66
|
const [error, setError] = (0, react_1.useState)(null);
|
|
66
67
|
(0, react_1.useEffect)(() => {
|
|
67
|
-
var _a
|
|
68
|
-
var
|
|
68
|
+
var _a;
|
|
69
|
+
var _b, _c;
|
|
69
70
|
if (studioRuntimeConfig === null) {
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
|
-
setSettings((
|
|
73
|
+
setSettings((_b = studioRuntimeConfig.configFileStudioSettings) !== null && _b !== void 0 ? _b : initialSettings);
|
|
73
74
|
setCommittedNumberSettings({
|
|
74
|
-
|
|
75
|
-
numberOfSharedAudioTags: (_e = (_b = studioRuntimeConfig.configFileStudioSettings) === null || _b === void 0 ? void 0 : _b.numberOfSharedAudioTags) !== null && _e !== void 0 ? _e : null,
|
|
75
|
+
numberOfSharedAudioTags: (_c = (_a = studioRuntimeConfig.configFileStudioSettings) === null || _a === void 0 ? void 0 : _a.numberOfSharedAudioTags) !== null && _c !== void 0 ? _c : null,
|
|
76
76
|
});
|
|
77
77
|
setEditedSetters(new Set());
|
|
78
78
|
setSyncedRevision(revision);
|
|
@@ -96,7 +96,6 @@ const StudioSettings = () => {
|
|
|
96
96
|
update('setAskAIEnabled', settings.askAIEnabled),
|
|
97
97
|
update('setEnableCrossSiteIsolation', settings.enableCrossSiteIsolation),
|
|
98
98
|
update('setBeepOnFinish', settings.beepOnFinish),
|
|
99
|
-
update('setMaxTimelineTracks', committedNumberSettings.maxTimelineTracks),
|
|
100
99
|
update('setAudioLatencyHint', settings.audioLatencyHint),
|
|
101
100
|
update('setNumberOfSharedAudioTags', committedNumberSettings.numberOfSharedAudioTags),
|
|
102
101
|
update('setRspack', settings.rspack),
|
|
@@ -126,17 +125,32 @@ const StudioSettings = () => {
|
|
|
126
125
|
return null;
|
|
127
126
|
}
|
|
128
127
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
129
|
-
jsx_runtime_1.jsx("p", { style: dividerLabel, children: "
|
|
130
|
-
{ label: 'Interactive', value: 'interactive' },
|
|
131
|
-
{ label: 'Balanced', value: 'balanced' },
|
|
132
|
-
{ label: 'Playback', value: 'playback' },
|
|
133
|
-
], value: settings.audioLatencyHint }), jsx_runtime_1.jsx(ConfigNumber, { defaultValue: 0, name: "Number of shared audio tags", onChange: (value) => previewNumberSetting('numberOfSharedAudioTags', value), onChangeEnd: (value) => commitNumberSetting('numberOfSharedAudioTags', 'setNumberOfSharedAudioTags', value), value: settings.numberOfSharedAudioTags }), jsx_runtime_1.jsx(ConfigSelect_1.ConfigSelect, { defaultLabel: "Disabled", name: "Beep on finish", onChange: (value) => changeSetting('beepOnFinish', 'setBeepOnFinish', value), options: ConfigSelect_1.booleanOptions, value: settings.beepOnFinish }), jsx_runtime_1.jsx("p", { style: sectionTitle, children: "Development" }), jsx_runtime_1.jsx(ConfigSelect_1.ConfigSelect, { defaultLabel: "Webpack", name: "Bundler", onChange: (value) => changeSetting('rspack', 'setRspack', value), options: [
|
|
128
|
+
jsx_runtime_1.jsx("p", { style: dividerLabel, children: "Development" }), jsx_runtime_1.jsx(ConfigSelect_1.ConfigSelect, { defaultLabel: "Webpack", name: "Bundler", onChange: (value) => changeSetting('rspack', 'setRspack', value), options: [
|
|
134
129
|
{ label: 'Rspack', value: true },
|
|
135
130
|
{ label: 'Webpack', value: false },
|
|
136
|
-
], value: settings.rspack }), jsx_runtime_1.
|
|
131
|
+
], value: settings.rspack }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
132
|
+
jsx_runtime_1.jsxs("div", { style: layout_2.label, children: ["Cross-site isolation",
|
|
133
|
+
jsx_runtime_1.jsx(InfoBubble_1.InfoBubble, { title: "About cross-site isolation", horizontalAlignment: "right", children: jsx_runtime_1.jsx("div", { style: {
|
|
134
|
+
padding: 12,
|
|
135
|
+
maxWidth: 280,
|
|
136
|
+
fontSize: 14,
|
|
137
|
+
lineHeight: 1.5,
|
|
138
|
+
}, children: "Isolates Studio from other websites to enable shared memory and multithreading. Required for @remotion/whisper-web and can speed up ProRes decoding. Media from other websites that requires cookies or authentication may not load. Disabled by default." }) })
|
|
139
|
+
] }), jsx_runtime_1.jsx("label", { style: layout_2.rightRow, "aria-label": "Cross-site isolation", children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: settings.enableCrossSiteIsolation === true, name: "Cross-site isolation", onChange: (event) => changeSetting('enableCrossSiteIsolation', 'setEnableCrossSiteIsolation', event.target.checked ? true : null) }) })
|
|
140
|
+
] }), jsx_runtime_1.jsx(ConfigSelect_1.ConfigSelect, { defaultLabel: "Info", name: "Log level", onChange: (value) => changeSetting('logLevel', 'setLogLevel', value), options: client_1.BrowserSafeApis.logLevels.map((value) => ({
|
|
137
141
|
label: value[0].toUpperCase() + value.slice(1),
|
|
138
142
|
value,
|
|
139
|
-
})), value: settings.logLevel }), (
|
|
143
|
+
})), value: settings.logLevel }), jsx_runtime_1.jsx("p", { style: sectionTitle, children: "Interface" }), jsx_runtime_1.jsxs("label", { style: layout_2.optionRow, children: [
|
|
144
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Ask AI enabled" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: settings.askAIEnabled !== false, name: "Ask AI enabled", onChange: (event) => changeSetting('askAIEnabled', 'setAskAIEnabled', event.target.checked ? null : false) }) })
|
|
145
|
+
] }), jsx_runtime_1.jsxs("label", { style: layout_2.optionRow, children: [
|
|
146
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Interactivity enabled" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: settings.interactivityEnabled !== false, name: "Interactivity enabled", onChange: (event) => changeSetting('interactivityEnabled', 'setInteractivityEnabled', event.target.checked ? null : false) }) })
|
|
147
|
+
] }), jsx_runtime_1.jsx("p", { style: sectionTitle, children: "Audio" }), jsx_runtime_1.jsx(ConfigSelect_1.ConfigSelect, { defaultLabel: "Playback", name: "Audio latency hint", onChange: (value) => changeSetting('audioLatencyHint', 'setAudioLatencyHint', value), options: [
|
|
148
|
+
{ label: 'Interactive', value: 'interactive' },
|
|
149
|
+
{ label: 'Balanced', value: 'balanced' },
|
|
150
|
+
{ label: 'Playback', value: 'playback' },
|
|
151
|
+
], value: settings.audioLatencyHint }), jsx_runtime_1.jsx(ConfigNumber, { defaultValue: 0, name: "Number of shared audio tags", onChange: (value) => previewNumberSetting('numberOfSharedAudioTags', value), onChangeEnd: (value) => commitNumberSetting('numberOfSharedAudioTags', 'setNumberOfSharedAudioTags', value), value: settings.numberOfSharedAudioTags }), jsx_runtime_1.jsxs("label", { style: layout_2.optionRow, children: [
|
|
152
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Beep on finish" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: settings.beepOnFinish === true, name: "Beep on finish", onChange: (event) => changeSetting('beepOnFinish', 'setBeepOnFinish', event.target.checked ? true : null) }) })
|
|
153
|
+
] }), (error !== null && error !== void 0 ? error : settingsError) ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
140
154
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx("div", { style: { paddingLeft: 16, paddingRight: 16 }, children: jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: (_a = error !== null && error !== void 0 ? error : settingsError) !== null && _a !== void 0 ? _a : '', type: "error" }) })
|
|
141
155
|
] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true })
|
|
142
156
|
] }));
|
|
@@ -71,8 +71,8 @@ const renderTokens = (tokens) => {
|
|
|
71
71
|
: ((_a = tokens.alias) !== null && _a !== void 0 ? _a : [])),
|
|
72
72
|
].join(' '), style: tokenStyle, children: renderTokens(tokens.content) }));
|
|
73
73
|
};
|
|
74
|
-
const
|
|
74
|
+
const SyntaxHighlightedSource = ({ source, }) => {
|
|
75
75
|
const tokens = (0, react_1.useMemo)(() => prismjs_1.default.tokenize(source, prismjs_1.default.languages.tsx), [source]);
|
|
76
76
|
return (jsx_runtime_1.jsx("span", { style: { ...tokenStyle, color: 'inherit' }, children: renderTokens(tokens) }));
|
|
77
77
|
};
|
|
78
|
-
exports.default =
|
|
78
|
+
exports.default = SyntaxHighlightedSource;
|
|
@@ -259,22 +259,54 @@ const TimelineInner = () => {
|
|
|
259
259
|
overrideIdToNodePathMappings,
|
|
260
260
|
compositions,
|
|
261
261
|
]);
|
|
262
|
+
const durationInFrames = (_a = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _a !== void 0 ? _a : 0;
|
|
263
|
+
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
264
|
+
const filtered = (0, react_1.useMemo)(() => {
|
|
265
|
+
return timeline.filter((t) => {
|
|
266
|
+
// Moving outside the composition can reduce the displayed duration to
|
|
267
|
+
// zero. Keep the drag owner mounted until its pending edit is saved.
|
|
268
|
+
if (t.sequence.showInTimeline &&
|
|
269
|
+
t.nodePathInfo !== null &&
|
|
270
|
+
getDragOverrides(t.nodePathInfo.sequenceSubscriptionKey).from !==
|
|
271
|
+
undefined) {
|
|
272
|
+
return true;
|
|
273
|
+
}
|
|
274
|
+
return (0, should_show_track_in_timeline_1.shouldShowTrackInTimeline)(t, durationInFrames);
|
|
275
|
+
});
|
|
276
|
+
}, [durationInFrames, getDragOverrides, timeline]);
|
|
277
|
+
// Keep `filtered` complete so a future toggle can show every programmatic
|
|
278
|
+
// instance without recalculating the timeline or losing its instance index.
|
|
279
|
+
const collapsed = (0, react_1.useMemo)(() => {
|
|
280
|
+
const seenNodePaths = new Set();
|
|
281
|
+
return filtered.filter((track) => {
|
|
282
|
+
if (track.nodePathInfo === null) {
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
const key = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(track.nodePathInfo.sequenceSubscriptionKey);
|
|
286
|
+
if (seenNodePaths.has(key)) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
seenNodePaths.add(key);
|
|
290
|
+
return true;
|
|
291
|
+
});
|
|
292
|
+
}, [filtered]);
|
|
293
|
+
const { visibleTracks, value: layerChildrenValue } = (0, TimelineLayerChildren_1.useTimelineLayerChildren)(collapsed, sequences, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null);
|
|
262
294
|
const pendingInsertedElementSelection = (0, use_sync_external_store_1.useSyncExternalStore)(inserted_element_selection_1.subscribeToInsertedElementSelection, inserted_element_selection_1.getInsertedElementSelection, inserted_element_selection_1.getInsertedElementSelection);
|
|
263
295
|
const { fastRefreshes } = (0, react_1.useContext)(fast_refresh_context_1.FastRefreshContext);
|
|
264
296
|
const pendingSelectionStart = (0, react_1.useRef)(null);
|
|
265
297
|
const { selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
266
|
-
(0, react_1.
|
|
298
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
267
299
|
var _a;
|
|
268
300
|
if (pendingInsertedElementSelection === null) {
|
|
269
301
|
pendingSelectionStart.current = null;
|
|
270
302
|
return;
|
|
271
303
|
}
|
|
272
|
-
const matchesInsertedNodePath = (track) =>
|
|
273
|
-
(
|
|
274
|
-
|
|
304
|
+
const matchesInsertedNodePath = (track) => pendingInsertedElementSelection.nodePath === null ||
|
|
305
|
+
(track.nodePathInfo !== null &&
|
|
306
|
+
track.nodePathInfo.sequenceSubscriptionKey.absolutePath ===
|
|
275
307
|
pendingInsertedElementSelection.nodePath.absolutePath &&
|
|
276
|
-
|
|
277
|
-
|
|
308
|
+
JSON.stringify(track.nodePathInfo.sequenceSubscriptionKey.nodePath) ===
|
|
309
|
+
JSON.stringify(pendingInsertedElementSelection.nodePath.nodePath));
|
|
278
310
|
if (((_a = pendingSelectionStart.current) === null || _a === void 0 ? void 0 : _a.selection) !==
|
|
279
311
|
pendingInsertedElementSelection) {
|
|
280
312
|
pendingSelectionStart.current = {
|
|
@@ -300,7 +332,14 @@ const TimelineInner = () => {
|
|
|
300
332
|
return matchesInsertedNodePath(track) &&
|
|
301
333
|
!((_a = pendingSelectionStart.current) === null || _a === void 0 ? void 0 : _a.existingSequenceIds.has(track.sequence.id));
|
|
302
334
|
});
|
|
303
|
-
if (!insertedTrack
|
|
335
|
+
if (!insertedTrack) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const layerKey = layerChildrenValue.keys.get(insertedTrack.sequence.id);
|
|
339
|
+
if (layerKey !== undefined && !layerChildrenValue.collapsed[layerKey]) {
|
|
340
|
+
layerChildrenValue.toggle(layerKey);
|
|
341
|
+
}
|
|
342
|
+
if (insertedTrack.nodePathInfo === null) {
|
|
304
343
|
return;
|
|
305
344
|
}
|
|
306
345
|
selectItems([{ type: 'sequence', nodePathInfo: insertedTrack.nodePathInfo }], { reveal: true });
|
|
@@ -311,42 +350,11 @@ const TimelineInner = () => {
|
|
|
311
350
|
}, [
|
|
312
351
|
canvasContent,
|
|
313
352
|
fastRefreshes,
|
|
353
|
+
layerChildrenValue,
|
|
314
354
|
pendingInsertedElementSelection,
|
|
315
355
|
selectItems,
|
|
316
356
|
timeline,
|
|
317
357
|
]);
|
|
318
|
-
const durationInFrames = (_a = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _a !== void 0 ? _a : 0;
|
|
319
|
-
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
320
|
-
const filtered = (0, react_1.useMemo)(() => {
|
|
321
|
-
return timeline.filter((t) => {
|
|
322
|
-
// Moving outside the composition can reduce the displayed duration to
|
|
323
|
-
// zero. Keep the drag owner mounted until its pending edit is saved.
|
|
324
|
-
if (t.sequence.showInTimeline &&
|
|
325
|
-
t.nodePathInfo !== null &&
|
|
326
|
-
getDragOverrides(t.nodePathInfo.sequenceSubscriptionKey).from !==
|
|
327
|
-
undefined) {
|
|
328
|
-
return true;
|
|
329
|
-
}
|
|
330
|
-
return (0, should_show_track_in_timeline_1.shouldShowTrackInTimeline)(t, durationInFrames);
|
|
331
|
-
});
|
|
332
|
-
}, [durationInFrames, getDragOverrides, timeline]);
|
|
333
|
-
// Keep `filtered` complete so a future toggle can show every programmatic
|
|
334
|
-
// instance without recalculating the timeline or losing its instance index.
|
|
335
|
-
const collapsed = (0, react_1.useMemo)(() => {
|
|
336
|
-
const seenNodePaths = new Set();
|
|
337
|
-
return filtered.filter((track) => {
|
|
338
|
-
if (track.nodePathInfo === null) {
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
const key = (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(track.nodePathInfo.sequenceSubscriptionKey);
|
|
342
|
-
if (seenNodePaths.has(key)) {
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
seenNodePaths.add(key);
|
|
346
|
-
return true;
|
|
347
|
-
});
|
|
348
|
-
}, [filtered]);
|
|
349
|
-
const { visibleTracks, value: layerChildrenValue } = (0, TimelineLayerChildren_1.useTimelineLayerChildren)(collapsed, sequences, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null);
|
|
350
358
|
const maxTimelineTracks = (0, studio_runtime_config_1.getStudioMaxTimelineTracks)();
|
|
351
359
|
const shown = (0, react_1.useMemo)(() => {
|
|
352
360
|
return maxTimelineTracks !== null &&
|
|
@@ -8,7 +8,16 @@ const hoverable_1 = require("../../helpers/hoverable");
|
|
|
8
8
|
const persist_boolean_map_1 = require("../../helpers/persist-boolean-map");
|
|
9
9
|
const timeline_node_path_key_1 = require("../../helpers/timeline-node-path-key");
|
|
10
10
|
const TimelineCollapseToggle_1 = require("./TimelineCollapseToggle");
|
|
11
|
-
|
|
11
|
+
// Reserve the same space before and after children register or unregister.
|
|
12
|
+
const toggleLayout = {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
width: 12,
|
|
17
|
+
height: 16,
|
|
18
|
+
marginRight: 0,
|
|
19
|
+
flexShrink: 0,
|
|
20
|
+
};
|
|
12
21
|
const STORAGE_KEY = 'remotion.editor.collapsedLayerChildren.v1';
|
|
13
22
|
const TimelineLayerChildrenContext = (0, react_1.createContext)(null);
|
|
14
23
|
exports.TimelineLayerChildrenProvider = TimelineLayerChildrenContext.Provider;
|
|
@@ -104,7 +113,7 @@ const TimelineLayerChildrenToggle = ({ sequence }) => {
|
|
|
104
113
|
}, [context, key]);
|
|
105
114
|
const stopPropagation = (0, react_1.useCallback)((event) => event.stopPropagation(), []);
|
|
106
115
|
if (!(context === null || context === void 0 ? void 0 : context.parents.has(sequence.id)) || key === undefined) {
|
|
107
|
-
return jsx_runtime_1.jsx(
|
|
116
|
+
return jsx_runtime_1.jsx("div", { style: toggleLayout });
|
|
108
117
|
}
|
|
109
118
|
const label = `${isCollapsed ? 'Expand' : 'Collapse'} children of ${sequence.displayName}`;
|
|
110
119
|
return (jsx_runtime_1.jsx("button", { type: "button", className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, "aria-label": label, "aria-expanded": !isCollapsed, title: label, onClick: onClick, onPointerDown: stopPropagation, onDoubleClick: stopPropagation, style: {
|
|
@@ -114,16 +123,10 @@ const TimelineLayerChildrenToggle = ({ sequence }) => {
|
|
|
114
123
|
idleColor: colors_1.LIGHT_TEXT,
|
|
115
124
|
hoverColor: colors_1.WHITE,
|
|
116
125
|
}),
|
|
126
|
+
...toggleLayout,
|
|
117
127
|
border: 'none',
|
|
118
128
|
padding: 0,
|
|
119
129
|
cursor: 'default',
|
|
120
|
-
display: 'flex',
|
|
121
|
-
alignItems: 'center',
|
|
122
|
-
justifyContent: 'center',
|
|
123
|
-
width: 12,
|
|
124
|
-
height: 16,
|
|
125
|
-
marginRight: 0,
|
|
126
|
-
flexShrink: 0,
|
|
127
130
|
}, children: jsx_runtime_1.jsx(TimelineCollapseToggle_1.TimelineCollapseToggle, { collapsed: isCollapsed, color: "currentColor" }) }));
|
|
128
131
|
};
|
|
129
132
|
exports.TimelineLayerChildrenToggle = TimelineLayerChildrenToggle;
|
|
@@ -44,6 +44,7 @@ const is_current_selected_still_1 = require("../../helpers/is-current-selected-s
|
|
|
44
44
|
const canvas_zoom_1 = require("../../icons/canvas-zoom");
|
|
45
45
|
const timeline_zoom_1 = require("../../state/timeline-zoom");
|
|
46
46
|
const z_index_1 = require("../../state/z-index");
|
|
47
|
+
const ActionTooltip_1 = require("../ActionTooltip");
|
|
47
48
|
const ControlButton_1 = require("../ControlButton");
|
|
48
49
|
const layout_1 = require("../layout");
|
|
49
50
|
const timeline_refs_1 = require("./timeline-refs");
|
|
@@ -123,7 +124,7 @@ const TimelineZoomControlsInner = ({ sliderMaxWidth }) => {
|
|
|
123
124
|
return null;
|
|
124
125
|
}
|
|
125
126
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
126
|
-
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "Zoom out timeline",
|
|
127
|
+
jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Zoom out timeline", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "", "aria-label": "Zoom out timeline", type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomOutIcon, { color: color }) }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(TimelineZoomSlider, { maxWidth: sliderMaxWidth, minZoom: minZoom, timelineViewportWidth: timelineViewportWidth }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Zoom in timeline", shortcut: null, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { onClick: onPlusClicked, style: buttonStyle, title: "", "aria-label": "Zoom in timeline", type: "button", children: (color) => jsx_runtime_1.jsx(canvas_zoom_1.CanvasZoomIcon, { color: color }) }) })
|
|
127
128
|
] }));
|
|
128
129
|
};
|
|
129
130
|
exports.TimelineZoomControls = react_1.default.memo(TimelineZoomControlsInner);
|
|
@@ -95,11 +95,14 @@ const formatNumberTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
|
|
|
95
95
|
const digits = (0, timeline_field_utils_1.getDecimalPlaces)(numericValue);
|
|
96
96
|
return digits === 0 ? String(numericValue) : numericValue.toFixed(digits);
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
// The step controls increments, not the precision of source or typed values.
|
|
99
|
+
// Keep finer values while trimming floating point noise.
|
|
100
|
+
const normalizedValue = (0, timeline_field_utils_1.getDecimalPlaces)(numericValue) > stepDecimals
|
|
101
|
+
? Number(numericValue.toPrecision(15))
|
|
102
|
+
: numericValue;
|
|
103
|
+
return (0, timeline_field_utils_1.getDecimalPlaces)(normalizedValue) > stepDecimals
|
|
104
|
+
? String(normalizedValue)
|
|
105
|
+
: normalizedValue.toFixed(stepDecimals);
|
|
103
106
|
};
|
|
104
107
|
const formatRotationTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
|
|
105
108
|
const configuredStep = fieldSchema.type === 'rotation-css' ||
|
|
@@ -5,6 +5,7 @@ export declare const TimelineCombobox: React.FC<{
|
|
|
5
5
|
readonly values: ComboboxValue[];
|
|
6
6
|
readonly selectedId: string | number;
|
|
7
7
|
readonly title: string;
|
|
8
|
+
readonly tooltipDelay: number | null;
|
|
8
9
|
readonly labelWidth?: number;
|
|
9
10
|
readonly renderLeftItem?: RenderInlineAction;
|
|
10
11
|
readonly unhoveredIconColor?: string;
|
|
@@ -4,6 +4,7 @@ exports.TimelineCombobox = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const colors_1 = require("../helpers/colors");
|
|
6
6
|
const caret_1 = require("../icons/caret");
|
|
7
|
+
const ActionTooltip_1 = require("./ActionTooltip");
|
|
7
8
|
const layout_1 = require("./layout");
|
|
8
9
|
const SegmentedButton_1 = require("./SegmentedButton");
|
|
9
10
|
const segmentedButtonStyle = {
|
|
@@ -21,7 +22,7 @@ const label = {
|
|
|
21
22
|
userSelect: 'none',
|
|
22
23
|
whiteSpace: 'nowrap',
|
|
23
24
|
};
|
|
24
|
-
const TimelineCombobox = ({ values, selectedId, title, labelWidth = 32, renderLeftItem, unhoveredIconColor = colors_1.LIGHT_TEXT, }) => {
|
|
25
|
+
const TimelineCombobox = ({ values, selectedId, title, tooltipDelay, labelWidth = 32, renderLeftItem, unhoveredIconColor = colors_1.LIGHT_TEXT, }) => {
|
|
25
26
|
const selected = values.find((value) => value.id === selectedId);
|
|
26
27
|
const segments = [
|
|
27
28
|
{
|
|
@@ -32,16 +33,19 @@ const TimelineCombobox = ({ values, selectedId, title, labelWidth = 32, renderLe
|
|
|
32
33
|
leaveLeftSpace: true,
|
|
33
34
|
onOpenChange: null,
|
|
34
35
|
renderContent: (color) => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderLeftItem ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderLeftItem(color), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
|
|
35
|
-
] })) : null, selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string'
|
|
36
|
+
] })) : null, selected ? (jsx_runtime_1.jsx("div", { title: tooltipDelay === null && typeof selected.label === 'string'
|
|
37
|
+
? selected.label
|
|
38
|
+
: undefined, style: { ...label, width: labelWidth }, children: selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(caret_1.CaretDown, { color: color })
|
|
36
39
|
] })),
|
|
37
40
|
segmentId: 'selector',
|
|
38
41
|
selectedId,
|
|
39
42
|
style: { fontFamily: 'inherit', padding: '0 4px' },
|
|
40
|
-
title,
|
|
43
|
+
title: tooltipDelay === null ? title : null,
|
|
41
44
|
type: 'menu',
|
|
42
45
|
values,
|
|
43
46
|
},
|
|
44
47
|
];
|
|
45
|
-
|
|
48
|
+
const button = (jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: segments, style: segmentedButtonStyle, title: null }));
|
|
49
|
+
return tooltipDelay === null ? (button) : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: title, shortcut: null, delay: tooltipDelay, dismissOnClick: true, children: button }));
|
|
46
50
|
};
|
|
47
51
|
exports.TimelineCombobox = TimelineCombobox;
|
|
@@ -5,24 +5,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
-
const no_react_1 = require("remotion/no-react");
|
|
9
|
-
const client_id_1 = require("../helpers/client-id");
|
|
10
8
|
const colors_1 = require("../helpers/colors");
|
|
11
9
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
12
11
|
const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
|
|
13
12
|
const in_out_1 = require("../state/in-out");
|
|
13
|
+
const ActionTooltip_1 = require("./ActionTooltip");
|
|
14
14
|
const ControlButton_1 = require("./ControlButton");
|
|
15
|
-
const keyboard_shortcuts_1 = require("./keyboard-shortcuts");
|
|
16
|
-
const getTooltipText = (pointType, action) => {
|
|
17
|
-
const shortcut = (0, keyboard_shortcuts_1.getKeyboardShortcutLabel)(action);
|
|
18
|
-
return [
|
|
19
|
-
`Mark ${pointType}`,
|
|
20
|
-
(0, use_keybinding_1.areKeyboardShortcutsDisabled)() || shortcut === '' ? null : `(${shortcut})`,
|
|
21
|
-
'- right click to clear',
|
|
22
|
-
]
|
|
23
|
-
.filter(no_react_1.NoReactInternals.truthy)
|
|
24
|
-
.join(' ');
|
|
25
|
-
};
|
|
26
15
|
const style = {
|
|
27
16
|
width: 17,
|
|
28
17
|
height: 17,
|
|
@@ -34,7 +23,11 @@ exports.inOutHandles = (0, react_1.createRef)();
|
|
|
34
23
|
exports.defaultInOutValue = { inFrame: null, outFrame: null };
|
|
35
24
|
const TimelineInOutPointToggle = () => {
|
|
36
25
|
var _a;
|
|
37
|
-
(0,
|
|
26
|
+
const inShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('setInPoint');
|
|
27
|
+
const outShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('setOutPoint');
|
|
28
|
+
const inAriaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('setInPoint');
|
|
29
|
+
const outAriaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('setOutPoint');
|
|
30
|
+
const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
|
|
38
31
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
39
32
|
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
40
33
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
@@ -249,7 +242,7 @@ const TimelineInOutPointToggle = () => {
|
|
|
249
242
|
};
|
|
250
243
|
}, [confId, onInMark, onInOutClear, onOutMark]);
|
|
251
244
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
252
|
-
jsx_runtime_1.jsx(
|
|
245
|
+
jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "In point", shortcut: shortcutsDisabled ? null : inShortcut, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": "In point", "aria-description": "Right click to clear", "aria-keyshortcuts": shortcutsDisabled ? undefined : inAriaShortcut || undefined, style: buttonStyle, onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? color : colors_1.BLUE, style: style })) }) }), jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Out point", shortcut: shortcutsDisabled ? null : outShortcut, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: "", "aria-label": "Out point", "aria-description": "Right click to clear", "aria-keyshortcuts": shortcutsDisabled ? undefined : outAriaShortcut || undefined, style: buttonStyle, onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || isLastFrame, children: (color) => (jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? color : colors_1.BLUE, style: style })) }) })
|
|
253
246
|
] }));
|
|
254
247
|
};
|
|
255
248
|
exports.TimelineInOutPointToggle = TimelineInOutPointToggle;
|