remotion 3.1.3 → 3.1.6
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/.turbo/turbo-build.log +5 -5
- package/dist/Still.d.ts +0 -1
- package/dist/audio/Audio.d.ts +2 -2
- package/dist/audio/AudioForDevelopment.d.ts +2 -2
- package/dist/audio/AudioForDevelopment.js +10 -1
- package/dist/audio/AudioForRendering.d.ts +1 -1
- package/dist/audio/shared-audio-tags.d.ts +3 -2
- package/dist/audio/shared-audio-tags.js +83 -40
- package/dist/config/index.d.ts +6 -2
- package/dist/config/index.js +5 -0
- package/dist/config/log.d.ts +1 -1
- package/dist/config/output-location.d.ts +2 -0
- package/dist/config/output-location.js +16 -0
- package/dist/internals.d.ts +6 -4
- package/dist/internals.js +2 -0
- package/dist/video/Video.d.ts +2 -2
- package/dist/video/VideoForDevelopment.d.ts +2 -2
- package/dist/video/VideoForRendering.d.ts +1 -1
- package/package.json +2 -2
- package/dist/config/bundle-out-dir.d.ts +0 -2
- package/dist/config/bundle-out-dir.js +0 -12
- package/dist/config/every-nth-file.d.ts +0 -2
- package/dist/config/every-nth-file.js +0 -12
- package/dist/config/loop.d.ts +0 -4
- package/dist/config/loop.js +0 -18
- package/dist/config/public-path.d.ts +0 -2
- package/dist/config/public-path.js +0 -12
- package/dist/config/skip-n-frames.d.ts +0 -2
- package/dist/config/skip-n-frames.js +0 -12
- package/dist/initial-frame.d.ts +0 -2
- package/dist/initial-frame.js +0 -12
- package/dist/interpolateColors.d.ts +0 -5
- package/dist/interpolateColors.js +0 -401
- package/dist/preload.d.ts +0 -7
- package/dist/preload.js +0 -39
- package/dist/sequencing/index.d.ts +0 -19
- package/dist/sequencing/index.js +0 -123
- package/dist/use-frame.d.ts +0 -7
- package/dist/use-frame.js +0 -25
package/dist/sequencing/index.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Sequence = exports.SequenceContext = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const CompositionManager_1 = require("../CompositionManager");
|
|
7
|
-
const get_timeline_clip_name_1 = require("../get-timeline-clip-name");
|
|
8
|
-
const nonce_1 = require("../nonce");
|
|
9
|
-
const timeline_position_state_1 = require("../timeline-position-state");
|
|
10
|
-
const use_frame_1 = require("../use-frame");
|
|
11
|
-
const use_unsafe_video_config_1 = require("../use-unsafe-video-config");
|
|
12
|
-
exports.SequenceContext = (0, react_1.createContext)(null);
|
|
13
|
-
const Sequence = ({ from, durationInFrames = Infinity, children, name, layout = 'absolute-fill', showInTimeline = true, showLoopTimesInTimeline, }) => {
|
|
14
|
-
const [id] = (0, react_1.useState)(() => String(Math.random()));
|
|
15
|
-
const parentSequence = (0, react_1.useContext)(exports.SequenceContext);
|
|
16
|
-
const { rootId } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
|
|
17
|
-
const cumulatedFrom = parentSequence
|
|
18
|
-
? parentSequence.cumulatedFrom + parentSequence.relativeFrom
|
|
19
|
-
: 0;
|
|
20
|
-
const actualFrom = cumulatedFrom + from;
|
|
21
|
-
const nonce = (0, nonce_1.useNonce)();
|
|
22
|
-
if (layout !== 'absolute-fill' && layout !== 'none') {
|
|
23
|
-
throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
|
|
24
|
-
}
|
|
25
|
-
if (typeof durationInFrames !== 'number') {
|
|
26
|
-
throw new TypeError(`You passed to durationInFrames an argument of type ${typeof durationInFrames}, but it must be a number.`);
|
|
27
|
-
}
|
|
28
|
-
if (durationInFrames <= 0) {
|
|
29
|
-
throw new TypeError(`durationInFrames must be positive, but got ${durationInFrames}`);
|
|
30
|
-
}
|
|
31
|
-
// Infinity is non-integer but allowed!
|
|
32
|
-
if (durationInFrames % 1 !== 0 && Number.isFinite(durationInFrames)) {
|
|
33
|
-
throw new TypeError(`The "durationInFrames" of a sequence must be an integer, but got ${durationInFrames}.`);
|
|
34
|
-
}
|
|
35
|
-
if (typeof from !== 'number') {
|
|
36
|
-
throw new TypeError(`You passed to the "from" props of your <Sequence> an argument of type ${typeof from}, but it must be a number.`);
|
|
37
|
-
}
|
|
38
|
-
if (from % 1 !== 0) {
|
|
39
|
-
throw new TypeError(`The "from" prop of a sequence must be an integer, but got ${from}.`);
|
|
40
|
-
}
|
|
41
|
-
const absoluteFrame = (0, use_frame_1.useAbsoluteCurrentFrame)();
|
|
42
|
-
const unsafeVideoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
|
|
43
|
-
const compositionDuration = unsafeVideoConfig
|
|
44
|
-
? unsafeVideoConfig.durationInFrames
|
|
45
|
-
: 0;
|
|
46
|
-
const actualDurationInFrames = Math.min(compositionDuration - from, parentSequence
|
|
47
|
-
? Math.min(parentSequence.durationInFrames +
|
|
48
|
-
(parentSequence.cumulatedFrom + parentSequence.relativeFrom) -
|
|
49
|
-
actualFrom, durationInFrames)
|
|
50
|
-
: durationInFrames);
|
|
51
|
-
const { registerSequence, unregisterSequence } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
52
|
-
const contextValue = (0, react_1.useMemo)(() => {
|
|
53
|
-
var _a;
|
|
54
|
-
return {
|
|
55
|
-
cumulatedFrom,
|
|
56
|
-
relativeFrom: from,
|
|
57
|
-
durationInFrames: actualDurationInFrames,
|
|
58
|
-
parentFrom: (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.relativeFrom) !== null && _a !== void 0 ? _a : 0,
|
|
59
|
-
id,
|
|
60
|
-
};
|
|
61
|
-
}, [
|
|
62
|
-
cumulatedFrom,
|
|
63
|
-
from,
|
|
64
|
-
actualDurationInFrames,
|
|
65
|
-
parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.relativeFrom,
|
|
66
|
-
id,
|
|
67
|
-
]);
|
|
68
|
-
const timelineClipName = (0, react_1.useMemo)(() => {
|
|
69
|
-
return name !== null && name !== void 0 ? name : (0, get_timeline_clip_name_1.getTimelineClipName)(children);
|
|
70
|
-
}, [children, name]);
|
|
71
|
-
(0, react_1.useEffect)(() => {
|
|
72
|
-
var _a;
|
|
73
|
-
registerSequence({
|
|
74
|
-
from,
|
|
75
|
-
duration: actualDurationInFrames,
|
|
76
|
-
id,
|
|
77
|
-
displayName: timelineClipName,
|
|
78
|
-
parent: (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _a !== void 0 ? _a : null,
|
|
79
|
-
type: 'sequence',
|
|
80
|
-
rootId,
|
|
81
|
-
showInTimeline,
|
|
82
|
-
nonce,
|
|
83
|
-
showLoopTimesInTimeline,
|
|
84
|
-
});
|
|
85
|
-
return () => {
|
|
86
|
-
unregisterSequence(id);
|
|
87
|
-
};
|
|
88
|
-
}, [
|
|
89
|
-
durationInFrames,
|
|
90
|
-
actualFrom,
|
|
91
|
-
id,
|
|
92
|
-
name,
|
|
93
|
-
registerSequence,
|
|
94
|
-
timelineClipName,
|
|
95
|
-
unregisterSequence,
|
|
96
|
-
parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id,
|
|
97
|
-
actualDurationInFrames,
|
|
98
|
-
rootId,
|
|
99
|
-
from,
|
|
100
|
-
showInTimeline,
|
|
101
|
-
nonce,
|
|
102
|
-
showLoopTimesInTimeline,
|
|
103
|
-
]);
|
|
104
|
-
const endThreshold = (() => {
|
|
105
|
-
return actualFrom + durationInFrames - 1;
|
|
106
|
-
})();
|
|
107
|
-
const content = absoluteFrame < actualFrom
|
|
108
|
-
? null
|
|
109
|
-
: absoluteFrame > endThreshold
|
|
110
|
-
? null
|
|
111
|
-
: children;
|
|
112
|
-
return ((0, jsx_runtime_1.jsx)(exports.SequenceContext.Provider, { value: contextValue, children: content === null ? null : layout === 'absolute-fill' ? ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
113
|
-
position: 'absolute',
|
|
114
|
-
display: 'flex',
|
|
115
|
-
width: '100%',
|
|
116
|
-
height: '100%',
|
|
117
|
-
top: 0,
|
|
118
|
-
bottom: 0,
|
|
119
|
-
left: 0,
|
|
120
|
-
right: 0,
|
|
121
|
-
}, children: content })) : (content) }));
|
|
122
|
-
};
|
|
123
|
-
exports.Sequence = Sequence;
|
package/dist/use-frame.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const useAbsoluteCurrentFrame: () => number;
|
|
2
|
-
/**
|
|
3
|
-
* Get the current frame of the video.
|
|
4
|
-
* Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
|
|
5
|
-
* @link https://www.remotion.dev/docs/use-current-frame
|
|
6
|
-
*/
|
|
7
|
-
export declare const useCurrentFrame: () => number;
|
package/dist/use-frame.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCurrentFrame = exports.useAbsoluteCurrentFrame = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const sequencing_1 = require("./sequencing");
|
|
6
|
-
const timeline_position_state_1 = require("./timeline-position-state");
|
|
7
|
-
const useAbsoluteCurrentFrame = () => {
|
|
8
|
-
const timelinePosition = (0, timeline_position_state_1.useTimelinePosition)();
|
|
9
|
-
return timelinePosition;
|
|
10
|
-
};
|
|
11
|
-
exports.useAbsoluteCurrentFrame = useAbsoluteCurrentFrame;
|
|
12
|
-
/**
|
|
13
|
-
* Get the current frame of the video.
|
|
14
|
-
* Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
|
|
15
|
-
* @link https://www.remotion.dev/docs/use-current-frame
|
|
16
|
-
*/
|
|
17
|
-
const useCurrentFrame = () => {
|
|
18
|
-
const frame = (0, exports.useAbsoluteCurrentFrame)();
|
|
19
|
-
const context = (0, react_1.useContext)(sequencing_1.SequenceContext);
|
|
20
|
-
const contextOffset = context
|
|
21
|
-
? context.cumulatedFrom + context.relativeFrom
|
|
22
|
-
: 0;
|
|
23
|
-
return frame - contextOffset;
|
|
24
|
-
};
|
|
25
|
-
exports.useCurrentFrame = useCurrentFrame;
|