@remotion/studio 4.0.483 → 4.0.485
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ColorPicker/ColorPicker.js +65 -3
- package/dist/components/ColorPicker/ColorPickerPopup.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPickerPopup.js +3 -2
- package/dist/components/ContextMenu.js +75 -1
- package/dist/components/CurrentComposition.js +3 -2
- package/dist/components/InlineCompositionName.d.ts +7 -0
- package/dist/components/InlineCompositionName.js +58 -0
- package/dist/components/InlineEditableTitle.d.ts +7 -0
- package/dist/components/InlineEditableTitle.js +129 -0
- package/dist/components/InspectorPanel/EasingInspector.js +184 -10
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.d.ts +14 -0
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +146 -0
- package/dist/components/InspectorPanel/KeyframeInspector.d.ts +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +229 -5
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +17 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +80 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -58
- package/dist/components/InspectorPanel/common.d.ts +12 -0
- package/dist/components/InspectorPanel/common.js +78 -1
- package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +14 -0
- package/dist/components/InspectorPanel/easing-inspector-selection.js +18 -0
- package/dist/components/InspectorPanel/keyframe-easing-navigator-items.d.ts +24 -0
- package/dist/components/InspectorPanel/keyframe-easing-navigator-items.js +40 -0
- package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +8 -0
- package/dist/components/InspectorPanel/keyframe-inspector-frame.js +14 -0
- package/dist/components/InspectorPanel/styles.d.ts +1 -0
- package/dist/components/InspectorPanel/styles.js +9 -3
- package/dist/components/InspectorSequenceSection.js +37 -10
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +7 -1
- package/dist/components/NewComposition/CodemodFooter.js +17 -12
- package/dist/components/NewComposition/DeleteComposition.js +7 -1
- package/dist/components/NewComposition/DeleteFolder.js +7 -1
- package/dist/components/NewComposition/DuplicateComposition.js +17 -10
- package/dist/components/NewComposition/InputAndValidationContainer.d.ts +3 -0
- package/dist/components/NewComposition/InputAndValidationContainer.js +15 -0
- package/dist/components/NewComposition/NewCompDuration.js +7 -6
- package/dist/components/NewComposition/NewComposition.d.ts +5 -1
- package/dist/components/NewComposition/NewComposition.js +29 -86
- package/dist/components/NewComposition/RenameComposition.js +13 -14
- package/dist/components/NewComposition/RenameFolder.js +9 -2
- package/dist/components/NewComposition/RenameStaticFile.js +2 -1
- package/dist/components/NewComposition/ValidationMessage.js +9 -1
- package/dist/components/OptionsPanel.d.ts +0 -3
- package/dist/components/OptionsPanel.js +7 -3
- package/dist/components/Preview.js +1 -1
- package/dist/components/RenderModal/ServerRenderModal.js +4 -3
- package/dist/components/RenderModal/WebRenderModal.js +2 -1
- package/dist/components/SelectedOutlineElement.js +45 -3
- package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
- package/dist/components/SelectedOutlineOverlay.js +48 -15
- package/dist/components/Timeline/EasingEditorModal.js +9 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +45 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +82 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -1
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframeControls.js +38 -7
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +4 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +12 -6
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +13 -62
- package/dist/components/Timeline/TimelineSequenceName.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceName.js +7 -6
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +86 -4
- package/dist/components/Timeline/TimelineSlider.js +17 -3
- package/dist/components/Timeline/TimelineTextContentField.d.ts +12 -0
- package/dist/components/Timeline/TimelineTextContentField.js +100 -0
- package/dist/components/Timeline/TimelineWidthProvider.js +18 -3
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +8 -2
- package/dist/components/Timeline/delete-selected-timeline-item.js +80 -1
- package/dist/components/Timeline/focus-inspector-field.d.ts +16 -0
- package/dist/components/Timeline/focus-inspector-field.js +49 -0
- package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +18 -0
- package/dist/components/Timeline/get-animation-item-selection-for-frame.js +49 -0
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +15 -0
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +26 -0
- package/dist/components/Timeline/save-sequence-prop.js +2 -0
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +38 -0
- package/dist/components/Timeline/split-selected-timeline-item.js +156 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +2 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +1 -0
- package/dist/components/Timeline/update-selected-easing.js +4 -3
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
- package/dist/components/Timeline/use-rename-sequence.d.ts +30 -0
- package/dist/components/Timeline/use-rename-sequence.js +115 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
- package/dist/components/Timeline/use-timeline-height.js +1 -0
- package/dist/components/composition-menu-items.js +3 -0
- package/dist/components/folder-menu-items.js +20 -0
- package/dist/components/options-sidebar-tabs.d.ts +4 -0
- package/dist/components/options-sidebar-tabs.js +5 -0
- package/dist/components/selected-outline-types.d.ts +6 -1
- package/dist/esm/{chunk-fq0j774v.js → chunk-103pp4n7.js} +17652 -15098
- package/dist/esm/internals.mjs +17652 -15098
- package/dist/esm/previewEntry.mjs +18357 -15803
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/render-codec-label.d.ts +1 -1
- package/dist/helpers/timeline-layout.d.ts +4 -3
- package/dist/helpers/timeline-layout.js +3 -1
- package/dist/helpers/use-create-composition.d.ts +35 -0
- package/dist/helpers/use-create-composition.js +111 -0
- package/dist/helpers/use-menu-structure.js +0 -14
- package/dist/helpers/use-rename-composition.d.ts +16 -0
- package/dist/helpers/use-rename-composition.js +49 -0
- package/dist/state/modals.d.ts +3 -0
- package/dist/state/timeline-zoom.js +17 -14
- package/dist/state/z-index.d.ts +1 -0
- package/dist/state/z-index.js +11 -2
- package/package.json +12 -12
|
@@ -4,14 +4,14 @@ exports.NewComposition = 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
|
-
const
|
|
8
|
-
const validate_new_comp_data_1 = require("../../helpers/validate-new-comp-data");
|
|
7
|
+
const use_create_composition_1 = require("../../helpers/use-create-composition");
|
|
9
8
|
const layout_1 = require("../layout");
|
|
10
9
|
const ModalFooter_1 = require("../ModalFooter");
|
|
11
10
|
const ModalHeader_1 = require("../ModalHeader");
|
|
12
11
|
const layout_2 = require("../RenderModal/layout");
|
|
13
12
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
14
13
|
const DismissableModal_1 = require("./DismissableModal");
|
|
14
|
+
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
15
15
|
const InputDragger_1 = require("./InputDragger");
|
|
16
16
|
const NewCompDuration_1 = require("./NewCompDuration");
|
|
17
17
|
const RemInput_1 = require("./RemInput");
|
|
@@ -23,49 +23,9 @@ const content = {
|
|
|
23
23
|
fontSize: 13,
|
|
24
24
|
minWidth: 500,
|
|
25
25
|
};
|
|
26
|
-
const
|
|
27
|
-
var _a;
|
|
28
|
-
const words = (_a = value.match(/[a-zA-Z0-9]+/g)) !== null && _a !== void 0 ? _a : [];
|
|
29
|
-
const candidate = words
|
|
30
|
-
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)
|
|
31
|
-
.join('');
|
|
32
|
-
if (!candidate) {
|
|
33
|
-
return 'NewComposition';
|
|
34
|
-
}
|
|
35
|
-
if (/^[0-9]/.test(candidate)) {
|
|
36
|
-
return `Composition${candidate}`;
|
|
37
|
-
}
|
|
38
|
-
return candidate;
|
|
39
|
-
};
|
|
40
|
-
const waitForComposition = (compositionId) => {
|
|
41
|
-
return new Promise((resolve) => {
|
|
42
|
-
const started = Date.now();
|
|
43
|
-
const interval = window.setInterval(() => {
|
|
44
|
-
var _a;
|
|
45
|
-
var _b;
|
|
46
|
-
const compositionNames = (_b = (_a = window.remotion_getCompositionNames) === null || _a === void 0 ? void 0 : _a.call(window)) !== null && _b !== void 0 ? _b : [];
|
|
47
|
-
if (compositionNames.includes(compositionId) ||
|
|
48
|
-
Date.now() - started > 10000) {
|
|
49
|
-
window.clearInterval(interval);
|
|
50
|
-
resolve();
|
|
51
|
-
}
|
|
52
|
-
}, 100);
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
const getUniqueCompositionName = (compositions) => {
|
|
56
|
-
let counter = 1;
|
|
57
|
-
while (true) {
|
|
58
|
-
const name = counter === 1 ? 'NewComposition' : `NewComposition${counter}`;
|
|
59
|
-
const err = (0, validate_new_comp_data_1.validateCompositionName)(name, compositions);
|
|
60
|
-
if (!err) {
|
|
61
|
-
return name;
|
|
62
|
-
}
|
|
63
|
-
counter++;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const NewCompositionLoaded = () => {
|
|
26
|
+
const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
67
27
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
68
|
-
const [newId, setName] = (0, react_1.useState)(() => getUniqueCompositionName(compositions));
|
|
28
|
+
const [newId, setName] = (0, react_1.useState)(() => (0, use_create_composition_1.getUniqueCompositionName)(compositions));
|
|
69
29
|
const [selectedFrameRate, setFrameRate] = (0, react_1.useState)(30);
|
|
70
30
|
const [size, setSize] = (0, react_1.useState)(() => ({
|
|
71
31
|
width: 1920,
|
|
@@ -113,66 +73,49 @@ const NewCompositionLoaded = () => {
|
|
|
113
73
|
const onFpsChange = (0, react_1.useCallback)((newFps) => {
|
|
114
74
|
setFrameRate(newFps);
|
|
115
75
|
}, []);
|
|
116
|
-
const compNameErrMessage = (0,
|
|
117
|
-
|
|
118
|
-
const compHeightErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Height', size.height);
|
|
119
|
-
const componentName = toPascalCase(newId);
|
|
120
|
-
const valid = compNameErrMessage === null &&
|
|
121
|
-
compWidthErrMessage === null &&
|
|
122
|
-
compHeightErrMessage === null;
|
|
123
|
-
const codemod = (0, react_1.useMemo)(() => {
|
|
124
|
-
return {
|
|
125
|
-
type: 'new-composition',
|
|
126
|
-
newDurationInFrames: Number(durationInFrames),
|
|
127
|
-
newFps: Number(selectedFrameRate),
|
|
128
|
-
newHeight: Number(size.height),
|
|
129
|
-
newWidth: Number(size.width),
|
|
130
|
-
newId,
|
|
131
|
-
componentName,
|
|
132
|
-
componentImportPath: `./${componentName}`,
|
|
133
|
-
};
|
|
134
|
-
}, [
|
|
135
|
-
componentName,
|
|
76
|
+
const { codemod, createComposition, heightValidationMessage: compHeightErrMessage, nameValidationMessage: compNameErrMessage, valid, widthValidationMessage: compWidthErrMessage, } = (0, use_create_composition_1.useCreateComposition)({
|
|
77
|
+
compositions,
|
|
136
78
|
durationInFrames,
|
|
79
|
+
folderName,
|
|
137
80
|
newId,
|
|
81
|
+
parentName,
|
|
138
82
|
selectedFrameRate,
|
|
139
|
-
size
|
|
140
|
-
|
|
141
|
-
]);
|
|
142
|
-
const onSuccess = (0, react_1.useCallback)(() => {
|
|
143
|
-
waitForComposition(newId).then(() => {
|
|
144
|
-
(0, url_state_1.pushUrl)(`/${newId}`);
|
|
145
|
-
});
|
|
146
|
-
}, [newId]);
|
|
83
|
+
size,
|
|
84
|
+
});
|
|
147
85
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
148
86
|
e.preventDefault();
|
|
149
87
|
}, []);
|
|
88
|
+
const folderPath = [parentName, folderName].filter(Boolean).join('/');
|
|
150
89
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
151
90
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "New composition" }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
152
|
-
jsx_runtime_1.jsxs("div", { style: content, children: [
|
|
153
|
-
|
|
154
|
-
|
|
91
|
+
jsx_runtime_1.jsxs("div", { style: content, children: [folderPath ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
92
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Folder" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: folderPath })
|
|
93
|
+
] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
94
|
+
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: [
|
|
155
95
|
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { 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: [
|
|
156
96
|
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" })
|
|
157
97
|
] })) : null] }) })
|
|
158
98
|
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
159
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
99
|
+
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: [
|
|
100
|
+
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: [
|
|
101
|
+
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" })
|
|
102
|
+
] })) : null] }) })
|
|
163
103
|
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
164
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
104
|
+
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: [
|
|
105
|
+
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: [
|
|
106
|
+
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" })
|
|
107
|
+
] })) : null] }) })
|
|
168
108
|
] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
169
109
|
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 }) })
|
|
170
110
|
] })
|
|
171
|
-
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: "Creating composition...", errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack:
|
|
111
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: "Creating composition...", errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => createComposition({
|
|
112
|
+
signal,
|
|
113
|
+
symbolicatedStack,
|
|
114
|
+
}), fallbackToRootFile: true }) })
|
|
172
115
|
] })
|
|
173
116
|
] }));
|
|
174
117
|
};
|
|
175
|
-
const NewComposition = () => {
|
|
176
|
-
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { children: jsx_runtime_1.jsx(NewCompositionLoaded, {}) }));
|
|
118
|
+
const NewComposition = ({ folderName, parentName, stack }) => {
|
|
119
|
+
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { children: jsx_runtime_1.jsx(NewCompositionLoaded, { folderName: folderName, parentName: parentName, stack: stack }) }));
|
|
177
120
|
};
|
|
178
121
|
exports.NewComposition = NewComposition;
|
|
@@ -4,7 +4,7 @@ exports.RenameComposition = 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
|
-
const
|
|
7
|
+
const use_rename_composition_1 = require("../../helpers/use-rename-composition");
|
|
8
8
|
const layout_1 = require("../layout");
|
|
9
9
|
const ModalFooter_1 = require("../ModalFooter");
|
|
10
10
|
const ModalHeader_1 = require("../ModalHeader");
|
|
@@ -12,6 +12,7 @@ const layout_2 = require("../RenderModal/layout");
|
|
|
12
12
|
const ResolveCompositionBeforeModal_1 = require("../RenderModal/ResolveCompositionBeforeModal");
|
|
13
13
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
14
14
|
const DismissableModal_1 = require("./DismissableModal");
|
|
15
|
+
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
15
16
|
const RemInput_1 = require("./RemInput");
|
|
16
17
|
const ValidationMessage_1 = require("./ValidationMessage");
|
|
17
18
|
const content = {
|
|
@@ -43,28 +44,26 @@ const RenameCompositionLoaded = () => {
|
|
|
43
44
|
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
44
45
|
setName(e.target.value);
|
|
45
46
|
}, []);
|
|
46
|
-
const compNameErrMessage =
|
|
47
|
-
|
|
48
|
-
:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
type: 'rename-composition',
|
|
53
|
-
idToRename: resolved.result.id,
|
|
54
|
-
newId,
|
|
55
|
-
};
|
|
56
|
-
}, [newId, resolved.result.id]);
|
|
47
|
+
const { codemod, renameComposition, valid, validationMessage: compNameErrMessage, } = (0, use_rename_composition_1.useRenameComposition)({
|
|
48
|
+
compositions,
|
|
49
|
+
currentId: resolved.result.id,
|
|
50
|
+
newId,
|
|
51
|
+
});
|
|
57
52
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
58
53
|
e.preventDefault();
|
|
59
54
|
}, []);
|
|
60
55
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
61
56
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${resolved.result.id}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
62
57
|
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
63
|
-
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(
|
|
58
|
+
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: [
|
|
64
59
|
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: [
|
|
65
60
|
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" })
|
|
66
61
|
] })) : null] }) })
|
|
67
|
-
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming...', errorNotification: 'Could not rename composition', successNotification: `Renamed to ${newId}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: null })
|
|
62
|
+
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming...', errorNotification: 'Could not rename composition', successNotification: `Renamed to ${newId}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => renameComposition({
|
|
63
|
+
newCompositionId: newId,
|
|
64
|
+
signal,
|
|
65
|
+
symbolicatedStack,
|
|
66
|
+
}) }) })
|
|
68
67
|
] })
|
|
69
68
|
] }));
|
|
70
69
|
};
|
|
@@ -10,8 +10,10 @@ const layout_1 = require("../layout");
|
|
|
10
10
|
const ModalFooter_1 = require("../ModalFooter");
|
|
11
11
|
const ModalHeader_1 = require("../ModalHeader");
|
|
12
12
|
const layout_2 = require("../RenderModal/layout");
|
|
13
|
+
const actions_1 = require("../RenderQueue/actions");
|
|
13
14
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
14
15
|
const DismissableModal_1 = require("./DismissableModal");
|
|
16
|
+
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
15
17
|
const RemInput_1 = require("./RemInput");
|
|
16
18
|
const ValidationMessage_1 = require("./ValidationMessage");
|
|
17
19
|
const content = {
|
|
@@ -56,11 +58,16 @@ const RenameFolder = ({ folderName, parentName, stack }) => {
|
|
|
56
58
|
return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { children: [
|
|
57
59
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${folderId}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
58
60
|
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
59
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(
|
|
61
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
60
62
|
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
61
63
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: folderNameErrMessage, type: "error" })
|
|
62
64
|
] })) : null] }) })
|
|
63
|
-
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming folder...', errorNotification: 'Could not rename folder', successNotification: `Renamed folder to ${newName}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null })
|
|
65
|
+
] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming folder...', errorNotification: 'Could not rename folder', successNotification: `Renamed folder to ${newName}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
|
|
66
|
+
codemod,
|
|
67
|
+
dryRun: false,
|
|
68
|
+
signal,
|
|
69
|
+
symbolicatedStack,
|
|
70
|
+
}) }) })
|
|
64
71
|
] })
|
|
65
72
|
] }));
|
|
66
73
|
};
|
|
@@ -15,6 +15,7 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
|
15
15
|
const layout_2 = require("../RenderModal/layout");
|
|
16
16
|
const use_static_files_1 = require("../use-static-files");
|
|
17
17
|
const DismissableModal_1 = require("./DismissableModal");
|
|
18
|
+
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
18
19
|
const RemInput_1 = require("./RemInput");
|
|
19
20
|
const ValidationMessage_1 = require("./ValidationMessage");
|
|
20
21
|
const content = {
|
|
@@ -115,7 +116,7 @@ const RenameStaticFileModal = ({ relativePath }) => {
|
|
|
115
116
|
return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { children: [
|
|
116
117
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${relativePath}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
117
118
|
jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
118
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(
|
|
119
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
119
120
|
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, autoComplete: "off", "data-1p-ignore": true, placeholder: "Asset name", status: validationMessage ? 'error' : 'ok', rightAlign: true }), validationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
120
121
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: validationMessage, type: "error" })
|
|
121
122
|
] })) : null] }) })
|
|
@@ -20,12 +20,20 @@ const compactStyle = {
|
|
|
20
20
|
height: 10,
|
|
21
21
|
};
|
|
22
22
|
const container = {
|
|
23
|
+
width: '100%',
|
|
23
24
|
maxWidth: 500,
|
|
25
|
+
minWidth: 0,
|
|
26
|
+
};
|
|
27
|
+
const row = {
|
|
28
|
+
minWidth: 0,
|
|
24
29
|
};
|
|
25
30
|
const label = {
|
|
26
31
|
fontSize: 13,
|
|
27
32
|
color: 'white',
|
|
28
33
|
fontFamily: 'sans-serif',
|
|
34
|
+
minWidth: 0,
|
|
35
|
+
whiteSpace: 'normal',
|
|
36
|
+
overflowWrap: 'anywhere',
|
|
29
37
|
};
|
|
30
38
|
const compactLabel = {
|
|
31
39
|
...label,
|
|
@@ -40,7 +48,7 @@ const ValidationMessage = ({ message, align, type, action, size = 'default' }) =
|
|
|
40
48
|
fill: type === 'warning' ? colors_1.WARNING_COLOR : colors_1.FAIL_COLOR,
|
|
41
49
|
};
|
|
42
50
|
}, [iconStyle, type]);
|
|
43
|
-
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", justify: align, children: [
|
|
51
|
+
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", justify: align, style: row, children: [
|
|
44
52
|
jsx_runtime_1.jsx(exports.WarningTriangle, { style: finalStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: size === 'compact' ? 0.75 : 1 }), jsx_runtime_1.jsx("div", { style: labelStyle, children: message }), action ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
45
53
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: size === 'compact' ? 0.75 : 1 }), action] })) : null] }) }));
|
|
46
54
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type OptionsSidebarPanel = 'inspector' | 'renders';
|
|
3
3
|
export declare const persistSelectedOptionsSidebarPanel: (panel: OptionsSidebarPanel) => void;
|
|
4
|
-
export declare const optionsSidebarTabs: React.RefObject<{
|
|
5
|
-
selectRendersPanel: () => void;
|
|
6
|
-
} | null>;
|
|
7
4
|
export declare const OptionsPanel: React.FC<{
|
|
8
5
|
readonly readOnlyStudio: boolean;
|
|
9
6
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OptionsPanel = exports.
|
|
3
|
+
exports.OptionsPanel = exports.persistSelectedOptionsSidebarPanel = 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");
|
|
@@ -10,6 +10,7 @@ const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
|
|
|
10
10
|
const get_zod_if_possible_1 = require("./get-zod-if-possible");
|
|
11
11
|
const InspectorPanel_1 = require("./InspectorPanel");
|
|
12
12
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
13
|
+
const options_sidebar_tabs_1 = require("./options-sidebar-tabs");
|
|
13
14
|
const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
|
|
14
15
|
const extract_enum_json_paths_1 = require("./RenderModal/SchemaEditor/extract-enum-json-paths");
|
|
15
16
|
const SchemaResetButton_1 = require("./RenderModal/SchemaEditor/SchemaResetButton");
|
|
@@ -35,7 +36,6 @@ const persistSelectedOptionsSidebarPanel = (panel) => {
|
|
|
35
36
|
localStorage.setItem(localStorageKey, panel);
|
|
36
37
|
};
|
|
37
38
|
exports.persistSelectedOptionsSidebarPanel = persistSelectedOptionsSidebarPanel;
|
|
38
|
-
exports.optionsSidebarTabs = (0, react_1.createRef)();
|
|
39
39
|
const OptionsPanel = ({ readOnlyStudio }) => {
|
|
40
40
|
const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
41
41
|
const renderingAvailable = !readOnlyStudio || show_browser_rendering_1.SHOW_BROWSER_RENDERING;
|
|
@@ -57,8 +57,12 @@ const OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
57
57
|
setPanel('renders');
|
|
58
58
|
(0, exports.persistSelectedOptionsSidebarPanel)('renders');
|
|
59
59
|
}, []);
|
|
60
|
-
(0, react_1.useImperativeHandle)(
|
|
60
|
+
(0, react_1.useImperativeHandle)(options_sidebar_tabs_1.optionsSidebarTabs, () => {
|
|
61
61
|
return {
|
|
62
|
+
selectInspectorPanel: () => {
|
|
63
|
+
setPanel('inspector');
|
|
64
|
+
(0, exports.persistSelectedOptionsSidebarPanel)('inspector');
|
|
65
|
+
},
|
|
62
66
|
selectRendersPanel: () => {
|
|
63
67
|
setPanel('renders');
|
|
64
68
|
(0, exports.persistSelectedOptionsSidebarPanel)('renders');
|
|
@@ -122,7 +122,7 @@ const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent,
|
|
|
122
122
|
return (jsx_runtime_1.jsx("div", { style: outer, children: jsx_runtime_1.jsx(RenderPreview_1.RenderPreview, { path: canvasContent.displayName, assetMetadata: assetMetadata, getBlob: canvasContent.getBlob }) }));
|
|
123
123
|
}
|
|
124
124
|
return (jsx_runtime_1.jsxs("div", { style: outer, children: [
|
|
125
|
-
jsx_runtime_1.jsx(PortalContainer, { contentDimensions: contentDimensions, scale: scale, xCorrection: xCorrection, yCorrection: yCorrection }), jsx_runtime_1.jsx(SelectedOutlineOverlay_1.SelectedOutlineOverlay, { scale: scale })
|
|
125
|
+
jsx_runtime_1.jsx(PortalContainer, { contentDimensions: contentDimensions, scale: scale, xCorrection: xCorrection, yCorrection: yCorrection }), jsx_runtime_1.jsx(SelectedOutlineOverlay_1.SelectedOutlineOverlay, { scale: scale, translationX: previewSize.translation.x, translationY: previewSize.translation.y })
|
|
126
126
|
] }));
|
|
127
127
|
};
|
|
128
128
|
const PortalContainer = ({ scale, xCorrection, yCorrection, contentDimensions }) => {
|
|
@@ -27,6 +27,7 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
|
27
27
|
const ModalHeader_1 = require("../ModalHeader");
|
|
28
28
|
const DismissableModal_1 = require("../NewComposition/DismissableModal");
|
|
29
29
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
30
|
+
const options_sidebar_tabs_1 = require("../options-sidebar-tabs");
|
|
30
31
|
const OptionsPanel_1 = require("../OptionsPanel");
|
|
31
32
|
const actions_1 = require("../RenderQueue/actions");
|
|
32
33
|
const SegmentedControl_1 = require("../SegmentedControl");
|
|
@@ -365,7 +366,7 @@ const RenderModal = ({ readOnlyStudio, initialFrame, initialVideoImageFormat, in
|
|
|
365
366
|
var _a;
|
|
366
367
|
setSidebarCollapsedState({ left: null, right: 'expanded' });
|
|
367
368
|
(0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
|
|
368
|
-
(_a =
|
|
369
|
+
(_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
|
|
369
370
|
dispatchIfMounted({ type: 'start' });
|
|
370
371
|
(0, actions_1.addStillRenderJob)({
|
|
371
372
|
compositionId: resolvedComposition.id,
|
|
@@ -438,7 +439,7 @@ const RenderModal = ({ readOnlyStudio, initialFrame, initialVideoImageFormat, in
|
|
|
438
439
|
var _a;
|
|
439
440
|
setSidebarCollapsedState({ left: null, right: 'expanded' });
|
|
440
441
|
(0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
|
|
441
|
-
(_a =
|
|
442
|
+
(_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
|
|
442
443
|
dispatchIfMounted({ type: 'start' });
|
|
443
444
|
(0, actions_1.addVideoRenderJob)({
|
|
444
445
|
compositionId: resolvedComposition.id,
|
|
@@ -548,7 +549,7 @@ const RenderModal = ({ readOnlyStudio, initialFrame, initialVideoImageFormat, in
|
|
|
548
549
|
var _a;
|
|
549
550
|
setSidebarCollapsedState({ left: null, right: 'expanded' });
|
|
550
551
|
(0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
|
|
551
|
-
(_a =
|
|
552
|
+
(_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
|
|
552
553
|
dispatchIfMounted({ type: 'start' });
|
|
553
554
|
(0, actions_1.addSequenceRenderJob)({
|
|
554
555
|
compositionId: resolvedComposition.id,
|
|
@@ -18,6 +18,7 @@ const Button_1 = require("../Button");
|
|
|
18
18
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
19
19
|
const ModalHeader_1 = require("../ModalHeader");
|
|
20
20
|
const DismissableModal_1 = require("../NewComposition/DismissableModal");
|
|
21
|
+
const options_sidebar_tabs_1 = require("../options-sidebar-tabs");
|
|
21
22
|
const OptionsPanel_1 = require("../OptionsPanel");
|
|
22
23
|
const context_1 = require("../RenderQueue/context");
|
|
23
24
|
const SegmentedControl_1 = require("../SegmentedControl");
|
|
@@ -369,7 +370,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
369
370
|
}
|
|
370
371
|
setSidebarCollapsedState({ left: null, right: 'expanded' });
|
|
371
372
|
(0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
|
|
372
|
-
(_a =
|
|
373
|
+
(_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
|
|
373
374
|
setSelectedModal(null);
|
|
374
375
|
}, [
|
|
375
376
|
renderMode,
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.SelectedOutlineElement = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
|
+
const react_dom_1 = require("react-dom");
|
|
39
40
|
const remotion_1 = require("remotion");
|
|
40
41
|
const no_react_1 = require("remotion/no-react");
|
|
41
42
|
const client_id_1 = require("../helpers/client-id");
|
|
@@ -49,6 +50,7 @@ const ContextMenu_1 = require("./ContextMenu");
|
|
|
49
50
|
const effect_drag_and_drop_1 = require("./effect-drag-and-drop");
|
|
50
51
|
const ForceSpecificCursor_1 = require("./ForceSpecificCursor");
|
|
51
52
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
53
|
+
const options_sidebar_tabs_1 = require("./options-sidebar-tabs");
|
|
52
54
|
const selected_outline_drag_1 = require("./selected-outline-drag");
|
|
53
55
|
const selected_outline_measurement_1 = require("./selected-outline-measurement");
|
|
54
56
|
const selected_outline_types_1 = require("./selected-outline-types");
|
|
@@ -56,6 +58,7 @@ const selected_outline_uv_1 = require("./selected-outline-uv");
|
|
|
56
58
|
const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
57
59
|
const disable_sequence_interactivity_1 = require("./Timeline/disable-sequence-interactivity");
|
|
58
60
|
const duplicate_selected_timeline_item_1 = require("./Timeline/duplicate-selected-timeline-item");
|
|
61
|
+
const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
59
62
|
const get_sequence_context_menu_items_1 = require("./Timeline/get-sequence-context-menu-items");
|
|
60
63
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
61
64
|
const timeline_asset_link_1 = require("./Timeline/timeline-asset-link");
|
|
@@ -310,7 +313,7 @@ const SelectedOutlineTransformOriginHandle = ({ outline, onDraggingChange, targe
|
|
|
310
313
|
jsx_runtime_1.jsx("circle", { cx: position.x, cy: position.y, r: 4, stroke: colors_1.BLUE, fill: "none", strokeWidth: 2, vectorEffect: "non-scaling-stroke" }), jsx_runtime_1.jsx("line", { x1: position.x - 8, y1: position.y, x2: position.x + 8, y2: position.y, stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke" }), jsx_runtime_1.jsx("line", { x1: position.x, y1: position.y - 8, x2: position.x, y2: position.y + 8, stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke" })
|
|
311
314
|
] }));
|
|
312
315
|
};
|
|
313
|
-
const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, hovered, onContextMenuOpen, outline, onDraggingChange, onHoverChange, onSelect, scale, target, }) => {
|
|
316
|
+
const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, hovered, onContextMenuOpen, outline, onDraggingChange, onHoverChange, onSelect, onTextEditStart, scale, target, }) => {
|
|
314
317
|
var _a, _b, _c, _d;
|
|
315
318
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
316
319
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -339,6 +342,9 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
339
342
|
if (drag === null || interaction.shiftKey || interaction.toggleKey) {
|
|
340
343
|
return;
|
|
341
344
|
}
|
|
345
|
+
if ((0, focus_inspector_field_1.commitPendingInspectorFields)()) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
342
348
|
const startPointerX = event.clientX;
|
|
343
349
|
const startPointerY = event.clientY;
|
|
344
350
|
const dragStates = (0, selected_outline_drag_1.getSelectedOutlineDragStates)({
|
|
@@ -478,6 +484,14 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
478
484
|
setDragOverrides,
|
|
479
485
|
target,
|
|
480
486
|
]);
|
|
487
|
+
const onDoubleClick = react_1.default.useCallback((event) => {
|
|
488
|
+
if (target === undefined) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
event.preventDefault();
|
|
492
|
+
event.stopPropagation();
|
|
493
|
+
onTextEditStart(target);
|
|
494
|
+
}, [onTextEditStart, target]);
|
|
481
495
|
const onEffectDragOver = react_1.default.useCallback((event) => {
|
|
482
496
|
if (effectDrop === null || !(0, effect_drag_and_drop_1.hasEffectDragType)(event.dataTransfer)) {
|
|
483
497
|
return;
|
|
@@ -526,7 +540,7 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
526
540
|
if (!dragging) {
|
|
527
541
|
onHoverChange(null);
|
|
528
542
|
}
|
|
529
|
-
}, onPointerDown: onPointerDown, onDragOver: effectDrop === null ? undefined : onEffectDragOver, onDragLeave: effectDrop === null ? undefined : onEffectDragLeave, onDrop: effectDrop === null ? undefined : onEffectDrop }), jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: polygonRef, values: [...contextMenuValues], onOpen: onContextMenuOpen })
|
|
543
|
+
}, onPointerDown: onPointerDown, onDoubleClick: onDoubleClick, onDragOver: effectDrop === null ? undefined : onEffectDragOver, onDragLeave: effectDrop === null ? undefined : onEffectDragLeave, onDrop: effectDrop === null ? undefined : onEffectDrop }), jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: polygonRef, values: [...contextMenuValues], onOpen: onContextMenuOpen })
|
|
530
544
|
] }));
|
|
531
545
|
};
|
|
532
546
|
const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, contextMenuValues, dragging, edge, outline, onDraggingChange, onContextMenuOpen, onHoverChange, onSelect, target, }) => {
|
|
@@ -554,6 +568,9 @@ const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, contextMenuValues,
|
|
|
554
568
|
if (interaction.shiftKey || interaction.toggleKey) {
|
|
555
569
|
return;
|
|
556
570
|
}
|
|
571
|
+
if ((0, focus_inspector_field_1.commitPendingInspectorFields)()) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
557
574
|
const startPointer = { x: event.clientX, y: event.clientY };
|
|
558
575
|
const dragStates = (0, selected_outline_drag_1.getSelectedOutlineScaleDragStates)({
|
|
559
576
|
dragTargets: selected ? allScaleDragTargets : [scaleDrag],
|
|
@@ -728,6 +745,9 @@ const SelectedOutlineRotationCornerHandle = ({ allRotationDragTargets, contextMe
|
|
|
728
745
|
if (interaction.toggleKey) {
|
|
729
746
|
return;
|
|
730
747
|
}
|
|
748
|
+
if ((0, focus_inspector_field_1.commitPendingInspectorFields)()) {
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
731
751
|
const startPointer = { x: event.clientX, y: event.clientY };
|
|
732
752
|
const svgRect = svg.getBoundingClientRect();
|
|
733
753
|
const center = svgPointToClientPoint((0, selected_outline_measurement_1.getSelectedOutlineRotationPivot)({
|
|
@@ -916,6 +936,28 @@ const SelectedOutlineElement = ({ allDragTargets, allRotationDragTargets, allSca
|
|
|
916
936
|
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
917
937
|
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
918
938
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
939
|
+
const onTextEditStart = react_1.default.useCallback((editTarget) => {
|
|
940
|
+
const { textEdit } = editTarget;
|
|
941
|
+
if (textEdit === null) {
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
if (textEdit.propStatus.status !== 'static' ||
|
|
945
|
+
typeof textEdit.propStatus.codeValue !== 'string') {
|
|
946
|
+
(0, NotificationCenter_1.showNotification)('This text is computed and cannot be edited visually', 3000);
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
(0, react_dom_1.flushSync)(() => {
|
|
950
|
+
var _a;
|
|
951
|
+
if (!editTarget.selected) {
|
|
952
|
+
onSelect(editTarget.selection, { shiftKey: false, toggleKey: false });
|
|
953
|
+
}
|
|
954
|
+
(_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectInspectorPanel();
|
|
955
|
+
});
|
|
956
|
+
(0, focus_inspector_field_1.requestFocusInspectorField)({
|
|
957
|
+
fieldKey: 'children',
|
|
958
|
+
nodePath: textEdit.nodePath,
|
|
959
|
+
});
|
|
960
|
+
}, [onSelect]);
|
|
919
961
|
const onContextMenuOpen = react_1.default.useCallback(async () => {
|
|
920
962
|
if (target === undefined || previewServerState.type !== 'connected') {
|
|
921
963
|
return false;
|
|
@@ -1071,7 +1113,7 @@ const SelectedOutlineElement = ({ allDragTargets, allRotationDragTargets, allSca
|
|
|
1071
1113
|
updateResolvedStackTrace,
|
|
1072
1114
|
]);
|
|
1073
1115
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
1074
|
-
jsx_runtime_1.jsx(SelectedOutlinePolygon, { allDragTargets: allDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, scale: scale, target: target }), (target === null || target === void 0 ? void 0 : target.containsSelection) || hovered
|
|
1116
|
+
jsx_runtime_1.jsx(SelectedOutlinePolygon, { allDragTargets: allDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, onTextEditStart: onTextEditStart, scale: scale, target: target }), (target === null || target === void 0 ? void 0 : target.containsSelection) || hovered
|
|
1075
1117
|
? ['top', 'right', 'bottom', 'left'].map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine, { allScaleDragTargets: allScaleDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, edge: edge, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: target }, edge)))
|
|
1076
1118
|
: null, (target === null || target === void 0 ? void 0 : target.containsSelection) || hovered
|
|
1077
1119
|
? ['top-left', 'top-right', 'bottom-right', 'bottom-left'].map((corner) => (jsx_runtime_1.jsx(SelectedOutlineRotationCornerHandle, { allRotationDragTargets: allRotationDragTargets, contextMenuValues: emptyContextMenuValues, corner: corner, dragging: dragging, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: target }, corner)))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type SelectedOutline } from './selected-outline-geometry';
|
|
3
3
|
import { type SelectedOutlineTarget } from './selected-outline-types';
|
|
4
|
-
export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutlineActiveSchema, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold,
|
|
4
|
+
export { applySelectedOutlineDragAxisLock, applySelectedOutlineTransformOriginAxisLock, compensateTranslateForTransformOrigin, getSelectedOutlineActiveSchema, getSelectedOutlineDragChanges, getSelectedOutlineDragValues, getSelectedOutlineKeyboardNudgeDelta, getSelectedOutlineKeyboardNudgeDeltas, getSelectedOutlineRotationDragChanges, getSelectedOutlineRotationDragStates, getSelectedOutlineRotationDragValues, getSelectedOutlineScaleDragChanges, getSelectedOutlineScaleDragStates, getSelectedOutlineScaleDragValues, getSelectedOutlineScaleEdgeInfo, getSelectedOutlineTransformOriginLockedAxis, isSelectedOutlineDragPastThreshold, selectedOutlineTransformOriginSnapThresholdPx, selectedOutlineUvSnapThresholdPx, snapSelectedOutlineRotationDeltaDegrees, snapSelectedOutlineTransformOriginUv, snapSelectedOutlineUv, } from './selected-outline-drag';
|
|
5
5
|
export { getOutlineSelectionInteraction, getSelectedEffectFieldsBySequenceKey, getSelectedOutlineRotationCornerInfo, getSelectedOutlineRotationDeltaDegrees, getSelectedOutlineRotationPivot, getSelectedSequenceKeys, getSequencesWithSelectableOutlines, getTransformedSvgViewportPoints, } from './selected-outline-measurement';
|
|
6
6
|
export { selectedOutlineDragThresholdPx } from './selected-outline-types';
|
|
7
7
|
export type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineScaleDragState, } from './selected-outline-types';
|
|
@@ -11,4 +11,6 @@ export declare const orderOutlinesForRendering: ({ outlines, targetsByKey, }: {
|
|
|
11
11
|
}) => readonly SelectedOutline[];
|
|
12
12
|
export declare const SelectedOutlineOverlay: React.FC<{
|
|
13
13
|
readonly scale: number;
|
|
14
|
+
readonly translationX: number;
|
|
15
|
+
readonly translationY: number;
|
|
14
16
|
}>;
|