@remotion/studio-shared 4.0.488 → 4.0.490

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, InteractivitySchema, JsxComponentIdentity, SequenceNodePath, SequencePropsSubscriptionKey } from 'remotion';
3
+ import type { _InternalTypes, CannotUpdateSequenceReason, CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponseFalse, CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, ExtrapolateType, InteractivitySchema, InterpolateOutputOption, JsxComponentIdentity, SequenceNodePath, SequencePropsSubscriptionKey } 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';
@@ -430,6 +430,7 @@ export type KeyframeSettings = {
430
430
  right: ExtrapolateType;
431
431
  } | undefined;
432
432
  posterize: number | undefined;
433
+ output: InterpolateOutputOption | undefined;
433
434
  } | {
434
435
  type: 'easing';
435
436
  segmentIndex: number;
@@ -594,6 +595,7 @@ export type ElementInstallRequest = {
594
595
  position: InsertableCompositionElementPosition | null;
595
596
  };
596
597
  export type UpdateElementInstallTargetRequest = {
598
+ requestId: string | null;
597
599
  clientId: string;
598
600
  compositionFile: string | null;
599
601
  compositionId: string | null;
@@ -534,6 +534,28 @@ exports.EFFECT_CATALOG = [
534
534
  },
535
535
  },
536
536
  },
537
+ {
538
+ id: 'effects-linear-progressive-pixelate',
539
+ category: 'Stylize',
540
+ label: 'linearProgressivePixelate()',
541
+ description: 'Gradient-controlled pixelation',
542
+ effect: {
543
+ name: 'linearProgressivePixelate',
544
+ importPath: '@remotion/effects/linear-progressive-pixelate',
545
+ config: {},
546
+ },
547
+ },
548
+ {
549
+ id: 'effects-radial-progressive-pixelate',
550
+ category: 'Stylize',
551
+ label: 'radialProgressivePixelate()',
552
+ description: 'Ellipse-controlled pixelation',
553
+ effect: {
554
+ name: 'radialProgressivePixelate',
555
+ importPath: '@remotion/effects/radial-progressive-pixelate',
556
+ config: {},
557
+ },
558
+ },
537
559
  {
538
560
  id: 'effects-scanlines',
539
561
  category: 'Stylize',
@@ -16,12 +16,14 @@ export type EffectClipboardClamping = {
16
16
  readonly left: EffectClipboardExtrapolateType;
17
17
  readonly right: EffectClipboardExtrapolateType;
18
18
  };
19
+ export type EffectClipboardOutput = 'linear' | 'perceptual-scale';
19
20
  export type EffectClipboardKeyframedParam = {
20
21
  readonly type: 'keyframed';
21
22
  readonly interpolationFunction: EffectClipboardInterpolationFunction;
22
23
  readonly keyframes: EffectClipboardKeyframe[];
23
24
  readonly easing: EffectClipboardEasing[];
24
25
  readonly clamping: EffectClipboardClamping;
26
+ readonly output?: EffectClipboardOutput;
25
27
  readonly posterize?: number;
26
28
  };
27
29
  export type EffectClipboardParam = EffectClipboardStaticParam | EffectClipboardKeyframedParam;
@@ -6,6 +6,7 @@ const isRecord = (value) => {
6
6
  return typeof value === 'object' && value !== null && !Array.isArray(value);
7
7
  };
8
8
  const extrapolateTypes = new Set(['extend', 'identity', 'clamp', 'wrap']);
9
+ const outputOptions = new Set(['linear', 'perceptual-scale']);
9
10
  const isFiniteNumber = (value) => {
10
11
  return typeof value === 'number' && Number.isFinite(value);
11
12
  };
@@ -79,6 +80,7 @@ const isEffectClipboardParam = (value) => {
79
80
  return false;
80
81
  }
81
82
  const { posterize } = value;
83
+ const { output } = value;
82
84
  const easingLength = Array.isArray(value.keyframes) && value.keyframes.length > 0
83
85
  ? value.keyframes.length - 1
84
86
  : null;
@@ -91,6 +93,10 @@ const isEffectClipboardParam = (value) => {
91
93
  value.easing.length === easingLength &&
92
94
  value.easing.every(isEasing) &&
93
95
  isClamping(value.clamping) &&
96
+ (output === undefined ||
97
+ (value.interpolationFunction === 'interpolate' &&
98
+ typeof output === 'string' &&
99
+ outputOptions.has(output))) &&
94
100
  (posterize === undefined || (isFiniteNumber(posterize) && posterize > 0)));
95
101
  };
