@remotion/promo-pages 4.0.496 → 4.0.497

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.
@@ -22913,7 +22913,7 @@ var getSingleChildComponent = (children) => {
22913
22913
  }
22914
22914
  return child.type;
22915
22915
  };
22916
- var VERSION = "4.0.496";
22916
+ var VERSION = "4.0.497";
22917
22917
  var checkMultipleRemotionVersions = () => {
22918
22918
  if (typeof globalThis === "undefined") {
22919
22919
  return;
@@ -23391,6 +23391,45 @@ var textSchema = {
23391
23391
  hiddenFromList: false
23392
23392
  }
23393
23393
  };
23394
+ var borderSchema = {
23395
+ "style.borderWidth": {
23396
+ type: "number",
23397
+ default: undefined,
23398
+ min: 0,
23399
+ step: 1,
23400
+ description: "Border width",
23401
+ hiddenFromList: false
23402
+ },
23403
+ "style.borderStyle": {
23404
+ type: "enum",
23405
+ default: "none",
23406
+ description: "Border style",
23407
+ variants: {
23408
+ none: {},
23409
+ hidden: {},
23410
+ solid: {},
23411
+ dashed: {},
23412
+ dotted: {},
23413
+ double: {},
23414
+ groove: {},
23415
+ ridge: {},
23416
+ inset: {},
23417
+ outset: {}
23418
+ }
23419
+ },
23420
+ "style.borderColor": {
23421
+ type: "color",
23422
+ default: undefined,
23423
+ description: "Border color"
23424
+ }
23425
+ };
23426
+ var backgroundSchema = {
23427
+ "style.backgroundColor": {
23428
+ type: "color",
23429
+ default: "transparent",
23430
+ description: "Color"
23431
+ }
23432
+ };
23394
23433
  var textContentSchema = {
23395
23434
  children: {
23396
23435
  type: "text-content",
@@ -23418,20 +23457,13 @@ var premountSchema = {
23418
23457
  keyframable: false
23419
23458
  }
23420
23459
  };
23421
- var premountStyleSchema = {
23422
- styleWhilePremounted: {
23423
- type: "hidden"
23424
- },
23425
- styleWhilePostmounted: {
23426
- type: "hidden"
23427
- }
23428
- };
23429
23460
  var sequencePremountSchema = {
23430
- ...premountSchema,
23431
- ...premountStyleSchema
23461
+ ...premountSchema
23432
23462
  };
23433
23463
  var sequenceStyleSchema = {
23434
23464
  ...transformSchema,
23465
+ ...backgroundSchema,
23466
+ ...borderSchema,
23435
23467
  ...sequencePremountSchema
23436
23468
  };
23437
23469
  var hiddenField = {
@@ -26767,38 +26799,53 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
26767
26799
  });
26768
26800
  };
26769
26801
  var Canvas = React16.forwardRef(CanvasRefForwardingFunction);
