Comparing version 4.0.227 to 4.0.228
@@ -53,2 +53,5 @@ "use strict"; | ||
if (loop && durationFetched !== undefined) { | ||
if (!Number.isFinite(durationFetched)) { | ||
return ((0, jsx_runtime_1.jsx)(exports.Audio, { ...propsOtherThanLoop, ref: ref, _remotionInternalNativeLoopPassed: true })); | ||
} | ||
const duration = durationFetched * fps; | ||
@@ -55,0 +58,0 @@ return ((0, jsx_runtime_1.jsx)(index_js_1.Loop, { layout: "none", durationInFrames: (0, calculate_loop_js_1.calculateLoopDuration)({ |
import type React from 'react'; | ||
export declare const Clipper: React.FC<{ | ||
readonly width: number; | ||
readonly height: number; | ||
readonly x: number; | ||
readonly y: number; | ||
}>; | ||
/** | ||
* @deprecated <Clipper> has been removed as of Remotion v4.0.228. The native clipping APIs were experimental and subject to removal at any time. We removed them because they were sparingly used and made rendering often slower rather than faster. | ||
*/ | ||
export declare const Clipper: React.FC<{}>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Clipper = void 0; | ||
const react_1 = require("react"); | ||
const NativeLayers_js_1 = require("./NativeLayers.js"); | ||
const Clipper = ({ height, width, x, y }) => { | ||
const { setClipRegion } = (0, react_1.useContext)(NativeLayers_js_1.NativeLayersContext); | ||
(0, react_1.useEffect)(() => { | ||
setClipRegion((c) => { | ||
if (c === 'hide') { | ||
throw new Error('Cannot render <Clipper>, because another <Null> is already rendered'); | ||
} | ||
if (c === null) { | ||
return { height, width, x, y }; | ||
} | ||
throw new Error('Cannot render <Clipper>, because another component clipping the region was already rendered (most likely <Clipper>)'); | ||
}); | ||
return () => { | ||
setClipRegion(null); | ||
}; | ||
}, [height, setClipRegion, width, x, y]); | ||
return null; | ||
/** | ||
* @deprecated <Clipper> has been removed as of Remotion v4.0.228. The native clipping APIs were experimental and subject to removal at any time. We removed them because they were sparingly used and made rendering often slower rather than faster. | ||
*/ | ||
const Clipper = () => { | ||
throw new Error('<Clipper> has been removed as of Remotion v4.0.228. The native clipping APIs were experimental and subject to removal at any time. We removed them because they were sparingly used and made rendering often slower rather than faster.'); | ||
}; | ||
exports.Clipper = Clipper; |
@@ -1,2 +0,2 @@ | ||
import type { ComponentType, PropsWithChildren } from 'react'; | ||
import type { ComponentType } from 'react'; | ||
import React from 'react'; | ||
@@ -50,3 +50,2 @@ import type { AnyZodObject } from 'zod'; | ||
} & StillCalculateMetadataOrExplicit<Schema, Props> & CompProps<Props> & PropsIfHasProps<Schema, Props>; | ||
export declare const ClipComposition: React.FC<PropsWithChildren>; | ||
export type CompositionProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = { | ||
@@ -53,0 +52,0 @@ readonly id: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Composition = exports.ClipComposition = void 0; | ||
exports.Composition = void 0; | ||
const jsx_runtime_1 = require("react/jsx-runtime"); | ||
const react_1 = require("react"); | ||
const react_dom_1 = require("react-dom"); | ||
const AbsoluteFill_js_1 = require("./AbsoluteFill.js"); | ||
const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js"); | ||
const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js"); | ||
const Folder_js_1 = require("./Folder.js"); | ||
const NativeLayers_js_1 = require("./NativeLayers.js"); | ||
const ResolveCompositionConfig_js_1 = require("./ResolveCompositionConfig.js"); | ||
@@ -24,17 +22,2 @@ const delay_render_js_1 = require("./delay-render.js"); | ||
const validate_default_props_js_1 = require("./validation/validate-default-props.js"); | ||
const ClipComposition = ({ children }) => { | ||
const { clipRegion } = (0, react_1.useContext)(NativeLayers_js_1.NativeLayersContext); | ||
const style = (0, react_1.useMemo)(() => { | ||
return { | ||
display: 'flex', | ||
flexDirection: 'row', | ||
opacity: clipRegion === 'hide' ? 0 : 1, | ||
clipPath: clipRegion && clipRegion !== 'hide' | ||
? `polygon(${clipRegion.x}px ${clipRegion.y}px, ${clipRegion.x}px ${clipRegion.height + clipRegion.y}px, ${clipRegion.width + clipRegion.x}px ${clipRegion.height + clipRegion.y}px, ${clipRegion.width + clipRegion.x}px ${clipRegion.y}px)` | ||
: undefined, | ||
}; | ||
}, [clipRegion]); | ||
return (0, jsx_runtime_1.jsx)(AbsoluteFill_js_1.AbsoluteFill, { style: style, children: children }); | ||
}; | ||
exports.ClipComposition = ClipComposition; | ||
const Fallback = () => { | ||
@@ -114,3 +97,3 @@ (0, react_1.useEffect)(() => { | ||
} | ||
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)()); | ||
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)(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)()); | ||
} | ||
@@ -117,0 +100,0 @@ if (environment.isRendering && video && video.component === lazy) { |
@@ -6,3 +6,2 @@ import './_check-rsc.js'; | ||
import type { StaticFile } from './get-static-files.js'; | ||
import type { ClipRegion } from './NativeLayers.js'; | ||
import type { VideoConfig } from './video-config.js'; | ||
@@ -47,3 +46,2 @@ export type VideoConfigWithSerializedProps = Omit<VideoConfig, 'defaultProps' | 'props'> & { | ||
remotion_collectAssets: () => TRenderAsset[]; | ||
remotion_getClipRegion: () => ClipRegion | null; | ||
remotion_isPlayer: boolean; | ||
@@ -93,3 +91,2 @@ remotion_isStudio: boolean; | ||
export { Loop } from './loop/index.js'; | ||
export { ClipRegion } from './NativeLayers.js'; | ||
export { EasingFunction, ExtrapolateType, interpolate, InterpolateOptions, random, RandomSeed, } from './no-react'; | ||
@@ -117,8 +114,3 @@ export { prefetch, PrefetchOnProgress } from './prefetch.js'; | ||
*/ | ||
Clipper: import("react").FC<{ | ||
readonly width: number; | ||
readonly height: number; | ||
readonly x: number; | ||
readonly y: number; | ||
}>; | ||
Clipper: import("react").FC<{}>; | ||
/** | ||
@@ -125,0 +117,0 @@ * @description This is a special component, that, when rendered, will skip rendering the frame altogether. |
@@ -126,8 +126,2 @@ import { type CompProps } from './Composition.js'; | ||
readonly useTimelineSetFrame: () => ((u: React.SetStateAction<Record<string, number>>) => void); | ||
readonly NativeLayersProvider: import("react").FC<{ | ||
children?: import("react").ReactNode | undefined; | ||
}>; | ||
readonly ClipComposition: import("react").FC<{ | ||
children?: import("react").ReactNode | undefined; | ||
}>; | ||
readonly isIosSafari: () => boolean; | ||
@@ -134,0 +128,0 @@ readonly WATCH_REMOTION_STATIC_FILES: "remotion_staticFilesChanged"; |
@@ -31,3 +31,2 @@ "use strict"; | ||
const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js"); | ||
const Composition_js_1 = require("./Composition.js"); | ||
const CompositionManager_js_1 = require("./CompositionManager.js"); | ||
@@ -41,3 +40,2 @@ const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js"); | ||
const is_player_js_1 = require("./is-player.js"); | ||
const NativeLayers_js_1 = require("./NativeLayers.js"); | ||
const nonce_js_1 = require("./nonce.js"); | ||
@@ -118,4 +116,2 @@ const portal_node_js_1 = require("./portal-node.js"); | ||
useTimelineSetFrame: timeline_position_state_js_1.useTimelineSetFrame, | ||
NativeLayersProvider: NativeLayers_js_1.NativeLayersProvider, | ||
ClipComposition: Composition_js_1.ClipComposition, | ||
isIosSafari: video_fragment_js_1.isIosSafari, | ||
@@ -122,0 +118,0 @@ WATCH_REMOTION_STATIC_FILES: watch_static_file_js_1.WATCH_REMOTION_STATIC_FILES, |
export type { ArtifactAsset, AudioOrVideoAsset, TRenderAsset, } from './CompositionManager'; | ||
export { EasingFunction, ExtrapolateType, interpolate, InterpolateOptions, } from './interpolate'; | ||
export type { ClipRegion } from './NativeLayers'; | ||
export { random, RandomSeed } from './random.js'; | ||
@@ -5,0 +4,0 @@ export type { VideoConfig } from './video-config'; |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @deprecated <Null /> has been removed as of Remotion v4.0.228. The native clipping APIs were experimental and subject to removal at any time. We removed them because they were sparingly used and made rendering often slower rather than faster. | ||
*/ | ||
export declare const Null: React.FC; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Null = void 0; | ||
const react_1 = require("react"); | ||
const NativeLayers_js_1 = require("./NativeLayers.js"); | ||
/** | ||
* @deprecated <Null /> has been removed as of Remotion v4.0.228. The native clipping APIs were experimental and subject to removal at any time. We removed them because they were sparingly used and made rendering often slower rather than faster. | ||
*/ | ||
const Null = () => { | ||
const { setClipRegion } = (0, react_1.useContext)(NativeLayers_js_1.NativeLayersContext); | ||
(0, react_1.useEffect)(() => { | ||
setClipRegion((c) => { | ||
if (c === null) { | ||
return 'hide'; | ||
} | ||
// Rendering multiple <Null> is fine, because they are all hidden | ||
if (c === 'hide') { | ||
return 'hide'; | ||
} | ||
throw new Error('Cannot render <Null>, because another component clipping the region was already rendered (most likely <Clipper>)'); | ||
}); | ||
return () => { | ||
setClipRegion(null); | ||
}; | ||
}, [setClipRegion]); | ||
return null; | ||
throw new Error('<Null> has been removed as of Remotion v4.0.228. The native clipping APIs were experimental and subject to removal at any time. We removed them because they were sparingly used and made rendering often slower rather than faster.'); | ||
}; | ||
exports.Null = Null; |
@@ -8,3 +8,2 @@ "use strict"; | ||
const EditorProps_js_1 = require("./EditorProps.js"); | ||
const NativeLayers_js_1 = require("./NativeLayers.js"); | ||
const buffering_js_1 = require("./buffering.js"); | ||
@@ -91,4 +90,4 @@ const delay_render_js_1 = require("./delay-render.js"); | ||
}, []); | ||
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)(EditorProps_js_1.EditorPropsProvider, { 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: (0, jsx_runtime_1.jsx)(buffering_js_1.BufferingProvider, { children: children }) }) }) }) }) }) }) }) })); | ||
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)(EditorProps_js_1.EditorPropsProvider, { children: (0, jsx_runtime_1.jsx)(prefetch_state_js_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(CompositionManager_js_1.CompositionManagerProvider, { numberOfAudioTags: numberOfAudioTags, children: (0, jsx_runtime_1.jsx)(duration_state_js_1.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(buffering_js_1.BufferingProvider, { children: children }) }) }) }) }) }) }) })); | ||
}; | ||
exports.RemotionRoot = RemotionRoot; |
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
export declare const VERSION = "4.0.227"; | ||
export declare const VERSION = "4.0.228"; |
@@ -10,2 +10,2 @@ "use strict"; | ||
*/ | ||
exports.VERSION = '4.0.227'; | ||
exports.VERSION = '4.0.228'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.seekToTimeMultipleUntilRight = exports.seekToTime = void 0; | ||
const is_approximately_the_same_1 = require("../is-approximately-the-same"); | ||
const roundTo6Commas = (num) => { | ||
@@ -8,2 +9,8 @@ return Math.round(num * 100000) / 100000; | ||
const seekToTime = (element, desiredTime) => { | ||
if ((0, is_approximately_the_same_1.isApproximatelyTheSame)(element.currentTime, desiredTime)) { | ||
return { | ||
wait: Promise.resolve(desiredTime), | ||
cancel: () => { }, | ||
}; | ||
} | ||
element.currentTime = desiredTime; | ||
@@ -10,0 +17,0 @@ let cancel; |
@@ -40,2 +40,5 @@ "use strict"; | ||
if (loop && durationFetched !== undefined) { | ||
if (!Number.isFinite(durationFetched)) { | ||
return ((0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref, _remotionInternalNativeLoopPassed: true })); | ||
} | ||
const mediaDuration = durationFetched * fps; | ||
@@ -42,0 +45,0 @@ return ((0, jsx_runtime_1.jsx)(index_js_1.Loop, { durationInFrames: (0, calculate_loop_js_1.calculateLoopDuration)({ |
@@ -109,3 +109,3 @@ "use strict"; | ||
}); | ||
const handle = (0, delay_render_js_1.delayRender)(`Rendering <Video /> with src="${props.src}"`, { | ||
const handle = (0, delay_render_js_1.delayRender)(`Rendering <Video /> with src="${props.src}" at time ${currentTime}`, { | ||
retries: delayRenderRetries !== null && delayRenderRetries !== void 0 ? delayRenderRetries : undefined, | ||
@@ -112,0 +112,0 @@ timeoutInMilliseconds: delayRenderTimeoutInMilliseconds !== null && delayRenderTimeoutInMilliseconds !== void 0 ? delayRenderTimeoutInMilliseconds : undefined, |
@@ -9,3 +9,2 @@ import React from 'react'; | ||
canUseRemotionHooksContext: boolean; | ||
nativeLayersContext: import("./NativeLayers.js").TNativeLayersContext; | ||
preloadContext: { | ||
@@ -12,0 +11,0 @@ [x: string]: string; |
@@ -35,3 +35,2 @@ "use strict"; | ||
const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js"); | ||
const NativeLayers_js_1 = require("./NativeLayers.js"); | ||
const RenderAssetManager_js_1 = require("./RenderAssetManager.js"); | ||
@@ -52,3 +51,2 @@ const ResolveCompositionConfig_js_1 = require("./ResolveCompositionConfig.js"); | ||
const canUseRemotionHooksContext = react_1.default.useContext(CanUseRemotionHooks_js_1.CanUseRemotionHooks); | ||
const nativeLayersContext = react_1.default.useContext(NativeLayers_js_1.NativeLayersContext); | ||
const preloadContext = react_1.default.useContext(prefetch_state_js_1.PreloadContext); | ||
@@ -66,3 +64,2 @@ const resolveCompositionContext = react_1.default.useContext(ResolveCompositionConfig_js_1.ResolveCompositionContext); | ||
canUseRemotionHooksContext, | ||
nativeLayersContext, | ||
preloadContext, | ||
@@ -80,3 +77,2 @@ resolveCompositionContext, | ||
canUseRemotionHooksContext, | ||
nativeLayersContext, | ||
preloadContext, | ||
@@ -91,4 +87,4 @@ resolveCompositionContext, | ||
const { children, contexts } = props; | ||
return ((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooks.Provider, { value: contexts.canUseRemotionHooksContext, children: (0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: contexts.nonceContext, children: (0, jsx_runtime_1.jsx)(NativeLayers_js_1.NativeLayersContext.Provider, { value: contexts.nativeLayersContext, children: (0, jsx_runtime_1.jsx)(prefetch_state_js_1.PreloadContext.Provider, { value: contexts.preloadContext, children: (0, jsx_runtime_1.jsx)(CompositionManagerContext_js_1.CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: (0, jsx_runtime_1.jsx)(SequenceManager_js_1.SequenceManager.Provider, { value: contexts.sequenceManagerContext, children: (0, jsx_runtime_1.jsx)(RenderAssetManager_js_1.RenderAssetManager.Provider, { value: contexts.renderAssetManagerContext, children: (0, jsx_runtime_1.jsx)(ResolveCompositionConfig_js_1.ResolveCompositionContext.Provider, { value: contexts.resolveCompositionContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.TimelineContext.Provider, { value: contexts.timelineContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: (0, jsx_runtime_1.jsx)(SequenceContext_js_1.SequenceContext.Provider, { value: contexts.sequenceContext, children: (0, jsx_runtime_1.jsx)(buffering_js_1.BufferingContextReact.Provider, { value: contexts.bufferManagerContext, children: children }) }) }) }) }) }) }) }) }) }) }) })); | ||
return ((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_js_1.CanUseRemotionHooks.Provider, { value: contexts.canUseRemotionHooksContext, children: (0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: contexts.nonceContext, children: (0, jsx_runtime_1.jsx)(prefetch_state_js_1.PreloadContext.Provider, { value: contexts.preloadContext, children: (0, jsx_runtime_1.jsx)(CompositionManagerContext_js_1.CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: (0, jsx_runtime_1.jsx)(SequenceManager_js_1.SequenceManager.Provider, { value: contexts.sequenceManagerContext, children: (0, jsx_runtime_1.jsx)(RenderAssetManager_js_1.RenderAssetManager.Provider, { value: contexts.renderAssetManagerContext, children: (0, jsx_runtime_1.jsx)(ResolveCompositionConfig_js_1.ResolveCompositionContext.Provider, { value: contexts.resolveCompositionContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.TimelineContext.Provider, { value: contexts.timelineContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: (0, jsx_runtime_1.jsx)(SequenceContext_js_1.SequenceContext.Provider, { value: contexts.sequenceContext, children: (0, jsx_runtime_1.jsx)(buffering_js_1.BufferingContextReact.Provider, { value: contexts.bufferManagerContext, children: children }) }) }) }) }) }) }) }) }) }) })); | ||
}; | ||
exports.RemotionContextProvider = RemotionContextProvider; |
@@ -6,3 +6,3 @@ { | ||
"name": "remotion", | ||
"version": "4.0.227", | ||
"version": "4.0.228", | ||
"description": "Make videos programmatically", | ||
@@ -29,6 +29,6 @@ "main": "dist/cjs/index.js", | ||
"vitest": "0.31.1", | ||
"webpack": "5.94.0", | ||
"webpack": "5.96.1", | ||
"zod": "3.22.3", | ||
"eslint": "9.14.0", | ||
"@remotion/eslint-config-internal": "4.0.227" | ||
"@remotion/eslint-config-internal": "4.0.228" | ||
}, | ||
@@ -35,0 +35,0 @@ "keywords": [ |
@@ -29,7 +29,7 @@ <p align="center"> | ||
<td align="center"> | ||
<img style="width: 290px" src="packages/docs/static/img/fireship-quick.gif" /> | ||
<img style="width: 290px" src="https://remotion-assets.s3.eu-central-1.amazonaws.com/fireship-quick.gif" /> | ||
<p>"This video was made with code" <em>- Fireship</em> <a href="https://youtu.be/deg8bOoziaE">Watch</a> • <a href="https://github.com/wcandillon/remotion-fireship">Source</a></p> | ||
</td> | ||
<td align="center"> | ||
<img style="width: 240px" src="packages/docs/static/img/unwrapped-2023.gif" /> | ||
<img style="width: 240px" src="https://remotion-assets.s3.eu-central-1.amazonaws.com/unwrapped-2023.gif" /> | ||
<p>GitHub Unwrapped - Personalized Year in Review <a href="https://www.githubunwrapped.com">Try</a> • <a href="https://github.com/remotion-dev/github-unwrapped-2023">Source</a></p> | ||
@@ -36,0 +36,0 @@ </td> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
658477
16654