remotion 4.0.534 → 4.0.536

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 (128) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AbsoluteFill.d.ts +2 -7
  3. package/dist/cjs/AbsoluteFill.js +1 -1
  4. package/dist/cjs/Composition.js +15 -20
  5. package/dist/cjs/CompositionManager.d.ts +0 -4
  6. package/dist/cjs/CompositionManagerContext.d.ts +1 -6
  7. package/dist/cjs/CompositionManagerContext.js +0 -4
  8. package/dist/cjs/CompositionManagerProvider.js +77 -169
  9. package/dist/cjs/CompositionRegistryProvider.d.ts +5 -0
  10. package/dist/cjs/CompositionRegistryProvider.js +142 -0
  11. package/dist/cjs/DefaultPremountContext.d.ts +1 -0
  12. package/dist/cjs/DefaultPremountContext.js +6 -0
  13. package/dist/cjs/Folder.js +11 -20
  14. package/dist/cjs/HtmlInCanvas.d.ts +6 -4
  15. package/dist/cjs/HtmlInCanvas.js +179 -32
  16. package/dist/cjs/IFrame.js +40 -8
  17. package/dist/cjs/Img.d.ts +4 -2
  18. package/dist/cjs/Img.js +4 -3
  19. package/dist/cjs/Interactive.d.ts +31 -5
  20. package/dist/cjs/Interactive.js +40 -8
  21. package/dist/cjs/RemotionRoot.js +2 -1
  22. package/dist/cjs/Sequence.d.ts +2 -3
  23. package/dist/cjs/Sequence.js +117 -39
  24. package/dist/cjs/SequenceActivityBoundary.d.ts +10 -0
  25. package/dist/cjs/SequenceActivityBoundary.js +101 -0
  26. package/dist/cjs/SequenceActivityBudget.d.ts +13 -0
  27. package/dist/cjs/SequenceActivityBudget.js +196 -0
  28. package/dist/cjs/SequenceActivitySuspensionProvider.d.ts +4 -0
  29. package/dist/cjs/SequenceActivitySuspensionProvider.js +45 -0
  30. package/dist/cjs/SequenceManager.d.ts +9 -22
  31. package/dist/cjs/SequenceManager.js +54 -196
  32. package/dist/cjs/SequenceRegistryProvider.d.ts +4 -0
  33. package/dist/cjs/SequenceRegistryProvider.js +292 -0
  34. package/dist/cjs/Track.d.ts +10 -3
  35. package/dist/cjs/Track.js +8 -8
  36. package/dist/cjs/animated-image/AnimatedImage.d.ts +3 -2
  37. package/dist/cjs/animated-image/AnimatedImage.js +47 -34
  38. package/dist/cjs/animated-image/canvas.d.ts +2 -1
  39. package/dist/cjs/animated-image/canvas.js +2 -2
  40. package/dist/cjs/animated-image/props.d.ts +2 -1
  41. package/dist/cjs/asset-types.d.ts +4 -0
  42. package/dist/cjs/audio/AudioForPreview.js +54 -41
  43. package/dist/cjs/audio/get-audio-sync-anchor-tolerance.d.ts +1 -0
  44. package/dist/cjs/audio/get-audio-sync-anchor-tolerance.js +11 -0
  45. package/dist/cjs/audio/shared-audio-tags.d.ts +1 -1
  46. package/dist/cjs/audio/shared-audio-tags.js +1 -1
  47. package/dist/cjs/audio/use-audio-context.js +26 -7
  48. package/dist/cjs/canvas-image/CanvasImage.d.ts +3 -2
  49. package/dist/cjs/canvas-image/CanvasImage.js +5 -4
  50. package/dist/cjs/canvas-image/props.d.ts +2 -1
  51. package/dist/cjs/committed-metadata.d.ts +68 -0
  52. package/dist/cjs/committed-metadata.js +39 -0
  53. package/dist/cjs/component-identity.d.ts +6 -0
  54. package/dist/cjs/component-identity.js +39 -0
  55. package/dist/cjs/composition-registry-fallback.d.ts +14 -0
  56. package/dist/cjs/composition-registry-fallback.js +35 -0
  57. package/dist/cjs/create-element-source-proxy.d.ts +4 -0
  58. package/dist/cjs/create-element-source-proxy.js +46 -0
  59. package/dist/cjs/default-premount-in-seconds.d.ts +3 -0
  60. package/dist/cjs/default-premount-in-seconds.js +12 -0
  61. package/dist/cjs/effects/Solid.d.ts +3 -2
  62. package/dist/cjs/effects/Solid.js +5 -4
  63. package/dist/cjs/effects/canvas-pool.d.ts +1 -0
  64. package/dist/cjs/effects/canvas-pool.js +15 -10
  65. package/dist/cjs/effects/effect-types.d.ts +4 -0
  66. package/dist/cjs/effects/index.d.ts +1 -1
  67. package/dist/cjs/effects/run-effect-chain.d.ts +3 -1
  68. package/dist/cjs/effects/run-effect-chain.js +94 -56
  69. package/dist/cjs/effects/use-effect-chain-state.d.ts +2 -1
  70. package/dist/cjs/effects/use-effect-chain-state.js +11 -2
  71. package/dist/cjs/effects/use-memoized-effects.js +96 -17
  72. package/dist/cjs/enable-sequence-stack-traces.d.ts +2 -8
  73. package/dist/cjs/enable-sequence-stack-traces.js +7 -38
  74. package/dist/cjs/freeze.js +4 -1
  75. package/dist/cjs/index.d.ts +1 -3
  76. package/dist/cjs/index.js +0 -2
  77. package/dist/cjs/interactivity-schema.d.ts +50 -14
  78. package/dist/cjs/interactivity-schema.js +32 -4
  79. package/dist/cjs/internals.d.ts +110 -33
  80. package/dist/cjs/internals.js +29 -8
  81. package/dist/cjs/interpolate-keyframed-status.d.ts +4 -0
  82. package/dist/cjs/interpolate-keyframed-status.js +38 -1
  83. package/dist/cjs/interpolate.d.ts +12 -0
  84. package/dist/cjs/interpolate.js +15 -1
  85. package/dist/cjs/no-react.d.ts +5 -1
  86. package/dist/cjs/no-react.js +6 -0
  87. package/dist/cjs/optimistic-sequence-deletion.d.ts +17 -0
  88. package/dist/cjs/optimistic-sequence-deletion.js +114 -0
  89. package/dist/cjs/registry-store.d.ts +17 -0
  90. package/dist/cjs/registry-store.js +68 -0
  91. package/dist/cjs/sequence-activity-context.d.ts +13 -0
  92. package/dist/cjs/sequence-activity-context.js +21 -0
  93. package/dist/cjs/sequence-activity-defaults.d.ts +1 -0
  94. package/dist/cjs/sequence-activity-defaults.js +4 -0
  95. package/dist/cjs/sequence-outline.js +1 -2
  96. package/dist/cjs/sequence-registry-context.d.ts +26 -0
  97. package/dist/cjs/sequence-registry-context.js +71 -0
  98. package/dist/cjs/series/index.d.ts +2 -1
  99. package/dist/cjs/series/index.js +12 -4
  100. package/dist/cjs/timeline-position-state.js +11 -3
  101. package/dist/cjs/timeline-track-context.d.ts +1 -1
  102. package/dist/cjs/timeline-track-context.js +1 -2
  103. package/dist/cjs/use-lazy-component.js +29 -15
  104. package/dist/cjs/use-media-in-timeline.d.ts +7 -14
  105. package/dist/cjs/use-media-in-timeline.js +15 -117
  106. package/dist/cjs/use-premounting.js +3 -4
  107. package/dist/cjs/use-schema.js +3 -1
  108. package/dist/cjs/use-sequence-registration.d.ts +1 -1
  109. package/dist/cjs/use-sequence-registration.js +22 -6
  110. package/dist/cjs/use-timeline-seek.d.ts +1 -0
  111. package/dist/cjs/use-timeline-seek.js +10 -0
  112. package/dist/cjs/use-video.d.ts +7 -2
  113. package/dist/cjs/use-video.js +11 -3
  114. package/dist/cjs/version.d.ts +1 -1
  115. package/dist/cjs/version.js +1 -1
  116. package/dist/cjs/video/VideoForPreview.js +55 -42
  117. package/dist/cjs/video/seek-until-right.js +11 -7
  118. package/dist/cjs/with-interactivity-schema.js +40 -14
  119. package/dist/cjs/wrap-remotion-context.d.ts +15 -3
  120. package/dist/cjs/wrap-remotion-context.js +101 -7
  121. package/dist/esm/index.mjs +3562 -2347
  122. package/dist/esm/no-react.mjs +74 -37
  123. package/dist/esm/version.mjs +1 -1
  124. package/package.json +2 -2
  125. package/dist/cjs/nonce.d.ts +0 -11
  126. package/dist/cjs/nonce.js +0 -42
  127. package/dist/cjs/sequence-order-marker.d.ts +0 -58
  128. package/dist/cjs/sequence-order-marker.js +0 -44
