@remotion/studio 4.0.461 → 4.0.462
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.
- package/dist/components/ExpandedTracksProvider.js +8 -3
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +4 -3
- package/dist/components/Timeline/SubscribeToNodePaths.js +11 -1
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/TimelineColorField.d.ts +11 -0
- package/dist/components/Timeline/TimelineColorField.js +181 -0
- package/dist/components/Timeline/TimelineEffectFieldRow.d.ts +11 -0
- package/dist/components/Timeline/TimelineEffectFieldRow.js +177 -0
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +3 -3
- package/dist/components/Timeline/TimelineExpandedRow.js +8 -1
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +2 -2
- package/dist/components/Timeline/TimelineExpandedSection.js +7 -20
- package/dist/components/Timeline/TimelineFieldRow.d.ts +3 -3
- package/dist/components/Timeline/TimelineFieldRow.js +31 -25
- package/dist/components/Timeline/TimelineListItem.js +5 -4
- package/dist/components/Timeline/TimelineNumberField.js +1 -1
- package/dist/components/Timeline/TimelineRotationField.js +1 -1
- package/dist/components/Timeline/TimelineSchemaField.d.ts +8 -2
- package/dist/components/Timeline/TimelineSchemaField.js +20 -11
- package/dist/components/Timeline/TimelineTracks.js +4 -4
- package/dist/components/Timeline/TimelineTranslateField.js +4 -2
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -1
- package/dist/components/Timeline/sequence-props-subscription-store.js +10 -4
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +2 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +3 -1
- package/dist/components/Timeline/use-timeline-height.js +3 -3
- package/dist/esm/{chunk-yzh34sp0.js → chunk-yvg1f56k.js} +4017 -3545
- package/dist/esm/index.mjs +20 -8
- package/dist/esm/internals.mjs +4017 -3545
- package/dist/esm/previewEntry.mjs +2755 -2294
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.js +13 -5
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -2
- package/dist/helpers/timeline-layout.d.ts +9 -14
- package/dist/helpers/timeline-layout.js +21 -35
- package/dist/icons/eyedropper.d.ts +4 -0
- package/dist/icons/eyedropper.js +6 -0
- package/package.json +11 -12
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
9
9
|
const call_api_1 = require("../call-api");
|
|
10
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
10
11
|
const Padder_1 = require("./Padder");
|
|
11
12
|
const TimelineSchemaField_1 = require("./TimelineSchemaField");
|
|
12
13
|
const fieldRowBase = {
|
|
@@ -27,16 +28,9 @@ const fieldLabelRow = {
|
|
|
27
28
|
alignItems: 'center',
|
|
28
29
|
gap: 6,
|
|
29
30
|
};
|
|
30
|
-
const
|
|
31
|
-
var _a, _b;
|
|
32
|
-
const { getCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
|
|
31
|
+
const Value = ({ field, nodePath, validatedLocation, schema, codeValue }) => {
|
|
33
32
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
34
33
|
const { setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
35
|
-
const codeValuesForOverride = getCodeValues(nodePath);
|
|
36
|
-
const codeValue = (_a = codeValuesForOverride === null || codeValuesForOverride === void 0 ? void 0 : codeValuesForOverride[field.key]) !== null && _a !== void 0 ? _a : null;
|
|
37
|
-
if (codeValue === null) {
|
|
38
|
-
throw new Error('Unexpectedly got null code value for field' + field.key);
|
|
39
|
-
}
|
|
40
34
|
const dragOverrideValue = (0, react_1.useMemo)(() => {
|
|
41
35
|
var _a;
|
|
42
36
|
return nodePath === null
|
|
@@ -45,16 +39,12 @@ const TimelineFieldRow = ({ field, validatedLocation, paddingLeft, nestedDepth,
|
|
|
45
39
|
}, [getDragOverrides, nodePath, field.key]);
|
|
46
40
|
const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
47
41
|
codeValue,
|
|
48
|
-
runtimeValue: field.currentRuntimeValue,
|
|
49
42
|
dragOverrideValue,
|
|
50
43
|
defaultValue: field.fieldSchema.default,
|
|
51
44
|
shouldResortToDefaultValueIfUndefined: true,
|
|
52
45
|
});
|
|
53
46
|
const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
54
47
|
const onSave = (0, react_1.useCallback)((value) => {
|
|
55
|
-
if (!codeValuesForOverride || !validatedLocation || !nodePath) {
|
|
56
|
-
return Promise.reject(new Error('Cannot save'));
|
|
57
|
-
}
|
|
58
48
|
if (!codeValue || !codeValue.canUpdate) {
|
|
59
49
|
return Promise.reject(new Error('Cannot save'));
|
|
60
50
|
}
|
|
@@ -89,22 +79,29 @@ const TimelineFieldRow = ({ field, validatedLocation, paddingLeft, nestedDepth,
|
|
|
89
79
|
schema,
|
|
90
80
|
})
|
|
91
81
|
.then((data) => {
|
|
92
|
-
setCodeValues(nodePath, () =>
|
|
82
|
+
setCodeValues(nodePath, (prev) => {
|
|
83
|
+
if (!data.canUpdate) {
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
canUpdate: true,
|
|
88
|
+
props: data.props,
|
|
89
|
+
effects: prev.canUpdate ? prev.effects : [],
|
|
90
|
+
};
|
|
91
|
+
});
|
|
93
92
|
})
|
|
94
|
-
.catch(() => {
|
|
93
|
+
.catch((err) => {
|
|
95
94
|
// In case something went wrong, undo optimistic update
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
95
|
+
setCodeValues(nodePath, (current) => {
|
|
96
|
+
if (previousUpdate) {
|
|
97
|
+
return previousUpdate;
|
|
98
|
+
}
|
|
99
|
+
return current;
|
|
100
|
+
});
|
|
101
|
+
(0, NotificationCenter_1.showNotification)(`Could not save sequence prop: ${err instanceof Error ? err.message : String(err)}`, 4000);
|
|
104
102
|
});
|
|
105
103
|
}, [
|
|
106
104
|
codeValue,
|
|
107
|
-
codeValuesForOverride,
|
|
108
105
|
field.fieldSchema.default,
|
|
109
106
|
field.key,
|
|
110
107
|
nodePath,
|
|
@@ -124,6 +121,13 @@ const TimelineFieldRow = ({ field, validatedLocation, paddingLeft, nestedDepth,
|
|
|
124
121
|
}
|
|
125
122
|
clearDragOverrides(nodePath);
|
|
126
123
|
}, [clearDragOverrides, nodePath]);
|
|
124
|
+
return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: codeValue, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, effectiveValue: effectiveValue }));
|
|
125
|
+
};
|
|
126
|
+
const TimelineFieldRow = ({ field, validatedLocation, paddingLeft, nestedDepth, nodePath, schema, }) => {
|
|
127
|
+
var _a, _b;
|
|
128
|
+
const { codeValues: visualModeCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
|
|
129
|
+
const codeValuesForOverride = remotion_1.Internals.getCodeValuesCtx(visualModeCodeValues, nodePath);
|
|
130
|
+
const codeValue = (_a = codeValuesForOverride === null || codeValuesForOverride === void 0 ? void 0 : codeValuesForOverride[field.key]) !== null && _a !== void 0 ? _a : null;
|
|
127
131
|
const style = (0, react_1.useMemo)(() => {
|
|
128
132
|
return {
|
|
129
133
|
...fieldRowBase,
|
|
@@ -131,8 +135,10 @@ const TimelineFieldRow = ({ field, validatedLocation, paddingLeft, nestedDepth,
|
|
|
131
135
|
paddingLeft,
|
|
132
136
|
};
|
|
133
137
|
}, [field.rowHeight, paddingLeft]);
|
|
138
|
+
if (codeValue === null) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
134
141
|
return (jsx_runtime_1.jsxs("div", { style: style, children: [
|
|
135
|
-
jsx_runtime_1.jsx(Padder_1.Padder, { depth: nestedDepth + 1 }), jsx_runtime_1.jsx("div", { style: fieldLabelRow, children: jsx_runtime_1.jsx("span", { style: fieldName, children: (_b = field.description) !== null && _b !== void 0 ? _b : field.key }) }), jsx_runtime_1.jsx(
|
|
136
|
-
] }));
|
|
142
|
+
jsx_runtime_1.jsx(Padder_1.Padder, { depth: nestedDepth + 1 }), jsx_runtime_1.jsx("div", { style: fieldLabelRow, children: jsx_runtime_1.jsx("span", { style: fieldName, children: (_b = field.description) !== null && _b !== void 0 ? _b : field.key }) }), codeValue.canUpdate ? (jsx_runtime_1.jsx(Value, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, schema: schema, codeValue: codeValue })) : (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineNonEditableStatus, { propStatus: codeValue }))] }));
|
|
137
143
|
};
|
|
138
144
|
exports.TimelineFieldRow = TimelineFieldRow;
|
|
@@ -20,7 +20,7 @@ const use_resolved_stack_1 = require("./use-resolved-stack");
|
|
|
20
20
|
exports.INDENT = 10;
|
|
21
21
|
const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
|
|
22
22
|
var _a, _b;
|
|
23
|
-
const nodePath = (_a = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.
|
|
23
|
+
const nodePath = (_a = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _a !== void 0 ? _a : null;
|
|
24
24
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
25
25
|
const previewConnected = previewServerState.type === 'connected';
|
|
26
26
|
const { hidden, setHidden } = (0, react_1.useContext)(remotion_1.Internals.SequenceVisibilityToggleContext);
|
|
@@ -59,7 +59,7 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) =>
|
|
|
59
59
|
try {
|
|
60
60
|
const result = await (0, call_api_1.callApi)('/api/duplicate-jsx-node', {
|
|
61
61
|
fileName: validatedLocation.source,
|
|
62
|
-
nodePath,
|
|
62
|
+
nodePath: nodePath.nodePath,
|
|
63
63
|
});
|
|
64
64
|
if (result.success) {
|
|
65
65
|
(0, NotificationCenter_1.showNotification)('Duplicated sequence in source file', 2000);
|
|
@@ -88,7 +88,7 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) =>
|
|
|
88
88
|
try {
|
|
89
89
|
const result = await (0, call_api_1.callApi)('/api/delete-jsx-node', {
|
|
90
90
|
fileName: validatedLocation.source,
|
|
91
|
-
nodePath,
|
|
91
|
+
nodePath: nodePath.nodePath,
|
|
92
92
|
});
|
|
93
93
|
if (result.success) {
|
|
94
94
|
(0, NotificationCenter_1.showNotification)('Removed sequence from source file', 2000);
|
|
@@ -194,6 +194,7 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) =>
|
|
|
194
194
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, children: trackRow })) : (trackRow), previewConnected &&
|
|
195
195
|
isExpanded &&
|
|
196
196
|
hasExpandableContent &&
|
|
197
|
-
nodePathInfo
|
|
197
|
+
nodePathInfo &&
|
|
198
|
+
validatedLocation ? (jsx_runtime_1.jsx(TimelineExpandedSection_1.TimelineExpandedSection, { sequence: sequence, validatedLocation: validatedLocation, nodePathInfo: nodePathInfo, nestedDepth: nestedDepth })) : null] }));
|
|
198
199
|
};
|
|
199
200
|
exports.TimelineListItem = TimelineListItem;
|
|
@@ -31,7 +31,7 @@ const TimelineNumberField = ({ field, effectiveValue, onSave, onDragValueChange,
|
|
|
31
31
|
propStatus.canUpdate &&
|
|
32
32
|
parsed !== propStatus.codeValue) {
|
|
33
33
|
setDragValue(parsed);
|
|
34
|
-
onSave(parsed).
|
|
34
|
+
onSave(parsed).finally(() => {
|
|
35
35
|
setDragValue(null);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -53,7 +53,7 @@ const TimelineRotationField = ({ field, effectiveValue, propStatus, onSave, onDr
|
|
|
53
53
|
const newStr = `${parsed}deg`;
|
|
54
54
|
if (newStr !== propStatus.codeValue) {
|
|
55
55
|
setDragValue(parsed);
|
|
56
|
-
onSave(newStr).
|
|
56
|
+
onSave(newStr).finally(() => {
|
|
57
57
|
setDragValue(null);
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CanUpdateSequencePropStatusFalse, CanUpdateSequencePropStatusTrue } from 'remotion';
|
|
3
3
|
import type { SchemaFieldInfo, TimelineFieldOnDragValueChange, TimelineFieldOnSave } from '../../helpers/timeline-layout';
|
|
4
|
+
export declare const UnsupportedStatus: React.FC<{
|
|
5
|
+
readonly label: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const TimelineNonEditableStatus: React.FC<{
|
|
8
|
+
readonly propStatus: CanUpdateSequencePropStatusFalse;
|
|
9
|
+
}>;
|
|
4
10
|
export declare const TimelineFieldValue: React.FC<{
|
|
5
11
|
readonly field: SchemaFieldInfo;
|
|
6
12
|
readonly onSave: TimelineFieldOnSave;
|
|
7
13
|
readonly onDragValueChange: TimelineFieldOnDragValueChange;
|
|
8
14
|
readonly onDragEnd: () => void;
|
|
9
|
-
readonly propStatus:
|
|
15
|
+
readonly propStatus: CanUpdateSequencePropStatusTrue;
|
|
10
16
|
readonly effectiveValue: unknown;
|
|
11
17
|
}>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineFieldValue = void 0;
|
|
3
|
+
exports.TimelineFieldValue = exports.TimelineNonEditableStatus = exports.UnsupportedStatus = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const TimelineBooleanField_1 = require("./TimelineBooleanField");
|
|
6
|
+
const TimelineColorField_1 = require("./TimelineColorField");
|
|
6
7
|
const TimelineEnumField_1 = require("./TimelineEnumField");
|
|
7
8
|
const TimelineNumberField_1 = require("./TimelineNumberField");
|
|
8
9
|
const TimelineRotationField_1 = require("./TimelineRotationField");
|
|
@@ -20,19 +21,24 @@ const notEditableBackground = {
|
|
|
20
21
|
const inlineWrapper = {
|
|
21
22
|
fontSize: 12,
|
|
22
23
|
};
|
|
24
|
+
const UnsupportedStatus = ({ label }) => {
|
|
25
|
+
return jsx_runtime_1.jsx("span", { style: unsupportedLabel, children: label });
|
|
26
|
+
};
|
|
27
|
+
exports.UnsupportedStatus = UnsupportedStatus;
|
|
28
|
+
const TimelineNonEditableStatus = ({ propStatus }) => {
|
|
29
|
+
if (propStatus.canUpdate) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
if (propStatus.reason === 'computed') {
|
|
33
|
+
return jsx_runtime_1.jsx("span", { style: unsupportedLabel, children: "computed" });
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`Unsupported prop status: ${propStatus.reason}`);
|
|
36
|
+
};
|
|
37
|
+
exports.TimelineNonEditableStatus = TimelineNonEditableStatus;
|
|
23
38
|
const TimelineFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propStatus, effectiveValue, }) => {
|
|
24
39
|
const wrapperStyle = !propStatus.canUpdate
|
|
25
40
|
? notEditableBackground
|
|
26
41
|
: undefined;
|
|
27
|
-
if (!field.supported) {
|
|
28
|
-
return jsx_runtime_1.jsx("span", { style: unsupportedLabel, children: "unsupported" });
|
|
29
|
-
}
|
|
30
|
-
if (!propStatus.canUpdate) {
|
|
31
|
-
if (propStatus.reason === 'computed') {
|
|
32
|
-
return jsx_runtime_1.jsx("span", { style: unsupportedLabel, children: "computed" });
|
|
33
|
-
}
|
|
34
|
-
throw new Error(`Unsupported prop status: ${propStatus.reason}`);
|
|
35
|
-
}
|
|
36
42
|
if (field.typeName === 'number') {
|
|
37
43
|
return (jsx_runtime_1.jsx("span", { style: wrapperStyle, children: jsx_runtime_1.jsx(TimelineNumberField_1.TimelineNumberField, { field: field, effectiveValue: effectiveValue, onSave: onSave, propStatus: propStatus, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd }) }));
|
|
38
44
|
}
|
|
@@ -45,9 +51,12 @@ const TimelineFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propS
|
|
|
45
51
|
if (field.typeName === 'boolean') {
|
|
46
52
|
return (jsx_runtime_1.jsx("span", { style: wrapperStyle, children: jsx_runtime_1.jsx(TimelineBooleanField_1.TimelineBooleanField, { field: field, propStatus: propStatus, onSave: onSave, effectiveValue: effectiveValue }) }));
|
|
47
53
|
}
|
|
54
|
+
if (field.typeName === 'color') {
|
|
55
|
+
return (jsx_runtime_1.jsx("span", { style: wrapperStyle, children: jsx_runtime_1.jsx(TimelineColorField_1.TimelineColorField, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, effectiveValue: effectiveValue }) }));
|
|
56
|
+
}
|
|
48
57
|
if (field.typeName === 'enum') {
|
|
49
58
|
return (jsx_runtime_1.jsx("span", { style: inlineWrapper, children: jsx_runtime_1.jsx(TimelineEnumField_1.TimelineEnumField, { field: field, propStatus: propStatus, onSave: onSave, effectiveValue: effectiveValue, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd }) }));
|
|
50
59
|
}
|
|
51
|
-
|
|
60
|
+
throw new Error(`Unsupported field type: ${field.typeName}`);
|
|
52
61
|
};
|
|
53
62
|
exports.TimelineFieldValue = TimelineFieldValue;
|
|
@@ -52,18 +52,18 @@ const content = {
|
|
|
52
52
|
const timelineContent = {
|
|
53
53
|
minHeight: '100%',
|
|
54
54
|
};
|
|
55
|
-
const getExpandedPlaceholderStyle = ({ sequence, nodePathInfo, getIsExpanded,
|
|
55
|
+
const getExpandedPlaceholderStyle = ({ sequence, nodePathInfo, getIsExpanded, codeValues, }) => ({
|
|
56
56
|
height: (0, timeline_layout_1.getExpandedTrackHeight)({
|
|
57
57
|
sequence,
|
|
58
58
|
nodePathInfo,
|
|
59
59
|
getIsExpanded,
|
|
60
|
-
|
|
60
|
+
codeValues,
|
|
61
61
|
}) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
62
62
|
});
|
|
63
63
|
const TimelineTracksInner = ({ timeline, hasBeenCut }) => {
|
|
64
64
|
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
65
65
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
66
|
-
const {
|
|
66
|
+
const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
|
|
67
67
|
const previewServerConnected = previewServerState.type === 'connected';
|
|
68
68
|
const timelineStyle = (0, react_1.useMemo)(() => {
|
|
69
69
|
return {
|
|
@@ -86,7 +86,7 @@ const TimelineTracksInner = ({ timeline, hasBeenCut }) => {
|
|
|
86
86
|
sequence: track.sequence,
|
|
87
87
|
nodePathInfo: track.nodePathInfo,
|
|
88
88
|
getIsExpanded,
|
|
89
|
-
|
|
89
|
+
codeValues,
|
|
90
90
|
}) })) : null] }, track.sequence.id));
|
|
91
91
|
})] }), hasBeenCut ? jsx_runtime_1.jsx(MaxTimelineTracks_1.MaxTimelineTracksReached, {}) : null] }));
|
|
92
92
|
};
|
|
@@ -65,7 +65,9 @@ const TimelineTranslateField = ({ field, propStatus, effectiveValue, onSave, onD
|
|
|
65
65
|
const newStr = makeString(parsed, currentY);
|
|
66
66
|
if (newStr !== propStatus.codeValue) {
|
|
67
67
|
setDragX(parsed);
|
|
68
|
-
onSave(newStr)
|
|
68
|
+
onSave(newStr).finally(() => {
|
|
69
|
+
setDragX(null);
|
|
70
|
+
});
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
}
|
|
@@ -98,7 +100,7 @@ const TimelineTranslateField = ({ field, propStatus, effectiveValue, onSave, onD
|
|
|
98
100
|
const newStr = makeString(currentX, parsed);
|
|
99
101
|
if (newStr !== propStatus.codeValue) {
|
|
100
102
|
setDragY(parsed);
|
|
101
|
-
onSave(newStr).
|
|
103
|
+
onSave(newStr).finally(() => {
|
|
102
104
|
setDragY(null);
|
|
103
105
|
});
|
|
104
106
|
}
|
|
@@ -2,11 +2,12 @@ import type { SequenceSchema } 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;
|
|
5
|
-
export declare const acquireSequencePropsSubscription: ({ fileName, line, column, schema, clientId, applyOnce, applyEach, }: {
|
|
5
|
+
export declare const acquireSequencePropsSubscription: ({ fileName, line, column, schema, effects, clientId, applyOnce, applyEach, }: {
|
|
6
6
|
fileName: string;
|
|
7
7
|
line: number;
|
|
8
8
|
column: number;
|
|
9
9
|
schema: SequenceSchema;
|
|
10
|
+
effects: SequenceSchema[];
|
|
10
11
|
clientId: string;
|
|
11
12
|
applyOnce: ApplyResult;
|
|
12
13
|
applyEach: ApplyResult;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.acquireSequencePropsSubscription = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
4
5
|
const remotion_1 = require("remotion");
|
|
5
6
|
const call_api_1 = require("../call-api");
|
|
6
|
-
const makeKey = (fileName, line, column) => `${fileName}\0${line}\0${column}`;
|
|
7
|
+
const makeKey = (fileName, line, column, sequenceKeys, effectKeys) => `${fileName}\0${line}\0${column}\0${sequenceKeys.join('\0')}\0${effectKeys.map((keys) => keys.join('\0')).join('\0\0')}`;
|
|
7
8
|
const entries = new Map();
|
|
8
|
-
const acquireSequencePropsSubscription = ({ fileName, line, column, schema, clientId, applyOnce, applyEach, }) => {
|
|
9
|
-
const
|
|
9
|
+
const acquireSequencePropsSubscription = ({ fileName, line, column, schema, effects, clientId, applyOnce, applyEach, }) => {
|
|
10
|
+
const sequenceKeys = (0, studio_shared_1.getAllSchemaKeys)(schema);
|
|
11
|
+
const effectKeys = effects.map((effect) => (0, studio_shared_1.getAllSchemaKeys)(effect));
|
|
12
|
+
const key = makeKey(fileName, line, column, sequenceKeys, effectKeys);
|
|
10
13
|
let entry = entries.get(key);
|
|
11
14
|
if (!entry) {
|
|
12
15
|
const promise = (0, call_api_1.callApi)('/api/subscribe-to-sequence-props', {
|
|
13
16
|
fileName,
|
|
14
17
|
line,
|
|
15
18
|
column,
|
|
16
|
-
schema,
|
|
19
|
+
keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
|
|
20
|
+
effects: effectKeys,
|
|
17
21
|
clientId,
|
|
18
22
|
});
|
|
19
23
|
const created = {
|
|
@@ -72,6 +76,8 @@ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, clie
|
|
|
72
76
|
fileName: acquired.fileName,
|
|
73
77
|
nodePath: result.nodePath,
|
|
74
78
|
clientId: acquired.clientId,
|
|
79
|
+
sequenceKeys,
|
|
80
|
+
effectKeys,
|
|
75
81
|
});
|
|
76
82
|
})
|
|
77
83
|
.catch(() => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { SequenceSchema } from 'remotion';
|
|
2
2
|
import type { OriginalPosition } from '../../error-overlay/react-overlay/utils/get-source-map';
|
|
3
|
-
export declare const useSequencePropsSubscription: ({ originalLocation, overrideId, schema, }: {
|
|
3
|
+
export declare const useSequencePropsSubscription: ({ originalLocation, overrideId, schema, effects, }: {
|
|
4
4
|
overrideId: string;
|
|
5
5
|
schema: SequenceSchema;
|
|
6
|
+
effects: SequenceSchema[];
|
|
6
7
|
originalLocation: OriginalPosition | null;
|
|
7
8
|
}) => void;
|
|
@@ -5,7 +5,7 @@ const react_1 = require("react");
|
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const client_id_1 = require("../../helpers/client-id");
|
|
7
7
|
const sequence_props_subscription_store_1 = require("./sequence-props-subscription-store");
|
|
8
|
-
const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, }) => {
|
|
8
|
+
const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, effects, }) => {
|
|
9
9
|
var _a, _b, _c;
|
|
10
10
|
const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
11
11
|
const { setOverrideIdToNodePath } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsSettersContext);
|
|
@@ -40,6 +40,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, })
|
|
|
40
40
|
line: locationLine,
|
|
41
41
|
column: locationColumn,
|
|
42
42
|
schema,
|
|
43
|
+
effects,
|
|
43
44
|
clientId,
|
|
44
45
|
applyOnce: (result) => {
|
|
45
46
|
if (!result.success) {
|
|
@@ -59,6 +60,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, })
|
|
|
59
60
|
};
|
|
60
61
|
}, [
|
|
61
62
|
clientId,
|
|
63
|
+
effects,
|
|
62
64
|
locationColumn,
|
|
63
65
|
locationLine,
|
|
64
66
|
locationSource,
|
|
@@ -11,7 +11,7 @@ const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
|
|
|
11
11
|
const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
12
12
|
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
13
13
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
14
|
-
const {
|
|
14
|
+
const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
|
|
15
15
|
const previewServerConnected = previewServerState.type === 'connected';
|
|
16
16
|
return (0, react_1.useMemo)(() => {
|
|
17
17
|
const tracksHeight = shown.reduce((acc, track) => {
|
|
@@ -25,7 +25,7 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
|
25
25
|
sequence: track.sequence,
|
|
26
26
|
nodePathInfo: track.nodePathInfo,
|
|
27
27
|
getIsExpanded,
|
|
28
|
-
|
|
28
|
+
codeValues,
|
|
29
29
|
}) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM
|
|
30
30
|
: 0;
|
|
31
31
|
return acc + layerHeight + expandedHeight;
|
|
@@ -34,6 +34,6 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
|
|
|
34
34
|
timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM +
|
|
35
35
|
(hasBeenCut ? MaxTimelineTracks_1.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) +
|
|
36
36
|
TimelineTimeIndicators_1.TIMELINE_TIME_INDICATOR_HEIGHT);
|
|
37
|
-
}, [shown, hasBeenCut, previewServerConnected, getIsExpanded,
|
|
37
|
+
}, [shown, hasBeenCut, previewServerConnected, getIsExpanded, codeValues]);
|
|
38
38
|
};
|
|
39
39
|
exports.useTimelineHeight = useTimelineHeight;
|