@remotion/studio 4.0.485 → 4.0.487
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/ResolveCompositionConfigInStudio.js +42 -0
- package/dist/components/AssetSelector.js +1 -1
- package/dist/components/AssetSelectorItem.js +9 -9
- package/dist/components/AudioWaveform.js +3 -3
- package/dist/components/Button.js +2 -2
- package/dist/components/Canvas.js +28 -0
- package/dist/components/CanvasOrLoading.js +1 -1
- package/dist/components/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ColorPicker/AlphaSlider.js +4 -3
- package/dist/components/ColorPicker/ColorPicker.js +4 -4
- package/dist/components/ColorPicker/ColorPickerPopup.js +10 -10
- package/dist/components/ColorPicker/HueSlider.js +4 -3
- package/dist/components/ColorPicker/SaturationValueArea.js +5 -4
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/ColorPicker/checker.js +3 -3
- package/dist/components/CompactExplanation.js +3 -3
- package/dist/components/CompositionSelector.js +141 -5
- package/dist/components/CompositionSelectorItem.d.ts +1 -0
- package/dist/components/CompositionSelectorItem.js +103 -11
- package/dist/components/ContextMenu.js +2 -1
- package/dist/components/CopyButton.js +3 -2
- package/dist/components/CurrentAsset.d.ts +3 -1
- package/dist/components/CurrentAsset.js +15 -2
- package/dist/components/CurrentComposition.js +43 -2
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/EffectPickerModal.js +1 -1
- package/dist/components/FilePreview.js +2 -1
- package/dist/components/FpsCounter.js +3 -2
- package/dist/components/FullscreenToggle.js +2 -1
- package/dist/components/GlobalKeybindings.js +19 -12
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineEditableTitle.d.ts +1 -0
- package/dist/components/InlineEditableTitle.js +12 -7
- package/dist/components/InspectorInfoHeader.js +2 -2
- package/dist/components/InspectorPanel/DefaultInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/DefaultInspector.js +2 -2
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/common.js +2 -2
- package/dist/components/InspectorPanel/styles.js +3 -3
- package/dist/components/InspectorPanel.d.ts +1 -0
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.js +1 -1
- package/dist/components/InspectorSourceLocation.d.ts +1 -0
- package/dist/components/InspectorSourceLocation.js +18 -3
- package/dist/components/InstallablePackage.js +1 -1
- package/dist/components/KeyboardShortcutsExplainer.js +9 -5
- package/dist/components/LoopToggle.js +1 -1
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuSubItem.js +1 -1
- package/dist/components/Menu/styles.js +3 -3
- package/dist/components/MenuToolbar.js +2 -2
- package/dist/components/ModalButton.js +1 -1
- package/dist/components/ModalContainer.js +3 -3
- package/dist/components/ModalFooter.js +2 -1
- package/dist/components/ModalHeader.js +3 -2
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CancelButton.js +4 -3
- package/dist/components/NewComposition/ComboBox.js +3 -3
- package/dist/components/NewComposition/InputDragger.js +11 -3
- package/dist/components/NewComposition/MenuContent.js +1 -1
- package/dist/components/NewComposition/NewComposition.js +4 -1
- package/dist/components/NewComposition/NewFolder.d.ts +5 -0
- package/dist/components/NewComposition/NewFolder.js +86 -0
- package/dist/components/NewComposition/RemInput.js +3 -3
- package/dist/components/NewComposition/RemTextarea.js +1 -1
- package/dist/components/NewComposition/RenameStaticFile.js +20 -59
- package/dist/components/NewComposition/ValidationMessage.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.d.ts +18 -0
- package/dist/components/NewComposition/use-rename-static-file.js +90 -0
- package/dist/components/NoRegisterRoot.js +3 -2
- package/dist/components/Notifications/ColorDot.js +3 -2
- package/dist/components/Notifications/Notification.js +4 -4
- package/dist/components/Notifications/NotificationCenter.js +2 -1
- package/dist/components/Notifications/ServerDisconnected.js +5 -4
- package/dist/components/OptionsPanel.js +1 -1
- package/dist/components/OutlineToggle.js +1 -1
- package/dist/components/PlayPause.js +4 -3
- package/dist/components/Preview.js +1 -1
- package/dist/components/PreviewToolbar.js +3 -2
- package/dist/components/QuickSwitcher/AlgoliaCredit.js +2 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +2 -2
- package/dist/components/RefreshCompositionOverlay.js +2 -1
- package/dist/components/RenderButton.js +10 -9
- package/dist/components/RenderModal/CliCopyButton.js +1 -1
- package/dist/components/RenderModal/ClientRenderProgress.js +1 -1
- package/dist/components/RenderModal/DataEditor.js +1 -1
- package/dist/components/RenderModal/GuiRenderStatus.js +1 -1
- package/dist/components/RenderModal/InfoBubble.js +2 -2
- package/dist/components/RenderModal/InfoTooltip.js +3 -3
- package/dist/components/RenderModal/InlineEyeIcon.js +2 -1
- package/dist/components/RenderModal/InlineRemoveButton.js +2 -1
- package/dist/components/RenderModal/MultiRangeSlider.js +1 -1
- package/dist/components/RenderModal/OptionExplainer.d.ts +11 -1
- package/dist/components/RenderModal/OptionExplainer.js +33 -13
- package/dist/components/RenderModal/OptionExplainerBubble.d.ts +15 -1
- package/dist/components/RenderModal/OptionExplainerBubble.js +17 -3
- package/dist/components/RenderModal/RenderModalHr.js +2 -1
- package/dist/components/RenderModal/RenderStatusModal.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +6 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +1 -2
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaVerticalGuide.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +2 -1
- package/dist/components/RenderModal/ServerRenderModal.js +1 -1
- package/dist/components/RenderModal/WarningIndicatorButton.js +4 -6
- package/dist/components/RenderModal/WebRenderModal.js +5 -2
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +3 -0
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +92 -5
- package/dist/components/RenderModal/WebRenderModalAudio.js +4 -3
- package/dist/components/RenderModal/WebRenderModalBasic.js +2 -2
- package/dist/components/RenderModal/WebRenderModalLicense.js +2 -2
- package/dist/components/RenderModal/WebRenderModalPicture.js +2 -1
- package/dist/components/RenderModal/render-modals.js +3 -3
- package/dist/components/RenderPreview.js +1 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +1 -0
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/components/RenderQueue/client-side-render-types.d.ts +2 -1
- package/dist/components/RenderQueue/index.js +1 -1
- package/dist/components/RendersTab.js +2 -2
- package/dist/components/SegmentedControl.js +3 -3
- package/dist/components/SelectedOutlineElement.d.ts +9 -0
- package/dist/components/SelectedOutlineElement.js +63 -18
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -0
- package/dist/components/SelectedOutlineOverlay.js +53 -2
- package/dist/components/SelectedOutlineUvControls.js +18 -11
- package/dist/components/SidebarCollapserControls.js +5 -4
- package/dist/components/SnappingProvider.d.ts +4 -0
- package/dist/components/SnappingProvider.js +24 -0
- package/dist/components/SnappingToggle.d.ts +2 -0
- package/dist/components/SnappingToggle.js +26 -0
- package/dist/components/Splitter/SplitterContext.d.ts +1 -1
- package/dist/components/Splitter/SplitterElement.js +2 -1
- package/dist/components/StaticFilePreview.js +1 -1
- package/dist/components/Tabs/index.js +3 -3
- package/dist/components/Tabs/vertical.js +3 -3
- package/dist/components/TextViewer.js +2 -1
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/EasingEditorModal.js +8 -8
- package/dist/components/Timeline/KeyframeSettingsModal.js +1 -1
- package/dist/components/Timeline/LoopedIndicator.js +2 -2
- package/dist/components/Timeline/MaxTimelineTracks.js +3 -2
- package/dist/components/Timeline/TimelineArrayField.js +6 -5
- package/dist/components/Timeline/TimelineColorField.js +2 -1
- package/dist/components/Timeline/TimelineEffectItem.js +3 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +2 -2
- package/dist/components/Timeline/TimelineExpandArrowButton.js +3 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +2 -1
- package/dist/components/Timeline/TimelineFontFamilyField.d.ts +11 -0
- package/dist/components/Timeline/TimelineFontFamilyField.js +545 -0
- package/dist/components/Timeline/TimelineImageInfo.js +2 -1
- package/dist/components/Timeline/TimelineInOutPointer.js +2 -1
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -4
- package/dist/components/Timeline/TimelineKeyframeControls.js +2 -2
- package/dist/components/Timeline/TimelineKeyframeDiamondIcon.js +1 -1
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +1 -1
- package/dist/components/Timeline/TimelineLayerEye.js +3 -3
- package/dist/components/Timeline/TimelineMediaInfo.js +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineRotationField.js +4 -3
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineSchemaField.d.ts +2 -0
- package/dist/components/Timeline/TimelineSchemaField.js +47 -7
- package/dist/components/Timeline/TimelineScrollable.js +3 -2
- package/dist/components/Timeline/TimelineSelection.js +11 -6
- package/dist/components/Timeline/TimelineSequence.js +17 -20
- package/dist/components/Timeline/TimelineSequenceFrame.js +3 -2
- package/dist/components/Timeline/TimelineSequenceItem.js +8 -7
- package/dist/components/Timeline/TimelineSequenceName.js +3 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +2 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +20 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +128 -11
- package/dist/components/Timeline/TimelineSlider.js +2 -1
- package/dist/components/Timeline/TimelineSliderHandle.js +2 -1
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +2 -1
- package/dist/components/Timeline/TimelineZoomControls.js +4 -3
- package/dist/components/Timeline/call-move-keyframe.d.ts +5 -0
- package/dist/components/Timeline/call-move-keyframe.js +14 -3
- package/dist/components/Timeline/google-fonts-list.d.ts +6 -0
- package/dist/components/Timeline/google-fonts-list.js +1512 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +8 -1
- package/dist/components/Timeline/save-sequence-prop.js +63 -19
- package/dist/components/Timeline/timeline-rotation-field-utils.d.ts +5 -0
- package/dist/components/Timeline/timeline-rotation-field-utils.js +16 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +5 -2
- package/dist/components/TimelineInOutToggle.js +1 -1
- package/dist/components/UpdateCheck.js +2 -2
- package/dist/components/UpdateModal/OpenIssueButton.js +1 -1
- package/dist/components/VisualControls/ClickableFileName.js +4 -4
- package/dist/components/VisualControls/VisualControlsContent.js +9 -1
- package/dist/components/effect-drag-and-drop.js +30 -8
- package/dist/components/import-assets.d.ts +8 -2
- package/dist/components/import-assets.js +55 -1
- package/dist/components/options-sidebar-tabs.d.ts +1 -0
- package/dist/components/options-sidebar-tabs.js +6 -1
- package/dist/components/selected-outline-measurement.js +2 -1
- package/dist/components/selected-outline-snap.d.ts +36 -0
- package/dist/components/selected-outline-snap.js +158 -0
- package/dist/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.js +2 -2
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +7 -5
- package/dist/error-overlay/remotion-overlay/CompositionIdListItem.js +2 -2
- package/dist/error-overlay/remotion-overlay/DismissButton.js +3 -2
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +3 -2
- package/dist/error-overlay/remotion-overlay/ErrorMessage.js +4 -4
- package/dist/error-overlay/remotion-overlay/HelpLink.js +1 -1
- package/dist/error-overlay/remotion-overlay/MediaPlaybackErrorExplainer.js +4 -4
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +4 -3
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +2 -1
- package/dist/error-overlay/remotion-overlay/carets.js +3 -2
- package/dist/esm/chunk-jefhcs5z.js +164 -0
- package/dist/esm/{chunk-103pp4n7.js → chunk-y2t24cx0.js} +10754 -6829
- package/dist/esm/internals.mjs +10755 -6796
- package/dist/esm/previewEntry.mjs +10554 -6591
- package/dist/esm/renderEntry.mjs +8 -5
- package/dist/helpers/checkerboard-background.js +4 -12
- package/dist/helpers/colors.d.ts +99 -7
- package/dist/helpers/colors.js +118 -10
- package/dist/helpers/inject-css.js +85 -83
- package/dist/helpers/retry-payload.js +1 -0
- package/dist/helpers/timeline-layout.d.ts +4 -2
- package/dist/helpers/use-menu-structure.js +74 -5
- package/dist/helpers/validate-folder-rename.js +2 -10
- package/dist/helpers/validate-new-folder-name.d.ts +5 -0
- package/dist/helpers/validate-new-folder-name.js +16 -0
- package/dist/hot-middleware-client/client.js +3 -2
- package/dist/icons/Checkmark.js +2 -1
- package/dist/icons/audio.js +2 -1
- package/dist/icons/caret.js +2 -2
- package/dist/icons/certificate.js +2 -1
- package/dist/icons/data.js +2 -1
- package/dist/icons/eyedropper.js +2 -1
- package/dist/icons/file.js +2 -1
- package/dist/icons/frame.js +2 -1
- package/dist/icons/gear.js +2 -1
- package/dist/icons/gif.js +2 -1
- package/dist/icons/jump-to-start.js +2 -1
- package/dist/icons/keys.js +4 -3
- package/dist/icons/magnet.d.ts +3 -0
- package/dist/icons/magnet.js +8 -0
- package/dist/icons/media-volume.js +1 -1
- package/dist/icons/minus.js +2 -1
- package/dist/icons/pause.js +2 -1
- package/dist/icons/play.js +2 -1
- package/dist/icons/react.d.ts +5 -0
- package/dist/icons/react.js +8 -0
- package/dist/icons/redo.js +2 -1
- package/dist/icons/step-back.js +2 -1
- package/dist/icons/step-forward.js +2 -1
- package/dist/icons/undo.js +2 -1
- package/dist/previewEntry.js +2 -1
- package/dist/renderEntry.js +4 -3
- package/dist/state/editor-guides.d.ts +2 -2
- package/dist/state/editor-snapping.d.ts +8 -0
- package/dist/state/editor-snapping.js +18 -0
- package/dist/state/modals.d.ts +6 -1
- package/package.json +12 -12
- package/dist/esm/chunk-6jf1natv.js +0 -25
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TimelineFontFamilyField = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const player_1 = require("@remotion/player");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
|
+
const colors_1 = require("../../helpers/colors");
|
|
12
|
+
const install_required_package_1 = require("../../helpers/install-required-package");
|
|
13
|
+
const caret_1 = require("../../icons/caret");
|
|
14
|
+
const Checkmark_1 = require("../../icons/Checkmark");
|
|
15
|
+
const z_index_1 = require("../../state/z-index");
|
|
16
|
+
const layout_1 = require("../layout");
|
|
17
|
+
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
18
|
+
const portals_1 = require("../Menu/portals");
|
|
19
|
+
const styles_1 = require("../Menu/styles");
|
|
20
|
+
const google_fonts_list_1 = require("./google-fonts-list");
|
|
21
|
+
const ROW_HEIGHT = 30;
|
|
22
|
+
const LIST_HEIGHT = 280;
|
|
23
|
+
const OVERSCAN = 10;
|
|
24
|
+
const POPOVER_WIDTH = 280;
|
|
25
|
+
const CLEAR_HOVER = 'rgba(255, 255, 255, 0.06)';
|
|
26
|
+
const INPUT_BORDER_COLOR_UNHOVERED = 'rgba(0, 0, 0, 0.6)';
|
|
27
|
+
const INPUT_BORDER_COLOR_HOVERED = 'rgba(255, 255, 255, 0.05)';
|
|
28
|
+
const googleFonts = google_fonts_list_1.GOOGLE_FONTS_LIST.map((font) => ({
|
|
29
|
+
id: `google-${font.importName}`,
|
|
30
|
+
fontFamily: font.fontFamily,
|
|
31
|
+
label: font.fontFamily,
|
|
32
|
+
source: 'Google Fonts',
|
|
33
|
+
value: font.fontFamily,
|
|
34
|
+
googleFontImportName: font.importName,
|
|
35
|
+
googleFontCssFamily: font.previewUrl,
|
|
36
|
+
googleFontWeights: font.weights,
|
|
37
|
+
}));
|
|
38
|
+
const loadedGoogleFontsForPreview = new Set();
|
|
39
|
+
const loadingGoogleFontsForPreview = new Set();
|
|
40
|
+
const loadedGoogleFontsForPickerPreview = new Set();
|
|
41
|
+
const loadingGoogleFontsForPickerPreview = new Set();
|
|
42
|
+
const systemFonts = [
|
|
43
|
+
'Arial',
|
|
44
|
+
'Helvetica',
|
|
45
|
+
'Inter',
|
|
46
|
+
'Georgia',
|
|
47
|
+
'Times New Roman',
|
|
48
|
+
'Courier New',
|
|
49
|
+
'Verdana',
|
|
50
|
+
'Tahoma',
|
|
51
|
+
'Trebuchet MS',
|
|
52
|
+
'sans-serif',
|
|
53
|
+
'serif',
|
|
54
|
+
'monospace',
|
|
55
|
+
].map((fontFamily) => ({
|
|
56
|
+
id: `system-${fontFamily}`,
|
|
57
|
+
fontFamily,
|
|
58
|
+
label: fontFamily,
|
|
59
|
+
source: 'System',
|
|
60
|
+
value: fontFamily,
|
|
61
|
+
}));
|
|
62
|
+
const triggerStyle = {
|
|
63
|
+
marginLeft: 8,
|
|
64
|
+
padding: '3px 4px',
|
|
65
|
+
display: 'inline-flex',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
68
|
+
borderWidth: 1,
|
|
69
|
+
borderStyle: 'solid',
|
|
70
|
+
maxWidth: 140,
|
|
71
|
+
color: 'white',
|
|
72
|
+
userSelect: 'none',
|
|
73
|
+
WebkitUserSelect: 'none',
|
|
74
|
+
};
|
|
75
|
+
const triggerLabel = {
|
|
76
|
+
fontSize: 11,
|
|
77
|
+
lineHeight: 1,
|
|
78
|
+
textAlign: 'left',
|
|
79
|
+
overflow: 'hidden',
|
|
80
|
+
textOverflow: 'ellipsis',
|
|
81
|
+
whiteSpace: 'nowrap',
|
|
82
|
+
};
|
|
83
|
+
const popover = {
|
|
84
|
+
position: 'fixed',
|
|
85
|
+
width: POPOVER_WIDTH,
|
|
86
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
87
|
+
color: 'white',
|
|
88
|
+
userSelect: 'none',
|
|
89
|
+
WebkitUserSelect: 'none',
|
|
90
|
+
border: '1px solid rgba(255, 255, 255, 0.08)',
|
|
91
|
+
};
|
|
92
|
+
const searchInput = {
|
|
93
|
+
boxSizing: 'border-box',
|
|
94
|
+
width: '100%',
|
|
95
|
+
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
96
|
+
border: '1px solid rgba(255, 255, 255, 0.12)',
|
|
97
|
+
color: 'white',
|
|
98
|
+
fontSize: 12,
|
|
99
|
+
outline: 'none',
|
|
100
|
+
padding: '6px 8px',
|
|
101
|
+
};
|
|
102
|
+
const listStyle = {
|
|
103
|
+
height: LIST_HEIGHT,
|
|
104
|
+
overflowY: 'auto',
|
|
105
|
+
overflowX: 'hidden',
|
|
106
|
+
position: 'relative',
|
|
107
|
+
};
|
|
108
|
+
const noResults = {
|
|
109
|
+
fontSize: 12,
|
|
110
|
+
color: colors_1.LIGHT_TEXT,
|
|
111
|
+
padding: 12,
|
|
112
|
+
};
|
|
113
|
+
const optionButton = {
|
|
114
|
+
height: ROW_HEIGHT,
|
|
115
|
+
width: '100%',
|
|
116
|
+
border: 'none',
|
|
117
|
+
background: 'transparent',
|
|
118
|
+
color: 'white',
|
|
119
|
+
display: 'flex',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
padding: '0 8px',
|
|
122
|
+
fontSize: 12,
|
|
123
|
+
textAlign: 'left',
|
|
124
|
+
cursor: 'default',
|
|
125
|
+
};
|
|
126
|
+
const optionLabel = {
|
|
127
|
+
flex: 1,
|
|
128
|
+
overflow: 'hidden',
|
|
129
|
+
textOverflow: 'ellipsis',
|
|
130
|
+
whiteSpace: 'nowrap',
|
|
131
|
+
fontSize: 12,
|
|
132
|
+
};
|
|
133
|
+
const optionSource = {
|
|
134
|
+
color: colors_1.LIGHT_TEXT,
|
|
135
|
+
fontSize: 10,
|
|
136
|
+
marginLeft: 8,
|
|
137
|
+
};
|
|
138
|
+
const errorText = {
|
|
139
|
+
padding: '6px 8px',
|
|
140
|
+
color: '#ff8a8a',
|
|
141
|
+
fontSize: 10,
|
|
142
|
+
};
|
|
143
|
+
const portalStyle = ({ size, }) => {
|
|
144
|
+
const margin = 10;
|
|
145
|
+
const spaceToBottom = size.windowSize.height - (size.top + size.height) - margin;
|
|
146
|
+
const spaceToTop = size.top - margin;
|
|
147
|
+
const openDown = spaceToBottom >= LIST_HEIGHT || spaceToBottom >= spaceToTop;
|
|
148
|
+
const left = Math.min(Math.max(0, size.left), Math.max(0, size.windowSize.width - POPOVER_WIDTH));
|
|
149
|
+
return {
|
|
150
|
+
...popover,
|
|
151
|
+
boxShadow: openDown ? styles_1.SHADOW_TOWARDS_BOTTOM : styles_1.SHADOW_TOWARDS_TOP,
|
|
152
|
+
left,
|
|
153
|
+
...(openDown
|
|
154
|
+
? { top: size.top + size.height }
|
|
155
|
+
: { bottom: size.windowSize.height - size.top }),
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
const getCurrentValue = ({ effectiveValue, fallback, }) => {
|
|
159
|
+
return typeof effectiveValue === 'string' ? effectiveValue : fallback;
|
|
160
|
+
};
|
|
161
|
+
const scrollIndexIntoView = ({ index, list, }) => {
|
|
162
|
+
const top = index * ROW_HEIGHT;
|
|
163
|
+
const bottom = top + ROW_HEIGHT;
|
|
164
|
+
if (top < list.scrollTop) {
|
|
165
|
+
list.scrollTop = top;
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (bottom > list.scrollTop + LIST_HEIGHT) {
|
|
169
|
+
list.scrollTop = bottom - LIST_HEIGHT;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const getGoogleFontSourceEdit = ({ fontFamily, importName, weights, }) => {
|
|
173
|
+
return {
|
|
174
|
+
fontFamily,
|
|
175
|
+
importName,
|
|
176
|
+
style: 'normal',
|
|
177
|
+
weights,
|
|
178
|
+
subsets: ['latin'],
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
const makeFontPreviewName = (fontFamily) => {
|
|
182
|
+
return `${fontFamily}Preview`;
|
|
183
|
+
};
|
|
184
|
+
const loadGoogleFontForPickerPreview = async ({ fontFamily, cssFamily, document, }) => {
|
|
185
|
+
if (loadedGoogleFontsForPickerPreview.has(fontFamily) ||
|
|
186
|
+
loadingGoogleFontsForPickerPreview.has(fontFamily)) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
loadingGoogleFontsForPickerPreview.add(fontFamily);
|
|
190
|
+
try {
|
|
191
|
+
const response = await fetch(`https://fonts.googleapis.com/css?family=${cssFamily}:400&text=${encodeURIComponent(fontFamily)}`);
|
|
192
|
+
if (!response.ok) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const cssText = await response.text();
|
|
196
|
+
const match = cssText.match(/url\(([^)]+)\)/);
|
|
197
|
+
const url = match === null || match === void 0 ? void 0 : match[1];
|
|
198
|
+
if (!url) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const fontFace = new FontFace(makeFontPreviewName(fontFamily), `url(${url})`, { weight: '400' });
|
|
202
|
+
await fontFace.load();
|
|
203
|
+
document.fonts.add(fontFace);
|
|
204
|
+
loadedGoogleFontsForPickerPreview.add(fontFamily);
|
|
205
|
+
}
|
|
206
|
+
finally {
|
|
207
|
+
loadingGoogleFontsForPickerPreview.delete(fontFamily);
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const getGoogleFontUrlsFromCss = (cssText) => {
|
|
211
|
+
return [...cssText.matchAll(/url\(([^)]+)\)/g)].map((match) => match[1]);
|
|
212
|
+
};
|
|
213
|
+
const loadGoogleFontWeight = async ({ cssFamily, fontFaceFamily, weight, document, text, }) => {
|
|
214
|
+
const response = await fetch(`https://fonts.googleapis.com/css?family=${cssFamily}:${weight}${text === null ? '' : `&text=${encodeURIComponent(text)}`}`);
|
|
215
|
+
if (!response.ok) {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
const cssText = await response.text();
|
|
219
|
+
const urls = getGoogleFontUrlsFromCss(cssText);
|
|
220
|
+
if (urls.length === 0) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
await Promise.all(urls.map(async (url) => {
|
|
224
|
+
const fontFace = new FontFace(fontFaceFamily, `url(${url})`, { weight });
|
|
225
|
+
await fontFace.load();
|
|
226
|
+
document.fonts.add(fontFace);
|
|
227
|
+
}));
|
|
228
|
+
return true;
|
|
229
|
+
};
|
|
230
|
+
const commonPreviewFontWeights = ['400', '700', '800'];
|
|
231
|
+
const getGoogleFontPreviewWeights = (weights) => {
|
|
232
|
+
const commonWeights = weights.filter((weight) => commonPreviewFontWeights.includes(weight));
|
|
233
|
+
return commonWeights.length ? commonWeights : weights.slice(0, 1);
|
|
234
|
+
};
|
|
235
|
+
const loadGoogleFontForPreview = async ({ fontFamily, cssFamily, weights, document, }) => {
|
|
236
|
+
if (loadedGoogleFontsForPreview.has(fontFamily) ||
|
|
237
|
+
loadingGoogleFontsForPreview.has(fontFamily)) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
if (!google_fonts_list_1.GOOGLE_FONTS_LIST.some((font) => font.fontFamily === fontFamily)) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
loadingGoogleFontsForPreview.add(fontFamily);
|
|
244
|
+
try {
|
|
245
|
+
const loadedWeights = await Promise.all(getGoogleFontPreviewWeights(weights).map((weight) => loadGoogleFontWeight({
|
|
246
|
+
cssFamily,
|
|
247
|
+
fontFaceFamily: fontFamily,
|
|
248
|
+
weight,
|
|
249
|
+
document,
|
|
250
|
+
text: null,
|
|
251
|
+
})));
|
|
252
|
+
if (loadedWeights.some(Boolean)) {
|
|
253
|
+
loadedGoogleFontsForPreview.add(fontFamily);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
finally {
|
|
257
|
+
loadingGoogleFontsForPreview.delete(fontFamily);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
const TimelineFontFamilyField = ({ field, propStatus, effectiveValue, onSave, onDragValueChange, onDragEnd, }) => {
|
|
261
|
+
const { fieldSchema } = field;
|
|
262
|
+
if (fieldSchema.type !== 'font-family') {
|
|
263
|
+
throw new Error('TimelineFontFamilyField rendered for non-font-family field');
|
|
264
|
+
}
|
|
265
|
+
const fallback = fieldSchema.default;
|
|
266
|
+
const current = getCurrentValue({ effectiveValue, fallback });
|
|
267
|
+
const defaultOption = (0, react_1.useMemo)(() => {
|
|
268
|
+
return {
|
|
269
|
+
id: 'default',
|
|
270
|
+
fontFamily: fallback !== null && fallback !== void 0 ? fallback : null,
|
|
271
|
+
label: fallback ? `Default (${fallback})` : 'Default',
|
|
272
|
+
source: 'Default',
|
|
273
|
+
value: fallback,
|
|
274
|
+
};
|
|
275
|
+
}, [fallback]);
|
|
276
|
+
const [opened, setOpened] = (0, react_1.useState)(false);
|
|
277
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
278
|
+
const [query, setQuery] = (0, react_1.useState)('');
|
|
279
|
+
const [highlightedIndex, setHighlightedIndex] = (0, react_1.useState)(0);
|
|
280
|
+
const [scrollTop, setScrollTop] = (0, react_1.useState)(0);
|
|
281
|
+
const [loadedPickerPreviewFonts, setLoadedPickerPreviewFonts] = (0, react_1.useState)(() => new Set(loadedGoogleFontsForPickerPreview));
|
|
282
|
+
const [saveError, setSaveError] = (0, react_1.useState)(null);
|
|
283
|
+
const buttonRef = (0, react_1.useRef)(null);
|
|
284
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
285
|
+
const listRef = (0, react_1.useRef)(null);
|
|
286
|
+
const { tabIndex, currentZIndex } = (0, z_index_1.useZIndex)();
|
|
287
|
+
const size = player_1.PlayerInternals.useElementSize(buttonRef, {
|
|
288
|
+
triggerOnWindowResize: true,
|
|
289
|
+
shouldApplyCssTransforms: true,
|
|
290
|
+
});
|
|
291
|
+
const options = (0, react_1.useMemo)(() => {
|
|
292
|
+
const base = [defaultOption, ...systemFonts, ...googleFonts];
|
|
293
|
+
if (!current || base.some((option) => option.value === current)) {
|
|
294
|
+
return base;
|
|
295
|
+
}
|
|
296
|
+
return [
|
|
297
|
+
defaultOption,
|
|
298
|
+
{
|
|
299
|
+
id: `current-${current}`,
|
|
300
|
+
fontFamily: current,
|
|
301
|
+
label: current,
|
|
302
|
+
source: 'Current',
|
|
303
|
+
value: current,
|
|
304
|
+
},
|
|
305
|
+
...systemFonts,
|
|
306
|
+
...googleFonts,
|
|
307
|
+
];
|
|
308
|
+
}, [current, defaultOption]);
|
|
309
|
+
const filteredOptions = (0, react_1.useMemo)(() => {
|
|
310
|
+
const needle = query.trim().toLowerCase();
|
|
311
|
+
if (!needle) {
|
|
312
|
+
return options;
|
|
313
|
+
}
|
|
314
|
+
return options.filter((option) => {
|
|
315
|
+
return option.label.toLowerCase().includes(needle);
|
|
316
|
+
});
|
|
317
|
+
}, [options, query]);
|
|
318
|
+
const selected = (0, react_1.useMemo)(() => {
|
|
319
|
+
var _a;
|
|
320
|
+
return (_a = options.find((option) => option.value === current)) !== null && _a !== void 0 ? _a : defaultOption;
|
|
321
|
+
}, [current, defaultOption, options]);
|
|
322
|
+
const visibleRange = (0, react_1.useMemo)(() => {
|
|
323
|
+
const visibleCount = Math.ceil(LIST_HEIGHT / ROW_HEIGHT);
|
|
324
|
+
const start = Math.max(0, Math.floor(scrollTop / ROW_HEIGHT) - OVERSCAN);
|
|
325
|
+
const end = Math.min(filteredOptions.length, start + visibleCount + OVERSCAN * 2);
|
|
326
|
+
return { start, end };
|
|
327
|
+
}, [filteredOptions.length, scrollTop]);
|
|
328
|
+
const hide = (0, react_1.useCallback)(() => {
|
|
329
|
+
setOpened(false);
|
|
330
|
+
setQuery('');
|
|
331
|
+
}, []);
|
|
332
|
+
const selectOption = (0, react_1.useCallback)((option) => {
|
|
333
|
+
setSaveError(null);
|
|
334
|
+
if (option.value === propStatus.codeValue) {
|
|
335
|
+
hide();
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
onDragValueChange(option.value);
|
|
339
|
+
hide();
|
|
340
|
+
const save = async () => {
|
|
341
|
+
var _a, _b;
|
|
342
|
+
if (option.source !== 'Google Fonts' || !option.googleFontImportName) {
|
|
343
|
+
await onSave(option.value);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
await (0, install_required_package_1.installRequiredPackages)(['@remotion/google-fonts']);
|
|
347
|
+
const googleFont = getGoogleFontSourceEdit({
|
|
348
|
+
fontFamily: (_a = option.value) !== null && _a !== void 0 ? _a : option.label,
|
|
349
|
+
importName: option.googleFontImportName,
|
|
350
|
+
weights: (_b = option.googleFontWeights) !== null && _b !== void 0 ? _b : ['400'],
|
|
351
|
+
});
|
|
352
|
+
await onSave(option.value, {
|
|
353
|
+
sourceEdit: { type: 'google-font', font: googleFont },
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
save()
|
|
357
|
+
.catch((err) => {
|
|
358
|
+
onDragValueChange(propStatus.codeValue);
|
|
359
|
+
setSaveError(err instanceof Error ? err.message : String(err));
|
|
360
|
+
})
|
|
361
|
+
.finally(() => {
|
|
362
|
+
onDragEnd();
|
|
363
|
+
});
|
|
364
|
+
}, [propStatus.codeValue, onDragValueChange, hide, onSave, onDragEnd]);
|
|
365
|
+
const toggleOpened = (0, react_1.useCallback)(() => {
|
|
366
|
+
var _a;
|
|
367
|
+
if (opened) {
|
|
368
|
+
setOpened(false);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
(_a = size === null || size === void 0 ? void 0 : size.refresh) === null || _a === void 0 ? void 0 : _a.call(size);
|
|
372
|
+
setOpened(true);
|
|
373
|
+
}, [opened, size]);
|
|
374
|
+
(0, react_1.useEffect)(() => {
|
|
375
|
+
if (!opened) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
const selectedIndex = filteredOptions.findIndex((option) => option.value === current);
|
|
379
|
+
const nextIndex = Math.max(0, selectedIndex);
|
|
380
|
+
setHighlightedIndex(nextIndex);
|
|
381
|
+
requestAnimationFrame(() => {
|
|
382
|
+
var _a;
|
|
383
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
384
|
+
const list = listRef.current;
|
|
385
|
+
if (!list) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
list.scrollTop = Math.max(0, nextIndex * ROW_HEIGHT - LIST_HEIGHT / 2 + ROW_HEIGHT / 2);
|
|
389
|
+
});
|
|
390
|
+
}, [current, filteredOptions, opened]);
|
|
391
|
+
(0, react_1.useEffect)(() => {
|
|
392
|
+
setHighlightedIndex(0);
|
|
393
|
+
if (listRef.current) {
|
|
394
|
+
listRef.current.scrollTop = 0;
|
|
395
|
+
}
|
|
396
|
+
}, [query]);
|
|
397
|
+
(0, react_1.useEffect)(() => {
|
|
398
|
+
if (!current) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
const googleFont = google_fonts_list_1.GOOGLE_FONTS_LIST.find((font) => font.fontFamily === current);
|
|
402
|
+
if (!googleFont) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
loadGoogleFontForPreview({
|
|
406
|
+
fontFamily: current,
|
|
407
|
+
cssFamily: googleFont.previewUrl,
|
|
408
|
+
weights: googleFont.weights,
|
|
409
|
+
document,
|
|
410
|
+
}).catch(() => undefined);
|
|
411
|
+
loadGoogleFontForPickerPreview({
|
|
412
|
+
fontFamily: current,
|
|
413
|
+
cssFamily: googleFont.previewUrl,
|
|
414
|
+
document,
|
|
415
|
+
})
|
|
416
|
+
.then(() => {
|
|
417
|
+
setLoadedPickerPreviewFonts(new Set(loadedGoogleFontsForPickerPreview));
|
|
418
|
+
})
|
|
419
|
+
.catch(() => undefined);
|
|
420
|
+
}, [current]);
|
|
421
|
+
(0, react_1.useEffect)(() => {
|
|
422
|
+
if (!opened) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const visibleGoogleFonts = filteredOptions
|
|
426
|
+
.slice(visibleRange.start, visibleRange.end)
|
|
427
|
+
.filter((option) => option.source === 'Google Fonts' &&
|
|
428
|
+
option.fontFamily &&
|
|
429
|
+
option.googleFontCssFamily);
|
|
430
|
+
if (visibleGoogleFonts.length === 0) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
Promise.all(visibleGoogleFonts.map((font) => loadGoogleFontForPickerPreview({
|
|
434
|
+
fontFamily: font.fontFamily,
|
|
435
|
+
cssFamily: font.googleFontCssFamily,
|
|
436
|
+
document,
|
|
437
|
+
})))
|
|
438
|
+
.then(() => {
|
|
439
|
+
setLoadedPickerPreviewFonts(new Set(loadedGoogleFontsForPickerPreview));
|
|
440
|
+
})
|
|
441
|
+
.catch(() => undefined);
|
|
442
|
+
}, [filteredOptions, opened, visibleRange.end, visibleRange.start]);
|
|
443
|
+
const onKeyDown = (0, react_1.useCallback)((event) => {
|
|
444
|
+
if (event.key === 'ArrowDown') {
|
|
445
|
+
event.preventDefault();
|
|
446
|
+
setHighlightedIndex((prev) => {
|
|
447
|
+
const next = Math.max(0, Math.min(filteredOptions.length - 1, prev + 1));
|
|
448
|
+
if (listRef.current) {
|
|
449
|
+
scrollIndexIntoView({ index: next, list: listRef.current });
|
|
450
|
+
}
|
|
451
|
+
return next;
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
if (event.key === 'ArrowUp') {
|
|
455
|
+
event.preventDefault();
|
|
456
|
+
setHighlightedIndex((prev) => {
|
|
457
|
+
const next = Math.max(0, prev - 1);
|
|
458
|
+
if (listRef.current) {
|
|
459
|
+
scrollIndexIntoView({ index: next, list: listRef.current });
|
|
460
|
+
}
|
|
461
|
+
return next;
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
if (event.key === 'Enter') {
|
|
465
|
+
event.preventDefault();
|
|
466
|
+
const option = filteredOptions[highlightedIndex];
|
|
467
|
+
if (option) {
|
|
468
|
+
selectOption(option);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (event.key === 'Escape') {
|
|
472
|
+
event.preventDefault();
|
|
473
|
+
hide();
|
|
474
|
+
}
|
|
475
|
+
}, [filteredOptions, hide, highlightedIndex, selectOption]);
|
|
476
|
+
const renderedOptions = filteredOptions.slice(visibleRange.start, visibleRange.end);
|
|
477
|
+
const getOptionPreviewStyle = (0, react_1.useCallback)((option) => {
|
|
478
|
+
if (option.source !== 'Google Fonts' ||
|
|
479
|
+
!option.fontFamily ||
|
|
480
|
+
!loadedPickerPreviewFonts.has(option.fontFamily)) {
|
|
481
|
+
return {};
|
|
482
|
+
}
|
|
483
|
+
return { fontFamily: makeFontPreviewName(option.fontFamily) };
|
|
484
|
+
}, [loadedPickerPreviewFonts]);
|
|
485
|
+
const style = (0, react_1.useMemo)(() => {
|
|
486
|
+
return {
|
|
487
|
+
...triggerStyle,
|
|
488
|
+
borderColor: opened
|
|
489
|
+
? colors_1.SELECTED_BACKGROUND
|
|
490
|
+
: hovered
|
|
491
|
+
? INPUT_BORDER_COLOR_HOVERED
|
|
492
|
+
: INPUT_BORDER_COLOR_UNHOVERED,
|
|
493
|
+
};
|
|
494
|
+
}, [hovered, opened]);
|
|
495
|
+
const selectedPreviewStyle = getOptionPreviewStyle(selected);
|
|
496
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
497
|
+
jsx_runtime_1.jsxs("button", { ref: buttonRef, title: field.key, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, onPointerDown: (event) => {
|
|
498
|
+
event.stopPropagation();
|
|
499
|
+
toggleOpened();
|
|
500
|
+
}, onClick: (event) => {
|
|
501
|
+
event.stopPropagation();
|
|
502
|
+
if (event.detail === 0) {
|
|
503
|
+
toggleOpened();
|
|
504
|
+
}
|
|
505
|
+
}, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [
|
|
506
|
+
jsx_runtime_1.jsx("div", { title: selected.label, style: { ...triggerLabel, ...selectedPreviewStyle }, children: selected.label }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(caret_1.CaretDown, { small: true })
|
|
507
|
+
] }), saveError === null ? null : jsx_runtime_1.jsx("div", { style: errorText, children: saveError }), opened && size
|
|
508
|
+
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, onPointerDown: (event) => event.stopPropagation(), children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: hide, onEscape: hide, children: jsx_runtime_1.jsxs("div", { style: portalStyle({ size }), children: [
|
|
509
|
+
jsx_runtime_1.jsx("div", { style: { padding: 6 }, children: jsx_runtime_1.jsx("input", { ref: inputRef, value: query, onChange: (event) => setQuery(event.target.value), onKeyDown: onKeyDown, placeholder: "Search fonts", style: searchInput }) }), filteredOptions.length === 0 ? (jsx_runtime_1.jsx("div", { style: noResults, children: "No fonts found" })) : (jsx_runtime_1.jsxs("div", { ref: listRef, style: listStyle, onScroll: (event) => {
|
|
510
|
+
setScrollTop(event.currentTarget.scrollTop);
|
|
511
|
+
}, children: [
|
|
512
|
+
jsx_runtime_1.jsx("div", { style: { height: visibleRange.start * ROW_HEIGHT } }), renderedOptions.map((option, index) => {
|
|
513
|
+
const actualIndex = visibleRange.start + index;
|
|
514
|
+
const isSelected = option.value === current;
|
|
515
|
+
const isHighlighted = actualIndex === highlightedIndex;
|
|
516
|
+
return (jsx_runtime_1.jsxs("button", { type: "button", style: {
|
|
517
|
+
...optionButton,
|
|
518
|
+
backgroundColor: isHighlighted
|
|
519
|
+
? CLEAR_HOVER
|
|
520
|
+
: isSelected
|
|
521
|
+
? colors_1.SELECTED_BACKGROUND
|
|
522
|
+
: 'transparent',
|
|
523
|
+
}, onPointerEnter: () => setHighlightedIndex(actualIndex), onPointerDown: (event) => {
|
|
524
|
+
event.preventDefault();
|
|
525
|
+
event.stopPropagation();
|
|
526
|
+
selectOption(option);
|
|
527
|
+
}, children: [
|
|
528
|
+
jsx_runtime_1.jsx("span", { style: { width: 18 }, children: isSelected ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, { size: 11 }) : null }), jsx_runtime_1.jsx("span", { style: {
|
|
529
|
+
...optionLabel,
|
|
530
|
+
...getOptionPreviewStyle(option),
|
|
531
|
+
}, children: option.label }), jsx_runtime_1.jsx("span", { style: optionSource, children: option.source })
|
|
532
|
+
] }, option.id));
|
|
533
|
+
}), jsx_runtime_1.jsx("div", { style: {
|
|
534
|
+
height: (filteredOptions.length - visibleRange.end) *
|
|
535
|
+
ROW_HEIGHT,
|
|
536
|
+
} })
|
|
537
|
+
] })), jsx_runtime_1.jsx("div", { style: {
|
|
538
|
+
padding: '6px 8px',
|
|
539
|
+
color: colors_1.LIGHT_TEXT,
|
|
540
|
+
fontSize: 10,
|
|
541
|
+
}, children: "Google Fonts are loaded for Studio preview and saved to your composition when selected." })
|
|
542
|
+
] }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
543
|
+
: null] }));
|
|
544
|
+
};
|
|
545
|
+
exports.TimelineFontFamilyField = TimelineFontFamilyField;
|
|
@@ -4,12 +4,13 @@ exports.TimelineImageInfo = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const timeline_utils_1 = require("@remotion/timeline-utils");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
9
|
const HEIGHT = (0, timeline_layout_1.getTimelineLayerHeight)('image') - 2;
|
|
9
10
|
const containerStyle = {
|
|
10
11
|
height: HEIGHT,
|
|
11
12
|
width: '100%',
|
|
12
|
-
backgroundColor:
|
|
13
|
+
backgroundColor: colors_1.BLACK_ALPHA_30,
|
|
13
14
|
display: 'flex',
|
|
14
15
|
borderTopLeftRadius: 2,
|
|
15
16
|
borderBottomLeftRadius: 2,
|
|
@@ -4,12 +4,13 @@ exports.TimelineInOutPointer = exports.outMarkerAreaRef = exports.inMarkerAreaRe
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const get_left_of_timeline_slider_1 = require("../../helpers/get-left-of-timeline-slider");
|
|
8
9
|
const in_out_1 = require("../../state/in-out");
|
|
9
10
|
const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
|
|
10
11
|
const areaHighlight = {
|
|
11
12
|
position: 'absolute',
|
|
12
|
-
backgroundColor:
|
|
13
|
+
backgroundColor: colors_1.BLACK_ALPHA_50,
|
|
13
14
|
height: '100%',
|
|
14
15
|
bottom: 0,
|
|
15
16
|
top: 0,
|
|
@@ -12,7 +12,7 @@ const line = {
|
|
|
12
12
|
height: '100%',
|
|
13
13
|
width: 1,
|
|
14
14
|
position: 'absolute',
|
|
15
|
-
backgroundColor:
|
|
15
|
+
backgroundColor: colors_1.WHITE_ALPHA_10,
|
|
16
16
|
cursor: 'ew-resize',
|
|
17
17
|
paddingLeft: 1,
|
|
18
18
|
paddingRight: 1,
|
|
@@ -24,9 +24,7 @@ const InnerTimelineInOutPointerHandle = ({ atFrame, dragging, onPointerDown, tim
|
|
|
24
24
|
const style = (0, react_1.useMemo)(() => {
|
|
25
25
|
return {
|
|
26
26
|
...line,
|
|
27
|
-
backgroundColor: dragging
|
|
28
|
-
? colors_1.LIGHT_TRANSPARENT
|
|
29
|
-
: 'rgba(255, 255, 255, 0.1)',
|
|
27
|
+
backgroundColor: dragging ? colors_1.WHITE_ALPHA_70 : colors_1.WHITE_ALPHA_10,
|
|
30
28
|
transform: `translateX(${(0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(atFrame, videoConfig.durationInFrames, timelineWidth)}px)`,
|
|
31
29
|
top: 0,
|
|
32
30
|
};
|
|
@@ -29,7 +29,7 @@ const navButtonStyle = {
|
|
|
29
29
|
alignItems: 'center',
|
|
30
30
|
background: 'none',
|
|
31
31
|
border: 'none',
|
|
32
|
-
color:
|
|
32
|
+
color: colors_1.WHITE,
|
|
33
33
|
cursor: 'pointer',
|
|
34
34
|
display: 'flex',
|
|
35
35
|
flexShrink: 0,
|
|
@@ -469,7 +469,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
|
|
|
469
469
|
}), [canToggleKeyframe, clientId]);
|
|
470
470
|
const diamondColor = hasKeyframeAtCurrentFrame ? colors_1.BLUE : colors_1.LIGHT_TEXT;
|
|
471
471
|
return (jsx_runtime_1.jsxs("div", { style: controlsContainerStyle, children: [
|
|
472
|
-
jsx_runtime_1.jsx("button", { type: "button", style: previousStyle, disabled: previousDisabled, onPointerDown: previousDisabled ? undefined : onPrevious, "aria-label": "Go to previous keyframe", title: "Previous keyframe", children: jsx_runtime_1.jsx("svg", { width: "14", height: "14", viewBox: "0 0 10 10", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M7 1.5L3 5L7 8.5Z", fill:
|
|
472
|
+
jsx_runtime_1.jsx("button", { type: "button", style: previousStyle, disabled: previousDisabled, onPointerDown: previousDisabled ? undefined : onPrevious, "aria-label": "Go to previous keyframe", title: "Previous keyframe", children: jsx_runtime_1.jsx("svg", { width: "14", height: "14", viewBox: "0 0 10 10", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M7 1.5L3 5L7 8.5Z", fill: colors_1.LIGHT_GRAY }) }) }), jsx_runtime_1.jsx("button", { type: "button", style: diamondStyle, disabled: !canToggleKeyframe || !clientId, onPointerDown: canToggleKeyframe && clientId ? onToggleKeyframe : undefined, "aria-label": hasKeyframeAtCurrentFrame ? 'Remove keyframe' : 'Add keyframe', title: hasKeyframeAtCurrentFrame ? 'Remove keyframe' : 'Add keyframe', children: jsx_runtime_1.jsx(TimelineKeyframeDiamondIcon_1.TimelineKeyframeDiamondIcon, { color: diamondColor, size: 12 }) }), jsx_runtime_1.jsx("button", { type: "button", style: nextStyle, disabled: nextDisabled, onPointerDown: nextDisabled ? undefined : onNext, "aria-label": "Go to next keyframe", title: "Next keyframe", children: jsx_runtime_1.jsx("svg", { width: "14", height: "14", viewBox: "0 0 10 10", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M3 1.5L7 5L3 8.5Z", fill: colors_1.LIGHT_GRAY }) }) })
|
|
473
473
|
] }));
|
|
474
474
|
};
|
|
475
475
|
exports.TimelineKeyframeControls = TimelineKeyframeControls;
|
|
@@ -8,7 +8,7 @@ const svgStyle = {
|
|
|
8
8
|
overflow: 'visible',
|
|
9
9
|
};
|
|
10
10
|
const TimelineKeyframeDiamondIcon = ({ color, selected = false, size }) => {
|
|
11
|
-
return (jsx_runtime_1.jsxs("svg", { width: size, height: size, viewBox: "0 0 12 12", style: svgStyle, "aria-hidden": "true", focusable: "false", children: [selected ? (jsx_runtime_1.jsx("polygon", { points: "6 0.75 11.25 6 6 11.25 0.75 6", fill: "none", stroke: colors_1.BLUE, strokeWidth: "1.5", strokeLinejoin: "round" })) : null, jsx_runtime_1.jsx("polygon", { points: "6 1.5 10.5 6 6 10.5 1.5 6", fill: color, stroke:
|
|
11
|
+
return (jsx_runtime_1.jsxs("svg", { width: size, height: size, viewBox: "0 0 12 12", style: svgStyle, "aria-hidden": "true", focusable: "false", children: [selected ? (jsx_runtime_1.jsx("polygon", { points: "6 0.75 11.25 6 6 11.25 0.75 6", fill: "none", stroke: colors_1.BLUE, strokeWidth: "1.5", strokeLinejoin: "round" })) : null, jsx_runtime_1.jsx("polygon", { points: "6 1.5 10.5 6 6 10.5 1.5 6", fill: color, stroke: colors_1.BLACK_ALPHA_40, strokeWidth: "1", strokeLinejoin: "round" })
|
|
12
12
|
] }));
|
|
13
13
|
};
|
|
14
14
|
exports.TimelineKeyframeDiamondIcon = TimelineKeyframeDiamondIcon;
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
7
7
|
const eyeIcon = {
|
|
8
8
|
width: 12,
|
|
9
|
-
color:
|
|
9
|
+
color: colors_1.CURRENT_COLOR,
|
|
10
10
|
pointerEvents: 'none',
|
|
11
11
|
};
|
|
12
12
|
const effectIcon = {
|
|
@@ -22,7 +22,7 @@ exports.timelineLayerIconContainer = {
|
|
|
22
22
|
height: 16,
|
|
23
23
|
width: 16,
|
|
24
24
|
borderRadius: 2,
|
|
25
|
-
backgroundColor:
|
|
25
|
+
backgroundColor: colors_1.BLACK_ALPHA_40,
|
|
26
26
|
display: 'inline-flex',
|
|
27
27
|
justifyContent: 'center',
|
|
28
28
|
alignItems: 'center',
|
|
@@ -39,7 +39,7 @@ const TimelineLayerEye = ({ onInvoked, hidden, type }) => {
|
|
|
39
39
|
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 10 14", fill: "none", style: speakerIcon, children: jsx_runtime_1.jsx("path", { d: "M9.40938 0.0869018C9.76875 0.249402 10 0.605652 10 0.999402V12.9994C10 13.3932 9.76875 13.7494 9.40938 13.9119C9.05 14.0744 8.62813 14.0088 8.33438 13.7463L4.11875 9.9994H2C0.896875 9.9994 0 9.10253 0 7.9994V5.9994C0 4.89628 0.896875 3.9994 2 3.9994H4.11875L8.33438 0.252527C8.62813 -0.0099732 9.05 -0.0724732 9.40938 0.0869018Z", fill: color }) }));
|
|
40
40
|
}
|
|
41
41
|
if (type === 'effect') {
|
|
42
|
-
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 16 16", fill: "none", style: effectIcon, children: jsx_runtime_1.jsx("path", { d: "M4.405 4.48C4.575 3.82 4.865 3.325 5.275 2.995C5.695 2.665 6.25 2.5 6.94 2.5H9.235V4.06H7.045C6.555 4.06 6.235 4.3 6.085 4.78L5.83 5.68H7.975V7.255H5.395L3.805 13H2.02L3.625 7.255H1.96V5.68H4.075L4.405 4.48ZM8.57102 9.085L6.87602 5.68H8.79602L9.86102 7.99L11.991 5.68H14.331L10.686 9.415L12.426 13H10.491L9.35102 10.585L7.02602 13H4.68602L8.57102 9.085Z", fill:
|
|
42
|
+
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 16 16", fill: "none", style: effectIcon, children: jsx_runtime_1.jsx("path", { d: "M4.405 4.48C4.575 3.82 4.865 3.325 5.275 2.995C5.695 2.665 6.25 2.5 6.94 2.5H9.235V4.06H7.045C6.555 4.06 6.235 4.3 6.085 4.78L5.83 5.68H7.975V7.255H5.395L3.805 13H2.02L3.625 7.255H1.96V5.68H4.075L4.405 4.48ZM8.57102 9.085L6.87602 5.68H8.79602L9.86102 7.99L11.991 5.68H14.331L10.686 9.415L12.426 13H10.491L9.35102 10.585L7.02602 13H4.68602L8.57102 9.085Z", fill: colors_1.WHITE }) }));
|
|
43
43
|
}
|
|
44
44
|
return (jsx_runtime_1.jsx("svg", { style: eyeIcon, viewBox: "0 0 24 16", fill: "none", children: jsx_runtime_1.jsx("path", { d: "M24 7.551C24 7.551 19.748 16 12.015 16C4.835 16 0 7.551 0 7.551C0 7.551 4.446 0 12.015 0C19.709 0 24 7.551 24 7.551ZM17 8C17 5.243 14.757 3 12 3C9.243 3 7 5.243 7 8C7 10.757 9.243 13 12 13C14.757 13 17 10.757 17 8Z", fill: color }) }));
|
|
45
45
|
}, [hidden, type]);
|