@remotion/studio 4.0.454 → 4.0.456

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 (30) hide show
  1. package/dist/components/CompSelectorRef.js +21 -23
  2. package/dist/components/CompositionSelector.d.ts +0 -1
  3. package/dist/components/CompositionSelector.js +1 -13
  4. package/dist/components/InitialCompositionLoader.js +4 -2
  5. package/dist/components/PlayPause.d.ts +1 -0
  6. package/dist/components/PlayPause.js +2 -1
  7. package/dist/components/PreviewToolbar.js +1 -1
  8. package/dist/components/Timeline/Timeline.js +1 -1
  9. package/dist/components/Timeline/TimelineExpandArrowButton.d.ts +8 -0
  10. package/dist/components/Timeline/TimelineExpandArrowButton.js +39 -0
  11. package/dist/components/Timeline/TimelineExpandedSection.d.ts +0 -2
  12. package/dist/components/Timeline/TimelineExpandedSection.js +65 -16
  13. package/dist/components/Timeline/TimelineFieldRow.d.ts +1 -1
  14. package/dist/components/Timeline/TimelineFieldRow.js +5 -9
  15. package/dist/components/Timeline/TimelineListItem.js +15 -31
  16. package/dist/components/Timeline/TimelineStack/index.js +2 -0
  17. package/dist/components/Timeline/TimelineTracks.js +4 -3
  18. package/dist/error-overlay/remotion-overlay/CopyStackTrace.d.ts +0 -1
  19. package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +2 -20
  20. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +1 -1
  21. package/dist/error-overlay/remotion-overlay/StackFrame.js +22 -1
  22. package/dist/esm/{chunk-g39hwn0a.js → chunk-0y1jhm8s.js} +5147 -4987
  23. package/dist/esm/internals.mjs +5147 -4987
  24. package/dist/esm/previewEntry.mjs +5222 -5062
  25. package/dist/esm/renderEntry.mjs +1 -1
  26. package/dist/helpers/create-folder-tree.d.ts +5 -0
  27. package/dist/helpers/create-folder-tree.js +17 -1
  28. package/dist/helpers/timeline-layout.d.ts +29 -2
  29. package/dist/helpers/timeline-layout.js +87 -6
  30. package/package.json +9 -9