26770
- var CACHE_SIZE = 5;
26771
- var getActualTime = ({
26772
- loopBehavior,
26773
- durationFound,
26774
- timeInSec
26775
- }) => {
26776
- return loopBehavior === "loop" ? durationFound ? timeInSec % durationFound : timeInSec : Math.min(timeInSec, durationFound || Infinity);
26777
- };
26778
- var decodeImage = async ({
26802
+ var createImageDecoder = async ({
26779
26803
  resolvedSrc,
26780
26804
  signal,
26781
26805
  requestInit,
26782
- currentTime,
26783
- initialLoopBehavior
26806
+ contentType
26784
26807
  }) => {
26785
26808
  if (typeof ImageDecoder === "undefined") {
26786
26809
  throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");
26787
26810
  }
26788
- const res = await fetch(resolvedSrc, { ...requestInit, signal });
26789
- const { body } = res;
26811
+ const response = await fetch(resolvedSrc, { ...requestInit, signal });
26812
+ const { body } = response;
26790
26813
  if (!body) {
26791
26814
  throw new Error("Got no body");
26792
26815
  }
26793
26816
  const decoder = new ImageDecoder({
26794
26817
  data: body,
26795
- type: res.headers.get("Content-Type") || "image/gif"
26818
+ type: contentType ?? response.headers.get("Content-Type") ?? "image/gif"
26796
26819
  });
26797
- await decoder.completed;
26820
+ await Promise.all([decoder.completed, decoder.tracks.ready]);
26798
26821
  const { selectedTrack } = decoder.tracks;
26799
26822
  if (!selectedTrack) {
26823
+ decoder.close();
26800
26824
  throw new Error("No selected track");
26801
26825
  }
26826
+ return { decoder, selectedTrack };
26827
+ };
26828
+ var CACHE_SIZE = 5;
26829
+ var getActualTime = ({
26830
+ loopBehavior,
26831
+ durationFound,
26832
+ timeInSec
26833
+ }) => {
26834
+ return loopBehavior === "loop" ? durationFound ? timeInSec % durationFound : timeInSec : Math.min(timeInSec, durationFound || Infinity);
26835
+ };
26836
+ var decodeImage = async ({
26837
+ resolvedSrc,
26838
+ signal,
26839
+ requestInit,
26840
+ currentTime,
26841
+ initialLoopBehavior
26842
+ }) => {
26843
+ const { decoder, selectedTrack } = await createImageDecoder({
26844
+ resolvedSrc,
26845
+ signal,
26846
+ requestInit,
26847
+ contentType: null
26848
+ });
26802
26849
  const cache2 = [];
26803
26850
  let durationFound = null;
26804
26851
  const getFrameByIndex = async (frameIndex) => {
@@ -26904,6 +26951,13 @@ var decodeImage = async ({
26904
26951
  return closest;
26905
26952
  };
26906
26953
  return {
26954
+ close: () => {
26955
+ for (const item of cache2) {
26956
+ item.frame?.close();
26957
+ item.frame = null;
26958
+ }
26959
+ decoder.close();
26960
+ },
26907
26961
  getFrame,
26908
26962
  frameCount: selectedTrack.frameCount
26909
26963
  };
@@ -26941,6 +26995,7 @@ var animatedImageSchema = {
26941
26995
  keyframable: false
26942
26996
  },
26943
26997
  ...baseSchema,
26998
+ ...premountSchema,
26944
26999
  playbackRate: {
26945
27000
  type: "number",
26946
27001
  min: 0,
@@ -26951,7 +27006,9 @@ var animatedImageSchema = {
26951
27006
  hiddenFromList: false,
26952
27007
  keyframable: false
26953
27008
  },
26954
- ...transformSchema
27009
+ ...transformSchema,
27010
+ ...backgroundSchema,
27011
+ ...borderSchema
26955
27012
  };
26956
27013
  var getCanvasPropsFromSequenceProps = (props) => {
26957
27014
  const canvasProps = {};
@@ -27003,6 +27060,15 @@ var AnimatedImageContent = forwardRef4(({
27003
27060
  const [initialLoopBehavior] = useState6(() => loopBehavior);
27004
27061
  useEffect5(() => {
27005
27062
  const controller = new AbortController;
27063
+ let cancelled = false;
27064
+ let continued = false;
27065
+ const continueRenderOnce = () => {
27066
+ if (continued) {
27067
+ return;
27068
+ }
27069
+ continued = true;
27070
+ continueRender2(decodeHandle);
27071
+ };
27006
27072
  decodeImage({
27007
27073
  resolvedSrc,
27008
27074
  signal: controller.signal,
@@ -27010,22 +27076,31 @@ var AnimatedImageContent = forwardRef4(({
27010
27076
  currentTime: currentTimeRef.current,
27011
27077
  initialLoopBehavior
27012
27078
  }).then((d) => {
27079
+ if (cancelled) {
27080
+ d.close();
27081
+ return;
27082
+ }
27013
27083
  setImageDecoder(d);
27014
- continueRender2(decodeHandle);
27084
+ continueRenderOnce();
27015
27085
  }).catch((err) => {
27086
+ if (cancelled) {
27087
+ return;
27088
+ }
27016
27089
  if (err.name === "AbortError") {
27017
- continueRender2(decodeHandle);
27090
+ continueRenderOnce();
27018
27091
  return;
27019
27092
  }
27020
27093
  if (onError) {
27021
27094
  onError?.(err);
27022
- continueRender2(decodeHandle);
27095
+ continueRenderOnce();
27023
27096
  } else {
27024
27097
  cancelRender(err);
27025
27098
  }
27026
27099
  });
27027
27100
  return () => {
27101
+ cancelled = true;
27028
27102
  controller.abort();
27103
+ continueRenderOnce();
27029
27104
  };
27030
27105
  }, [
27031
27106
  resolvedSrc,
@@ -27035,6 +27110,11 @@ var AnimatedImageContent = forwardRef4(({
27035
27110
  initialLoopBehavior,
27036
27111
  continueRender2
27037
27112
  ]);
27113
+ useEffect5(() => {
27114
+ return () => {
27115
+ imageDecoder?.close();
27116
+ };
27117
+ }, [imageDecoder]);
27038
27118
  useLayoutEffect2(() => {
27039
27119
  if (!imageDecoder) {
27040
27120
  return;
@@ -27104,6 +27184,11 @@ var AnimatedImageInner = ({
27104
27184
  className,
27105
27185
  style,
27106
27186
  durationInFrames,
27187
+ from,
27188
+ premountFor,
27189
+ postmountFor,
27190
+ styleWhilePremounted,
27191
+ styleWhilePostmounted,
27107
27192
  requestInit,
27108
27193
  effects = [],
27109
27194
  controls,
@@ -27115,6 +27200,24 @@ var AnimatedImageInner = ({
27115
27200
  useImperativeHandle2(ref, () => {
27116
27201
  return actualRef.current;
27117
27202
  }, []);
27203
+ const {
27204
+ effectivePostmountFor,
27205
+ effectivePremountFor,
27206
+ freezeFrame,
27207
+ isPremountingOrPostmounting,
27208
+ postmountingActive,
27209
+ premountingActive,
27210
+ premountingStyle
27211
+ } = usePremounting({
27212
+ from: from ?? 0,
27213
+ durationInFrames: durationInFrames ?? Infinity,
27214
+ premountFor: premountFor ?? null,
27215
+ postmountFor: postmountFor ?? null,
27216
+ style: style ?? null,
27217
+ styleWhilePremounted: styleWhilePremounted ?? null,
27218
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
27219
+ hideWhilePremounted: "display-none"
27220
+ });
27118
27221
  const canvasProps = getCanvasPropsFromSequenceProps(sequenceProps);
27119
27222
  const animatedImageProps = {
27120
27223
  src,
@@ -27126,24 +27229,33 @@ var AnimatedImageInner = ({
27126
27229
  loopBehavior,
27127
27230
  id,
27128
27231
  className,
27129
- style,
27232
+ style: premountingStyle ?? undefined,
27130
27233
  requestInit,
27131
27234
  ...canvasProps
27132
27235
  };
27133
- return /* @__PURE__ */ jsx14(Sequence, {
27134
- layout: "none",
27135
- durationInFrames,
27136
- name: "<AnimatedImage>",
27137
- _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage",
27138
- controls,
27139
- _remotionInternalEffects: memoizedEffectDefinitions,
27140
- ...sequenceProps,
27141
- outlineRef: actualRef,
27142
- children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
27143
- ...animatedImageProps,
27144
- ref: actualRef,
27145
- effects,
27146
- controls
27236
+ return /* @__PURE__ */ jsx14(Freeze, {
27237
+ frame: freezeFrame,
27238
+ active: isPremountingOrPostmounting,
27239
+ children: /* @__PURE__ */ jsx14(Sequence, {
27240
+ layout: "none",
27241
+ from: from ?? 0,
27242
+ durationInFrames: durationInFrames ?? Infinity,
27243
+ name: "<AnimatedImage>",
27244
+ _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage",
27245
+ controls,
27246
+ _remotionInternalEffects: memoizedEffectDefinitions,
27247
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
27248
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
27249
+ _remotionInternalIsPremounting: premountingActive,
27250
+ _remotionInternalIsPostmounting: postmountingActive,
27251
+ ...sequenceProps,
27252
+ outlineRef: actualRef,
27253
+ children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
27254
+ ...animatedImageProps,
27255
+ ref: actualRef,
27256
+ effects,
27257
+ controls
27258
+ })
27147
27259
  })
27148
27260
  });
27149
27261
  };
@@ -27859,13 +27971,17 @@ var makeSharedElementSourceNode = ({
27859
27971
  }) => {
27860
27972
  let connected = null;
27861
27973
  let disposed = false;
27974
+ let currentAudioContext = audioContext;
27862
27975
  return {
27976
+ setAudioContext: (newAudioContext) => {
27977
+ currentAudioContext = newAudioContext;
27978
+ },
27863
27979
  attemptToConnect: () => {
27864
27980
  if (disposed) {
27865
27981
  throw new Error("SharedElementSourceNode has been disposed");
27866
27982
  }
27867
- if (!connected && ref.current) {
27868
- const mediaElementSourceNode = audioContext.createMediaElementSource(ref.current);
27983
+ if (!connected && ref.current && currentAudioContext) {
27984
+ const mediaElementSourceNode = currentAudioContext.createMediaElementSource(ref.current);
27869
27985
  connected = mediaElementSourceNode;
27870
27986
  }
27871
27987
  },
@@ -28193,19 +28309,22 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
28193
28309
  const audioCtx = useContext21(SharedAudioContext);
28194
28310
  const audioContext = audioCtx?.audioContext ?? null;
28195
28311
  const resume = audioCtx?.resume;
28196
- const refs = useMemo22(() => {
28312
+ const [refs] = useState10(() => {
28197
28313
  return new Array(numberOfAudioTags).fill(true).map(() => {
28198
28314
  const ref = createRef2();
28199
28315
  return {
28200
28316
  id: Math.random(),
28201
28317
  ref,
28202
- mediaElementSourceNode: audioContext ? makeSharedElementSourceNode({
28318
+ mediaElementSourceNode: makeSharedElementSourceNode({
28203
28319
  audioContext,
28204
28320
  ref
28205
- }) : null
28321
+ })
28206
28322
  };
28207
28323
  });
28208
- }, [audioContext, numberOfAudioTags]);
28324
+ });
28325
+ for (const { mediaElementSourceNode } of refs) {
28326
+ mediaElementSourceNode?.setAudioContext(audioContext);
28327
+ }
28209
28328
  const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
28210
28329
  effectToUse(() => {
28211
28330
  return () => {
@@ -28273,7 +28392,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
28273
28392
  const cloned = [...takenAudios.current];
28274
28393
  const index = refs.findIndex((r2) => r2.id === id);
28275
28394
  if (index === -1) {
28276
- throw new TypeError("Error occured in ");
28395
+ throw new TypeError(`Unknown audio ref ${id}; refs: ${refs.map((r2) => r2.id).join(", ")}`);
28277
28396
  }
28278
28397
  cloned[index] = false;
28279
28398
  takenAudios.current = cloned;
@@ -28377,10 +28496,10 @@ var useSharedAudio = ({
28377
28496
  return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
28378
28497
  }
28379
28498
  const el = React20.createRef();
28380
- const mediaElementSourceNode = audioCtx?.audioContext ? makeSharedElementSourceNode({
28381
- audioContext: audioCtx.audioContext,
28499
+ const mediaElementSourceNode = makeSharedElementSourceNode({
28500
+ audioContext: audioCtx?.audioContext ?? null,
28382
28501
  ref: el
28383
- }) : null;
28502
+ });
28384
28503
  return {
28385
28504
  el,
28386
28505
  id: Math.random(),
@@ -28395,6 +28514,7 @@ var useSharedAudio = ({
28395
28514
  }
28396
28515
  };
28397
28516
  });
28517
+ elem.mediaElementSourceNode?.setAudioContext(audioCtx?.audioContext ?? null);
28398
28518
  const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
28399
28519
  if (typeof document !== "undefined") {
28400
28520
  effectToUse(() => {
@@ -30252,7 +30372,9 @@ var solidSchema = {
30252
30372
  description: "Pixel density",
30253
30373
  hiddenFromList: false
30254
30374
  },
30255
- ...transformSchema
30375
+ ...transformSchema,
30376
+ ...backgroundSchema,
30377
+ ...borderSchema
30256
30378
  };
30257
30379
  var SolidInner = ({
30258
30380
  color,
@@ -30806,7 +30928,9 @@ var htmlInCanvasSchema = {
30806
30928
  description: "Pixel density",
30807
30929
  hiddenFromList: false
30808
30930
  },
30809
- ...transformSchema
30931
+ ...transformSchema,
30932
+ ...backgroundSchema,
30933
+ ...borderSchema
30810
30934
  };
30811
30935
  var HtmlInCanvasWrapped = withInteractivitySchema({
30812
30936
  Component: HtmlInCanvasInner,
@@ -30828,6 +30952,7 @@ function truncateSrcForLabel(src) {
30828
30952
  }
30829
30953
  var canvasImageSchema = {
30830
30954
  ...baseSchema,
30955
+ ...premountSchema,
30831
30956
  fit: {
30832
30957
  type: "enum",
30833
30958
  default: "fill",
@@ -30838,7 +30963,9 @@ var canvasImageSchema = {
30838
30963
  cover: {}
30839
30964
  }
30840
30965
  },
30841
- ...transformSchema
30966
+ ...transformSchema,
30967
+ ...backgroundSchema,
30968
+ ...borderSchema
30842
30969
  };
30843
30970
  var makeAbortError = () => {
30844
30971
  if (typeof DOMException !== "undefined") {
@@ -31162,6 +31289,10 @@ var CanvasImageInner = forwardRef10(({
31162
31289
  from,
31163
31290
  trimBefore,
31164
31291
  freeze,
31292
+ premountFor,
31293
+ postmountFor,
31294
+ styleWhilePremounted,
31295
+ styleWhilePostmounted,
31165
31296
  hidden,
31166
31297
  name,
31167
31298
  showInTimeline,
@@ -31179,39 +31310,65 @@ var CanvasImageInner = forwardRef10(({
31179
31310
  useImperativeHandle7(ref, () => {
31180
31311
  return actualRef.current;
31181
31312
  }, []);
31182
- return /* @__PURE__ */ jsx26(Sequence, {
31183
- layout: "none",
31313
+ const {
31314
+ effectivePostmountFor,
31315
+ effectivePremountFor,
31316
+ freezeFrame,
31317
+ isPremountingOrPostmounting,
31318
+ postmountingActive,
31319
+ premountingActive,
31320
+ premountingStyle
31321
+ } = usePremounting({
31184
31322
  from: from ?? 0,
31185
- trimBefore,
31186
31323
  durationInFrames: durationInFrames ?? Infinity,
31187
- freeze,
31188
- hidden,
31189
- showInTimeline: showInTimeline ?? true,
31190
- name: name ?? "<CanvasImage>",
31191
- _remotionInternalDocumentationLink: _remotionInternalDocumentationLink ?? "https://www.remotion.dev/docs/canvasimage",
31192
- controls,
31193
- _remotionInternalEffects: memoizedEffectDefinitions,
31194
- _remotionInternalIsMedia: { type: "image", src },
31195
- _remotionInternalStack: stack,
31196
- outlineRef: outlineRef ?? actualRef,
31197
- children: /* @__PURE__ */ jsx26(CanvasImageContent, {
31198
- ref: actualRef,
31199
- src,
31200
- width,
31201
- height,
31202
- fit,
31203
- effects,
31324
+ premountFor: premountFor ?? null,
31325
+ postmountFor: postmountFor ?? null,
31326
+ style: style ?? null,
31327
+ styleWhilePremounted: styleWhilePremounted ?? null,
31328
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
31329
+ hideWhilePremounted: "display-none"
31330
+ });
31331
+ return /* @__PURE__ */ jsx26(Freeze, {
31332
+ frame: freezeFrame,
31333
+ active: isPremountingOrPostmounting,
31334
+ children: /* @__PURE__ */ jsx26(Sequence, {
31335
+ layout: "none",
31336
+ from: from ?? 0,
31337
+ trimBefore,
31338
+ durationInFrames: durationInFrames ?? Infinity,
31339
+ freeze,
31340
+ hidden,
31341
+ showInTimeline: showInTimeline ?? true,
31342
+ name: name ?? "<CanvasImage>",
31343
+ _remotionInternalDocumentationLink: _remotionInternalDocumentationLink ?? "https://www.remotion.dev/docs/canvasimage",
31204
31344
  controls,
31205
- className,
31206
- style,
31207
- id,
31208
- onError,
31209
- pauseWhenLoading,
31210
- maxRetries,
31211
- delayRenderRetries,
31212
- delayRenderTimeoutInMilliseconds,
31213
- refForOutline: outlineRef ?? null,
31214
- ...canvasProps
31345
+ _remotionInternalEffects: memoizedEffectDefinitions,
31346
+ _remotionInternalIsMedia: { type: "image", src },
31347
+ _remotionInternalStack: stack,
31348
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
31349
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
31350
+ _remotionInternalIsPremounting: premountingActive,
31351
+ _remotionInternalIsPostmounting: postmountingActive,
31352
+ outlineRef: outlineRef ?? actualRef,
31353
+ children: /* @__PURE__ */ jsx26(CanvasImageContent, {
31354
+ ref: actualRef,
31355
+ src,
31356
+ width,
31357
+ height,
31358
+ fit,
31359
+ effects,
31360
+ controls,
31361
+ className,
31362
+ style: premountingStyle ?? undefined,
31363
+ id,
31364
+ onError,
31365
+ pauseWhenLoading,
31366
+ maxRetries,
31367
+ delayRenderRetries,
31368
+ delayRenderTimeoutInMilliseconds,
31369
+ refForOutline: outlineRef ?? null,
31370
+ ...canvasProps
31371
+ })
31215
31372
  })
31216
31373
  });
31217
31374
  });
@@ -31428,6 +31585,11 @@ var NativeImgInner = ({
31428
31585
  trimBefore,
31429
31586
  durationInFrames,
31430
31587
  freeze,
31588
+ premountFor,
31589
+ postmountFor,
31590
+ style,
31591
+ styleWhilePremounted,
31592
+ styleWhilePostmounted,
31431
31593
  controls,
31432
31594
  outlineRef: refForOutline,
31433
31595
  ...props2
@@ -31435,24 +31597,51 @@ var NativeImgInner = ({
31435
31597
  if (!src) {
31436
31598
  throw new Error('No "src" prop was passed to <Img>.');
31437
31599
  }
31438
- return /* @__PURE__ */ jsx28(Sequence, {
31439
- layout: "none",
31600
+ const {
31601
+ effectivePostmountFor,
31602
+ effectivePremountFor,
31603
+ freezeFrame,
31604
+ isPremountingOrPostmounting,
31605
+ postmountingActive,
31606
+ premountingActive,
31607
+ premountingStyle
31608
+ } = usePremounting({
31440
31609
  from: from ?? 0,
31441
- trimBefore,
31442
31610
  durationInFrames: durationInFrames ?? Infinity,
31443
- freeze,
31444
- _remotionInternalStack: stack,
31445
- _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
31446
- _remotionInternalIsMedia: { type: "image", src },
31447
- name: name ?? "<Img>",
31448
- controls,
31449
- showInTimeline: showInTimeline ?? true,
31450
- hidden,
31451
- outlineRef: refForOutline,
31452
- children: /* @__PURE__ */ jsx28(ImgContent, {
31453
- src,
31454
- refForOutline,
31455
- ...props2
31611
+ premountFor: premountFor ?? null,
31612
+ postmountFor: postmountFor ?? null,
31613
+ style: style ?? null,
31614
+ styleWhilePremounted: styleWhilePremounted ?? null,
31615
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
31616
+ hideWhilePremounted: "display-none"
31617
+ });
31618
+ return /* @__PURE__ */ jsx28(Freeze, {
31619
+ frame: freezeFrame,
31620
+ active: isPremountingOrPostmounting,
31621
+ children: /* @__PURE__ */ jsx28(Sequence, {
31622
+ layout: "none",
31623
+ from: from ?? 0,
31624
+ trimBefore,
31625
+ durationInFrames: durationInFrames ?? Infinity,
31626
+ freeze,
31627
+ _remotionInternalStack: stack,
31628
+ _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
31629
+ _remotionInternalIsMedia: { type: "image", src },
31630
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
31631
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
31632
+ _remotionInternalIsPremounting: premountingActive,
31633
+ _remotionInternalIsPostmounting: postmountingActive,
31634
+ name: name ?? "<Img>",
31635
+ controls,
31636
+ showInTimeline: showInTimeline ?? true,
31637
+ hidden,
31638
+ outlineRef: refForOutline,
31639
+ children: /* @__PURE__ */ jsx28(ImgContent, {
31640
+ src,
31641
+ refForOutline,
31642
+ style: premountingStyle ?? undefined,
31643
+ ...props2
31644
+ })
31456
31645
  })
31457
31646
  });
31458
31647
  };
@@ -31465,7 +31654,10 @@ var imgSchema = {
31465
31654
  keyframable: false
31466
31655
  },
31467
31656
  ...baseSchema,
31468
- ...transformSchema
31657
+ ...premountSchema,
31658
+ ...transformSchema,
31659
+ ...backgroundSchema,
31660
+ ...borderSchema
31469
31661
  };
31470
31662
  var imgCanvasFallbackIncompatibleProps = new Set([
31471
31663
  "alt",
@@ -31521,6 +31713,10 @@ var ImgInner = ({
31521
31713
  trimBefore,
31522
31714
  durationInFrames,
31523
31715
  freeze,
31716
+ premountFor,
31717
+ postmountFor,
31718
+ styleWhilePremounted,
31719
+ styleWhilePostmounted,
31524
31720
  controls,
31525
31721
  width,
31526
31722
  height,
@@ -31547,6 +31743,10 @@ var ImgInner = ({
31547
31743
  trimBefore,
31548
31744
  durationInFrames,
31549
31745
  freeze,
31746
+ premountFor,
31747
+ postmountFor,
31748
+ styleWhilePremounted,
31749
+ styleWhilePostmounted,
31550
31750
  controls,
31551
31751
  width,
31552
31752
  height,
@@ -31590,6 +31790,10 @@ var ImgInner = ({
31590
31790
  trimBefore,
31591
31791
  durationInFrames,
31592
31792
  freeze,
31793
+ premountFor,
31794
+ postmountFor,
31795
+ styleWhilePremounted,
31796
+ styleWhilePostmounted,
31593
31797
  hidden,
31594
31798
  name: name ?? "<Img>",
31595
31799
  showInTimeline,
@@ -31628,7 +31832,20 @@ var interactiveElementSchema = {
31628
31832
  ...baseSchema,
31629
31833
  ...transformSchema
31630
31834
  };
31835
+ var interactiveBackgroundElementSchema = {
31836
+ ...interactiveElementSchema,
31837
+ ...backgroundSchema
31838
+ };
31839
+ var interactiveBorderElementSchema = {
31840
+ ...interactiveBackgroundElementSchema,
31841
+ ...borderSchema
31842
+ };
31631
31843
  var interactiveTextElementSchema = {
31844
+ ...interactiveBorderElementSchema,
31845
+ ...textSchema,
31846
+ ...textContentSchema
31847
+ };
31848
+ var interactiveSvgTextElementSchema = {
31632
31849
  ...interactiveElementSchema,
31633
31850
  ...textSchema,
31634
31851
  ...textContentSchema
@@ -31707,6 +31924,8 @@ var Interactive = {
31707
31924
  baseSchema,
31708
31925
  transformSchema,
31709
31926
  textSchema,
31927
+ backgroundSchema,
31928
+ borderSchema,
31710
31929
  premountSchema,
31711
31930
  sequenceSchema,
31712
31931
  withSchema,
@@ -31743,10 +31962,39 @@ var Interactive = {
31743
31962
  Small: makeInteractiveTextElement("small", "<Interactive.Small>"),
31744
31963
  Span: makeInteractiveTextElement("span", "<Interactive.Span>"),
31745
31964
  Strong: makeInteractiveTextElement("strong", "<Interactive.Strong>"),
31746
- Svg: makeInteractiveNonTextElement("svg", "<Interactive.Svg>"),
31747
- Text: makeInteractiveTextElement("text", "<Interactive.Text>"),
31965
+ Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveBorderElementSchema),
31966
+ Text: makeInteractiveElement("text", "<Interactive.Text>", interactiveSvgTextElementSchema),
31748
31967
  Ul: makeInteractiveTextElement("ul", "<Interactive.Ul>")
31749
31968
  };
31969
+ var getAnimatedImageDurationInSeconds = async ({
31970
+ resolvedSrc,
31971
+ signal,
31972
+ requestInit,
31973
+ contentType
31974
+ }) => {
31975
+ const { decoder, selectedTrack } = await createImageDecoder({
31976
+ resolvedSrc,
31977
+ signal,
31978
+ requestInit,
31979
+ contentType
31980
+ });
31981
+ try {
31982
+ const { image } = await decoder.decode({
31983
+ frameIndex: selectedTrack.frameCount - 1,
31984
+ completeFramesOnly: true
31985
+ });
31986
+ try {
31987
+ if (image.duration === null) {
31988
+ throw new Error("Could not determine animated image duration");
31989
+ }
31990
+ return (image.timestamp + image.duration) / 1e6;
31991
+ } finally {
31992
+ image.close();
31993
+ }
31994
+ } finally {
31995
+ decoder.close();
31996
+ }
31997
+ };
31750
31998
  var compositionsRef = React31.createRef();
31751
31999
  var CompositionManagerProvider = ({
31752
32000
  children,
@@ -32974,6 +33222,7 @@ var Internals = {
32974
33222
  useAbsoluteTimelinePosition,
32975
33223
  evaluateVolume,
32976
33224
  getAbsoluteSrc,
33225
+ getAnimatedImageDurationInSeconds,
32977
33226
  getAssetDisplayName,
32978
33227
  Timeline: exports_timeline_position_state,
32979
33228
  validateMediaTrimProps,
@@ -32998,7 +33247,6 @@ var Internals = {
32998
33247
  textSchema,
32999
33248
  transformSchema,
33000
33249
  premountSchema,
33001
- premountStyleSchema,
33002
33250
  flattenActiveSchema,
33003
33251
  getFlatSchemaWithAllKeys,
33004
33252
  RemotionRootContexts,
@@ -33137,6 +33385,7 @@ var seriesSequenceSchema = {
33137
33385
  hidden: Interactive.sequenceSchema.hidden,
33138
33386
  showInTimeline: Interactive.sequenceSchema.showInTimeline,
33139
33387
  freeze: Interactive.baseSchema.freeze,
33388
+ trimBefore: Interactive.sequenceSchema.trimBefore,
33140
33389
  layout: Interactive.sequenceSchema.layout
33141
33390
  };
33142
33391
  var SeriesSequenceInner = forwardRef14(({
@@ -34209,7 +34458,9 @@ var makeShapeSchema = (shapeFields) => {
34209
34458
  defaultValue: "#0b84ff",
34210
34459
  description: "Fill"
34211
34460
  }),
34212
- ...Internals.transformSchema
34461
+ ...Internals.transformSchema,
34462
+ ...Interactive.backgroundSchema,
34463
+ ...Interactive.borderSchema
34213
34464
  };
34214
34465
  };
34215
34466
  var arrowSchema = makeShapeSchema({