remotion 4.0.499 → 4.0.501

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.
Files changed (57) hide show
  1. package/dist/cjs/AbsoluteFill.d.ts +237 -1
  2. package/dist/cjs/AbsoluteFill.js +40 -103
  3. package/dist/cjs/AbsoluteFillElement.d.ts +3 -0
  4. package/dist/cjs/AbsoluteFillElement.js +111 -0
  5. package/dist/cjs/Composition.js +2 -1
  6. package/dist/cjs/CompositionManager.d.ts +0 -1
  7. package/dist/cjs/Folder.js +2 -1
  8. package/dist/cjs/HtmlInCanvas.d.ts +84 -3
  9. package/dist/cjs/HtmlInCanvas.js +30 -2
  10. package/dist/cjs/Img.d.ts +84 -11
  11. package/dist/cjs/Img.js +16 -5
  12. package/dist/cjs/Interactive.d.ts +211 -6
  13. package/dist/cjs/Interactive.js +33 -11
  14. package/dist/cjs/Sequence.d.ts +4 -0
  15. package/dist/cjs/Sequence.js +30 -13
  16. package/dist/cjs/TimelineContext.d.ts +0 -1
  17. package/dist/cjs/TimelineContext.js +1 -4
  18. package/dist/cjs/animated-image/AnimatedImage.d.ts +82 -1
  19. package/dist/cjs/animated-image/AnimatedImage.js +13 -2
  20. package/dist/cjs/animated-image/props.d.ts +2 -2
  21. package/dist/cjs/audio/AudioForPreview.d.ts +0 -1
  22. package/dist/cjs/audio/AudioForPreview.js +1 -1
  23. package/dist/cjs/audio/html5-audio.d.ts +2 -2
  24. package/dist/cjs/audio/html5-audio.js +2 -2
  25. package/dist/cjs/canvas-image/CanvasImage.d.ts +83 -3
  26. package/dist/cjs/canvas-image/CanvasImage.js +13 -2
  27. package/dist/cjs/canvas-image/props.d.ts +6 -7
  28. package/dist/cjs/effects/Solid.d.ts +84 -3
  29. package/dist/cjs/effects/Solid.js +13 -2
  30. package/dist/cjs/enable-sequence-stack-traces.d.ts +4 -0
  31. package/dist/cjs/enable-sequence-stack-traces.js +16 -1
  32. package/dist/cjs/index.d.ts +3 -3
  33. package/dist/cjs/interactivity-schema.d.ts +420 -1
  34. package/dist/cjs/interactivity-schema.js +122 -1
  35. package/dist/cjs/internals.d.ts +211 -2
  36. package/dist/cjs/internals.js +7 -0
  37. package/dist/cjs/no-react.d.ts +81 -0
  38. package/dist/cjs/sequence-crop.d.ts +20 -0
  39. package/dist/cjs/sequence-crop.js +59 -0
  40. package/dist/cjs/series/index.js +4 -4
  41. package/dist/cjs/static-file.js +10 -0
  42. package/dist/cjs/truncate-src-for-label.js +5 -1
  43. package/dist/cjs/use-crop-style.d.ts +6 -0
  44. package/dist/cjs/use-crop-style.js +19 -0
  45. package/dist/cjs/use-media-in-timeline.d.ts +0 -1
  46. package/dist/cjs/use-media-in-timeline.js +1 -7
  47. package/dist/cjs/version.d.ts +1 -1
  48. package/dist/cjs/version.js +1 -1
  49. package/dist/cjs/video/OffthreadVideo.js +6 -6
  50. package/dist/cjs/video/html5-video.d.ts +2 -2
  51. package/dist/cjs/video/html5-video.js +5 -5
  52. package/dist/cjs/video/props.d.ts +1 -1
  53. package/dist/cjs/with-interactivity-schema.js +22 -12
  54. package/dist/esm/index.mjs +2453 -2022
  55. package/dist/esm/no-react.mjs +111 -0
  56. package/dist/esm/version.mjs +1 -1
  57. package/package.json +2 -2
@@ -215,6 +215,47 @@ export declare const Internals: {
215
215
  readonly default: undefined;
216
216
  readonly description: "Border color";
217
217
  };
