remotion 4.0.493 → 4.0.495

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.
@@ -0,0 +1,19 @@
1
+ import type React from 'react';
2
+ export declare const usePremounting: ({ from, durationInFrames, premountFor, postmountFor, style, styleWhilePremounted, styleWhilePostmounted, hideWhilePremounted, }: {
3
+ readonly from: number;
4
+ readonly durationInFrames: number;
5
+ readonly premountFor: number | null;
6
+ readonly postmountFor: number | null;
7
+ readonly style: React.CSSProperties | null;
8
+ readonly styleWhilePremounted: React.CSSProperties | null;
9
+ readonly styleWhilePostmounted: React.CSSProperties | null;
10
+ readonly hideWhilePremounted: "display-none" | "opacity";
11
+ }) => {
12
+ effectivePremountFor: number;
13
+ effectivePostmountFor: number;
14
+ premountingActive: boolean;
15
+ postmountingActive: boolean;
16
+ isPremountingOrPostmounting: boolean;
17
+ freezeFrame: number;
18
+ premountingStyle: React.CSSProperties | null;
19
+ };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usePremounting = void 0;
4
+ const react_1 = require("react");
5
+ const PremountContext_js_1 = require("./PremountContext.js");
6
+ const use_current_frame_js_1 = require("./use-current-frame.js");
7
+ const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
8
+ const use_video_config_js_1 = require("./use-video-config.js");
9
+ const v5_flag_js_1 = require("./v5-flag.js");
10
+ const usePremounting = ({ from, durationInFrames, premountFor, postmountFor, style, styleWhilePremounted, styleWhilePostmounted, hideWhilePremounted, }) => {
11
+ const parentPremountContext = (0, react_1.useContext)(PremountContext_js_1.PremountContext);
12
+ const frame = (0, use_current_frame_js_1.useCurrentFrame)() - parentPremountContext.premountFramesRemaining;
13
+ const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
14
+ const { fps } = (0, use_video_config_js_1.useVideoConfig)();
15
+ const effectivePremountFor = v5_flag_js_1.ENABLE_V5_BREAKING_CHANGES
16
+ ? (premountFor !== null && premountFor !== void 0 ? premountFor : fps)
17
+ : (premountFor !== null && premountFor !== void 0 ? premountFor : 0);
18
+ const effectivePostmountFor = postmountFor !== null && postmountFor !== void 0 ? postmountFor : 0;
19
+ const endThreshold = Math.ceil(from + durationInFrames - 1);
20
+ const premountingActive = !environment.isRendering &&
21
+ frame < from &&
22
+ frame >= from - effectivePremountFor;
23
+ const postmountingActive = !environment.isRendering &&
24
+ frame > endThreshold &&
25
+ frame <= endThreshold + effectivePostmountFor;
26
+ const isPremountingOrPostmounting = premountingActive || postmountingActive;
27
+ const freezeFrame = premountingActive
28
+ ? from
29
+ : postmountingActive
30
+ ? from + durationInFrames - 1
31
+ : 0;
32
+ const premountingStyle = (0, react_1.useMemo)(() => {
33
+ if (!isPremountingOrPostmounting) {
34
+ return style;
35
+ }
36
+ return {
37
+ ...style,
38
+ ...(hideWhilePremounted === 'opacity' ? { opacity: 0 } : { display: 'none' }),
39
+ pointerEvents: 'none',
40
+ ...(premountingActive ? styleWhilePremounted : {}),
41
+ ...(postmountingActive ? styleWhilePostmounted : {}),
42
+ };
43
+ }, [
44
+ isPremountingOrPostmounting,
45
+ hideWhilePremounted,
46
+ postmountingActive,
47
+ premountingActive,
48
+ style,
49
+ styleWhilePostmounted,
50
+ styleWhilePremounted,
51
+ ]);
52
+ return {
53
+ effectivePremountFor,
54
+ effectivePostmountFor,
55
+ premountingActive,
56
+ postmountingActive,
57
+ isPremountingOrPostmounting,
58
+ freezeFrame,
59
+ premountingStyle,
60
+ };
61
+ };
62
+ exports.usePremounting = usePremounting;
@@ -25,6 +25,12 @@ export type VideoConfigNumericExpression = {
25
25
  multiplicand: number;
26
26
  factorPosition: 'left' | 'right';
27
27
  value: number;
28
+ } | {
29
+ type: 'video-config-subtraction';
30
+ identifier: string;
31
+ minuend: number;
32
+ subtrahend: number;
33
+ value: number;
28
34
  };
29
35
  export type CanUpdateSequencePropStatusLinearEasing = {
30
36
  type: 'linear';
@@ -3,4 +3,4 @@
3
3
  * @see [Documentation](https://remotion.dev/docs/version)
4
4
  * @returns {string} The current version of the remotion package
5
5
  */
6
- export declare const VERSION = "4.0.493";
6
+ export declare const VERSION = "4.0.495";
@@ -7,4 +7,4 @@ exports.VERSION = void 0;
7
7
  * @see [Documentation](https://remotion.dev/docs/version)
8
8
  * @returns {string} The current version of the remotion package
9
9
  */
10
- exports.VERSION = '4.0.493';
10
+ exports.VERSION = '4.0.495';