@remotion/mac-cursors 4.0.527 → 4.0.529

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,7 @@
1
1
  import type { CSSProperties } from 'react';
2
2
  import React from 'react';
3
- import type { InteractiveBaseProps, InteractivitySchema } from 'remotion';
4
- export type MacOSCursorProps = InteractiveBaseProps & {
3
+ import type { InteractiveBaseProps, InteractivePremountProps, InteractivitySchema } from 'remotion';
4
+ export type MacOSCursorProps = InteractiveBaseProps & InteractivePremountProps & {
5
5
  readonly cursor?: string;
6
6
  readonly customCursor?: string;
7
7
  readonly className?: string;
@@ -1,6 +1,12 @@
1
1
  // src/MacOSCursor.tsx
2
2
  import React from "react";
3
- import { Interactive, Sequence } from "remotion";
3
+ import {
4
+ Freeze,
5
+ Sequence,
6
+ Interactive,
7
+ Internals,
8
+ useCurrentScale
9
+ } from "remotion";
4
10
 
5
11
  // src/cursor-assets.ts
6
12
  var cursorAssets = {
@@ -215,6 +221,7 @@ var resolveCursor = (cursor) => {
215
221
  import { jsx } from "react/jsx-runtime";
216
222
  var macOSCursorSchema = {
217
223
  ...Interactive.baseSchema,
224
+ ...Interactive.premountSchema,
218
225
  cursor: {
219
226
  type: "enum",
220
227
  default: "default",
@@ -240,7 +247,12 @@ var MacOSCursorInner = ({
240
247
  style,
241
248
  durationInFrames,
242
249
  from,
250
+ premountFor,
251
+ postmountFor,
252
+ styleWhilePremounted,
253
+ styleWhilePostmounted,
243
254
  trimBefore,
255
+ playbackRate,
244
256
  freeze,
245
257
  hidden,
246
258
  name,
@@ -251,42 +263,70 @@ var MacOSCursorInner = ({
251
263
  const refForOutline = React.useRef(null);
252
264
  const width = resolved?.width ?? undefined;
253
265
  const height = resolved?.height ?? undefined;
254
- return /* @__PURE__ */ jsx(Sequence, {
255
- layout: "none",
266
+ const currentScale = useCurrentScale({ dontThrowIfOutsideOfRemotion: true });
267
+ const {
268
+ effectivePremountFor,
269
+ effectivePostmountFor,
270
+ freezeFrame,
271
+ isPremountingOrPostmounting,
272
+ premountingActive,
273
+ postmountingActive,
274
+ premountingStyle
275
+ } = Internals.usePremounting({
256
276
  from: from ?? 0,
257
- trimBefore,
258
277
  durationInFrames: durationInFrames ?? Infinity,
259
- freeze,
260
- hidden,
261
- name: name ?? "<MacOSCursor>",
262
- showInTimeline: showInTimeline ?? true,
263
- controls,
264
- outlineRef: refForOutline,
265
- children: resolved ? /* @__PURE__ */ jsx("svg", {
266
- ref: refForOutline,
267
- className,
268
- width,
269
- height,
270
- viewBox: width && height ? `0 0 ${width} ${height}` : undefined,
271
- xmlns: "http://www.w3.org/2000/svg",
272
- style: {
273
- display: "block",
274
- position: "absolute",
275
- width,
276
- height,
277
- overflow: "visible",
278
- marginLeft: -resolved.hotspot.x,
279
- marginTop: -resolved.hotspot.y,
280
- transformOrigin: `${resolved.hotspot.x}px ${resolved.hotspot.y}px`,
281
- ...style
282
- },
283
- children: /* @__PURE__ */ jsx("image", {
284
- href: resolved.src,
278
+ premountFor: premountFor ?? null,
279
+ postmountFor: postmountFor ?? null,
280
+ style: style ?? null,
281
+ styleWhilePremounted: styleWhilePremounted ?? null,
282
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
283
+ hideWhilePremounted: "opacity"
284
+ });
285
+ return /* @__PURE__ */ jsx(Freeze, {
286
+ frame: freezeFrame,
287
+ active: isPremountingOrPostmounting,
288
+ children: /* @__PURE__ */ jsx(Sequence, {
289
+ layout: "none",
290
+ from: from ?? 0,
291
+ trimBefore,
292
+ playbackRate,
293
+ durationInFrames: durationInFrames ?? Infinity,
294
+ freeze,
295
+ hidden,
296
+ name: name ?? "<MacOSCursor>",
297
+ showInTimeline: showInTimeline ?? true,
298
+ controls,
299
+ outlineRef: refForOutline,
300
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
301
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
302
+ _remotionInternalIsPremounting: premountingActive,
303
+ _remotionInternalIsPostmounting: postmountingActive,
304
+ children: resolved ? /* @__PURE__ */ jsx("svg", {
305
+ ref: refForOutline,
306
+ className,
285
307
  width,
286
308
  height,
287
- preserveAspectRatio: "xMinYMin meet"
288
- })
289
- }) : null
309
+ viewBox: width && height ? `0 0 ${width} ${height}` : undefined,
310
+ xmlns: "http://www.w3.org/2000/svg",
311
+ style: {
312
+ display: "block",
313
+ position: "absolute",
314
+ width,
315
+ height,
316
+ overflow: "visible",
317
+ marginLeft: -resolved.hotspot.x,
318
+ marginTop: -resolved.hotspot.y,
319
+ transformOrigin: `${resolved.hotspot.x}px ${resolved.hotspot.y}px`,
320
+ ...premountingStyle
321
+ },
322
+ children: /* @__PURE__ */ jsx("image", {
323
+ href: resolved.src,
324
+ width,
325
+ height,
326
+ preserveAspectRatio: "xMinYMin meet"
327
+ }, cursor === "custom" ? currentScale : undefined)
328
+ }) : null
329
+ })
290
330
  });
291
331
  };
292
332
  var MacOSCursor = Interactive.withSchema({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/mac-cursors",
3
- "version": "4.0.527",
3
+ "version": "4.0.529",
4
4
  "description": "macOS cursor components for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "url": "https://github.com/remotion-dev/remotion/issues"
25
25
  },
26
26
  "dependencies": {
27
- "remotion": "4.0.527"
27
+ "remotion": "4.0.529"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": ">=16.8.0",
@@ -41,7 +41,7 @@
41
41
  "devDependencies": {
42
42
  "react": "19.2.3",
43
43
  "react-dom": "19.2.3",
44
- "@remotion/eslint-config-internal": "4.0.527",
44
+ "@remotion/eslint-config-internal": "4.0.529",
45
45
  "eslint": "9.19.0",
46
46
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
47
47
  },