@remotion/studio-shared 4.0.478 → 4.0.481

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,6 +1,6 @@
1
1
  import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, PixelFormat, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
2
2
  import type { HardwareAccelerationOption } from '@remotion/renderer/client';
3
- import type { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, ExtrapolateType, JsxComponentIdentity, SequenceNodePath, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
3
+ import type { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, ExtrapolateType, JsxComponentIdentity, SequenceNodePath, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
4
4
  import type { RecastCodemod, VisualControlChange } from './codemods';
5
5
  import type { ComponentProp } from './component-drag-data';
6
6
  import type { EffectClipboardParam, EffectClipboardPasteType, EffectClipboardSnapshot } from './effect-clipboard-data';
@@ -227,7 +227,7 @@ export type SaveSequencePropEdit = {
227
227
  key: string;
228
228
  value: string;
229
229
  defaultValue: string | null;
230
- schema: SequenceSchema;
230
+ schema: InteractivitySchema;
231
231
  };
232
232
  export type SaveSequencePropsRequest = {
233
233
  edits: SaveSequencePropEdit[];
@@ -254,7 +254,7 @@ type SaveEffectPropsRequestBase = {
254
254
  effectIndex: number;
255
255
  key: string;
256
256
  defaultValue: string | null;
257
- schema: SequenceSchema;
257
+ schema: InteractivitySchema;
258
258
  clientId: string;
259
259
  };
260
260
  export type SaveEffectPropsRequest = (SaveEffectPropsRequestBase & {
@@ -327,7 +327,7 @@ export type DeleteSequenceKeyframe = {
327
327
  nodePath: SequencePropsSubscriptionKey;
328
328
  key: string;
329
329
  frame: number;
330
- schema: SequenceSchema;
330
+ schema: InteractivitySchema;
331
331
  };
332
332
  export type MoveSequenceKeyframe = {
333
333
  fileName: string;
@@ -335,7 +335,7 @@ export type MoveSequenceKeyframe = {
335
335
  key: string;
336
336
  fromFrame: number;
337
337
  toFrame: number;
338
- schema: SequenceSchema;
338
+ schema: InteractivitySchema;
339
339
  };
340
340
  export type AddSequenceKeyframeRequest = {
341
341
  fileName: string;
@@ -343,7 +343,7 @@ export type AddSequenceKeyframeRequest = {
343
343
  key: string;
344
344
  frame: number;
345
345
  value: string;
346
- schema: SequenceSchema;
346
+ schema: InteractivitySchema;
347
347
  clientId: string;
348
348
  };
349
349
  export type AddSequenceKeyframeResponse = SaveSequencePropsResponse;
@@ -354,7 +354,7 @@ export type DeleteEffectKeyframe = {
354
354
  effectIndex: number;
355
355
  key: string;
356
356
  frame: number;
357
- schema: SequenceSchema;
357
+ schema: InteractivitySchema;
358
358
  };
359
359
  export type MoveEffectKeyframe = {
360
360
  fileName: string;
@@ -363,7 +363,7 @@ export type MoveEffectKeyframe = {
363
363
  key: string;
364
364
  fromFrame: number;
365
365
  toFrame: number;
366
- schema: SequenceSchema;
366
+ schema: InteractivitySchema;
367
367
  };
368
368
  export type DeleteKeyframesRequest = {
369
369
  sequenceKeyframes: DeleteSequenceKeyframe[];
@@ -388,7 +388,7 @@ export type AddEffectKeyframeRequest = {
388
388
  key: string;
389
389
  frame: number;
390
390
  value: string;
391
- schema: SequenceSchema;
391
+ schema: InteractivitySchema;
392
392
  clientId: string;
393
393
  };
394
394
  export type AddEffectKeyframeResponse = SaveEffectPropsResponse;
@@ -418,7 +418,7 @@ export type UpdateSequenceKeyframeSettingsRequest = {
418
418
  nodePath: SequencePropsSubscriptionKey;
419
419
  key: string;
420
420
  settings: KeyframeSettings;
421
- schema: SequenceSchema;
421
+ schema: InteractivitySchema;
422
422
  clientId: string;
423
423
  };
424
424
  export type UpdateSequenceKeyframeSettingsResponse = SaveSequencePropsResponse;
@@ -428,7 +428,7 @@ export type UpdateEffectKeyframeSettingsRequest = {
428
428
  effectIndex: number;
429
429
  key: string;
430
430
  settings: KeyframeSettings;
431
- schema: SequenceSchema;
431
+ schema: InteractivitySchema;
432
432
  clientId: string;
433
433
  };
434
434
  export type UpdateEffectKeyframeSettingsResponse = SaveEffectPropsResponse;
@@ -0,0 +1,18 @@
1
+ import type { KeyframeEasing } from './keyframe-easing-presets';
2
+ export type EasingClipboardData = {
3
+ readonly type: 'easing';
4
+ readonly version: 1;
5
+ readonly remotionClipboard: 'easing';
6
+ readonly easing: KeyframeEasing;
7
+ };
8
+ export type EasingClipboardDataParseResult = {
9
+ readonly status: 'valid';
10
+ readonly data: EasingClipboardData;
11
+ } | {
12
+ readonly status: 'unsupported-version';
13
+ readonly version: unknown;
14
+ } | {
15
+ readonly status: 'invalid';
16
+ };
17
+ export declare const parseEasingClipboardDataResult: (value: string) => EasingClipboardDataParseResult;
18
+ export declare const parseEasingClipboardData: (value: string) => EasingClipboardData | null;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseEasingClipboardData = exports.parseEasingClipboardDataResult = void 0;
4
+ const isRecord = (value) => {
5
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
6
+ };
7
+ const isFiniteNumber = (value) => {
8
+ return typeof value === 'number' && Number.isFinite(value);
9
+ };
10
+ const isEasing = (value) => {
11
+ return (isRecord(value) &&
12
+ (value.type === 'linear' ||
13
+ (value.type === 'bezier' &&
14
+ isFiniteNumber(value.x1) &&
15
+ isFiniteNumber(value.y1) &&
16
+ isFiniteNumber(value.x2) &&
17
+ isFiniteNumber(value.y2)) ||
18
+ (value.type === 'spring' &&
19
+ isFiniteNumber(value.damping) &&
20
+ isFiniteNumber(value.mass) &&
21
+ isFiniteNumber(value.stiffness) &&
22
+ typeof value.overshootClamping === 'boolean')));
23
+ };
24
+ const parseEasingClipboardDataResult = (value) => {
25
+ try {
26
+ const parsed = JSON.parse(value);
27
+ if (!isRecord(parsed)) {
28
+ return { status: 'invalid' };
29
+ }
30
+ if (parsed.remotionClipboard !== 'easing') {
31
+ return { status: 'invalid' };
32
+ }
33
+ if (parsed.version !== 1) {
34
+ return {
35
+ status: 'unsupported-version',
36
+ version: parsed.version,
37
+ };
38
+ }
39
+ if (parsed.type !== 'easing' || !isEasing(parsed.easing)) {
40
+ return { status: 'invalid' };
41
+ }
42
+ return {
43
+ status: 'valid',
44
+ data: {
45
+ type: 'easing',
46
+ version: 1,
47
+ remotionClipboard: 'easing',
48
+ easing: parsed.easing,
49
+ },
50
+ };
51
+ }
52
+ catch (_a) {
53
+ return { status: 'invalid' };
54
+ }
55
+ };
56
+ exports.parseEasingClipboardDataResult = parseEasingClipboardDataResult;
57
+ const parseEasingClipboardData = (value) => {
58
+ const result = (0, exports.parseEasingClipboardDataResult)(value);
59
+ if (result.status !== 'valid') {
60
+ return null;
61
+ }
62
+ return result.data;
63
+ };
64
+ exports.parseEasingClipboardData = parseEasingClipboardData;
@@ -0,0 +1,19 @@
1
+ import type { EffectDragData } from './effect-drag-data';
2
+ export type EffectCatalogItem = {
3
+ readonly id: string;
4
+ readonly category: string;
5
+ readonly label: string;
6
+ readonly description: string;
7
+ readonly effect: EffectDragData['effect'];
8
+ };
9
+ export type EffectCatalogCategory = {
10
+ readonly title: string;
11
+ readonly effects: readonly EffectCatalogItem[];
12
+ };
13
+ export declare const getEffectDocumentationPath: (item: EffectCatalogItem) => string;
14
+ export declare const getEffectDocumentationLink: (item: EffectCatalogItem) => string;
15
+ export declare const getEffectPreviewSource: (item: EffectCatalogItem) => string;
16
+ export declare const getEffectPreviewAlt: (item: EffectCatalogItem) => string;
17
+ export declare const makeEffectDragDataFromCatalogItem: (item: EffectCatalogItem) => EffectDragData;
18
+ export declare const getEffectCatalogCategories: (items: readonly EffectCatalogItem[]) => readonly EffectCatalogCategory[];
19
+ export declare const EFFECT_CATALOG: readonly EffectCatalogItem[];