@@ -24,13 +24,28 @@ type StyleAcceptsCssProperties<Style> = true extends StyleMemberAcceptsCssProper
24
24
  type PropsBranchAcceptsStyle<Props> = Props extends unknown ? 'style' extends keyof Props ? StyleAcceptsCssProperties<Props[Extract<'style', keyof Props>]> : false : never;
25
25
  type EveryPropsBranchAcceptsStyle<Props> = [Props] extends [never] ? false : false extends PropsBranchAcceptsStyle<Props> ? false : true;
26
26
  type ComponentAcceptingStyle<Component extends React.ElementType, ReservedKey extends PropertyKey> = ComponentWithoutReservedProps<Component, ReservedKey> & (EveryPropsBranchAcceptsStyle<React.ComponentPropsWithoutRef<Component>> extends true ? unknown : never);
27
- type WithSchema = {
28
- <S extends InteractivitySchema, Component extends React.ElementType>(options: Omit<WithInteractivitySchemaOptions<S, React.ComponentPropsWithoutRef<Component>>, 'Component' | 'supportsEffects'> & {
27
+ type WithSchemaOptions<Options extends {
28
+ schema: InteractivitySchema;
29
+ componentName: string;
30
+ }, WithDefaults extends boolean> = WithDefaults extends true ? Omit<Options, 'schema' | 'componentName' | 'wrapInSequence'> & Partial<Pick<Options, 'schema' | 'componentName'>> : Options;
31
+ type WithSequence<WithDefaults extends boolean> = {
32
+ <S extends InteractivitySchema, Component extends React.ElementType>(options: WithSchemaOptions<Omit<WithInteractivitySchemaOptions<S, React.ComponentPropsWithoutRef<Component>>, 'Component' | 'supportsEffects'> & {
33
+ readonly Component: ComponentWithoutReservedProps<Component, WithSchemaReservedKey | 'style' | 'width' | 'height'>;
34
+ readonly wrapInSequence: true;
35
+ readonly layout: 'absolute-fill';
36
+ }, WithDefaults>): React.FC<React.ComponentPropsWithoutRef<Component> & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps & InteractiveTransformProps & Pick<SequenceProps, 'width' | 'height'> & {
37
+ readonly ref?: React.Ref<HTMLDivElement>;
38
+ }>;
39
+ <S extends InteractivitySchema, Component extends React.ElementType>(options: WithSchemaOptions<Omit<WithInteractivitySchemaOptions<S, React.ComponentPropsWithoutRef<Component>>, 'Component' | 'supportsEffects'> & {
29
40
  readonly Component: ComponentAcceptingStyle<Component, WithSchemaReservedKey>;
30
41
  readonly wrapInSequence: true;
31
- }): React.FC<React.ComponentPropsWithRef<Component> & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps>;
42
+ readonly layout?: 'none';
43
+ }, WithDefaults>): React.FC<React.ComponentPropsWithRef<Component> & InteractiveBaseProps & InteractivePremountProps & InteractiveCropProps>;
44
+ };
45
+ type WithSchema = WithSequence<false> & {
32
46
  <S extends InteractivitySchema, Props extends object>(options: WithInteractivitySchemaOptions<S, Props> & {
33
47
  readonly wrapInSequence?: false;
48
+ readonly layout?: never;
34
49
  }): React.ComponentType<Props>;
35
50
  };
36
51
  /**
@@ -85,6 +100,9 @@ export declare const Interactive: {
85
100
  readonly keyframable: false;
86
101
  };
87
102
  };
103
+ childrenSchema: {
104
+ children: import("./interactivity-schema.js").InteractivitySchemaField;
105
+ };
88
106
  transformSchema: {
89
107
  readonly 'style.transformOrigin': {
90
108
  readonly type: "transform-origin";
@@ -358,7 +376,7 @@ export declare const Interactive: {
358
376
  premountSchema: {
359
377
  readonly premountFor: {
360
378
  readonly type: "number";
361
- readonly default: 0;
379
+ readonly default: undefined;
362
380
  readonly description: "Premount For";
363
381
  readonly min: 0;
364
382
  readonly step: 1;
@@ -532,7 +550,7 @@ export declare const Interactive: {
532
550
  };
533
551
  readonly premountFor: {
534
552
  readonly type: "number";
535
- readonly default: 0;
553
+ readonly default: undefined;
536
554
  readonly description: "Premount For";
537
555
  readonly min: 0;
538
556
  readonly step: 1;
@@ -592,7 +610,15 @@ export declare const Interactive: {
592
610
  };
593
611
  };
594
612
  };
613
+ /**
614
+ * @deprecated Use `Interactive.create()` instead: https://www.remotion.dev/docs/interactive-create
615
+ */
595
616
  withSchema: WithSchema;
617
+ /**
618
+ * @description Creates a component with timing props and editable Studio controls.
619
+ * @see [Documentation](https://www.remotion.dev/docs/interactive-create)
620
+ */
621
+ create: WithSequence<true>;
596
622
  _internalMakeRemotionComponentIdentity: ({ packageName, componentName, }: {
597
623
  readonly packageName: RemotionComponentIdentityPackage;
598
624
  readonly componentName: string;
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Interactive = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
+ const component_identity_js_1 = require("./component-identity.js");
39
40
  const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js");
40
41
  const enable_sequence_stack_traces_js_1 = require("./enable-sequence-stack-traces.js");
41
42
  const freeze_js_1 = require("./freeze.js");
@@ -78,13 +79,13 @@ const interactiveBorderElementSchema = {
78
79
  const interactiveTextElementSchema = {
79
80
  ...interactiveBorderElementSchema,
80
81
  ...interactivity_schema_js_1.textSchema,
81
- ...interactivity_schema_js_1.textContentSchema,
82
+ ...interactivity_schema_js_1.childrenSchema,
82
83
  };
83
84
  const interactiveSvgTextElementSchema = {
84
85
  ...interactiveElementSchema,
85
86
  ...interactivity_schema_js_1.svgPaintSchema,
86
87
  ...interactivity_schema_js_1.textSchema,
87
- ...interactivity_schema_js_1.textContentSchema,
88
+ ...interactivity_schema_js_1.childrenSchema,
88
89
  };
89
90
  const interactiveSvgElementSchema = {
90
91
  ...interactiveElementSchema,
@@ -122,16 +123,17 @@ const withSchema = (untypedOptions) => {
122
123
  (0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(LegacyWrapped);
123
124
  return LegacyWrapped;
124
125
  }
125
- const { Component, componentName, schema, wrapInSequence: _, ...rest } = options;
126
+ const { Component, componentName, schema, wrapInSequence: _, layout = 'none', ...rest } = options;
126
127
  const ComponentWrappedInSequence = (0, react_1.forwardRef)((props, ref) => {
127
128
  const { canvasContent, compositions } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
128
129
  // The render callback runs after the exported wrapper has been initialized.
129
130
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
130
- const componentIdentity = (0, enable_sequence_stack_traces_js_1.resolveComponentIdentity)(Wrapped);
131
+ const componentIdentity = (0, component_identity_js_1.resolveComponentIdentity)(Wrapped);
131
132
  const isCurrentComposition = compositions.some((composition) => (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' &&
132
133
  composition.id === canvasContent.compositionId &&
133
134
  composition.componentFromProps === componentIdentity);
134
- const { durationInFrames, from, trimBefore, playbackRate, loop, freeze, hidden, name, showInTimeline, controls, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, ...componentProps } = props;
135
+ const { width, height, ...propsWithoutDimensions } = props;
136
+ const { durationInFrames, from, trimBefore, playbackRate, loop, freeze, hidden, name, showInTimeline, controls, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, ...componentProps } = layout === 'absolute-fill' ? propsWithoutDimensions : props;
135
137
  const { cropLeft, cropRight, cropTop, cropBottom, style, ...componentPropsWithoutCropping } = componentProps;
136
138
  const { effectivePremountFor, effectivePostmountFor, freezeFrame, isPremountingOrPostmounting, premountingActive, postmountingActive, premountingStyle, } = (0, use_premounting_js_1.usePremounting)({
137
139
  from: from !== null && from !== void 0 ? from : 0,
@@ -155,10 +157,18 @@ const withSchema = (untypedOptions) => {
155
157
  style: premountingStyle,
156
158
  componentName,
157
159
  });
158
- return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.SequenceWithoutSchema, { _remotionInternalSingleChildComponent: isCurrentComposition ? null : componentIdentity, layout: "none", durationInFrames: durationInFrames, from: from, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : componentName, showInTimeline: isCurrentComposition ? false : showInTimeline, controls: controls, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: react_1.default.createElement(Component, {
160
+ return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, children: jsx_runtime_1.jsx(Sequence_js_1.SequenceWithoutSchema, { _remotionInternalSingleChildComponent: isCurrentComposition ? null : componentIdentity, layout: layout, ...(layout === 'absolute-fill'
161
+ ? {
162
+ width,
163
+ height,
164
+ style: { overflow: 'hidden', ...croppedStyle },
165
+ ref: ref,
166
+ }
167
+ : {}), durationInFrames: durationInFrames, from: from, trimBefore: trimBefore, playbackRate: playbackRate, loop: loop, freeze: freeze, hidden: hidden, name: name !== null && name !== void 0 ? name : componentName, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive-create", showInTimeline: isCurrentComposition ? false : showInTimeline, controls: controls, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, children: react_1.default.createElement(Component, {
159
168
  ...componentPropsWithoutCropping,
160
- style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined,
161
- ref,
169
+ ...(layout === 'none'
170
+ ? { style: croppedStyle !== null && croppedStyle !== void 0 ? croppedStyle : undefined, ref }
171
+ : {}),
162
172
  }) }) }));
163
173
  });
164
174
  const Wrapped = (0, with_interactivity_schema_js_1.withInteractivitySchema)({
@@ -177,6 +187,19 @@ const withSchema = (untypedOptions) => {
177
187
  (0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(Wrapped);
178
188
  return Wrapped;
179
189
  };
190
+ const create = (untypedOptions) => {
191
+ var _a;
192
+ var _b, _c;
193
+ const options = untypedOptions;
194
+ return withSchema({
195
+ ...options,
196
+ wrapInSequence: true,
197
+ schema: (_b = options.schema) !== null && _b !== void 0 ? _b : {},
198
+ componentName: (_c = options.componentName) !== null && _c !== void 0 ? _c : (options.Component.displayName ||
199
+ ((_a = options.Component.name) === null || _a === void 0 ? void 0 : _a.replace(/(.+)Inner$/, '$1')) ||
200
+ 'Component'),
201
+ });
202
+ };
180
203
  const makeInteractiveElement = (tag, displayName, schema) => {
181
204
  const Inner = (0, react_1.forwardRef)((propsWithControls, ref) => {
182
205
  const { durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, trimBefore, playbackRate, loop, freeze, hidden, name, showInTimeline, controls, cropLeft, cropRight, cropTop, cropBottom, style, ...props } = propsWithControls;
@@ -240,6 +263,7 @@ const makeInteractiveSvgStrokeElement = (tag, displayName) => {
240
263
  exports.Interactive = {
241
264
  baseSchema: interactivity_schema_js_1.baseSchema,
242
265
  captionsSchema: interactivity_schema_js_1.captionsSchema,
266
+ childrenSchema: interactivity_schema_js_1.childrenSchema,
243
267
  transformSchema: interactivity_schema_js_1.transformSchema,
244
268
  textSchema: interactivity_schema_js_1.textSchema,
245
269
  backgroundSchema: interactivity_schema_js_1.backgroundSchema,
@@ -250,7 +274,15 @@ exports.Interactive = {
250
274
  svgStrokeSchema: interactivity_schema_js_1.svgStrokeSchema,
251
275
  premountSchema: interactivity_schema_js_1.premountSchema,
252
276
  sequenceSchema: interactivity_schema_js_1.sequenceSchema,
277
+ /**
278
+ * @deprecated Use `Interactive.create()` instead: https://www.remotion.dev/docs/interactive-create
279
+ */
253
280
  withSchema,
281
+ /**
282
+ * @description Creates a component with timing props and editable Studio controls.
283
+ * @see [Documentation](https://www.remotion.dev/docs/interactive-create)
284
+ */
285
+ create,
254
286
  _internalMakeRemotionComponentIdentity: makeRemotionComponentIdentity,
255
287
  A: makeInteractiveTextElement('a', '<Interactive.A>'),
256
288
  Article: makeInteractiveTextElement('article', '<Interactive.Article>'),
@@ -11,11 +11,12 @@ const prefetch_state_js_1 = require("./prefetch-state.js");
11
11
  const SequenceManager_js_1 = require("./SequenceManager.js");
12
12
  const TimelineContext_js_1 = require("./TimelineContext.js");
13
13
  const use_media_enabled_js_1 = require("./use-media-enabled.js");
14
+ const use_video_js_1 = require("./use-video.js");
14
15
  const duration_state_js_1 = require("./video/duration-state.js");
15
16
  const RemotionRootContexts = ({ children, numberOfAudioTags, logLevel, audioLatencyHint, previewSampleRate, videoEnabled, audioEnabled, frameState, _experimentalKeepAudioContextAlive, }) => {
16
17
  const logging = (0, react_1.useMemo)(() => {
17
18
  return { logLevel, mountTime: Date.now() };
18
19
  }, [logLevel]);
19
- return (jsx_runtime_1.jsx(log_level_context_js_1.LogLevelContext.Provider, { value: logging, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContextProvider, { frameState: frameState, children: jsx_runtime_1.jsx(use_media_enabled_js_1.MediaEnabledProvider, { videoEnabled: videoEnabled, audioEnabled: audioEnabled, children: jsx_runtime_1.jsx(EditorProps_js_1.EditorPropsProvider, { children: jsx_runtime_1.jsx(prefetch_state_js_1.PrefetchProvider, { children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceManagerProvider, { children: jsx_runtime_1.jsx(duration_state_js_1.DurationsContextProvider, { children: jsx_runtime_1.jsx(buffering_js_1.BufferingProvider, { children: jsx_runtime_1.jsx(shared_audio_tags_js_1.SharedAudioContextProvider, { audioLatencyHint: audioLatencyHint, audioEnabled: audioEnabled, previewSampleRate: previewSampleRate, _experimentalKeepAudioContextAlive: _experimentalKeepAudioContextAlive, children: jsx_runtime_1.jsx(shared_audio_tags_js_1.SharedAudioTagsContextProvider, { numberOfAudioTags: numberOfAudioTags, children: children }) }) }) }) }) }) }) }) }) }));
20
+ return (jsx_runtime_1.jsx(log_level_context_js_1.LogLevelContext.Provider, { value: logging, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContextProvider, { frameState: frameState, children: jsx_runtime_1.jsx(use_media_enabled_js_1.MediaEnabledProvider, { videoEnabled: videoEnabled, audioEnabled: audioEnabled, children: jsx_runtime_1.jsx(EditorProps_js_1.EditorPropsProvider, { children: jsx_runtime_1.jsx(prefetch_state_js_1.PrefetchProvider, { children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceManagerProvider, { children: jsx_runtime_1.jsx(duration_state_js_1.DurationsContextProvider, { children: jsx_runtime_1.jsx(buffering_js_1.BufferingProvider, { children: jsx_runtime_1.jsx(shared_audio_tags_js_1.SharedAudioContextProvider, { audioLatencyHint: audioLatencyHint, audioEnabled: audioEnabled, previewSampleRate: previewSampleRate, _experimentalKeepAudioContextAlive: _experimentalKeepAudioContextAlive, children: jsx_runtime_1.jsx(shared_audio_tags_js_1.SharedAudioTagsContextProvider, { numberOfAudioTags: numberOfAudioTags, children: jsx_runtime_1.jsx(use_video_js_1.VideoProvider, { children: children }) }) }) }) }) }) }) }) }) }) }));
20
21
  };
21
22
  exports.RemotionRootContexts = RemotionRootContexts;
@@ -36,7 +36,7 @@ export type SequencePropsWithoutDuration = {
36
36
  /**
37
37
  * @deprecated For internal use only.
38
38
  */
39
- readonly _remotionInternalTimelineTrack?: Pick<TimelineTrackItem, 'role'>;
39
+ readonly _remotionInternalTimelineTrack?: Pick<TimelineTrackItem, 'role' | 'seriesOffset'>;
40
40
  /**
41
41
  * @deprecated For internal use only.
42
42
  */
@@ -80,8 +80,7 @@ export type SequencePropsWithoutDuration = {
80
80
  src: string;
81
81
  };
82
82
  /**
83
- * @deprecated Remotion Studio discovers rendered elements automatically.
84
- * Remove this prop.
83
+ * @deprecated This prop has no effect. Remotion Studio discovers selection outlines automatically.
85
84
  */
86
85
  readonly outlineRef?: React.RefObject<Element | null> | null;
87
86
  } & LayoutAndStyle;
@@ -1,19 +1,56 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.SequenceWithoutFrom = exports.Sequence = exports.SequenceWithoutSchema = void 0;
4
37
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- /* eslint-disable @typescript-eslint/no-use-before-define */
6
- const react_1 = require("react");
38
+ const react_1 = __importStar(require("react"));
7
39
  const AbsoluteFillElement_js_1 = require("./AbsoluteFillElement.js");
40
+ const committed_metadata_js_1 = require("./committed-metadata.js");
41
+ const component_identity_js_1 = require("./component-identity.js");
42
+ const DefaultPremountContext_js_1 = require("./DefaultPremountContext.js");
8
43
  const enable_sequence_stack_traces_js_1 = require("./enable-sequence-stack-traces.js");
9
44
  const freeze_js_1 = require("./freeze.js");
10
45
  const get_sequence_boundary_tolerance_js_1 = require("./get-sequence-boundary-tolerance.js");
11
46
  const interactivity_schema_js_1 = require("./interactivity-schema.js");
12
47
  const loop_context_js_1 = require("./loop/loop-context.js");
13
48
  const resolve_sequence_duration_js_1 = require("./resolve-sequence-duration.js");
49
+ const sequence_activity_context_js_1 = require("./sequence-activity-context.js");
14
50
  const sequence_crop_js_1 = require("./sequence-crop.js");
15
- const sequence_order_marker_js_1 = require("./sequence-order-marker.js");
16
51
  const sequence_outline_js_1 = require("./sequence-outline.js");
52
+ const SequenceActivityBoundary_js_1 = require("./SequenceActivityBoundary.js");
53
+ const SequenceActivityBudget_js_1 = require("./SequenceActivityBudget.js");
17
54
  const SequenceContext_js_1 = require("./SequenceContext.js");
18
55
  const SequenceManager_js_1 = require("./SequenceManager.js");
19
56
  const is_inside_series_js_1 = require("./series/is-inside-series.js");
@@ -23,18 +60,25 @@ const use_premounting_js_1 = require("./use-premounting.js");
23
60
  const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
24
61
  const use_sequence_registration_js_1 = require("./use-sequence-registration.js");
25
62
  const use_video_config_js_1 = require("./use-video-config.js");
26
- const v5_flag_js_1 = require("./v5-flag.js");
27
63
  const with_interactivity_schema_js_1 = require("./with-interactivity-schema.js");
28
64
  const SeriesContentVisibilityContext = (0, react_1.createContext)(true);
65
+ const SequenceContextProvider = (0, committed_metadata_js_1.withCommittedMetadata)(SequenceContext_js_1.SequenceContext.Provider);
29
66
  const EMPTY_EFFECTS = [];
30
- const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playbackRate = 1, loop = false, freeze, durationInFrames, children, name, height, width, showInTimeline = true, hidden = false, controls, _remotionInternalEffects, _remotionInternalTimelineTrack: timelineTrackItem, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalDocumentationLink: documentationLink, _remotionInternalSingleChildComponent: singleChildComponent, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, outlineRef: passedRefForOutline, cropLeft, cropRight, cropTop, cropBottom, ...other }, ref) => {
31
- var _a, _b, _c, _d, _e, _f;
67
+ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playbackRate = 1, loop = false, freeze, durationInFrames, children, name, height, width, showInTimeline = true, hidden = false, controls, _remotionInternalEffects, _remotionInternalTimelineTrack: timelineTrackItem, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalSingleChildComponent: childComponentOverride, _remotionInternalDocumentationLink: documentationLink, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, cropLeft, cropRight, cropTop, cropBottom, ...other }, ref) => {
68
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
32
69
  const { layout = 'absolute-fill' } = other;
33
70
  const [id] = (0, react_1.useState)(() => String(Math.random()));
34
71
  const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
72
+ const activityRequested = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityContext);
73
+ const parentDormant = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivityDormantContext);
74
+ const activitySuspended = (0, react_1.useContext)(sequence_activity_context_js_1.SequenceActivitySuspensionContext);
75
+ const hadActivity = (0, react_1.useRef)(false);
76
+ const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
77
+ const activityEnabled = activityRequested && env.isStudio && !env.isRendering;
35
78
  const timelineTrack = (0, react_1.useContext)(timeline_track_context_js_1.TimelineTrackContext);
36
79
  const timelineTrackRole = (_a = timelineTrackItem === null || timelineTrackItem === void 0 ? void 0 : timelineTrackItem.role) !== null && _a !== void 0 ? _a : 'clip';
37
- const parentPlaybackRate = (_b = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.playbackRate) !== null && _b !== void 0 ? _b : 1;
80
+ const seriesOffset = (_b = timelineTrackItem === null || timelineTrackItem === void 0 ? void 0 : timelineTrackItem.seriesOffset) !== null && _b !== void 0 ? _b : null;
81
+ const parentPlaybackRate = (_c = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.playbackRate) !== null && _c !== void 0 ? _c : 1;
38
82
  const cumulativePlaybackRate = parentPlaybackRate * playbackRate;
39
83
  const cumulatedFrom = parentSequence
40
84
  ? parentSequence.cumulatedFrom + parentSequence.relativeFrom
@@ -110,7 +154,9 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
110
154
  lastPlaybackRate.current.playbackRate !== playbackRate) {
111
155
  throw new Error('The "playbackRate" prop of <Sequence /> must be constant. Animating playbackRate is not supported.');
112
156
  }
113
- lastPlaybackRate.current = { playbackRate, frame: absoluteFrame };
157
+ (0, react_1.useLayoutEffect)(() => {
158
+ lastPlaybackRate.current = { playbackRate, frame: absoluteFrame };
159
+ }, [absoluteFrame, playbackRate]);
114
160
  const videoConfig = (0, use_video_config_js_1.useVideoConfig)();
115
161
  const effectiveDurationInFrames = (0, resolve_sequence_duration_js_1.resolveSequenceDuration)({
116
162
  durationInFrames,
@@ -130,7 +176,11 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
130
176
  ? contentDurationInFrames / playbackRate
131
177
  : null;
132
178
  let loopIteration = 0;
133
- if (loopPeriod !== null) {
179
+ if (loopPeriod !== null &&
180
+ (!activityEnabled ||
181
+ (!parentDormant &&
182
+ frameInParent >= from &&
183
+ frameInParent < from + actualDurationInFrames))) {
134
184
  const loopsElapsed = (frameInParent - from) / loopPeriod;
135
185
  const nearestIteration = Math.round(loopsElapsed);
136
186
  // Fractional periods and nested playback rates can put an exact loop
@@ -144,7 +194,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
144
194
  const clockFrom = from + loopOffset;
145
195
  const effectiveRelativeFrom = clockFrom - trimBefore / playbackRate;
146
196
  const relativeFrom = effectiveRelativeFrom / parentPlaybackRate;
147
- const absoluteFrom = ((_c = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.absoluteFrom) !== null && _c !== void 0 ? _c : 0) + relativeFrom;
197
+ const absoluteFrom = ((_d = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.absoluteFrom) !== null && _d !== void 0 ? _d : 0) + relativeFrom;
148
198
  // Inside a loop, the local clock ends after `durationInFrames`, except in a final
149
199
  // iteration that the parent cuts short.
150
200
  const localClockEnd = loopPeriod === null
@@ -154,15 +204,12 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
154
204
  trimBefore;
155
205
  const sequenceRegistrationEnabled = (0, react_1.useContext)(SequenceManager_js_1.SequenceRegistrationContext);
156
206
  const canvasOutlinesEnabled = (0, react_1.useContext)(sequence_outline_js_1.SequenceOutlineContext);
157
- const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
158
207
  const shouldDiscoverOutline = env.isStudio || canvasOutlinesEnabled;
159
- const automaticOutlineRef = (0, react_1.useMemo)(() => shouldDiscoverOutline && layout === 'none' && !passedRefForOutline
208
+ const automaticOutlineRef = (0, react_1.useMemo)(() => shouldDiscoverOutline && layout === 'none'
160
209
  ? sequence_outline_js_1.SequenceOutlineInternals.createRef()
161
- : null, [shouldDiscoverOutline, layout, passedRefForOutline]);
210
+ : null, [shouldDiscoverOutline, layout]);
162
211
  const wrapperRefForOutline = (0, react_1.useRef)(null);
163
- const refForOutline = other.layout === 'none'
164
- ? (passedRefForOutline !== null && passedRefForOutline !== void 0 ? passedRefForOutline : automaticOutlineRef)
165
- : (passedRefForOutline !== null && passedRefForOutline !== void 0 ? passedRefForOutline : wrapperRefForOutline);
212
+ const refForOutline = layout === 'none' ? automaticOutlineRef : wrapperRefForOutline;
166
213
  const premounting = (0, react_1.useMemo)(() => {
167
214
  // || is intentional, ?? would not trigger on `false`
168
215
  return ((parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.premounting) ||
@@ -254,13 +301,13 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
254
301
  }, [name]);
255
302
  const resolvedDocumentationLink = documentationLink !== null && documentationLink !== void 0 ? documentationLink : 'https://www.remotion.dev/docs/sequence';
256
303
  const isInsideSeries = (0, react_1.useContext)(is_inside_series_js_1.IsInsideSeriesContext);
257
- // Our assumption: Stack doesnt' change. After we symbolicate we assign it a nodePath
258
- // and if it changes, it would lead to-remounting of the sequence.
259
- const stackRef = (0, react_1.useRef)(null);
260
- stackRef.current = controls
261
- ? ((_e = (_d = (0, enable_sequence_stack_traces_js_1.getStackForControls)(controls)) !== null && _d !== void 0 ? _d : stack) !== null && _e !== void 0 ? _e : null)
304
+ const singleChildComponent = (0, react_1.useMemo)(() => childComponentOverride === undefined
305
+ ? (0, component_identity_js_1.getSingleChildComponent)(children)
306
+ : childComponentOverride, [children, childComponentOverride]);
307
+ const registrationStack = controls
308
+ ? ((_f = (_e = (0, enable_sequence_stack_traces_js_1.getStackForControls)(controls)) !== null && _e !== void 0 ? _e : stack) !== null && _f !== void 0 ? _f : null)
262
309
  : (stack !== null && stack !== void 0 ? stack : null);
263
- const getStack = (0, react_1.useCallback)(() => stackRef.current, []);
310
+ const getStack = (0, react_1.useCallback)(() => registrationStack, [registrationStack]);
264
311
  const registeredFrozenFrame = typeof freeze === 'number' ? freeze : null;
265
312
  const currentFrame = registeredFrozenFrame !== null && registeredFrozenFrame !== void 0 ? registeredFrozenFrame : (absoluteFrame - currentSequenceStart) * cumulativePlaybackRate;
266
313
  const currentFrameRef = (0, react_1.useRef)(currentFrame);
@@ -269,7 +316,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
269
316
  }, [currentFrame]);
270
317
  const getCurrentFrame = (0, react_1.useCallback)(() => currentFrameRef.current, []);
271
318
  const registeredTrimBefore = trimBefore === 0 ? null : trimBefore;
272
- const parentCumulatedNegativeFrom = (_f = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.cumulatedNegativeFrom) !== null && _f !== void 0 ? _f : 0;
319
+ const parentCumulatedNegativeFrom = (_g = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.cumulatedNegativeFrom) !== null && _g !== void 0 ? _g : 0;
273
320
  const startMediaFrom = isMedia && isMedia.type !== 'image'
274
321
  ? isMedia.data.startMediaFrom +
275
322
  parentCumulatedNegativeFrom -
@@ -350,6 +397,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
350
397
  timelineTrack: {
351
398
  ...timelineTrack,
352
399
  role: timelineTrackRole,
400
+ seriesOffset,
353
401
  },
354
402
  }
355
403
  : {};
@@ -392,7 +440,6 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
392
440
  effectRuntimeValues,
393
441
  displayName: timelineClipName,
394
442
  documentationLink: resolvedDocumentationLink,
395
- doesVolumeChange: isMedia.data.doesVolumeChange,
396
443
  duration: actualDurationInFrames,
397
444
  from,
398
445
  trimBefore: registeredTrimBefore,
@@ -409,7 +456,6 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
409
456
  getCurrentFrame,
410
457
  startMediaFrom: startMediaFrom !== null && startMediaFrom !== void 0 ? startMediaFrom : isMedia.data.startMediaFrom,
411
458
  mediaFrameAtSequenceZero,
412
- volume: isMedia.data.volumes,
413
459
  muted: isMedia.data.muted,
414
460
  refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
415
461
  isInsideSeries,
@@ -451,6 +497,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
451
497
  id,
452
498
  timelineTrack,
453
499
  timelineTrackRole,
500
+ seriesOffset,
454
501
  getCurrentFrame,
455
502
  getStack,
456
503
  timelineClipName,
@@ -480,7 +527,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
480
527
  frozenMediaFrame,
481
528
  singleChildComponent,
482
529
  ]);
483
- (0, use_sequence_registration_js_1.useSequenceRegistration)({
530
+ const registration = (0, use_sequence_registration_js_1.useSequenceRegistration)({
484
531
  getSequence: env.isStudio || sequenceRegistrationEnabled
485
532
  ? getSequenceForRegistration
486
533
  : null,
@@ -495,11 +542,33 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
495
542
  parentPlaybackRate,
496
543
  durationInFrames: effectiveDurationInFrames,
497
544
  });
498
- const content = !seriesContentVisible || frameInParent - from < -boundaryTolerance
499
- ? null
500
- : frameInParent - endThreshold >= -boundaryTolerance
501
- ? null
502
- : children;
545
+ const contentVisible = seriesContentVisible &&
546
+ frameInParent - from >= -boundaryTolerance &&
547
+ frameInParent - endThreshold < -boundaryTolerance;
548
+ const activityDormant = parentDormant || !contentVisible;
549
+ const admitted = (0, SequenceActivityBudget_js_1.useSequenceActivityAdmission)(activityEnabled && !hidden
550
+ ? {
551
+ id,
552
+ parent: (_h = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _h !== void 0 ? _h : null,
553
+ compositionId: videoConfig.id,
554
+ from: firstFrame,
555
+ end: cumulatedFrom +
556
+ (from + actualDurationInFrames) / parentPlaybackRate,
557
+ }
558
+ : null);
559
+ const renderActivity = activityEnabled &&
560
+ (!activityDormant ||
561
+ admitted ||
562
+ (activitySuspended && hadActivity.current));
563
+ // A scene visited during playback must keep its children and registrations
564
+ // when it leaves the viewport, even if it was outside the discovery budget.
565
+ const useCommitEffect = (_j = react_1.default.useInsertionEffect) !== null && _j !== void 0 ? _j : react_1.useLayoutEffect;
566
+ useCommitEffect(() => {
567
+ hadActivity.current = renderActivity;
568
+ }, [renderActivity]);
569
+ const content = (activityEnabled ? renderActivity : contentVisible)
570
+ ? children
571
+ : null;
503
572
  const frozenContent = content === null || typeof freeze === 'undefined' || freeze === null ? (content) : (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freeze, children: content }));
504
573
  const loopedContent = frozenContent === null || loopContextValue === null ? (frozenContent) : (jsx_runtime_1.jsx(loop_context_js_1.LoopContext.Provider, { value: loopContextValue, children: frozenContent }));
505
574
  const styleIfThere = other.layout === 'none' ? undefined : other.style;
@@ -535,20 +604,30 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, playba
535
604
  if (ref !== null && layout === 'none') {
536
605
  throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
537
606
  }
607
+ const metadata = (0, react_1.useMemo)(() => shouldDiscoverOutline || registration !== null
608
+ ? {
609
+ type: 'sequence',
610
+ id,
611
+ value: registration,
612
+ outlineChildrenRef: automaticOutlineRef,
613
+ }
614
+ : null, [automaticOutlineRef, id, registration, shouldDiscoverOutline]);
538
615
  if (hidden) {
539
- return shouldDiscoverOutline ? (jsx_runtime_1.jsx(sequence_order_marker_js_1.SequenceOrderMarker, { sequenceId: id, outlineChildrenRef: automaticOutlineRef, children: null })) : null;
616
+ return shouldDiscoverOutline || registration !== null ? (jsx_runtime_1.jsx(SequenceContextProvider, { value: contextValue, _remotionCommitMetadata: metadata, children: null })) : null;
540
617
  }
541
618
  // Retain resolved scene registrations so Studio can recover the natural end
542
619
  // even when seeking past an explicit wrapper trim. Scene contents stay hidden.
543
620
  const retainSeriesRegistration = env.isStudio && canInferDuration;
544
- const renderedContent = loopedContent === null ? (retainSeriesRegistration ? (children) : null) : other.layout === 'none' ? (loopedContent) : (jsx_runtime_1.jsx(AbsoluteFillElement_js_1.AbsoluteFillElement, { ref: sequenceRef, style: defaultStyle, className: other.className, children: loopedContent }));
545
- const sequenceContent = (jsx_runtime_1.jsx(SequenceContext_js_1.SequenceContext.Provider, { value: contextValue, children: retainSeriesRegistration ? (jsx_runtime_1.jsx(SeriesContentVisibilityContext.Provider, { value: content !== null, children: renderedContent })) : (renderedContent) }));
621
+ const contentForLayout = renderActivity ? (jsx_runtime_1.jsx(SequenceActivityBoundary_js_1.SequenceActivityContent, { dormant: activityDormant, children: loopedContent })) : (loopedContent);
622
+ const renderedContent = loopedContent === null ? (retainSeriesRegistration ? (children) : null) : other.layout === 'none' ? (contentForLayout) : (jsx_runtime_1.jsx(AbsoluteFillElement_js_1.AbsoluteFillElement, { ref: sequenceRef, style: defaultStyle, className: other.className, children: contentForLayout }));
623
+ const activityContent = renderActivity ? (jsx_runtime_1.jsx(SequenceActivityBoundary_js_1.SequenceActivityBoundary, { dormant: activityDormant, frame: firstFrame, children: renderedContent })) : (renderedContent);
624
+ const sequenceContent = (jsx_runtime_1.jsx(SequenceContextProvider, { value: contextValue, _remotionCommitMetadata: metadata, children: retainSeriesRegistration ? (jsx_runtime_1.jsx(SeriesContentVisibilityContext.Provider, { value: renderActivity || contentVisible, children: activityContent })) : (activityContent) }));
546
625
  // Keep the provider mounted when track grouping changes so clip state survives.
547
626
  const sequence = (jsx_runtime_1.jsx(timeline_track_context_js_1.TimelineTrackContext.Provider, { value: timelineTrackRole === 'track' ||
548
627
  (timelineTrackRole === 'clip' && !showInTimeline)
549
628
  ? timelineTrack
550
629
  : null, children: sequenceContent }));
551
- return shouldDiscoverOutline ? (jsx_runtime_1.jsx(sequence_order_marker_js_1.SequenceOrderMarker, { sequenceId: id, outlineChildrenRef: automaticOutlineRef, children: sequence })) : (sequence);
630
+ return sequence;
552
631
  };
553
632
  const RegularSequence = (0, react_1.forwardRef)(RegularSequenceRefForwardingFunction);
554
633
  const PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
@@ -570,17 +649,16 @@ const PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
570
649
  styleWhilePostmounted: styleWhilePostmounted !== null && styleWhilePostmounted !== void 0 ? styleWhilePostmounted : null,
571
650
  hideWhilePremounted: 'opacity',
572
651
  });
573
- return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, _remotionInternalIsPremounting: premountingActive, children: jsx_runtime_1.jsx(SequenceInner, { ref: ref, from: from, durationInFrames: durationInFrames, style: premountingStyle !== null && premountingStyle !== void 0 ? premountingStyle : undefined, _remotionInternalPremountDisplay: premountFor, _remotionInternalPostmountDisplay: postmountFor, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...otherProps }) }));
652
+ return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, _remotionInternalIsPremounting: premountingActive, children: jsx_runtime_1.jsx(RegularSequence, { ref: ref, from: from, durationInFrames: durationInFrames, style: premountingStyle !== null && premountingStyle !== void 0 ? premountingStyle : undefined, _remotionInternalPremountDisplay: premountFor, _remotionInternalPostmountDisplay: postmountFor, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...otherProps }) }));
574
653
  };
