@remotion/studio 4.0.483 → 4.0.485

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 (113) hide show
  1. package/dist/components/ColorPicker/ColorPicker.js +65 -3
  2. package/dist/components/ColorPicker/ColorPickerPopup.d.ts +1 -0
  3. package/dist/components/ColorPicker/ColorPickerPopup.js +3 -2
  4. package/dist/components/ContextMenu.js +75 -1
  5. package/dist/components/CurrentComposition.js +3 -2
  6. package/dist/components/InlineCompositionName.d.ts +7 -0
  7. package/dist/components/InlineCompositionName.js +58 -0
  8. package/dist/components/InlineEditableTitle.d.ts +7 -0
  9. package/dist/components/InlineEditableTitle.js +129 -0
  10. package/dist/components/InspectorPanel/EasingInspector.js +184 -10
  11. package/dist/components/InspectorPanel/KeyframeEasingNavigator.d.ts +14 -0
  12. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +146 -0
  13. package/dist/components/InspectorPanel/KeyframeInspector.d.ts +1 -1
  14. package/dist/components/InspectorPanel/KeyframeInspector.js +229 -5
  15. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +17 -0
  16. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +80 -0
  17. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -58
  18. package/dist/components/InspectorPanel/common.d.ts +12 -0
  19. package/dist/components/InspectorPanel/common.js +78 -1
  20. package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +14 -0
  21. package/dist/components/InspectorPanel/easing-inspector-selection.js +18 -0
  22. package/dist/components/InspectorPanel/keyframe-easing-navigator-items.d.ts +24 -0
  23. package/dist/components/InspectorPanel/keyframe-easing-navigator-items.js +40 -0
  24. package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +8 -0
  25. package/dist/components/InspectorPanel/keyframe-inspector-frame.js +14 -0
  26. package/dist/components/InspectorPanel/styles.d.ts +1 -0
  27. package/dist/components/InspectorPanel/styles.js +9 -3
  28. package/dist/components/InspectorSequenceSection.js +37 -10
  29. package/dist/components/Modals.js +1 -1
  30. package/dist/components/NewComposition/CodemodFooter.d.ts +7 -1
  31. package/dist/components/NewComposition/CodemodFooter.js +17 -12
  32. package/dist/components/NewComposition/DeleteComposition.js +7 -1
  33. package/dist/components/NewComposition/DeleteFolder.js +7 -1
  34. package/dist/components/NewComposition/DuplicateComposition.js +17 -10
  35. package/dist/components/NewComposition/InputAndValidationContainer.d.ts +3 -0
  36. package/dist/components/NewComposition/InputAndValidationContainer.js +15 -0
  37. package/dist/components/NewComposition/NewCompDuration.js +7 -6
  38. package/dist/components/NewComposition/NewComposition.d.ts +5 -1
  39. package/dist/components/NewComposition/NewComposition.js +29 -86
  40. package/dist/components/NewComposition/RenameComposition.js +13 -14
  41. package/dist/components/NewComposition/RenameFolder.js +9 -2
  42. package/dist/components/NewComposition/RenameStaticFile.js +2 -1
  43. package/dist/components/NewComposition/ValidationMessage.js +9 -1
  44. package/dist/components/OptionsPanel.d.ts +0 -3
  45. package/dist/components/OptionsPanel.js +7 -3
  46. package/dist/components/Preview.js +1 -1
  47. package/dist/components/RenderModal/ServerRenderModal.js +4 -3
  48. package/dist/components/RenderModal/WebRenderModal.js +2 -1
  49. package/dist/components/SelectedOutlineElement.js +45 -3
  50. package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
  51. package/dist/components/SelectedOutlineOverlay.js +48 -15
  52. package/dist/components/Timeline/EasingEditorModal.js +9 -4
  53. package/dist/components/Timeline/TimelineDeleteKeybindings.js +45 -2
  54. package/dist/components/Timeline/TimelineEffectPropItem.js +82 -1
  55. package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
  56. package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -1
  57. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -1
  58. package/dist/components/Timeline/TimelineKeyframeControls.js +38 -7
  59. package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +4 -0
  60. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +12 -6
  61. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
  62. package/dist/components/Timeline/TimelineSelection.js +1 -0
  63. package/dist/components/Timeline/TimelineSequenceItem.js +13 -62
  64. package/dist/components/Timeline/TimelineSequenceName.d.ts +1 -0
  65. package/dist/components/Timeline/TimelineSequenceName.js +7 -6
  66. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +1 -1
  67. package/dist/components/Timeline/TimelineSequencePropItem.js +86 -4
  68. package/dist/components/Timeline/TimelineSlider.js +17 -3
  69. package/dist/components/Timeline/TimelineTextContentField.d.ts +12 -0
  70. package/dist/components/Timeline/TimelineTextContentField.js +100 -0
  71. package/dist/components/Timeline/TimelineWidthProvider.js +18 -3
  72. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +8 -2
  73. package/dist/components/Timeline/delete-selected-timeline-item.js +80 -1
  74. package/dist/components/Timeline/focus-inspector-field.d.ts +16 -0
  75. package/dist/components/Timeline/focus-inspector-field.js +49 -0
  76. package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +18 -0
  77. package/dist/components/Timeline/get-animation-item-selection-for-frame.js +49 -0
  78. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +15 -0
  79. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +26 -0
  80. package/dist/components/Timeline/save-sequence-prop.js +2 -0
  81. package/dist/components/Timeline/split-selected-timeline-item.d.ts +38 -0
  82. package/dist/components/Timeline/split-selected-timeline-item.js +156 -0
  83. package/dist/components/Timeline/timeline-field-display-utils.js +2 -0
  84. package/dist/components/Timeline/update-selected-easing.d.ts +1 -0
  85. package/dist/components/Timeline/update-selected-easing.js +4 -3
  86. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
  87. package/dist/components/Timeline/use-rename-sequence.d.ts +30 -0
  88. package/dist/components/Timeline/use-rename-sequence.js +115 -0
  89. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
  90. package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
  91. package/dist/components/Timeline/use-timeline-height.js +1 -0
  92. package/dist/components/composition-menu-items.js +3 -0
  93. package/dist/components/folder-menu-items.js +20 -0
  94. package/dist/components/options-sidebar-tabs.d.ts +4 -0
  95. package/dist/components/options-sidebar-tabs.js +5 -0
  96. package/dist/components/selected-outline-types.d.ts +6 -1
  97. package/dist/esm/{chunk-fq0j774v.js → chunk-103pp4n7.js} +17652 -15098
  98. package/dist/esm/internals.mjs +17652 -15098
  99. package/dist/esm/previewEntry.mjs +18357 -15803
  100. package/dist/esm/renderEntry.mjs +1 -1
  101. package/dist/helpers/render-codec-label.d.ts +1 -1
  102. package/dist/helpers/timeline-layout.d.ts +4 -3
  103. package/dist/helpers/timeline-layout.js +3 -1
  104. package/dist/helpers/use-create-composition.d.ts +35 -0
  105. package/dist/helpers/use-create-composition.js +111 -0
  106. package/dist/helpers/use-menu-structure.js +0 -14
  107. package/dist/helpers/use-rename-composition.d.ts +16 -0
  108. package/dist/helpers/use-rename-composition.js +49 -0
  109. package/dist/state/modals.d.ts +3 -0
  110. package/dist/state/timeline-zoom.js +17 -14
  111. package/dist/state/z-index.d.ts +1 -0
  112. package/dist/state/z-index.js +11 -2
  113. package/package.json +12 -12
