@remotion/studio 4.0.478 → 4.0.479

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 (171) hide show
  1. package/dist/components/AssetSelector.js +8 -14
  2. package/dist/components/Button.d.ts +1 -0
  3. package/dist/components/Button.js +8 -5
  4. package/dist/components/CompactExplanation.d.ts +12 -0
  5. package/dist/components/CompactExplanation.js +52 -0
  6. package/dist/components/CompositionSelector.js +2 -4
  7. package/dist/components/CurrentAsset.d.ts +3 -1
  8. package/dist/components/CurrentAsset.js +42 -34
  9. package/dist/components/CurrentComposition.d.ts +1 -1
  10. package/dist/components/CurrentComposition.js +38 -31
  11. package/dist/components/DefaultPropsEditor.d.ts +12 -2
  12. package/dist/components/DefaultPropsEditor.js +2 -2
  13. package/dist/components/EffectPickerModal.d.ts +5 -0
  14. package/dist/components/EffectPickerModal.js +179 -0
  15. package/dist/components/InspectorInfoHeader.d.ts +11 -0
  16. package/dist/components/InspectorInfoHeader.js +55 -0
  17. package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
  18. package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
  19. package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
  20. package/dist/components/InspectorPanel/EasingInspector.js +41 -0
  21. package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
  22. package/dist/components/InspectorPanel/GuideInspector.js +55 -0
  23. package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
  24. package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
  25. package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
  26. package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
  27. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
  28. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +116 -0
  29. package/dist/components/InspectorPanel/common.d.ts +15 -0
  30. package/dist/components/InspectorPanel/common.js +18 -0
  31. package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
  32. package/dist/components/InspectorPanel/inspector-selection.js +34 -0
  33. package/dist/components/InspectorPanel/styles.d.ts +27 -0
  34. package/dist/components/InspectorPanel/styles.js +178 -0
  35. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
  36. package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
  37. package/dist/components/InspectorPanel.d.ts +8 -0
  38. package/dist/components/InspectorPanel.js +26 -0
  39. package/dist/components/InspectorPanelLayout.d.ts +1 -0
  40. package/dist/components/InspectorPanelLayout.js +4 -0
  41. package/dist/components/InspectorSequenceSection.d.ts +16 -0
  42. package/dist/components/InspectorSequenceSection.js +147 -0
  43. package/dist/components/InspectorSourceLocation.d.ts +7 -0
  44. package/dist/components/InspectorSourceLocation.js +71 -0
  45. package/dist/components/Modals.js +3 -3
  46. package/dist/components/NewComposition/InputDragger.js +1 -1
  47. package/dist/components/NewComposition/RemInput.d.ts +1 -0
  48. package/dist/components/NewComposition/RemInput.js +8 -2
  49. package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
  50. package/dist/components/NewComposition/RemTextarea.js +8 -2
  51. package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
  52. package/dist/components/NewComposition/ValidationMessage.js +16 -5
  53. package/dist/components/OptionsPanel.d.ts +1 -1
  54. package/dist/components/OptionsPanel.js +8 -17
  55. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
  56. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
  57. package/dist/components/QuickSwitcher/shared.d.ts +4 -0
  58. package/dist/components/QuickSwitcher/shared.js +24 -0
  59. package/dist/components/RenderModal/DataEditor.d.ts +29 -2
  60. package/dist/components/RenderModal/DataEditor.js +107 -56
  61. package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
  62. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
  63. package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
  64. package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
  65. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
  66. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
  67. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
  68. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
  69. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
  70. package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
  71. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  72. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  73. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
  74. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  75. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
  76. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
  77. package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
  78. package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
  79. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  80. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
  81. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
  82. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  83. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  84. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
  85. package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
  86. package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
  87. package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
  88. package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
  89. package/dist/components/RendersTab.js +1 -1
  90. package/dist/components/SegmentedControl.d.ts +3 -0
  91. package/dist/components/SegmentedControl.js +11 -5
  92. package/dist/components/SelectedOutlineElement.js +57 -24
  93. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  94. package/dist/components/SelectedOutlineOverlay.js +41 -29
  95. package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
  96. package/dist/components/SelectedOutlineUvControls.js +64 -10
  97. package/dist/components/Tabs/index.js +4 -4
  98. package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
  99. package/dist/components/Timeline/EasingEditorModal.js +597 -124
  100. package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
  101. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
  102. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
  103. package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
  104. package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
  105. package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
  106. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
  107. package/dist/components/Timeline/TimelineEffectPropItem.js +24 -20
  108. package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
  109. package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
  110. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
  111. package/dist/components/Timeline/TimelineExpandedSection.js +5 -19
  112. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
  113. package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
  114. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
  115. package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
  116. package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
  117. package/dist/components/Timeline/TimelineNumberField.js +5 -11
  118. package/dist/components/Timeline/TimelineRotationField.js +5 -6
  119. package/dist/components/Timeline/TimelineScaleField.js +4 -8
  120. package/dist/components/Timeline/TimelineSelection.d.ts +6 -0
  121. package/dist/components/Timeline/TimelineSelection.js +109 -14
  122. package/dist/components/Timeline/TimelineSequence.js +19 -3
  123. package/dist/components/Timeline/TimelineSequenceItem.js +12 -67
  124. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
  125. package/dist/components/Timeline/TimelineSequencePropItem.js +56 -52
  126. package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
  127. package/dist/components/Timeline/TimelineTranslateField.js +4 -5
  128. package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
  129. package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
  130. package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
  131. package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
  132. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
  133. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
  134. package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
  135. package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
  136. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
  137. package/dist/components/Timeline/reset-selected-timeline-props.js +19 -5
  138. package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
  139. package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
  140. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
  141. package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
  142. package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
  143. package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
  144. package/dist/components/Timeline/update-selected-easing.js +40 -9
  145. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
  146. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
  147. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
  148. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +11 -0
  149. package/dist/components/Timeline/use-timeline-expanded-tree.js +33 -0
  150. package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
  151. package/dist/components/VisualControls/VisualControlsContent.js +4 -5
  152. package/dist/components/effect-drag-and-drop.d.ts +10 -0
  153. package/dist/components/effect-drag-and-drop.js +17 -8
  154. package/dist/components/effect-picker-search.d.ts +5 -0
  155. package/dist/components/effect-picker-search.js +77 -0
  156. package/dist/components/selected-outline-drag.d.ts +21 -2
  157. package/dist/components/selected-outline-drag.js +31 -6
  158. package/dist/components/selected-outline-types.d.ts +7 -7
  159. package/dist/components/selected-outline-uv.d.ts +4 -3
  160. package/dist/components/selected-outline-uv.js +6 -2
  161. package/dist/esm/{chunk-hrw9799x.js → chunk-fge2mq5p.js} +16535 -13311
  162. package/dist/esm/internals.mjs +16535 -13311
  163. package/dist/esm/previewEntry.mjs +17141 -13917
  164. package/dist/esm/renderEntry.mjs +1 -1
  165. package/dist/helpers/render-codec-label.d.ts +2 -0
  166. package/dist/helpers/render-codec-label.js +49 -0
  167. package/dist/helpers/timeline-layout.d.ts +4 -4
  168. package/dist/helpers/use-media-metadata.d.ts +8 -2
  169. package/dist/helpers/use-media-metadata.js +17 -4
  170. package/dist/state/modals.d.ts +9 -4
  171. package/package.json +12 -12
