@remotion/promo-pages 4.0.499 → 4.0.500

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
@@ -1378,7 +1378,7 @@ var getDefaultConfig = () => {
1378
1378
  var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
1379
1379
 
1380
1380
  // ../design/dist/esm/index.mjs
1381
- import React33, { useEffect as useEffect21, useMemo as useMemo43, useState as useState23 } from "react";
1381
+ import React33, { useEffect as useEffect21, useMemo as useMemo44, useState as useState23 } from "react";
1382
1382
 
1383
1383
  // ../paths/dist/esm/index.mjs
1384
1384
  var cutLInstruction = ({
@@ -4214,8 +4214,9 @@ import {
4214
4214
  useRef as useRef9,
4215
4215
  useState as useState6
4216
4216
  } from "react";
4217
- import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo17, useRef as useRef8 } from "react";
4218
- import { useEffect as useEffect4, useMemo as useMemo16, useRef as useRef7 } from "react";
4217
+ import { useMemo as useMemo16 } from "react";
4218
+ import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo18, useRef as useRef8 } from "react";
4219
+ import { useEffect as useEffect4, useMemo as useMemo17, useRef as useRef7 } from "react";
4219
4220
  import { jsx as jsx13 } from "react/jsx-runtime";
4220
4221
  import { jsx as jsx14 } from "react/jsx-runtime";
4221
4222
  import { useContext as useContext19, useLayoutEffect as useLayoutEffect4, useState as useState8 } from "react";
@@ -4224,18 +4225,18 @@ import {
4224
4225
  useCallback as useCallback8,
4225
4226
  useImperativeHandle as useImperativeHandle3,
4226
4227
  useLayoutEffect as useLayoutEffect3,
4227
- useMemo as useMemo18,
4228
+ useMemo as useMemo19,
4228
4229
  useRef as useRef10,
4229
4230
  useState as useState7
4230
4231
  } from "react";
4231
4232
  import { jsx as jsx15 } from "react/jsx-runtime";
4232
4233
  import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as useContext31 } from "react";
4233
- import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
4234
+ import React17, { createContext as createContext18, useMemo as useMemo20 } from "react";
4234
4235
  import { jsx as jsx16 } from "react/jsx-runtime";
4235
4236
  import { useContext as useContext20 } from "react";
4236
4237
  import { createContext as createContext19, useEffect as useEffect6, useState as useState9 } from "react";
4237
4238
  import { jsx as jsx17 } from "react/jsx-runtime";
4238
- import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
4239
+ import { createContext as createContext20, useMemo as useMemo21, useReducer } from "react";
4239
4240
  import { jsx as jsx18 } from "react/jsx-runtime";
4240
4241
  import { useCallback as useCallback13 } from "react";
4241
4242
  import React23, {
@@ -4243,7 +4244,7 @@ import React23, {
4243
4244
  useContext as useContext29,
4244
4245
  useEffect as useEffect14,
4245
4246
  useImperativeHandle as useImperativeHandle4,
4246
- useMemo as useMemo28,
4247
+ useMemo as useMemo29,
4247
4248
  useRef as useRef19,
4248
4249
  useState as useState14
4249
4250
  } from "react";
@@ -4254,14 +4255,14 @@ import React20, {
4254
4255
  useCallback as useCallback9,
4255
4256
  useContext as useContext21,
4256
4257
  useEffect as useEffect7,
4257
- useMemo as useMemo22,
4258
+ useMemo as useMemo23,
4258
4259
  useRef as useRef12,
4259
4260
  useState as useState10
4260
4261
  } from "react";
4261
- import { useMemo as useMemo21, useRef as useRef11 } from "react";
4262
+ import { useMemo as useMemo22, useRef as useRef11 } from "react";
4262
4263
  import { jsx as jsx19, jsxs as jsxs2 } from "react/jsx-runtime";
4263
4264
  import { useRef as useRef13 } from "react";
4264
- import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState11 } from "react";
4265
+ import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo24, useState as useState11 } from "react";
4265
4266
  import { useContext as useContext23 } from "react";
