@remotion/studio 4.0.522 → 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/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/CurrentAsset.js +40 -6
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/ElementInstallConfirmation.js +287 -135
- package/dist/components/FixComputedValueModal.js +38 -8
- 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/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/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/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/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 +10 -11
- package/dist/components/SizeSelector.js +10 -2
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +5 -2
- 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/Timeline.js +2 -42
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- 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 +75 -17
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +208 -111
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +73 -25
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -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/TimelineInOutToggle.js +20 -17
- 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 +8 -12
- 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/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 -114393
- package/dist/esm/previewEntry.mjs +387 -115050
- package/dist/esm/renderEntry.mjs +3 -3
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
- 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-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/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/modals.d.ts +14 -2
- package/package.json +34 -20
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
|
@@ -0,0 +1,1146 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getStudioKeyboardShortcuts,
|
|
3
|
+
getStudioKeyboardShortcutsEnabled
|
|
4
|
+
} from "./index-5zrb1ft4.mjs";
|
|
5
|
+
import {
|
|
6
|
+
BACKGROUND,
|
|
7
|
+
BLUE,
|
|
8
|
+
BORDER_BLACK,
|
|
9
|
+
CURRENT_COLOR,
|
|
10
|
+
FAIL_COLOR,
|
|
11
|
+
LIGHT_TEXT,
|
|
12
|
+
SHADOW_BLACK,
|
|
13
|
+
TRANSPARENT,
|
|
14
|
+
WARNING_COLOR,
|
|
15
|
+
WHITE,
|
|
16
|
+
WHITE_ALPHA_20,
|
|
17
|
+
getBackgroundFromHoverState
|
|
18
|
+
} from "./index-jg13hf2g.mjs";
|
|
19
|
+
|
|
20
|
+
// src/components/layout.tsx
|
|
21
|
+
import { useMemo } from "react";
|
|
22
|
+
import { jsx } from "react/jsx-runtime";
|
|
23
|
+
var SPACING_UNIT = 8;
|
|
24
|
+
var COMPACT_CONTROL_ROW_HEIGHT = 28;
|
|
25
|
+
var COMPACT_INLINE_ROW_HEIGHT = 22;
|
|
26
|
+
var Spacing = ({ x = 0, y = 0, block = false }) => {
|
|
27
|
+
const style = useMemo(() => {
|
|
28
|
+
return {
|
|
29
|
+
display: block ? "block" : "inline-block",
|
|
30
|
+
width: x * SPACING_UNIT,
|
|
31
|
+
height: y * SPACING_UNIT,
|
|
32
|
+
flexShrink: 0
|
|
33
|
+
};
|
|
34
|
+
}, [block, x, y]);
|
|
35
|
+
return /* @__PURE__ */ jsx("div", {
|
|
36
|
+
style
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var flexCss = { flex: 1 };
|
|
40
|
+
var Flex = ({ children }) => /* @__PURE__ */ jsx("div", {
|
|
41
|
+
style: flexCss,
|
|
42
|
+
children
|
|
43
|
+
});
|
|
44
|
+
var Row = ({ children, justify, className, align, flex, style = {}, ...other }) => {
|
|
45
|
+
const finalStyle = useMemo(() => {
|
|
46
|
+
return {
|
|
47
|
+
...style,
|
|
48
|
+
display: "flex",
|
|
49
|
+
flexDirection: "row",
|
|
50
|
+
justifyContent: justify ?? "flex-start",
|
|
51
|
+
alignItems: align ?? "flex-start",
|
|
52
|
+
flex: flex ?? undefined
|
|
53
|
+
};
|
|
54
|
+
}, [align, flex, justify, style]);
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
className,
|
|
57
|
+
style: finalStyle,
|
|
58
|
+
...other,
|
|
59
|
+
children
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var Column = ({ children, justify, className, align, style = {} }) => {
|
|
63
|
+
const finalStyle = useMemo(() => {
|
|
64
|
+
return {
|
|
65
|
+
...style,
|
|
66
|
+
display: "flex",
|
|
67
|
+
flexDirection: "column",
|
|
68
|
+
justifyContent: justify ?? "flex-start",
|
|
69
|
+
alignItems: align ?? "flex-start"
|
|
70
|
+
};
|
|
71
|
+
}, [align, justify, style]);
|
|
72
|
+
return /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className,
|
|
74
|
+
style: finalStyle,
|
|
75
|
+
children
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// src/components/InlineAction.tsx
|
|
80
|
+
import { useCallback as useCallback4, useMemo as useMemo6 } from "react";
|
|
81
|
+
|
|
82
|
+
// src/helpers/hoverable.ts
|
|
83
|
+
var HOVERABLE_CLASS_NAME = "__remotion-hoverable";
|
|
84
|
+
var HOVER_GROUP_CLASS_NAME = "__remotion-hover-group";
|
|
85
|
+
var HOVER_GROUP_REVEAL_CLASS_NAME = "__remotion-hover-group-reveal";
|
|
86
|
+
var FOCUS_VISIBLE_ONLY_CLASS_NAME = "__remotion-focus-visible-only";
|
|
87
|
+
var BG_VARIABLE = "--remotion-hoverable-bg";
|
|
88
|
+
var HOVER_BG_VARIABLE = "--remotion-hoverable-hover-bg";
|
|
89
|
+
var COLOR_VARIABLE = "--remotion-hoverable-color";
|
|
90
|
+
var HOVER_COLOR_VARIABLE = "--remotion-hoverable-hover-color";
|
|
91
|
+
var NO_HOVER_BACKGROUND_STYLE = {
|
|
92
|
+
[HOVER_BG_VARIABLE]: TRANSPARENT
|
|
93
|
+
};
|
|
94
|
+
var hoverableStyle = ({
|
|
95
|
+
idleBackground,
|
|
96
|
+
hoverBackground,
|
|
97
|
+
idleColor,
|
|
98
|
+
hoverColor
|
|
99
|
+
}) => {
|
|
100
|
+
return {
|
|
101
|
+
[BG_VARIABLE]: idleBackground,
|
|
102
|
+
[HOVER_BG_VARIABLE]: hoverBackground,
|
|
103
|
+
[COLOR_VARIABLE]: idleColor,
|
|
104
|
+
[HOVER_COLOR_VARIABLE]: hoverColor
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
var hoverable = `.${HOVERABLE_CLASS_NAME}.${HOVERABLE_CLASS_NAME}`;
|
|
108
|
+
var hoverGroup = `.${HOVER_GROUP_CLASS_NAME}`;
|
|
109
|
+
var reveal = `.${HOVER_GROUP_REVEAL_CLASS_NAME}.${HOVER_GROUP_REVEAL_CLASS_NAME}`;
|
|
110
|
+
var makeHoverableCSS = () => `
|
|
111
|
+
${hoverable} {
|
|
112
|
+
background-color: var(${BG_VARIABLE}, ${TRANSPARENT});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
${hoverable},
|
|
116
|
+
${hoverable} * {
|
|
117
|
+
color: var(${COLOR_VARIABLE}, inherit);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
${hoverGroup} ${reveal} {
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media (hover: hover) {
|
|
125
|
+
${hoverable}:hover {
|
|
126
|
+
background-color: var(${HOVER_BG_VARIABLE}, var(${BG_VARIABLE}, ${TRANSPARENT}));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
${hoverable}:hover,
|
|
130
|
+
${hoverable}:hover * {
|
|
131
|
+
color: var(${HOVER_COLOR_VARIABLE}, var(${COLOR_VARIABLE}, inherit));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* An outer hoverable must not put a nested inline action into its hover
|
|
135
|
+
state. The nested action should only use its hover color when the
|
|
136
|
+
pointer is over the action itself. */
|
|
137
|
+
${hoverable}:hover ${hoverable}:not(:hover),
|
|
138
|
+
${hoverable}:hover ${hoverable}:not(:hover) * {
|
|
139
|
+
color: var(${COLOR_VARIABLE}, inherit);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
${hoverGroup} ${reveal} {
|
|
143
|
+
opacity: 0;
|
|
144
|
+
width: 0;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
${hoverGroup}:hover ${reveal} {
|
|
149
|
+
opacity: 1;
|
|
150
|
+
width: auto;
|
|
151
|
+
overflow: visible;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`;
|
|
155
|
+
|
|
156
|
+
// src/state/z-index.tsx
|
|
157
|
+
import {
|
|
158
|
+
createContext as createContext3,
|
|
159
|
+
useContext as useContext2,
|
|
160
|
+
useLayoutEffect,
|
|
161
|
+
useMemo as useMemo5,
|
|
162
|
+
useRef as useRef2
|
|
163
|
+
} from "react";
|
|
164
|
+
|
|
165
|
+
// src/helpers/pointer-session.ts
|
|
166
|
+
var getButtonMask = (button) => {
|
|
167
|
+
if (button === 0) {
|
|
168
|
+
return 1;
|
|
169
|
+
}
|
|
170
|
+
if (button === 1) {
|
|
171
|
+
return 4;
|
|
172
|
+
}
|
|
173
|
+
if (button === 2) {
|
|
174
|
+
return 2;
|
|
175
|
+
}
|
|
176
|
+
return 1 << button;
|
|
177
|
+
};
|
|
178
|
+
var startPointerSession = ({
|
|
179
|
+
event,
|
|
180
|
+
captureTarget,
|
|
181
|
+
onMove,
|
|
182
|
+
onEnd
|
|
183
|
+
}) => {
|
|
184
|
+
const { pointerId } = event;
|
|
185
|
+
const buttonMask = getButtonMask(event.button);
|
|
186
|
+
let ended = false;
|
|
187
|
+
let activeCaptureTarget = null;
|
|
188
|
+
const capturePointer = (target) => {
|
|
189
|
+
if (activeCaptureTarget !== null) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
activeCaptureTarget = target;
|
|
193
|
+
try {
|
|
194
|
+
target.setPointerCapture?.(pointerId);
|
|
195
|
+
} catch {}
|
|
196
|
+
target.addEventListener("lostpointercapture", handleLostPointerCapture);
|
|
197
|
+
};
|
|
198
|
+
const cleanup = () => {
|
|
199
|
+
window.removeEventListener("pointermove", handleMove);
|
|
200
|
+
window.removeEventListener("pointerup", handleUp);
|
|
201
|
+
window.removeEventListener("pointercancel", handleCancel);
|
|
202
|
+
window.removeEventListener("blur", handleBlur);
|
|
203
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
204
|
+
activeCaptureTarget?.removeEventListener("lostpointercapture", handleLostPointerCapture);
|
|
205
|
+
if (activeCaptureTarget?.hasPointerCapture?.(pointerId)) {
|
|
206
|
+
try {
|
|
207
|
+
activeCaptureTarget.releasePointerCapture(pointerId);
|
|
208
|
+
} catch {}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const end = (reason, pointerEvent) => {
|
|
212
|
+
if (ended) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
ended = true;
|
|
216
|
+
cleanup();
|
|
217
|
+
onEnd(reason, pointerEvent);
|
|
218
|
+
};
|
|
219
|
+
function handleMove(moveEvent) {
|
|
220
|
+
if (moveEvent.pointerId !== pointerId) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if ((moveEvent.buttons & buttonMask) === 0) {
|
|
224
|
+
end("buttons-released", moveEvent);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
onMove?.(moveEvent, capturePointer);
|
|
228
|
+
}
|
|
229
|
+
function handleUp(upEvent) {
|
|
230
|
+
if (upEvent.pointerId === pointerId) {
|
|
231
|
+
end("pointerup", upEvent);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function handleCancel(cancelEvent) {
|
|
235
|
+
if (cancelEvent.pointerId === pointerId) {
|
|
236
|
+
end("pointercancel", cancelEvent);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function handleLostPointerCapture(lostEvent) {
|
|
240
|
+
const pointerEvent = lostEvent;
|
|
241
|
+
if (pointerEvent.pointerId === pointerId) {
|
|
242
|
+
end("lostpointercapture", pointerEvent);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function handleBlur() {
|
|
246
|
+
end("blur", null);
|
|
247
|
+
}
|
|
248
|
+
function handleVisibilityChange() {
|
|
249
|
+
if (document.visibilityState === "hidden") {
|
|
250
|
+
end("visibilitychange", null);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (captureTarget !== null) {
|
|
254
|
+
capturePointer(captureTarget);
|
|
255
|
+
}
|
|
256
|
+
window.addEventListener("pointermove", handleMove);
|
|
257
|
+
window.addEventListener("pointerup", handleUp);
|
|
258
|
+
window.addEventListener("pointercancel", handleCancel);
|
|
259
|
+
window.addEventListener("blur", handleBlur);
|
|
260
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
261
|
+
return () => end("manual", null);
|
|
262
|
+
};
|
|
263
|
+
var startCapturedPointerSession = ({
|
|
264
|
+
event,
|
|
265
|
+
captureTarget,
|
|
266
|
+
onMove,
|
|
267
|
+
onEnd
|
|
268
|
+
}) => {
|
|
269
|
+
return startPointerSession({ event, captureTarget, onMove, onEnd });
|
|
270
|
+
};
|
|
271
|
+
var startDeferredCapturedPointerSession = ({
|
|
272
|
+
event,
|
|
273
|
+
captureTarget,
|
|
274
|
+
onMove,
|
|
275
|
+
onEnd
|
|
276
|
+
}) => {
|
|
277
|
+
return startPointerSession({
|
|
278
|
+
event,
|
|
279
|
+
captureTarget: null,
|
|
280
|
+
onMove: (moveEvent, capturePointer) => {
|
|
281
|
+
onMove(moveEvent, () => capturePointer(captureTarget));
|
|
282
|
+
},
|
|
283
|
+
onEnd
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
var observePointerRelease = ({
|
|
287
|
+
event,
|
|
288
|
+
onEnd
|
|
289
|
+
}) => {
|
|
290
|
+
return startPointerSession({
|
|
291
|
+
event,
|
|
292
|
+
captureTarget: null,
|
|
293
|
+
onEnd
|
|
294
|
+
});
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// src/helpers/use-keybinding.ts
|
|
298
|
+
import { useCallback as useCallback2, useContext, useEffect, useMemo as useMemo3, useState } from "react";
|
|
299
|
+
|
|
300
|
+
// src/helpers/is-mac.ts
|
|
301
|
+
var isMac = typeof window !== "undefined" && window.navigator.platform.startsWith("Mac");
|
|
302
|
+
|
|
303
|
+
// src/components/keyboard-shortcuts.ts
|
|
304
|
+
var shortcut = (action, actionId) => ({ action, actionId });
|
|
305
|
+
var fixedShortcut = (action, fixedChords, fixedReason) => ({ action, actionId: null, fixedChords, fixedReason });
|
|
306
|
+
var defaultKeyboardShortcuts = {
|
|
307
|
+
playPause: [{ key: "Space" }],
|
|
308
|
+
jumpToBeginning: [{ key: "a" }],
|
|
309
|
+
jumpToEnd: [{ key: "e" }],
|
|
310
|
+
reversePlayback: [{ key: "j" }],
|
|
311
|
+
pausePlayback: [{ key: "k" }],
|
|
312
|
+
playForward: [{ key: "l" }],
|
|
313
|
+
goToFrame: [{ key: "g" }],
|
|
314
|
+
pauseAndReturnToPlaybackStart: [{ key: "Enter" }],
|
|
315
|
+
toggleLeftSidebar: [{ key: "b", commandOrControl: true }],
|
|
316
|
+
toggleRightSidebar: [{ key: "j", commandOrControl: true }],
|
|
317
|
+
toggleBothSidebars: [{ key: "g", commandOrControl: true }],
|
|
318
|
+
enterFullscreen: [{ key: "f" }],
|
|
319
|
+
toggleSnapping: [{ key: "m", shift: true }],
|
|
320
|
+
previousComposition: [{ key: "PageUp" }],
|
|
321
|
+
nextComposition: [{ key: "PageDown" }],
|
|
322
|
+
showKeyboardShortcuts: [{ key: "?", shift: true }],
|
|
323
|
+
quickSwitcher: [{ key: "k", commandOrControl: true }],
|
|
324
|
+
render: [{ key: "r" }],
|
|
325
|
+
toggleCheckerboard: [{ key: "t" }],
|
|
326
|
+
setInPoint: [{ key: "i" }],
|
|
327
|
+
setOutPoint: [{ key: "o" }],
|
|
328
|
+
clearInOutPoints: [{ key: "x" }],
|
|
329
|
+
zoomIn: [{ key: "+", shift: true }, { key: "+" }],
|
|
330
|
+
zoomOut: [{ key: "-" }],
|
|
331
|
+
resetZoom: [{ key: "0" }],
|
|
332
|
+
undo: [{ key: "z", commandOrControl: true }],
|
|
333
|
+
redo: [
|
|
334
|
+
...isMac ? [] : [{ key: "y", commandOrControl: true }],
|
|
335
|
+
{ key: "z", commandOrControl: true, shift: true }
|
|
336
|
+
],
|
|
337
|
+
selectAllSequenceRows: [{ key: "a", commandOrControl: true }],
|
|
338
|
+
selectTranslateProp: [{ key: "p" }],
|
|
339
|
+
selectOpacityProp: [{ key: "t" }],
|
|
340
|
+
selectRotateProp: [{ key: "r" }],
|
|
341
|
+
selectScaleProp: [{ key: "s" }],
|
|
342
|
+
duplicateSequences: [{ key: "d", commandOrControl: true }],
|
|
343
|
+
copyEffectsAndValues: [{ key: "c", commandOrControl: true }],
|
|
344
|
+
cutEffects: [{ key: "x", commandOrControl: true }],
|
|
345
|
+
deleteSelection: [{ key: "Backspace" }, { key: "Delete" }],
|
|
346
|
+
askAI: [{ key: "i", commandOrControl: true }]
|
|
347
|
+
};
|
|
348
|
+
var keyboardShortcutGroups = [
|
|
349
|
+
{
|
|
350
|
+
name: "Playback",
|
|
351
|
+
shortcuts: [
|
|
352
|
+
fixedShortcut("1 second back", [["Shift", "←"]], "Context-sensitive timeline control"),
|
|
353
|
+
fixedShortcut("Previous frame", [["←"]], "Context-sensitive timeline control"),
|
|
354
|
+
shortcut("Play / Pause", "playPause"),
|
|
355
|
+
fixedShortcut("Next frame", [["→"]], "Context-sensitive timeline control"),
|
|
356
|
+
fixedShortcut("1 second forward", [["Shift", "→"]], "Context-sensitive timeline control"),
|
|
357
|
+
shortcut("Jump to beginning", "jumpToBeginning"),
|
|
358
|
+
shortcut("Jump to end", "jumpToEnd"),
|
|
359
|
+
shortcut("Reverse playback", "reversePlayback"),
|
|
360
|
+
shortcut("Pause", "pausePlayback"),
|
|
361
|
+
shortcut("Play / Speed up", "playForward"),
|
|
362
|
+
shortcut("Go to frame", "goToFrame"),
|
|
363
|
+
shortcut("Pause & return to playback start", "pauseAndReturnToPlaybackStart")
|
|
364
|
+
]
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: "Sidebar",
|
|
368
|
+
shortcuts: [
|
|
369
|
+
shortcut("Toggle left sidebar", "toggleLeftSidebar"),
|
|
370
|
+
shortcut("Toggle right sidebar", "toggleRightSidebar"),
|
|
371
|
+
shortcut("Toggle both sidebars", "toggleBothSidebars")
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: "View",
|
|
376
|
+
shortcuts: [
|
|
377
|
+
shortcut("Enter fullscreen", "enterFullscreen"),
|
|
378
|
+
fixedShortcut("Exit fullscreen", [["Esc"]], "Handled by the browser"),
|
|
379
|
+
shortcut("Enable snapping", "toggleSnapping")
|
|
380
|
+
]
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
name: "Navigation",
|
|
384
|
+
shortcuts: [
|
|
385
|
+
shortcut("Previous composition", "previousComposition"),
|
|
386
|
+
shortcut("Next composition", "nextComposition"),
|
|
387
|
+
shortcut("Render, unless a sequence or prop is selected", "render"),
|
|
388
|
+
shortcut("Checkerboard, unless a sequence or prop is selected", "toggleCheckerboard"),
|
|
389
|
+
shortcut("Show keyboard shortcuts", "showKeyboardShortcuts"),
|
|
390
|
+
shortcut("Quick Switcher", "quickSwitcher")
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: "Playback range",
|
|
395
|
+
shortcuts: [
|
|
396
|
+
shortcut("Set In Point", "setInPoint"),
|
|
397
|
+
shortcut("Set Out Point", "setOutPoint"),
|
|
398
|
+
shortcut("Clear In/Out Points", "clearInOutPoints")
|
|
399
|
+
]
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: "Zoom",
|
|
403
|
+
shortcuts: [
|
|
404
|
+
shortcut("Zoom in", "zoomIn"),
|
|
405
|
+
shortcut("Zoom out", "zoomOut"),
|
|
406
|
+
shortcut("Reset zoom", "resetZoom")
|
|
407
|
+
]
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: "Props Editor",
|
|
411
|
+
shortcuts: [shortcut("Undo", "undo"), shortcut("Redo", "redo")]
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: "Interactivity",
|
|
415
|
+
shortcuts: [
|
|
416
|
+
fixedShortcut("Select range / axis lock drag", [["Shift"]], "Gesture modifier"),
|
|
417
|
+
fixedShortcut("Toggle selection", [[isMac ? "⌘" : "Ctrl"]], "Gesture modifier"),
|
|
418
|
+
shortcut("Select sequence rows", "selectAllSequenceRows"),
|
|
419
|
+
shortcut("Select translate prop", "selectTranslateProp"),
|
|
420
|
+
shortcut("Select opacity prop", "selectOpacityProp"),
|
|
421
|
+
shortcut("Select rotate prop", "selectRotateProp"),
|
|
422
|
+
shortcut("Select scale prop", "selectScaleProp"),
|
|
423
|
+
shortcut("Duplicate sequences", "duplicateSequences"),
|
|
424
|
+
shortcut("Copy effects / values", "copyEffectsAndValues"),
|
|
425
|
+
shortcut("Cut effects", "cutEffects"),
|
|
426
|
+
fixedShortcut("Paste effects / values", [[isMac ? "⌘" : "Ctrl", "V"]], "Handled by the browser clipboard event"),
|
|
427
|
+
shortcut("Delete / reset selection", "deleteSelection")
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
];
|
|
431
|
+
var askAIKeyboardShortcutGroup = {
|
|
432
|
+
name: "AI",
|
|
433
|
+
shortcuts: [shortcut("Ask AI", "askAI")]
|
|
434
|
+
};
|
|
435
|
+
var getKeyboardShortcutsForAction = (action, configured = getStudioKeyboardShortcuts()) => {
|
|
436
|
+
if (configured !== null && Object.prototype.hasOwnProperty.call(configured, action)) {
|
|
437
|
+
const value = configured[action];
|
|
438
|
+
if (value === null) {
|
|
439
|
+
return [];
|
|
440
|
+
}
|
|
441
|
+
return Array.isArray(value) ? value : [
|
|
442
|
+
value
|
|
443
|
+
];
|
|
444
|
+
}
|
|
445
|
+
return defaultKeyboardShortcuts[action];
|
|
446
|
+
};
|
|
447
|
+
var normalizeKey = (key) => key === "Space" ? " " : key;
|
|
448
|
+
var keyboardEventMatchesShortcut = ({
|
|
449
|
+
event,
|
|
450
|
+
shortcut: value
|
|
451
|
+
}) => {
|
|
452
|
+
const commandOrControl = isMac ? event.metaKey : event.ctrlKey;
|
|
453
|
+
return event.key.toLowerCase() === normalizeKey(value.key).toLowerCase() && commandOrControl === (value.commandOrControl ?? false) && (isMac ? !event.ctrlKey : !event.metaKey) && (!value.shift || event.shiftKey) && (!value.alt || event.altKey);
|
|
454
|
+
};
|
|
455
|
+
var keyboardShortcutsOverlap = (first, second) => first.key.toLowerCase() === second.key.toLowerCase() && (first.commandOrControl ?? false) === (second.commandOrControl ?? false);
|
|
456
|
+
var keyboardEventMatchesAction = (event, action) => getKeyboardShortcutsForAction(action).some((value) => keyboardEventMatchesShortcut({ event, shortcut: value }));
|
|
457
|
+
var displayKey = (keyboardKey) => {
|
|
458
|
+
if (keyboardKey === "ArrowLeft")
|
|
459
|
+
return "←";
|
|
460
|
+
if (keyboardKey === "ArrowRight")
|
|
461
|
+
return "→";
|
|
462
|
+
if (keyboardKey === "Delete")
|
|
463
|
+
return "Del";
|
|
464
|
+
if (keyboardKey === "Backspace")
|
|
465
|
+
return "⌫";
|
|
466
|
+
if (keyboardKey === "Escape")
|
|
467
|
+
return "Esc";
|
|
468
|
+
return keyboardKey.length === 1 ? keyboardKey.toUpperCase() : keyboardKey;
|
|
469
|
+
};
|
|
470
|
+
var formatKeyboardShortcut = (value) => [
|
|
471
|
+
...value.commandOrControl ? [isMac ? "⌘" : "Ctrl"] : [],
|
|
472
|
+
...value.alt ? [isMac ? "Option" : "Alt"] : [],
|
|
473
|
+
...value.shift && !["+", "?"].includes(value.key) ? ["Shift"] : [],
|
|
474
|
+
displayKey(value.key)
|
|
475
|
+
];
|
|
476
|
+
var formatKeyboardShortcutForAria = (value) => [
|
|
477
|
+
...value.commandOrControl ? [isMac ? "Meta" : "Control"] : [],
|
|
478
|
+
...value.alt ? ["Alt"] : [],
|
|
479
|
+
...value.shift ? ["Shift"] : [],
|
|
480
|
+
value.key
|
|
481
|
+
].join("+");
|
|
482
|
+
var getKeyboardShortcutLabel = (action) => getKeyboardShortcutsForAction(action).map((value) => formatKeyboardShortcut(value).join("+")).join(" / ");
|
|
483
|
+
var getKeyboardShortcutAriaKeyShortcuts = (action) => getKeyboardShortcutsForAction(action).map(formatKeyboardShortcutForAria).join(" ");
|
|
484
|
+
var shortcutFromKeyboardEvent = (event) => {
|
|
485
|
+
if (["Alt", "Control", "Meta", "Shift"].includes(event.key)) {
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
if (isMac ? event.ctrlKey : event.metaKey) {
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
return {
|
|
492
|
+
key: event.key === " " ? "Space" : event.key,
|
|
493
|
+
...(isMac ? event.metaKey : event.ctrlKey) ? { commandOrControl: true } : {},
|
|
494
|
+
...event.shiftKey ? { shift: true } : {},
|
|
495
|
+
...event.altKey ? { alt: true } : {}
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
// src/state/keybindings.tsx
|
|
500
|
+
import { createContext, useCallback, useMemo as useMemo2, useRef } from "react";
|
|
501
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
502
|
+
var KeybindingContext = createContext({
|
|
503
|
+
registerKeybinding: () => {
|
|
504
|
+
throw new Error("Has no keybinding context");
|
|
505
|
+
},
|
|
506
|
+
unregisterKeybinding: () => {
|
|
507
|
+
return;
|
|
508
|
+
},
|
|
509
|
+
unregisterPane: () => {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
var KeybindingContextProvider = ({ children }) => {
|
|
514
|
+
const registered = useRef([]);
|
|
515
|
+
const registerKeybinding = useCallback((binding) => {
|
|
516
|
+
registered.current = [...registered.current, binding];
|
|
517
|
+
window.addEventListener(binding.event, binding.callback);
|
|
518
|
+
}, []);
|
|
519
|
+
const unregisterKeybinding = useCallback((binding) => {
|
|
520
|
+
registered.current = registered.current.filter((r) => {
|
|
521
|
+
if (r.id === binding.id) {
|
|
522
|
+
window.removeEventListener(binding.event, binding.callback);
|
|
523
|
+
return false;
|
|
524
|
+
}
|
|
525
|
+
return true;
|
|
526
|
+
});
|
|
527
|
+
}, []);
|
|
528
|
+
const unregisterPane = useCallback((paneId) => {
|
|
529
|
+
const matchedKeybindings = registered.current.filter((r) => r.registeredFromPane === paneId);
|
|
530
|
+
for (const matched of matchedKeybindings) {
|
|
531
|
+
unregisterKeybinding(matched);
|
|
532
|
+
}
|
|
533
|
+
}, [unregisterKeybinding]);
|
|
534
|
+
const value = useMemo2(() => {
|
|
535
|
+
return {
|
|
536
|
+
registerKeybinding,
|
|
537
|
+
unregisterKeybinding,
|
|
538
|
+
unregisterPane
|
|
539
|
+
};
|
|
540
|
+
}, [registerKeybinding, unregisterKeybinding, unregisterPane]);
|
|
541
|
+
return /* @__PURE__ */ jsx2(KeybindingContext.Provider, {
|
|
542
|
+
value,
|
|
543
|
+
children
|
|
544
|
+
});
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
// src/helpers/use-keybinding.ts
|
|
548
|
+
if (!getStudioKeyboardShortcutsEnabled()) {
|
|
549
|
+
console.warn("Keyboard shortcuts disabled either due to: a) --disable-keyboard-shortcuts being passed b) Config.setKeyboardShortcutsEnabled(false) being set or c) a Remotion version mismatch.");
|
|
550
|
+
}
|
|
551
|
+
var areKeyboardShortcutsDisabled = () => {
|
|
552
|
+
return !getStudioKeyboardShortcutsEnabled();
|
|
553
|
+
};
|
|
554
|
+
var useKeybinding = () => {
|
|
555
|
+
const [paneId] = useState(() => String(Math.random()));
|
|
556
|
+
const context = useContext(KeybindingContext);
|
|
557
|
+
const { isHighestContext } = useZIndex();
|
|
558
|
+
const registerKeybinding = useCallback2((options) => {
|
|
559
|
+
if (!isHighestContext && !options.keepRegisteredWhenNotHighestContext) {
|
|
560
|
+
return {
|
|
561
|
+
unregister: () => {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
const listener = (e) => {
|
|
567
|
+
if (!e.key) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
const matches = options.action ? keyboardEventMatchesAction(e, options.action) : e.key.toLowerCase() === options.key.toLowerCase() && options.commandCtrlKey === (isMac ? e.metaKey : e.ctrlKey);
|
|
571
|
+
if (matches && getStudioKeyboardShortcutsEnabled()) {
|
|
572
|
+
if (!options.triggerIfInputFieldFocused) {
|
|
573
|
+
const { activeElement } = document;
|
|
574
|
+
if (activeElement instanceof HTMLInputElement) {
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
if (activeElement instanceof HTMLTextAreaElement) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
options.callback(e);
|
|
582
|
+
if (options.preventDefault) {
|
|
583
|
+
e.preventDefault();
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
const toRegister = {
|
|
588
|
+
registeredFromPane: paneId,
|
|
589
|
+
event: options.event,
|
|
590
|
+
key: options.action ?? options.key,
|
|
591
|
+
callback: listener,
|
|
592
|
+
id: String(Math.random())
|
|
593
|
+
};
|
|
594
|
+
context.registerKeybinding(toRegister);
|
|
595
|
+
return {
|
|
596
|
+
unregister: () => context.unregisterKeybinding(toRegister)
|
|
597
|
+
};
|
|
598
|
+
}, [context, isHighestContext, paneId]);
|
|
599
|
+
useEffect(() => {
|
|
600
|
+
return () => {
|
|
601
|
+
context.unregisterPane(paneId);
|
|
602
|
+
};
|
|
603
|
+
}, [context, paneId]);
|
|
604
|
+
return useMemo3(() => ({ registerKeybinding, isHighestContext }), [registerKeybinding, isHighestContext]);
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
// src/state/highest-z-index.tsx
|
|
608
|
+
import { createContext as createContext2, useCallback as useCallback3, useMemo as useMemo4, useState as useState2 } from "react";
|
|
609
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
610
|
+
var HighestZIndexContext = createContext2({
|
|
611
|
+
highestIndex: 0,
|
|
612
|
+
registerZIndex: () => {
|
|
613
|
+
return;
|
|
614
|
+
},
|
|
615
|
+
unregisterZIndex: () => {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
var HighestZIndexProvider = ({ children }) => {
|
|
620
|
+
const [zIndexes, setZIndexes] = useState2([]);
|
|
621
|
+
const registerZIndex = useCallback3((newIndex) => {
|
|
622
|
+
setZIndexes((prev) => [...prev, newIndex]);
|
|
623
|
+
}, []);
|
|
624
|
+
const unregisterZIndex = useCallback3((newIndex) => {
|
|
625
|
+
setZIndexes((prev) => {
|
|
626
|
+
const index = prev.indexOf(newIndex);
|
|
627
|
+
if (index === -1) {
|
|
628
|
+
throw new Error("did not find z-index " + newIndex);
|
|
629
|
+
}
|
|
630
|
+
return prev.filter((_n, i) => i !== index);
|
|
631
|
+
});
|
|
632
|
+
}, []);
|
|
633
|
+
const highestIndex = Math.max(...zIndexes);
|
|
634
|
+
const value = useMemo4(() => {
|
|
635
|
+
return {
|
|
636
|
+
highestIndex,
|
|
637
|
+
registerZIndex,
|
|
638
|
+
unregisterZIndex
|
|
639
|
+
};
|
|
640
|
+
}, [registerZIndex, unregisterZIndex, highestIndex]);
|
|
641
|
+
return /* @__PURE__ */ jsx3(HighestZIndexContext.Provider, {
|
|
642
|
+
value,
|
|
643
|
+
children
|
|
644
|
+
});
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
// src/state/input-dragger-click-lock.ts
|
|
648
|
+
var clickLock = false;
|
|
649
|
+
var getClickLock = () => clickLock;
|
|
650
|
+
var setClickLock = (lock) => {
|
|
651
|
+
clickLock = lock;
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
// src/state/z-index.tsx
|
|
655
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
656
|
+
var ZIndexContext = createContext3({
|
|
657
|
+
currentIndex: 0
|
|
658
|
+
});
|
|
659
|
+
var margin = {
|
|
660
|
+
margin: "auto"
|
|
661
|
+
};
|
|
662
|
+
var EscapeHook = ({ onEscape }) => {
|
|
663
|
+
const keybindings = useKeybinding();
|
|
664
|
+
useLayoutEffect(() => {
|
|
665
|
+
const escape = keybindings.registerKeybinding({
|
|
666
|
+
event: "keydown",
|
|
667
|
+
key: "Escape",
|
|
668
|
+
callback: onEscape,
|
|
669
|
+
commandCtrlKey: false,
|
|
670
|
+
preventDefault: true,
|
|
671
|
+
triggerIfInputFieldFocused: true,
|
|
672
|
+
keepRegisteredWhenNotHighestContext: false
|
|
673
|
+
});
|
|
674
|
+
return () => {
|
|
675
|
+
escape.unregister();
|
|
676
|
+
};
|
|
677
|
+
}, [keybindings, onEscape]);
|
|
678
|
+
return null;
|
|
679
|
+
};
|
|
680
|
+
var HigherZIndex = ({
|
|
681
|
+
children,
|
|
682
|
+
onEscape,
|
|
683
|
+
onOutsideClick,
|
|
684
|
+
disabled,
|
|
685
|
+
outsideClickButton = "any"
|
|
686
|
+
}) => {
|
|
687
|
+
const context = useContext2(ZIndexContext);
|
|
688
|
+
const highestContext = useContext2(HighestZIndexContext);
|
|
689
|
+
const { registerZIndex, unregisterZIndex } = highestContext;
|
|
690
|
+
const containerRef = useRef2(null);
|
|
691
|
+
const highestIndexRef = useRef2(highestContext.highestIndex);
|
|
692
|
+
const onOutsideClickRef = useRef2(onOutsideClick);
|
|
693
|
+
const outsideClickButtonRef = useRef2(outsideClickButton);
|
|
694
|
+
const currentIndex = disabled ? context.currentIndex : context.currentIndex + 1;
|
|
695
|
+
useLayoutEffect(() => {
|
|
696
|
+
highestIndexRef.current = highestContext.highestIndex;
|
|
697
|
+
onOutsideClickRef.current = onOutsideClick;
|
|
698
|
+
outsideClickButtonRef.current = outsideClickButton;
|
|
699
|
+
}, [highestContext.highestIndex, onOutsideClick, outsideClickButton]);
|
|
700
|
+
useLayoutEffect(() => {
|
|
701
|
+
if (disabled) {
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
registerZIndex(currentIndex);
|
|
705
|
+
return () => unregisterZIndex(currentIndex);
|
|
706
|
+
}, [currentIndex, disabled, registerZIndex, unregisterZIndex]);
|
|
707
|
+
useLayoutEffect(() => {
|
|
708
|
+
if (disabled) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
let endPointerSession = null;
|
|
712
|
+
const listener = (downEvent) => {
|
|
713
|
+
if (outsideClickButtonRef.current === "primary" && downEvent.button !== 0) {
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const outsideClick = !containerRef.current?.contains(downEvent.target);
|
|
717
|
+
if (!outsideClick) {
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
if (highestIndexRef.current !== currentIndex) {
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
endPointerSession?.();
|
|
724
|
+
endPointerSession = observePointerRelease({
|
|
725
|
+
event: downEvent,
|
|
726
|
+
onEnd: (reason, upEvent) => {
|
|
727
|
+
endPointerSession = null;
|
|
728
|
+
if ((reason === "pointerup" || reason === "buttons-released") && upEvent && !getClickLock()) {
|
|
729
|
+
const target = document.elementFromPoint(upEvent.clientX, upEvent.clientY) ?? upEvent.target;
|
|
730
|
+
if (document.contains(target)) {
|
|
731
|
+
upEvent.stopPropagation();
|
|
732
|
+
onOutsideClickRef.current(target);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
};
|
|
738
|
+
window.addEventListener("pointerdown", listener, true);
|
|
739
|
+
return () => {
|
|
740
|
+
endPointerSession?.();
|
|
741
|
+
endPointerSession = null;
|
|
742
|
+
return window.removeEventListener("pointerdown", listener, true);
|
|
743
|
+
};
|
|
744
|
+
}, [currentIndex, disabled]);
|
|
745
|
+
const value = useMemo5(() => {
|
|
746
|
+
return {
|
|
747
|
+
currentIndex
|
|
748
|
+
};
|
|
749
|
+
}, [currentIndex]);
|
|
750
|
+
return /* @__PURE__ */ jsxs(ZIndexContext.Provider, {
|
|
751
|
+
value,
|
|
752
|
+
children: [
|
|
753
|
+
disabled ? null : /* @__PURE__ */ jsx4(EscapeHook, {
|
|
754
|
+
onEscape
|
|
755
|
+
}),
|
|
756
|
+
/* @__PURE__ */ jsx4("div", {
|
|
757
|
+
ref: containerRef,
|
|
758
|
+
style: margin,
|
|
759
|
+
children
|
|
760
|
+
})
|
|
761
|
+
]
|
|
762
|
+
});
|
|
763
|
+
};
|
|
764
|
+
var useZIndex = () => {
|
|
765
|
+
const context = useContext2(ZIndexContext);
|
|
766
|
+
const highestContext = useContext2(HighestZIndexContext);
|
|
767
|
+
const isHighestContext = highestContext.highestIndex === context.currentIndex;
|
|
768
|
+
return useMemo5(() => ({
|
|
769
|
+
currentZIndex: context.currentIndex,
|
|
770
|
+
highestZIndex: highestContext.highestIndex,
|
|
771
|
+
isHighestContext,
|
|
772
|
+
tabIndex: isHighestContext ? 0 : -1
|
|
773
|
+
}), [context.currentIndex, highestContext.highestIndex, isHighestContext]);
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
// src/components/InlineAction.tsx
|
|
777
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
778
|
+
var InlineAction = ({
|
|
779
|
+
renderAction,
|
|
780
|
+
onClick,
|
|
781
|
+
disabled,
|
|
782
|
+
title,
|
|
783
|
+
hoveredColor = WHITE,
|
|
784
|
+
unhoveredColor = LIGHT_TEXT,
|
|
785
|
+
variant,
|
|
786
|
+
style: customStyle,
|
|
787
|
+
className,
|
|
788
|
+
onPointerDown: onPointerDownProp,
|
|
789
|
+
...buttonProps
|
|
790
|
+
}) => {
|
|
791
|
+
const { tabIndex } = useZIndex();
|
|
792
|
+
const onPointerDown = useCallback4((event) => {
|
|
793
|
+
onPointerDownProp?.(event);
|
|
794
|
+
if (event.button !== 0) {
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
798
|
+
document.activeElement.blur();
|
|
799
|
+
}
|
|
800
|
+
event.preventDefault();
|
|
801
|
+
}, [onPointerDownProp]);
|
|
802
|
+
const style = useMemo6(() => {
|
|
803
|
+
return {
|
|
804
|
+
border: "none",
|
|
805
|
+
height: 24,
|
|
806
|
+
width: variant === "compact" ? 14 : 24,
|
|
807
|
+
padding: 0,
|
|
808
|
+
display: "inline-flex",
|
|
809
|
+
justifyContent: "center",
|
|
810
|
+
alignItems: "center",
|
|
811
|
+
borderRadius: 3,
|
|
812
|
+
opacity: disabled ? 0.5 : 1,
|
|
813
|
+
pointerEvents: disabled ? "none" : "auto",
|
|
814
|
+
...hoverableStyle({
|
|
815
|
+
idleBackground: TRANSPARENT,
|
|
816
|
+
hoverBackground: disabled ? TRANSPARENT : getBackgroundFromHoverState({ hovered: true, selected: false }),
|
|
817
|
+
idleColor: unhoveredColor,
|
|
818
|
+
hoverColor: disabled ? unhoveredColor : hoveredColor
|
|
819
|
+
}),
|
|
820
|
+
...customStyle
|
|
821
|
+
};
|
|
822
|
+
}, [customStyle, disabled, hoveredColor, unhoveredColor, variant]);
|
|
823
|
+
return /* @__PURE__ */ jsx5("button", {
|
|
824
|
+
...buttonProps,
|
|
825
|
+
type: "button",
|
|
826
|
+
className: className ? `${HOVERABLE_CLASS_NAME} ${className}` : HOVERABLE_CLASS_NAME,
|
|
827
|
+
disabled,
|
|
828
|
+
onClick,
|
|
829
|
+
onPointerDown,
|
|
830
|
+
style,
|
|
831
|
+
tabIndex,
|
|
832
|
+
title,
|
|
833
|
+
"aria-label": buttonProps["aria-label"] ?? title,
|
|
834
|
+
children: renderAction(CURRENT_COLOR)
|
|
835
|
+
});
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
// src/components/Menu/is-menu-item.tsx
|
|
839
|
+
var MENU_INITIATOR_CLASSNAME = "__remotion-studio-menu-initiator";
|
|
840
|
+
var MENU_ITEM_CLASSNAME = "__remotion-studio-menu-item";
|
|
841
|
+
var HORIZONTAL_SCROLLBAR_CLASSNAME = "__remotion-horizontal-scrollbar";
|
|
842
|
+
var VERTICAL_SCROLLBAR_CLASSNAME = "__remotion-vertical-scrollbar";
|
|
843
|
+
var isMenuItem = (el) => {
|
|
844
|
+
return Boolean(el.classList.contains(MENU_ITEM_CLASSNAME) || el.closest(`.${MENU_ITEM_CLASSNAME}`) || el.classList.contains(MENU_INITIATOR_CLASSNAME) || el.closest(`.${MENU_INITIATOR_CLASSNAME}`));
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
// src/components/NewComposition/ValidationMessage.tsx
|
|
848
|
+
import { useMemo as useMemo7 } from "react";
|
|
849
|
+
import { jsx as jsx6, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
850
|
+
var WarningTriangle = (props) => {
|
|
851
|
+
return /* @__PURE__ */ jsx6("svg", {
|
|
852
|
+
viewBox: "0 0 576 512",
|
|
853
|
+
...props,
|
|
854
|
+
children: /* @__PURE__ */ jsx6("path", {
|
|
855
|
+
d: "M248.747 204.705l6.588 112c.373 6.343 5.626 11.295 11.979 11.295h41.37a12 12 0 0 0 11.979-11.295l6.588-112c.405-6.893-5.075-12.705-11.979-12.705h-54.547c-6.903 0-12.383 5.812-11.978 12.705zM330 384c0 23.196-18.804 42-42 42s-42-18.804-42-42 18.804-42 42-42 42 18.804 42 42zm-.423-360.015c-18.433-31.951-64.687-32.009-83.154 0L6.477 440.013C-11.945 471.946 11.118 512 48.054 512H527.94c36.865 0 60.035-39.993 41.577-71.987L329.577 23.985zM53.191 455.002L282.803 57.008c2.309-4.002 8.085-4.002 10.394 0l229.612 397.993c2.308 4-.579 8.998-5.197 8.998H58.388c-4.617.001-7.504-4.997-5.197-8.997z"
|
|
856
|
+
})
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
var style = {
|
|
860
|
+
width: 12,
|
|
861
|
+
height: 12,
|
|
862
|
+
flexShrink: 0
|
|
863
|
+
};
|
|
864
|
+
var compactStyle = {
|
|
865
|
+
...style,
|
|
866
|
+
width: 10,
|
|
867
|
+
height: 10
|
|
868
|
+
};
|
|
869
|
+
var container = {
|
|
870
|
+
width: "100%",
|
|
871
|
+
maxWidth: 500,
|
|
872
|
+
minWidth: 0
|
|
873
|
+
};
|
|
874
|
+
var row = {
|
|
875
|
+
minWidth: 0
|
|
876
|
+
};
|
|
877
|
+
var label = {
|
|
878
|
+
fontSize: 13,
|
|
879
|
+
color: WHITE,
|
|
880
|
+
fontFamily: "sans-serif",
|
|
881
|
+
minWidth: 0,
|
|
882
|
+
whiteSpace: "normal",
|
|
883
|
+
overflowWrap: "anywhere"
|
|
884
|
+
};
|
|
885
|
+
var compactLabel = {
|
|
886
|
+
...label,
|
|
887
|
+
fontSize: 12
|
|
888
|
+
};
|
|
889
|
+
var ValidationMessage = ({ message, align, type, action, size = "default" }) => {
|
|
890
|
+
const iconStyle = size === "compact" ? compactStyle : style;
|
|
891
|
+
const labelStyle = size === "compact" ? compactLabel : label;
|
|
892
|
+
const finalStyle = useMemo7(() => {
|
|
893
|
+
return {
|
|
894
|
+
...iconStyle,
|
|
895
|
+
fill: type === "warning" ? WARNING_COLOR : FAIL_COLOR
|
|
896
|
+
};
|
|
897
|
+
}, [iconStyle, type]);
|
|
898
|
+
return /* @__PURE__ */ jsx6("div", {
|
|
899
|
+
style: container,
|
|
900
|
+
children: /* @__PURE__ */ jsxs2(Row, {
|
|
901
|
+
align: "center",
|
|
902
|
+
justify: align,
|
|
903
|
+
style: row,
|
|
904
|
+
children: [
|
|
905
|
+
/* @__PURE__ */ jsx6(WarningTriangle, {
|
|
906
|
+
style: finalStyle
|
|
907
|
+
}),
|
|
908
|
+
/* @__PURE__ */ jsx6(Spacing, {
|
|
909
|
+
x: size === "compact" ? 0.75 : 1
|
|
910
|
+
}),
|
|
911
|
+
/* @__PURE__ */ jsx6("div", {
|
|
912
|
+
style: labelStyle,
|
|
913
|
+
children: message
|
|
914
|
+
}),
|
|
915
|
+
action ? /* @__PURE__ */ jsxs2(Fragment, {
|
|
916
|
+
children: [
|
|
917
|
+
/* @__PURE__ */ jsx6(Spacing, {
|
|
918
|
+
x: size === "compact" ? 0.75 : 1
|
|
919
|
+
}),
|
|
920
|
+
action
|
|
921
|
+
]
|
|
922
|
+
}) : null
|
|
923
|
+
]
|
|
924
|
+
})
|
|
925
|
+
});
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
// src/components/ModalContainer.tsx
|
|
929
|
+
import { useCallback as useCallback5 } from "react";
|
|
930
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
931
|
+
var padding = 20;
|
|
932
|
+
var getMaxModalWidth = (width) => {
|
|
933
|
+
return `min(calc(100vw - ${padding * 2}px), calc(${width}px - ${padding * 2}px))`;
|
|
934
|
+
};
|
|
935
|
+
var getMaxModalHeight = (height) => {
|
|
936
|
+
return `min(calc(100vh - ${padding * 2}px), calc(${height}px - ${padding * 2}px))`;
|
|
937
|
+
};
|
|
938
|
+
var backgroundOverlay = {
|
|
939
|
+
backgroundColor: WHITE_ALPHA_20,
|
|
940
|
+
backdropFilter: `blur(1px)`,
|
|
941
|
+
position: "fixed",
|
|
942
|
+
height: "100%",
|
|
943
|
+
width: "100%",
|
|
944
|
+
display: "flex",
|
|
945
|
+
padding
|
|
946
|
+
};
|
|
947
|
+
var panel = {
|
|
948
|
+
backgroundColor: BACKGROUND,
|
|
949
|
+
boxShadow: SHADOW_BLACK,
|
|
950
|
+
color: WHITE,
|
|
951
|
+
margin: "auto"
|
|
952
|
+
};
|
|
953
|
+
var ModalContainer = ({
|
|
954
|
+
ariaLabel,
|
|
955
|
+
ariaLabelledBy,
|
|
956
|
+
children,
|
|
957
|
+
onEscape,
|
|
958
|
+
onOutsideClick,
|
|
959
|
+
noZIndex,
|
|
960
|
+
panelStyle
|
|
961
|
+
}) => {
|
|
962
|
+
const onPointerDown = useCallback5((e) => {
|
|
963
|
+
e.stopPropagation();
|
|
964
|
+
}, []);
|
|
965
|
+
return /* @__PURE__ */ jsx7("div", {
|
|
966
|
+
"aria-label": ariaLabel,
|
|
967
|
+
"aria-labelledby": ariaLabelledBy ?? undefined,
|
|
968
|
+
"aria-modal": "true",
|
|
969
|
+
className: "css-reset",
|
|
970
|
+
role: "dialog",
|
|
971
|
+
style: backgroundOverlay,
|
|
972
|
+
onPointerDown,
|
|
973
|
+
children: /* @__PURE__ */ jsx7(HigherZIndex, {
|
|
974
|
+
disabled: noZIndex,
|
|
975
|
+
onOutsideClick,
|
|
976
|
+
onEscape,
|
|
977
|
+
children: /* @__PURE__ */ jsx7("div", {
|
|
978
|
+
style: { ...panel, ...panelStyle },
|
|
979
|
+
children
|
|
980
|
+
})
|
|
981
|
+
})
|
|
982
|
+
});
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
// src/components/RenderModal/render-modals.ts
|
|
986
|
+
var outerModalStyle = {
|
|
987
|
+
width: getMaxModalWidth(800),
|
|
988
|
+
height: getMaxModalHeight(490),
|
|
989
|
+
overflow: "hidden",
|
|
990
|
+
display: "flex",
|
|
991
|
+
flexDirection: "column"
|
|
992
|
+
};
|
|
993
|
+
var container2 = {
|
|
994
|
+
display: "flex",
|
|
995
|
+
flexDirection: "row",
|
|
996
|
+
alignItems: "center",
|
|
997
|
+
padding: "12px 16px",
|
|
998
|
+
borderBottom: BORDER_BLACK
|
|
999
|
+
};
|
|
1000
|
+
var optionsPanel = {
|
|
1001
|
+
display: "flex",
|
|
1002
|
+
flex: 1,
|
|
1003
|
+
minHeight: 0,
|
|
1004
|
+
minWidth: 0,
|
|
1005
|
+
overflowY: "auto"
|
|
1006
|
+
};
|
|
1007
|
+
var horizontalLayout = {
|
|
1008
|
+
display: "flex",
|
|
1009
|
+
flexDirection: "row",
|
|
1010
|
+
flex: 1,
|
|
1011
|
+
minHeight: 0,
|
|
1012
|
+
overflow: "hidden"
|
|
1013
|
+
};
|
|
1014
|
+
var leftSidebar = {
|
|
1015
|
+
flexShrink: 0,
|
|
1016
|
+
padding: 6
|
|
1017
|
+
};
|
|
1018
|
+
var horizontalTab = {
|
|
1019
|
+
width: 150,
|
|
1020
|
+
display: "flex",
|
|
1021
|
+
flexDirection: "row",
|
|
1022
|
+
alignItems: "center",
|
|
1023
|
+
textAlign: "left",
|
|
1024
|
+
fontSize: 14,
|
|
1025
|
+
fontWeight: "normal",
|
|
1026
|
+
paddingLeft: 8,
|
|
1027
|
+
paddingTop: 6,
|
|
1028
|
+
paddingBottom: 6,
|
|
1029
|
+
borderRadius: 4
|
|
1030
|
+
};
|
|
1031
|
+
var iconContainer = {
|
|
1032
|
+
width: 18,
|
|
1033
|
+
height: 18,
|
|
1034
|
+
marginRight: 8,
|
|
1035
|
+
color: "inherit",
|
|
1036
|
+
display: "inline-flex",
|
|
1037
|
+
justifyContent: "center",
|
|
1038
|
+
alignItems: "center"
|
|
1039
|
+
};
|
|
1040
|
+
var icon = {
|
|
1041
|
+
color: "inherit",
|
|
1042
|
+
height: 18
|
|
1043
|
+
};
|
|
1044
|
+
var buttonStyle = {
|
|
1045
|
+
backgroundColor: BLUE,
|
|
1046
|
+
color: WHITE
|
|
1047
|
+
};
|
|
1048
|
+
var flexer = {
|
|
1049
|
+
flex: 1
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
// src/components/Spinner.tsx
|
|
1053
|
+
import { useMemo as useMemo8 } from "react";
|
|
1054
|
+
import { jsx as jsx8, jsxs as jsxs3, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
1055
|
+
var viewBox = 100;
|
|
1056
|
+
var lines = 8;
|
|
1057
|
+
var className = "__remotion_spinner_line";
|
|
1058
|
+
var remotionSpinnerAnimation = "__remotion_spinner_animation";
|
|
1059
|
+
var translated = "M 44 0 L 50 0 a 6 6 0 0 1 6 6 L 56 26 a 6 6 0 0 1 -6 6 L 50 32 a 6 6 0 0 1 -6 -6 L 44 6 a 6 6 0 0 1 6 -6 Z";
|
|
1060
|
+
var Spinner = ({ size, duration, color = LIGHT_TEXT }) => {
|
|
1061
|
+
const style2 = useMemo8(() => {
|
|
1062
|
+
return {
|
|
1063
|
+
width: size,
|
|
1064
|
+
height: size
|
|
1065
|
+
};
|
|
1066
|
+
}, [size]);
|
|
1067
|
+
return /* @__PURE__ */ jsxs3(Fragment2, {
|
|
1068
|
+
children: [
|
|
1069
|
+
/* @__PURE__ */ jsx8("style", {
|
|
1070
|
+
type: "text/css",
|
|
1071
|
+
children: `
|
|
1072
|
+
@keyframes ${remotionSpinnerAnimation} {
|
|
1073
|
+
0% {
|
|
1074
|
+
opacity: 1;
|
|
1075
|
+
}
|
|
1076
|
+
100% {
|
|
1077
|
+
opacity: 0.15;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
.${className} {
|
|
1082
|
+
animation: ${remotionSpinnerAnimation} ${duration}s linear infinite;
|
|
1083
|
+
}
|
|
1084
|
+
`
|
|
1085
|
+
}),
|
|
1086
|
+
/* @__PURE__ */ jsx8("svg", {
|
|
1087
|
+
style: style2,
|
|
1088
|
+
viewBox: `0 0 ${viewBox} ${viewBox}`,
|
|
1089
|
+
children: new Array(lines).fill(true).map((_, index) => {
|
|
1090
|
+
return /* @__PURE__ */ jsx8("path", {
|
|
1091
|
+
className,
|
|
1092
|
+
style: {
|
|
1093
|
+
rotate: `${index * Math.PI * 2 / lines}rad`,
|
|
1094
|
+
transformOrigin: "center center",
|
|
1095
|
+
animationDelay: `${index * (duration / lines) - duration}s`
|
|
1096
|
+
},
|
|
1097
|
+
d: translated,
|
|
1098
|
+
fill: color
|
|
1099
|
+
}, index);
|
|
1100
|
+
})
|
|
1101
|
+
})
|
|
1102
|
+
]
|
|
1103
|
+
});
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
// src/icons/trash.tsx
|
|
1107
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1108
|
+
var TrashIcon = ({ color, ...props }) => {
|
|
1109
|
+
return /* @__PURE__ */ jsx9("svg", {
|
|
1110
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1111
|
+
viewBox: "0 0 448 512",
|
|
1112
|
+
...props,
|
|
1113
|
+
children: /* @__PURE__ */ jsx9("path", {
|
|
1114
|
+
fill: color,
|
|
1115
|
+
d: "M160.5 27.4C162.5 20.6 168.8 16 175.8 16h96.4c7.1 0 13.3 4.6 15.3 11.4l11 36.6h-149l11-36.6zM116.1 64H16C7.2 64 0 71.2 0 80s7.2 16 16 16h416c8.8 0 16-7.2 16-16s-7.2-16-16-16H331.9l-13.7-45.8C312.1-2.1 293.4-16 272.2-16h-96.4c-21.2 0-39.9 13.9-46 34.2L116.1 64zM28.7 144l22.9 308.7c2.5 33.4 30.3 59.3 63.8 59.3h217.1c33.5 0 61.3-25.9 63.8-59.3L419.2 144h-32.1l-22.7 306.4c-1.2 16.7-15.2 29.6-31.9 29.6H115.4c-16.8 0-30.7-12.9-31.9-29.6L60.8 144H28.7z"
|
|
1116
|
+
})
|
|
1117
|
+
});
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
// src/icons/cloud-download.tsx
|
|
1121
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1122
|
+
var CloudDownloadIcon = ({ color, ...props }) => {
|
|
1123
|
+
return /* @__PURE__ */ jsx10("svg", {
|
|
1124
|
+
...props,
|
|
1125
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1126
|
+
viewBox: "0 0 576 512",
|
|
1127
|
+
children: /* @__PURE__ */ jsx10("path", {
|
|
1128
|
+
fill: color,
|
|
1129
|
+
d: "M128 176c0-61.9 50.1-112 112-112 39.3 0 73.8 20.2 93.8 50.8 4.4 6.7 13.1 9.1 20.3 5.7 11.4-5.5 24.3-8.5 37.9-8.5 48.6 0 88 39.4 88 88 0 14.1-3.3 27.4-9.2 39.2-2 4.1-2.2 8.9-.5 13.1s5.2 7.6 9.5 9.1c37.4 13.1 64.2 48.8 64.2 90.6 0 53-43 96-96 96l-304 0c-61.9 0-112-50.1-112-112 0-53.7 37.8-98.6 88.2-109.5 4.3-.9 8.1-3.6 10.3-7.4s2.9-8.3 1.7-12.6c-2.7-9.7-4.2-19.9-4.2-30.5zM240 32c-79.5 0-144 64.5-144 144 0 8 .7 15.9 1.9 23.5-56.9 19.2-97.9 73-97.9 136.5 0 79.5 64.5 144 144 144l304 0c70.7 0 128-57.3 128-128 0-49.9-28.5-93-70.1-114.2 3.9-11.9 6.1-24.6 6.1-37.8 0-66.3-53.7-120-120-120-13.7 0-26.9 2.3-39.2 6.5-26.4-33.2-67.1-54.5-112.8-54.5zM371.3 307.3c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L304 329.4 304 208c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 121.4-44.7-44.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l72 72c6.2 6.2 16.4 6.2 22.6 0l72-72z"
|
|
1130
|
+
})
|
|
1131
|
+
});
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
// src/icons/check-circle-filled.tsx
|
|
1135
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1136
|
+
var CheckCircleFilled = (props) => /* @__PURE__ */ jsx11("svg", {
|
|
1137
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1138
|
+
style: { width: 14, height: 14 },
|
|
1139
|
+
viewBox: "0 0 512 512",
|
|
1140
|
+
...props,
|
|
1141
|
+
children: /* @__PURE__ */ jsx11("path", {
|
|
1142
|
+
d: "M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zM374 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8L379.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z"
|
|
1143
|
+
})
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
export { startCapturedPointerSession, startDeferredCapturedPointerSession, isMac, defaultKeyboardShortcuts, keyboardShortcutGroups, askAIKeyboardShortcutGroup, getKeyboardShortcutsForAction, keyboardShortcutsOverlap, formatKeyboardShortcut, getKeyboardShortcutLabel, getKeyboardShortcutAriaKeyShortcuts, shortcutFromKeyboardEvent, KeybindingContextProvider, areKeyboardShortcutsDisabled, useKeybinding, HighestZIndexProvider, getClickLock, setClickLock, HigherZIndex, useZIndex, getMaxModalWidth, getMaxModalHeight, ModalContainer, SPACING_UNIT, COMPACT_CONTROL_ROW_HEIGHT, COMPACT_INLINE_ROW_HEIGHT, Spacing, Flex, Row, Column, HOVERABLE_CLASS_NAME, HOVER_GROUP_CLASS_NAME, HOVER_GROUP_REVEAL_CLASS_NAME, FOCUS_VISIBLE_ONLY_CLASS_NAME, NO_HOVER_BACKGROUND_STYLE, hoverableStyle, makeHoverableCSS, InlineAction, MENU_INITIATOR_CLASSNAME, MENU_ITEM_CLASSNAME, HORIZONTAL_SCROLLBAR_CLASSNAME, VERTICAL_SCROLLBAR_CLASSNAME, isMenuItem, Spinner, TrashIcon, WarningTriangle, ValidationMessage, CloudDownloadIcon, outerModalStyle, container2 as container, optionsPanel, horizontalLayout, leftSidebar, horizontalTab, iconContainer, icon, buttonStyle, flexer, CheckCircleFilled };
|