@@ -1,5 +1,5 @@
1
1
  import { type EffectClipboardParam } from '@remotion/studio-shared';
2
- import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
2
+ import type { SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
3
3
  import type { SetPropStatuses } from './save-sequence-prop';
4
4
  type SaveEffectPropBase = {
5
5
  fileName: string;
@@ -7,7 +7,7 @@ type SaveEffectPropBase = {
7
7
  effectIndex: number;
8
8
  fieldKey: string;
9
9
  defaultValue: string | null;
10
- schema: SequenceSchema;
10
+ schema: InteractivitySchema;
11
11
  setPropStatuses: SetPropStatuses;
12
12
  clientId: string;
13
13
  };
@@ -1,4 +1,4 @@
1
- import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
1
+ import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
2
2
  export type SetPropStatuses = (nodePath: SequencePropsSubscriptionKey, values: (prev: CanUpdateSequencePropsResponse) => CanUpdateSequencePropsResponse) => void;
3
3
  export type SaveSequencePropChange = {
4
4
  fileName: string;
@@ -6,7 +6,7 @@ export type SaveSequencePropChange = {
6
6
  fieldKey: string;
7
7
  value: unknown;
8
8
  defaultValue: string | null;
9
- schema: SequenceSchema;
9
+ schema: InteractivitySchema;
10
10
  };
11
11
  type SaveSequencePropsOptions = {
12
12
  changes: SaveSequencePropChange[];
@@ -1,4 +1,4 @@
1
- import type { SequenceNodePath, SequenceSchema } from 'remotion';
1
+ import type { SequenceNodePath, InteractivitySchema } from 'remotion';
2
2
  import { callApi } from '../call-api';
3
3
  type SubscribeResult = Awaited<ReturnType<typeof callApi<'/api/subscribe-to-sequence-props'>>>;
4
4
  type ApplyResult = (result: SubscribeResult) => void;
@@ -6,9 +6,9 @@ export declare const acquireSequencePropsSubscription: ({ fileName, line, column
6
6
  fileName: string;
7
7
  line: number;
8
8
  column: number;
9
- schema: SequenceSchema;
9
+ schema: InteractivitySchema;
10
10
  componentIdentity: string | null;
11
- effects: SequenceSchema[];
11
+ effects: InteractivitySchema[];
12
12
  nodePath: SequenceNodePath | null;
13
13
  clientId: string;
14
14
  applyOnce: ApplyResult;
@@ -0,0 +1,5 @@
1
+ import type { InteractivitySchemaField } from 'remotion';
2
+ export declare const formatTimelineFieldValueForDisplay: ({ fieldSchema, value, }: {
3
+ readonly fieldSchema: InteractivitySchemaField | undefined;
4
+ readonly value: unknown;
5
+ }) => string;
@@ -0,0 +1,244 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatTimelineFieldValueForDisplay = void 0;
4
+ const timeline_field_utils_1 = require("./timeline-field-utils");
5
+ const timeline_rotation_utils_1 = require("./timeline-rotation-utils");
6
+ const timeline_translate_utils_1 = require("./timeline-translate-utils");
7
+ const transform_origin_utils_1 = require("./transform-origin-utils");
8
+ const DISPLAY_FALLBACK_DECIMAL_PLACES = 3;
9
+ const DEFAULT_SCALE_VALUE = [1, 1, 1];
10
+ const getFiniteNumericValue = (value) => {
11
+ if (typeof value !== 'number' && typeof value !== 'string') {
12
+ return null;
13
+ }
14
+ const numericValue = Number(value);
15
+ return Number.isFinite(numericValue) ? numericValue : null;
16
+ };
17
+ const parseScaleStringForDisplay = (value) => {
18
+ var _a, _b;
19
+ const parts = value.trim().split(/\s+/);
20
+ if (parts.length < 1 || parts.length > 3 || parts[0] === '') {
21
+ return null;
22
+ }
23
+ const parsed = parts.map((part) => Number(part));
24
+ if (!parsed.every((part) => Number.isFinite(part))) {
25
+ return null;
26
+ }
27
+ const x = parsed[0];
28
+ const y = (_a = parsed[1]) !== null && _a !== void 0 ? _a : x;
29
+ const z = (_b = parsed[2]) !== null && _b !== void 0 ? _b : 1;
30
+ return [x, y, z];
31
+ };
32
+ const parseScaleValueForDisplay = (value) => {
33
+ var _a;
34
+ if (typeof value === 'number') {
35
+ return Number.isFinite(value) ? [value, value, 1] : DEFAULT_SCALE_VALUE;
36
+ }
37
+ if (typeof value === 'string') {
38
+ return (_a = parseScaleStringForDisplay(value)) !== null && _a !== void 0 ? _a : DEFAULT_SCALE_VALUE;
39
+ }
40
+ return DEFAULT_SCALE_VALUE;
41
+ };
42
+ const formatUnknownNumberForDisplay = (value) => {
43
+ if (!Number.isFinite(value)) {
44
+ return String(value);
45
+ }
46
+ return (0, timeline_field_utils_1.formatTimelineNumber)({
47
+ decimalPlaces: DISPLAY_FALLBACK_DECIMAL_PLACES,
48
+ fixed: false,
49
+ value: (0, timeline_field_utils_1.normalizeTimelineNumber)(value),
50
+ });
51
+ };
52
+ const normalizeUnknownForDisplay = (value) => {
53
+ if (typeof value === 'number' && Number.isFinite(value)) {
54
+ return (0, timeline_field_utils_1.roundToDecimalPlaces)((0, timeline_field_utils_1.normalizeTimelineNumber)(value), DISPLAY_FALLBACK_DECIMAL_PLACES);
55
+ }
56
+ if (Array.isArray(value)) {
57
+ return value.map(normalizeUnknownForDisplay);
58
+ }
59
+ if (value && typeof value === 'object') {
60
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [
61
+ key,
62
+ normalizeUnknownForDisplay(item),
63
+ ]));
64
+ }
65
+ return value;
66
+ };
67
+ const formatUnknownTimelineValueForDisplay = (value) => {
68
+ var _a;
69
+ if (typeof value === 'number') {
70
+ return formatUnknownNumberForDisplay(value);
71
+ }
72
+ if (value === null ||
73
+ typeof value === 'string' ||
74
+ typeof value === 'boolean' ||
75
+ typeof value === 'bigint') {
76
+ return String(value);
77
+ }
78
+ if (value === undefined) {
79
+ return 'undefined';
80
+ }
81
+ try {
82
+ return (_a = JSON.stringify(normalizeUnknownForDisplay(value))) !== null && _a !== void 0 ? _a : String(value);
83
+ }
84
+ catch (_b) {
85
+ return String(value);
86
+ }
87
+ };
88
+ const formatNumberTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
89
+ const numericValue = getFiniteNumericValue(value);
90
+ if (numericValue === null) {
91
+ return null;
92
+ }
93
+ const stepDecimals = fieldSchema.step === undefined ? null : (0, timeline_field_utils_1.getDecimalPlaces)(fieldSchema.step);
94
+ if (stepDecimals === null) {
95
+ const digits = (0, timeline_field_utils_1.getDecimalPlaces)(numericValue);
96
+ return digits === 0 ? String(numericValue) : numericValue.toFixed(digits);
97
+ }
98
+ return (0, timeline_field_utils_1.formatTimelineNumber)({
99
+ decimalPlaces: stepDecimals,
100
+ fixed: true,
101
+ value: numericValue,
102
+ });
103
+ };
104
+ const formatRotationTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
105
+ const configuredStep = fieldSchema.type === 'rotation-css' ||
106
+ fieldSchema.type === 'rotation-degrees'
107
+ ? fieldSchema.step
108
+ : undefined;
109
+ const decimalPlaces = (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
110
+ defaultDecimalPlaces: 1,
111
+ step: configuredStep,
112
+ });
113
+ const degrees = fieldSchema.type === 'rotation-css'
114
+ ? (0, timeline_rotation_utils_1.parseCssRotationToDegrees)(String(value !== null && value !== void 0 ? value : '0deg'))
115
+ : getFiniteNumericValue(value);
116
+ if (degrees === null || !Number.isFinite(degrees)) {
117
+ return null;
118
+ }
119
+ return `${(0, timeline_field_utils_1.formatTimelineNumber)({
120
+ decimalPlaces,
121
+ fixed: false,
122
+ value: (0, timeline_field_utils_1.normalizeTimelineNumber)(degrees),
123
+ })}\u00B0`;
124
+ };
125
+ const formatScaleTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
126
+ const decimalPlaces = (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
127
+ defaultDecimalPlaces: 3,
128
+ step: fieldSchema.step,
129
+ });
130
+ const formatScalePart = (part) => (0, timeline_field_utils_1.formatTimelineNumber)({
131
+ decimalPlaces,
132
+ fixed: true,
133
+ value: part,
134
+ });
135
+ const [x, y, z] = parseScaleValueForDisplay(value);
136
+ const parts = x === y && z === 1 ? [x] : z === 1 ? [x, y] : [x, y, z];
137
+ return parts.map(formatScalePart).join(' ');
138
+ };
139
+ const formatTranslateCoordinateForDisplay = (value, decimalPlaces) => `${(0, timeline_field_utils_1.formatTimelineNumber)({
140
+ decimalPlaces,
141
+ fixed: false,
142
+ value,
143
+ })}px`;
144
+ const formatTranslateTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
145
+ const decimalPlaces = (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
146
+ defaultDecimalPlaces: 1,
147
+ step: fieldSchema.step,
148
+ });
149
+ const numericValue = getFiniteNumericValue(value);
150
+ if (numericValue !== null) {
151
+ return formatTranslateCoordinateForDisplay(numericValue, decimalPlaces);
152
+ }
153
+ const [x, y] = (0, timeline_translate_utils_1.parseTranslate)(String(value !== null && value !== void 0 ? value : '0px 0px'));
154
+ return (0, timeline_translate_utils_1.serializeTranslate)(x, y, decimalPlaces);
155
+ };
156
+ const formatTransformOriginAxisValueForDisplay = ({ decimalPlaces, unit, value, }) => {
157
+ return `${(0, timeline_field_utils_1.formatTimelineNumber)({
158
+ decimalPlaces,
159
+ fixed: false,
160
+ value,
161
+ })}${unit}`;
162
+ };
163
+ const formatTransformOriginTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
164
+ const decimalPlaces = (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
165
+ defaultDecimalPlaces: 2,
166
+ step: fieldSchema.step,
167
+ });
168
+ const numericValue = getFiniteNumericValue(value);
169
+ if (numericValue !== null) {
170
+ return formatTransformOriginAxisValueForDisplay({
171
+ decimalPlaces,
172
+ unit: '%',
173
+ value: numericValue,
174
+ });
175
+ }
176
+ const parsed = (0, transform_origin_utils_1.parseTransformOrigin)(value);
177
+ if (parsed === null) {
178
+ return null;
179
+ }
180
+ const xy = `${formatTransformOriginAxisValueForDisplay({
181
+ decimalPlaces,
182
+ unit: parsed.x.unit,
183
+ value: parsed.x.value,
184
+ })} ${formatTransformOriginAxisValueForDisplay({
185
+ decimalPlaces,
186
+ unit: parsed.y.unit,
187
+ value: parsed.y.value,
188
+ })}`;
189
+ return parsed.z === null ? xy : `${xy} ${parsed.z}`;
190
+ };
191
+ const formatUvCoordinatePartForDisplay = (value, decimalPlaces) => (0, timeline_field_utils_1.formatTimelineNumber)({
192
+ decimalPlaces,
193
+ fixed: true,
194
+ value,
195
+ });
196
+ const formatUvCoordinateTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
197
+ const decimalPlaces = (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
198
+ defaultDecimalPlaces: 2,
199
+ step: fieldSchema.step,
200
+ });
201
+ const numericValue = getFiniteNumericValue(value);
202
+ if (numericValue !== null) {
203
+ return formatUvCoordinatePartForDisplay(numericValue, decimalPlaces);
204
+ }
205
+ if (!Array.isArray(value) ||
206
+ value.length !== 2 ||
207
+ !value.every((item) => typeof item === 'number' && Number.isFinite(item))) {
208
+ return null;
209
+ }
210
+ return `${formatUvCoordinatePartForDisplay(value[0], decimalPlaces)}, ${formatUvCoordinatePartForDisplay(value[1], decimalPlaces)}`;
211
+ };
212
+ const formatTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
213
+ var _a, _b, _c, _d, _e;
214
+ if (!fieldSchema) {
215
+ return formatUnknownTimelineValueForDisplay(value);
216
+ }
217
+ switch (fieldSchema.type) {
218
+ case 'number':
219
+ return ((_a = formatNumberTimelineFieldValueForDisplay({ fieldSchema, value })) !== null && _a !== void 0 ? _a : formatUnknownTimelineValueForDisplay(value));
220
+ case 'rotation-css':
221
+ case 'rotation-degrees':
222
+ return ((_b = formatRotationTimelineFieldValueForDisplay({ fieldSchema, value })) !== null && _b !== void 0 ? _b : formatUnknownTimelineValueForDisplay(value));
223
+ case 'scale':
224
+ return formatScaleTimelineFieldValueForDisplay({ fieldSchema, value });
225
+ case 'translate':
226
+ return ((_c = formatTranslateTimelineFieldValueForDisplay({ fieldSchema, value })) !== null && _c !== void 0 ? _c : formatUnknownTimelineValueForDisplay(value));
227
+ case 'transform-origin':
228
+ return ((_d = formatTransformOriginTimelineFieldValueForDisplay({
229
+ fieldSchema,
230
+ value,
231
+ })) !== null && _d !== void 0 ? _d : formatUnknownTimelineValueForDisplay(value));
232
+ case 'uv-coordinate':
233
+ return ((_e = formatUvCoordinateTimelineFieldValueForDisplay({ fieldSchema, value })) !== null && _e !== void 0 ? _e : formatUnknownTimelineValueForDisplay(value));
234
+ case 'array':
235
+ case 'boolean':
236
+ case 'color':
237
+ case 'enum':
238
+ case 'hidden':
239
+ return formatUnknownTimelineValueForDisplay(value);
240
+ default:
241
+ return formatUnknownTimelineValueForDisplay(value);
242
+ }
243
+ };
244
+ exports.formatTimelineFieldValueForDisplay = formatTimelineFieldValueForDisplay;
@@ -1,8 +1,51 @@
1
- import type { OverrideIdToNodePaths, PropStatuses, TSequence } from 'remotion';
1
+ import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusEasing, DragOverrideValue, OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, InteractivitySchema, TSequence } from 'remotion';
2
2
  import type { SetPropStatuses } from './save-sequence-prop';
