@remotion/studio-server 4.0.468 → 4.0.470
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/codemods/delete-effect.d.ts +18 -0
- package/dist/codemods/delete-effect.js +95 -21
- package/dist/codemods/delete-jsx-node.d.ts +10 -0
- package/dist/codemods/delete-jsx-node.js +38 -14
- package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.d.ts +4 -0
- package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.js +152 -0
- package/dist/codemods/update-keyframes/update-keyframes.d.ts +8 -0
- package/dist/codemods/update-keyframes/update-keyframes.js +98 -31
- package/dist/codemods/update-sequence-props/update-sequence-props.d.ts +32 -10
- package/dist/codemods/update-sequence-props/update-sequence-props.js +39 -7
- package/dist/index.d.ts +2 -1
- package/dist/preview-server/api-routes.js +16 -0
- package/dist/preview-server/routes/add-effect-keyframe.d.ts +3 -0
- package/dist/preview-server/routes/add-effect-keyframe.js +91 -0
- package/dist/preview-server/routes/add-sequence-keyframe.d.ts +3 -0
- package/dist/preview-server/routes/add-sequence-keyframe.js +84 -0
- package/dist/preview-server/routes/apply-codemod.js +1 -0
- package/dist/preview-server/routes/apply-visual-control-change.js +1 -0
- package/dist/preview-server/routes/can-update-sequence-props.d.ts +0 -9
- package/dist/preview-server/routes/can-update-sequence-props.js +192 -24
- package/dist/preview-server/routes/composition-component-info.d.ts +3 -0
- package/dist/preview-server/routes/composition-component-info.js +26 -0
- package/dist/preview-server/routes/delete-effect-keyframe.d.ts +3 -0
- package/dist/preview-server/routes/delete-effect-keyframe.js +89 -0
- package/dist/preview-server/routes/delete-effect.js +76 -37
- package/dist/preview-server/routes/delete-jsx-node.js +67 -36
- package/dist/preview-server/routes/delete-sequence-keyframe.d.ts +3 -0
- package/dist/preview-server/routes/delete-sequence-keyframe.js +82 -0
- package/dist/preview-server/routes/duplicate-jsx-node.js +1 -0
- package/dist/preview-server/routes/open-in-editor.d.ts +4 -0
- package/dist/preview-server/routes/open-in-editor.js +40 -0
- package/dist/preview-server/routes/register-client-render.d.ts +3 -0
- package/dist/preview-server/routes/register-client-render.js +11 -0
- package/dist/preview-server/routes/save-effect-props.js +1 -0
- package/dist/preview-server/routes/save-sequence-props.js +161 -72
- package/dist/preview-server/routes/unregister-client-render.d.ts +4 -0
- package/dist/preview-server/routes/unregister-client-render.js +11 -0
- package/dist/preview-server/routes/update-default-props.js +1 -0
- package/dist/preview-server/start-server.d.ts +1 -0
- package/dist/preview-server/start-server.js +1 -0
- package/dist/preview-server/undo-stack.d.ts +26 -3
- package/dist/preview-server/undo-stack.js +130 -42
- package/dist/preview-server/validate-same-origin.d.ts +2 -0
- package/dist/preview-server/validate-same-origin.js +13 -0
- package/dist/routes.d.ts +2 -1
- package/dist/routes.js +9 -136
- package/dist/start-studio.d.ts +2 -1
- package/dist/start-studio.js +2 -1
- package/package.json +6 -6
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteSequenceKeyframeHandler = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const renderer_1 = require("@remotion/renderer");
|
|
6
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
|
+
const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
|
|
8
|
+
const file_watcher_1 = require("../../file-watcher");
|
|
9
|
+
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
10
|
+
const undo_stack_1 = require("../undo-stack");
|
|
11
|
+
const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
|
|
12
|
+
const can_update_sequence_props_1 = require("./can-update-sequence-props");
|
|
13
|
+
const log_update_1 = require("./log-updates/log-update");
|
|
14
|
+
const save_props_mutex_1 = require("./save-props-mutex");
|
|
15
|
+
const deleteSequenceKeyframeHandler = ({ input: { fileName, nodePath, key, frame, schema, clientId }, remotionRoot, logLevel, }) => (0, save_props_mutex_1.withSavePropsLock)(async () => {
|
|
16
|
+
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[delete-sequence-keyframe] Received request for fileName="${fileName}" key="${key}" frame=${frame}`);
|
|
17
|
+
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
18
|
+
remotionRoot,
|
|
19
|
+
fileName,
|
|
20
|
+
action: 'modify',
|
|
21
|
+
});
|
|
22
|
+
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
23
|
+
const { output, oldValueStrings, newValueStrings, formatted, logLine } = await (0, update_keyframes_1.updateSequenceKeyframes)({
|
|
24
|
+
input: fileContents,
|
|
25
|
+
nodePath: nodePath.nodePath,
|
|
26
|
+
updates: [
|
|
27
|
+
{
|
|
28
|
+
key,
|
|
29
|
+
operation: {
|
|
30
|
+
type: 'remove',
|
|
31
|
+
frame,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
const oldValueString = oldValueStrings[0];
|
|
37
|
+
const newValueString = newValueStrings[0];
|
|
38
|
+
const undoPropChange = `${key} keyframe restored at frame ${frame}`;
|
|
39
|
+
const redoPropChange = `${key} keyframe deleted at frame ${frame}`;
|
|
40
|
+
(0, undo_stack_1.pushToUndoStack)({
|
|
41
|
+
filePath: absolutePath,
|
|
42
|
+
oldContents: fileContents,
|
|
43
|
+
newContents: null,
|
|
44
|
+
logLevel,
|
|
45
|
+
remotionRoot,
|
|
46
|
+
logLine,
|
|
47
|
+
description: {
|
|
48
|
+
undoMessage: `↩️ ${undoPropChange}`,
|
|
49
|
+
redoMessage: `↪️ ${redoPropChange}`,
|
|
50
|
+
},
|
|
51
|
+
entryType: 'sequence-props',
|
|
52
|
+
suppressHmrOnFileRestore: true,
|
|
53
|
+
});
|
|
54
|
+
(0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
|
|
55
|
+
(0, watch_ignore_next_change_1.suppressBundlerUpdateForFile)(absolutePath);
|
|
56
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(absolutePath, output, clientId);
|
|
57
|
+
(0, log_update_1.logUpdate)({
|
|
58
|
+
fileRelativeToRoot,
|
|
59
|
+
line: logLine,
|
|
60
|
+
key,
|
|
61
|
+
oldValueString,
|
|
62
|
+
newValueString,
|
|
63
|
+
defaultValueString: null,
|
|
64
|
+
formatted,
|
|
65
|
+
logLevel,
|
|
66
|
+
removedProps: [],
|
|
67
|
+
addedProps: [],
|
|
68
|
+
});
|
|
69
|
+
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
70
|
+
const status = (0, can_update_sequence_props_1.computeSequencePropsStatusFromContent)({
|
|
71
|
+
fileContents: output,
|
|
72
|
+
keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
|
|
73
|
+
nodePath: nodePath.nodePath,
|
|
74
|
+
effects: [],
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
canUpdate: true,
|
|
78
|
+
props: status.props,
|
|
79
|
+
results: [{ fileName, nodePath, props: status.props }],
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
exports.deleteSequenceKeyframeHandler = deleteSequenceKeyframeHandler;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenInEditorRequest, OpenInEditorResponse } from '@remotion/studio-shared';
|
|
2
|
+
import type { ApiHandler } from '../api-types';
|
|
3
|
+
export declare const getEditorName: () => Promise<string | null>;
|
|
4
|
+
export declare const openInEditorHandler: ApiHandler<OpenInEditorRequest, OpenInEditorResponse>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.openInEditorHandler = exports.getEditorName = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
9
|
+
const editorGuess = (0, open_in_editor_1.guessEditor)();
|
|
10
|
+
const getEditorName = async () => {
|
|
11
|
+
const [edit] = await editorGuess;
|
|
12
|
+
return (0, open_in_editor_1.getDisplayNameForEditor)(edit ? edit.command : null);
|
|
13
|
+
};
|
|
14
|
+
exports.getEditorName = getEditorName;
|
|
15
|
+
const openInEditorHandler = async ({ input, remotionRoot, logLevel }) => {
|
|
16
|
+
try {
|
|
17
|
+
if (!('stack' in input)) {
|
|
18
|
+
throw new TypeError('Need to pass stack');
|
|
19
|
+
}
|
|
20
|
+
const { stack } = input;
|
|
21
|
+
const guess = await editorGuess;
|
|
22
|
+
const didOpen = await (0, open_in_editor_1.launchEditor)({
|
|
23
|
+
colNumber: stack.originalColumnNumber,
|
|
24
|
+
editor: guess[0],
|
|
25
|
+
fileName: node_path_1.default.resolve(remotionRoot, stack.originalFileName),
|
|
26
|
+
lineNumber: stack.originalLineNumber,
|
|
27
|
+
vsCodeNewWindow: false,
|
|
28
|
+
logLevel,
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
success: didOpen,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (_a) {
|
|
35
|
+
return {
|
|
36
|
+
success: false,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.openInEditorHandler = openInEditorHandler;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerClientRenderHandler = void 0;
|
|
4
|
+
const client_render_queue_1 = require("../../client-render-queue");
|
|
5
|
+
const validate_same_origin_1 = require("../validate-same-origin");
|
|
6
|
+
const registerClientRenderHandler = ({ input, remotionRoot, request }) => {
|
|
7
|
+
(0, validate_same_origin_1.validateSameOrigin)(request);
|
|
8
|
+
(0, client_render_queue_1.addCompletedClientRender)({ render: input, remotionRoot });
|
|
9
|
+
return Promise.resolve();
|
|
10
|
+
};
|
|
11
|
+
exports.registerClientRenderHandler = registerClientRenderHandler;
|
|
@@ -14,84 +14,173 @@ const can_update_sequence_props_1 = require("./can-update-sequence-props");
|
|
|
14
14
|
const format_prop_change_1 = require("./log-updates/format-prop-change");
|
|
15
15
|
const log_update_1 = require("./log-updates/log-update");
|
|
16
16
|
const save_props_mutex_1 = require("./save-props-mutex");
|
|
17
|
-
const saveSequencePropsHandler = ({ input: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
17
|
+
const saveSequencePropsHandler = ({ input: { edits, clientId, undoLabel, redoLabel }, remotionRoot, logLevel, }) => (0, save_props_mutex_1.withSavePropsLock)(async () => {
|
|
18
|
+
var _a;
|
|
19
|
+
if (edits.length === 0) {
|
|
20
|
+
throw new Error('No sequence prop edits to save');
|
|
21
|
+
}
|
|
22
|
+
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[save-sequence-props] Received request with ${edits.length} edit(s)`);
|
|
23
|
+
const editGroups = new Map();
|
|
24
|
+
for (const [index, edit] of edits.entries()) {
|
|
25
|
+
const parsedValue = JSON.parse(edit.value);
|
|
26
|
+
const parsedDefaultValue = edit.defaultValue !== null ? JSON.parse(edit.defaultValue) : null;
|
|
27
|
+
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
28
|
+
remotionRoot,
|
|
29
|
+
fileName: edit.fileName,
|
|
30
|
+
action: 'modify',
|
|
31
|
+
});
|
|
32
|
+
const group = (_a = editGroups.get(absolutePath)) !== null && _a !== void 0 ? _a : {
|
|
33
|
+
fileRelativeToRoot,
|
|
34
|
+
edits: [],
|
|
35
|
+
};
|
|
36
|
+
group.edits.push({
|
|
37
|
+
index,
|
|
38
|
+
fileName: edit.fileName,
|
|
39
|
+
nodePath: edit.nodePath,
|
|
40
|
+
key: edit.key,
|
|
41
|
+
value: parsedValue,
|
|
42
|
+
valueString: JSON.stringify(parsedValue),
|
|
43
|
+
defaultValue: parsedDefaultValue,
|
|
44
|
+
defaultValueString: parsedDefaultValue !== null
|
|
45
|
+
? JSON.stringify(parsedDefaultValue)
|
|
46
|
+
: null,
|
|
47
|
+
schema: edit.schema,
|
|
48
|
+
});
|
|
49
|
+
editGroups.set(absolutePath, group);
|
|
50
|
+
}
|
|
51
|
+
const snapshots = [];
|
|
52
|
+
const outputByPath = new Map();
|
|
53
|
+
const resultByIndex = new Map();
|
|
54
|
+
for (const [absolutePath, group] of editGroups) {
|
|
55
|
+
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
56
|
+
const { output, formatted, results: updateResults, } = await (0, update_sequence_props_1.updateMultipleSequenceProps)({
|
|
57
|
+
input: fileContents,
|
|
58
|
+
changes: group.edits.map((edit) => {
|
|
59
|
+
return {
|
|
60
|
+
nodePath: edit.nodePath.nodePath,
|
|
61
|
+
updates: [
|
|
62
|
+
{
|
|
63
|
+
key: edit.key,
|
|
64
|
+
value: edit.value,
|
|
65
|
+
defaultValue: edit.defaultValue,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
schema: no_react_1.NoReactInternals.sequenceSchema,
|
|
69
|
+
};
|
|
70
|
+
}),
|
|
71
|
+
prettierConfigOverride: null,
|
|
72
|
+
});
|
|
73
|
+
const [{ logLine: firstLogLine }] = updateResults;
|
|
74
|
+
outputByPath.set(absolutePath, output);
|
|
75
|
+
snapshots.push({
|
|
76
|
+
filePath: absolutePath,
|
|
77
|
+
oldContents: fileContents,
|
|
78
|
+
newContents: output,
|
|
79
|
+
logLine: firstLogLine,
|
|
80
|
+
});
|
|
81
|
+
for (const [resultIndex, result] of updateResults.entries()) {
|
|
82
|
+
const edit = group.edits[resultIndex];
|
|
83
|
+
resultByIndex.set(edit.index, {
|
|
84
|
+
oldValueString: result.oldValueStrings[0],
|
|
85
|
+
logLine: result.logLine,
|
|
86
|
+
removedProps: result.removedProps,
|
|
87
|
+
formatted,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const [firstEdit] = edits;
|
|
92
|
+
const firstResult = resultByIndex.get(0);
|
|
93
|
+
if (!firstResult) {
|
|
94
|
+
throw new Error('Could not compute sequence prop edit result');
|
|
95
|
+
}
|
|
96
|
+
const undoMessage = undoLabel !== null
|
|
97
|
+
? `↩️ ${undoLabel}`
|
|
98
|
+
: edits.length === 1
|
|
99
|
+
? `↩️ ${(0, format_prop_change_1.formatPropChange)({
|
|
100
|
+
key: firstEdit.key,
|
|
101
|
+
oldValueString: (0, log_update_1.normalizeQuotes)(JSON.stringify(JSON.parse(firstEdit.value))),
|
|
102
|
+
newValueString: (0, log_update_1.normalizeQuotes)(firstResult.oldValueString),
|
|
103
|
+
defaultValueString: firstEdit.defaultValue !== null
|
|
104
|
+
? (0, log_update_1.normalizeQuotes)(JSON.stringify(JSON.parse(firstEdit.defaultValue)))
|
|
105
|
+
: null,
|
|
106
|
+
removedProps: [],
|
|
107
|
+
addedProps: firstResult.removedProps,
|
|
108
|
+
})}`
|
|
109
|
+
: '↩️ Update selected sequence props';
|
|
110
|
+
const redoMessage = redoLabel !== null
|
|
111
|
+
? `↪️ ${redoLabel}`
|
|
112
|
+
: edits.length === 1
|
|
113
|
+
? `↪️ ${(0, format_prop_change_1.formatPropChange)({
|
|
114
|
+
key: firstEdit.key,
|
|
115
|
+
oldValueString: (0, log_update_1.normalizeQuotes)(firstResult.oldValueString),
|
|
116
|
+
newValueString: (0, log_update_1.normalizeQuotes)(JSON.stringify(JSON.parse(firstEdit.value))),
|
|
117
|
+
defaultValueString: firstEdit.defaultValue !== null
|
|
118
|
+
? (0, log_update_1.normalizeQuotes)(JSON.stringify(JSON.parse(firstEdit.defaultValue)))
|
|
119
|
+
: null,
|
|
120
|
+
removedProps: firstResult.removedProps,
|
|
121
|
+
addedProps: [],
|
|
122
|
+
})}`
|
|
123
|
+
: '↪️ Update selected sequence props';
|
|
124
|
+
(0, undo_stack_1.pushTransactionToUndoStack)({
|
|
125
|
+
snapshots,
|
|
63
126
|
logLevel,
|
|
64
127
|
remotionRoot,
|
|
65
|
-
|
|
66
|
-
description: {
|
|
67
|
-
undoMessage: `↩️ ${undoPropChange}`,
|
|
68
|
-
redoMessage: `↪️ ${redoPropChange}`,
|
|
69
|
-
},
|
|
128
|
+
description: { undoMessage, redoMessage },
|
|
70
129
|
entryType: 'sequence-props',
|
|
71
130
|
suppressHmrOnFileRestore: true,
|
|
72
131
|
});
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
132
|
+
for (const [absolutePath, output] of outputByPath) {
|
|
133
|
+
(0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
|
|
134
|
+
(0, watch_ignore_next_change_1.suppressBundlerUpdateForFile)(absolutePath);
|
|
135
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(absolutePath, output, clientId);
|
|
136
|
+
}
|
|
137
|
+
for (const { edits: groupEdits, fileRelativeToRoot } of editGroups.values()) {
|
|
138
|
+
for (const edit of groupEdits) {
|
|
139
|
+
const result = resultByIndex.get(edit.index);
|
|
140
|
+
if (!result) {
|
|
141
|
+
throw new Error('Could not compute sequence prop edit result');
|
|
142
|
+
}
|
|
143
|
+
(0, log_update_1.logUpdate)({
|
|
144
|
+
fileRelativeToRoot,
|
|
145
|
+
line: result.logLine,
|
|
146
|
+
key: edit.key,
|
|
147
|
+
oldValueString: result.oldValueString,
|
|
148
|
+
newValueString: edit.valueString,
|
|
149
|
+
defaultValueString: edit.defaultValueString,
|
|
150
|
+
formatted: result.formatted,
|
|
151
|
+
logLevel,
|
|
152
|
+
removedProps: result.removedProps,
|
|
153
|
+
addedProps: [],
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
88
157
|
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
158
|
+
const results = edits.map((edit) => {
|
|
159
|
+
const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
160
|
+
remotionRoot,
|
|
161
|
+
fileName: edit.fileName,
|
|
162
|
+
action: 'modify',
|
|
163
|
+
});
|
|
164
|
+
const output = outputByPath.get(absolutePath);
|
|
165
|
+
if (!output) {
|
|
166
|
+
throw new Error('Could not compute sequence prop edit status');
|
|
167
|
+
}
|
|
168
|
+
const newStatus = (0, can_update_sequence_props_1.computeSequencePropsStatusFromContent)({
|
|
169
|
+
fileContents: output,
|
|
170
|
+
keys: (0, studio_shared_1.getAllSchemaKeys)(edit.schema),
|
|
171
|
+
nodePath: edit.nodePath.nodePath,
|
|
172
|
+
effects: [],
|
|
173
|
+
});
|
|
174
|
+
return {
|
|
175
|
+
fileName: edit.fileName,
|
|
176
|
+
nodePath: edit.nodePath,
|
|
177
|
+
props: newStatus.props,
|
|
178
|
+
};
|
|
94
179
|
});
|
|
95
|
-
return
|
|
180
|
+
return {
|
|
181
|
+
canUpdate: true,
|
|
182
|
+
props: results[0].props,
|
|
183
|
+
results,
|
|
184
|
+
};
|
|
96
185
|
});
|
|
97
186
|
exports.saveSequencePropsHandler = saveSequencePropsHandler;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unregisterClientRenderHandler = void 0;
|
|
4
|
+
const client_render_queue_1 = require("../../client-render-queue");
|
|
5
|
+
const validate_same_origin_1 = require("../validate-same-origin");
|
|
6
|
+
const unregisterClientRenderHandler = ({ input: { id }, request, }) => {
|
|
7
|
+
(0, validate_same_origin_1.validateSameOrigin)(request);
|
|
8
|
+
(0, client_render_queue_1.removeCompletedClientRender)(id);
|
|
9
|
+
return Promise.resolve();
|
|
10
|
+
};
|
|
11
|
+
exports.unregisterClientRenderHandler = unregisterClientRenderHandler;
|
|
@@ -38,6 +38,7 @@ export declare const startServer: (options: {
|
|
|
38
38
|
binariesDirectory: string | null;
|
|
39
39
|
forceIPv4: boolean;
|
|
40
40
|
audioLatencyHint: AudioContextLatencyCategory | null;
|
|
41
|
+
previewSampleRate: number | null;
|
|
41
42
|
enableCrossSiteIsolation: boolean;
|
|
42
43
|
askAIEnabled: boolean;
|
|
43
44
|
forceNew: boolean;
|
|
@@ -102,6 +102,7 @@ const startServer = async (options) => {
|
|
|
102
102
|
gitSource: options.gitSource,
|
|
103
103
|
binariesDirectory: options.binariesDirectory,
|
|
104
104
|
audioLatencyHint: options.audioLatencyHint,
|
|
105
|
+
previewSampleRate: options.previewSampleRate,
|
|
105
106
|
enableCrossSiteIsolation: options.enableCrossSiteIsolation,
|
|
106
107
|
});
|
|
107
108
|
})
|
|
@@ -4,11 +4,18 @@ export interface UndoEntryDescription {
|
|
|
4
4
|
redoMessage: string;
|
|
5
5
|
}
|
|
6
6
|
type UndoEntryType = 'visual-control' | 'default-props' | 'sequence-props' | 'effect-props' | 'delete-effect' | 'delete-jsx-node' | 'duplicate-jsx-node' | 'delete-composition' | 'rename-composition' | 'duplicate-composition';
|
|
7
|
-
type
|
|
7
|
+
type UndoEntrySnapshot = {
|
|
8
8
|
filePath: string;
|
|
9
9
|
oldContents: string;
|
|
10
|
+
newContents: string | null;
|
|
11
|
+
/** 1-based source line for terminal/IDE file links (e.g. path:line). */
|
|
12
|
+
logLine: number;
|
|
13
|
+
};
|
|
14
|
+
type UndoEntry = {
|
|
15
|
+
filePath: string;
|
|
10
16
|
/** 1-based source line for terminal/IDE file links (e.g. path:line). */
|
|
11
17
|
logLine: number;
|
|
18
|
+
snapshots: UndoEntrySnapshot[];
|
|
12
19
|
description: UndoEntryDescription;
|
|
13
20
|
/** When true, undo/redo file restores call `suppressBundlerUpdateForFile` (skip HMR refresh). */
|
|
14
21
|
suppressHmrOnFileRestore: boolean;
|
|
@@ -33,9 +40,10 @@ type UndoEntry = {
|
|
|
33
40
|
} | {
|
|
34
41
|
entryType: 'duplicate-composition';
|
|
35
42
|
});
|
|
36
|
-
export declare function pushToUndoStack({ filePath, oldContents, logLevel, remotionRoot, logLine, description, entryType, suppressHmrOnFileRestore }: {
|
|
43
|
+
export declare function pushToUndoStack({ filePath, oldContents, newContents, logLevel, remotionRoot, logLine, description, entryType, suppressHmrOnFileRestore }: {
|
|
37
44
|
filePath: string;
|
|
38
45
|
oldContents: string;
|
|
46
|
+
newContents: string | null;
|
|
39
47
|
logLevel: LogLevel;
|
|
40
48
|
remotionRoot: string;
|
|
41
49
|
logLine: number;
|
|
@@ -43,10 +51,24 @@ export declare function pushToUndoStack({ filePath, oldContents, logLevel, remot
|
|
|
43
51
|
entryType: UndoEntryType;
|
|
44
52
|
suppressHmrOnFileRestore: boolean;
|
|
45
53
|
}): void;
|
|
54
|
+
export declare function pushTransactionToUndoStack({ snapshots, logLevel, remotionRoot, description, entryType, suppressHmrOnFileRestore }: {
|
|
55
|
+
snapshots: Array<{
|
|
56
|
+
filePath: string;
|
|
57
|
+
oldContents: string;
|
|
58
|
+
newContents: string | null;
|
|
59
|
+
logLine: number;
|
|
60
|
+
}>;
|
|
61
|
+
logLevel: LogLevel;
|
|
62
|
+
remotionRoot: string;
|
|
63
|
+
description: UndoEntryDescription;
|
|
64
|
+
entryType: UndoEntryType;
|
|
65
|
+
suppressHmrOnFileRestore: boolean;
|
|
66
|
+
}): void;
|
|
46
67
|
export declare function printUndoHint(logLevel: LogLevel): void;
|
|
47
|
-
export declare function pushToRedoStack({ filePath, oldContents, logLine, description, entryType, suppressHmrOnFileRestore }: {
|
|
68
|
+
export declare function pushToRedoStack({ filePath, oldContents, newContents, logLine, description, entryType, suppressHmrOnFileRestore }: {
|
|
48
69
|
filePath: string;
|
|
49
70
|
oldContents: string;
|
|
71
|
+
newContents: string | null;
|
|
50
72
|
logLine: number;
|
|
51
73
|
description: UndoEntryDescription;
|
|
52
74
|
entryType: UndoEntryType;
|
|
@@ -67,4 +89,5 @@ export declare function popRedo(): {
|
|
|
67
89
|
};
|
|
68
90
|
export declare function getUndoStack(): readonly UndoEntry[];
|
|
69
91
|
export declare function getRedoStack(): readonly UndoEntry[];
|
|
92
|
+
export declare function clearUndoStackForTests(): void;
|
|
70
93
|
export {};
|