remotion 3.3.78 → 3.3.80

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,15 @@
1
+ import React from 'react';
2
+ declare type Props = Record<string, object>;
3
+ export declare type EditorPropsContextType = {
4
+ props: Props;
5
+ updateProps: (options: {
6
+ id: string;
7
+ defaultProps: object;
8
+ newProps: object;
9
+ }) => void;
10
+ };
11
+ export declare const EditorPropsContext: React.Context<EditorPropsContextType>;
12
+ export declare const EditorPropsProvider: React.FC<{
13
+ children: React.ReactNode;
14
+ }>;
15
+ export {};
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.EditorPropsProvider = exports.EditorPropsContext = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = __importStar(require("react"));
29
+ exports.EditorPropsContext = (0, react_1.createContext)({
30
+ props: {},
31
+ updateProps: () => {
32
+ throw new Error('Not implemented');
33
+ },
34
+ });
35
+ const EditorPropsProvider = ({ children }) => {
36
+ const [props, setProps] = react_1.default.useState({});
37
+ const updateProps = (0, react_1.useCallback)(({ defaultProps, id, newProps, }) => {
38
+ setProps((prev) => {
39
+ var _a;
40
+ return {
41
+ ...prev,
42
+ [id]: typeof newProps === 'function'
43
+ ? newProps((_a = prev[id]) !== null && _a !== void 0 ? _a : defaultProps)
44
+ : newProps,
45
+ };
46
+ });
47
+ }, []);
48
+ const ctx = (0, react_1.useMemo)(() => {
49
+ return { props, updateProps };
50
+ }, [props, updateProps]);
51
+ return ((0, jsx_runtime_1.jsx)(exports.EditorPropsContext.Provider, { value: ctx, children: children }));
52
+ };
53
+ exports.EditorPropsProvider = EditorPropsProvider;
@@ -182,6 +182,7 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
182
182
  };
183
183
  exports.SharedAudioContextProvider = SharedAudioContextProvider;
184
184
  const useSharedAudio = (aud, audioId) => {
185
+ var _a;
185
186
  const ctx = (0, react_1.useContext)(exports.SharedAudioContext);
186
187
  /**
187
188
  * We work around this in React 18 so an audio tag will only register itself once
@@ -201,8 +202,10 @@ const useSharedAudio = (aud, audioId) => {
201
202
  * Effects in React 18 fire twice, and we are looking for a way to only fire it once.
202
203
  * - useInsertionEffect only fires once. If it's available we are in React 18.
203
204
  * - useLayoutEffect only fires once in React 17.
205
+ *
206
+ * Need to import it from React to fix React 17 ESM support.
204
207
  */
205
- const effectToUse = react_1.useInsertionEffect !== null && react_1.useInsertionEffect !== void 0 ? react_1.useInsertionEffect : react_1.useLayoutEffect;
208
+ const effectToUse = (_a = react_1.default.useInsertionEffect) !== null && _a !== void 0 ? _a : react_1.default.useLayoutEffect;
206
209
  if (typeof document !== 'undefined') {
207
210
  effectToUse(() => {
208
211
  if (ctx && ctx.numberOfAudioTags > 0) {
@@ -0,0 +1,10 @@
1
+ import type { z } from 'zod';
2
+ export declare type PropsIfHasProps<Schema extends z.ZodTypeAny, Props> = z.ZodTypeAny extends Schema ? {} extends Props ? {
3
+ defaultProps?: Props;
4
+ } : {
5
+ defaultProps: Props;
6
+ } : {} extends Props ? {
7
+ defaultProps: z.infer<Schema>;
8
+ } : {
9
+ defaultProps: z.infer<Schema> & Props;
10
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- export declare const VERSION = "3.3.78";
1
+ export declare const VERSION = "3.3.80";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Automatically generated on publish
5
- exports.VERSION = '3.3.78';
5
+ exports.VERSION = '3.3.80';
@@ -1,4 +1,4 @@
1
- import React, { createContext, useState, useMemo, useLayoutEffect, useContext, useEffect, forwardRef, useRef, useCallback, useImperativeHandle, Children, isValidElement, useReducer, createRef, useInsertionEffect, Suspense } from 'react';
1
+ import React, { createContext, useState, useMemo, useLayoutEffect, useContext, useEffect, forwardRef, useRef, useCallback, useImperativeHandle, Children, isValidElement, useReducer, createRef, Suspense } from 'react';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
3
  import { createPortal } from 'react-dom';
4
4
 
@@ -58,7 +58,7 @@ function truthy(value) {
58
58
  }
59
59
 
60
60
  // Automatically generated on publish
61
- const VERSION = '3.3.78';
61
+ const VERSION = '3.3.80';
62
62
 
63
63
  const checkMultipleRemotionVersions = () => {
64
64
  if (typeof globalThis === 'undefined') {
@@ -1539,6 +1539,7 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
1539
1539
  }), children] }));
1540
1540
  };
1541
1541
  const useSharedAudio = (aud, audioId) => {
1542
+ var _a;
1542
1543
  const ctx = useContext(SharedAudioContext);
1543
1544
  /**
1544
1545
  * We work around this in React 18 so an audio tag will only register itself once
@@ -1558,8 +1559,10 @@ const useSharedAudio = (aud, audioId) => {
1558
1559
  * Effects in React 18 fire twice, and we are looking for a way to only fire it once.
1559
1560
  * - useInsertionEffect only fires once. If it's available we are in React 18.
1560
1561
  * - useLayoutEffect only fires once in React 17.
1562
+ *
1563
+ * Need to import it from React to fix React 17 ESM support.
1561
1564
  */
1562
- const effectToUse = useInsertionEffect !== null && useInsertionEffect !== void 0 ? useInsertionEffect : useLayoutEffect;
1565
+ const effectToUse = (_a = React.useInsertionEffect) !== null && _a !== void 0 ? _a : React.useLayoutEffect;
1563
1566
  if (typeof document !== 'undefined') {
1564
1567
  effectToUse(() => {
1565
1568
  if (ctx && ctx.numberOfAudioTags > 0) {
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '3.3.78';
2
+ const VERSION = '3.3.80';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "3.3.78",
3
+ "version": "3.3.80",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",