@remotion/studio 4.0.514 → 4.0.516
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/api/install-package.js +14 -1
- package/dist/api/restart-studio.js +4 -0
- package/dist/components/AssetSelector.js +3 -9
- package/dist/components/AssetSelectorItem.d.ts +3 -1
- package/dist/components/AssetSelectorItem.js +41 -42
- package/dist/components/AudioWaveform.js +17 -139
- package/dist/components/Canvas.js +7 -4
- package/dist/components/CaptionInspector.d.ts +2 -0
- package/dist/components/CaptionInspector.js +3 -5
- package/dist/components/CompositionSelector.js +6 -3
- package/dist/components/CompositionSelectorItem.js +9 -10
- package/dist/components/ConfigSelect.d.ts +17 -0
- package/dist/components/ConfigSelect.js +50 -0
- package/dist/components/CurrentAsset.d.ts +10 -2
- package/dist/components/CurrentAsset.js +139 -46
- package/dist/components/FixComputedValueModal.js +54 -51
- package/dist/components/GlobalKeybindings.js +5 -5
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +12 -2
- package/dist/components/InlineCaptionInspector.d.ts +2 -0
- package/dist/components/InlineCaptionInspector.js +2 -2
- package/dist/components/InlineCompositionName.js +1 -1
- package/dist/components/InlineEditableTitle.js +3 -2
- package/dist/components/InspectorInfoHeader.js +1 -1
- package/dist/components/InspectorOpenInEditor.js +48 -72
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
- package/dist/components/InspectorPanel/CompositionInspector.js +41 -12
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -4
- package/dist/components/InspectorPanel/common.d.ts +0 -12
- package/dist/components/InspectorPanel/common.js +3 -52
- package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
- package/dist/components/InspectorPanelLayout.d.ts +1 -1
- package/dist/components/InspectorPanelLayout.js +1 -1
- package/dist/components/InspectorSequenceSection.js +40 -54
- package/dist/components/InstallPackage.d.ts +3 -2
- package/dist/components/InstallPackage.js +90 -28
- package/dist/components/InstallablePackage.js +37 -11
- package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
- package/dist/components/KeyboardShortcutsSettings.js +177 -0
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/Modals.js +12 -4
- package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
- package/dist/components/NewComposition/CodemodFooter.js +2 -8
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DeleteFolder.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +1 -1
- package/dist/components/NewComposition/InputDragger.js +27 -4
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/NewFolder.js +1 -3
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/NewComposition/RenameFolder.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.js +1 -1
- package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
- package/dist/components/Notifications/NotificationCenter.js +5 -0
- package/dist/components/OptionsPanel.js +9 -12
- package/dist/components/PreviewToolbar.js +5 -2
- package/dist/components/PreviewToolbarOverflowButton.js +30 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
- package/dist/components/RenderButton.js +66 -183
- package/dist/components/RenderModal/DataEditor.js +15 -12
- package/dist/components/RenderModal/GuiRenderStatus.js +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +3 -3
- package/dist/components/RenderModal/RenderStatusModal.js +0 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
- package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
- package/dist/components/RenderModal/WebRenderModal.js +4 -2
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +3 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -7
- package/dist/components/RenderingSettings.js +7 -4
- package/dist/components/RulersAndGuidesToggle.d.ts +2 -0
- package/dist/components/RulersAndGuidesToggle.js +23 -0
- package/dist/components/SegmentedButton.d.ts +29 -0
- package/dist/components/SegmentedButton.js +226 -0
- package/dist/components/SelectedOutlineCanvasRotation.d.ts +1 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +11 -4
- package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
- package/dist/components/SelectedOutlineEditingHandles.js +66 -0
- package/dist/components/SelectedOutlineElement.d.ts +2 -4
- package/dist/components/SelectedOutlineElement.js +15 -54
- package/dist/components/SelectedOutlineOverlay.js +32 -6
- package/dist/components/SelectedOutlinePolygon.d.ts +4 -4
- package/dist/components/SelectedOutlinePolygon.js +20 -17
- package/dist/components/SelectedOutlineRenderer.js +66 -14
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +30 -7
- package/dist/components/SettingsModalFooter.js +2 -1
- package/dist/components/SkillsSettings.d.ts +2 -0
- package/dist/components/SkillsSettings.js +129 -0
- package/dist/components/StaticFilePreview.js +7 -1
- package/dist/components/StudioSettings.js +7 -48
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Timeline/Timeline.js +0 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +15 -9
- package/dist/components/Timeline/TimelineBooleanField.js +1 -4
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +13 -12
- package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectItem.js +45 -15
- package/dist/components/Timeline/TimelineEffectPropItem.js +21 -4
- package/dist/components/Timeline/TimelineExpandArrowButton.js +10 -7
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +4 -1
- package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
- package/dist/components/Timeline/TimelineExpandedSection.js +8 -5
- package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
- package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
- package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
- package/dist/components/Timeline/TimelineImageInfo.js +13 -32
- package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
- package/dist/components/Timeline/TimelineRotationField.js +0 -2
- package/dist/components/Timeline/TimelineRowChrome.d.ts +1 -1
- package/dist/components/Timeline/TimelineRowChrome.js +41 -6
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
- package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
- package/dist/components/Timeline/TimelineScaleField.js +2 -6
- package/dist/components/Timeline/TimelineSchemaField.js +9 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +8 -3
- package/dist/components/Timeline/TimelineSelection.js +7 -5
- package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequence.js +110 -19
- package/dist/components/Timeline/TimelineSequenceItem.js +11 -8
- package/dist/components/Timeline/TimelineSequenceName.js +1 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +4 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
- package/dist/components/Timeline/TimelineTrack.js +5 -2
- package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
- package/dist/components/Timeline/TimelineTranslateField.js +0 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +4 -2
- package/dist/components/Timeline/TimelineVirtualization.js +3 -1
- package/dist/components/Timeline/delete-selected-timeline-item.js +6 -2
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +7 -14
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
- package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
- package/dist/components/Timeline/save-effect-prop.js +3 -3
- package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
- package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
- package/dist/components/Timeline/timeline-field-utils.js +0 -2
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
- package/dist/components/TimelineCombobox.js +25 -160
- package/dist/components/TimelineInOutToggle.js +4 -1
- package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
- package/dist/components/duplicate-jsx-node-api.js +12 -0
- package/dist/components/effect-drag-and-drop.js +7 -7
- package/dist/components/effect-operations-api.d.ts +8 -0
- package/dist/components/effect-operations-api.js +52 -0
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +3 -3
- package/dist/components/import-assets.js +9 -65
- package/dist/components/keyboard-shortcuts.d.ts +10 -0
- package/dist/components/keyboard-shortcuts.js +135 -0
- package/dist/components/selected-outline-control-layout.js +2 -6
- package/dist/components/selected-outline-measurement.d.ts +1 -1
- package/dist/components/selected-outline-measurement.js +16 -3
- package/dist/components/use-delete-asset.d.ts +1 -0
- package/dist/components/use-delete-asset.js +40 -0
- package/dist/components/use-selected-outline-control-target.d.ts +11 -0
- package/dist/components/use-selected-outline-control-target.js +79 -0
- package/dist/error-overlay/remotion-overlay/log-studio-error.js +4 -0
- package/dist/esm/{chunk-r46yxrjr.js → chunk-4bxz1d3g.js} +4 -3
- package/dist/esm/{chunk-xn2q7eem.js → chunk-w4244j4n.js} +14747 -14549
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/internals.mjs +14747 -14549
- package/dist/esm/previewEntry.mjs +14557 -14359
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
- package/dist/helpers/add-asset-cache-bust.js +10 -0
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +18 -1
- package/dist/helpers/calculate-timeline.js +2 -1
- package/dist/helpers/colors.d.ts +3 -1
- package/dist/helpers/colors.js +7 -3
- package/dist/helpers/drag-aware-double-click.d.ts +6 -0
- package/dist/helpers/drag-aware-double-click.js +20 -0
- package/dist/helpers/get-asset-metadata.js +25 -16
- package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
- package/dist/helpers/get-sequence-double-click-action.js +7 -1
- package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
- package/dist/helpers/get-timeline-sequence-layout.js +15 -6
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
- package/dist/helpers/hoverable.d.ts +1 -0
- package/dist/helpers/hoverable.js +2 -1
- package/dist/helpers/inject-css.js +7 -3
- package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
- package/dist/helpers/open-in-remotion-convert.js +18 -0
- package/dist/helpers/use-max-media-duration.js +5 -3
- package/dist/helpers/use-media-metadata.d.ts +2 -1
- package/dist/helpers/use-media-metadata.js +49 -25
- package/dist/helpers/use-menu-structure.js +54 -67
- package/dist/icons/align-center-horizontal.js +1 -1
- package/dist/icons/align-left.js +1 -1
- package/dist/icons/align-right.js +1 -1
- package/dist/icons/cloud-download.d.ts +4 -0
- package/dist/icons/cloud-download.js +8 -0
- package/dist/icons/keyboard.d.ts +4 -0
- package/dist/icons/keyboard.js +10 -0
- package/dist/icons/license.d.ts +4 -0
- package/dist/icons/license.js +8 -0
- package/dist/icons/package.d.ts +4 -0
- package/dist/icons/package.js +8 -0
- package/dist/icons/react.js +1 -1
- package/dist/icons/remotion-convert.d.ts +4 -0
- package/dist/icons/remotion-convert.js +10 -0
- package/dist/icons/skills.d.ts +4 -0
- package/dist/icons/skills.js +10 -0
- package/dist/state/modals.d.ts +2 -5
- package/package.json +12 -12
- package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
- package/dist/components/KeyboardShortcutsExplainer.js +0 -194
|
@@ -32,15 +32,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.RenderButton = void 0;
|
|
40
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
38
|
const player_1 = require("@remotion/player");
|
|
42
39
|
const react_1 = __importStar(require("react"));
|
|
43
|
-
const react_dom_1 = __importDefault(require("react-dom"));
|
|
44
40
|
const remotion_1 = require("remotion");
|
|
45
41
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
46
42
|
const client_id_1 = require("../helpers/client-id");
|
|
@@ -50,48 +46,10 @@ const caret_1 = require("../icons/caret");
|
|
|
50
46
|
const render_1 = require("../icons/render");
|
|
51
47
|
const in_out_1 = require("../state/in-out");
|
|
52
48
|
const modals_1 = require("../state/modals");
|
|
53
|
-
const z_index_1 = require("../state/z-index");
|
|
54
49
|
const layout_1 = require("./layout");
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
59
|
-
const splitButtonContainer = {
|
|
60
|
-
display: 'inline-flex',
|
|
61
|
-
flexDirection: 'row',
|
|
62
|
-
alignItems: 'center',
|
|
63
|
-
borderRadius: 3,
|
|
64
|
-
gap: 1,
|
|
65
|
-
overflow: 'hidden',
|
|
66
|
-
};
|
|
67
|
-
const mainButtonStyle = {
|
|
68
|
-
paddingLeft: 7,
|
|
69
|
-
paddingRight: 7,
|
|
70
|
-
paddingTop: 7,
|
|
71
|
-
paddingBottom: 7,
|
|
72
|
-
background: colors_1.TRANSPARENT,
|
|
73
|
-
border: 'none',
|
|
74
|
-
borderRadius: '3px 0 0 3px',
|
|
75
|
-
color: colors_1.WHITE,
|
|
76
|
-
cursor: 'default',
|
|
77
|
-
display: 'flex',
|
|
78
|
-
alignItems: 'center',
|
|
79
|
-
fontSize: 14,
|
|
80
|
-
fontFamily: 'inherit',
|
|
81
|
-
};
|
|
82
|
-
const dropdownTriggerStyle = {
|
|
83
|
-
paddingLeft: 6,
|
|
84
|
-
paddingRight: 6,
|
|
85
|
-
paddingTop: 7,
|
|
86
|
-
paddingBottom: 7,
|
|
87
|
-
background: colors_1.TRANSPARENT,
|
|
88
|
-
border: 'none',
|
|
89
|
-
borderRadius: '0 3px 3px 0',
|
|
90
|
-
color: colors_1.WHITE,
|
|
91
|
-
cursor: 'default',
|
|
92
|
-
display: 'flex',
|
|
93
|
-
alignItems: 'center',
|
|
94
|
-
justifyContent: 'center',
|
|
50
|
+
const SegmentedButton_1 = require("./SegmentedButton");
|
|
51
|
+
const segmentedButtonStyle = {
|
|
52
|
+
height: 28,
|
|
95
53
|
};
|
|
96
54
|
const mainButtonContent = {
|
|
97
55
|
paddingLeft: 4,
|
|
@@ -110,21 +68,21 @@ const label = {
|
|
|
110
68
|
WebkitUserSelect: 'none',
|
|
111
69
|
whiteSpace: 'nowrap',
|
|
112
70
|
};
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
...mainButtonStyle,
|
|
116
|
-
boxSizing: 'border-box',
|
|
117
|
-
height: compactSplitButtonSegmentHeight,
|
|
118
|
-
padding: '0 4px',
|
|
119
|
-
fontSize: 12,
|
|
71
|
+
const compactMainSegmentStyle = {
|
|
72
|
+
padding: '0 6px',
|
|
120
73
|
};
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
74
|
+
const defaultMainSegmentStyle = {
|
|
75
|
+
fontFamily: 'inherit',
|
|
76
|
+
fontSize: 14,
|
|
77
|
+
padding: '0 7px',
|
|
78
|
+
};
|
|
79
|
+
const compactDropdownSegmentStyle = {
|
|
125
80
|
padding: 0,
|
|
126
81
|
width: 20,
|
|
127
82
|
};
|
|
83
|
+
const defaultDropdownSegmentStyle = {
|
|
84
|
+
padding: '0 6px',
|
|
85
|
+
};
|
|
128
86
|
const compactMainButtonContent = {
|
|
129
87
|
...mainButtonContent,
|
|
130
88
|
paddingLeft: 0,
|
|
@@ -155,50 +113,6 @@ const RenderButtonInner = ({ readOnlyStudio, size: controlSize = 'default', narr
|
|
|
155
113
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
156
114
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
157
115
|
const [preferredRenderType, setPreferredRenderType] = (0, react_1.useState)(() => getInitialRenderType(readOnlyStudio));
|
|
158
|
-
const [dropdownOpened, setDropdownOpened] = (0, react_1.useState)(false);
|
|
159
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
160
|
-
const dropdownRef = (0, react_1.useRef)(null);
|
|
161
|
-
const containerRef = (0, react_1.useRef)(null);
|
|
162
|
-
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
163
|
-
const size = player_1.PlayerInternals.useElementSize(dropdownRef, {
|
|
164
|
-
triggerOnWindowResize: true,
|
|
165
|
-
shouldApplyCssTransforms: true,
|
|
166
|
-
});
|
|
167
|
-
const refresh = size === null || size === void 0 ? void 0 : size.refresh;
|
|
168
|
-
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
169
|
-
// Prevent deselection of currently selected items
|
|
170
|
-
e.stopPropagation();
|
|
171
|
-
setDropdownOpened((o) => {
|
|
172
|
-
if (!o) {
|
|
173
|
-
refresh === null || refresh === void 0 ? void 0 : refresh();
|
|
174
|
-
}
|
|
175
|
-
return !o;
|
|
176
|
-
});
|
|
177
|
-
}, [refresh]);
|
|
178
|
-
const onMenuPointerDown = (0, react_1.useCallback)((e) => {
|
|
179
|
-
// Prevent deselection of currently selected items
|
|
180
|
-
e.stopPropagation();
|
|
181
|
-
}, []);
|
|
182
|
-
const onClickDropdown = (0, react_1.useCallback)((e) => {
|
|
183
|
-
e.stopPropagation();
|
|
184
|
-
const isKeyboardInitiated = e.detail === 0;
|
|
185
|
-
if (!isKeyboardInitiated) {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
setDropdownOpened((o) => {
|
|
189
|
-
if (!o) {
|
|
190
|
-
refresh === null || refresh === void 0 ? void 0 : refresh();
|
|
191
|
-
window.addEventListener('pointerup', (evt) => {
|
|
192
|
-
if (!(0, is_menu_item_1.isMenuItem)(evt.target)) {
|
|
193
|
-
setDropdownOpened(false);
|
|
194
|
-
}
|
|
195
|
-
}, {
|
|
196
|
-
once: true,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
return !o;
|
|
200
|
-
});
|
|
201
|
-
}, [refresh]);
|
|
202
116
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
203
117
|
.previewServerState.type;
|
|
204
118
|
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
@@ -343,9 +257,6 @@ const RenderButtonInner = ({ readOnlyStudio, size: controlSize = 'default', narr
|
|
|
343
257
|
openClientRenderModal();
|
|
344
258
|
}
|
|
345
259
|
}, [renderType, openServerRenderModal, openClientRenderModal]);
|
|
346
|
-
const onHideDropdown = (0, react_1.useCallback)(() => {
|
|
347
|
-
setDropdownOpened(false);
|
|
348
|
-
}, []);
|
|
349
260
|
const handleRenderTypeChange = (0, react_1.useCallback)((newType) => {
|
|
350
261
|
setPreferredRenderType(newType);
|
|
351
262
|
try {
|
|
@@ -354,7 +265,6 @@ const RenderButtonInner = ({ readOnlyStudio, size: controlSize = 'default', narr
|
|
|
354
265
|
catch (_a) {
|
|
355
266
|
// localStorage might not be available
|
|
356
267
|
}
|
|
357
|
-
setDropdownOpened(false);
|
|
358
268
|
if (newType === 'server-render') {
|
|
359
269
|
openServerRenderModal(false);
|
|
360
270
|
}
|
|
@@ -421,94 +331,67 @@ const RenderButtonInner = ({ readOnlyStudio, size: controlSize = 'default', narr
|
|
|
421
331
|
},
|
|
422
332
|
];
|
|
423
333
|
}, [canServerRender, handleRenderTypeChange, readOnlyStudio]);
|
|
424
|
-
const spaceToBottom = (0, react_1.useMemo)(() => {
|
|
425
|
-
const margin = 10;
|
|
426
|
-
if (size && dropdownOpened) {
|
|
427
|
-
return size.windowSize.height - (size.top + size.height) - margin;
|
|
428
|
-
}
|
|
429
|
-
return 0;
|
|
430
|
-
}, [dropdownOpened, size]);
|
|
431
|
-
const spaceToTop = (0, react_1.useMemo)(() => {
|
|
432
|
-
const margin = 10;
|
|
433
|
-
if (size && dropdownOpened) {
|
|
434
|
-
return size.top - margin;
|
|
435
|
-
}
|
|
436
|
-
return 0;
|
|
437
|
-
}, [dropdownOpened, size]);
|
|
438
|
-
const derivedMaxHeight = (0, react_1.useMemo)(() => {
|
|
439
|
-
return spaceToTop > spaceToBottom ? spaceToTop : spaceToBottom;
|
|
440
|
-
}, [spaceToBottom, spaceToTop]);
|
|
441
|
-
const portalStyle = (0, react_1.useMemo)(() => {
|
|
442
|
-
if (!dropdownOpened || !size) {
|
|
443
|
-
return null;
|
|
444
|
-
}
|
|
445
|
-
const verticalLayout = spaceToTop > spaceToBottom ? 'bottom' : 'top';
|
|
446
|
-
return {
|
|
447
|
-
...(verticalLayout === 'top'
|
|
448
|
-
? {
|
|
449
|
-
...styles_1.menuContainerTowardsBottom,
|
|
450
|
-
top: size.top + size.height,
|
|
451
|
-
}
|
|
452
|
-
: {
|
|
453
|
-
...styles_1.menuContainerTowardsTop,
|
|
454
|
-
bottom: size.windowSize.height - size.top,
|
|
455
|
-
}),
|
|
456
|
-
right: size.windowSize.width - size.left - size.width,
|
|
457
|
-
};
|
|
458
|
-
}, [dropdownOpened, size, spaceToBottom, spaceToTop]);
|
|
459
|
-
const containerStyle = (0, react_1.useMemo)(() => {
|
|
460
|
-
return {
|
|
461
|
-
...splitButtonContainer,
|
|
462
|
-
borderRadius: controlSize === 'compact' ? 3 : 4,
|
|
463
|
-
opacity: 1,
|
|
464
|
-
cursor: 'default',
|
|
465
|
-
};
|
|
466
|
-
}, [controlSize]);
|
|
467
334
|
const renderLabel = renderType === 'server-render'
|
|
468
335
|
? 'Render'
|
|
469
336
|
: renderType === 'render-command'
|
|
470
337
|
? 'Render via CLI'
|
|
471
338
|
: 'Render on web';
|
|
472
339
|
const showRenderLabel = !narrow || renderType !== 'server-render';
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
340
|
+
const segments = (0, react_1.useMemo)(() => {
|
|
341
|
+
return [
|
|
342
|
+
{
|
|
343
|
+
ariaLabel: renderLabel,
|
|
344
|
+
buttonId: 'render-modal-button',
|
|
345
|
+
disabled: false,
|
|
346
|
+
idleColor: colors_1.WHITE_ALPHA_80,
|
|
347
|
+
onClick,
|
|
348
|
+
onPointerDown: null,
|
|
349
|
+
renderContent: (color) => (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", style: controlSize === 'compact'
|
|
350
|
+
? compactMainButtonContent
|
|
351
|
+
: mainButtonContent, children: [
|
|
352
|
+
jsx_runtime_1.jsx(render_1.ThinRenderIcon, { fill: color, svgProps: iconStyle }), showRenderLabel ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
353
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: controlSize === 'compact' ? 0.75 : 1 }), jsx_runtime_1.jsx("span", { style: controlSize === 'compact' ? compactLabel : label, children: renderLabel })
|
|
354
|
+
] })) : null] })),
|
|
355
|
+
segmentId: 'render',
|
|
356
|
+
style: controlSize === 'compact'
|
|
357
|
+
? compactMainSegmentStyle
|
|
358
|
+
: defaultMainSegmentStyle,
|
|
359
|
+
title: tooltip,
|
|
360
|
+
type: 'action',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
ariaLabel: 'Select render type',
|
|
364
|
+
buttonId: null,
|
|
365
|
+
disabled: false,
|
|
366
|
+
idleColor: colors_1.WHITE_ALPHA_80,
|
|
367
|
+
leaveLeftSpace: false,
|
|
368
|
+
onOpenChange: null,
|
|
369
|
+
renderContent: (color) => jsx_runtime_1.jsx(caret_1.CaretDown, { color: color }),
|
|
370
|
+
segmentId: 'render-type',
|
|
371
|
+
selectedId: renderType,
|
|
372
|
+
style: controlSize === 'compact'
|
|
373
|
+
? compactDropdownSegmentStyle
|
|
374
|
+
: defaultDropdownSegmentStyle,
|
|
375
|
+
title: 'Select render type',
|
|
376
|
+
type: 'menu',
|
|
377
|
+
values: dropdownValues,
|
|
378
|
+
},
|
|
379
|
+
];
|
|
380
|
+
}, [
|
|
381
|
+
controlSize,
|
|
382
|
+
dropdownValues,
|
|
383
|
+
iconStyle,
|
|
384
|
+
onClick,
|
|
385
|
+
renderLabel,
|
|
386
|
+
renderType,
|
|
387
|
+
showRenderLabel,
|
|
388
|
+
tooltip,
|
|
389
|
+
]);
|
|
484
390
|
if (!video) {
|
|
485
391
|
return null;
|
|
486
392
|
}
|
|
487
393
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
488
|
-
jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-server", disabled: !canServerRender, onClick: () => openServerRenderModal(false), type: "button" }), ' ', jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-client", onClick: openClientRenderModal, type: "button" }), jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-command", onClick: () => openServerRenderModal(true), type: "button" }), jsx_runtime_1.
|
|
489
|
-
|
|
490
|
-
...(controlSize === 'compact'
|
|
491
|
-
? compactMainButtonStyle
|
|
492
|
-
: mainButtonStyle),
|
|
493
|
-
backgroundColor: mainSegmentBackground,
|
|
494
|
-
color: mainForegroundColor,
|
|
495
|
-
}, onClick: onClick, id: "render-modal-button", children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", style: controlSize === 'compact'
|
|
496
|
-
? compactMainButtonContent
|
|
497
|
-
: mainButtonContent, children: [
|
|
498
|
-
jsx_runtime_1.jsx(render_1.ThinRenderIcon, { fill: mainForegroundColor, svgProps: iconStyle }), showRenderLabel ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
499
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: controlSize === 'compact' ? 0.75 : 1 }), jsx_runtime_1.jsx("span", { style: {
|
|
500
|
-
...(controlSize === 'compact' ? compactLabel : label),
|
|
501
|
-
color: mainForegroundColor,
|
|
502
|
-
}, children: renderLabel })
|
|
503
|
-
] })) : null] }) }), jsx_runtime_1.jsx("button", { ref: dropdownRef, type: "button", style: {
|
|
504
|
-
...(controlSize === 'compact'
|
|
505
|
-
? compactDropdownTriggerStyle
|
|
506
|
-
: dropdownTriggerStyle),
|
|
507
|
-
backgroundColor: dropdownSegmentBackground,
|
|
508
|
-
color: dropdownForegroundColor,
|
|
509
|
-
}, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, onPointerDown: onPointerDown, onClick: onClickDropdown, children: jsx_runtime_1.jsx(caret_1.CaretDown, { color: dropdownForegroundColor }) })
|
|
510
|
-
] }), portalStyle
|
|
511
|
-
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHideDropdown, onEscape: onHideDropdown, children: jsx_runtime_1.jsx("div", { style: portalStyle, onPointerDown: onMenuPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: () => { }, onPreviousMenu: () => { }, values: dropdownValues, onHide: onHideDropdown, leaveLeftSpace: false, preselectIndex: dropdownValues.findIndex((v) => v.id === renderType), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
512
|
-
: null] }));
|
|
394
|
+
jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-server", disabled: !canServerRender, onClick: () => openServerRenderModal(false), type: "button" }), ' ', jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-client", onClick: openClientRenderModal, type: "button" }), jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-command", onClick: () => openServerRenderModal(true), type: "button" }), jsx_runtime_1.jsx(SegmentedButton_1.SegmentedButton, { segments: segments, style: segmentedButtonStyle, title: tooltip })
|
|
395
|
+
] }));
|
|
513
396
|
};
|
|
514
397
|
exports.RenderButton = react_1.default.memo(RenderButtonInner);
|
|
@@ -48,6 +48,7 @@ const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
|
48
48
|
const SegmentedControl_1 = require("../SegmentedControl");
|
|
49
49
|
const get_render_modal_warnings_1 = require("./get-render-modal-warnings");
|
|
50
50
|
const RenderModalJSONPropsEditor_1 = require("./RenderModalJSONPropsEditor");
|
|
51
|
+
const infer_zod_schema_from_value_1 = require("./SchemaEditor/infer-zod-schema-from-value");
|
|
51
52
|
const SchemaEditor_1 = require("./SchemaEditor/SchemaEditor");
|
|
52
53
|
const SchemaErrorMessages_1 = require("./SchemaEditor/SchemaErrorMessages");
|
|
53
54
|
const zod_schema_type_1 = require("./SchemaEditor/zod-schema-type");
|
|
@@ -196,19 +197,21 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, prop
|
|
|
196
197
|
setDefaultProps((p) => p, { shouldSave: true });
|
|
197
198
|
}, [setDefaultProps]);
|
|
198
199
|
const z = (0, get_zod_if_possible_1.useZodIfPossible)();
|
|
200
|
+
const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
|
|
199
201
|
const schema = (0, react_1.useMemo)(() => {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
202
|
+
var _a;
|
|
203
|
+
return (0, infer_zod_schema_from_value_1.resolveCompositionSchema)({
|
|
204
|
+
explicitSchema: unresolvedComposition.schema,
|
|
205
|
+
defaultProps: (_a = unresolvedComposition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
206
|
+
z,
|
|
207
|
+
zodTypes,
|
|
208
|
+
});
|
|
209
|
+
}, [
|
|
210
|
+
unresolvedComposition.defaultProps,
|
|
211
|
+
unresolvedComposition.schema,
|
|
212
|
+
z,
|
|
213
|
+
zodTypes,
|
|
214
|
+
]);
|
|
212
215
|
const zodValidationResult = (0, react_1.useMemo)(() => {
|
|
213
216
|
if (schema === 'no-zod') {
|
|
214
217
|
return 'no-zod';
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GuiRenderStatus = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
6
7
|
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const layout_1 = require("../layout");
|
|
8
9
|
const actions_1 = require("../RenderQueue/actions");
|
|
@@ -78,6 +79,7 @@ const DownloadsProgress = ({ downloads }) => {
|
|
|
78
79
|
] }));
|
|
79
80
|
};
|
|
80
81
|
const OpenFile = ({ job }) => {
|
|
82
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
81
83
|
const labelStyle = (0, react_1.useMemo)(() => {
|
|
82
84
|
return {
|
|
83
85
|
...label,
|
|
@@ -93,7 +95,7 @@ const OpenFile = ({ job }) => {
|
|
|
93
95
|
(0, actions_1.openInFileExplorer)({ directory: job.outName });
|
|
94
96
|
}, [job.outName]);
|
|
95
97
|
return (jsx_runtime_1.jsxs("div", { style: progressItem, children: [
|
|
96
|
-
jsx_runtime_1.jsx(SuccessIcon_1.SuccessIcon, {}), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("button", { style: labelStyle, type: "button", onClick: onClick, children: job.outName }), jsx_runtime_1.jsx("div", { style: right, children: jsx_runtime_1.jsx(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }) })
|
|
98
|
+
jsx_runtime_1.jsx(SuccessIcon_1.SuccessIcon, {}), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), isBrowserStudio ? (jsx_runtime_1.jsx("div", { style: labelStyle, children: job.outName })) : (jsx_runtime_1.jsx("button", { style: labelStyle, type: "button", onClick: onClick, children: job.outName })), jsx_runtime_1.jsx("div", { style: right, children: jsx_runtime_1.jsx(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }) })
|
|
97
99
|
] }));
|
|
98
100
|
};
|
|
99
101
|
const GuiRenderStatus = ({ job }) => {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenderModalOutputName = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
6
7
|
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const get_file_manager_name_1 = require("../../helpers/get-file-manager-name");
|
|
8
9
|
const folder_1 = require("../../icons/folder");
|
|
@@ -47,14 +48,13 @@ const RenderModalOutputName = ({ existence, inputStyle, outName, onValueChange,
|
|
|
47
48
|
return jsx_runtime_1.jsx(folder_1.ExpandedFolderIconSolid, { style: openIconStyle, color: color });
|
|
48
49
|
}, []);
|
|
49
50
|
const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
|
|
51
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
50
52
|
return (jsx_runtime_1.jsxs("div", { style: outputNameRow, children: [
|
|
51
53
|
jsx_runtime_1.jsx(layout_1.Column, { children: jsx_runtime_1.jsx("div", { style: layout_2.label, children: labelText }) }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { style: outputNameInputContainer, children: [
|
|
52
54
|
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange, rightAlign: true }), validationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
53
55
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: validationMessage, type: 'error' })
|
|
54
56
|
] })) : existence ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
55
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: jsx_runtime_1.jsxs("span", { style: existsMessageStyle, children: [
|
|
56
|
-
jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openExistingOutput, renderAction: renderOpenIcon, title: `Open in ${fileManagerName}` }),
|
|
57
|
-
"Exists, will be overwritten"] }), type: 'warning' })
|
|
57
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: jsx_runtime_1.jsxs("span", { style: existsMessageStyle, children: [isBrowserStudio ? null : (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openExistingOutput, renderAction: renderOpenIcon, title: `Open in ${fileManagerName}` })), "Exists, will be overwritten"] }), type: 'warning' })
|
|
58
58
|
] })) : null] }) })
|
|
59
59
|
] }));
|
|
60
60
|
};
|
|
@@ -68,7 +68,6 @@ const RenderStatusModal = ({ jobId, }) => {
|
|
|
68
68
|
setSelectedModal(null);
|
|
69
69
|
if (isClientJob) {
|
|
70
70
|
removeClientJob(job.id);
|
|
71
|
-
(0, NotificationCenter_1.showNotification)('Removed render', 2000);
|
|
72
71
|
}
|
|
73
72
|
else {
|
|
74
73
|
(0, actions_1.removeRenderJob)(job).catch((err) => {
|
|
@@ -36,7 +36,9 @@ const ZodSwitch = ({ schema, jsonPath, value, setValue, onRemove, mayPad }) => {
|
|
|
36
36
|
description === zodTypes.ZodZypesInternals.REMOTION_COLOR_BRAND) {
|
|
37
37
|
return (jsx_runtime_1.jsx(ZodColorEditor_1.ZodColorEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, onRemove: onRemove, mayPad: mayPad }));
|
|
38
38
|
}
|
|
39
|
-
if (
|
|
39
|
+
if ((window.remotion_staticBase !== '' &&
|
|
40
|
+
value.startsWith(window.remotion_staticBase)) ||
|
|
41
|
+
window.remotion_staticFiles.some((file) => file.src === value)) {
|
|
40
42
|
return (jsx_runtime_1.jsx(ZodStaticFileEditor_1.ZodStaticFileEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, onRemove: onRemove, mayPad: mayPad }));
|
|
41
43
|
}
|
|
42
44
|
if (zodTypes &&
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ZodType as ZodNamespace, ZodTypesType } from '../../get-zod-if-possible';
|
|
2
|
+
import type { AnyZodSchema } from './zod-schema-type';
|
|
3
|
+
export declare function inferZodSchemaFromValue({ value, z, zodTypes, path }: {
|
|
4
|
+
readonly value: unknown;
|
|
5
|
+
readonly z: ZodNamespace;
|
|
6
|
+
readonly zodTypes: ZodTypesType | null;
|
|
7
|
+
readonly path: readonly string[];
|
|
8
|
+
}): AnyZodSchema;
|
|
9
|
+
export type ResolvedCompositionSchema = AnyZodSchema | 'no-schema' | 'no-zod';
|
|
10
|
+
export declare function resolveCompositionSchema({ explicitSchema, defaultProps, z, zodTypes }: {
|
|
11
|
+
readonly explicitSchema: unknown;
|
|
12
|
+
readonly defaultProps: Record<string, unknown>;
|
|
13
|
+
readonly z: ZodNamespace | null;
|
|
14
|
+
readonly zodTypes: ZodTypesType | null;
|
|
15
|
+
}): ResolvedCompositionSchema;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inferZodSchemaFromValue = inferZodSchemaFromValue;
|
|
4
|
+
exports.resolveCompositionSchema = resolveCompositionSchema;
|
|
5
|
+
const zod_schema_type_1 = require("./zod-schema-type");
|
|
6
|
+
const hasUnambiguousColorSyntax = (value) => {
|
|
7
|
+
return /^(?:#|(?:rgb|hsl|hwb|lab|lch|oklab|oklch|color)\()/i.test(value.trim());
|
|
8
|
+
};
|
|
9
|
+
const isPlainObject = (value) => {
|
|
10
|
+
if (value === null || typeof value !== 'object') {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const prototype = Object.getPrototypeOf(value);
|
|
14
|
+
return prototype === Object.prototype || prototype === null;
|
|
15
|
+
};
|
|
16
|
+
function inferZodSchemaFromValue({ value, z, zodTypes, path, }) {
|
|
17
|
+
var _a;
|
|
18
|
+
if (typeof value === 'string') {
|
|
19
|
+
const key = (_a = path.at(-1)) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
20
|
+
if (key === 'type') {
|
|
21
|
+
return z.literal(value);
|
|
22
|
+
}
|
|
23
|
+
const keySuggestsColor = key === null || key === void 0 ? void 0 : key.includes('color');
|
|
24
|
+
if (zodTypes && (keySuggestsColor || hasUnambiguousColorSyntax(value))) {
|
|
25
|
+
try {
|
|
26
|
+
zodTypes.ZodZypesInternals.parseColor(value);
|
|
27
|
+
return zodTypes.zColor();
|
|
28
|
+
}
|
|
29
|
+
catch (_b) { }
|
|
30
|
+
}
|
|
31
|
+
return z.string();
|
|
32
|
+
}
|
|
33
|
+
if (typeof value === 'number') {
|
|
34
|
+
return z.number();
|
|
35
|
+
}
|
|
36
|
+
if (typeof value === 'boolean') {
|
|
37
|
+
return z.boolean();
|
|
38
|
+
}
|
|
39
|
+
if (value === null) {
|
|
40
|
+
return z.null();
|
|
41
|
+
}
|
|
42
|
+
if (typeof value === 'undefined') {
|
|
43
|
+
return z.undefined();
|
|
44
|
+
}
|
|
45
|
+
if (value instanceof Date) {
|
|
46
|
+
return z.date();
|
|
47
|
+
}
|
|
48
|
+
if (Array.isArray(value)) {
|
|
49
|
+
if (value.length === 0) {
|
|
50
|
+
return z.any();
|
|
51
|
+
}
|
|
52
|
+
const elementSchema = inferZodSchemaFromValue({
|
|
53
|
+
value: value[0],
|
|
54
|
+
z,
|
|
55
|
+
zodTypes,
|
|
56
|
+
path,
|
|
57
|
+
});
|
|
58
|
+
if (!value.every((item) => (0, zod_schema_type_1.zodSafeParse)(elementSchema, item).success)) {
|
|
59
|
+
return z.any();
|
|
60
|
+
}
|
|
61
|
+
return z.array(elementSchema);
|
|
62
|
+
}
|
|
63
|
+
if (isPlainObject(value)) {
|
|
64
|
+
return z.object(Object.fromEntries(Object.entries(value).map(([key, child]) => [
|
|
65
|
+
key,
|
|
66
|
+
inferZodSchemaFromValue({
|
|
67
|
+
value: child,
|
|
68
|
+
z,
|
|
69
|
+
zodTypes,
|
|
70
|
+
path: [...path, key],
|
|
71
|
+
}),
|
|
72
|
+
])));
|
|
73
|
+
}
|
|
74
|
+
return z.any();
|
|
75
|
+
}
|
|
76
|
+
function resolveCompositionSchema({ explicitSchema, defaultProps, z, zodTypes, }) {
|
|
77
|
+
if (!z) {
|
|
78
|
+
return 'no-zod';
|
|
79
|
+
}
|
|
80
|
+
if (explicitSchema) {
|
|
81
|
+
if (typeof explicitSchema.safeParse !== 'function') {
|
|
82
|
+
throw new Error('A value which is not a Zod schema was passed to `schema`');
|
|
83
|
+
}
|
|
84
|
+
return explicitSchema;
|
|
85
|
+
}
|
|
86
|
+
if (Object.keys(defaultProps).length === 0) {
|
|
87
|
+
return 'no-schema';
|
|
88
|
+
}
|
|
89
|
+
return inferZodSchemaFromValue({
|
|
90
|
+
value: defaultProps,
|
|
91
|
+
z,
|
|
92
|
+
zodTypes,
|
|
93
|
+
path: [],
|
|
94
|
+
});
|
|
95
|
+
}
|
|
@@ -6,6 +6,7 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
6
6
|
const web_renderer_1 = require("@remotion/web-renderer");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const ShortcutHint_1 = require("../../error-overlay/remotion-overlay/ShortcutHint");
|
|
9
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
9
10
|
const audio_1 = require("../../icons/audio");
|
|
10
11
|
const certificate_1 = require("../../icons/certificate");
|
|
11
12
|
const file_1 = require("../../icons/file");
|
|
@@ -105,6 +106,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
105
106
|
? 'video'
|
|
106
107
|
: 'still');
|
|
107
108
|
const [tab, setTab] = (0, react_1.useState)('general');
|
|
109
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
108
110
|
const [imageFormat, setImageFormat] = (0, react_1.useState)(() => initialStillImageFormat !== null && initialStillImageFormat !== void 0 ? initialStillImageFormat : 'png');
|
|
109
111
|
const [frame, setFrame] = (0, react_1.useState)(() => initialFrame);
|
|
110
112
|
const [logLevel, setLogLevel] = (0, react_1.useState)(() => initialLogLevel);
|
|
@@ -418,11 +420,11 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
418
420
|
jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), jsx_runtime_1.jsx("div", { style: render_modals_1.flexer }), jsx_runtime_1.jsxs(Button_1.Button, { autoFocus: true, onClick: onAddToQueue, style: render_modals_1.buttonStyle, disabled: !outnameValidation.valid, children: ["Render ", renderMode, jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })
|
|
419
421
|
] })
|
|
420
422
|
] }), jsx_runtime_1.jsxs("div", { style: render_modals_1.horizontalLayout, children: [
|
|
421
|
-
jsx_runtime_1.jsxs("div", { style: render_modals_1.leftSidebar, children: [jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(file_1.FileIcon, { color: color, style: render_modals_1.icon }) })), children: "General" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(input_props_1.InputPropsIcon, { color: color, style: render_modals_1.icon }) })), children: "Input Props" }), renderMode !== 'audio' ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: render_modals_1.icon }) })), children: "Picture" })) : null, renderMode === 'video' || renderMode === 'audio' ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(audio_1.AudioIcon, { color: color, style: render_modals_1.icon }) })), children: "Audio" })) : null, jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(gear_1.GearIcon, { color: color, style: render_modals_1.icon }) })), children: "Other" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: false, onClick: () => setSelectedModal({
|
|
423
|
+
jsx_runtime_1.jsxs("div", { style: render_modals_1.leftSidebar, children: [jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(file_1.FileIcon, { color: color, style: render_modals_1.icon }) })), children: "General" }), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(input_props_1.InputPropsIcon, { color: color, style: render_modals_1.icon }) })), children: "Input Props" }), renderMode !== 'audio' ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: render_modals_1.icon }) })), children: "Picture" })) : null, renderMode === 'video' || renderMode === 'audio' ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(audio_1.AudioIcon, { color: color, style: render_modals_1.icon }) })), children: "Audio" })) : null, jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(gear_1.GearIcon, { color: color, style: render_modals_1.icon }) })), children: "Other" }), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: false, onClick: () => setSelectedModal({
|
|
422
424
|
type: 'settings',
|
|
423
425
|
initialTab: 'license',
|
|
424
426
|
initialPublicLicenseKey: publicLicenseKey,
|
|
425
|
-
}), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { color: color, style: render_modals_1.icon }) })), children: "License" })] }), jsx_runtime_1.jsx("div", { style: render_modals_1.optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? (jsx_runtime_1.jsx(WebRenderModalBasic_1.WebRenderModalBasic, { renderMode: renderMode, resolvedComposition: resolvedComposition, imageFormat: imageFormat, setStillFormat: setStillFormat, frame: frame, onFrameChanged: onFrameChanged, onFrameSetDirectly: onFrameSetDirectly, container: container, setContainerFormat: setContainerFormat, setCodec: setCodecWithContainer, encodableVideoCodecs: encodableVideoCodecs, effectiveVideoCodec: effectiveVideoCodec, startFrame: finalStartFrame, setStartFrame: setStartFrame, endFrame: finalEndFrame, setEndFrame: setEndFrame, outName: outName, onOutNameChange: onOutNameChange, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message, logLevel: logLevel, setLogLevel: setLogLevel })) : tab === 'data' ? (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { defaultProps: inputProps, setDefaultProps: setInputProps, unresolvedComposition: unresolvedComposition, propsEditType: "input-props", canSaveDefaultProps: {
|
|
427
|
+
}), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { color: color, style: render_modals_1.icon }) })), children: "License" }))] }), jsx_runtime_1.jsx("div", { style: render_modals_1.optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? (jsx_runtime_1.jsx(WebRenderModalBasic_1.WebRenderModalBasic, { renderMode: renderMode, resolvedComposition: resolvedComposition, imageFormat: imageFormat, setStillFormat: setStillFormat, frame: frame, onFrameChanged: onFrameChanged, onFrameSetDirectly: onFrameSetDirectly, container: container, setContainerFormat: setContainerFormat, setCodec: setCodecWithContainer, encodableVideoCodecs: encodableVideoCodecs, effectiveVideoCodec: effectiveVideoCodec, startFrame: finalStartFrame, setStartFrame: setStartFrame, endFrame: finalEndFrame, setEndFrame: setEndFrame, outName: outName, onOutNameChange: onOutNameChange, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message, logLevel: logLevel, setLogLevel: setLogLevel })) : tab === 'data' ? (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { defaultProps: inputProps, setDefaultProps: setInputProps, unresolvedComposition: unresolvedComposition, propsEditType: "input-props", canSaveDefaultProps: {
|
|
426
428
|
canUpdate: false,
|
|
427
429
|
reason: 'render dialogue',
|
|
428
430
|
determined: false,
|
|
@@ -4,6 +4,7 @@ exports.RenderQueueItem = 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 browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
7
8
|
const colors_1 = require("../../helpers/colors");
|
|
8
9
|
const url_state_1 = require("../../helpers/url-state");
|
|
9
10
|
const layout_1 = require("../layout");
|
|
@@ -54,6 +55,7 @@ const RenderQueueItem = ({ job, selected }) => {
|
|
|
54
55
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
55
56
|
const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
|
|
56
57
|
const isClientJob = (0, context_1.isClientRenderJob)(job);
|
|
58
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
57
59
|
const { canDrag, isDragging, onDragEnd, onDragStart } = (0, use_render_output_file_drag_1.useRenderOutputFileDrag)(job);
|
|
58
60
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
59
61
|
setHovered(true);
|
|
@@ -147,6 +149,6 @@ const RenderQueueItem = ({ job, selected }) => {
|
|
|
147
149
|
return (jsx_runtime_1.jsxs(layout_1.Row, { "data-render-queue-item": job.id, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: containerStyle, align: "center", onClick: onClick, draggable: canDrag, onDragStart: onDragStart, onDragEnd: onDragEnd, className: selected ? SELECTED_CLASSNAME : undefined, children: [
|
|
148
150
|
jsx_runtime_1.jsx(RenderQueueItemStatus_1.RenderQueueItemStatus, { job: job }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs("div", { style: right, children: [
|
|
149
151
|
jsx_runtime_1.jsx("div", { style: title, children: job.compositionId }), jsx_runtime_1.jsx("div", { style: subtitle, children: job.status === 'done' ? (jsx_runtime_1.jsx(RenderQueueOutputName_1.RenderQueueOutputName, { job: job })) : job.status === 'failed' ? (jsx_runtime_1.jsx(RenderQueueError_1.RenderQueueError, { job: job })) : job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueProgressMessage_1.RenderQueueProgressMessage, { job: job })) : job.status === 'saving' ? (jsx_runtime_1.jsx(RenderQueueSavingMessage_1.RenderQueueSavingMessage, {})) : job.status === 'cancelled' ? (jsx_runtime_1.jsx(RenderQueueCancelledMessage_1.RenderQueueCancelledMessage, {})) : null })
|
|
150
|
-
] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), !isDragging ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [canCopyToClipboard ? (jsx_runtime_1.jsx(RenderQueueCopyToClipboard_1.RenderQueueCopyToClipboard, { job: job })) : null, canRepeat ? jsx_runtime_1.jsx(RenderQueueRepeat_1.RenderQueueRepeatItem, { job: job }) : null, job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueItemCancelButton_1.RenderQueueCancelButton, { job: job })) : (jsx_runtime_1.jsx(RenderQueueRemoveItem_1.RenderQueueRemoveItem, { job: job })), job.status === 'done' ? (clientBlobInfo ? (jsx_runtime_1.jsx(RenderQueueDownloadItem_1.RenderQueueDownloadItem, { job: job })) : (jsx_runtime_1.jsx(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }))) : null] })) : null] }));
|
|
152
|
+
] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), !isDragging ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [canCopyToClipboard ? (jsx_runtime_1.jsx(RenderQueueCopyToClipboard_1.RenderQueueCopyToClipboard, { job: job })) : null, canRepeat ? jsx_runtime_1.jsx(RenderQueueRepeat_1.RenderQueueRepeatItem, { job: job }) : null, job.status === 'running' ? (jsx_runtime_1.jsx(RenderQueueItemCancelButton_1.RenderQueueCancelButton, { job: job })) : isBrowserStudio ? null : (jsx_runtime_1.jsx(RenderQueueRemoveItem_1.RenderQueueRemoveItem, { job: job })), job.status === 'done' ? (clientBlobInfo ? (jsx_runtime_1.jsx(RenderQueueDownloadItem_1.RenderQueueDownloadItem, { job: job })) : isBrowserStudio ? null : (jsx_runtime_1.jsx(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }))) : null] })) : null] }));
|
|
151
153
|
};
|
|
152
154
|
exports.RenderQueueItem = RenderQueueItem;
|
|
@@ -3,12 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenderQueueOpenInFinderItem = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
6
7
|
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const folder_1 = require("../../icons/folder");
|
|
8
9
|
const InlineAction_1 = require("../InlineAction");
|
|
9
10
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
10
11
|
const actions_1 = require("./actions");
|
|
11
12
|
const RenderQueueOpenInFinderItem = ({ job }) => {
|
|
13
|
+
const isBrowserStudio = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
12
14
|
const onClick = (0, react_1.useCallback)((e) => {
|
|
13
15
|
e.stopPropagation();
|
|
14
16
|
(0, actions_1.openInFileExplorer)({ directory: job.outName }).catch((err) => {
|
|
@@ -24,6 +26,6 @@ const RenderQueueOpenInFinderItem = ({ job }) => {
|
|
|
24
26
|
const renderAction = (0, react_1.useCallback)((color) => {
|
|
25
27
|
return jsx_runtime_1.jsx(folder_1.ExpandedFolderIconSolid, { style: icon, color: color });
|
|
26
28
|
}, [icon]);
|
|
27
|
-
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, variant: null }));
|
|
29
|
+
return isBrowserStudio ? null : (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, variant: null }));
|
|
28
30
|
};
|
|
29
31
|
exports.RenderQueueOpenInFinderItem = RenderQueueOpenInFinderItem;
|