@remotion/studio 4.0.514 → 4.0.516
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 +14 -1
- package/dist/api/restart-studio.js +4 -0
- package/dist/components/AssetSelector.js +3 -9
- package/dist/components/AssetSelectorItem.d.ts +3 -1
- package/dist/components/AssetSelectorItem.js +41 -42
- package/dist/components/AudioWaveform.js +17 -139
- package/dist/components/Canvas.js +7 -4
- package/dist/components/CaptionInspector.d.ts +2 -0
- package/dist/components/CaptionInspector.js +3 -5
- package/dist/components/CompositionSelector.js +6 -3
- package/dist/components/CompositionSelectorItem.js +9 -10
- package/dist/components/ConfigSelect.d.ts +17 -0
- package/dist/components/ConfigSelect.js +50 -0
- package/dist/components/CurrentAsset.d.ts +10 -2
- package/dist/components/CurrentAsset.js +139 -46
- package/dist/components/FixComputedValueModal.js +54 -51
- package/dist/components/GlobalKeybindings.js +5 -5
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +12 -2
- package/dist/components/InlineCaptionInspector.d.ts +2 -0
- package/dist/components/InlineCaptionInspector.js +2 -2
- package/dist/components/InlineCompositionName.js +1 -1
- package/dist/components/InlineEditableTitle.js +3 -2
- package/dist/components/InspectorInfoHeader.js +1 -1
- package/dist/components/InspectorOpenInEditor.js +48 -72
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
- package/dist/components/InspectorPanel/CompositionInspector.js +41 -12
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -4
- package/dist/components/InspectorPanel/common.d.ts +0 -12
- package/dist/components/InspectorPanel/common.js +3 -52
- package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
- package/dist/components/InspectorPanelLayout.d.ts +1 -1
- package/dist/components/InspectorPanelLayout.js +1 -1
- package/dist/components/InspectorSequenceSection.js +40 -54
- package/dist/components/InstallPackage.d.ts +3 -2
- package/dist/components/InstallPackage.js +90 -28
- package/dist/components/InstallablePackage.js +37 -11
- package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
- package/dist/components/KeyboardShortcutsSettings.js +177 -0
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/Modals.js +12 -4
- package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
- package/dist/components/NewComposition/CodemodFooter.js +2 -8
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DeleteFolder.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +1 -1
- package/dist/components/NewComposition/InputDragger.js +27 -4
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/NewFolder.js +1 -3
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/NewComposition/RenameFolder.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.js +1 -1
- package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
- package/dist/components/Notifications/NotificationCenter.js +5 -0
- package/dist/components/OptionsPanel.js +9 -12
- package/dist/components/PreviewToolbar.js +5 -2
- package/dist/components/PreviewToolbarOverflowButton.js +30 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
- package/dist/components/RenderButton.js +66 -183
- package/dist/components/RenderModal/DataEditor.js +15 -12
- package/dist/components/RenderModal/GuiRenderStatus.js +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +3 -3
- package/dist/components/RenderModal/RenderStatusModal.js +0 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
- package/dist/components/RenderModal/WebRenderModal.js +4 -2
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +3 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -7
- package/dist/components/RenderingSettings.js +7 -4
- package/dist/components/RulersAndGuidesToggle.d.ts +2 -0
- package/dist/components/RulersAndGuidesToggle.js +23 -0
- package/dist/components/SegmentedButton.d.ts +29 -0
- package/dist/components/SegmentedButton.js +226 -0
- package/dist/components/SelectedOutlineCanvasRotation.d.ts +1 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +11 -4
- package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
- package/dist/components/SelectedOutlineEditingHandles.js +66 -0
- package/dist/components/SelectedOutlineElement.d.ts +2 -4
- package/dist/components/SelectedOutlineElement.js +15 -54
- package/dist/components/SelectedOutlineOverlay.js +32 -6
- package/dist/components/SelectedOutlinePolygon.d.ts +4 -4
- package/dist/components/SelectedOutlinePolygon.js +20 -17
- package/dist/components/SelectedOutlineRenderer.js +66 -14
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +30 -7
- package/dist/components/SettingsModalFooter.js +2 -1
- package/dist/components/SkillsSettings.d.ts +2 -0
- package/dist/components/SkillsSettings.js +129 -0
- package/dist/components/StaticFilePreview.js +7 -1
- package/dist/components/StudioSettings.js +7 -48
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Timeline/Timeline.js +0 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +15 -9
- package/dist/components/Timeline/TimelineBooleanField.js +1 -4
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +13 -12
- package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectItem.js +45 -15
- package/dist/components/Timeline/TimelineEffectPropItem.js +21 -4
- package/dist/components/Timeline/TimelineExpandArrowButton.js +10 -7
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +4 -1
- package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
- package/dist/components/Timeline/TimelineExpandedSection.js +8 -5
- package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
- package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
- package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
- package/dist/components/Timeline/TimelineImageInfo.js +13 -32
- package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineRotationField.js +0 -2
- package/dist/components/Timeline/TimelineRowChrome.d.ts +1 -1
- package/dist/components/Timeline/TimelineRowChrome.js +41 -6
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
- package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
- package/dist/components/Timeline/TimelineScaleField.js +2 -6
- package/dist/components/Timeline/TimelineSchemaField.js +9 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +8 -3
- package/dist/components/Timeline/TimelineSelection.js +7 -5
- package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequence.js +110 -19
- package/dist/components/Timeline/TimelineSequenceItem.js +11 -8
- package/dist/components/Timeline/TimelineSequenceName.js +1 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +4 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
- package/dist/components/Timeline/TimelineTrack.js +5 -2
- package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
- package/dist/components/Timeline/TimelineTranslateField.js +0 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +4 -2
- package/dist/components/Timeline/TimelineVirtualization.js +3 -1
- package/dist/components/Timeline/delete-selected-timeline-item.js +6 -2
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +7 -14
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
- package/dist/components/Timeline/save-effect-prop.js +3 -3
- package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
- package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
- package/dist/components/Timeline/timeline-field-utils.js +0 -2
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
- package/dist/components/TimelineCombobox.js +25 -160
- package/dist/components/TimelineInOutToggle.js +4 -1
- package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
- package/dist/components/duplicate-jsx-node-api.js +12 -0
- package/dist/components/effect-drag-and-drop.js +7 -7
- package/dist/components/effect-operations-api.d.ts +8 -0
- package/dist/components/effect-operations-api.js +52 -0
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +3 -3
- package/dist/components/import-assets.js +9 -65
- package/dist/components/keyboard-shortcuts.d.ts +10 -0
- package/dist/components/keyboard-shortcuts.js +135 -0
- package/dist/components/selected-outline-control-layout.js +2 -6
- package/dist/components/selected-outline-measurement.d.ts +1 -1
- package/dist/components/selected-outline-measurement.js +16 -3
- package/dist/components/use-delete-asset.d.ts +1 -0
- package/dist/components/use-delete-asset.js +40 -0
- package/dist/components/use-selected-outline-control-target.d.ts +11 -0
- package/dist/components/use-selected-outline-control-target.js +79 -0
- package/dist/error-overlay/remotion-overlay/log-studio-error.js +4 -0
- package/dist/esm/{chunk-r46yxrjr.js → chunk-4bxz1d3g.js} +4 -3
- package/dist/esm/{chunk-xn2q7eem.js → chunk-w4244j4n.js} +14747 -14549
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/internals.mjs +14747 -14549
- package/dist/esm/previewEntry.mjs +14557 -14359
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
- package/dist/helpers/add-asset-cache-bust.js +10 -0
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +18 -1
- package/dist/helpers/calculate-timeline.js +2 -1
- package/dist/helpers/colors.d.ts +3 -1
- package/dist/helpers/colors.js +7 -3
- package/dist/helpers/drag-aware-double-click.d.ts +6 -0
- package/dist/helpers/drag-aware-double-click.js +20 -0
- package/dist/helpers/get-asset-metadata.js +25 -16
- package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
- package/dist/helpers/get-sequence-double-click-action.js +7 -1
- package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
- package/dist/helpers/get-timeline-sequence-layout.js +15 -6
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
- package/dist/helpers/hoverable.d.ts +1 -0
- package/dist/helpers/hoverable.js +2 -1
- package/dist/helpers/inject-css.js +7 -3
- package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
- package/dist/helpers/open-in-remotion-convert.js +18 -0
- package/dist/helpers/use-max-media-duration.js +5 -3
- package/dist/helpers/use-media-metadata.d.ts +2 -1
- package/dist/helpers/use-media-metadata.js +49 -25
- package/dist/helpers/use-menu-structure.js +54 -67
- package/dist/icons/align-center-horizontal.js +1 -1
- package/dist/icons/align-left.js +1 -1
- package/dist/icons/align-right.js +1 -1
- package/dist/icons/cloud-download.d.ts +4 -0
- package/dist/icons/cloud-download.js +8 -0
- package/dist/icons/keyboard.d.ts +4 -0
- package/dist/icons/keyboard.js +10 -0
- package/dist/icons/license.d.ts +4 -0
- package/dist/icons/license.js +8 -0
- package/dist/icons/package.d.ts +4 -0
- package/dist/icons/package.js +8 -0
- package/dist/icons/react.js +1 -1
- package/dist/icons/remotion-convert.d.ts +4 -0
- package/dist/icons/remotion-convert.js +10 -0
- package/dist/icons/skills.d.ts +4 -0
- package/dist/icons/skills.js +10 -0
- package/dist/state/modals.d.ts +2 -5
- package/package.json +12 -12
- package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
- package/dist/components/KeyboardShortcutsExplainer.js +0 -194
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
WHITE,
|
|
5
5
|
__require,
|
|
6
6
|
__toESM
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4bxz1d3g.js";
|
|
8
8
|
|
|
9
9
|
// src/renderEntry.tsx
|
|
10
10
|
import { useContext, useEffect, useRef, useState } from "react";
|
|
@@ -213,7 +213,7 @@ var renderContent = (Root) => {
|
|
|
213
213
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
214
214
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
215
215
|
}));
|
|
216
|
-
import("./chunk-
|
|
216
|
+
import("./chunk-w4244j4n.js").then(({ StudioInternals }) => {
|
|
217
217
|
window.remotion_isStudio = true;
|
|
218
218
|
window.remotion_isReadOnlyStudio = true;
|
|
219
219
|
window.remotion_inputProps = "{}";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addAssetCacheBust = void 0;
|
|
4
|
+
const addAssetCacheBust = ({ fetchedAt, src, }) => {
|
|
5
|
+
if (src.startsWith('blob:')) {
|
|
6
|
+
return src;
|
|
7
|
+
}
|
|
8
|
+
return `${src}${src.includes('?') ? '&' : '?'}date=${fetchedAt}`;
|
|
9
|
+
};
|
|
10
|
+
exports.addAssetCacheBust = addAssetCacheBust;
|
|
@@ -2,4 +2,7 @@ import type { BrowserStudioOperations } from '@remotion/studio-shared';
|
|
|
2
2
|
export declare const BROWSER_STUDIO_OPERATIONS_READY_EVENT = "remotion-browser-studio-operations-ready";
|
|
3
3
|
export declare const getBrowserStudioOperations: () => BrowserStudioOperations | null;
|
|
4
4
|
export declare const getBrowserStudioKeyframeOperations: () => import("@remotion/studio-shared").BrowserStudioKeyframeOperations | null;
|
|
5
|
+
export declare const getBrowserStudioEffectOperations: () => import("@remotion/studio-shared").BrowserStudioEffectOperations | null;
|
|
5
6
|
export declare const canUseKeyframeOperations: () => boolean;
|
|
7
|
+
export declare const canUseEffectOperations: () => boolean;
|
|
8
|
+
export declare const canInstallPackages: () => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canUseKeyframeOperations = exports.getBrowserStudioKeyframeOperations = exports.getBrowserStudioOperations = exports.BROWSER_STUDIO_OPERATIONS_READY_EVENT = void 0;
|
|
3
|
+
exports.canInstallPackages = exports.canUseEffectOperations = exports.canUseKeyframeOperations = exports.getBrowserStudioEffectOperations = exports.getBrowserStudioKeyframeOperations = exports.getBrowserStudioOperations = exports.BROWSER_STUDIO_OPERATIONS_READY_EVENT = void 0;
|
|
4
4
|
// Browser Studio may be hosted by a different studio-shared version, so this
|
|
5
5
|
// handshake intentionally has no shared runtime import.
|
|
6
6
|
exports.BROWSER_STUDIO_OPERATIONS_READY_EVENT = 'remotion-browser-studio-operations-ready';
|
|
@@ -18,6 +18,23 @@ const getBrowserStudioKeyframeOperations = () => {
|
|
|
18
18
|
return (_b = (_a = (0, exports.getBrowserStudioOperations)()) === null || _a === void 0 ? void 0 : _a.keyframes) !== null && _b !== void 0 ? _b : null;
|
|
19
19
|
};
|
|
20
20
|
exports.getBrowserStudioKeyframeOperations = getBrowserStudioKeyframeOperations;
|
|
21
|
+
const getBrowserStudioEffectOperations = () => {
|
|
22
|
+
var _a;
|
|
23
|
+
var _b;
|
|
24
|
+
return (_b = (_a = (0, exports.getBrowserStudioOperations)()) === null || _a === void 0 ? void 0 : _a.effects) !== null && _b !== void 0 ? _b : null;
|
|
25
|
+
};
|
|
26
|
+
exports.getBrowserStudioEffectOperations = getBrowserStudioEffectOperations;
|
|
21
27
|
const canUseKeyframeOperations = () => !window.remotion_isReadOnlyStudio ||
|
|
22
28
|
(0, exports.getBrowserStudioKeyframeOperations)() !== null;
|
|
23
29
|
exports.canUseKeyframeOperations = canUseKeyframeOperations;
|
|
30
|
+
const canUseEffectOperations = () => !window.remotion_isReadOnlyStudio ||
|
|
31
|
+
(0, exports.getBrowserStudioEffectOperations)() !== null;
|
|
32
|
+
exports.canUseEffectOperations = canUseEffectOperations;
|
|
33
|
+
const canInstallPackages = () => {
|
|
34
|
+
const browserStudioOperations = (0, exports.getBrowserStudioOperations)();
|
|
35
|
+
if (browserStudioOperations !== null) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return !window.remotion_isReadOnlyStudio;
|
|
39
|
+
};
|
|
40
|
+
exports.canInstallPackages = canInstallPackages;
|
|
@@ -76,6 +76,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, compositions = [
|
|
|
76
76
|
},
|
|
77
77
|
depth: (0, get_timeline_nestedness_1.getTimelineNestedLevel)(sequence, sortedSequences, 0),
|
|
78
78
|
cascadedStart,
|
|
79
|
+
localStart: sequence.from,
|
|
79
80
|
cascadedDuration: sequence.duration,
|
|
80
81
|
keyframeDisplayOffset: hasKeyframeRows
|
|
81
82
|
? cascadedStartWithTrim - effectiveFrom
|
|
@@ -103,7 +104,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, compositions = [
|
|
|
103
104
|
return sortKeyA.localeCompare(sortKeyB);
|
|
104
105
|
})
|
|
105
106
|
.map((track) => {
|
|
106
|
-
const { cascadedDuration,
|
|
107
|
+
const { cascadedDuration, ...cleanTrack } = track;
|
|
107
108
|
return cleanTrack;
|
|
108
109
|
});
|
|
109
110
|
const nodePathIndexCounters = new Map();
|
package/dist/helpers/colors.d.ts
CHANGED
|
@@ -62,7 +62,9 @@ export declare const ERROR_LINK_COLOR = "#58a6ff";
|
|
|
62
62
|
export declare const INFO_BLUE = "#60a5fa";
|
|
63
63
|
export declare const SERVER_DISCONNECTED_BACKGROUND = "#e74c3c";
|
|
64
64
|
export declare const STACK_FRAME_BORDER_BLUE = "rgb(66, 144, 245)";
|
|
65
|
-
export declare const TIMELINE_BACKGROUND_COLOR = "#
|
|
65
|
+
export declare const TIMELINE_BACKGROUND_COLOR = "#15181B";
|
|
66
|
+
export declare const TIMELINE_NEGATIVE_START_BACKGROUND_COLOR = "#2C2F32";
|
|
67
|
+
export declare const TIMELINE_NEGATIVE_START_BORDER_COLOR = "#414446";
|
|
66
68
|
export declare const TIMELINE_SELECTED_BACKGROUND_COLOR = "#3B3F42";
|
|
67
69
|
export declare const TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR = "#B0B0B0";
|
|
68
70
|
export declare const TIMELINE_BLUE = "#0b84ff";
|
package/dist/helpers/colors.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BLUE_DISABLED = exports.BLUE_HOVERED = exports.BLUE = exports.WARNING_COLOR = exports.FAIL_COLOR = exports.BLACK_OPAQUE = exports.BLACK_ALPHA_90 = exports.BLACK_ALPHA_85 = exports.BLACK_ALPHA_80 = exports.BLACK_ALPHA_60 = exports.BLACK_ALPHA_50 = exports.BLACK_ALPHA_40 = exports.BLACK_ALPHA_30 = exports.BLACK_ALPHA_28 = exports.BLACK_ALPHA_10 = exports.WHITE_ALPHA_80 = exports.WHITE_ALPHA_72 = exports.WHITE_ALPHA_70 = exports.WHITE_ALPHA_60 = exports.WHITE_ALPHA_50 = exports.WHITE_ALPHA_45 = exports.WHITE_ALPHA_40 = exports.WHITE_ALPHA_35 = exports.WHITE_ALPHA_30 = exports.WHITE_ALPHA_25 = exports.WHITE_ALPHA_20 = exports.WHITE_ALPHA_15 = exports.WHITE_ALPHA_12 = exports.WHITE_ALPHA_10 = exports.WHITE_ALPHA_08 = exports.WHITE_ALPHA_06 = exports.WHITE_ALPHA_05 = exports.RULER_COLOR = exports.LIGHT_TEXT = exports.SELECTED_BACKGROUND = exports.LIGHT_COLOR = exports.INPUT_BACKGROUND = exports.BACKGROUND__TRANSPARENT = exports.BACKGROUND_HEX = exports.BACKGROUND = exports.BLACK_FULL_HEX = exports.BLACK_HEX = exports.WHITE_FULL_HEX = exports.WHITE_HEX = exports.CURRENT_COLOR_LOWERCASE = exports.CURRENT_COLOR = exports.TRANSPARENT = exports.RED = exports.WHITE = exports.BLACK = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.getBackgroundFromHoverState = exports.TIMELINE_IMAGE_GRADIENT = exports.TIMELINE_VIDEO_GRADIENT = exports.TIMELINE_AUDIO_GRADIENT = exports.LOOPED_INDICATOR_DROP_SHADOW = exports.SELECTED_OUTLINE_UV_DROP_SHADOW = exports.SELECTED_OUTLINE_DROP_SHADOW = exports.ERROR_MESSAGE_MASK_IMAGE = exports.COLOR_PICKER_HUE_GRADIENT = exports.COLOR_PICKER_ALPHA_TRANSPARENT = exports.COLOR_PICKER_SATURATION_BLACK_GRADIENT = exports.COLOR_PICKER_SATURATION_VALUE_GRADIENT = exports.COLOR_PICKER_CHECKER_BACKGROUND_COLOR = exports.COLOR_PICKER_CHECKER_BACKGROUND_IMAGE = exports.CHECKERBOARD_BACKGROUND_IMAGE = void 0;
|
|
4
|
+
exports.HOT_MIDDLEWARE_ERROR_STYLE = exports.NOTIFICATION_BORDER = exports.COLOR_PICKER_HANDLE_SHADOW = exports.COLOR_PICKER_POPUP_SHADOW = exports.SERVER_DISCONNECTED_SHADOW = exports.NOTIFICATION_SHADOW = exports.SHADOW_BLACK_ALPHA_50_TOWARDS_TOP = exports.SHADOW_BLACK_ALPHA_50_TOWARDS_BOTTOM = exports.SHADOW_BLACK = exports.BORDER_TIMELINE_MARQUEE_BLUE = exports.BORDER_TIMELINE_DROP_BLUE = exports.BORDER_STACK_FRAME_BLUE = exports.BORDER_INFO_BLUE = exports.BORDER_WHITE_ALPHA_20 = exports.BORDER_WHITE_ALPHA_12 = exports.BORDER_BLACK_ALPHA_60 = exports.BORDER_BLACK_ALPHA_50 = exports.BORDER_TRANSPARENT_2PX = exports.BORDER_CURRENT_COLOR = exports.BORDER_WHITE_2PX = exports.BORDER_WHITE = exports.BORDER_BLACK = exports.INFO_BLUE_BACKGROUND = exports.EASING_SELECTED_BACKGROUND = exports.TIMELINE_MARQUEE_BLUE_ALPHA_75 = exports.TIMELINE_MARQUEE_BLUE_ALPHA_16 = exports.TIMELINE_DROP_BLUE_ALPHA_75 = exports.TIMELINE_DROP_BLUE_ALPHA_16 = exports.TIMELINE_DROP_BLUE_ALPHA_12 = exports.TIMELINE_PLAYHEAD_COLOR = exports.TIMELINE_BLUE = exports.TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR = exports.TIMELINE_SELECTED_BACKGROUND_COLOR = exports.TIMELINE_NEGATIVE_START_BORDER_COLOR = exports.TIMELINE_NEGATIVE_START_BACKGROUND_COLOR = exports.TIMELINE_BACKGROUND_COLOR = exports.STACK_FRAME_BORDER_BLUE = exports.SERVER_DISCONNECTED_BACKGROUND = exports.INFO_BLUE = exports.ERROR_LINK_COLOR = exports.ERROR_CODE_FRAME_LINE_BACKGROUND = exports.ERROR_CODE_FRAME_BACKGROUND = exports.RENDER_STATUS_BACKGROUND = exports.NOTIFICATION_BACKGROUND = exports.KEYBOARD_SHORTCUT_KEY_COLOR = exports.LIGHT_GRAY = exports.TIMELINE_TRACK_SEPARATOR = exports.LINE_COLOR = exports.SELECTED_GUIDE = exports.UNSELECTED_GUIDE = void 0;
|
|
5
|
+
exports.getBackgroundFromHoverState = exports.TIMELINE_IMAGE_GRADIENT = exports.TIMELINE_VIDEO_GRADIENT = exports.TIMELINE_AUDIO_GRADIENT = exports.LOOPED_INDICATOR_DROP_SHADOW = exports.SELECTED_OUTLINE_UV_DROP_SHADOW = exports.SELECTED_OUTLINE_DROP_SHADOW = exports.ERROR_MESSAGE_MASK_IMAGE = exports.COLOR_PICKER_HUE_GRADIENT = exports.COLOR_PICKER_ALPHA_TRANSPARENT = exports.COLOR_PICKER_SATURATION_BLACK_GRADIENT = exports.COLOR_PICKER_SATURATION_VALUE_GRADIENT = exports.COLOR_PICKER_CHECKER_BACKGROUND_COLOR = exports.COLOR_PICKER_CHECKER_BACKGROUND_IMAGE = exports.CHECKERBOARD_BACKGROUND_IMAGE = exports.FOCUS_BOX_SHADOW = exports.HOT_MIDDLEWARE_WARNING_STYLE = void 0;
|
|
6
6
|
exports.BLACK = 'black';
|
|
7
7
|
exports.WHITE = 'white';
|
|
8
8
|
exports.RED = 'red';
|
|
@@ -68,7 +68,11 @@ exports.ERROR_LINK_COLOR = '#58a6ff';
|
|
|
68
68
|
exports.INFO_BLUE = '#60a5fa';
|
|
69
69
|
exports.SERVER_DISCONNECTED_BACKGROUND = '#e74c3c';
|
|
70
70
|
exports.STACK_FRAME_BORDER_BLUE = 'rgb(66, 144, 245)';
|
|
71
|
-
exports.TIMELINE_BACKGROUND_COLOR = '#
|
|
71
|
+
exports.TIMELINE_BACKGROUND_COLOR = '#15181B';
|
|
72
|
+
// WHITE_ALPHA_10 composited over TIMELINE_BACKGROUND_COLOR.
|
|
73
|
+
exports.TIMELINE_NEGATIVE_START_BACKGROUND_COLOR = '#2C2F32';
|
|
74
|
+
// WHITE_ALPHA_10 composited over TIMELINE_NEGATIVE_START_BACKGROUND_COLOR.
|
|
75
|
+
exports.TIMELINE_NEGATIVE_START_BORDER_COLOR = '#414446';
|
|
72
76
|
exports.TIMELINE_SELECTED_BACKGROUND_COLOR = '#3B3F42';
|
|
73
77
|
exports.TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR = '#B0B0B0';
|
|
74
78
|
exports.TIMELINE_BLUE = '#0b84ff';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type DragAwareDoubleClickTracker = {
|
|
2
|
+
readonly beginPointerGesture: () => void;
|
|
3
|
+
readonly endPointerGesture: (wasDragged: boolean) => void;
|
|
4
|
+
readonly consumePointerGestureWasDragged: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const createDragAwareDoubleClickTracker: () => DragAwareDoubleClickTracker;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDragAwareDoubleClickTracker = void 0;
|
|
4
|
+
const createDragAwareDoubleClickTracker = () => {
|
|
5
|
+
let pointerGestureWasDragged = false;
|
|
6
|
+
return {
|
|
7
|
+
beginPointerGesture: () => {
|
|
8
|
+
pointerGestureWasDragged = false;
|
|
9
|
+
},
|
|
10
|
+
endPointerGesture: (wasDragged) => {
|
|
11
|
+
pointerGestureWasDragged = wasDragged;
|
|
12
|
+
},
|
|
13
|
+
consumePointerGestureWasDragged: () => {
|
|
14
|
+
const wasDragged = pointerGestureWasDragged;
|
|
15
|
+
pointerGestureWasDragged = false;
|
|
16
|
+
return wasDragged;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
exports.createDragAwareDoubleClickTracker = createDragAwareDoubleClickTracker;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAssetMetadata = exports.remotion_outputsBase = void 0;
|
|
4
4
|
const media_utils_1 = require("@remotion/media-utils");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
+
const add_asset_cache_bust_1 = require("./add-asset-cache-bust");
|
|
6
7
|
const get_preview_file_type_1 = require("./get-preview-file-type");
|
|
7
8
|
exports.remotion_outputsBase = window.remotion_staticBase.replace('static', 'outputs');
|
|
8
9
|
const getSrcFromCanvasContent = (canvasContent) => {
|
|
@@ -12,6 +13,7 @@ const getSrcFromCanvasContent = (canvasContent) => {
|
|
|
12
13
|
return exports.remotion_outputsBase + canvasContent.path;
|
|
13
14
|
};
|
|
14
15
|
const getAssetMetadata = async (canvasContent, addTime) => {
|
|
16
|
+
var _a;
|
|
15
17
|
if (canvasContent.type === 'output-blob') {
|
|
16
18
|
return {
|
|
17
19
|
type: 'found',
|
|
@@ -25,27 +27,34 @@ const getAssetMetadata = async (canvasContent, addTime) => {
|
|
|
25
27
|
}
|
|
26
28
|
try {
|
|
27
29
|
const src = getSrcFromCanvasContent(canvasContent);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
const listedStaticFile = canvasContent.type === 'asset'
|
|
31
|
+
? window.remotion_staticFiles.find((file) => file.name === canvasContent.asset && file.src === src)
|
|
32
|
+
: null;
|
|
33
|
+
let size = (_a = listedStaticFile === null || listedStaticFile === void 0 ? void 0 : listedStaticFile.sizeInBytes) !== null && _a !== void 0 ? _a : null;
|
|
34
|
+
if (size === null) {
|
|
35
|
+
const file = await fetch(src, {
|
|
36
|
+
method: 'HEAD',
|
|
37
|
+
});
|
|
38
|
+
if (file.status === 404) {
|
|
39
|
+
return { type: 'not-found' };
|
|
40
|
+
}
|
|
41
|
+
if (file.status !== 200) {
|
|
42
|
+
throw new Error(`Expected status code 200 or 404 for file, got ${file.status}`);
|
|
43
|
+
}
|
|
44
|
+
const contentLength = file.headers.get('content-length');
|
|
45
|
+
if (!contentLength) {
|
|
46
|
+
throw new Error('Unexpected error: content-length is null');
|
|
47
|
+
}
|
|
48
|
+
size = Number(contentLength);
|
|
40
49
|
}
|
|
41
50
|
const fetchedAt = Date.now();
|
|
42
|
-
const srcWithTime = addTime ?
|
|
51
|
+
const srcWithTime = addTime ? (0, add_asset_cache_bust_1.addAssetCacheBust)({ fetchedAt, src }) : src;
|
|
43
52
|
const fileType = (0, get_preview_file_type_1.getPreviewFileType)(src);
|
|
44
53
|
if (fileType === 'video') {
|
|
45
54
|
const resolution = await (0, media_utils_1.getVideoMetadata)(srcWithTime);
|
|
46
55
|
return {
|
|
47
56
|
type: 'found',
|
|
48
|
-
size
|
|
57
|
+
size,
|
|
49
58
|
dimensions: { width: resolution.width, height: resolution.height },
|
|
50
59
|
fetchedAt,
|
|
51
60
|
};
|
|
@@ -56,7 +65,7 @@ const getAssetMetadata = async (canvasContent, addTime) => {
|
|
|
56
65
|
img.onload = () => {
|
|
57
66
|
resolve({
|
|
58
67
|
type: 'found',
|
|
59
|
-
size
|
|
68
|
+
size,
|
|
60
69
|
dimensions: { width: img.width, height: img.height },
|
|
61
70
|
fetchedAt,
|
|
62
71
|
});
|
|
@@ -71,7 +80,7 @@ const getAssetMetadata = async (canvasContent, addTime) => {
|
|
|
71
80
|
return {
|
|
72
81
|
type: 'found',
|
|
73
82
|
dimensions: 'none',
|
|
74
|
-
size
|
|
83
|
+
size,
|
|
75
84
|
fetchedAt,
|
|
76
85
|
};
|
|
77
86
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { TSequence } from 'remotion';
|
|
2
2
|
export type SequenceDoubleClickAction = 'open-connected-composition' | 'open-in-editor';
|
|
3
|
-
export declare const getSequenceDoubleClickAction: ({ button, canOpenInEditor, numberOfConnectedCompositions, }: {
|
|
3
|
+
export declare const getSequenceDoubleClickAction: ({ button, canOpenInEditor, numberOfConnectedCompositions, sequenceWasDragged, }: {
|
|
4
4
|
readonly button: number;
|
|
5
5
|
readonly canOpenInEditor: boolean;
|
|
6
6
|
readonly numberOfConnectedCompositions: number;
|
|
7
|
+
readonly sequenceWasDragged: boolean;
|
|
7
8
|
}) => SequenceDoubleClickAction | null;
|
|
8
9
|
export declare const getConnectedCompositionFrame: ({ timelinePosition, sequence, sequenceFrameOffset, }: {
|
|
9
10
|
readonly timelinePosition: number;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getConnectedCompositionFrame = exports.getSequenceDoubleClickAction = void 0;
|
|
4
|
-
const getSequenceDoubleClickAction = ({ button, canOpenInEditor, numberOfConnectedCompositions, }) => {
|
|
4
|
+
const getSequenceDoubleClickAction = ({ button, canOpenInEditor, numberOfConnectedCompositions, sequenceWasDragged, }) => {
|
|
5
|
+
// The browser still fires `dblclick` when the second press of a
|
|
6
|
+
// double-click turned into a drag. That gesture is a drag, not a
|
|
7
|
+
// double-click.
|
|
8
|
+
if (sequenceWasDragged) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
5
11
|
if (button !== 0) {
|
|
6
12
|
return null;
|
|
7
13
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { VideoConfig } from 'remotion';
|
|
2
2
|
export declare const SEQUENCE_BORDER_WIDTH = 1;
|
|
3
|
-
export declare const getTimelineSequenceLayout: ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, premountDisplay, postmountDisplay, }: {
|
|
3
|
+
export declare const getTimelineSequenceLayout: ({ durationInFrames, startFrom, cascadedStart, maxMediaDuration, startFromMedia, video, windowWidth, premountDisplay, postmountDisplay, }: {
|
|
4
4
|
durationInFrames: number;
|
|
5
5
|
startFrom: number;
|
|
6
|
+
cascadedStart: number;
|
|
6
7
|
startFromMedia: number;
|
|
7
8
|
maxMediaDuration: number | null;
|
|
8
9
|
video: VideoConfig;
|
|
@@ -13,6 +14,8 @@ export declare const getTimelineSequenceLayout: ({ durationInFrames, startFrom,
|
|
|
13
14
|
marginLeft: number;
|
|
14
15
|
width: number;
|
|
15
16
|
naturalWidth: number;
|
|
17
|
+
negativeStartWidth: number;
|
|
18
|
+
negativeStartClipped: boolean;
|
|
16
19
|
premountWidth: number | null;
|
|
17
20
|
postmountWidth: number | null;
|
|
18
21
|
};
|
|
@@ -10,16 +10,23 @@ const getWidthOfTrack = ({ durationInFrames, timelineDuration, windowWidth, spat
|
|
|
10
10
|
: (spatialDuration / timelineDuration) * fullWidth;
|
|
11
11
|
return Math.max(0, base - exports.SEQUENCE_BORDER_WIDTH + nonNegativeMarginLeft);
|
|
12
12
|
};
|
|
13
|
-
const getTimelineSequenceLayout = ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, premountDisplay, postmountDisplay, }) => {
|
|
13
|
+
const getTimelineSequenceLayout = ({ durationInFrames, startFrom, cascadedStart, maxMediaDuration, startFromMedia, video, windowWidth, premountDisplay, postmountDisplay, }) => {
|
|
14
14
|
var _a;
|
|
15
15
|
const maxMediaSequenceDuration = (maxMediaDuration !== null && maxMediaDuration !== void 0 ? maxMediaDuration : Infinity) - startFromMedia;
|
|
16
16
|
const timelineDuration = (_a = video.durationInFrames) !== null && _a !== void 0 ? _a : 1;
|
|
17
|
+
const fullWidth = windowWidth - timeline_layout_1.TIMELINE_PADDING * 2;
|
|
17
18
|
const spatialDuration = Math.max(0, Math.min(maxMediaSequenceDuration, durationInFrames, timelineDuration - startFrom));
|
|
18
19
|
// Unclipped spatial duration: without the timeline-end constraint
|
|
19
20
|
const naturalSpatialDuration = Math.max(0, Math.min(maxMediaSequenceDuration, durationInFrames));
|
|
20
|
-
const marginLeft = timelineDuration <= 0
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const marginLeft = timelineDuration <= 0 ? 0 : (startFrom / timelineDuration) * fullWidth;
|
|
22
|
+
const naturalNegativeStartWidth = timelineDuration > 0 &&
|
|
23
|
+
startFrom === 0 &&
|
|
24
|
+
cascadedStart < 0 &&
|
|
25
|
+
durationInFrames > 0
|
|
26
|
+
? Math.max(0, (-cascadedStart / timelineDuration) * fullWidth)
|
|
27
|
+
: 0;
|
|
28
|
+
const negativeStartWidth = Math.min(timeline_layout_1.TIMELINE_PADDING, naturalNegativeStartWidth);
|
|
29
|
+
const negativeStartClipped = naturalNegativeStartWidth > timeline_layout_1.TIMELINE_PADDING;
|
|
23
30
|
const nonNegativeMarginLeft = Math.min(marginLeft, 0);
|
|
24
31
|
const width = getWidthOfTrack({
|
|
25
32
|
durationInFrames,
|
|
@@ -54,9 +61,11 @@ const getTimelineSequenceLayout = ({ durationInFrames, startFrom, maxMediaDurati
|
|
|
54
61
|
})
|
|
55
62
|
: null;
|
|
56
63
|
return {
|
|
57
|
-
marginLeft: Math.max(marginLeft, 0) - (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0),
|
|
58
|
-
width: width + (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0) + (postmountWidth !== null && postmountWidth !== void 0 ? postmountWidth : 0),
|
|
64
|
+
marginLeft: Math.max(marginLeft, 0) - negativeStartWidth - (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0),
|
|
65
|
+
width: width + negativeStartWidth + (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0) + (postmountWidth !== null && postmountWidth !== void 0 ? postmountWidth : 0),
|
|
59
66
|
naturalWidth: naturalWidth + (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0) + (postmountWidth !== null && postmountWidth !== void 0 ? postmountWidth : 0),
|
|
67
|
+
negativeStartWidth,
|
|
68
|
+
negativeStartClipped,
|
|
60
69
|
premountWidth,
|
|
61
70
|
postmountWidth,
|
|
62
71
|
};
|
|
@@ -13,9 +13,10 @@ export type TimelineTrackData = {
|
|
|
13
13
|
nodePathInfo: SequenceNodePathInfo | null;
|
|
14
14
|
keyframeDisplayOffset: number;
|
|
15
15
|
sequenceFrameOffset: number;
|
|
16
|
+
cascadedStart: number;
|
|
17
|
+
localStart: number;
|
|
16
18
|
};
|
|
17
19
|
export type TimelineTrackWithOriginalTimings = TimelineTrackData & {
|
|
18
|
-
cascadedStart: number;
|
|
19
20
|
cascadedDuration: number;
|
|
20
21
|
};
|
|
21
22
|
export declare const getTimelineSequenceSortKey: (track: TimelineTrackData, tracks: TimelineTrackData[], nonceRanks: Map<string, number>) => string;
|
|
@@ -2,6 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
export declare const HOVERABLE_CLASS_NAME = "__remotion-hoverable";
|
|
3
3
|
export declare const HOVER_GROUP_CLASS_NAME = "__remotion-hover-group";
|
|
4
4
|
export declare const HOVER_GROUP_REVEAL_CLASS_NAME = "__remotion-hover-group-reveal";
|
|
5
|
+
export declare const FOCUS_VISIBLE_ONLY_CLASS_NAME = "__remotion-focus-visible-only";
|
|
5
6
|
export declare const hoverableStyle: ({ idleBackground, hoverBackground, idleColor, hoverColor, }: {
|
|
6
7
|
idleBackground: string;
|
|
7
8
|
hoverBackground: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeHoverableCSS = exports.hoverableStyle = exports.HOVER_GROUP_REVEAL_CLASS_NAME = exports.HOVER_GROUP_CLASS_NAME = exports.HOVERABLE_CLASS_NAME = void 0;
|
|
3
|
+
exports.makeHoverableCSS = exports.hoverableStyle = exports.FOCUS_VISIBLE_ONLY_CLASS_NAME = exports.HOVER_GROUP_REVEAL_CLASS_NAME = exports.HOVER_GROUP_CLASS_NAME = exports.HOVERABLE_CLASS_NAME = void 0;
|
|
4
4
|
const colors_1 = require("./colors");
|
|
5
5
|
// Purely visual hover styling must be driven by CSS `:hover` rather than
|
|
6
6
|
// React state: When the Studio runs in an <iframe> (like in Browser Studio),
|
|
@@ -11,6 +11,7 @@ const colors_1 = require("./colors");
|
|
|
11
11
|
exports.HOVERABLE_CLASS_NAME = '__remotion-hoverable';
|
|
12
12
|
exports.HOVER_GROUP_CLASS_NAME = '__remotion-hover-group';
|
|
13
13
|
exports.HOVER_GROUP_REVEAL_CLASS_NAME = '__remotion-hover-group-reveal';
|
|
14
|
+
exports.FOCUS_VISIBLE_ONLY_CLASS_NAME = '__remotion-focus-visible-only';
|
|
14
15
|
const BG_VARIABLE = '--remotion-hoverable-bg';
|
|
15
16
|
const HOVER_BG_VARIABLE = '--remotion-hoverable-hover-bg';
|
|
16
17
|
const COLOR_VARIABLE = '--remotion-hoverable-color';
|
|
@@ -58,7 +58,7 @@ const makeDefaultGlobalCSS = () => {
|
|
|
58
58
|
|
|
59
59
|
input:focus,
|
|
60
60
|
textarea:focus,
|
|
61
|
-
button:focus:not(.__remotion_input_dragger):not(.__remotion_color_swatch):not(.__remotion-inspector-section-title),
|
|
61
|
+
button:focus:not(.__remotion_input_dragger):not(.__remotion_color_swatch):not(.__remotion-inspector-section-title):not(.${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}):not(.__remotion-timeline-expand-arrow-button),
|
|
62
62
|
a:focus {
|
|
63
63
|
outline: none;
|
|
64
64
|
box-shadow: ${colors_1.FOCUS_BOX_SHADOW};
|
|
@@ -66,14 +66,18 @@ const makeDefaultGlobalCSS = () => {
|
|
|
66
66
|
|
|
67
67
|
.__remotion-composition-selector-item:focus,
|
|
68
68
|
.__remotion-inspector-quick-action:focus,
|
|
69
|
-
.__remotion-inspector-section-title:focus
|
|
69
|
+
.__remotion-inspector-section-title:focus,
|
|
70
|
+
.${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}:focus,
|
|
71
|
+
.__remotion-timeline-expand-arrow-button:focus {
|
|
70
72
|
outline: none;
|
|
71
73
|
box-shadow: none;
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
.__remotion-composition-selector-item:focus-visible,
|
|
75
77
|
.__remotion-inspector-quick-action:focus-visible,
|
|
76
|
-
.__remotion-inspector-section-title:focus-visible
|
|
78
|
+
.__remotion-inspector-section-title:focus-visible,
|
|
79
|
+
.${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}:focus-visible,
|
|
80
|
+
.__remotion-timeline-expand-arrow-button:focus-visible {
|
|
77
81
|
box-shadow: ${colors_1.FOCUS_BOX_SHADOW};
|
|
78
82
|
}
|
|
79
83
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openInRemotionConvert = exports.getRemotionConvertUrl = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const getRemotionConvertUrl = ({ relativePath, studioOrigin, }) => {
|
|
6
|
+
const convertUrl = new URL('https://www.remotion.dev/convert');
|
|
7
|
+
const assetUrl = new URL((0, remotion_1.staticFile)(relativePath), studioOrigin);
|
|
8
|
+
convertUrl.searchParams.set('url', assetUrl.toString());
|
|
9
|
+
return convertUrl.toString();
|
|
10
|
+
};
|
|
11
|
+
exports.getRemotionConvertUrl = getRemotionConvertUrl;
|
|
12
|
+
const openInRemotionConvert = ({ relativePath, }) => {
|
|
13
|
+
window.open((0, exports.getRemotionConvertUrl)({
|
|
14
|
+
relativePath,
|
|
15
|
+
studioOrigin: window.location.origin,
|
|
16
|
+
}), '_blank', 'noopener,noreferrer');
|
|
17
|
+
};
|
|
18
|
+
exports.openInRemotionConvert = openInRemotionConvert;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useMaxMediaDuration = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
5
6
|
const is_video_with_last_frame_hold_1 = require("./is-video-with-last-frame-hold");
|
|
6
7
|
const use_media_metadata_1 = require("./use-media-metadata");
|
|
7
8
|
const cache = new Map();
|
|
@@ -19,7 +20,8 @@ const useMaxMediaDuration = (s, fps) => {
|
|
|
19
20
|
var _a;
|
|
20
21
|
const holdsLastFrame = (0, is_video_with_last_frame_hold_1.isVideoWithLastFrameHold)(s);
|
|
21
22
|
const src = holdsLastFrame ? null : getSrc(s);
|
|
22
|
-
const
|
|
23
|
+
const resolvedSrc = remotion_1.Internals.usePreload(src !== null && src !== void 0 ? src : '');
|
|
24
|
+
const cacheKey = src ? getCacheKey(resolvedSrc, fps) : null;
|
|
23
25
|
const [maxMediaDuration, setMaxMediaDuration] = (0, react_1.useState)(cacheKey ? ((_a = cache.get(cacheKey)) !== null && _a !== void 0 ? _a : null) : Infinity);
|
|
24
26
|
(0, react_1.useEffect)(() => {
|
|
25
27
|
var _a;
|
|
@@ -32,7 +34,7 @@ const useMaxMediaDuration = (s, fps) => {
|
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
36
|
let cancelled = false;
|
|
35
|
-
(0, use_media_metadata_1.getMediaMetadata)(
|
|
37
|
+
(0, use_media_metadata_1.getMediaMetadata)(resolvedSrc)
|
|
36
38
|
.then((metadata) => {
|
|
37
39
|
if (cancelled || !metadata) {
|
|
38
40
|
return;
|
|
@@ -50,7 +52,7 @@ const useMaxMediaDuration = (s, fps) => {
|
|
|
50
52
|
return () => {
|
|
51
53
|
cancelled = true;
|
|
52
54
|
};
|
|
53
|
-
}, [cacheKey, fps, src]);
|
|
55
|
+
}, [cacheKey, fps, resolvedSrc, src]);
|
|
54
56
|
if (holdsLastFrame) {
|
|
55
57
|
return Infinity;
|
|
56
58
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InputAudioTrack, InputVideoTrack } from 'mediabunny';
|
|
1
|
+
import type { FrameRateMetrics, InputAudioTrack, InputVideoTrack } from 'mediabunny';
|
|
2
2
|
export type MediaMetadata = {
|
|
3
3
|
duration: number;
|
|
4
4
|
format: string | null;
|
|
@@ -12,6 +12,7 @@ export type MediaMetadata = {
|
|
|
12
12
|
hasVideoTrack: boolean | null;
|
|
13
13
|
hasAudioTrack: boolean | null;
|
|
14
14
|
};
|
|
15
|
+
export declare const getFrameRateFromMetrics: (metrics: Pick<FrameRateMetrics, "bestGuessFrameRate" | "probedPacketCount"> | null) => number | null;
|
|
15
16
|
export declare const getCachedMediaMetadata: (src: string) => MediaMetadata | null;
|
|
16
17
|
export declare const getMediaMetadata: (src: string) => Promise<MediaMetadata | null>;
|
|
17
18
|
export declare const useMediaMetadata: (src: string | null) => MediaMetadata | null;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMediaMetadata = exports.getMediaMetadata = exports.getCachedMediaMetadata = void 0;
|
|
3
|
+
exports.useMediaMetadata = exports.getMediaMetadata = exports.getCachedMediaMetadata = exports.getFrameRateFromMetrics = void 0;
|
|
4
4
|
const media_utils_1 = require("@remotion/media-utils");
|
|
5
5
|
const mediabunny_1 = require("mediabunny");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const remotion_1 = require("remotion");
|
|
7
8
|
const get_duration_or_compute_1 = require("./get-duration-or-compute");
|
|
8
9
|
const cache = new Map();
|
|
9
10
|
const pendingRequests = new Map();
|
|
11
|
+
const getFrameRateFromMetrics = (metrics) => {
|
|
12
|
+
if (metrics === null || metrics.probedPacketCount < 2) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return metrics.bestGuessFrameRate;
|
|
16
|
+
};
|
|
17
|
+
exports.getFrameRateFromMetrics = getFrameRateFromMetrics;
|
|
10
18
|
const getCachedMediaMetadata = (src) => {
|
|
11
19
|
var _a;
|
|
12
20
|
return (_a = cache.get(src)) !== null && _a !== void 0 ? _a : null;
|
|
@@ -21,20 +29,39 @@ const safeCall = async (fn) => {
|
|
|
21
29
|
}
|
|
22
30
|
};
|
|
23
31
|
const getMediabunnyMetadata = async (src) => {
|
|
24
|
-
var _a
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
var _a;
|
|
33
|
+
const lease = (() => {
|
|
34
|
+
try {
|
|
35
|
+
return remotion_1.Internals.globalMediaResourceManager.acquire({
|
|
36
|
+
key: remotion_1.Internals.getMediabunnyInputResourceKey({
|
|
37
|
+
src,
|
|
38
|
+
credentials: null,
|
|
39
|
+
requestInitFingerprint: null,
|
|
40
|
+
revision: null,
|
|
41
|
+
}),
|
|
42
|
+
create: () => {
|
|
43
|
+
const createdInput = new mediabunny_1.Input({
|
|
44
|
+
formats: mediabunny_1.ALL_FORMATS,
|
|
45
|
+
source: new mediabunny_1.UrlSource(src),
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
resource: createdInput,
|
|
49
|
+
dispose: () => createdInput.dispose(),
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (_a) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
})();
|
|
58
|
+
if (lease === null) {
|
|
33
59
|
return null;
|
|
34
60
|
}
|
|
61
|
+
const input = lease.resource;
|
|
35
62
|
try {
|
|
36
63
|
const [duration, format, videoTrack, audioTrack] = await Promise.all([
|
|
37
|
-
safeCall(() => (0, get_duration_or_compute_1.getDurationOrCompute)(input)),
|
|
64
|
+
safeCall(() => lease.getOrCreateValue(remotion_1.Internals.MEDIABUNNY_DURATION_VALUE_KEY, () => (0, get_duration_or_compute_1.getDurationOrCompute)(input))),
|
|
38
65
|
safeCall(() => input.getFormat()),
|
|
39
66
|
safeCall(() => input.getPrimaryVideoTrack()),
|
|
40
67
|
safeCall(() => input.getPrimaryAudioTrack()),
|
|
@@ -42,11 +69,11 @@ const getMediabunnyMetadata = async (src) => {
|
|
|
42
69
|
if (duration === null) {
|
|
43
70
|
return null;
|
|
44
71
|
}
|
|
45
|
-
const [width, height, videoCodec,
|
|
72
|
+
const [width, height, videoCodec, frameRateMetrics, isHdr, audioCodec, sampleRate,] = await Promise.all([
|
|
46
73
|
videoTrack ? safeCall(() => videoTrack.getDisplayWidth()) : null,
|
|
47
74
|
videoTrack ? safeCall(() => videoTrack.getDisplayHeight()) : null,
|
|
48
75
|
videoTrack ? safeCall(() => videoTrack.getCodec()) : null,
|
|
49
|
-
videoTrack ? safeCall(() => videoTrack.
|
|
76
|
+
videoTrack ? safeCall(() => videoTrack.computeFrameRateMetrics()) : null,
|
|
50
77
|
videoTrack ? safeCall(() => videoTrack.hasHighDynamicRange()) : null,
|
|
51
78
|
audioTrack ? safeCall(() => audioTrack.getCodec()) : null,
|
|
52
79
|
audioTrack ? safeCall(() => audioTrack.getSampleRate()) : null,
|
|
@@ -58,7 +85,7 @@ const getMediabunnyMetadata = async (src) => {
|
|
|
58
85
|
height,
|
|
59
86
|
videoCodec,
|
|
60
87
|
audioCodec,
|
|
61
|
-
fps: (
|
|
88
|
+
fps: (0, exports.getFrameRateFromMetrics)(frameRateMetrics),
|
|
62
89
|
isHdr,
|
|
63
90
|
sampleRate,
|
|
64
91
|
hasVideoTrack: Boolean(videoTrack),
|
|
@@ -66,12 +93,7 @@ const getMediabunnyMetadata = async (src) => {
|
|
|
66
93
|
};
|
|
67
94
|
}
|
|
68
95
|
finally {
|
|
69
|
-
|
|
70
|
-
input.dispose();
|
|
71
|
-
}
|
|
72
|
-
catch (_d) {
|
|
73
|
-
// ignore
|
|
74
|
-
}
|
|
96
|
+
lease.release();
|
|
75
97
|
}
|
|
76
98
|
};
|
|
77
99
|
const getFallbackVideoMetadata = async (src) => {
|
|
@@ -121,15 +143,17 @@ const getMediaMetadata = (src) => {
|
|
|
121
143
|
};
|
|
122
144
|
exports.getMediaMetadata = getMediaMetadata;
|
|
123
145
|
const useMediaMetadata = (src) => {
|
|
124
|
-
const
|
|
146
|
+
const resolvedSrc = remotion_1.Internals.usePreload(src !== null && src !== void 0 ? src : '');
|
|
147
|
+
const metadataSrc = src === null ? null : resolvedSrc;
|
|
148
|
+
const [mediaMetadata, setMediaMetadata] = (0, react_1.useState)(metadataSrc ? (0, exports.getCachedMediaMetadata)(metadataSrc) : null);
|
|
125
149
|
(0, react_1.useEffect)(() => {
|
|
126
|
-
const cached =
|
|
150
|
+
const cached = metadataSrc ? (0, exports.getCachedMediaMetadata)(metadataSrc) : null;
|
|
127
151
|
setMediaMetadata(cached);
|
|
128
|
-
if (!
|
|
152
|
+
if (!metadataSrc || cached) {
|
|
129
153
|
return;
|
|
130
154
|
}
|
|
131
155
|
let cancelled = false;
|
|
132
|
-
(0, exports.getMediaMetadata)(
|
|
156
|
+
(0, exports.getMediaMetadata)(metadataSrc)
|
|
133
157
|
.then((metadata) => {
|
|
134
158
|
if (cancelled) {
|
|
135
159
|
return;
|
|
@@ -145,7 +169,7 @@ const useMediaMetadata = (src) => {
|
|
|
145
169
|
return () => {
|
|
146
170
|
cancelled = true;
|
|
147
171
|
};
|
|
148
|
-
}, [
|
|
172
|
+
}, [metadataSrc]);
|
|
149
173
|
return mediaMetadata;
|
|
150
174
|
};
|
|
151
175
|
exports.useMediaMetadata = useMediaMetadata;
|