@remotion/studio 4.0.518 → 4.0.519
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/AppLaunchButton.d.ts +16 -0
- package/dist/components/AppLaunchButton.js +90 -0
- package/dist/components/AssetSelector.js +7 -6
- package/dist/components/AssetSelectorItem.d.ts +12 -0
- package/dist/components/AssetSelectorItem.js +180 -62
- package/dist/components/Button.js +20 -7
- package/dist/components/Canvas.js +109 -78
- package/dist/components/CanvasOrLoading.js +7 -7
- package/dist/components/CodingAgentButton.d.ts +7 -0
- package/dist/components/CodingAgentButton.js +59 -0
- package/dist/components/CompositionContextButton.d.ts +1 -0
- package/dist/components/CompositionContextButton.js +6 -3
- package/dist/components/CompositionSelector.js +15 -10
- package/dist/components/CompositionSelectorItem.js +16 -23
- package/dist/components/ConfigureLicenseModal.js +4 -48
- package/dist/components/CurrentAsset.js +1 -1
- package/dist/components/ElementInstallConfirmation.d.ts +20 -7
- package/dist/components/ElementInstallConfirmation.js +325 -32
- package/dist/components/FixComputedValueModal.js +5 -131
- package/dist/components/InitialCompositionLoader.js +3 -2
- package/dist/components/InspectorOpenInEditor.js +48 -33
- package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.js +1 -0
- package/dist/components/InspectorPanel/styles.js +1 -0
- package/dist/components/InspectorSequenceSection.js +8 -3
- package/dist/components/InspectorSourceLocation.js +5 -1
- package/dist/components/KnownBugs.d.ts +1 -1
- package/dist/components/KnownBugs.js +1 -1
- package/dist/components/LicenseExplanation.d.ts +2 -0
- package/dist/components/LicenseExplanation.js +63 -0
- package/dist/components/MenuToolbar.js +7 -1
- package/dist/components/Modals.js +1 -2
- package/dist/components/NewComposition/InputDragger.js +29 -2
- package/dist/components/NewComposition/NewCompDuration.js +1 -1
- package/dist/components/NewComposition/NewComposition.d.ts +23 -0
- package/dist/components/NewComposition/NewComposition.js +217 -80
- package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +21 -13
- package/dist/components/RenderQueue/actions.d.ts +1 -0
- package/dist/components/RenderQueue/actions.js +5 -1
- package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
- package/dist/components/SelectedOutlineElement.js +2 -1
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
- package/dist/components/SelectedOutlineOverlay.js +21 -26
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +12 -4
- package/dist/components/SelectedOutlineRenderer.js +88 -21
- package/dist/components/SettingsContext.js +2 -1
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +19 -3
- package/dist/components/SidebarRenderButton.d.ts +1 -0
- package/dist/components/SidebarRenderButton.js +14 -5
- package/dist/components/Timeline/SequencePropsObserver.js +29 -14
- package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
- package/dist/components/Timeline/TimelineRowChrome.js +4 -2
- package/dist/components/Timeline/TimelineSequence.js +40 -8
- package/dist/components/Timeline/TimelineSequenceItem.js +34 -1
- package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
- package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
- package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/UpdateCheck.d.ts +0 -8
- package/dist/components/UpdateCheck.js +7 -54
- package/dist/components/UpdateStatusContext.d.ts +18 -0
- package/dist/components/UpdateStatusContext.js +74 -0
- package/dist/components/UpdatesSettings.d.ts +2 -0
- package/dist/components/UpdatesSettings.js +251 -0
- package/dist/components/WebMcp.js +3 -3
- package/dist/components/get-open-in-menu-items.d.ts +4 -0
- package/dist/components/get-open-in-menu-items.js +28 -24
- package/dist/components/root-composition-menu-items.d.ts +4 -1
- package/dist/components/root-composition-menu-items.js +38 -1
- package/dist/components/selected-outline-geometry.d.ts +21 -2
- package/dist/components/selected-outline-geometry.js +16 -5
- package/dist/components/selected-outline-measurement.d.ts +40 -1
- package/dist/components/selected-outline-measurement.js +239 -1
- package/dist/components/selected-outline-order.d.ts +12 -0
- package/dist/components/selected-outline-order.js +251 -0
- package/dist/components/selected-outline-types.d.ts +15 -2
- package/dist/components/selected-outline-uv.js +106 -3
- package/dist/components/use-configure-default-apps.d.ts +1 -0
- package/dist/components/use-configure-default-apps.js +24 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
- package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
- package/dist/esm/{chunk-7prjt5n5.js → chunk-1fkq5bfq.js} +15439 -11610
- package/dist/esm/chunk-6jf1natv.js +25 -0
- package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
- package/dist/esm/chunk-m0jqdbkr.js +14571 -0
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/internals.mjs +32140 -13755
- package/dist/esm/previewEntry.mjs +35408 -17021
- package/dist/esm/renderEntry.mjs +6 -3
- package/dist/helpers/can-show-updates.d.ts +5 -0
- package/dist/helpers/can-show-updates.js +7 -0
- package/dist/helpers/colors.d.ts +0 -3
- package/dist/helpers/colors.js +2 -5
- package/dist/helpers/create-folder-tree.d.ts +5 -0
- package/dist/helpers/create-folder-tree.js +24 -1
- package/dist/helpers/get-asset-metadata.js +1 -1
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
- package/dist/helpers/get-box-quads-polyfill-internals.js +2403 -0
- package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
- package/dist/helpers/get-box-quads-ponyfill.js +23 -0
- package/dist/helpers/get-git-menu-item.d.ts +5 -0
- package/dist/helpers/get-git-menu-item.js +15 -1
- package/dist/helpers/hoverable.js +10 -5
- package/dist/helpers/open-in-editor.js +51 -1
- package/dist/helpers/preview-server-events.js +3 -0
- package/dist/helpers/timeline-layout.d.ts +0 -1
- package/dist/helpers/timeline-layout.js +1 -5
- package/dist/helpers/url-state.d.ts +1 -0
- package/dist/helpers/url-state.js +12 -5
- package/dist/renderEntry.js +2 -0
- package/dist/state/folders.d.ts +3 -0
- package/dist/state/folders.js +40 -1
- package/dist/state/modals.d.ts +1 -6
- package/package.json +17 -14
- package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
- package/dist/components/UpdateModal/UpdateModal.js +0 -104
- /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NewComposition = void 0;
|
|
3
|
+
exports.NewComposition = exports.NewCompositionFields = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const get_static_files_1 = require("../../api/get-static-files");
|
|
8
8
|
const write_static_file_1 = require("../../api/write-static-file");
|
|
9
|
+
const colors_1 = require("../../helpers/colors");
|
|
10
|
+
const get_folder_id_1 = require("../../helpers/get-folder-id");
|
|
9
11
|
const install_required_package_1 = require("../../helpers/install-required-package");
|
|
12
|
+
const sort_by_nonce_history_1 = require("../../helpers/sort-by-nonce-history");
|
|
10
13
|
const use_create_composition_1 = require("../../helpers/use-create-composition");
|
|
14
|
+
const Checkmark_1 = require("../../icons/Checkmark");
|
|
15
|
+
const folder_1 = require("../../icons/folder");
|
|
16
|
+
const folders_1 = require("../../state/folders");
|
|
11
17
|
const layout_1 = require("../layout");
|
|
12
18
|
const ModalFooter_1 = require("../ModalFooter");
|
|
13
19
|
const ModalHeader_1 = require("../ModalHeader");
|
|
14
20
|
const layout_2 = require("../RenderModal/layout");
|
|
15
21
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
22
|
+
const ComboBox_1 = require("./ComboBox");
|
|
16
23
|
const DismissableModal_1 = require("./DismissableModal");
|
|
17
24
|
const get_new_composition_defaults_1 = require("./get-new-composition-defaults");
|
|
18
25
|
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
@@ -27,9 +34,198 @@ const content = {
|
|
|
27
34
|
fontSize: 13,
|
|
28
35
|
minWidth: 500,
|
|
29
36
|
};
|
|
30
|
-
const
|
|
31
|
-
|
|
37
|
+
const folderSelectStyle = {
|
|
38
|
+
boxSizing: 'border-box',
|
|
39
|
+
width: 250,
|
|
32
40
|
};
|
|
41
|
+
const folderIconStyle = {
|
|
42
|
+
flexShrink: 0,
|
|
43
|
+
height: 16,
|
|
44
|
+
width: 16,
|
|
45
|
+
};
|
|
46
|
+
const folderLabelStyle = {
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
color: 'inherit',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
fontFamily: 'inherit',
|
|
51
|
+
fontSize: 'inherit',
|
|
52
|
+
lineHeight: 'normal',
|
|
53
|
+
minWidth: 0,
|
|
54
|
+
};
|
|
55
|
+
const folderLabelTextStyle = {
|
|
56
|
+
color: 'inherit',
|
|
57
|
+
fontFamily: 'inherit',
|
|
58
|
+
fontSize: 'inherit',
|
|
59
|
+
lineHeight: 'normal',
|
|
60
|
+
overflow: 'hidden',
|
|
61
|
+
textOverflow: 'ellipsis',
|
|
62
|
+
whiteSpace: 'nowrap',
|
|
63
|
+
};
|
|
64
|
+
const FolderDropdownLabel = ({ folderPath, indentation }) => {
|
|
65
|
+
return (jsx_runtime_1.jsxs("div", { style: folderLabelStyle, children: [
|
|
66
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: indentation * 1.5 }), folderPath === null ? (jsx_runtime_1.jsx("div", { style: folderIconStyle })) : (jsx_runtime_1.jsx(folder_1.CollapsedFolderIcon, { color: colors_1.LIGHT_TEXT, style: folderIconStyle })), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("span", { style: folderLabelTextStyle, children: folderPath !== null && folderPath !== void 0 ? folderPath : 'None' })
|
|
67
|
+
] }));
|
|
68
|
+
};
|
|
69
|
+
const rootFolderId = 'new-composition-root-folder';
|
|
70
|
+
const folderSelectIdPrefix = 'new-composition-folder-';
|
|
71
|
+
const NewCompositionFields = ({ heightValidationMessage, inputRef, nameValidationMessage, setValues, values, widthValidationMessage, }) => {
|
|
72
|
+
const { folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
73
|
+
const { compositionSortOrder } = (0, react_1.useContext)(folders_1.FolderContext);
|
|
74
|
+
const selectedFolderId = values.folder.folderName
|
|
75
|
+
? `${folderSelectIdPrefix}${(0, get_folder_id_1.getFolderId)({
|
|
76
|
+
folderName: values.folder.folderName,
|
|
77
|
+
parentName: values.folder.parentName,
|
|
78
|
+
})}`
|
|
79
|
+
: rootFolderId;
|
|
80
|
+
const folderValues = (0, react_1.useMemo)(() => {
|
|
81
|
+
const foldersInTreeOrder = [];
|
|
82
|
+
const sortedFolders = compositionSortOrder === 'alphabetical'
|
|
83
|
+
? folders
|
|
84
|
+
.slice()
|
|
85
|
+
.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true }))
|
|
86
|
+
: (0, sort_by_nonce_history_1.sortItemsByNonceHistory)(folders);
|
|
87
|
+
const appendFolders = (parent) => {
|
|
88
|
+
sortedFolders
|
|
89
|
+
.filter((folder) => folder.parent === parent)
|
|
90
|
+
.forEach((folder) => {
|
|
91
|
+
foldersInTreeOrder.push(folder);
|
|
92
|
+
appendFolders((0, get_folder_id_1.getFolderId)({ folderName: folder.name, parentName: folder.parent }));
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
appendFolders(null);
|
|
96
|
+
return [
|
|
97
|
+
{
|
|
98
|
+
id: rootFolderId,
|
|
99
|
+
keyHint: null,
|
|
100
|
+
label: jsx_runtime_1.jsx(FolderDropdownLabel, { folderPath: null, indentation: 0 }),
|
|
101
|
+
leftItem: values.folder.folderName === null ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
102
|
+
onClick: () => {
|
|
103
|
+
setValues((current) => ({
|
|
104
|
+
...current,
|
|
105
|
+
folder: {
|
|
106
|
+
folderName: null,
|
|
107
|
+
parentName: null,
|
|
108
|
+
stack: null,
|
|
109
|
+
},
|
|
110
|
+
}));
|
|
111
|
+
},
|
|
112
|
+
quickSwitcherLabel: 'None',
|
|
113
|
+
subMenu: null,
|
|
114
|
+
type: 'item',
|
|
115
|
+
value: rootFolderId,
|
|
116
|
+
},
|
|
117
|
+
...(folders.length === 0
|
|
118
|
+
? []
|
|
119
|
+
: [
|
|
120
|
+
{
|
|
121
|
+
id: 'new-composition-root-folder-divider',
|
|
122
|
+
type: 'divider',
|
|
123
|
+
},
|
|
124
|
+
]),
|
|
125
|
+
...foldersInTreeOrder.map((folder) => {
|
|
126
|
+
var _a;
|
|
127
|
+
var _b;
|
|
128
|
+
const folderPath = (0, get_folder_id_1.getFolderId)({
|
|
129
|
+
folderName: folder.name,
|
|
130
|
+
parentName: folder.parent,
|
|
131
|
+
});
|
|
132
|
+
const indentation = (_b = (_a = folder.parent) === null || _a === void 0 ? void 0 : _a.split('/').length) !== null && _b !== void 0 ? _b : 0;
|
|
133
|
+
const id = `${folderSelectIdPrefix}${folderPath}`;
|
|
134
|
+
return {
|
|
135
|
+
id,
|
|
136
|
+
keyHint: null,
|
|
137
|
+
label: (jsx_runtime_1.jsx(FolderDropdownLabel, { folderPath: folderPath, indentation: indentation })),
|
|
138
|
+
leftItem: selectedFolderId === id ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
139
|
+
onClick: () => {
|
|
140
|
+
setValues((current) => ({
|
|
141
|
+
...current,
|
|
142
|
+
folder: {
|
|
143
|
+
folderName: folder.name,
|
|
144
|
+
parentName: folder.parent,
|
|
145
|
+
stack: folder.stack,
|
|
146
|
+
},
|
|
147
|
+
}));
|
|
148
|
+
},
|
|
149
|
+
quickSwitcherLabel: folderPath,
|
|
150
|
+
subMenu: null,
|
|
151
|
+
type: 'item',
|
|
152
|
+
value: id,
|
|
153
|
+
disabled: folder.stack === null,
|
|
154
|
+
};
|
|
155
|
+
}),
|
|
156
|
+
];
|
|
157
|
+
}, [
|
|
158
|
+
compositionSortOrder,
|
|
159
|
+
folders,
|
|
160
|
+
selectedFolderId,
|
|
161
|
+
setValues,
|
|
162
|
+
values.folder.folderName,
|
|
163
|
+
]);
|
|
164
|
+
const onWidthChanged = (0, react_1.useCallback)((newValue) => {
|
|
165
|
+
setValues((current) => ({
|
|
166
|
+
...current,
|
|
167
|
+
size: { height: current.size.height, width: Number(newValue) },
|
|
168
|
+
}));
|
|
169
|
+
}, [setValues]);
|
|
170
|
+
const onWidthDirectlyChanged = (0, react_1.useCallback)((newWidth) => {
|
|
171
|
+
setValues((current) => ({
|
|
172
|
+
...current,
|
|
173
|
+
size: { height: current.size.height, width: newWidth },
|
|
174
|
+
}));
|
|
175
|
+
}, [setValues]);
|
|
176
|
+
const onHeightChanged = (0, react_1.useCallback)((newValue) => {
|
|
177
|
+
setValues((current) => ({
|
|
178
|
+
...current,
|
|
179
|
+
size: { height: Number(newValue), width: current.size.width },
|
|
180
|
+
}));
|
|
181
|
+
}, [setValues]);
|
|
182
|
+
const onHeightDirectlyChanged = (0, react_1.useCallback)((newHeight) => {
|
|
183
|
+
setValues((current) => ({
|
|
184
|
+
...current,
|
|
185
|
+
size: { height: newHeight, width: current.size.width },
|
|
186
|
+
}));
|
|
187
|
+
}, [setValues]);
|
|
188
|
+
const onNameChange = (0, react_1.useCallback)((event) => {
|
|
189
|
+
setValues((current) => ({ ...current, id: event.target.value }));
|
|
190
|
+
}, [setValues]);
|
|
191
|
+
const onTextFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
192
|
+
setValues((current) => ({ ...current, fps: Number(newFps) }));
|
|
193
|
+
}, [setValues]);
|
|
194
|
+
const onFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
195
|
+
setValues((current) => ({ ...current, fps: newFps }));
|
|
196
|
+
}, [setValues]);
|
|
197
|
+
const setDurationInFrames = (0, react_1.useCallback)((update) => {
|
|
198
|
+
setValues((current) => ({
|
|
199
|
+
...current,
|
|
200
|
+
durationInFrames: typeof update === 'function'
|
|
201
|
+
? update(current.durationInFrames)
|
|
202
|
+
: update,
|
|
203
|
+
}));
|
|
204
|
+
}, [setValues]);
|
|
205
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
206
|
+
jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
207
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Folder" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: folderValues, selectedId: selectedFolderId, style: folderSelectStyle, title: "Folder" }) })
|
|
208
|
+
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
209
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
210
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: values.id, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), nameValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
211
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: nameValidationMessage, type: "error" })
|
|
212
|
+
] })) : null] }) })
|
|
213
|
+
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
214
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
215
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": "Width", type: "number", value: values.size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (width) => `${width}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), widthValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
216
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: widthValidationMessage, type: "error" })
|
|
217
|
+
] })) : null] }) })
|
|
218
|
+
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
219
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
220
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": "Height", type: "number", value: values.size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (height) => `${height}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), heightValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
221
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: heightValidationMessage, type: "error" })
|
|
222
|
+
] })) : null] }) })
|
|
223
|
+
] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: values.durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
224
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": "FPS", type: "number", value: values.fps, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })
|
|
225
|
+
] })
|
|
226
|
+
] }));
|
|
227
|
+
};
|
|
228
|
+
exports.NewCompositionFields = NewCompositionFields;
|
|
33
229
|
const NewCompositionLoaded = ({ canvasCapture, folderName, parentName, stack }) => {
|
|
34
230
|
var _a;
|
|
35
231
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
@@ -39,7 +235,16 @@ const NewCompositionLoaded = ({ canvasCapture, folderName, parentName, stack })
|
|
|
39
235
|
? resolvedComposition.result
|
|
40
236
|
: null;
|
|
41
237
|
const initialDimensions = (0, get_new_composition_defaults_1.getNewCompositionDefaults)(initialComposition, (_a = canvasCapture === null || canvasCapture === void 0 ? void 0 : canvasCapture.durationInSeconds) !== null && _a !== void 0 ? _a : null);
|
|
42
|
-
const [
|
|
238
|
+
const [values, setValues] = (0, react_1.useState)(() => ({
|
|
239
|
+
durationInFrames: initialDimensions.durationInFrames,
|
|
240
|
+
folder: { folderName, parentName, stack },
|
|
241
|
+
fps: initialDimensions.fps,
|
|
242
|
+
id: (0, use_create_composition_1.getUniqueCompositionName)(compositions),
|
|
243
|
+
size: {
|
|
244
|
+
height: initialDimensions.height,
|
|
245
|
+
width: initialDimensions.width,
|
|
246
|
+
},
|
|
247
|
+
}));
|
|
43
248
|
const inputRef = (0, react_1.useRef)(null);
|
|
44
249
|
(0, react_1.useEffect)(() => {
|
|
45
250
|
const input = inputRef.current;
|
|
@@ -47,61 +252,14 @@ const NewCompositionLoaded = ({ canvasCapture, folderName, parentName, stack })
|
|
|
47
252
|
return;
|
|
48
253
|
input.select();
|
|
49
254
|
}, []);
|
|
50
|
-
const
|
|
51
|
-
const [size, setSize] = (0, react_1.useState)(() => ({
|
|
52
|
-
width: initialDimensions.width,
|
|
53
|
-
height: initialDimensions.height,
|
|
54
|
-
}));
|
|
55
|
-
const [durationInFrames, setDurationInFrames] = (0, react_1.useState)(initialDimensions.durationInFrames);
|
|
56
|
-
const onWidthChanged = (0, react_1.useCallback)((newValue) => {
|
|
57
|
-
setSize((s) => {
|
|
58
|
-
return {
|
|
59
|
-
height: s.height,
|
|
60
|
-
width: Number(newValue),
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
}, []);
|
|
64
|
-
const onWidthDirectlyChanged = (0, react_1.useCallback)((newWidth) => {
|
|
65
|
-
setSize((s) => {
|
|
66
|
-
return {
|
|
67
|
-
height: s.height,
|
|
68
|
-
width: newWidth,
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
}, []);
|
|
72
|
-
const onHeightDirectlyChanged = (0, react_1.useCallback)((newHeight) => {
|
|
73
|
-
setSize((s) => {
|
|
74
|
-
return {
|
|
75
|
-
width: s.width,
|
|
76
|
-
height: newHeight,
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
}, []);
|
|
80
|
-
const onHeightChanged = (0, react_1.useCallback)((newValue) => {
|
|
81
|
-
setSize((s) => {
|
|
82
|
-
return {
|
|
83
|
-
width: s.width,
|
|
84
|
-
height: Number(newValue),
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
}, []);
|
|
88
|
-
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
89
|
-
setName(e.target.value);
|
|
90
|
-
}, []);
|
|
91
|
-
const onTextFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
92
|
-
setFrameRate(Number(newFps));
|
|
93
|
-
}, []);
|
|
94
|
-
const onFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
95
|
-
setFrameRate(newFps);
|
|
96
|
-
}, []);
|
|
97
|
-
const { codemod, createComposition, heightValidationMessage: compHeightErrMessage, nameValidationMessage: compNameErrMessage, valid, widthValidationMessage: compWidthErrMessage, } = (0, use_create_composition_1.useCreateComposition)({
|
|
255
|
+
const { codemod, createComposition, heightValidationMessage, nameValidationMessage, valid, widthValidationMessage, } = (0, use_create_composition_1.useCreateComposition)({
|
|
98
256
|
compositions,
|
|
99
|
-
durationInFrames,
|
|
100
|
-
folderName,
|
|
101
|
-
newId,
|
|
102
|
-
parentName,
|
|
103
|
-
selectedFrameRate,
|
|
104
|
-
size,
|
|
257
|
+
durationInFrames: values.durationInFrames,
|
|
258
|
+
folderName: values.folder.folderName,
|
|
259
|
+
newId: values.id,
|
|
260
|
+
parentName: values.folder.parentName,
|
|
261
|
+
selectedFrameRate: values.fps,
|
|
262
|
+
size: values.size,
|
|
105
263
|
canvasCapture: canvasCapture === null
|
|
106
264
|
? null
|
|
107
265
|
: {
|
|
@@ -134,30 +292,9 @@ const NewCompositionLoaded = ({ canvasCapture, folderName, parentName, stack })
|
|
|
134
292
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
135
293
|
e.preventDefault();
|
|
136
294
|
}, []);
|
|
137
|
-
const folderPath = [parentName, folderName].filter(Boolean).join('/');
|
|
138
295
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
139
296
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: canvasCapture === null ? 'New composition' : 'Import Canvas Capture' }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
140
|
-
jsx_runtime_1.
|
|
141
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Folder" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx("span", { style: folderPathStyle, children: folderPath }) })
|
|
142
|
-
] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
143
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
144
|
-
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
145
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })
|
|
146
|
-
] })) : null] }) })
|
|
147
|
-
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
148
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
149
|
-
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
150
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })
|
|
151
|
-
] })) : null] }) })
|
|
152
|
-
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
153
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
154
|
-
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
155
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })
|
|
156
|
-
] })) : null] }) })
|
|
157
|
-
] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
158
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })
|
|
159
|
-
] })
|
|
160
|
-
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: null, errorNotification: "Could not create composition", genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => createCanvasCaptureComposition({
|
|
297
|
+
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsx(exports.NewCompositionFields, { heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: nameValidationMessage, setValues: setValues, values: values, widthValidationMessage: widthValidationMessage }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: null, errorNotification: "Could not create composition", genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: values.folder.stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => createCanvasCaptureComposition({
|
|
161
298
|
signal,
|
|
162
299
|
symbolicatedStack,
|
|
163
300
|
}), applyCodemodForPreview: null, fallbackToRootFile: true }) })
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OpenIssueButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const colors_1 = require("
|
|
6
|
+
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const svgStyle = {
|
|
8
8
|
width: '11px',
|
|
9
9
|
height: '11px',
|
|
@@ -11,7 +11,7 @@ const ellipsis_1 = require("../../icons/ellipsis");
|
|
|
11
11
|
const modals_1 = require("../../state/modals");
|
|
12
12
|
const InlineDropdown_1 = require("../InlineDropdown");
|
|
13
13
|
const quickSwitcherArea = {
|
|
14
|
-
padding: '4px 8px',
|
|
14
|
+
padding: '4px 4px 4px 8px',
|
|
15
15
|
borderBottom: `1px solid ${colors_1.BLACK_HEX}`,
|
|
16
16
|
display: 'flex',
|
|
17
17
|
alignItems: 'center',
|
|
@@ -28,6 +28,7 @@ const quickSwitcherTrigger = {
|
|
|
28
28
|
border: 'none',
|
|
29
29
|
flex: 1,
|
|
30
30
|
appearance: 'none',
|
|
31
|
+
userSelect: 'none',
|
|
31
32
|
...(0, hoverable_1.hoverableStyle)({
|
|
32
33
|
idleBackground: colors_1.WHITE_ALPHA_06,
|
|
33
34
|
hoverBackground: colors_1.WHITE_ALPHA_06,
|
|
@@ -27,6 +27,10 @@ const input = {
|
|
|
27
27
|
width: '100%',
|
|
28
28
|
borderRadius: 4,
|
|
29
29
|
};
|
|
30
|
+
const touchscreenInput = {
|
|
31
|
+
...input,
|
|
32
|
+
fontSize: 16,
|
|
33
|
+
};
|
|
30
34
|
const modeSelector = {
|
|
31
35
|
paddingLeft: 16,
|
|
32
36
|
paddingRight: 16,
|
|
@@ -42,6 +46,7 @@ const modeItem = {
|
|
|
42
46
|
padding: 0,
|
|
43
47
|
fontSize: 13,
|
|
44
48
|
cursor: 'pointer',
|
|
49
|
+
userSelect: 'none',
|
|
45
50
|
};
|
|
46
51
|
const modeInactive = {
|
|
47
52
|
...modeItem,
|
|
@@ -126,6 +131,7 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio
|
|
|
126
131
|
});
|
|
127
132
|
}, [assetSelection, compositionSelection, initialMode, invocationTimestamp]);
|
|
128
133
|
const inputRef = (0, react_1.useRef)(null);
|
|
134
|
+
const isTouchscreen = navigator.maxTouchPoints > 0;
|
|
129
135
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
130
136
|
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
131
137
|
const closeMenu = (0, react_1.useCallback)(() => undefined, []);
|
|
@@ -314,39 +320,41 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio
|
|
|
314
320
|
setState({ query: e.target.value, selectedIndex: 0 });
|
|
315
321
|
}, []);
|
|
316
322
|
const selectedIndexRounded = (0, shared_1.loopIndex)(state.selectedIndex, resultsArray.length);
|
|
317
|
-
const
|
|
323
|
+
const focusInput = (0, react_1.useCallback)(() => {
|
|
318
324
|
var _a;
|
|
325
|
+
if (!isTouchscreen) {
|
|
326
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
327
|
+
}
|
|
328
|
+
}, [isTouchscreen]);
|
|
329
|
+
const onActionsSelected = (0, react_1.useCallback)(() => {
|
|
319
330
|
setState((s) => ({
|
|
320
331
|
query: `> ${stripQuery(s.query)}`,
|
|
321
332
|
selectedIndex: 0,
|
|
322
333
|
}));
|
|
323
|
-
(
|
|
324
|
-
}, []);
|
|
334
|
+
focusInput();
|
|
335
|
+
}, [focusInput]);
|
|
325
336
|
const onCompositionsSelected = (0, react_1.useCallback)(() => {
|
|
326
|
-
var _a;
|
|
327
337
|
setState((s) => ({
|
|
328
338
|
query: stripQuery(s.query),
|
|
329
339
|
selectedIndex: 0,
|
|
330
340
|
}));
|
|
331
|
-
(
|
|
332
|
-
}, []);
|
|
341
|
+
focusInput();
|
|
342
|
+
}, [focusInput]);
|
|
333
343
|
const onAssetsSelected = (0, react_1.useCallback)(() => {
|
|
334
|
-
var _a;
|
|
335
344
|
setState((s) => ({
|
|
336
345
|
query: `$ ${stripQuery(s.query)}`,
|
|
337
346
|
selectedIndex: 0,
|
|
338
347
|
}));
|
|
339
|
-
(
|
|
340
|
-
}, []);
|
|
348
|
+
focusInput();
|
|
349
|
+
}, [focusInput]);
|
|
341
350
|
const onDocSearchSelected = (0, react_1.useCallback)(() => {
|
|
342
|
-
var _a;
|
|
343
351
|
setState((s) => ({
|
|
344
352
|
query: `? ${stripQuery(s.query)}`,
|
|
345
353
|
selectedIndex: 0,
|
|
346
354
|
}));
|
|
347
355
|
setDocResults({ type: 'initial' });
|
|
348
|
-
(
|
|
349
|
-
}, []);
|
|
356
|
+
focusInput();
|
|
357
|
+
}, [focusInput]);
|
|
350
358
|
const showSearchLoadingState = mode === 'docs' && docResults.type === 'loading';
|
|
351
359
|
const showEmptyDocSearch = mode === 'docs' && actualQuery.trim() === '';
|
|
352
360
|
const placeholder = mode === 'assets'
|
|
@@ -360,7 +368,7 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio
|
|
|
360
368
|
jsx_runtime_1.jsx("button", { onClick: onCompositionsSelected, style: mode === 'compositions' ? modeActive : modeInactive, type: "button", children: "Compositions" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("button", { onClick: onAssetsSelected, style: mode === 'assets' ? modeActive : modeInactive, type: "button", children: "Assets" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("button", { onClick: onActionsSelected, style: mode === 'commands' ? modeActive : modeInactive, type: "button", children: "Actions" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("button", { onClick: onDocSearchSelected, style: mode === 'docs' ? modeActive : modeInactive, type: "button", children: "Documentation" })
|
|
361
369
|
] })), jsx_runtime_1.jsx("div", { style: assetSelection === null && compositionSelection === null
|
|
362
370
|
? content
|
|
363
|
-
: contentWithoutModeSelector, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, type: "text", style: input, autoFocus:
|
|
371
|
+
: contentWithoutModeSelector, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, type: "text", style: isTouchscreen ? touchscreenInput : input, autoFocus: !isTouchscreen, status: "ok", value: state.query, onChange: onTextChange, placeholder: placeholder, rightAlign: false }) }), jsx_runtime_1.jsx("div", { style: results, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: showEmptyDocSearch ||
|
|
364
372
|
showSearchLoadingState ? null : resultsArray.length === 0 ? (jsx_runtime_1.jsx(NoResults_1.QuickSwitcherNoResults, { mode: mode, query: actualQuery })) : (resultsArray.map((result, i) => {
|
|
365
373
|
return (jsx_runtime_1.jsx(QuickSwitcherResult_1.QuickSwitcherResult, { selected: selectedIndexRounded === i, result: result }, result.id));
|
|
366
374
|
})) })
|
|
@@ -109,6 +109,7 @@ export declare const applyCodemod: ({ codemod, dryRun, symbolicatedStack, signal
|
|
|
109
109
|
export declare const removeRenderJob: (job: RenderJob) => Promise<undefined>;
|
|
110
110
|
export declare const cancelRenderJob: (job: RenderJob) => Promise<import("@remotion/studio-shared").CancelRenderResponse>;
|
|
111
111
|
export declare const updateAvailable: (signal: AbortSignal) => Promise<import("@remotion/studio-shared").UpdateAvailableResponse>;
|
|
112
|
+
export declare const getReleaseNotes: (currentVersion: string, latestVersion: string, signal: AbortSignal) => Promise<import("@remotion/studio-shared").GetReleaseNotesResponse>;
|
|
112
113
|
export declare const getProjectInfo: (signal: AbortSignal) => Promise<import("@remotion/studio-shared").ProjectInfoResponse>;
|
|
113
114
|
export declare const callUpdateDefaultPropsApi: (compositionId: string, defaultProps: Record<string, unknown>, enumPaths: EnumPath[]) => Promise<import("@remotion/studio-shared").UpdateDefaultPropsResponse>;
|
|
114
115
|
export declare const applyVisualControlChange: ({ fileName, changes, }: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyVisualControlChange = exports.callUpdateDefaultPropsApi = exports.getProjectInfo = exports.updateAvailable = exports.cancelRenderJob = exports.removeRenderJob = exports.applyCodemod = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addSequenceRenderJob = exports.addStillRenderJob = void 0;
|
|
3
|
+
exports.applyVisualControlChange = exports.callUpdateDefaultPropsApi = exports.getProjectInfo = exports.getReleaseNotes = exports.updateAvailable = exports.cancelRenderJob = exports.removeRenderJob = exports.applyCodemod = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addSequenceRenderJob = exports.addStillRenderJob = void 0;
|
|
4
4
|
const no_react_1 = require("remotion/no-react");
|
|
5
5
|
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
6
6
|
const call_api_1 = require("../call-api");
|
|
@@ -166,6 +166,10 @@ const updateAvailable = (signal) => {
|
|
|
166
166
|
return (0, call_api_1.callApi)('/api/update-available', {}, signal);
|
|
167
167
|
};
|
|
168
168
|
exports.updateAvailable = updateAvailable;
|
|
169
|
+
const getReleaseNotes = (currentVersion, latestVersion, signal) => {
|
|
170
|
+
return (0, call_api_1.callApi)('/api/release-notes', { currentVersion, latestVersion }, signal);
|
|
171
|
+
};
|
|
172
|
+
exports.getReleaseNotes = getReleaseNotes;
|
|
169
173
|
const getProjectInfo = (signal) => {
|
|
170
174
|
return (0, call_api_1.callApi)('/api/project-info', {}, signal);
|
|
171
175
|
};
|
|
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
40
40
|
const colors_1 = require("../helpers/colors");
|
|
41
|
+
const is_mac_1 = require("../helpers/is-mac");
|
|
41
42
|
const pointer_session_1 = require("../helpers/pointer-session");
|
|
42
43
|
const editor_snapping_1 = require("../state/editor-snapping");
|
|
43
44
|
const canvas_rotation_cursor_1 = require("./canvas-rotation-cursor");
|
|
@@ -57,9 +58,34 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
57
58
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
58
59
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
59
60
|
const { editorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
61
|
+
const [commandKeyPressed, setCommandKeyPressed] = react_1.default.useState(false);
|
|
60
62
|
const cursor = transform3DMode
|
|
61
63
|
? canvas_rotation_cursor_1.canvasRotationCursor
|
|
62
64
|
: canvas2DRotationCursor;
|
|
65
|
+
react_1.default.useEffect(() => {
|
|
66
|
+
const commandKey = is_mac_1.isMac ? 'Meta' : 'Control';
|
|
67
|
+
const onKeyDown = (event) => {
|
|
68
|
+
if (event.key === commandKey) {
|
|
69
|
+
setCommandKeyPressed(true);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const onKeyUp = (event) => {
|
|
73
|
+
if (event.key === commandKey) {
|
|
74
|
+
setCommandKeyPressed(false);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const onBlur = () => {
|
|
78
|
+
setCommandKeyPressed(false);
|
|
79
|
+
};
|
|
80
|
+
window.addEventListener('keydown', onKeyDown);
|
|
81
|
+
window.addEventListener('keyup', onKeyUp);
|
|
82
|
+
window.addEventListener('blur', onBlur);
|
|
83
|
+
return () => {
|
|
84
|
+
window.removeEventListener('keydown', onKeyDown);
|
|
85
|
+
window.removeEventListener('keyup', onKeyUp);
|
|
86
|
+
window.removeEventListener('blur', onBlur);
|
|
87
|
+
};
|
|
88
|
+
}, []);
|
|
63
89
|
const onPointerDown = react_1.default.useCallback((event) => {
|
|
64
90
|
var _a, _b;
|
|
65
91
|
if (event.button !== 0) {
|
|
@@ -241,6 +267,6 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
241
267
|
setDragOverrides,
|
|
242
268
|
setPropStatuses,
|
|
243
269
|
]);
|
|
244
|
-
return (jsx_runtime_1.jsx("polygon", { points: outline.points.map((point) => `${point.x},${point.y}`).join(' '), fill: colors_1.TRANSPARENT, pointerEvents:
|
|
270
|
+
return (jsx_runtime_1.jsx("polygon", { points: outline.points.map((point) => `${point.x},${point.y}`).join(' '), fill: colors_1.TRANSPARENT, pointerEvents: commandKeyPressed ? 'none' : 'all', cursor: commandKeyPressed ? 'default' : cursor, onPointerDown: onPointerDown, "data-remotion-studio-canvas-rotation": true }));
|
|
245
271
|
};
|
|
246
272
|
exports.SelectedOutlineCanvasRotation = SelectedOutlineCanvasRotation;
|
|
@@ -362,6 +362,7 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
362
362
|
};
|
|
363
363
|
}, [onContextMenuOpen, outline.key, registerContextMenuOpen]);
|
|
364
364
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
365
|
-
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, containsSelection: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) === true, directlySelected: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selected) === true, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false
|
|
365
|
+
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, containsSelection: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) === true, directlySelected: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selected) === true, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false, translateWithCommandKey: (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) === true &&
|
|
366
|
+
Boolean(controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) && (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) ? (jsx_runtime_1.jsx(SelectedOutlineCanvasRotation_1.SelectedOutlineCanvasRotation, { getLatestTargetByKey: getLatestTargetByKey, layoutTarget: layoutTarget, onDraggingChange: onDraggingChange, outline: outline, transform3DMode: controlTarget.rotationDrag.transform3DMode })) : null] }));
|
|
366
367
|
};
|
|
367
368
|
exports.SelectedOutlineElement = react_1.default.memo(SelectedOutlineElementUnmemoized);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CanvasSelectableOutline } from '@remotion/canvas';
|
|
2
1
|
import type React from 'react';
|
|
2
|
+
import type { getSequencesWithSelectableOutlines } from './selected-outline-measurement';
|
|
3
3
|
import { type SelectedOutlineTarget } from './selected-outline-types';
|
|
4
4
|
export declare const SelectedOutlineKeyboardControls: React.FC<{
|
|
5
5
|
readonly getLatestOutlineTargetByKey: (key: string) => SelectedOutlineTarget | undefined;
|
|
6
|
-
readonly getSelectableOutlines: () =>
|
|
6
|
+
readonly getSelectableOutlines: () => ReturnType<typeof getSequencesWithSelectableOutlines>;
|
|
7
7
|
}>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { orderOutlinesForRendering } from './selected-outline-order';
|
|
3
|
+
export { orderOutlinesForRendering };
|
|
2
4
|
export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutline3DRotationDragValues, getSelectedOutlineActiveSchema, getSelectedOutlineCropDragChanges, getSelectedOutlineCropDragValues, getSelectedOutlineCropFollowingTransformOrigin, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginDragChanges, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold, selectedOutlineTransformOriginSnapThresholdPx, selectedOutlineUvSnapThresholdPx, snapSelectedOutlineRotationDeltaDegrees, snapSelectedOutlineTransformOriginUv, snapSelectedOutlineUv, } from './selected-outline-drag';
|
|
3
|
-
export { getOutlineSelectionInteraction, getSelectedCropInfo, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, } from './selected-outline-measurement';
|
|
5
|
+
export { getOutlineSelectionInteraction, getSelectedCropInfo, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
|
|
4
6
|
export { selectedOutlineDragThresholdPx } from './selected-outline-types';
|
|
5
7
|
export type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineScaleDragState, } from './selected-outline-types';
|
|
6
8
|
type SelectedOutlineOverlayProps = {
|