@@ -0,0 +1,16 @@
1
+ import type { SequencePropsSubscriptionKey } from 'remotion';
2
+ export declare const registerFocusInspectorFieldElement: ({ element, fieldKey, nodePath, }: {
3
+ readonly element: HTMLTextAreaElement | null;
4
+ readonly fieldKey: string;
5
+ readonly nodePath: SequencePropsSubscriptionKey | null;
6
+ }) => void;
7
+ export declare const requestFocusInspectorField: ({ fieldKey, nodePath, }: {
8
+ readonly fieldKey: string;
9
+ readonly nodePath: SequencePropsSubscriptionKey;
10
+ }) => void;
11
+ export declare const registerCommitPendingInspectorField: ({ commitPending, fieldKey, nodePath, }: {
12
+ readonly commitPending: (() => boolean) | null;
13
+ readonly fieldKey: string;
14
+ readonly nodePath: SequencePropsSubscriptionKey | null;
15
+ }) => void;
16
+ export declare const commitPendingInspectorFields: () => boolean;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commitPendingInspectorFields = exports.registerCommitPendingInspectorField = exports.requestFocusInspectorField = exports.registerFocusInspectorFieldElement = void 0;
4
+ const serializeRegistryKey = ({ fieldKey, nodePath, }) => {
5
+ return JSON.stringify({ fieldKey, nodePath });
6
+ };
7
+ const registeredFields = new Map();
8
+ const registeredCommitPendingCallbacks = new Map();
9
+ const registerFocusInspectorFieldElement = ({ element, fieldKey, nodePath, }) => {
10
+ if (nodePath === null) {
11
+ return;
12
+ }
13
+ const key = serializeRegistryKey({ fieldKey, nodePath });
14
+ if (element === null) {
15
+ registeredFields.delete(key);
16
+ return;
17
+ }
18
+ registeredFields.set(key, element);
19
+ };
20
+ exports.registerFocusInspectorFieldElement = registerFocusInspectorFieldElement;
21
+ const requestFocusInspectorField = ({ fieldKey, nodePath, }) => {
22
+ const element = registeredFields.get(serializeRegistryKey({ fieldKey, nodePath }));
23
+ requestAnimationFrame(() => {
24
+ element === null || element === void 0 ? void 0 : element.scrollIntoView({ block: 'center' });
25
+ element === null || element === void 0 ? void 0 : element.focus();
26
+ element === null || element === void 0 ? void 0 : element.select();
27
+ });
28
+ };
29
+ exports.requestFocusInspectorField = requestFocusInspectorField;
30
+ const registerCommitPendingInspectorField = ({ commitPending, fieldKey, nodePath, }) => {
31
+ if (nodePath === null) {
32
+ return;
33
+ }
34
+ const key = serializeRegistryKey({ fieldKey, nodePath });
35
+ if (commitPending === null) {
36
+ registeredCommitPendingCallbacks.delete(key);
37
+ return;
38
+ }
39
+ registeredCommitPendingCallbacks.set(key, commitPending);
40
+ };
41
+ exports.registerCommitPendingInspectorField = registerCommitPendingInspectorField;
42
+ const commitPendingInspectorFields = () => {
43
+ let committed = false;
44
+ for (const commitPending of registeredCommitPendingCallbacks.values()) {
45
+ committed = commitPending() || committed;
46
+ }
47
+ return committed;
48
+ };
49
+ exports.commitPendingInspectorFields = commitPendingInspectorFields;
@@ -0,0 +1,18 @@
1
+ import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
2
+ import type { TimelineSelection } from './TimelineSelection';
3
+ type AnimationItemSelection = Extract<TimelineSelection, {
4
+ type: 'keyframe';
5
+ } | {
6
+ type: 'easing';
7
+ }>;
8
+ type AnimationKeyframe = {
9
+ readonly frame: number;
10
+ };
11
+ export declare const getAnimationItemSelectionForSourceFrame: ({ includeEasings, keyframeDisplayOffset, keyframes, nodePathInfo, sourceFrame, }: {
12
+ readonly includeEasings: boolean;
13
+ readonly keyframeDisplayOffset: number;
14
+ readonly keyframes: readonly AnimationKeyframe[];
15
+ readonly nodePathInfo: SequenceNodePathInfo;
16
+ readonly sourceFrame: number;
17
+ }) => AnimationItemSelection | null;
18
+ export {};
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAnimationItemSelectionForSourceFrame = void 0;
4
+ const getKeyframeSelection = ({ keyframe, keyframeDisplayOffset, nodePathInfo, }) => {
5
+ return {
6
+ type: 'keyframe',
7
+ nodePathInfo,
8
+ frame: keyframe.frame + keyframeDisplayOffset,
9
+ };
10
+ };
11
+ const getAnimationItemSelectionForSourceFrame = ({ includeEasings, keyframeDisplayOffset, keyframes, nodePathInfo, sourceFrame, }) => {
12
+ const firstKeyframe = keyframes[0];
13
+ if (!firstKeyframe) {
14
+ return null;
15
+ }
16
+ for (let i = 0; i < keyframes.length; i++) {
17
+ const keyframe = keyframes[i];
18
+ if (keyframe.frame === sourceFrame) {
19
+ return getKeyframeSelection({
20
+ keyframe,
21
+ keyframeDisplayOffset,
22
+ nodePathInfo,
23
+ });
24
+ }
25
+ const nextKeyframe = keyframes[i + 1];
26
+ if (!nextKeyframe) {
27
+ continue;
28
+ }
29
+ if (sourceFrame > keyframe.frame && sourceFrame < nextKeyframe.frame) {
30
+ if (!includeEasings) {
31
+ return null;
32
+ }
33
+ return {
34
+ type: 'easing',
35
+ nodePathInfo,
36
+ fromFrame: keyframe.frame + keyframeDisplayOffset,
37
+ toFrame: nextKeyframe.frame + keyframeDisplayOffset,
38
+ segmentIndex: i,
39
+ };
40
+ }
41
+ }
42
+ const lastKeyframe = keyframes[keyframes.length - 1];
43
+ return getKeyframeSelection({
44
+ keyframe: sourceFrame < firstKeyframe.frame ? firstKeyframe : lastKeyframe,
45
+ keyframeDisplayOffset,
46
+ nodePathInfo,
47
+ });
48
+ };
49
+ exports.getAnimationItemSelectionForSourceFrame = getAnimationItemSelectionForSourceFrame;
@@ -0,0 +1,15 @@
1
+ import type { CanUpdateSequencePropStatusKeyframed } from 'remotion';
2
+ import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
+ export declare const getEasingSelectionAfterKeyframeDelete: ({ deletedSourceFrames, keyframeDisplayOffset, nodePathInfo, propStatus, timelinePosition, }: {
4
+ readonly deletedSourceFrames: readonly number[];
5
+ readonly keyframeDisplayOffset: number;
6
+ readonly nodePathInfo: SequenceNodePathInfo;
7
+ readonly propStatus: CanUpdateSequencePropStatusKeyframed;
8
+ readonly timelinePosition: number;
9
+ }) => {
10
+ readonly type: "easing";
11
+ readonly nodePathInfo: SequenceNodePathInfo;
12
+ readonly fromFrame: number;
13
+ readonly toFrame: number;
14
+ readonly segmentIndex: number;
15
+ } | null;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEasingSelectionAfterKeyframeDelete = void 0;
4
+ const getEasingSelectionAfterKeyframeDelete = ({ deletedSourceFrames, keyframeDisplayOffset, nodePathInfo, propStatus, timelinePosition, }) => {
5
+ const deletedSourceFrameSet = new Set(deletedSourceFrames);
6
+ const remainingKeyframes = propStatus.keyframes.filter((keyframe) => !deletedSourceFrameSet.has(keyframe.frame));
7
+ const sourceFrame = timelinePosition - keyframeDisplayOffset;
8
+ for (let i = 0; i < remainingKeyframes.length - 1; i++) {
9
+ const keyframe = remainingKeyframes[i];
10
+ const nextKeyframe = remainingKeyframes[i + 1];
11
+ if (!keyframe || !nextKeyframe) {
12
+ continue;
13
+ }
14
+ if (sourceFrame > keyframe.frame && sourceFrame < nextKeyframe.frame) {
15
+ return {
16
+ type: 'easing',
17
+ nodePathInfo,
18
+ fromFrame: keyframe.frame + keyframeDisplayOffset,
19
+ toFrame: nextKeyframe.frame + keyframeDisplayOffset,
20
+ segmentIndex: i,
21
+ };
22
+ }
23
+ }
24
+ return null;
25
+ };
26
+ exports.getEasingSelectionAfterKeyframeDelete = getEasingSelectionAfterKeyframeDelete;
@@ -20,6 +20,7 @@ const saveSequenceProps = ({ changes, setPropStatuses, clientId, undoLabel, redo
20
20
  previous: prev,
21
21
  fieldKey: change.fieldKey,
22
22
  value: change.value,
23
+ defaultValue: change.defaultValue,
23
24
  schema: change.schema,
24
25
  }),
