@remotion/studio 4.0.499 → 4.0.500
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssetSelector.js +8 -6
- package/dist/components/AssetSelectorItem.d.ts +24 -0
- package/dist/components/AssetSelectorItem.js +113 -80
- package/dist/components/CompositionSelector.js +2 -32
- package/dist/components/ControlButton.js +1 -0
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/ExplorerPanelRef.d.ts +2 -0
- package/dist/components/GlobalKeybindings.js +7 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineDropdown.d.ts +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +8 -7
- package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +7 -7
- package/dist/components/InspectorPanel/common.d.ts +17 -4
- package/dist/components/InspectorPanel/common.js +60 -6
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
- package/dist/components/InspectorSequenceSection.js +43 -19
- package/dist/components/KeyboardShortcutsExplainer.js +4 -2
- package/dist/components/Menu/MenuItem.js +2 -1
- package/dist/components/MenuCompositionName.js +30 -7
- package/dist/components/MenuToolbar.d.ts +0 -1
- package/dist/components/MenuToolbar.js +8 -7
- package/dist/components/MobilePanel.d.ts +2 -1
- package/dist/components/MobilePanel.js +29 -25
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +7 -0
- package/dist/components/NewComposition/InputDragger.js +119 -8
- package/dist/components/OutlineToggle.d.ts +1 -3
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +44 -0
- package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +76 -12
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
- package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
- package/dist/components/QuickSwitcher/asset-search.js +42 -0
- package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
- package/dist/components/SelectedOutlineCropControls.js +299 -0
- package/dist/components/SelectedOutlineElement.js +83 -43
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.js +130 -8
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
- package/dist/components/SidebarCollapserControls.d.ts +3 -1
- package/dist/components/SidebarCollapserControls.js +34 -29
- package/dist/components/SnappingToggle.d.ts +1 -3
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
- package/dist/components/Timeline/TimelineAssetField.js +52 -100
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
- package/dist/components/Timeline/TimelineColorField.js +20 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
- package/dist/components/Timeline/TimelineList.d.ts +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +7 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +5 -5
- package/dist/components/Timeline/TimelineSelection.js +8 -6
- package/dist/components/Timeline/TimelineSequence.js +1 -5
- package/dist/components/Timeline/TimelineSequenceItem.js +57 -10
- package/dist/components/Timeline/TimelineSequencePropItem.js +27 -75
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +0 -1
- package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
- package/dist/components/Timeline/reset-selected-timeline-props.js +18 -10
- package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
- package/dist/components/Timeline/save-effect-prop.js +52 -1
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +17 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
- package/dist/components/TopPanel.js +2 -2
- package/dist/components/UndoRedoButtons.js +27 -5
- package/dist/components/composition-drop-preview.js +1 -0
- package/dist/components/menu-toolbar-height.d.ts +1 -0
- package/dist/components/menu-toolbar-height.js +4 -0
- package/dist/components/selected-outline-drag.d.ts +41 -4
- package/dist/components/selected-outline-drag.js +179 -2
- package/dist/components/selected-outline-geometry.d.ts +1 -0
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +64 -3
- package/dist/components/selected-outline-types.d.ts +44 -1
- package/dist/components/selected-outline-types.js +21 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
- package/dist/esm/{chunk-pk1zwsn1.js → chunk-dr1y1vm3.js} +8417 -7127
- package/dist/esm/internals.mjs +8417 -7127
- package/dist/esm/previewEntry.mjs +51241 -49953
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.d.ts +2 -2
- package/dist/helpers/calculate-timeline.js +8 -28
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
- package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -2
- package/dist/helpers/is-mac.d.ts +1 -0
- package/dist/helpers/is-mac.js +4 -0
- package/dist/helpers/open-in-editor.d.ts +5 -1
- package/dist/helpers/open-in-editor.js +15 -1
- package/dist/helpers/sort-by-nonce-history.js +97 -19
- package/dist/helpers/use-keybinding.js +2 -3
- package/dist/helpers/use-menu-structure.js +10 -1
- package/dist/icons/caret.d.ts +1 -0
- package/dist/icons/caret.js +2 -2
- package/dist/icons/pen.d.ts +5 -0
- package/dist/icons/pen.js +8 -0
- package/dist/state/modals.d.ts +5 -0
- package/package.json +12 -12
- package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
- package/dist/helpers/get-timeline-sequence-hash.js +0 -33
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -212,7 +212,7 @@ var renderContent = (Root) => {
|
|
|
212
212
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
213
213
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
214
214
|
}));
|
|
215
|
-
import("./chunk-
|
|
215
|
+
import("./chunk-dr1y1vm3.js").then(({ StudioInternals }) => {
|
|
216
216
|
window.remotion_isStudio = true;
|
|
217
217
|
window.remotion_isReadOnlyStudio = true;
|
|
218
218
|
window.remotion_inputProps = "{}";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OverrideIdToNodePaths, TSequence } from 'remotion';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TimelineTrackData } from './get-timeline-sequence-sort-key';
|
|
3
3
|
export declare const calculateTimeline: ({ sequences, overrideIdsToNodePaths, compositions, }: {
|
|
4
4
|
sequences: TSequence[];
|
|
5
5
|
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
6
6
|
compositions?: readonly import("remotion").AnyComposition[] | undefined;
|
|
7
|
-
}) =>
|
|
7
|
+
}) => TimelineTrackData[];
|
|
@@ -5,7 +5,6 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
5
5
|
const get_connected_compositions_1 = require("./get-connected-compositions");
|
|
6
6
|
const get_sequence_visible_range_1 = require("./get-sequence-visible-range");
|
|
7
7
|
const get_timeline_nestedness_1 = require("./get-timeline-nestedness");
|
|
8
|
-
const get_timeline_sequence_hash_1 = require("./get-timeline-sequence-hash");
|
|
9
8
|
const get_timeline_sequence_sort_key_1 = require("./get-timeline-sequence-sort-key");
|
|
10
9
|
const sort_by_nonce_history_1 = require("./sort-by-nonce-history");
|
|
11
10
|
const getInheritedLoopDisplay = (sequence, sequences) => {
|
|
@@ -52,19 +51,8 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, compositions = [
|
|
|
52
51
|
}
|
|
53
52
|
return true;
|
|
54
53
|
});
|
|
55
|
-
const sameHashes = {};
|
|
56
|
-
const hashesUsedInRoot = {};
|
|
57
|
-
const cache = {};
|
|
58
54
|
for (let i = 0; i < timelineSequences.length; i++) {
|
|
59
55
|
const sequence = timelineSequences[i];
|
|
60
|
-
if (!hashesUsedInRoot[sequence.rootId]) {
|
|
61
|
-
hashesUsedInRoot[sequence.rootId] = [];
|
|
62
|
-
}
|
|
63
|
-
const actualHash = (0, get_timeline_sequence_hash_1.getTimelineSequenceHash)(sequence, sortedSequences, hashesUsedInRoot, cache);
|
|
64
|
-
if (!sameHashes[actualHash]) {
|
|
65
|
-
sameHashes[actualHash] = [];
|
|
66
|
-
}
|
|
67
|
-
sameHashes[actualHash].push(sequence.id);
|
|
68
56
|
const cascadedStart = (0, get_sequence_visible_range_1.getCascadedStart)(sequence, sortedSequences);
|
|
69
57
|
const cascadedStartWithTrim = (0, get_sequence_visible_range_1.getCascadedStartWithTrim)(sequence, sortedSequences);
|
|
70
58
|
const effectiveFrom = sequence.trimBefore === null
|
|
@@ -87,7 +75,6 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, compositions = [
|
|
|
87
75
|
: sequence.loopDisplay,
|
|
88
76
|
},
|
|
89
77
|
depth: (0, get_timeline_nestedness_1.getTimelineNestedLevel)(sequence, sortedSequences, 0),
|
|
90
|
-
hash: actualHash,
|
|
91
78
|
cascadedStart,
|
|
92
79
|
cascadedDuration: sequence.duration,
|
|
93
80
|
keyframeDisplayOffset: hasKeyframeRows
|
|
@@ -105,26 +92,19 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, compositions = [
|
|
|
105
92
|
: null,
|
|
106
93
|
});
|
|
107
94
|
}
|
|
108
|
-
const uniqueTracks = [];
|
|
109
|
-
for (const track of tracks) {
|
|
110
|
-
const existingTrack = uniqueTracks.find((t) => t.hash === track.hash);
|
|
111
|
-
if (!existingTrack) {
|
|
112
|
-
const { cascadedDuration, cascadedStart, ...cleanTrack } = track;
|
|
113
|
-
uniqueTracks.push(cleanTrack);
|
|
114
|
-
}
|
|
115
|
-
else if (existingTrack.connectedCompositions === undefined &&
|
|
116
|
-
track.connectedCompositions !== undefined) {
|
|
117
|
-
existingTrack.connectedCompositions = track.connectedCompositions;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
95
|
const nonceRanks = new Map();
|
|
121
96
|
for (let i = 0; i < tracks.length; i++) {
|
|
122
97
|
nonceRanks.set(tracks[i].sequence.id, i);
|
|
123
98
|
}
|
|
124
|
-
const sortedTracks =
|
|
125
|
-
|
|
126
|
-
const
|
|
99
|
+
const sortedTracks = tracks
|
|
100
|
+
.sort((a, b) => {
|
|
101
|
+
const sortKeyA = (0, get_timeline_sequence_sort_key_1.getTimelineSequenceSortKey)(a, tracks, nonceRanks);
|
|
102
|
+
const sortKeyB = (0, get_timeline_sequence_sort_key_1.getTimelineSequenceSortKey)(b, tracks, nonceRanks);
|
|
127
103
|
return sortKeyA.localeCompare(sortKeyB);
|
|
104
|
+
})
|
|
105
|
+
.map((track) => {
|
|
106
|
+
const { cascadedDuration, cascadedStart, ...cleanTrack } = track;
|
|
107
|
+
return cleanTrack;
|
|
128
108
|
});
|
|
129
109
|
const nodePathIndexCounters = new Map();
|
|
130
110
|
return sortedTracks
|
|
@@ -6,7 +6,7 @@ export type SequenceNodePathInfo = {
|
|
|
6
6
|
numberOfSequencesWithThisNodePath: number;
|
|
7
7
|
supportsEffects: boolean;
|
|
8
8
|
};
|
|
9
|
-
type
|
|
9
|
+
export type TimelineTrackData = {
|
|
10
10
|
sequence: TSequence;
|
|
11
11
|
connectedCompositions?: readonly _InternalTypes['AnyComposition'][];
|
|
12
12
|
depth: number;
|
|
@@ -14,15 +14,8 @@ type Track = {
|
|
|
14
14
|
keyframeDisplayOffset: number;
|
|
15
15
|
sequenceFrameOffset: number;
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
18
|
-
hash: string;
|
|
19
|
-
};
|
|
20
|
-
export type TrackWithHashAndOriginalTimings = TrackWithHash & {
|
|
21
|
-
hash: string;
|
|
17
|
+
export type TimelineTrackWithOriginalTimings = TimelineTrackData & {
|
|
22
18
|
cascadedStart: number;
|
|
23
19
|
cascadedDuration: number;
|
|
24
20
|
};
|
|
25
|
-
export declare const
|
|
26
|
-
[hash: string]: string[];
|
|
27
|
-
}, nonceRanks?: Map<string, number>) => string;
|
|
28
|
-
export {};
|
|
21
|
+
export declare const getTimelineSequenceSortKey: (track: TimelineTrackData, tracks: TimelineTrackData[], nonceRanks: Map<string, number>) => string;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.getTimelineSequenceSortKey = void 0;
|
|
4
|
+
const getTimelineSequenceSortKey = (track, tracks, nonceRanks) => {
|
|
5
5
|
var _a;
|
|
6
|
-
const
|
|
7
|
-
const sequenceId = firstSequenceWithSameHash.sequence.id;
|
|
8
|
-
const rank = (_a = nonceRanks.get(sequenceId)) !== null && _a !== void 0 ? _a : 0;
|
|
6
|
+
const rank = (_a = nonceRanks.get(track.sequence.id)) !== null && _a !== void 0 ? _a : 0;
|
|
9
7
|
const id = String(rank).padStart(6, '0');
|
|
10
8
|
if (!track.sequence.parent) {
|
|
11
9
|
return id;
|
|
@@ -16,12 +14,6 @@ const getTimelineSequenceSequenceSortKey = (track, tracks, sameHashes = {}, nonc
|
|
|
16
14
|
// may not exist in the `allTracks` array.
|
|
17
15
|
return id;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
return sameHashes[parent.hash].includes(a.sequence.id);
|
|
21
|
-
});
|
|
22
|
-
if (!firstParentWithSameHash) {
|
|
23
|
-
throw new Error('could not find parent: ' + track.sequence.parent);
|
|
24
|
-
}
|
|
25
|
-
return `${(0, exports.getTimelineSequenceSequenceSortKey)(firstParentWithSameHash, tracks, sameHashes, nonceRanks)}-${id}`;
|
|
17
|
+
return `${(0, exports.getTimelineSequenceSortKey)(parent, tracks, nonceRanks)}-${id}`;
|
|
26
18
|
};
|
|
27
|
-
exports.
|
|
19
|
+
exports.getTimelineSequenceSortKey = getTimelineSequenceSortKey;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isStudioInteractivityEnabled = void 0;
|
|
3
|
+
exports.isStudioSelectionEnabled = exports.isStudioInteractivityEnabled = void 0;
|
|
4
4
|
const studio_runtime_config_1 = require("./studio-runtime-config");
|
|
5
|
-
|
|
5
|
+
const isStudioInteractivityEnabled = () => {
|
|
6
|
+
return ((0, studio_runtime_config_1.getStudioInteractivityEnabled)() &&
|
|
7
|
+
(typeof window === 'undefined' || !window.remotion_isReadOnlyStudio));
|
|
8
|
+
};
|
|
9
|
+
exports.isStudioInteractivityEnabled = isStudioInteractivityEnabled;
|
|
10
|
+
exports.isStudioSelectionEnabled = studio_runtime_config_1.getStudioInteractivityEnabled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isMac: boolean;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { CompositionComponentInfoResponse, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
|
-
import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
2
|
+
import type { CodePosition, OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
3
3
|
export declare const openInEditor: (stack: SymbolicatedStackFrame) => Promise<import("@remotion/studio-shared").OpenInEditorResponse>;
|
|
4
4
|
export declare const openOriginalPositionInEditor: (originalPosition: OriginalPosition) => Promise<void>;
|
|
5
|
+
export declare const openOriginalPositionInEditorAtProperty: ({ originalPosition, property, }: {
|
|
6
|
+
originalPosition: CodePosition;
|
|
7
|
+
property: string;
|
|
8
|
+
}) => Promise<void>;
|
|
5
9
|
type ResolvedCompositionComponentInfo = {
|
|
6
10
|
location: CompositionComponentInfoResponse['location'];
|
|
7
11
|
canAddSequence: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.openCompositionComponentInEditor = exports.preloadCompositionComponentInfo = exports.loadCompositionComponentInfo = exports.useCachedCompositionComponentInfo = exports.getCachedCompositionComponentInfo = exports.subscribeToCompositionComponentInfo = exports.openOriginalPositionInEditor = exports.openInEditor = void 0;
|
|
3
|
+
exports.openCompositionComponentInEditor = exports.preloadCompositionComponentInfo = exports.loadCompositionComponentInfo = exports.useCachedCompositionComponentInfo = exports.getCachedCompositionComponentInfo = exports.subscribeToCompositionComponentInfo = exports.openOriginalPositionInEditorAtProperty = exports.openOriginalPositionInEditor = exports.openInEditor = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const call_api_1 = require("../components/call-api");
|
|
6
6
|
const openInEditor = (stack) => {
|
|
@@ -26,6 +26,20 @@ const openOriginalPositionInEditor = async (originalPosition) => {
|
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
exports.openOriginalPositionInEditor = openOriginalPositionInEditor;
|
|
29
|
+
const openOriginalPositionInEditorAtProperty = async ({ originalPosition, property, }) => {
|
|
30
|
+
const position = await (0, call_api_1.callApi)('/api/find-in-file', {
|
|
31
|
+
fileName: originalPosition.source,
|
|
32
|
+
lineNumber: originalPosition.line,
|
|
33
|
+
columnNumber: originalPosition.column,
|
|
34
|
+
search: property,
|
|
35
|
+
});
|
|
36
|
+
await (0, exports.openOriginalPositionInEditor)({
|
|
37
|
+
source: originalPosition.source,
|
|
38
|
+
line: position.lineNumber,
|
|
39
|
+
column: position.columnNumber,
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.openOriginalPositionInEditorAtProperty = openOriginalPositionInEditorAtProperty;
|
|
29
43
|
const componentResolutionCache = new Map();
|
|
30
44
|
const componentResolutionResults = new Map();
|
|
31
45
|
const componentResolutionListeners = new Set();
|
|
@@ -25,45 +25,123 @@ const compareNonceHistories = (a, b) => {
|
|
|
25
25
|
return aLatestEpoch - bLatestEpoch;
|
|
26
26
|
};
|
|
27
27
|
exports.compareNonceHistories = compareNonceHistories;
|
|
28
|
+
// Compare two histories, each pre-collapsed to parallel arrays of epochs and
|
|
29
|
+
// nonces sorted by descending epoch, without rebuilding a Map per comparison.
|
|
30
|
+
// Equivalent to getSharedEpochOrder: both find the newest shared epoch and
|
|
31
|
+
// compare its nonces.
|
|
32
|
+
const sharedEpochOrderFromSorted = (aEpochs, aNonces, bEpochs, bNonces) => {
|
|
33
|
+
let i = 0;
|
|
34
|
+
let j = 0;
|
|
35
|
+
while (i < aEpochs.length && j < bEpochs.length) {
|
|
36
|
+
const ae = aEpochs[i];
|
|
37
|
+
const be = bEpochs[j];
|
|
38
|
+
if (ae === be) {
|
|
39
|
+
return aNonces[i] - bNonces[j];
|
|
40
|
+
}
|
|
41
|
+
if (ae > be) {
|
|
42
|
+
i++;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
j++;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
28
50
|
const sortItemsByNonceHistory = (items) => {
|
|
29
51
|
const n = items.length;
|
|
30
52
|
if (n <= 1) {
|
|
31
53
|
return items.slice();
|
|
32
54
|
}
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
|
|
55
|
+
// Collapse each history once into epoch/nonce arrays sorted by descending
|
|
56
|
+
// epoch. `new Map(nonce)` keeps the last value per duplicated epoch, matching
|
|
57
|
+
// getSharedEpochOrder. This removes the per-pair Map/Set construction the
|
|
58
|
+
// pairwise loop below would otherwise repeat O(n^2) times.
|
|
59
|
+
const epochsOf = new Array(n);
|
|
60
|
+
const noncesOf = new Array(n);
|
|
61
|
+
for (let i = 0; i < n; i++) {
|
|
62
|
+
const map = new Map(items[i].nonce);
|
|
63
|
+
const epochs = [...map.keys()].sort((x, y) => y - x);
|
|
64
|
+
epochsOf[i] = epochs;
|
|
65
|
+
noncesOf[i] = epochs.map((e) => map.get(e));
|
|
66
|
+
}
|
|
67
|
+
// Pairwise "strictly before" relation, stored as bitsets: `before[i]` has
|
|
68
|
+
// bit j set when i must come before j, `known[i]` has bit j set when the
|
|
69
|
+
// pair (i, j) is directly determined by a shared epoch. Bitsets let the
|
|
70
|
+
// transitive closure below combine 32 relationships per word.
|
|
71
|
+
const words = (n + 31) >> 5;
|
|
72
|
+
const before = new Uint32Array(n * words);
|
|
73
|
+
const known = new Uint32Array(n * words);
|
|
74
|
+
// Direct comparison sign per ordered pair; only read where `known` is set.
|
|
75
|
+
const sign = new Int8Array(n * n);
|
|
36
76
|
for (let i = 0; i < n; i++) {
|
|
37
77
|
for (let j = i + 1; j < n; j++) {
|
|
38
|
-
const cmp =
|
|
39
|
-
|
|
40
|
-
|
|
78
|
+
const cmp = sharedEpochOrderFromSorted(epochsOf[i], noncesOf[i], epochsOf[j], noncesOf[j]);
|
|
79
|
+
if (cmp === null) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
known[i * words + (j >> 5)] |= 1 << (j & 31);
|
|
83
|
+
known[j * words + (i >> 5)] |= 1 << (i & 31);
|
|
84
|
+
sign[i * n + j] = cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
|
|
85
|
+
sign[j * n + i] = cmp < 0 ? 1 : cmp > 0 ? -1 : 0;
|
|
86
|
+
if (cmp < 0) {
|
|
87
|
+
before[i * words + (j >> 5)] |= 1 << (j & 31);
|
|
88
|
+
}
|
|
89
|
+
else if (cmp > 0) {
|
|
90
|
+
before[j * words + (i >> 5)] |= 1 << (i & 31);
|
|
91
|
+
}
|
|
41
92
|
}
|
|
42
93
|
}
|
|
43
|
-
//
|
|
94
|
+
// Transitive closure: if i < k and k < j, then i < j. This is the same
|
|
95
|
+
// Floyd-Warshall relation as before, but the inner sweep is bitwise
|
|
96
|
+
// (`before[k] & ~known[i]` finds all reachable j at once). A newly derived
|
|
97
|
+
// edge is marked known immediately so the first path decides an otherwise
|
|
98
|
+
// undetermined pair — preserving behavior on the inputs where the pairwise
|
|
99
|
+
// comparison is intentionally non-transitive.
|
|
44
100
|
for (let k = 0; k < n; k++) {
|
|
101
|
+
const kBase = k * words;
|
|
102
|
+
const kWord = k >> 5;
|
|
103
|
+
const kBit = 1 << (k & 31);
|
|
45
104
|
for (let i = 0; i < n; i++) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
105
|
+
if (i === k) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const iBase = i * words;
|
|
109
|
+
if ((before[iBase + kWord] & kBit) === 0) {
|
|
110
|
+
continue; // i is not before k, so k adds nothing for i
|
|
111
|
+
}
|
|
112
|
+
for (let w = 0; w < words; w++) {
|
|
113
|
+
const add = before[kBase + w] & ~known[iBase + w];
|
|
114
|
+
if (add === 0) {
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
before[iBase + w] |= add;
|
|
118
|
+
known[iBase + w] |= add;
|
|
119
|
+
// Set the mirror relationship (j after i) for each newly known pair.
|
|
120
|
+
let bits = add;
|
|
121
|
+
while (bits !== 0) {
|
|
122
|
+
const lowest = bits & -bits;
|
|
123
|
+
const j = (w << 5) + (31 - Math.clz32(lowest));
|
|
124
|
+
sign[i * n + j] = -1;
|
|
125
|
+
known[j * words + (i >> 5)] |= 1 << (i & 31);
|
|
126
|
+
sign[j * n + i] = 1;
|
|
127
|
+
bits ^= lowest;
|
|
54
128
|
}
|
|
55
129
|
}
|
|
56
130
|
}
|
|
57
131
|
}
|
|
58
|
-
// Sort using transitive order, falling back to lower latest epoch first.
|
|
59
132
|
const indexMap = new Map(items.map((item, i) => [item, i]));
|
|
60
133
|
const result = items.slice();
|
|
61
134
|
result.sort((a, b) => {
|
|
62
135
|
const ai = indexMap.get(a);
|
|
63
136
|
const bi = indexMap.get(b);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
137
|
+
if ((known[ai * words + (bi >> 5)] >> (bi & 31)) & 1) {
|
|
138
|
+
return sign[ai * n + bi];
|
|
139
|
+
}
|
|
140
|
+
if ((before[ai * words + (bi >> 5)] >> (bi & 31)) & 1) {
|
|
141
|
+
return -1;
|
|
142
|
+
}
|
|
143
|
+
if ((before[bi * words + (ai >> 5)] >> (ai & 31)) & 1) {
|
|
144
|
+
return 1;
|
|
67
145
|
}
|
|
68
146
|
// No transitive relationship — lower latest epoch first
|
|
69
147
|
return a.nonce[a.nonce.length - 1][0] - b.nonce[b.nonce.length - 1][0];
|
|
@@ -4,6 +4,7 @@ exports.useKeybinding = exports.areKeyboardShortcutsDisabled = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const keybindings_1 = require("../state/keybindings");
|
|
6
6
|
const z_index_1 = require("../state/z-index");
|
|
7
|
+
const is_mac_1 = require("./is-mac");
|
|
7
8
|
const studio_runtime_config_1 = require("./studio-runtime-config");
|
|
8
9
|
if (!(0, studio_runtime_config_1.getStudioKeyboardShortcutsEnabled)()) {
|
|
9
10
|
// eslint-disable-next-line no-console
|
|
@@ -29,9 +30,7 @@ const useKeybinding = () => {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
const listener = (e) => {
|
|
32
|
-
const commandKey =
|
|
33
|
-
? e.metaKey
|
|
34
|
-
: e.ctrlKey;
|
|
33
|
+
const commandKey = is_mac_1.isMac ? e.metaKey : e.ctrlKey;
|
|
35
34
|
// Apparently, e.key can be undefined in Edge:
|
|
36
35
|
// https://github.com/remotion-dev/remotion/issues/5637
|
|
37
36
|
if (!e.key) {
|
|
@@ -39,6 +39,13 @@ const openExternal = (link) => {
|
|
|
39
39
|
};
|
|
40
40
|
const rotate = {
|
|
41
41
|
transform: `rotate(90deg)`,
|
|
42
|
+
color: 'inherit',
|
|
43
|
+
};
|
|
44
|
+
const iconContainer = {
|
|
45
|
+
color: 'inherit',
|
|
46
|
+
};
|
|
47
|
+
const iconPath = {
|
|
48
|
+
color: 'inherit',
|
|
42
49
|
};
|
|
43
50
|
const ICON_SIZE = 16;
|
|
44
51
|
const getFileMenu = ({ readOnlyStudio, closeMenu, previewServerState, setSelectedModal, }) => {
|
|
@@ -235,7 +242,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
235
242
|
let struct = [
|
|
236
243
|
{
|
|
237
244
|
id: 'remotion',
|
|
238
|
-
label: (jsx_runtime_1.jsx(layout_1.Row, { align: "center", justify: "center", children: jsx_runtime_1.jsx("svg", { width: ICON_SIZE, height: ICON_SIZE, viewBox: "-100 -100 400 400", style: rotate, children: jsx_runtime_1.jsx("path", { fill: colors_1.
|
|
245
|
+
label: (jsx_runtime_1.jsx(layout_1.Row, { align: "center", justify: "center", style: iconContainer, children: jsx_runtime_1.jsx("svg", { width: ICON_SIZE, height: ICON_SIZE, viewBox: "-100 -100 400 400", style: rotate, children: jsx_runtime_1.jsx("path", { fill: colors_1.CURRENT_COLOR, stroke: colors_1.CURRENT_COLOR, style: iconPath, strokeWidth: "100", strokeLinejoin: "round", d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z" }) }) })),
|
|
239
246
|
leaveLeftPadding: false,
|
|
240
247
|
items: [
|
|
241
248
|
{
|
|
@@ -574,6 +581,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
574
581
|
type: 'quick-switcher',
|
|
575
582
|
mode: 'compositions',
|
|
576
583
|
invocationTimestamp: Date.now(),
|
|
584
|
+
assetSelection: null,
|
|
577
585
|
});
|
|
578
586
|
},
|
|
579
587
|
type: 'item',
|
|
@@ -762,6 +770,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
762
770
|
type: 'quick-switcher',
|
|
763
771
|
mode: 'docs',
|
|
764
772
|
invocationTimestamp: Date.now(),
|
|
773
|
+
assetSelection: null,
|
|
765
774
|
});
|
|
766
775
|
},
|
|
767
776
|
keyHint: '?',
|
package/dist/icons/caret.d.ts
CHANGED
package/dist/icons/caret.js
CHANGED
|
@@ -18,8 +18,8 @@ const angleDown = {
|
|
|
18
18
|
};
|
|
19
19
|
const CaretRight = () => (jsx_runtime_1.jsx("svg", { viewBox: "0 0 192 512", style: caret, children: jsx_runtime_1.jsx("path", { fill: colors_1.CURRENT_COLOR, d: "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" }) }));
|
|
20
20
|
exports.CaretRight = CaretRight;
|
|
21
|
-
const CaretDown = ({ small = false
|
|
22
|
-
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 320 512", style: small ? caretDownSmall : caretDown, children: jsx_runtime_1.jsx("path", { fill:
|
|
21
|
+
const CaretDown = ({ color = colors_1.CURRENT_COLOR, small = false }) => {
|
|
22
|
+
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 320 512", style: small ? caretDownSmall : caretDown, children: jsx_runtime_1.jsx("path", { fill: color, d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" }) }));
|
|
23
23
|
};
|
|
24
24
|
exports.CaretDown = CaretDown;
|
|
25
25
|
const AngleDown = ({ down }) => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PenIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const PenIcon = ({ color, ...props }) => {
|
|
6
|
+
return (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props, children: jsx_runtime_1.jsx("path", { fill: color, d: "M18.7 2.3a1 1 0 0 0-1.4 0L5.2 14.4a1 1 0 0 0-.26.46l-1.4 4.95a.5.5 0 0 0 .62.62l4.95-1.4a1 1 0 0 0 .46-.26L21.7 6.7a1 1 0 0 0 0-1.4l-3-3Zm-10.33 14.9-2.4.68.68-2.4L15.5 6.62l1.73 1.73-8.86 8.85Zm10.28-10.27L16.92 5.2 18 4.12l1.73 1.73-1.08 1.08Z" }) }));
|
|
7
|
+
};
|
|
8
|
+
exports.PenIcon = PenIcon;
|
package/dist/state/modals.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { PackageManager, RenderDefaults } from '@remotion/studio-shared';
|
|
|
4
4
|
import type { RenderStillOnWebImageFormat, WebRendererAudioCodec, WebRendererContainer, WebRendererHardwareAcceleration, WebRendererPageResponsiveness, WebRendererQuality, WebRendererVideoCodec } from '@remotion/web-renderer';
|
|
5
5
|
import type React from 'react';
|
|
6
6
|
import type { SequencePropsSubscriptionKey, _InternalTypes } from 'remotion';
|
|
7
|
+
import type { StaticFile } from '../api/get-static-files';
|
|
7
8
|
import type { CompType } from '../components/NewComposition/DuplicateComposition';
|
|
8
9
|
import type { QuickSwitcherMode } from '../components/QuickSwitcher/NoResults';
|
|
9
10
|
import type { RenderType } from '../components/RenderModal/RenderModalAdvanced';
|
|
@@ -159,6 +160,10 @@ export type ModalState = {
|
|
|
159
160
|
type: 'quick-switcher';
|
|
160
161
|
mode: QuickSwitcherMode;
|
|
161
162
|
invocationTimestamp: number;
|
|
163
|
+
assetSelection: {
|
|
164
|
+
initialQuery: string;
|
|
165
|
+
onSelected: (asset: StaticFile) => void;
|
|
166
|
+
} | null;
|
|
162
167
|
} | AddEffectModalState | ConfirmationDialogState | SvgImportDialogState;
|
|
163
168
|
export type ModalContextType = {
|
|
164
169
|
selectedModal: ModalState | null;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.500",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"react-dom": ">=16.8.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@remotion/drag-and-drop": "4.0.
|
|
27
|
+
"@remotion/drag-and-drop": "4.0.500",
|
|
28
28
|
"semver": "7.5.3",
|
|
29
|
-
"remotion": "4.0.
|
|
30
|
-
"@remotion/canvas-capture": "4.0.
|
|
31
|
-
"@remotion/player": "4.0.
|
|
32
|
-
"@remotion/media-utils": "4.0.
|
|
33
|
-
"@remotion/renderer": "4.0.
|
|
34
|
-
"@remotion/web-renderer": "4.0.
|
|
35
|
-
"@remotion/studio-shared": "4.0.
|
|
36
|
-
"@remotion/timeline-utils": "4.0.
|
|
37
|
-
"@remotion/zod-types": "4.0.
|
|
29
|
+
"remotion": "4.0.500",
|
|
30
|
+
"@remotion/canvas-capture": "4.0.500",
|
|
31
|
+
"@remotion/player": "4.0.500",
|
|
32
|
+
"@remotion/media-utils": "4.0.500",
|
|
33
|
+
"@remotion/renderer": "4.0.500",
|
|
34
|
+
"@remotion/web-renderer": "4.0.500",
|
|
35
|
+
"@remotion/studio-shared": "4.0.500",
|
|
36
|
+
"@remotion/timeline-utils": "4.0.500",
|
|
37
|
+
"@remotion/zod-types": "4.0.500",
|
|
38
38
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
39
39
|
"mediabunny": "1.50.8",
|
|
40
40
|
"memfs": "3.4.3",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react": "19.2.3",
|
|
46
46
|
"react-dom": "19.2.3",
|
|
47
47
|
"@types/semver": "7.5.3",
|
|
48
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
48
|
+
"@remotion/eslint-config-internal": "4.0.500",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
50
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
51
51
|
},
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTimelineSequenceHash = void 0;
|
|
4
|
-
// The goal for this function is to calculate an as unique as possible identifier
|
|
5
|
-
// for a sequence based on it's properties. A sequence can be registered multiple times
|
|
6
|
-
// from main preview and from thumbnails and we use this to deduplicate it.
|
|
7
|
-
// This is why we don't use `id` properties as they will
|
|
8
|
-
// differ as a hash.
|
|
9
|
-
const getTimelineSequenceHash = (sequence, allSequences, hashesUsedInRoot, cache) => {
|
|
10
|
-
if (cache[sequence.id]) {
|
|
11
|
-
return cache[sequence.id];
|
|
12
|
-
}
|
|
13
|
-
const parent = allSequences.find((a) => a.id === sequence.parent);
|
|
14
|
-
const baseHash = [
|
|
15
|
-
parent
|
|
16
|
-
? (0, exports.getTimelineSequenceHash)(parent, allSequences, hashesUsedInRoot, cache)
|
|
17
|
-
: null,
|
|
18
|
-
sequence.displayName,
|
|
19
|
-
sequence.duration,
|
|
20
|
-
sequence.from,
|
|
21
|
-
sequence.type,
|
|
22
|
-
sequence.type === 'audio' ? sequence.src : null,
|
|
23
|
-
sequence.type === 'audio' ? sequence.volume : null,
|
|
24
|
-
sequence.type === 'video' ? sequence.src : null,
|
|
25
|
-
sequence.type === 'video' ? sequence.volume : null,
|
|
26
|
-
].join('-');
|
|
27
|
-
const actualHash = baseHash +
|
|
28
|
-
hashesUsedInRoot[sequence.rootId].filter((h) => h === baseHash).length;
|
|
29
|
-
hashesUsedInRoot[sequence.rootId].push(baseHash);
|
|
30
|
-
cache[sequence.id] = actualHash;
|
|
31
|
-
return actualHash;
|
|
32
|
-
};
|
|
33
|
-
exports.getTimelineSequenceHash = getTimelineSequenceHash;
|