remotion 4.0.0-alpha.217 → 4.0.0-alpha4
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/cjs/Composition.d.ts +8 -10
- package/dist/cjs/Composition.js +6 -11
- package/dist/cjs/CompositionManager.d.ts +10 -15
- package/dist/cjs/CompositionManager.js +2 -2
- package/dist/cjs/Img.js +1 -2
- package/dist/cjs/RemotionRoot.js +1 -2
- package/dist/cjs/Still.d.ts +2 -3
- package/dist/cjs/Still.js +2 -11
- package/dist/cjs/index.d.ts +4 -4
- package/dist/cjs/index.js +3 -25
- package/dist/cjs/internals.d.ts +5 -11
- package/dist/cjs/internals.js +2 -5
- package/dist/cjs/interpolate-colors.d.ts +0 -1
- package/dist/cjs/interpolate-colors.js +8 -4
- package/dist/cjs/use-lazy-component.d.ts +2 -2
- package/dist/cjs/use-video-config.js +5 -1
- package/dist/cjs/use-video.d.ts +1 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +2 -2
- package/dist/esm/index.mjs +372 -407
- package/dist/esm/version.mjs +1 -1
- package/package.json +78 -81
- package/dist/cjs/EditorProps.d.ts +0 -15
- package/dist/cjs/EditorProps.js +0 -53
- package/dist/cjs/props-if-has-props.d.ts +0 -10
- package/dist/cjs/props-if-has-props.js +0 -2
- package/dist/cjs/z-color.d.ts +0 -9
- package/dist/cjs/z-color.js +0 -28
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import type { ComponentType, PropsWithChildren } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { z } from 'zod';
|
|
4
|
-
import type { PropsIfHasProps } from './props-if-has-props.js';
|
|
5
3
|
declare type LooseComponentType<T> = ComponentType<T> | ((props: T) => React.ReactNode);
|
|
6
|
-
export declare type CompProps<
|
|
4
|
+
export declare type CompProps<T> = {
|
|
7
5
|
lazyComponent: () => Promise<{
|
|
8
|
-
default: LooseComponentType<
|
|
6
|
+
default: LooseComponentType<T>;
|
|
9
7
|
}>;
|
|
10
8
|
} | {
|
|
11
|
-
component: LooseComponentType<
|
|
9
|
+
component: LooseComponentType<T>;
|
|
12
10
|
};
|
|
13
|
-
export declare type StillProps<
|
|
11
|
+
export declare type StillProps<T> = {
|
|
14
12
|
width: number;
|
|
15
13
|
height: number;
|
|
16
14
|
id: string;
|
|
17
|
-
|
|
18
|
-
} & CompProps<
|
|
19
|
-
|
|
15
|
+
defaultProps?: T;
|
|
16
|
+
} & CompProps<T>;
|
|
17
|
+
declare type CompositionProps<T> = StillProps<T> & {
|
|
20
18
|
fps: number;
|
|
21
19
|
durationInFrames: number;
|
|
22
20
|
};
|
|
@@ -24,6 +22,6 @@ export declare type CompositionProps<Schema extends z.ZodTypeAny, Props> = Still
|
|
|
24
22
|
* @description This component is used to register a video to make it renderable and make it show in the sidebar, in dev mode.
|
|
25
23
|
* @see [Documentation](https://www.remotion.dev/docs/composition)
|
|
26
24
|
*/
|
|
27
|
-
export declare const Composition: <
|
|
25
|
+
export declare const Composition: <T>({ width, height, fps, durationInFrames, id, defaultProps, ...compProps }: CompositionProps<T>) => React.ReactPortal | null;
|
|
28
26
|
export declare const ClipComposition: React.FC<PropsWithChildren>;
|
|
29
27
|
export {};
|
package/dist/cjs/Composition.js
CHANGED
|
@@ -9,9 +9,9 @@ const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js");
|
|
|
9
9
|
const CompositionManager_js_1 = require("./CompositionManager.js");
|
|
10
10
|
const input_props_js_1 = require("./config/input-props.js");
|
|
11
11
|
const delay_render_js_1 = require("./delay-render.js");
|
|
12
|
-
const EditorProps_js_1 = require("./EditorProps.js");
|
|
13
12
|
const Folder_js_1 = require("./Folder.js");
|
|
14
13
|
const get_environment_js_1 = require("./get-environment.js");
|
|
14
|
+
const internals_js_1 = require("./internals.js");
|
|
15
15
|
const loading_indicator_js_1 = require("./loading-indicator.js");
|
|
16
16
|
const NativeLayers_js_1 = require("./NativeLayers.js");
|
|
17
17
|
const nonce_js_1 = require("./nonce.js");
|
|
@@ -33,15 +33,13 @@ const Fallback = () => {
|
|
|
33
33
|
* @description This component is used to register a video to make it renderable and make it show in the sidebar, in dev mode.
|
|
34
34
|
* @see [Documentation](https://www.remotion.dev/docs/composition)
|
|
35
35
|
*/
|
|
36
|
-
const Composition = ({ width, height, fps, durationInFrames, id, defaultProps,
|
|
37
|
-
var _a;
|
|
36
|
+
const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, ...compProps }) => {
|
|
38
37
|
const { registerComposition, unregisterComposition } = (0, react_1.useContext)(CompositionManager_js_1.CompositionManager);
|
|
39
38
|
const video = (0, use_video_js_1.useVideo)();
|
|
40
39
|
const lazy = (0, use_lazy_component_js_1.useLazyComponent)(compProps);
|
|
41
|
-
const { props: allEditorProps } = (0, react_1.useContext)(EditorProps_js_1.EditorPropsContext);
|
|
42
40
|
const nonce = (0, nonce_js_1.useNonce)();
|
|
43
41
|
const environment = (0, get_environment_js_1.useRemotionEnvironment)();
|
|
44
|
-
const canUseComposition = (0, react_1.useContext)(
|
|
42
|
+
const canUseComposition = (0, react_1.useContext)(internals_js_1.Internals.CanUseRemotionHooks);
|
|
45
43
|
if (canUseComposition) {
|
|
46
44
|
if (environment === 'player-development' ||
|
|
47
45
|
environment === 'player-production') {
|
|
@@ -72,10 +70,9 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
|
|
|
72
70
|
id,
|
|
73
71
|
folderName,
|
|
74
72
|
component: lazy,
|
|
75
|
-
defaultProps
|
|
73
|
+
defaultProps,
|
|
76
74
|
nonce,
|
|
77
75
|
parentFolderName: parentName,
|
|
78
|
-
schema: schema !== null && schema !== void 0 ? schema : null,
|
|
79
76
|
});
|
|
80
77
|
return () => {
|
|
81
78
|
unregisterComposition(id);
|
|
@@ -93,18 +90,16 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
|
|
|
93
90
|
width,
|
|
94
91
|
nonce,
|
|
95
92
|
parentName,
|
|
96
|
-
schema,
|
|
97
93
|
]);
|
|
98
|
-
const editorPropsOrUndefined = (_a = allEditorProps[id]) !== null && _a !== void 0 ? _a : {};
|
|
99
94
|
if (environment === 'preview' && video && video.component === lazy) {
|
|
100
95
|
const Comp = lazy;
|
|
101
96
|
const inputProps = (0, input_props_js_1.getInputProps)();
|
|
102
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(exports.ClipComposition, { children: (0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(loading_indicator_js_1.Loading, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...
|
|
97
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(exports.ClipComposition, { children: (0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(loading_indicator_js_1.Loading, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }) }) }) }), (0, portal_node_js_1.portalNode)());
|
|
103
98
|
}
|
|
104
99
|
if (environment === 'rendering' && video && video.component === lazy) {
|
|
105
100
|
const Comp = lazy;
|
|
106
101
|
const inputProps = (0, input_props_js_1.getInputProps)();
|
|
107
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Fallback, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...
|
|
102
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Fallback, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }) }) }), (0, portal_node_js_1.portalNode)());
|
|
108
103
|
}
|
|
109
104
|
return null;
|
|
110
105
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { z } from 'zod';
|
|
4
3
|
import type { TFolder } from './Folder.js';
|
|
5
|
-
|
|
6
|
-
export declare type TComposition<Schema extends z.ZodTypeAny, Props> = {
|
|
4
|
+
export declare type TComposition<T = unknown> = {
|
|
7
5
|
width: number;
|
|
8
6
|
height: number;
|
|
9
7
|
fps: number;
|
|
@@ -11,15 +9,12 @@ export declare type TComposition<Schema extends z.ZodTypeAny, Props> = {
|
|
|
11
9
|
id: string;
|
|
12
10
|
folderName: string | null;
|
|
13
11
|
parentFolderName: string | null;
|
|
14
|
-
component: LazyExoticComponent<ComponentType<
|
|
12
|
+
component: LazyExoticComponent<ComponentType<T>>;
|
|
13
|
+
defaultProps: T | undefined;
|
|
15
14
|
nonce: number;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare type
|
|
19
|
-
export declare type TCompMetadata<Schema extends z.ZodTypeAny, Props> = Pick<TComposition<Schema, Props>, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames' | 'defaultProps'>;
|
|
20
|
-
export declare type AnyCompMetadata = TCompMetadata<z.ZodTypeAny, unknown>;
|
|
21
|
-
export declare type SmallTCompMetadata<T extends z.ZodTypeAny, Props> = Pick<TComposition<T, Props>, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames'> & Partial<Pick<TComposition<T, Props>, 'defaultProps'>>;
|
|
22
|
-
export declare type AnySmallCompMetadata = SmallTCompMetadata<z.ZodTypeAny, unknown>;
|
|
15
|
+
};
|
|
16
|
+
export declare type TCompMetadata = Pick<TComposition, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames' | 'defaultProps'>;
|
|
17
|
+
export declare type SmallTCompMetadata = Pick<TComposition, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames'> & Partial<Pick<TComposition, 'defaultProps'>>;
|
|
23
18
|
declare type EnhancedTSequenceData = {
|
|
24
19
|
type: 'sequence';
|
|
25
20
|
} | {
|
|
@@ -58,10 +53,10 @@ export declare type TAsset = {
|
|
|
58
53
|
playbackRate: number;
|
|
59
54
|
allowAmplificationDuringRender: boolean;
|
|
60
55
|
};
|
|
61
|
-
declare type BaseMetadata = Pick<
|
|
56
|
+
declare type BaseMetadata = Pick<TCompMetadata, 'durationInFrames' | 'fps' | 'defaultProps' | 'height' | 'width'>;
|
|
62
57
|
export declare type CompositionManagerContext = {
|
|
63
|
-
compositions:
|
|
64
|
-
registerComposition: <
|
|
58
|
+
compositions: TComposition[];
|
|
59
|
+
registerComposition: <T>(comp: TComposition<T>) => void;
|
|
65
60
|
unregisterComposition: (name: string) => void;
|
|
66
61
|
registerFolder: (name: string, parent: string | null) => void;
|
|
67
62
|
unregisterFolder: (name: string, parent: string | null) => void;
|
|
@@ -79,7 +74,7 @@ export declare type CompositionManagerContext = {
|
|
|
79
74
|
};
|
|
80
75
|
export declare const CompositionManager: React.Context<CompositionManagerContext>;
|
|
81
76
|
export declare const compositionsRef: React.RefObject<{
|
|
82
|
-
getCompositions: () => TCompMetadata
|
|
77
|
+
getCompositions: () => TCompMetadata[];
|
|
83
78
|
}>;
|
|
84
79
|
export declare const CompositionManagerProvider: React.FC<{
|
|
85
80
|
children: React.ReactNode;
|
|
@@ -57,9 +57,9 @@ const CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
|
|
|
57
57
|
const [folders, setFolders] = (0, react_1.useState)([]);
|
|
58
58
|
const [sequences, setSequences] = (0, react_1.useState)([]);
|
|
59
59
|
const [currentCompositionMetadata, setCurrentCompositionMetadata] = (0, react_1.useState)(null);
|
|
60
|
-
const updateCompositions = (0, react_1.useCallback)(
|
|
60
|
+
const updateCompositions = (0, react_1.useCallback)(
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
|
-
updateComps) => {
|
|
62
|
+
(updateComps) => {
|
|
63
63
|
setCompositions((comps) => {
|
|
64
64
|
const updated = updateComps(comps);
|
|
65
65
|
currentcompositionsRef.current = updated;
|
package/dist/cjs/Img.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Img = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const cancel_render_js_1 = require("./cancel-render.js");
|
|
7
6
|
const delay_render_js_1 = require("./delay-render.js");
|
|
8
7
|
const prefetch_js_1 = require("./prefetch.js");
|
|
9
8
|
function exponentialBackoff(errorCount) {
|
|
@@ -54,7 +53,7 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, ...props }, ref) => {
|
|
|
54
53
|
retryIn(backoff);
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
|
-
|
|
56
|
+
console.error('Error loading image with src:', (_l = imageRef.current) === null || _l === void 0 ? void 0 : _l.src, e, 'Handle the event using the onError() prop to make this message disappear.');
|
|
58
57
|
}, [maxRetries, onError, retryIn]);
|
|
59
58
|
(0, react_1.useLayoutEffect)(() => {
|
|
60
59
|
if (process.env.NODE_ENV === 'test') {
|
package/dist/cjs/RemotionRoot.js
CHANGED
|
@@ -5,7 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const CompositionManager_js_1 = require("./CompositionManager.js");
|
|
7
7
|
const delay_render_js_1 = require("./delay-render.js");
|
|
8
|
-
const EditorProps_js_1 = require("./EditorProps.js");
|
|
9
8
|
const NativeLayers_js_1 = require("./NativeLayers.js");
|
|
10
9
|
const nonce_js_1 = require("./nonce.js");
|
|
11
10
|
const prefetch_state_js_1 = require("./prefetch-state.js");
|
|
@@ -67,6 +66,6 @@ const RemotionRoot = ({ children, numberOfAudioTags }) => {
|
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
}, []);
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(prefetch_state_js_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(NativeLayers_js_1.NativeLayersProvider, { children: (0, jsx_runtime_1.jsx)(CompositionManager_js_1.CompositionManagerProvider, { numberOfAudioTags: numberOfAudioTags, children: (0, jsx_runtime_1.jsx)(duration_state_js_1.DurationsContextProvider, { children: children }) }) }) }) }) }) }));
|
|
71
70
|
};
|
|
72
71
|
exports.RemotionRoot = RemotionRoot;
|
package/dist/cjs/Still.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import type { z } from 'zod';
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import type { StillProps } from './Composition.js';
|
|
4
3
|
/**
|
|
5
4
|
* @description A <Still /> is a <Composition /> that is only 1 frame long.
|
|
6
5
|
* @see [Documentation](https://www.remotion.dev/docs/still)
|
|
7
6
|
*/
|
|
8
|
-
export declare const Still: <
|
|
7
|
+
export declare const Still: <T>(props: StillProps<T>) => JSX.Element;
|
package/dist/cjs/Still.js
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Still = void 0;
|
|
7
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
5
|
const Composition_js_1 = require("./Composition.js");
|
|
9
6
|
/**
|
|
10
7
|
* @description A <Still /> is a <Composition /> that is only 1 frame long.
|
|
11
8
|
* @see [Documentation](https://www.remotion.dev/docs/still)
|
|
12
9
|
*/
|
|
13
10
|
const Still = (props) => {
|
|
14
|
-
|
|
15
|
-
...props,
|
|
16
|
-
durationInFrames: 1,
|
|
17
|
-
fps: 1,
|
|
18
|
-
};
|
|
19
|
-
// @ts-expect-error TypeScript does not understand it, but should still fail on type mismatch
|
|
20
|
-
return react_1.default.createElement((Composition_js_1.Composition), newProps);
|
|
11
|
+
return (0, jsx_runtime_1.jsx)(Composition_js_1.Composition, { fps: 1, durationInFrames: 1, ...props });
|
|
21
12
|
};
|
|
22
13
|
exports.Still = Still;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './asset-types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TAsset, TCompMetadata } from './CompositionManager.js';
|
|
3
3
|
import type { StaticFile } from './get-static-files.js';
|
|
4
4
|
import type { ClipRegion } from './NativeLayers.js';
|
|
5
5
|
declare global {
|
|
6
6
|
interface Window {
|
|
7
7
|
ready: boolean;
|
|
8
8
|
remotion_cancelledError: string | undefined;
|
|
9
|
-
getStaticCompositions: () =>
|
|
9
|
+
getStaticCompositions: () => TCompMetadata[];
|
|
10
10
|
setBundleMode: (bundleMode: BundleState) => void;
|
|
11
11
|
remotion_staticBase: string;
|
|
12
12
|
remotion_staticFiles: StaticFile[];
|
|
@@ -50,7 +50,8 @@ export * from './AbsoluteFill.js';
|
|
|
50
50
|
export * from './audio/index.js';
|
|
51
51
|
export { cancelRender } from './cancel-render.js';
|
|
52
52
|
export * from './Composition.js';
|
|
53
|
-
export {
|
|
53
|
+
export { SmallTCompMetadata, TAsset, TCompMetadata, } from './CompositionManager.js';
|
|
54
|
+
export { Config, ConfigType, WebpackConfiguration, WebpackOverrideFn, } from './config.js';
|
|
54
55
|
export { getInputProps } from './config/input-props.js';
|
|
55
56
|
export { continueRender, delayRender } from './delay-render.js';
|
|
56
57
|
export * from './easing.js';
|
|
@@ -96,4 +97,3 @@ export declare const Experimental: {
|
|
|
96
97
|
Null: import("react").FC<{}>;
|
|
97
98
|
useIsPlayer: () => boolean;
|
|
98
99
|
};
|
|
99
|
-
export declare const Config: {};
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.Experimental = exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.random = exports.prefetch = exports.Loop = exports.interpolate = exports.interpolateColors = exports.getStaticFiles = exports.delayRender = exports.continueRender = exports.getInputProps = exports.Config = exports.cancelRender = void 0;
|
|
18
18
|
require("./asset-types.js");
|
|
19
19
|
const Clipper_js_1 = require("./Clipper.js");
|
|
20
20
|
const is_player_js_1 = require("./is-player.js");
|
|
@@ -26,6 +26,8 @@ __exportStar(require("./audio/index.js"), exports);
|
|
|
26
26
|
var cancel_render_js_1 = require("./cancel-render.js");
|
|
27
27
|
Object.defineProperty(exports, "cancelRender", { enumerable: true, get: function () { return cancel_render_js_1.cancelRender; } });
|
|
28
28
|
__exportStar(require("./Composition.js"), exports);
|
|
29
|
+
var config_js_1 = require("./config.js");
|
|
30
|
+
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_js_1.Config; } });
|
|
29
31
|
var input_props_js_1 = require("./config/input-props.js");
|
|
30
32
|
Object.defineProperty(exports, "getInputProps", { enumerable: true, get: function () { return input_props_js_1.getInputProps; } });
|
|
31
33
|
var delay_render_js_1 = require("./delay-render.js");
|
|
@@ -78,27 +80,3 @@ exports.Experimental = {
|
|
|
78
80
|
Null: Null_js_1.Null,
|
|
79
81
|
useIsPlayer: is_player_js_1.useIsPlayer,
|
|
80
82
|
};
|
|
81
|
-
const proxyObj = {};
|
|
82
|
-
exports.Config = new Proxy(proxyObj, {
|
|
83
|
-
get(_, prop) {
|
|
84
|
-
if (prop === 'Bundling' ||
|
|
85
|
-
prop === 'Rendering' ||
|
|
86
|
-
prop === 'Log' ||
|
|
87
|
-
prop === 'Puppeteer' ||
|
|
88
|
-
prop === 'Output') {
|
|
89
|
-
return exports.Config;
|
|
90
|
-
}
|
|
91
|
-
return () => {
|
|
92
|
-
console.warn('⚠️ The CLI configuration has been extracted from Remotion Core.');
|
|
93
|
-
console.warn('Update the import from the config file:');
|
|
94
|
-
console.warn();
|
|
95
|
-
console.warn('- Delete:');
|
|
96
|
-
console.warn('import {Config} from "remotion";');
|
|
97
|
-
console.warn('+ Replace:');
|
|
98
|
-
console.warn('import {Config} from "@remotion/cli/config";');
|
|
99
|
-
console.warn();
|
|
100
|
-
console.warn('For more information, see https://v4.remotion.dev/docs/4-0-migration.');
|
|
101
|
-
process.exit(1);
|
|
102
|
-
};
|
|
103
|
-
},
|
|
104
|
-
});
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { CompProps } from './Composition.js';
|
|
|
3
3
|
import type { CompositionManagerContext, TAsset, TCompMetadata, TComposition, TSequence } from './CompositionManager.js';
|
|
4
4
|
import * as CSSUtils from './default-css.js';
|
|
5
5
|
import type { RemotionEnvironment } from './get-environment.js';
|
|
6
|
-
import { processColor } from './interpolate-colors.js';
|
|
7
6
|
import type { SetTimelineContextValue, TimelineContextValue } from './timeline-position-state.js';
|
|
8
7
|
import * as TimelinePosition from './timeline-position-state.js';
|
|
9
8
|
import { truthy } from './truthy.js';
|
|
@@ -23,19 +22,18 @@ export declare const Internals: {
|
|
|
23
22
|
width: number;
|
|
24
23
|
fps: number;
|
|
25
24
|
durationInFrames: number;
|
|
26
|
-
defaultProps
|
|
25
|
+
defaultProps: unknown;
|
|
27
26
|
id: string;
|
|
28
27
|
folderName: string | null;
|
|
29
28
|
parentFolderName: string | null;
|
|
30
29
|
component: import("react").LazyExoticComponent<import("react").ComponentType<unknown>>;
|
|
31
30
|
nonce: number;
|
|
32
|
-
schema: import("zod").ZodTypeAny | null;
|
|
33
31
|
} | null;
|
|
34
32
|
getRoot: () => import("react").FC<{}> | null;
|
|
35
33
|
useMediaVolumeState: () => readonly [number, (u: number) => void];
|
|
36
34
|
useMediaMutedState: () => readonly [boolean, (u: import("react").SetStateAction<boolean>) => void];
|
|
37
|
-
useLazyComponent: <
|
|
38
|
-
readonly _result: import("react").ComponentType<
|
|
35
|
+
useLazyComponent: <T>(compProps: CompProps<T>) => import("react").ExoticComponent<(import("react").PropsWithoutRef<T> & import("react").RefAttributes<import("react").Component<T, any, any>>) | import("react").PropsWithRef<T>> & {
|
|
36
|
+
readonly _result: import("react").ComponentType<T>;
|
|
39
37
|
};
|
|
40
38
|
truthy: typeof truthy;
|
|
41
39
|
SequenceContext: import("react").Context<import("./SequenceContext.js").SequenceContextType | null>;
|
|
@@ -79,7 +77,7 @@ export declare const Internals: {
|
|
|
79
77
|
isCompositionIdValid: (id: string) => RegExpMatchArray | null;
|
|
80
78
|
getPreviewDomElement: () => HTMLElement | null;
|
|
81
79
|
compositionsRef: import("react").RefObject<{
|
|
82
|
-
getCompositions: () => TCompMetadata
|
|
80
|
+
getCompositions: () => TCompMetadata[];
|
|
83
81
|
}>;
|
|
84
82
|
DELAY_RENDER_CALLSTACK_TOKEN: string;
|
|
85
83
|
portalNode: () => HTMLElement;
|
|
@@ -89,6 +87,7 @@ export declare const Internals: {
|
|
|
89
87
|
children: import("react").ReactNode;
|
|
90
88
|
}>;
|
|
91
89
|
CanUseRemotionHooks: import("react").Context<boolean>;
|
|
90
|
+
enableLegacyRemotionConfig: () => void;
|
|
92
91
|
PrefetchProvider: import("react").FC<{
|
|
93
92
|
children: import("react").ReactNode;
|
|
94
93
|
}>;
|
|
@@ -105,11 +104,6 @@ export declare const Internals: {
|
|
|
105
104
|
durationInFrames: number;
|
|
106
105
|
allowFloats: boolean;
|
|
107
106
|
}) => void;
|
|
108
|
-
EditorPropsProvider: import("react").FC<{
|
|
109
|
-
children: import("react").ReactNode;
|
|
110
|
-
}>;
|
|
111
|
-
EditorPropsContext: import("react").Context<import("./EditorProps.js").EditorPropsContextType>;
|
|
112
107
|
usePreload: (src: string) => string;
|
|
113
|
-
processColor: typeof processColor;
|
|
114
108
|
};
|
|
115
109
|
export type { TComposition, Timeline, TCompMetadata, TSequence, TAsset, TimelineContextValue, SetTimelineContextValue, CompProps, CompositionManagerContext, MediaVolumeContextValue, SetMediaVolumeContextValue, RemotionEnvironment, };
|
package/dist/cjs/internals.js
CHANGED
|
@@ -24,15 +24,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Internals = void 0;
|
|
27
|
+
const config_js_1 = require("./config.js");
|
|
27
28
|
const shared_audio_tags_js_1 = require("./audio/shared-audio-tags.js");
|
|
28
29
|
const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js");
|
|
29
30
|
const CompositionManager_js_1 = require("./CompositionManager.js");
|
|
30
31
|
const CSSUtils = __importStar(require("./default-css.js"));
|
|
31
32
|
const delay_render_js_1 = require("./delay-render.js");
|
|
32
|
-
const EditorProps_js_1 = require("./EditorProps.js");
|
|
33
33
|
const get_environment_js_1 = require("./get-environment.js");
|
|
34
34
|
const get_preview_dom_element_js_1 = require("./get-preview-dom-element.js");
|
|
35
|
-
const interpolate_colors_js_1 = require("./interpolate-colors.js");
|
|
36
35
|
const is_player_js_1 = require("./is-player.js");
|
|
37
36
|
const portal_node_js_1 = require("./portal-node.js");
|
|
38
37
|
const prefetch_state_js_1 = require("./prefetch-state.js");
|
|
@@ -93,14 +92,12 @@ exports.Internals = {
|
|
|
93
92
|
validateOffthreadVideoImageFormat: validate_offthreadvideo_image_format_js_1.validateOffthreadVideoImageFormat,
|
|
94
93
|
CanUseRemotionHooksProvider: CanUseRemotionHooks_js_1.CanUseRemotionHooksProvider,
|
|
95
94
|
CanUseRemotionHooks: CanUseRemotionHooks_js_1.CanUseRemotionHooks,
|
|
95
|
+
enableLegacyRemotionConfig: config_js_1.enableLegacyRemotionConfig,
|
|
96
96
|
PrefetchProvider: prefetch_state_js_1.PrefetchProvider,
|
|
97
97
|
DurationsContextProvider: duration_state_js_1.DurationsContextProvider,
|
|
98
98
|
IsPlayerContextProvider: is_player_js_1.IsPlayerContextProvider,
|
|
99
99
|
useIsPlayer: is_player_js_1.useIsPlayer,
|
|
100
100
|
useRemotionEnvironment: get_environment_js_1.useRemotionEnvironment,
|
|
101
101
|
validateFrame: validate_frame_js_1.validateFrame,
|
|
102
|
-
EditorPropsProvider: EditorProps_js_1.EditorPropsProvider,
|
|
103
|
-
EditorPropsContext: EditorProps_js_1.EditorPropsContext,
|
|
104
102
|
usePreload: prefetch_js_1.usePreload,
|
|
105
|
-
processColor: interpolate_colors_js_1.processColor,
|
|
106
103
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copied from:
|
|
3
3
|
* https://github.com/software-mansion/react-native-reanimated/blob/master/src/reanimated2/Colors.ts
|
|
4
4
|
*/
|
|
5
|
-
export declare function processColor(color: string): number;
|
|
6
5
|
/**
|
|
7
6
|
* @description This function allows you to map a range of values to colors using a concise syntax.
|
|
8
7
|
* @see [Documentation](https://www.remotion.dev/docs/interpolate-colors)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* https://github.com/software-mansion/react-native-reanimated/blob/master/src/reanimated2/Colors.ts
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.interpolateColors =
|
|
7
|
+
exports.interpolateColors = void 0;
|
|
8
8
|
/* eslint no-bitwise: 0 */
|
|
9
9
|
const interpolate_js_1 = require("./interpolate.js");
|
|
10
10
|
// var INTEGER = '[-+]?\\d+';
|
|
@@ -356,11 +356,15 @@ const blue = (c) => {
|
|
|
356
356
|
const rgbaColor = (r, g, b, alpha) => {
|
|
357
357
|
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
358
358
|
};
|
|
359
|
+
function processColorInitially(color) {
|
|
360
|
+
let normalizedColor = normalizeColor(color);
|
|
361
|
+
normalizedColor = ((normalizedColor << 24) | (normalizedColor >>> 8)) >>> 0; // argb
|
|
362
|
+
return normalizedColor;
|
|
363
|
+
}
|
|
359
364
|
function processColor(color) {
|
|
360
|
-
const normalizedColor =
|
|
361
|
-
return
|
|
365
|
+
const normalizedColor = processColorInitially(color);
|
|
366
|
+
return normalizedColor;
|
|
362
367
|
}
|
|
363
|
-
exports.processColor = processColor;
|
|
364
368
|
const interpolateColorsRGB = (value, inputRange, colors) => {
|
|
365
369
|
const [r, g, b, a] = [red, green, blue, opacity].map((f) => {
|
|
366
370
|
const unrounded = (0, interpolate_js_1.interpolate)(value, inputRange, colors.map((c) => f(c)), {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ComponentType, ExoticComponent } from 'react';
|
|
2
|
-
import type { CompProps } from './
|
|
2
|
+
import type { CompProps } from './internals.js';
|
|
3
3
|
declare type LazyExoticComponent<T extends ComponentType<any>> = ExoticComponent<ComponentPropsWithRef<T>> & {
|
|
4
4
|
readonly _result: T;
|
|
5
5
|
};
|
|
6
|
-
export declare const useLazyComponent: <
|
|
6
|
+
export declare const useLazyComponent: <T>(compProps: CompProps<T>) => LazyExoticComponent<ComponentType<T>>;
|
|
7
7
|
export {};
|
|
@@ -18,7 +18,11 @@ const useVideoConfig = () => {
|
|
|
18
18
|
if (!videoConfig) {
|
|
19
19
|
if ((typeof window !== 'undefined' && window.remotion_isPlayer) ||
|
|
20
20
|
isPlayer) {
|
|
21
|
-
throw new Error(
|
|
21
|
+
throw new Error([
|
|
22
|
+
'No video config found. Likely reasons:',
|
|
23
|
+
'- You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.',
|
|
24
|
+
'- You have multiple versions of Remotion installed which causes the React context to get lost.',
|
|
25
|
+
].join('-'));
|
|
22
26
|
}
|
|
23
27
|
throw new Error('No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.');
|
|
24
28
|
}
|
package/dist/cjs/use-video.d.ts
CHANGED
|
@@ -4,11 +4,10 @@ export declare const useVideo: () => {
|
|
|
4
4
|
width: number;
|
|
5
5
|
fps: number;
|
|
6
6
|
durationInFrames: number;
|
|
7
|
-
defaultProps
|
|
7
|
+
defaultProps: unknown;
|
|
8
8
|
id: string;
|
|
9
9
|
folderName: string | null;
|
|
10
10
|
parentFolderName: string | null;
|
|
11
11
|
component: import("react").LazyExoticComponent<import("react").ComponentType<unknown>>;
|
|
12
12
|
nonce: number;
|
|
13
|
-
schema: import("zod").ZodTypeAny | null;
|
|
14
13
|
} | null;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.0-
|
|
1
|
+
export declare const VERSION = "4.0.0-alpha4";
|
package/dist/cjs/version.js
CHANGED
|
@@ -8,10 +8,10 @@ const use_audio_frame_js_1 = require("../audio/use-audio-frame.js");
|
|
|
8
8
|
const CompositionManager_js_1 = require("../CompositionManager.js");
|
|
9
9
|
const default_css_js_1 = require("../default-css.js");
|
|
10
10
|
const Img_js_1 = require("../Img.js");
|
|
11
|
+
const internals_js_1 = require("../internals.js");
|
|
11
12
|
const random_js_1 = require("../random.js");
|
|
12
13
|
const SequenceContext_js_1 = require("../SequenceContext.js");
|
|
13
14
|
const timeline_position_state_js_1 = require("../timeline-position-state.js");
|
|
14
|
-
const truthy_js_1 = require("../truthy.js");
|
|
15
15
|
const use_current_frame_js_1 = require("../use-current-frame.js");
|
|
16
16
|
const use_unsafe_video_config_js_1 = require("../use-unsafe-video-config.js");
|
|
17
17
|
const volume_prop_js_1 = require("../volume-prop.js");
|
|
@@ -96,7 +96,7 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
96
96
|
}, [onError]);
|
|
97
97
|
const className = (0, react_1.useMemo)(() => {
|
|
98
98
|
return [default_css_js_1.OFFTHREAD_VIDEO_CLASS_NAME, props.className]
|
|
99
|
-
.filter(
|
|
99
|
+
.filter(internals_js_1.Internals.truthy)
|
|
100
100
|
.join(' ');
|
|
101
101
|
}, [props.className]);
|
|
102
102
|
return ((0, jsx_runtime_1.jsx)(Img_js_1.Img, { src: actualSrc, className: className, ...props, onError: onErr }));
|