25
26
  apiCall: () => (0, call_api_1.callApi)('/api/save-sequence-props', {
@@ -45,6 +46,7 @@ const saveSequenceProps = ({ changes, setPropStatuses, clientId, undoLabel, redo
45
46
  previous: prev,
46
47
  fieldKey: change.fieldKey,
47
48
  value: change.value,
49
+ defaultValue: change.defaultValue,
48
50
  schema: change.schema,
49
51
  }));
50
52
  }
@@ -0,0 +1,38 @@
1
+ import type { CanUpdateSequencePropStatus, OverrideIdToNodePaths, PropStatuses, TSequence } from 'remotion';
2
+ import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
+ import type { TimelineSelection } from './TimelineSelection';
4
+ export type SplitTimelineSequenceEligibility = {
5
+ canSplit: true;
6
+ nodePathInfo: SequenceNodePathInfo;
7
+ } | {
8
+ canSplit: false;
9
+ reason: string;
10
+ };
11
+ export declare const getTimelineSequenceSplitUnsupportedReason: (componentName: string | null | undefined) => string | null;
12
+ export declare const getTimelineSequenceSplitEligibility: ({ selection, sequence, splitFrame, propStatuses, }: {
13
+ selection: TimelineSelection;
14
+ sequence: TSequence | null;
15
+ splitFrame: number;
16
+ propStatuses?: Partial<Record<"durationInFrames" | "from" | "trimBefore", CanUpdateSequencePropStatus>> | undefined;
17
+ }) => SplitTimelineSequenceEligibility;
18
+ export declare const splitTimelineSequenceFromSource: ({ nodePathInfo, splitFrame, }: {
19
+ nodePathInfo: SequenceNodePathInfo;
20
+ splitFrame: number;
21
+ }) => Promise<boolean>;
22
+ export declare const shouldHandleTimelineDuplicateShortcut: ({ shiftKey, }: {
23
+ readonly shiftKey: boolean;
24
+ }) => boolean;
25
+ export declare const shouldHandleTimelineSplitShortcut: ({ shiftKey, }: {
26
+ readonly shiftKey: boolean;
27
+ }) => boolean;
28
+ export declare const splitSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, splitFrame, splitSequence, }: {
29
+ selections: readonly TimelineSelection[];
30
+ sequences: TSequence[];
31
+ overrideIdsToNodePaths: OverrideIdToNodePaths;
32
+ propStatuses: PropStatuses | undefined;
33
+ splitFrame: number;
34
+ splitSequence?: ((options: {
35
+ nodePathInfo: SequenceNodePathInfo;
36
+ splitFrame: number;
37
+ }) => Promise<boolean>) | undefined;
38
+ }) => Promise<boolean> | null;
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.splitSelectedTimelineItems = exports.shouldHandleTimelineSplitShortcut = exports.shouldHandleTimelineDuplicateShortcut = exports.splitTimelineSequenceFromSource = exports.getTimelineSequenceSplitEligibility = exports.getTimelineSequenceSplitUnsupportedReason = void 0;
4
+ const remotion_1 = require("remotion");
5
+ const call_api_1 = require("../call-api");
6
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
7
+ const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
8
+ const getTimelineSequenceSplitUnsupportedReason = (componentName) => {
9
+ if (componentName === '<TransitionSeries.Sequence>' ||
10
+ componentName === '<TransitionSeries.Overlay>') {
11
+ return `${componentName} cannot be split from source`;
12
+ }
13
+ return null;
14
+ };
15
+ exports.getTimelineSequenceSplitUnsupportedReason = getTimelineSequenceSplitUnsupportedReason;
16
+ const staticNumberish = (status) => {
17
+ if (!status) {
18
+ return true;
19
+ }
20
+ return (status.status === 'static' &&
21
+ (typeof status.codeValue === 'number' || status.codeValue === undefined));
22
+ };
23
+ const getTimelineSequenceSplitEligibility = ({ selection, sequence, splitFrame, propStatuses, }) => {
24
+ var _a;
25
+ if (selection.type !== 'sequence') {
26
+ return {
27
+ canSplit: false,
28
+ reason: 'Select one sequence to split',
29
+ };
30
+ }
31
+ if (!sequence) {
32
+ return {
33
+ canSplit: false,
34
+ reason: 'Could not find selected sequence',
35
+ };
36
+ }
37
+ if (!Number.isInteger(splitFrame)) {
38
+ return {
39
+ canSplit: false,
40
+ reason: 'Split frame must be an integer',
41
+ };
42
+ }
43
+ if (sequence.isInsideSeries) {
44
+ return {
45
+ canSplit: false,
46
+ reason: 'Series.Sequence clips cannot be split from source',
47
+ };
48
+ }
49
+ const unsupportedReason = (0, exports.getTimelineSequenceSplitUnsupportedReason)((_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.componentName);
50
+ if (unsupportedReason) {
51
+ return {
52
+ canSplit: false,
53
+ reason: unsupportedReason,
54
+ };
55
+ }
56
+ const { nodePathInfo } = selection;
57
+ if (!nodePathInfo.sequenceSubscriptionKey.nodePath) {
58
+ return {
59
+ canSplit: false,
60
+ reason: 'Sequence has no editable source node',
61
+ };
62
+ }
63
+ if (nodePathInfo.numberOfSequencesWithThisNodePath > 1) {
64
+ return {
65
+ canSplit: false,
66
+ reason: 'Programmatically duplicated sequences cannot be split',
67
+ };
68
+ }
69
+ if (!staticNumberish(propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses.from) ||
70
+ !staticNumberish(propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses.durationInFrames) ||
71
+ !staticNumberish(propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses.trimBefore)) {
72
+ return {
73
+ canSplit: false,
74
+ reason: 'Sequence timing props must be static numbers',
75
+ };
76
+ }
77
+ const start = sequence.from;
78
+ const end = sequence.duration === Infinity
79
+ ? Infinity
80
+ : sequence.from + sequence.duration;
81
+ if (splitFrame <= start) {
82
+ return {
83
+ canSplit: false,
84
+ reason: 'Cannot split at the sequence start',
85
+ };
86
+ }
87
+ if (splitFrame >= end) {
88
+ return {
89
+ canSplit: false,
90
+ reason: 'Cannot split at the sequence end',
91
+ };
92
+ }
93
+ return {
94
+ canSplit: true,
95
+ nodePathInfo,
96
+ };
97
+ };
98
+ exports.getTimelineSequenceSplitEligibility = getTimelineSequenceSplitEligibility;
99
+ const splitTimelineSequenceFromSource = ({ nodePathInfo, splitFrame, }) => {
100
+ const nodePath = nodePathInfo.sequenceSubscriptionKey;
101
+ return (0, call_api_1.callApi)('/api/split-jsx-sequence', {
102
+ fileName: nodePath.absolutePath,
103
+ nodePath: nodePath.nodePath,
104
+ splitFrame,
105
+ })
106
+ .then((result) => {
107
+ if (result.success) {
108
+ (0, NotificationCenter_1.showNotification)('Split sequence', 2000);
109
+ return true;
110
+ }
111
+ (0, NotificationCenter_1.showNotification)(result.reason, 4000);
112
+ return false;
113
+ })
114
+ .catch((err) => {
115
+ (0, NotificationCenter_1.showNotification)(err.message, 4000);
116
+ return false;
117
+ });
118
+ };
119
+ exports.splitTimelineSequenceFromSource = splitTimelineSequenceFromSource;
120
+ const shouldHandleTimelineDuplicateShortcut = ({ shiftKey, }) => !shiftKey;
121
+ exports.shouldHandleTimelineDuplicateShortcut = shouldHandleTimelineDuplicateShortcut;
122
+ const shouldHandleTimelineSplitShortcut = ({ shiftKey, }) => shiftKey;
123
+ exports.shouldHandleTimelineSplitShortcut = shouldHandleTimelineSplitShortcut;
124
+ const splitSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodePaths, propStatuses, splitFrame, splitSequence = exports.splitTimelineSequenceFromSource, }) => {
125
+ var _a;
126
+ if (selections.length !== 1) {
127
+ return null;
128
+ }
129
+ const [selection] = selections;
130
+ if (selection.type !== 'sequence') {
131
+ return null;
132
+ }
133
+ const track = (0, find_track_for_node_path_info_1.findTrackForNodePathInfo)({
134
+ sequences,
135
+ overrideIdsToNodePaths,
136
+ nodePathInfo: selection.nodePathInfo,
137
+ });
138
+ const sequencePropStatuses = propStatuses
139
+ ? remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey)
140
+ : undefined;
141
+ const eligibility = (0, exports.getTimelineSequenceSplitEligibility)({
142
+ selection,
143
+ sequence: (_a = track === null || track === void 0 ? void 0 : track.sequence) !== null && _a !== void 0 ? _a : null,
144
+ splitFrame,
145
+ propStatuses: sequencePropStatuses,
146
+ });
147
+ if (!eligibility.canSplit) {
148
+ (0, NotificationCenter_1.showNotification)(eligibility.reason, 4000);
149
+ return Promise.resolve(false);
150
+ }
151
+ return splitSequence({
152
+ nodePathInfo: eligibility.nodePathInfo,
153
+ splitFrame,
154
+ });
155
+ };
156
+ exports.splitSelectedTimelineItems = splitSelectedTimelineItems;
@@ -234,6 +234,8 @@ const formatTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
234
234
  })) !== null && _d !== void 0 ? _d : formatUnknownTimelineValueForDisplay(value));