96
102
  const isEffectClipboardSnapshotV3 = (value) => {
@@ -4,6 +4,7 @@ export type ElementDragData = {
4
4
  type: 'remotion-element';
5
5
  version: 1;
6
6
  element: {
7
+ dependencies: string[];
7
8
  slug: string;
8
9
  displayName: string;
9
10
  sourceCode: string;
@@ -13,7 +14,8 @@ export type ElementDragData = {
13
14
  export declare const isLowercaseElementFileName: (value: unknown) => value is string;
14
15
  export declare const makeElementFileNameFromSlug: (slug: string) => string | null;
15
16
  export declare const getElementComponentNameFromSourceCode: (sourceCode: string) => string | null;
16
- export declare const makeElementDragData: ({ dimensions, displayName, slug, sourceCode, }: {
17
+ export declare const makeElementDragData: ({ dependencies, dimensions, displayName, slug, sourceCode, }: {
18
+ dependencies: string[];
17
19
  slug: string;
18
20
  displayName: string;
19
21
  sourceCode: string;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseElementDragData = exports.makeElementDragData = exports.getElementComponentNameFromSourceCode = exports.makeElementFileNameFromSlug = exports.isLowercaseElementFileName = exports.ELEMENT_DRAG_MIME_TYPE = void 0;
4
4
  const component_drag_data_1 = require("./component-drag-data");
5
+ const package_name_1 = require("./package-name");
5
6
  const drag_mime_types_1 = require("./drag-mime-types");
6
7
  Object.defineProperty(exports, "ELEMENT_DRAG_MIME_TYPE", { enumerable: true, get: function () { return drag_mime_types_1.ELEMENT_DRAG_MIME_TYPE; } });
7
8
  const isRecord = (value) => {
@@ -48,6 +49,11 @@ const isSourceCode = (value) => {
48
49
  value.trim().length > 0 &&
49
50
  value.length < 200000);
50
51
  };
52
+ const isDependencies = (value) => {
53
+ return (Array.isArray(value) &&
54
+ value.length <= 100 &&
55
+ value.every((dependency) => typeof dependency === 'string' && (0, package_name_1.isValidPackageName)(dependency)));
56
+ };
51
57
  const isDimensions = (value) => {
52
58
  if (!isRecord(value)) {
53
59
  return false;
@@ -69,11 +75,12 @@ const getElementComponentNameFromSourceCode = (sourceCode) => {
69
75
  return (0, component_drag_data_1.isComponentIdentifier)(componentName) ? componentName : null;
70
76
  };
71
77
  exports.getElementComponentNameFromSourceCode = getElementComponentNameFromSourceCode;
72
- const makeElementDragData = ({ dimensions, displayName, slug, sourceCode, }) => {
78
+ const makeElementDragData = ({ dependencies, dimensions, displayName, slug, sourceCode, }) => {
73
79
  return {
74
80
  type: 'remotion-element',
75
81
  version: 1,
76
82
  element: {
83
+ dependencies: Array.from(new Set(dependencies)),
77
84
  slug,
78
85
  displayName,
79
86
  sourceCode,
@@ -94,18 +101,20 @@ const parseElementDragData = (value) => {
94
101
  if (!isRecord(parsed.element)) {
95
102
  return null;
96
103
  }
97
- const { dimensions, displayName, slug, sourceCode } = parsed.element;
104
+ const { dependencies, dimensions, displayName, slug, sourceCode } = parsed.element;
98
105
  if (!isSlug(slug) ||
99
106
  !isDisplayName(displayName) ||
100
107
  !isSourceCode(sourceCode) ||
101
108
  (0, exports.getElementComponentNameFromSourceCode)(sourceCode) === null ||
102
109
  (0, exports.makeElementFileNameFromSlug)(slug) === null ||
110
+ (dependencies !== undefined && !isDependencies(dependencies)) ||
103
111
  (dimensions !== undefined &&
104
112
  dimensions !== null &&
105
113
  !isDimensions(dimensions))) {
106
114
  return null;
107
115
  }
108
116
  return (0, exports.makeElementDragData)({
117
+ dependencies: dependencies !== null && dependencies !== void 0 ? dependencies : [],
109
118
  slug,
110
119
  displayName,
111
120
  sourceCode,
@@ -54,6 +54,9 @@ export type EventSourceEvent = {
54
54
  type: 'undo-redo-stack-changed';
55
55
  undoFile: string | null;
56
56
  redoFile: string | null;
57
+ } | {
58
+ type: 'request-element-install-target';
59
+ requestId: string;
57
60
  } | {
58
61
  type: 'element-install-request';
59
62
  request: ElementInstallRequest;
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ export { ProjectInfo } from './project-info';
31
31
  export type { RenderDefaults } from './render-defaults';
32
32
  export { AggregateRenderProgress, ArtifactProgress, BrowserDownloadState, BrowserProgressLog, BundlingState, CopyingState, DownloadProgress, JobProgressCallback, RenderJob, RenderJobWithCleanup, RenderingProgressInput, RequiredChromiumOptions, StitchingProgressInput, UiOpenGlOptions, } from './render-job';
33
33
  export type { CompletedClientRender } from './render-job';
34
- export { getRequiredPackageForEffectImportPath, getRequiredPackageForInsertableElement, } from './required-package';
34
+ export { getRequiredPackageForEffectImportPath, getRequiredPackageForInsertableElement, isValidPackageName, } from './required-package';
35
35
  export { SCHEMA_FIELD_GROUPS, SCHEMA_FIELD_ROW_HEIGHT, getEffectFieldsToShow, getFieldsToShow, getSchemaFieldGroup, } from './schema-field-info';
36
36
  export type { AnySchemaFieldInfo, DragOverrides, EffectSchemaFieldInfo, InteractivitySchemaFieldInfo, PropStatuses, SchemaFieldGroup, SchemaFieldGroupInfo, SchemaFieldInfo, SequenceControls, } from './schema-field-info';
37
37
  export { SFX_DRAG_MIME_TYPE, parseSfxDragData, type SfxDragData, } from './sfx-drag-data';
@@ -39,6 +39,7 @@ export { ScriptLine, SomeStackFrame, StackFrame, SymbolicatedStackFrame, } from
39
39
  export { EnumPath, stringifyDefaultProps } from './stringify-default-props';
40
40
  export { getStudioEntryPoints, type StudioEntryPointPaths, } from './studio-entry-points';
41
41
  export { studioHtml, type StudioHtmlOptions } from './studio-html';
42
+ export type { StudioRuntimeConfig } from './studio-runtime-config';
42
43
  export type { VisualControlChange } from './codemods';
43
44
  export { optimisticAddEffectKeyframe, optimisticAddSequenceKeyframe, } from './optimistic-add-keyframe';
44
45
  export { optimisticDeleteEffectKeyframe, optimisticDeleteEffectKeyframes, optimisticDeleteSequenceKeyframe, optimisticDeleteSequenceKeyframes, } from './optimistic-delete-keyframe';
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.KEYFRAME_EASING_PRESETS = exports.EASE_KEYFRAME_EASING = exports.CUBIC_KEYFRAME_EASING = exports.hotMiddlewareOptions = exports.getProjectName = exports.getLocationFromBuildError = exports.getDefaultOutLocation = exports.getAllSchemaKeys = exports.formatBytes = exports.parseElementDragData = exports.makeElementFileNameFromSlug = exports.makeElementDragData = exports.isLowercaseElementFileName = exports.getElementComponentNameFromSourceCode = exports.ELEMENT_DRAG_MIME_TYPE = exports.parseEffectDragData = exports.EFFECT_DRAG_MIME_TYPE = exports.parseEffectPropClipboardDataResult = exports.parseEffectPropClipboardData = exports.parseEffectClipboardDataResult = exports.parseEffectClipboardData = exports.makeEffectDragDataFromCatalogItem = exports.getEffectPreviewSource = exports.getEffectPreviewAlt = exports.getEffectDocumentationPath = exports.getEffectDocumentationLink = exports.getEffectCatalogCategories = exports.EFFECT_CATALOG = exports.parseEasingClipboardDataResult = exports.parseEasingClipboardData = exports.isRemotionDragMimeType = exports.REMOTION_DRAG_MIME_TYPES = exports.isImageFileType = exports.detectFileType = exports.getDefinePluginDefinitions = exports.DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = exports.parseCompositionDragData = exports.makeCompositionDragData = exports.COMPOSITION_DRAG_MIME_TYPE = exports.parseComponentDragData = exports.makeComponentDragData = exports.isComponentImportPath = exports.isComponentIdentifier = exports.areComponentProps = exports.COMPONENT_DRAG_MIME_TYPE = exports.parseAssetDragData = exports.makeAssetDragData = exports.ASSET_DRAG_MIME_TYPE = exports.stripAnsi = exports.splitAnsi = void 0;
18
- exports.isUrl = exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = exports.optimisticUpdateEffectKeyframeSettings = exports.optimisticUpdateForPropStatuses = exports.optimisticUpdateForEffectPropStatuses = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.studioHtml = exports.getStudioEntryPoints = exports.stringifyDefaultProps = exports.parseSfxDragData = exports.SFX_DRAG_MIME_TYPE = exports.getSchemaFieldGroup = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_GROUPS = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForEffectImportPath = exports.parseSpringEasingConfig = exports.DEFAULT_SPRING_EASING = exports.packages = exports.installableMap = exports.extraPackages = exports.descriptions = exports.apiDocs = exports.DEFAULT_TIMELINE_TRACKS = exports.keyframeInterpolationFunctions = exports.isSchemaFieldKeyframable = exports.isKeyframeInterpolationFunction = exports.isInteractivitySchemaFieldKeyframable = exports.getKeyframeInterpolationFunctionForSchemaField = exports.getKeyframeInterpolationFunction = exports.getPolyKeyframeEasing = exports.getOutKeyframeEasing = exports.getBackKeyframeEasing = exports.QUAD_KEYFRAME_EASING = exports.LINEAR_KEYFRAME_EASING = void 0;
18
+ exports.isUrl = exports.stringifySequenceSubscriptionKey = exports.stringifySequenceExpandedRowKey = exports.optimisticUpdateSequenceKeyframeSettings = exports.optimisticUpdateEffectKeyframeSettings = exports.optimisticUpdateForPropStatuses = exports.optimisticUpdateForEffectPropStatuses = exports.optimisticMoveSequenceKeyframes = exports.optimisticMoveEffectKeyframes = exports.moveKeyframesInPropStatus = exports.canMoveKeyframesWithoutCollisions = exports.optimisticDeleteSequenceKeyframes = exports.optimisticDeleteSequenceKeyframe = exports.optimisticDeleteEffectKeyframes = exports.optimisticDeleteEffectKeyframe = exports.optimisticAddSequenceKeyframe = exports.optimisticAddEffectKeyframe = exports.studioHtml = exports.getStudioEntryPoints = exports.stringifyDefaultProps = exports.parseSfxDragData = exports.SFX_DRAG_MIME_TYPE = exports.getSchemaFieldGroup = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_GROUPS = exports.isValidPackageName = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForEffectImportPath = exports.parseSpringEasingConfig = exports.DEFAULT_SPRING_EASING = exports.packages = exports.installableMap = exports.extraPackages = exports.descriptions = exports.apiDocs = exports.DEFAULT_TIMELINE_TRACKS = exports.keyframeInterpolationFunctions = exports.isSchemaFieldKeyframable = exports.isKeyframeInterpolationFunction = exports.isInteractivitySchemaFieldKeyframable = exports.getKeyframeInterpolationFunctionForSchemaField = exports.getKeyframeInterpolationFunction = exports.getPolyKeyframeEasing = exports.getOutKeyframeEasing = exports.getBackKeyframeEasing = exports.QUAD_KEYFRAME_EASING = exports.LINEAR_KEYFRAME_EASING = void 0;
19
19
  const ansi_1 = require("./ansi");
20
20
  Object.defineProperty(exports, "splitAnsi", { enumerable: true, get: function () { return ansi_1.splitAnsi; } });
21
21
  Object.defineProperty(exports, "stripAnsi", { enumerable: true, get: function () { return ansi_1.stripAnsi; } });
@@ -113,6 +113,7 @@ Object.defineProperty(exports, "parseSpringEasingConfig", { enumerable: true, ge
113
113
  const required_package_1 = require("./required-package");
114
114
  Object.defineProperty(exports, "getRequiredPackageForEffectImportPath", { enumerable: true, get: function () { return required_package_1.getRequiredPackageForEffectImportPath; } });
115
115
  Object.defineProperty(exports, "getRequiredPackageForInsertableElement", { enumerable: true, get: function () { return required_package_1.getRequiredPackageForInsertableElement; } });
116
+ Object.defineProperty(exports, "isValidPackageName", { enumerable: true, get: function () { return required_package_1.isValidPackageName; } });
116
117
  const schema_field_info_1 = require("./schema-field-info");
117
118
  Object.defineProperty(exports, "SCHEMA_FIELD_GROUPS", { enumerable: true, get: function () { return schema_field_info_1.SCHEMA_FIELD_GROUPS; } });
118
119
  Object.defineProperty(exports, "SCHEMA_FIELD_ROW_HEIGHT", { enumerable: true, get: function () { return schema_field_info_1.SCHEMA_FIELD_ROW_HEIGHT; } });
@@ -56,6 +56,7 @@ const addKeyframeToPropStatus = ({ status, fieldKey, frame, value, schema, }) =>
56
56
  easing: [],
57
57
  clamping: { left: 'clamp', right: 'clamp' },
58
58
  posterize: undefined,
59
+ output: undefined,
59
60
  };
60
61
  }
61
62
  return status;
@@ -25,6 +25,7 @@ const applySettingsToStatus = (status, settings) => {
25
25
  ? { clamping: settings.clamping }
26
26
  : {}),
27
27
  ...(settings.type === 'settings' ? { posterize: settings.posterize } : {}),
28
+ ...(settings.type === 'settings' ? { output: settings.output } : {}),
28
29
  ...(settings.type === 'easing'
29
30
  ? {
30
31
  easing: updateEasing({
@@ -1,4 +1,4 @@
1
- export declare const packages: readonly ["svg-3d-engine", "animation-utils", "animated-emoji", "astro-example", "babel-loader", "bugs", "brand", "bundler", "browser-studio", "canvas-capture", "cli", "cloudrun", "codex-plugin", "compositor-darwin-arm64", "compositor-darwin-x64", "compositor-linux-arm64-gnu", "compositor-linux-arm64-musl", "compositor-linux-x64-gnu", "compositor-linux-x64-musl", "compositor-win32-x64-msvc", "core", "create-video", "discord-poster", "docusaurus-plugin", "docs", "enable-scss", "eslint-config", "eslint-config-flat", "eslint-config-internal", "eslint-plugin", "example-without-zod", "example", "fonts", "gif", "google-fonts", "install-whisper-cpp", "it-tests", "react18-tests", "lambda-go-example", "lambda-go", "lambda-php", "lambda-ruby", "lambda-python", "lambda", "lambda-client", "layout-utils", "rounded-text-box", "licensing", "lottie", "mcp", "media-utils", "motion-blur", "noise", "paths", "player-a11y", "player-example", "player", "preload", "renderer", "rive", "shapes", "skia", "promo-pages", "streaming", "serverless", "serverless-client", "skills", "skills-evals", "studio-server", "studio-shared", "studio", "tailwind", "tailwind-v4", "timeline-utils", "test-utils", "three", "transitions", "media-parser", "zod-types", "zod-types-v3", "webcodecs", "convert", "captions", "openai-whisper", "elevenlabs", "compositor", "example-videos", "whisper-web", "media", "remotion-media", "web-renderer", "design", "light-leaks", "starburst", "vercel", "sfx", "effects"];
1
+ export declare const packages: readonly ["svg-3d-engine", "animation-utils", "animated-emoji", "astro-example", "babel-loader", "bugs", "brand", "bundler", "browser-studio", "canvas-capture", "cli", "cloudrun", "codex-plugin", "compositor-darwin-arm64", "compositor-darwin-x64", "compositor-linux-arm64-gnu", "compositor-linux-arm64-musl", "compositor-linux-x64-gnu", "compositor-linux-x64-musl", "compositor-win32-x64-msvc", "core", "create-video", "discord-poster", "docusaurus-plugin", "docs", "enable-scss", "eslint-config", "eslint-config-flat", "eslint-config-internal", "eslint-plugin", "example-without-zod", "example", "fonts", "gif", "google-fonts", "install-whisper-cpp", "it-tests", "react18-tests", "lambda-go-example", "lambda-go", "lambda-php", "lambda-ruby", "lambda-python", "lambda", "lambda-client", "layout-utils", "rounded-text-box", "licensing", "lottie", "mcp", "media-utils", "motion-blur", "noise", "paths", "player-a11y", "player-example", "player", "preload", "renderer", "rive", "shapes", "skia", "promo-pages", "streaming", "serverless", "serverless-client", "skills", "skills-evals", "studio-server", "studio-shared", "studio", "tailwind", "tailwind-v4", "timeline-utils", "test-utils", "three", "transitions", "media-parser", "zod-types", "zod-types-v3", "webcodecs", "convert", "captions", "openai-whisper", "elevenlabs", "compositor", "example-videos", "whisper-web", "media", "remotion-media", "web-renderer", "design", "light-leaks", "rough-notation", "starburst", "vercel", "sfx", "effects"];
2
2
  export type Pkgs = (typeof packages)[number];
3
3
  export type ExtraPackage = {
4
4
  name: string;
@@ -95,6 +95,7 @@ exports.packages = [
95
95
  'web-renderer',
96
96
  'design',
97
97
  'light-leaks',
98
+ 'rough-notation',
98
99
  'starburst',
99
100
  'vercel',
100
101
  'sfx',
@@ -219,7 +220,8 @@ exports.descriptions = {
219
220
  'web-renderer': 'Render videos in the browser (not yet released)',
220
221
  design: 'Design system',
221
222
  'light-leaks': 'Light leak effects for Remotion',
222
- 'player-a11y': 'Accessible wrapper around @remotion/player with WCAG 2.1 AA controls',
223
+ 'rough-notation': 'Rough annotation primitives for Remotion',
224
+ 'player-a11y': 'Internal accessibility wrapper around @remotion/player',
223
225
  starburst: 'Starburst ray effect for Remotion',
224
226
  vercel: 'Render Remotion videos on Vercel Sandbox',
225
227
  sfx: 'Sound effect library',
@@ -283,7 +285,7 @@ exports.installableMap = {
283
285
  noise: true,
284
286
  paths: true,
285
287
  'player-example': false,
286
- 'player-a11y': true,
288
+ 'player-a11y': false,
287
289
  player: true,
288
290
  preload: true,
289
291
  renderer: true,
@@ -319,6 +321,7 @@ exports.installableMap = {
319
321
  'web-renderer': false,
320
322
  design: false,
321
323
  'light-leaks': true,
324
+ 'rough-notation': true,
322
325
  starburst: true,
323
326
  vercel: true,
324
327
  sfx: true,
@@ -375,7 +378,7 @@ exports.apiDocs = {
375
378
  'lambda-python': null,
376
379
  'lambda-ruby': 'https://www.remotion.dev/docs/lambda/ruby',
377
380
  'player-example': null,
378
- 'player-a11y': 'https://www.remotion.dev/docs/player-a11y',
381
+ 'player-a11y': null,
379
382
  'astro-example': null,
380
383
  'lambda-go-example': null,
381
384
  'test-utils': null,
@@ -418,6 +421,7 @@ exports.apiDocs = {
418
421
  'web-renderer': 'https://www.remotion.dev/docs/web-renderer/',
419
422
  design: 'https://www.remotion.dev/design',
420
423
  'light-leaks': 'https://www.remotion.dev/docs/light-leaks',
424
+ 'rough-notation': 'https://www.remotion.dev/docs/rough-notation',
421
425
  starburst: 'https://www.remotion.dev/docs/starburst',
422
426
  vercel: 'https://www.remotion.dev/docs/vercel/api',
423
427
  sfx: 'https://www.remotion.dev/docs/sfx',
@@ -0,0 +1 @@
1
+ export declare const isValidPackageName: (packageName: string) => boolean;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidPackageName = void 0;
4
+ const nodeBuiltinPackages = new Set([
5
+ 'assert',
6
+ 'async_hooks',
7
+ 'buffer',
8
+ 'child_process',
9
+ 'cluster',
10
+ 'console',
11
+ 'constants',
12
+ 'crypto',
13
+ 'dgram',
14
+ 'diagnostics_channel',
15
+ 'dns',
16
+ 'domain',
17
+ 'events',
18
+ 'fs',
19
+ 'http',
20
+ 'http2',
21
+ 'https',
22
+ 'inspector',
23
+ 'module',
24
+ 'net',
25
+ 'os',
26
+ 'path',
27
+ 'perf_hooks',
28
+ 'process',
29
+ 'punycode',
30
+ 'querystring',
31
+ 'readline',
32
+ 'repl',
33
+ 'sea',
34
+ 'sqlite',
35
+ 'stream',
36
+ 'string_decoder',
37
+ 'sys',
38
+ 'test',
39
+ 'timers',
40
+ 'tls',
41
+ 'trace_events',
42
+ 'tty',
43
+ 'url',
44
+ 'util',
45
+ 'v8',
46
+ 'vm',
47
+ 'wasi',
48
+ 'worker_threads',
49
+ 'zlib',
50
+ ]);
51
+ const scopedPackagePattern = /^(?:@([^/]+?)\/)?([^/]+?)$/;
52
+ const reservedPackageNames = new Set(['node_modules', 'favicon.ico']);
53
+ const isValidPackageName = (packageName) => {
54
+ var _a;
55
+ if (packageName.length === 0 ||
56
+ packageName.length > 214 ||
57
+ packageName.startsWith('.') ||
58
+ packageName.startsWith('_') ||
59
+ // npm permits leading hyphens, but package-manager CLIs interpret them as
60
+ // options instead of package names.
61
+ packageName.startsWith('-') ||
62
+ packageName.trim() !== packageName ||
63
+ packageName.toLowerCase() !== packageName ||
64
+ reservedPackageNames.has(packageName) ||
65
+ nodeBuiltinPackages.has(packageName) ||
66
+ /[~'!()*]/.test((_a = packageName.split('/').at(-1)) !== null && _a !== void 0 ? _a : '')) {
67
+ return false;
68
+ }
69
+ if (encodeURIComponent(packageName) === packageName) {
70
+ return true;
71
+ }
72
+ const match = packageName.match(scopedPackagePattern);
73
+ if (!match) {
74
+ return false;
75
+ }
76
+ const [, scope, name] = match;
77
+ return (scope !== undefined &&
78
+ name !== undefined &&
79
+ encodeURIComponent(scope) === scope &&
80
+ encodeURIComponent(name) === name);
81
+ };
82
+ exports.isValidPackageName = isValidPackageName;
@@ -3,6 +3,7 @@ import type { HardwareAccelerationOption } from '@remotion/renderer/client';
3
3
  import type { _InternalTypes } from 'remotion';
4
4
  import type { GitSource } from './git-source';
5
5
  import type { PackageManager } from './package-manager';
6
+ import type { StudioRuntimeConfig } from './studio-runtime-config';
6
7
  export type RenderDefaults = {
7
8
  jpegQuality: number;
8
9
  scale: number;
@@ -55,5 +56,6 @@ declare global {
55
56
  remotion_gitSource: GitSource | null;
56
57
  remotion_installedPackages: string[] | null;
57
58
  remotion_packageManager: PackageManager | 'unknown';
59
+ remotion_studioConfig: StudioRuntimeConfig | null;
58
60
  }
59
61
  }
@@ -1,4 +1,5 @@
1
1
  import type { InsertableCompositionElement } from './api-requests';
2
+ export { isValidPackageName } from './package-name';
2
3
  export declare const getRequiredPackageForImportPath: (importPath: string) => string | null;
3
4
  export declare const getRequiredPackageForInsertableElement: (element: InsertableCompositionElement) => string | null;
4
5
  export declare const getRequiredPackageForEffectImportPath: (importPath: string) => string | null;
@@ -1,16 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRequiredPackageForEffectImportPath = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForImportPath = void 0;
3
+ exports.getRequiredPackageForEffectImportPath = exports.getRequiredPackageForInsertableElement = exports.getRequiredPackageForImportPath = exports.isValidPackageName = void 0;
4
+ const package_name_1 = require("./package-name");
5
+ const package_name_2 = require("./package-name");
6
+ Object.defineProperty(exports, "isValidPackageName", { enumerable: true, get: function () { return package_name_2.isValidPackageName; } });
4
7
  const getRequiredPackageForImportPath = (importPath) => {
5
8
  if (importPath === 'remotion' || importPath.startsWith('.')) {
6
9
  return null;
7
10
  }
8
11
  if (importPath.startsWith('@')) {
9
12
  const [scope, scopedPackageName] = importPath.split('/');
10
- return scope && scopedPackageName ? `${scope}/${scopedPackageName}` : null;
13
+ const scopedPackage = scope && scopedPackageName ? `${scope}/${scopedPackageName}` : null;
14
+ return scopedPackage && (0, package_name_1.isValidPackageName)(scopedPackage)
15
+ ? scopedPackage
16
+ : null;
11
17
  }
12
18
  const [packageName] = importPath.split('/');
13
- return packageName || null;
19
+ return packageName && (0, package_name_1.isValidPackageName)(packageName) ? packageName : null;
14
20
  };
15
21
  exports.getRequiredPackageForImportPath = getRequiredPackageForImportPath;
16
22
  const getRequiredPackageForInsertableElement = (element) => {
@@ -2,6 +2,7 @@ import type { LogLevel, StaticFile } from 'remotion';
2
2
  import type { GitSource } from './git-source';
3
3
  import type { PackageManager } from './package-manager';
4
4
  import type { RenderDefaults } from './render-defaults';
5
+ import type { StudioRuntimeConfig } from './studio-runtime-config';
5
6
  export type StudioHtmlOptions = {
6
7
  staticHash: string;
7
8
  publicPath: string;
@@ -28,5 +29,6 @@ export type StudioHtmlOptions = {
28
29
  mode: 'dev' | 'bundle';
29
30
  bundleScriptUrl?: string;
30
31
  readOnlyStudio?: boolean;
32
+ studioRuntimeConfig?: StudioRuntimeConfig;
31
33
  };
32
- export declare const studioHtml: ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, }: StudioHtmlOptions) => string;
34
+ export declare const studioHtml: ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }: StudioHtmlOptions) => string;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.studioHtml = void 0;
4
4
  const remotion_1 = require("remotion");
5
- const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, }) => {
5
+ const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHash, remotionRoot, studioServerCommand, renderQueue, completedClientRenders, numberOfAudioTags, publicFiles, includeFavicon, title, renderDefaults, publicFolderExists, gitSource, projectName, installedDependencies, packageManager, audioLatencyHint, sampleRate, logLevel, mode, bundleScriptUrl, readOnlyStudio, studioRuntimeConfig, }) => {
6
6
  const scriptUrl = bundleScriptUrl !== null && bundleScriptUrl !== void 0 ? bundleScriptUrl : `${publicPath}bundle.js`;
7
7
  return `
8
8
  <!DOCTYPE html>
@@ -29,6 +29,7 @@ const studioHtml = ({ publicPath, editorName, inputProps, envVariables, staticHa
29
29
  <script>window.remotion_publicPath = ${JSON.stringify(publicPath)};</script>
30
30
  <script>window.remotion_audioEnabled = true;</script>
31
31
  <script>window.remotion_videoEnabled = true;</script>
32
+ <script>window.remotion_studioConfig = ${JSON.stringify(studioRuntimeConfig !== null && studioRuntimeConfig !== void 0 ? studioRuntimeConfig : null)};</script>
32
33
  <script>window.remotion_renderDefaults = ${JSON.stringify(renderDefaults)};</script>
33
34
  <script>window.remotion_cwd = ${JSON.stringify(remotionRoot)};</script>
34
35
  <script>window.remotion_studioServerCommand = ${studioServerCommand ? JSON.stringify(studioServerCommand) : 'null'};</script>
@@ -0,0 +1,8 @@
1
+ export type StudioRuntimeConfig = {
2
+ readonly maxTimelineTracks: number | null;
3
+ readonly askAIEnabled: boolean;
4
+ readonly interactivityEnabled: boolean;
5
+ readonly keyboardShortcutsEnabled: boolean;
6
+ readonly bufferStateDelayInMilliseconds: number | null;
7
+ readonly experimentalClientSideRenderingEnabled: boolean;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio-shared"
4
4
  },
5
5
  "name": "@remotion/studio-shared",
6
- "version": "4.0.488",
6
+ "version": "4.0.490",
7
7
  "description": "Internal package for shared objects between the Studio backend and frontend",
8
8
  "main": "dist",
9
9
  "scripts": {
@@ -20,11 +20,11 @@
20
20
  "url": "https://github.com/remotion-dev/remotion/issues"
21
21
  },
22
22
  "dependencies": {
23
- "remotion": "4.0.488"
23
+ "remotion": "4.0.490"
24
24
  },
25
25
  "devDependencies": {
26
- "@remotion/renderer": "4.0.488",
27
- "@remotion/eslint-config-internal": "4.0.488",
26
+ "@remotion/renderer": "4.0.490",
27
+ "@remotion/eslint-config-internal": "4.0.490",
28
28
  "eslint": "9.19.0",
29
29
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
30
30
  },
@@ -1,22 +0,0 @@
1
- export declare const SHAPE_DRAG_MIME_TYPE = "application/vnd.remotion.shape+json";
2
- export declare const shapeNames: readonly ["Arrow", "Circle", "Ellipse", "Heart", "Pie", "Polygon", "Rect", "Star", "Triangle"];
3
- export type ShapeName = (typeof shapeNames)[number];
4
- export type ShapeAttribute = {
5
- name: string;
6
- value: string | number | boolean;
7
- };
8
- export type ShapeDragData = {
9
- type: 'remotion-shape';
10
- version: 1;
11
- shape: ShapeName;
12
- attributes: ShapeAttribute[];
13
- };
14
- export declare const isShapeName: (value: unknown) => value is "Arrow" | "Circle" | "Ellipse" | "Heart" | "Pie" | "Polygon" | "Rect" | "Star" | "Triangle";
15
- export declare const isShapeAttributeName: (value: unknown) => value is string;
16
- export declare const isShapeAttribute: (value: unknown) => value is ShapeAttribute;
17
- export declare const areShapeAttributes: (value: unknown) => value is ShapeAttribute[];
18
- export declare const makeShapeDragData: ({ attributes, shape, }: {
19
- attributes: ShapeAttribute[];
20
- shape: "Arrow" | "Circle" | "Ellipse" | "Heart" | "Pie" | "Polygon" | "Rect" | "Star" | "Triangle";
21
- }) => ShapeDragData;
22
- export declare const parseShapeDragData: (value: string) => ShapeDragData | null;
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseShapeDragData = exports.makeShapeDragData = exports.areShapeAttributes = exports.isShapeAttribute = exports.isShapeAttributeName = exports.isShapeName = exports.shapeNames = exports.SHAPE_DRAG_MIME_TYPE = void 0;
4
- exports.SHAPE_DRAG_MIME_TYPE = 'application/vnd.remotion.shape+json';
5
- exports.shapeNames = [
6
- 'Arrow',
7
- 'Circle',
8
- 'Ellipse',
9
- 'Heart',
10
- 'Pie',
11
- 'Polygon',
12
- 'Rect',
13
- 'Star',
14
- 'Triangle',
15
- ];
16
- const isRecord = (value) => {
17
- return typeof value === 'object' && value !== null && !Array.isArray(value);
18
- };
19
- const isShapeName = (value) => {
20
- return typeof value === 'string' && exports.shapeNames.includes(value);
21
- };
22
- exports.isShapeName = isShapeName;
23
- const isShapeAttributeName = (value) => {
24
- return (typeof value === 'string' &&
25
- value !== 'style' &&
26
- /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value));
27
- };
28
- exports.isShapeAttributeName = isShapeAttributeName;
29
- const isShapeAttribute = (value) => {
30
- if (!isRecord(value)) {
31
- return false;
32
- }
33
- if (!(0, exports.isShapeAttributeName)(value.name)) {
34
- return false;
35
- }
36
- return (typeof value.value === 'string' ||
37
- typeof value.value === 'boolean' ||
38
- (typeof value.value === 'number' && Number.isFinite(value.value)));
39
- };
40
- exports.isShapeAttribute = isShapeAttribute;
41
- const areShapeAttributes = (value) => {
42
- if (!Array.isArray(value)) {
43
- return false;
44
- }
45
- const seen = new Set();
46
- for (const attribute of value) {
47
- if (!(0, exports.isShapeAttribute)(attribute) || seen.has(attribute.name)) {
48
- return false;
49
- }
50
- seen.add(attribute.name);
51
- }
52
- return true;
53
- };
54
- exports.areShapeAttributes = areShapeAttributes;
55
- const makeShapeDragData = ({ attributes, shape, }) => {
56
- return {
57
- type: 'remotion-shape',
58
- version: 1,
59
- shape,
60
- attributes,
61
- };
62
- };
63
- exports.makeShapeDragData = makeShapeDragData;
64
- const parseShapeDragData = (value) => {
65
- try {
66
- const parsed = JSON.parse(value);
67
- if (!isRecord(parsed)) {
68
- return null;
69
- }
70
- if (parsed.type !== 'remotion-shape' || parsed.version !== 1) {
71
- return null;
72
- }
73
- if (!(0, exports.isShapeName)(parsed.shape)) {
74
- return null;
75
- }
76
- if (!(0, exports.areShapeAttributes)(parsed.attributes)) {
77
- return null;
78
- }
79
- return {
80
- type: 'remotion-shape',
81
- version: 1,
82
- shape: parsed.shape,
83
- attributes: parsed.attributes,
84
- };
85
- }
86
- catch (_a) {
87
- return null;
88
- }
89
- };
90
- exports.parseShapeDragData = parseShapeDragData;