@remotion/studio 4.0.471 → 4.0.472
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 +10 -1
- package/dist/components/Canvas.js +98 -0
- package/dist/components/CompositionSelectorItem.d.ts +1 -0
- package/dist/components/CompositionSelectorItem.js +12 -4
- package/dist/components/ContextMenu.js +54 -46
- package/dist/components/Editor.js +14 -6
- package/dist/components/Modals.js +3 -1
- package/dist/components/NewComposition/CodemodFooter.js +2 -2
- package/dist/components/NewComposition/DeleteFolder.d.ts +6 -0
- package/dist/components/NewComposition/DeleteFolder.js +39 -0
- package/dist/components/NewComposition/RenameFolder.d.ts +6 -0
- package/dist/components/NewComposition/RenameFolder.js +60 -0
- package/dist/components/SelectedOutlineOverlay.d.ts +81 -4
- package/dist/components/SelectedOutlineOverlay.js +405 -54
- package/dist/components/Splitter/SplitterContainer.js +9 -0
- package/dist/components/Splitter/SplitterHandle.js +63 -70
- package/dist/components/Timeline/Timeline.js +47 -2
- package/dist/components/Timeline/TimelineArrayField.d.ts +9 -0
- package/dist/components/Timeline/TimelineArrayField.js +210 -0
- package/dist/components/Timeline/TimelineBooleanField.d.ts +2 -2
- package/dist/components/Timeline/TimelineBooleanField.js +2 -2
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +20 -0
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +265 -0
- package/dist/components/Timeline/TimelineColorField.d.ts +2 -2
- package/dist/components/Timeline/TimelineColorField.js +2 -8
- package/dist/components/Timeline/TimelineEffectItem.js +2 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +95 -25
- package/dist/components/Timeline/TimelineEnumField.d.ts +2 -2
- package/dist/components/Timeline/TimelineEnumField.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +4 -3
- package/dist/components/Timeline/TimelineKeyframeControls.js +37 -23
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +7 -2
- package/dist/components/Timeline/TimelineKeyframedValue.js +22 -8
- package/dist/components/Timeline/TimelineLayerEye.d.ts +1 -0
- package/dist/components/Timeline/TimelineLayerEye.js +8 -3
- package/dist/components/Timeline/TimelineNumberField.d.ts +2 -2
- package/dist/components/Timeline/TimelineNumberField.js +7 -11
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +17 -0
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +53 -0
- package/dist/components/Timeline/TimelineRotationField.d.ts +2 -2
- package/dist/components/Timeline/TimelineRotationField.js +41 -24
- package/dist/components/Timeline/TimelineRowChrome.js +8 -7
- package/dist/components/Timeline/TimelineScaleField.d.ts +20 -0
- package/dist/components/Timeline/TimelineScaleField.js +314 -0
- package/dist/components/Timeline/TimelineSchemaField.d.ts +3 -2
- package/dist/components/Timeline/TimelineSchemaField.js +8 -42
- package/dist/components/Timeline/TimelineSelection.js +3 -2
- package/dist/components/Timeline/TimelineSequence.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequence.js +51 -10
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +7 -7
- package/dist/components/Timeline/TimelineSequencePropItem.js +82 -21
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +58 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +528 -0
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTranslateField.d.ts +2 -2
- package/dist/components/Timeline/TimelineTranslateField.js +21 -25
- package/dist/components/Timeline/TimelineUvCoordinateField.d.ts +2 -2
- package/dist/components/Timeline/TimelineUvCoordinateField.js +20 -26
- package/dist/components/Timeline/call-add-keyframe.js +2 -0
- package/dist/components/Timeline/get-node-keyframes.d.ts +5 -2
- package/dist/components/Timeline/get-node-keyframes.js +38 -5
- package/dist/components/Timeline/get-timeline-keyframes.js +4 -4
- package/dist/components/Timeline/reset-selected-timeline-props.js +19 -6
- package/dist/components/Timeline/timeline-field-utils.d.ts +1 -0
- package/dist/components/Timeline/timeline-field-utils.js +5 -1
- package/dist/components/Timeline/timeline-translate-utils.js +6 -2
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +7 -0
- package/dist/components/TopPanel.d.ts +1 -1
- package/dist/components/folder-menu-items.d.ts +12 -0
- package/dist/components/folder-menu-items.js +147 -0
- package/dist/components/import-assets.d.ts +6 -0
- package/dist/components/import-assets.js +157 -0
- package/dist/esm/{chunk-z0z9d4r0.js → chunk-48grt472.js} +8936 -5886
- package/dist/esm/internals.mjs +8936 -5886
- package/dist/esm/previewEntry.mjs +8748 -5698
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.js +7 -3
- package/dist/helpers/create-folder-tree.js +1 -0
- package/dist/helpers/detect-file-type.d.ts +69 -0
- package/dist/helpers/detect-file-type.js +278 -0
- package/dist/helpers/get-folder-id.d.ts +4 -0
- package/dist/helpers/get-folder-id.js +7 -0
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -0
- package/dist/helpers/timeline-layout.js +5 -1
- package/dist/helpers/validate-folder-rename.d.ts +6 -0
- package/dist/helpers/validate-folder-rename.js +19 -0
- package/dist/state/modals.d.ts +10 -0
- package/dist/state/scale-lock.d.ts +18 -0
- package/dist/state/scale-lock.js +59 -0
- package/package.json +10 -10
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -209,7 +209,7 @@ var renderContent = (Root) => {
|
|
|
209
209
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
210
210
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
211
211
|
}));
|
|
212
|
-
import("./chunk-
|
|
212
|
+
import("./chunk-48grt472.js").then(({ StudioInternals }) => {
|
|
213
213
|
window.remotion_isStudio = true;
|
|
214
214
|
window.remotion_isReadOnlyStudio = true;
|
|
215
215
|
window.remotion_inputProps = "{}";
|
|
@@ -21,8 +21,8 @@ const getInheritedLoopDisplay = (sequence, sequences) => {
|
|
|
21
21
|
return getInheritedLoopDisplay(parent, sequences);
|
|
22
22
|
};
|
|
23
23
|
const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
24
|
-
var _a;
|
|
25
|
-
var
|
|
24
|
+
var _a, _b;
|
|
25
|
+
var _c;
|
|
26
26
|
const sortedSequences = (0, sort_by_nonce_history_1.sortItemsByNonceHistory)(sequences);
|
|
27
27
|
const tracks = [];
|
|
28
28
|
if (sortedSequences.length === 0) {
|
|
@@ -44,7 +44,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
|
44
44
|
const cascadedStart = (0, get_sequence_visible_range_1.getCascadedStart)(sequence, sortedSequences);
|
|
45
45
|
const visibleStart = (0, get_sequence_visible_range_1.getTimelineVisibleStart)(sequence, sortedSequences);
|
|
46
46
|
const visibleDuration = (0, get_sequence_visible_range_1.getTimelineVisibleDuration)(sequence, sortedSequences);
|
|
47
|
-
const overrideId = (
|
|
47
|
+
const overrideId = (_c = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.overrideId) !== null && _c !== void 0 ? _c : null;
|
|
48
48
|
const nodePath = overrideId ? overrideIdsToNodePaths[overrideId] : null;
|
|
49
49
|
const hasKeyframeRows = sequence.controls !== null || sequence.effects.length > 0;
|
|
50
50
|
tracks.push({
|
|
@@ -63,12 +63,14 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
|
63
63
|
keyframeDisplayOffset: hasKeyframeRows
|
|
64
64
|
? cascadedStart - sequence.from
|
|
65
65
|
: 0,
|
|
66
|
+
sequenceFrameOffset: visibleStart - cascadedStart,
|
|
66
67
|
nodePathInfo: nodePath
|
|
67
68
|
? {
|
|
68
69
|
sequenceSubscriptionKey: nodePath,
|
|
69
70
|
auxiliaryKeys: [],
|
|
70
71
|
index: 0,
|
|
71
72
|
numberOfSequencesWithThisNodePath: 0,
|
|
73
|
+
supportsEffects: ((_b = sequence.controls) === null || _b === void 0 ? void 0 : _b.supportsEffects) === true,
|
|
72
74
|
}
|
|
73
75
|
: null,
|
|
74
76
|
});
|
|
@@ -106,6 +108,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
|
106
108
|
auxiliaryKeys: track.nodePathInfo.auxiliaryKeys,
|
|
107
109
|
index,
|
|
108
110
|
numberOfSequencesWithThisNodePath: 0,
|
|
111
|
+
supportsEffects: track.nodePathInfo.supportsEffects,
|
|
109
112
|
},
|
|
110
113
|
};
|
|
111
114
|
})
|
|
@@ -122,6 +125,7 @@ const calculateTimeline = ({ sequences, overrideIdsToNodePaths, }) => {
|
|
|
122
125
|
auxiliaryKeys: track.nodePathInfo.auxiliaryKeys,
|
|
123
126
|
index: track.nodePathInfo.index,
|
|
124
127
|
numberOfSequencesWithThisNodePath: (_a = nodePathIndexCounters.get(key)) !== null && _a !== void 0 ? _a : 0,
|
|
128
|
+
supportsEffects: track.nodePathInfo.supportsEffects,
|
|
125
129
|
},
|
|
126
130
|
};
|
|
127
131
|
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type FileDimensions = {
|
|
2
|
+
readonly width: number;
|
|
3
|
+
readonly height: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const matchesPattern: (pattern: Uint8Array<ArrayBufferLike>) => (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
6
|
+
export declare const isRiffAvi: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
7
|
+
export declare const isRiffWave: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
8
|
+
export declare const isWebm: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
9
|
+
export declare const isIsoBaseMedia: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
10
|
+
export declare const isTransportStream: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
11
|
+
export declare const isMp3: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
12
|
+
export declare const isAac: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
13
|
+
export declare const isFlac: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
14
|
+
export declare const isM3u: (data: Uint8Array<ArrayBufferLike>) => boolean;
|
|
15
|
+
export type RiffType = {
|
|
16
|
+
type: 'riff';
|
|
17
|
+
};
|
|
18
|
+
export type WebmType = {
|
|
19
|
+
type: 'webm';
|
|
20
|
+
};
|
|
21
|
+
export type IsoBaseMediaType = {
|
|
22
|
+
type: 'iso-base-media';
|
|
23
|
+
};
|
|
24
|
+
export type TransportStreamType = {
|
|
25
|
+
type: 'transport-stream';
|
|
26
|
+
};
|
|
27
|
+
export type Mp3Type = {
|
|
28
|
+
type: 'mp3';
|
|
29
|
+
};
|
|
30
|
+
export type AacType = {
|
|
31
|
+
type: 'aac';
|
|
32
|
+
};
|
|
33
|
+
export type WavType = {
|
|
34
|
+
type: 'wav';
|
|
35
|
+
};
|
|
36
|
+
export type GifType = {
|
|
37
|
+
type: 'gif';
|
|
38
|
+
dimensions: FileDimensions;
|
|
39
|
+
};
|
|
40
|
+
export type FlacType = {
|
|
41
|
+
type: 'flac';
|
|
42
|
+
};
|
|
43
|
+
export type M3uType = {
|
|
44
|
+
type: 'm3u';
|
|
45
|
+
};
|
|
46
|
+
export type PngType = {
|
|
47
|
+
type: 'png';
|
|
48
|
+
dimensions: FileDimensions | null;
|
|
49
|
+
};
|
|
50
|
+
export type JpegType = {
|
|
51
|
+
type: 'jpeg';
|
|
52
|
+
dimensions: FileDimensions | null;
|
|
53
|
+
};
|
|
54
|
+
export type WebpType = {
|
|
55
|
+
type: 'webp';
|
|
56
|
+
dimensions: FileDimensions | null;
|
|
57
|
+
};
|
|
58
|
+
export type BmpType = {
|
|
59
|
+
type: 'bmp';
|
|
60
|
+
dimensions: FileDimensions | null;
|
|
61
|
+
};
|
|
62
|
+
export type PdfType = {
|
|
63
|
+
type: 'pdf';
|
|
64
|
+
};
|
|
65
|
+
export type UnknownType = {
|
|
66
|
+
type: 'unknown';
|
|
67
|
+
};
|
|
68
|
+
export type FileType = JpegType | WebpType | RiffType | WebmType | WavType | PdfType | AacType | IsoBaseMediaType | TransportStreamType | Mp3Type | GifType | PngType | BmpType | AacType | FlacType | M3uType | UnknownType;
|
|
69
|
+
export declare const detectFileType: (data: Uint8Array<ArrayBufferLike>) => FileType;
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectFileType = exports.isM3u = exports.isFlac = exports.isAac = exports.isMp3 = exports.isTransportStream = exports.isIsoBaseMedia = exports.isWebm = exports.isRiffWave = exports.isRiffAvi = exports.matchesPattern = void 0;
|
|
4
|
+
const webmPattern = new Uint8Array([0x1a, 0x45, 0xdf, 0xa3]);
|
|
5
|
+
const matchesPattern = (pattern) => {
|
|
6
|
+
return (data) => {
|
|
7
|
+
return pattern.every((value, index) => data[index] === value);
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
exports.matchesPattern = matchesPattern;
|
|
11
|
+
const isRiffAvi = (data) => {
|
|
12
|
+
const riffPattern = new Uint8Array([0x52, 0x49, 0x46, 0x46]);
|
|
13
|
+
if (!(0, exports.matchesPattern)(riffPattern)(data.subarray(0, 4))) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const fileType = data.subarray(8, 12);
|
|
17
|
+
const aviPattern = new Uint8Array([0x41, 0x56, 0x49, 0x20]);
|
|
18
|
+
return (0, exports.matchesPattern)(aviPattern)(fileType);
|
|
19
|
+
};
|
|
20
|
+
exports.isRiffAvi = isRiffAvi;
|
|
21
|
+
const isRiffWave = (data) => {
|
|
22
|
+
const riffPattern = new Uint8Array([0x52, 0x49, 0x46, 0x46]);
|
|
23
|
+
if (!(0, exports.matchesPattern)(riffPattern)(data.subarray(0, 4))) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const fileType = data.subarray(8, 12);
|
|
27
|
+
const wavePattern = new Uint8Array([0x57, 0x41, 0x56, 0x45]);
|
|
28
|
+
return (0, exports.matchesPattern)(wavePattern)(fileType);
|
|
29
|
+
};
|
|
30
|
+
exports.isRiffWave = isRiffWave;
|
|
31
|
+
const isWebm = (data) => {
|
|
32
|
+
return (0, exports.matchesPattern)(webmPattern)(data.subarray(0, 4));
|
|
33
|
+
};
|
|
34
|
+
exports.isWebm = isWebm;
|
|
35
|
+
const isIsoBaseMedia = (data) => {
|
|
36
|
+
const isoBaseMediaMp4Pattern = new TextEncoder().encode('ftyp');
|
|
37
|
+
return (0, exports.matchesPattern)(isoBaseMediaMp4Pattern)(data.subarray(4, 8));
|
|
38
|
+
};
|
|
39
|
+
exports.isIsoBaseMedia = isIsoBaseMedia;
|
|
40
|
+
const isTransportStream = (data) => {
|
|
41
|
+
return data[0] === 0x47 && data[188] === 0x47;
|
|
42
|
+
};
|
|
43
|
+
exports.isTransportStream = isTransportStream;
|
|
44
|
+
const isMp3 = (data) => {
|
|
45
|
+
const mpegPattern = new Uint8Array([0xff, 0xf3]);
|
|
46
|
+
const mpegPattern2 = new Uint8Array([0xff, 0xfb]);
|
|
47
|
+
const id3v4Pattern = new Uint8Array([0x49, 0x44, 0x33, 4]);
|
|
48
|
+
const id3v3Pattern = new Uint8Array([0x49, 0x44, 0x33, 3]);
|
|
49
|
+
const id3v2Pattern = new Uint8Array([0x49, 0x44, 0x33, 2]);
|
|
50
|
+
const subarray = data.subarray(0, 4);
|
|
51
|
+
return ((0, exports.matchesPattern)(mpegPattern)(subarray) ||
|
|
52
|
+
(0, exports.matchesPattern)(mpegPattern2)(subarray) ||
|
|
53
|
+
(0, exports.matchesPattern)(id3v4Pattern)(subarray) ||
|
|
54
|
+
(0, exports.matchesPattern)(id3v3Pattern)(subarray) ||
|
|
55
|
+
(0, exports.matchesPattern)(id3v2Pattern)(subarray));
|
|
56
|
+
};
|
|
57
|
+
exports.isMp3 = isMp3;
|
|
58
|
+
const isAac = (data) => {
|
|
59
|
+
const aacPattern = new Uint8Array([0xff, 0xf1]);
|
|
60
|
+
return (0, exports.matchesPattern)(aacPattern)(data.subarray(0, 2));
|
|
61
|
+
};
|
|
62
|
+
exports.isAac = isAac;
|
|
63
|
+
const isFlac = (data) => {
|
|
64
|
+
const flacPattern = new Uint8Array([0x66, 0x4c, 0x61, 0x43]);
|
|
65
|
+
return (0, exports.matchesPattern)(flacPattern)(data.subarray(0, 4));
|
|
66
|
+
};
|
|
67
|
+
exports.isFlac = isFlac;
|
|
68
|
+
const isM3u = (data) => {
|
|
69
|
+
return new TextDecoder('utf-8').decode(data.slice(0, 7)) === '#EXTM3U';
|
|
70
|
+
};
|
|
71
|
+
exports.isM3u = isM3u;
|
|
72
|
+
const getPngDimensions = (pngData) => {
|
|
73
|
+
if (pngData.length < 24) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const view = new DataView(pngData.buffer, pngData.byteOffset);
|
|
77
|
+
const pngSignature = [137, 80, 78, 71, 13, 10, 26, 10];
|
|
78
|
+
for (let i = 0; i < 8; i++) {
|
|
79
|
+
if (pngData[i] !== pngSignature[i]) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
width: view.getUint32(16, false),
|
|
85
|
+
height: view.getUint32(20, false),
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
const isPng = (data) => {
|
|
89
|
+
const pngPattern = new Uint8Array([0x89, 0x50, 0x4e, 0x47]);
|
|
90
|
+
if ((0, exports.matchesPattern)(pngPattern)(data.subarray(0, 4))) {
|
|
91
|
+
const png = getPngDimensions(data);
|
|
92
|
+
return { dimensions: png, type: 'png' };
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
};
|
|
96
|
+
const getJpegDimensions = (data) => {
|
|
97
|
+
let offset = 0;
|
|
98
|
+
const readUint16BE = (o) => {
|
|
99
|
+
return (data[o] << 8) | data[o + 1];
|
|
100
|
+
};
|
|
101
|
+
if (readUint16BE(offset) !== 0xffd8) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
offset += 2;
|
|
105
|
+
while (offset < data.length) {
|
|
106
|
+
if (data[offset] === 0xff) {
|
|
107
|
+
const marker = data[offset + 1];
|
|
108
|
+
if (marker === 0xc0 || marker === 0xc2) {
|
|
109
|
+
const height = readUint16BE(offset + 5);
|
|
110
|
+
const width = readUint16BE(offset + 7);
|
|
111
|
+
return { width, height };
|
|
112
|
+
}
|
|
113
|
+
const length = readUint16BE(offset + 2);
|
|
114
|
+
offset += length + 2;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
offset++;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
};
|
|
122
|
+
const isJpeg = (data) => {
|
|
123
|
+
const jpegPattern = new Uint8Array([0xff, 0xd8]);
|
|
124
|
+
const jpeg = (0, exports.matchesPattern)(jpegPattern)(data.subarray(0, 2));
|
|
125
|
+
if (!jpeg) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const dim = getJpegDimensions(data);
|
|
129
|
+
return { dimensions: dim, type: 'jpeg' };
|
|
130
|
+
};
|
|
131
|
+
const getGifDimensions = (data) => {
|
|
132
|
+
const view = new DataView(data.buffer, data.byteOffset);
|
|
133
|
+
const width = view.getUint16(6, true);
|
|
134
|
+
const height = view.getUint16(8, true);
|
|
135
|
+
return { width, height };
|
|
136
|
+
};
|
|
137
|
+
const isGif = (data) => {
|
|
138
|
+
const gifPattern = new Uint8Array([0x47, 0x49, 0x46, 0x38]);
|
|
139
|
+
if ((0, exports.matchesPattern)(gifPattern)(data.subarray(0, 4))) {
|
|
140
|
+
return { type: 'gif', dimensions: getGifDimensions(data) };
|
|
141
|
+
}
|
|
142
|
+
return null;
|
|
143
|
+
};
|
|
144
|
+
const getWebPDimensions = (bytes) => {
|
|
145
|
+
if (bytes.length < 30) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
if (bytes[0] !== 0x52 ||
|
|
149
|
+
bytes[1] !== 0x49 ||
|
|
150
|
+
bytes[2] !== 0x46 ||
|
|
151
|
+
bytes[3] !== 0x46 ||
|
|
152
|
+
bytes[8] !== 0x57 ||
|
|
153
|
+
bytes[9] !== 0x45 ||
|
|
154
|
+
bytes[10] !== 0x42 ||
|
|
155
|
+
bytes[11] !== 0x50) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
if (bytes[12] === 0x56 && bytes[13] === 0x50 && bytes[14] === 0x38) {
|
|
159
|
+
if (bytes[15] === 0x20) {
|
|
160
|
+
return {
|
|
161
|
+
width: bytes[26] | ((bytes[27] << 8) & 0x3fff),
|
|
162
|
+
height: bytes[28] | ((bytes[29] << 8) & 0x3fff),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (bytes[12] === 0x56 &&
|
|
167
|
+
bytes[13] === 0x50 &&
|
|
168
|
+
bytes[14] === 0x38 &&
|
|
169
|
+
bytes[15] === 0x4c) {
|
|
170
|
+
return {
|
|
171
|
+
width: 1 + (bytes[21] | ((bytes[22] & 0x3f) << 8)),
|
|
172
|
+
height: 1 +
|
|
173
|
+
(((bytes[22] & 0xc0) >> 6) |
|
|
174
|
+
(bytes[23] << 2) |
|
|
175
|
+
((bytes[24] & 0x0f) << 10)),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (bytes[12] === 0x56 &&
|
|
179
|
+
bytes[13] === 0x50 &&
|
|
180
|
+
bytes[14] === 0x38 &&
|
|
181
|
+
bytes[15] === 0x58) {
|
|
182
|
+
return {
|
|
183
|
+
width: 1 + (bytes[24] | (bytes[25] << 8) | (bytes[26] << 16)),
|
|
184
|
+
height: 1 + (bytes[27] | (bytes[28] << 8) | (bytes[29] << 16)),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return null;
|
|
188
|
+
};
|
|
189
|
+
const isWebp = (data) => {
|
|
190
|
+
const webpPattern = new Uint8Array([0x52, 0x49, 0x46, 0x46]);
|
|
191
|
+
if ((0, exports.matchesPattern)(webpPattern)(data.subarray(0, 4))) {
|
|
192
|
+
return {
|
|
193
|
+
type: 'webp',
|
|
194
|
+
dimensions: getWebPDimensions(data),
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
};
|
|
199
|
+
const getBmpDimensions = (bmpData) => {
|
|
200
|
+
if (bmpData.length < 26) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
const view = new DataView(bmpData.buffer, bmpData.byteOffset);
|
|
204
|
+
return {
|
|
205
|
+
width: view.getUint32(18, true),
|
|
206
|
+
height: Math.abs(view.getInt32(22, true)),
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
const isBmp = (data) => {
|
|
210
|
+
const bmpPattern = new Uint8Array([0x42, 0x4d]);
|
|
211
|
+
if ((0, exports.matchesPattern)(bmpPattern)(data.subarray(0, 2))) {
|
|
212
|
+
const bmp = getBmpDimensions(data);
|
|
213
|
+
return { dimensions: bmp, type: 'bmp' };
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
};
|
|
217
|
+
const isPdf = (data) => {
|
|
218
|
+
if (data.length < 4) {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
const pdfPattern = new Uint8Array([0x25, 0x50, 0x44, 0x46]);
|
|
222
|
+
return (0, exports.matchesPattern)(pdfPattern)(data.subarray(0, 4)) ? { type: 'pdf' } : null;
|
|
223
|
+
};
|
|
224
|
+
const detectFileType = (data) => {
|
|
225
|
+
if ((0, exports.isRiffWave)(data)) {
|
|
226
|
+
return { type: 'wav' };
|
|
227
|
+
}
|
|
228
|
+
if ((0, exports.isRiffAvi)(data)) {
|
|
229
|
+
return { type: 'riff' };
|
|
230
|
+
}
|
|
231
|
+
if ((0, exports.isAac)(data)) {
|
|
232
|
+
return { type: 'aac' };
|
|
233
|
+
}
|
|
234
|
+
if ((0, exports.isFlac)(data)) {
|
|
235
|
+
return { type: 'flac' };
|
|
236
|
+
}
|
|
237
|
+
if ((0, exports.isM3u)(data)) {
|
|
238
|
+
return { type: 'm3u' };
|
|
239
|
+
}
|
|
240
|
+
const webp = isWebp(data);
|
|
241
|
+
if (webp) {
|
|
242
|
+
return webp;
|
|
243
|
+
}
|
|
244
|
+
if ((0, exports.isWebm)(data)) {
|
|
245
|
+
return { type: 'webm' };
|
|
246
|
+
}
|
|
247
|
+
if ((0, exports.isIsoBaseMedia)(data)) {
|
|
248
|
+
return { type: 'iso-base-media' };
|
|
249
|
+
}
|
|
250
|
+
if ((0, exports.isTransportStream)(data)) {
|
|
251
|
+
return { type: 'transport-stream' };
|
|
252
|
+
}
|
|
253
|
+
if ((0, exports.isMp3)(data)) {
|
|
254
|
+
return { type: 'mp3' };
|
|
255
|
+
}
|
|
256
|
+
const gif = isGif(data);
|
|
257
|
+
if (gif) {
|
|
258
|
+
return gif;
|
|
259
|
+
}
|
|
260
|
+
const png = isPng(data);
|
|
261
|
+
if (png) {
|
|
262
|
+
return png;
|
|
263
|
+
}
|
|
264
|
+
const pdf = isPdf(data);
|
|
265
|
+
if (pdf) {
|
|
266
|
+
return pdf;
|
|
267
|
+
}
|
|
268
|
+
const bmp = isBmp(data);
|
|
269
|
+
if (bmp) {
|
|
270
|
+
return bmp;
|
|
271
|
+
}
|
|
272
|
+
const jpeg = isJpeg(data);
|
|
273
|
+
if (jpeg) {
|
|
274
|
+
return jpeg;
|
|
275
|
+
}
|
|
276
|
+
return { type: 'unknown' };
|
|
277
|
+
};
|
|
278
|
+
exports.detectFileType = detectFileType;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFolderId = void 0;
|
|
4
|
+
const getFolderId = ({ folderName, parentName, }) => {
|
|
5
|
+
return [parentName, folderName].filter(Boolean).join('/');
|
|
6
|
+
};
|
|
7
|
+
exports.getFolderId = getFolderId;
|
|
@@ -4,12 +4,14 @@ export type SequenceNodePathInfo = {
|
|
|
4
4
|
auxiliaryKeys: string[];
|
|
5
5
|
index: number;
|
|
6
6
|
numberOfSequencesWithThisNodePath: number;
|
|
7
|
+
supportsEffects: boolean;
|
|
7
8
|
};
|
|
8
9
|
type Track = {
|
|
9
10
|
sequence: TSequence;
|
|
10
11
|
depth: number;
|
|
11
12
|
nodePathInfo: SequenceNodePathInfo | null;
|
|
12
13
|
keyframeDisplayOffset: number;
|
|
14
|
+
sequenceFrameOffset: number;
|
|
13
15
|
};
|
|
14
16
|
export type TrackWithHash = Track & {
|
|
15
17
|
hash: string;
|
|
@@ -15,7 +15,7 @@ exports.EXPANDED_SECTION_PADDING_RIGHT = 10;
|
|
|
15
15
|
const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, codeValues, }) => {
|
|
16
16
|
var _a;
|
|
17
17
|
const roots = [];
|
|
18
|
-
const { sequenceSubscriptionKey, index, auxiliaryKeys } = nodePathInfo;
|
|
18
|
+
const { sequenceSubscriptionKey, index, auxiliaryKeys, supportsEffects } = nodePathInfo;
|
|
19
19
|
const controlFields = (0, studio_shared_1.getFieldsToShow)({
|
|
20
20
|
schema: sequence.controls.schema,
|
|
21
21
|
currentRuntimeValueDotNotation: sequence.controls.currentRuntimeValueDotNotation,
|
|
@@ -32,6 +32,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
32
32
|
auxiliaryKeys: [...auxiliaryKeys, 'controls', f.key],
|
|
33
33
|
index,
|
|
34
34
|
numberOfSequencesWithThisNodePath: 0,
|
|
35
|
+
supportsEffects,
|
|
35
36
|
},
|
|
36
37
|
label: (_a = f.description) !== null && _a !== void 0 ? _a : f.key,
|
|
37
38
|
field: f,
|
|
@@ -46,6 +47,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
46
47
|
auxiliaryKeys: [...auxiliaryKeys, 'effects'],
|
|
47
48
|
index,
|
|
48
49
|
numberOfSequencesWithThisNodePath: 0,
|
|
50
|
+
supportsEffects,
|
|
49
51
|
},
|
|
50
52
|
label: 'Effects',
|
|
51
53
|
effectInfo: null,
|
|
@@ -65,6 +67,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
65
67
|
auxiliaryKeys: [...auxiliaryKeys, 'effects', i.toString()],
|
|
66
68
|
index,
|
|
67
69
|
numberOfSequencesWithThisNodePath: 0,
|
|
70
|
+
supportsEffects,
|
|
68
71
|
},
|
|
69
72
|
label: effect.label,
|
|
70
73
|
effectInfo: {
|
|
@@ -86,6 +89,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
86
89
|
],
|
|
87
90
|
index,
|
|
88
91
|
numberOfSequencesWithThisNodePath: 0,
|
|
92
|
+
supportsEffects,
|
|
89
93
|
},
|
|
90
94
|
label: (_a = f.description) !== null && _a !== void 0 ? _a : f.key,
|
|
91
95
|
field: f,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFolderRename = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const validateFolderRename = ({ folders, newName, originalName, parentName, }) => {
|
|
6
|
+
if (!remotion_1.Internals.isFolderNameValid(newName)) {
|
|
7
|
+
return remotion_1.Internals.invalidFolderNameErrorMessage;
|
|
8
|
+
}
|
|
9
|
+
if (newName === originalName) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
if (folders.find((folder) => {
|
|
13
|
+
return folder.name === newName && folder.parent === parentName;
|
|
14
|
+
})) {
|
|
15
|
+
return `A folder with that name already exists.`;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
exports.validateFolderRename = validateFolderRename;
|
package/dist/state/modals.d.ts
CHANGED
|
@@ -96,6 +96,16 @@ export type ModalState = {
|
|
|
96
96
|
} | {
|
|
97
97
|
type: 'rename-comp';
|
|
98
98
|
compositionId: string;
|
|
99
|
+
} | {
|
|
100
|
+
type: 'delete-folder';
|
|
101
|
+
folderName: string;
|
|
102
|
+
parentName: string | null;
|
|
103
|
+
stack: string | null;
|
|
104
|
+
} | {
|
|
105
|
+
type: 'rename-folder';
|
|
106
|
+
folderName: string;
|
|
107
|
+
parentName: string | null;
|
|
108
|
+
stack: string | null;
|
|
99
109
|
} | {
|
|
100
110
|
type: 'input-props-override';
|
|
101
111
|
} | RenderModalState | WebRenderModalState | {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SequencePropsSubscriptionKey } from 'remotion';
|
|
3
|
+
export type ScaleLockContextValue = {
|
|
4
|
+
readonly getScaleLockState: ({ defaultValue, fieldKey, nodePath }: {
|
|
5
|
+
readonly defaultValue: boolean;
|
|
6
|
+
readonly fieldKey: string;
|
|
7
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
8
|
+
}) => boolean;
|
|
9
|
+
readonly setScaleLockState: ({ fieldKey, linked, nodePath }: {
|
|
10
|
+
readonly fieldKey: string;
|
|
11
|
+
readonly linked: boolean;
|
|
12
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
13
|
+
}) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const ScaleLockContext: React.Context<ScaleLockContextValue>;
|
|
16
|
+
export declare const ScaleLockProvider: React.FC<{
|
|
17
|
+
readonly children: React.ReactNode;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ScaleLockProvider = exports.ScaleLockContext = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const remotion_1 = require("remotion");
|
|
40
|
+
const makeScaleLockKey = ({ fieldKey, nodePath, }) => `${remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath)}.${fieldKey}`;
|
|
41
|
+
exports.ScaleLockContext = react_1.default.createContext({
|
|
42
|
+
getScaleLockState: ({ defaultValue }) => defaultValue,
|
|
43
|
+
setScaleLockState: () => undefined,
|
|
44
|
+
});
|
|
45
|
+
const ScaleLockProvider = ({ children }) => {
|
|
46
|
+
const [states, setStates] = (0, react_1.useState)({});
|
|
47
|
+
const getScaleLockState = (0, react_1.useCallback)(({ defaultValue, fieldKey, nodePath }) => {
|
|
48
|
+
var _a;
|
|
49
|
+
const key = makeScaleLockKey({ fieldKey, nodePath });
|
|
50
|
+
return (_a = states[key]) !== null && _a !== void 0 ? _a : defaultValue;
|
|
51
|
+
}, [states]);
|
|
52
|
+
const setScaleLockState = (0, react_1.useCallback)(({ fieldKey, linked, nodePath }) => {
|
|
53
|
+
const key = makeScaleLockKey({ fieldKey, nodePath });
|
|
54
|
+
setStates((current) => ({ ...current, [key]: linked }));
|
|
55
|
+
}, []);
|
|
56
|
+
const value = (0, react_1.useMemo)(() => ({ getScaleLockState, setScaleLockState }), [getScaleLockState, setScaleLockState]);
|
|
57
|
+
return (jsx_runtime_1.jsx(exports.ScaleLockContext.Provider, { value: value, children: children }));
|
|
58
|
+
};
|
|
59
|
+
exports.ScaleLockProvider = ScaleLockProvider;
|
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.472",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"semver": "7.5.3",
|
|
28
|
-
"remotion": "4.0.
|
|
29
|
-
"@remotion/player": "4.0.
|
|
30
|
-
"@remotion/media-utils": "4.0.
|
|
31
|
-
"@remotion/renderer": "4.0.
|
|
32
|
-
"@remotion/web-renderer": "4.0.
|
|
33
|
-
"@remotion/studio-shared": "4.0.
|
|
34
|
-
"@remotion/timeline-utils": "4.0.
|
|
35
|
-
"@remotion/zod-types": "4.0.
|
|
28
|
+
"remotion": "4.0.472",
|
|
29
|
+
"@remotion/player": "4.0.472",
|
|
30
|
+
"@remotion/media-utils": "4.0.472",
|
|
31
|
+
"@remotion/renderer": "4.0.472",
|
|
32
|
+
"@remotion/web-renderer": "4.0.472",
|
|
33
|
+
"@remotion/studio-shared": "4.0.472",
|
|
34
|
+
"@remotion/timeline-utils": "4.0.472",
|
|
35
|
+
"@remotion/zod-types": "4.0.472",
|
|
36
36
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
37
37
|
"mediabunny": "1.45.0",
|
|
38
38
|
"memfs": "3.4.3",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react": "19.2.3",
|
|
44
44
|
"react-dom": "19.2.3",
|
|
45
45
|
"@types/semver": "7.5.3",
|
|
46
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
46
|
+
"@remotion/eslint-config-internal": "4.0.472",
|
|
47
47
|
"eslint": "9.19.0",
|
|
48
48
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
49
49
|
},
|