575
654
  const PremountedPostmountedSequence = (0, react_1.forwardRef)(PremountedPostmountedSequenceRefForwardingFunction);
576
655
  const SequenceRefForwardingFunction = (props, ref) => {
577
656
  var _a;
578
657
  const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
579
658
  const { fps } = (0, use_video_config_js_1.useVideoConfig)();
659
+ const defaultPremountInSeconds = (0, react_1.useContext)(DefaultPremountContext_js_1.DefaultPremountContext);
580
660
  if (props.layout !== 'none' && !env.isRendering) {
581
- const effectivePremountFor = v5_flag_js_1.ENABLE_V5_BREAKING_CHANGES
582
- ? ((_a = props.premountFor) !== null && _a !== void 0 ? _a : fps)
583
- : props.premountFor;
661
+ const effectivePremountFor = (_a = props.premountFor) !== null && _a !== void 0 ? _a : Math.round(defaultPremountInSeconds * fps);
584
662
  if (effectivePremountFor || props.postmountFor) {
585
663
  return (jsx_runtime_1.jsx(PremountedPostmountedSequence, { ref: ref, ...props, premountFor: effectivePremountFor }));
586
664
  }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export declare const SequenceActivityContent: React.NamedExoticComponent<{
3
+ readonly children: React.ReactNode;
4
+ readonly dormant: boolean;
5
+ }>;
6
+ export declare const SequenceActivityBoundary: React.FC<{
7
+ readonly children: React.ReactNode;
8
+ readonly dormant: boolean;
9
+ readonly frame: number;
10
+ }>;