remotion 4.0.499 → 4.0.500

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/cjs/CompositionManager.d.ts +0 -1
  2. package/dist/cjs/HtmlInCanvas.d.ts +43 -3
  3. package/dist/cjs/HtmlInCanvas.js +29 -2
  4. package/dist/cjs/Img.d.ts +43 -3
  5. package/dist/cjs/Img.js +15 -5
  6. package/dist/cjs/Interactive.d.ts +118 -0
  7. package/dist/cjs/Interactive.js +28 -9
  8. package/dist/cjs/Sequence.d.ts +4 -0
  9. package/dist/cjs/Sequence.js +22 -7
  10. package/dist/cjs/TimelineContext.d.ts +0 -1
  11. package/dist/cjs/TimelineContext.js +1 -4
  12. package/dist/cjs/animated-image/AnimatedImage.d.ts +41 -1
  13. package/dist/cjs/animated-image/AnimatedImage.js +12 -2
  14. package/dist/cjs/animated-image/props.d.ts +2 -2
  15. package/dist/cjs/canvas-image/CanvasImage.d.ts +42 -1
  16. package/dist/cjs/canvas-image/CanvasImage.js +12 -2
  17. package/dist/cjs/canvas-image/props.d.ts +6 -2
  18. package/dist/cjs/effects/Solid.d.ts +43 -3
  19. package/dist/cjs/effects/Solid.js +12 -2
  20. package/dist/cjs/index.d.ts +1 -1
  21. package/dist/cjs/interactivity-schema.d.ts +239 -0
  22. package/dist/cjs/interactivity-schema.js +70 -1
  23. package/dist/cjs/internals.d.ts +127 -1
  24. package/dist/cjs/internals.js +5 -0
  25. package/dist/cjs/no-react.d.ts +40 -0
  26. package/dist/cjs/sequence-crop.d.ts +19 -0
  27. package/dist/cjs/sequence-crop.js +45 -0
  28. package/dist/cjs/use-crop-style.d.ts +6 -0
  29. package/dist/cjs/use-crop-style.js +19 -0
  30. package/dist/cjs/use-media-in-timeline.d.ts +0 -1
  31. package/dist/cjs/use-media-in-timeline.js +1 -7
  32. package/dist/cjs/version.d.ts +1 -1
  33. package/dist/cjs/version.js +1 -1
  34. package/dist/cjs/with-interactivity-schema.js +4 -2
  35. package/dist/esm/index.mjs +408 -140
  36. package/dist/esm/no-react.mjs +67 -0
  37. package/dist/esm/version.mjs +1 -1
  38. package/package.json +2 -2
@@ -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
+ borderRadius: style === null || style === void 0 ? void 0 : style.borderRadius,
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.500";
@@ -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.500';
@@ -126,7 +126,7 @@ const withInteractivitySchema = ({ Component, componentName, componentIdentity,
126
126
  const Wrapped = (0, react_1.forwardRef)((props, ref) => {
127
127
  var _a;
128
128
  const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
129
- if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
129
+ if (!env.isStudio || env.isRendering) {
130
130
  return react_1.default.createElement(Component, {
131
131
  ...props,
132
132
  controls: null,
@@ -163,7 +163,9 @@ const withInteractivitySchema = ({ Component, componentName, componentIdentity,
163
163
  stackToOverrideMap[stack] = newOverrideId;
164
164
  return newOverrideId;
165
165
  });
166
- const nodePath = (_a = nodePathMapping.overrideIdToNodePathMappings[overrideId]) !== null && _a !== void 0 ? _a : null;
166
+ const nodePath = env.isReadOnlyStudio
167
+ ? null
168
+ : ((_a = nodePathMapping.overrideIdToNodePathMappings[overrideId]) !== null && _a !== void 0 ? _a : null);
167
169
  // Read the runtime values for every flat key from the JSX props,
168
170
  // memoized on the leaf values so the object reference is stable
169
171
  // when nothing changed — otherwise downstream `useMemo`s churn and