218
+ readonly 'style.borderRadius': {
219
+ readonly type: "number";
220
+ readonly default: 0;
221
+ readonly min: 0;
222
+ readonly step: 1;
223
+ readonly description: "Border radius";
224
+ readonly hiddenFromList: false;
225
+ readonly keyframable: true;
226
+ };
227
+ readonly 'style.borderTopLeftRadius': {
228
+ readonly type: "number";
229
+ readonly default: 0;
230
+ readonly min: 0;
231
+ readonly step: 1;
232
+ readonly description: "Top left radius";
233
+ readonly hiddenFromList: false;
234
+ };
235
+ readonly 'style.borderTopRightRadius': {
236
+ readonly type: "number";
237
+ readonly default: 0;
238
+ readonly min: 0;
239
+ readonly step: 1;
240
+ readonly description: "Top right radius";
241
+ readonly hiddenFromList: false;
242
+ };
243
+ readonly 'style.borderBottomRightRadius': {
244
+ readonly type: "number";
245
+ readonly default: 0;
246
+ readonly min: 0;
247
+ readonly step: 1;
248
+ readonly description: "Bottom right radius";
249
+ readonly hiddenFromList: false;
250
+ };
251
+ readonly 'style.borderBottomLeftRadius': {
252
+ readonly type: "number";
253
+ readonly default: 0;
254
+ readonly min: 0;
255
+ readonly step: 1;
256
+ readonly description: "Bottom left radius";
257
+ readonly hiddenFromList: false;
258
+ };
218
259
  readonly 'style.backgroundColor': {
219
260
  readonly type: "color";
220
261
  readonly default: "transparent";
@@ -237,6 +278,46 @@ export declare const Internals: {
237
278
  readonly hiddenFromList: true;
238
279
  readonly keyframable: false;
239
280
  };
281
+ readonly cropLeft: {
282
+ readonly type: "number";
283
+ readonly default: 0;
284
+ readonly description: "Crop left";
285
+ readonly min: 0;
286
+ readonly max: 1;
287
+ readonly step: 0.01;
288
+ readonly hiddenFromList: false;
289
+ readonly keyframable: true;
290
+ };
291
+ readonly cropRight: {
292
+ readonly type: "number";
293
+ readonly default: 0;
294
+ readonly description: "Crop right";
295
+ readonly min: 0;
296
+ readonly max: 1;
297
+ readonly step: 0.01;
298
+ readonly hiddenFromList: false;
299
+ readonly keyframable: true;
300
+ };
301
+ readonly cropTop: {
302
+ readonly type: "number";
303
+ readonly default: 0;
304
+ readonly description: "Crop top";
305
+ readonly min: 0;
306
+ readonly max: 1;
307
+ readonly step: 0.01;
308
+ readonly hiddenFromList: false;
309
+ readonly keyframable: true;
310
+ };
311
+ readonly cropBottom: {
312
+ readonly type: "number";
313
+ readonly default: 0;
314
+ readonly description: "Crop bottom";
315
+ readonly min: 0;
316
+ readonly max: 1;
317
+ readonly step: 0.01;
318
+ readonly hiddenFromList: false;
319
+ readonly keyframable: true;
320
+ };
240
321
  };
241
322
  readonly none: {};
242
323
  };
@@ -309,6 +390,47 @@ export declare const Internals: {
309
390
  readonly default: undefined;
310
391
  readonly description: "Border color";
311
392
  };
393
+ readonly 'style.borderRadius': {
394
+ readonly type: "number";
395
+ readonly default: 0;
396
+ readonly min: 0;
397
+ readonly step: 1;
398
+ readonly description: "Border radius";
399
+ readonly hiddenFromList: false;
400
+ readonly keyframable: true;
401
+ };
402
+ readonly 'style.borderTopLeftRadius': {
403
+ readonly type: "number";
404
+ readonly default: 0;
405
+ readonly min: 0;
406
+ readonly step: 1;
407
+ readonly description: "Top left radius";
408
+ readonly hiddenFromList: false;
409
+ };
410
+ readonly 'style.borderTopRightRadius': {
411
+ readonly type: "number";
412
+ readonly default: 0;
413
+ readonly min: 0;
414
+ readonly step: 1;
415
+ readonly description: "Top right radius";
416
+ readonly hiddenFromList: false;
417
+ };
418
+ readonly 'style.borderBottomRightRadius': {
419
+ readonly type: "number";
420
+ readonly default: 0;
421
+ readonly min: 0;
422
+ readonly step: 1;
423
+ readonly description: "Bottom right radius";
424
+ readonly hiddenFromList: false;
425
+ };
426
+ readonly 'style.borderBottomLeftRadius': {
427
+ readonly type: "number";
428
+ readonly default: 0;
429
+ readonly min: 0;
430
+ readonly step: 1;
431
+ readonly description: "Bottom left radius";
432
+ readonly hiddenFromList: false;
433
+ };
312
434
  readonly 'style.backgroundColor': {
313
435
  readonly type: "color";
314
436
  readonly default: "transparent";
@@ -331,6 +453,46 @@ export declare const Internals: {
331
453
  readonly hiddenFromList: true;
332
454
  readonly keyframable: false;
333
455
  };
456
+ readonly cropLeft: {
457
+ readonly type: "number";
458
+ readonly default: 0;
459
+ readonly description: "Crop left";
460
+ readonly min: 0;
461
+ readonly max: 1;
462
+ readonly step: 0.01;
463
+ readonly hiddenFromList: false;
464
+ readonly keyframable: true;
465
+ };
466
+ readonly cropRight: {
467
+ readonly type: "number";
468
+ readonly default: 0;
469
+ readonly description: "Crop right";
470
+ readonly min: 0;
471
+ readonly max: 1;
472
+ readonly step: 0.01;
473
+ readonly hiddenFromList: false;
474
+ readonly keyframable: true;
475
+ };
476
+ readonly cropTop: {
477
+ readonly type: "number";
478
+ readonly default: 0;
479
+ readonly description: "Crop top";
480
+ readonly min: 0;
481
+ readonly max: 1;
482
+ readonly step: 0.01;
483
+ readonly hiddenFromList: false;
484
+ readonly keyframable: true;
485
+ };
486
+ readonly cropBottom: {
487
+ readonly type: "number";
488
+ readonly default: 0;
489
+ readonly description: "Crop bottom";
490
+ readonly min: 0;
491
+ readonly max: 1;
492
+ readonly step: 0.01;
493
+ readonly hiddenFromList: false;
494
+ readonly keyframable: true;
495
+ };
334
496
  };
