@remotion/studio 4.0.522 → 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/api/install-package.js +4 -2
- package/dist/components/ActionTooltip.d.ts +9 -0
- package/dist/components/ActionTooltip.js +143 -0
- package/dist/components/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +8 -8
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +9 -10
- package/dist/components/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/CompositionContextButton.js +4 -1
- package/dist/components/CompositionSelectorItem.js +2 -2
- package/dist/components/ConfigureLicenseModal.js +1 -1
- package/dist/components/CurrentAsset.js +40 -6
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/ElementInstallConfirmation.js +254 -137
- package/dist/components/FixComputedValueModal.js +38 -8
- package/dist/components/FullscreenToggle.js +8 -10
- package/dist/components/GlobalKeybindings.js +107 -49
- package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
- package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
- package/dist/components/InspectorPanel.js +4 -0
- package/dist/components/InspectorSequenceSection.js +69 -6
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- 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 +11 -7
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +3 -1
- package/dist/components/ModelManager.d.ts +16 -0
- package/dist/components/ModelManager.js +200 -0
- package/dist/components/ModelsSettings.d.ts +2 -0
- package/dist/components/ModelsSettings.js +133 -0
- package/dist/components/MuteToggle.d.ts +1 -0
- package/dist/components/MuteToggle.js +16 -6
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +2 -2
- package/dist/components/NewComposition/InputDragger.js +6 -6
- package/dist/components/NewComposition/NewComposition.d.ts +1 -0
- package/dist/components/NewComposition/NewComposition.js +5 -4
- package/dist/components/NewComposition/NewFolder.js +9 -8
- package/dist/components/NewComposition/RenameComposition.js +3 -2
- package/dist/components/NewComposition/RenameFolder.js +15 -10
- package/dist/components/NewComposition/SlugPreview.d.ts +7 -0
- package/dist/components/NewComposition/SlugPreview.js +18 -0
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/OutlineToggle.js +16 -10
- package/dist/components/PlayPause.js +11 -9
- package/dist/components/PlaybackKeyboardShortcutsManager.d.ts +2 -0
- package/dist/components/PlaybackKeyboardShortcutsManager.js +39 -7
- package/dist/components/PlaybackRateSelector.js +2 -2
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/PreviewToolbarOverflowButton.js +19 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
- package/dist/components/RadioButton.d.ts +1 -0
- package/dist/components/RadioButton.js +2 -2
- package/dist/components/RenderButton.js +5 -1
- package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
- package/dist/components/RenderModal/NumberSetting.js +2 -2
- package/dist/components/RenderModal/RenderModalBasic.js +1 -1
- package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
- package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
- package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
- package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/CaptionQueueItem.js +130 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
- 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.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +130 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
- package/dist/components/RenderQueue/caption-job-types.js +7 -0
- package/dist/components/RenderQueue/context.d.ts +16 -0
- package/dist/components/RenderQueue/context.js +224 -11
- package/dist/components/RenderQueue/index.js +34 -10
- package/dist/components/RenderQueue/item-style.d.ts +1 -0
- package/dist/components/RenderQueue/item-style.js +2 -1
- package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
- package/dist/components/RenderQueue/load-model-for-job.js +14 -0
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
- package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
- package/dist/components/RendersTab.js +4 -4
- package/dist/components/RulersAndGuidesToggle.js +7 -1
- package/dist/components/SegmentedControl.d.ts +2 -2
- package/dist/components/SegmentedControl.js +38 -13
- package/dist/components/SelectedOutlinePolygon.js +8 -2
- package/dist/components/SettingsButton.d.ts +4 -0
- package/dist/components/SettingsButton.js +51 -0
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +3 -1
- package/dist/components/ShowOutlinesProvider.js +12 -0
- package/dist/components/SidebarCollapserControls.js +17 -21
- package/dist/components/SizeSelector.js +12 -4
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +9 -8
- package/dist/components/StudioSettings.js +32 -18
- package/dist/components/SyntaxHighlightedSource.d.ts +5 -0
- package/dist/components/SyntaxHighlightedSource.js +78 -0
- package/dist/components/Tabs/vertical.d.ts +1 -0
- package/dist/components/Tabs/vertical.js +2 -2
- package/dist/components/TimeValue.js +2 -3
- package/dist/components/Timeline/SequencePropsObserver.js +4 -0
- package/dist/components/Timeline/Timeline.js +49 -81
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineLayerChildren.js +12 -9
- package/dist/components/Timeline/TimelineRowChrome.js +11 -3
- package/dist/components/Timeline/TimelineSchemaField.js +8 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
- package/dist/components/Timeline/TimelineSelection.js +55 -2
- package/dist/components/Timeline/TimelineSequence.js +75 -17
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +208 -111
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +73 -25
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
- package/dist/components/Timeline/TimelineZoomControls.js +2 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +8 -5
- package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
- package/dist/components/TimelineCombobox.d.ts +1 -0
- package/dist/components/TimelineCombobox.js +8 -4
- package/dist/components/TimelineInOutToggle.js +14 -18
- package/dist/components/Transcription/LazyModels.d.ts +1 -0
- package/dist/components/Transcription/LazyModels.js +5 -0
- package/dist/components/Transcription/Models.d.ts +6 -0
- package/dist/components/Transcription/Models.js +18 -0
- package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
- package/dist/components/Transcription/TranscriptionModal.js +428 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
- package/dist/components/Transcription/caption-output-name.d.ts +2 -0
- package/dist/components/Transcription/caption-output-name.js +10 -0
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
- package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
- package/dist/components/Transcription/whisper-languages.d.ts +2 -0
- package/dist/components/Transcription/whisper-languages.js +104 -0
- package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
- package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
- package/dist/components/UndoRedoButtons.js +13 -38
- package/dist/components/UpdatesSettings.js +8 -12
- package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
- package/dist/components/VideoMatting/LazyModels.js +5 -0
- package/dist/components/VideoMatting/Models.d.ts +6 -0
- package/dist/components/VideoMatting/Models.js +18 -0
- package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
- package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
- package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
- package/dist/components/VideoMatting/video-matting-capability.js +7 -0
- package/dist/components/WebMcp.js +439 -22
- package/dist/components/handle-drop.js +3 -2
- package/dist/components/import-assets.d.ts +3 -2
- package/dist/components/import-assets.js +5 -9
- package/dist/components/keyboard-shortcuts.d.ts +17 -1
- package/dist/components/keyboard-shortcuts.js +191 -89
- package/dist/components/public-output-name.d.ts +5 -0
- package/dist/components/public-output-name.js +60 -0
- package/dist/components/use-model-cache-status.d.ts +7 -0
- package/dist/components/use-model-cache-status.js +35 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -18
- package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/LazyModels-hc33szyn.mjs +11 -0
- package/dist/esm/LazyModels-sg40rjw6.mjs +11 -0
- package/dist/esm/SyntaxHighlightedSource-3xks91rz.mjs +1236 -0
- package/dist/esm/TranscriptionModal-3ctnxpt6.mjs +1011 -0
- package/dist/esm/VideoMattingModal-b0r7e60n.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1b9skrrd.mjs +142 -0
- package/dist/esm/index-2j3d1g81.mjs +261 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9qtvmwtx.mjs +1366 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-c37kme2v.mjs +46209 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-e3zwf3e7.mjs +36 -0
- package/dist/esm/index-er3mh6em.mjs +54688 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-k426ye99.mjs} +4 -1
- package/dist/esm/index-q2epbw93.mjs +423 -0
- package/dist/esm/index-q5xv20xx.mjs +41 -0
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-wbmp5srk.mjs +35 -0
- package/dist/esm/index-yfrysr5f.mjs +1154 -0
- package/dist/esm/index.mjs +45 -933
- package/dist/esm/internals.mjs +13 -114393
- package/dist/esm/previewEntry.mjs +387 -115050
- package/dist/esm/renderEntry.mjs +5 -5
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-bt2d6qxq.mjs} +1 -1
- package/dist/helpers/colors.d.ts +1 -0
- package/dist/helpers/colors.js +4 -3
- package/dist/helpers/drag-aware-double-click.d.ts +2 -1
- package/dist/helpers/drag-aware-double-click.js +12 -1
- package/dist/helpers/get-asset-metadata.d.ts +1 -0
- package/dist/helpers/get-asset-metadata.js +4 -0
- package/dist/helpers/hoverable.js +8 -0
- package/dist/helpers/inject-css.js +2 -0
- package/dist/helpers/optional-package-dependencies.d.ts +3 -0
- package/dist/helpers/optional-package-dependencies.js +24 -0
- package/dist/helpers/pointer-session.d.ts +6 -0
- package/dist/helpers/pointer-session.js +36 -14
- package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -0
- package/dist/helpers/prism-vsc-dark-plus.js +305 -0
- package/dist/helpers/sequence-node-path-mutations.js +11 -0
- package/dist/helpers/slugify-name.d.ts +1 -0
- package/dist/helpers/slugify-name.js +14 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -0
- package/dist/helpers/studio-runtime-config.js +6 -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 +9 -3
- package/dist/helpers/use-keybinding.js +8 -9
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
- package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
- package/dist/helpers/use-menu-structure.js +59 -14
- package/dist/helpers/use-rename-composition.d.ts +1 -0
- package/dist/helpers/use-rename-composition.js +11 -5
- package/dist/icons/input-props.d.ts +1 -1
- package/dist/icons/input-props.js +2 -2
- package/dist/icons/models.d.ts +4 -0
- package/dist/icons/models.js +7 -0
- package/dist/icons/separation.d.ts +4 -0
- package/dist/icons/separation.js +7 -0
- package/dist/icons/skills.js +1 -1
- package/dist/icons/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/renderEntry.js +2 -2
- package/dist/state/modals.d.ts +14 -2
- package/package.json +35 -21
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const get_folder_id_1 = require("../../helpers/get-folder-id");
|
|
8
|
+
const slugify_name_1 = require("../../helpers/slugify-name");
|
|
8
9
|
const validate_folder_rename_1 = require("../../helpers/validate-folder-rename");
|
|
9
10
|
const layout_1 = require("../layout");
|
|
10
11
|
const ModalFooter_1 = require("../ModalFooter");
|
|
@@ -15,6 +16,7 @@ const CodemodFooter_1 = require("./CodemodFooter");
|
|
|
15
16
|
const DismissableModal_1 = require("./DismissableModal");
|
|
16
17
|
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
17
18
|
const RemInput_1 = require("./RemInput");
|
|
19
|
+
const SlugPreview_1 = require("./SlugPreview");
|
|
18
20
|
const ValidationMessage_1 = require("./ValidationMessage");
|
|
19
21
|
const content = {
|
|
20
22
|
padding: 12,
|
|
@@ -36,21 +38,24 @@ const RenameFolder = ({ folderName, parentName, stack }) => {
|
|
|
36
38
|
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
37
39
|
setName(e.target.value);
|
|
38
40
|
}, []);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const slug = (0, slugify_name_1.slugifyName)(newName);
|
|
42
|
+
const folderNameErrMessage = slug
|
|
43
|
+
? (0, validate_folder_rename_1.validateFolderRename)({
|
|
44
|
+
folders,
|
|
45
|
+
newName: slug,
|
|
46
|
+
originalName: folderName,
|
|
47
|
+
parentName,
|
|
48
|
+
})
|
|
49
|
+
: 'Enter a name containing letters or numbers.';
|
|
50
|
+
const valid = folderNameErrMessage === null && folderName !== slug;
|
|
46
51
|
const codemod = (0, react_1.useMemo)(() => {
|
|
47
52
|
return {
|
|
48
53
|
type: 'rename-folder',
|
|
49
54
|
folderName,
|
|
50
55
|
parentName,
|
|
51
|
-
newName,
|
|
56
|
+
newName: slug,
|
|
52
57
|
};
|
|
53
|
-
}, [folderName,
|
|
58
|
+
}, [folderName, slug, parentName]);
|
|
54
59
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
55
60
|
e.preventDefault();
|
|
56
61
|
}, []);
|
|
@@ -59,7 +64,7 @@ const RenameFolder = ({ folderName, parentName, stack }) => {
|
|
|
59
64
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${folderId}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
60
65
|
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
61
66
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
62
|
-
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
67
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), jsx_runtime_1.jsx(SlugPreview_1.SlugPreview, { action: "rename", currentName: folderName, input: newName, slug: slug }), folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
63
68
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: folderNameErrMessage, type: "error" })
|
|
64
69
|
] })) : null] }) })
|
|
65
70
|
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming folder...', errorNotification: 'Could not rename folder', genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlugPreview = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../../helpers/colors");
|
|
6
|
+
const layout_1 = require("../layout");
|
|
7
|
+
const SlugPreview = ({ action, currentName, input, slug }) => {
|
|
8
|
+
if (!slug ||
|
|
9
|
+
slug === input ||
|
|
10
|
+
slug === input.trim() ||
|
|
11
|
+
slug === currentName) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
15
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsxs("div", { "aria-live": "polite", style: { fontSize: 12, color: colors_1.LIGHT_TEXT }, children: ["Will be ", action === 'create' ? 'created as' : 'renamed to', " ", slug] })
|
|
16
|
+
] }));
|
|
17
|
+
};
|
|
18
|
+
exports.SlugPreview = SlugPreview;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const isOptionalPackageInstalled: (packageName: string) => boolean;
|
|
3
|
+
export declare const markOptionalPackageInstalled: (packageName: string) => void;
|
|
4
|
+
export declare const installOptionalPackage: (packageName: string) => Promise<void>;
|
|
5
|
+
export declare const useOptionalPackageInstalled: (packageName: string) => boolean;
|
|
6
|
+
export declare const OptionalPackageModal: React.FC<{
|
|
7
|
+
readonly ariaLabel: string;
|
|
8
|
+
readonly children: React.ReactNode;
|
|
9
|
+
readonly packageName: string;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.OptionalPackageModal = exports.useOptionalPackageInstalled = exports.installOptionalPackage = exports.markOptionalPackageInstalled = exports.isOptionalPackageInstalled = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const install_package_1 = require("../api/install-package");
|
|
40
|
+
const colors_1 = require("../helpers/colors");
|
|
41
|
+
const optional_package_dependencies_1 = require("../helpers/optional-package-dependencies");
|
|
42
|
+
const modals_1 = require("../state/modals");
|
|
43
|
+
const Button_1 = require("./Button");
|
|
44
|
+
const layout_1 = require("./layout");
|
|
45
|
+
const ModalButton_1 = require("./ModalButton");
|
|
46
|
+
const ModalContainer_1 = require("./ModalContainer");
|
|
47
|
+
const ModalFooter_1 = require("./ModalFooter");
|
|
48
|
+
const ModalHeader_1 = require("./ModalHeader");
|
|
49
|
+
const Spinner_1 = require("./Spinner");
|
|
50
|
+
const panelStyle = {
|
|
51
|
+
width: 'min(520px, calc(100vw - 40px))',
|
|
52
|
+
};
|
|
53
|
+
const contentStyle = {
|
|
54
|
+
color: colors_1.WHITE,
|
|
55
|
+
fontFamily: 'sans-serif',
|
|
56
|
+
fontSize: 14,
|
|
57
|
+
lineHeight: 1.5,
|
|
58
|
+
padding: 16,
|
|
59
|
+
};
|
|
60
|
+
const codeStyle = {
|
|
61
|
+
color: 'inherit',
|
|
62
|
+
fontFamily: 'monospace',
|
|
63
|
+
fontSize: 'inherit',
|
|
64
|
+
};
|
|
65
|
+
const statusStyle = {
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
color: colors_1.LIGHT_TEXT,
|
|
68
|
+
display: 'flex',
|
|
69
|
+
fontFamily: 'sans-serif',
|
|
70
|
+
fontSize: 14,
|
|
71
|
+
gap: 10,
|
|
72
|
+
lineHeight: 1.5,
|
|
73
|
+
};
|
|
74
|
+
const errorStyle = {
|
|
75
|
+
color: colors_1.WARNING_COLOR,
|
|
76
|
+
marginTop: 12,
|
|
77
|
+
whiteSpace: 'pre-wrap',
|
|
78
|
+
};
|
|
79
|
+
const cancelStyle = { minWidth: 90 };
|
|
80
|
+
const isOptionalPackageInstalled = (packageName) => {
|
|
81
|
+
var _a;
|
|
82
|
+
var _b;
|
|
83
|
+
return (_b = (_a = window.remotion_installedPackages) === null || _a === void 0 ? void 0 : _a.includes(packageName)) !== null && _b !== void 0 ? _b : false;
|
|
84
|
+
};
|
|
85
|
+
exports.isOptionalPackageInstalled = isOptionalPackageInstalled;
|
|
86
|
+
const OPTIONAL_PACKAGE_INSTALLED_EVENT = 'remotion-optional-package-installed';
|
|
87
|
+
const markOptionalPackageInstalled = (packageName) => {
|
|
88
|
+
var _a;
|
|
89
|
+
window.remotion_installedPackages = Array.from(new Set([...((_a = window.remotion_installedPackages) !== null && _a !== void 0 ? _a : []), packageName]));
|
|
90
|
+
window.dispatchEvent(new CustomEvent(OPTIONAL_PACKAGE_INSTALLED_EVENT, {
|
|
91
|
+
detail: packageName,
|
|
92
|
+
}));
|
|
93
|
+
};
|
|
94
|
+
exports.markOptionalPackageInstalled = markOptionalPackageInstalled;
|
|
95
|
+
const installOptionalPackage = async (packageName) => {
|
|
96
|
+
const dependencies = (0, optional_package_dependencies_1.withRequiredAuxiliaryPackages)([
|
|
97
|
+
{ name: packageName, version: null },
|
|
98
|
+
]);
|
|
99
|
+
await (0, install_package_1.installPackages)(dependencies);
|
|
100
|
+
for (const dependency of dependencies) {
|
|
101
|
+
(0, exports.markOptionalPackageInstalled)(dependency.name);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
exports.installOptionalPackage = installOptionalPackage;
|
|
105
|
+
const useOptionalPackageInstalled = (packageName) => {
|
|
106
|
+
const [installed, setInstalled] = (0, react_1.useState)(() => (0, exports.isOptionalPackageInstalled)(packageName));
|
|
107
|
+
(0, react_1.useEffect)(() => {
|
|
108
|
+
const onInstalled = (event) => {
|
|
109
|
+
if (event.detail === packageName) {
|
|
110
|
+
setInstalled(true);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
window.addEventListener(OPTIONAL_PACKAGE_INSTALLED_EVENT, onInstalled);
|
|
114
|
+
return () => window.removeEventListener(OPTIONAL_PACKAGE_INSTALLED_EVENT, onInstalled);
|
|
115
|
+
}, [packageName]);
|
|
116
|
+
return installed;
|
|
117
|
+
};
|
|
118
|
+
exports.useOptionalPackageInstalled = useOptionalPackageInstalled;
|
|
119
|
+
const OptionalPackageModal = ({ ariaLabel, children, packageName, title }) => {
|
|
120
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
121
|
+
const installed = (0, exports.useOptionalPackageInstalled)(packageName);
|
|
122
|
+
const [installState, setInstallState] = (0, react_1.useState)({
|
|
123
|
+
type: 'idle',
|
|
124
|
+
});
|
|
125
|
+
const busy = installState.type === 'installing';
|
|
126
|
+
const packageNames = (0, optional_package_dependencies_1.withRequiredAuxiliaryPackages)([
|
|
127
|
+
{ name: packageName, version: null },
|
|
128
|
+
]).map((dependency) => dependency.name);
|
|
129
|
+
const packagesLabel = packageNames.join(' and ');
|
|
130
|
+
const dismiss = (0, react_1.useCallback)(() => {
|
|
131
|
+
if (!busy) {
|
|
132
|
+
setSelectedModal(null);
|
|
133
|
+
}
|
|
134
|
+
}, [busy, setSelectedModal]);
|
|
135
|
+
const install = (0, react_1.useCallback)(async () => {
|
|
136
|
+
setInstallState({ type: 'installing' });
|
|
137
|
+
try {
|
|
138
|
+
await (0, exports.installOptionalPackage)(packageName);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
setInstallState({ type: 'error', error: error });
|
|
142
|
+
}
|
|
143
|
+
}, [packageName]);
|
|
144
|
+
if (installed) {
|
|
145
|
+
return children;
|
|
146
|
+
}
|
|
147
|
+
return (jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { ariaLabel: ariaLabel, onEscape: dismiss, onOutsideClick: dismiss, panelStyle: panelStyle, children: [
|
|
148
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: title, onClose: dismiss }), jsx_runtime_1.jsx("div", { style: contentStyle, children: busy ? (jsx_runtime_1.jsxs("div", { style: statusStyle, children: [
|
|
149
|
+
jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: 18 }), `Installing ${packagesLabel}…`] })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["This requires installing", ' ', packageNames.map((name, index) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [index > 0 ? ' and ' : null, jsx_runtime_1.jsx("code", { style: codeStyle, children: name })
|
|
150
|
+
] }, name))), ". Continue?", installState.type === 'error' ? (jsx_runtime_1.jsx("div", { style: errorStyle, children: installState.error.message })) : null] })) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
151
|
+
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(Button_1.Button, { disabled: busy, onClick: dismiss, style: cancelStyle, children: "Cancel" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx(ModalButton_1.ModalButton, { disabled: busy, onClick: install, autoFocus: true, children: installState.type === 'error' ? 'Retry' : 'Continue' })
|
|
152
|
+
] }) })
|
|
153
|
+
] }));
|
|
154
|
+
};
|
|
155
|
+
exports.OptionalPackageModal = OptionalPackageModal;
|
|
@@ -4,25 +4,31 @@ exports.OutlineToggle = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
7
9
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
10
|
+
const ActionTooltip_1 = require("./ActionTooltip");
|
|
8
11
|
const ControlButton_1 = require("./ControlButton");
|
|
9
12
|
const OutlineToggle = () => {
|
|
10
13
|
const { editorShowOutlines, setEditorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
11
14
|
const onClick = (0, react_1.useCallback)(() => {
|
|
12
15
|
setEditorShowOutlines((current) => !current);
|
|
13
16
|
}, [setEditorShowOutlines]);
|
|
17
|
+
const shortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleOutlines');
|
|
18
|
+
const ariaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('toggleOutlines');
|
|
19
|
+
const shortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
|
|
14
20
|
const accessibilityLabel = editorShowOutlines
|
|
15
21
|
? 'Hide outlines'
|
|
16
22
|
: 'Show outlines';
|
|
17
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
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-keyshortcuts": shortcutsDisabled ? undefined : ariaShortcut || undefined, "aria-pressed": editorShowOutlines, onClick: onClick, children: (color) => {
|
|
24
|
+
const iconColor = editorShowOutlines ? colors_1.BLUE : color;
|
|
25
|
+
return (jsx_runtime_1.jsxs("svg", { style: { width: 17, height: 17 }, viewBox: "0 0 512 512", fill: "none", "aria-hidden": "true", focusable: "false", children: [
|
|
26
|
+
jsx_runtime_1.jsx("path", { d: "M64 64H448V448H64V64Z", stroke: iconColor, strokeWidth: "36" }), [
|
|
27
|
+
[16, 16],
|
|
28
|
+
[400, 16],
|
|
29
|
+
[16, 400],
|
|
30
|
+
[400, 400],
|
|
31
|
+
].map(([x, y]) => (jsx_runtime_1.jsx("rect", { x: x, y: y, width: "96", height: "96", rx: "24", fill: colors_1.BACKGROUND_HEX, stroke: iconColor, strokeWidth: "32" }, `${x}-${y}`)))] }));
|
|
32
|
+
} }) }));
|
|
27
33
|
};
|
|
28
34
|
exports.OutlineToggle = OutlineToggle;
|
|
@@ -40,12 +40,14 @@ const react_1 = __importStar(require("react"));
|
|
|
40
40
|
const remotion_1 = require("remotion");
|
|
41
41
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
42
42
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
43
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
43
44
|
const jump_to_start_1 = require("../icons/jump-to-start");
|
|
44
45
|
const pause_1 = require("../icons/pause");
|
|
45
46
|
const play_1 = require("../icons/play");
|
|
46
47
|
const step_back_1 = require("../icons/step-back");
|
|
47
48
|
const step_forward_1 = require("../icons/step-forward");
|
|
48
49
|
const in_out_1 = require("../state/in-out");
|
|
50
|
+
const ActionTooltip_1 = require("./ActionTooltip");
|
|
49
51
|
const ControlButton_1 = require("./ControlButton");
|
|
50
52
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
51
53
|
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
@@ -82,6 +84,10 @@ const PlayPauseInner = ({ playbackRate, loop, bufferStateDelayInMilliseconds, mu
|
|
|
82
84
|
const { play, pause, pauseAndReturnToPlayStart, frameBack, seek, frameForward, emitter, getCurrentFrame, } = player_1.PlayerInternals.usePlayerMethods();
|
|
83
85
|
const playing = remotion_1.Internals.usePlaying();
|
|
84
86
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
87
|
+
const jumpToBeginningShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('jumpToBeginning');
|
|
88
|
+
const jumpToBeginningAriaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('jumpToBeginning');
|
|
89
|
+
const playPauseShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('playPause');
|
|
90
|
+
const playPauseAriaShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('playPause');
|
|
85
91
|
(0, react_1.useEffect)(() => {
|
|
86
92
|
if (isStill) {
|
|
87
93
|
pause();
|
|
@@ -147,36 +153,32 @@ const PlayPauseInner = ({ playbackRate, loop, bufferStateDelayInMilliseconds, mu
|
|
|
147
153
|
});
|
|
148
154
|
const space = keybindings.registerKeybinding({
|
|
149
155
|
event: 'keydown',
|
|
150
|
-
|
|
156
|
+
action: 'playPause',
|
|
151
157
|
callback: onSpace,
|
|
152
|
-
commandCtrlKey: false,
|
|
153
158
|
preventDefault: true,
|
|
154
159
|
triggerIfInputFieldFocused: false,
|
|
155
160
|
keepRegisteredWhenNotHighestContext: false,
|
|
156
161
|
});
|
|
157
162
|
const enter = keybindings.registerKeybinding({
|
|
158
163
|
event: 'keydown',
|
|
159
|
-
|
|
164
|
+
action: 'pauseAndReturnToPlaybackStart',
|
|
160
165
|
callback: onEnter,
|
|
161
|
-
commandCtrlKey: false,
|
|
162
166
|
preventDefault: false,
|
|
163
167
|
triggerIfInputFieldFocused: false,
|
|
164
168
|
keepRegisteredWhenNotHighestContext: false,
|
|
165
169
|
});
|
|
166
170
|
const a = keybindings.registerKeybinding({
|
|
167
171
|
event: 'keydown',
|
|
168
|
-
|
|
172
|
+
action: 'jumpToBeginning',
|
|
169
173
|
callback: jumpToStart,
|
|
170
|
-
commandCtrlKey: false,
|
|
171
174
|
preventDefault: true,
|
|
172
175
|
triggerIfInputFieldFocused: false,
|
|
173
176
|
keepRegisteredWhenNotHighestContext: false,
|
|
174
177
|
});
|
|
175
178
|
const e = keybindings.registerKeybinding({
|
|
176
179
|
event: 'keydown',
|
|
177
|
-
|
|
180
|
+
action: 'jumpToEnd',
|
|
178
181
|
callback: jumpToEnd,
|
|
179
|
-
commandCtrlKey: false,
|
|
180
182
|
preventDefault: true,
|
|
181
183
|
triggerIfInputFieldFocused: false,
|
|
182
184
|
keepRegisteredWhenNotHighestContext: false,
|
|
@@ -233,6 +235,6 @@ const PlayPauseInner = ({ playbackRate, loop, bufferStateDelayInMilliseconds, mu
|
|
|
233
235
|
};
|
|
234
236
|
}, [bufferStateDelayInMilliseconds, emitter]);
|
|
235
237
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
236
|
-
jsx_runtime_1.jsx(PlaybackManager, { loop: loop, playbackRate: playbackRate, muted: muted, inFrame: inFrame, outFrame: outFrame, getCurrentFrame: getCurrentFrame }), hideNavigationControls ? null : (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "
|
|
238
|
+
jsx_runtime_1.jsx(PlaybackManager, { loop: loop, playbackRate: playbackRate, muted: muted, inFrame: inFrame, outFrame: outFrame, getCurrentFrame: getCurrentFrame }), hideNavigationControls ? null : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Go to beginning", shortcut: jumpToBeginningShortcut, delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Go to beginning", "aria-keyshortcuts": jumpToBeginningAriaShortcut || undefined, title: "", disabled: !videoConfig, onClick: jumpToStart, children: (color) => jsx_runtime_1.jsx(jump_to_start_1.JumpToStart, { style: backStyle, color: color }) }) })), hideNavigationControls ? null : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Go back 1 frame", shortcut: "\u2190", delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Go back 1 frame", "aria-keyshortcuts": "ArrowLeft", title: "", disabled: !videoConfig, onClick: oneFrameBack, children: (color) => jsx_runtime_1.jsx(step_back_1.StepBack, { style: forwardBackStyle, color: color }) }) })), jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: playing ? 'Pause' : 'Play', shortcut: playPauseShortcut, delay: 800, dismissOnClick: false, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', "aria-keyshortcuts": playPauseAriaShortcut || undefined, title: "", onClick: playing ? pause : play, disabled: !videoConfig, children: (color) => playing ? (showBufferIndicator ? (jsx_runtime_1.jsx(player_1.PlayerInternals.BufferingIndicator, { type: "studio", color: color })) : (jsx_runtime_1.jsx(pause_1.Pause, { style: iconButton, color: color }))) : (jsx_runtime_1.jsx(play_1.Play, { style: iconButton, color: color })) }) }), hideNavigationControls ? null : (jsx_runtime_1.jsx(ActionTooltip_1.ActionTooltip, { label: "Go forward 1 frame", shortcut: "\u2192", delay: 800, dismissOnClick: true, children: jsx_runtime_1.jsx(ControlButton_1.ControlButton, { "aria-label": "Go forward 1 frame", "aria-keyshortcuts": "ArrowRight", title: "", disabled: !videoConfig, onClick: oneFrameForward, children: (color) => jsx_runtime_1.jsx(step_forward_1.StepForward, { style: forwardBackStyle, color: color }) }) }))] }));
|
|
237
239
|
};
|
|
238
240
|
exports.PlayPause = react_1.default.memo(PlayPauseInner);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
export declare const PlaybackKeyboardShortcutsManager: React.FC<{
|
|
3
3
|
readonly setPlaybackRate: React.Dispatch<React.SetStateAction<number>>;
|
|
4
|
+
readonly setMuted: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
readonly setLoop: React.Dispatch<React.SetStateAction<boolean>>;
|
|
4
6
|
}>;
|
|
@@ -3,9 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PlaybackKeyboardShortcutsManager = void 0;
|
|
4
4
|
const player_1 = require("@remotion/player");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
6
7
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
7
|
-
const
|
|
8
|
+
const LoopToggle_1 = require("./LoopToggle");
|
|
9
|
+
const MuteToggle_1 = require("./MuteToggle");
|
|
10
|
+
const PlaybackKeyboardShortcutsManager = ({ setPlaybackRate, setMuted, setLoop }) => {
|
|
8
11
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
12
|
+
const isVideoComposition = (0, is_current_selected_still_1.useIsVideoComposition)();
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
14
|
+
if (!isVideoComposition) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const mute = keybindings.registerKeybinding({
|
|
18
|
+
event: 'keydown',
|
|
19
|
+
action: 'toggleMute',
|
|
20
|
+
callback: (event) => {
|
|
21
|
+
if (!event.repeat)
|
|
22
|
+
(0, MuteToggle_1.toggleMute)(setMuted);
|
|
23
|
+
},
|
|
24
|
+
preventDefault: true,
|
|
25
|
+
triggerIfInputFieldFocused: false,
|
|
26
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
27
|
+
});
|
|
28
|
+
const loop = keybindings.registerKeybinding({
|
|
29
|
+
event: 'keydown',
|
|
30
|
+
action: 'toggleLoop',
|
|
31
|
+
callback: (event) => {
|
|
32
|
+
if (!event.repeat)
|
|
33
|
+
(0, LoopToggle_1.toggleLoop)(setLoop);
|
|
34
|
+
},
|
|
35
|
+
preventDefault: true,
|
|
36
|
+
triggerIfInputFieldFocused: false,
|
|
37
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
38
|
+
});
|
|
39
|
+
return () => {
|
|
40
|
+
mute.unregister();
|
|
41
|
+
loop.unregister();
|
|
42
|
+
};
|
|
43
|
+
}, [isVideoComposition, keybindings, setLoop, setMuted]);
|
|
9
44
|
const { play, pause, isPlaying } = player_1.PlayerInternals.usePlayerMethods();
|
|
10
45
|
const onJKey = (0, react_1.useCallback)(() => {
|
|
11
46
|
const wasPlaying = isPlaying();
|
|
@@ -46,27 +81,24 @@ const PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
|
|
|
46
81
|
(0, react_1.useEffect)(() => {
|
|
47
82
|
const jKey = keybindings.registerKeybinding({
|
|
48
83
|
event: 'keydown',
|
|
49
|
-
|
|
84
|
+
action: 'reversePlayback',
|
|
50
85
|
callback: onJKey,
|
|
51
|
-
commandCtrlKey: false,
|
|
52
86
|
preventDefault: true,
|
|
53
87
|
triggerIfInputFieldFocused: false,
|
|
54
88
|
keepRegisteredWhenNotHighestContext: false,
|
|
55
89
|
});
|
|
56
90
|
const kKey = keybindings.registerKeybinding({
|
|
57
91
|
event: 'keydown',
|
|
58
|
-
|
|
92
|
+
action: 'pausePlayback',
|
|
59
93
|
callback: onKKey,
|
|
60
|
-
commandCtrlKey: false,
|
|
61
94
|
preventDefault: true,
|
|
62
95
|
triggerIfInputFieldFocused: false,
|
|
63
96
|
keepRegisteredWhenNotHighestContext: false,
|
|
64
97
|
});
|
|
65
98
|
const lKey = keybindings.registerKeybinding({
|
|
66
99
|
event: 'keydown',
|
|
67
|
-
|
|
100
|
+
action: 'playForward',
|
|
68
101
|
callback: onLKey,
|
|
69
|
-
commandCtrlKey: false,
|
|
70
102
|
preventDefault: true,
|
|
71
103
|
triggerIfInputFieldFocused: false,
|
|
72
104
|
keepRegisteredWhenNotHighestContext: false,
|
|
@@ -13,7 +13,7 @@ const TimelineCombobox_1 = require("./TimelineCombobox");
|
|
|
13
13
|
const getPlaybackRateLabel = (playbackRate) => {
|
|
14
14
|
return `${playbackRate}x`;
|
|
15
15
|
};
|
|
16
|
-
const accessibilityLabel = '
|
|
16
|
+
const accessibilityLabel = 'Playback rate';
|
|
17
17
|
const usePlaybackRateMenuItems = ({ playbackRate, setPlaybackRate, }) => {
|
|
18
18
|
const items = (0, react_1.useMemo)(() => {
|
|
19
19
|
const divider = {
|
|
@@ -57,6 +57,6 @@ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate, }) => {
|
|
|
57
57
|
if (isStill || canvasContent === null) {
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
|
-
return (jsx_runtime_1.jsx(TimelineCombobox_1.TimelineCombobox, { title: accessibilityLabel, labelWidth: 30, selectedId: selectedId, values: items, renderLeftItem: (color) => (jsx_runtime_1.jsx(playback_rate_1.PlaybackRateIcon, { color: color, playbackRate: playbackRate })), unhoveredIconColor: colors_1.WHITE_ALPHA_80 }));
|
|
60
|
+
return (jsx_runtime_1.jsx(TimelineCombobox_1.TimelineCombobox, { title: accessibilityLabel, tooltipDelay: 800, labelWidth: 30, selectedId: selectedId, values: items, renderLeftItem: (color) => (jsx_runtime_1.jsx(playback_rate_1.PlaybackRateIcon, { color: color, playbackRate: playbackRate })), unhoveredIconColor: colors_1.WHITE_ALPHA_80 }));
|
|
61
61
|
};
|
|
62
62
|
exports.PlaybackRateSelector = PlaybackRateSelector;
|
|
@@ -99,7 +99,7 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
99
99
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.25 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SnappingToggle_1.SnappingToggle, {}) })
|
|
100
100
|
] }))] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, { hidden: isMobileLayout }) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
101
101
|
jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout ? null : jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio, size: "compact", narrow: isMobileLayout }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
102
|
-
] }), jsx_runtime_1.jsx(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), jsx_runtime_1.jsx(PlaybackRatePersistor_1.PlaybackRatePersistor, {})
|
|
102
|
+
] }), jsx_runtime_1.jsx(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate, setMuted: setPlayerMuted, setLoop: setLoop }), jsx_runtime_1.jsx(PlaybackRatePersistor_1.PlaybackRatePersistor, {})
|
|
103
103
|
] }));
|
|
104
104
|
};
|
|
105
105
|
exports.PreviewToolbar = PreviewToolbar;
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
8
9
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
9
10
|
const ellipsis_1 = require("../icons/ellipsis");
|
|
10
11
|
const checkerboard_1 = require("../state/checkerboard");
|
|
@@ -21,6 +22,10 @@ const clickButton = (id) => {
|
|
|
21
22
|
};
|
|
22
23
|
const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLoop, showCanvasViewControls, showCompositionControls, playbackRate, setPlaybackRate, loop, setLoop, }) => {
|
|
23
24
|
const keyboardShortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
|
|
25
|
+
const fullscreenShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('enterFullscreen');
|
|
26
|
+
const loopShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleLoop');
|
|
27
|
+
const outlinesShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleOutlines');
|
|
28
|
+
const checkerboardShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleCheckerboard');
|
|
24
29
|
const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
25
30
|
const { editorShowOutlines, setEditorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
26
31
|
const { editorShowGuides, setEditorShowGuides } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
|
|
@@ -80,7 +85,9 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
80
85
|
label: 'Loop',
|
|
81
86
|
value: 'loop',
|
|
82
87
|
onClick: () => (0, LoopToggle_1.toggleLoop)(setLoop),
|
|
83
|
-
keyHint:
|
|
88
|
+
keyHint: keyboardShortcutsDisabled || loopShortcut === ''
|
|
89
|
+
? null
|
|
90
|
+
: loopShortcut,
|
|
84
91
|
leftItem: loop ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
85
92
|
subMenu: null,
|
|
86
93
|
quickSwitcherLabel: null,
|
|
@@ -93,7 +100,9 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
93
100
|
label: 'Transparency as checkerboard',
|
|
94
101
|
value: 'checkerboard',
|
|
95
102
|
onClick: () => setCheckerboard((current) => !current),
|
|
96
|
-
keyHint: keyboardShortcutsDisabled
|
|
103
|
+
keyHint: keyboardShortcutsDisabled || checkerboardShortcut === ''
|
|
104
|
+
? null
|
|
105
|
+
: checkerboardShortcut,
|
|
97
106
|
leftItem: checkerboard ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
98
107
|
subMenu: null,
|
|
99
108
|
quickSwitcherLabel: null,
|
|
@@ -106,7 +115,7 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
106
115
|
label: 'Outlines',
|
|
107
116
|
value: 'outlines',
|
|
108
117
|
onClick: () => setEditorShowOutlines((current) => !current),
|
|
109
|
-
keyHint: null,
|
|
118
|
+
keyHint: keyboardShortcutsDisabled ? null : outlinesShortcut || null,
|
|
110
119
|
leftItem: editorShowOutlines ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
111
120
|
subMenu: null,
|
|
112
121
|
quickSwitcherLabel: null,
|
|
@@ -145,7 +154,9 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
145
154
|
label: 'Fullscreen',
|
|
146
155
|
value: 'fullscreen',
|
|
147
156
|
onClick: () => clickButton('fullscreen-toggle'),
|
|
148
|
-
keyHint: keyboardShortcutsDisabled
|
|
157
|
+
keyHint: keyboardShortcutsDisabled || fullscreenShortcut === ''
|
|
158
|
+
? null
|
|
159
|
+
: fullscreenShortcut,
|
|
149
160
|
leftItem: null,
|
|
150
161
|
subMenu: null,
|
|
151
162
|
quickSwitcherLabel: null,
|
|
@@ -153,6 +164,9 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
153
164
|
}
|
|
154
165
|
return items;
|
|
155
166
|
}, [
|
|
167
|
+
checkerboardShortcut,
|
|
168
|
+
fullscreenShortcut,
|
|
169
|
+
loopShortcut,
|
|
156
170
|
previewSizeItems,
|
|
157
171
|
playbackRateItems,
|
|
158
172
|
selectedPlaybackRate,
|
|
@@ -166,6 +180,7 @@ const PreviewToolbarOverflowButton = ({ showFullscreen, showPlaybackRate, showLo
|
|
|
166
180
|
checkerboard,
|
|
167
181
|
editorShowGuides,
|
|
168
182
|
editorShowOutlines,
|
|
183
|
+
outlinesShortcut,
|
|
169
184
|
editorShowRulers,
|
|
170
185
|
setCheckerboard,
|
|
171
186
|
setEditorShowGuides,
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ExplorerQuickSwitcherTrigger = 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");
|
|
7
6
|
const colors_1 = require("../../helpers/colors");
|
|
8
7
|
const hoverable_1 = require("../../helpers/hoverable");
|
|
9
8
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
9
|
+
const use_keyboard_shortcut_label_1 = require("../../helpers/use-keyboard-shortcut-label");
|
|
10
10
|
const ellipsis_1 = require("../../icons/ellipsis");
|
|
11
11
|
const modals_1 = require("../../state/modals");
|
|
12
12
|
const InlineDropdown_1 = require("../InlineDropdown");
|
|
@@ -60,8 +60,11 @@ const ExplorerQuickSwitcherTrigger = ({ mode, showShortcut, tabIndex, getActions
|
|
|
60
60
|
return jsx_runtime_1.jsx(ellipsis_1.EllipsisIcon, { svgProps: ellipsisSvgProps, fill: color });
|
|
61
61
|
}, []);
|
|
62
62
|
const moreActionsTitle = mode === 'assets' ? 'More asset actions' : 'More composition actions';
|
|
63
|
+
const quickSwitcherShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('quickSwitcher');
|
|
63
64
|
return (jsx_runtime_1.jsxs("div", { style: quickSwitcherArea, children: [
|
|
64
|
-
jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, children: ["Search...", showShortcut &&
|
|
65
|
+
jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, children: ["Search...", showShortcut &&
|
|
66
|
+
!(0, use_keybinding_1.areKeyboardShortcutsDisabled)() &&
|
|
67
|
+
quickSwitcherShortcut !== '' ? (jsx_runtime_1.jsx("span", { style: shortcutLabel, children: quickSwitcherShortcut })) : null] }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { variant: null, title: moreActionsTitle, renderAction: renderMoreActions, getItems: getActions, className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME })
|
|
65
68
|
] }));
|
|
66
69
|
};
|
|
67
70
|
exports.ExplorerQuickSwitcherTrigger = ExplorerQuickSwitcherTrigger;
|
|
@@ -54,8 +54,8 @@ const label = {
|
|
|
54
54
|
fontSize: 14,
|
|
55
55
|
lineHeight: '20px',
|
|
56
56
|
};
|
|
57
|
-
const RadioButton = ({ checked, children, onClick }) => {
|
|
58
|
-
return (jsx_runtime_1.jsxs("button", { "aria-checked": checked, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: onClick, role: "radio", style: row, type: "button", children: [
|
|
57
|
+
const RadioButton = ({ checked, disabled, children, onClick }) => {
|
|
58
|
+
return (jsx_runtime_1.jsxs("button", { "aria-checked": checked, disabled: disabled, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: onClick, role: "radio", style: row, type: "button", children: [
|
|
59
59
|
jsx_runtime_1.jsx("span", { style: circle, children: checked ? jsx_runtime_1.jsx("span", { style: bullet }) : null }), jsx_runtime_1.jsx("span", { style: label, children: children })
|
|
60
60
|
] }));
|
|
61
61
|
};
|