@remotion/studio 4.0.495 → 4.0.497
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/AssetSelectorItem.js +7 -7
- package/dist/components/AudioWaveform.js +1 -11
- package/dist/components/Canvas.js +22 -203
- package/dist/components/CompositionSelectorItem.js +5 -31
- package/dist/components/CurrentAsset.js +4 -3
- package/dist/components/InlineCompositionName.js +1 -1
- package/dist/components/InlineEditableTitle.d.ts +1 -0
- package/dist/components/InlineEditableTitle.js +56 -11
- package/dist/components/InspectorInfoHeader.d.ts +2 -0
- package/dist/components/InspectorInfoHeader.js +16 -4
- package/dist/components/InspectorLocationCopy.js +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -0
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +11 -6
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +27 -2
- package/dist/components/InspectorPanel/EasingInspector.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +7 -8
- package/dist/components/InspectorPanel/KeyframeSettings.js +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +28 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +67 -10
- package/dist/components/InspectorPanel/common.d.ts +4 -2
- package/dist/components/InspectorPanel/common.js +18 -18
- package/dist/components/InspectorPanel/styles.d.ts +0 -3
- package/dist/components/InspectorPanel/styles.js +5 -40
- package/dist/components/InspectorPanel/use-composition-actions.js +6 -2
- package/dist/components/InspectorSequenceSection.js +12 -2
- package/dist/components/InspectorSourceLocation.d.ts +1 -0
- package/dist/components/InspectorSourceLocation.js +5 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -1
- package/dist/components/NewComposition/CodemodFooter.js +23 -4
- package/dist/components/NewComposition/ComboBox.d.ts +2 -1
- package/dist/components/NewComposition/ComboBox.js +32 -7
- package/dist/components/NewComposition/InputDragger.d.ts +6 -0
- package/dist/components/NewComposition/InputDragger.js +12 -3
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.js +1 -1
- package/dist/components/PlaybackRateSelector.js +3 -3
- package/dist/components/PreviewToolbar.js +3 -3
- package/dist/components/RenderButton.d.ts +1 -0
- package/dist/components/RenderButton.js +51 -7
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/SelectedOutlineElement.js +56 -88
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +9 -10
- package/dist/components/SizeSelector.js +3 -3
- package/dist/components/Timeline/Timeline.js +10 -3
- package/dist/components/Timeline/TimelineAssetDropIndicator.d.ts +2 -0
- package/dist/components/Timeline/TimelineAssetDropIndicator.js +37 -0
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +1 -7
- package/dist/components/Timeline/TimelineEnumField.js +1 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeControls.js +26 -6
- package/dist/components/Timeline/TimelineRowChrome.js +10 -2
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +3 -0
- package/dist/components/Timeline/TimelineRowLayoutContext.js +6 -0
- package/dist/components/Timeline/TimelineScrollable.js +3 -2
- package/dist/components/Timeline/TimelineSelection.d.ts +4 -0
- package/dist/components/Timeline/TimelineSelection.js +40 -5
- package/dist/components/Timeline/TimelineSequence.js +20 -8
- package/dist/components/Timeline/TimelineSequenceFrame.js +2 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +2 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +4 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +15 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +96 -18
- package/dist/components/Timeline/TimelineTimeIndicators.d.ts +16 -0
- package/dist/components/Timeline/TimelineTimeIndicators.js +154 -35
- package/dist/components/Timeline/TimelineTranslateField.js +2 -1
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +4 -1
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +5 -4
- package/dist/components/Timeline/disable-sequence-interactivity.js +2 -0
- package/dist/components/Timeline/get-timeline-media-visualization-layout.d.ts +8 -0
- package/dist/components/Timeline/get-timeline-media-visualization-layout.js +10 -0
- package/dist/components/Timeline/get-timeline-video-info-widths.js +11 -3
- package/dist/components/Timeline/keyframe-clipboard.js +21 -5
- package/dist/components/Timeline/reset-selected-timeline-props.js +2 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +5 -3
- package/dist/components/Timeline/save-sequence-prop.js +43 -18
- package/dist/components/Timeline/should-clear-selection-on-pointer-down.d.ts +2 -0
- package/dist/components/Timeline/should-clear-selection-on-pointer-down.js +1 -1
- package/dist/components/Timeline/timeline-asset-drop-context.d.ts +1 -0
- package/dist/components/Timeline/timeline-asset-drop-context.js +5 -0
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +10 -1
- package/dist/components/Timeline/use-rename-sequence.js +2 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +2 -0
- package/dist/components/Timeline/use-timeline-asset-drop.d.ts +1 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +168 -0
- package/dist/components/composition-menu-items.d.ts +15 -1
- package/dist/components/composition-menu-items.js +137 -107
- package/dist/components/drop-handler-data.d.ts +13 -0
- package/dist/components/drop-handler-data.js +117 -0
- package/dist/components/handle-drop.d.ts +13 -0
- package/dist/components/handle-drop.js +115 -0
- package/dist/components/import-assets.d.ts +26 -8
- package/dist/components/import-assets.js +161 -49
- package/dist/components/layout.d.ts +1 -0
- package/dist/components/layout.js +2 -1
- package/dist/components/open-in-new-window.d.ts +2 -0
- package/dist/components/open-in-new-window.js +28 -0
- package/dist/components/selected-outline-drag.d.ts +11 -1
- package/dist/components/selected-outline-drag.js +74 -1
- package/dist/esm/{chunk-784jbkzs.js → chunk-5wj95bdd.js} +4760 -3701
- package/dist/esm/internals.mjs +4760 -3701
- package/dist/esm/previewEntry.mjs +4962 -3903
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/inject-css.js +4 -2
- package/dist/helpers/is-video-with-last-frame-hold.d.ts +2 -0
- package/dist/helpers/is-video-with-last-frame-hold.js +9 -0
- package/dist/helpers/url-state.d.ts +1 -0
- package/dist/helpers/url-state.js +5 -1
- package/dist/helpers/use-max-media-duration.js +5 -3
- package/dist/helpers/use-menu-structure.js +2 -0
- package/dist/icons/duplicate.d.ts +5 -0
- package/dist/icons/duplicate.js +10 -0
- package/dist/icons/scissors.js +1 -1
- package/dist/icons/snowflake.d.ts +5 -0
- package/dist/icons/snowflake.js +10 -0
- package/dist/icons/trash.d.ts +5 -0
- package/dist/icons/trash.js +8 -0
- package/package.json +11 -11
|
@@ -5,10 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const client_id_1 = require("../helpers/client-id");
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
|
|
8
9
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
9
10
|
const plus_1 = require("../icons/plus");
|
|
10
11
|
const modals_1 = require("../state/modals");
|
|
11
|
-
const
|
|
12
|
+
const AssetFileIcon_1 = require("./AssetFileIcon");
|
|
12
13
|
const InlineAction_1 = require("./InlineAction");
|
|
13
14
|
const common_1 = require("./InspectorPanel/common");
|
|
14
15
|
const styles_1 = require("./InspectorPanel/styles");
|
|
@@ -41,6 +42,11 @@ const plusIcon = {
|
|
|
41
42
|
width: 15,
|
|
42
43
|
height: 15,
|
|
43
44
|
};
|
|
45
|
+
const assetSelectorIcon = {
|
|
46
|
+
flexShrink: 0,
|
|
47
|
+
height: 18,
|
|
48
|
+
width: 18,
|
|
49
|
+
};
|
|
44
50
|
const remoteSourceLabel = {
|
|
45
51
|
color: colors_1.LIGHT_TEXT,
|
|
46
52
|
display: 'flex',
|
|
@@ -135,6 +141,7 @@ const hasSequenceControls = (sequence) => {
|
|
|
135
141
|
};
|
|
136
142
|
exports.hasSequenceControls = hasSequenceControls;
|
|
137
143
|
const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderTransformControls, }) => {
|
|
144
|
+
var _a;
|
|
138
145
|
const { tree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
139
146
|
sequence,
|
|
140
147
|
nodePathInfo,
|
|
@@ -155,6 +162,9 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
155
162
|
(0, timeline_asset_link_1.openTimelineAssetLink)(localAsset, selectAsset);
|
|
156
163
|
}
|
|
157
164
|
}, [localAsset, selectAsset]);
|
|
165
|
+
const localAssetFileName = localAsset
|
|
166
|
+
? ((_a = localAsset.assetPath.split('/').pop()) !== null && _a !== void 0 ? _a : localAsset.assetPath)
|
|
167
|
+
: null;
|
|
158
168
|
const getIsExpanded = (0, react_1.useCallback)((candidate) => {
|
|
159
169
|
return !collapsedKeys.has(getInspectorExpansionKey(candidate));
|
|
160
170
|
}, [collapsedKeys]);
|
|
@@ -232,7 +242,7 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
232
242
|
if (controlRows.length === 0 && !showEffectsSection) {
|
|
233
243
|
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Controls", children: jsx_runtime_1.jsx("div", { style: emptyState, children: "No schema" }) }) }));
|
|
234
244
|
}
|
|
235
|
-
return (jsx_runtime_1.jsxs("div", { style: container, children: [controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group) => (jsx_runtime_1.jsxs(common_1.InspectorSection, { header: group.label, children: [group.id === 'source' && localAsset ? (jsx_runtime_1.jsx(
|
|
245
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group) => (jsx_runtime_1.jsxs(common_1.InspectorSection, { header: group.label, children: [group.id === 'source' && localAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: jumpToAsset, renderIcon: (color) => (jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { color: color, fileType: (0, get_preview_file_type_1.getPreviewFileType)(localAsset.assetPath), style: assetSelectorIcon })), size: "compact", title: localAsset.assetPath, children: localAssetFileName })) : null, group.id === 'source' && remoteAsset && remoteSourceParts ? (jsx_runtime_1.jsxs("div", { style: remoteSourceLabel, title: remoteAsset.href, children: [
|
|
236
246
|
jsx_runtime_1.jsx("span", { style: remoteSourceLeading, children: remoteSourceParts.leading }), jsx_runtime_1.jsx("span", { style: remoteSourceTrailing, children: remoteSourceParts.trailing })
|
|
237
247
|
] })) : null, group.id === 'transforms' ? renderTransformControls() : null, group.id === 'source' ? null : group.rows.map(renderRow)] }, group.id))) })) : null, showEffectsSection ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: effectsHeader, children: effectRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) })) : null })) : null] }));
|
|
238
248
|
};
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const format_file_location_1 = require("../helpers/format-file-location");
|
|
8
|
+
const common_1 = require("./InspectorPanel/common");
|
|
8
9
|
const source_attribution_1 = require("./Timeline/TimelineStack/source-attribution");
|
|
9
10
|
const sourceLocationStyle = {
|
|
10
11
|
alignSelf: 'flex-start',
|
|
@@ -40,7 +41,7 @@ const sourceLocationLabelStyle = {
|
|
|
40
41
|
textOverflow: 'ellipsis',
|
|
41
42
|
whiteSpace: 'nowrap',
|
|
42
43
|
};
|
|
43
|
-
const InspectorSourceLocation = ({ location, canOpen, onOpen, renderIcon }) => {
|
|
44
|
+
const InspectorSourceLocation = ({ location, canOpen, onOpen, renderIcon, size = 'default' }) => {
|
|
44
45
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
45
46
|
const validLocation = (0, react_1.useMemo)(() => {
|
|
46
47
|
if (!(location === null || location === void 0 ? void 0 : location.source) || location.line === null) {
|
|
@@ -80,6 +81,9 @@ const InspectorSourceLocation = ({ location, canOpen, onOpen, renderIcon }) => {
|
|
|
80
81
|
if (!label) {
|
|
81
82
|
return null;
|
|
82
83
|
}
|
|
84
|
+
if (size === 'inline-action') {
|
|
85
|
+
return (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canOpen, onClick: onClick, renderIcon: (iconColor) => renderIcon === null || renderIcon === void 0 ? void 0 : renderIcon(iconColor), size: "compact", title: fileLocation !== null && fileLocation !== void 0 ? fileLocation : undefined, children: label }));
|
|
86
|
+
}
|
|
83
87
|
return (jsx_runtime_1.jsxs("button", { type: "button", style: style, title: fileLocation !== null && fileLocation !== void 0 ? fileLocation : undefined, onClick: onClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [renderIcon ? renderIcon(color) : null, jsx_runtime_1.jsx("span", { style: sourceLocationLabelStyle, children: label })
|
|
84
88
|
] }));
|
|
85
89
|
};
|
|
@@ -8,7 +8,7 @@ export declare const CodemodFooter: React.FC<{
|
|
|
8
8
|
readonly valid: boolean;
|
|
9
9
|
readonly codemod: RecastCodemod;
|
|
10
10
|
readonly stack: string | null;
|
|
11
|
-
readonly loadingNotification: React.ReactNode;
|
|
11
|
+
readonly loadingNotification: React.ReactNode | null;
|
|
12
12
|
readonly successNotification: React.ReactNode;
|
|
13
13
|
readonly errorNotification: string;
|
|
14
14
|
readonly genericSubmitLabel: string;
|
|
@@ -34,21 +34,40 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
34
34
|
const trigger = (0, react_1.useCallback)(() => {
|
|
35
35
|
setSubmitting(true);
|
|
36
36
|
setSelectedModal(null);
|
|
37
|
-
const notification =
|
|
37
|
+
const notification = loadingNotification === null
|
|
38
|
+
? null
|
|
39
|
+
: (0, NotificationCenter_1.showNotification)(loadingNotification, null);
|
|
38
40
|
applyCodemod({
|
|
39
41
|
symbolicatedStack,
|
|
40
42
|
signal: new AbortController().signal,
|
|
41
43
|
})
|
|
42
44
|
.then((result) => {
|
|
43
45
|
if (!result.success) {
|
|
44
|
-
|
|
46
|
+
const message = `${errorNotification}: ${result.reason}`;
|
|
47
|
+
if (notification) {
|
|
48
|
+
notification.replaceContent(message, 2000);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
(0, NotificationCenter_1.showNotification)(message, 2000);
|
|
52
|
+
}
|
|
45
53
|
return;
|
|
46
54
|
}
|
|
47
|
-
notification
|
|
55
|
+
if (notification) {
|
|
56
|
+
notification.replaceContent(successNotification, 2000);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
(0, NotificationCenter_1.showNotification)(successNotification, 2000);
|
|
60
|
+
}
|
|
48
61
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
49
62
|
})
|
|
50
63
|
.catch((err) => {
|
|
51
|
-
|
|
64
|
+
const message = `${errorNotification}: ${err.message}`;
|
|
65
|
+
if (notification) {
|
|
66
|
+
notification.replaceContent(message, 2000);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
(0, NotificationCenter_1.showNotification)(message, 2000);
|
|
70
|
+
}
|
|
52
71
|
});
|
|
53
72
|
}, [
|
|
54
73
|
applyCodemod,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type ComboboxSize = 'default' | 'compact' | 'small';
|
|
2
3
|
type DividerItem = {
|
|
3
4
|
type: 'divider';
|
|
4
5
|
id: string;
|
|
@@ -26,6 +27,6 @@ export declare const Combobox: React.FC<{
|
|
|
26
27
|
readonly selectedId: string | number;
|
|
27
28
|
readonly style?: React.CSSProperties;
|
|
28
29
|
readonly title: string;
|
|
29
|
-
readonly
|
|
30
|
+
readonly size?: ComboboxSize;
|
|
30
31
|
}>;
|
|
31
32
|
export {};
|
|
@@ -24,8 +24,17 @@ const container = {
|
|
|
24
24
|
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
25
25
|
borderWidth: 1,
|
|
26
26
|
borderStyle: 'solid',
|
|
27
|
+
borderRadius: 4,
|
|
28
|
+
fontFamily: 'inherit',
|
|
27
29
|
maxWidth: '100%',
|
|
28
30
|
};
|
|
31
|
+
const compactContainer = {
|
|
32
|
+
...container,
|
|
33
|
+
boxSizing: 'border-box',
|
|
34
|
+
borderRadius: 0,
|
|
35
|
+
height: layout_1.COMPACT_CONTROL_ROW_HEIGHT + 2,
|
|
36
|
+
padding: '5px 6px',
|
|
37
|
+
};
|
|
29
38
|
const smallContainer = {
|
|
30
39
|
...container,
|
|
31
40
|
padding: '3px 4px',
|
|
@@ -34,16 +43,25 @@ const label = {
|
|
|
34
43
|
flex: 1,
|
|
35
44
|
overflow: 'hidden',
|
|
36
45
|
textOverflow: 'ellipsis',
|
|
46
|
+
color: 'inherit',
|
|
47
|
+
fontFamily: 'inherit',
|
|
37
48
|
fontSize: 14,
|
|
49
|
+
lineHeight: '21px',
|
|
50
|
+
minWidth: 0,
|
|
38
51
|
textAlign: 'left',
|
|
39
52
|
whiteSpace: 'nowrap',
|
|
40
53
|
};
|
|
54
|
+
const compactLabel = {
|
|
55
|
+
...label,
|
|
56
|
+
fontSize: 12,
|
|
57
|
+
lineHeight: '16px',
|
|
58
|
+
};
|
|
41
59
|
const smallLabel = {
|
|
42
60
|
...label,
|
|
43
61
|
fontSize: 11,
|
|
44
|
-
lineHeight:
|
|
62
|
+
lineHeight: '12px',
|
|
45
63
|
};
|
|
46
|
-
const Combobox = ({ values, selectedId, style: customStyle, title,
|
|
64
|
+
const Combobox = ({ values, selectedId, style: customStyle, title, size: controlSize = 'default', }) => {
|
|
47
65
|
const [hovered, setIsHovered] = (0, react_1.useState)(false);
|
|
48
66
|
const [opened, setOpened] = (0, react_1.useState)(false);
|
|
49
67
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -163,7 +181,11 @@ const Combobox = ({ values, selectedId, style: customStyle, title, small = false
|
|
|
163
181
|
const selected = values.find((v) => v.id === selectedId);
|
|
164
182
|
const style = (0, react_1.useMemo)(() => {
|
|
165
183
|
return {
|
|
166
|
-
...(
|
|
184
|
+
...(controlSize === 'small'
|
|
185
|
+
? smallContainer
|
|
186
|
+
: controlSize === 'compact'
|
|
187
|
+
? compactContainer
|
|
188
|
+
: container),
|
|
167
189
|
...(customStyle !== null && customStyle !== void 0 ? customStyle : {}),
|
|
168
190
|
userSelect: 'none',
|
|
169
191
|
WebkitUserSelect: 'none',
|
|
@@ -177,11 +199,14 @@ const Combobox = ({ values, selectedId, style: customStyle, title, small = false
|
|
|
177
199
|
? colors_1.WHITE_ALPHA_05
|
|
178
200
|
: colors_1.BLACK_ALPHA_60,
|
|
179
201
|
};
|
|
180
|
-
}, [customStyle, hovered, opened
|
|
202
|
+
}, [controlSize, customStyle, hovered, opened]);
|
|
203
|
+
const selectedLabelStyle = controlSize === 'small'
|
|
204
|
+
? smallLabel
|
|
205
|
+
: controlSize === 'compact'
|
|
206
|
+
? compactLabel
|
|
207
|
+
: label;
|
|
181
208
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
182
|
-
jsx_runtime_1.jsxs("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style:
|
|
183
|
-
" ",
|
|
184
|
-
jsx_runtime_1.jsx(caret_1.CaretDown, { small: small })
|
|
209
|
+
jsx_runtime_1.jsxs("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: selectedLabelStyle, children: selected === null || selected === void 0 ? void 0 : selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: controlSize === 'default' ? 1 : 0.5 }), ' ', jsx_runtime_1.jsx(caret_1.CaretDown, { small: controlSize === 'small' })
|
|
185
210
|
] }), portalStyle
|
|
186
211
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, onPointerDown: onOverlayPointerDown, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => selected && v.id === selected.id), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
187
212
|
: null] }));
|
|
@@ -16,6 +16,11 @@ export declare const isInputDraggerValueInRange: ({ max, min, value, }: {
|
|
|
16
16
|
readonly min: string | number | undefined;
|
|
17
17
|
readonly value: number;
|
|
18
18
|
}) => boolean;
|
|
19
|
+
export declare const deriveInputDraggerValueDiff: ({ dragSensitivity, step, xDistance, }: {
|
|
20
|
+
readonly dragSensitivity: number;
|
|
21
|
+
readonly step: number;
|
|
22
|
+
readonly xDistance: number;
|
|
23
|
+
}) => number;
|
|
19
24
|
export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
20
25
|
readonly onValueChange: (newVal: number) => void;
|
|
21
26
|
readonly onValueChangeEnd?: ((newVal: number) => void) | undefined;
|
|
@@ -26,4 +31,5 @@ export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttr
|
|
|
26
31
|
readonly small?: boolean | undefined;
|
|
27
32
|
readonly snapToStep?: boolean | undefined;
|
|
28
33
|
readonly dragDecimalPlaces?: number | undefined;
|
|
34
|
+
readonly dragSensitivity?: number | undefined;
|
|
29
35
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InputDragger = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = exports.inputDraggerContainerStyle = void 0;
|
|
36
|
+
exports.InputDragger = exports.deriveInputDraggerValueDiff = exports.isInputDraggerValueInRange = exports.deriveInputDraggerDragStartValue = exports.deriveInputDraggerStep = exports.inputDraggerContainerStyle = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
@@ -92,7 +92,11 @@ const isInputDraggerValueInRange = ({ max, min, value, }) => {
|
|
|
92
92
|
(!Number.isFinite(numericMax) || value <= numericMax));
|
|
93
93
|
};
|
|
94
94
|
exports.isInputDraggerValueInRange = isInputDraggerValueInRange;
|
|
95
|
-
const
|
|
95
|
+
const deriveInputDraggerValueDiff = ({ dragSensitivity, step, xDistance, }) => {
|
|
96
|
+
return (0, remotion_1.interpolate)(xDistance, [-5, -4, 0, 4, 5], [-step * dragSensitivity, 0, 0, 0, step * dragSensitivity]);
|
|
97
|
+
};
|
|
98
|
+
exports.deriveInputDraggerValueDiff = deriveInputDraggerValueDiff;
|
|
99
|
+
const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min, max: _max, step: _step, value, onTextChange, formatter = (q) => String(q), status, rightAlign, small, snapToStep = true, dragDecimalPlaces, dragSensitivity = 1, ...props }, ref) => {
|
|
96
100
|
const [inputFallback, setInputFallback] = (0, react_1.useState)(false);
|
|
97
101
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
98
102
|
const fallbackRef = (0, react_1.useRef)(null);
|
|
@@ -195,7 +199,11 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
195
199
|
(0, ForceSpecificCursor_1.forceSpecificCursor)('ew-resize');
|
|
196
200
|
target.blur();
|
|
197
201
|
}
|
|
198
|
-
const diff = (0,
|
|
202
|
+
const diff = (0, exports.deriveInputDraggerValueDiff)({
|
|
203
|
+
dragSensitivity,
|
|
204
|
+
step,
|
|
205
|
+
xDistance,
|
|
206
|
+
});
|
|
199
207
|
const newValue = Math.min(max, Math.max(min, dragStartValue + diff));
|
|
200
208
|
const nextValue = snapToStep
|
|
201
209
|
? roundToStep(newValue, step)
|
|
@@ -229,6 +237,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
229
237
|
onValueChangeEnd,
|
|
230
238
|
snapToStep,
|
|
231
239
|
dragDecimalPlaces,
|
|
240
|
+
dragSensitivity,
|
|
232
241
|
]);
|
|
233
242
|
(0, react_1.useEffect)(() => {
|
|
234
243
|
var _a;
|
|
@@ -125,7 +125,7 @@ const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
|
125
125
|
] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
126
126
|
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 }) })
|
|
127
127
|
] })
|
|
128
|
-
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification:
|
|
128
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: null, 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({
|
|
129
129
|
signal,
|
|
130
130
|
symbolicatedStack,
|
|
131
131
|
}), fallbackToRootFile: true }) })
|
|
@@ -76,7 +76,7 @@ const useRenameStaticFile = ({ relativePath, staticFiles, }) => {
|
|
|
76
76
|
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' &&
|
|
77
77
|
canvasContent.asset === relativePath) {
|
|
78
78
|
setCanvasContent({ type: 'asset', asset: newRelativePath });
|
|
79
|
-
(0, url_state_1.
|
|
79
|
+
(0, url_state_1.replaceUrl)(`/assets/${newRelativePath}`);
|
|
80
80
|
}
|
|
81
81
|
notification.replaceContent(`Renamed to ${newRelativePath}`, 2000);
|
|
82
82
|
return true;
|
|
@@ -16,13 +16,13 @@ const getPlaybackRateLabel = (playbackRate) => {
|
|
|
16
16
|
return `${playbackRate}x`;
|
|
17
17
|
};
|
|
18
18
|
const accessibilityLabel = 'Change the playback rate';
|
|
19
|
-
const comboStyle = { width:
|
|
19
|
+
const comboStyle = { width: 64 };
|
|
20
20
|
const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
|
|
21
21
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
22
22
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
23
23
|
const style = (0, react_1.useMemo)(() => {
|
|
24
24
|
return {
|
|
25
|
-
padding: ControlButton_1.CONTROL_BUTTON_PADDING,
|
|
25
|
+
padding: ControlButton_1.CONTROL_BUTTON_PADDING - 2,
|
|
26
26
|
};
|
|
27
27
|
}, []);
|
|
28
28
|
const items = (0, react_1.useMemo)(() => {
|
|
@@ -54,6 +54,6 @@ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
|
|
|
54
54
|
if (isStill || canvasContent === null || canvasContent.type === 'asset') {
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
return (jsx_runtime_1.jsx("div", { style: style, "aria-label": accessibilityLabel, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: accessibilityLabel, style: comboStyle, selectedId: String(playbackRate), values: items }) }));
|
|
57
|
+
return (jsx_runtime_1.jsx("div", { style: style, "aria-label": accessibilityLabel, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { size: "compact", title: accessibilityLabel, style: comboStyle, selectedId: String(playbackRate), values: items }) }));
|
|
58
58
|
};
|
|
59
59
|
exports.PlaybackRateSelector = PlaybackRateSelector;
|
|
@@ -26,7 +26,7 @@ const SizeSelector_1 = require("./SizeSelector");
|
|
|
26
26
|
const SnappingToggle_1 = require("./SnappingToggle");
|
|
27
27
|
const TimelineZoomControls_1 = require("./Timeline/TimelineZoomControls");
|
|
28
28
|
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
29
|
-
const TOOLBAR_HEIGHT =
|
|
29
|
+
const TOOLBAR_HEIGHT = 40;
|
|
30
30
|
const container = {
|
|
31
31
|
display: 'flex',
|
|
32
32
|
justifyContent: 'center',
|
|
@@ -64,7 +64,7 @@ const scrollIndicatorRight = {
|
|
|
64
64
|
};
|
|
65
65
|
const sideContainer = {
|
|
66
66
|
width: 300,
|
|
67
|
-
height:
|
|
67
|
+
height: 30,
|
|
68
68
|
display: 'flex',
|
|
69
69
|
flexDirection: 'row',
|
|
70
70
|
alignItems: 'center',
|
|
@@ -169,7 +169,7 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
169
169
|
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, { disabled: readOnlyStudio }) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SnappingToggle_1.SnappingToggle, { disabled: readOnlyStudio }) })
|
|
170
170
|
] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, {}) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout && (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
171
171
|
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
172
|
-
jsx_runtime_1.jsx(layout_1.Flex, {}), !isMobileLayout && jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
172
|
+
jsx_runtime_1.jsx(layout_1.Flex, {}), !isMobileLayout && jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio, size: "compact" }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
173
173
|
] }), jsx_runtime_1.jsx(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), jsx_runtime_1.jsx(PlaybackRatePersistor_1.PlaybackRatePersistor, {}), jsx_runtime_1.jsx("div", { ref: rightScrollIndicatorRef, style: scrollIndicatorRight })
|
|
174
174
|
] }));
|
|
175
175
|
};
|
|
@@ -65,9 +65,47 @@ const dropdownTriggerStyle = {
|
|
|
65
65
|
const mainButtonContent = {
|
|
66
66
|
paddingLeft: 4,
|
|
67
67
|
paddingRight: 6,
|
|
68
|
+
minWidth: 0,
|
|
68
69
|
};
|
|
69
70
|
const label = {
|
|
71
|
+
color: 'inherit',
|
|
72
|
+
fontFamily: 'inherit',
|
|
70
73
|
fontSize: 14,
|
|
74
|
+
lineHeight: '21px',
|
|
75
|
+
minWidth: 0,
|
|
76
|
+
overflow: 'hidden',
|
|
77
|
+
textOverflow: 'ellipsis',
|
|
78
|
+
whiteSpace: 'nowrap',
|
|
79
|
+
};
|
|
80
|
+
const compactSplitButtonSegmentHeight = layout_1.COMPACT_CONTROL_ROW_HEIGHT;
|
|
81
|
+
const compactMainButtonStyle = {
|
|
82
|
+
...mainButtonStyle,
|
|
83
|
+
boxSizing: 'border-box',
|
|
84
|
+
height: compactSplitButtonSegmentHeight,
|
|
85
|
+
paddingLeft: 6,
|
|
86
|
+
paddingRight: 6,
|
|
87
|
+
paddingTop: 6,
|
|
88
|
+
paddingBottom: 6,
|
|
89
|
+
fontSize: 12,
|
|
90
|
+
};
|
|
91
|
+
const compactDropdownTriggerStyle = {
|
|
92
|
+
...dropdownTriggerStyle,
|
|
93
|
+
boxSizing: 'border-box',
|
|
94
|
+
height: compactSplitButtonSegmentHeight,
|
|
95
|
+
paddingLeft: 5,
|
|
96
|
+
paddingRight: 5,
|
|
97
|
+
paddingTop: 6,
|
|
98
|
+
paddingBottom: 6,
|
|
99
|
+
};
|
|
100
|
+
const compactMainButtonContent = {
|
|
101
|
+
...mainButtonContent,
|
|
102
|
+
paddingLeft: 2,
|
|
103
|
+
paddingRight: 4,
|
|
104
|
+
};
|
|
105
|
+
const compactLabel = {
|
|
106
|
+
...label,
|
|
107
|
+
fontSize: 12,
|
|
108
|
+
lineHeight: '16px',
|
|
71
109
|
};
|
|
72
110
|
const RENDER_TYPE_STORAGE_KEY = 'remotion.renderType';
|
|
73
111
|
const getInitialRenderType = (readOnlyStudio) => {
|
|
@@ -85,7 +123,7 @@ const getInitialRenderType = (readOnlyStudio) => {
|
|
|
85
123
|
}
|
|
86
124
|
return 'server-render';
|
|
87
125
|
};
|
|
88
|
-
const RenderButton = ({ readOnlyStudio, }) => {
|
|
126
|
+
const RenderButton = ({ readOnlyStudio, size: controlSize = 'default' }) => {
|
|
89
127
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
90
128
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
91
129
|
const [preferredRenderType, setPreferredRenderType] = (0, react_1.useState)(() => getInitialRenderType(readOnlyStudio));
|
|
@@ -153,11 +191,12 @@ const RenderButton = ({ readOnlyStudio, }) => {
|
|
|
153
191
|
const iconStyle = (0, react_1.useMemo)(() => {
|
|
154
192
|
return {
|
|
155
193
|
style: {
|
|
156
|
-
height: 16,
|
|
194
|
+
height: controlSize === 'compact' ? 14 : 16,
|
|
157
195
|
color: colors_1.CURRENT_COLOR,
|
|
196
|
+
flexShrink: 0,
|
|
158
197
|
},
|
|
159
198
|
};
|
|
160
|
-
}, []);
|
|
199
|
+
}, [controlSize]);
|
|
161
200
|
const video = remotion_1.Internals.useVideo();
|
|
162
201
|
const { getCurrentFrame } = player_1.PlayerInternals.usePlayer();
|
|
163
202
|
const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
@@ -385,10 +424,11 @@ const RenderButton = ({ readOnlyStudio, }) => {
|
|
|
385
424
|
return {
|
|
386
425
|
...splitButtonContainer,
|
|
387
426
|
borderColor: colors_1.BLACK_ALPHA_60,
|
|
427
|
+
borderRadius: controlSize === 'compact' ? 0 : 4,
|
|
388
428
|
opacity: 1,
|
|
389
429
|
cursor: 'pointer',
|
|
390
430
|
};
|
|
391
|
-
}, []);
|
|
431
|
+
}, [controlSize]);
|
|
392
432
|
const renderLabel = renderType === 'server-render'
|
|
393
433
|
? 'Render'
|
|
394
434
|
: renderType === 'render-command'
|
|
@@ -399,9 +439,13 @@ const RenderButton = ({ readOnlyStudio, }) => {
|
|
|
399
439
|
}
|
|
400
440
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
401
441
|
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.jsxs("div", { ref: containerRef, style: containerStyle, title: tooltip, children: [
|
|
402
|
-
jsx_runtime_1.jsx("button", { type: "button", style: mainButtonStyle, onClick: onClick, id: "render-modal-button", children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", style:
|
|
403
|
-
|
|
404
|
-
|
|
442
|
+
jsx_runtime_1.jsx("button", { type: "button", style: controlSize === 'compact' ? compactMainButtonStyle : mainButtonStyle, onClick: onClick, id: "render-modal-button", children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", style: controlSize === 'compact'
|
|
443
|
+
? compactMainButtonContent
|
|
444
|
+
: mainButtonContent, children: [
|
|
445
|
+
jsx_runtime_1.jsx(render_1.ThinRenderIcon, { fill: colors_1.CURRENT_COLOR_LOWERCASE, svgProps: iconStyle }), 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 })
|
|
446
|
+
] }) }), jsx_runtime_1.jsx("div", { style: dividerStyle }), jsx_runtime_1.jsx("button", { ref: dropdownRef, type: "button", style: controlSize === 'compact'
|
|
447
|
+
? compactDropdownTriggerStyle
|
|
448
|
+
: dropdownTriggerStyle, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, onPointerDown: onPointerDown, onClick: onClickDropdown, children: jsx_runtime_1.jsx(caret_1.CaretDown, {}) })
|
|
405
449
|
] }), portalStyle
|
|
406
450
|
? 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))
|
|
407
451
|
: null] }));
|
|
@@ -47,7 +47,7 @@ const ZodDiscriminatedUnionEditor = ({ schema, setValue, value, mayPad, jsonPath
|
|
|
47
47
|
return {
|
|
48
48
|
discriminator,
|
|
49
49
|
markup: (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
|
|
50
|
-
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: [...jsonPath, discriminator], onRemove: onRemove, suffix: null, valid: zodValidation.success }), jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: "Select type", values: comboBoxValues, selectedId: value[discriminator],
|
|
50
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: [...jsonPath, discriminator], onRemove: onRemove, suffix: null, valid: zodValidation.success }), jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: "Select type", values: comboBoxValues, selectedId: value[discriminator], size: "small" })
|
|
51
51
|
] }, 'replacement')),
|
|
52
52
|
};
|
|
53
53
|
}, [
|
|
@@ -39,7 +39,7 @@ const ZodEnumEditor = ({ schema, jsonPath, setValue, value, onRemove }) => {
|
|
|
39
39
|
}, [enumValues, onChange, value]);
|
|
40
40
|
const zodValidation = (0, react_1.useMemo)(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
|
|
41
41
|
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: true, children: [
|
|
42
|
-
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value,
|
|
42
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value, size: "small" }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
|
|
43
43
|
] }));
|
|
44
44
|
};
|
|
45
45
|
exports.ZodEnumEditor = ZodEnumEditor;
|
|
@@ -38,7 +38,7 @@ const ZodStaticFileEditor = ({ schema, jsonPath, setValue, value, onRemove, mayP
|
|
|
38
38
|
});
|
|
39
39
|
}, [onChange, staticFiles, value]);
|
|
40
40
|
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
|
|
41
|
-
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value,
|
|
41
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value, size: "small" }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
|
|
42
42
|
] }));
|
|
43
43
|
};
|
|
44
44
|
exports.ZodStaticFileEditor = ZodStaticFileEditor;
|