335
497
  readonly sequenceVisualStyleSchema: {
336
498
  readonly 'style.transformOrigin': {
@@ -388,6 +550,48 @@ export declare const Internals: {
388
550
  readonly keyframable: false;
389
551
  };
390
552
  };
553
+ readonly sequenceCropSchema: {
554
+ readonly cropLeft: {
555
+ readonly type: "number";
556
+ readonly default: 0;
557
+ readonly description: "Crop left";
558
+ readonly min: 0;
559
+ readonly max: 1;
560
+ readonly step: 0.01;
561
+ readonly hiddenFromList: false;
562
+ readonly keyframable: true;
563
+ };
564
+ readonly cropRight: {
565
+ readonly type: "number";
566
+ readonly default: 0;
567
+ readonly description: "Crop right";
568
+ readonly min: 0;
569
+ readonly max: 1;
570
+ readonly step: 0.01;
571
+ readonly hiddenFromList: false;
572
+ readonly keyframable: true;
573
+ };
574
+ readonly cropTop: {
575
+ readonly type: "number";
576
+ readonly default: 0;
577
+ readonly description: "Crop top";
578
+ readonly min: 0;
579
+ readonly max: 1;
580
+ readonly step: 0.01;
581
+ readonly hiddenFromList: false;
582
+ readonly keyframable: true;
583
+ };
584
+ readonly cropBottom: {
585
+ readonly type: "number";
586
+ readonly default: 0;
587
+ readonly description: "Crop bottom";
588
+ readonly min: 0;
589
+ readonly max: 1;
590
+ readonly step: 0.01;
591
+ readonly hiddenFromList: false;
592
+ readonly keyframable: true;
593
+ };
594
+ };
391
595
  readonly textSchema: {
392
596
  readonly 'style.color': {
393
597
  readonly type: "color";
@@ -803,6 +1007,8 @@ export declare const Internals: {
803
1007
  readonly getComponentsToAddStacksTo: () => unknown[];
804
1008
  readonly getSequenceComponent: () => unknown;
805
1009
  readonly getSingleChildComponent: (children: import("react").ReactNode) => unknown;
1010
+ readonly getStackForControls: (controls: import("./CompositionManager.js").SequenceControls) => string | null;
1011
+ readonly REMOTION_INTERNAL_STACK_PROP: "_remotionInternalStack";
806
1012
  readonly CurrentScaleContext: import("react").Context<({
807
1013
  type: "scale";
808
1014
  scale: number;
@@ -913,7 +1119,6 @@ export declare const Internals: {
913
1119
  readonly _remotionInternalNativeLoopPassed: boolean;
914
1120
  readonly _remotionInternalStack: string | null;
915
1121
  readonly showInTimeline: boolean;
916
- readonly stack?: string | undefined;
917
1122
  readonly onNativeError: import("react").ReactEventHandler<HTMLAudioElement>;
918
1123
  }, "ref"> & import("react").RefAttributes<HTMLAudioElement>>;
919
1124
  readonly OBJECTFIT_CONTAIN_CLASS_NAME: "__remotion_objectfitcontain";
@@ -935,7 +1140,6 @@ export declare const Internals: {
935
1140
  duration: number;
936
1141
  doesVolumeChange: boolean;
937
1142
  nonce: import("./nonce.js").NonceHistoryContext;
938
- rootId: string;
939
1143
  finalDisplayName: string;
940
1144
  startMediaFrom: number;
941
1145
  src: string;
@@ -1059,5 +1263,10 @@ export declare const Internals: {
1059
1263
  readonly step: 1;
1060
1264
  readonly hiddenFromList: true;
1061
1265
  };
1266
+ readonly resolveSequenceCrop: ({ cropLeft, cropRight, cropTop, cropBottom, }: import("./sequence-crop.js").SequenceCropInput) => import("./sequence-crop.js").ResolvedSequenceCrop;
1267
+ readonly useCropStyle: ({ cropLeft, cropRight, cropTop, cropBottom, style, componentName, }: import("./sequence-crop.js").SequenceCropInput & {
1268
+ readonly style: import("react").CSSProperties | null;
1269
+ readonly componentName: string;
1270
+ }) => import("react").CSSProperties | null;
1062
1271
  };
1063
1272
  export type { ArrayFieldSchema, AssetFieldSchema, ArrayItemFieldSchema, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateEffectPropsResponseFalse, CanUpdateEffectPropsResponseTrue, CanUpdateSequencePropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, CanUpdateSequencePropStatusEasing, CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, VideoConfigNumericExpression, CompositionManagerContext, CompProps, DragOverrides, DragOverrideValue, EffectDragOverrides, GetDragOverrides, GetEffectDragOverrides, GetEffectPropStatuses, GetPropStatuses, JsxComponentIdentity, LoggingContextValue, MediaVolumeContextValue, NonceHistory, OverrideIdsToNodePathsGettersContext, OverrideIdsToNodePathsSettersContext, OverrideIdToNodePaths, OverrideToNodePathGetters, OverrideToNodeSetters, PlaybackRateContextValue, PropStatuses, RemotionAudioContextState, RemotionEnvironment, ResolvedStackLocation, ScheduleAudioNodeOptions, ScheduleAudioNodeResult, InteractivitySchemaField, SequenceNodePath, SequencePropsSubscriptionKey, VideoConfigValues, InteractivitySchema, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, VisibleFieldSchema, WatchRemotionStaticFilesPayload, };
@@ -81,6 +81,7 @@ const RemotionRoot_js_1 = require("./RemotionRoot.js");
81
81
  const RenderAssetManager_js_1 = require("./RenderAssetManager.js");
82
82
  const resolve_video_config_js_1 = require("./resolve-video-config.js");
83
83
  const ResolveCompositionConfig_js_1 = require("./ResolveCompositionConfig.js");
84
+ const sequence_crop_js_1 = require("./sequence-crop.js");
84
85
  const sequence_node_path_js_1 = require("./sequence-node-path.js");
85
86
  const sequence_stack_traces_js_1 = require("./sequence-stack-traces.js");
86
87
  const Sequence_js_1 = require("./Sequence.js");
@@ -91,6 +92,7 @@ const TimelinePosition = __importStar(require("./timeline-position-state.js"));
91
92
  const timeline_position_state_js_1 = require("./timeline-position-state.js");
92
93
  const TimelineContext_js_1 = require("./TimelineContext.js");
93
94
  const truthy_js_1 = require("./truthy.js");
95
+ const use_crop_style_js_1 = require("./use-crop-style.js");
94
96
  const use_current_scale_js_1 = require("./use-current-scale.js");
95
97
  const use_delay_render_js_1 = require("./use-delay-render.js");
96
98
  const use_lazy_component_js_1 = require("./use-lazy-component.js");
@@ -149,6 +151,7 @@ exports.Internals = {
149
151
  sequenceStyleSchema: interactivity_schema_js_1.sequenceStyleSchema,
150
152
  sequenceVisualStyleSchema: interactivity_schema_js_1.sequenceVisualStyleSchema,
151
153
  sequencePremountSchema: interactivity_schema_js_1.sequencePremountSchema,
154
+ sequenceCropSchema: interactivity_schema_js_1.sequenceCropSchema,
152
155
  textSchema: interactivity_schema_js_1.textSchema,
153
156
  transformSchema: interactivity_schema_js_1.transformSchema,
154
157
  premountSchema: interactivity_schema_js_1.premountSchema,
@@ -218,6 +221,8 @@ exports.Internals = {
218
221
  getComponentsToAddStacksTo: enable_sequence_stack_traces_js_1.getComponentsToAddStacksTo,
219
222
  getSequenceComponent: enable_sequence_stack_traces_js_1.getSequenceComponent,
220
223
  getSingleChildComponent: enable_sequence_stack_traces_js_1.getSingleChildComponent,
224
+ getStackForControls: enable_sequence_stack_traces_js_1.getStackForControls,
225
+ REMOTION_INTERNAL_STACK_PROP: enable_sequence_stack_traces_js_1.REMOTION_INTERNAL_STACK_PROP,
221
226
  CurrentScaleContext: use_current_scale_js_1.CurrentScaleContext,
222
227
  PixelDensityContext: use_pixel_density_js_1.PixelDensityContext,
223
228
  PreviewSizeContext: use_current_scale_js_1.PreviewSizeContext,
@@ -273,4 +278,6 @@ exports.Internals = {
273
278
  durationInFramesField: interactivity_schema_js_1.durationInFramesField,
274
279
  freezeField: interactivity_schema_js_1.freezeField,
275
280
  fromField: interactivity_schema_js_1.fromField,
281
+ resolveSequenceCrop: sequence_crop_js_1.resolveSequenceCrop,
282
+ useCropStyle: use_crop_style_js_1.useCropStyle,
276
283
  };
@@ -163,6 +163,47 @@ export declare const NoReactInternals: {
163
163
  readonly default: undefined;
164
164
  readonly description: "Border color";
165
165
  };
166
+ readonly 'style.borderRadius': {
167
+ readonly type: "number";
168
+ readonly default: 0;
169
+ readonly min: 0;
170
+ readonly step: 1;
171
+ readonly description: "Border radius";
172
+ readonly hiddenFromList: false;
173
+ readonly keyframable: true;
174
+ };
175
+ readonly 'style.borderTopLeftRadius': {
176
+ readonly type: "number";
177
+ readonly default: 0;
178
+ readonly min: 0;
179
+ readonly step: 1;
180
+ readonly description: "Top left radius";
181
+ readonly hiddenFromList: false;
182
+ };
183
+ readonly 'style.borderTopRightRadius': {
184
+ readonly type: "number";
185
+ readonly default: 0;
186
+ readonly min: 0;
187
+ readonly step: 1;
188
+ readonly description: "Top right radius";
189
+ readonly hiddenFromList: false;
190
+ };
191
+ readonly 'style.borderBottomRightRadius': {
192
+ readonly type: "number";
193
+ readonly default: 0;
194
+ readonly min: 0;
195
+ readonly step: 1;
196
+ readonly description: "Bottom right radius";
197
+ readonly hiddenFromList: false;
198
+ };
199
+ readonly 'style.borderBottomLeftRadius': {
200
+ readonly type: "number";
201
+ readonly default: 0;
202
+ readonly min: 0;
203
+ readonly step: 1;
204
+ readonly description: "Bottom left radius";
205
+ readonly hiddenFromList: false;
206
+ };
166
207
  readonly 'style.backgroundColor': {
167
208
  readonly type: "color";
168
209
  readonly default: "transparent";
@@ -185,6 +226,46 @@ export declare const NoReactInternals: {
185
226
  readonly hiddenFromList: true;
186
227
  readonly keyframable: false;
187
228
  };
229
+ readonly cropLeft: {
230
+ readonly type: "number";
231
+ readonly default: 0;
232
+ readonly description: "Crop left";
233
+ readonly min: 0;
234
+ readonly max: 1;
235
+ readonly step: 0.01;
236
+ readonly hiddenFromList: false;
237
+ readonly keyframable: true;
238
+ };
239
+ readonly cropRight: {
240
+ readonly type: "number";
241
+ readonly default: 0;
242
+ readonly description: "Crop right";
243
+ readonly min: 0;
244
+ readonly max: 1;
245
+ readonly step: 0.01;
246
+ readonly hiddenFromList: false;
247
+ readonly keyframable: true;
248
+ };
249
+ readonly cropTop: {
250
+ readonly type: "number";
251
+ readonly default: 0;
252
+ readonly description: "Crop top";
253
+ readonly min: 0;
254
+ readonly max: 1;
255
+ readonly step: 0.01;
256
+ readonly hiddenFromList: false;
257
+ readonly keyframable: true;
258
+ };
259
+ readonly cropBottom: {
260
+ readonly type: "number";
261
+ readonly default: 0;
262
+ readonly description: "Crop bottom";
263
+ readonly min: 0;
264
+ readonly max: 1;
265
+ readonly step: 0.01;
266
+ readonly hiddenFromList: false;
267
+ readonly keyframable: true;
268
+ };
188
269
  };
189
270
  readonly none: {};
190
271
  };
@@ -0,0 +1,20 @@
1
+ import type { CSSProperties } from 'react';
2
+ export type ResolvedSequenceCrop = {
3
+ readonly left: number;
4
+ readonly right: number;
5
+ readonly top: number;
6
+ readonly bottom: number;
7
+ };
8
+ type ResolvedSequenceCropWithStyle = ResolvedSequenceCrop & {
9
+ readonly style: CSSProperties | null | undefined;
10
+ };
11
+ export type SequenceCropInput = {
12
+ readonly cropLeft?: number;
13
+ readonly cropRight?: number;
14
+ readonly cropTop?: number;
15
+ readonly cropBottom?: number;
16
+ };
17
+ export declare const resolveSequenceCrop: ({ cropLeft, cropRight, cropTop, cropBottom, }: SequenceCropInput) => ResolvedSequenceCrop;
18
+ export declare const getSequenceCropClipPath: ({ left, right, top, bottom, style, }: ResolvedSequenceCropWithStyle) => string | null;
19
+ export declare const validateSequenceCrop: (crop: SequenceCropInput, componentName?: string) => void;
20
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSequenceCrop = exports.getSequenceCropClipPath = exports.resolveSequenceCrop = void 0;
4
+ const clampCrop = (value) => {
5
+ return Math.min(1, Math.max(0, value !== null && value !== void 0 ? value : 0));
6
+ };
7
+ const resolveAxis = (start, end) => {
8
+ const resolvedStart = clampCrop(start);
9
+ const resolvedEnd = clampCrop(end);
10
+ if (resolvedStart + resolvedEnd > 1) {
11
+ return [0.5, 0.5];
12
+ }
13
+ return [resolvedStart, resolvedEnd];
14
+ };
15
+ const resolveSequenceCrop = ({ cropLeft, cropRight, cropTop, cropBottom, }) => {
16
+ const [left, right] = resolveAxis(cropLeft, cropRight);
17
+ const [top, bottom] = resolveAxis(cropTop, cropBottom);
18
+ return { left, right, top, bottom };
19
+ };
20
+ exports.resolveSequenceCrop = resolveSequenceCrop;
21
+ const getSequenceCropClipPath = ({ left, right, top, bottom, style, }) => {
22
+ if (left === 0 && right === 0 && top === 0 && bottom === 0) {
23
+ return null;
24
+ }
25
+ const serializeRadius = (radius) => typeof radius === 'number' ? `${radius}px` : radius;
26
+ const shorthand = serializeRadius(style === null || style === void 0 ? void 0 : style.borderRadius);
27
+ const longhands = [
28
+ style === null || style === void 0 ? void 0 : style.borderTopLeftRadius,
29
+ style === null || style === void 0 ? void 0 : style.borderTopRightRadius,
30
+ style === null || style === void 0 ? void 0 : style.borderBottomRightRadius,
31
+ style === null || style === void 0 ? void 0 : style.borderBottomLeftRadius,
32
+ ];
33
+ const serializedBorderRadius = shorthand ||
34
+ (longhands.some((radius) => radius !== undefined)
35
+ ? longhands.map((radius) => {
36
+ var _a;
37
+ return (_a = serializeRadius(radius)) !== null && _a !== void 0 ? _a : '0px';
38
+ }).join(' ')
39
+ : undefined);
40
+ const rounded = serializedBorderRadius
41
+ ? ` round ${serializedBorderRadius}`
42
+ : '';
43
+ return `inset(${top * 100}% ${right * 100}% ${bottom * 100}% ${left * 100}%${rounded})`;
44
+ };
45
+ exports.getSequenceCropClipPath = getSequenceCropClipPath;
46
+ const validateSequenceCrop = (crop, componentName = '<Sequence />') => {
47
+ for (const [name, value] of Object.entries(crop)) {
48
+ if (value === undefined) {
49
+ continue;
50
+ }
51
+ if (typeof value !== 'number' || !Number.isFinite(value)) {
52
+ throw new TypeError(`The "${name}" prop of ${componentName} must be a finite number, but got ${String(value)}.`);
53
+ }
54
+ if (value < 0 || value > 1) {
55
+ throw new RangeError(`The "${name}" prop of ${componentName} must be between 0 and 1, but got ${value}.`);
56
+ }
57
+ }
58
+ };
59
+ exports.validateSequenceCrop = validateSequenceCrop;
@@ -53,10 +53,10 @@ const seriesSequenceSchema = {
53
53
  trimBefore: Interactive_js_1.Interactive.sequenceSchema.trimBefore,
54
54
  layout: Interactive_js_1.Interactive.sequenceSchema.layout,
55
55
  };
56
- const SeriesSequenceInner = (0, react_1.forwardRef)(({ offset = 0, className = '', stack = null, _remotionInternalRender = null, ...props }, ref) => {
56
+ const SeriesSequenceInner = (0, react_1.forwardRef)(({ offset = 0, className = '', _remotionInternalRender = null, ...props }, ref) => {
57
57
  (0, is_inside_series_js_1.useRequireToBeInsideSeries)();
58
58
  if (_remotionInternalRender) {
59
- return _remotionInternalRender({ ...props, offset, className: className || undefined, stack }, ref);
59
+ return _remotionInternalRender({ ...props, offset, className: className || undefined }, ref);
60
60
  }
61
61
  return (jsx_runtime_1.jsx(is_inside_series_js_1.IsNotInsideSeriesProvider, { children: props.children }));
62
62
  });
@@ -117,7 +117,7 @@ const SeriesInner = (props) => {
117
117
  return react_1.default.cloneElement(castedElement, {
118
118
  _remotionInternalRender: (resolvedProps, ref) => {
119
119
  const durationInFramesProp = resolvedProps.durationInFrames;
120
- const { durationInFrames: _durationInFrames, children: sequenceChildren, offset: offsetProp, controls, stack, from: _from, name, ...passedProps } = resolvedProps; // `from` is not accepted and must be filtered out if used in JS
120
+ const { durationInFrames: _durationInFrames, children: sequenceChildren, offset: offsetProp, controls, from: _from, name, ...passedProps } = resolvedProps; // `from` is not accepted and must be filtered out if used in JS
121
121
  const offset = validateSeriesSequenceProps({
122
122
  durationInFrames: durationInFramesProp,
123
123
  offset: offsetProp,
@@ -127,7 +127,7 @@ const SeriesInner = (props) => {
127
127
  const currentStartFrame = startFrame + offset;
128
128
  const nextStartFrame = startFrame + durationInFramesProp + offset;
129
129
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
130
- jsx_runtime_1.jsx(SequenceWithoutSchemaWithRef, { ref: ref, name: name || '<Series.Sequence>', _remotionInternalDocumentationLink: name ? undefined : 'https://www.remotion.dev/docs/series', _remotionInternalStack: stack !== null && stack !== void 0 ? stack : undefined, controls: controls !== null && controls !== void 0 ? controls : undefined, from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: jsx_runtime_1.jsx(is_inside_series_js_1.IsNotInsideSeriesProvider, { children: sequenceChildren }) }), renderChildren(i + 1, nextStartFrame)] }));
130
+ jsx_runtime_1.jsx(SequenceWithoutSchemaWithRef, { ref: ref, name: name || '<Series.Sequence>', _remotionInternalDocumentationLink: name ? undefined : 'https://www.remotion.dev/docs/series', controls: controls !== null && controls !== void 0 ? controls : undefined, from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: jsx_runtime_1.jsx(is_inside_series_js_1.IsNotInsideSeriesProvider, { children: sequenceChildren }) }), renderChildren(i + 1, nextStartFrame)] }));
131
131
  },
132
132
  });
133
133
  };
@@ -66,6 +66,7 @@ const encodeBySplitting = (path) => {
66
66
  * @see [Documentation](https://www.remotion.dev/docs/staticfile)
67
67
  */
68
68
  const staticFile = (path) => {
69
+ var _a;
69
70
  if (path === null) {
70
71
  throw new TypeError('null was passed to staticFile()');
71
72
  }
@@ -96,6 +97,15 @@ const staticFile = (path) => {
96
97
  if (includesHex.containsHex) {
97
98
  warnOnce(`WARNING: You seem to pass an already encoded path (path contains ${includesHex.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);
98
99
  }
100
+ if (typeof window !== 'undefined') {
101
+ // This lookup is primarily used by Browser Studio, where virtual assets
102
+ // have blob: URLs. Regular Studio sources are already encoded using the
103
+ // same per-path-segment encoding as the fallback below.
104
+ const matchingStaticFile = (_a = window.remotion_staticFiles) === null || _a === void 0 ? void 0 : _a.find((file) => file.name === trimLeadingSlash(path));
105
+ if (matchingStaticFile) {
106
+ return matchingStaticFile.src;
107
+ }
108
+ }
99
109
  const preprocessed = encodeBySplitting(path);
100
110
  const preparsed = inner(preprocessed);
101
111
  if (!preparsed.startsWith('/')) {
@@ -4,7 +4,11 @@ exports.truncateSrcForLabel = truncateSrcForLabel;
4
4
  // Data URLs like the ones from canvas.toDataURL() can be many megabytes, which makes the delayRender() label
5
5
  // unreadable and bloats log output
6
6
  function truncateSrcForLabel(src) {
7
- if (src.startsWith('data:') && src.length > 100) {
7
+ if (typeof src !== 'string') {
8
+ return String(src);
9
+ }
10
+ if (src.length > 100 &&
11
+ (src.startsWith('data:') || src.startsWith('blob:'))) {
8
12
  return src.slice(0, 60) + '...[' + src.length + ' chars total]';
9
13
  }
10
14
  return src;
@@ -0,0 +1,6 @@
1
+ import type React from 'react';
2
+ import { type SequenceCropInput } from './sequence-crop.js';
3
+ export declare const useCropStyle: ({ cropLeft, cropRight, cropTop, cropBottom, style, componentName, }: SequenceCropInput & {
4
+ readonly style: React.CSSProperties | null;
5
+ readonly componentName: string;
6
+ }) => React.CSSProperties | null;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useCropStyle = void 0;
4
+ const react_1 = require("react");
5
+ const sequence_crop_js_1 = require("./sequence-crop.js");
6
+ const useCropStyle = ({ cropLeft, cropRight, cropTop, cropBottom, style, componentName, }) => {
7
+ (0, sequence_crop_js_1.validateSequenceCrop)({ cropLeft, cropRight, cropTop, cropBottom }, componentName);
8
+ return (0, react_1.useMemo)(() => {
9
+ const cropClipPath = (0, sequence_crop_js_1.getSequenceCropClipPath)({
10
+ ...(0, sequence_crop_js_1.resolveSequenceCrop)({ cropLeft, cropRight, cropTop, cropBottom }),
11
+ style,
12
+ });
13
+ if (cropClipPath === null) {
14
+ return style;
15
+ }
16
+ return { ...style, clipPath: cropClipPath };
17
+ }, [cropBottom, cropLeft, cropRight, cropTop, style]);
18
+ };
19
+ exports.useCropStyle = useCropStyle;
@@ -17,7 +17,6 @@ export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType,
17
17
  duration: number;
18
18
  doesVolumeChange: boolean;
19
19
  nonce: import("./nonce.js").NonceHistoryContext;
20
- rootId: string;
21
20
  finalDisplayName: string;
22
21
  startMediaFrom: number;
23
22
  src: string;
@@ -8,7 +8,6 @@ const get_timeline_duration_js_1 = require("./get-timeline-duration.js");
8
8
  const nonce_js_1 = require("./nonce.js");
9
9
  const SequenceContext_js_1 = require("./SequenceContext.js");
10
10
  const SequenceManager_js_1 = require("./SequenceManager.js");
11
- const timeline_position_state_js_1 = require("./timeline-position-state.js");
12
11
  const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
13
12
  const use_video_config_js_1 = require("./use-video-config.js");
14
13
  const volume_prop_js_1 = require("./volume-prop.js");
@@ -58,7 +57,6 @@ const useBasicMediaInTimeline = ({ volume, mediaVolume, mediaType, src, displayN
58
57
  }, [initialVolume, mediaType, src, volume]);
59
58
  const doesVolumeChange = typeof volume === 'function';
60
59
  const nonce = (0, nonce_js_1.useNonce)();
61
- const { rootId } = (0, timeline_position_state_js_1.useTimelineContext)();
62
60
  const startMediaFrom = 0 - mediaStartsAt + (trimBefore !== null && trimBefore !== void 0 ? trimBefore : 0);
63
61
  const memoizedResult = (0, react_1.useMemo)(() => {
64
62
  return {
@@ -66,7 +64,6 @@ const useBasicMediaInTimeline = ({ volume, mediaVolume, mediaType, src, displayN
66
64
  duration,
67
65
  doesVolumeChange,
68
66
  nonce,
69
- rootId,
70
67
  finalDisplayName: displayName !== null && displayName !== void 0 ? displayName : (0, get_asset_file_name_js_1.getAssetDisplayName)(src),
71
68
  startMediaFrom,
72
69
  src,
@@ -77,7 +74,6 @@ const useBasicMediaInTimeline = ({ volume, mediaVolume, mediaType, src, displayN
77
74
  duration,
78
75
  doesVolumeChange,
79
76
  nonce,
80
- rootId,
81
77
  displayName,
82
78
  src,
83
79
  startMediaFrom,
@@ -92,7 +88,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate,
92
88
  const { registerSequence, unregisterSequence } = (0, react_1.useContext)(SequenceManager_js_1.SequenceManager);
93
89
  const { durationInFrames } = (0, use_video_config_js_1.useVideoConfig)();
94
90
  const mediaStartsAt = (0, use_audio_frame_js_1.useMediaStartsAt)();
95
- const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = (0, exports.useBasicMediaInTimeline)({
91
+ const { volumes, duration, doesVolumeChange, nonce, finalDisplayName } = (0, exports.useBasicMediaInTimeline)({
96
92
  volume,
97
93
  mediaVolume,
98
94
  mediaType,
@@ -128,7 +124,6 @@ const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate,
128
124
  parent: (_c = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _c !== void 0 ? _c : null,
129
125
  displayName: finalDisplayName,
130
126
  documentationLink,
131
- rootId,
132
127
  volume: volumes,
133
128
  showInTimeline: true,
134
129
  nonce: nonce.get(),
@@ -169,7 +164,6 @@ const useMediaInTimeline = ({ volume, mediaVolume, src, mediaType, playbackRate,
169
164
  postmountDisplay,
170
165
  loopDisplay,
171
166
  documentationLink,
172
- rootId,
173
167
  finalDisplayName,
174
168
  isStudio,
175
169
  refForOutline,
@@ -3,4 +3,4 @@
3
3
  * @see [Documentation](https://remotion.dev/docs/version)
4
4
  * @returns {string} The current version of the remotion package
5
5
  */
6
- export declare const VERSION = "4.0.499";
6
+ export declare const VERSION = "4.0.501";
@@ -7,4 +7,4 @@ exports.VERSION = void 0;
7
7
  * @see [Documentation](https://remotion.dev/docs/version)
8
8
  * @returns {string} The current version of the remotion package
9
9
  */
10
- exports.VERSION = '4.0.499';
10
+ exports.VERSION = '4.0.501';