@remotion/studio 4.0.429 → 4.0.430

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.
@@ -1,7 +1,6 @@
1
1
  import {
2
- __require,
3
- __toESM
4
- } from "./chunk-6jf1natv.js";
2
+ __require
3
+ } from "./chunk-m17t3vjq.js";
5
4
 
6
5
  // src/renderEntry.tsx
7
6
  import { useContext, useEffect, useRef, useState } from "react";
@@ -208,11 +207,10 @@ var renderContent = (Root) => {
208
207
  renderToDOM(/* @__PURE__ */ jsx("div", {
209
208
  children: /* @__PURE__ */ jsx(DelayedSpinner, {})
210
209
  }));
211
- import("./chunk-0rv5nqc6.js").then(({ StudioInternals }) => {
210
+ import("./chunk-59m8tgkh.js").then(({ StudioInternals }) => {
212
211
  window.remotion_isStudio = true;
213
212
  window.remotion_isReadOnlyStudio = true;
214
213
  window.remotion_inputProps = "{}";
215
- Internals.enableSequenceStackTraces();
216
214
  renderToDOM(/* @__PURE__ */ jsx(StudioInternals.Studio, {
217
215
  readOnly: true,
218
216
  rootComponent: Root
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractFrames = extractFrames;
4
4
  const mediabunny_1 = require("mediabunny");
5
5
  async function extractFrames({ src, timestampsInSeconds, onVideoSample, signal, }) {
6
+ var _a;
6
7
  const input = new mediabunny_1.Input({
7
8
  formats: mediabunny_1.ALL_FORMATS,
8
9
  source: new mediabunny_1.UrlSource(src),
@@ -36,15 +37,30 @@ async function extractFrames({ src, timestampsInSeconds, onVideoSample, signal,
36
37
  return;
37
38
  }
38
39
  const sink = new mediabunny_1.VideoSampleSink(videoTrack);
39
- for await (const videoSample of sink.samplesAtTimestamps(timestamps)) {
40
- if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
41
- videoSample === null || videoSample === void 0 ? void 0 : videoSample.close();
42
- break;
40
+ const sampleIterator = sink.samplesAtTimestamps(timestamps);
41
+ try {
42
+ for await (const videoSample of sampleIterator) {
43
+ if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
44
+ videoSample === null || videoSample === void 0 ? void 0 : videoSample.close();
45
+ break;
46
+ }
47
+ if (!videoSample) {
48
+ continue;
49
+ }
50
+ onVideoSample(videoSample);
43
51
  }
44
- if (!videoSample) {
45
- continue;
52
+ }
53
+ finally {
54
+ // When input.dispose() causes the iterator to throw
55
+ // InputDisposedError, for-await does not call .return() on the
56
+ // iterator (it only does so on `break`). Explicitly call it so
57
+ // the iterator can close any internally buffered VideoSamples.
58
+ try {
59
+ await ((_a = sampleIterator.return) === null || _a === void 0 ? void 0 : _a.call(sampleIterator));
60
+ }
61
+ catch (_b) {
62
+ // Iterator already done or input disposed
46
63
  }
47
- onVideoSample(videoSample);
48
64
  }
49
65
  }
50
66
  catch (error) {
@@ -13,27 +13,13 @@ const getWidthOfTrack = ({ durationInFrames, lastFrame, windowWidth, spatialDura
13
13
  const getTimelineSequenceLayout = ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, premountDisplay, postmountDisplay, }) => {
14
14
  var _a;
15
15
  const maxMediaSequenceDuration = (maxMediaDuration !== null && maxMediaDuration !== void 0 ? maxMediaDuration : Infinity) - startFromMedia;
16
- const lastFrame = ((_a = video.durationInFrames) !== null && _a !== void 0 ? _a : 1) - 1;
17
- let spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames - 1, lastFrame - startFrom);
16
+ const lastFrame = (_a = video.durationInFrames) !== null && _a !== void 0 ? _a : 1;
17
+ const spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames, lastFrame - startFrom);
18
18
  // Unclipped spatial duration: without the lastFrame - startFrom constraint
19
- let naturalSpatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames - 1);
20
- const shouldAddHalfAFrameAtEnd = startFrom + durationInFrames < lastFrame;
21
- const shouldAddHalfAFrameAtStart = startFrom > 0;
22
- if (shouldAddHalfAFrameAtEnd) {
23
- spatialDuration += 0.5;
24
- naturalSpatialDuration += 0.5;
25
- }
26
- if (shouldAddHalfAFrameAtStart) {
27
- spatialDuration += 0.5;
28
- naturalSpatialDuration += 0.5;
29
- }
30
- const startFromWithOffset = shouldAddHalfAFrameAtStart
31
- ? startFrom - 0.5
32
- : startFrom;
19
+ const naturalSpatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames);
33
20
  const marginLeft = lastFrame === 0
34
21
  ? 0
35
- : (startFromWithOffset / lastFrame) *
36
- (windowWidth - timeline_layout_1.TIMELINE_PADDING * 2);
22
+ : (startFrom / lastFrame) * (windowWidth - timeline_layout_1.TIMELINE_PADDING * 2);
37
23
  const nonNegativeMarginLeft = Math.min(marginLeft, 0);
38
24
  const width = getWidthOfTrack({
39
25
  durationInFrames,
@@ -1,5 +1,4 @@
1
- import type { SequenceControls } from 'remotion';
2
- import type { AnyZodSchema } from '../components/RenderModal/SchemaEditor/zod-schema-type';
1
+ import type { SequenceControls, SequenceFieldSchema } from 'remotion';
3
2
  export declare const TIMELINE_PADDING = 16;
4
3
  export declare const TIMELINE_BORDER = 1;
5
4
  export declare const TIMELINE_ITEM_BORDER_BOTTOM = 1;
@@ -8,11 +7,12 @@ export declare const SCHEMA_FIELD_ROW_HEIGHT = 26;
8
7
  export declare const UNSUPPORTED_FIELD_ROW_HEIGHT = 26;
9
8
  export type SchemaFieldInfo = {
10
9
  key: string;
10
+ description: string | undefined;
11
11
  typeName: string;
12
12
  supported: boolean;
13
13
  rowHeight: number;
14
14
  currentValue: unknown;
15
- fieldSchema: AnyZodSchema;
15
+ fieldSchema: SequenceFieldSchema;
16
16
  };
17
17
  export declare const getSchemaFields: (controls: SequenceControls | null) => SchemaFieldInfo[] | null;
18
18
  export declare const getExpandedTrackHeight: (controls: SequenceControls | null) => number;
@@ -1,35 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTimelineLayerHeight = exports.getExpandedTrackHeight = exports.getSchemaFields = exports.UNSUPPORTED_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.TIMELINE_TRACK_EXPANDED_HEIGHT = exports.TIMELINE_ITEM_BORDER_BOTTOM = exports.TIMELINE_BORDER = exports.TIMELINE_PADDING = void 0;
4
- const zod_schema_type_1 = require("../components/RenderModal/SchemaEditor/zod-schema-type");
5
4
  exports.TIMELINE_PADDING = 16;
6
5
  exports.TIMELINE_BORDER = 1;
7
6
  exports.TIMELINE_ITEM_BORDER_BOTTOM = 1;
8
7
  exports.TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
9
8
  exports.SCHEMA_FIELD_ROW_HEIGHT = 26;
10
9
  exports.UNSUPPORTED_FIELD_ROW_HEIGHT = 26;
11
- const SUPPORTED_SCHEMA_TYPES = new Set([
12
- 'number',
13
- 'string',
14
- 'boolean',
15
- 'enum',
16
- 'date',
17
- 'array',
18
- 'object',
19
- 'optional',
20
- 'nullable',
21
- 'default',
22
- ]);
10
+ const SUPPORTED_SCHEMA_TYPES = new Set(['number', 'boolean']);
23
11
  const getSchemaFields = (controls) => {
24
12
  if (!controls) {
25
13
  return null;
26
14
  }
27
- const shape = (0, zod_schema_type_1.getObjectShape)(controls.schema);
28
- return Object.entries(shape).map(([key, fieldSchema]) => {
29
- const typeName = (0, zod_schema_type_1.getZodSchemaType)(fieldSchema);
15
+ return Object.entries(controls.schema).map(([key, fieldSchema]) => {
16
+ const typeName = fieldSchema.type;
30
17
  const supported = SUPPORTED_SCHEMA_TYPES.has(typeName);
31
18
  return {
32
19
  key,
20
+ description: fieldSchema.description,
33
21
  typeName,
34
22
  supported,
35
23
  rowHeight: supported
@@ -44,6 +44,5 @@ const renderToDOM = (content) => {
44
44
  };
45
45
  renderToDOM(jsx_runtime_1.jsx(NoRegisterRoot_1.NoRegisterRoot, {}));
46
46
  remotion_1.Internals.waitForRoot((NewRoot) => {
47
- remotion_1.Internals.enableSequenceStackTraces();
48
47
  renderToDOM(jsx_runtime_1.jsx(Studio_1.Studio, { readOnly: false, rootComponent: NewRoot }));
49
48
  });
@@ -203,7 +203,6 @@ const renderContent = (Root) => {
203
203
  window.remotion_isStudio = true;
204
204
  window.remotion_isReadOnlyStudio = true;
205
205
  window.remotion_inputProps = '{}';
206
- remotion_1.Internals.enableSequenceStackTraces();
207
206
  renderToDOM(jsx_runtime_1.jsx(StudioInternals.Studio, { readOnly: true, rootComponent: Root }));
208
207
  })
209
208
  .catch((err) => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
4
4
  },
5
5
  "name": "@remotion/studio",
6
- "version": "4.0.429",
6
+ "version": "4.0.430",
7
7
  "description": "APIs for interacting with the Remotion Studio",
8
8
  "main": "dist",
9
9
  "sideEffects": false,
@@ -11,7 +11,8 @@
11
11
  "lint": "eslint src",
12
12
  "make": "tsgo -d && bun --env-file=../.env.bundle bundle.ts",
13
13
  "test": "bun test src",
14
- "formatting": "oxfmt src --check"
14
+ "formatting": "oxfmt src --check",
15
+ "format": "oxfmt src"
15
16
  },
16
17
  "author": "Jonny Burger <jonny@remotion.dev>",
17
18
  "contributors": [],
@@ -32,7 +33,7 @@
32
33
  "@remotion/web-renderer": "4.0.429",
33
34
  "@remotion/studio-shared": "4.0.429",
34
35
  "@remotion/zod-types": "4.0.429",
35
- "mediabunny": "1.34.5",
36
+ "mediabunny": "1.35.1",
36
37
  "memfs": "3.4.3",
37
38
  "source-map": "0.7.3",
38
39
  "open": "^8.4.2",
@@ -1,25 +0,0 @@
1
- var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __toESM = (mod, isNodeMode, target) => {
7
- target = mod != null ? __create(__getProtoOf(mod)) : {};
8
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
9
- for (let key of __getOwnPropNames(mod))
10
- if (!__hasOwnProp.call(to, key))
11
- __defProp(to, key, {
12
- get: () => mod[key],
13
- enumerable: true
14
- });
15
- return to;
16
- };
17
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
18
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
19
- }) : x)(function(x) {
20
- if (typeof require !== "undefined")
21
- return require.apply(this, arguments);
22
- throw Error('Dynamic require of "' + x + '" is not supported');
23
- });
24
-
25
- export { __toESM, __require };