remotion 4.0.225 → 4.0.227

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.
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
2
  export declare const Clipper: React.FC<{
3
- width: number;
4
- height: number;
5
- x: number;
6
- y: number;
3
+ readonly width: number;
4
+ readonly height: number;
5
+ readonly x: number;
6
+ readonly y: number;
7
7
  }>;
@@ -35,15 +35,12 @@ exports.compositionsRef = react_1.default.createRef();
35
35
  const CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
36
36
  var _a;
37
37
  // Wontfix, expected to have
38
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
38
  const [compositions, setCompositions] = (0, react_1.useState)([]);
40
39
  const currentcompositionsRef = (0, react_1.useRef)(compositions);
41
40
  const [folders, setFolders] = (0, react_1.useState)([]);
42
41
  const [canvasContent, setCanvasContent] = (0, react_1.useState)(null);
43
42
  const [currentCompositionMetadata, setCurrentCompositionMetadata] = (0, react_1.useState)(null);
44
- const updateCompositions = (0, react_1.useCallback)((
45
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
- updateComps) => {
43
+ const updateCompositions = (0, react_1.useCallback)((updateComps) => {
47
44
  setCompositions((comps) => {
48
45
  const updated = updateComps(comps);
49
46
  currentcompositionsRef.current = updated;
@@ -57,7 +54,6 @@ const CompositionManagerProvider = ({ children, numberOfAudioTags }) => {
57
54
  }
58
55
  const value = [...comps, comp]
59
56
  .slice()
60
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
57
  .sort((a, b) => a.nonce - b.nonce);
62
58
  return value;
63
59
  });
@@ -13,7 +13,7 @@ export declare const FolderContext: import("react").Context<FolderContextType>;
13
13
  * @see [Documentation](https://www.remotion.dev/docs/folder)
14
14
  */
15
15
  export declare const Folder: FC<{
16
- name: string;
17
- children: React.ReactNode;
16
+ readonly name: string;
17
+ readonly children: React.ReactNode;
18
18
  }>;
19
19
  export {};
@@ -14,7 +14,7 @@ exports.FolderContext = (0, react_1.createContext)({
14
14
  * @description By wrapping a <Composition /> inside a <Folder />, you can visually categorize it in your sidebar, should you have many compositions.
15
15
  * @see [Documentation](https://www.remotion.dev/docs/folder)
16
16
  */
17
- const Folder = ({ name, children, }) => {
17
+ const Folder = ({ name, children }) => {
18
18
  const parent = (0, react_1.useContext)(exports.FolderContext);
19
19
  const { registerFolder, unregisterFolder } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
20
20
  (0, validate_folder_name_js_1.validateFolderName)(name);
@@ -12,5 +12,5 @@ export type SequenceVisibilityToggleState = {
12
12
  };
13
13
  export declare const SequenceVisibilityToggleContext: React.Context<SequenceVisibilityToggleState>;
14
14
  export declare const SequenceManagerProvider: React.FC<{
15
- children: React.ReactNode;
15
+ readonly children: React.ReactNode;
16
16
  }>;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  type FreezeProps = {
3
- frame: number;
4
- children: React.ReactNode;
5
- active?: boolean | ((f: number) => boolean);
3
+ readonly frame: number;
4
+ readonly children: React.ReactNode;
5
+ readonly active?: boolean | ((f: number) => boolean);
6
6
  };
7
7
  /**
8
8
  * @description This method freezes all of its children to the frame that you specify as a prop
@@ -112,10 +112,10 @@ export declare const Experimental: {
112
112
  * @see [Documentation](https://www.remotion.dev/docs/clipper)
113
113
  */
114
114
  Clipper: import("react").FC<{
115
- width: number;
116
- height: number;
117
- x: number;
118
- y: number;
115
+ readonly width: number;
116
+ readonly height: number;
117
+ readonly x: number;
118
+ readonly y: number;
119
119
  }>;
120
120
  /**
121
121
  * @description This is a special component, that, when rendered, will skip rendering the frame altogether.
@@ -72,10 +72,10 @@ export declare const Internals: {
72
72
  }>;
73
73
  readonly CanUseRemotionHooks: import("react").Context<boolean>;
74
74
  readonly PrefetchProvider: import("react").FC<{
75
- children: import("react").ReactNode;
75
+ readonly children: import("react").ReactNode;
76
76
  }>;
77
77
  readonly DurationsContextProvider: import("react").FC<{
78
- children: import("react").ReactNode;
78
+ readonly children: import("react").ReactNode;
79
79
  }>;
80
80
  readonly IsPlayerContextProvider: import("react").FC<{
81
81
  children?: import("react").ReactNode | undefined;
@@ -6,7 +6,6 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.interpolateColors = exports.colorNames = void 0;
8
8
  exports.processColor = processColor;
9
- /* eslint no-bitwise: 0 */
10
9
  const interpolate_js_1 = require("./interpolate.js");
11
10
  // var INTEGER = '[-+]?\\d+';
12
11
  const NUMBER = '[-+]?\\d*\\.?\\d+';
@@ -33,6 +33,11 @@ const playAndHandleNotAllowedError = (mediaRef, mediaType, onAutoPlayError) => {
33
33
  if (err.message.includes('because the media was removed from the document')) {
34
34
  return;
35
35
  }
36
+ // Audio tag got unmounted
37
+ if (err.message.includes("user didn't interact with the document") &&
38
+ current.muted) {
39
+ return;
40
+ }
36
41
  // eslint-disable-next-line no-console
37
42
  console.log(`Could not play ${mediaType} due to following error: `, err);
38
43
  if (!current.muted) {
@@ -3,6 +3,6 @@ type Value = Record<string, string>;
3
3
  export declare const PreloadContext: React.Context<Value>;
4
4
  export declare const setPreloads: (updater: (p: Value) => Value) => void;
5
5
  export declare const PrefetchProvider: React.FC<{
6
- children: React.ReactNode;
6
+ readonly children: React.ReactNode;
7
7
  }>;
8
8
  export {};
@@ -26,7 +26,6 @@ const blobToBase64 = function (blob) {
26
26
  const getBlobFromReader = async ({ reader, contentType, contentLength, onProgress, }) => {
27
27
  let receivedLength = 0;
28
28
  const chunks = [];
29
- // eslint-disable-next-line no-constant-condition
30
29
  while (true) {
31
30
  const { done, value } = await reader.read();
32
31
  if (done) {
@@ -150,7 +149,7 @@ const prefetch = (src, options) => {
150
149
  try {
151
150
  controller.abort(new Error('free() called'));
152
151
  }
153
- catch (e) { }
152
+ catch (_a) { }
154
153
  }
155
154
  }
156
155
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.random = void 0;
4
- /* eslint-disable no-bitwise */
5
4
  function mulberry32(a) {
6
5
  let t = a + 0x6d2b79f5;
7
6
  t = Math.imul(t ^ (t >>> 15), t | 1);
@@ -12,7 +12,6 @@ const is_inside_series_js_1 = require("./is-inside-series.js");
12
12
  const SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
13
13
  (0, is_inside_series_js_1.useRequireToBeInsideSeries)();
14
14
  // Discard ref
15
- // eslint-disable-next-line react/jsx-no-useless-fragment
16
15
  return (0, jsx_runtime_1.jsx)(is_inside_series_js_1.IsNotInsideSeriesProvider, { children: children });
17
16
  };
18
17
  const SeriesSequence = (0, react_1.forwardRef)(SeriesSequenceRefForwardingFunction);
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setupEnvVariables = void 0;
4
4
  const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
5
5
  // https://github.com/remotion-dev/remotion/issues/3412#issuecomment-1910120552
6
- // eslint-disable-next-line no-useless-concat
7
6
  function getEnvVar() {
8
7
  const parts = ['proc', 'ess', '.', 'en', 'v', '.', 'NOD', 'E_EN', 'V'];
9
8
  return parts.join('');
@@ -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.225";
6
+ export declare const VERSION = "4.0.227";
@@ -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.225';
10
+ exports.VERSION = '4.0.227';
@@ -12,6 +12,6 @@ type TDurationsContext = {
12
12
  };
13
13
  export declare const DurationsContext: React.Context<TDurationsContext>;
14
14
  export declare const DurationsContextProvider: React.FC<{
15
- children: React.ReactNode;
15
+ readonly children: React.ReactNode;
16
16
  }>;
17
17
  export {};
@@ -42,7 +42,7 @@ export declare function useRemotionContexts(): {
42
42
  } | null;
43
43
  };
44
44
  export interface RemotionContextProviderProps {
45
- contexts: ReturnType<typeof useRemotionContexts>;
46
- children: React.ReactNode;
45
+ readonly contexts: ReturnType<typeof useRemotionContexts>;
46
+ readonly children: React.ReactNode;
47
47
  }
48
48
  export declare const RemotionContextProvider: (props: RemotionContextProviderProps) => import("react/jsx-runtime.js").JSX.Element;
@@ -151,7 +151,7 @@ function truthy(value) {
151
151
  }
152
152
 
153
153
  // src/version.ts
154
- var VERSION = "4.0.225";
154
+ var VERSION = "4.0.227";
155
155
 
156
156
  // src/multiple-versions-warning.ts
157
157
  var checkMultipleRemotionVersions = () => {
@@ -1944,7 +1944,7 @@ var prefetch = (src, options) => {
1944
1944
  if (canBeAborted) {
1945
1945
  try {
1946
1946
  controller.abort(new Error("free() called"));
1947
- } catch (e) {
1947
+ } catch {
1948
1948
  }
1949
1949
  }
1950
1950
  }
@@ -2140,6 +2140,9 @@ var playAndHandleNotAllowedError = (mediaRef, mediaType, onAutoPlayError) => {
2140
2140
  if (err.message.includes("because the media was removed from the document")) {
2141
2141
  return;
2142
2142
  }
2143
+ if (err.message.includes("user didn't interact with the document") && current.muted) {
2144
+ return;
2145
+ }
2143
2146
  console.log(`Could not play ${mediaType} due to following error: `, err);
2144
2147
  if (!current.muted) {
2145
2148
  if (onAutoPlayError) {
@@ -3822,10 +3825,7 @@ var FolderContext = createContext17({
3822
3825
  folderName: null,
3823
3826
  parentName: null
3824
3827
  });
3825
- var Folder = ({
3826
- name,
3827
- children
3828
- }) => {
3828
+ var Folder = ({ name, children }) => {
3829
3829
  const parent = useContext24(FolderContext);
3830
3830
  const { registerFolder, unregisterFolder } = useContext24(CompositionManager);
3831
3831
  validateFolderName(name);
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "4.0.225";
2
+ var VERSION = "4.0.227";
3
3
  export {
4
4
  VERSION
5
5
  };
@@ -0,0 +1,11 @@
1
+ import {remotionFlatConfig} from '@remotion/eslint-config-internal';
2
+
3
+ const config = remotionFlatConfig({react: true});
4
+
5
+ export default {
6
+ ...config,
7
+ rules: {
8
+ ...config.rules,
9
+ 'no-console': 'error',
10
+ },
11
+ };
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.225",
6
+ "version": "4.0.227",
7
7
  "description": "Make videos programmatically",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -26,7 +26,9 @@
26
26
  "react-dom": "18.3.1",
27
27
  "vitest": "0.31.1",
28
28
  "webpack": "5.94.0",
29
- "zod": "3.22.3"
29
+ "zod": "3.22.3",
30
+ "eslint": "9.14.0",
31
+ "@remotion/eslint-config-internal": "4.0.227"
30
32
  },
31
33
  "keywords": [
32
34
  "remotion",
@@ -72,8 +74,8 @@
72
74
  "homepage": "https://www.remotion.dev/docs/remotion",
73
75
  "scripts": {
74
76
  "formatting": "prettier src --check",
75
- "lint": "eslint src --ext ts,tsx",
77
+ "lint": "eslint src",
76
78
  "test": "vitest --run",
77
- "make": "bun --env-file=../.env.bundle bundle.ts"
79
+ "make": "tsc -d && bun --env-file=../.env.bundle bundle.ts"
78
80
  }
79
81
  }