@remotion/studio 4.0.521 → 4.0.523
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/install-package.js +4 -2
- package/dist/components/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +5 -6
- package/dist/components/CanvasIfSizeIsAvailable.js +7 -0
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +8 -6
- package/dist/components/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/CompositionContextButton.js +4 -1
- package/dist/components/CompositionSelectorItem.js +2 -2
- package/dist/components/ConfigureLicenseModal.js +1 -1
- package/dist/components/CopyButton.js +7 -14
- package/dist/components/CurrentAsset.js +40 -6
- package/dist/components/Editor.js +6 -5
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/ElementInstallConfirmation.js +290 -136
- package/dist/components/FixComputedValueModal.js +56 -16
- package/dist/components/FullscreenToggle.js +9 -8
- package/dist/components/GlobalKeybindings.js +50 -49
- package/dist/components/HighlightedElementSource.d.ts +5 -0
- package/dist/components/HighlightedElementSource.js +78 -0
- package/dist/components/InspectorLocationCopy.js +10 -5
- package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
- package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
- package/dist/components/InspectorPanel.js +4 -0
- package/dist/components/InspectorSequenceSection.js +64 -1
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- package/dist/components/MenuBuildIndicator.js +7 -2
- package/dist/components/MenuCompositionName.js +62 -6
- package/dist/components/MenuToolbar.js +7 -5
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +3 -1
- package/dist/components/ModelManager.d.ts +16 -0
- package/dist/components/ModelManager.js +200 -0
- package/dist/components/ModelsSettings.d.ts +2 -0
- package/dist/components/ModelsSettings.js +133 -0
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +2 -2
- package/dist/components/NewComposition/InputDragger.js +6 -6
- package/dist/components/NewComposition/NewFolder.js +11 -8
- package/dist/components/NewComposition/RenameFolder.js +17 -10
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/PlayPause.js +4 -8
- package/dist/components/PlaybackKeyboardShortcutsManager.js +3 -6
- package/dist/components/PreviewToolbarOverflowButton.js +11 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
- package/dist/components/RadioButton.d.ts +1 -0
- package/dist/components/RadioButton.js +2 -2
- package/dist/components/RenderButton.js +5 -1
- package/dist/components/RenderModal/CliCopyButton.js +13 -27
- package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
- package/dist/components/RenderModal/NumberSetting.js +2 -2
- package/dist/components/RenderModal/RenderModalBasic.js +1 -1
- package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
- package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
- package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
- package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/CaptionQueueItem.js +129 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +7 -4
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +129 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
- package/dist/components/RenderQueue/caption-job-types.js +7 -0
- package/dist/components/RenderQueue/context.d.ts +16 -0
- package/dist/components/RenderQueue/context.js +224 -11
- package/dist/components/RenderQueue/index.js +34 -10
- package/dist/components/RenderQueue/item-style.d.ts +1 -0
- package/dist/components/RenderQueue/item-style.js +2 -1
- package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
- package/dist/components/RenderQueue/load-model-for-job.js +14 -0
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
- package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
- package/dist/components/RendersTab.js +4 -4
- package/dist/components/SegmentedControl.d.ts +2 -2
- package/dist/components/SegmentedControl.js +38 -13
- package/dist/components/SelectedOutlinePolygon.js +8 -2
- package/dist/components/SettingsButton.d.ts +4 -0
- package/dist/components/SettingsButton.js +49 -0
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +3 -1
- package/dist/components/ShowOutlinesProvider.js +12 -0
- package/dist/components/SidebarCollapserControls.js +21 -16
- package/dist/components/SizeSelector.js +10 -2
- package/dist/components/SkillsSettings.js +11 -8
- package/dist/components/SnappingToggle.js +5 -2
- package/dist/components/Splitter/SplitterContainer.js +63 -10
- package/dist/components/Splitter/SplitterContext.d.ts +3 -0
- package/dist/components/Splitter/SplitterContext.js +5 -1
- package/dist/components/Splitter/SplitterElement.js +11 -2
- package/dist/components/Splitter/SplitterHandle.d.ts +1 -0
- package/dist/components/Splitter/SplitterHandle.js +55 -25
- package/dist/components/Tabs/vertical.d.ts +1 -0
- package/dist/components/Tabs/vertical.js +2 -2
- package/dist/components/TimeValue.js +2 -3
- package/dist/components/Timeline/SequencePropsObserver.js +4 -0
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +2 -1
- package/dist/components/Timeline/Timeline.js +17 -46
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
- package/dist/components/Timeline/TimelineDragHandler.js +11 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelinePinchZoom.js +6 -30
- package/dist/components/Timeline/TimelinePlayCursorSyncer.js +1 -7
- package/dist/components/Timeline/TimelineRowChrome.js +11 -3
- package/dist/components/Timeline/TimelineSchemaField.js +8 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
- package/dist/components/Timeline/TimelineSelection.js +55 -2
- package/dist/components/Timeline/TimelineSequence.js +148 -25
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +220 -112
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +35 -5
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +233 -138
- package/dist/components/Timeline/TimelineSlider.js +1 -4
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
- package/dist/components/Timeline/TimelineWidthProvider.js +2 -5
- package/dist/components/Timeline/TimelineZoomControls.js +20 -20
- package/dist/components/Timeline/get-sequence-split-menu-item.d.ts +11 -0
- package/dist/components/Timeline/get-sequence-split-menu-item.js +55 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -2
- package/dist/components/Timeline/use-sequence-props-subscription.js +4 -10
- package/dist/components/TimelineInOutToggle.js +20 -17
- package/dist/components/TopPanel.js +3 -19
- package/dist/components/Transcription/LazyModels.d.ts +1 -0
- package/dist/components/Transcription/LazyModels.js +5 -0
- package/dist/components/Transcription/Models.d.ts +6 -0
- package/dist/components/Transcription/Models.js +18 -0
- package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
- package/dist/components/Transcription/TranscriptionModal.js +428 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
- package/dist/components/Transcription/caption-output-name.d.ts +2 -0
- package/dist/components/Transcription/caption-output-name.js +10 -0
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
- package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
- package/dist/components/Transcription/whisper-languages.d.ts +2 -0
- package/dist/components/Transcription/whisper-languages.js +104 -0
- package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
- package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
- package/dist/components/UndoRedoButtons.js +13 -38
- package/dist/components/UpdatesSettings.js +17 -17
- package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
- package/dist/components/VideoMatting/LazyModels.js +5 -0
- package/dist/components/VideoMatting/Models.d.ts +6 -0
- package/dist/components/VideoMatting/Models.js +18 -0
- package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
- package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
- package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
- package/dist/components/VideoMatting/video-matting-capability.js +7 -0
- package/dist/components/WebMcp.js +439 -22
- package/dist/components/ZoomPersistor.js +6 -3
- package/dist/components/composition-menu-items.js +1 -1
- package/dist/components/import-assets.d.ts +3 -2
- package/dist/components/import-assets.js +5 -9
- package/dist/components/keyboard-shortcuts.d.ts +17 -1
- package/dist/components/keyboard-shortcuts.js +177 -89
- package/dist/components/public-output-name.d.ts +5 -0
- package/dist/components/public-output-name.js +60 -0
- package/dist/components/use-model-cache-status.d.ts +7 -0
- package/dist/components/use-model-cache-status.js +35 -0
- package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/HighlightedElementSource-jfc66k4p.mjs +1236 -0
- package/dist/esm/LazyModels-2trdm224.mjs +11 -0
- package/dist/esm/LazyModels-fjb5ckaq.mjs +11 -0
- package/dist/esm/TranscriptionModal-916jqhry.mjs +1011 -0
- package/dist/esm/VideoMattingModal-2tm79s9b.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1x7bsdh6.mjs +261 -0
- package/dist/esm/index-3hgr6gjx.mjs +41 -0
- package/dist/esm/index-5qddp5h7.mjs +36 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-6cvm9a65.mjs +45923 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-czwvnn9g.mjs +35 -0
- package/dist/esm/index-hy4xcgty.mjs +1366 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-jg13hf2g.mjs} +3 -1
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-sgtmgc4h.mjs +423 -0
- package/dist/esm/index-te66vvrp.mjs +142 -0
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-x7t2y7ws.mjs +54194 -0
- package/dist/esm/index-xhe2m2qr.mjs +1146 -0
- package/dist/esm/index.mjs +45 -933
- package/dist/esm/internals.mjs +13 -114127
- package/dist/esm/previewEntry.mjs +387 -114784
- package/dist/esm/renderEntry.mjs +3 -3
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
- package/dist/helpers/copy-text.js +1 -2
- package/dist/helpers/drag-aware-double-click.d.ts +2 -1
- package/dist/helpers/drag-aware-double-click.js +12 -1
- package/dist/helpers/get-asset-metadata.d.ts +1 -0
- package/dist/helpers/get-asset-metadata.js +4 -0
- package/dist/helpers/hoverable.js +8 -0
- package/dist/helpers/inject-css.js +2 -0
- package/dist/helpers/optional-package-dependencies.d.ts +3 -0
- package/dist/helpers/optional-package-dependencies.js +24 -0
- package/dist/helpers/pointer-session.d.ts +6 -0
- package/dist/helpers/pointer-session.js +36 -14
- package/dist/helpers/prism-tomorrow.d.ts +1 -0
- package/dist/helpers/prism-tomorrow.js +151 -0
- package/dist/helpers/sequence-node-path-mutations.js +11 -0
- package/dist/helpers/slugify-name.d.ts +1 -0
- package/dist/helpers/slugify-name.js +14 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -0
- package/dist/helpers/studio-runtime-config.js +6 -1
- package/dist/helpers/use-copy-feedback.d.ts +4 -0
- package/dist/helpers/use-copy-feedback.js +19 -0
- package/dist/helpers/use-keybinding.d.ts +9 -3
- package/dist/helpers/use-keybinding.js +8 -9
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
- package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
- package/dist/helpers/use-menu-structure.js +58 -13
- package/dist/icons/copy.d.ts +5 -0
- package/dist/icons/copy.js +12 -0
- package/dist/icons/input-props.d.ts +1 -1
- package/dist/icons/input-props.js +2 -2
- package/dist/icons/models.d.ts +4 -0
- package/dist/icons/models.js +7 -0
- package/dist/icons/separation.d.ts +4 -0
- package/dist/icons/separation.js +7 -0
- package/dist/icons/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/state/canvas-ref.d.ts +1 -0
- package/dist/state/canvas-ref.js +2 -1
- package/dist/state/modals.d.ts +14 -2
- package/dist/state/sidebar.d.ts +3 -0
- package/dist/state/sidebar.js +6 -1
- package/dist/state/timeline-zoom.d.ts +1 -1
- package/dist/state/timeline-zoom.js +3 -3
- package/dist/visual-controls/VisualControls.js +4 -0
- package/package.json +34 -20
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-emw4k5b0.js +0 -99527
- package/dist/esm/chunk-vkrvnx2h.js +0 -99378
- package/dist/helpers/use-max-media-duration.d.ts +0 -2
- package/dist/helpers/use-max-media-duration.js +0 -61
|
@@ -25,9 +25,9 @@ const badge = {
|
|
|
25
25
|
alignItems: 'center',
|
|
26
26
|
};
|
|
27
27
|
const RendersTab = ({ selected, onClick }) => {
|
|
28
|
-
const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
29
|
-
const failedJobs = jobs.filter((
|
|
30
|
-
const jobCount = jobs.length;
|
|
28
|
+
const { jobs, captionJobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
29
|
+
const failedJobs = [...jobs, ...captionJobs].filter((job) => job.status === 'failed').length;
|
|
30
|
+
const jobCount = jobs.length + captionJobs.length;
|
|
31
31
|
const badgeStyle = (0, react_1.useMemo)(() => {
|
|
32
32
|
return {
|
|
33
33
|
...badge,
|
|
@@ -38,7 +38,7 @@ const RendersTab = ({ selected, onClick }) => {
|
|
|
38
38
|
borderColor: colors_1.LIGHT_TEXT,
|
|
39
39
|
};
|
|
40
40
|
}, [failedJobs]);
|
|
41
|
-
return (jsx_runtime_1.jsx(Tabs_1.Tab, { selected: selected, onClick: onClick, children: jsx_runtime_1.jsxs("div", { style: row, children: ["
|
|
41
|
+
return (jsx_runtime_1.jsx(Tabs_1.Tab, { selected: selected, onClick: onClick, children: jsx_runtime_1.jsxs("div", { style: row, children: ["Jobs", jobCount > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
42
42
|
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx("div", { style: badgeStyle, children: jobCount })
|
|
43
43
|
] })) : null] }) }));
|
|
44
44
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type SegmentedControlItem = {
|
|
3
3
|
label: React.ReactNode;
|
|
4
|
-
onClick: () => void;
|
|
4
|
+
onClick: (() => void) | null;
|
|
5
5
|
key: string;
|
|
6
6
|
selected: boolean;
|
|
7
7
|
};
|
|
8
|
-
type SegmentedControlSize = 'default' | 'compact';
|
|
8
|
+
type SegmentedControlSize = 'default' | 'medium' | 'compact';
|
|
9
9
|
export declare const SegmentedControl: React.FC<{
|
|
10
10
|
readonly items: SegmentedControlItem[];
|
|
11
11
|
readonly needsWrapping: boolean;
|
|
@@ -4,6 +4,7 @@ exports.SegmentedControl = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const hoverable_1 = require("../helpers/hoverable");
|
|
7
8
|
const z_index_1 = require("../state/z-index");
|
|
8
9
|
const container = {
|
|
9
10
|
display: 'flex',
|
|
@@ -19,6 +20,7 @@ const item = {
|
|
|
19
20
|
fontSize: 15,
|
|
20
21
|
padding: '4px 12px',
|
|
21
22
|
appearance: 'none',
|
|
23
|
+
cursor: 'default',
|
|
22
24
|
border: 'none',
|
|
23
25
|
flex: 1,
|
|
24
26
|
justifyContent: 'center',
|
|
@@ -30,6 +32,12 @@ const compactItem = {
|
|
|
30
32
|
fontWeight: 400,
|
|
31
33
|
padding: '2px 7px',
|
|
32
34
|
};
|
|
35
|
+
const mediumItem = {
|
|
36
|
+
...item,
|
|
37
|
+
fontSize: 13,
|
|
38
|
+
fontWeight: 400,
|
|
39
|
+
padding: '3px 10px',
|
|
40
|
+
};
|
|
33
41
|
const SegmentedControl = ({ items, needsWrapping, size = 'default' }) => {
|
|
34
42
|
const controlStyle = (0, react_1.useMemo)(() => {
|
|
35
43
|
if (needsWrapping) {
|
|
@@ -45,26 +53,43 @@ const SegmentedControl = ({ items, needsWrapping, size = 'default' }) => {
|
|
|
45
53
|
...container,
|
|
46
54
|
};
|
|
47
55
|
}, [needsWrapping]);
|
|
48
|
-
|
|
56
|
+
const onKeyDown = (0, react_1.useCallback)((event) => {
|
|
57
|
+
if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const buttons = Array.from(event.currentTarget.querySelectorAll('button:not(:disabled)'));
|
|
61
|
+
const index = buttons.indexOf(event.target);
|
|
62
|
+
if (index === -1) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
const direction = event.key === 'ArrowLeft' || event.key === 'ArrowUp' ? -1 : 1;
|
|
67
|
+
const next = buttons[(index + direction + buttons.length) % buttons.length];
|
|
68
|
+
next.click();
|
|
69
|
+
requestAnimationFrame(() => next.focus());
|
|
70
|
+
}, []);
|
|
71
|
+
return (jsx_runtime_1.jsx("div", { style: controlStyle, onKeyDown: onKeyDown, children: items.map((i) => {
|
|
49
72
|
return (jsx_runtime_1.jsx(Item, { onClick: i.onClick, selected: i.selected, size: size, children: i.label }, i.key));
|
|
50
73
|
}) }));
|
|
51
74
|
};
|
|
52
75
|
exports.SegmentedControl = SegmentedControl;
|
|
53
76
|
const Item = ({ selected, onClick, children, size }) => {
|
|
54
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
55
77
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
56
|
-
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
57
|
-
setHovered(true);
|
|
58
|
-
}, []);
|
|
59
|
-
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
60
|
-
setHovered(false);
|
|
61
|
-
}, []);
|
|
62
78
|
const itemStyle = (0, react_1.useMemo)(() => {
|
|
63
79
|
return {
|
|
64
|
-
...(size === 'compact'
|
|
65
|
-
|
|
66
|
-
|
|
80
|
+
...(size === 'compact'
|
|
81
|
+
? compactItem
|
|
82
|
+
: size === 'medium'
|
|
83
|
+
? mediumItem
|
|
84
|
+
: item),
|
|
85
|
+
opacity: onClick === null ? 0.5 : 1,
|
|
86
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
87
|
+
idleBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
|
|
88
|
+
hoverBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
|
|
89
|
+
idleColor: selected ? colors_1.WHITE : colors_1.LIGHT_TEXT,
|
|
90
|
+
hoverColor: onClick === null ? colors_1.LIGHT_TEXT : colors_1.WHITE,
|
|
91
|
+
}),
|
|
67
92
|
};
|
|
68
|
-
}, [
|
|
69
|
-
return (jsx_runtime_1.jsx("button", { type: "button",
|
|
93
|
+
}, [onClick, selected, size]);
|
|
94
|
+
return (jsx_runtime_1.jsx("button", { type: "button", "aria-pressed": selected, disabled: onClick === null, className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: itemStyle, tabIndex: tabIndex, onClick: onClick !== null && onClick !== void 0 ? onClick : undefined, children: children }));
|
|
70
95
|
};
|
|
@@ -345,7 +345,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
345
345
|
setDragOverrides,
|
|
346
346
|
translateWithCommandKey,
|
|
347
347
|
]);
|
|
348
|
-
const
|
|
348
|
+
const performDoubleClick = react_1.default.useCallback((event) => {
|
|
349
349
|
const target = getTarget();
|
|
350
350
|
if (target === undefined) {
|
|
351
351
|
return;
|
|
@@ -356,6 +356,12 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
356
356
|
event.preventDefault();
|
|
357
357
|
event.stopPropagation();
|
|
358
358
|
}, [dragAwareDoubleClick, getTarget, onDoubleClickTarget]);
|
|
359
|
+
const onClick = react_1.default.useCallback((event) => {
|
|
360
|
+
if (!dragAwareDoubleClick.acceptClickAsDoubleClick(event)) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
performDoubleClick(event);
|
|
364
|
+
}, [dragAwareDoubleClick, performDoubleClick]);
|
|
359
365
|
const onEffectDragOver = react_1.default.useCallback((event) => {
|
|
360
366
|
if (!(0, effect_drag_and_drop_1.hasEffectDragType)(event.dataTransfer)) {
|
|
361
367
|
return;
|
|
@@ -411,6 +417,6 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
411
417
|
if (!dragging) {
|
|
412
418
|
onHoverChange(null);
|
|
413
419
|
}
|
|
414
|
-
}, onPointerDown: onPointerDown, onPointerDownCapture: dragAwareDoubleClick.beginPointerGesture,
|
|
420
|
+
}, onPointerDown: onPointerDown, onPointerDownCapture: dragAwareDoubleClick.beginPointerGesture, onClick: onClick, onDragOver: onEffectDragOver, onDragLeave: onEffectDragLeave, onDrop: onEffectDrop }));
|
|
415
421
|
};
|
|
416
422
|
exports.SelectedOutlinePolygon = react_1.default.memo(SelectedOutlinePolygonUnmemoized);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SettingsButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
7
|
+
const colors_1 = require("../helpers/colors");
|
|
8
|
+
const gear_1 = require("../icons/gear");
|
|
9
|
+
const modals_1 = require("../state/modals");
|
|
10
|
+
const InlineAction_1 = require("./InlineAction");
|
|
11
|
+
const UpdateStatusContext_1 = require("./UpdateStatusContext");
|
|
12
|
+
const SettingsButton = ({ showUpdates }) => {
|
|
13
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
14
|
+
const { info, knownBugs } = (0, UpdateStatusContext_1.useUpdateStatus)();
|
|
15
|
+
const updateAvailable = showUpdates &&
|
|
16
|
+
Boolean((info === null || info === void 0 ? void 0 : info.updateAvailable) || (info === null || info === void 0 ? void 0 : info.skillsUpdateAvailable));
|
|
17
|
+
const hasBugfixesAvailable = showUpdates &&
|
|
18
|
+
Boolean((info === null || info === void 0 ? void 0 : info.updateAvailable) && knownBugs && knownBugs.length > 0);
|
|
19
|
+
const openModal = (0, react_1.useCallback)(() => {
|
|
20
|
+
var _a;
|
|
21
|
+
var _b;
|
|
22
|
+
setSelectedModal({
|
|
23
|
+
type: 'settings',
|
|
24
|
+
initialTab: updateAvailable
|
|
25
|
+
? 'updates'
|
|
26
|
+
: (0, browser_studio_operations_1.getBrowserStudioOperations)() === null
|
|
27
|
+
? 'rendering'
|
|
28
|
+
: 'shortcuts',
|
|
29
|
+
initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
|
|
30
|
+
});
|
|
31
|
+
}, [setSelectedModal, updateAvailable]);
|
|
32
|
+
const renderGearIcon = (0, react_1.useCallback)((color) => {
|
|
33
|
+
return jsx_runtime_1.jsx(gear_1.GearIcon, { color: color, width: 16, height: 16 });
|
|
34
|
+
}, []);
|
|
35
|
+
const renderUpdateIcon = (0, react_1.useCallback)((color) => {
|
|
36
|
+
return (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", style: {
|
|
37
|
+
height: 16,
|
|
38
|
+
width: 16,
|
|
39
|
+
color,
|
|
40
|
+
flexShrink: 0,
|
|
41
|
+
}, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: color, d: "M256 32a224 224 0 1 1 0 448 224 224 0 1 1 0-448zm0 480a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM377 231L273 127c-9.4-9.4-24.6-9.4-33.9 0L135 231c-6.9 6.9-8.9 17.2-5.2 26.2S142.3 272 152 272l40 0 0 72c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-72 40 0c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2z" }) }));
|
|
42
|
+
}, []);
|
|
43
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: openModal, renderAction: updateAvailable ? renderUpdateIcon : renderGearIcon, unhoveredColor: hasBugfixesAvailable ? colors_1.WARNING_COLOR : colors_1.WHITE_ALPHA_80, title: hasBugfixesAvailable
|
|
44
|
+
? 'Bugfixes available'
|
|
45
|
+
: updateAvailable
|
|
46
|
+
? 'Update available'
|
|
47
|
+
: 'Settings' }));
|
|
48
|
+
};
|
|
49
|
+
exports.SettingsButton = SettingsButton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type SettingsTab = 'apps' | 'rendering' | 'studio' | 'packages' | 'shortcuts' | 'skills' | 'license' | 'updates';
|
|
2
|
+
type SettingsTab = 'apps' | 'rendering' | 'studio' | 'packages' | 'models' | 'shortcuts' | 'skills' | 'license' | 'updates';
|
|
3
3
|
export declare const SettingsModal: React.FC<{
|
|
4
4
|
readonly initialTab: SettingsTab;
|
|
5
5
|
readonly initialPublicLicenseKey: string | null;
|
|
@@ -10,6 +10,7 @@ const apps_1 = require("../icons/apps");
|
|
|
10
10
|
const cloud_download_1 = require("../icons/cloud-download");
|
|
11
11
|
const keyboard_1 = require("../icons/keyboard");
|
|
12
12
|
const license_1 = require("../icons/license");
|
|
13
|
+
const models_1 = require("../icons/models");
|
|
13
14
|
const package_1 = require("../icons/package");
|
|
14
15
|
const remotion_triangle_1 = require("../icons/remotion-triangle");
|
|
15
16
|
const skills_1 = require("../icons/skills");
|
|
@@ -21,6 +22,7 @@ const InstallPackage_1 = require("./InstallPackage");
|
|
|
21
22
|
const KeyboardShortcutsSettings_1 = require("./KeyboardShortcutsSettings");
|
|
22
23
|
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
23
24
|
const ModalHeader_1 = require("./ModalHeader");
|
|
25
|
+
const ModelsSettings_1 = require("./ModelsSettings");
|
|
24
26
|
const DismissableModal_1 = require("./NewComposition/DismissableModal");
|
|
25
27
|
const RenderingSettings_1 = require("./RenderingSettings");
|
|
26
28
|
const render_modals_1 = require("./RenderModal/render-modals");
|
|
@@ -102,6 +104,6 @@ const SettingsModal = ({ initialPublicLicenseKey, initialTab }) => {
|
|
|
102
104
|
}, [initialPublicLicenseKey, setPublicLicenseKey]);
|
|
103
105
|
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { panelStyle: render_modals_1.outerModalStyle, children: jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
104
106
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Settings", onClose: dismiss }), jsx_runtime_1.jsxs("div", { style: render_modals_1.horizontalLayout, children: [
|
|
105
|
-
jsx_runtime_1.jsxs("div", { style: settingsLeftSidebar, children: [isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'rendering', onClick: () => selectTab('rendering'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: render_modals_1.icon }) })), children: "Defaults" })), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'studio', onClick: () => selectTab('studio'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(remotion_triangle_1.RemotionTriangleIcon, { color: color, style: render_modals_1.icon }) })), children: "Studio" })), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'shortcuts', onClick: () => selectTab('shortcuts'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(keyboard_1.KeyboardIcon, { color: color, style: keyboardIcon }) })), children: "Shortcuts" }), showPackages ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'packages', onClick: () => selectTab('packages'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(package_1.PackageIcon, { color: color, style: render_modals_1.icon }) })), children: "Packages" })) : null, isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'skills', onClick: () => selectTab('skills'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(skills_1.SkillsIcon, { color: color, style: skillsIcon }) })), children: "Skills" })), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'apps', onClick: () => selectTab('apps'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(apps_1.AppsIcon, { color: color, style: appsIcon }) })), children: "Apps" })), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'license', onClick: () => selectTab('license'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(license_1.LicenseIcon, { color: color, style: render_modals_1.icon }) })), children: "License" })), showUpdates ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'updates', onClick: () => selectTab('updates'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(cloud_download_1.CloudDownloadIcon, { color: color, style: render_modals_1.icon }) })), children: "Updates" })) : null] }), openedTabs.includes('packages') ? (jsx_runtime_1.jsx("div", { style: tab === 'packages' ? render_modals_1.optionsPanel : hiddenPanel, children: jsx_runtime_1.jsx(InstallPackage_1.InstallPackageSettings, { footerContainer: packagesFooterContainer, packageManager: packageManager }) })) : null, openedTabs.includes('apps') ? (jsx_runtime_1.jsx("div", { style: tab === 'apps' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ConfigureDefaultEditorModal_1.DefaultEditorSettings, {}) })) : null, openedTabs.includes('license') ? (jsx_runtime_1.jsx("div", { style: tab === 'license' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ConfigureLicenseModal_1.LicenseSettings, {}) })) : null, openedTabs.includes('skills') ? (jsx_runtime_1.jsx("div", { style: tab === 'skills' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(SkillsSettings_1.SkillsSettings, {}) })) : null, openedTabs.includes('shortcuts') ? (jsx_runtime_1.jsx("div", { style: tab === 'shortcuts' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(KeyboardShortcutsSettings_1.KeyboardShortcutsSettings, {}) })) : null, openedTabs.includes('rendering') ? (jsx_runtime_1.jsx("div", { style: tab === 'rendering' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(RenderingSettings_1.RenderingSettings, {}) })) : null, openedTabs.includes('studio') ? (jsx_runtime_1.jsx("div", { style: tab === 'studio' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(StudioSettings_1.StudioSettings, {}) })) : null, showUpdates && openedTabs.includes('updates') ? (jsx_runtime_1.jsx("div", { style: tab === 'updates' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(UpdatesSettings_1.UpdatesSettings, {}) })) : null] }), tab === 'packages' ? (jsx_runtime_1.jsx("div", { ref: setPackagesFooterContainer })) : isBrowserStudio || tab === 'updates' ? null : (jsx_runtime_1.jsx(SettingsModalFooter_1.SettingsModalFooter, { showLicenseFaq: tab === 'license' }))] }) }));
|
|
107
|
+
jsx_runtime_1.jsxs("div", { style: settingsLeftSidebar, children: [isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'rendering', onClick: () => selectTab('rendering'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: render_modals_1.icon }) })), children: "Defaults" })), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'studio', onClick: () => selectTab('studio'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(remotion_triangle_1.RemotionTriangleIcon, { color: color, style: render_modals_1.icon }) })), children: "Studio" })), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'shortcuts', onClick: () => selectTab('shortcuts'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(keyboard_1.KeyboardIcon, { color: color, style: keyboardIcon }) })), children: "Shortcuts" }), showPackages ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'packages', onClick: () => selectTab('packages'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(package_1.PackageIcon, { color: color, style: render_modals_1.icon }) })), children: "Packages" })) : null, isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'skills', onClick: () => selectTab('skills'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(skills_1.SkillsIcon, { color: color, style: skillsIcon }) })), children: "Skills" })), jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'models', onClick: () => selectTab('models'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(models_1.ModelsIcon, { color: color, style: render_modals_1.icon }) })), children: "Models" }), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'apps', onClick: () => selectTab('apps'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(apps_1.AppsIcon, { color: color, style: appsIcon }) })), children: "Apps" })), isBrowserStudio ? null : (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'license', onClick: () => selectTab('license'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(license_1.LicenseIcon, { color: color, style: render_modals_1.icon }) })), children: "License" })), showUpdates ? (jsx_runtime_1.jsx(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'updates', onClick: () => selectTab('updates'), renderIcon: (color) => (jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(cloud_download_1.CloudDownloadIcon, { color: color, style: render_modals_1.icon }) })), children: "Updates" })) : null] }), openedTabs.includes('packages') ? (jsx_runtime_1.jsx("div", { style: tab === 'packages' ? render_modals_1.optionsPanel : hiddenPanel, children: jsx_runtime_1.jsx(InstallPackage_1.InstallPackageSettings, { footerContainer: packagesFooterContainer, packageManager: packageManager }) })) : null, openedTabs.includes('apps') ? (jsx_runtime_1.jsx("div", { style: tab === 'apps' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ConfigureDefaultEditorModal_1.DefaultEditorSettings, {}) })) : null, openedTabs.includes('models') ? (jsx_runtime_1.jsx("div", { style: tab === 'models' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ModelsSettings_1.ModelsSettings, {}) })) : null, openedTabs.includes('license') ? (jsx_runtime_1.jsx("div", { style: tab === 'license' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ConfigureLicenseModal_1.LicenseSettings, {}) })) : null, openedTabs.includes('skills') ? (jsx_runtime_1.jsx("div", { style: tab === 'skills' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(SkillsSettings_1.SkillsSettings, {}) })) : null, openedTabs.includes('shortcuts') ? (jsx_runtime_1.jsx("div", { style: tab === 'shortcuts' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(KeyboardShortcutsSettings_1.KeyboardShortcutsSettings, {}) })) : null, openedTabs.includes('rendering') ? (jsx_runtime_1.jsx("div", { style: tab === 'rendering' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(RenderingSettings_1.RenderingSettings, {}) })) : null, openedTabs.includes('studio') ? (jsx_runtime_1.jsx("div", { style: tab === 'studio' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(StudioSettings_1.StudioSettings, {}) })) : null, showUpdates && openedTabs.includes('updates') ? (jsx_runtime_1.jsx("div", { style: tab === 'updates' ? settingsOptionsPanel : hiddenPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(UpdatesSettings_1.UpdatesSettings, {}) })) : null] }), tab === 'packages' ? (jsx_runtime_1.jsx("div", { ref: setPackagesFooterContainer })) : isBrowserStudio || tab === 'models' || tab === 'updates' ? null : (jsx_runtime_1.jsx(SettingsModalFooter_1.SettingsModalFooter, { showLicenseFaq: tab === 'license' }))] }) }));
|
|
106
108
|
};
|
|
107
109
|
exports.SettingsModal = SettingsModal;
|
|
@@ -5,9 +5,21 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
7
7
|
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
8
|
+
const browserStudioPointerLeaveEvent = 'remotion-browser-studio-pointerleave';
|
|
8
9
|
const ShowOutlinesProvider = ({ children }) => {
|
|
9
10
|
const [editorShowOutlines, setEditorShowOutlinesState] = (0, react_1.useState)(() => (0, editor_outlines_1.loadEditorShowOutlinesOption)());
|
|
10
11
|
const timelineSequenceHoverStore = (0, react_1.useMemo)(() => (0, timeline_sequence_hover_1.createTimelineSequenceHoverStore)(), []);
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
const onPointerLeave = () => {
|
|
14
|
+
timelineSequenceHoverStore.setHoveredSequence((hover) => (hover === null || hover === void 0 ? void 0 : hover.source) === 'timeline' ? null : hover);
|
|
15
|
+
};
|
|
16
|
+
window.addEventListener('pointerleave', onPointerLeave);
|
|
17
|
+
window.addEventListener(browserStudioPointerLeaveEvent, onPointerLeave);
|
|
18
|
+
return () => {
|
|
19
|
+
window.removeEventListener('pointerleave', onPointerLeave);
|
|
20
|
+
window.removeEventListener(browserStudioPointerLeaveEvent, onPointerLeave);
|
|
21
|
+
};
|
|
22
|
+
}, [timelineSequenceHoverStore]);
|
|
11
23
|
const setEditorShowOutlines = (0, react_1.useCallback)((newValue) => {
|
|
12
24
|
setEditorShowOutlinesState((prevState) => {
|
|
13
25
|
const newVal = newValue(prevState);
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SidebarCollapserControl = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
7
6
|
const colors_1 = require("../helpers/colors");
|
|
8
7
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
9
9
|
const sidebar_1 = require("../state/sidebar");
|
|
10
10
|
const InlineAction_1 = require("./InlineAction");
|
|
11
11
|
const TopPanel_1 = require("./TopPanel");
|
|
@@ -19,7 +19,7 @@ const style = {
|
|
|
19
19
|
position: 'relative',
|
|
20
20
|
};
|
|
21
21
|
const SidebarCollapserControl = ({ side }) => {
|
|
22
|
-
const { setSidebarCollapsedState, sidebarCollapsedStateRight } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
22
|
+
const { setSidebarCollapsedState, sidebarCollapsedStateRight, sidebarCollapsedDuringDrag, } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
23
23
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
24
24
|
const leftSidebarStatus = (0, TopPanel_1.useResponsiveSidebarStatus)();
|
|
25
25
|
const leftIcon = (0, react_1.useCallback)((color) => {
|
|
@@ -27,9 +27,12 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
27
27
|
width: '35%',
|
|
28
28
|
height: '100%',
|
|
29
29
|
borderRight: '1px solid ' + color,
|
|
30
|
-
background: leftSidebarStatus === 'expanded'
|
|
30
|
+
background: leftSidebarStatus === 'expanded' &&
|
|
31
|
+
sidebarCollapsedDuringDrag !== 'left'
|
|
32
|
+
? color
|
|
33
|
+
: colors_1.TRANSPARENT,
|
|
31
34
|
};
|
|
32
|
-
}, [leftSidebarStatus]);
|
|
35
|
+
}, [leftSidebarStatus, sidebarCollapsedDuringDrag]);
|
|
33
36
|
const rightIcon = (0, react_1.useCallback)((color) => {
|
|
34
37
|
return {
|
|
35
38
|
width: '35%',
|
|
@@ -37,9 +40,12 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
37
40
|
right: 0,
|
|
38
41
|
position: 'absolute',
|
|
39
42
|
borderLeft: '1px solid ' + color,
|
|
40
|
-
background: sidebarCollapsedStateRight === 'expanded'
|
|
43
|
+
background: sidebarCollapsedStateRight === 'expanded' &&
|
|
44
|
+
sidebarCollapsedDuringDrag !== 'right'
|
|
45
|
+
? color
|
|
46
|
+
: colors_1.TRANSPARENT,
|
|
41
47
|
};
|
|
42
|
-
}, [sidebarCollapsedStateRight]);
|
|
48
|
+
}, [sidebarCollapsedStateRight, sidebarCollapsedDuringDrag]);
|
|
43
49
|
const toggleLeft = (0, react_1.useCallback)(() => {
|
|
44
50
|
setSidebarCollapsedState({
|
|
45
51
|
left: (s) => {
|
|
@@ -86,8 +92,7 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
86
92
|
if (side === 'left') {
|
|
87
93
|
const left = keybindings.registerKeybinding({
|
|
88
94
|
event: 'keydown',
|
|
89
|
-
|
|
90
|
-
commandCtrlKey: true,
|
|
95
|
+
action: 'toggleLeftSidebar',
|
|
91
96
|
callback: toggleLeft,
|
|
92
97
|
preventDefault: true,
|
|
93
98
|
triggerIfInputFieldFocused: false,
|
|
@@ -95,8 +100,7 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
95
100
|
});
|
|
96
101
|
const zen = keybindings.registerKeybinding({
|
|
97
102
|
event: 'keydown',
|
|
98
|
-
|
|
99
|
-
commandCtrlKey: true,
|
|
103
|
+
action: 'toggleBothSidebars',
|
|
100
104
|
callback: toggleBoth,
|
|
101
105
|
preventDefault: true,
|
|
102
106
|
triggerIfInputFieldFocused: false,
|
|
@@ -109,8 +113,7 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
109
113
|
}
|
|
110
114
|
const right = keybindings.registerKeybinding({
|
|
111
115
|
event: 'keydown',
|
|
112
|
-
|
|
113
|
-
commandCtrlKey: true,
|
|
116
|
+
action: 'toggleRightSidebar',
|
|
114
117
|
callback: toggleRight,
|
|
115
118
|
preventDefault: true,
|
|
116
119
|
triggerIfInputFieldFocused: false,
|
|
@@ -120,12 +123,14 @@ const SidebarCollapserControl = ({ side }) => {
|
|
|
120
123
|
right.unregister();
|
|
121
124
|
};
|
|
122
125
|
}, [keybindings, side, toggleBoth, toggleLeft, toggleRight]);
|
|
123
|
-
const
|
|
126
|
+
const leftShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleLeftSidebar');
|
|
127
|
+
const rightShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleRightSidebar');
|
|
128
|
+
const toggleLeftTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() || leftShortcut === ''
|
|
124
129
|
? 'Toggle Left Sidebar'
|
|
125
|
-
: `Toggle Left Sidebar (${
|
|
126
|
-
const toggleRightTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
|
|
130
|
+
: `Toggle Left Sidebar (${leftShortcut})`;
|
|
131
|
+
const toggleRightTooltip = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() || rightShortcut === ''
|
|
127
132
|
? 'Toggle Right Sidebar'
|
|
128
|
-
: `Toggle Right Sidebar (${
|
|
133
|
+
: `Toggle Right Sidebar (${rightShortcut})`;
|
|
129
134
|
const colorStyle = (0, react_1.useCallback)((color) => {
|
|
130
135
|
return {
|
|
131
136
|
...style,
|
|
@@ -6,6 +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 get_preview_file_type_1 = require("../helpers/get-preview-file-type");
|
|
9
|
+
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
9
11
|
const canvas_zoom_1 = require("../icons/canvas-zoom");
|
|
10
12
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
11
13
|
const TimelineCombobox_1 = require("./TimelineCombobox");
|
|
@@ -87,6 +89,10 @@ const usePreviewSizeMenuItems = () => {
|
|
|
87
89
|
}
|
|
88
90
|
return false;
|
|
89
91
|
}, [canvasContent]);
|
|
92
|
+
const configuredResetZoomShortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('resetZoom');
|
|
93
|
+
const resetZoomShortcut = (0, use_keybinding_1.areKeyboardShortcutsDisabled)()
|
|
94
|
+
? ''
|
|
95
|
+
: configuredResetZoomShortcut;
|
|
90
96
|
const items = (0, react_1.useMemo)(() => {
|
|
91
97
|
return (0, exports.getUniqueSizes)(size).map((newSize) => {
|
|
92
98
|
return {
|
|
@@ -99,13 +105,15 @@ const usePreviewSizeMenuItems = () => {
|
|
|
99
105
|
},
|
|
100
106
|
type: 'item',
|
|
101
107
|
value: newSize.size,
|
|
102
|
-
keyHint: newSize.size === 'auto'
|
|
108
|
+
keyHint: newSize.size === 'auto' && resetZoomShortcut !== ''
|
|
109
|
+
? resetZoomShortcut
|
|
110
|
+
: null,
|
|
103
111
|
leftItem: String(size.size) === String(newSize.size) ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
104
112
|
subMenu: null,
|
|
105
113
|
quickSwitcherLabel: null,
|
|
106
114
|
};
|
|
107
115
|
});
|
|
108
|
-
}, [setSize, size]);
|
|
116
|
+
}, [resetZoomShortcut, setSize, size]);
|
|
109
117
|
return {
|
|
110
118
|
items,
|
|
111
119
|
selectedId: String(size.size),
|
|
@@ -5,9 +5,9 @@ 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 copy_text_1 = require("../helpers/copy-text");
|
|
8
|
+
const use_copy_feedback_1 = require("../helpers/use-copy-feedback");
|
|
8
9
|
const check_circle_filled_1 = require("../icons/check-circle-filled");
|
|
9
|
-
const
|
|
10
|
-
const minus_1 = require("../icons/minus");
|
|
10
|
+
const copy_1 = require("../icons/copy");
|
|
11
11
|
const InlineAction_1 = require("./InlineAction");
|
|
12
12
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
13
13
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
@@ -94,19 +94,22 @@ const loading = {
|
|
|
94
94
|
const SkillsSettings = () => {
|
|
95
95
|
var _a;
|
|
96
96
|
const { error, remotionSkillsInfo } = (0, SettingsContext_1.useSettings)();
|
|
97
|
+
const { copied, markCopied } = (0, use_copy_feedback_1.useCopyFeedback)();
|
|
97
98
|
const installedSkills = (0, react_1.useMemo)(() => {
|
|
98
99
|
var _a;
|
|
99
100
|
return ((_a = remotionSkillsInfo === null || remotionSkillsInfo === void 0 ? void 0 : remotionSkillsInfo.skills.filter(({ installedGlobally, installedInProject }) => installedGlobally || installedInProject).length) !== null && _a !== void 0 ? _a : 0);
|
|
100
101
|
}, [remotionSkillsInfo]);
|
|
101
102
|
const missingSkills = ((_a = remotionSkillsInfo === null || remotionSkillsInfo === void 0 ? void 0 : remotionSkillsInfo.skills.length) !== null && _a !== void 0 ? _a : 0) - installedSkills;
|
|
102
103
|
const onCopy = (0, react_1.useCallback)(() => {
|
|
103
|
-
(0, copy_text_1.copyText)(INSTALL_COMMAND)
|
|
104
|
+
(0, copy_text_1.copyText)(INSTALL_COMMAND)
|
|
105
|
+
.then(markCopied)
|
|
106
|
+
.catch((err) => {
|
|
104
107
|
(0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
|
|
105
108
|
});
|
|
106
|
-
}, []);
|
|
109
|
+
}, [markCopied]);
|
|
107
110
|
const renderCopyAction = (0, react_1.useCallback)((color) => {
|
|
108
|
-
return jsx_runtime_1.jsx(
|
|
109
|
-
}, []);
|
|
111
|
+
return jsx_runtime_1.jsx(copy_1.CopyIcon, { copied: copied, color: color, style: copyIcon });
|
|
112
|
+
}, [copied]);
|
|
110
113
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [remotionSkillsInfo === null && error === null ? (jsx_runtime_1.jsx("p", { style: loading, children: "Checking installed skills..." })) : null, remotionSkillsInfo === null && error ? (jsx_runtime_1.jsx("div", { style: { marginTop: 14 }, children: jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: error, align: "flex-start", type: "error" }) })) : null, missingSkills > 0 ? (jsx_runtime_1.jsxs("div", { children: [
|
|
111
114
|
jsx_runtime_1.jsx("p", { style: description, children: "Not all skills are installed. Run this command in the project directory, then reload Studio and restart your coding agent." }), jsx_runtime_1.jsxs("div", { style: commandField, children: [
|
|
112
115
|
jsx_runtime_1.jsx("pre", { style: command, children: INSTALL_COMMAND }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onCopy, renderAction: renderCopyAction, title: "Copy install command" })
|
|
@@ -122,8 +125,8 @@ const SkillsSettings = () => {
|
|
|
122
125
|
: 'Not installed';
|
|
123
126
|
return (jsx_runtime_1.jsxs("div", { role: "listitem", style: index === remotionSkillsInfo.skills.length - 1
|
|
124
127
|
? lastSkillRow
|
|
125
|
-
: skillRow, children: [
|
|
126
|
-
|
|
128
|
+
: skillRow, children: [
|
|
129
|
+
jsx_runtime_1.jsxs("span", { style: skillName, children: ["/", skill.name] }), jsx_runtime_1.jsx("span", { style: status, children: installedLocation }), installed ? (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { "aria-hidden": true, style: { ...statusIcon, fill: colors_1.BLUE } })) : null] }, skill.name));
|
|
127
130
|
}) })) : null] }));
|
|
128
131
|
};
|
|
129
132
|
exports.SkillsSettings = SkillsSettings;
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const no_react_1 = require("remotion/no-react");
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
8
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
9
|
+
const use_keyboard_shortcut_label_1 = require("../helpers/use-keyboard-shortcut-label");
|
|
9
10
|
const magnet_1 = require("../icons/magnet");
|
|
10
11
|
const editor_snapping_1 = require("../state/editor-snapping");
|
|
11
12
|
const ControlButton_1 = require("./ControlButton");
|
|
@@ -14,12 +15,14 @@ const SnappingToggle = () => {
|
|
|
14
15
|
const onClick = (0, react_1.useCallback)(() => {
|
|
15
16
|
setEditorSnapping((current) => !current);
|
|
16
17
|
}, [setEditorSnapping]);
|
|
18
|
+
const shortcut = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutLabel)('toggleSnapping');
|
|
19
|
+
const ariaKeyShortcuts = (0, use_keyboard_shortcut_label_1.useKeyboardShortcutAriaKeyShortcuts)('toggleSnapping');
|
|
17
20
|
const accessibilityLabel = [
|
|
18
21
|
editorSnapping ? 'Disable snapping' : 'Enable snapping',
|
|
19
|
-
(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null :
|
|
22
|
+
(0, use_keybinding_1.areKeyboardShortcutsDisabled)() || shortcut === '' ? null : `(${shortcut})`,
|
|
20
23
|
]
|
|
21
24
|
.filter(no_react_1.NoReactInternals.truthy)
|
|
22
25
|
.join(' ');
|
|
23
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": editorSnapping, "aria-keyshortcuts":
|
|
26
|
+
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": editorSnapping, "aria-keyshortcuts": ariaKeyShortcuts || undefined, onClick: onClick, children: (color) => (jsx_runtime_1.jsx(magnet_1.MagnetIcon, { style: { width: 18, height: 18, transform: 'translateY(1px)' }, color: editorSnapping ? colors_1.BLUE : color, "aria-hidden": "true", focusable: "false" })) }));
|
|
24
27
|
};
|
|
25
28
|
exports.SnappingToggle = SnappingToggle;
|
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.SplitterContainer = exports.containerColumn = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
38
|
const player_1 = require("@remotion/player");
|
|
6
|
-
const react_1 = require("react");
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
7
40
|
const timeline_1 = require("../../state/timeline");
|
|
8
41
|
const SplitterContext_1 = require("./SplitterContext");
|
|
9
42
|
const SplitterHandle_1 = require("./SplitterHandle");
|
|
@@ -21,8 +54,10 @@ exports.containerColumn = {
|
|
|
21
54
|
height: 0,
|
|
22
55
|
};
|
|
23
56
|
const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFlex, maxFlexerSize, minFlexerSize, maxAntiFlexerSize, minAntiFlexerSize, id, }) => {
|
|
57
|
+
const parentLayout = (0, react_1.useContext)(SplitterContext_1.SplitterLayoutContext);
|
|
24
58
|
const [initialTimelineFlex, persistFlex] = (0, timeline_1.useTimelineFlex)(id);
|
|
25
59
|
const [flexValue, setFlexValue] = (0, react_1.useState)(initialTimelineFlex !== null && initialTimelineFlex !== void 0 ? initialTimelineFlex : defaultFlex);
|
|
60
|
+
const [collapsedDuringDrag, setCollapsedDuringDrag] = (0, react_1.useState)(null);
|
|
26
61
|
const ref = (0, react_1.useRef)(null);
|
|
27
62
|
const isDragging = (0, react_1.useRef)(false);
|
|
28
63
|
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
@@ -46,6 +81,8 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
46
81
|
const value = (0, react_1.useMemo)(() => {
|
|
47
82
|
return {
|
|
48
83
|
flexValue: effectiveFlexValue,
|
|
84
|
+
collapsedDuringDrag,
|
|
85
|
+
setCollapsedDuringDrag,
|
|
49
86
|
ref,
|
|
50
87
|
setFlexValue,
|
|
51
88
|
isDragging,
|
|
@@ -62,6 +99,7 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
62
99
|
};
|
|
63
100
|
}, [
|
|
64
101
|
defaultFlex,
|
|
102
|
+
collapsedDuringDrag,
|
|
65
103
|
effectiveFlexValue,
|
|
66
104
|
id,
|
|
67
105
|
maxFlex,
|
|
@@ -74,14 +112,29 @@ const SplitterContainer = ({ orientation, children, defaultFlex, maxFlex, minFle
|
|
|
74
112
|
persistFlex,
|
|
75
113
|
ref,
|
|
76
114
|
]);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
115
|
+
const childCount = react_1.default.Children.toArray(children).length;
|
|
116
|
+
const layout = (0, react_1.useMemo)(() => ({
|
|
117
|
+
parentLayout,
|
|
118
|
+
effectiveFlexValue,
|
|
119
|
+
collapsedDuringDrag,
|
|
120
|
+
orientation,
|
|
121
|
+
width: size === null || size === void 0 ? void 0 : size.width,
|
|
122
|
+
height: size === null || size === void 0 ? void 0 : size.height,
|
|
123
|
+
childCount,
|
|
124
|
+
}), [
|
|
125
|
+
parentLayout,
|
|
126
|
+
effectiveFlexValue,
|
|
127
|
+
collapsedDuringDrag,
|
|
128
|
+
orientation,
|
|
129
|
+
size === null || size === void 0 ? void 0 : size.width,
|
|
130
|
+
size === null || size === void 0 ? void 0 : size.height,
|
|
131
|
+
childCount,
|
|
132
|
+
]);
|
|
133
|
+
const refreshSize = size === null || size === void 0 ? void 0 : size.refresh;
|
|
134
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
135
|
+
// Remeasure this splitter when its own or an ancestor's layout changes.
|
|
136
|
+
refreshSize === null || refreshSize === void 0 ? void 0 : refreshSize();
|
|
137
|
+
}, [layout, refreshSize]);
|
|
138
|
+
return (jsx_runtime_1.jsx(SplitterContext_1.SplitterLayoutContext.Provider, { value: layout, children: jsx_runtime_1.jsx(SplitterContext_1.SplitterContext.Provider, { value: value, children: jsx_runtime_1.jsx("div", { ref: ref, style: orientation === 'horizontal' ? exports.containerColumn : containerRow, children: children }) }) }));
|
|
86
139
|
};
|
|
87
140
|
exports.SplitterContainer = SplitterContainer;
|
|
@@ -6,6 +6,8 @@ export type SplitterDragState = false | {
|
|
|
6
6
|
export type SplitterOrientation = 'horizontal' | 'vertical';
|
|
7
7
|
export type TSplitterContext = {
|
|
8
8
|
flexValue: number;
|
|
9
|
+
collapsedDuringDrag: 'left' | 'right' | null;
|
|
10
|
+
setCollapsedDuringDrag: (side: 'left' | 'right' | null) => void;
|
|
9
11
|
setFlexValue: React.Dispatch<React.SetStateAction<number>>;
|
|
10
12
|
orientation: SplitterOrientation;
|
|
11
13
|
ref: React.RefObject<HTMLDivElement | null>;
|
|
@@ -36,4 +38,5 @@ export declare const getClampedSplitterFlex: ({ flexValue, ...bounds }: Pick<TSp
|
|
|
36
38
|
readonly flexValue: number;
|
|
37
39
|
}) => number;
|
|
38
40
|
export declare const SplitterContext: React.Context<TSplitterContext>;
|
|
41
|
+
export declare const SplitterLayoutContext: React.Context<object | null>;
|
|
39
42
|
export {};
|