235
235
  case 'uv-coordinate':
236
236
  return ((_e = formatUvCoordinateTimelineFieldValueForDisplay({ fieldSchema, value })) !== null && _e !== void 0 ? _e : formatUnknownTimelineValueForDisplay(value));
237
+ case 'text-content':
238
+ return String(value);
237
239
  case 'array':
238
240
  case 'boolean':
239
241
  case 'color':
@@ -23,6 +23,7 @@ export type SelectedEasingUpdate = {
23
23
  readonly currentEasing: TimelineEasingValue;
24
24
  readonly propStatus: CanUpdateSequencePropStatusKeyframed;
25
25
  };
26
+ export declare const canEditEasingForInterpolationFunction: (interpolationFunction: string) => boolean;
26
27
  export declare const getSelectedEasingUpdate: ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }: {
27
28
  selection: {
28
29
  readonly type: "easing";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateSelectedTimelineEasings = exports.getTimelineEasingValueForSelection = exports.getEasingSelections = exports.makeEasingDragOverride = exports.getSelectedEasingUpdates = exports.getSelectedEasingUpdate = void 0;
3
+ exports.updateSelectedTimelineEasings = exports.getTimelineEasingValueForSelection = exports.getEasingSelections = exports.makeEasingDragOverride = exports.getSelectedEasingUpdates = exports.getSelectedEasingUpdate = exports.canEditEasingForInterpolationFunction = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const remotion_1 = require("remotion");
6
6
  const call_update_keyframe_settings_1 = require("./call-update-keyframe-settings");
@@ -8,6 +8,7 @@ const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info
8
8
  const parse_keyframe_field_from_node_path_1 = require("./parse-keyframe-field-from-node-path");
9
9
  const canEditEasingForInterpolationFunction = (interpolationFunction) => interpolationFunction === 'interpolate' ||
10
10
  interpolationFunction === 'interpolateColors';
11
+ exports.canEditEasingForInterpolationFunction = canEditEasingForInterpolationFunction;
11
12
  const isEasingSelection = (selection) => selection.type === 'easing';
12
13
  const getSelectedEasingUpdate = ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }) => {
13
14
  var _a;
@@ -33,7 +34,7 @@ const getSelectedEasingUpdate = ({ selection, sequences, overrideIdsToNodePaths,
33
34
  }
34
35
  const sequencePropStatus = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a[field.fieldKey];
35
36
  if ((sequencePropStatus === null || sequencePropStatus === void 0 ? void 0 : sequencePropStatus.status) !== 'keyframed' ||
36
- !canEditEasingForInterpolationFunction(sequencePropStatus.interpolationFunction)) {
37
+ !(0, exports.canEditEasingForInterpolationFunction)(sequencePropStatus.interpolationFunction)) {
37
38
  return null;
38
39
  }
39
40
  return {
@@ -60,7 +61,7 @@ const getSelectedEasingUpdate = ({ selection, sequences, overrideIdsToNodePaths,
60
61
  ? effectStatus.props[field.fieldKey]
61
62
  : null;
62
63
  if ((effectPropStatus === null || effectPropStatus === void 0 ? void 0 : effectPropStatus.status) !== 'keyframed' ||
63
- !canEditEasingForInterpolationFunction(effectPropStatus.interpolationFunction)) {
64
+ !(0, exports.canEditEasingForInterpolationFunction)(effectPropStatus.interpolationFunction)) {
64
65
  return null;
65
66
  }
66
67
  return {
@@ -44,6 +44,7 @@ const useExpandedTrackKeyframeRows = ({ sequence, nodePathInfo, keyframeDisplayO
44
44
  getDragOverrides,
45
45
  getEffectDragOverrides,
46
46
  propStatuses,
47
+ includeTextContent: false,
47
48
  }), [
48
49
  propStatuses,
49
50
  getDragOverrides,
@@ -0,0 +1,30 @@
1
+ import type { TSequence } from 'remotion';
2
+ import type { CodePosition } from '../../error-overlay/react-overlay/utils/get-source-map';
3
+ import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
4
+ type SequenceNameSaveAction = {
5
+ type: 'noop';
6
+ } | {
7
+ type: 'save';
8
+ defaultValue: string | null;
9
+ };
10
+ export declare const getSequenceNameSaveAction: ({ editedName, currentDisplayName, fallbackDisplayName, hasStaticNameProp, }: {
11
+ editedName: string;
12
+ currentDisplayName: string;
13
+ fallbackDisplayName: string;
14
+ hasStaticNameProp: boolean;
15
+ }) => SequenceNameSaveAction;
16
+ export declare const useRenameSequence: ({ clientId, nodePathInfo, sequence, validatedLocation, }: {
17
+ readonly clientId: string | null;
18
+ readonly nodePathInfo: SequenceNodePathInfo | null;
19
+ readonly sequence: TSequence;
20
+ readonly validatedLocation: CodePosition | null;
21
+ }) => {
22
+ canRename: boolean;
23
+ codeNameStatus: import("remotion").CanUpdateSequencePropStatus | undefined;
24
+ displayName: string;
25
+ fallbackDisplayName: string;
26
+ hasStaticNameProp: boolean;
27
+ propStatusesForOverride: Record<string, import("remotion").CanUpdateSequencePropStatus> | undefined;
28
+ saveName: (name: string) => Promise<void>;
29
+ };
30
+ export {};
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRenameSequence = exports.getSequenceNameSaveAction = void 0;
4
+ const react_1 = require("react");
5
+ const remotion_1 = require("remotion");
6
+ const save_sequence_prop_1 = require("./save-sequence-prop");
7
+ const getSequenceNameSaveAction = ({ editedName, currentDisplayName, fallbackDisplayName, hasStaticNameProp, }) => {
8
+ if (!hasStaticNameProp &&
9
+ (editedName === '' || editedName === fallbackDisplayName)) {
10
+ return { type: 'noop' };
11
+ }
12
+ if (hasStaticNameProp && editedName === currentDisplayName) {
13
+ return { type: 'noop' };
14
+ }
15
+ return {
16
+ type: 'save',
17
+ defaultValue: editedName === '' ? JSON.stringify('') : null,
18
+ };
19
+ };
20
+ exports.getSequenceNameSaveAction = getSequenceNameSaveAction;
21
+ const useRenameSequence = ({ clientId, nodePathInfo, sequence, validatedLocation, }) => {
22
+ var _a;
23
+ var _b, _c;
24
+ const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
25
+ const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
26
+ const nodePath = (_b = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _b !== void 0 ? _b : null;
27
+ const propStatusesForOverride = (0, react_1.useMemo)(() => {
28
+ return nodePath
29
+ ? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
30
+ : undefined;
31
+ }, [propStatuses, nodePath]);
32
+ const codeNameStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.name;
33
+ const fallbackDisplayName = (_c = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.componentName) !== null && _c !== void 0 ? _c : '<Sequence>';
34
+ const staticNamePropValue = (codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status) === 'static' &&
35
+ typeof codeNameStatus.codeValue === 'string'
36
+ ? codeNameStatus.codeValue
37
+ : null;
38
+ const hasStaticNameProp = staticNamePropValue !== null;
39
+ const displayName = (0, react_1.useMemo)(() => {
40
+ if (staticNamePropValue !== null) {
41
+ return staticNamePropValue;
42
+ }
43
+ if ((codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status) === 'static') {
44
+ return fallbackDisplayName;
45
+ }
46
+ return sequence.displayName;
47
+ }, [
48
+ codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status,
49
+ fallbackDisplayName,
50
+ sequence.displayName,
51
+ staticNamePropValue,
52
+ ]);
53
+ const canRename = clientId !== null &&
54
+ !window.remotion_isReadOnlyStudio &&
55
+ Boolean(sequence.controls) &&
56
+ nodePath !== null &&
57
+ validatedLocation !== null &&
58
+ codeNameStatus !== undefined &&
59
+ codeNameStatus !== null &&
60
+ codeNameStatus.status === 'static';
61
+ const saveName = (0, react_1.useCallback)(async (name) => {
62
+ if (!canRename ||
63
+ clientId === null ||
64
+ !sequence.controls ||
65
+ !nodePath ||
66
+ !validatedLocation) {
67
+ return;
68
+ }
69
+ const action = (0, exports.getSequenceNameSaveAction)({
70
+ editedName: name,
71
+ currentDisplayName: displayName,
72
+ fallbackDisplayName,
73
+ hasStaticNameProp,
74
+ });
75
+ if (action.type === 'noop') {
76
+ return;
77
+ }
78
+ await (0, save_sequence_prop_1.saveSequenceProps)({
79
+ changes: [
80
+ {
81
+ fileName: validatedLocation.source,
82
+ nodePath,
83
+ fieldKey: 'name',
84
+ value: name,
85
+ defaultValue: action.defaultValue,
86
+ schema: sequence.controls.schema,
87
+ },
88
+ ],
89
+ setPropStatuses,
90
+ clientId,
91
+ undoLabel: 'Rename sequence',
92
+ redoLabel: 'Rename sequence again',
93
+ });
94
+ }, [
95
+ canRename,
96
+ clientId,
97
+ displayName,
98
+ fallbackDisplayName,
99
+ hasStaticNameProp,
100
+ nodePath,
101
+ sequence.controls,
102
+ setPropStatuses,
103
+ validatedLocation,
104
+ ]);
105
+ return {
106
+ canRename,
107
+ codeNameStatus,
108
+ displayName,
109
+ fallbackDisplayName,
110
+ hasStaticNameProp,
111
+ propStatusesForOverride,
112
+ saveName,
113
+ };
114
+ };
115
+ exports.useRenameSequence = useRenameSequence;
@@ -1,8 +1,9 @@
1
1
  import { type TSequence } from 'remotion';
2
2
  import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
- export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, }: {
3
+ export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, includeTextContent, }: {
4
4
  readonly sequence: TSequence;
5
5
  readonly nodePathInfo: SequenceNodePathInfo;
6
+ readonly includeTextContent: boolean;
6
7
  }) => {
7
8
  filteredTree: import("../../helpers/timeline-layout").TimelineTreeNode[];
8
9
  getIsExpanded: import("../ExpandedTracksProvider").GetIsExpanded;
@@ -8,7 +8,7 @@ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
8
8
  const get_node_keyframes_1 = require("./get-node-keyframes");
9
9
  const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
10
10
  const TimelineSelection_1 = require("./TimelineSelection");
11
- const useTimelineExpandedTree = ({ sequence, nodePathInfo, }) => {
11
+ const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, }) => {
12
12
  const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
13
13
  const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
14
14
  const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
@@ -20,12 +20,14 @@ const useTimelineExpandedTree = ({ sequence, nodePathInfo, }) => {
20
20
  getDragOverrides,
21
21
  getEffectDragOverrides,
22
22
  propStatuses: visualModePropStatuses,
23
+ includeTextContent,
23
24
  }), [
24
25
  sequence,
25
26
  nodePathInfo,
26
27
  getDragOverrides,
27
28
  getEffectDragOverrides,
28
29
  visualModePropStatuses,
30
+ includeTextContent,
29
31
  ]);
30
32
  const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
31
33
  const filteredTree = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
@@ -37,6 +37,7 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
37
37
  getDragOverrides,
38
38
  getEffectDragOverrides,
39
39
  propStatuses,
40
+ includeTextContent: false,
40
41
  });
41
42
  const filteredTree = (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
42
43
  nodes: tree,
@@ -108,6 +108,9 @@ const getCompositionMenuItems = ({ composition, connectionStatus, resolvedLocati
108
108
  closeMenu();
109
109
  setSelectedModal({
110
110
  type: 'new-comp',
111
+ folderName: null,
112
+ parentName: null,
113
+ stack: null,
111
114
  });
112
115
  },
113
116
  quickSwitcherLabel: 'New composition...',