@remotion/promo-pages 4.0.496 → 4.0.498

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.
package/dist/team.js CHANGED
@@ -5760,7 +5760,7 @@ var getSingleChildComponent = (children) => {
5760
5760
  }
5761
5761
  return child.type;
5762
5762
  };
5763
- var VERSION = "4.0.496";
5763
+ var VERSION = "4.0.498";
5764
5764
  var checkMultipleRemotionVersions = () => {
5765
5765
  if (typeof globalThis === "undefined") {
5766
5766
  return;
@@ -6238,6 +6238,45 @@ var textSchema = {
6238
6238
  hiddenFromList: false
6239
6239
  }
6240
6240
  };
6241
+ var borderSchema = {
6242
+ "style.borderWidth": {
6243
+ type: "number",
6244
+ default: undefined,
6245
+ min: 0,
6246
+ step: 1,
6247
+ description: "Border width",
6248
+ hiddenFromList: false
6249
+ },
6250
+ "style.borderStyle": {
6251
+ type: "enum",
6252
+ default: "none",
6253
+ description: "Border style",
6254
+ variants: {
6255
+ none: {},
6256
+ hidden: {},
6257
+ solid: {},
6258
+ dashed: {},
6259
+ dotted: {},
6260
+ double: {},
6261
+ groove: {},
6262
+ ridge: {},
6263
+ inset: {},
6264
+ outset: {}
6265
+ }
6266
+ },
6267
+ "style.borderColor": {
6268
+ type: "color",
6269
+ default: undefined,
6270
+ description: "Border color"
6271
+ }
6272
+ };
6273
+ var backgroundSchema = {
6274
+ "style.backgroundColor": {
6275
+ type: "color",
6276
+ default: "transparent",
6277
+ description: "Color"
6278
+ }
6279
+ };
6241
6280
  var textContentSchema = {
6242
6281
  children: {
6243
6282
  type: "text-content",
@@ -6265,20 +6304,13 @@ var premountSchema = {
6265
6304
  keyframable: false
6266
6305
  }
6267
6306
  };
6268
- var premountStyleSchema = {
6269
- styleWhilePremounted: {
6270
- type: "hidden"
6271
- },
6272
- styleWhilePostmounted: {
6273
- type: "hidden"
6274
- }
6275
- };
6276
6307
  var sequencePremountSchema = {
6277
- ...premountSchema,
6278
- ...premountStyleSchema
6308
+ ...premountSchema
6279
6309
  };
6280
6310
  var sequenceStyleSchema = {
6281
6311
  ...transformSchema,
6312
+ ...backgroundSchema,
6313
+ ...borderSchema,
6282
6314
  ...sequencePremountSchema
6283
6315
  };
6284
6316
  var hiddenField = {
@@ -6566,6 +6598,9 @@ var PremountContext = createContext15({
6566
6598
  premountFramesRemaining: 0
6567
6599
  });
6568
6600
  var ENABLE_V5_BREAKING_CHANGES = false;
6601
+ var resolveV5Default = (value) => {
6602
+ return value ?? ENABLE_V5_BREAKING_CHANGES;
6603
+ };
6569
6604
  var usePremounting = ({
6570
6605
  from,
6571
6606
  durationInFrames,
@@ -9614,38 +9649,53 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
9614
9649
  });
9615
9650
  };
9616
9651
  var Canvas = React16.forwardRef(CanvasRefForwardingFunction);
9617
- var CACHE_SIZE = 5;
9618
- var getActualTime = ({
9619
- loopBehavior,
9620
- durationFound,
9621
- timeInSec
9622
- }) => {
9623
- return loopBehavior === "loop" ? durationFound ? timeInSec % durationFound : timeInSec : Math.min(timeInSec, durationFound || Infinity);
9624
- };
9625
- var decodeImage = async ({
9652
+ var createImageDecoder = async ({
9626
9653
  resolvedSrc,
9627
9654
  signal,
9628
9655
  requestInit,
9629
- currentTime,
9630
- initialLoopBehavior
9656
+ contentType
9631
9657
  }) => {
9632
9658
  if (typeof ImageDecoder === "undefined") {
9633
9659
  throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");
9634
9660
  }
9635
- const res = await fetch(resolvedSrc, { ...requestInit, signal });
9636
- const { body } = res;
9661
+ const response = await fetch(resolvedSrc, { ...requestInit, signal });
9662
+ const { body } = response;
9637
9663
  if (!body) {
9638
9664
  throw new Error("Got no body");
9639
9665
  }
9640
9666
  const decoder = new ImageDecoder({
9641
9667
  data: body,
9642
- type: res.headers.get("Content-Type") || "image/gif"
9668
+ type: contentType ?? response.headers.get("Content-Type") ?? "image/gif"
9643
9669
  });
9644
- await decoder.completed;
9670
+ await Promise.all([decoder.completed, decoder.tracks.ready]);
9645
9671
  const { selectedTrack } = decoder.tracks;
9646
9672
  if (!selectedTrack) {
9673
+ decoder.close();
9647
9674
  throw new Error("No selected track");
9648
9675
  }
9676
+ return { decoder, selectedTrack };
9677
+ };
9678
+ var CACHE_SIZE = 5;
9679
+ var getActualTime = ({
9680
+ loopBehavior,
9681
+ durationFound,
9682
+ timeInSec
9683
+ }) => {
9684
+ return loopBehavior === "loop" ? durationFound ? timeInSec % durationFound : timeInSec : Math.min(timeInSec, durationFound || Infinity);
9685
+ };
9686
+ var decodeImage = async ({
9687
+ resolvedSrc,
9688
+ signal,
9689
+ requestInit,
9690
+ currentTime,
9691
+ initialLoopBehavior
9692
+ }) => {
9693
+ const { decoder, selectedTrack } = await createImageDecoder({
9694
+ resolvedSrc,
9695
+ signal,
9696
+ requestInit,
9697
+ contentType: null
9698
+ });
9649
9699
  const cache2 = [];
9650
9700
  let durationFound = null;
9651
9701
  const getFrameByIndex = async (frameIndex) => {
@@ -9751,6 +9801,13 @@ var decodeImage = async ({
9751
9801
  return closest;
9752
9802
  };
9753
9803
  return {
9804
+ close: () => {
9805
+ for (const item of cache2) {
9806
+ item.frame?.close();
9807
+ item.frame = null;
9808
+ }
9809
+ decoder.close();
9810
+ },
9754
9811
  getFrame,
9755
9812
  frameCount: selectedTrack.frameCount
9756
9813
  };
@@ -9788,6 +9845,7 @@ var animatedImageSchema = {
9788
9845
  keyframable: false
9789
9846
  },
9790
9847
  ...baseSchema,
9848
+ ...premountSchema,
9791
9849
  playbackRate: {
9792
9850
  type: "number",
9793
9851
  min: 0,
@@ -9798,7 +9856,9 @@ var animatedImageSchema = {
9798
9856
  hiddenFromList: false,
9799
9857
  keyframable: false
9800
9858
  },
9801
- ...transformSchema
9859
+ ...transformSchema,
9860
+ ...backgroundSchema,
9861
+ ...borderSchema
9802
9862
  };
9803
9863
  var getCanvasPropsFromSequenceProps = (props) => {
9804
9864
  const canvasProps = {};
@@ -9850,6 +9910,15 @@ var AnimatedImageContent = forwardRef4(({
9850
9910
  const [initialLoopBehavior] = useState6(() => loopBehavior);
9851
9911
  useEffect5(() => {
9852
9912
  const controller = new AbortController;
9913
+ let cancelled = false;
9914
+ let continued = false;
9915
+ const continueRenderOnce = () => {
9916
+ if (continued) {
9917
+ return;
9918
+ }
9919
+ continued = true;
9920
+ continueRender2(decodeHandle);
9921
+ };
9853
9922
  decodeImage({
9854
9923
  resolvedSrc,
9855
9924
  signal: controller.signal,
@@ -9857,22 +9926,31 @@ var AnimatedImageContent = forwardRef4(({
9857
9926
  currentTime: currentTimeRef.current,
9858
9927
  initialLoopBehavior
9859
9928
  }).then((d) => {
9929
+ if (cancelled) {
9930
+ d.close();
9931
+ return;
9932
+ }
9860
9933
  setImageDecoder(d);
9861
- continueRender2(decodeHandle);
9934
+ continueRenderOnce();
9862
9935
  }).catch((err) => {
9936
+ if (cancelled) {
9937
+ return;
9938
+ }
9863
9939
  if (err.name === "AbortError") {
9864
- continueRender2(decodeHandle);
9940
+ continueRenderOnce();
9865
9941
  return;
9866
9942
  }
9867
9943
  if (onError) {
9868
9944
  onError?.(err);
9869
- continueRender2(decodeHandle);
9945
+ continueRenderOnce();
9870
9946
  } else {
9871
9947
  cancelRender(err);
9872
9948
  }
9873
9949
  });
9874
9950
  return () => {
9951
+ cancelled = true;
9875
9952
  controller.abort();
9953
+ continueRenderOnce();
9876
9954
  };
9877
9955
  }, [
9878
9956
  resolvedSrc,
@@ -9882,6 +9960,11 @@ var AnimatedImageContent = forwardRef4(({
9882
9960
  initialLoopBehavior,
9883
9961
  continueRender2
9884
9962
  ]);
9963
+ useEffect5(() => {
9964
+ return () => {
9965
+ imageDecoder?.close();
9966
+ };
9967
+ }, [imageDecoder]);
9885
9968
  useLayoutEffect2(() => {
9886
9969
  if (!imageDecoder) {
9887
9970
  return;
@@ -9951,6 +10034,11 @@ var AnimatedImageInner = ({
9951
10034
  className,
9952
10035
  style,
9953
10036
  durationInFrames,
10037
+ from,
10038
+ premountFor,
10039
+ postmountFor,
10040
+ styleWhilePremounted,
10041
+ styleWhilePostmounted,
9954
10042
  requestInit,
9955
10043
  effects = [],
9956
10044
  controls,
@@ -9962,6 +10050,24 @@ var AnimatedImageInner = ({
9962
10050
  useImperativeHandle2(ref, () => {
9963
10051
  return actualRef.current;
9964
10052
  }, []);
10053
+ const {
10054
+ effectivePostmountFor,
10055
+ effectivePremountFor,
10056
+ freezeFrame,
10057
+ isPremountingOrPostmounting,
10058
+ postmountingActive,
10059
+ premountingActive,
10060
+ premountingStyle
10061
+ } = usePremounting({
10062
+ from: from ?? 0,
10063
+ durationInFrames: durationInFrames ?? Infinity,
10064
+ premountFor: premountFor ?? null,
10065
+ postmountFor: postmountFor ?? null,
10066
+ style: style ?? null,
10067
+ styleWhilePremounted: styleWhilePremounted ?? null,
10068
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
10069
+ hideWhilePremounted: "display-none"
10070
+ });
9965
10071
  const canvasProps = getCanvasPropsFromSequenceProps(sequenceProps);
9966
10072
  const animatedImageProps = {
9967
10073
  src,
@@ -9973,24 +10079,33 @@ var AnimatedImageInner = ({
9973
10079
  loopBehavior,
9974
10080
  id,
9975
10081
  className,
9976
- style,
10082
+ style: premountingStyle ?? undefined,
9977
10083
  requestInit,
9978
10084
  ...canvasProps
9979
10085
  };
9980
- return /* @__PURE__ */ jsx14(Sequence, {
9981
- layout: "none",
9982
- durationInFrames,
9983
- name: "<AnimatedImage>",
9984
- _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage",
9985
- controls,
9986
- _remotionInternalEffects: memoizedEffectDefinitions,
9987
- ...sequenceProps,
9988
- outlineRef: actualRef,
9989
- children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
9990
- ...animatedImageProps,
9991
- ref: actualRef,
9992
- effects,
9993
- controls
10086
+ return /* @__PURE__ */ jsx14(Freeze, {
10087
+ frame: freezeFrame,
10088
+ active: isPremountingOrPostmounting,
10089
+ children: /* @__PURE__ */ jsx14(Sequence, {
10090
+ layout: "none",
10091
+ from: from ?? 0,
10092
+ durationInFrames: durationInFrames ?? Infinity,
10093
+ name: "<AnimatedImage>",
10094
+ _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage",
10095
+ controls,
10096
+ _remotionInternalEffects: memoizedEffectDefinitions,
10097
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
10098
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
10099
+ _remotionInternalIsPremounting: premountingActive,
10100
+ _remotionInternalIsPostmounting: postmountingActive,
10101
+ ...sequenceProps,
10102
+ outlineRef: actualRef,
10103
+ children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
10104
+ ...animatedImageProps,
10105
+ ref: actualRef,
10106
+ effects,
10107
+ controls
10108
+ })
9994
10109
  })
9995
10110
  });
9996
10111
  };
@@ -10706,13 +10821,17 @@ var makeSharedElementSourceNode = ({
10706
10821
  }) => {
10707
10822
  let connected = null;
10708
10823
  let disposed = false;
10824
+ let currentAudioContext = audioContext;
10709
10825
  return {
10826
+ setAudioContext: (newAudioContext) => {
10827
+ currentAudioContext = newAudioContext;
10828
+ },
10710
10829
  attemptToConnect: () => {
10711
10830
  if (disposed) {
10712
10831
  throw new Error("SharedElementSourceNode has been disposed");
10713
10832
  }
10714
- if (!connected && ref.current) {
10715
- const mediaElementSourceNode = audioContext.createMediaElementSource(ref.current);
10833
+ if (!connected && ref.current && currentAudioContext) {
10834
+ const mediaElementSourceNode = currentAudioContext.createMediaElementSource(ref.current);
10716
10835
  connected = mediaElementSourceNode;
10717
10836
  }
10718
10837
  },
@@ -11040,19 +11159,22 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
11040
11159
  const audioCtx = useContext21(SharedAudioContext);
11041
11160
  const audioContext = audioCtx?.audioContext ?? null;
11042
11161
  const resume = audioCtx?.resume;
11043
- const refs = useMemo22(() => {
11162
+ const [refs] = useState10(() => {
11044
11163
  return new Array(numberOfAudioTags).fill(true).map(() => {
11045
11164
  const ref = createRef2();
11046
11165
  return {
11047
11166
  id: Math.random(),
11048
11167
  ref,
11049
- mediaElementSourceNode: audioContext ? makeSharedElementSourceNode({
11168
+ mediaElementSourceNode: makeSharedElementSourceNode({
11050
11169
  audioContext,
11051
11170
  ref
11052
- }) : null
11171
+ })
11053
11172
  };
11054
11173
  });
11055
- }, [audioContext, numberOfAudioTags]);
11174
+ });
11175
+ for (const { mediaElementSourceNode } of refs) {
11176
+ mediaElementSourceNode?.setAudioContext(audioContext);
11177
+ }
11056
11178
  const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
11057
11179
  effectToUse(() => {
11058
11180
  return () => {
@@ -11120,7 +11242,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
11120
11242
  const cloned = [...takenAudios.current];
11121
11243
  const index = refs.findIndex((r2) => r2.id === id);
11122
11244
  if (index === -1) {
11123
- throw new TypeError("Error occured in ");
11245
+ throw new TypeError(`Unknown audio ref ${id}; refs: ${refs.map((r2) => r2.id).join(", ")}`);
11124
11246
  }
11125
11247
  cloned[index] = false;
11126
11248
  takenAudios.current = cloned;
@@ -11224,10 +11346,10 @@ var useSharedAudio = ({
11224
11346
  return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
11225
11347
  }
11226
11348
  const el = React20.createRef();
11227
- const mediaElementSourceNode = audioCtx?.audioContext ? makeSharedElementSourceNode({
11228
- audioContext: audioCtx.audioContext,
11349
+ const mediaElementSourceNode = makeSharedElementSourceNode({
11350
+ audioContext: audioCtx?.audioContext ?? null,
11229
11351
  ref: el
11230
- }) : null;
11352
+ });
11231
11353
  return {
11232
11354
  el,
11233
11355
  id: Math.random(),
@@ -11242,6 +11364,7 @@ var useSharedAudio = ({
11242
11364
  }
11243
11365
  };
11244
11366
  });
11367
+ elem.mediaElementSourceNode?.setAudioContext(audioCtx?.audioContext ?? null);
11245
11368
  const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
11246
11369
  if (typeof document !== "undefined") {
11247
11370
  effectToUse(() => {
@@ -12953,6 +13076,7 @@ var AudioRefForwardingFunction = (props, ref) => {
12953
13076
  const { loop, freeze: _freeze, ...propsOtherThanLoop } = propsWithFreeze;
12954
13077
  const { fps } = useVideoConfig();
12955
13078
  const environment = useRemotionEnvironment();
13079
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
12956
13080
  if (environment.isClientSideRendering) {
12957
13081
  throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
12958
13082
  }
@@ -13022,7 +13146,7 @@ var AudioRefForwardingFunction = (props, ref) => {
13022
13146
  name,
13023
13147
  children: /* @__PURE__ */ jsx23(Html5Audio, {
13024
13148
  _remotionInternalNeedsDurationCalculation: Boolean(loop),
13025
- pauseWhenBuffering: pauseWhenBuffering ?? false,
13149
+ pauseWhenBuffering: shouldPauseWhenBuffering,
13026
13150
  ...otherProps,
13027
13151
  ref
13028
13152
  })
@@ -13050,7 +13174,7 @@ var AudioRefForwardingFunction = (props, ref) => {
13050
13174
  ref,
13051
13175
  onNativeError: onError,
13052
13176
  onDuration,
13053
- pauseWhenBuffering: pauseWhenBuffering ?? false,
13177
+ pauseWhenBuffering: shouldPauseWhenBuffering,
13054
13178
  _remotionInternalNeedsDurationCalculation: Boolean(loop),
13055
13179
  showInTimeline: showInTimeline ?? true
13056
13180
  });
@@ -13099,7 +13223,9 @@ var solidSchema = {
13099
13223
  description: "Pixel density",
13100
13224
  hiddenFromList: false
13101
13225
  },
13102
- ...transformSchema
13226
+ ...transformSchema,
13227
+ ...backgroundSchema,
13228
+ ...borderSchema
13103
13229
  };
13104
13230
  var SolidInner = ({
13105
13231
  color,
@@ -13653,7 +13779,9 @@ var htmlInCanvasSchema = {
13653
13779
  description: "Pixel density",
13654
13780
  hiddenFromList: false
13655
13781
  },
13656
- ...transformSchema
13782
+ ...transformSchema,
13783
+ ...backgroundSchema,
13784
+ ...borderSchema
13657
13785
  };
13658
13786
  var HtmlInCanvasWrapped = withInteractivitySchema({
13659
13787
  Component: HtmlInCanvasInner,
@@ -13675,6 +13803,7 @@ function truncateSrcForLabel(src) {
13675
13803
  }
13676
13804
  var canvasImageSchema = {
13677
13805
  ...baseSchema,
13806
+ ...premountSchema,
13678
13807
  fit: {
13679
13808
  type: "enum",
13680
13809
  default: "fill",
@@ -13685,7 +13814,9 @@ var canvasImageSchema = {
13685
13814
  cover: {}
13686
13815
  }
13687
13816
  },
13688
- ...transformSchema
13817
+ ...transformSchema,
13818
+ ...backgroundSchema,
13819
+ ...borderSchema
13689
13820
  };
13690
13821
  var makeAbortError = () => {
13691
13822
  if (typeof DOMException !== "undefined") {
@@ -14009,6 +14140,10 @@ var CanvasImageInner = forwardRef10(({
14009
14140
  from,
14010
14141
  trimBefore,
14011
14142
  freeze,
14143
+ premountFor,
14144
+ postmountFor,
14145
+ styleWhilePremounted,
14146
+ styleWhilePostmounted,
14012
14147
  hidden,
14013
14148
  name,
14014
14149
  showInTimeline,
@@ -14026,39 +14161,65 @@ var CanvasImageInner = forwardRef10(({
14026
14161
  useImperativeHandle7(ref, () => {
14027
14162
  return actualRef.current;
14028
14163
  }, []);
14029
- return /* @__PURE__ */ jsx26(Sequence, {
14030
- layout: "none",
14164
+ const {
14165
+ effectivePostmountFor,
14166
+ effectivePremountFor,
14167
+ freezeFrame,
14168
+ isPremountingOrPostmounting,
14169
+ postmountingActive,
14170
+ premountingActive,
14171
+ premountingStyle
14172
+ } = usePremounting({
14031
14173
  from: from ?? 0,
14032
- trimBefore,
14033
14174
  durationInFrames: durationInFrames ?? Infinity,
14034
- freeze,
14035
- hidden,
14036
- showInTimeline: showInTimeline ?? true,
14037
- name: name ?? "<CanvasImage>",
14038
- _remotionInternalDocumentationLink: _remotionInternalDocumentationLink ?? "https://www.remotion.dev/docs/canvasimage",
14039
- controls,
14040
- _remotionInternalEffects: memoizedEffectDefinitions,
14041
- _remotionInternalIsMedia: { type: "image", src },
14042
- _remotionInternalStack: stack,
14043
- outlineRef: outlineRef ?? actualRef,
14044
- children: /* @__PURE__ */ jsx26(CanvasImageContent, {
14045
- ref: actualRef,
14046
- src,
14047
- width,
14048
- height,
14049
- fit,
14050
- effects,
14175
+ premountFor: premountFor ?? null,
14176
+ postmountFor: postmountFor ?? null,
14177
+ style: style ?? null,
14178
+ styleWhilePremounted: styleWhilePremounted ?? null,
14179
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
14180
+ hideWhilePremounted: "display-none"
14181
+ });
14182
+ return /* @__PURE__ */ jsx26(Freeze, {
14183
+ frame: freezeFrame,
14184
+ active: isPremountingOrPostmounting,
14185
+ children: /* @__PURE__ */ jsx26(Sequence, {
14186
+ layout: "none",
14187
+ from: from ?? 0,
14188
+ trimBefore,
14189
+ durationInFrames: durationInFrames ?? Infinity,
14190
+ freeze,
14191
+ hidden,
14192
+ showInTimeline: showInTimeline ?? true,
14193
+ name: name ?? "<CanvasImage>",
14194
+ _remotionInternalDocumentationLink: _remotionInternalDocumentationLink ?? "https://www.remotion.dev/docs/canvasimage",
14051
14195
  controls,
14052
- className,
14053
- style,
14054
- id,
14055
- onError,
14056
- pauseWhenLoading,
14057
- maxRetries,
14058
- delayRenderRetries,
14059
- delayRenderTimeoutInMilliseconds,
14060
- refForOutline: outlineRef ?? null,
14061
- ...canvasProps
14196
+ _remotionInternalEffects: memoizedEffectDefinitions,
14197
+ _remotionInternalIsMedia: { type: "image", src },
14198
+ _remotionInternalStack: stack,
14199
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
14200
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
14201
+ _remotionInternalIsPremounting: premountingActive,
14202
+ _remotionInternalIsPostmounting: postmountingActive,
14203
+ outlineRef: outlineRef ?? actualRef,
14204
+ children: /* @__PURE__ */ jsx26(CanvasImageContent, {
14205
+ ref: actualRef,
14206
+ src,
14207
+ width,
14208
+ height,
14209
+ fit,
14210
+ effects,
14211
+ controls,
14212
+ className,
14213
+ style: premountingStyle ?? undefined,
14214
+ id,
14215
+ onError,
14216
+ pauseWhenLoading,
14217
+ maxRetries,
14218
+ delayRenderRetries,
14219
+ delayRenderTimeoutInMilliseconds,
14220
+ refForOutline: outlineRef ?? null,
14221
+ ...canvasProps
14222
+ })
14062
14223
  })
14063
14224
  });
14064
14225
  });
@@ -14275,6 +14436,11 @@ var NativeImgInner = ({
14275
14436
  trimBefore,
14276
14437
  durationInFrames,
14277
14438
  freeze,
14439
+ premountFor,
14440
+ postmountFor,
14441
+ style,
14442
+ styleWhilePremounted,
14443
+ styleWhilePostmounted,
14278
14444
  controls,
14279
14445
  outlineRef: refForOutline,
14280
14446
  ...props2
@@ -14282,24 +14448,51 @@ var NativeImgInner = ({
14282
14448
  if (!src) {
14283
14449
  throw new Error('No "src" prop was passed to <Img>.');
14284
14450
  }
14285
- return /* @__PURE__ */ jsx28(Sequence, {
14286
- layout: "none",
14451
+ const {
14452
+ effectivePostmountFor,
14453
+ effectivePremountFor,
14454
+ freezeFrame,
14455
+ isPremountingOrPostmounting,
14456
+ postmountingActive,
14457
+ premountingActive,
14458
+ premountingStyle
14459
+ } = usePremounting({
14287
14460
  from: from ?? 0,
14288
- trimBefore,
14289
14461
  durationInFrames: durationInFrames ?? Infinity,
14290
- freeze,
14291
- _remotionInternalStack: stack,
14292
- _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
14293
- _remotionInternalIsMedia: { type: "image", src },
14294
- name: name ?? "<Img>",
14295
- controls,
14296
- showInTimeline: showInTimeline ?? true,
14297
- hidden,
14298
- outlineRef: refForOutline,
14299
- children: /* @__PURE__ */ jsx28(ImgContent, {
14300
- src,
14301
- refForOutline,
14302
- ...props2
14462
+ premountFor: premountFor ?? null,
14463
+ postmountFor: postmountFor ?? null,
14464
+ style: style ?? null,
14465
+ styleWhilePremounted: styleWhilePremounted ?? null,
14466
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
14467
+ hideWhilePremounted: "display-none"
14468
+ });
14469
+ return /* @__PURE__ */ jsx28(Freeze, {
14470
+ frame: freezeFrame,
14471
+ active: isPremountingOrPostmounting,
14472
+ children: /* @__PURE__ */ jsx28(Sequence, {
14473
+ layout: "none",
14474
+ from: from ?? 0,
14475
+ trimBefore,
14476
+ durationInFrames: durationInFrames ?? Infinity,
14477
+ freeze,
14478
+ _remotionInternalStack: stack,
14479
+ _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
14480
+ _remotionInternalIsMedia: { type: "image", src },
14481
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
14482
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
14483
+ _remotionInternalIsPremounting: premountingActive,
14484
+ _remotionInternalIsPostmounting: postmountingActive,
14485
+ name: name ?? "<Img>",
14486
+ controls,
14487
+ showInTimeline: showInTimeline ?? true,
14488
+ hidden,
14489
+ outlineRef: refForOutline,
14490
+ children: /* @__PURE__ */ jsx28(ImgContent, {
14491
+ src,
14492
+ refForOutline,
14493
+ style: premountingStyle ?? undefined,
14494
+ ...props2
14495
+ })
14303
14496
  })
14304
14497
  });
14305
14498
  };
@@ -14312,7 +14505,10 @@ var imgSchema = {
14312
14505
  keyframable: false
14313
14506
  },
14314
14507
  ...baseSchema,
14315
- ...transformSchema
14508
+ ...premountSchema,
14509
+ ...transformSchema,
14510
+ ...backgroundSchema,
14511
+ ...borderSchema
14316
14512
  };
14317
14513
  var imgCanvasFallbackIncompatibleProps = new Set([
14318
14514
  "alt",
@@ -14368,6 +14564,10 @@ var ImgInner = ({
14368
14564
  trimBefore,
14369
14565
  durationInFrames,
14370
14566
  freeze,
14567
+ premountFor,
14568
+ postmountFor,
14569
+ styleWhilePremounted,
14570
+ styleWhilePostmounted,
14371
14571
  controls,
14372
14572
  width,
14373
14573
  height,
@@ -14381,6 +14581,7 @@ var ImgInner = ({
14381
14581
  ...props2
14382
14582
  }) => {
14383
14583
  const refForOutline = useRef24(null);
14584
+ const shouldPauseWhenLoading = resolveV5Default(pauseWhenLoading);
14384
14585
  if (effects.length === 0) {
14385
14586
  return /* @__PURE__ */ jsx28(NativeImgInner, {
14386
14587
  ...props2,
@@ -14394,13 +14595,17 @@ var ImgInner = ({
14394
14595
  trimBefore,
14395
14596
  durationInFrames,
14396
14597
  freeze,
14598
+ premountFor,
14599
+ postmountFor,
14600
+ styleWhilePremounted,
14601
+ styleWhilePostmounted,
14397
14602
  controls,
14398
14603
  width,
14399
14604
  height,
14400
14605
  className,
14401
14606
  style,
14402
14607
  id,
14403
- pauseWhenLoading,
14608
+ pauseWhenLoading: shouldPauseWhenLoading,
14404
14609
  maxRetries,
14405
14610
  delayRenderRetries,
14406
14611
  delayRenderTimeoutInMilliseconds,
@@ -14429,7 +14634,7 @@ var ImgInner = ({
14429
14634
  className,
14430
14635
  style,
14431
14636
  id,
14432
- pauseWhenLoading,
14637
+ pauseWhenLoading: shouldPauseWhenLoading,
14433
14638
  maxRetries,
14434
14639
  delayRenderRetries,
14435
14640
  delayRenderTimeoutInMilliseconds,
@@ -14437,6 +14642,10 @@ var ImgInner = ({
14437
14642
  trimBefore,
14438
14643
  durationInFrames,
14439
14644
  freeze,
14645
+ premountFor,
14646
+ postmountFor,
14647
+ styleWhilePremounted,
14648
+ styleWhilePostmounted,
14440
14649
  hidden,
14441
14650
  name: name ?? "<Img>",
14442
14651
  showInTimeline,
@@ -14475,7 +14684,20 @@ var interactiveElementSchema = {
14475
14684
  ...baseSchema,
14476
14685
  ...transformSchema
14477
14686
  };
14687
+ var interactiveBackgroundElementSchema = {
14688
+ ...interactiveElementSchema,
14689
+ ...backgroundSchema
14690
+ };
14691
+ var interactiveBorderElementSchema = {
14692
+ ...interactiveBackgroundElementSchema,
14693
+ ...borderSchema
14694
+ };
14478
14695
  var interactiveTextElementSchema = {
14696
+ ...interactiveBorderElementSchema,
14697
+ ...textSchema,
14698
+ ...textContentSchema
14699
+ };
14700
+ var interactiveSvgTextElementSchema = {
14479
14701
  ...interactiveElementSchema,
14480
14702
  ...textSchema,
14481
14703
  ...textContentSchema
@@ -14554,6 +14776,8 @@ var Interactive = {
14554
14776
  baseSchema,
14555
14777
  transformSchema,
14556
14778
  textSchema,
14779
+ backgroundSchema,
14780
+ borderSchema,
14557
14781
  premountSchema,
14558
14782
  sequenceSchema,
14559
14783
  withSchema,
@@ -14590,10 +14814,39 @@ var Interactive = {
14590
14814
  Small: makeInteractiveTextElement("small", "<Interactive.Small>"),
14591
14815
  Span: makeInteractiveTextElement("span", "<Interactive.Span>"),
14592
14816
  Strong: makeInteractiveTextElement("strong", "<Interactive.Strong>"),
14593
- Svg: makeInteractiveNonTextElement("svg", "<Interactive.Svg>"),
14594
- Text: makeInteractiveTextElement("text", "<Interactive.Text>"),
14817
+ Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveBorderElementSchema),
14818
+ Text: makeInteractiveElement("text", "<Interactive.Text>", interactiveSvgTextElementSchema),
14595
14819
  Ul: makeInteractiveTextElement("ul", "<Interactive.Ul>")
14596
14820
  };
14821
+ var getAnimatedImageDurationInSeconds = async ({
14822
+ resolvedSrc,
14823
+ signal,
14824
+ requestInit,
14825
+ contentType
14826
+ }) => {
14827
+ const { decoder, selectedTrack } = await createImageDecoder({
14828
+ resolvedSrc,
14829
+ signal,
14830
+ requestInit,
14831
+ contentType
14832
+ });
14833
+ try {
14834
+ const { image } = await decoder.decode({
14835
+ frameIndex: selectedTrack.frameCount - 1,
14836
+ completeFramesOnly: true
14837
+ });
14838
+ try {
14839
+ if (image.duration === null) {
14840
+ throw new Error("Could not determine animated image duration");
14841
+ }
14842
+ return (image.timestamp + image.duration) / 1e6;
14843
+ } finally {
14844
+ image.close();
14845
+ }
14846
+ } finally {
14847
+ decoder.close();
14848
+ }
14849
+ };
14597
14850
  var compositionsRef = React31.createRef();
14598
14851
  var CompositionManagerProvider = ({
14599
14852
  children,
@@ -15575,6 +15828,7 @@ var InnerOffthreadVideo = (props2) => {
15575
15828
  ...otherProps
15576
15829
  } = props2;
15577
15830
  const environment = useRemotionEnvironment();
15831
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
15578
15832
  if (environment.isClientSideRendering) {
15579
15833
  throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
15580
15834
  }
@@ -15599,7 +15853,7 @@ var InnerOffthreadVideo = (props2) => {
15599
15853
  durationInFrames: trimAfterValue,
15600
15854
  name,
15601
15855
  children: /* @__PURE__ */ jsx35(InnerOffthreadVideo, {
15602
- pauseWhenBuffering: pauseWhenBuffering ?? false,
15856
+ pauseWhenBuffering: shouldPauseWhenBuffering,
15603
15857
  ...otherProps,
15604
15858
  trimAfter: undefined,
15605
15859
  name: undefined,
@@ -15614,7 +15868,7 @@ var InnerOffthreadVideo = (props2) => {
15614
15868
  validateMediaProps(props2, "Video");
15615
15869
  if (environment.isRendering) {
15616
15870
  return /* @__PURE__ */ jsx35(OffthreadVideoForRendering, {
15617
- pauseWhenBuffering: pauseWhenBuffering ?? false,
15871
+ pauseWhenBuffering: shouldPauseWhenBuffering,
15618
15872
  ...otherProps,
15619
15873
  trimAfter: undefined,
15620
15874
  name: undefined,
@@ -15639,7 +15893,7 @@ var InnerOffthreadVideo = (props2) => {
15639
15893
  _remotionInternalStack: stack ?? null,
15640
15894
  onDuration,
15641
15895
  onlyWarnForMediaSeekingError: true,
15642
- pauseWhenBuffering: pauseWhenBuffering ?? false,
15896
+ pauseWhenBuffering: shouldPauseWhenBuffering,
15643
15897
  showInTimeline: showInTimeline ?? true,
15644
15898
  onAutoPlayError: onAutoPlayError ?? undefined,
15645
15899
  onVideoFrame: onVideoFrame ?? null,
@@ -15697,7 +15951,7 @@ var OffthreadVideo = ({
15697
15951
  onAutoPlayError: onAutoPlayError ?? null,
15698
15952
  onError,
15699
15953
  onVideoFrame,
15700
- pauseWhenBuffering: pauseWhenBuffering ?? true,
15954
+ pauseWhenBuffering: resolveV5Default(pauseWhenBuffering),
15701
15955
  playbackRate: playbackRate ?? 1,
15702
15956
  preservePitch,
15703
15957
  toneFrequency: toneFrequency ?? 1,
@@ -15821,6 +16075,7 @@ var Internals = {
15821
16075
  useAbsoluteTimelinePosition,
15822
16076
  evaluateVolume,
15823
16077
  getAbsoluteSrc,
16078
+ getAnimatedImageDurationInSeconds,
15824
16079
  getAssetDisplayName,
15825
16080
  Timeline: exports_timeline_position_state,
15826
16081
  validateMediaTrimProps,
@@ -15845,7 +16100,6 @@ var Internals = {
15845
16100
  textSchema,
15846
16101
  transformSchema,
15847
16102
  premountSchema,
15848
- premountStyleSchema,
15849
16103
  flattenActiveSchema,
15850
16104
  getFlatSchemaWithAllKeys,
15851
16105
  RemotionRootContexts,
@@ -15984,6 +16238,7 @@ var seriesSequenceSchema = {
15984
16238
  hidden: Interactive.sequenceSchema.hidden,
15985
16239
  showInTimeline: Interactive.sequenceSchema.showInTimeline,
15986
16240
  freeze: Interactive.baseSchema.freeze,
16241
+ trimBefore: Interactive.sequenceSchema.trimBefore,
15987
16242
  layout: Interactive.sequenceSchema.layout
15988
16243
  };
15989
16244
  var SeriesSequenceInner = forwardRef14(({
@@ -16579,6 +16834,7 @@ var VideoForwardingFunction = (props2, ref) => {
16579
16834
  const { loop, ...propsOtherThanLoop } = props2;
16580
16835
  const { fps } = useVideoConfig();
16581
16836
  const environment = useRemotionEnvironment();
16837
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
16582
16838
  if (environment.isClientSideRendering) {
16583
16839
  throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
16584
16840
  }
@@ -16637,7 +16893,7 @@ var VideoForwardingFunction = (props2, ref) => {
16637
16893
  durationInFrames: trimAfterValue === undefined ? undefined : trimAfterValue / (props2.playbackRate ?? 1),
16638
16894
  name,
16639
16895
  children: /* @__PURE__ */ jsx39(Html5Video, {
16640
- pauseWhenBuffering: pauseWhenBuffering ?? false,
16896
+ pauseWhenBuffering: shouldPauseWhenBuffering,
16641
16897
  onVideoFrame,
16642
16898
  ...otherProps,
16643
16899
  ref,
@@ -16663,7 +16919,7 @@ var VideoForwardingFunction = (props2, ref) => {
16663
16919
  ...otherProps,
16664
16920
  ref,
16665
16921
  onVideoFrame: onVideoFrame ?? null,
16666
- pauseWhenBuffering: pauseWhenBuffering ?? false,
16922
+ pauseWhenBuffering: shouldPauseWhenBuffering,
16667
16923
  onDuration,
16668
16924
  _remotionInternalStack: stack ?? null,
16669
16925
  _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed ?? false,
@@ -17056,7 +17312,9 @@ var makeShapeSchema = (shapeFields) => {
17056
17312
  defaultValue: "#0b84ff",
17057
17313
  description: "Fill"
17058
17314
  }),
17059
- ...Internals.transformSchema
17315
+ ...Internals.transformSchema,
17316
+ ...Interactive.backgroundSchema,
17317
+ ...Interactive.borderSchema
17060
17318
  };
17061
17319
  };
17062
17320
  var arrowSchema = makeShapeSchema({