@remotion/studio 4.0.499 → 4.0.501
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/Studio.js +1 -1
- package/dist/api/delete-static-file.js +8 -3
- package/dist/api/rename-static-file.js +8 -0
- package/dist/api/watch-public-folder.js +2 -1
- package/dist/api/watch-static-file.js +2 -1
- package/dist/api/write-static-file.js +8 -3
- package/dist/components/AssetSelector.js +11 -7
- package/dist/components/AssetSelectorItem.d.ts +25 -0
- package/dist/components/AssetSelectorItem.js +116 -80
- package/dist/components/Canvas.js +6 -1
- package/dist/components/CaptionInspector.d.ts +10 -0
- package/dist/components/CaptionInspector.js +24 -0
- package/dist/components/CaptionTextEditor.d.ts +9 -0
- package/dist/components/CaptionTextEditor.js +132 -0
- package/dist/components/CompositionSelector.js +2 -32
- package/dist/components/ControlButton.js +1 -0
- package/dist/components/CurrentAsset.js +3 -2
- package/dist/components/EditorContexts.d.ts +0 -1
- package/dist/components/EditorContexts.js +2 -2
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/ExplorerPanelRef.d.ts +2 -0
- package/dist/components/FpsCounter.js +3 -3
- package/dist/components/FullscreenToggle.js +2 -1
- package/dist/components/GlobalKeybindings.js +9 -1
- package/dist/components/InitialCompositionLoader.d.ts +1 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +3 -2
- package/dist/components/InlineCaptionInspector.d.ts +11 -0
- package/dist/components/InlineCaptionInspector.js +108 -0
- package/dist/components/InlineDropdown.d.ts +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +12 -9
- package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +10 -10
- package/dist/components/InspectorPanel/common.d.ts +17 -4
- package/dist/components/InspectorPanel/common.js +60 -6
- package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
- package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
- package/dist/components/InspectorPanel/styles.js +7 -1
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +3 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +91 -5
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.d.ts +2 -1
- package/dist/components/InspectorSequenceSection.js +279 -25
- package/dist/components/KeyboardShortcutsExplainer.js +4 -2
- package/dist/components/Menu/MenuItem.js +2 -1
- package/dist/components/MenuCompositionName.js +30 -7
- package/dist/components/MenuToolbar.d.ts +0 -1
- package/dist/components/MenuToolbar.js +15 -7
- package/dist/components/MobilePanel.d.ts +2 -1
- package/dist/components/MobilePanel.js +29 -25
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +7 -0
- package/dist/components/NewComposition/InputDragger.js +119 -8
- package/dist/components/OutlineToggle.d.ts +1 -3
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +45 -0
- package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +10 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +10 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +95 -13
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
- package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
- package/dist/components/QuickSwitcher/asset-search.js +42 -0
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
- package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
- package/dist/components/SelectedOutlineCropControls.js +299 -0
- package/dist/components/SelectedOutlineElement.js +84 -47
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.js +147 -16
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
- package/dist/components/ShowOutlinesProvider.js +4 -1
- package/dist/components/SidebarCollapserControls.d.ts +3 -1
- package/dist/components/SidebarCollapserControls.js +34 -29
- package/dist/components/SnappingToggle.d.ts +1 -3
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Timeline/Timeline.js +19 -5
- package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
- package/dist/components/Timeline/TimelineAssetField.js +53 -100
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
- package/dist/components/Timeline/TimelineColorField.js +20 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -1
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
- package/dist/components/Timeline/TimelineList.d.ts +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +10 -2
- package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
- package/dist/components/Timeline/TimelineRowChrome.js +4 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +9 -7
- package/dist/components/Timeline/TimelineSelection.js +17 -12
- package/dist/components/Timeline/TimelineSequence.js +2 -9
- package/dist/components/Timeline/TimelineSequenceItem.js +61 -15
- package/dist/components/Timeline/TimelineSequencePropItem.js +36 -85
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +0 -1
- package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
- package/dist/components/Timeline/TimelineTrack.js +4 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
- package/dist/components/Timeline/border-radius-representation.js +60 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
- package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
- package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
- package/dist/components/Timeline/reset-selected-timeline-props.js +20 -18
- package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
- package/dist/components/Timeline/save-effect-prop.js +52 -1
- package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
- package/dist/components/Timeline/save-sequence-prop.js +25 -1
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +17 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
- package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
- package/dist/components/TopPanel.js +2 -2
- package/dist/components/UndoRedoButtons.js +42 -11
- package/dist/components/composition-drop-preview.js +1 -0
- package/dist/components/handle-drop.d.ts +3 -2
- package/dist/components/handle-drop.js +2 -1
- package/dist/components/import-assets.d.ts +4 -2
- package/dist/components/import-assets.js +20 -7
- package/dist/components/menu-toolbar-height.d.ts +1 -0
- package/dist/components/menu-toolbar-height.js +4 -0
- package/dist/components/selected-outline-drag.d.ts +41 -4
- package/dist/components/selected-outline-drag.js +179 -2
- package/dist/components/selected-outline-geometry.d.ts +1 -0
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +64 -3
- package/dist/components/selected-outline-types.d.ts +44 -1
- package/dist/components/selected-outline-types.js +21 -1
- package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
- package/dist/components/use-element-overwrite-confirmation.js +73 -0
- package/dist/components/use-static-files.js +7 -2
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
- package/dist/esm/{chunk-pk1zwsn1.js → chunk-n1kj09yv.js} +10618 -8002
- package/dist/esm/index.mjs +24 -8
- package/dist/esm/internals.mjs +10618 -8002
- package/dist/esm/previewEntry.mjs +40002 -37388
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +14 -0
- package/dist/helpers/calculate-timeline.d.ts +2 -2
- package/dist/helpers/calculate-timeline.js +8 -28
- package/dist/helpers/client-id.d.ts +0 -1
- package/dist/helpers/client-id.js +15 -10
- package/dist/helpers/download-blob.d.ts +1 -0
- package/dist/helpers/download-blob.js +15 -0
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
- package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
- package/dist/helpers/inject-css.js +5 -3
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -2
- package/dist/helpers/is-mac.d.ts +1 -0
- package/dist/helpers/is-mac.js +4 -0
- package/dist/helpers/open-in-editor.d.ts +5 -1
- package/dist/helpers/open-in-editor.js +39 -4
- package/dist/helpers/preview-server-events.js +46 -9
- package/dist/helpers/sort-by-nonce-history.js +97 -19
- package/dist/helpers/use-create-composition.js +8 -6
- package/dist/helpers/use-keybinding.js +2 -3
- package/dist/helpers/use-menu-structure.js +39 -1
- package/dist/hot-middleware-client/client.js +3 -3
- package/dist/icons/border-radius.d.ts +4 -0
- package/dist/icons/border-radius.js +8 -0
- package/dist/icons/caret.d.ts +1 -0
- package/dist/icons/caret.js +2 -2
- package/dist/icons/fullscreen.d.ts +4 -0
- package/dist/icons/fullscreen.js +6 -0
- package/dist/icons/pen.d.ts +5 -0
- package/dist/icons/pen.js +8 -0
- package/dist/previewEntry.js +1 -1
- package/dist/state/modals.d.ts +9 -0
- package/dist/state/timeline-sequence-hover.d.ts +17 -0
- package/dist/state/timeline-sequence-hover.js +33 -0
- package/package.json +13 -12
- package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
- package/dist/helpers/get-timeline-sequence-hash.js +0 -33
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CaptionTextEditor = 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 RemInput_1 = require("./NewComposition/RemInput");
|
|
8
|
+
const container = {
|
|
9
|
+
alignSelf: 'stretch',
|
|
10
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
fontFamily: 'sans-serif',
|
|
14
|
+
width: '100%',
|
|
15
|
+
};
|
|
16
|
+
const list = {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
};
|
|
20
|
+
const row = {
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
borderBottom: `1px solid ${colors_1.LINE_COLOR}`,
|
|
23
|
+
display: 'grid',
|
|
24
|
+
gap: 12,
|
|
25
|
+
gridTemplateColumns: '100px minmax(0, 1fr)',
|
|
26
|
+
padding: '5px 12px',
|
|
27
|
+
};
|
|
28
|
+
const timing = {
|
|
29
|
+
color: colors_1.LIGHT_TEXT,
|
|
30
|
+
fontFamily: 'monospace',
|
|
31
|
+
fontSize: 11,
|
|
32
|
+
fontVariantNumeric: 'tabular-nums',
|
|
33
|
+
lineHeight: '16px',
|
|
34
|
+
textAlign: 'right',
|
|
35
|
+
whiteSpace: 'nowrap',
|
|
36
|
+
};
|
|
37
|
+
const empty = {
|
|
38
|
+
color: colors_1.LIGHT_TEXT,
|
|
39
|
+
fontFamily: 'sans-serif',
|
|
40
|
+
fontSize: 13,
|
|
41
|
+
lineHeight: '18px',
|
|
42
|
+
padding: 12,
|
|
43
|
+
textAlign: 'center',
|
|
44
|
+
};
|
|
45
|
+
const formatMilliseconds = (milliseconds) => {
|
|
46
|
+
return Math.round(milliseconds);
|
|
47
|
+
};
|
|
48
|
+
const CaptionTextEditor = ({ captions, onChange, onSave, onCancel, readOnly }) => {
|
|
49
|
+
const listRef = (0, react_1.useRef)(null);
|
|
50
|
+
const cancelledBlurIndexes = (0, react_1.useRef)(new Set());
|
|
51
|
+
const dirtyRef = (0, react_1.useRef)(false);
|
|
52
|
+
const latestRef = (0, react_1.useRef)({ captions, onSave });
|
|
53
|
+
latestRef.current = { captions, onSave };
|
|
54
|
+
const captionRows = (0, react_1.useMemo)(() => {
|
|
55
|
+
const occurrences = new Map();
|
|
56
|
+
return captions.map((caption) => {
|
|
57
|
+
var _a;
|
|
58
|
+
const signature = [
|
|
59
|
+
caption.startMs,
|
|
60
|
+
caption.endMs,
|
|
61
|
+
caption.timestampMs,
|
|
62
|
+
caption.confidence,
|
|
63
|
+
].join('-');
|
|
64
|
+
const occurrence = (_a = occurrences.get(signature)) !== null && _a !== void 0 ? _a : 0;
|
|
65
|
+
occurrences.set(signature, occurrence + 1);
|
|
66
|
+
return { caption, key: `${signature}-${occurrence}` };
|
|
67
|
+
});
|
|
68
|
+
}, [captions]);
|
|
69
|
+
const commitPending = (0, react_1.useCallback)(() => {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
if (!dirtyRef.current) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
dirtyRef.current = false;
|
|
75
|
+
(_b = (_a = latestRef.current).onSave) === null || _b === void 0 ? void 0 : _b.call(_a, latestRef.current.captions);
|
|
76
|
+
}, []);
|
|
77
|
+
(0, react_1.useEffect)(() => {
|
|
78
|
+
return commitPending;
|
|
79
|
+
}, [commitPending]);
|
|
80
|
+
const updateText = (0, react_1.useCallback)((index, text) => {
|
|
81
|
+
var _a;
|
|
82
|
+
if (((_a = latestRef.current.captions[index]) === null || _a === void 0 ? void 0 : _a.text) === text) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const nextCaptions = latestRef.current.captions.map((caption, captionIndex) => {
|
|
86
|
+
return captionIndex === index ? { ...caption, text } : caption;
|
|
87
|
+
});
|
|
88
|
+
latestRef.current.captions = nextCaptions;
|
|
89
|
+
dirtyRef.current = true;
|
|
90
|
+
onChange(nextCaptions);
|
|
91
|
+
}, [onChange]);
|
|
92
|
+
const focusSibling = (0, react_1.useCallback)((index) => {
|
|
93
|
+
var _a;
|
|
94
|
+
const input = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-caption-index="${index}"]`);
|
|
95
|
+
input === null || input === void 0 ? void 0 : input.focus();
|
|
96
|
+
input === null || input === void 0 ? void 0 : input.scrollIntoView({ block: 'nearest' });
|
|
97
|
+
}, []);
|
|
98
|
+
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs("div", { ref: listRef, style: list, children: [captions.length === 0 ? jsx_runtime_1.jsx("div", { style: empty, children: "No captions" }) : null, captionRows.map(({ caption, key }, index) => {
|
|
99
|
+
return (jsx_runtime_1.jsxs("div", { style: row, children: [
|
|
100
|
+
jsx_runtime_1.jsxs("div", { style: timing, children: [formatMilliseconds(caption.startMs), " \u2192", ' ', formatMilliseconds(caption.endMs), " ms"] }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { "data-caption-index": index, disabled: readOnly, onBlur: (event) => {
|
|
101
|
+
if (cancelledBlurIndexes.current.delete(index)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
updateText(index, event.currentTarget.value);
|
|
105
|
+
commitPending();
|
|
106
|
+
}, onChange: (event) => updateText(index, event.target.value), onKeyDown: (event) => {
|
|
107
|
+
if (event.key === 'ArrowDown' &&
|
|
108
|
+
index < captions.length - 1) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
focusSibling(index + 1);
|
|
111
|
+
}
|
|
112
|
+
if (event.key === 'ArrowUp' && index > 0) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
focusSibling(index - 1);
|
|
115
|
+
}
|
|
116
|
+
if (event.key === 'Escape') {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
cancelledBlurIndexes.current.add(index);
|
|
119
|
+
dirtyRef.current = false;
|
|
120
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
121
|
+
event.currentTarget.blur();
|
|
122
|
+
}
|
|
123
|
+
}, rightAlign: false, small: true, status: "ok", style: {
|
|
124
|
+
color: colors_1.WHITE,
|
|
125
|
+
fontFamily: 'sans-serif',
|
|
126
|
+
fontSize: 12,
|
|
127
|
+
lineHeight: '16px',
|
|
128
|
+
}, value: caption.text })
|
|
129
|
+
] }, key));
|
|
130
|
+
})] }) }));
|
|
131
|
+
};
|
|
132
|
+
exports.CaptionTextEditor = CaptionTextEditor;
|
|
@@ -6,19 +6,18 @@ const drag_and_drop_1 = require("@remotion/drag-and-drop");
|
|
|
6
6
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const remotion_1 = require("remotion");
|
|
9
|
-
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
10
9
|
const client_id_1 = require("../helpers/client-id");
|
|
11
10
|
const colors_1 = require("../helpers/colors");
|
|
12
11
|
const create_folder_tree_1 = require("../helpers/create-folder-tree");
|
|
13
12
|
const persist_open_folders_1 = require("../helpers/persist-open-folders");
|
|
14
13
|
const sort_by_nonce_history_1 = require("../helpers/sort-by-nonce-history");
|
|
15
|
-
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
16
14
|
const modals_1 = require("../state/modals");
|
|
17
15
|
const z_index_1 = require("../state/z-index");
|
|
18
16
|
const CompositionSelectorItem_1 = require("./CompositionSelectorItem");
|
|
19
17
|
const ContextMenu_1 = require("./ContextMenu");
|
|
20
18
|
const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
|
|
21
19
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
20
|
+
const ExplorerQuickSwitcherTrigger_1 = require("./QuickSwitcher/ExplorerQuickSwitcherTrigger");
|
|
22
21
|
const actions_1 = require("./RenderQueue/actions");
|
|
23
22
|
const root_composition_menu_items_1 = require("./root-composition-menu-items");
|
|
24
23
|
const useCompositionNavigation = () => {
|
|
@@ -65,28 +64,6 @@ const container = {
|
|
|
65
64
|
overflow: 'hidden',
|
|
66
65
|
backgroundColor: colors_1.BACKGROUND,
|
|
67
66
|
};
|
|
68
|
-
const quickSwitcherArea = {
|
|
69
|
-
padding: '4px 12px',
|
|
70
|
-
borderBottom: `1px solid ${colors_1.BLACK_HEX}`,
|
|
71
|
-
};
|
|
72
|
-
const quickSwitcherTrigger = {
|
|
73
|
-
backgroundColor: colors_1.WHITE_ALPHA_06,
|
|
74
|
-
borderRadius: 5,
|
|
75
|
-
padding: '4px 10px',
|
|
76
|
-
color: colors_1.LIGHT_TEXT,
|
|
77
|
-
fontSize: 12,
|
|
78
|
-
cursor: 'pointer',
|
|
79
|
-
display: 'flex',
|
|
80
|
-
alignItems: 'center',
|
|
81
|
-
justifyContent: 'space-between',
|
|
82
|
-
border: 'none',
|
|
83
|
-
width: '100%',
|
|
84
|
-
appearance: 'none',
|
|
85
|
-
};
|
|
86
|
-
const shortcutLabel = {
|
|
87
|
-
fontSize: 11,
|
|
88
|
-
opacity: 0.6,
|
|
89
|
-
};
|
|
90
67
|
const autoScrollThreshold = 70;
|
|
91
68
|
const maxAutoScrollSpeed = 18;
|
|
92
69
|
const getAutoScrollSpeed = ({ clientY, element, }) => {
|
|
@@ -146,13 +123,6 @@ const CompositionSelector = () => {
|
|
|
146
123
|
var _a;
|
|
147
124
|
(_a = remotion_1.Internals.compositionSelectorRef.current) === null || _a === void 0 ? void 0 : _a.toggleFolder(folderName, parentName);
|
|
148
125
|
}, []);
|
|
149
|
-
const openQuickSwitcher = (0, react_1.useCallback)(() => {
|
|
150
|
-
setSelectedModal({
|
|
151
|
-
type: 'quick-switcher',
|
|
152
|
-
mode: 'compositions',
|
|
153
|
-
invocationTimestamp: Date.now(),
|
|
154
|
-
});
|
|
155
|
-
}, [setSelectedModal]);
|
|
156
126
|
const clearRootDragHover = (0, react_1.useCallback)(() => {
|
|
157
127
|
setRootDragHovered(false);
|
|
158
128
|
}, []);
|
|
@@ -264,7 +234,7 @@ const CompositionSelector = () => {
|
|
|
264
234
|
}
|
|
265
235
|
}, [compositions, stopCompositionListAutoScroll]);
|
|
266
236
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
267
|
-
jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef, values: rootContextMenuItems, onOpen: null }), jsx_runtime_1.jsx(
|
|
237
|
+
jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef, values: rootContextMenuItems, onOpen: null }), jsx_runtime_1.jsx(ExplorerQuickSwitcherTrigger_1.ExplorerQuickSwitcherTrigger, { mode: "compositions", showShortcut: true, tabIndex: tabIndex }), jsx_runtime_1.jsx("div", { ref: listRef, className: "__remotion-vertical-scrollbar", style: list, onDragOverCapture: onCompositionListDragOverCapture, onDragEndCapture: stopCompositionListAutoScroll, onDragOver: onRootDragOver, onDragLeave: onRootDragLeave, onDropCapture: stopCompositionListAutoScroll, onDrop: onRootDrop, children: items.map((c) => {
|
|
268
238
|
return (jsx_runtime_1.jsx(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: canvasContent && canvasContent.type === 'composition'
|
|
269
239
|
? canvasContent.compositionId
|
|
270
240
|
: null, selectComposition: selectComposition, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover, tabIndex: tabIndex, item: c }, c.key + c.type));
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
8
9
|
const client_id_1 = require("../helpers/client-id");
|
|
9
10
|
const format_media_duration_1 = require("../helpers/format-media-duration");
|
|
10
11
|
const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
|
|
@@ -88,8 +89,8 @@ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStud
|
|
|
88
89
|
const imageSrc = (0, exports.getCurrentAssetImageMetadataSource)(assetName);
|
|
89
90
|
const imageMetadata = (0, use_image_metadata_1.useImageMetadata)(imageSrc);
|
|
90
91
|
const canRename = onAssetClick === undefined &&
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
((0, browser_studio_operations_1.getBrowserStudioOperations)() !== null ||
|
|
93
|
+
(connectionStatus === 'connected' && !readOnlyStudio));
|
|
93
94
|
const onRename = (0, react_1.useCallback)((newName) => {
|
|
94
95
|
renameFile(newName).catch(() => undefined);
|
|
95
96
|
}, [renameFile]);
|
|
@@ -24,8 +24,8 @@ const ShowRulersProvider_1 = require("./ShowRulersProvider");
|
|
|
24
24
|
const SnappingProvider_1 = require("./SnappingProvider");
|
|
25
25
|
const VisualControlsUndoSync_1 = require("./VisualControls/VisualControlsUndoSync");
|
|
26
26
|
const ZoomGesturesProvider_1 = require("./ZoomGesturesProvider");
|
|
27
|
-
const EditorContexts = ({ children
|
|
28
|
-
return (jsx_runtime_1.jsx(get_zod_if_possible_1.ZodProvider, { children: jsx_runtime_1.jsx(VisualControls_1.VisualControlsProvider, { children: jsx_runtime_1.jsxs(client_id_1.PreviewServerConnection, {
|
|
27
|
+
const EditorContexts = ({ children }) => {
|
|
28
|
+
return (jsx_runtime_1.jsx(get_zod_if_possible_1.ZodProvider, { children: jsx_runtime_1.jsx(VisualControls_1.VisualControlsProvider, { children: jsx_runtime_1.jsxs(client_id_1.PreviewServerConnection, { children: [
|
|
29
29
|
jsx_runtime_1.jsx(VisualControlsUndoSync_1.VisualControlsUndoSync, {}), jsx_runtime_1.jsxs(context_1.RenderQueueContextProvider, { children: [
|
|
30
30
|
jsx_runtime_1.jsx(ClientRenderQueueProcessor_1.ClientRenderQueueProcessor, {}), jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(CheckerboardProvider_1.CheckerboardProvider, { children: jsx_runtime_1.jsx(ZoomGesturesProvider_1.ZoomGesturesProvider, { children: jsx_runtime_1.jsx(ShowRulersProvider_1.ShowRulersProvider, { children: jsx_runtime_1.jsx(ShowGuidesProvider_1.ShowGuidesProvider, { children: jsx_runtime_1.jsx(ShowOutlinesProvider_1.ShowOutlinesProvider, { children: jsx_runtime_1.jsx(SnappingProvider_1.SnappingProvider, { children: jsx_runtime_1.jsx(preview_size_1.PreviewSizeProvider, { children: jsx_runtime_1.jsx(ModalsProvider_1.ModalsProvider, { children: jsx_runtime_1.jsx(MediaVolumeProvider_1.MediaVolumeProvider, { children: jsx_runtime_1.jsx(player_1.PlayerInternals.PlayerEmitterProvider, { currentPlaybackRate: null, children: jsx_runtime_1.jsx(sidebar_1.SidebarContextProvider, { children: jsx_runtime_1.jsx(folders_1.FolderContextProvider, { children: jsx_runtime_1.jsx(highest_z_index_1.HighestZIndexProvider, { children: jsx_runtime_1.jsx(SetTimelineInOutProvider_1.SetTimelineInOutProvider, { children: jsx_runtime_1.jsx(ExpandedTracksProvider_1.ExpandedTracksProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) })
|
|
31
31
|
] })
|
|
@@ -43,6 +43,7 @@ const ExplorerPanel = ({ readOnlyStudio }) => {
|
|
|
43
43
|
}, []);
|
|
44
44
|
(0, react_1.useImperativeHandle)(ExplorerPanelRef_1.explorerSidebarTabs, () => {
|
|
45
45
|
return {
|
|
46
|
+
getSelectedPanel: () => panel,
|
|
46
47
|
selectAssetsPanel: () => {
|
|
47
48
|
setPanel('assets');
|
|
48
49
|
persistSelectedOptionsSidebarPanel('assets');
|
|
@@ -52,7 +53,7 @@ const ExplorerPanel = ({ readOnlyStudio }) => {
|
|
|
52
53
|
persistSelectedOptionsSidebarPanel('compositions');
|
|
53
54
|
},
|
|
54
55
|
};
|
|
55
|
-
}, []);
|
|
56
|
+
}, [panel]);
|
|
56
57
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
57
58
|
// Prevent deselection of currently selected items
|
|
58
59
|
e.stopPropagation();
|
|
@@ -6,8 +6,8 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
8
|
const label = {
|
|
9
|
-
color: colors_1.
|
|
10
|
-
fontSize:
|
|
9
|
+
color: colors_1.LIGHT_TEXT,
|
|
10
|
+
fontSize: 13,
|
|
11
11
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
12
12
|
whiteSpace: 'nowrap',
|
|
13
13
|
};
|
|
@@ -59,7 +59,7 @@ const FpsCounter = ({ playbackSpeed }) => {
|
|
|
59
59
|
const expectedFps = Math.abs(playbackSpeed) * videoConfig.fps;
|
|
60
60
|
return {
|
|
61
61
|
...label,
|
|
62
|
-
color: fps < expectedFps * 0.9 ? colors_1.RED : colors_1.
|
|
62
|
+
color: fps < expectedFps * 0.9 ? colors_1.RED : colors_1.LIGHT_TEXT,
|
|
63
63
|
};
|
|
64
64
|
}, [fps, playbackSpeed, videoConfig]);
|
|
65
65
|
if (fps === 0) {
|
|
@@ -7,6 +7,7 @@ const remotion_1 = require("remotion");
|
|
|
7
7
|
const no_react_1 = require("remotion/no-react");
|
|
8
8
|
const colors_1 = require("../helpers/colors");
|
|
9
9
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
|
+
const fullscreen_1 = require("../icons/fullscreen");
|
|
10
11
|
const canvas_ref_1 = require("../state/canvas-ref");
|
|
11
12
|
const ControlButton_1 = require("./ControlButton");
|
|
12
13
|
const accessibilityLabel = [
|
|
@@ -44,6 +45,6 @@ const FullScreenToggle = () => {
|
|
|
44
45
|
f.unregister();
|
|
45
46
|
};
|
|
46
47
|
}, [keybindings, onClick]);
|
|
47
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx(
|
|
48
|
+
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx(fullscreen_1.FullscreenIcon, { color: colors_1.WHITE_HEX, style: { width: 18, height: 18 } }) }));
|
|
48
49
|
};
|
|
49
50
|
exports.FullScreenToggle = FullScreenToggle;
|
|
@@ -12,6 +12,7 @@ const editor_snapping_1 = require("../state/editor-snapping");
|
|
|
12
12
|
const modals_1 = require("../state/modals");
|
|
13
13
|
const AskAiModal_1 = require("./AskAiModal");
|
|
14
14
|
const CompositionSelector_1 = require("./CompositionSelector");
|
|
15
|
+
const ExplorerPanelRef_1 = require("./ExplorerPanelRef");
|
|
15
16
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
16
17
|
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
17
18
|
const sequencePropShortcuts = {
|
|
@@ -106,10 +107,15 @@ const GlobalKeybindings = () => {
|
|
|
106
107
|
event: 'keydown',
|
|
107
108
|
key: 'k',
|
|
108
109
|
callback: () => {
|
|
110
|
+
var _a;
|
|
109
111
|
setSelectedModal({
|
|
110
112
|
type: 'quick-switcher',
|
|
111
|
-
mode: '
|
|
113
|
+
mode: ((_a = ExplorerPanelRef_1.explorerSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.getSelectedPanel()) === 'assets'
|
|
114
|
+
? 'assets'
|
|
115
|
+
: 'compositions',
|
|
112
116
|
invocationTimestamp: Date.now(),
|
|
117
|
+
assetSelection: null,
|
|
118
|
+
compositionSelection: null,
|
|
113
119
|
});
|
|
114
120
|
},
|
|
115
121
|
triggerIfInputFieldFocused: true,
|
|
@@ -159,6 +165,8 @@ const GlobalKeybindings = () => {
|
|
|
159
165
|
type: 'quick-switcher',
|
|
160
166
|
mode: 'docs',
|
|
161
167
|
invocationTimestamp: Date.now(),
|
|
168
|
+
assetSelection: null,
|
|
169
|
+
compositionSelection: null,
|
|
162
170
|
});
|
|
163
171
|
},
|
|
164
172
|
commandCtrlKey: false,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
export declare const useSelectComposition: () => (c: import("remotion").AnyComposition, push: boolean, frame?: number | null) => void;
|
|
2
|
+
export declare const useSelectComposition: () => (c: Pick<import("remotion").AnyComposition, "folderName" | "id" | "parentFolderName">, push: boolean, frame?: number | null) => void;
|
|
3
3
|
export declare const InitialCompositionLoader: React.FC;
|
|
@@ -5,5 +5,6 @@ export type InlineActionProps = {
|
|
|
5
5
|
readonly disabled?: boolean;
|
|
6
6
|
readonly renderAction: RenderInlineAction;
|
|
7
7
|
readonly title?: string;
|
|
8
|
+
readonly unhoveredColor?: string;
|
|
8
9
|
};
|
|
9
|
-
export declare const InlineAction: ({ renderAction, onClick, disabled, title, }: InlineActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const InlineAction: ({ renderAction, onClick, disabled, title, unhoveredColor, }: InlineActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const z_index_1 = require("../state/z-index");
|
|
8
|
-
const InlineAction = ({ renderAction, onClick, disabled, title, }) => {
|
|
8
|
+
const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor = colors_1.LIGHT_TEXT, }) => {
|
|
9
9
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
10
10
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
11
11
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
@@ -27,9 +27,10 @@ const InlineAction = ({ renderAction, onClick, disabled, title, }) => {
|
|
|
27
27
|
justifyContent: 'center',
|
|
28
28
|
alignItems: 'center',
|
|
29
29
|
borderRadius: 3,
|
|
30
|
+
opacity: disabled ? 0.5 : 1,
|
|
30
31
|
pointerEvents: disabled ? 'none' : 'auto',
|
|
31
32
|
};
|
|
32
33
|
}, [disabled, hovered]);
|
|
33
|
-
return (jsx_runtime_1.jsx("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, children: renderAction(hovered ? colors_1.WHITE :
|
|
34
|
+
return (jsx_runtime_1.jsx("button", { type: "button", disabled: disabled, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, children: renderAction(hovered ? colors_1.WHITE : unhoveredColor) }));
|
|
34
35
|
};
|
|
35
36
|
exports.InlineAction = InlineAction;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Caption } from '@remotion/captions';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { SequenceControls, SequencePropsSubscriptionKey } from 'remotion';
|
|
4
|
+
import type { CodePosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
5
|
+
export declare const InlineCaptionInspector: React.FC<{
|
|
6
|
+
readonly captions: Caption[];
|
|
7
|
+
readonly controls: SequenceControls;
|
|
8
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
9
|
+
readonly readOnlyStudio: boolean;
|
|
10
|
+
readonly validatedLocation: CodePosition;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InlineCaptionInspector = 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 CaptionInspector_1 = require("./CaptionInspector");
|
|
9
|
+
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
10
|
+
const serializeCaptions = (captions) => {
|
|
11
|
+
return JSON.stringify(captions);
|
|
12
|
+
};
|
|
13
|
+
const getCaptionPatches = ({ previous, next, }) => {
|
|
14
|
+
if (previous.length !== next.length) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const patches = [];
|
|
18
|
+
for (const [index, before] of previous.entries()) {
|
|
19
|
+
const after = next[index];
|
|
20
|
+
if (!after) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (before.text !== after.text) {
|
|
24
|
+
patches.push({
|
|
25
|
+
index,
|
|
26
|
+
before,
|
|
27
|
+
changes: { text: after.text },
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return patches;
|
|
32
|
+
};
|
|
33
|
+
const InlineCaptionInspector = ({ captions, controls, nodePath, readOnlyStudio, validatedLocation }) => {
|
|
34
|
+
var _a;
|
|
35
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
36
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
37
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
38
|
+
const captionStatus = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a.captions;
|
|
39
|
+
const clientId = previewServerState.type === 'connected'
|
|
40
|
+
? previewServerState.clientId
|
|
41
|
+
: null;
|
|
42
|
+
const canSave = !readOnlyStudio && clientId !== null && (captionStatus === null || captionStatus === void 0 ? void 0 : captionStatus.status) === 'static';
|
|
43
|
+
const [draftCaptions, setDraftCaptions] = (0, react_1.useState)(captions);
|
|
44
|
+
const savedCaptions = (0, react_1.useRef)(captions);
|
|
45
|
+
const runtimeSignature = serializeCaptions(captions);
|
|
46
|
+
const lastRuntimeSignature = (0, react_1.useRef)(runtimeSignature);
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
if (lastRuntimeSignature.current === runtimeSignature) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
lastRuntimeSignature.current = runtimeSignature;
|
|
52
|
+
savedCaptions.current = captions;
|
|
53
|
+
setDraftCaptions(captions);
|
|
54
|
+
clearDragOverrides(nodePath);
|
|
55
|
+
}, [captions, clearDragOverrides, nodePath, runtimeSignature]);
|
|
56
|
+
const updateCaptions = (0, react_1.useCallback)((nextCaptions) => {
|
|
57
|
+
setDraftCaptions(nextCaptions);
|
|
58
|
+
setDragOverrides(nodePath, 'captions', remotion_1.Internals.makeStaticDragOverride(nextCaptions));
|
|
59
|
+
}, [nodePath, setDragOverrides]);
|
|
60
|
+
const cancelCaptions = (0, react_1.useCallback)(() => {
|
|
61
|
+
setDraftCaptions(savedCaptions.current);
|
|
62
|
+
clearDragOverrides(nodePath);
|
|
63
|
+
}, [clearDragOverrides, nodePath]);
|
|
64
|
+
const saveCaptions = (0, react_1.useCallback)((nextCaptions) => {
|
|
65
|
+
const patches = getCaptionPatches({
|
|
66
|
+
previous: savedCaptions.current,
|
|
67
|
+
next: nextCaptions,
|
|
68
|
+
});
|
|
69
|
+
setDraftCaptions(nextCaptions);
|
|
70
|
+
if (!canSave ||
|
|
71
|
+
clientId === null ||
|
|
72
|
+
patches === null ||
|
|
73
|
+
patches.length === 0) {
|
|
74
|
+
clearDragOverrides(nodePath);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
savedCaptions.current = nextCaptions;
|
|
78
|
+
(0, save_sequence_prop_1.saveInlineCaptionPatches)({
|
|
79
|
+
fileName: validatedLocation.source,
|
|
80
|
+
nodePath,
|
|
81
|
+
schema: controls.schema,
|
|
82
|
+
patches,
|
|
83
|
+
nextCaptions,
|
|
84
|
+
setPropStatuses,
|
|
85
|
+
clientId,
|
|
86
|
+
undoLabel: 'Update captions',
|
|
87
|
+
redoLabel: 'Update captions again',
|
|
88
|
+
});
|
|
89
|
+
clearDragOverrides(nodePath);
|
|
90
|
+
}, [
|
|
91
|
+
canSave,
|
|
92
|
+
clearDragOverrides,
|
|
93
|
+
clientId,
|
|
94
|
+
controls.schema,
|
|
95
|
+
nodePath,
|
|
96
|
+
setPropStatuses,
|
|
97
|
+
validatedLocation.source,
|
|
98
|
+
]);
|
|
99
|
+
const readOnlyTitle = readOnlyStudio
|
|
100
|
+
? 'Caption editing is unavailable in read-only Studio'
|
|
101
|
+
: clientId === null
|
|
102
|
+
? 'Caption editing requires a Studio server connection'
|
|
103
|
+
: (captionStatus === null || captionStatus === void 0 ? void 0 : captionStatus.status) === 'computed'
|
|
104
|
+
? 'Captions must be a direct inline JSX array to edit them'
|
|
105
|
+
: 'Captions are not ready for editing';
|
|
106
|
+
return (jsx_runtime_1.jsx(CaptionInspector_1.CaptionInspector, { captions: draftCaptions, onTextChange: updateCaptions, onTextSave: saveCaptions, onTextCancel: cancelCaptions, readOnly: !canSave, readOnlyTitle: canSave ? null : readOnlyTitle }));
|
|
107
|
+
};
|
|
108
|
+
exports.InlineCaptionInspector = InlineCaptionInspector;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InlineActionProps } from './InlineAction';
|
|
2
2
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
3
|
-
export declare const InlineDropdown: ({ values, ...props }: Omit<InlineActionProps, "onClick"> & {
|
|
3
|
+
export declare const InlineDropdown: ({ values, unhoveredColor, ...props }: Omit<InlineActionProps, "onClick"> & {
|
|
4
4
|
readonly values: ComboboxValue[];
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const player_1 = require("@remotion/player");
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
|
+
const colors_1 = require("../helpers/colors");
|
|
11
12
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
12
13
|
const noop_1 = require("../helpers/noop");
|
|
13
14
|
const z_index_1 = require("../state/z-index");
|
|
@@ -15,7 +16,7 @@ const InlineAction_1 = require("./InlineAction");
|
|
|
15
16
|
const portals_1 = require("./Menu/portals");
|
|
16
17
|
const styles_1 = require("./Menu/styles");
|
|
17
18
|
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
18
|
-
const InlineDropdown = ({ values, ...props }) => {
|
|
19
|
+
const InlineDropdown = ({ values, unhoveredColor, ...props }) => {
|
|
19
20
|
const ref = (0, react_1.useRef)(null);
|
|
20
21
|
const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
|
|
21
22
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
@@ -79,7 +80,7 @@ const InlineDropdown = ({ values, ...props }) => {
|
|
|
79
80
|
setOpened({ type: 'not-open' });
|
|
80
81
|
}, []);
|
|
81
82
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
82
|
-
jsx_runtime_1.jsx("div", { ref: ref, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, ...props }) }), portalStyle
|
|
83
|
+
jsx_runtime_1.jsx("div", { ref: ref, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, unhoveredColor: opened.type === 'open' ? colors_1.WHITE : unhoveredColor, ...props }) }), portalStyle
|
|
83
84
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
84
85
|
: null] }));
|
|
85
86
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
export declare const AlignmentControls: React.FC<{
|
|
4
|
-
readonly track:
|
|
4
|
+
readonly track: TimelineTrackData;
|
|
5
5
|
}>;
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
8
9
|
const align_bottom_1 = require("../../icons/align-bottom");
|
|
9
10
|
const align_center_horizontal_1 = require("../../icons/align-center-horizontal");
|
|
10
11
|
const align_center_vertical_1 = require("../../icons/align-center-vertical");
|
|
@@ -62,7 +63,8 @@ const AlignmentControls = ({ track }) => {
|
|
|
62
63
|
const handleAlign = (0, react_1.useCallback)((direction) => {
|
|
63
64
|
var _a;
|
|
64
65
|
var _b, _c, _d, _e;
|
|
65
|
-
if (
|
|
66
|
+
if (!(0, interactivity_enabled_1.isStudioInteractivityEnabled)() ||
|
|
67
|
+
previewServerState.type !== 'connected' ||
|
|
66
68
|
!track.nodePathInfo ||
|
|
67
69
|
!track.sequence.controls) {
|
|
68
70
|
return;
|
|
@@ -177,7 +179,8 @@ const AlignmentControls = ({ track }) => {
|
|
|
177
179
|
getDragOverrides,
|
|
178
180
|
setPropStatuses,
|
|
179
181
|
]);
|
|
180
|
-
if (
|
|
182
|
+
if (!(0, interactivity_enabled_1.isStudioInteractivityEnabled)() ||
|
|
183
|
+
previewServerState.type !== 'connected' ||
|
|
181
184
|
!track.nodePathInfo ||
|
|
182
185
|
!track.sequence.controls ||
|
|
183
186
|
!currentCompositionMetadata) {
|