remotion 4.0.258 → 4.0.260

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.
@@ -34,7 +34,10 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
34
34
  var _a, _b;
35
35
  const { registerComposition, unregisterComposition } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
36
36
  const video = (0, use_video_js_1.useVideo)();
37
- const lazy = (0, use_lazy_component_js_1.useLazyComponent)(compProps);
37
+ const lazy = (0, use_lazy_component_js_1.useLazyComponent)({
38
+ compProps: compProps,
39
+ componentName: 'Composition',
40
+ });
38
41
  const nonce = (0, nonce_js_1.useNonce)();
39
42
  const isPlayer = (0, is_player_js_1.useIsPlayer)();
40
43
  const environment = (0, get_remotion_environment_js_1.getRemotionEnvironment)();
@@ -14,6 +14,10 @@ export declare const editorPropsProviderRef: React.RefObject<{
14
14
  getProps: () => Props;
15
15
  setProps: React.Dispatch<React.SetStateAction<Props>>;
16
16
  } | null>;
17
+ export declare const timeValueRef: React.RefObject<{
18
+ goToFrame: () => void;
19
+ seek: (newFrame: number) => void;
20
+ } | null>;
17
21
  export declare const EditorPropsProvider: React.FC<{
18
22
  readonly children: React.ReactNode;
19
23
  }>;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.EditorPropsProvider = exports.editorPropsProviderRef = exports.EditorPropsContext = void 0;
26
+ exports.EditorPropsProvider = exports.timeValueRef = exports.editorPropsProviderRef = exports.EditorPropsContext = void 0;
27
27
  const jsx_runtime_1 = require("react/jsx-runtime");
28
28
  const react_1 = __importStar(require("react"));
