remotion 4.0.5 → 4.0.6

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,4 +1,4 @@
1
- import type { ComponentType } from 'react';
1
+ import type { ComponentType, PropsWithChildren } from 'react';
2
2
  import React from 'react';
3
3
  import type { AnyZodObject } from 'zod';
4
4
  import type { InferProps, PropsIfHasProps } from './props-if-has-props.js';
@@ -53,4 +53,5 @@ export type CompositionProps<Schema extends AnyZodObject, Props extends Record<s
53
53
  * @see [Documentation](https://www.remotion.dev/docs/composition)
54
54
  */
55
55
  export declare const Composition: <Schema extends AnyZodObject, Props extends Record<string, unknown>>({ width, height, fps, durationInFrames, id, defaultProps, schema, ...compProps }: CompositionProps<Schema, Props>) => React.ReactPortal | null;
56
+ export declare const ClipComposition: React.FC<PropsWithChildren>;
56
57
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Composition = void 0;
3
+ exports.ClipComposition = exports.Composition = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const react_dom_1 = require("react-dom");
@@ -93,7 +93,7 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
93
93
  if (resolved === null || resolved.type !== 'success') {
94
94
  return null;
95
95
  }
96
- return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(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, { ...((_a = resolved.result.props) !== null && _a !== void 0 ? _a : {}) }) }) }) }), (0, portal_node_js_1.portalNode)());
96
+ 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, { ...((_a = resolved.result.props) !== null && _a !== void 0 ? _a : {}) }) }) }) }), (0, portal_node_js_1.portalNode)());
97
97
  }
98
98
  if (environment === 'rendering' && video && video.component === lazy) {
99
99
  const Comp = lazy;
@@ -119,3 +119,4 @@ const ClipComposition = ({ children }) => {
119
119
  }, [clipRegion]);
120
120
  return (0, jsx_runtime_1.jsx)(AbsoluteFill_js_1.AbsoluteFill, { style: style, children: children });
121
121
  };
122
+ exports.ClipComposition = ClipComposition;
@@ -17,13 +17,14 @@ const NativeLayersProvider = ({ children, }) => {
17
17
  clipRegion,
18
18
  };
19
19
  }, [clipRegion, setClipRegion]);
20
- (0, react_1.useLayoutEffect)(() => {
21
- if (typeof window !== 'undefined') {
20
+ if (typeof window !== 'undefined') {
21
+ // eslint-disable-next-line react-hooks/rules-of-hooks
22
+ (0, react_1.useLayoutEffect)(() => {
22
23
  window.remotion_getClipRegion = () => {
23
24
  return clipRegion;
24
25
  };
25
- }
26
- }, [clipRegion, setClipRegion]);
26
+ }, [clipRegion, setClipRegion]);
27
+ }
27
28
  return ((0, jsx_runtime_1.jsx)(exports.NativeLayersContext.Provider, { value: context, children: children }));
28
29
  };
29
30
  exports.NativeLayersProvider = NativeLayersProvider;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { CompProps } from './Composition.js';
2
+ import { type CompProps } from './Composition.js';
3
3
  import type { TAsset, TCompMetadata, TComposition, TSequence } from './CompositionManager.js';
4
4
  import type { CompositionManagerContext } from './CompositionManagerContext.js';
5
5
  import * as CSSUtils from './default-css.js';
