@remotion/studio 4.0.477 → 4.0.479
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/AssetSelector.js +8 -14
- package/dist/components/Button.d.ts +1 -0
- package/dist/components/Button.js +8 -5
- package/dist/components/CanvasIfSizeIsAvailable.js +2 -6
- package/dist/components/CompactExplanation.d.ts +12 -0
- package/dist/components/CompactExplanation.js +52 -0
- package/dist/components/CompositionSelector.js +2 -4
- package/dist/components/CurrentAsset.d.ts +3 -1
- package/dist/components/CurrentAsset.js +42 -34
- package/dist/components/CurrentComposition.d.ts +1 -1
- package/dist/components/CurrentComposition.js +38 -31
- package/dist/components/DefaultPropsEditor.d.ts +12 -2
- package/dist/components/DefaultPropsEditor.js +2 -2
- package/dist/components/EditorGuides/Guide.js +37 -9
- package/dist/components/EditorRuler/Ruler.js +4 -14
- package/dist/components/EditorRuler/index.js +9 -4
- package/dist/components/EffectPickerModal.d.ts +5 -0
- package/dist/components/EffectPickerModal.js +179 -0
- package/dist/components/InlineAction.js +1 -0
- package/dist/components/InspectorInfoHeader.d.ts +11 -0
- package/dist/components/InspectorInfoHeader.js +55 -0
- package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
- package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/EasingInspector.js +41 -0
- package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
- package/dist/components/InspectorPanel/GuideInspector.js +55 -0
- package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
- package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +116 -0
- package/dist/components/InspectorPanel/common.d.ts +15 -0
- package/dist/components/InspectorPanel/common.js +18 -0
- package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
- package/dist/components/InspectorPanel/inspector-selection.js +34 -0
- package/dist/components/InspectorPanel/styles.d.ts +27 -0
- package/dist/components/InspectorPanel/styles.js +178 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
- package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
- package/dist/components/InspectorPanel.d.ts +8 -0
- package/dist/components/InspectorPanel.js +26 -0
- package/dist/components/InspectorPanelLayout.d.ts +1 -0
- package/dist/components/InspectorPanelLayout.js +4 -0
- package/dist/components/InspectorSequenceSection.d.ts +16 -0
- package/dist/components/InspectorSequenceSection.js +147 -0
- package/dist/components/InspectorSourceLocation.d.ts +7 -0
- package/dist/components/InspectorSourceLocation.js +71 -0
- package/dist/components/MenuToolbar.d.ts +1 -0
- package/dist/components/MenuToolbar.js +4 -1
- package/dist/components/Modals.js +3 -3
- package/dist/components/NewComposition/InputDragger.js +1 -1
- package/dist/components/NewComposition/RemInput.d.ts +1 -0
- package/dist/components/NewComposition/RemInput.js +8 -2
- package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
- package/dist/components/NewComposition/RemTextarea.js +8 -2
- package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
- package/dist/components/NewComposition/ValidationMessage.js +16 -5
- package/dist/components/OptionsPanel.d.ts +1 -1
- package/dist/components/OptionsPanel.js +8 -17
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
- package/dist/components/QuickSwitcher/shared.d.ts +4 -0
- package/dist/components/QuickSwitcher/shared.js +24 -0
- package/dist/components/RenderModal/DataEditor.d.ts +29 -2
- package/dist/components/RenderModal/DataEditor.js +107 -56
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
- package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
- package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
- package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
- package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
- package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
- package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
- package/dist/components/RendersTab.js +1 -1
- package/dist/components/SegmentedControl.d.ts +3 -0
- package/dist/components/SegmentedControl.js +11 -5
- package/dist/components/SelectedOutlineElement.js +135 -31
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +45 -29
- package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
- package/dist/components/SelectedOutlineUvControls.js +64 -10
- package/dist/components/Tabs/index.js +4 -4
- package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
- package/dist/components/Timeline/EasingEditorModal.js +597 -124
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
- package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +24 -20
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +5 -19
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
- package/dist/components/Timeline/TimelineNumberField.js +5 -11
- package/dist/components/Timeline/TimelineRotationField.js +5 -6
- package/dist/components/Timeline/TimelineScaleField.js +4 -8
- package/dist/components/Timeline/TimelineSelection.d.ts +6 -0
- package/dist/components/Timeline/TimelineSelection.js +109 -14
- package/dist/components/Timeline/TimelineSequence.js +22 -14
- package/dist/components/Timeline/TimelineSequenceItem.js +12 -67
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +56 -52
- package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
- package/dist/components/Timeline/TimelineTranslateField.js +4 -5
- package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +93 -8
- package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
- package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
- package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
- package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +7 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +32 -3
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
- package/dist/components/Timeline/reset-selected-timeline-props.js +19 -5
- package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
- package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
- package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
- package/dist/components/Timeline/timeline-video-filmstrip-times.d.ts +17 -0
- package/dist/components/Timeline/timeline-video-filmstrip-times.js +22 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
- package/dist/components/Timeline/update-selected-easing.js +40 -9
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +11 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +33 -0
- package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
- package/dist/components/VisualControls/VisualControlsContent.js +4 -5
- package/dist/components/effect-drag-and-drop.d.ts +10 -0
- package/dist/components/effect-drag-and-drop.js +17 -8
- package/dist/components/effect-picker-search.d.ts +5 -0
- package/dist/components/effect-picker-search.js +77 -0
- package/dist/components/import-assets.d.ts +11 -2
- package/dist/components/import-assets.js +61 -6
- package/dist/components/selected-outline-drag.d.ts +44 -2
- package/dist/components/selected-outline-drag.js +74 -1
- package/dist/components/selected-outline-types.d.ts +7 -7
- package/dist/components/selected-outline-uv.d.ts +4 -3
- package/dist/components/selected-outline-uv.js +6 -2
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -0
- package/dist/esm/{chunk-t8fjnw2d.js → chunk-fge2mq5p.js} +17004 -13432
- package/dist/esm/internals.mjs +17004 -13432
- package/dist/esm/previewEntry.mjs +26617 -23041
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/editor-guide-selection.js +1 -1
- package/dist/helpers/get-preview-file-type.js +1 -1
- package/dist/helpers/render-codec-label.d.ts +2 -0
- package/dist/helpers/render-codec-label.js +49 -0
- package/dist/helpers/ruler-canvas-size.d.ts +5 -0
- package/dist/helpers/ruler-canvas-size.js +17 -0
- package/dist/helpers/timeline-layout.d.ts +4 -4
- package/dist/helpers/use-media-metadata.d.ts +8 -2
- package/dist/helpers/use-media-metadata.js +17 -4
- package/dist/state/modals.d.ts +9 -4
- package/package.json +12 -12
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InspectorSequenceSection = exports.hasSequenceControls = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const client_id_1 = require("../helpers/client-id");
|
|
7
|
+
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
9
|
+
const plus_1 = require("../icons/plus");
|
|
10
|
+
const modals_1 = require("../state/modals");
|
|
11
|
+
const InlineAction_1 = require("./InlineAction");
|
|
12
|
+
const styles_1 = require("./InspectorPanel/styles");
|
|
13
|
+
const TimelineExpandedRow_1 = require("./Timeline/TimelineExpandedRow");
|
|
14
|
+
const use_timeline_expanded_tree_1 = require("./Timeline/use-timeline-expanded-tree");
|
|
15
|
+
const container = {
|
|
16
|
+
color: 'white',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
20
|
+
fontSize: 12,
|
|
21
|
+
};
|
|
22
|
+
const emptyState = {
|
|
23
|
+
color: colors_1.LIGHT_TEXT,
|
|
24
|
+
fontFamily: 'sans-serif',
|
|
25
|
+
fontSize: 12,
|
|
26
|
+
lineHeight: 1.4,
|
|
27
|
+
padding: '0 12px 8px',
|
|
28
|
+
};
|
|
29
|
+
const divider = {
|
|
30
|
+
backgroundColor: colors_1.LINE_COLOR,
|
|
31
|
+
flexShrink: 0,
|
|
32
|
+
height: 1,
|
|
33
|
+
margin: '4px 0',
|
|
34
|
+
};
|
|
35
|
+
const controlsEffectsDivider = {
|
|
36
|
+
...divider,
|
|
37
|
+
margin: '8px 0 4px',
|
|
38
|
+
};
|
|
39
|
+
const effectsHeaderTitle = {
|
|
40
|
+
...styles_1.sectionHeaderTitle,
|
|
41
|
+
flexShrink: 1,
|
|
42
|
+
};
|
|
43
|
+
const plusIcon = {
|
|
44
|
+
width: 15,
|
|
45
|
+
height: 15,
|
|
46
|
+
};
|
|
47
|
+
const isEffectsRoot = (node) => {
|
|
48
|
+
if (node.kind !== 'group' || node.effectInfo !== null) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const { auxiliaryKeys } = node.nodePathInfo;
|
|
52
|
+
return auxiliaryKeys[auxiliaryKeys.length - 1] === 'effects';
|
|
53
|
+
};
|
|
54
|
+
const getInspectorExpansionKey = (nodePathInfo) => {
|
|
55
|
+
return JSON.stringify(nodePathInfo);
|
|
56
|
+
};
|
|
57
|
+
const hasSequenceControls = (sequence) => {
|
|
58
|
+
return sequence.controls !== null;
|
|
59
|
+
};
|
|
60
|
+
exports.hasSequenceControls = hasSequenceControls;
|
|
61
|
+
const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderSectionHeader, }) => {
|
|
62
|
+
const { tree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
63
|
+
sequence,
|
|
64
|
+
nodePathInfo,
|
|
65
|
+
});
|
|
66
|
+
const [collapsedKeys, setCollapsedKeys] = (0, react_1.useState)(() => new Set());
|
|
67
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
68
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
69
|
+
const getIsExpanded = (0, react_1.useCallback)((candidate) => {
|
|
70
|
+
return !collapsedKeys.has(getInspectorExpansionKey(candidate));
|
|
71
|
+
}, [collapsedKeys]);
|
|
72
|
+
const toggleTrack = (0, react_1.useCallback)((candidate) => {
|
|
73
|
+
setCollapsedKeys((prev) => {
|
|
74
|
+
const key = getInspectorExpansionKey(candidate);
|
|
75
|
+
const next = new Set(prev);
|
|
76
|
+
if (next.has(key)) {
|
|
77
|
+
next.delete(key);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
next.add(key);
|
|
81
|
+
}
|
|
82
|
+
return next;
|
|
83
|
+
});
|
|
84
|
+
}, []);
|
|
85
|
+
const { controlRows, effectRows } = (0, react_1.useMemo)(() => {
|
|
86
|
+
const controlNodes = [];
|
|
87
|
+
let effectsRoot = null;
|
|
88
|
+
for (const node of tree) {
|
|
89
|
+
if (isEffectsRoot(node)) {
|
|
90
|
+
effectsRoot = node;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
controlNodes.push(node);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
controlRows: (0, timeline_layout_1.flattenVisibleTreeNodes)({
|
|
98
|
+
nodes: controlNodes,
|
|
99
|
+
getIsExpanded,
|
|
100
|
+
}),
|
|
101
|
+
effectRows: effectsRoot === null
|
|
102
|
+
? []
|
|
103
|
+
: (0, timeline_layout_1.flattenVisibleTreeNodes)({
|
|
104
|
+
nodes: effectsRoot.children,
|
|
105
|
+
getIsExpanded,
|
|
106
|
+
}),
|
|
107
|
+
};
|
|
108
|
+
}, [getIsExpanded, tree]);
|
|
109
|
+
const { schema } = sequence.controls;
|
|
110
|
+
const showEffectsSection = nodePathInfo.supportsEffects || effectRows.length > 0;
|
|
111
|
+
const showControlsEffectsDivider = controlRows.length > 0 && showEffectsSection;
|
|
112
|
+
const canAddEffect = nodePathInfo.supportsEffects &&
|
|
113
|
+
previewServerState.type === 'connected' &&
|
|
114
|
+
Boolean(validatedLocation.source);
|
|
115
|
+
const onAddEffect = (0, react_1.useCallback)(() => {
|
|
116
|
+
if (!canAddEffect || previewServerState.type !== 'connected') {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
setSelectedModal({
|
|
120
|
+
type: 'add-effect',
|
|
121
|
+
clientId: previewServerState.clientId,
|
|
122
|
+
fileName: validatedLocation.source,
|
|
123
|
+
nodePath: nodePathInfo.sequenceSubscriptionKey,
|
|
124
|
+
});
|
|
125
|
+
}, [
|
|
126
|
+
canAddEffect,
|
|
127
|
+
nodePathInfo.sequenceSubscriptionKey,
|
|
128
|
+
previewServerState,
|
|
129
|
+
setSelectedModal,
|
|
130
|
+
validatedLocation.source,
|
|
131
|
+
]);
|
|
132
|
+
const renderEffectsHeader = () => {
|
|
133
|
+
return renderSectionHeader(jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
|
|
134
|
+
jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: "Effects" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: !canAddEffect, onClick: onAddEffect, title: canAddEffect ? 'Add effect' : undefined, renderAction: (color) => jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: plusIcon }) })] }));
|
|
135
|
+
};
|
|
136
|
+
const renderRow = ({ node, depth }) => {
|
|
137
|
+
return (jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: 0, rowDepthBase: 0, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "inspector" }, JSON.stringify(node.nodePathInfo)));
|
|
138
|
+
};
|
|
139
|
+
if (controlRows.length === 0 && !showEffectsSection) {
|
|
140
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
141
|
+
jsx_runtime_1.jsx("div", { style: divider }), jsx_runtime_1.jsx("div", { style: emptyState, children: "No schema" })
|
|
142
|
+
] }));
|
|
143
|
+
}
|
|
144
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
145
|
+
jsx_runtime_1.jsx("div", { style: divider }), controlRows.length > 0 ? renderSectionHeader('Controls') : null, controlRows.map(renderRow), showEffectsSection ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showControlsEffectsDivider ? (jsx_runtime_1.jsx("div", { style: controlsEffectsDivider })) : null, renderEffectsHeader(), effectRows.length === 0 ? (jsx_runtime_1.jsx("div", { style: emptyState, children: "None" })) : (effectRows.map(renderRow))] })) : null] }));
|
|
146
|
+
};
|
|
147
|
+
exports.InspectorSequenceSection = InspectorSequenceSection;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
3
|
+
export declare const InspectorSourceLocation: React.FC<{
|
|
4
|
+
readonly location: OriginalPosition | null;
|
|
5
|
+
readonly canOpen: boolean;
|
|
6
|
+
readonly onOpen: () => void;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InspectorSourceLocation = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const format_file_location_1 = require("../helpers/format-file-location");
|
|
8
|
+
const source_attribution_1 = require("./Timeline/TimelineStack/source-attribution");
|
|
9
|
+
const sourceLocationStyle = {
|
|
10
|
+
alignSelf: 'flex-start',
|
|
11
|
+
appearance: 'none',
|
|
12
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
13
|
+
border: 'none',
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
display: 'block',
|
|
16
|
+
fontFamily: 'sans-serif',
|
|
17
|
+
fontSize: 12,
|
|
18
|
+
height: 18,
|
|
19
|
+
lineHeight: '18px',
|
|
20
|
+
margin: 0,
|
|
21
|
+
maxWidth: '100%',
|
|
22
|
+
overflow: 'hidden',
|
|
23
|
+
padding: 0,
|
|
24
|
+
textAlign: 'left',
|
|
25
|
+
textDecoration: 'none',
|
|
26
|
+
textOverflow: 'ellipsis',
|
|
27
|
+
whiteSpace: 'nowrap',
|
|
28
|
+
width: 'fit-content',
|
|
29
|
+
};
|
|
30
|
+
const InspectorSourceLocation = ({ location, canOpen, onOpen }) => {
|
|
31
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
32
|
+
const validLocation = (0, react_1.useMemo)(() => {
|
|
33
|
+
if (!(location === null || location === void 0 ? void 0 : location.source) || location.line === null) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return location;
|
|
37
|
+
}, [location]);
|
|
38
|
+
const fileLocation = (0, react_1.useMemo)(() => {
|
|
39
|
+
if (!validLocation) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return (0, format_file_location_1.formatFileLocation)({
|
|
43
|
+
location: validLocation,
|
|
44
|
+
root: window.remotion_cwd,
|
|
45
|
+
});
|
|
46
|
+
}, [validLocation]);
|
|
47
|
+
const label = (0, react_1.useMemo)(() => {
|
|
48
|
+
if (!validLocation) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return (0, source_attribution_1.getOriginalSourceAttribution)(validLocation);
|
|
52
|
+
}, [validLocation]);
|
|
53
|
+
const style = (0, react_1.useMemo)(() => {
|
|
54
|
+
return {
|
|
55
|
+
...sourceLocationStyle,
|
|
56
|
+
color: hovered ? colors_1.LIGHT_COLOR : colors_1.LIGHT_TEXT,
|
|
57
|
+
cursor: canOpen ? 'pointer' : 'default',
|
|
58
|
+
};
|
|
59
|
+
}, [canOpen, hovered]);
|
|
60
|
+
const onClick = (0, react_1.useCallback)(() => {
|
|
61
|
+
if (!canOpen) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
onOpen();
|
|
65
|
+
}, [canOpen, onOpen]);
|
|
66
|
+
if (!label) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return (jsx_runtime_1.jsx("button", { type: "button", style: style, title: fileLocation !== null && fileLocation !== void 0 ? fileLocation : undefined, onClick: onClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: label }));
|
|
70
|
+
};
|
|
71
|
+
exports.InspectorSourceLocation = InspectorSourceLocation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuToolbar = void 0;
|
|
3
|
+
exports.MenuToolbar = exports.MENU_TOOLBAR_HEIGHT = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
@@ -12,13 +12,16 @@ const MenuBuildIndicator_1 = require("./MenuBuildIndicator");
|
|
|
12
12
|
const SidebarCollapserControls_1 = require("./SidebarCollapserControls");
|
|
13
13
|
const UndoRedoButtons_1 = require("./UndoRedoButtons");
|
|
14
14
|
const UpdateCheck_1 = require("./UpdateCheck");
|
|
15
|
+
exports.MENU_TOOLBAR_HEIGHT = 30;
|
|
15
16
|
const row = {
|
|
16
17
|
alignItems: 'center',
|
|
17
18
|
flexDirection: 'row',
|
|
18
19
|
display: 'flex',
|
|
19
20
|
color: 'white',
|
|
20
21
|
borderBottom: '1px solid black',
|
|
22
|
+
boxSizing: 'border-box',
|
|
21
23
|
fontSize: 13,
|
|
24
|
+
height: exports.MENU_TOOLBAR_HEIGHT,
|
|
22
25
|
paddingLeft: 6,
|
|
23
26
|
paddingRight: 10,
|
|
24
27
|
backgroundColor: colors_1.BACKGROUND,
|
|
@@ -10,6 +10,7 @@ const client_id_1 = require("../helpers/client-id");
|
|
|
10
10
|
const modals_1 = require("../state/modals");
|
|
11
11
|
const AskAiModal_1 = require("./AskAiModal");
|
|
12
12
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
13
|
+
const EffectPickerModal_1 = require("./EffectPickerModal");
|
|
13
14
|
const InstallPackage_1 = require("./InstallPackage");
|
|
14
15
|
const DeleteComposition_1 = require("./NewComposition/DeleteComposition");
|
|
15
16
|
const DeleteFolder_1 = require("./NewComposition/DeleteFolder");
|
|
@@ -22,7 +23,6 @@ const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher")
|
|
|
22
23
|
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
23
24
|
const ServerRenderModal_1 = require("./RenderModal/ServerRenderModal");
|
|
24
25
|
const WebRenderModal_1 = require("./RenderModal/WebRenderModal");
|
|
25
|
-
const EasingEditorModal_1 = require("./Timeline/EasingEditorModal");
|
|
26
26
|
const KeyframeSettingsModal_1 = require("./Timeline/KeyframeSettingsModal");
|
|
27
27
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
28
28
|
const Modals = ({ readOnlyStudio }) => {
|
|
@@ -30,8 +30,8 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
30
30
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
31
31
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
32
32
|
'connected';
|
|
33
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'keyframe-settings' && (jsx_runtime_1.jsx(KeyframeSettingsModal_1.KeyframeSettingsModal, { state: modalContextType })), modalContextType && modalContextType.type === '
|
|
33
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'keyframe-settings' && (jsx_runtime_1.jsx(KeyframeSettingsModal_1.KeyframeSettingsModal, { state: modalContextType })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
34
34
|
modalContextType.type === 'server-render' &&
|
|
35
|
-
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), process.env.ASK_AI_ENABLED && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
35
|
+
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), process.env.ASK_AI_ENABLED && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
36
36
|
};
|
|
37
37
|
exports.Modals = Modals;
|
|
@@ -207,7 +207,7 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
207
207
|
});
|
|
208
208
|
}, [_min, _step, snapToStep]);
|
|
209
209
|
if (inputFallback) {
|
|
210
|
-
return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, onChange: onInputChange, min: _min, max: _max, step: deriveStep, defaultValue: value, status: status, pattern: '[0-9]*[.]?[0-9]*', rightAlign: rightAlign,
|
|
210
|
+
return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, onChange: onInputChange, min: _min, max: _max, step: deriveStep, defaultValue: value, status: status, pattern: '[0-9]*[.]?[0-9]*', rightAlign: rightAlign, small: small, ...props }) }));
|
|
211
211
|
}
|
|
212
212
|
return (jsx_runtime_1.jsx("button", { ref: ref, type: "button", className: '__remotion_input_dragger', style: style, onClick: onClick, onFocus: onFocus, onPointerDown: onPointerDown, children: jsx_runtime_1.jsx("span", { style: span, children: formatter(value) }) }));
|
|
213
213
|
};
|
|
@@ -4,6 +4,7 @@ export type RemInputStatus = 'error' | 'warning' | 'ok';
|
|
|
4
4
|
type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {
|
|
5
5
|
readonly status: RemInputStatus;
|
|
6
6
|
readonly rightAlign: boolean;
|
|
7
|
+
readonly small?: boolean;
|
|
7
8
|
};
|
|
8
9
|
export declare const INPUT_HORIZONTAL_PADDING = 8;
|
|
9
10
|
export declare const RightAlignInput: React.FC<PropsWithChildren>;
|
|
@@ -20,6 +20,11 @@ exports.inputBaseStyle = {
|
|
|
20
20
|
borderWidth: 1,
|
|
21
21
|
fontSize: 14,
|
|
22
22
|
};
|
|
23
|
+
const compactInputStyle = {
|
|
24
|
+
fontSize: 12,
|
|
25
|
+
lineHeight: '16px',
|
|
26
|
+
padding: '4px 6px',
|
|
27
|
+
};
|
|
23
28
|
const getInputBorderColor = ({ status, isFocused, isHovered, }) => status === 'warning'
|
|
24
29
|
? colors_1.WARNING_COLOR
|
|
25
30
|
: status === 'error'
|
|
@@ -30,7 +35,7 @@ const getInputBorderColor = ({ status, isFocused, isHovered, }) => status === 'w
|
|
|
30
35
|
? colors_1.INPUT_BORDER_COLOR_HOVERED
|
|
31
36
|
: colors_1.INPUT_BORDER_COLOR_UNHOVERED;
|
|
32
37
|
exports.getInputBorderColor = getInputBorderColor;
|
|
33
|
-
const RemInputForwardRef = ({ status, rightAlign, ...props }, ref) => {
|
|
38
|
+
const RemInputForwardRef = ({ status, rightAlign, small = false, ...props }, ref) => {
|
|
34
39
|
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
35
40
|
const [isHovered, setIsHovered] = (0, react_1.useState)(false);
|
|
36
41
|
const inputRef = (0, react_1.useRef)(null);
|
|
@@ -40,12 +45,13 @@ const RemInputForwardRef = ({ status, rightAlign, ...props }, ref) => {
|
|
|
40
45
|
return {
|
|
41
46
|
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
42
47
|
...exports.inputBaseStyle,
|
|
48
|
+
...(small ? compactInputStyle : null),
|
|
43
49
|
width: '100%',
|
|
44
50
|
borderColor: (0, exports.getInputBorderColor)({ isFocused, isHovered, status }),
|
|
45
51
|
textAlign: rightAlign ? 'right' : 'left',
|
|
46
52
|
...((_a = props.style) !== null && _a !== void 0 ? _a : {}),
|
|
47
53
|
};
|
|
48
|
-
}, [isFocused, isHovered, rightAlign, props.style, status]);
|
|
54
|
+
}, [isFocused, isHovered, rightAlign, props.style, small, status]);
|
|
49
55
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
50
56
|
return inputRef.current;
|
|
51
57
|
}, []);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> & {
|
|
3
3
|
readonly status: 'error' | 'warning' | 'ok';
|
|
4
|
+
readonly small?: boolean;
|
|
4
5
|
};
|
|
5
6
|
export declare const RemTextarea: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
6
7
|
export {};
|
|
@@ -16,7 +16,12 @@ const inputBaseStyle = {
|
|
|
16
16
|
resize: 'none',
|
|
17
17
|
overflowX: 'hidden',
|
|
18
18
|
};
|
|
19
|
-
const
|
|
19
|
+
const compactInputStyle = {
|
|
20
|
+
fontSize: 12,
|
|
21
|
+
lineHeight: '16px',
|
|
22
|
+
padding: '4px 6px',
|
|
23
|
+
};
|
|
24
|
+
const RemTextareaFRFunction = ({ status, small = false, ...props }, ref) => {
|
|
20
25
|
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
21
26
|
const [isHovered, setIsHovered] = (0, react_1.useState)(false);
|
|
22
27
|
const inputRef = (0, react_1.useRef)(null);
|
|
@@ -29,11 +34,12 @@ const RemTextareaFRFunction = ({ status, ...props }, ref) => {
|
|
|
29
34
|
return {
|
|
30
35
|
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
31
36
|
...inputBaseStyle,
|
|
37
|
+
...(small ? compactInputStyle : null),
|
|
32
38
|
width: '100%',
|
|
33
39
|
borderColor: (0, RemInput_1.getInputBorderColor)({ isFocused, isHovered, status }),
|
|
34
40
|
...((_a = props.style) !== null && _a !== void 0 ? _a : {}),
|
|
35
41
|
};
|
|
36
|
-
}, [isFocused, isHovered, props.style, status]);
|
|
42
|
+
}, [isFocused, isHovered, props.style, small, status]);
|
|
37
43
|
(0, react_1.useEffect)(() => {
|
|
38
44
|
if (!inputRef.current) {
|
|
39
45
|
return;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const WarningTriangle: React.FC<SVGProps<SVGSVGElement>>;
|
|
4
|
+
type ValidationMessageSize = 'default' | 'compact';
|
|
4
5
|
export declare const ValidationMessage: React.FC<{
|
|
5
6
|
readonly message: string;
|
|
6
7
|
readonly align: 'flex-start' | 'flex-end';
|
|
7
8
|
readonly type: 'warning' | 'error';
|
|
8
9
|
readonly action?: React.ReactNode;
|
|
10
|
+
readonly size?: ValidationMessageSize;
|
|
9
11
|
}>;
|
|
12
|
+
export {};
|
|
@@ -14,6 +14,11 @@ const style = {
|
|
|
14
14
|
height: 12,
|
|
15
15
|
flexShrink: 0,
|
|
16
16
|
};
|
|
17
|
+
const compactStyle = {
|
|
18
|
+
...style,
|
|
19
|
+
width: 10,
|
|
20
|
+
height: 10,
|
|
21
|
+
};
|
|
17
22
|
const container = {
|
|
18
23
|
maxWidth: 500,
|
|
19
24
|
};
|
|
@@ -22,15 +27,21 @@ const label = {
|
|
|
22
27
|
color: 'white',
|
|
23
28
|
fontFamily: 'sans-serif',
|
|
24
29
|
};
|
|
25
|
-
const
|
|
30
|
+
const compactLabel = {
|
|
31
|
+
...label,
|
|
32
|
+
fontSize: 12,
|
|
33
|
+
};
|
|
34
|
+
const ValidationMessage = ({ message, align, type, action, size = 'default' }) => {
|
|
35
|
+
const iconStyle = size === 'compact' ? compactStyle : style;
|
|
36
|
+
const labelStyle = size === 'compact' ? compactLabel : label;
|
|
26
37
|
const finalStyle = (0, react_1.useMemo)(() => {
|
|
27
38
|
return {
|
|
28
|
-
...
|
|
39
|
+
...iconStyle,
|
|
29
40
|
fill: type === 'warning' ? colors_1.WARNING_COLOR : colors_1.FAIL_COLOR,
|
|
30
41
|
};
|
|
31
|
-
}, [type]);
|
|
42
|
+
}, [iconStyle, type]);
|
|
32
43
|
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", justify: align, children: [
|
|
33
|
-
jsx_runtime_1.jsx(exports.WarningTriangle, { style: finalStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style:
|
|
34
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), action] })) : null] }) }));
|
|
44
|
+
jsx_runtime_1.jsx(exports.WarningTriangle, { style: finalStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: size === 'compact' ? 0.75 : 1 }), jsx_runtime_1.jsx("div", { style: labelStyle, children: message }), action ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
45
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: size === 'compact' ? 0.75 : 1 }), action] })) : null] }) }));
|
|
35
46
|
};
|
|
36
47
|
exports.ValidationMessage = ValidationMessage;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type OptionsSidebarPanel = '
|
|
2
|
+
type OptionsSidebarPanel = 'inspector' | 'renders';
|
|
3
3
|
export declare const persistSelectedOptionsSidebarPanel: (panel: OptionsSidebarPanel) => void;
|
|
4
4
|
export declare const optionsSidebarTabs: React.RefObject<{
|
|
5
5
|
selectRendersPanel: () => void;
|
|
@@ -7,9 +7,8 @@ const remotion_1 = require("remotion");
|
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
8
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
9
9
|
const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
|
|
10
|
-
const VisualControls_1 = require("../visual-controls/VisualControls");
|
|
11
|
-
const DefaultPropsEditor_1 = require("./DefaultPropsEditor");
|
|
12
10
|
const get_zod_if_possible_1 = require("./get-zod-if-possible");
|
|
11
|
+
const InspectorPanel_1 = require("./InspectorPanel");
|
|
13
12
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
14
13
|
const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
|
|
15
14
|
const extract_enum_json_paths_1 = require("./RenderModal/SchemaEditor/extract-enum-json-paths");
|
|
@@ -18,20 +17,16 @@ const RenderQueue_1 = require("./RenderQueue");
|
|
|
18
17
|
const actions_1 = require("./RenderQueue/actions");
|
|
19
18
|
const RendersTab_1 = require("./RendersTab");
|
|
20
19
|
const Tabs_1 = require("./Tabs");
|
|
21
|
-
const VisualControlsContent_1 = require("./VisualControls/VisualControlsContent");
|
|
22
20
|
const localStorageKey = 'remotion.sidebarPanel';
|
|
23
21
|
const getSelectedPanel = (renderingAvailable) => {
|
|
24
22
|
if (!renderingAvailable) {
|
|
25
|
-
return '
|
|
23
|
+
return 'inspector';
|
|
26
24
|
}
|
|
27
25
|
const panel = localStorage.getItem(localStorageKey);
|
|
28
26
|
if (panel === 'renders') {
|
|
29
27
|
return 'renders';
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
return 'visual-controls';
|
|
33
|
-
}
|
|
34
|
-
return 'input-props';
|
|
29
|
+
return 'inspector';
|
|
35
30
|
};
|
|
36
31
|
const tabsContainer = {
|
|
37
32
|
backgroundColor: colors_1.BACKGROUND,
|
|
@@ -45,7 +40,6 @@ const OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
45
40
|
const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
46
41
|
const renderingAvailable = !readOnlyStudio || show_browser_rendering_1.SHOW_BROWSER_RENDERING;
|
|
47
42
|
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
48
|
-
const visualControlsTabActivated = (0, react_1.useContext)(VisualControls_1.VisualControlsTabActivatedContext);
|
|
49
43
|
const container = (0, react_1.useMemo)(() => ({
|
|
50
44
|
height: '100%',
|
|
51
45
|
width: '100%',
|
|
@@ -55,18 +49,14 @@ const OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
55
49
|
flex: 1,
|
|
56
50
|
}), [isMobileLayout]);
|
|
57
51
|
const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel(renderingAvailable));
|
|
58
|
-
const
|
|
59
|
-
setPanel('
|
|
60
|
-
(0, exports.persistSelectedOptionsSidebarPanel)('
|
|
52
|
+
const onInspectorSelected = (0, react_1.useCallback)(() => {
|
|
53
|
+
setPanel('inspector');
|
|
54
|
+
(0, exports.persistSelectedOptionsSidebarPanel)('inspector');
|
|
61
55
|
}, []);
|
|
62
56
|
const onRendersSelected = (0, react_1.useCallback)(() => {
|
|
63
57
|
setPanel('renders');
|
|
64
58
|
(0, exports.persistSelectedOptionsSidebarPanel)('renders');
|
|
65
59
|
}, []);
|
|
66
|
-
const onVisualControlsSelected = (0, react_1.useCallback)(() => {
|
|
67
|
-
setPanel('visual-controls');
|
|
68
|
-
(0, exports.persistSelectedOptionsSidebarPanel)('visual-controls');
|
|
69
|
-
}, []);
|
|
70
60
|
(0, react_1.useImperativeHandle)(exports.optionsSidebarTabs, () => {
|
|
71
61
|
return {
|
|
72
62
|
selectRendersPanel: () => {
|
|
@@ -186,6 +176,7 @@ const OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
186
176
|
e.stopPropagation();
|
|
187
177
|
}, []);
|
|
188
178
|
return (jsx_runtime_1.jsxs("div", { style: container, className: "css-reset", onPointerDown: onPointerDown, children: [
|
|
189
|
-
jsx_runtime_1.jsx("div", { style: tabsContainer, children: jsx_runtime_1.jsxs(Tabs_1.Tabs, { children: [
|
|
179
|
+
jsx_runtime_1.jsx("div", { style: tabsContainer, children: jsx_runtime_1.jsxs(Tabs_1.Tabs, { children: [
|
|
180
|
+
jsx_runtime_1.jsxs(Tabs_1.Tab, { selected: panel === 'inspector', onClick: onInspectorSelected, style: { justifyContent: 'space-between' }, children: ["Inspector", hasLocalModifications ? (jsx_runtime_1.jsx(SchemaResetButton_1.SchemaResetButton, { onClick: resetToOriginal })) : null] }), renderingAvailable ? (jsx_runtime_1.jsx(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })) : null] }) }), panel === 'inspector' ? (jsx_runtime_1.jsx(InspectorPanel_1.InspectorPanel, { composition: composition, currentDefaultProps: currentDefaultProps, setDefaultProps: setDefaultProps })) : !renderingAvailable ? null : (jsx_runtime_1.jsx(RenderQueue_1.RenderQueue, {}))] }));
|
|
190
181
|
};
|
|
191
182
|
exports.OptionsPanel = OptionsPanel;
|
|
@@ -19,6 +19,7 @@ const AlgoliaCredit_1 = require("./AlgoliaCredit");
|
|
|
19
19
|
const fuzzy_search_1 = require("./fuzzy-search");
|
|
20
20
|
const NoResults_1 = require("./NoResults");
|
|
21
21
|
const QuickSwitcherResult_1 = require("./QuickSwitcherResult");
|
|
22
|
+
const shared_1 = require("./shared");
|
|
22
23
|
const input = {
|
|
23
24
|
width: '100%',
|
|
24
25
|
};
|
|
@@ -56,12 +57,6 @@ const content = {
|
|
|
56
57
|
flexDirection: 'row',
|
|
57
58
|
alignItems: 'center',
|
|
58
59
|
};
|
|
59
|
-
const loopIndex = (index, length) => {
|
|
60
|
-
if (index < 0) {
|
|
61
|
-
index += length;
|
|
62
|
-
}
|
|
63
|
-
return index % length;
|
|
64
|
-
};
|
|
65
60
|
const stripQuery = (query) => {
|
|
66
61
|
if (query.startsWith('>') || query.startsWith('?')) {
|
|
67
62
|
return query.substring(1).trim();
|
|
@@ -232,7 +227,7 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp, readOnlyStudio
|
|
|
232
227
|
const onTextChange = (0, react_1.useCallback)((e) => {
|
|
233
228
|
setState({ query: e.target.value, selectedIndex: 0 });
|
|
234
229
|
}, []);
|
|
235
|
-
const selectedIndexRounded = loopIndex(state.selectedIndex, resultsArray.length);
|
|
230
|
+
const selectedIndexRounded = (0, shared_1.loopIndex)(state.selectedIndex, resultsArray.length);
|
|
236
231
|
const onActionsSelected = (0, react_1.useCallback)(() => {
|
|
237
232
|
var _a;
|
|
238
233
|
setState((s) => ({
|
|
@@ -8,6 +8,7 @@ const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
|
8
8
|
const still_1 = require("../../icons/still");
|
|
9
9
|
const video_1 = require("../../icons/video");
|
|
10
10
|
const layout_1 = require("../layout");
|
|
11
|
+
const shared_1 = require("./shared");
|
|
11
12
|
const container = {
|
|
12
13
|
paddingLeft: 16,
|
|
13
14
|
paddingRight: 16,
|
|
@@ -70,15 +71,7 @@ const QuickSwitcherResult = ({ result, selected }) => {
|
|
|
70
71
|
binding.unregister();
|
|
71
72
|
};
|
|
72
73
|
}, [keybindings, result.onSelected, selected]);
|
|
73
|
-
(0,
|
|
74
|
-
var _a;
|
|
75
|
-
if (selected) {
|
|
76
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
77
|
-
block: 'nearest',
|
|
78
|
-
inline: 'center',
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}, [selected]);
|
|
74
|
+
(0, shared_1.useScrollIntoViewOnSelected)(ref, selected);
|
|
82
75
|
const style = (0, react_1.useMemo)(() => {
|
|
83
76
|
return {
|
|
84
77
|
...container,
|
|
@@ -96,7 +89,7 @@ const QuickSwitcherResult = ({ result, selected }) => {
|
|
|
96
89
|
: selected || hovered
|
|
97
90
|
? 'white'
|
|
98
91
|
: colors_1.LIGHT_TEXT,
|
|
99
|
-
fontSize:
|
|
92
|
+
fontSize: shared_1.QUICK_SWITCHER_RESULT_LABEL_FONT_SIZE,
|
|
100
93
|
};
|
|
101
94
|
}, [hovered, result.type, selected]);
|
|
102
95
|
return (jsx_runtime_1.jsxs("div", { ref: ref, style: style, onClick: result.onSelected, children: [result.type === 'composition' ? (result.compositionType === 'still' ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle }))) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: labelContainer, children: result.type === 'search-result' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
export declare const QUICK_SWITCHER_RESULT_LABEL_FONT_SIZE = 15;
|
|
3
|
+
export declare const loopIndex: (index: number, length: number) => number;
|
|
4
|
+
export declare const useScrollIntoViewOnSelected: <T extends HTMLElement>(ref: RefObject<T | null>, selected: boolean) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useScrollIntoViewOnSelected = exports.loopIndex = exports.QUICK_SWITCHER_RESULT_LABEL_FONT_SIZE = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
exports.QUICK_SWITCHER_RESULT_LABEL_FONT_SIZE = 15;
|
|
6
|
+
const loopIndex = (index, length) => {
|
|
7
|
+
if (index < 0) {
|
|
8
|
+
index += length;
|
|
9
|
+
}
|
|
10
|
+
return index % length;
|
|
11
|
+
};
|
|
12
|
+
exports.loopIndex = loopIndex;
|
|
13
|
+
const useScrollIntoViewOnSelected = (ref, selected) => {
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
var _a;
|
|
16
|
+
if (selected) {
|
|
17
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
18
|
+
block: 'nearest',
|
|
19
|
+
inline: 'center',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}, [ref, selected]);
|
|
23
|
+
};
|
|
24
|
+
exports.useScrollIntoViewOnSelected = useScrollIntoViewOnSelected;
|