3
3
  import type { TimelineEasingSelection, TimelineSelection } from './TimelineSelection';
4
4
  export type EasingSelection = TimelineEasingSelection;
5
- export type TimelineEasingValue = 'linear' | [number, number, number, number];
5
+ export type TimelineEasingValue = CanUpdateSequencePropStatusEasing;
6
+ export type SelectedEasingUpdate = {
7
+ readonly type: 'sequence';
8
+ readonly fileName: string;
9
+ readonly nodePath: SequencePropsSubscriptionKey;
10
+ readonly fieldKey: string;
11
+ readonly schema: InteractivitySchema;
12
+ readonly segmentIndex: number;
13
+ readonly currentEasing: TimelineEasingValue;
14
+ readonly propStatus: CanUpdateSequencePropStatusKeyframed;
15
+ } | {
16
+ readonly type: 'effect';
17
+ readonly fileName: string;
18
+ readonly nodePath: SequencePropsSubscriptionKey;
19
+ readonly effectIndex: number;
20
+ readonly fieldKey: string;
21
+ readonly schema: InteractivitySchema;
22
+ readonly segmentIndex: number;
23
+ readonly currentEasing: TimelineEasingValue;
24
+ readonly propStatus: CanUpdateSequencePropStatusKeyframed;
25
+ };
26
+ export declare const getSelectedEasingUpdate: ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }: {
27
+ selection: {
28
+ readonly type: "easing";
29
+ readonly nodePathInfo: import("../../helpers/get-timeline-sequence-sort-key").SequenceNodePathInfo;
30
+ readonly fromFrame: number;
31
+ readonly toFrame: number;
32
+ readonly segmentIndex: number;
33
+ };
34
+ sequences: TSequence[];
35
+ overrideIdsToNodePaths: OverrideIdToNodePaths;
36
+ propStatuses: PropStatuses;
37
+ }) => SelectedEasingUpdate | null;
38
+ export declare const getSelectedEasingUpdates: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, }: {
39
+ readonly selections: readonly TimelineSelection[];
40
+ readonly sequences: TSequence[];
41
+ readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
42
+ readonly propStatuses: PropStatuses;
43
+ }) => SelectedEasingUpdate[];
44
+ export declare const makeEasingDragOverride: ({ status, segmentIndex, easing, }: {
45
+ readonly status: CanUpdateSequencePropStatusKeyframed;
46
+ readonly segmentIndex: number;
47
+ readonly easing: CanUpdateSequencePropStatusEasing;
48
+ }) => DragOverrideValue;
6
49
  export declare const getEasingSelections: (selections: readonly TimelineSelection[]) => {
7
50
  readonly type: "easing";
8
51
  readonly nodePathInfo: import("../../helpers/get-timeline-sequence-sort-key").SequenceNodePathInfo;
@@ -21,7 +64,7 @@ export declare const getTimelineEasingValueForSelection: ({ selection, sequences
21
64
  sequences: TSequence[];
22
65
  overrideIdsToNodePaths: OverrideIdToNodePaths;
23
66
  propStatuses: PropStatuses;
24
- }) => TimelineEasingValue | null;
67
+ }) => CanUpdateSequencePropStatusEasing | null;
25
68
  export declare const updateSelectedTimelineEasings: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, setPropStatuses, clientId, easing, }: {
26
69
  selections: readonly TimelineSelection[];
27
70
  sequences: TSequence[];
@@ -29,5 +72,5 @@ export declare const updateSelectedTimelineEasings: ({ selections, sequences, ov
29
72
  propStatuses: PropStatuses;
30
73
  setPropStatuses: SetPropStatuses;
31
74
  clientId: string;
32
- easing: TimelineEasingValue;
75
+ easing: CanUpdateSequencePropStatusEasing;
33
76
  }) => Promise<void> | null;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateSelectedTimelineEasings = exports.getTimelineEasingValueForSelection = exports.getEasingSelections = void 0;
3
+ exports.updateSelectedTimelineEasings = exports.getTimelineEasingValueForSelection = exports.getEasingSelections = exports.makeEasingDragOverride = exports.getSelectedEasingUpdates = exports.getSelectedEasingUpdate = void 0;
4
+ const studio_shared_1 = require("@remotion/studio-shared");
4
5
  const remotion_1 = require("remotion");
5
6
  const call_update_keyframe_settings_1 = require("./call-update-keyframe-settings");
6
7
  const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
@@ -42,7 +43,8 @@ const getSelectedEasingUpdate = ({ selection, sequences, overrideIdsToNodePaths,
42
43
  fieldKey: field.fieldKey,
43
44
  schema: sequence.controls.schema,
44
45
  segmentIndex: selection.segmentIndex,
45
- currentEasing: (_c = sequencePropStatus.easing[selection.segmentIndex]) !== null && _c !== void 0 ? _c : 'linear',
46
+ currentEasing: (_c = sequencePropStatus.easing[selection.segmentIndex]) !== null && _c !== void 0 ? _c : studio_shared_1.LINEAR_KEYFRAME_EASING,
47
+ propStatus: sequencePropStatus,
46
48
  };
47
49
  }
48
50
  const effect = sequence.effects[field.effectIndex];
@@ -69,15 +71,46 @@ const getSelectedEasingUpdate = ({ selection, sequences, overrideIdsToNodePaths,
69
71
  fieldKey: field.fieldKey,
70
72
  schema: effect.schema,
71
73
  segmentIndex: selection.segmentIndex,
72
- currentEasing: (_d = effectPropStatus.easing[selection.segmentIndex]) !== null && _d !== void 0 ? _d : 'linear',
74
+ currentEasing: (_d = effectPropStatus.easing[selection.segmentIndex]) !== null && _d !== void 0 ? _d : studio_shared_1.LINEAR_KEYFRAME_EASING,
75
+ propStatus: effectPropStatus,
73
76
  };
74
77
  };
78
+ exports.getSelectedEasingUpdate = getSelectedEasingUpdate;
79
+ const getSelectedEasingUpdates = ({ selections, sequences, overrideIdsToNodePaths, propStatuses, }) => {
80
+ return (0, exports.getEasingSelections)(selections)
81
+ .map((selection) => (0, exports.getSelectedEasingUpdate)({
82
+ selection,
83
+ sequences,
84
+ overrideIdsToNodePaths,
85
+ propStatuses,
86
+ }))
87
+ .filter((update) => update !== null);
88
+ };
89
+ exports.getSelectedEasingUpdates = getSelectedEasingUpdates;
90
+ const makeEasingDragOverride = ({ status, segmentIndex, easing, }) => {
91
+ const nextEasing = [...status.easing];
92
+ while (nextEasing.length < status.keyframes.length - 1) {
93
+ nextEasing.push(studio_shared_1.LINEAR_KEYFRAME_EASING);
94
+ }
95
+ if (nextEasing.length > status.keyframes.length - 1) {
96
+ nextEasing.length = status.keyframes.length - 1;
97
+ }
98
+ nextEasing[segmentIndex] = easing;
99
+ return {
100
+ type: 'keyframed',
101
+ status: {
102
+ ...status,
103
+ easing: nextEasing,
104
+ },
105
+ };
106
+ };
107
+ exports.makeEasingDragOverride = makeEasingDragOverride;
75
108
  const getEasingSelections = (selections) => selections.filter(isEasingSelection);
76
109
  exports.getEasingSelections = getEasingSelections;
77
110
  const getTimelineEasingValueForSelection = ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }) => {
78
111
  var _a;
79
112
  var _b;
80
- return ((_b = (_a = getSelectedEasingUpdate({
113
+ return ((_b = (_a = (0, exports.getSelectedEasingUpdate)({
81
114
  selection,
82
115
  sequences,
83
116
  overrideIdsToNodePaths,
@@ -90,14 +123,12 @@ const updateSelectedTimelineEasings = ({ selections, sequences, overrideIdsToNod
90
123
  if (easingSelections.length === 0) {
91
124
  return null;
92
125
  }
93
- const updates = easingSelections
94
- .map((selection) => getSelectedEasingUpdate({
95
- selection,
126
+ const updates = (0, exports.getSelectedEasingUpdates)({
127
+ selections: easingSelections,
96
128
  sequences,
97
129
  overrideIdsToNodePaths,
98
130
  propStatuses,
99
- }))
100
- .filter((update) => update !== null);
131
+ });
101
132
  if (updates.length === 0) {
102
133
  return null;
103
134
  }
@@ -0,0 +1,13 @@
1
+ import type { CanUpdateSequencePropStatus, SequencePropsSubscriptionKey, TSequence } from 'remotion';
2
+ import type { ComboboxValue } from '../NewComposition/ComboBox';
3
+ import { type SetPropStatuses } from './save-sequence-prop';
4
+ export declare const useSequenceFreezeFrameMenuItem: ({ clientId, nodePath, propStatusesForOverride, sequence, sequenceFrameOffset, setPropStatuses, timelinePosition, validatedSource, }: {
5
+ readonly clientId: string | null;
6
+ readonly nodePath: SequencePropsSubscriptionKey | null;
7
+ readonly propStatusesForOverride: Record<string, CanUpdateSequencePropStatus> | undefined;
8
+ readonly sequence: TSequence;
9
+ readonly sequenceFrameOffset: number;
10
+ readonly setPropStatuses: SetPropStatuses;
11
+ readonly timelinePosition: number;
12
+ readonly validatedSource: string | null;
13
+ }) => ComboboxValue;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSequenceFreezeFrameMenuItem = void 0;
4
+ const react_1 = require("react");
5
+ const save_sequence_prop_1 = require("./save-sequence-prop");
6
+ const useSequenceFreezeFrameMenuItem = ({ clientId, nodePath, propStatusesForOverride, sequence, sequenceFrameOffset, setPropStatuses, timelinePosition, validatedSource, }) => {
7
+ const freezeStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.freeze;
8
+ const isFrozen = (freezeStatus === null || freezeStatus === void 0 ? void 0 : freezeStatus.status) === 'static' &&
9
+ typeof freezeStatus.codeValue === 'number';
10
+ const canToggleFreeze = clientId !== null &&
11
+ Boolean(sequence.controls) &&
12
+ nodePath !== null &&
13
+ validatedSource !== null &&
14
+ freezeStatus !== undefined &&
15
+ freezeStatus !== null &&
16
+ freezeStatus.status === 'static';
17
+ const onToggleFreezeFrame = (0, react_1.useCallback)(() => {
18
+ if (!canToggleFreeze ||
19
+ !sequence.controls ||
20
+ nodePath === null ||
21
+ validatedSource === null ||
22
+ clientId === null) {
23
+ return;
24
+ }
25
+ const rawFreezeFrame = Math.round(timelinePosition - sequence.from + sequenceFrameOffset);
26
+ const maxFrame = Number.isFinite(sequence.duration)
27
+ ? Math.max(0, sequence.duration - 1)
28
+ : rawFreezeFrame;
29
+ const freezeFrame = Math.min(Math.max(0, rawFreezeFrame), maxFrame);
30
+ const remove = isFrozen;
31
+ (0, save_sequence_prop_1.saveSequenceProps)({
32
+ changes: [
33
+ {
34
+ fileName: validatedSource,
35
+ nodePath,
36
+ fieldKey: 'freeze',
37
+ value: remove ? null : freezeFrame,
38
+ defaultValue: null,
39
+ schema: sequence.controls.schema,
40
+ },
41
+ ],
42
+ setPropStatuses,
43
+ clientId,
44
+ undoLabel: remove ? 'Unfreeze sequence' : 'Freeze sequence',
45
+ redoLabel: remove ? 'Freeze sequence again' : 'Unfreeze sequence again',
46
+ });
47
+ }, [
48
+ canToggleFreeze,
49
+ clientId,
50
+ isFrozen,
51
+ nodePath,
52
+ sequence.controls,
53
+ sequence.duration,
54
+ sequence.from,
55
+ sequenceFrameOffset,
56
+ setPropStatuses,
57
+ timelinePosition,
58
+ validatedSource,
59
+ ]);
60
+ return (0, react_1.useMemo)(() => ({
61
+ type: 'item',
62
+ id: 'toggle-freeze-frame',
63
+ keyHint: null,
64
+ label: isFrozen ? 'Unfreeze frame' : 'Freeze frame',
65
+ leftItem: null,
66
+ disabled: !canToggleFreeze,
67
+ onClick: onToggleFreezeFrame,
68
+ quickSwitcherLabel: null,
69
+ subMenu: null,
70
+ value: 'toggle-freeze-frame',
71
+ }), [canToggleFreeze, isFrozen, onToggleFreezeFrame]);
72
+ };
73
+ exports.useSequenceFreezeFrameMenuItem = useSequenceFreezeFrameMenuItem;
@@ -1,9 +1,9 @@
1
- import type { SequenceSchema } from 'remotion';
1
+ import type { InteractivitySchema } from 'remotion';
2
2
  import type { OriginalPosition } from '../../error-overlay/react-overlay/utils/get-source-map';
3
3
  export declare const useSequencePropsSubscription: ({ originalLocation, overrideId, componentIdentity, schema, effects, }: {
4
4
  overrideId: string;
5
5
  componentIdentity: string | null;
6
- schema: SequenceSchema;
7
- effects: SequenceSchema[];
6
+ schema: InteractivitySchema;
7
+ effects: InteractivitySchema[];
8
8
  originalLocation: OriginalPosition | null;
9
9
  }) => void;
@@ -0,0 +1,11 @@
1
+ import { type TSequence } from 'remotion';
2
+ import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
+ export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, }: {
4
+ readonly sequence: TSequence;
5
+ readonly nodePathInfo: SequenceNodePathInfo;
6
+ }) => {
7
+ getIsExpanded: import("../ExpandedTracksProvider").GetIsExpanded;
8
+ propStatuses: import("remotion").PropStatuses;
9
+ toggleTrack: (nodePathInfo: SequenceNodePathInfo) => void;
10
+ tree: import("../../helpers/timeline-layout").TimelineTreeNode[];
11
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useTimelineExpandedTree = void 0;
4
+ const react_1 = require("react");
5
+ const remotion_1 = require("remotion");
6
+ const timeline_layout_1 = require("../../helpers/timeline-layout");
7
+ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
8
+ const useTimelineExpandedTree = ({ sequence, nodePathInfo, }) => {
9
+ const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
10
+ const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
11
+ const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
12
+ const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
13
+ const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
14
+ sequence,
15
+ nodePathInfo,
16
+ getDragOverrides,
17
+ getEffectDragOverrides,
18
+ propStatuses: visualModePropStatuses,
19
+ }), [
20
+ sequence,
21
+ nodePathInfo,
22
+ getDragOverrides,
23
+ getEffectDragOverrides,
24
+ visualModePropStatuses,
25
+ ]);
26
+ return {
27
+ getIsExpanded,
28
+ propStatuses: visualModePropStatuses,
29
+ toggleTrack,
30
+ tree,
31
+ };
32
+ };
33
+ exports.useTimelineExpandedTree = useTimelineExpandedTree;
@@ -1 +1 @@
1
- export declare const VisualControlsContent: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const VisualControlsContent: () => import("react/jsx-runtime").JSX.Element | null;
@@ -37,16 +37,15 @@ exports.VisualControlsContent = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const VisualControls_1 = require("../../visual-controls/VisualControls");
40
- const is_menu_item_1 = require("../Menu/is-menu-item");
41
40
  const SchemaSeparationLine_1 = require("../RenderModal/SchemaEditor/SchemaSeparationLine");
42
41
  const VisualControlHandle_1 = require("./VisualControlHandle");
43
- const container = {
44
- overflowY: 'auto',
45
- };
46
42
  const VisualControlsContent = () => {
47
43
  const { handles } = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
48
44
  const entries = Object.entries(handles);
49
- return (jsx_runtime_1.jsx("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: entries.map(([key, value], i) => {
45
+ if (entries.length === 0) {
46
+ return null;
47
+ }
48
+ return (jsx_runtime_1.jsx("div", { children: entries.map(([key, value], i) => {
50
49
  return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [
51
50
  jsx_runtime_1.jsx(VisualControlHandle_1.VisualControlHandle, { keyName: key, value: value }), i === entries.length - 1 ? null : jsx_runtime_1.jsx(SchemaSeparationLine_1.SchemaSeparationLine, {})] }, key));
52
51
  }) }));
@@ -9,3 +9,13 @@ export declare const addEffectFromDragData: ({ clientId, dragData, fileName, nod
9
9
  readonly fileName: string;
10
10
  readonly nodePath: SequencePropsSubscriptionKey;
11
11
  }) => Promise<void>;
12
+ export declare const addEffectToSequence: ({ clientId, effect, fileName, nodePath, }: {
13
+ readonly clientId: string;
14
+ readonly effect: {
15
+ name: string;
16
+ importPath: string;
17
+ config: Record<string, unknown>;
18
+ };
19
+ readonly fileName: string;
20
+ readonly nodePath: SequencePropsSubscriptionKey;
21
+ }) => Promise<void>;