@@ -128,6 +128,7 @@ export declare const Internals: {
128
128
  readonly REMOTION_STUDIO_CONTAINER_ELEMENT: "__remotion-studio-container";
129
129
  readonly AssetManager: import("react").Context<import("./AssetManager.js").AssetManagerContext>;
130
130
  readonly bundleName: "bundle.js";
131
+ readonly bundleMapName: "bundle.js.map";
131
132
  readonly persistCurrentFrame: (frame: number, composition: string) => void;
132
133
  readonly useTimelineSetFrame: () => (u: import("react").SetStateAction<Record<string, number>>) => void;
133
134
  readonly serializeJSONWithDate: ({ data, indent, staticBase, }: {
@@ -137,5 +138,11 @@ export declare const Internals: {
137
138
  }) => SerializedJSONWithCustomFields;
138
139
  readonly deserializeJSONWithCustomFields: (data: string) => Record<string, unknown>;
139
140
  readonly FILE_TOKEN: "remotion-file:";
141
+ readonly NativeLayersProvider: import("react").FC<{
142
+ children?: import("react").ReactNode;
143
+ }>;
144
+ readonly ClipComposition: import("react").FC<{
145
+ children?: import("react").ReactNode;
146
+ }>;
140
147
  };
141
148
  export type { TComposition, Timeline, TCompMetadata, TSequence, TAsset, TimelineContextValue, SetTimelineContextValue, CompProps, CompositionManagerContext, MediaVolumeContextValue, SetMediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, };
@@ -27,6 +27,7 @@ exports.Internals = void 0;
27
27
  const AssetManager_js_1 = require("./AssetManager.js");
28
28
  const shared_audio_tags_js_1 = require("./audio/shared-audio-tags.js");
29
29
  const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js");
30
+ const Composition_js_1 = require("./Composition.js");
30
31
  const CompositionManager_js_1 = require("./CompositionManager.js");
31
32
  const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js");
32
33
  const CSSUtils = __importStar(require("./default-css.js"));
@@ -37,6 +38,7 @@ const get_preview_dom_element_js_1 = require("./get-preview-dom-element.js");
37
38
  const input_props_serialization_js_1 = require("./input-props-serialization.js");
38
39
  const interpolate_colors_js_1 = require("./interpolate-colors.js");
39
40
  const is_player_js_1 = require("./is-player.js");
41
+ const NativeLayers_js_1 = require("./NativeLayers.js");
40
42
  const nonce_js_1 = require("./nonce.js");
41
43
  const portal_node_js_1 = require("./portal-node.js");
42
44
  const prefetch_state_js_1 = require("./prefetch-state.js");
@@ -48,8 +50,8 @@ const ResolveCompositionConfig_js_1 = require("./ResolveCompositionConfig.js");
48
50
  const SequenceContext_js_1 = require("./SequenceContext.js");
49
51
  const SequenceManager_js_1 = require("./SequenceManager.js");
50
52
  const setup_env_variables_js_1 = require("./setup-env-variables.js");
51
- const timeline_position_state_js_1 = require("./timeline-position-state.js");
52
53
  const TimelinePosition = __importStar(require("./timeline-position-state.js"));
54
+ const timeline_position_state_js_1 = require("./timeline-position-state.js");
53
55
  const truthy_js_1 = require("./truthy.js");
54
56
  const use_lazy_component_js_1 = require("./use-lazy-component.js");
55
57
  const use_unsafe_video_config_js_1 = require("./use-unsafe-video-config.js");
@@ -119,9 +121,12 @@ exports.Internals = {
119
121
  REMOTION_STUDIO_CONTAINER_ELEMENT: get_preview_dom_element_js_1.REMOTION_STUDIO_CONTAINER_ELEMENT,
120
122
  AssetManager: AssetManager_js_1.AssetManager,
121
123
  bundleName: 'bundle.js',
124
+ bundleMapName: 'bundle.js.map',
122
125
  persistCurrentFrame: timeline_position_state_js_1.persistCurrentFrame,
123
126
  useTimelineSetFrame: timeline_position_state_js_1.useTimelineSetFrame,
124
127
  serializeJSONWithDate: input_props_serialization_js_1.serializeJSONWithDate,
125
128
  deserializeJSONWithCustomFields: input_props_serialization_js_1.deserializeJSONWithCustomFields,
126
129
  FILE_TOKEN: input_props_serialization_js_1.FILE_TOKEN,
130
+ NativeLayersProvider: NativeLayers_js_1.NativeLayersProvider,
131
+ ClipComposition: Composition_js_1.ClipComposition,
127
132
  };
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.5";
1
+ export declare const VERSION = "4.0.6";
@@ -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 = '4.0.5';
5
+ exports.VERSION = '4.0.6';
@@ -16,13 +16,14 @@ const NativeLayersProvider = ({ children, }) => {
16
16
  clipRegion,
17
17
  };
18
18
  }, [clipRegion, setClipRegion]);
19
- useLayoutEffect(() => {
20
- if (typeof window !== 'undefined') {
19
+ if (typeof window !== 'undefined') {
20
+ // eslint-disable-next-line react-hooks/rules-of-hooks
21
+ useLayoutEffect(() => {
21
22
  window.remotion_getClipRegion = () => {
22
23
  return clipRegion;
23
24
  };
24
- }
25
- }, [clipRegion, setClipRegion]);
25
+ }, [clipRegion, setClipRegion]);
26
+ }
26
27
  return (jsx(NativeLayersContext.Provider, { value: context, children: children }));
27
28
  };
28
29
 
@@ -58,7 +59,7 @@ function truthy(value) {
58
59
  }
59
60
 
60
61
  // Automatically generated on publish
61
- const VERSION = '4.0.5';
62
+ const VERSION = '4.0.6';
62
63
 
63
64
  const checkMultipleRemotionVersions = () => {
64
65
  if (typeof globalThis === 'undefined') {
@@ -3825,11 +3826,14 @@ const Internals = {
3825
3826
  REMOTION_STUDIO_CONTAINER_ELEMENT,
3826
3827
  AssetManager,
3827
3828
  bundleName: 'bundle.js',
3829
+ bundleMapName: 'bundle.js.map',
3828
3830
  persistCurrentFrame,
3829
3831
  useTimelineSetFrame,
3830
3832
  serializeJSONWithDate,
3831
3833
  deserializeJSONWithCustomFields,
3832
3834
  FILE_TOKEN,
3835
+ NativeLayersProvider,
3836
+ ClipComposition,
3833
3837
  };
3834
3838
 
3835
3839
  const flattenChildren = (children) => {
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.5';
2
+ const VERSION = '4.0.6';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "eslint-plugin-require-extensions": "^0.1.2",
30
30
  "jsdom": "21.1.0",
31
31
  "prettier": "^2.7.1",
32
- "prettier-plugin-organize-imports": "^2.3.4",
32
+ "prettier-plugin-organize-imports": "^3.2.2",
33
33
  "react": "^18.0.0",
34
34
  "react-dom": "^18.0.0",
35
35
  "rimraf": "^3.0.2",