@remotion/studio 4.0.478 → 4.0.481
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/AudioWaveform.js +19 -11
- package/dist/components/Button.d.ts +2 -0
- package/dist/components/Button.js +9 -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/CurrentCompositionSideEffects.d.ts +0 -3
- package/dist/components/CurrentCompositionSideEffects.js +1 -37
- package/dist/components/DefaultPropsEditor.d.ts +12 -2
- package/dist/components/DefaultPropsEditor.js +2 -2
- package/dist/components/Editor.js +2 -5
- package/dist/components/EditorContent.js +2 -1
- package/dist/components/EffectPickerModal.d.ts +5 -0
- package/dist/components/EffectPickerModal.js +179 -0
- package/dist/components/ExpandedTracksProvider.d.ts +1 -0
- package/dist/components/ExpandedTracksProvider.js +81 -7
- package/dist/components/GlobalKeybindings.d.ts +3 -1
- package/dist/components/GlobalKeybindings.js +104 -10
- 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 +117 -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 +35 -0
- package/dist/components/InspectorPanel/styles.d.ts +28 -0
- package/dist/components/InspectorPanel/styles.js +196 -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 +19 -0
- package/dist/components/InspectorSequenceSection.js +157 -0
- package/dist/components/InspectorSourceLocation.d.ts +7 -0
- package/dist/components/InspectorSourceLocation.js +71 -0
- package/dist/components/KeyboardShortcutsExplainer.js +10 -2
- 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/ResetZoomButton.d.ts +2 -1
- package/dist/components/ResetZoomButton.js +5 -1
- package/dist/components/SegmentedControl.d.ts +3 -0
- package/dist/components/SegmentedControl.js +11 -5
- package/dist/components/SelectedOutlineElement.js +96 -24
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +44 -30
- 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/Timeline.js +9 -9
- 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/TimelineEffectItem.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +25 -21
- package/dist/components/Timeline/TimelineExpandArrowButton.js +42 -2
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +6 -6
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +10 -25
- 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/TimelineRowChrome.d.ts +2 -0
- package/dist/components/Timeline/TimelineRowChrome.js +5 -3
- package/dist/components/Timeline/TimelineScaleField.js +4 -8
- package/dist/components/Timeline/TimelineSelection.d.ts +28 -2
- package/dist/components/Timeline/TimelineSelection.js +342 -61
- package/dist/components/Timeline/TimelineSequence.js +19 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +68 -64
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +57 -53
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +6 -4
- 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/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/find-track-for-node-path-info.js +2 -2
- package/dist/components/Timeline/get-node-keyframes.d.ts +7 -0
- package/dist/components/Timeline/get-node-keyframes.js +26 -1
- 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 +34 -7
- 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-expanded-filter.d.ts +12 -0
- package/dist/components/Timeline/timeline-expanded-filter.js +38 -0
- 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/update-selected-easing.d.ts +47 -4
- package/dist/components/Timeline/update-selected-easing.js +40 -9
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +50 -18
- 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 +12 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +60 -0
- package/dist/components/Timeline/use-timeline-height.js +51 -7
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +12 -6
- package/dist/components/TopPanel.js +1 -1
- 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/selected-outline-drag.d.ts +21 -2
- package/dist/components/selected-outline-drag.js +31 -6
- package/dist/components/selected-outline-measurement.js +48 -14
- 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/ErrorLoader.js +8 -1
- package/dist/esm/{chunk-hrw9799x.js → chunk-4rq5gt8c.js} +30557 -26640
- package/dist/esm/internals.mjs +30557 -26640
- package/dist/esm/previewEntry.mjs +18584 -14665
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
- package/dist/helpers/render-codec-label.d.ts +2 -0
- package/dist/helpers/render-codec-label.js +49 -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,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultInspector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const VisualControls_1 = require("../../visual-controls/VisualControls");
|
|
8
|
+
const CurrentAsset_1 = require("../CurrentAsset");
|
|
9
|
+
const CurrentComposition_1 = require("../CurrentComposition");
|
|
10
|
+
const DefaultPropsEditor_1 = require("../DefaultPropsEditor");
|
|
11
|
+
const get_zod_if_possible_1 = require("../get-zod-if-possible");
|
|
12
|
+
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
13
|
+
const ObserveDefaultPropsContext_1 = require("../ObserveDefaultPropsContext");
|
|
14
|
+
const DataEditor_1 = require("../RenderModal/DataEditor");
|
|
15
|
+
const zod_schema_type_1 = require("../RenderModal/SchemaEditor/zod-schema-type");
|
|
16
|
+
const WarningIndicatorButton_1 = require("../RenderModal/WarningIndicatorButton");
|
|
17
|
+
const SegmentedControl_1 = require("../SegmentedControl");
|
|
18
|
+
const VisualControlsContent_1 = require("../VisualControls/VisualControlsContent");
|
|
19
|
+
const common_1 = require("./common");
|
|
20
|
+
const styles_1 = require("./styles");
|
|
21
|
+
const DefaultInspector = ({ composition, currentDefaultProps, setDefaultProps }) => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
24
|
+
const hasSelectedAsset = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset';
|
|
25
|
+
const z = (0, get_zod_if_possible_1.useZodIfPossible)();
|
|
26
|
+
const canSaveDefaultProps = (0, react_1.useContext)(ObserveDefaultPropsContext_1.ObserveDefaultPropsContext);
|
|
27
|
+
const { handles: visualControlHandles } = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
|
|
28
|
+
const [defaultPropsMode, setDefaultPropsMode] = (0, react_1.useState)('schema');
|
|
29
|
+
const compositionId = (_a = composition === null || composition === void 0 ? void 0 : composition.id) !== null && _a !== void 0 ? _a : null;
|
|
30
|
+
const hasVisualControls = Object.keys(visualControlHandles).length > 0;
|
|
31
|
+
(0, react_1.useEffect)(() => {
|
|
32
|
+
setDefaultPropsMode('schema');
|
|
33
|
+
}, [compositionId]);
|
|
34
|
+
const defaultPropsModeItems = (0, react_1.useMemo)(() => {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
key: 'schema',
|
|
38
|
+
label: 'Schema',
|
|
39
|
+
onClick: () => {
|
|
40
|
+
setDefaultPropsMode('schema');
|
|
41
|
+
},
|
|
42
|
+
selected: defaultPropsMode === 'schema',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'json',
|
|
46
|
+
label: 'JSON',
|
|
47
|
+
onClick: () => {
|
|
48
|
+
setDefaultPropsMode('json');
|
|
49
|
+
},
|
|
50
|
+
selected: defaultPropsMode === 'json',
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
}, [defaultPropsMode]);
|
|
54
|
+
const canShowDefaultPropsSection = (0, react_1.useMemo)(() => {
|
|
55
|
+
if (!z || !(composition === null || composition === void 0 ? void 0 : composition.schema) || !composition.defaultProps) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
if (!(typeof composition.schema.safeParse ===
|
|
59
|
+
'function')) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return (0, zod_schema_type_1.getZodSchemaType)(composition.schema) !== 'any';
|
|
63
|
+
}, [composition === null || composition === void 0 ? void 0 : composition.defaultProps, composition === null || composition === void 0 ? void 0 : composition.schema, z]);
|
|
64
|
+
const { setShowWarning, showWarning } = (0, DataEditor_1.useDataEditorWarningVisibility)();
|
|
65
|
+
const { warnings: defaultPropsWarnings } = (0, DataEditor_1.useDataEditorWarnings)({
|
|
66
|
+
canSaveDefaultProps: (_b = canSaveDefaultProps === null || canSaveDefaultProps === void 0 ? void 0 : canSaveDefaultProps.canSaveDefaultProps) !== null && _b !== void 0 ? _b : null,
|
|
67
|
+
defaultProps: currentDefaultProps,
|
|
68
|
+
mode: defaultPropsMode,
|
|
69
|
+
propsEditType: 'default-props',
|
|
70
|
+
showCannotSaveDefaultPropsWarning: canShowDefaultPropsSection,
|
|
71
|
+
});
|
|
72
|
+
if (hasSelectedAsset) {
|
|
73
|
+
return (jsx_runtime_1.jsx("div", { style: styles_1.scrollableContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx("div", { style: styles_1.compositionSection, children: jsx_runtime_1.jsx(CurrentAsset_1.CurrentAsset, {}) }) }));
|
|
74
|
+
}
|
|
75
|
+
if (composition === null) {
|
|
76
|
+
return jsx_runtime_1.jsx("div", { style: styles_1.container });
|
|
77
|
+
}
|
|
78
|
+
return (jsx_runtime_1.jsxs("div", { style: styles_1.scrollableContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
79
|
+
jsx_runtime_1.jsx("div", { style: styles_1.compositionSection, children: jsx_runtime_1.jsx(CurrentComposition_1.CurrentComposition, {}) }), canShowDefaultPropsSection ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
80
|
+
jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }), jsx_runtime_1.jsxs("div", { style: styles_1.defaultPropsSection, children: [
|
|
81
|
+
jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
|
|
82
|
+
jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderStart, children: [
|
|
83
|
+
jsx_runtime_1.jsx("span", { style: styles_1.sectionHeaderTitle, children: "Default Props" }), jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: defaultPropsModeItems, needsWrapping: false, size: "compact" })
|
|
84
|
+
] }), jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: defaultPropsWarnings.length > 0 ? (jsx_runtime_1.jsx(WarningIndicatorButton_1.WarningIndicatorButton, { setShowWarning: setShowWarning, showWarning: showWarning, warningCount: defaultPropsWarnings.length, size: "compact" })) : null })
|
|
85
|
+
] }) }), defaultPropsWarnings.length > 0 && showWarning ? (jsx_runtime_1.jsx("div", { style: styles_1.defaultPropsWarningContainer, children: jsx_runtime_1.jsx(common_1.InspectorDefaultPropsWarnings, { warnings: defaultPropsWarnings }) })) : null, jsx_runtime_1.jsx(DefaultPropsEditor_1.DefaultPropsEditor, { unresolvedComposition: composition, defaultProps: currentDefaultProps, setDefaultProps: setDefaultProps, propsEditType: "default-props", schemaErrorMode: "compact", layout: "inspector", mode: defaultPropsMode, onModeChange: setDefaultPropsMode, hideModeControls: canShowDefaultPropsSection, warnings: defaultPropsWarnings, showWarning: false, setShowWarning: setShowWarning, hideWarningButton: true }, composition.id)
|
|
86
|
+
] })
|
|
87
|
+
] })) : null, hasVisualControls ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
88
|
+
jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }), jsx_runtime_1.jsxs("div", { style: styles_1.visualControlsSection, children: [
|
|
89
|
+
jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: "Visual Controls" }), jsx_runtime_1.jsx(VisualControlsContent_1.VisualControlsContent, {})
|
|
90
|
+
] })
|
|
91
|
+
] })) : null] }));
|
|
92
|
+
};
|
|
93
|
+
exports.DefaultInspector = DefaultInspector;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EasingInspector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
8
|
+
const SegmentedControl_1 = require("../SegmentedControl");
|
|
9
|
+
const EasingEditorModal_1 = require("../Timeline/EasingEditorModal");
|
|
10
|
+
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
11
|
+
const update_selected_easing_1 = require("../Timeline/update-selected-easing");
|
|
12
|
+
const common_1 = require("./common");
|
|
13
|
+
const styles_1 = require("./styles");
|
|
14
|
+
const EasingInspector = ({ selection }) => {
|
|
15
|
+
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
16
|
+
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
17
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
18
|
+
const initialEasing = (0, react_1.useMemo)(() => (0, update_selected_easing_1.getTimelineEasingValueForSelection)({
|
|
19
|
+
selection,
|
|
20
|
+
sequences,
|
|
21
|
+
overrideIdsToNodePaths: overrideIdToNodePathMappings,
|
|
22
|
+
propStatuses,
|
|
23
|
+
}), [overrideIdToNodePathMappings, propStatuses, selection, sequences]);
|
|
24
|
+
const state = (0, react_1.useMemo)(() => {
|
|
25
|
+
if (initialEasing === null) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
initialEasing,
|
|
30
|
+
selections: [selection],
|
|
31
|
+
};
|
|
32
|
+
}, [initialEasing, selection]);
|
|
33
|
+
const renderHeader = (0, react_1.useCallback)((modeItems) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderRow, children: jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderStart, children: [
|
|
34
|
+
jsx_runtime_1.jsx("span", { style: styles_1.sectionHeaderTitle, children: "Easing" }), jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: modeItems, needsWrapping: false, size: "compact" })
|
|
35
|
+
] }) }) })), []);
|
|
36
|
+
if (state === null) {
|
|
37
|
+
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Easing unavailable" });
|
|
38
|
+
}
|
|
39
|
+
return (jsx_runtime_1.jsx("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(selection)) }));
|
|
40
|
+
};
|
|
41
|
+
exports.EasingInspector = EasingInspector;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GuideInspector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const editor_guides_1 = require("../../state/editor-guides");
|
|
7
|
+
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
8
|
+
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
9
|
+
const common_1 = require("./common");
|
|
10
|
+
const styles_1 = require("./styles");
|
|
11
|
+
const updateGuidePosition = ({ guideId, persist, position, setGuidesList, }) => {
|
|
12
|
+
setGuidesList((prevState) => {
|
|
13
|
+
const newGuides = prevState.map((guide) => {
|
|
14
|
+
if (guide.id !== guideId) {
|
|
15
|
+
return guide;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
...guide,
|
|
19
|
+
position: Math.round(position),
|
|
20
|
+
show: true,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
if (persist) {
|
|
24
|
+
(0, editor_guides_1.persistGuidesList)(newGuides);
|
|
25
|
+
}
|
|
26
|
+
return newGuides;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const GuideInspector = ({ selection }) => {
|
|
30
|
+
const { guidesList, setGuidesList } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
|
|
31
|
+
const guide = guidesList.find((candidate) => candidate.id === selection.guideId);
|
|
32
|
+
const onValueChange = (0, react_1.useCallback)((value) => {
|
|
33
|
+
updateGuidePosition({
|
|
34
|
+
guideId: selection.guideId,
|
|
35
|
+
persist: false,
|
|
36
|
+
position: value,
|
|
37
|
+
setGuidesList,
|
|
38
|
+
});
|
|
39
|
+
}, [selection.guideId, setGuidesList]);
|
|
40
|
+
const onValueChangeEnd = (0, react_1.useCallback)((value) => {
|
|
41
|
+
updateGuidePosition({
|
|
42
|
+
guideId: selection.guideId,
|
|
43
|
+
persist: true,
|
|
44
|
+
position: value,
|
|
45
|
+
setGuidesList,
|
|
46
|
+
});
|
|
47
|
+
}, [selection.guideId, setGuidesList]);
|
|
48
|
+
if (!guide) {
|
|
49
|
+
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Guide unavailable" });
|
|
50
|
+
}
|
|
51
|
+
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
52
|
+
jsx_runtime_1.jsxs(common_1.InspectorSectionHeader, { children: [guide.orientation === 'vertical' ? 'Vertical' : 'Horizontal', " guide"] }), jsx_runtime_1.jsx("div", { style: styles_1.guideDetailsContainer, children: jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: guide.orientation === 'vertical' ? 'X position' : 'Y position', children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: guide.position, status: "ok", onValueChange: onValueChange, onValueChangeEnd: onValueChangeEnd, onTextChange: () => undefined, step: 1, formatter: (value) => String(Math.round(Number(value))), rightAlign: true, small: true }) }) })
|
|
53
|
+
] }));
|
|
54
|
+
};
|
|
55
|
+
exports.GuideInspector = GuideInspector;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyframeInspector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
|
+
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
9
|
+
const parse_keyframe_field_from_node_path_1 = require("../Timeline/parse-keyframe-field-from-node-path");
|
|
10
|
+
const TimelineEffectPropItem_1 = require("../Timeline/TimelineEffectPropItem");
|
|
11
|
+
const TimelineSequencePropItem_1 = require("../Timeline/TimelineSequencePropItem");
|
|
12
|
+
const common_1 = require("./common");
|
|
13
|
+
const styles_1 = require("./styles");
|
|
14
|
+
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
15
|
+
const KeyframeInspector = ({ selection }) => {
|
|
16
|
+
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
17
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
18
|
+
const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
19
|
+
const details = (0, react_1.useMemo)(() => {
|
|
20
|
+
var _a;
|
|
21
|
+
var _b, _c, _d, _e, _f, _g;
|
|
22
|
+
if (!track || !track.sequence.controls) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const keyframeField = (0, parse_keyframe_field_from_node_path_1.parseKeyframeFieldFromNodePath)(selection.nodePathInfo.auxiliaryKeys);
|
|
26
|
+
if (keyframeField === null) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const nodePath = selection.nodePathInfo.sequenceSubscriptionKey;
|
|
30
|
+
const { keyframeDisplayOffset } = track;
|
|
31
|
+
const sourceFrame = selection.frame - keyframeDisplayOffset;
|
|
32
|
+
if (keyframeField.type === 'sequence') {
|
|
33
|
+
const sequenceFields = (0, timeline_layout_1.getFieldsToShow)({
|
|
34
|
+
schema: track.sequence.controls.schema,
|
|
35
|
+
currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
|
|
36
|
+
getDragOverrides,
|
|
37
|
+
propStatuses,
|
|
38
|
+
nodePath,
|
|
39
|
+
});
|
|
40
|
+
const sequenceField = (_b = sequenceFields === null || sequenceFields === void 0 ? void 0 : sequenceFields.find((candidate) => candidate.key === keyframeField.fieldKey)) !== null && _b !== void 0 ? _b : null;
|
|
41
|
+
const sequencePropStatus = (_c = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a[keyframeField.fieldKey]) !== null && _c !== void 0 ? _c : null;
|
|
42
|
+
if (!sequenceField || (sequencePropStatus === null || sequencePropStatus === void 0 ? void 0 : sequencePropStatus.status) !== 'keyframed') {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
type: 'sequence',
|
|
47
|
+
field: sequenceField,
|
|
48
|
+
fieldLabel: (_d = sequenceField.description) !== null && _d !== void 0 ? _d : sequenceField.key,
|
|
49
|
+
fileName: nodePath.absolutePath,
|
|
50
|
+
nodePath,
|
|
51
|
+
propStatus: sequencePropStatus,
|
|
52
|
+
schema: track.sequence.controls.schema,
|
|
53
|
+
sourceFrame,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const effect = track.sequence.effects[keyframeField.effectIndex];
|
|
57
|
+
if (!effect) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const effectFields = (0, timeline_layout_1.getEffectFieldsToShow)({
|
|
61
|
+
effect,
|
|
62
|
+
effectIndex: keyframeField.effectIndex,
|
|
63
|
+
nodePath,
|
|
64
|
+
propStatuses,
|
|
65
|
+
getEffectDragOverrides,
|
|
66
|
+
});
|
|
67
|
+
const effectField = (_e = effectFields.find((candidate) => candidate.key === keyframeField.fieldKey)) !== null && _e !== void 0 ? _e : null;
|
|
68
|
+
const effectStatus = remotion_1.Internals.getEffectPropStatusesCtx({
|
|
69
|
+
propStatuses,
|
|
70
|
+
nodePath,
|
|
71
|
+
effectIndex: keyframeField.effectIndex,
|
|
72
|
+
});
|
|
73
|
+
const effectPropStatus = effectStatus.type === 'can-update-effect'
|
|
74
|
+
? ((_f = effectStatus.props[keyframeField.fieldKey]) !== null && _f !== void 0 ? _f : null)
|
|
75
|
+
: null;
|
|
76
|
+
if (!effectField || (effectPropStatus === null || effectPropStatus === void 0 ? void 0 : effectPropStatus.status) !== 'keyframed') {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
type: 'effect',
|
|
81
|
+
field: effectField,
|
|
82
|
+
fieldLabel: (_g = effectField.description) !== null && _g !== void 0 ? _g : effectField.key,
|
|
83
|
+
nodePath,
|
|
84
|
+
sourceFrame,
|
|
85
|
+
validatedLocation: {
|
|
86
|
+
source: nodePath.absolutePath,
|
|
87
|
+
line: 1,
|
|
88
|
+
column: 0,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}, [
|
|
92
|
+
getDragOverrides,
|
|
93
|
+
getEffectDragOverrides,
|
|
94
|
+
propStatuses,
|
|
95
|
+
selection,
|
|
96
|
+
track,
|
|
97
|
+
]);
|
|
98
|
+
if (details === null) {
|
|
99
|
+
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Keyframe unavailable" });
|
|
100
|
+
}
|
|
101
|
+
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
102
|
+
jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: "Keyframe" }), jsx_runtime_1.jsxs("div", { style: styles_1.detailsContainer, children: [
|
|
103
|
+
jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Frame", children: selection.frame }), jsx_runtime_1.jsxs("div", { style: styles_1.keyframeEditorRow, children: [
|
|
104
|
+
jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorLabel, children: details.fieldLabel }), jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorValue, children: details.type === 'sequence' ? (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequenceKeyframedValue, { field: details.field, fileName: details.fileName, nodePath: details.nodePath, schema: details.schema, propStatus: details.propStatus, sourceFrame: details.sourceFrame })) : (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropValue, { field: details.field, nodePath: details.nodePath, validatedLocation: details.validatedLocation, sourceFrame: details.sourceFrame })) })
|
|
105
|
+
] })
|
|
106
|
+
] })
|
|
107
|
+
] }));
|
|
108
|
+
};
|
|
109
|
+
exports.KeyframeInspector = KeyframeInspector;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SelectedInspector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const common_1 = require("./common");
|
|
6
|
+
const EasingInspector_1 = require("./EasingInspector");
|
|
7
|
+
const GuideInspector_1 = require("./GuideInspector");
|
|
8
|
+
const inspector_selection_1 = require("./inspector-selection");
|
|
9
|
+
const KeyframeInspector_1 = require("./KeyframeInspector");
|
|
10
|
+
const SequenceSelectionInspector_1 = require("./SequenceSelectionInspector");
|
|
11
|
+
const SelectedInspector = ({ selection }) => {
|
|
12
|
+
if ((0, inspector_selection_1.isSequenceSectionSelection)(selection)) {
|
|
13
|
+
return jsx_runtime_1.jsx(SequenceSelectionInspector_1.SequenceSelectionInspector, { selection: selection });
|
|
14
|
+
}
|
|
15
|
+
if (selection.type === 'keyframe') {
|
|
16
|
+
return jsx_runtime_1.jsx(KeyframeInspector_1.KeyframeInspector, { selection: selection });
|
|
17
|
+
}
|
|
18
|
+
if (selection.type === 'easing') {
|
|
19
|
+
return jsx_runtime_1.jsx(EasingInspector_1.EasingInspector, { selection: selection });
|
|
20
|
+
}
|
|
21
|
+
if (selection.type === 'guide') {
|
|
22
|
+
return jsx_runtime_1.jsx(GuideInspector_1.GuideInspector, { selection: selection });
|
|
23
|
+
}
|
|
24
|
+
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Inspector unavailable" });
|
|
25
|
+
};
|
|
26
|
+
exports.SelectedInspector = SelectedInspector;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequenceSelectionInspector = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const InspectorSequenceSection_1 = require("../InspectorSequenceSection");
|
|
9
|
+
const InspectorSourceLocation_1 = require("../InspectorSourceLocation");
|
|
10
|
+
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
11
|
+
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
12
|
+
const use_open_sequence_in_editor_1 = require("../Timeline/use-open-sequence-in-editor");
|
|
13
|
+
const common_1 = require("./common");
|
|
14
|
+
const styles_1 = require("./styles");
|
|
15
|
+
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
16
|
+
const useSequenceDisplayName = (track) => {
|
|
17
|
+
var _a;
|
|
18
|
+
var _b;
|
|
19
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
20
|
+
const nodePath = (_b = (_a = track.nodePathInfo) === null || _a === void 0 ? void 0 : _a.sequenceSubscriptionKey) !== null && _b !== void 0 ? _b : null;
|
|
21
|
+
return (0, react_1.useMemo)(() => {
|
|
22
|
+
const propStatusesForOverride = nodePath
|
|
23
|
+
? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
|
|
24
|
+
: undefined;
|
|
25
|
+
const codeNameStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.name;
|
|
26
|
+
const displayName = codeNameStatus &&
|
|
27
|
+
codeNameStatus.status === 'static' &&
|
|
28
|
+
typeof codeNameStatus.codeValue === 'string'
|
|
29
|
+
? codeNameStatus.codeValue
|
|
30
|
+
: track.sequence.displayName;
|
|
31
|
+
return displayName || '<Sequence>';
|
|
32
|
+
}, [nodePath, propStatuses, track.sequence.displayName]);
|
|
33
|
+
};
|
|
34
|
+
const SequenceExpandedInspector = ({ track }) => {
|
|
35
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
36
|
+
const { selectedItems, selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
37
|
+
const { canOpenInEditor, openInEditor, originalLocation } = (0, use_open_sequence_in_editor_1.useOpenSequenceInEditor)(track.sequence);
|
|
38
|
+
const sequenceDisplayName = useSequenceDisplayName(track);
|
|
39
|
+
const { documentationLink } = track.sequence;
|
|
40
|
+
const validatedLocation = (0, react_1.useMemo)(() => {
|
|
41
|
+
var _a;
|
|
42
|
+
if (!originalLocation ||
|
|
43
|
+
!originalLocation.source ||
|
|
44
|
+
!originalLocation.line) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
source: originalLocation.source,
|
|
49
|
+
line: originalLocation.line,
|
|
50
|
+
column: (_a = originalLocation.column) !== null && _a !== void 0 ? _a : 0,
|
|
51
|
+
};
|
|
52
|
+
}, [originalLocation]);
|
|
53
|
+
const openFileLocation = (0, react_1.useCallback)(() => {
|
|
54
|
+
if (!canOpenInEditor) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
openInEditor();
|
|
58
|
+
}, [canOpenInEditor, openInEditor]);
|
|
59
|
+
const openDocumentationLink = (0, react_1.useCallback)(() => {
|
|
60
|
+
if (!documentationLink) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
window.open(documentationLink, '_blank', 'noopener,noreferrer');
|
|
64
|
+
}, [documentationLink]);
|
|
65
|
+
const subtitleStyle = (0, react_1.useMemo)(() => {
|
|
66
|
+
return {
|
|
67
|
+
...styles_1.sequenceHeaderSubtitle,
|
|
68
|
+
cursor: documentationLink ? 'pointer' : 'default',
|
|
69
|
+
};
|
|
70
|
+
}, [documentationLink]);
|
|
71
|
+
const sequenceSelection = (0, react_1.useMemo)(() => {
|
|
72
|
+
if (!track.nodePathInfo) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
type: 'sequence',
|
|
77
|
+
nodePathInfo: track.nodePathInfo,
|
|
78
|
+
};
|
|
79
|
+
}, [track.nodePathInfo]);
|
|
80
|
+
const sequenceSelected = (0, react_1.useMemo)(() => {
|
|
81
|
+
if (sequenceSelection === null || selectedItems.length !== 1) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return ((0, TimelineSelection_1.getTimelineSelectionKey)(selectedItems[0]) ===
|
|
85
|
+
(0, TimelineSelection_1.getTimelineSelectionKey)(sequenceSelection));
|
|
86
|
+
}, [selectedItems, sequenceSelection]);
|
|
87
|
+
const selectSequenceOnInspectorPointerDown = (0, react_1.useCallback)((event) => {
|
|
88
|
+
if (event.button !== 0 || sequenceSelection === null) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
if (sequenceSelected) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
selectItems([sequenceSelection]);
|
|
96
|
+
}, [selectItems, sequenceSelected, sequenceSelection]);
|
|
97
|
+
if (previewServerState.type !== 'connected') {
|
|
98
|
+
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Studio server disconnected" });
|
|
99
|
+
}
|
|
100
|
+
if (!track.nodePathInfo ||
|
|
101
|
+
!(0, InspectorSequenceSection_1.hasSequenceControls)(track.sequence) ||
|
|
102
|
+
!validatedLocation) {
|
|
103
|
+
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
104
|
+
}
|
|
105
|
+
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
106
|
+
jsx_runtime_1.jsxs("div", { style: styles_1.sequenceHeader, children: [
|
|
107
|
+
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderTitle, children: sequenceDisplayName }), documentationLink ? (jsx_runtime_1.jsx("button", { type: "button", style: subtitleStyle, title: "Open component docs", onClick: openDocumentationLink, children: track.sequence.controls.componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: track.sequence.controls.componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: canOpenInEditor, onOpen: openFileLocation })
|
|
108
|
+
] }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })) })] }));
|
|
109
|
+
};
|
|
110
|
+
const SequenceSelectionInspector = ({ selection }) => {
|
|
111
|
+
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
112
|
+
if (!track) {
|
|
113
|
+
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
114
|
+
}
|
|
115
|
+
return jsx_runtime_1.jsx(SequenceExpandedInspector, { track: track });
|
|
116
|
+
};
|
|
117
|
+
exports.SequenceSelectionInspector = SequenceSelectionInspector;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RenderModalWarning } from '../RenderModal/DataEditor';
|
|
3
|
+
export declare const InspectorSectionHeader: React.FC<{
|
|
4
|
+
readonly children: React.ReactNode;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const InspectorMessage: React.FC<{
|
|
7
|
+
readonly children: React.ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const InspectorDetailRow: React.FC<{
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly children: React.ReactNode;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const InspectorDefaultPropsWarnings: React.FC<{
|
|
14
|
+
readonly warnings: RenderModalWarning[];
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InspectorDefaultPropsWarnings = exports.InspectorDetailRow = exports.InspectorMessage = exports.InspectorSectionHeader = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
6
|
+
const styles_1 = require("./styles");
|
|
7
|
+
const InspectorSectionHeader = ({ children }) => jsx_runtime_1.jsx("div", { style: styles_1.sectionHeader, children: children });
|
|
8
|
+
exports.InspectorSectionHeader = InspectorSectionHeader;
|
|
9
|
+
const InspectorMessage = ({ children }) => jsx_runtime_1.jsx("div", { style: styles_1.centeredMessage, children: children });
|
|
10
|
+
exports.InspectorMessage = InspectorMessage;
|
|
11
|
+
const InspectorDetailRow = ({ label, children }) => (jsx_runtime_1.jsxs("div", { style: styles_1.detailRow, children: [
|
|
12
|
+
jsx_runtime_1.jsx("div", { style: styles_1.detailLabel, children: label }), jsx_runtime_1.jsx("div", { style: styles_1.detailValue, children: children })
|
|
13
|
+
] }));
|
|
14
|
+
exports.InspectorDetailRow = InspectorDetailRow;
|
|
15
|
+
const InspectorDefaultPropsWarnings = ({ warnings }) => {
|
|
16
|
+
return (jsx_runtime_1.jsx("div", { style: styles_1.defaultPropsWarningMessages, children: warnings.map((warning) => (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: warning.message, align: "flex-start", type: "warning", size: "compact", action: warning.resolveLink ? (jsx_runtime_1.jsx("a", { href: warning.resolveLink, target: "_blank", rel: "noopener noreferrer", style: styles_1.resolveLinkStyle, children: "Resolve" })) : null }, warning.id))) }));
|
|
17
|
+
};
|
|
18
|
+
exports.InspectorDefaultPropsWarnings = InspectorDefaultPropsWarnings;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TimelineSelection } from '../Timeline/TimelineSelection';
|
|
2
|
+
export type SequenceSectionSelection = Extract<TimelineSelection, {
|
|
3
|
+
type: 'sequence' | 'sequence-prop' | 'sequence-all-effects' | 'sequence-effect' | 'sequence-effect-prop';
|
|
4
|
+
}>;
|
|
5
|
+
export declare const isSequenceSectionSelection: (selection: TimelineSelection) => selection is SequenceSectionSelection;
|
|
6
|
+
type SameSequenceInspectorSelection = Extract<TimelineSelection, {
|
|
7
|
+
type: 'sequence-prop' | 'sequence-effect' | 'sequence-effect-prop';
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getSameSequenceInspectorSelection: (selections: readonly TimelineSelection[]) => SameSequenceInspectorSelection | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSameSequenceInspectorSelection = exports.isSequenceSectionSelection = void 0;
|
|
4
|
+
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
5
|
+
const isSequenceSectionSelection = (selection) => {
|
|
6
|
+
return (selection.type === 'sequence' ||
|
|
7
|
+
selection.type === 'sequence-prop' ||
|
|
8
|
+
selection.type === 'sequence-all-effects' ||
|
|
9
|
+
selection.type === 'sequence-effect' ||
|
|
10
|
+
selection.type === 'sequence-effect-prop');
|
|
11
|
+
};
|
|
12
|
+
exports.isSequenceSectionSelection = isSequenceSectionSelection;
|
|
13
|
+
const isSameSequenceInspectorSelection = (selection) => {
|
|
14
|
+
return (selection.type === 'sequence-prop' ||
|
|
15
|
+
selection.type === 'sequence-effect' ||
|
|
16
|
+
selection.type === 'sequence-effect-prop');
|
|
17
|
+
};
|
|
18
|
+
const getSameSequenceInspectorSelection = (selections) => {
|
|
19
|
+
const firstSelection = selections[0];
|
|
20
|
+
if (!firstSelection || !isSameSequenceInspectorSelection(firstSelection)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const rootSequenceKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(firstSelection.nodePathInfo);
|
|
24
|
+
for (const selection of selections) {
|
|
25
|
+
if (!isSameSequenceInspectorSelection(selection)) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if ((0, TimelineSelection_1.getTimelineSequenceSelectionKey)(selection.nodePathInfo) !==
|
|
29
|
+
rootSequenceKey) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return firstSelection;
|
|
34
|
+
};
|
|
35
|
+
exports.getSameSequenceInspectorSelection = getSameSequenceInspectorSelection;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const container: React.CSSProperties;
|
|
3
|
+
export declare const scrollableContainer: React.CSSProperties;
|
|
4
|
+
export declare const defaultPropsSection: React.CSSProperties;
|
|
5
|
+
export declare const visualControlsSection: React.CSSProperties;
|
|
6
|
+
export declare const compositionSection: React.CSSProperties;
|
|
7
|
+
export declare const inspectorSectionDivider: React.CSSProperties;
|
|
8
|
+
export declare const sectionHeader: React.CSSProperties;
|
|
9
|
+
export declare const sequenceHeader: React.CSSProperties;
|
|
10
|
+
export declare const sequenceHeaderTitle: React.CSSProperties;
|
|
11
|
+
export declare const sequenceHeaderSubtitle: React.CSSProperties;
|
|
12
|
+
export declare const sectionHeaderRow: React.CSSProperties;
|
|
13
|
+
export declare const sectionHeaderTitle: React.CSSProperties;
|
|
14
|
+
export declare const sectionHeaderStart: React.CSSProperties;
|
|
15
|
+
export declare const sectionHeaderEnd: React.CSSProperties;
|
|
16
|
+
export declare const defaultPropsWarningContainer: React.CSSProperties;
|
|
17
|
+
export declare const defaultPropsWarningMessages: React.CSSProperties;
|
|
18
|
+
export declare const resolveLinkStyle: React.CSSProperties;
|
|
19
|
+
export declare const selectedContainer: React.CSSProperties;
|
|
20
|
+
export declare const centeredMessage: React.CSSProperties;
|
|
21
|
+
export declare const detailsContainer: React.CSSProperties;
|
|
22
|
+
export declare const guideDetailsContainer: React.CSSProperties;
|
|
23
|
+
export declare const detailRow: React.CSSProperties;
|
|
24
|
+
export declare const detailLabel: React.CSSProperties;
|
|
25
|
+
export declare const detailValue: React.CSSProperties;
|
|
26
|
+
export declare const keyframeEditorRow: React.CSSProperties;
|
|
27
|
+
export declare const keyframeEditorLabel: React.CSSProperties;
|
|
28
|
+
export declare const keyframeEditorValue: React.CSSProperties;
|