@remotion/studio-server 4.0.529 → 4.0.531
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/canvas-capture/generate-canvas-capture-composition.d.ts +14 -0
- package/dist/canvas-capture/generate-canvas-capture-composition.js +239 -0
- package/dist/codemods/add-composition-to-file.d.ts +7 -0
- package/dist/codemods/add-composition-to-file.js +63 -0
- package/dist/codemods/add-effect.d.ts +1 -0
- package/dist/codemods/add-effect.js +8 -0
- package/dist/codemods/apply-codemod-to-file.js +6 -1
- package/dist/codemods/apply-visual-control.d.ts +8 -0
- package/dist/codemods/apply-visual-control.js +89 -0
- package/dist/codemods/delete-effect.d.ts +1 -0
- package/dist/codemods/delete-effect.js +6 -0
- package/dist/codemods/delete-jsx-node.d.ts +22 -0
- package/dist/codemods/delete-jsx-node.js +17 -0
- package/dist/codemods/duplicate-composition.d.ts +2 -0
- package/dist/codemods/duplicate-composition.js +64 -0
- package/dist/codemods/duplicate-effect.d.ts +1 -0
- package/dist/codemods/duplicate-effect.js +6 -0
- package/dist/codemods/duplicate-jsx-node.d.ts +25 -0
- package/dist/codemods/duplicate-jsx-node.js +26 -0
- package/dist/codemods/format-file-content.d.ts +7 -0
- package/dist/codemods/format-file-content.js +80 -0
- package/dist/codemods/format-inline-content.d.ts +18 -0
- package/dist/codemods/format-inline-content.js +78 -0
- package/dist/codemods/insert-video-layers.d.ts +11 -0
- package/dist/codemods/insert-video-layers.js +5 -0
- package/dist/codemods/recast-mods.d.ts +13 -0
- package/dist/codemods/recast-mods.js +902 -0
- package/dist/codemods/reorder-effect.d.ts +1 -0
- package/dist/codemods/reorder-effect.js +5 -0
- package/dist/codemods/reorder-sequence.d.ts +1 -0
- package/dist/codemods/reorder-sequence.js +5 -0
- package/dist/codemods/simple-diff.d.ts +5 -0
- package/dist/codemods/simple-diff.js +39 -0
- package/dist/codemods/split-video-from-audio.d.ts +1 -0
- package/dist/codemods/split-video-from-audio.js +5 -0
- package/dist/codemods/update-default-props.d.ts +1 -0
- package/dist/codemods/update-default-props.js +6 -0
- package/dist/codemods/update-inline-caption-patches.d.ts +1 -0
- package/dist/codemods/update-inline-caption-patches.js +5 -0
- package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.d.ts +1 -0
- package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.js +7 -0
- package/dist/codemods/update-keyframes/update-keyframes.d.ts +3 -3
- package/dist/codemods/update-keyframes/update-keyframes.js +1 -1
- package/dist/codemods/update-sequence-props/update-sequence-props.js +1 -1
- package/dist/helpers/get-file-source.js +6 -4
- package/dist/helpers/get-local-package-override.d.ts +5 -0
- package/dist/helpers/get-local-package-override.js +39 -0
- package/dist/helpers/install-command.js +1 -0
- package/dist/helpers/resolve-composition-component.d.ts +2 -1
- package/dist/helpers/resolve-composition-component.js +66 -15
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -0
- package/dist/open-directory-in-finder.js +11 -9
- package/dist/preview-server/api-routes.js +32 -12
- package/dist/preview-server/element-install-state.js +10 -2
- package/dist/preview-server/routes/add-composition.d.ts +3 -0
- package/dist/preview-server/routes/add-composition.js +97 -0
- package/dist/preview-server/routes/add-folder.d.ts +3 -0
- package/dist/preview-server/routes/add-folder.js +107 -0
- package/dist/preview-server/routes/add-keyframes.d.ts +2 -2
- package/dist/preview-server/routes/add-keyframes.js +49 -6
- package/dist/preview-server/routes/can-update-sequence-props.js +27 -5
- package/dist/preview-server/routes/delete-composition.d.ts +3 -0
- package/dist/preview-server/routes/delete-composition.js +104 -0
- package/dist/preview-server/routes/delete-jsx-node.d.ts +3 -0
- package/dist/preview-server/routes/delete-jsx-node.js +126 -0
- package/dist/preview-server/routes/delete-nodes.d.ts +3 -0
- package/dist/preview-server/routes/delete-nodes.js +142 -0
- package/dist/preview-server/routes/duplicate-composition.d.ts +3 -0
- package/dist/preview-server/routes/duplicate-composition.js +114 -0
- package/dist/preview-server/routes/duplicate-nodes.d.ts +3 -0
- package/dist/preview-server/routes/duplicate-nodes.js +123 -0
- package/dist/preview-server/routes/insert-basic-captions.js +2 -1
- package/dist/preview-server/routes/insert-composition-element.d.ts +3 -0
- package/dist/preview-server/routes/insert-composition-element.js +236 -0
- package/dist/preview-server/routes/insert-element.js +26 -19
- package/dist/preview-server/routes/insert-video-layers.d.ts +3 -0
- package/dist/preview-server/routes/insert-video-layers.js +68 -0
- package/dist/preview-server/routes/install-dependency.js +10 -1
- package/dist/preview-server/routes/move-composition.d.ts +3 -0
- package/dist/preview-server/routes/move-composition.js +148 -0
- package/dist/preview-server/routes/move-folder.d.ts +3 -0
- package/dist/preview-server/routes/move-folder.js +151 -0
- package/dist/preview-server/routes/precompose-jsx-nodes.d.ts +3 -0
- package/dist/preview-server/routes/precompose-jsx-nodes.js +209 -0
- package/dist/preview-server/routes/rename-composition.d.ts +3 -0
- package/dist/preview-server/routes/rename-composition.js +105 -0
- package/dist/preview-server/routes/rename-folder.d.ts +3 -0
- package/dist/preview-server/routes/rename-folder.js +111 -0
- package/dist/preview-server/routes/reorder-sequence.js +7 -2
- package/dist/preview-server/routes/replace-video-source.js +7 -2
- package/dist/preview-server/routes/save-sequence-props.js +6 -3
- package/dist/preview-server/routes/split-sequences.d.ts +3 -0
- package/dist/preview-server/routes/split-sequences.js +122 -0
- package/dist/preview-server/routes/split-video-from-audio.js +6 -1
- package/dist/preview-server/routes/unwrap-folder.d.ts +3 -0
- package/dist/preview-server/routes/unwrap-folder.js +107 -0
- package/dist/preview-server/routes/update-composition-metadata.d.ts +3 -0
- package/dist/preview-server/routes/update-composition-metadata.js +110 -0
- package/dist/preview-server/routes/update-public-license.d.ts +11 -0
- package/dist/preview-server/routes/update-public-license.js +97 -0
- package/dist/preview-server/routes/wrap-node.d.ts +3 -0
- package/dist/preview-server/routes/wrap-node.js +108 -0
- package/dist/preview-server/studio-protocol/handle-discovery.js +3 -10
- package/dist/preview-server/studio-protocol/handle-install.js +0 -3
- package/dist/preview-server/undo-stack.d.ts +1 -1
- package/dist/preview-server/undo-stack.js +6 -0
- package/dist/start-studio.js +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitSequencesHandler = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const codemods_1 = require("@remotion/codemods");
|
|
6
|
+
const renderer_1 = require("@remotion/renderer");
|
|
7
|
+
const file_watcher_1 = require("../../file-watcher");
|
|
8
|
+
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
9
|
+
const format_log_file_location_1 = require("../format-log-file-location");
|
|
10
|
+
const sequence_node_path_mutation_1 = require("../sequence-node-path-mutation");
|
|
11
|
+
const undo_stack_1 = require("../undo-stack");
|
|
12
|
+
const source_file_write_queue_1 = require("./source-file-write-queue");
|
|
13
|
+
const splitSequencesHandler = ({ input: { sequences }, remotionRoot, logLevel }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
|
|
14
|
+
var _a;
|
|
15
|
+
try {
|
|
16
|
+
if (sequences.length === 0) {
|
|
17
|
+
throw new Error('No JSX sequences were specified for splitting');
|
|
18
|
+
}
|
|
19
|
+
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[split-sequences] Received request to split ${sequences.length} JSX sequence${sequences.length === 1 ? '' : 's'}`);
|
|
20
|
+
const sequencesByFileName = new Map();
|
|
21
|
+
for (const sequence of sequences) {
|
|
22
|
+
const fileSequences = (_a = sequencesByFileName.get(sequence.fileName)) !== null && _a !== void 0 ? _a : [];
|
|
23
|
+
fileSequences.push(sequence);
|
|
24
|
+
sequencesByFileName.set(sequence.fileName, fileSequences);
|
|
25
|
+
}
|
|
26
|
+
const updates = await Promise.all([...sequencesByFileName].map(async ([fileName, fileSequences]) => {
|
|
27
|
+
var _a;
|
|
28
|
+
var _b;
|
|
29
|
+
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
30
|
+
remotionRoot,
|
|
31
|
+
fileName,
|
|
32
|
+
action: 'modify',
|
|
33
|
+
});
|
|
34
|
+
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
35
|
+
const result = await (0, codemods_1.splitSequences)({
|
|
36
|
+
project: {
|
|
37
|
+
files: { [absolutePath]: fileContents },
|
|
38
|
+
rootDir: remotionRoot,
|
|
39
|
+
},
|
|
40
|
+
splits: fileSequences.map(({ nodePath, sequenceKeys, splitFrame }) => ({
|
|
41
|
+
node: { filePath: absolutePath, nodePath },
|
|
42
|
+
sequenceKeys,
|
|
43
|
+
frame: splitFrame,
|
|
44
|
+
})),
|
|
45
|
+
});
|
|
46
|
+
const output = (_b = (_a = result.changes[0]) === null || _a === void 0 ? void 0 : _a.nextContents) !== null && _b !== void 0 ? _b : fileContents;
|
|
47
|
+
const { nodeLabels, logLines } = result.editDetails[0];
|
|
48
|
+
const nodePathRemappings = result.nodePathRemappings.map(({ oldNodePath, newNodePath, oldJsxName, newJsxName }) => ({
|
|
49
|
+
oldNodePath,
|
|
50
|
+
newNodePath,
|
|
51
|
+
oldJsxName,
|
|
52
|
+
newJsxName,
|
|
53
|
+
}));
|
|
54
|
+
return {
|
|
55
|
+
absolutePath,
|
|
56
|
+
fileContents,
|
|
57
|
+
fileRelativeToRoot,
|
|
58
|
+
logLine: Math.min(...logLines),
|
|
59
|
+
nodeLabels,
|
|
60
|
+
nodePathRemappings,
|
|
61
|
+
output,
|
|
62
|
+
};
|
|
63
|
+
}));
|
|
64
|
+
const nodePathMutation = (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)(updates.map((update) => ({
|
|
65
|
+
absolutePath: update.absolutePath,
|
|
66
|
+
remappings: update.nodePathRemappings,
|
|
67
|
+
})), null);
|
|
68
|
+
const splitDescription = sequences.length === 1
|
|
69
|
+
? updates[0].nodeLabels[0]
|
|
70
|
+
: `${sequences.length} JSX sequences`;
|
|
71
|
+
(0, undo_stack_1.pushTransactionToUndoStack)({
|
|
72
|
+
snapshots: updates.map((update) => ({
|
|
73
|
+
filePath: update.absolutePath,
|
|
74
|
+
oldContents: update.fileContents,
|
|
75
|
+
newContents: null,
|
|
76
|
+
logLine: update.logLine,
|
|
77
|
+
nodePathRemappings: update.nodePathRemappings,
|
|
78
|
+
})),
|
|
79
|
+
logLevel,
|
|
80
|
+
remotionRoot,
|
|
81
|
+
description: {
|
|
82
|
+
undoMessage: `↩️ Split of ${splitDescription}`,
|
|
83
|
+
redoMessage: `↪️ Split of ${splitDescription}`,
|
|
84
|
+
},
|
|
85
|
+
entryType: 'split-sequences',
|
|
86
|
+
suppressHmrOnFileRestore: false,
|
|
87
|
+
undoRedoNavigation: null,
|
|
88
|
+
});
|
|
89
|
+
for (const update of updates) {
|
|
90
|
+
(0, undo_stack_1.suppressUndoStackInvalidation)(update.absolutePath);
|
|
91
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)({
|
|
92
|
+
file: update.absolutePath,
|
|
93
|
+
content: update.output,
|
|
94
|
+
originatorClientId: undefined,
|
|
95
|
+
metadata: { skipSequencePropsUpdate: true },
|
|
96
|
+
});
|
|
97
|
+
const locationLabel = (0, format_log_file_location_1.formatLogFileLocation)({
|
|
98
|
+
remotionRoot,
|
|
99
|
+
absolutePath: update.absolutePath,
|
|
100
|
+
line: update.logLine,
|
|
101
|
+
});
|
|
102
|
+
const fileDescription = update.nodeLabels.length === 1
|
|
103
|
+
? update.nodeLabels[0]
|
|
104
|
+
: `${update.nodeLabels.length} JSX sequences`;
|
|
105
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Split ${fileDescription}`);
|
|
106
|
+
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, `[split-sequences] Wrote ${update.fileRelativeToRoot}`);
|
|
107
|
+
}
|
|
108
|
+
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
109
|
+
return {
|
|
110
|
+
success: true,
|
|
111
|
+
nodePathMutation,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
return {
|
|
116
|
+
success: false,
|
|
117
|
+
reason: err.message,
|
|
118
|
+
stack: err.stack,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
exports.splitSequencesHandler = splitSequencesHandler;
|
|
@@ -28,7 +28,12 @@ const splitVideoFromAudioHandler = ({ input: { fileName, nodePath }, remotionRoo
|
|
|
28
28
|
});
|
|
29
29
|
const output = (_b = (_a = result.changes[0]) === null || _a === void 0 ? void 0 : _a.nextContents) !== null && _b !== void 0 ? _b : fileContents;
|
|
30
30
|
const { formatted, nodeLabel, logLine } = result.editDetails[0];
|
|
31
|
-
const nodePathRemappings = result.nodePathRemappings.map(({ oldNodePath, newNodePath }) => ({
|
|
31
|
+
const nodePathRemappings = result.nodePathRemappings.map(({ oldNodePath, newNodePath, oldJsxName, newJsxName }) => ({
|
|
32
|
+
oldNodePath,
|
|
33
|
+
newNodePath,
|
|
34
|
+
oldJsxName,
|
|
35
|
+
newJsxName,
|
|
36
|
+
}));
|
|
32
37
|
const nodePathMutation = (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)([
|
|
33
38
|
{
|
|
34
39
|
absolutePath,
|
|
@@ -0,0 +1,107 @@
|
|
|
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.unwrapFolderHandler = void 0;
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const codemods_1 = require("@remotion/codemods");
|
|
10
|
+
const renderer_1 = require("@remotion/renderer");
|
|
11
|
+
const file_watcher_1 = require("../../file-watcher");
|
|
12
|
+
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
13
|
+
const format_log_file_location_1 = require("../format-log-file-location");
|
|
14
|
+
const project_info_1 = require("../project-info");
|
|
15
|
+
const undo_stack_1 = require("../undo-stack");
|
|
16
|
+
const can_update_default_props_1 = require("./can-update-default-props");
|
|
17
|
+
const source_file_write_queue_1 = require("./source-file-write-queue");
|
|
18
|
+
const unwrapFolderHandler = ({ input: request, logLevel, remotionRoot, entryPoint }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
var _c, _d;
|
|
21
|
+
try {
|
|
22
|
+
let filePath;
|
|
23
|
+
if ((_a = request.symbolicatedStack) === null || _a === void 0 ? void 0 : _a.originalFileName) {
|
|
24
|
+
filePath = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
25
|
+
remotionRoot,
|
|
26
|
+
fileName: request.symbolicatedStack.originalFileName,
|
|
27
|
+
action: 'delete a folder from',
|
|
28
|
+
}).absolutePath;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const { rootFile } = await (0, project_info_1.getProjectInfo)(remotionRoot, entryPoint);
|
|
32
|
+
if (rootFile === null) {
|
|
33
|
+
throw new Error('Cannot find the Remotion root file');
|
|
34
|
+
}
|
|
35
|
+
filePath = rootFile;
|
|
36
|
+
}
|
|
37
|
+
(0, can_update_default_props_1.checkIfTypeScriptFile)(filePath);
|
|
38
|
+
const result = (0, codemods_1.unwrapFolder)({
|
|
39
|
+
project: {
|
|
40
|
+
files: { [filePath]: (0, node_fs_1.readFileSync)(filePath, 'utf-8') },
|
|
41
|
+
rootDir: node_path_1.default.dirname(filePath),
|
|
42
|
+
},
|
|
43
|
+
compositionFile: filePath,
|
|
44
|
+
folder: { name: request.folderName, parentName: request.parentName },
|
|
45
|
+
});
|
|
46
|
+
for (const change of result.changes) {
|
|
47
|
+
const currentContents = (0, node_fs_1.existsSync)(change.filePath)
|
|
48
|
+
? (0, node_fs_1.readFileSync)(change.filePath, 'utf-8')
|
|
49
|
+
: null;
|
|
50
|
+
if (currentContents !== change.previousContents) {
|
|
51
|
+
throw new Error(`Source changed before deleting folder: ${change.filePath}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (result.changes.length > 0) {
|
|
55
|
+
const logLine = (_c = (_b = request.symbolicatedStack) === null || _b === void 0 ? void 0 : _b.originalLineNumber) !== null && _c !== void 0 ? _c : 1;
|
|
56
|
+
const folderPath = request.parentName
|
|
57
|
+
? `${request.parentName}/${request.folderName}`
|
|
58
|
+
: request.folderName;
|
|
59
|
+
(0, undo_stack_1.pushTransactionToUndoStack)({
|
|
60
|
+
snapshots: result.changes.map((change) => ({
|
|
61
|
+
filePath: change.filePath,
|
|
62
|
+
oldContents: change.previousContents,
|
|
63
|
+
newContents: change.nextContents,
|
|
64
|
+
logLine: change.filePath === filePath ? logLine : 1,
|
|
65
|
+
nodePathRemappings: null,
|
|
66
|
+
})),
|
|
67
|
+
logLevel,
|
|
68
|
+
remotionRoot,
|
|
69
|
+
description: {
|
|
70
|
+
undoMessage: `↩️ Deletion of folder "${folderPath}"`,
|
|
71
|
+
redoMessage: `↪️ Deletion of folder "${folderPath}"`,
|
|
72
|
+
},
|
|
73
|
+
entryType: 'delete-folder',
|
|
74
|
+
suppressHmrOnFileRestore: false,
|
|
75
|
+
undoRedoNavigation: request.undoRedoNavigation,
|
|
76
|
+
});
|
|
77
|
+
for (const change of result.changes) {
|
|
78
|
+
if (change.nextContents === null) {
|
|
79
|
+
throw new Error('Deleting a folder cannot remove source files');
|
|
80
|
+
}
|
|
81
|
+
(0, undo_stack_1.suppressUndoStackInvalidation)(change.filePath);
|
|
82
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)({
|
|
83
|
+
file: change.filePath,
|
|
84
|
+
content: change.nextContents,
|
|
85
|
+
originatorClientId: undefined,
|
|
86
|
+
metadata: null,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const locationLabel = (0, format_log_file_location_1.formatLogFileLocation)({
|
|
90
|
+
remotionRoot,
|
|
91
|
+
absolutePath: filePath,
|
|
92
|
+
line: logLine,
|
|
93
|
+
});
|
|
94
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(locationLabel)} Deleted folder "${folderPath}"`);
|
|
95
|
+
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
96
|
+
}
|
|
97
|
+
return { success: true, nodePathMutation: null };
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
return {
|
|
101
|
+
success: false,
|
|
102
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
103
|
+
stack: error instanceof Error ? ((_d = error.stack) !== null && _d !== void 0 ? _d : '') : '',
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
exports.unwrapFolderHandler = unwrapFolderHandler;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CompositionEditResponse, UpdateCompositionMetadataRequest } from '@remotion/studio-shared';
|
|
2
|
+
import type { ApiHandler } from '../api-types';
|
|
3
|
+
export declare const updateCompositionMetadataHandler: ApiHandler<UpdateCompositionMetadataRequest, CompositionEditResponse>;
|
|
@@ -0,0 +1,110 @@
|
|
|
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.updateCompositionMetadataHandler = void 0;
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const codemods_1 = require("@remotion/codemods");
|
|
10
|
+
const renderer_1 = require("@remotion/renderer");
|
|
11
|
+
const file_watcher_1 = require("../../file-watcher");
|
|
12
|
+
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
13
|
+
const format_log_file_location_1 = require("../format-log-file-location");
|
|
14
|
+
const project_info_1 = require("../project-info");
|
|
15
|
+
const undo_stack_1 = require("../undo-stack");
|
|
16
|
+
const can_update_default_props_1 = require("./can-update-default-props");
|
|
17
|
+
const source_file_write_queue_1 = require("./source-file-write-queue");
|
|
18
|
+
const updateCompositionMetadataHandler = ({ input: request, logLevel, remotionRoot, entryPoint }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
var _c, _d, _e, _f, _g, _h;
|
|
21
|
+
try {
|
|
22
|
+
let filePath;
|
|
23
|
+
if ((_a = request.symbolicatedStack) === null || _a === void 0 ? void 0 : _a.originalFileName) {
|
|
24
|
+
filePath = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
25
|
+
remotionRoot,
|
|
26
|
+
fileName: request.symbolicatedStack.originalFileName,
|
|
27
|
+
action: 'update composition metadata in',
|
|
28
|
+
}).absolutePath;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const { rootFile } = await (0, project_info_1.getProjectInfo)(remotionRoot, entryPoint);
|
|
32
|
+
if (rootFile === null) {
|
|
33
|
+
throw new Error('Cannot find the Remotion root file');
|
|
34
|
+
}
|
|
35
|
+
filePath = rootFile;
|
|
36
|
+
}
|
|
37
|
+
(0, can_update_default_props_1.checkIfTypeScriptFile)(filePath);
|
|
38
|
+
const result = (0, codemods_1.updateCompositionMetadata)({
|
|
39
|
+
project: {
|
|
40
|
+
files: { [filePath]: (0, node_fs_1.readFileSync)(filePath, 'utf-8') },
|
|
41
|
+
rootDir: node_path_1.default.dirname(filePath),
|
|
42
|
+
},
|
|
43
|
+
compositionFile: filePath,
|
|
44
|
+
compositionId: request.idToUpdate,
|
|
45
|
+
metadata: {
|
|
46
|
+
width: (_c = request.newWidth) !== null && _c !== void 0 ? _c : undefined,
|
|
47
|
+
height: (_d = request.newHeight) !== null && _d !== void 0 ? _d : undefined,
|
|
48
|
+
fps: (_e = request.newFps) !== null && _e !== void 0 ? _e : undefined,
|
|
49
|
+
durationInFrames: (_f = request.newDurationInFrames) !== null && _f !== void 0 ? _f : undefined,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
for (const change of result.changes) {
|
|
53
|
+
const currentContents = (0, node_fs_1.existsSync)(change.filePath)
|
|
54
|
+
? (0, node_fs_1.readFileSync)(change.filePath, 'utf-8')
|
|
55
|
+
: null;
|
|
56
|
+
if (currentContents !== change.previousContents) {
|
|
57
|
+
throw new Error(`Source changed before updating composition metadata: ${change.filePath}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (result.changes.length > 0) {
|
|
61
|
+
const logLine = (_g = (_b = request.symbolicatedStack) === null || _b === void 0 ? void 0 : _b.originalLineNumber) !== null && _g !== void 0 ? _g : 1;
|
|
62
|
+
(0, undo_stack_1.pushTransactionToUndoStack)({
|
|
63
|
+
snapshots: result.changes.map((change) => ({
|
|
64
|
+
filePath: change.filePath,
|
|
65
|
+
oldContents: change.previousContents,
|
|
66
|
+
newContents: change.nextContents,
|
|
67
|
+
logLine: change.filePath === filePath ? logLine : 1,
|
|
68
|
+
nodePathRemappings: null,
|
|
69
|
+
})),
|
|
70
|
+
logLevel,
|
|
71
|
+
remotionRoot,
|
|
72
|
+
description: {
|
|
73
|
+
undoMessage: `↩️ Update of metadata of composition "${request.idToUpdate}"`,
|
|
74
|
+
redoMessage: `↪️ Update of metadata of composition "${request.idToUpdate}"`,
|
|
75
|
+
},
|
|
76
|
+
entryType: 'update-composition-metadata',
|
|
77
|
+
suppressHmrOnFileRestore: false,
|
|
78
|
+
undoRedoNavigation: request.undoRedoNavigation,
|
|
79
|
+
});
|
|
80
|
+
for (const change of result.changes) {
|
|
81
|
+
if (change.nextContents === null) {
|
|
82
|
+
throw new Error('Updating composition metadata cannot remove source files');
|
|
83
|
+
}
|
|
84
|
+
(0, undo_stack_1.suppressUndoStackInvalidation)(change.filePath);
|
|
85
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)({
|
|
86
|
+
file: change.filePath,
|
|
87
|
+
content: change.nextContents,
|
|
88
|
+
originatorClientId: undefined,
|
|
89
|
+
metadata: null,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
const locationLabel = (0, format_log_file_location_1.formatLogFileLocation)({
|
|
93
|
+
remotionRoot,
|
|
94
|
+
absolutePath: filePath,
|
|
95
|
+
line: logLine,
|
|
96
|
+
});
|
|
97
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(locationLabel)} Updated metadata of composition "${request.idToUpdate}"`);
|
|
98
|
+
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
99
|
+
}
|
|
100
|
+
return { success: true, nodePathMutation: null };
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
return {
|
|
104
|
+
success: false,
|
|
105
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
106
|
+
stack: error instanceof Error ? ((_h = error.stack) !== null && _h !== void 0 ? _h : '') : '',
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
exports.updateCompositionMetadataHandler = updateCompositionMetadataHandler;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UpdatePublicLicenseRequest, UpdatePublicLicenseResponse } from '@remotion/studio-shared';
|
|
2
|
+
import type { ApiHandler } from '../api-types';
|
|
3
|
+
export declare const updatePublicLicenseInConfig: ({ configContents, publicLicenseKey, }: {
|
|
4
|
+
configContents: string;
|
|
5
|
+
publicLicenseKey: string;
|
|
6
|
+
}) => string;
|
|
7
|
+
export declare const setPublicLicenseKeyInConfigFile: ({ configFile, publicLicenseKey, }: {
|
|
8
|
+
readonly configFile: string;
|
|
9
|
+
readonly publicLicenseKey: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
export declare const updatePublicLicenseHandler: ApiHandler<UpdatePublicLicenseRequest, UpdatePublicLicenseResponse>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.updatePublicLicenseHandler = exports.setPublicLicenseKeyInConfigFile = exports.updatePublicLicenseInConfig = void 0;
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const recast = __importStar(require("recast"));
|
|
39
|
+
const parse_ast_1 = require("../../codemods/parse-ast");
|
|
40
|
+
const file_watcher_1 = require("../../file-watcher");
|
|
41
|
+
const updatePublicLicenseInConfig = ({ configContents, publicLicenseKey, }) => {
|
|
42
|
+
const ast = (0, parse_ast_1.parseAst)(configContents);
|
|
43
|
+
recast.types.visit(ast.program, {
|
|
44
|
+
visitExpressionStatement(path) {
|
|
45
|
+
const { expression } = path.node;
|
|
46
|
+
if (expression.type === 'CallExpression' &&
|
|
47
|
+
expression.callee.type === 'MemberExpression' &&
|
|
48
|
+
!expression.callee.computed &&
|
|
49
|
+
expression.callee.object.type === 'Identifier' &&
|
|
50
|
+
expression.callee.object.name === 'Config' &&
|
|
51
|
+
expression.callee.property.type === 'Identifier' &&
|
|
52
|
+
expression.callee.property.name === 'setPublicLicenseKey') {
|
|
53
|
+
path.prune();
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
this.traverse(path);
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
const configWithoutExistingCalls = recast.print(ast, {
|
|
60
|
+
lineTerminator: '\n',
|
|
61
|
+
}).code;
|
|
62
|
+
const separator = configWithoutExistingCalls.endsWith('\n') ? '' : '\n';
|
|
63
|
+
const escapedPublicLicenseKey = publicLicenseKey
|
|
64
|
+
.replaceAll('\\', '\\\\')
|
|
65
|
+
.replaceAll("'", "\\'")
|
|
66
|
+
.replaceAll('\r', '\\r')
|
|
67
|
+
.replaceAll('\n', '\\n')
|
|
68
|
+
.replaceAll('\u2028', '\\u2028')
|
|
69
|
+
.replaceAll('\u2029', '\\u2029');
|
|
70
|
+
return `${configWithoutExistingCalls}${separator}Config.setPublicLicenseKey('${escapedPublicLicenseKey}');\n`;
|
|
71
|
+
};
|
|
72
|
+
exports.updatePublicLicenseInConfig = updatePublicLicenseInConfig;
|
|
73
|
+
const setPublicLicenseKeyInConfigFile = ({ configFile, publicLicenseKey, }) => {
|
|
74
|
+
const configContents = (0, node_fs_1.readFileSync)(configFile, 'utf8');
|
|
75
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(configFile, (0, exports.updatePublicLicenseInConfig)({ configContents, publicLicenseKey }), undefined);
|
|
76
|
+
};
|
|
77
|
+
exports.setPublicLicenseKeyInConfigFile = setPublicLicenseKeyInConfigFile;
|
|
78
|
+
const updatePublicLicenseHandler = ({ input, configFile }) => {
|
|
79
|
+
if (configFile === null || configFile === undefined) {
|
|
80
|
+
return Promise.resolve({
|
|
81
|
+
success: false,
|
|
82
|
+
reason: 'No Remotion config file was loaded.',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (input.publicLicenseKey.length === 0) {
|
|
86
|
+
return Promise.resolve({
|
|
87
|
+
success: false,
|
|
88
|
+
reason: 'The public license key must not be empty.',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
(0, exports.setPublicLicenseKeyInConfigFile)({
|
|
92
|
+
configFile,
|
|
93
|
+
publicLicenseKey: input.publicLicenseKey,
|
|
94
|
+
});
|
|
95
|
+
return Promise.resolve({ success: true });
|
|
96
|
+
};
|
|
97
|
+
exports.updatePublicLicenseHandler = updatePublicLicenseHandler;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapNodeHandler = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const codemods_1 = require("@remotion/codemods");
|
|
6
|
+
const renderer_1 = require("@remotion/renderer");
|
|
7
|
+
const file_watcher_1 = require("../../file-watcher");
|
|
8
|
+
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
9
|
+
const format_log_file_location_1 = require("../format-log-file-location");
|
|
10
|
+
const sequence_node_path_mutation_1 = require("../sequence-node-path-mutation");
|
|
11
|
+
const undo_stack_1 = require("../undo-stack");
|
|
12
|
+
const source_file_write_queue_1 = require("./source-file-write-queue");
|
|
13
|
+
const wrapNodeHandler = ({ input: { fileName, nodePath, wrapper, width, height, timing }, remotionRoot, logLevel, }) => {
|
|
14
|
+
return (0, source_file_write_queue_1.withSourceFileWriteQueue)(() => {
|
|
15
|
+
var _a;
|
|
16
|
+
try {
|
|
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 eligibility = (0, codemods_1.canWrapNode)({ input: fileContents, nodePath });
|
|
24
|
+
if (wrapper === null) {
|
|
25
|
+
return Promise.resolve({
|
|
26
|
+
success: true,
|
|
27
|
+
...eligibility,
|
|
28
|
+
nodePathMutation: null,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (!eligibility.canWrap ||
|
|
32
|
+
((wrapper === 'HtmlInCanvas' || wrapper === 'HtmlInCanvasMotionBlur') &&
|
|
33
|
+
!eligibility.canWrapHtmlInCanvas)) {
|
|
34
|
+
throw new Error('This JSX element cannot be wrapped');
|
|
35
|
+
}
|
|
36
|
+
const result = (0, codemods_1.wrapNode)({
|
|
37
|
+
project: { files: { [absolutePath]: fileContents }, rootDir: remotionRoot },
|
|
38
|
+
node: { filePath: absolutePath, nodePath },
|
|
39
|
+
wrapper: (0, codemods_1.createElement)({
|
|
40
|
+
component: wrapper,
|
|
41
|
+
importPath: wrapper === 'HtmlInCanvasMotionBlur'
|
|
42
|
+
? '@remotion/motion-blur'
|
|
43
|
+
: 'remotion',
|
|
44
|
+
props: wrapper === 'HtmlInCanvas' || wrapper === 'HtmlInCanvasMotionBlur'
|
|
45
|
+
? {
|
|
46
|
+
width: width !== null && width !== void 0 ? width : 0,
|
|
47
|
+
height: height !== null && height !== void 0 ? height : 0,
|
|
48
|
+
...(timing !== null && timing !== void 0 ? timing : {}),
|
|
49
|
+
}
|
|
50
|
+
: {},
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
const change = result.changes.find(({ filePath }) => filePath === absolutePath);
|
|
54
|
+
if ((change === null || change === void 0 ? void 0 : change.previousContents) !== fileContents ||
|
|
55
|
+
change.nextContents === null) {
|
|
56
|
+
throw new Error('Could not wrap JSX node');
|
|
57
|
+
}
|
|
58
|
+
const output = change.nextContents;
|
|
59
|
+
const remappings = result.nodePathRemappings.map(({ oldNodePath, newNodePath }) => ({ oldNodePath, newNodePath }));
|
|
60
|
+
const nodePathMutation = (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)([{ absolutePath, remappings }], null);
|
|
61
|
+
const line = result.logLine;
|
|
62
|
+
(0, undo_stack_1.pushTransactionToUndoStack)({
|
|
63
|
+
snapshots: [
|
|
64
|
+
{
|
|
65
|
+
filePath: absolutePath,
|
|
66
|
+
oldContents: fileContents,
|
|
67
|
+
newContents: null,
|
|
68
|
+
logLine: line,
|
|
69
|
+
nodePathRemappings: remappings,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
logLevel,
|
|
73
|
+
remotionRoot,
|
|
74
|
+
description: {
|
|
75
|
+
undoMessage: `↩️ Wrapping in ${wrapper}`,
|
|
76
|
+
redoMessage: `↪️ Wrapping in ${wrapper}`,
|
|
77
|
+
},
|
|
78
|
+
entryType: 'wrap-node',
|
|
79
|
+
suppressHmrOnFileRestore: false,
|
|
80
|
+
undoRedoNavigation: null,
|
|
81
|
+
});
|
|
82
|
+
(0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
|
|
83
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)({
|
|
84
|
+
file: absolutePath,
|
|
85
|
+
content: output,
|
|
86
|
+
originatorClientId: undefined,
|
|
87
|
+
metadata: { skipSequencePropsUpdate: true },
|
|
88
|
+
});
|
|
89
|
+
const locationLabel = (0, format_log_file_location_1.formatLogFileLocation)({
|
|
90
|
+
remotionRoot,
|
|
91
|
+
absolutePath,
|
|
92
|
+
line,
|
|
93
|
+
});
|
|
94
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(locationLabel)} Wrapped JSX in <${wrapper}>`);
|
|
95
|
+
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, `[wrap-node] Wrote ${fileRelativeToRoot}`);
|
|
96
|
+
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
97
|
+
return Promise.resolve({ success: true, ...eligibility, nodePathMutation });
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
return Promise.resolve({
|
|
101
|
+
success: false,
|
|
102
|
+
reason: err.message,
|
|
103
|
+
stack: (_a = err.stack) !== null && _a !== void 0 ? _a : '',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
exports.wrapNodeHandler = wrapNodeHandler;
|
|
@@ -10,7 +10,6 @@ const version_1 = require("remotion/version");
|
|
|
10
10
|
const element_install_state_1 = require("../element-install-state");
|
|
11
11
|
const origin_policy_1 = require("./origin-policy");
|
|
12
12
|
const protocol_response_1 = require("./protocol-response");
|
|
13
|
-
const STUDIO_PROTOCOL_FOCUS_MAX_AGE = 5 * 60 * 1000;
|
|
14
13
|
exports.ELEMENT_INSTALL_TARGET_RESPONSE_WAIT = 250;
|
|
15
14
|
const requestInstallTarget = ({ liveEventsServer, }) => {
|
|
16
15
|
const requestId = `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
@@ -25,17 +24,11 @@ const getLiveStudioTarget = (requestId) => {
|
|
|
25
24
|
const now = Date.now();
|
|
26
25
|
if (target === null ||
|
|
27
26
|
now - target.updatedAt >= element_install_state_1.ELEMENT_INSTALL_TARGET_MAX_AGE ||
|
|
28
|
-
target.lastFocusedAt === null ||
|
|
29
|
-
now - target.lastFocusedAt >= STUDIO_PROTOCOL_FOCUS_MAX_AGE ||
|
|
30
27
|
target.readOnly) {
|
|
31
28
|
return null;
|
|
32
29
|
}
|
|
33
30
|
return target;
|
|
34
31
|
};
|
|
35
|
-
const isElementRequestTarget = (target) => target !== null &&
|
|
36
|
-
target.compositionFile !== null &&
|
|
37
|
-
target.compositionId !== null &&
|
|
38
|
-
target.lastFocusedAt !== null;
|
|
39
32
|
const getProject = ({ gitSource, remotionRoot, }) => (0, studio_shared_1.getProjectName)({
|
|
40
33
|
basename: node_path_1.default.basename,
|
|
41
34
|
gitSource,
|
|
@@ -67,7 +60,7 @@ const handleStudioProtocolDiscovery = ({ gitSource, liveEventsServer, remotionRo
|
|
|
67
60
|
setTimeout(() => {
|
|
68
61
|
const now = Date.now();
|
|
69
62
|
const target = getLiveStudioTarget(requestId);
|
|
70
|
-
const installTarget =
|
|
63
|
+
const installTarget = target;
|
|
71
64
|
const issuedInstallTarget = installTarget === null
|
|
72
65
|
? null
|
|
73
66
|
: (0, element_install_state_1.issueStudioProtocolTarget)({
|
|
@@ -76,7 +69,7 @@ const handleStudioProtocolDiscovery = ({ gitSource, liveEventsServer, remotionRo
|
|
|
76
69
|
purpose: 'install-element',
|
|
77
70
|
target: installTarget,
|
|
78
71
|
});
|
|
79
|
-
const issuedLicenseKeyTarget = target === null
|
|
72
|
+
const issuedLicenseKeyTarget = target === null || target.lastFocusedAt === null
|
|
80
73
|
? null
|
|
81
74
|
: (0, element_install_state_1.issueStudioProtocolTarget)({
|
|
82
75
|
now,
|
|
@@ -84,7 +77,7 @@ const handleStudioProtocolDiscovery = ({ gitSource, liveEventsServer, remotionRo
|
|
|
84
77
|
purpose: 'set-license-key',
|
|
85
78
|
target,
|
|
86
79
|
});
|
|
87
|
-
const issuedElementLibraryTarget = target === null
|
|
80
|
+
const issuedElementLibraryTarget = target === null || target.lastFocusedAt === null
|
|
88
81
|
? null
|
|
89
82
|
: (0, element_install_state_1.issueStudioProtocolTarget)({
|
|
90
83
|
now,
|
|
@@ -11,9 +11,6 @@ const protocol_response_1 = require("./protocol-response");
|
|
|
11
11
|
const MAX_STUDIO_PROTOCOL_INSTALL_BODY_SIZE = 1000000;
|
|
12
12
|
const deliverElementInstall = ({ element, focusStudioTab, liveEventsServer, origin, target, }) => {
|
|
13
13
|
var _a, _b, _c;
|
|
14
|
-
if (target.compositionFile === null || target.compositionId === null) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
14
|
const installRequest = {
|
|
18
15
|
id: `${Date.now()}-${Math.random().toString(16).slice(2)}`,
|
|
19
16
|
clientId: target.clientId,
|