4266
4267
  import {
4267
4268
  useCallback as useCallback12,
@@ -4270,14 +4271,14 @@ import {
4270
4271
  useLayoutEffect as useLayoutEffect7,
4271
4272
  useRef as useRef18
4272
4273
  } from "react";
4273
- import { useCallback as useCallback11, useMemo as useMemo26, useRef as useRef16 } from "react";
4274
- import { useContext as useContext26, useMemo as useMemo25 } from "react";
4274
+ import { useCallback as useCallback11, useMemo as useMemo27, useRef as useRef16 } from "react";
4275
+ import { useContext as useContext26, useMemo as useMemo26 } from "react";
4275
4276
  import React21, {
4276
4277
  useCallback as useCallback10,
4277
4278
  useContext as useContext25,
4278
4279
  useEffect as useEffect9,
4279
4280
  useLayoutEffect as useLayoutEffect6,
4280
- useMemo as useMemo24,
4281
+ useMemo as useMemo25,
4281
4282
  useRef as useRef15,
4282
4283
  useState as useState12
4283
4284
  } from "react";
@@ -4286,7 +4287,7 @@ import React22 from "react";
4286
4287
  import { useEffect as useEffect10, useState as useState13 } from "react";
4287
4288
  import { useEffect as useEffect11, useRef as useRef17 } from "react";
4288
4289
  import { useEffect as useEffect13 } from "react";
4289
- import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
4290
+ import { createContext as createContext22, useContext as useContext28, useMemo as useMemo28 } from "react";
4290
4291
  import { jsx as jsx21 } from "react/jsx-runtime";
4291
4292
  import {
4292
4293
  forwardRef as forwardRef6,
@@ -4294,7 +4295,7 @@ import {
4294
4295
  useEffect as useEffect15,
4295
4296
  useImperativeHandle as useImperativeHandle5,
4296
4297
  useLayoutEffect as useLayoutEffect8,
4297
- useMemo as useMemo29,
4298
+ useMemo as useMemo30,
4298
4299
  useRef as useRef20
4299
4300
  } from "react";
4300
4301
  import { jsx as jsx22 } from "react/jsx-runtime";
@@ -4304,7 +4305,7 @@ import {
4304
4305
  useCallback as useCallback15,
4305
4306
  useEffect as useEffect16,
4306
4307
  useImperativeHandle as useImperativeHandle6,
4307
- useMemo as useMemo30,
4308
+ useMemo as useMemo31,
4308
4309
  useRef as useRef21,
4309
4310
  useState as useState15
4310
4311
  } from "react";
@@ -4315,7 +4316,7 @@ import {
4315
4316
  useCallback as useCallback16,
4316
4317
  useContext as useContext32,
4317
4318
  useLayoutEffect as useLayoutEffect9,
4318
- useMemo as useMemo31,
4319
+ useMemo as useMemo32,
4319
4320
  useRef as useRef22
4320
4321
  } from "react";
4321
4322
  import { jsx as jsx25 } from "react/jsx-runtime";
@@ -4325,7 +4326,7 @@ import {
4325
4326
  useContext as useContext33,
4326
4327
  useImperativeHandle as useImperativeHandle7,
4327
4328
  useLayoutEffect as useLayoutEffect10,
4328
- useMemo as useMemo32,
4329
+ useMemo as useMemo33,
4329
4330
  useRef as useRef23,
4330
4331
  useState as useState16
4331
4332
  } from "react";
@@ -4347,14 +4348,14 @@ import React31 from "react";
4347
4348
  import {
4348
4349
  useCallback as useCallback21,
4349
4350
  useImperativeHandle as useImperativeHandle8,
4350
- useMemo as useMemo33,
4351
+ useMemo as useMemo34,
4351
4352
  useRef as useRef26,
4352
4353
  useState as useState19
4353
4354
  } from "react";
4354
4355
  import { jsx as jsx30 } from "react/jsx-runtime";
4355
4356
  import React32 from "react";
4356
- import { useMemo as useMemo35 } from "react";
4357
- import { createContext as createContext24, useContext as useContext35, useMemo as useMemo34 } from "react";
4357
+ import { useMemo as useMemo36 } from "react";
4358
+ import { createContext as createContext24, useContext as useContext35, useMemo as useMemo35 } from "react";
4358
4359
  import { jsx as jsx31 } from "react/jsx-runtime";
4359
4360
  import { jsx as jsx32 } from "react/jsx-runtime";
4360
4361
  import React34 from "react";
@@ -4366,7 +4367,7 @@ import {
4366
4367
  useContext as useContext37,
4367
4368
  useEffect as useEffect17,
4368
4369
  useLayoutEffect as useLayoutEffect12,
4369
- useMemo as useMemo36,
4370
+ useMemo as useMemo37,
4370
4371
  useState as useState20
4371
4372
  } from "react";
4372
4373
  import { jsx as jsx33 } from "react/jsx-runtime";
@@ -4376,18 +4377,18 @@ import React38, {
4376
4377
  useContext as useContext38,
4377
4378
  useEffect as useEffect19,
4378
4379
  useImperativeHandle as useImperativeHandle9,
4379
- useMemo as useMemo37,
4380
+ useMemo as useMemo38,
4380
4381
  useRef as useRef27,
4381
4382
  useState as useState21
4382
4383
  } from "react";
4383
4384
  import { useEffect as useEffect18 } from "react";
4384
4385
  import { jsx as jsx34 } from "react/jsx-runtime";
4385
4386
  import { jsx as jsx35 } from "react/jsx-runtime";
4386
- import React40, { useMemo as useMemo38 } from "react";
4387
+ import React40, { useMemo as useMemo39 } from "react";
4387
4388
  import { jsx as jsx36 } from "react/jsx-runtime";
4388
4389
  import React42, {
4389
4390
  forwardRef as forwardRef14,
4390
- useMemo as useMemo39
4391
+ useMemo as useMemo40
4391
4392
  } from "react";
4392
4393
  import React41 from "react";
4393
4394
  import { jsx as jsx37, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
@@ -4399,7 +4400,7 @@ import {
4399
4400
  useEffect as useEffect20,
4400
4401
  useImperativeHandle as useImperativeHandle10,
4401
4402
  useLayoutEffect as useLayoutEffect13,
4402
- useMemo as useMemo40,
4403
+ useMemo as useMemo41,
4403
4404
  useRef as useRef28
4404
4405
  } from "react";
4405
4406
  import { jsx as jsx38 } from "react/jsx-runtime";
@@ -5579,7 +5580,7 @@ var getSingleChildComponent = (children) => {
5579
5580
  }
5580
5581
  return child.type;
5581
5582
  };
5582
- var VERSION = "4.0.499";
5583
+ var VERSION = "4.0.500";
5583
5584
  var checkMultipleRemotionVersions = () => {
5584
5585
  if (typeof globalThis === "undefined") {
5585
5586
  return;
@@ -5621,38 +5622,6 @@ __export2(exports_timeline_position_state, {
5621
5622
  getFrameForComposition: () => getFrameForComposition,
5622
5623
  clampFrameToCompositionRange: () => clampFrameToCompositionRange
5623
5624
  });
5624
- function mulberry32(a) {
5625
- let t = a + 1831565813;
5626
- t = Math.imul(t ^ t >>> 15, t | 1);
5627
- t ^= t + Math.imul(t ^ t >>> 7, t | 61);
5628
- return ((t ^ t >>> 14) >>> 0) / 4294967296;
5629
- }
5630
- function hashCode(str) {
5631
- let i = 0;
5632
- let chr = 0;
5633
- let hash = 0;
5634
- for (i = 0;i < str.length; i++) {
5635
- chr = str.charCodeAt(i);
5636
- hash = (hash << 5) - hash + chr;
5637
- hash |= 0;
5638
- }
5639
- return hash;
5640
- }
5641
- var random = (seed, dummy) => {
5642
- if (dummy !== undefined) {
5643
- throw new TypeError("random() takes only one argument");
5644
- }
5645
- if (seed === null) {
5646
- return Math.random();
5647
- }
5648
- if (typeof seed === "string") {
5649
- return mulberry32(hashCode(seed));
5650
- }
5651
- if (typeof seed === "number") {
5652
- return mulberry32(seed * 10000000000);
5653
- }
5654
- throw new Error("random() argument must be a number or a string");
5655
- };
5656
5625
  var SetTimelineContext = createContext13({
5657
5626
  setFrame: () => {
5658
5627
  throw new Error("default");
@@ -5669,7 +5638,6 @@ var TimelineContextProvider = ({ children, frameState }) => {
5669
5638
  const imperativePlaying = useRef3(false);
5670
5639
  const [playbackRate, setPlaybackRate] = useState2(1);
5671
5640
  const audioAndVideoTags = useRef3([]);
5672
- const [remotionRootId] = useState2(() => String(random(null)));
5673
5641
  const [_frame, setFrame] = useState2(() => getInitialFrameState());
5674
5642
  const frame = frameState ?? _frame;
5675
5643
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
@@ -5704,10 +5672,9 @@ var TimelineContextProvider = ({ children, frameState }) => {
5704
5672
  frame,
5705
5673
  playing,
5706
5674
  imperativePlaying,
5707
- rootId: remotionRootId,
5708
5675
  audioAndVideoTags
5709
5676
  };
5710
- }, [frame, playing, remotionRootId]);
5677
+ }, [frame, playing]);
5711
5678
  const playbackRateContextValue = useMemo8(() => {
5712
5679
  return {
5713
5680
  playbackRate,
@@ -6096,6 +6063,29 @@ var backgroundSchema = {
6096
6063
  description: "Color"
6097
6064
  }
6098
6065
  };
6066
+ var svgStrokeSchema = {
6067
+ stroke: {
6068
+ type: "color",
6069
+ default: "none",
6070
+ description: "Stroke"
6071
+ },
6072
+ strokeWidth: {
6073
+ type: "number",
6074
+ default: 1,
6075
+ description: "Stroke width",
6076
+ min: 0,
6077
+ step: 1,
6078
+ hiddenFromList: false
6079
+ }
6080
+ };
6081
+ var svgPaintSchema = {
6082
+ fill: {
6083
+ type: "color",
6084
+ default: undefined,
6085
+ description: "Fill"
6086
+ },
6087
+ ...svgStrokeSchema
6088
+ };
6099
6089
  var textContentSchema = {
6100
6090
  children: {
6101
6091
  type: "text-content",
@@ -6126,7 +6116,51 @@ var premountSchema = {
6126
6116
  var sequencePremountSchema = {
6127
6117
  ...premountSchema
6128
6118
  };
6119
+ var cropSchema = {
6120
+ cropLeft: {
6121
+ type: "number",
6122
+ default: 0,
6123
+ description: "Crop left",
6124
+ min: 0,
6125
+ max: 1,
6126
+ step: 0.01,
6127
+ hiddenFromList: false,
6128
+ keyframable: true
6129
+ },
6130
+ cropRight: {
6131
+ type: "number",
6132
+ default: 0,
6133
+ description: "Crop right",
6134
+ min: 0,
6135
+ max: 1,
6136
+ step: 0.01,
6137
+ hiddenFromList: false,
6138
+ keyframable: true
6139
+ },
6140
+ cropTop: {
6141
+ type: "number",
6142
+ default: 0,
6143
+ description: "Crop top",
6144
+ min: 0,
6145
+ max: 1,
6146
+ step: 0.01,
6147
+ hiddenFromList: false,
6148
+ keyframable: true
6149
+ },
6150
+ cropBottom: {
6151
+ type: "number",
6152
+ default: 0,
6153
+ description: "Crop bottom",
6154
+ min: 0,
6155
+ max: 1,
6156
+ step: 0.01,
6157
+ hiddenFromList: false,
6158
+ keyframable: true
6159
+ }
6160
+ };
6161
+ var sequenceCropSchema = cropSchema;
6129
6162
  var sequenceStyleSchema = {
6163
+ ...sequenceCropSchema,
6130
6164
  ...transformSchema,
6131
6165
  ...backgroundSchema,
6132
6166
  ...borderSchema,
@@ -6215,6 +6249,54 @@ var sequenceSchemaDefaultLayoutNone = {
6215
6249
  default: "none"
6216
6250
  }
6217
6251
  };
6252
+ var clampCrop = (value) => {
6253
+ return Math.min(1, Math.max(0, value ?? 0));
6254
+ };
6255
+ var resolveAxis = (start, end) => {
6256
+ const resolvedStart = clampCrop(start);
6257
+ const resolvedEnd = clampCrop(end);
6258
+ if (resolvedStart + resolvedEnd > 1) {
6259
+ return [0.5, 0.5];
6260
+ }
6261
+ return [resolvedStart, resolvedEnd];
6262
+ };
6263
+ var resolveSequenceCrop = ({
6264
+ cropLeft,
6265
+ cropRight,
6266
+ cropTop,
6267
+ cropBottom
6268
+ }) => {
6269
+ const [left, right] = resolveAxis(cropLeft, cropRight);
6270
+ const [top, bottom] = resolveAxis(cropTop, cropBottom);
6271
+ return { left, right, top, bottom };
6272
+ };
6273
+ var getSequenceCropClipPath = ({
6274
+ left,
6275
+ right,
6276
+ top,
6277
+ bottom,
6278
+ borderRadius
6279
+ }) => {
6280
+ if (left === 0 && right === 0 && top === 0 && bottom === 0) {
6281
+ return null;
6282
+ }
6283
+ const serializedBorderRadius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
6284
+ const rounded = serializedBorderRadius ? ` round ${serializedBorderRadius}` : "";
6285
+ return `inset(${top * 100}% ${right * 100}% ${bottom * 100}% ${left * 100}%${rounded})`;
6286
+ };
6287
+ var validateSequenceCrop = (crop, componentName = "<Sequence />") => {
6288
+ for (const [name, value] of Object.entries(crop)) {
6289
+ if (value === undefined) {
6290
+ continue;
6291
+ }
6292
+ if (typeof value !== "number" || !Number.isFinite(value)) {
6293
+ throw new TypeError(`The "${name}" prop of ${componentName} must be a finite number, but got ${String(value)}.`);
6294
+ }
6295
+ if (value < 0 || value > 1) {
6296
+ throw new RangeError(`The "${name}" prop of ${componentName} must be between 0 and 1, but got ${value}.`);
6297
+ }
6298
+ }
6299
+ };
6218
6300
  var SequenceManager = React12.createContext({
6219
6301
  registerSequence: () => {
6220
6302
  throw new Error("SequenceManagerContext not initialized");
@@ -8634,7 +8716,7 @@ var withInteractivitySchema = ({
8634
8716
  const flatKeys = Object.keys(flatSchema);
8635
8717
  const Wrapped = forwardRef2((props, ref) => {
8636
8718
  const env = useRemotionEnvironment();
8637
- if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
8719
+ if (!env.isStudio || env.isRendering) {
8638
8720
  return React14.createElement(Component, {
8639
8721
  ...props,
8640
8722
  controls: null,
@@ -8664,7 +8746,7 @@ var withInteractivitySchema = ({
8664
8746
  stackToOverrideMap[stack] = newOverrideId;
8665
8747
  return newOverrideId;
8666
8748
  });
8667
- const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
8749
+ const nodePath = env.isReadOnlyStudio ? null : nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
8668
8750
  const runtimeValues = flatKeys.map((key) => getRuntimeValueForSchemaKey({
8669
8751
  flatSchema,
8670
8752
  key,
@@ -8735,17 +8817,32 @@ var RegularSequenceRefForwardingFunction = ({
8735
8817
  _remotionInternalPostmountDisplay: postmountDisplay,
8736
8818
  _remotionInternalIsMedia: isMedia,
8737
8819
  outlineRef: passedRefForOutline,
8820
+ cropLeft,
8821
+ cropRight,
8822
+ cropTop,
8823
+ cropBottom,
8738
8824
  ...other
8739
8825
  }, ref) => {
8740
8826
  const { layout = "absolute-fill" } = other;
8741
8827
  const [id] = useState5(() => String(Math.random()));
8742
8828
  const parentSequence = useContext18(SequenceContext);
8743
- const { rootId } = useTimelineContext();
8744
8829
  const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
8745
8830
  const nonce = useNonce();
8746
8831
  if (layout !== "absolute-fill" && layout !== "none") {
8747
8832
  throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
8748
8833
  }
8834
+ const cropProps = { cropLeft, cropRight, cropTop, cropBottom };
8835
+ const hasCropProp = Object.values(cropProps).some((value) => value !== undefined);
8836
+ if (layout === "none" && hasCropProp) {
8837
+ throw new TypeError('The cropLeft, cropRight, cropTop and cropBottom props of <Sequence /> are only supported with layout="absolute-fill".');
8838
+ }
8839
+ validateSequenceCrop(cropProps);
8840
+ const {
8841
+ left: resolvedCropLeft,
8842
+ right: resolvedCropRight,
8843
+ top: resolvedCropTop,
8844
+ bottom: resolvedCropBottom
8845
+ } = resolveSequenceCrop(cropProps);
8749
8846
  if (layout === "none" && typeof other.style !== "undefined") {
8750
8847
  throw new TypeError('If layout="none", you may not pass a style. Passed: ' + JSON.stringify(other.style));
8751
8848
  }
@@ -8871,7 +8968,6 @@ var RegularSequenceRefForwardingFunction = ({
8871
8968
  parent: parentSequence?.id ?? null,
8872
8969
  postmountDisplay: postmountDisplay ?? null,
8873
8970
  premountDisplay: premountDisplay ?? null,
8874
- rootId,
8875
8971
  showInTimeline,
8876
8972
  src: isMedia.src,
8877
8973
  getStack: () => stackRef.current,
@@ -8898,7 +8994,6 @@ var RegularSequenceRefForwardingFunction = ({
8898
8994
  playbackRate: isMedia.data.playbackRate,
8899
8995
  postmountDisplay: postmountDisplay ?? null,
8900
8996
  premountDisplay: premountDisplay ?? null,
8901
- rootId,
8902
8997
  showInTimeline,
8903
8998
  src: isMedia.data.src,
8904
8999
  getStack: () => stackRef.current,
@@ -8925,7 +9020,6 @@ var RegularSequenceRefForwardingFunction = ({
8925
9020
  documentationLink: resolvedDocumentationLink,
8926
9021
  parent: parentSequence?.id ?? null,
8927
9022
  type: "sequence",
8928
- rootId,
8929
9023
  showInTimeline,
8930
9024
  nonce: nonce.get(),
8931
9025
  loopDisplay,
@@ -8951,7 +9045,6 @@ var RegularSequenceRefForwardingFunction = ({
8951
9045
  unregisterSequence,
8952
9046
  parentSequence?.id,
8953
9047
  actualDurationInFrames,
8954
- rootId,
8955
9048
  from,
8956
9049
  trimBefore,
8957
9050
  registeredTrimBefore,
@@ -8980,6 +9073,13 @@ var RegularSequenceRefForwardingFunction = ({
8980
9073
  children: content
8981
9074
  });
8982
9075
  const styleIfThere = other.layout === "none" ? undefined : other.style;
9076
+ const cropClipPath = getSequenceCropClipPath({
9077
+ left: resolvedCropLeft,
9078
+ right: resolvedCropRight,
9079
+ top: resolvedCropTop,
9080
+ bottom: resolvedCropBottom,
9081
+ borderRadius: styleIfThere?.borderRadius
9082
+ });
8983
9083
  const sequenceRef = useCallback6((node) => {
8984
9084
  wrapperRefForOutline.current = node;
8985
9085
  if (typeof ref === "function") {
@@ -8993,9 +9093,12 @@ var RegularSequenceRefForwardingFunction = ({
8993
9093
  flexDirection: undefined,
8994
9094
  ...width ? { width } : {},
8995
9095
  ...height ? { height } : {},
8996
- ...styleIfThere ?? {}
9096
+ ...styleIfThere ?? {},
9097
+ ...cropClipPath ? {
9098
+ clipPath: cropClipPath
9099
+ } : {}
8997
9100
  };
8998
- }, [height, styleIfThere, width]);
9101
+ }, [cropClipPath, height, styleIfThere, width]);
8999
9102
  if (ref !== null && layout === "none") {
9000
9103
  throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
9001
9104
  }
@@ -9094,6 +9197,26 @@ var SequenceWithoutFrom = withInteractivitySchema({
9094
9197
  schema: sequenceSchemaWithoutFrom,
9095
9198
  supportsEffects: false
9096
9199
  });
9200
+ var useCropStyle = ({
9201
+ cropLeft,
9202
+ cropRight,
9203
+ cropTop,
9204
+ cropBottom,
9205
+ style,
9206
+ componentName
9207
+ }) => {
9208
+ validateSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }, componentName);
9209
+ return useMemo16(() => {
9210
+ const cropClipPath = getSequenceCropClipPath({
9211
+ ...resolveSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }),
9212
+ borderRadius: style?.borderRadius
9213
+ });
9214
+ if (cropClipPath === null) {
9215
+ return style;
9216
+ }
9217
+ return { ...style, clipPath: cropClipPath };
9218
+ }, [cropBottom, cropLeft, cropRight, cropTop, style]);
9219
+ };
9097
9220
  var calculateImageFit = (fit, imageSize, canvasSize) => {
9098
9221
  switch (fit) {
9099
9222
  case "fill": {
@@ -9386,7 +9509,7 @@ var useEffectChainState = () => {
9386
9509
  }
9387
9510
  };
9388
9511
  }, []);
9389
- return useMemo16(() => ({
9512
+ return useMemo17(() => ({
9390
9513
  get: (width, height) => {
9391
9514
  if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
9392
9515
  if (chainStateRef.current) {
@@ -9402,7 +9525,7 @@ var useEffectChainState = () => {
9402
9525
  var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, ...props }, ref) => {
9403
9526
  const canvasRef = useRef8(null);
9404
9527
  const chainState = useEffectChainState();
9405
- const sourceCanvas = useMemo17(() => {
9528
+ const sourceCanvas = useMemo18(() => {
9406
9529
  if (typeof document === "undefined") {
9407
9530
  return null;
9408
9531
  }
@@ -9664,6 +9787,7 @@ var animatedImageSchema = {
9664
9787
  keyframable: false
9665
9788
  },
9666
9789
  ...baseSchema,
9790
+ ...cropSchema,
9667
9791
  ...premountSchema,
9668
9792
  playbackRate: {
9669
9793
  type: "number",
@@ -9858,6 +9982,10 @@ var AnimatedImageInner = ({
9858
9982
  postmountFor,
9859
9983
  styleWhilePremounted,
9860
9984
  styleWhilePostmounted,
9985
+ cropLeft,
9986
+ cropRight,
9987
+ cropTop,
9988
+ cropBottom,
9861
9989
  requestInit,
9862
9990
  effects = [],
9863
9991
  controls,
@@ -9887,6 +10015,14 @@ var AnimatedImageInner = ({
9887
10015
  styleWhilePostmounted: styleWhilePostmounted ?? null,
9888
10016
  hideWhilePremounted: "display-none"
9889
10017
  });
10018
+ const croppedStyle = useCropStyle({
10019
+ cropLeft,
10020
+ cropRight,
10021
+ cropTop,
10022
+ cropBottom,
10023
+ style: premountingStyle,
10024
+ componentName: "<AnimatedImage />"
10025
+ });
9890
10026
  const canvasProps = getCanvasPropsFromSequenceProps(sequenceProps);
9891
10027
  const animatedImageProps = {
9892
10028
  src,
@@ -9898,7 +10034,7 @@ var AnimatedImageInner = ({
9898
10034
  loopBehavior,
9899
10035
  id,
9900
10036
  className,
9901
- style: premountingStyle ?? undefined,
10037
+ style: croppedStyle ?? undefined,
9902
10038
  requestInit,
9903
10039
  ...canvasProps
9904
10040
  };
@@ -10039,7 +10175,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
10039
10175
  };
10040
10176
  }
10041
10177
  }, []);
10042
- const contextValue = useMemo18(() => {
10178
+ const contextValue = useMemo19(() => {
10043
10179
  return {
10044
10180
  registerRenderAsset,
10045
10181
  unregisterRenderAsset,
@@ -10168,14 +10304,14 @@ var Loop = ({
10168
10304
  const iteration = Math.floor(currentFrame / durationInFrames);
10169
10305
  const start = iteration * durationInFrames;
10170
10306
  const from = Math.min(start, maxFrame);
10171
- const loopDisplay = useMemo19(() => {
10307
+ const loopDisplay = useMemo20(() => {
10172
10308
  return {
10173
10309
  numberOfTimes: Math.min(compDuration / durationInFrames, times),
10174
10310
  startOffset: -from,
10175
10311
  durationInFrames
10176
10312
  };
10177
10313
  }, [compDuration, durationInFrames, from, times]);
10178
- const loopContext = useMemo19(() => {
10314
+ const loopContext = useMemo20(() => {
10179
10315
  return {
10180
10316
  iteration: Math.floor(currentFrame / durationInFrames),
10181
10317
  durationInFrames
@@ -10547,7 +10683,7 @@ var DurationsContext = createContext20({
10547
10683
  });
10548
10684
  var DurationsContextProvider = ({ children }) => {
10549
10685
  const [durations, setDurations] = useReducer(durationReducer, {});
10550
- const value = useMemo20(() => {
10686
+ const value = useMemo21(() => {
10551
10687
  return {
10552
10688
  durations,
10553
10689
  setDurations
@@ -10574,6 +10710,38 @@ var getCrossOriginValue = ({
10574
10710
  }
10575
10711
  return;
10576
10712
  };
10713
+ function mulberry32(a2) {
10714
+ let t = a2 + 1831565813;
10715
+ t = Math.imul(t ^ t >>> 15, t | 1);
10716
+ t ^= t + Math.imul(t ^ t >>> 7, t | 61);
10717
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
10718
+ }
10719
+ function hashCode(str) {
10720
+ let i = 0;
10721
+ let chr = 0;
10722
+ let hash = 0;
10723
+ for (i = 0;i < str.length; i++) {
10724
+ chr = str.charCodeAt(i);
10725
+ hash = (hash << 5) - hash + chr;
10726
+ hash |= 0;
10727
+ }
10728
+ return hash;
10729
+ }
10730
+ var random = (seed, dummy) => {
10731
+ if (dummy !== undefined) {
10732
+ throw new TypeError("random() takes only one argument");
10733
+ }
10734
+ if (seed === null) {
10735
+ return Math.random();
10736
+ }
10737
+ if (typeof seed === "string") {
10738
+ return mulberry32(hashCode(seed));
10739
+ }
10740
+ if (typeof seed === "number") {
10741
+ return mulberry32(seed * 10000000000);
10742
+ }
10743
+ throw new Error("random() argument must be a number or a string");
10744
+ };
10577
10745
  var playAndHandleNotAllowedError = ({
10578
10746
  mediaRef,
10579
10747
  mediaType,
@@ -10690,7 +10858,7 @@ var useSingletonAudioContext = ({
10690
10858
  if (sampleRate !== initialSampleRate.current) {
10691
10859
  throw new Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${initialSampleRate.current} Hz, but ${sampleRate} Hz was passed later.`);
10692
10860
  }
10693
- const context = useMemo21(() => {
10861
+ const context = useMemo22(() => {
10694
10862
  if (env.isRendering) {
10695
10863
  return null;
10696
10864
  }
@@ -10824,9 +10992,9 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
10824
10992
  });
10825
10993
  const audioContextIsPlayingEventually = useRef12(false);
10826
10994
  const isResuming = useRef12(null);
10827
- const audioSyncAnchor = useMemo22(() => ({ value: 0 }), []);
10995
+ const audioSyncAnchor = useMemo23(() => ({ value: 0 }), []);
10828
10996
  const audioSyncAnchorListeners = useRef12([]);
10829
- const audioSyncAnchorEmitter = useMemo22(() => {
10997
+ const audioSyncAnchorEmitter = useMemo23(() => {
10830
10998
  return {
10831
10999
  dispatch: (event) => {
10832
11000
  audioSyncAnchorListeners.current.forEach((l) => l(event));
@@ -10846,7 +11014,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
10846
11014
  const unscheduleAudioNode = useCallback9((node) => {
10847
11015
  nodesToResume.current.delete(node);
10848
11016
  }, []);
10849
- const scheduleAudioNode = useMemo22(() => {
11017
+ const scheduleAudioNode = useMemo23(() => {
10850
11018
  return ({
10851
11019
  node,
10852
11020
  mediaTimestamp,
@@ -10938,7 +11106,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
10938
11106
  audioContextIsPlayingEventually.current = false;
10939
11107
  return ctxAndGain.suspend();
10940
11108
  }, [ctxAndGain]);
10941
- const audioContextValue = useMemo22(() => {
11109
+ const audioContextValue = useMemo23(() => {
10942
11110
  return {
10943
11111
  audioContext: ctxAndGain?.audioContext ?? null,
10944
11112
  getAudioContextState: () => ctxAndGain?.getState() ?? null,
@@ -11120,7 +11288,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
11120
11288
  });
11121
11289
  resume?.();
11122
11290
  }, [logLevel, mountTime, refs, env.isPlayer, resume]);
11123
- const audioTagsValue = useMemo22(() => {
11291
+ const audioTagsValue = useMemo23(() => {
11124
11292
  return {
11125
11293
  registerAudio,
11126
11294
  unregisterAudio,
@@ -11135,7 +11303,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
11135
11303
  unregisterAudio,
11136
11304
  updateAudio
11137
11305
  ]);
11138
- const sharedAudioTagElements = useMemo22(() => {
11306
+ const sharedAudioTagElements = useMemo23(() => {
11139
11307
  return refs.map(({ id, ref }) => {
11140
11308
  return /* @__PURE__ */ jsx19("audio", {
11141
11309
  ref,
@@ -11503,7 +11671,7 @@ var useBasicMediaInTimeline = ({
11503
11671
  parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
11504
11672
  loop
11505
11673
  });
11506
- const volumes = useMemo23(() => {
11674
+ const volumes = useMemo24(() => {
11507
11675
  if (typeof volume === "number") {
11508
11676
  return volume;
11509
11677
  }
@@ -11522,15 +11690,13 @@ var useBasicMediaInTimeline = ({
11522
11690
  }, [initialVolume, mediaType, src, volume]);
11523
11691
  const doesVolumeChange = typeof volume === "function";
11524
11692
  const nonce = useNonce();
11525
- const { rootId } = useTimelineContext();
11526
11693
  const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
11527
- const memoizedResult = useMemo23(() => {
11694
+ const memoizedResult = useMemo24(() => {
11528
11695
  return {
11529
11696
  volumes,
11530
11697
  duration,
11531
11698
  doesVolumeChange,
11532
11699
  nonce,
11533
- rootId,
11534
11700
  finalDisplayName: displayName ?? getAssetDisplayName(src),
11535
11701
  startMediaFrom,
11536
11702
  src,
@@ -11541,7 +11707,6 @@ var useBasicMediaInTimeline = ({
11541
11707
  duration,
11542
11708
  doesVolumeChange,
11543
11709
  nonce,
11544
- rootId,
11545
11710
  displayName,
11546
11711
  src,
11547
11712
  startMediaFrom,
@@ -11570,7 +11735,7 @@ var useMediaInTimeline = ({
11570
11735
  const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
11571
11736
  const { durationInFrames } = useVideoConfig();
11572
11737
  const mediaStartsAt = useMediaStartsAt();
11573
- const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
11738
+ const { volumes, duration, doesVolumeChange, nonce, finalDisplayName } = useBasicMediaInTimeline({
11574
11739
  volume,
11575
11740
  mediaVolume,
11576
11741
  mediaType,
@@ -11604,7 +11769,6 @@ var useMediaInTimeline = ({
11604
11769
  parent: parentSequence?.id ?? null,
11605
11770
  displayName: finalDisplayName,
11606
11771
  documentationLink,
11607
- rootId,
11608
11772
  volume: volumes,
11609
11773
  showInTimeline: true,
11610
11774
  nonce: nonce.get(),
@@ -11645,7 +11809,6 @@ var useMediaInTimeline = ({
11645
11809
  postmountDisplay,
11646
11810
  loopDisplay,
11647
11811
  documentationLink,
11648
- rootId,
11649
11812
  finalDisplayName,
11650
11813
  isStudio,
11651
11814
  refForOutline
@@ -11732,7 +11895,7 @@ var useBufferManager = (logLevel, mountTime) => {
11732
11895
  }
11733
11896
  }, [blocks]);
11734
11897
  }
11735
- return useMemo24(() => {
11898
+ return useMemo25(() => {
11736
11899
  return { addBlock, listenForBuffering, listenForResume, buffering };
11737
11900
  }, [addBlock, buffering, listenForBuffering, listenForResume]);
11738
11901
  };
@@ -11767,7 +11930,7 @@ var useBufferState = () => {
11767
11930
  const buffer = useContext26(BufferingContextReact);
11768
11931
  const logLevel = useLogLevel();
11769
11932
  const addBlock = buffer ? buffer.addBlock : null;
11770
- return useMemo25(() => ({
11933
+ return useMemo26(() => ({
11771
11934
  delayPlayback: () => {
11772
11935
  if (!addBlock) {
11773
11936
  throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
@@ -11875,7 +12038,7 @@ var useBufferUntilFirstFrame = ({
11875
12038
  onVariableFpsVideoDetected,
11876
12039
  pauseWhenBuffering
11877
12040
  ]);
11878
- return useMemo26(() => {
12041
+ return useMemo27(() => {
11879
12042
  return {
11880
12043
  isBuffering: () => bufferingRef.current,
11881
12044
  bufferUntilFirstFrame
@@ -12546,14 +12709,14 @@ var SetMediaVolumeContext = createContext22({
12546
12709
  var useMediaVolumeState = () => {
12547
12710
  const { mediaVolume } = useContext28(MediaVolumeContext);
12548
12711
  const { setMediaVolume } = useContext28(SetMediaVolumeContext);
12549
- return useMemo27(() => {
12712
+ return useMemo28(() => {
12550
12713
  return [mediaVolume, setMediaVolume];
12551
12714
  }, [mediaVolume, setMediaVolume]);
12552
12715
  };
12553
12716
  var usePlayerMutedState = () => {
12554
12717
  const { playerMuted } = useContext28(MediaVolumeContext);
12555
12718
  const { setPlayerMuted } = useContext28(SetMediaVolumeContext);
12556
- return useMemo27(() => {
12719
+ return useMemo28(() => {
12557
12720
  return [playerMuted, setPlayerMuted];
12558
12721
  }, [playerMuted, setPlayerMuted]);
12559
12722
  };
@@ -12620,7 +12783,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12620
12783
  requestsVideoFrame: false,
12621
12784
  isClientSideRendering: false
12622
12785
  });
12623
- const propsToPass = useMemo28(() => {
12786
+ const propsToPass = useMemo29(() => {
12624
12787
  return {
12625
12788
  muted: muted || playerMuted || userPreferredVolume <= 0,
12626
12789
  src: preloadedSrc,
@@ -12637,7 +12800,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12637
12800
  userPreferredVolume,
12638
12801
  crossOriginValue
12639
12802
  ]);
12640
- const id = useMemo28(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
12803
+ const id = useMemo29(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
12641
12804
  src,
12642
12805
  sequenceContext?.relativeFrom,
12643
12806
  sequenceContext?.cumulatedFrom,
@@ -12770,7 +12933,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
12770
12933
  const sequenceContext = useContext30(SequenceContext);
12771
12934
  const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
12772
12935
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
12773
- const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
12936
+ const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
12774
12937
  props.src,
12775
12938
  sequenceContext?.relativeFrom,
12776
12939
  sequenceContext?.cumulatedFrom,
@@ -13044,7 +13207,8 @@ var solidSchema = {
13044
13207
  },
13045
13208
  ...transformSchema,
13046
13209
  ...backgroundSchema,
13047
- ...borderSchema
13210
+ ...borderSchema,
13211
+ ...cropSchema
13048
13212
  };
13049
13213
  var SolidInner = ({
13050
13214
  color,
@@ -13066,7 +13230,7 @@ var SolidInner = ({
13066
13230
  effects,
13067
13231
  overrideId: overrideId ?? null
13068
13232
  });
13069
- const sourceCanvas = useMemo30(() => {
13233
+ const sourceCanvas = useMemo31(() => {
13070
13234
  if (typeof document === "undefined") {
13071
13235
  return null;
13072
13236
  }
@@ -13134,7 +13298,7 @@ var SolidInner = ({
13134
13298
  cancelRender2,
13135
13299
  memoizedEffects
13136
13300
  ]);
13137
- const canvasStyle = useMemo30(() => {
13301
+ const canvasStyle = useMemo31(() => {
13138
13302
  return {
13139
13303
  width,
13140
13304
  height,
@@ -13165,6 +13329,10 @@ var SolidOuter = forwardRef8(({
13165
13329
  hidden,
13166
13330
  showInTimeline,
13167
13331
  pixelDensity,
13332
+ cropLeft,
13333
+ cropRight,
13334
+ cropTop,
13335
+ cropBottom,
13168
13336
  ...props2
13169
13337
  }, ref) => {
13170
13338
  const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
@@ -13172,6 +13340,14 @@ var SolidOuter = forwardRef8(({
13172
13340
  useImperativeHandle6(ref, () => {
13173
13341
  return actualRef.current;
13174
13342
  }, []);
13343
+ const croppedStyle = useCropStyle({
13344
+ cropLeft,
13345
+ cropRight,
13346
+ cropTop,
13347
+ cropBottom,
13348
+ style: style ?? null,
13349
+ componentName: "<Solid />"
13350
+ });
13175
13351
  return /* @__PURE__ */ jsx24(Sequence, {
13176
13352
  layout: "none",
13177
13353
  from,
@@ -13193,7 +13369,7 @@ var SolidOuter = forwardRef8(({
13193
13369
  height,
13194
13370
  width,
13195
13371
  className,
13196
- style,
13372
+ style: croppedStyle ?? undefined,
13197
13373
  effects,
13198
13374
  pixelDensity
13199
13375
  })
@@ -13222,6 +13398,17 @@ var isHtmlInCanvasSupported = () => {
13222
13398
  return cachedSupport;
13223
13399
  };
13224
13400
  var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";
13401
+ var MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS = 152;
13402
+ var getChromeMajorVersion = () => {
13403
+ if (typeof navigator === "undefined") {
13404
+ return null;
13405
+ }
13406
+ const match = navigator.userAgent.match(/\b(?:HeadlessChrome|Chrome)\/(\d+)/);
13407
+ if (!match) {
13408
+ return null;
13409
+ }
13410
+ return Number(match[1]);
13411
+ };
13225
13412
  function assertHtmlInCanvasDimensions(width, height) {
13226
13413
  if (typeof width !== "number" || typeof height !== "number") {
13227
13414
  throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(width)}, height=${String(height)}.`);
@@ -13285,6 +13472,10 @@ var HtmlInCanvasContent = forwardRef9(({
13285
13472
  }, ref) => {
13286
13473
  const ancestor = useContext32(HtmlInCanvasAncestorContext);
13287
13474
  assertHtmlInCanvasDimensions(width, height);
13475
+ const chromeMajorVersion = getChromeMajorVersion();
13476
+ if (ancestor && chromeMajorVersion !== null && chromeMajorVersion < MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS) {
13477
+ throw new Error(`Nested <HtmlInCanvas> components require Chrome ${MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS} or newer, but the current browser is Chrome ${chromeMajorVersion}. Upgrade Chrome or avoid nesting components that use <HtmlInCanvas>, such as shapes with effects.`);
13478
+ }
13288
13479
  const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
13289
13480
  const canvasWidth = Math.ceil(width * resolvedPixelDensity);
13290
13481
  const canvasHeight = Math.ceil(height * resolvedPixelDensity);
@@ -13503,20 +13694,20 @@ var HtmlInCanvasContent = forwardRef9(({
13503
13694
  continueRender2(handle);
13504
13695
  };
13505
13696
  }, [width, height, continueRender2, delayRender2, canvasSizeKey]);
13506
- const innerStyle = useMemo31(() => {
13697
+ const innerStyle = useMemo32(() => {
13507
13698
  return {
13508
13699
  width,
13509
13700
  height
13510
13701
  };
13511
13702
  }, [width, height]);
13512
- const canvasStyle = useMemo31(() => {
13703
+ const canvasStyle = useMemo32(() => {
13513
13704
  return {
13514
13705
  width,
13515
13706
  height,
13516
13707
  ...style ?? {}
13517
13708
  };
13518
13709
  }, [height, style, width]);
13519
- const ancestorValue = useMemo31(() => {
13710
+ const ancestorValue = useMemo32(() => {
13520
13711
  return {
13521
13712
  requestParentPaint: () => {
13522
13713
  canvas2dRef.current?.requestPaint?.();
@@ -13549,6 +13740,10 @@ var HtmlInCanvasInner = forwardRef9(({
13549
13740
  pixelDensity,
13550
13741
  controls,
13551
13742
  style,
13743
+ cropLeft,
13744
+ cropRight,
13745
+ cropTop,
13746
+ cropBottom,
13552
13747
  durationInFrames,
13553
13748
  name,
13554
13749
  ...sequenceProps
@@ -13563,6 +13758,14 @@ var HtmlInCanvasInner = forwardRef9(({
13563
13758
  ref.current = node;
13564
13759
  }
13565
13760
  }, [ref]);
13761
+ const croppedStyle = useCropStyle({
13762
+ cropLeft,
13763
+ cropRight,
13764
+ cropTop,
13765
+ cropBottom,
13766
+ style: style ?? null,
13767
+ componentName: "<HtmlInCanvas />"
13768
+ });
13566
13769
  return /* @__PURE__ */ jsx25(Sequence, {
13567
13770
  durationInFrames,
13568
13771
  name: name ?? "<HtmlInCanvas>",
@@ -13581,7 +13784,7 @@ var HtmlInCanvasInner = forwardRef9(({
13581
13784
  onInit,
13582
13785
  pixelDensity,
13583
13786
  controls,
13584
- style,
13787
+ style: croppedStyle ?? undefined,
13585
13788
  children
13586
13789
  })
13587
13790
  });
@@ -13600,7 +13803,8 @@ var htmlInCanvasSchema = {
13600
13803
  },
13601
13804
  ...transformSchema,
13602
13805
  ...backgroundSchema,
13603
- ...borderSchema
13806
+ ...borderSchema,
13807
+ ...cropSchema
13604
13808
  };
13605
13809
  var HtmlInCanvasWrapped = withInteractivitySchema({
13606
13810
  Component: HtmlInCanvasInner,
@@ -13622,6 +13826,7 @@ function truncateSrcForLabel(src) {
13622
13826
  }
13623
13827
  var canvasImageSchema = {
13624
13828
  ...baseSchema,
13829
+ ...cropSchema,
13625
13830
  ...premountSchema,
13626
13831
  fit: {
13627
13832
  type: "enum",
@@ -13752,7 +13957,7 @@ var CanvasImageContent = forwardRef10(({
13752
13957
  continueRender2(pending.handle);
13753
13958
  pendingLoadDelayRef.current = null;
13754
13959
  }, [continueRender2]);
13755
- const sourceCanvas = useMemo32(() => {
13960
+ const sourceCanvas = useMemo33(() => {
13756
13961
  if (typeof document === "undefined") {
13757
13962
  return null;
13758
13963
  }
@@ -13966,9 +14171,14 @@ var CanvasImageInner = forwardRef10(({
13966
14171
  hidden,
13967
14172
  name,
13968
14173
  showInTimeline,
14174
+ cropLeft,
14175
+ cropRight,
14176
+ cropTop,
14177
+ cropBottom,
13969
14178
  stack,
13970
14179
  controls,
13971
14180
  _remotionInternalDocumentationLink,
14181
+ _remotionInternalCropComponentName,
13972
14182
  outlineRef,
13973
14183
  ...canvasProps
13974
14184
  }, ref) => {
@@ -13998,6 +14208,14 @@ var CanvasImageInner = forwardRef10(({
13998
14208
  styleWhilePostmounted: styleWhilePostmounted ?? null,
13999
14209
  hideWhilePremounted: "display-none"
14000
14210
  });
14211
+ const croppedStyle = useCropStyle({
14212
+ cropLeft,
14213
+ cropRight,
14214
+ cropTop,
14215
+ cropBottom,
14216
+ style: premountingStyle,
14217
+ componentName: _remotionInternalCropComponentName ?? "<CanvasImage />"
14218
+ });
14001
14219
  return /* @__PURE__ */ jsx26(Freeze, {
14002
14220
  frame: freezeFrame,
14003
14221
  active: isPremountingOrPostmounting,
@@ -14029,7 +14247,7 @@ var CanvasImageInner = forwardRef10(({
14029
14247
  effects,
14030
14248
  controls,
14031
14249
  className,
14032
- style: premountingStyle ?? undefined,
14250
+ style: croppedStyle ?? undefined,
14033
14251
  id,
14034
14252
  onError,
14035
14253
  pauseWhenLoading,
@@ -14260,6 +14478,10 @@ var NativeImgInner = ({
14260
14478
  style,
14261
14479
  styleWhilePremounted,
14262
14480
  styleWhilePostmounted,
14481
+ cropLeft,
14482
+ cropRight,
14483
+ cropTop,
14484
+ cropBottom,
14263
14485
  controls,
14264
14486
  outlineRef: refForOutline,
14265
14487
  ...props2
@@ -14285,6 +14507,14 @@ var NativeImgInner = ({
14285
14507
  styleWhilePostmounted: styleWhilePostmounted ?? null,
14286
14508
  hideWhilePremounted: "display-none"
14287
14509
  });
14510
+ const croppedStyle = useCropStyle({
14511
+ cropLeft,
14512
+ cropRight,
14513
+ cropTop,
14514
+ cropBottom,
14515
+ style: premountingStyle,
14516
+ componentName: "<Img />"
14517
+ });
14288
14518
  return /* @__PURE__ */ jsx28(Freeze, {
14289
14519
  frame: freezeFrame,
14290
14520
  active: isPremountingOrPostmounting,
@@ -14309,7 +14539,7 @@ var NativeImgInner = ({
14309
14539
  children: /* @__PURE__ */ jsx28(ImgContent, {
14310
14540
  src,
14311
14541
  refForOutline,
14312
- style: premountingStyle ?? undefined,
14542
+ style: croppedStyle ?? undefined,
14313
14543
  ...props2
14314
14544
  })
14315
14545
  })
@@ -14324,6 +14554,7 @@ var imgSchema = {
14324
14554
  keyframable: false
14325
14555
  },
14326
14556
  ...baseSchema,
14557
+ ...cropSchema,
14327
14558
  ...premountSchema,
14328
14559
  ...transformSchema,
14329
14560
  ...backgroundSchema,
@@ -14392,6 +14623,10 @@ var ImgInner = ({
14392
14623
  height,
14393
14624
  className,
14394
14625
  style,
14626
+ cropLeft,
14627
+ cropRight,
14628
+ cropTop,
14629
+ cropBottom,
14395
14630
  id,
14396
14631
  pauseWhenLoading,
14397
14632
  maxRetries,
@@ -14423,6 +14658,10 @@ var ImgInner = ({
14423
14658
  height,
14424
14659
  className,
14425
14660
  style,
14661
+ cropLeft,
14662
+ cropRight,
14663
+ cropTop,
14664
+ cropBottom,
14426
14665
  id,
14427
14666
  pauseWhenLoading: shouldPauseWhenLoading,
14428
14667
  maxRetries,
@@ -14452,6 +14691,10 @@ var ImgInner = ({
14452
14691
  effects,
14453
14692
  className,
14454
14693
  style,
14694
+ cropLeft,
14695
+ cropRight,
14696
+ cropTop,
14697
+ cropBottom,
14455
14698
  id,
14456
14699
  pauseWhenLoading: shouldPauseWhenLoading,
14457
14700
  maxRetries,
@@ -14470,6 +14713,7 @@ var ImgInner = ({
14470
14713
  showInTimeline,
14471
14714
  stack,
14472
14715
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
14716
+ _remotionInternalCropComponentName: "<Img />",
14473
14717
  controls,
14474
14718
  outlineRef: refForOutline,
14475
14719
  ...canvasProps
@@ -14518,9 +14762,22 @@ var interactiveTextElementSchema = {
14518
14762
  };
14519
14763
  var interactiveSvgTextElementSchema = {
14520
14764
  ...interactiveElementSchema,
14765
+ ...svgPaintSchema,
14521
14766
  ...textSchema,
14522
14767
  ...textContentSchema
14523
14768
  };
14769
+ var interactiveSvgElementSchema = {
14770
+ ...interactiveElementSchema,
14771
+ ...svgPaintSchema
14772
+ };
14773
+ var interactiveSvgStrokeElementSchema = {
14774
+ ...interactiveElementSchema,
14775
+ ...svgStrokeSchema
14776
+ };
14777
+ var interactiveSvgRootElementSchema = {
14778
+ ...interactiveBorderElementSchema,
14779
+ ...svgPaintSchema
14780
+ };
14524
14781
  var setRef = (ref, value) => {
14525
14782
  if (typeof ref === "function") {
14526
14783
  ref(value);
@@ -14588,8 +14845,11 @@ var makeInteractiveElement = (tag, displayName, schema) => {
14588
14845
  var makeInteractiveTextElement = (tag, displayName) => {
14589
14846
  return makeInteractiveElement(tag, displayName, interactiveTextElementSchema);
14590
14847
  };
14591
- var makeInteractiveNonTextElement = (tag, displayName) => {
14592
- return makeInteractiveElement(tag, displayName, interactiveElementSchema);
14848
+ var makeInteractiveSvgElement = (tag, displayName) => {
14849
+ return makeInteractiveElement(tag, displayName, interactiveSvgElementSchema);
14850
+ };
14851
+ var makeInteractiveSvgStrokeElement = (tag, displayName) => {
14852
+ return makeInteractiveElement(tag, displayName, interactiveSvgStrokeElementSchema);
14593
14853
  };
14594
14854
  var Interactive = {
14595
14855
  baseSchema,
@@ -14597,6 +14857,9 @@ var Interactive = {
14597
14857
  textSchema,
14598
14858
  backgroundSchema,
14599
14859
  borderSchema,
14860
+ cropSchema,
14861
+ svgPaintSchema,
14862
+ svgStrokeSchema,
14600
14863
  premountSchema,
14601
14864
  sequenceSchema,
14602
14865
  withSchema,
@@ -14605,13 +14868,13 @@ var Interactive = {
14605
14868
  Article: makeInteractiveTextElement("article", "<Interactive.Article>"),
14606
14869
  Aside: makeInteractiveTextElement("aside", "<Interactive.Aside>"),
14607
14870
  Button: makeInteractiveTextElement("button", "<Interactive.Button>"),
14608
- Circle: makeInteractiveNonTextElement("circle", "<Interactive.Circle>"),
14871
+ Circle: makeInteractiveSvgElement("circle", "<Interactive.Circle>"),
14609
14872
  Code: makeInteractiveTextElement("code", "<Interactive.Code>"),
14610
14873
  Div: makeInteractiveTextElement("div", "<Interactive.Div>"),
14611
- Ellipse: makeInteractiveNonTextElement("ellipse", "<Interactive.Ellipse>"),
14874
+ Ellipse: makeInteractiveSvgElement("ellipse", "<Interactive.Ellipse>"),
14612
14875
  Em: makeInteractiveTextElement("em", "<Interactive.Em>"),
14613
14876
  Footer: makeInteractiveTextElement("footer", "<Interactive.Footer>"),
14614
- G: makeInteractiveNonTextElement("g", "<Interactive.G>"),
14877
+ G: makeInteractiveSvgElement("g", "<Interactive.G>"),
14615
14878
  H1: makeInteractiveTextElement("h1", "<Interactive.H1>"),
14616
14879
  H2: makeInteractiveTextElement("h2", "<Interactive.H2>"),
14617
14880
  H3: makeInteractiveTextElement("h3", "<Interactive.H3>"),
@@ -14621,19 +14884,19 @@ var Interactive = {
14621
14884
  Header: makeInteractiveTextElement("header", "<Interactive.Header>"),
14622
14885
  Label: makeInteractiveTextElement("label", "<Interactive.Label>"),
14623
14886
  Li: makeInteractiveTextElement("li", "<Interactive.Li>"),
14624
- Line: makeInteractiveNonTextElement("line", "<Interactive.Line>"),
14887
+ Line: makeInteractiveSvgStrokeElement("line", "<Interactive.Line>"),
14625
14888
  Main: makeInteractiveTextElement("main", "<Interactive.Main>"),
14626
14889
  Nav: makeInteractiveTextElement("nav", "<Interactive.Nav>"),
14627
14890
  Ol: makeInteractiveTextElement("ol", "<Interactive.Ol>"),
14628
14891
  P: makeInteractiveTextElement("p", "<Interactive.P>"),
14629
- Path: makeInteractiveNonTextElement("path", "<Interactive.Path>"),
14892
+ Path: makeInteractiveSvgElement("path", "<Interactive.Path>"),
14630
14893
  Pre: makeInteractiveTextElement("pre", "<Interactive.Pre>"),
14631
- Rect: makeInteractiveNonTextElement("rect", "<Interactive.Rect>"),
14894
+ Rect: makeInteractiveSvgElement("rect", "<Interactive.Rect>"),
14632
14895
  Section: makeInteractiveTextElement("section", "<Interactive.Section>"),
14633
14896
  Small: makeInteractiveTextElement("small", "<Interactive.Small>"),
14634
14897
  Span: makeInteractiveTextElement("span", "<Interactive.Span>"),
14635
14898
  Strong: makeInteractiveTextElement("strong", "<Interactive.Strong>"),
14636
- Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveBorderElementSchema),
14899
+ Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveSvgRootElementSchema),
14637
14900
  Text: makeInteractiveElement("text", "<Interactive.Text>", interactiveSvgTextElementSchema),
14638
14901
  Ul: makeInteractiveTextElement("ul", "<Interactive.Ul>")
14639
14902
  };
@@ -14721,7 +14984,7 @@ var CompositionManagerProvider = ({
14721
14984
  getCompositions: () => currentcompositionsRef.current
14722
14985
  };
14723
14986
  }, []);
14724
- const compositionManagerSetters = useMemo33(() => {
14987
+ const compositionManagerSetters = useMemo34(() => {
14725
14988
  return {
14726
14989
  registerComposition,
14727
14990
  unregisterComposition,
@@ -14737,7 +15000,7 @@ var CompositionManagerProvider = ({
14737
15000
  unregisterFolder,
14738
15001
  onlyRenderComposition
14739
15002
  ]);
14740
- const compositionManagerContextValue = useMemo33(() => {
15003
+ const compositionManagerContextValue = useMemo34(() => {
14741
15004
  return {
14742
15005
  compositions,
14743
15006
  folders,
@@ -14859,7 +15122,7 @@ var MediaEnabledProvider = ({
14859
15122
  videoEnabled,
14860
15123
  audioEnabled
14861
15124
  }) => {
14862
- const value = useMemo34(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
15125
+ const value = useMemo35(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
14863
15126
  return /* @__PURE__ */ jsx31(MediaEnabledContext.Provider, {
14864
15127
  value,
14865
15128
  children
@@ -14875,13 +15138,13 @@ var RemotionRootContexts = ({
14875
15138
  audioEnabled,
14876
15139
  frameState
14877
15140
  }) => {
14878
- const nonceContext = useMemo35(() => {
15141
+ const nonceContext = useMemo36(() => {
14879
15142
  let counter = 0;
14880
15143
  return {
14881
15144
  getNonce: () => counter++
14882
15145
  };
14883
15146
  }, []);
14884
- const logging = useMemo35(() => {
15147
+ const logging = useMemo36(() => {
14885
15148
  return { logLevel, mountTime: Date.now() };
14886
15149
  }, [logLevel]);
14887
15150
  return /* @__PURE__ */ jsx32(LogLevelContext.Provider, {
@@ -15188,7 +15451,7 @@ var OffthreadVideoForRendering = ({
15188
15451
  if (!src) {
15189
15452
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
15190
15453
  }
15191
- const id = useMemo36(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
15454
+ const id = useMemo37(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
15192
15455
  src,
15193
15456
  sequenceContext?.cumulatedFrom,
15194
15457
  sequenceContext?.relativeFrom,
@@ -15243,14 +15506,14 @@ var OffthreadVideoForRendering = ({
15243
15506
  sequenceContext?.cumulatedNegativeFrom,
15244
15507
  audioStreamIndex
15245
15508
  ]);
15246
- const currentTime = useMemo36(() => {
15509
+ const currentTime = useMemo37(() => {
15247
15510
  return getExpectedMediaFrameUncorrected({
15248
15511
  frame,
15249
15512
  playbackRate: playbackRate || 1,
15250
15513
  startFrom: -mediaStartsAt
15251
15514
  }) / videoConfig.fps;
15252
15515
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
15253
- const actualSrc = useMemo36(() => {
15516
+ const actualSrc = useMemo37(() => {
15254
15517
  return getOffthreadVideoSource({
15255
15518
  src,
15256
15519
  currentTime,
@@ -15338,7 +15601,7 @@ var OffthreadVideoForRendering = ({
15338
15601
  cancelRender("Failed to load image with src " + imageSrc);
15339
15602
  }
15340
15603
  }, [imageSrc, onError]);
15341
- const className = useMemo36(() => {
15604
+ const className = useMemo37(() => {
15342
15605
  return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
15343
15606
  }, [props2.className]);
15344
15607
  const onImageFrame = useCallback22((img) => {
@@ -15407,7 +15670,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
15407
15670
  throw new Error("SharedAudioContext not found");
15408
15671
  }
15409
15672
  const videoRef = useRef27(null);
15410
- const sharedSource = useMemo37(() => {
15673
+ const sharedSource = useMemo38(() => {
15411
15674
  if (!context.audioContext) {
15412
15675
  return null;
15413
15676
  }
@@ -15610,7 +15873,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
15610
15873
  current.preload = "auto";
15611
15874
  }
15612
15875
  }, []);
15613
- const actualStyle = useMemo37(() => {
15876
+ const actualStyle = useMemo38(() => {
15614
15877
  return {
15615
15878
  ...style
15616
15879
  };
@@ -15807,7 +16070,7 @@ function useRemotionContexts() {
15807
16070
  const visualModePropStatusesRefContext = React40.useContext(VisualModePropStatusesRefContext);
15808
16071
  const bufferManagerContext = React40.useContext(BufferingContextReact);
15809
16072
  const logLevelContext = React40.useContext(LogLevelContext);
15810
- return useMemo38(() => ({
16073
+ return useMemo39(() => ({
15811
16074
  compositionManagerCtx,
15812
16075
  timelineContext,
15813
16076
  setTimelineContext,
@@ -15916,6 +16179,7 @@ var Internals = {
15916
16179
  sequenceStyleSchema,
15917
16180
  sequenceVisualStyleSchema,
15918
16181
  sequencePremountSchema,
16182
+ sequenceCropSchema,
15919
16183
  textSchema,
15920
16184
  transformSchema,
15921
16185
  premountSchema,
@@ -16039,7 +16303,9 @@ var Internals = {
16039
16303
  hiddenField,
16040
16304
  durationInFramesField,
16041
16305
  freezeField,
16042
- fromField
16306
+ fromField,
16307
+ resolveSequenceCrop,
16308
+ useCropStyle
16043
16309
  };
16044
16310
  var flattenChildren = (children) => {
16045
16311
  const childrenArray = React41.Children.toArray(children);
@@ -16109,7 +16375,7 @@ var validateSeriesSequenceProps = ({
16109
16375
  return offset;
16110
16376
  };
16111
16377
  var SeriesInner = (props2) => {
16112
- const childrenValue = useMemo39(() => {
16378
+ const childrenValue = useMemo40(() => {
16113
16379
  const flattenedChildren = flattenChildren(props2.children);
16114
16380
  const renderChildren = (i, startFrame) => {
16115
16381
  if (i === flattenedChildren.length) {
@@ -16445,7 +16711,7 @@ var VideoForRenderingForwardFunction = ({
16445
16711
  const mountTime = useMountTime();
16446
16712
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
16447
16713
  const { registerRenderAsset, unregisterRenderAsset } = useContext39(RenderAssetManager);
16448
- const id = useMemo40(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
16714
+ const id = useMemo41(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
16449
16715
  props2.src,
16450
16716
  sequenceContext?.cumulatedFrom,
16451
16717
  sequenceContext?.relativeFrom,
@@ -16776,7 +17042,7 @@ addSequenceStackTraces(Composition);
16776
17042
  addSequenceStackTraces(Folder);
16777
17043
 
16778
17044
  // ../shapes/dist/esm/index.mjs
16779
- import React, { useCallback as useCallback26, useMemo as useMemo41, useRef as useRef29 } from "react";
17045
+ import React, { useCallback as useCallback26, useMemo as useMemo42, useRef as useRef29 } from "react";
16780
17046
  import { version } from "react-dom";
16781
17047
  import { jsx as jsx40, jsxs as jsxs4 } from "react/jsx-runtime";
16782
17048
  import { jsx as jsx210 } from "react/jsx-runtime";
@@ -16958,13 +17224,13 @@ var RenderSvg = ({
16958
17224
  stack,
16959
17225
  ...props
16960
17226
  }) => {
16961
- const actualStyle = useMemo41(() => {
17227
+ const actualStyle = useMemo42(() => {
16962
17228
  return {
16963
17229
  overflow: "visible",
16964
17230
  ...style ?? {}
16965
17231
  };
16966
17232
  }, [style]);
16967
- const actualPathStyle = useMemo41(() => {
17233
+ const actualPathStyle = useMemo42(() => {
16968
17234
  return {
16969
17235
  transformBox: "fill-box",
16970
17236
  ...pathStyle ?? {}
@@ -19945,7 +20211,7 @@ var useHoverTransforms = (ref, disabled) => {
19945
20211
  progress: 0,
19946
20212
  isActive: false
19947
20213
  });
19948
- const eventTarget = useMemo43(() => new EventTarget, []);
20214
+ const eventTarget = useMemo44(() => new EventTarget, []);
19949
20215
  useEffect21(() => {
19950
20216
  if (disabled) {
19951
20217
  eventTarget.dispatchEvent(new Event("disabled"));