@remotion/studio 4.0.498 → 4.0.499

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 (48) hide show
  1. package/dist/components/AssetSelectorItem.js +31 -3
  2. package/dist/components/Canvas.js +162 -7
  3. package/dist/components/CompositionSelector.js +13 -10
  4. package/dist/components/CompositionSelectorItem.js +21 -13
  5. package/dist/components/EditorContent.js +1 -1
  6. package/dist/components/EditorRuler/Ruler.js +5 -3
  7. package/dist/components/ForceSpecificCursor.js +13 -1
  8. package/dist/components/NewComposition/InputDragger.d.ts +27 -0
  9. package/dist/components/NewComposition/InputDragger.js +151 -23
  10. package/dist/components/Splitter/SplitterContainer.d.ts +2 -0
  11. package/dist/components/Splitter/SplitterContainer.js +5 -1
  12. package/dist/components/Splitter/SplitterContext.d.ts +2 -0
  13. package/dist/components/Splitter/SplitterContext.js +2 -0
  14. package/dist/components/Splitter/SplitterElement.js +6 -1
  15. package/dist/components/Splitter/SplitterHandle.js +27 -2
  16. package/dist/components/Timeline/Timeline.js +1 -1
  17. package/dist/components/Timeline/TimelineInOutDragHandler.js +25 -1
  18. package/dist/components/Timeline/TimelineLayerEye.js +4 -1
  19. package/dist/components/Timeline/TimelineSequence.js +6 -1
  20. package/dist/components/Timeline/TimelineSequenceName.js +1 -0
  21. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +5 -1
  22. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +29 -11
  23. package/dist/components/Timeline/use-timeline-keyframe-drag.js +6 -4
  24. package/dist/components/TopPanel.js +2 -1
  25. package/dist/components/composition-drop-preview.d.ts +33 -0
  26. package/dist/components/composition-drop-preview.js +67 -0
  27. package/dist/components/drop-handler-data.d.ts +1 -1
  28. package/dist/components/drop-handler-data.js +27 -60
  29. package/dist/components/effect-drag-and-drop.d.ts +1 -1
  30. package/dist/components/effect-drag-and-drop.js +7 -55
  31. package/dist/components/element-drag-and-drop.d.ts +1 -1
  32. package/dist/components/element-drag-and-drop.js +5 -17
  33. package/dist/components/handle-drop.js +0 -1
  34. package/dist/components/import-assets.d.ts +7 -8
  35. package/dist/components/import-assets.js +2 -9
  36. package/dist/esm/{chunk-7a6q9hk2.js → chunk-pk1zwsn1.js} +3549 -2482
  37. package/dist/esm/internals.mjs +3549 -2482
  38. package/dist/esm/previewEntry.mjs +8342 -7275
  39. package/dist/esm/renderEntry.mjs +1 -1
  40. package/dist/helpers/get-effective-translation.d.ts +13 -1
  41. package/dist/helpers/get-effective-translation.js +12 -6
  42. package/dist/helpers/ruler-canvas-size.d.ts +7 -0
  43. package/dist/helpers/ruler-canvas-size.js +14 -1
  44. package/dist/helpers/use-image-metadata.d.ts +1 -0
  45. package/dist/helpers/use-image-metadata.js +8 -5
  46. package/dist/helpers/use-media-metadata.d.ts +1 -0
  47. package/dist/helpers/use-media-metadata.js +8 -5
  48. package/package.json +13 -12