@@ -209,7 +209,7 @@ var renderContent = (Root) => {
209
209
  renderToDOM(/* @__PURE__ */ jsx("div", {
210
210
  children: /* @__PURE__ */ jsx(DelayedSpinner, {})
211
211
  }));
212
- import("./chunk-g39hwn0a.js").then(({ StudioInternals }) => {
212
+ import("./chunk-0y1jhm8s.js").then(({ StudioInternals }) => {
213
213
  window.remotion_isStudio = true;
214
214
  window.remotion_isReadOnlyStudio = true;
215
215
  window.remotion_inputProps = "{}";
@@ -14,4 +14,9 @@ export declare const splitParentIntoNameAndParent: (name: string | null) => {
14
14
  name: string | null;
15
15
  parent: string | null;
16
16
  };
17
+ /**
18
+ * Returns storage keys for the composition folder and each ancestor, so the
19
+ * tree can be expanded when navigating to a nested composition.
20
+ */
21
+ export declare const getKeysToExpand: (initialFolderName: string, parentFolderName: string | null, initial?: string[]) => string[];
17
22
  export declare const createFolderTree: (comps: import("remotion").AnyComposition[], folders: TFolder[], foldersExpanded: Record<string, boolean>) => CompositionSelectorItemType[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFolderTree = exports.splitParentIntoNameAndParent = exports.buildAssetFolderStructure = void 0;
3
+ exports.createFolderTree = exports.getKeysToExpand = exports.splitParentIntoNameAndParent = exports.buildAssetFolderStructure = void 0;
4
4
  const persist_open_folders_1 = require("./persist-open-folders");
5
5
  const buildAssetFolderStructure = (files, parentFolderName, foldersExpanded) => {
6
6
  const notInFolder = files.filter((f) => !f.name.includes('/'));
@@ -52,6 +52,22 @@ const splitParentIntoNameAndParent = (name) => {
52
52
  };
53
53
  };
54
54
  exports.splitParentIntoNameAndParent = splitParentIntoNameAndParent;
55
+ /**
56
+ * Returns storage keys for the composition folder and each ancestor, so the
57
+ * tree can be expanded when navigating to a nested composition.
58
+ */
59
+ const getKeysToExpand = (initialFolderName, parentFolderName, initial = []) => {
60
+ initial.push((0, persist_open_folders_1.openFolderKey)({
61
+ folderName: initialFolderName,
62
+ parentName: parentFolderName,
63
+ }));
64
+ const { name, parent } = (0, exports.splitParentIntoNameAndParent)(parentFolderName);
65
+ if (!name) {
66
+ return initial;
67
+ }
68
+ return (0, exports.getKeysToExpand)(name, parent, initial);
69
+ };
70
+ exports.getKeysToExpand = getKeysToExpand;
55
71
  const doesFolderExist = (items, folderName, parentName) => {
56
72
  for (const item of items) {
57
73
  if (item.type === 'folder') {
@@ -1,10 +1,14 @@
1
- import type { SequenceControls, SequenceFieldSchema } from 'remotion';
1
+ import type { EffectDefinitionAndStack, SequenceControls, SequenceFieldSchema, TSequence } from 'remotion';
2
2
  export declare const TIMELINE_PADDING = 16;
3
3
  export declare const TIMELINE_BORDER = 1;
4
4
  export declare const TIMELINE_ITEM_BORDER_BOTTOM = 1;
5
5
  export declare const TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
6
6
  export declare const SCHEMA_FIELD_ROW_HEIGHT = 22;
7
7
  export declare const UNSUPPORTED_FIELD_ROW_HEIGHT = 22;
8
+ export declare const TREE_GROUP_ROW_HEIGHT = 22;
9
+ export declare const TREE_INDENT_PER_LEVEL = 16;
10
+ export declare const EXPANDED_SECTION_PADDING_LEFT = 28;
11
+ export declare const EXPANDED_SECTION_PADDING_RIGHT = 10;
8
12
  export type SchemaFieldInfo = {
9
13
  key: string;
10
14
  description: string | undefined;
@@ -15,7 +19,30 @@ export type SchemaFieldInfo = {
15
19
  fieldSchema: SequenceFieldSchema;
16
20
  };
17
21
  export declare const getSchemaFields: (controls: SequenceControls | null) => SchemaFieldInfo[] | null;
18
- export declare const getExpandedTrackHeight: (controls: SequenceControls | null) => number;
22
+ export type EffectSchemaFieldLabel = {
23
+ key: string;
24
+ description: string | undefined;
25
+ };
26
+ export declare const getEffectSchemaLabels: (effect: EffectDefinitionAndStack<unknown>) => EffectSchemaFieldLabel[];
27
+ export type TimelineTreeNode = {
28
+ readonly kind: 'group';
29
+ readonly id: string;
30
+ readonly label: string;
31
+ readonly children: TimelineTreeNode[];
32
+ } | {
33
+ readonly kind: 'field';
34
+ readonly id: string;
35
+ readonly label: string;
36
+ readonly field: SchemaFieldInfo | null;
37
+ };
38
+ export declare const buildTimelineTree: (sequence: TSequence) => TimelineTreeNode[];
39
+ export type FlatTreeRow = {
40
+ readonly node: TimelineTreeNode;
41
+ readonly depth: number;
42
+ };
43
+ export declare const flattenVisibleTreeNodes: (nodes: TimelineTreeNode[], expandedTracks: Record<string, boolean>, depth?: number) => FlatTreeRow[];
44
+ export declare const getTreeRowHeight: (node: TimelineTreeNode) => number;
45
+ export declare const getExpandedTrackHeight: (sequence: TSequence, expandedTracks: Record<string, boolean>) => number;
19
46
  export declare const TIMELINE_LAYER_HEIGHT_VIDEO = 75;
20
47
  export declare const TIMELINE_LAYER_HEIGHT_IMAGE = 50;
21
48
  export declare const TIMELINE_LAYER_HEIGHT_AUDIO = 25;
@@ -1,12 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTimelineLayerHeight = exports.TIMELINE_LAYER_HEIGHT_AUDIO = exports.TIMELINE_LAYER_HEIGHT_IMAGE = exports.TIMELINE_LAYER_HEIGHT_VIDEO = exports.getExpandedTrackHeight = exports.getSchemaFields = exports.UNSUPPORTED_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.TIMELINE_TRACK_EXPANDED_HEIGHT = exports.TIMELINE_ITEM_BORDER_BOTTOM = exports.TIMELINE_BORDER = exports.TIMELINE_PADDING = void 0;
3
+ exports.getTimelineLayerHeight = exports.TIMELINE_LAYER_HEIGHT_AUDIO = exports.TIMELINE_LAYER_HEIGHT_IMAGE = exports.TIMELINE_LAYER_HEIGHT_VIDEO = exports.getExpandedTrackHeight = exports.getTreeRowHeight = exports.flattenVisibleTreeNodes = exports.buildTimelineTree = exports.getEffectSchemaLabels = exports.getSchemaFields = exports.EXPANDED_SECTION_PADDING_RIGHT = exports.EXPANDED_SECTION_PADDING_LEFT = exports.TREE_INDENT_PER_LEVEL = exports.TREE_GROUP_ROW_HEIGHT = exports.UNSUPPORTED_FIELD_ROW_HEIGHT = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.TIMELINE_TRACK_EXPANDED_HEIGHT = exports.TIMELINE_ITEM_BORDER_BOTTOM = exports.TIMELINE_BORDER = exports.TIMELINE_PADDING = void 0;
4
4
  exports.TIMELINE_PADDING = 16;
5
5
  exports.TIMELINE_BORDER = 1;
6
6
  exports.TIMELINE_ITEM_BORDER_BOTTOM = 1;
7
7
  exports.TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
8
8
  exports.SCHEMA_FIELD_ROW_HEIGHT = 22;
9
9
  exports.UNSUPPORTED_FIELD_ROW_HEIGHT = 22;
10
+ exports.TREE_GROUP_ROW_HEIGHT = 22;
11
+ exports.TREE_INDENT_PER_LEVEL = 16;
12
+ exports.EXPANDED_SECTION_PADDING_LEFT = 28;
13
+ exports.EXPANDED_SECTION_PADDING_RIGHT = 10;
10
14
  const SUPPORTED_SCHEMA_TYPES = new Set([
11
15
  'number',
12
16
  'boolean',
@@ -34,13 +38,90 @@ const getSchemaFields = (controls) => {
34
38
  });
35
39
  };
36
40
  exports.getSchemaFields = getSchemaFields;
37
- const getExpandedTrackHeight = (controls) => {
38
- const fields = (0, exports.getSchemaFields)(controls);
39
- if (!fields || fields.length === 0) {
41
+ const getEffectSchemaLabels = (effect) => {
42
+ if (!effect.definition.schema) {
43
+ return [];
44
+ }
45
+ return Object.entries(effect.definition.schema).map(([key, fieldSchema]) => ({
46
+ key,
47
+ description: fieldSchema.description,
48
+ }));
49
+ };
50
+ exports.getEffectSchemaLabels = getEffectSchemaLabels;
51
+ const buildTimelineTree = (sequence) => {
52
+ const roots = [];
53
+ if (sequence.effects.length > 0) {
54
+ roots.push({
55
+ kind: 'group',
56
+ id: `${sequence.id}::effects`,
57
+ label: 'Effects',
58
+ children: sequence.effects.map((effect, i) => {
59
+ const effectId = `${sequence.id}::effects::${i}`;
60
+ return {
61
+ kind: 'group',
62
+ id: effectId,
63
+ label: effect.definition.label,
64
+ children: (0, exports.getEffectSchemaLabels)(effect).map((label) => {
65
+ var _a;
66
+ return ({
67
+ kind: 'field',
68
+ id: `${effectId}::${label.key}`,
69
+ label: (_a = label.description) !== null && _a !== void 0 ? _a : label.key,
70
+ field: null,
71
+ });
72
+ }),
73
+ };
74
+ }),
75
+ });
76
+ }
77
+ const controlFields = (0, exports.getSchemaFields)(sequence.controls);
78
+ if (controlFields && controlFields.length > 0) {
79
+ roots.push({
80
+ kind: 'group',
81
+ id: `${sequence.id}::controls`,
82
+ label: 'Controls',
83
+ children: controlFields.map((f) => {
84
+ var _a;
85
+ return ({
86
+ kind: 'field',
87
+ id: `${sequence.id}::controls::${f.key}`,
88
+ label: (_a = f.description) !== null && _a !== void 0 ? _a : f.key,
89
+ field: f,
90
+ });
91
+ }),
92
+ });
93
+ }
94
+ return roots;
95
+ };
96
+ exports.buildTimelineTree = buildTimelineTree;
97
+ const flattenVisibleTreeNodes = (nodes, expandedTracks, depth = 0) => {
98
+ var _a;
99
+ const out = [];
100
+ for (const node of nodes) {
101
+ out.push({ node, depth });
102
+ if (node.kind === 'group' && ((_a = expandedTracks[node.id]) !== null && _a !== void 0 ? _a : false)) {
103
+ out.push(...(0, exports.flattenVisibleTreeNodes)(node.children, expandedTracks, depth + 1));
104
+ }
105
+ }
106
+ return out;
107
+ };
108
+ exports.flattenVisibleTreeNodes = flattenVisibleTreeNodes;
109
+ const getTreeRowHeight = (node) => {
110
+ if (node.kind === 'field' && node.field) {
111
+ return node.field.rowHeight;
112
+ }
113
+ return exports.TREE_GROUP_ROW_HEIGHT;
114
+ };
115
+ exports.getTreeRowHeight = getTreeRowHeight;
116
+ const getExpandedTrackHeight = (sequence, expandedTracks) => {
117
+ const tree = (0, exports.buildTimelineTree)(sequence);
118
+ const flat = (0, exports.flattenVisibleTreeNodes)(tree, expandedTracks);
119
+ if (flat.length === 0) {
40
120
  return exports.TIMELINE_TRACK_EXPANDED_HEIGHT;
41
121
  }
42
- const separators = Math.max(0, fields.length - 1);
43
- return fields.reduce((sum, f) => sum + f.rowHeight, 0) + separators;
122
+ const totalRowsHeight = flat.reduce((sum, { node }) => sum + (0, exports.getTreeRowHeight)(node), 0);
123
+ const separators = Math.max(0, flat.length - 1);
124
+ return totalRowsHeight + separators;
44
125
  };
45
126
  exports.getExpandedTrackHeight = getExpandedTrackHeight;
46
127
  exports.TIMELINE_LAYER_HEIGHT_VIDEO = 75;
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.454",
6
+ "version": "4.0.456",
7
7
  "description": "APIs for interacting with the Remotion Studio",
8
8
  "main": "dist",
9
9
  "sideEffects": false,
@@ -26,13 +26,13 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "semver": "7.5.3",
29
- "remotion": "4.0.454",
30
- "@remotion/player": "4.0.454",
31
- "@remotion/media-utils": "4.0.454",
32
- "@remotion/renderer": "4.0.454",
33
- "@remotion/web-renderer": "4.0.454",
34
- "@remotion/studio-shared": "4.0.454",
35
- "@remotion/zod-types": "4.0.454",
29
+ "remotion": "4.0.456",
30
+ "@remotion/player": "4.0.456",
31
+ "@remotion/media-utils": "4.0.456",
32
+ "@remotion/renderer": "4.0.456",
33
+ "@remotion/web-renderer": "4.0.456",
34
+ "@remotion/studio-shared": "4.0.456",
35
+ "@remotion/zod-types": "4.0.456",
36
36
  "mediabunny": "1.42.0",
37
37
  "memfs": "3.4.3",
38
38
  "source-map": "0.7.3",
@@ -43,7 +43,7 @@
43
43
  "react": "19.2.3",
44
44
  "react-dom": "19.2.3",
45
45
  "@types/semver": "^7.3.4",
46
- "@remotion/eslint-config-internal": "4.0.454",
46
+ "@remotion/eslint-config-internal": "4.0.456",
47
47
  "eslint": "9.19.0",
48
48
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
49
49
  },