@remotion/studio 4.0.522 → 4.0.523
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/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +5 -6
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +8 -6
- 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 +287 -135
- package/dist/components/FixComputedValueModal.js +38 -8
- package/dist/components/FullscreenToggle.js +9 -8
- package/dist/components/GlobalKeybindings.js +50 -49
- package/dist/components/HighlightedElementSource.d.ts +5 -0
- package/dist/components/HighlightedElementSource.js +78 -0
- 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 +64 -1
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- package/dist/components/MenuToolbar.js +7 -5
- 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/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/NewFolder.js +11 -8
- package/dist/components/NewComposition/RenameFolder.js +17 -10
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/PlayPause.js +4 -8
- package/dist/components/PlaybackKeyboardShortcutsManager.js +3 -6
- package/dist/components/PreviewToolbarOverflowButton.js +11 -2
- 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 +129 -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/RenderQueueItem.js +3 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +129 -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/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 +49 -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 +10 -11
- package/dist/components/SizeSelector.js +10 -2
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +5 -2
- 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 +2 -42
- 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/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/use-asset-timeline-context-menu.d.ts +2 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
- package/dist/components/TimelineInOutToggle.js +20 -17
- 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/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 +177 -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/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/HighlightedElementSource-jfc66k4p.mjs +1236 -0
- package/dist/esm/LazyModels-2trdm224.mjs +11 -0
- package/dist/esm/LazyModels-fjb5ckaq.mjs +11 -0
- package/dist/esm/TranscriptionModal-916jqhry.mjs +1011 -0
- package/dist/esm/VideoMattingModal-2tm79s9b.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1x7bsdh6.mjs +261 -0
- package/dist/esm/index-3hgr6gjx.mjs +41 -0
- package/dist/esm/index-5qddp5h7.mjs +36 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-6cvm9a65.mjs +45923 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-czwvnn9g.mjs +35 -0
- package/dist/esm/index-hy4xcgty.mjs +1366 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-jg13hf2g.mjs} +3 -1
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-sgtmgc4h.mjs +423 -0
- package/dist/esm/index-te66vvrp.mjs +142 -0
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-x7t2y7ws.mjs +54194 -0
- package/dist/esm/index-xhe2m2qr.mjs +1146 -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 +3 -3
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
- 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-tomorrow.d.ts +1 -0
- package/dist/helpers/prism-tomorrow.js +151 -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-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 +58 -13
- 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/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/state/modals.d.ts +14 -2
- package/package.json +34 -20
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
BACKGROUND_HEX,
|
|
3
3
|
TRANSPARENT,
|
|
4
4
|
WHITE
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./index-jg13hf2g.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__require,
|
|
8
8
|
__toESM
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./index-rcv7qkt5.mjs";
|
|
10
10
|
|
|
11
11
|
// src/renderEntry.tsx
|
|
12
12
|
import { useContext, useEffect, useRef, useState } from "react";
|
|
@@ -215,7 +215,7 @@ var renderContent = (Root) => {
|
|
|
215
215
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
216
216
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
217
217
|
}));
|
|
218
|
-
import("./
|
|
218
|
+
import("./internals.mjs").then(({ StudioInternals }) => {
|
|
219
219
|
window.remotion_isStudio = true;
|
|
220
220
|
window.remotion_isReadOnlyStudio = true;
|
|
221
221
|
window.remotion_inputProps = "{}";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type DragAwareDoubleClickTracker = {
|
|
2
|
-
readonly beginPointerGesture: () => void;
|
|
2
|
+
readonly beginPointerGesture: (event: Pick<PointerEvent, 'button'>) => void;
|
|
3
3
|
readonly endPointerGesture: (wasDragged: boolean) => void;
|
|
4
4
|
readonly consumePointerGestureWasDragged: () => boolean;
|
|
5
|
+
readonly acceptClickAsDoubleClick: (event: Pick<MouseEvent, 'button' | 'detail'>) => boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const createDragAwareDoubleClickTracker: () => DragAwareDoubleClickTracker;
|
|
@@ -3,9 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createDragAwareDoubleClickTracker = void 0;
|
|
4
4
|
const createDragAwareDoubleClickTracker = () => {
|
|
5
5
|
let pointerGestureWasDragged = false;
|
|
6
|
+
let previousPointerButton = null;
|
|
7
|
+
let currentPointerButton = null;
|
|
6
8
|
return {
|
|
7
|
-
beginPointerGesture: () => {
|
|
9
|
+
beginPointerGesture: (event) => {
|
|
8
10
|
pointerGestureWasDragged = false;
|
|
11
|
+
previousPointerButton = currentPointerButton;
|
|
12
|
+
currentPointerButton = event.button;
|
|
9
13
|
},
|
|
10
14
|
endPointerGesture: (wasDragged) => {
|
|
11
15
|
pointerGestureWasDragged = wasDragged;
|
|
@@ -15,6 +19,13 @@ const createDragAwareDoubleClickTracker = () => {
|
|
|
15
19
|
pointerGestureWasDragged = false;
|
|
16
20
|
return wasDragged;
|
|
17
21
|
},
|
|
22
|
+
acceptClickAsDoubleClick: (event) => {
|
|
23
|
+
return (event.button === 0 &&
|
|
24
|
+
event.detail > 0 &&
|
|
25
|
+
event.detail % 2 === 0 &&
|
|
26
|
+
(event.detail > 2 ||
|
|
27
|
+
(previousPointerButton === 0 && currentPointerButton === 0)));
|
|
28
|
+
},
|
|
18
29
|
};
|
|
19
30
|
};
|
|
20
31
|
exports.createDragAwareDoubleClickTracker = createDragAwareDoubleClickTracker;
|
|
@@ -34,6 +34,10 @@ const getAssetPreviewMetadata = ({ canvasContent, metadata, }) => {
|
|
|
34
34
|
: 30;
|
|
35
35
|
return {
|
|
36
36
|
asset: canvasContent.asset,
|
|
37
|
+
src: (0, add_asset_cache_bust_1.addAssetCacheBust)({
|
|
38
|
+
src: (0, remotion_1.staticFile)(canvasContent.asset),
|
|
39
|
+
fetchedAt: metadata.fetchedAt,
|
|
40
|
+
}),
|
|
37
41
|
width: dimensions.width,
|
|
38
42
|
height: dimensions.height,
|
|
39
43
|
fps,
|
|
@@ -49,6 +49,10 @@ const makeHoverableCSS = () => `
|
|
|
49
49
|
color: var(${COLOR_VARIABLE}, inherit);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
${hoverGroup} ${reveal} {
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
@media (hover: hover) {
|
|
53
57
|
${hoverable}:hover {
|
|
54
58
|
background-color: var(${HOVER_BG_VARIABLE}, var(${BG_VARIABLE}, ${colors_1.TRANSPARENT}));
|
|
@@ -69,10 +73,14 @@ const makeHoverableCSS = () => `
|
|
|
69
73
|
|
|
70
74
|
${hoverGroup} ${reveal} {
|
|
71
75
|
opacity: 0;
|
|
76
|
+
width: 0;
|
|
77
|
+
overflow: hidden;
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
${hoverGroup}:hover ${reveal} {
|
|
75
81
|
opacity: 1;
|
|
82
|
+
width: auto;
|
|
83
|
+
overflow: visible;
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
86
|
`;
|
|
@@ -5,6 +5,7 @@ const remotion_1 = require("remotion");
|
|
|
5
5
|
const scroll_to_default_props_path_1 = require("../components/RenderModal/SchemaEditor/scroll-to-default-props-path");
|
|
6
6
|
const colors_1 = require("./colors");
|
|
7
7
|
const hoverable_1 = require("./hoverable");
|
|
8
|
+
const prism_tomorrow_1 = require("./prism-tomorrow");
|
|
8
9
|
const makeDefaultGlobalCSS = () => {
|
|
9
10
|
const dragAreaFactor = 2;
|
|
10
11
|
const fromMiddle = 50 / dragAreaFactor;
|
|
@@ -167,6 +168,7 @@ const injectCSS = () => {
|
|
|
167
168
|
if (injected) {
|
|
168
169
|
return;
|
|
169
170
|
}
|
|
171
|
+
remotion_1.Internals.CSSUtils.injectCSS(prism_tomorrow_1.prismTomorrow);
|
|
170
172
|
remotion_1.Internals.CSSUtils.injectCSS(makeDefaultGlobalCSS());
|
|
171
173
|
injected = true;
|
|
172
174
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withRequiredAuxiliaryPackages = exports.TRANSFORMERS_PACKAGE = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
exports.TRANSFORMERS_PACKAGE = '@huggingface/transformers';
|
|
6
|
+
const packagesRequiringTransformers = new Set([
|
|
7
|
+
'@remotion/whisper-webgpu',
|
|
8
|
+
'@remotion/video-matting',
|
|
9
|
+
]);
|
|
10
|
+
const withRequiredAuxiliaryPackages = (dependencies) => {
|
|
11
|
+
if (!dependencies.some((dependency) => packagesRequiringTransformers.has(dependency.name)) ||
|
|
12
|
+
dependencies.some((dependency) => dependency.name === exports.TRANSFORMERS_PACKAGE)) {
|
|
13
|
+
return [...dependencies];
|
|
14
|
+
}
|
|
15
|
+
const transformers = studio_shared_1.extraPackages.find((pkg) => pkg.name === exports.TRANSFORMERS_PACKAGE);
|
|
16
|
+
if (!transformers) {
|
|
17
|
+
throw new Error(`No recommended version found for ${exports.TRANSFORMERS_PACKAGE}`);
|
|
18
|
+
}
|
|
19
|
+
return [
|
|
20
|
+
...dependencies,
|
|
21
|
+
{ name: transformers.name, version: transformers.version },
|
|
22
|
+
];
|
|
23
|
+
};
|
|
24
|
+
exports.withRequiredAuxiliaryPackages = withRequiredAuxiliaryPackages;
|
|
@@ -6,6 +6,12 @@ export declare const startCapturedPointerSession: ({ event, captureTarget, onMov
|
|
|
6
6
|
onMove?: ((event: PointerEvent) => void) | undefined;
|
|
7
7
|
onEnd: (reason: PointerSessionEndReason, event: PointerEvent | null) => void;
|
|
8
8
|
}) => () => void;
|
|
9
|
+
export declare const startDeferredCapturedPointerSession: ({ event, captureTarget, onMove, onEnd, }: {
|
|
10
|
+
event: PointerSessionEvent;
|
|
11
|
+
captureTarget: Element;
|
|
12
|
+
onMove: (event: PointerEvent, capturePointer: () => void) => void;
|
|
13
|
+
onEnd: (reason: PointerSessionEndReason, event: PointerEvent | null) => void;
|
|
14
|
+
}) => () => void;
|
|
9
15
|
export declare const observePointerRelease: ({ event, onEnd, }: {
|
|
10
16
|
event: PointerSessionEvent;
|
|
11
17
|
onEnd: (reason: PointerSessionEndReason, event: PointerEvent | null) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.observePointerRelease = exports.startCapturedPointerSession = void 0;
|
|
3
|
+
exports.observePointerRelease = exports.startDeferredCapturedPointerSession = exports.startCapturedPointerSession = void 0;
|
|
4
4
|
const getButtonMask = (button) => {
|
|
5
5
|
if (button === 0) {
|
|
6
6
|
return 1;
|
|
@@ -14,10 +14,24 @@ const getButtonMask = (button) => {
|
|
|
14
14
|
return 1 << button;
|
|
15
15
|
};
|
|
16
16
|
const startPointerSession = ({ event, captureTarget, onMove, onEnd, }) => {
|
|
17
|
-
var _a;
|
|
18
17
|
const { pointerId } = event;
|
|
19
18
|
const buttonMask = getButtonMask(event.button);
|
|
20
19
|
let ended = false;
|
|
20
|
+
let activeCaptureTarget = null;
|
|
21
|
+
const capturePointer = (target) => {
|
|
22
|
+
var _a;
|
|
23
|
+
if (activeCaptureTarget !== null) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
activeCaptureTarget = target;
|
|
27
|
+
try {
|
|
28
|
+
(_a = target.setPointerCapture) === null || _a === void 0 ? void 0 : _a.call(target, pointerId);
|
|
29
|
+
}
|
|
30
|
+
catch (_b) {
|
|
31
|
+
// Capture is best-effort for detached targets.
|
|
32
|
+
}
|
|
33
|
+
target.addEventListener('lostpointercapture', handleLostPointerCapture);
|
|
34
|
+
};
|
|
21
35
|
const cleanup = () => {
|
|
22
36
|
var _a;
|
|
23
37
|
window.removeEventListener('pointermove', handleMove);
|
|
@@ -25,10 +39,10 @@ const startPointerSession = ({ event, captureTarget, onMove, onEnd, }) => {
|
|
|
25
39
|
window.removeEventListener('pointercancel', handleCancel);
|
|
26
40
|
window.removeEventListener('blur', handleBlur);
|
|
27
41
|
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
28
|
-
|
|
29
|
-
if ((_a =
|
|
42
|
+
activeCaptureTarget === null || activeCaptureTarget === void 0 ? void 0 : activeCaptureTarget.removeEventListener('lostpointercapture', handleLostPointerCapture);
|
|
43
|
+
if ((_a = activeCaptureTarget === null || activeCaptureTarget === void 0 ? void 0 : activeCaptureTarget.hasPointerCapture) === null || _a === void 0 ? void 0 : _a.call(activeCaptureTarget, pointerId)) {
|
|
30
44
|
try {
|
|
31
|
-
|
|
45
|
+
activeCaptureTarget.releasePointerCapture(pointerId);
|
|
32
46
|
}
|
|
33
47
|
catch (_b) {
|
|
34
48
|
// The browser may already have released capture.
|
|
@@ -51,7 +65,7 @@ const startPointerSession = ({ event, captureTarget, onMove, onEnd, }) => {
|
|
|
51
65
|
end('buttons-released', moveEvent);
|
|
52
66
|
return;
|
|
53
67
|
}
|
|
54
|
-
onMove === null || onMove === void 0 ? void 0 : onMove(moveEvent);
|
|
68
|
+
onMove === null || onMove === void 0 ? void 0 : onMove(moveEvent, capturePointer);
|
|
55
69
|
}
|
|
56
70
|
function handleUp(upEvent) {
|
|
57
71
|
if (upEvent.pointerId === pointerId) {
|
|
@@ -77,14 +91,8 @@ const startPointerSession = ({ event, captureTarget, onMove, onEnd, }) => {
|
|
|
77
91
|
end('visibilitychange', null);
|
|
78
92
|
}
|
|
79
93
|
}
|
|
80
|
-
if (captureTarget) {
|
|
81
|
-
|
|
82
|
-
(_a = captureTarget.setPointerCapture) === null || _a === void 0 ? void 0 : _a.call(captureTarget, pointerId);
|
|
83
|
-
}
|
|
84
|
-
catch (_b) {
|
|
85
|
-
// Capture is best-effort for detached targets.
|
|
86
|
-
}
|
|
87
|
-
captureTarget.addEventListener('lostpointercapture', handleLostPointerCapture);
|
|
94
|
+
if (captureTarget !== null) {
|
|
95
|
+
capturePointer(captureTarget);
|
|
88
96
|
}
|
|
89
97
|
window.addEventListener('pointermove', handleMove);
|
|
90
98
|
window.addEventListener('pointerup', handleUp);
|
|
@@ -99,6 +107,20 @@ const startCapturedPointerSession = ({ event, captureTarget, onMove, onEnd, }) =
|
|
|
99
107
|
return startPointerSession({ event, captureTarget, onMove, onEnd });
|
|
100
108
|
};
|
|
101
109
|
exports.startCapturedPointerSession = startCapturedPointerSession;
|
|
110
|
+
// Use when a click must remain targeted at the element under the pointer, but
|
|
111
|
+
// an actual drag needs a stable capture target. Call `capturePointer()` from
|
|
112
|
+
// `onMove` once the movement qualifies as a drag.
|
|
113
|
+
const startDeferredCapturedPointerSession = ({ event, captureTarget, onMove, onEnd, }) => {
|
|
114
|
+
return startPointerSession({
|
|
115
|
+
event,
|
|
116
|
+
captureTarget: null,
|
|
117
|
+
onMove: (moveEvent, capturePointer) => {
|
|
118
|
+
onMove(moveEvent, () => capturePointer(captureTarget));
|
|
119
|
+
},
|
|
120
|
+
onEnd,
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
exports.startDeferredCapturedPointerSession = startDeferredCapturedPointerSession;
|
|
102
124
|
// Use when observing a gesture that started elsewhere. This deliberately does
|
|
103
125
|
// not capture the pointer from the element under it.
|
|
104
126
|
const observePointerRelease = ({ event, onEnd, }) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const prismTomorrow = "/**\n * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML\n * Based on https://github.com/chriskempson/tomorrow-theme\n * @author Rose Pritchard\n */\n\ncode[class*=\"language-\"],\npre[class*=\"language-\"] {\n\tcolor: #ccc;\n\tbackground: none;\n\tfont-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n\tfont-size: 1em;\n\ttext-align: left;\n\twhite-space: pre;\n\tword-spacing: normal;\n\tword-break: normal;\n\tword-wrap: normal;\n\tline-height: 1.5;\n\n\t-moz-tab-size: 4;\n\t-o-tab-size: 4;\n\ttab-size: 4;\n\n\t-webkit-hyphens: none;\n\t-moz-hyphens: none;\n\t-ms-hyphens: none;\n\thyphens: none;\n\n}\n\n/* Code blocks */\npre[class*=\"language-\"] {\n\tpadding: 1em;\n\tmargin: .5em 0;\n\toverflow: auto;\n}\n\n:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"] {\n\tbackground: #2d2d2d;\n}\n\n/* Inline code */\n:not(pre) > code[class*=\"language-\"] {\n\tpadding: .1em;\n\tborder-radius: .3em;\n\twhite-space: normal;\n}\n\n.token.comment,\n.token.block-comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n\tcolor: #999;\n}\n\n.token.punctuation {\n\tcolor: #ccc;\n}\n\n.token.tag,\n.token.attr-name,\n.token.namespace,\n.token.deleted {\n\tcolor: #e2777a;\n}\n\n.token.function-name {\n\tcolor: #6196cc;\n}\n\n.token.boolean,\n.token.number,\n.token.function {\n\tcolor: #f08d49;\n}\n\n.token.property,\n.token.class-name,\n.token.constant,\n.token.symbol {\n\tcolor: #f8c555;\n}\n\n.token.selector,\n.token.important,\n.token.atrule,\n.token.keyword,\n.token.builtin {\n\tcolor: #cc99cd;\n}\n\n.token.string,\n.token.char,\n.token.attr-value,\n.token.regex,\n.token.variable {\n\tcolor: #7ec699;\n}\n\n.token.operator,\n.token.entity,\n.token.url {\n\tcolor: #67cdcc;\n}\n\n.token.important,\n.token.bold {\n\tfont-weight: bold;\n}\n.token.italic {\n\tfont-style: italic;\n}\n\n.token.entity {\n\tcursor: help;\n}\n\n.token.inserted {\n\tcolor: green;\n}\n";
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prismTomorrow = void 0;
|
|
4
|
+
// Unmodified prismjs@1.30.0/themes/prism-tomorrow.css, stored as a string for
|
|
5
|
+
// Studio’s CSS injection (including Browser Studio, which has no CSS loader).
|
|
6
|
+
/*
|
|
7
|
+
MIT LICENSE
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2012 Lea Verou
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in
|
|
19
|
+
all copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
27
|
+
THE SOFTWARE.
|
|
28
|
+
*/
|
|
29
|
+
exports.prismTomorrow = `/**
|
|
30
|
+
* prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
|
|
31
|
+
* Based on https://github.com/chriskempson/tomorrow-theme
|
|
32
|
+
* @author Rose Pritchard
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
code[class*="language-"],
|
|
36
|
+
pre[class*="language-"] {
|
|
37
|
+
color: #ccc;
|
|
38
|
+
background: none;
|
|
39
|
+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
40
|
+
font-size: 1em;
|
|
41
|
+
text-align: left;
|
|
42
|
+
white-space: pre;
|
|
43
|
+
word-spacing: normal;
|
|
44
|
+
word-break: normal;
|
|
45
|
+
word-wrap: normal;
|
|
46
|
+
line-height: 1.5;
|
|
47
|
+
|
|
48
|
+
-moz-tab-size: 4;
|
|
49
|
+
-o-tab-size: 4;
|
|
50
|
+
tab-size: 4;
|
|
51
|
+
|
|
52
|
+
-webkit-hyphens: none;
|
|
53
|
+
-moz-hyphens: none;
|
|
54
|
+
-ms-hyphens: none;
|
|
55
|
+
hyphens: none;
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Code blocks */
|
|
60
|
+
pre[class*="language-"] {
|
|
61
|
+
padding: 1em;
|
|
62
|
+
margin: .5em 0;
|
|
63
|
+
overflow: auto;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:not(pre) > code[class*="language-"],
|
|
67
|
+
pre[class*="language-"] {
|
|
68
|
+
background: #2d2d2d;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Inline code */
|
|
72
|
+
:not(pre) > code[class*="language-"] {
|
|
73
|
+
padding: .1em;
|
|
74
|
+
border-radius: .3em;
|
|
75
|
+
white-space: normal;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.token.comment,
|
|
79
|
+
.token.block-comment,
|
|
80
|
+
.token.prolog,
|
|
81
|
+
.token.doctype,
|
|
82
|
+
.token.cdata {
|
|
83
|
+
color: #999;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.token.punctuation {
|
|
87
|
+
color: #ccc;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.token.tag,
|
|
91
|
+
.token.attr-name,
|
|
92
|
+
.token.namespace,
|
|
93
|
+
.token.deleted {
|
|
94
|
+
color: #e2777a;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.token.function-name {
|
|
98
|
+
color: #6196cc;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.token.boolean,
|
|
102
|
+
.token.number,
|
|
103
|
+
.token.function {
|
|
104
|
+
color: #f08d49;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.token.property,
|
|
108
|
+
.token.class-name,
|
|
109
|
+
.token.constant,
|
|
110
|
+
.token.symbol {
|
|
111
|
+
color: #f8c555;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.token.selector,
|
|
115
|
+
.token.important,
|
|
116
|
+
.token.atrule,
|
|
117
|
+
.token.keyword,
|
|
118
|
+
.token.builtin {
|
|
119
|
+
color: #cc99cd;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.token.string,
|
|
123
|
+
.token.char,
|
|
124
|
+
.token.attr-value,
|
|
125
|
+
.token.regex,
|
|
126
|
+
.token.variable {
|
|
127
|
+
color: #7ec699;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.token.operator,
|
|
131
|
+
.token.entity,
|
|
132
|
+
.token.url {
|
|
133
|
+
color: #67cdcc;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.token.important,
|
|
137
|
+
.token.bold {
|
|
138
|
+
font-weight: bold;
|
|
139
|
+
}
|
|
140
|
+
.token.italic {
|
|
141
|
+
font-style: italic;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.token.entity {
|
|
145
|
+
cursor: help;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.token.inserted {
|
|
149
|
+
color: green;
|
|
150
|
+
}
|
|
151
|
+
`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.takePendingSequenceNodePathMutations = exports.queueSequenceNodePathMutationFromApiResponse = exports.queueSequenceNodePathMutation = void 0;
|
|
4
|
+
const inserted_element_selection_1 = require("./inserted-element-selection");
|
|
4
5
|
const pendingMutations = [];
|
|
5
6
|
const seenMutationIds = new Set();
|
|
6
7
|
const queueSequenceNodePathMutation = (mutation) => {
|
|
@@ -9,6 +10,16 @@ const queueSequenceNodePathMutation = (mutation) => {
|
|
|
9
10
|
}
|
|
10
11
|
seenMutationIds.add(mutation.mutationId);
|
|
11
12
|
pendingMutations.push(mutation);
|
|
13
|
+
if (mutation.timelineSelection !== null) {
|
|
14
|
+
(0, inserted_element_selection_1.requestInsertedElementSelection)({
|
|
15
|
+
compositionId: mutation.timelineSelection.compositionId,
|
|
16
|
+
nodePath: {
|
|
17
|
+
absolutePath: mutation.timelineSelection.absolutePath,
|
|
18
|
+
nodePath: mutation.timelineSelection.nodePath,
|
|
19
|
+
},
|
|
20
|
+
notification: null,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
12
23
|
};
|
|
13
24
|
exports.queueSequenceNodePathMutation = queueSequenceNodePathMutation;
|
|
14
25
|
const queueSequenceNodePathMutationFromApiResponse = (response) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const slugifyName: (name: string) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.slugifyName = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const slugifyName = (name) => {
|
|
6
|
+
return remotion_1.Internals.isFolderNameValid(name)
|
|
7
|
+
? name
|
|
8
|
+
: name
|
|
9
|
+
.normalize('NFD')
|
|
10
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
11
|
+
.replace(/[^a-zA-Z0-9\u4E00-\u9FFF-]+/g, '-')
|
|
12
|
+
.replace(/^-+|-+$/g, '');
|
|
13
|
+
};
|
|
14
|
+
exports.slugifyName = slugifyName;
|
|
@@ -2,5 +2,6 @@ export declare const DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = 300;
|
|
|
2
2
|
export declare const getStudioAskAIEnabled: () => boolean;
|
|
3
3
|
export declare const getStudioInteractivityEnabled: () => boolean;
|
|
4
4
|
export declare const getStudioKeyboardShortcutsEnabled: () => boolean;
|
|
5
|
+
export declare const getStudioKeyboardShortcuts: () => Partial<Record<"askAI" | "clearInOutPoints" | "copyEffectsAndValues" | "cutEffects" | "deleteSelection" | "duplicateSequences" | "enterFullscreen" | "goToFrame" | "jumpToBeginning" | "jumpToEnd" | "nextComposition" | "pauseAndReturnToPlaybackStart" | "pausePlayback" | "playForward" | "playPause" | "previousComposition" | "quickSwitcher" | "redo" | "render" | "resetZoom" | "reversePlayback" | "selectAllSequenceRows" | "selectOpacityProp" | "selectRotateProp" | "selectScaleProp" | "selectTranslateProp" | "setInPoint" | "setOutPoint" | "showKeyboardShortcuts" | "toggleBothSidebars" | "toggleCheckerboard" | "toggleLeftSidebar" | "toggleRightSidebar" | "toggleSnapping" | "undo" | "zoomIn" | "zoomOut", import("@remotion/studio-shared").StudioKeyboardShortcutValue>> | null;
|
|
5
6
|
export declare const getStudioMaxTimelineTracks: () => number | null;
|
|
6
7
|
export declare const getStudioBufferStateDelayInMilliseconds: () => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStudioBufferStateDelayInMilliseconds = exports.getStudioMaxTimelineTracks = exports.getStudioKeyboardShortcutsEnabled = exports.getStudioInteractivityEnabled = exports.getStudioAskAIEnabled = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = void 0;
|
|
3
|
+
exports.getStudioBufferStateDelayInMilliseconds = exports.getStudioMaxTimelineTracks = exports.getStudioKeyboardShortcuts = exports.getStudioKeyboardShortcutsEnabled = exports.getStudioInteractivityEnabled = exports.getStudioAskAIEnabled = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = void 0;
|
|
4
4
|
exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = 300;
|
|
5
5
|
const defaultStudioRuntimeConfig = {
|
|
6
6
|
askAIEnabled: false,
|
|
@@ -32,6 +32,11 @@ const getStudioKeyboardShortcutsEnabled = () => {
|
|
|
32
32
|
return getStudioRuntimeConfig().keyboardShortcutsEnabled;
|
|
33
33
|
};
|
|
34
34
|
exports.getStudioKeyboardShortcutsEnabled = getStudioKeyboardShortcutsEnabled;
|
|
35
|
+
const getStudioKeyboardShortcuts = () => {
|
|
36
|
+
var _a;
|
|
37
|
+
return (_a = getStudioRuntimeConfig().keyboardShortcuts) !== null && _a !== void 0 ? _a : null;
|
|
38
|
+
};
|
|
39
|
+
exports.getStudioKeyboardShortcuts = getStudioKeyboardShortcuts;
|
|
35
40
|
const getStudioMaxTimelineTracks = () => {
|
|
36
41
|
return getStudioRuntimeConfig().maxTimelineTracks;
|
|
37
42
|
};
|
|
@@ -3,13 +3,19 @@ export declare const areKeyboardShortcutsDisabled: () => boolean;
|
|
|
3
3
|
export declare const useKeybinding: () => {
|
|
4
4
|
registerKeybinding: (options: {
|
|
5
5
|
event: KeyEventType;
|
|
6
|
-
key: string;
|
|
7
|
-
commandCtrlKey: boolean;
|
|
8
6
|
callback: (e: KeyboardEvent) => void;
|
|
9
7
|
preventDefault: boolean;
|
|
10
8
|
triggerIfInputFieldFocused: boolean;
|
|
11
9
|
keepRegisteredWhenNotHighestContext: boolean;
|
|
12
|
-
}
|
|
10
|
+
} & ({
|
|
11
|
+
action: "askAI" | "clearInOutPoints" | "copyEffectsAndValues" | "cutEffects" | "deleteSelection" | "duplicateSequences" | "enterFullscreen" | "goToFrame" | "jumpToBeginning" | "jumpToEnd" | "nextComposition" | "pauseAndReturnToPlaybackStart" | "pausePlayback" | "playForward" | "playPause" | "previousComposition" | "quickSwitcher" | "redo" | "render" | "resetZoom" | "reversePlayback" | "selectAllSequenceRows" | "selectOpacityProp" | "selectRotateProp" | "selectScaleProp" | "selectTranslateProp" | "setInPoint" | "setOutPoint" | "showKeyboardShortcuts" | "toggleBothSidebars" | "toggleCheckerboard" | "toggleLeftSidebar" | "toggleRightSidebar" | "toggleSnapping" | "undo" | "zoomIn" | "zoomOut";
|
|
12
|
+
key?: undefined;
|
|
13
|
+
commandCtrlKey?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
action?: undefined;
|
|
16
|
+
key: string;
|
|
17
|
+
commandCtrlKey: boolean;
|
|
18
|
+
})) => {
|
|
13
19
|
unregister: () => void;
|
|
14
20
|
};
|
|
15
21
|
isHighestContext: boolean;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useKeybinding = exports.areKeyboardShortcutsDisabled = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
const keyboard_shortcuts_1 = require("../components/keyboard-shortcuts");
|
|
5
6
|
const keybindings_1 = require("../state/keybindings");
|
|
6
7
|
const z_index_1 = require("../state/z-index");
|
|
7
8
|
const is_mac_1 = require("./is-mac");
|
|
@@ -19,25 +20,23 @@ const useKeybinding = () => {
|
|
|
19
20
|
const context = (0, react_1.useContext)(keybindings_1.KeybindingContext);
|
|
20
21
|
const { isHighestContext } = (0, z_index_1.useZIndex)();
|
|
21
22
|
const registerKeybinding = (0, react_1.useCallback)((options) => {
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
unregister: () => undefined,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
23
|
+
var _a;
|
|
27
24
|
if (!isHighestContext && !options.keepRegisteredWhenNotHighestContext) {
|
|
28
25
|
return {
|
|
29
26
|
unregister: () => undefined,
|
|
30
27
|
};
|
|
31
28
|
}
|
|
32
29
|
const listener = (e) => {
|
|
33
|
-
const commandKey = is_mac_1.isMac ? e.metaKey : e.ctrlKey;
|
|
34
30
|
// Apparently, e.key can be undefined in Edge:
|
|
35
31
|
// https://github.com/remotion-dev/remotion/issues/5637
|
|
36
32
|
if (!e.key) {
|
|
37
33
|
return;
|
|
38
34
|
}
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const matches = options.action
|
|
36
|
+
? (0, keyboard_shortcuts_1.keyboardEventMatchesAction)(e, options.action)
|
|
37
|
+
: e.key.toLowerCase() === options.key.toLowerCase() &&
|
|
38
|
+
options.commandCtrlKey === (is_mac_1.isMac ? e.metaKey : e.ctrlKey);
|
|
39
|
+
if (matches && (0, studio_runtime_config_1.getStudioKeyboardShortcutsEnabled)()) {
|
|
41
40
|
if (!options.triggerIfInputFieldFocused) {
|
|
42
41
|
const { activeElement } = document;
|
|
43
42
|
if (activeElement instanceof HTMLInputElement) {
|
|
@@ -56,7 +55,7 @@ const useKeybinding = () => {
|
|
|
56
55
|
const toRegister = {
|
|
57
56
|
registeredFromPane: paneId,
|
|
58
57
|
event: options.event,
|
|
59
|
-
key: options.key,
|
|
58
|
+
key: (_a = options.action) !== null && _a !== void 0 ? _a : options.key,
|
|
60
59
|
callback: listener,
|
|
61
60
|
id: String(Math.random()),
|
|
62
61
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const useKeyboardShortcutLabel: (action: "askAI" | "clearInOutPoints" | "copyEffectsAndValues" | "cutEffects" | "deleteSelection" | "duplicateSequences" | "enterFullscreen" | "goToFrame" | "jumpToBeginning" | "jumpToEnd" | "nextComposition" | "pauseAndReturnToPlaybackStart" | "pausePlayback" | "playForward" | "playPause" | "previousComposition" | "quickSwitcher" | "redo" | "render" | "resetZoom" | "reversePlayback" | "selectAllSequenceRows" | "selectOpacityProp" | "selectRotateProp" | "selectScaleProp" | "selectTranslateProp" | "setInPoint" | "setOutPoint" | "showKeyboardShortcuts" | "toggleBothSidebars" | "toggleCheckerboard" | "toggleLeftSidebar" | "toggleRightSidebar" | "toggleSnapping" | "undo" | "zoomIn" | "zoomOut") => string;
|
|
2
|
+
export declare const useKeyboardShortcutAriaKeyShortcuts: (action: "askAI" | "clearInOutPoints" | "copyEffectsAndValues" | "cutEffects" | "deleteSelection" | "duplicateSequences" | "enterFullscreen" | "goToFrame" | "jumpToBeginning" | "jumpToEnd" | "nextComposition" | "pauseAndReturnToPlaybackStart" | "pausePlayback" | "playForward" | "playPause" | "previousComposition" | "quickSwitcher" | "redo" | "render" | "resetZoom" | "reversePlayback" | "selectAllSequenceRows" | "selectOpacityProp" | "selectRotateProp" | "selectScaleProp" | "selectTranslateProp" | "setInPoint" | "setOutPoint" | "showKeyboardShortcuts" | "toggleBothSidebars" | "toggleCheckerboard" | "toggleLeftSidebar" | "toggleRightSidebar" | "toggleSnapping" | "undo" | "zoomIn" | "zoomOut") => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useKeyboardShortcutAriaKeyShortcuts = exports.useKeyboardShortcutLabel = void 0;
|
|
4
|
+
const keyboard_shortcuts_1 = require("../components/keyboard-shortcuts");
|
|
5
|
+
const client_id_1 = require("./client-id");
|
|
6
|
+
const useKeyboardShortcutLabel = (action) => {
|
|
7
|
+
(0, client_id_1.useStudioConfigRevision)();
|
|
8
|
+
return (0, keyboard_shortcuts_1.getKeyboardShortcutLabel)(action);
|
|
9
|
+
};
|
|
10
|
+
exports.useKeyboardShortcutLabel = useKeyboardShortcutLabel;
|
|
11
|
+
const useKeyboardShortcutAriaKeyShortcuts = (action) => {
|
|
12
|
+
(0, client_id_1.useStudioConfigRevision)();
|
|
13
|
+
return (0, keyboard_shortcuts_1.getKeyboardShortcutAriaKeyShortcuts)(action);
|
|
14
|
+
};
|
|
15
|
+
exports.useKeyboardShortcutAriaKeyShortcuts = useKeyboardShortcutAriaKeyShortcuts;
|