29
29
  exports.EditorPropsContext = (0, react_1.createContext)({
@@ -36,6 +36,7 @@ exports.EditorPropsContext = (0, react_1.createContext)({
36
36
  },
37
37
  });
38
38
  exports.editorPropsProviderRef = react_1.default.createRef();
39
+ exports.timeValueRef = react_1.default.createRef();
39
40
  const EditorPropsProvider = ({ children }) => {
40
41
  const [props, setProps] = react_1.default.useState({});
41
42
  const updateProps = (0, react_1.useCallback)(({ defaultProps, id, newProps, }) => {
@@ -28,7 +28,10 @@ export declare const Internals: {
28
28
  readonly getRoot: () => import("react").FC<{}> | null;
29
29
  readonly useMediaVolumeState: () => readonly [number, (u: number) => void];
30
30
  readonly useMediaMutedState: () => readonly [boolean, (u: React.SetStateAction<boolean>) => void];
31
- readonly useLazyComponent: <Props>(compProps: CompProps<Props>) => import("react").ExoticComponent<Props | (import("react").PropsWithoutRef<Props> & import("react").RefAttributes<import("react").Component<Props, any, any>>)> & {
31
+ readonly useLazyComponent: <Props>({ compProps, componentName, }: {
32
+ compProps: CompProps<Props>;
33
+ componentName: string;
34
+ }) => import("react").ExoticComponent<Props | (import("react").PropsWithoutRef<Props> & import("react").RefAttributes<import("react").Component<Props, any, any>>)> & {
32
35
  readonly _result: import("react").ComponentType<Props>;
33
36
  };
34
37
  readonly truthy: typeof truthy;
@@ -169,11 +172,11 @@ export declare const Internals: {
169
172
  readonly PROPS_UPDATED_EXTERNALLY: "remotion.propsUpdatedExternally";
170
173
  readonly validateRenderAsset: (artifact: TRenderAsset) => void;
171
174
  readonly Log: {
172
- trace: (logLevel: import("./log.js").LogLevel, ...args: Parameters<typeof console.log>) => void;
173
- verbose: (logLevel: import("./log.js").LogLevel, ...args: Parameters<typeof console.log>) => void;
174
- info: (logLevel: import("./log.js").LogLevel, ...args: Parameters<typeof console.log>) => void;
175
- warn: (logLevel: import("./log.js").LogLevel, ...args: Parameters<typeof console.log>) => void;
176
- error: (...args: Parameters<typeof console.log>) => void;
175
+ trace: (logLevel: import("./log.js").LogLevel, message?: any, ...optionalParams: any[]) => void;
176
+ verbose: (logLevel: import("./log.js").LogLevel, message?: any, ...optionalParams: any[]) => void;
177
+ info: (logLevel: import("./log.js").LogLevel, message?: any, ...optionalParams: any[]) => void;
178
+ warn: (logLevel: import("./log.js").LogLevel, message?: any, ...optionalParams: any[]) => void;
179
+ error: (message?: any, ...optionalParams: any[]) => void;
177
180
  };
178
181
  readonly LogLevelContext: import("react").Context<LoggingContextValue>;
179
182
  readonly useLogLevel: () => import("./log.js").LogLevel;
@@ -183,5 +186,9 @@ export declare const Internals: {
183
186
  message: string;
184
187
  mountTime: number | null;
185
188
  }) => void;
189
+ readonly timeValueRef: import("react").RefObject<{
190
+ goToFrame: () => void;
191
+ seek: (newFrame: number) => void;
192
+ } | null>;
186
193
  };
187
194
  export type { CompositionManagerContext, CompProps, LoggingContextValue, MediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TRenderAsset as TAsset, TCompMetadata, TComposition, TimelinePosition as Timeline, TimelineContextValue, TSequence, WatchRemotionStaticFilesPayload, };
@@ -131,4 +131,5 @@ exports.Internals = {
131
131
  LogLevelContext: log_level_context_js_1.LogLevelContext,
132
132
  useLogLevel: log_level_context_js_1.useLogLevel,
133
133
  playbackLogging: playback_logging_js_1.playbackLogging,
134
+ timeValueRef: EditorProps_js_1.timeValueRef,
134
135
  };
package/dist/cjs/log.d.ts CHANGED
@@ -2,9 +2,9 @@ export declare const logLevels: readonly ["trace", "verbose", "info", "warn", "e
2
2
  export type LogLevel = (typeof logLevels)[number];
3
3
  export declare const isEqualOrBelowLogLevel: (currentLevel: LogLevel, level: LogLevel) => boolean;
4
4
  export declare const Log: {
5
- trace: (logLevel: LogLevel, ...args: Parameters<typeof console.log>) => void;
6
- verbose: (logLevel: LogLevel, ...args: Parameters<typeof console.log>) => void;
7
- info: (logLevel: LogLevel, ...args: Parameters<typeof console.log>) => void;
8
- warn: (logLevel: LogLevel, ...args: Parameters<typeof console.log>) => void;
9
- error: (...args: Parameters<typeof console.log>) => void;
5
+ trace: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
6
+ verbose: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
7
+ info: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
8
+ warn: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
9
+ error: (message?: any, ...optionalParams: any[]) => void;
10
10
  };
@@ -3,5 +3,8 @@ import type { CompProps } from './Composition.js';
3
3
  type LazyExoticComponent<T extends ComponentType<any>> = ExoticComponent<ComponentPropsWithRef<T>> & {
4
4
  readonly _result: T;
5
5
  };
6
- export declare const useLazyComponent: <Props>(compProps: CompProps<Props>) => LazyExoticComponent<ComponentType<Props>>;
6
+ export declare const useLazyComponent: <Props>({ compProps, componentName, }: {
7
+ compProps: CompProps<Props>;
8
+ componentName: string;
9
+ }) => LazyExoticComponent<ComponentType<Props>>;
7
10
  export {};
@@ -26,10 +26,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.useLazyComponent = void 0;
27
27
  const react_1 = __importStar(require("react"));
28
28
  // Expected, it can be any component props
29
- const useLazyComponent = (compProps) => {
29
+ const useLazyComponent = ({ compProps, componentName, }) => {
30
30
  const lazy = (0, react_1.useMemo)(() => {
31
31
  if ('lazyComponent' in compProps &&
32
32
  typeof compProps.lazyComponent !== 'undefined') {
33
+ if (typeof compProps.lazyComponent === 'undefined') {
34
+ throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
35
+ }
33
36
  return react_1.default.lazy(compProps.lazyComponent);
34
37
  }
35
38
  if ('component' in compProps) {
@@ -37,6 +40,9 @@ const useLazyComponent = (compProps) => {
37
40
  if (typeof document === 'undefined') {
38
41
  return compProps.component;
39
42
  }
43
+ if (typeof compProps.component === 'undefined') {
44
+ throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
45
+ }
40
46
  return react_1.default.lazy(() => Promise.resolve({ default: compProps.component }));
41
47
  }
42
48
  throw new Error("You must pass either 'component' or 'lazyComponent'");
@@ -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.258";
6
+ export declare const VERSION = "4.0.260";
@@ -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.258';
10
+ exports.VERSION = '4.0.260';
@@ -104,7 +104,7 @@ function truthy(value) {
104
104
  }
105
105
 
106
106
  // src/version.ts
107
- var VERSION = "4.0.258";
107
+ var VERSION = "4.0.260";
108
108
 
109
109
  // src/multiple-versions-warning.ts
110
110
  var checkMultipleRemotionVersions = () => {
@@ -353,6 +353,7 @@ var EditorPropsContext = createContext6({
353
353
  }
354
354
  });
355
355
  var editorPropsProviderRef = React4.createRef();
356
+ var timeValueRef = React4.createRef();
356
357
  var EditorPropsProvider = ({ children }) => {
357
358
  const [props, setProps] = React4.useState({});
358
359
  const updateProps = useCallback2(({
@@ -4386,15 +4387,24 @@ var portalNode = () => {
4386
4387
 
4387
4388
  // src/use-lazy-component.ts
4388
4389
  import React18, { useMemo as useMemo22 } from "react";
4389
- var useLazyComponent = (compProps) => {
4390
+ var useLazyComponent = ({
4391
+ compProps,
4392
+ componentName
4393
+ }) => {
4390
4394
  const lazy = useMemo22(() => {
4391
4395
  if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
4396
+ if (typeof compProps.lazyComponent === "undefined") {
4397
+ throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
4398
+ }
4392
4399
  return React18.lazy(compProps.lazyComponent);
4393
4400
  }
4394
4401
  if ("component" in compProps) {
4395
4402
  if (typeof document === "undefined") {
4396
4403
  return compProps.component;
4397
4404
  }
4405
+ if (typeof compProps.component === "undefined") {
4406
+ throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
4407
+ }
4398
4408
  return React18.lazy(() => Promise.resolve({ default: compProps.component }));
4399
4409
  }
4400
4410
  throw new Error("You must pass either 'component' or 'lazyComponent'");
@@ -4446,7 +4456,10 @@ var Composition = ({
4446
4456
  }) => {
4447
4457
  const { registerComposition, unregisterComposition } = useContext24(CompositionManager);
4448
4458
  const video = useVideo();
4449
- const lazy = useLazyComponent(compProps);
4459
+ const lazy = useLazyComponent({
4460
+ compProps,
4461
+ componentName: "Composition"
4462
+ });
4450
4463
  const nonce = useNonce();
4451
4464
  const isPlayer = useIsPlayer();
4452
4465
  const environment = getRemotionEnvironment();
@@ -5491,7 +5504,8 @@ var Internals = {
5491
5504
  Log,
5492
5505
  LogLevelContext,
5493
5506
  useLogLevel,
5494
- playbackLogging
5507
+ playbackLogging,
5508
+ timeValueRef
5495
5509
  };
5496
5510
  // src/interpolate-colors.ts
5497
5511
  var NUMBER = "[-+]?\\d*\\.?\\d+";
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "4.0.258";
2
+ var VERSION = "4.0.260";
3
3
  export {
4
4
  VERSION
5
5
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
4
4
  },
5
5
  "name": "remotion",
6
- "version": "4.0.258",
6
+ "version": "4.0.260",
7
7
  "description": "Make videos programmatically",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -27,8 +27,8 @@
27
27
  "react-dom": "19.0.0",
28
28
  "webpack": "5.96.1",
29
29
  "zod": "3.22.3",
30
- "eslint": "9.14.0",
31
- "@remotion/eslint-config-internal": "4.0.258"
30
+ "eslint": "9.19.0",
31
+ "@remotion/eslint-config-internal": "4.0.260"
32
32
  },
33
33
  "keywords": [
34
34
  "remotion",