@@ -212,7 +212,7 @@ var renderContent = (Root) => {
212
212
  renderToDOM(/* @__PURE__ */ jsx("div", {
213
213
  children: /* @__PURE__ */ jsx(DelayedSpinner, {})
214
214
  }));
215
- import("./chunk-7a6q9hk2.js").then(({ StudioInternals }) => {
215
+ import("./chunk-pk1zwsn1.js").then(({ StudioInternals }) => {
216
216
  window.remotion_isStudio = true;
217
217
  window.remotion_isReadOnlyStudio = true;
218
218
  window.remotion_inputProps = "{}";
@@ -13,7 +13,19 @@ export declare const getEffectiveTranslation: ({ canvasSize, scale, compositionH
13
13
  x: number;
14
14
  y: number;
15
15
  };
16
- export declare const getCenterPointWhileScrolling: ({ size, clientX, clientY, compositionWidth, compositionHeight, scale, translation, }: {
16
+ export declare const getUnboundedCenterPointWhileScrolling: ({ size, clientX, clientY, compositionWidth, compositionHeight, scale, translation, }: {
17
+ size: Size;
18
+ clientX: number;
19
+ clientY: number;
20
+ compositionWidth: number;
21
+ compositionHeight: number;
22
+ scale: number;
23
+ translation: Translation;
24
+ }) => {
25
+ centerX: number;
26
+ centerY: number;
27
+ };
28
+ export declare const getCenterPointWhileScrolling: (options: {
17
29
  size: Size;
18
30
  clientX: number;
19
31
  clientY: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyZoomAroundFocalPoint = exports.getCenterPointWhileScrolling = exports.getEffectiveTranslation = void 0;
3
+ exports.applyZoomAroundFocalPoint = exports.getCenterPointWhileScrolling = exports.getUnboundedCenterPointWhileScrolling = exports.getEffectiveTranslation = void 0;
4
4
  const remotion_1 = require("remotion");
5
5
  const smooth_zoom_1 = require("./smooth-zoom");
6
6
  const studio_fit_padding_1 = require("./studio-fit-padding");
@@ -33,16 +33,22 @@ const getEffectiveTranslation = ({ canvasSize, scale, compositionHeight, composi
33
33
  };
34
34
  };
35
35
  exports.getEffectiveTranslation = getEffectiveTranslation;
36
- const getCenterPointWhileScrolling = ({ size, clientX, clientY, compositionWidth, compositionHeight, scale, translation, }) => {
36
+ const getUnboundedCenterPointWhileScrolling = ({ size, clientX, clientY, compositionWidth, compositionHeight, scale, translation, }) => {
37
37
  const mouseLeft = clientX - size.left;
38
38
  const mouseTop = clientY - size.top;
39
39
  const contentLeftPoint = size.width / 2 - (compositionWidth * scale) / 2 - translation.x;
40
40
  const contentTopPoint = size.height / 2 - (compositionHeight * scale) / 2 - translation.y;
41
- const offsetFromVideoLeft = Math.min(compositionWidth, Math.max(0, (mouseLeft - contentLeftPoint) / scale));
42
- const offsetFromVideoTop = Math.min(compositionHeight, Math.max(0, (mouseTop - contentTopPoint) / scale));
43
41
  return {
44
- centerX: offsetFromVideoLeft,
45
- centerY: offsetFromVideoTop,
42
+ centerX: (mouseLeft - contentLeftPoint) / scale,
43
+ centerY: (mouseTop - contentTopPoint) / scale,
44
+ };
45
+ };
46
+ exports.getUnboundedCenterPointWhileScrolling = getUnboundedCenterPointWhileScrolling;
47
+ const getCenterPointWhileScrolling = (options) => {
48
+ const { centerX, centerY } = (0, exports.getUnboundedCenterPointWhileScrolling)(options);
49
+ return {
50
+ centerX: Math.min(options.compositionWidth, Math.max(0, centerX)),
51
+ centerY: Math.min(options.compositionHeight, Math.max(0, centerY)),
46
52
  };
47
53
  };
48
54
  exports.getCenterPointWhileScrolling = getCenterPointWhileScrolling;
@@ -3,3 +3,10 @@ export declare const applyRulerInsetsToCanvasSize: ({ rulersAreVisible, size, }:
3
3
  readonly rulersAreVisible: boolean;
4
4
  readonly size: Size;
5
5
  }) => Size;
6
+ export declare const getRulerCanvasSize: ({ orientation, size, }: {
7
+ readonly orientation: "horizontal" | "vertical";
8
+ readonly size: Size;
9
+ }) => {
10
+ height: number;
11
+ width: number;
12
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyRulerInsetsToCanvasSize = void 0;
3
+ exports.getRulerCanvasSize = exports.applyRulerInsetsToCanvasSize = void 0;
4
4
  const editor_rulers_1 = require("../state/editor-rulers");
5
5
  const applyRulerInsetsToCanvasSize = ({ rulersAreVisible, size, }) => {
6
6
  if (!rulersAreVisible) {
@@ -15,3 +15,16 @@ const applyRulerInsetsToCanvasSize = ({ rulersAreVisible, size, }) => {
15
15
  };
16
16
  };
17
17
  exports.applyRulerInsetsToCanvasSize = applyRulerInsetsToCanvasSize;
18
+ const getRulerCanvasSize = ({ orientation, size, }) => {
19
+ if (orientation === 'vertical') {
20
+ return {
21
+ height: size.height,
22
+ width: editor_rulers_1.RULER_WIDTH,
23
+ };
24
+ }
25
+ return {
26
+ height: editor_rulers_1.RULER_WIDTH,
27
+ width: size.width,
28
+ };
29
+ };
30
+ exports.getRulerCanvasSize = getRulerCanvasSize;
@@ -3,6 +3,7 @@ export type ImageMetadata = {
3
3
  readonly width: number;
4
4
  readonly height: number;
5
5
  };
6
+ export declare const getCachedImageMetadata: (src: string) => ImageMetadata | null;
6
7
  export declare const getImageMetadataFromData: (data: Uint8Array<ArrayBufferLike>) => ImageMetadata | null;
7
8
  export declare const getImageMetadata: (src: string) => Promise<ImageMetadata | null>;
8
9
  export declare const useImageMetadata: (src: string | null) => ImageMetadata | null;
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useImageMetadata = exports.getImageMetadata = exports.getImageMetadataFromData = void 0;
3
+ exports.useImageMetadata = exports.getImageMetadata = exports.getImageMetadataFromData = exports.getCachedImageMetadata = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const react_1 = require("react");
6
6
  const cache = new Map();
7
7
  const pendingRequests = new Map();
8
+ const getCachedImageMetadata = (src) => {
9
+ var _a;
10
+ return (_a = cache.get(src)) !== null && _a !== void 0 ? _a : null;
11
+ };
12
+ exports.getCachedImageMetadata = getCachedImageMetadata;
8
13
  const formatImageType = (fileType) => {
9
14
  if (fileType === 'webp') {
10
15
  return 'WebP';
@@ -58,11 +63,9 @@ const getImageMetadata = (src) => {
58
63
  };
59
64
  exports.getImageMetadata = getImageMetadata;
60
65
  const useImageMetadata = (src) => {
61
- var _a;
62
- const [imageMetadata, setImageMetadata] = (0, react_1.useState)(src ? ((_a = cache.get(src)) !== null && _a !== void 0 ? _a : null) : null);
66
+ const [imageMetadata, setImageMetadata] = (0, react_1.useState)(src ? (0, exports.getCachedImageMetadata)(src) : null);
63
67
  (0, react_1.useEffect)(() => {
64
- var _a;
65
- const cached = src ? ((_a = cache.get(src)) !== null && _a !== void 0 ? _a : null) : null;
68
+ const cached = src ? (0, exports.getCachedImageMetadata)(src) : null;
66
69
  setImageMetadata(cached);
67
70
  if (!src || cached) {
68
71
  return;
@@ -12,5 +12,6 @@ export type MediaMetadata = {
12
12
  hasVideoTrack: boolean | null;
13
13
  hasAudioTrack: boolean | null;
14
14
  };
15
+ export declare const getCachedMediaMetadata: (src: string) => MediaMetadata | null;
15
16
  export declare const getMediaMetadata: (src: string) => Promise<MediaMetadata | null>;
16
17
  export declare const useMediaMetadata: (src: string | null) => MediaMetadata | null;
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMediaMetadata = exports.getMediaMetadata = void 0;
3
+ exports.useMediaMetadata = exports.getMediaMetadata = exports.getCachedMediaMetadata = void 0;
4
4
  const media_utils_1 = require("@remotion/media-utils");
5
5
  const mediabunny_1 = require("mediabunny");
6
6
  const react_1 = require("react");
7
7
  const get_duration_or_compute_1 = require("./get-duration-or-compute");
8
8
  const cache = new Map();
9
9
  const pendingRequests = new Map();
10
+ const getCachedMediaMetadata = (src) => {
11
+ var _a;
12
+ return (_a = cache.get(src)) !== null && _a !== void 0 ? _a : null;
13
+ };
14
+ exports.getCachedMediaMetadata = getCachedMediaMetadata;
10
15
  const safeCall = async (fn) => {
11
16
  try {
12
17
  return await fn();
@@ -116,11 +121,9 @@ const getMediaMetadata = (src) => {
116
121
  };
117
122
  exports.getMediaMetadata = getMediaMetadata;
118
123
  const useMediaMetadata = (src) => {
119
- var _a;
120
- const [mediaMetadata, setMediaMetadata] = (0, react_1.useState)(src ? ((_a = cache.get(src)) !== null && _a !== void 0 ? _a : null) : null);
124
+ const [mediaMetadata, setMediaMetadata] = (0, react_1.useState)(src ? (0, exports.getCachedMediaMetadata)(src) : null);
121
125
  (0, react_1.useEffect)(() => {
122
- var _a;
123
- const cached = src ? ((_a = cache.get(src)) !== null && _a !== void 0 ? _a : null) : null;
126
+ const cached = src ? (0, exports.getCachedMediaMetadata)(src) : null;
124
127
  setMediaMetadata(cached);
125
128
  if (!src || cached) {
126
129
  return;
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.498",
6
+ "version": "4.0.499",
7
7
  "description": "APIs for interacting with the Remotion Studio",
8
8
  "main": "dist",
9
9
  "scripts": {
@@ -24,27 +24,28 @@
24
24
  "react-dom": ">=16.8.0"
25
25
  },
26
26
  "dependencies": {
27
+ "@remotion/drag-and-drop": "4.0.499",
27
28
  "semver": "7.5.3",
28
- "remotion": "4.0.498",
29
- "@remotion/canvas-capture": "4.0.498",
30
- "@remotion/player": "4.0.498",
31
- "@remotion/media-utils": "4.0.498",
32
- "@remotion/renderer": "4.0.498",
33
- "@remotion/web-renderer": "4.0.498",
34
- "@remotion/studio-shared": "4.0.498",
35
- "@remotion/timeline-utils": "4.0.498",
36
- "@remotion/zod-types": "4.0.498",
29
+ "remotion": "4.0.499",
30
+ "@remotion/canvas-capture": "4.0.499",
31
+ "@remotion/player": "4.0.499",
32
+ "@remotion/media-utils": "4.0.499",
33
+ "@remotion/renderer": "4.0.499",
34
+ "@remotion/web-renderer": "4.0.499",
35
+ "@remotion/studio-shared": "4.0.499",
36
+ "@remotion/timeline-utils": "4.0.499",
37
+ "@remotion/zod-types": "4.0.499",
37
38
  "@jridgewell/trace-mapping": "0.3.31",
38
39
  "mediabunny": "1.50.8",
39
40
  "memfs": "3.4.3",
40
41
  "open": "8.4.2",
41
- "zod": "4.3.6"
42
+ "zod": "4.4.3"
42
43
  },
43
44
  "devDependencies": {
44
45
  "react": "19.2.3",
45
46
  "react-dom": "19.2.3",
46
47
  "@types/semver": "7.5.3",
47
- "@remotion/eslint-config-internal": "4.0.498",
48
+ "@remotion/eslint-config-internal": "4.0.499",
48
49
  "eslint": "9.19.0",
49
50
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
50
51
  },