@remotion/promo-pages 4.0.477 → 4.0.479

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/design.js CHANGED
@@ -5565,7 +5565,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
5565
5565
  var addSequenceStackTraces = (component) => {
5566
5566
  componentsToAddStacksTo.push(component);
5567
5567
  };
5568
- var VERSION = "4.0.477";
5568
+ var VERSION = "4.0.479";
5569
5569
  var checkMultipleRemotionVersions = () => {
5570
5570
  if (typeof globalThis === "undefined") {
5571
5571
  return;
@@ -5928,10 +5928,7 @@ var Freeze = ({
5928
5928
  })
5929
5929
  });
5930
5930
  };
5931
- var PremountContext = createContext14({
5932
- premountFramesRemaining: 0
5933
- });
5934
- var sequenceVisualStyleSchema = {
5931
+ var transformSchema = {
5935
5932
  "style.transformOrigin": {
5936
5933
  type: "transform-origin",
5937
5934
  step: 1,
@@ -5967,7 +5964,8 @@ var sequenceVisualStyleSchema = {
5967
5964
  hiddenFromList: false
5968
5965
  }
5969
5966
  };
5970
- var sequencePremountSchema = {
5967
+ var sequenceVisualStyleSchema = transformSchema;
5968
+ var premountSchema = {
5971
5969
  premountFor: {
5972
5970
  type: "number",
5973
5971
  default: 0,
@@ -5990,9 +5988,10 @@ var sequencePremountSchema = {
5990
5988
  type: "hidden"
5991
5989
  }
5992
5990
  };
5991
+ var sequencePremountSchema = premountSchema;
5993
5992
  var sequenceStyleSchema = {
5994
- ...sequenceVisualStyleSchema,
5995
- ...sequencePremountSchema
5993
+ ...transformSchema,
5994
+ ...premountSchema
5996
5995
  };
5997
5996
  var hiddenField = {
5998
5997
  type: "boolean",
@@ -6030,12 +6029,16 @@ var freezeField = {
6030
6029
  step: 1,
6031
6030
  hiddenFromList: true
6032
6031
  };
6033
- var sequenceSchema = extendSchemaWithSequenceName({
6034
- hidden: hiddenField,
6035
- showInTimeline: showInTimelineField,
6032
+ var baseSchema = {
6033
+ durationInFrames: durationInFramesField,
6036
6034
  from: fromField,
6037
6035
  freeze: freezeField,
6038
- durationInFrames: durationInFramesField,
6036
+ hidden: hiddenField,
6037
+ name: sequenceNameField,
6038
+ showInTimeline: showInTimelineField
6039
+ };
6040
+ var sequenceSchema = {
6041
+ ...baseSchema,
6039
6042
  layout: {
6040
6043
  type: "enum",
6041
6044
  default: "absolute-fill",
@@ -6045,14 +6048,18 @@ var sequenceSchema = extendSchemaWithSequenceName({
6045
6048
  none: {}
6046
6049
  }
6047
6050
  }
6048
- });
6049
- var sequenceSchemaWithoutFrom = extendSchemaWithSequenceName({
6050
- hidden: hiddenField,
6051
- showInTimeline: showInTimelineField,
6052
- freeze: freezeField,
6051
+ };
6052
+ var baseSchemaWithoutFrom = {
6053
6053
  durationInFrames: durationInFramesField,
6054
+ freeze: freezeField,
6055
+ hidden: hiddenField,
6056
+ name: sequenceNameField,
6057
+ showInTimeline: showInTimelineField
6058
+ };
6059
+ var sequenceSchemaWithoutFrom = {
6060
+ ...baseSchemaWithoutFrom,
6054
6061
  layout: sequenceSchema.layout
6055
- });
6062
+ };
6056
6063
  var sequenceSchemaDefaultLayoutNone = {
6057
6064
  ...sequenceSchema,
6058
6065
  layout: {
@@ -6060,6 +6067,9 @@ var sequenceSchemaDefaultLayoutNone = {
6060
6067
  default: "none"
6061
6068
  }
6062
6069
  };
6070
+ var PremountContext = createContext14({
6071
+ premountFramesRemaining: 0
6072
+ });
6063
6073
  var SequenceManager = React11.createContext({
6064
6074
  registerSequence: () => {
6065
6075
  throw new Error("SequenceManagerContext not initialized");
@@ -7744,10 +7754,21 @@ var interpolateColors = (input, inputRange, outputRange, options) => {
7744
7754
  return interpolateColorsRGB(input, inputRange, processedOutputRange, options);
7745
7755
  };
7746
7756
  var easingToFn = (e) => {
7747
- if (e === "linear") {
7748
- return Easing.linear;
7757
+ switch (e.type) {
7758
+ case "linear":
7759
+ return Easing.linear;
7760
+ case "spring":
7761
+ return Easing.spring({
7762
+ damping: e.damping,
7763
+ mass: e.mass,
7764
+ overshootClamping: e.overshootClamping,
7765
+ stiffness: e.stiffness
7766
+ });
7767
+ case "bezier":
7768
+ return bezier(e.x1, e.y1, e.x2, e.y2);
7769
+ default:
7770
+ throw new TypeError(`Unsupported easing: ${JSON.stringify(e)}`);
7749
7771
  }
7750
- return bezier(e[0], e[1], e[2], e[3]);
7751
7772
  };
7752
7773
  var interpolateKeyframedStatus = ({
7753
7774
  frame,
@@ -8069,6 +8090,9 @@ var findPropsToDelete = ({
8069
8090
  }
8070
8091
  return [...otherKeys];
8071
8092
  };
8093
+ var DEFAULT_LINEAR_EASING = {
8094
+ type: "linear"
8095
+ };
8072
8096
  var makeStaticDragOverride = (value) => {
8073
8097
  return { type: "static", value };
8074
8098
  };
@@ -8081,7 +8105,7 @@ var makeKeyframedDragOverride = ({
8081
8105
  const keyframes = existingIndex === -1 ? [...status.keyframes, { frame, value }].sort((first, second) => first.frame - second.frame) : status.keyframes.map((keyframe, index) => index === existingIndex ? { frame, value } : keyframe);
8082
8106
  const easing = [...status.easing];
8083
8107
  while (easing.length < keyframes.length - 1) {
8084
- easing.push("linear");
8108
+ easing.push(DEFAULT_LINEAR_EASING);
8085
8109
  }
8086
8110
  if (easing.length > keyframes.length - 1) {
8087
8111
  easing.length = keyframes.length - 1;
@@ -8239,7 +8263,7 @@ var mergeValues = ({
8239
8263
  return merged;
8240
8264
  };
8241
8265
  var stackToOverrideMap = {};
8242
- var wrapInSchema = ({
8266
+ var withInteractivitySchema = ({
8243
8267
  Component,
8244
8268
  componentIdentity,
8245
8269
  schema,
@@ -8253,7 +8277,7 @@ var wrapInSchema = ({
8253
8277
  if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
8254
8278
  return React13.createElement(Component, {
8255
8279
  ...props,
8256
- _experimentalControls: null,
8280
+ controls: null,
8257
8281
  ref
8258
8282
  });
8259
8283
  }
@@ -8261,7 +8285,7 @@ var wrapInSchema = ({
8261
8285
  const { getDragOverrides } = useContext16(VisualModeDragOverridesContext);
8262
8286
  const nodePathMapping = useContext16(OverrideIdsToNodePathsGettersContext);
8263
8287
  const frame = useCurrentFrame();
8264
- if (props._experimentalControls) {
8288
+ if (props.controls) {
8265
8289
  return React13.createElement(Component, {
8266
8290
  ...props,
8267
8291
  ref
@@ -8316,11 +8340,11 @@ var wrapInSchema = ({
8316
8340
  });
8317
8341
  return React13.createElement(Component, {
8318
8342
  ...mergedProps,
8319
- _experimentalControls: controls,
8343
+ controls,
8320
8344
  ref
8321
8345
  });
8322
8346
  });
8323
- Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
8347
+ Wrapped.displayName = `withInteractivitySchema(${Component.displayName || Component.name || "Component"})`;
8324
8348
  return Wrapped;
8325
8349
  };
8326
8350
  var EMPTY_EFFECTS = [];
@@ -8334,7 +8358,7 @@ var RegularSequenceRefForwardingFunction = ({
8334
8358
  width,
8335
8359
  showInTimeline = true,
8336
8360
  hidden = false,
8337
- _experimentalControls: controls,
8361
+ controls,
8338
8362
  _remotionInternalEffects,
8339
8363
  _remotionInternalLoopDisplay: loopDisplay,
8340
8364
  _remotionInternalStack: stack,
@@ -8342,7 +8366,7 @@ var RegularSequenceRefForwardingFunction = ({
8342
8366
  _remotionInternalPremountDisplay: premountDisplay,
8343
8367
  _remotionInternalPostmountDisplay: postmountDisplay,
8344
8368
  _remotionInternalIsMedia: isMedia,
8345
- _remotionInternalRefForOutline: passedRefForOutline,
8369
+ outlineRef: passedRefForOutline,
8346
8370
  ...other
8347
8371
  }, ref) => {
8348
8372
  const { layout = "absolute-fill" } = other;
@@ -8439,6 +8463,11 @@ var RegularSequenceRefForwardingFunction = ({
8439
8463
  const inheritedStack = other?.stack ?? null;
8440
8464
  const stackRef = useRef6(null);
8441
8465
  stackRef.current = stack ?? inheritedStack;
8466
+ const registeredFrozenFrame = typeof freeze === "number" ? freeze : null;
8467
+ const parentCumulatedNegativeFrom = parentSequence?.cumulatedNegativeFrom ?? 0;
8468
+ const startMediaFrom = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom - cumulatedNegativeFrom : null;
8469
+ const mediaFrameAtSequenceZero = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom : null;
8470
+ const frozenMediaFrame = isMedia && isMedia.type !== "image" && mediaFrameAtSequenceZero !== null ? registeredFrozenFrame === null ? null : mediaFrameAtSequenceZero + (loopDisplay ? registeredFrozenFrame % loopDisplay.durationInFrames : registeredFrozenFrame) * isMedia.data.playbackRate : null;
8442
8471
  useEffect3(() => {
8443
8472
  if (!env.isStudio) {
8444
8473
  return;
@@ -8464,7 +8493,8 @@ var RegularSequenceRefForwardingFunction = ({
8464
8493
  src: isMedia.src,
8465
8494
  getStack: () => stackRef.current,
8466
8495
  refForOutline: refForOutline ?? null,
8467
- isInsideSeries
8496
+ isInsideSeries,
8497
+ frozenFrame: registeredFrozenFrame
8468
8498
  });
8469
8499
  } else {
8470
8500
  registerSequence({
@@ -8487,10 +8517,12 @@ var RegularSequenceRefForwardingFunction = ({
8487
8517
  showInTimeline,
8488
8518
  src: isMedia.data.src,
8489
8519
  getStack: () => stackRef.current,
8490
- startMediaFrom: isMedia.data.startMediaFrom,
8520
+ startMediaFrom: startMediaFrom ?? isMedia.data.startMediaFrom,
8491
8521
  volume: isMedia.data.volumes,
8492
8522
  refForOutline: refForOutline ?? null,
8493
- isInsideSeries
8523
+ isInsideSeries,
8524
+ frozenFrame: registeredFrozenFrame,
8525
+ frozenMediaFrame
8494
8526
  });
8495
8527
  }
8496
8528
  return () => {
@@ -8515,7 +8547,8 @@ var RegularSequenceRefForwardingFunction = ({
8515
8547
  controls: controls ?? null,
8516
8548
  effects: _remotionInternalEffects ?? EMPTY_EFFECTS,
8517
8549
  refForOutline: refForOutline ?? null,
8518
- isInsideSeries
8550
+ isInsideSeries,
8551
+ frozenFrame: registeredFrozenFrame
8519
8552
  });
8520
8553
  return () => {
8521
8554
  unregisterSequence(id);
@@ -8542,7 +8575,10 @@ var RegularSequenceRefForwardingFunction = ({
8542
8575
  isMedia,
8543
8576
  resolvedDocumentationLink,
8544
8577
  refForOutline,
8545
- isInsideSeries
8578
+ isInsideSeries,
8579
+ registeredFrozenFrame,
8580
+ startMediaFrom,
8581
+ frozenMediaFrame
8546
8582
  ]);
8547
8583
  const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
8548
8584
  const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
@@ -8657,13 +8693,13 @@ var SequenceRefForwardingFunction = (props, ref) => {
8657
8693
  };
8658
8694
  var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
8659
8695
  var SequenceWithoutSchema = SequenceInner;
8660
- var Sequence = wrapInSchema({
8696
+ var Sequence = withInteractivitySchema({
8661
8697
  Component: SequenceInner,
8662
8698
  componentIdentity: "dev.remotion.remotion.Sequence",
8663
8699
  schema: sequenceSchema,
8664
8700
  supportsEffects: false
8665
8701
  });
8666
- var SequenceWithoutFrom = wrapInSchema({
8702
+ var SequenceWithoutFrom = withInteractivitySchema({
8667
8703
  Component: SequenceInner,
8668
8704
  componentIdentity: null,
8669
8705
  schema: sequenceSchemaWithoutFrom,
@@ -9202,9 +9238,7 @@ var resolveAnimatedImageSource = (src) => {
9202
9238
  return new URL(src, window.origin).href;
9203
9239
  };
9204
9240
  var animatedImageSchema = {
9205
- durationInFrames: durationInFramesField,
9206
- from: fromField,
9207
- freeze: freezeField,
9241
+ ...baseSchema,
9208
9242
  playbackRate: {
9209
9243
  type: "number",
9210
9244
  min: 0,
@@ -9215,8 +9249,7 @@ var animatedImageSchema = {
9215
9249
  hiddenFromList: false,
9216
9250
  keyframable: false
9217
9251
  },
9218
- ...sequenceVisualStyleSchema,
9219
- hidden: hiddenField
9252
+ ...transformSchema
9220
9253
  };
9221
9254
  var AnimatedImageContent = forwardRef4(({
9222
9255
  src,
@@ -9361,7 +9394,7 @@ var AnimatedImageInner = ({
9361
9394
  durationInFrames,
9362
9395
  requestInit,
9363
9396
  effects = [],
9364
- _experimentalControls: controls,
9397
+ controls,
9365
9398
  ref,
9366
9399
  ...sequenceProps
9367
9400
  }) => {
@@ -9390,10 +9423,10 @@ var AnimatedImageInner = ({
9390
9423
  durationInFrames: resolvedDuration,
9391
9424
  name: "<AnimatedImage>",
9392
9425
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage",
9393
- _experimentalControls: controls,
9426
+ controls,
9394
9427
  _remotionInternalEffects: memoizedEffectDefinitions,
9395
9428
  ...sequenceProps,
9396
- _remotionInternalRefForOutline: actualRef,
9429
+ outlineRef: actualRef,
9397
9430
  children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
9398
9431
  ...animatedImageProps,
9399
9432
  ref: actualRef,
@@ -9402,7 +9435,7 @@ var AnimatedImageInner = ({
9402
9435
  })
9403
9436
  });
9404
9437
  };
9405
- var AnimatedImage = wrapInSchema({
9438
+ var AnimatedImage = withInteractivitySchema({
9406
9439
  Component: AnimatedImageInner,
9407
9440
  componentIdentity: "dev.remotion.remotion.AnimatedImage",
9408
9441
  schema: animatedImageSchema,
@@ -9410,6 +9443,36 @@ var AnimatedImage = wrapInSchema({
9410
9443
  });
9411
9444
  AnimatedImage.displayName = "AnimatedImage";
9412
9445
  addSequenceStackTraces(AnimatedImage);
9446
+ var disabledEffectField = {
9447
+ type: "boolean",
9448
+ default: false,
9449
+ description: "Disabled"
9450
+ };
9451
+ var createEffect = (definition) => {
9452
+ const { calculateKey: userCalculateKey, validateParams } = definition;
9453
+ const widened = {
9454
+ ...definition,
9455
+ documentationLink: definition.documentationLink ?? null,
9456
+ calculateKey: (params) => {
9457
+ const disabled = params.disabled ?? false;
9458
+ return `${userCalculateKey(params)}-disabled-${disabled}`;
9459
+ },
9460
+ schema: {
9461
+ disabled: disabledEffectField,
9462
+ ...definition.schema
9463
+ }
9464
+ };
9465
+ const factory = (params = {}) => {
9466
+ validateParams(params);
9467
+ return {
9468
+ definition: widened,
9469
+ params,
9470
+ effectKey: widened.calculateKey(params),
9471
+ memoized: false
9472
+ };
9473
+ };
9474
+ return factory;
9475
+ };
9413
9476
  var validateArtifactFilename = (filename) => {
9414
9477
  if (typeof filename !== "string") {
9415
9478
  throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof filename}`);
@@ -11037,7 +11100,9 @@ var useMediaInTimeline = ({
11037
11100
  controls: null,
11038
11101
  effects: [],
11039
11102
  refForOutline,
11040
- isInsideSeries: false
11103
+ isInsideSeries: false,
11104
+ frozenFrame: null,
11105
+ frozenMediaFrame: null
11041
11106
  });
11042
11107
  return () => {
11043
11108
  unregisterSequence(id);
@@ -12353,9 +12418,7 @@ var resolveSolidPixelDensity = (pixelDensity) => {
12353
12418
  return pixelDensity;
12354
12419
  };
12355
12420
  var solidSchema = {
12356
- durationInFrames: durationInFramesField,
12357
- from: fromField,
12358
- freeze: freezeField,
12421
+ ...baseSchema,
12359
12422
  color: {
12360
12423
  type: "color",
12361
12424
  default: "transparent",
@@ -12377,8 +12440,7 @@ var solidSchema = {
12377
12440
  description: "Height",
12378
12441
  hiddenFromList: false
12379
12442
  },
12380
- ...sequenceVisualStyleSchema,
12381
- hidden: hiddenField
12443
+ ...transformSchema
12382
12444
  };
12383
12445
  var SolidInner = ({
12384
12446
  color,
@@ -12485,7 +12547,7 @@ var SolidInner = ({
12485
12547
  };
12486
12548
  var SolidOuter = forwardRef8(({
12487
12549
  effects = [],
12488
- _experimentalControls: controls,
12550
+ controls,
12489
12551
  color,
12490
12552
  height,
12491
12553
  width,
@@ -12511,11 +12573,11 @@ var SolidOuter = forwardRef8(({
12511
12573
  freeze,
12512
12574
  hidden,
12513
12575
  showInTimeline,
12514
- _experimentalControls: controls,
12576
+ controls,
12515
12577
  _remotionInternalEffects: memoizedEffectDefinitions,
12516
12578
  durationInFrames,
12517
12579
  name: name ?? "<Solid>",
12518
- _remotionInternalRefForOutline: actualRef,
12580
+ outlineRef: actualRef,
12519
12581
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/solid",
12520
12582
  ...props2,
12521
12583
  children: /* @__PURE__ */ jsx24(SolidInner, {
@@ -12531,7 +12593,7 @@ var SolidOuter = forwardRef8(({
12531
12593
  })
12532
12594
  });
12533
12595
  });
12534
- var Solid = wrapInSchema({
12596
+ var Solid = withInteractivitySchema({
12535
12597
  Component: SolidOuter,
12536
12598
  componentIdentity: "dev.remotion.remotion.Solid",
12537
12599
  schema: solidSchema,
@@ -12808,7 +12870,7 @@ var HtmlInCanvasInner = forwardRef9(({
12808
12870
  onPaint,
12809
12871
  onInit,
12810
12872
  pixelDensity,
12811
- _experimentalControls: controls,
12873
+ controls,
12812
12874
  style,
12813
12875
  durationInFrames,
12814
12876
  name,
@@ -12830,9 +12892,9 @@ var HtmlInCanvasInner = forwardRef9(({
12830
12892
  durationInFrames: resolvedDuration,
12831
12893
  name: name ?? "<HtmlInCanvas>",
12832
12894
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/remotion/html-in-canvas",
12833
- _experimentalControls: controls,
12895
+ controls,
12834
12896
  _remotionInternalEffects: memoizedEffectDefinitions,
12835
- _remotionInternalRefForOutline: actualRef,
12897
+ outlineRef: actualRef,
12836
12898
  layout: "none",
12837
12899
  ...sequenceProps,
12838
12900
  children: /* @__PURE__ */ jsx25(HtmlInCanvasContent, {
@@ -12851,13 +12913,10 @@ var HtmlInCanvasInner = forwardRef9(({
12851
12913
  });
12852
12914
  HtmlInCanvasInner.displayName = "HtmlInCanvas";
12853
12915
  var htmlInCanvasSchema = {
12854
- durationInFrames: durationInFramesField,
12855
- from: fromField,
12856
- freeze: freezeField,
12857
- ...sequenceVisualStyleSchema,
12858
- hidden: hiddenField
12916
+ ...baseSchema,
12917
+ ...transformSchema
12859
12918
  };
12860
- var HtmlInCanvasWrapped = wrapInSchema({
12919
+ var HtmlInCanvasWrapped = withInteractivitySchema({
12861
12920
  Component: HtmlInCanvasInner,
12862
12921
  componentIdentity: "dev.remotion.remotion.HtmlInCanvas",
12863
12922
  schema: htmlInCanvasSchema,
@@ -12875,9 +12934,7 @@ function truncateSrcForLabel(src) {
12875
12934
  return src;
12876
12935
  }
12877
12936
  var canvasImageSchema = {
12878
- durationInFrames: durationInFramesField,
12879
- from: fromField,
12880
- freeze: freezeField,
12937
+ ...baseSchema,
12881
12938
  fit: {
12882
12939
  type: "enum",
12883
12940
  default: "fill",
@@ -12888,8 +12945,7 @@ var canvasImageSchema = {
12888
12945
  cover: {}
12889
12946
  }
12890
12947
  },
12891
- ...sequenceVisualStyleSchema,
12892
- hidden: hiddenField
12948
+ ...transformSchema
12893
12949
  };
12894
12950
  var makeAbortError = () => {
12895
12951
  if (typeof DOMException !== "undefined") {
@@ -12970,6 +13026,7 @@ var CanvasImageContent = forwardRef10(({
12970
13026
  const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
12971
13027
  const { delayPlayback } = useBufferState();
12972
13028
  const [outputCanvas, setOutputCanvas] = useState16(null);
13029
+ const [loadedImage, setLoadedImage] = useState16(null);
12973
13030
  const actualSrc = usePreload(src);
12974
13031
  const chainState = useEffectChainState();
12975
13032
  const memoizedEffects = useMemoizedEffects({
@@ -12995,9 +13052,6 @@ var CanvasImageContent = forwardRef10(({
12995
13052
  }
12996
13053
  }, [ref, refForOutline]);
12997
13054
  useEffect17(() => {
12998
- if (!outputCanvas || !sourceCanvas) {
12999
- return;
13000
- }
13001
13055
  const isPremounting = Boolean(sequenceContext?.premounting);
13002
13056
  const isPostmounting = Boolean(sequenceContext?.postmounting);
13003
13057
  const handle = delayRender2(`Rendering <CanvasImage> with src="${truncateSrcForLabel(actualSrc)}"`, {
@@ -13012,6 +13066,7 @@ var CanvasImageContent = forwardRef10(({
13012
13066
  let continued = false;
13013
13067
  let errorCount = 0;
13014
13068
  let timeoutId = null;
13069
+ setLoadedImage(null);
13015
13070
  const continueRenderOnce = () => {
13016
13071
  if (continued) {
13017
13072
  return;
@@ -13025,30 +13080,9 @@ var CanvasImageContent = forwardRef10(({
13025
13080
  if (cancelled) {
13026
13081
  return;
13027
13082
  }
13028
- const canvasWidth = width ?? image.width;
13029
- const canvasHeight = height ?? image.height;
13030
- const sourceContext = sourceCanvas.getContext("2d", {
13031
- colorSpace: "srgb"
13032
- });
13033
- if (!sourceContext) {
13034
- throw new Error("Could not get 2D context for <CanvasImage> source canvas");
13035
- }
13036
- sourceCanvas.width = canvasWidth;
13037
- sourceCanvas.height = canvasHeight;
13038
- outputCanvas.width = canvasWidth;
13039
- outputCanvas.height = canvasHeight;
13040
- sourceContext.clearRect(0, 0, canvasWidth, canvasHeight);
13041
- sourceContext.drawImage(image.element, ...calculateImageFit(fit, { width: image.width, height: image.height }, { width: canvasWidth, height: canvasHeight }));
13042
- return runEffectChain({
13043
- state: chainState.get(canvasWidth, canvasHeight),
13044
- source: sourceCanvas,
13045
- effects: memoizedEffects,
13046
- output: outputCanvas,
13047
- width: canvasWidth,
13048
- height: canvasHeight
13049
- });
13050
- }).then((completed) => {
13051
- if (completed && !cancelled) {
13083
+ setLoadedImage(image);
13084
+ }).then(() => {
13085
+ if (!cancelled) {
13052
13086
  continueRenderOnce();
13053
13087
  }
13054
13088
  }).catch((err) => {
@@ -13085,21 +13119,87 @@ var CanvasImageContent = forwardRef10(({
13085
13119
  }, [
13086
13120
  actualSrc,
13087
13121
  cancelRender2,
13088
- chainState,
13089
13122
  continueRender2,
13090
13123
  delayPlayback,
13091
13124
  delayRender2,
13092
13125
  delayRenderRetries,
13093
13126
  delayRenderTimeoutInMilliseconds,
13127
+ maxRetries,
13128
+ onError,
13129
+ pauseWhenLoading,
13130
+ sequenceContext?.postmounting,
13131
+ sequenceContext?.premounting
13132
+ ]);
13133
+ useEffect17(() => {
13134
+ if (!loadedImage || !outputCanvas || !sourceCanvas) {
13135
+ return;
13136
+ }
13137
+ const handle = delayRender2(`Applying effects to <CanvasImage> with src="${truncateSrcForLabel(actualSrc)}"`);
13138
+ let cancelled = false;
13139
+ let continued = false;
13140
+ const continueRenderOnce = () => {
13141
+ if (continued) {
13142
+ return;
13143
+ }
13144
+ continued = true;
13145
+ continueRender2(handle);
13146
+ };
13147
+ const canvasWidth = width ?? loadedImage.width;
13148
+ const canvasHeight = height ?? loadedImage.height;
13149
+ const sourceContext = sourceCanvas.getContext("2d", {
13150
+ colorSpace: "srgb"
13151
+ });
13152
+ if (!sourceContext) {
13153
+ cancelRender2(new Error("Could not get 2D context for <CanvasImage> source canvas"));
13154
+ continueRenderOnce();
13155
+ return () => {
13156
+ continueRenderOnce();
13157
+ };
13158
+ }
13159
+ sourceCanvas.width = canvasWidth;
13160
+ sourceCanvas.height = canvasHeight;
13161
+ outputCanvas.width = canvasWidth;
13162
+ outputCanvas.height = canvasHeight;
13163
+ sourceContext.clearRect(0, 0, canvasWidth, canvasHeight);
13164
+ sourceContext.drawImage(loadedImage.element, ...calculateImageFit(fit, { width: loadedImage.width, height: loadedImage.height }, { width: canvasWidth, height: canvasHeight }));
13165
+ runEffectChain({
13166
+ state: chainState.get(canvasWidth, canvasHeight),
13167
+ source: sourceCanvas,
13168
+ effects: memoizedEffects,
13169
+ output: outputCanvas,
13170
+ width: canvasWidth,
13171
+ height: canvasHeight
13172
+ }).then((completed) => {
13173
+ if (completed && !cancelled) {
13174
+ continueRenderOnce();
13175
+ }
13176
+ }).catch((err) => {
13177
+ if (cancelled) {
13178
+ return;
13179
+ }
13180
+ if (onError) {
13181
+ onError(err);
13182
+ continueRenderOnce();
13183
+ } else {
13184
+ cancelRender2(err);
13185
+ }
13186
+ });
13187
+ return () => {
13188
+ cancelled = true;
13189
+ continueRenderOnce();
13190
+ };
13191
+ }, [
13192
+ actualSrc,
13193
+ cancelRender2,
13194
+ chainState,
13195
+ continueRender2,
13196
+ delayRender2,
13094
13197
  fit,
13095
13198
  height,
13096
- maxRetries,
13199
+ loadedImage,
13097
13200
  memoizedEffects,
13098
13201
  onError,
13099
13202
  outputCanvas,
13100
- pauseWhenLoading,
13101
- sequenceContext?.postmounting,
13102
- sequenceContext?.premounting,
13103
13203
  sourceCanvas,
13104
13204
  width
13105
13205
  ]);
@@ -13135,9 +13235,9 @@ var CanvasImageInner = forwardRef10(({
13135
13235
  name,
13136
13236
  showInTimeline,
13137
13237
  stack,
13138
- _experimentalControls: controls,
13238
+ controls,
13139
13239
  _remotionInternalDocumentationLink,
13140
- _remotionInternalRefForOutline,
13240
+ outlineRef,
13141
13241
  ...canvasProps
13142
13242
  }, ref) => {
13143
13243
  if (!src) {
@@ -13157,11 +13257,11 @@ var CanvasImageInner = forwardRef10(({
13157
13257
  showInTimeline: showInTimeline ?? true,
13158
13258
  name: name ?? "<CanvasImage>",
13159
13259
  _remotionInternalDocumentationLink: _remotionInternalDocumentationLink ?? "https://www.remotion.dev/docs/canvasimage",
13160
- _experimentalControls: controls,
13260
+ controls,
13161
13261
  _remotionInternalEffects: memoizedEffectDefinitions,
13162
13262
  _remotionInternalIsMedia: { type: "image", src },
13163
13263
  _remotionInternalStack: stack,
13164
- _remotionInternalRefForOutline: _remotionInternalRefForOutline ?? actualRef,
13264
+ outlineRef: outlineRef ?? actualRef,
13165
13265
  children: /* @__PURE__ */ jsx26(CanvasImageContent, {
13166
13266
  ref: actualRef,
13167
13267
  src,
@@ -13178,12 +13278,12 @@ var CanvasImageInner = forwardRef10(({
13178
13278
  maxRetries,
13179
13279
  delayRenderRetries,
13180
13280
  delayRenderTimeoutInMilliseconds,
13181
- refForOutline: _remotionInternalRefForOutline ?? null,
13281
+ refForOutline: outlineRef ?? null,
13182
13282
  ...canvasProps
13183
13283
  })
13184
13284
  });
13185
13285
  });
13186
- var CanvasImage = wrapInSchema({
13286
+ var CanvasImage = withInteractivitySchema({
13187
13287
  Component: CanvasImageInner,
13188
13288
  componentIdentity: "dev.remotion.remotion.CanvasImage",
13189
13289
  schema: canvasImageSchema,
@@ -13388,8 +13488,8 @@ var NativeImgInner = ({
13388
13488
  from,
13389
13489
  durationInFrames,
13390
13490
  freeze,
13391
- _experimentalControls: controls,
13392
- _remotionInternalRefForOutline: refForOutline,
13491
+ controls,
13492
+ outlineRef: refForOutline,
13393
13493
  ...props2
13394
13494
  }) => {
13395
13495
  if (!src) {
@@ -13404,10 +13504,10 @@ var NativeImgInner = ({
13404
13504
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
13405
13505
  _remotionInternalIsMedia: { type: "image", src },
13406
13506
  name: name ?? "<Img>",
13407
- _experimentalControls: controls,
13507
+ controls,
13408
13508
  showInTimeline: showInTimeline ?? true,
13409
13509
  hidden,
13410
- _remotionInternalRefForOutline: refForOutline,
13510
+ outlineRef: refForOutline,
13411
13511
  children: /* @__PURE__ */ jsx28(ImgContent, {
13412
13512
  src,
13413
13513
  refForOutline,
@@ -13417,11 +13517,8 @@ var NativeImgInner = ({
13417
13517
  };
13418
13518
  var CanvasImageWithPrivateProps = CanvasImage;
13419
13519
  var imgSchema = {
13420
- durationInFrames: durationInFramesField,
13421
- from: fromField,
13422
- freeze: freezeField,
13423
- ...sequenceVisualStyleSchema,
13424
- hidden: hiddenField
13520
+ ...baseSchema,
13521
+ ...transformSchema
13425
13522
  };
13426
13523
  var imgCanvasFallbackIncompatibleProps = new Set([
13427
13524
  "alt",
@@ -13476,7 +13573,7 @@ var ImgInner = ({
13476
13573
  from,
13477
13574
  durationInFrames,
13478
13575
  freeze,
13479
- _experimentalControls: controls,
13576
+ controls,
13480
13577
  width,
13481
13578
  height,
13482
13579
  className,
@@ -13501,7 +13598,7 @@ var ImgInner = ({
13501
13598
  from,
13502
13599
  durationInFrames,
13503
13600
  freeze,
13504
- _experimentalControls: controls,
13601
+ controls,
13505
13602
  width,
13506
13603
  height,
13507
13604
  className,
@@ -13511,7 +13608,7 @@ var ImgInner = ({
13511
13608
  maxRetries,
13512
13609
  delayRenderRetries,
13513
13610
  delayRenderTimeoutInMilliseconds,
13514
- _remotionInternalRefForOutline: refForOutline
13611
+ outlineRef: refForOutline
13515
13612
  });
13516
13613
  }
13517
13614
  if (!src) {
@@ -13548,12 +13645,12 @@ var ImgInner = ({
13548
13645
  showInTimeline,
13549
13646
  stack,
13550
13647
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
13551
- _experimentalControls: controls,
13552
- _remotionInternalRefForOutline: refForOutline,
13648
+ controls,
13649
+ outlineRef: refForOutline,
13553
13650
  ...canvasProps
13554
13651
  });
13555
13652
  };
13556
- var Img = wrapInSchema({
13653
+ var Img = withInteractivitySchema({
13557
13654
  Component: ImgInner,
13558
13655
  componentIdentity: "dev.remotion.remotion.Img",
13559
13656
  schema: imgSchema,
@@ -13561,11 +13658,8 @@ var Img = wrapInSchema({
13561
13658
  });
13562
13659
  addSequenceStackTraces(Img);
13563
13660
  var interactiveElementSchema = {
13564
- durationInFrames: durationInFramesField,
13565
- from: fromField,
13566
- freeze: freezeField,
13567
- ...sequenceVisualStyleSchema,
13568
- hidden: hiddenField
13661
+ ...baseSchema,
13662
+ ...transformSchema
13569
13663
  };
13570
13664
  var setRef = (ref, value) => {
13571
13665
  if (typeof ref === "function") {
@@ -13584,7 +13678,7 @@ var makeInteractiveElement = (tag, displayName) => {
13584
13678
  name,
13585
13679
  showInTimeline,
13586
13680
  stack,
13587
- _experimentalControls,
13681
+ controls,
13588
13682
  ...props2
13589
13683
  } = propsWithControls;
13590
13684
  const refForOutline = useRef25(null);
@@ -13600,10 +13694,10 @@ var makeInteractiveElement = (tag, displayName) => {
13600
13694
  hidden,
13601
13695
  name: name ?? displayName,
13602
13696
  showInTimeline: showInTimeline ?? true,
13603
- _experimentalControls,
13697
+ controls,
13604
13698
  _remotionInternalStack: stack,
13605
13699
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive",
13606
- _remotionInternalRefForOutline: refForOutline,
13700
+ outlineRef: refForOutline,
13607
13701
  children: React29.createElement(tag, {
13608
13702
  ...props2,
13609
13703
  ref: callbackRef
@@ -13611,7 +13705,7 @@ var makeInteractiveElement = (tag, displayName) => {
13611
13705
  });
13612
13706
  });
13613
13707
  Inner.displayName = displayName;
13614
- const Wrapped = wrapInSchema({
13708
+ const Wrapped = withInteractivitySchema({
13615
13709
  Component: Inner,
13616
13710
  componentIdentity: `dev.remotion.remotion.${displayName.slice(1, -1)}`,
13617
13711
  schema: interactiveElementSchema,
@@ -13622,6 +13716,11 @@ var makeInteractiveElement = (tag, displayName) => {
13622
13716
  return Wrapped;
13623
13717
  };
13624
13718
  var Interactive = {
13719
+ baseSchema,
13720
+ transformSchema,
13721
+ premountSchema,
13722
+ sequenceSchema,
13723
+ withSchema: withInteractivitySchema,
13625
13724
  A: makeInteractiveElement("a", "<Interactive.A>"),
13626
13725
  Article: makeInteractiveElement("article", "<Interactive.Article>"),
13627
13726
  Aside: makeInteractiveElement("aside", "<Interactive.Aside>"),
@@ -13803,36 +13902,6 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
13803
13902
  }
13804
13903
  `;
13805
13904
  };
13806
- var disabledEffectField = {
13807
- type: "boolean",
13808
- default: false,
13809
- description: "Disabled"
13810
- };
13811
- var createEffect = (definition) => {
13812
- const { calculateKey: userCalculateKey, validateParams } = definition;
13813
- const widened = {
13814
- ...definition,
13815
- documentationLink: definition.documentationLink ?? null,
13816
- calculateKey: (params) => {
13817
- const disabled = params.disabled ?? false;
13818
- return `${userCalculateKey(params)}-disabled-${disabled}`;
13819
- },
13820
- schema: {
13821
- disabled: disabledEffectField,
13822
- ...definition.schema
13823
- }
13824
- };
13825
- const factory = (params = {}) => {
13826
- validateParams(params);
13827
- return {
13828
- definition: widened,
13829
- params,
13830
- effectKey: widened.calculateKey(params),
13831
- memoized: false
13832
- };
13833
- };
13834
- return factory;
13835
- };
13836
13905
  var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
13837
13906
  var getPreviewDomElement = () => {
13838
13907
  return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
@@ -14919,12 +14988,14 @@ var Internals = {
14919
14988
  SequenceManager,
14920
14989
  SequenceManagerRefContext,
14921
14990
  SequenceStackTracesUpdateContext,
14922
- wrapInSchema,
14991
+ baseSchema,
14923
14992
  sequenceSchema,
14924
14993
  SequenceWithoutSchema,
14925
14994
  sequenceStyleSchema,
14926
14995
  sequenceVisualStyleSchema,
14927
14996
  sequencePremountSchema,
14997
+ transformSchema,
14998
+ premountSchema,
14928
14999
  flattenActiveSchema,
14929
15000
  getFlatSchemaWithAllKeys,
14930
15001
  RemotionRootContexts,
@@ -15124,7 +15195,7 @@ var SeriesInner = (props2) => {
15124
15195
  })
15125
15196
  });
15126
15197
  };
15127
- var Series = Object.assign(wrapInSchema({
15198
+ var Series = Object.assign(withInteractivitySchema({
15128
15199
  Component: SeriesInner,
15129
15200
  componentIdentity: "dev.remotion.remotion.Series",
15130
15201
  schema: sequenceSchemaDefaultLayoutNone,
@@ -15714,6 +15785,7 @@ import { jsx as jsx82 } from "react/jsx-runtime";
15714
15785
  import { jsx as jsx92 } from "react/jsx-runtime";
15715
15786
  import { jsx as jsx102 } from "react/jsx-runtime";
15716
15787
  import { jsx as jsx112 } from "react/jsx-runtime";
15788
+ import { jsx as jsx122 } from "react/jsx-runtime";
15717
15789
  var unitDir = (from, to) => {
15718
15790
  const dx = to[0] - from[0];
15719
15791
  const dy = to[1] - from[1];
@@ -15857,6 +15929,7 @@ var doesReactSupportTransformOriginProperty = (version2) => {
15857
15929
  const [major] = version2.split(".").map(Number);
15858
15930
  return major > 18;
15859
15931
  };
15932
+ var HtmlInCanvasWithPrivateProps = HtmlInCanvas;
15860
15933
  var RenderSvg = ({
15861
15934
  defaultName,
15862
15935
  documentationLink,
@@ -15876,7 +15949,7 @@ var RenderSvg = ({
15876
15949
  hidden,
15877
15950
  name,
15878
15951
  showInTimeline,
15879
- _experimentalControls: controls,
15952
+ controls,
15880
15953
  stack,
15881
15954
  ...props
15882
15955
  }) => {
@@ -15963,7 +16036,7 @@ var RenderSvg = ({
15963
16036
  }) : null
15964
16037
  ]
15965
16038
  });
15966
- const content = effects.length === 0 ? svg : /* @__PURE__ */ jsx40(HtmlInCanvas, {
16039
+ const content = effects.length === 0 ? svg : /* @__PURE__ */ jsx40(HtmlInCanvasWithPrivateProps, {
15967
16040
  ref: setCanvasRef,
15968
16041
  width: Math.ceil(width),
15969
16042
  height: Math.ceil(height),
@@ -15971,7 +16044,7 @@ var RenderSvg = ({
15971
16044
  pixelDensity,
15972
16045
  showInTimeline: false,
15973
16046
  style: actualStyle,
15974
- _experimentalControls: controls,
16047
+ controls,
15975
16048
  children: svg
15976
16049
  });
15977
16050
  const stackProps = stack === undefined ? null : { stack };
@@ -15984,11 +16057,11 @@ var RenderSvg = ({
15984
16057
  freeze,
15985
16058
  hidden,
15986
16059
  showInTimeline,
15987
- _experimentalControls: controls,
16060
+ controls,
15988
16061
  _remotionInternalEffects: memoizedEffectDefinitions,
15989
16062
  durationInFrames,
15990
16063
  name: name ?? defaultName,
15991
- _remotionInternalRefForOutline: outlineRef,
16064
+ outlineRef,
15992
16065
  _remotionInternalDocumentationLink: name === undefined ? documentationLink : undefined,
15993
16066
  ...stackProps,
15994
16067
  children: content
@@ -16046,16 +16119,13 @@ var enumField = ({
16046
16119
  };
16047
16120
  var makeShapeSchema = (shapeFields) => {
16048
16121
  return {
16049
- from: Internals.sequenceSchema.from,
16050
- freeze: Internals.sequenceSchema.freeze,
16051
- durationInFrames: Internals.sequenceSchema.durationInFrames,
16122
+ ...Internals.baseSchema,
16052
16123
  ...shapeFields,
16053
16124
  fill: colorField({
16054
16125
  defaultValue: "#0b84ff",
16055
16126
  description: "Fill"
16056
16127
  }),
16057
- ...Internals.sequenceVisualStyleSchema,
16058
- hidden: Internals.sequenceSchema.hidden
16128
+ ...Internals.transformSchema
16059
16129
  };
16060
16130
  };
16061
16131
  var arrowSchema = makeShapeSchema({
@@ -16113,7 +16183,7 @@ var ArrowInner = ({
16113
16183
  ...props
16114
16184
  });
16115
16185
  };
16116
- var Arrow = Internals.wrapInSchema({
16186
+ var Arrow = Interactive.withSchema({
16117
16187
  Component: ArrowInner,
16118
16188
  componentIdentity: "dev.remotion.shapes.Arrow",
16119
16189
  schema: arrowSchema,
@@ -16537,7 +16607,7 @@ var CalloutInner = ({
16537
16607
  ...props
16538
16608
  });
16539
16609
  };
16540
- var Callout = Internals.wrapInSchema({
16610
+ var Callout = Interactive.withSchema({
16541
16611
  Component: CalloutInner,
16542
16612
  componentIdentity: "dev.remotion.shapes.Callout",
16543
16613
  schema: calloutSchema,
@@ -16599,7 +16669,7 @@ var CircleInner = ({ radius, ...props }) => {
16599
16669
  ...props
16600
16670
  });
16601
16671
  };
16602
- var Circle = Internals.wrapInSchema({
16672
+ var Circle = Interactive.withSchema({
16603
16673
  Component: CircleInner,
16604
16674
  componentIdentity: "dev.remotion.shapes.Circle",
16605
16675
  schema: circleSchema,
@@ -16656,7 +16726,7 @@ var EllipseInner = ({ rx, ry, ...props }) => {
16656
16726
  ...props
16657
16727
  });
16658
16728
  };
16659
- var Ellipse = Internals.wrapInSchema({
16729
+ var Ellipse = Interactive.withSchema({
16660
16730
  Component: EllipseInner,
16661
16731
  componentIdentity: "dev.remotion.shapes.Ellipse",
16662
16732
  schema: ellipseSchema,
@@ -16794,7 +16864,7 @@ var HeartInner = ({
16794
16864
  ...props
16795
16865
  });
16796
16866
  };
16797
- var Heart = Internals.wrapInSchema({
16867
+ var Heart = Interactive.withSchema({
16798
16868
  Component: HeartInner,
16799
16869
  componentIdentity: "dev.remotion.shapes.Heart",
16800
16870
  schema: heartSchema,
@@ -16948,7 +17018,7 @@ var PieInner = ({
16948
17018
  ...props
16949
17019
  });
16950
17020
  };
16951
- var Pie = Internals.wrapInSchema({
17021
+ var Pie = Interactive.withSchema({
16952
17022
  Component: PieInner,
16953
17023
  componentIdentity: "dev.remotion.shapes.Pie",
16954
17024
  schema: pieSchema,
@@ -17047,7 +17117,7 @@ var PolygonInner = ({
17047
17117
  ...props
17048
17118
  });
17049
17119
  };
17050
- var Polygon = Internals.wrapInSchema({
17120
+ var Polygon = Interactive.withSchema({
17051
17121
  Component: PolygonInner,
17052
17122
  componentIdentity: "dev.remotion.shapes.Polygon",
17053
17123
  schema: polygonSchema,
@@ -17113,13 +17183,224 @@ var RectInner = ({
17113
17183
  ...props
17114
17184
  });
17115
17185
  };
17116
- var Rect = Internals.wrapInSchema({
17186
+ var Rect = Interactive.withSchema({
17117
17187
  Component: RectInner,
17118
17188
  componentIdentity: "dev.remotion.shapes.Rect",
17119
17189
  schema: rectSchema,
17120
17190
  supportsEffects: true
17121
17191
  });
17122
17192
  Internals.addSequenceStackTraces(Rect);
17193
+ var KAPPA = 0.5522847498307936;
17194
+ var CAP_HANDLE = 4 / 3;
17195
+ var curve = ({
17196
+ to,
17197
+ cp1,
17198
+ cp2
17199
+ }) => {
17200
+ return {
17201
+ type: "C",
17202
+ cp1x: cp1[0],
17203
+ cp1y: cp1[1],
17204
+ cp2x: cp2[0],
17205
+ cp2y: cp2[1],
17206
+ x: to[0],
17207
+ y: to[1]
17208
+ };
17209
+ };
17210
+ var cap = ({
17211
+ from,
17212
+ to,
17213
+ radius,
17214
+ direction
17215
+ }) => {
17216
+ if (direction === "top") {
17217
+ return curve({
17218
+ to,
17219
+ cp1: [from[0], from[1] - radius * CAP_HANDLE],
17220
+ cp2: [to[0], to[1] - radius * CAP_HANDLE]
17221
+ });
17222
+ }
17223
+ if (direction === "right") {
17224
+ return curve({
17225
+ to,
17226
+ cp1: [from[0] + radius * CAP_HANDLE, from[1]],
17227
+ cp2: [to[0] + radius * CAP_HANDLE, to[1]]
17228
+ });
17229
+ }
17230
+ if (direction === "bottom") {
17231
+ return curve({
17232
+ to,
17233
+ cp1: [from[0], from[1] + radius * CAP_HANDLE],
17234
+ cp2: [to[0], to[1] + radius * CAP_HANDLE]
17235
+ });
17236
+ }
17237
+ return curve({
17238
+ to,
17239
+ cp1: [from[0] - radius * CAP_HANDLE, from[1]],
17240
+ cp2: [to[0] - radius * CAP_HANDLE, to[1]]
17241
+ });
17242
+ };
17243
+ var edge = ({
17244
+ from,
17245
+ to,
17246
+ edgeRoundness,
17247
+ direction
17248
+ }) => {
17249
+ const dx = to[0] - from[0];
17250
+ const dy = to[1] - from[1];
17251
+ const handleX = Math.abs(dx) * KAPPA * edgeRoundness;
17252
+ const handleY = Math.abs(dy) * KAPPA * edgeRoundness;
17253
+ if (direction === "top-right") {
17254
+ return curve({
17255
+ to,
17256
+ cp1: [from[0], from[1] + handleY],
17257
+ cp2: [to[0] - handleX, to[1]]
17258
+ });
17259
+ }
17260
+ if (direction === "right-bottom") {
17261
+ return curve({
17262
+ to,
17263
+ cp1: [from[0] - handleX, from[1]],
17264
+ cp2: [to[0], to[1] - handleY]
17265
+ });
17266
+ }
17267
+ if (direction === "bottom-left") {
17268
+ return curve({
17269
+ to,
17270
+ cp1: [from[0], from[1] - handleY],
17271
+ cp2: [to[0] + handleX, to[1]]
17272
+ });
17273
+ }
17274
+ return curve({
17275
+ to,
17276
+ cp1: [from[0] + handleX, from[1]],
17277
+ cp2: [to[0], to[1] + handleY]
17278
+ });
17279
+ };
17280
+ var clampCornerRadius = ({
17281
+ cornerRadius,
17282
+ width,
17283
+ height
17284
+ }) => {
17285
+ return Math.min(Math.max(cornerRadius, 0), width / 2, height / 2);
17286
+ };
17287
+ var makeSpark = ({
17288
+ width,
17289
+ height,
17290
+ edgeRoundness = 1,
17291
+ cornerRadius = 0
17292
+ }) => {
17293
+ const centerX = width / 2;
17294
+ const centerY = height / 2;
17295
+ const radius = clampCornerRadius({ cornerRadius, width, height });
17296
+ const top = [centerX, 0];
17297
+ const right = [width, centerY];
17298
+ const bottom = [centerX, height];
17299
+ const left = [0, centerY];
17300
+ const topRight = radius === 0 ? top : [centerX + radius, radius];
17301
+ const rightTop = radius === 0 ? right : [width - radius, centerY - radius];
17302
+ const rightBottom = radius === 0 ? right : [width - radius, centerY + radius];
17303
+ const bottomRight = radius === 0 ? bottom : [centerX + radius, height - radius];
17304
+ const bottomLeft = radius === 0 ? bottom : [centerX - radius, height - radius];
17305
+ const leftBottom = radius === 0 ? left : [radius, centerY + radius];
17306
+ const leftTop = radius === 0 ? left : [radius, centerY - radius];
17307
+ const topLeft = radius === 0 ? top : [centerX - radius, radius];
17308
+ const instructions = [
17309
+ {
17310
+ type: "M",
17311
+ x: topRight[0],
17312
+ y: topRight[1]
17313
+ },
17314
+ edge({
17315
+ from: topRight,
17316
+ to: rightTop,
17317
+ edgeRoundness,
17318
+ direction: "top-right"
17319
+ })
17320
+ ];
17321
+ if (radius > 0) {
17322
+ instructions.push(cap({ from: rightTop, to: rightBottom, radius, direction: "right" }));
17323
+ }
17324
+ instructions.push(edge({
17325
+ from: rightBottom,
17326
+ to: bottomRight,
17327
+ edgeRoundness,
17328
+ direction: "right-bottom"
17329
+ }));
17330
+ if (radius > 0) {
17331
+ instructions.push(cap({ from: bottomRight, to: bottomLeft, radius, direction: "bottom" }));
17332
+ }
17333
+ instructions.push(edge({
17334
+ from: bottomLeft,
17335
+ to: leftBottom,
17336
+ edgeRoundness,
17337
+ direction: "bottom-left"
17338
+ }));
17339
+ if (radius > 0) {
17340
+ instructions.push(cap({ from: leftBottom, to: leftTop, radius, direction: "left" }));
17341
+ }
17342
+ instructions.push(edge({
17343
+ from: leftTop,
17344
+ to: topLeft,
17345
+ edgeRoundness,
17346
+ direction: "left-top"
17347
+ }));
17348
+ if (radius > 0) {
17349
+ instructions.push(cap({ from: topLeft, to: topRight, radius, direction: "top" }));
17350
+ }
17351
+ instructions.push({ type: "Z" });
17352
+ return {
17353
+ path: serializeInstructions(instructions),
17354
+ width,
17355
+ height,
17356
+ transformOrigin: `${centerX} ${centerY}`,
17357
+ instructions
17358
+ };
17359
+ };
17360
+ var sparkSchema = makeShapeSchema({
17361
+ width: numberField({
17362
+ defaultValue: 100,
17363
+ description: "Width",
17364
+ min: 0
17365
+ }),
17366
+ height: numberField({
17367
+ defaultValue: 140,
17368
+ description: "Height",
17369
+ min: 0
17370
+ }),
17371
+ edgeRoundness: numberField({
17372
+ defaultValue: 1,
17373
+ description: "Edge Roundness",
17374
+ min: 0,
17375
+ step: 0.01
17376
+ }),
17377
+ cornerRadius: numberField({
17378
+ defaultValue: 0,
17379
+ description: "Corner Radius",
17380
+ min: 0
17381
+ })
17382
+ });
17383
+ var SparkInner = ({
17384
+ width,
17385
+ height,
17386
+ edgeRoundness,
17387
+ cornerRadius,
17388
+ ...props
17389
+ }) => {
17390
+ return /* @__PURE__ */ jsx102(RenderSvg, {
17391
+ defaultName: "<Spark>",
17392
+ documentationLink: "https://www.remotion.dev/docs/shapes/spark",
17393
+ ...makeSpark({ width, height, edgeRoundness, cornerRadius }),
17394
+ ...props
17395
+ });
17396
+ };
17397
+ var Spark = Interactive.withSchema({
17398
+ Component: SparkInner,
17399
+ componentIdentity: "dev.remotion.shapes.Spark",
17400
+ schema: sparkSchema,
17401
+ supportsEffects: true
17402
+ });
17403
+ Internals.addSequenceStackTraces(Spark);
17123
17404
  var star = ({
17124
17405
  centerX,
17125
17406
  centerY,
@@ -17210,7 +17491,7 @@ var StarInner = ({
17210
17491
  edgeRoundness,
17211
17492
  ...props
17212
17493
  }) => {
17213
- return /* @__PURE__ */ jsx102(RenderSvg, {
17494
+ return /* @__PURE__ */ jsx112(RenderSvg, {
17214
17495
  defaultName: "<Star>",
17215
17496
  documentationLink: "https://www.remotion.dev/docs/shapes/star",
17216
17497
  ...makeStar({
@@ -17223,7 +17504,7 @@ var StarInner = ({
17223
17504
  ...props
17224
17505
  });
17225
17506
  };
17226
- var Star = Internals.wrapInSchema({
17507
+ var Star = Interactive.withSchema({
17227
17508
  Component: StarInner,
17228
17509
  componentIdentity: "dev.remotion.shapes.Star",
17229
17510
  schema: starSchema,
@@ -17322,14 +17603,14 @@ var TriangleInner = ({
17322
17603
  cornerRadius,
17323
17604
  ...props
17324
17605
  }) => {
17325
- return /* @__PURE__ */ jsx112(RenderSvg, {
17606
+ return /* @__PURE__ */ jsx122(RenderSvg, {
17326
17607
  defaultName: "<Triangle>",
17327
17608
  documentationLink: "https://www.remotion.dev/docs/shapes/triangle",
17328
17609
  ...makeTriangle({ length: length2, direction, edgeRoundness, cornerRadius }),
17329
17610
  ...props
17330
17611
  });
17331
17612
  };
17332
- var Triangle = Internals.wrapInSchema({
17613
+ var Triangle = Interactive.withSchema({
17333
17614
  Component: TriangleInner,
17334
17615
  componentIdentity: "dev.remotion.shapes.Triangle",
17335
17616
  schema: triangleSchema,
@@ -17795,18 +18076,18 @@ function arcToCircle2({
17795
18076
  result.push(approximate_unit_arc2(theta1, delta_theta));
17796
18077
  theta1 += delta_theta;
17797
18078
  }
17798
- return result.map((curve) => {
17799
- for (let i = 0;i < curve.length; i += 2) {
17800
- let x = curve[i + 0];
17801
- let y = curve[i + 1];
18079
+ return result.map((curve2) => {
18080
+ for (let i = 0;i < curve2.length; i += 2) {
18081
+ let x = curve2[i + 0];
18082
+ let y = curve2[i + 1];
17802
18083
  x *= rx;
17803
18084
  y *= ry;
17804
18085
  const xp = cos_phi * x - sin_phi * y;
17805
18086
  const yp = sin_phi * x + cos_phi * y;
17806
- curve[i + 0] = xp + cc[0];
17807
- curve[i + 1] = yp + cc[1];
18087
+ curve2[i + 0] = xp + cc[0];
18088
+ curve2[i + 1] = yp + cc[1];
17808
18089
  }
17809
- return curve;
18090
+ return curve2;
17810
18091
  });
17811
18092
  }
17812
18093
  var removeATSHVQInstructions2 = (segments) => {
@@ -18413,7 +18694,7 @@ import { jsx as jsx93 } from "react/jsx-runtime";
18413
18694
  import React72 from "react";
18414
18695
  import { jsx as jsx103 } from "react/jsx-runtime";
18415
18696
  import { jsx as jsx113 } from "react/jsx-runtime";
18416
- import { jsx as jsx122 } from "react/jsx-runtime";
18697
+ import { jsx as jsx123 } from "react/jsx-runtime";
18417
18698
  import * as React36 from "react";
18418
18699
  import * as ReactDOM4 from "react-dom";
18419
18700
  import React112 from "react";
@@ -19227,11 +19508,11 @@ var Link = ({
19227
19508
  });
19228
19509
  };
19229
19510
  var PlanePaperIcon = (props) => {
19230
- return /* @__PURE__ */ jsx122("svg", {
19511
+ return /* @__PURE__ */ jsx123("svg", {
19231
19512
  xmlns: "http://www.w3.org/2000/svg",
19232
19513
  ...props,
19233
19514
  viewBox: "0 0 576 512",
19234
- children: /* @__PURE__ */ jsx122("path", {
19515
+ children: /* @__PURE__ */ jsx123("path", {
19235
19516
  fill: "currentcolor",
19236
19517
  d: "M169.9 280L94.9 448.6 461.2 280 169.9 280zm291.3-48L94.9 63.4 169.9 232 461.2 232zM34.8 465.6L128 256 34.8 46.4C33 42.2 32 37.6 32 33 32 14.8 46.7 0 64.8 0 69.5 0 74.2 1 78.5 3L554.2 222c13.3 6.1 21.8 19.4 21.8 34s-8.5 27.9-21.8 34L78.5 509c-4.3 2-9 3-13.7 3-18.1 0-32.8-14.8-32.8-33 0-4.6 1-9.2 2.8-13.4z"
19237
19518
  })