@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,1366 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getBrowserStudioOperations
|
|
3
|
+
} from "./index-cw0pnpg5.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getStudioInteractivityEnabled
|
|
6
|
+
} from "./index-5zrb1ft4.mjs";
|
|
7
|
+
import {
|
|
8
|
+
CURRENT_COLOR,
|
|
9
|
+
CURRENT_COLOR_LOWERCASE
|
|
10
|
+
} from "./index-jg13hf2g.mjs";
|
|
11
|
+
import {
|
|
12
|
+
__require,
|
|
13
|
+
__toESM
|
|
14
|
+
} from "./index-rcv7qkt5.mjs";
|
|
15
|
+
|
|
16
|
+
// src/icons/apps.tsx
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
var AppsIcon = ({ color, ...props }) => /* @__PURE__ */ jsx("svg", {
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
viewBox: "0 0 640 640",
|
|
21
|
+
...props,
|
|
22
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
23
|
+
fill: color ?? CURRENT_COLOR_LOWERCASE,
|
|
24
|
+
d: "M144 128C135.2 128 128 135.2 128 144L128 240C128 248.8 135.2 256 144 256L240 256C248.8 256 256 248.8 256 240L256 144C256 135.2 248.8 128 240 128L144 128zM96 144C96 117.5 117.5 96 144 96L240 96C266.5 96 288 117.5 288 144L288 240C288 266.5 266.5 288 240 288L144 288C117.5 288 96 266.5 96 240L96 144zM144 384C135.2 384 128 391.2 128 400L128 496C128 504.8 135.2 512 144 512L240 512C248.8 512 256 504.8 256 496L256 400C256 391.2 248.8 384 240 384L144 384zM96 400C96 373.5 117.5 352 144 352L240 352C266.5 352 288 373.5 288 400L288 496C288 522.5 266.5 544 240 544L144 544C117.5 544 96 522.5 96 496L96 400zM496 128L400 128C391.2 128 384 135.2 384 144L384 240C384 248.8 391.2 256 400 256L496 256C504.8 256 512 248.8 512 240L512 144C512 135.2 504.8 128 496 128zM400 96L496 96C522.5 96 544 117.5 544 144L544 240C544 266.5 522.5 288 496 288L400 288C373.5 288 352 266.5 352 240L352 144C352 117.5 373.5 96 400 96zM400 384C391.2 384 384 391.2 384 400L384 496C384 504.8 391.2 512 400 512L496 512C504.8 512 512 504.8 512 496L512 400C512 391.2 504.8 384 496 384L400 384zM352 400C352 373.5 373.5 352 400 352L496 352C522.5 352 544 373.5 544 400L544 496C544 522.5 522.5 544 496 544L400 544C373.5 544 352 522.5 352 496L352 400z"
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/components/CodingAgentIcon.tsx
|
|
29
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
30
|
+
var CodingAgentIcon = ({ codingAgentId, size }) => {
|
|
31
|
+
if (codingAgentId === null) {
|
|
32
|
+
return /* @__PURE__ */ jsx2(AppsIcon, {
|
|
33
|
+
height: size,
|
|
34
|
+
width: size
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return /* @__PURE__ */ jsx2("img", {
|
|
38
|
+
alt: "",
|
|
39
|
+
"aria-hidden": true,
|
|
40
|
+
"data-coding-agent-icon": codingAgentId,
|
|
41
|
+
draggable: false,
|
|
42
|
+
src: `/api/app-icon/coding-agent/${codingAgentId}.png`,
|
|
43
|
+
style: { flexShrink: 0, height: size, width: size }
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/icons/custom-editor.tsx
|
|
48
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
49
|
+
var CustomEditorIcon = ({
|
|
50
|
+
size: sizeProp
|
|
51
|
+
}) => /* @__PURE__ */ jsx3("svg", {
|
|
52
|
+
focusable: "false",
|
|
53
|
+
role: "img",
|
|
54
|
+
viewBox: "0 0 24 24",
|
|
55
|
+
style: {
|
|
56
|
+
width: sizeProp ?? 14,
|
|
57
|
+
height: sizeProp ?? 14,
|
|
58
|
+
flexShrink: 0
|
|
59
|
+
},
|
|
60
|
+
children: /* @__PURE__ */ jsx3("path", {
|
|
61
|
+
fill: "none",
|
|
62
|
+
stroke: CURRENT_COLOR,
|
|
63
|
+
strokeLinecap: "round",
|
|
64
|
+
strokeLinejoin: "round",
|
|
65
|
+
strokeWidth: "1.8",
|
|
66
|
+
d: "m8 8-4 4 4 4m8-8 4 4-4 4m-2-10-4 12"
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// src/icons/editor.tsx
|
|
71
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
72
|
+
var iconStyle = (size) => ({
|
|
73
|
+
flexShrink: 0,
|
|
74
|
+
height: size,
|
|
75
|
+
width: size
|
|
76
|
+
});
|
|
77
|
+
var VsCodeIcon = ({ size }) => /* @__PURE__ */ jsx4("svg", {
|
|
78
|
+
viewBox: "0 0 40 40",
|
|
79
|
+
style: iconStyle(size),
|
|
80
|
+
"aria-hidden": true,
|
|
81
|
+
children: /* @__PURE__ */ jsx4("path", {
|
|
82
|
+
fill: "#23A9F2",
|
|
83
|
+
fillRule: "evenodd",
|
|
84
|
+
clipRule: "evenodd",
|
|
85
|
+
d: "M26.02 34.13c.23.09.48.13.72.12.25-.01.49-.07.71-.18l5.93-2.85c.31-.15.56-.38.74-.66.18-.29.28-.62.28-.96V10.25c0-.34-.1-.67-.28-.96-.18-.28-.43-.51-.74-.66l-5.93-2.85c-.34-.16-.71-.22-1.08-.15-.36.06-.7.23-.96.5L14.05 16.48 9.11 12.73a1.2 1.2 0 0 0-1.53.07L5.99 14.24a1.2 1.2 0 0 0 0 1.77l4.29 3.92-4.29 3.91a1.2 1.2 0 0 0 0 1.77l1.59 1.44a1.2 1.2 0 0 0 1.53.07l4.94-3.75 11.36 10.36c.17.17.38.31.61.4Zm1.18-20.74-8.61 6.54 8.61 6.53V13.39Z"
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
var CursorIcon = ({ size }) => /* @__PURE__ */ jsxs("svg", {
|
|
89
|
+
viewBox: "0 0 40 40",
|
|
90
|
+
style: iconStyle(size),
|
|
91
|
+
"aria-hidden": true,
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsx4("rect", {
|
|
94
|
+
x: "4",
|
|
95
|
+
y: "4",
|
|
96
|
+
width: "32",
|
|
97
|
+
height: "32",
|
|
98
|
+
rx: "7.625",
|
|
99
|
+
fill: "#050505"
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ jsx4("path", {
|
|
102
|
+
fill: "#fff",
|
|
103
|
+
d: "m29.62 14.21-8.67-5.09a.89.89 0 0 0-.9 0l-8.67 5.09a.77.77 0 0 0-.38.66v10.26c0 .27.14.52.38.66l8.67 5.09c.28.16.62.16.9 0l8.67-5.09c.24-.14.38-.39.38-.66V14.87a.77.77 0 0 0-.38-.66Zm-.54 1.07L20.7 30.01a.11.11 0 0 1-.2-.06v-9.64c0-.19-.1-.37-.27-.47l-8.22-4.82a.11.11 0 0 1 .06-.21h16.74c.24 0 .39.27.27.47Z"
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
var WindsurfIcon = ({ size }) => /* @__PURE__ */ jsx4("svg", {
|
|
108
|
+
viewBox: "0 0 24 24",
|
|
109
|
+
style: iconStyle(size),
|
|
110
|
+
"aria-hidden": true,
|
|
111
|
+
children: /* @__PURE__ */ jsx4("path", {
|
|
112
|
+
fill: CURRENT_COLOR,
|
|
113
|
+
d: "M23.55 5.07a2.18 2.18 0 0 0-2.18 2.17v4.87c0 .97-.8 1.76-1.76 1.76-.57 0-1.14-.29-1.47-.77l-4.97-7.1a2.21 2.21 0 0 0-3.96 1.22v4.89c0 .97-.8 1.76-1.77 1.76-.57 0-1.13-.29-1.47-.77L.41 5.16A.22.22 0 0 0 0 5.29v4.24c0 .22.07.43.19.6l5.47 7.82c.33.46.8.81 1.35.93a2.15 2.15 0 0 0 2.65-2.1v-4.89c0-.97.79-1.76 1.76-1.76.57 0 1.14.29 1.47.77l4.98 7.1c.41.59 1.05.94 1.81.94a2.15 2.15 0 0 0 2.15-2.16v-4.89c0-.97.79-1.76 1.76-1.76h.19a.22.22 0 0 0 .22-.22V5.29a.22.22 0 0 0-.22-.22h-.23Z"
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
var ZedIcon = ({ size }) => /* @__PURE__ */ jsx4("svg", {
|
|
117
|
+
viewBox: "0 0 40 40",
|
|
118
|
+
style: iconStyle(size),
|
|
119
|
+
"aria-hidden": true,
|
|
120
|
+
children: /* @__PURE__ */ jsx4("path", {
|
|
121
|
+
fill: CURRENT_COLOR,
|
|
122
|
+
fillRule: "evenodd",
|
|
123
|
+
clipRule: "evenodd",
|
|
124
|
+
d: "M8.3 7.4a.9.9 0 0 0-.9.9v19.8H5.6V8.3a2.7 2.7 0 0 1 2.7-2.7h24.11c1.2 0 1.81 1.45.96 2.3L18.52 22.76h4.18V20.9h1.8v2.31c0 .75-.6 1.35-1.35 1.35h-6.43l-3.1 3.09h14.03V16.4h1.8v11.25c0 1-.8 1.8-1.8 1.8H11.82L8.67 32.6H31.7a.9.9 0 0 0 .9-.9V11.9h1.8v19.8a2.7 2.7 0 0 1-2.7 2.7H7.59c-1.2 0-1.81-1.45-.96-2.31L21.43 17.3H17.3v1.8h-1.8v-2.25c0-.75.6-1.35 1.35-1.35h6.38l3.15-3.15H12.35V23.6h-1.8V12.35c0-1 .8-1.8 1.8-1.8h15.83l3.15-3.15H8.3Z"
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
var VscodiumIcon = ({ size }) => /* @__PURE__ */ jsx4("svg", {
|
|
128
|
+
viewBox: "0 0 24 24",
|
|
129
|
+
style: iconStyle(size),
|
|
130
|
+
"aria-hidden": true,
|
|
131
|
+
children: /* @__PURE__ */ jsx4("path", {
|
|
132
|
+
fill: "#2F80ED",
|
|
133
|
+
d: "M11.58.54a1.47 1.47 0 0 0-.44 2.03c2.43 3.76 3 6.6 2.75 9.08-1 4.75-3.18 5.72-5.09 5.72-1.86 0-1.36-3.07.03-3.96a5.3 5.3 0 0 1 2.73-.87 1.47 1.47 0 1 0 0-2.94c-.96 0-1.9.21-2.78.55.18-.85.25-1.76.02-2.74-.36-1.47-1.37-2.88-3.13-4.25a1.47 1.47 0 0 0-1.81 2.32c1.43 1.11 1.9 1.94 2.07 2.62.16.68.03 1.4-.3 2.4-.41 1.35-.9 2.56-1.1 3.71-.11.57-.12 1.19-.15 1.68-1.03-1-1.43-2.34-1.43-4.28a1.47 1.47 0 1 0-2.95 0c0 2.66.78 5.18 2.86 6.87 1.88 1.79 6.67 1.13 6.67 4.01 0 .81 1.19 1.21 2 1.21.84 0 1.89-.56 1.89-1.21 0-3.27 3.44-5.25 9.11-5.24A1.47 1.47 0 1 0 22.53 14.3c-.39 0-.77.01-1.14.03.64-1.49.92-3.13.86-4.9a1.47 1.47 0 1 0-2.95.1c.08 2.32-.01 4.39-1.74 5.48-.49.31-1.06.58-1.6.58.42-1.14.74-2.35.87-3.65.08-.83.09-1.82 0-2.59-.15-1.18-.33-2.53.12-3.55.4-.87 1.31-1.24 2.65-1.24a1.47 1.47 0 1 0 0-2.94c-1.98 0-3.48 1.04-4.34 2.3-.44-.95-.98-1.93-1.64-2.94a1.47 1.47 0 0 0-2.04-.44Z"
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
var WebStormIcon = ({ size }) => /* @__PURE__ */ jsxs("svg", {
|
|
137
|
+
viewBox: "0 0 24 24",
|
|
138
|
+
style: iconStyle(size),
|
|
139
|
+
"aria-hidden": true,
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ jsx4("rect", {
|
|
142
|
+
width: "24",
|
|
143
|
+
height: "24",
|
|
144
|
+
rx: "3",
|
|
145
|
+
fill: "#07C3F2"
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ jsx4("path", {
|
|
148
|
+
fill: "#050505",
|
|
149
|
+
d: "M3 3h18v18H3z"
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsx4("path", {
|
|
152
|
+
fill: "#fff",
|
|
153
|
+
d: "M4.8 5.4h2.1l1.3 4.9 1.4-4.9h1.6l1.4 4.9 1.3-4.9h2.1l-2.5 8.7h-1.8l-1.3-4.8-1.4 4.8H7.3L4.8 5.4Zm10.8 7.3 1.1-1.4c.8.6 1.6 1 2.5 1 .7 0 1.2-.3 1.2-.8 0-.5-.3-.7-1.7-1.1-1.7-.4-2.8-.9-2.8-2.6 0-1.6 1.3-2.6 3-2.6 1.2 0 2.3.4 3.2 1.1l-1 1.5c-.8-.5-1.5-.8-2.2-.8-.7 0-1.1.3-1.1.7 0 .6.4.7 1.8 1.1 1.7.5 2.7 1.1 2.7 2.6 0 1.7-1.3 2.7-3.2 2.7-1.3 0-2.6-.5-3.5-1.4ZM4.7 18h8v1.3h-8V18Z"
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
var SublimeTextIcon = ({ size }) => /* @__PURE__ */ jsxs("svg", {
|
|
158
|
+
viewBox: "0 0 40 40",
|
|
159
|
+
style: iconStyle(size),
|
|
160
|
+
"aria-hidden": true,
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ jsx4("path", {
|
|
163
|
+
fill: "#FF9800",
|
|
164
|
+
d: "M35.91 4.51c0-.37-.36-.59-.8-.48L4.8 11.44c-.44.11-.8.5-.8.87v7.58c0 .37.36.59.8.48l30.31-7.41c.44-.11.8-.5.8-.87V4.51Zm0 15.57c0-.38-.36-.59-.8-.49L4.8 27.01c-.44.1-.8.5-.8.87v7.57c0 .38.36.6.8.49l30.31-7.41c.44-.11.8-.5.8-.88v-7.57Z"
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ jsx4("path", {
|
|
167
|
+
fill: "#F28C00",
|
|
168
|
+
d: "M4 19.84c0 .37.36.76.8.87l30.32 7.41c.44.11.8-.11.8-.48v-7.58c0-.37-.36-.76-.8-.87L4.8 11.78c-.44-.11-.8.11-.8.48v7.58Z"
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
});
|
|
172
|
+
var EditorIcon = ({ editorId, size: sizeProp }) => {
|
|
173
|
+
const size = sizeProp ?? 14;
|
|
174
|
+
switch (editorId) {
|
|
175
|
+
case "vscode":
|
|
176
|
+
return /* @__PURE__ */ jsx4(VsCodeIcon, {
|
|
177
|
+
size
|
|
178
|
+
});
|
|
179
|
+
case "cursor":
|
|
180
|
+
return /* @__PURE__ */ jsx4(CursorIcon, {
|
|
181
|
+
size
|
|
182
|
+
});
|
|
183
|
+
case "windsurf":
|
|
184
|
+
return /* @__PURE__ */ jsx4(WindsurfIcon, {
|
|
185
|
+
size
|
|
186
|
+
});
|
|
187
|
+
case "zed":
|
|
188
|
+
return /* @__PURE__ */ jsx4(ZedIcon, {
|
|
189
|
+
size
|
|
190
|
+
});
|
|
191
|
+
case "vscodium":
|
|
192
|
+
return /* @__PURE__ */ jsx4(VscodiumIcon, {
|
|
193
|
+
size
|
|
194
|
+
});
|
|
195
|
+
case "webstorm":
|
|
196
|
+
return /* @__PURE__ */ jsx4(WebStormIcon, {
|
|
197
|
+
size
|
|
198
|
+
});
|
|
199
|
+
case "sublime-text":
|
|
200
|
+
return /* @__PURE__ */ jsx4(SublimeTextIcon, {
|
|
201
|
+
size
|
|
202
|
+
});
|
|
203
|
+
case "custom":
|
|
204
|
+
case null:
|
|
205
|
+
return /* @__PURE__ */ jsx4(CustomEditorIcon, {
|
|
206
|
+
size
|
|
207
|
+
});
|
|
208
|
+
default:
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// src/icons/finder.tsx
|
|
214
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
215
|
+
var FinderIcon = ({ size }) => {
|
|
216
|
+
return /* @__PURE__ */ jsx5("img", {
|
|
217
|
+
alt: "",
|
|
218
|
+
"aria-hidden": true,
|
|
219
|
+
"data-file-manager-icon": "finder",
|
|
220
|
+
draggable: false,
|
|
221
|
+
src: "/api/app-icon/file-manager/finder.png",
|
|
222
|
+
style: { flexShrink: 0, height: size, width: size }
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// src/icons/terminal.tsx
|
|
227
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
228
|
+
var iconStyle2 = (size) => ({
|
|
229
|
+
flexShrink: 0,
|
|
230
|
+
height: size,
|
|
231
|
+
width: size
|
|
232
|
+
});
|
|
233
|
+
var simpleTerminalIcons = {
|
|
234
|
+
warp: {
|
|
235
|
+
color: "#01A4FF",
|
|
236
|
+
path: "M12.035 2.723h9.253A2.712 2.712 0 0 1 24 5.435v10.529a2.712 2.712 0 0 1-2.712 2.713H8.047Zm-1.681 2.6L6.766 19.677h5.598l-.399 1.6H2.712A2.712 2.712 0 0 1 0 18.565V8.036a2.712 2.712 0 0 1 2.712-2.712Z"
|
|
237
|
+
},
|
|
238
|
+
wezterm: {
|
|
239
|
+
color: "#4E49EE",
|
|
240
|
+
path: "M3.27 8.524c0-.623.62-1.007 2.123-1.007l-.5 2.757c-.931-.623-1.624-1.199-1.624-1.75zm4.008 6.807c0 .647-.644 1.079-2.123 1.15l.524-2.924c.931.624 1.6 1.175 1.6 1.774zm-2.625 5.992.454-2.708c3.603-.336 5.01-1.798 5.01-3.404 0-1.653-2.004-2.948-3.841-4.074l.668-3.548c.764.072 1.67.216 2.744.432l.31-2.469c-.81-.12-1.575-.168-2.29-.216L8.257 2.7l-2.363-.024-.453 2.684C1.838 5.648.43 7.158.43 8.764c0 1.63 2.004 2.876 3.841 3.954l-.668 3.716c-.859-.048-1.908-.192-3.125-.408L0 18.495c1.026.12 1.98.192 2.84.216l-.525 2.588zm15.553-1.894h2.673c.334-2.804.81-8.46 1.121-14.86h-2.553c-.071 1.51-.334 10.498-.43 11.241h-.071c-.644-2.42-1.169-4.386-1.813-6.782h-1.456c-.62 2.396-1.05 4.194-1.694 6.782h-.096c-.071-.743-.477-9.73-.525-11.24h-2.648c.31 6.399.763 12.055 1.097 14.86h2.625l1.838-7.12z"
|
|
241
|
+
},
|
|
242
|
+
alacritty: {
|
|
243
|
+
color: "#F46D01",
|
|
244
|
+
path: "m10.065 0-8.57 21.269h3.595l6.91-16.244 6.91 16.244h3.594l-8.57-21.269zm1.935 9.935c-.76666 1.8547-1.5334 3.7094-2.298 5.565 1.475 4.54 1.475 4.54 2.298 8.5.823-3.96.823-3.96 2.297-8.5-.76637-1.8547-1.5315-3.7099-2.297-5.565z"
|
|
245
|
+
},
|
|
246
|
+
"gnome-terminal": {
|
|
247
|
+
color: CURRENT_COLOR,
|
|
248
|
+
path: "M1.846 0A1.841 1.841 0 000 1.846v18.463c0 1.022.823 1.845 1.846 1.845h20.308A1.841 1.841 0 0024 20.31V1.846A1.841 1.841 0 0022.154 0H1.846zm0 .924h20.308c.512 0 .922.41.922.922v18.463c0 .511-.41.921-.922.921H1.846a.919.919 0 01-.922-.921V1.846c0-.512.41-.922.922-.922zm0 .922v18.463h20.308V1.846H1.846zm1.845 2.14l3.235 1.758v.836L3.69 8.477V7.385l2.243-1.207v-.033L3.69 5.076v-1.09zM7.846 9.23h3.693v.924H7.846V9.23zM0 21.736v.418C0 23.177.823 24 1.846 24h20.308A1.841 1.841 0 0024 22.154v-.418a2.334 2.334 0 01-1.846.918H1.846A2.334 2.334 0 010 21.736Z"
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
var TerminalIcon = ({ terminalId, size }) => {
|
|
252
|
+
const hasArtwork = terminalId === "terminal" || terminalId === "iterm2" || terminalId === "ghostty" || terminalId === "windows-terminal";
|
|
253
|
+
if (hasArtwork) {
|
|
254
|
+
return /* @__PURE__ */ jsx6("img", {
|
|
255
|
+
alt: "",
|
|
256
|
+
"aria-hidden": true,
|
|
257
|
+
"data-terminal-icon": terminalId,
|
|
258
|
+
draggable: false,
|
|
259
|
+
src: `/api/app-icon/terminal/${terminalId}.png`,
|
|
260
|
+
style: iconStyle2(size)
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
const icon = simpleTerminalIcons[terminalId];
|
|
264
|
+
if (!icon) {
|
|
265
|
+
return /* @__PURE__ */ jsx6(AppsIcon, {
|
|
266
|
+
"aria-hidden": true,
|
|
267
|
+
"data-terminal-icon": terminalId,
|
|
268
|
+
height: size,
|
|
269
|
+
width: size
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
return /* @__PURE__ */ jsx6("svg", {
|
|
273
|
+
"aria-hidden": true,
|
|
274
|
+
"data-terminal-icon": terminalId,
|
|
275
|
+
style: iconStyle2(size),
|
|
276
|
+
viewBox: "0 0 24 24",
|
|
277
|
+
children: /* @__PURE__ */ jsx6("path", {
|
|
278
|
+
d: icon.path,
|
|
279
|
+
fill: icon.color
|
|
280
|
+
})
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// src/api/delete-static-file.ts
|
|
285
|
+
import { getRemotionEnvironment } from "remotion";
|
|
286
|
+
|
|
287
|
+
// src/helpers/inserted-element-selection.ts
|
|
288
|
+
var pendingSelection = null;
|
|
289
|
+
var listeners = new Set;
|
|
290
|
+
var requestInsertedElementSelection = (selection) => {
|
|
291
|
+
pendingSelection = selection;
|
|
292
|
+
for (const listener of listeners) {
|
|
293
|
+
listener();
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
var clearInsertedElementSelection = (selection) => {
|
|
297
|
+
if (pendingSelection !== selection) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
pendingSelection = null;
|
|
301
|
+
for (const listener of listeners) {
|
|
302
|
+
listener();
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
var subscribeToInsertedElementSelection = (listener) => {
|
|
306
|
+
listeners.add(listener);
|
|
307
|
+
return () => listeners.delete(listener);
|
|
308
|
+
};
|
|
309
|
+
var getInsertedElementSelection = () => pendingSelection;
|
|
310
|
+
|
|
311
|
+
// src/helpers/sequence-node-path-mutations.ts
|
|
312
|
+
var pendingMutations = [];
|
|
313
|
+
var seenMutationIds = new Set;
|
|
314
|
+
var queueSequenceNodePathMutation = (mutation) => {
|
|
315
|
+
if (seenMutationIds.has(mutation.mutationId)) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
seenMutationIds.add(mutation.mutationId);
|
|
319
|
+
pendingMutations.push(mutation);
|
|
320
|
+
if (mutation.timelineSelection !== null) {
|
|
321
|
+
requestInsertedElementSelection({
|
|
322
|
+
compositionId: mutation.timelineSelection.compositionId,
|
|
323
|
+
nodePath: {
|
|
324
|
+
absolutePath: mutation.timelineSelection.absolutePath,
|
|
325
|
+
nodePath: mutation.timelineSelection.nodePath
|
|
326
|
+
},
|
|
327
|
+
notification: null
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
var queueSequenceNodePathMutationFromApiResponse = (response) => {
|
|
332
|
+
if (typeof response !== "object" || response === null || !("nodePathMutation" in response)) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
const { nodePathMutation } = response;
|
|
336
|
+
if (typeof nodePathMutation !== "object" || nodePathMutation === null || !("mutationId" in nodePathMutation) || typeof nodePathMutation.mutationId !== "string") {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
queueSequenceNodePathMutation(nodePathMutation);
|
|
340
|
+
};
|
|
341
|
+
var takePendingSequenceNodePathMutations = () => pendingMutations.splice(0);
|
|
342
|
+
|
|
343
|
+
// src/components/call-api.ts
|
|
344
|
+
var callApi = (endpoint, body, signal) => {
|
|
345
|
+
return new Promise((resolve, reject) => {
|
|
346
|
+
fetch(endpoint, {
|
|
347
|
+
method: "post",
|
|
348
|
+
headers: {
|
|
349
|
+
"content-type": "application/json"
|
|
350
|
+
},
|
|
351
|
+
signal,
|
|
352
|
+
body: JSON.stringify(body)
|
|
353
|
+
}).then((res) => res.json()).then((data) => {
|
|
354
|
+
if (data.success) {
|
|
355
|
+
queueSequenceNodePathMutationFromApiResponse(data.data);
|
|
356
|
+
resolve(data.data);
|
|
357
|
+
} else {
|
|
358
|
+
reject(new Error(data.error));
|
|
359
|
+
}
|
|
360
|
+
}).catch((err) => {
|
|
361
|
+
reject(err);
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
// src/api/delete-static-file.ts
|
|
367
|
+
var deleteStaticFile = async (relativePath) => {
|
|
368
|
+
if (!getRemotionEnvironment().isStudio) {
|
|
369
|
+
throw new Error("deleteStaticFile() is only available in the Studio");
|
|
370
|
+
}
|
|
371
|
+
if (relativePath.startsWith(window.remotion_staticBase)) {
|
|
372
|
+
relativePath = relativePath.substring(window.remotion_staticBase.length + 1);
|
|
373
|
+
}
|
|
374
|
+
const browserStudioOperations = getBrowserStudioOperations();
|
|
375
|
+
if (browserStudioOperations) {
|
|
376
|
+
return browserStudioOperations.deleteStaticFile({ relativePath });
|
|
377
|
+
}
|
|
378
|
+
if (window.remotion_isReadOnlyStudio) {
|
|
379
|
+
throw new Error("deleteStaticFile() is not available in Read-Only Studio");
|
|
380
|
+
}
|
|
381
|
+
const res = await callApi("/api/delete-static-file", { relativePath });
|
|
382
|
+
return res;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
// src/api/get-static-files.ts
|
|
386
|
+
var warnedServer = false;
|
|
387
|
+
var warnedPlayer = false;
|
|
388
|
+
var warnServerOnce = () => {
|
|
389
|
+
if (warnedServer) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
warnedServer = true;
|
|
393
|
+
console.warn("Called getStaticFiles() on the server. The API is only available in the browser. An empty array was returned.");
|
|
394
|
+
};
|
|
395
|
+
var warnPlayerOnce = () => {
|
|
396
|
+
if (warnedPlayer) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
warnedPlayer = true;
|
|
400
|
+
console.warn("Called getStaticFiles() while using the Remotion Player. The API is only available while using the Remotion Studio. An empty array was returned.");
|
|
401
|
+
};
|
|
402
|
+
var getStaticFiles = () => {
|
|
403
|
+
if (typeof document === "undefined") {
|
|
404
|
+
warnServerOnce();
|
|
405
|
+
return [];
|
|
406
|
+
}
|
|
407
|
+
if (window.remotion_isPlayer) {
|
|
408
|
+
warnPlayerOnce();
|
|
409
|
+
return [];
|
|
410
|
+
}
|
|
411
|
+
return window.remotion_staticFiles;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
// src/api/shut-down-studio.ts
|
|
415
|
+
import { getRemotionEnvironment as getRemotionEnvironment2 } from "remotion";
|
|
416
|
+
var shutDownStudio = () => {
|
|
417
|
+
if (!getRemotionEnvironment2().isStudio) {
|
|
418
|
+
throw new Error("shutDownStudio() is only available in the Studio");
|
|
419
|
+
}
|
|
420
|
+
if (getBrowserStudioOperations() !== null) {
|
|
421
|
+
throw new Error("shutDownStudio() is not supported in Browser Studio");
|
|
422
|
+
}
|
|
423
|
+
if (window.remotion_isReadOnlyStudio) {
|
|
424
|
+
throw new Error("shutDownStudio() is not available in read-only Studio");
|
|
425
|
+
}
|
|
426
|
+
return callApi("/api/shutdown-studio", {});
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
// src/components/RenderQueue/actions.ts
|
|
430
|
+
import { NoReactInternals } from "remotion/no-react";
|
|
431
|
+
var addStillRenderJob = ({
|
|
432
|
+
compositionId,
|
|
433
|
+
outName,
|
|
434
|
+
imageFormat,
|
|
435
|
+
jpegQuality,
|
|
436
|
+
frame,
|
|
437
|
+
scale,
|
|
438
|
+
logLevel,
|
|
439
|
+
chromiumOptions,
|
|
440
|
+
delayRenderTimeout,
|
|
441
|
+
envVariables,
|
|
442
|
+
inputProps,
|
|
443
|
+
offthreadVideoCacheSizeInBytes,
|
|
444
|
+
offthreadVideoThreads,
|
|
445
|
+
multiProcessOnLinux,
|
|
446
|
+
beepOnFinish,
|
|
447
|
+
metadata,
|
|
448
|
+
chromeMode,
|
|
449
|
+
mediaCacheSizeInBytes,
|
|
450
|
+
licenseKey
|
|
451
|
+
}) => {
|
|
452
|
+
return callApi("/api/render", {
|
|
453
|
+
compositionId,
|
|
454
|
+
type: "still",
|
|
455
|
+
outName,
|
|
456
|
+
imageFormat,
|
|
457
|
+
jpegQuality,
|
|
458
|
+
frame,
|
|
459
|
+
scale,
|
|
460
|
+
logLevel,
|
|
461
|
+
chromiumOptions,
|
|
462
|
+
delayRenderTimeout,
|
|
463
|
+
envVariables,
|
|
464
|
+
serializedInputPropsWithCustomSchema: NoReactInternals.serializeJSONWithSpecialTypes({
|
|
465
|
+
data: inputProps,
|
|
466
|
+
staticBase: window.remotion_staticBase,
|
|
467
|
+
indent: undefined
|
|
468
|
+
}).serializedString,
|
|
469
|
+
offthreadVideoCacheSizeInBytes,
|
|
470
|
+
offthreadVideoThreads,
|
|
471
|
+
multiProcessOnLinux,
|
|
472
|
+
beepOnFinish,
|
|
473
|
+
metadata,
|
|
474
|
+
chromeMode,
|
|
475
|
+
mediaCacheSizeInBytes,
|
|
476
|
+
licenseKey
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
var addSequenceRenderJob = ({
|
|
480
|
+
compositionId,
|
|
481
|
+
outName,
|
|
482
|
+
imageFormat,
|
|
483
|
+
startFrame,
|
|
484
|
+
endFrame,
|
|
485
|
+
scale,
|
|
486
|
+
logLevel,
|
|
487
|
+
chromiumOptions,
|
|
488
|
+
delayRenderTimeout,
|
|
489
|
+
envVariables,
|
|
490
|
+
inputProps,
|
|
491
|
+
concurrency,
|
|
492
|
+
offthreadVideoCacheSizeInBytes,
|
|
493
|
+
offthreadVideoThreads,
|
|
494
|
+
jpegQuality,
|
|
495
|
+
disallowParallelEncoding,
|
|
496
|
+
multiProcessOnLinux,
|
|
497
|
+
beepOnFinish,
|
|
498
|
+
repro,
|
|
499
|
+
metadata,
|
|
500
|
+
chromeMode,
|
|
501
|
+
mediaCacheSizeInBytes
|
|
502
|
+
}) => {
|
|
503
|
+
return callApi("/api/render", {
|
|
504
|
+
compositionId,
|
|
505
|
+
type: "sequence",
|
|
506
|
+
outName,
|
|
507
|
+
imageFormat,
|
|
508
|
+
jpegQuality,
|
|
509
|
+
scale,
|
|
510
|
+
startFrame,
|
|
511
|
+
endFrame,
|
|
512
|
+
logLevel,
|
|
513
|
+
chromiumOptions,
|
|
514
|
+
delayRenderTimeout,
|
|
515
|
+
envVariables,
|
|
516
|
+
concurrency,
|
|
517
|
+
serializedInputPropsWithCustomSchema: NoReactInternals.serializeJSONWithSpecialTypes({
|
|
518
|
+
data: inputProps,
|
|
519
|
+
staticBase: window.remotion_staticBase,
|
|
520
|
+
indent: undefined
|
|
521
|
+
}).serializedString,
|
|
522
|
+
offthreadVideoCacheSizeInBytes,
|
|
523
|
+
offthreadVideoThreads,
|
|
524
|
+
disallowParallelEncoding,
|
|
525
|
+
multiProcessOnLinux,
|
|
526
|
+
beepOnFinish,
|
|
527
|
+
repro,
|
|
528
|
+
metadata,
|
|
529
|
+
chromeMode,
|
|
530
|
+
mediaCacheSizeInBytes
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
var addVideoRenderJob = ({
|
|
534
|
+
compositionId,
|
|
535
|
+
outName,
|
|
536
|
+
imageFormat,
|
|
537
|
+
jpegQuality,
|
|
538
|
+
scale,
|
|
539
|
+
logLevel,
|
|
540
|
+
codec,
|
|
541
|
+
concurrency,
|
|
542
|
+
crf,
|
|
543
|
+
gopSize,
|
|
544
|
+
startFrame,
|
|
545
|
+
endFrame,
|
|
546
|
+
muted,
|
|
547
|
+
enforceAudioTrack,
|
|
548
|
+
proResProfile,
|
|
549
|
+
x264Preset,
|
|
550
|
+
pixelFormat,
|
|
551
|
+
audioBitrate,
|
|
552
|
+
videoBitrate,
|
|
553
|
+
everyNthFrame,
|
|
554
|
+
numberOfGifLoops,
|
|
555
|
+
delayRenderTimeout,
|
|
556
|
+
audioCodec,
|
|
557
|
+
disallowParallelEncoding,
|
|
558
|
+
chromiumOptions,
|
|
559
|
+
envVariables,
|
|
560
|
+
inputProps,
|
|
561
|
+
offthreadVideoCacheSizeInBytes,
|
|
562
|
+
offthreadVideoThreads,
|
|
563
|
+
colorSpace,
|
|
564
|
+
multiProcessOnLinux,
|
|
565
|
+
encodingMaxRate,
|
|
566
|
+
encodingBufferSize,
|
|
567
|
+
beepOnFinish,
|
|
568
|
+
repro,
|
|
569
|
+
forSeamlessAacConcatenation,
|
|
570
|
+
separateAudioTo,
|
|
571
|
+
metadata,
|
|
572
|
+
hardwareAcceleration,
|
|
573
|
+
chromeMode,
|
|
574
|
+
mediaCacheSizeInBytes,
|
|
575
|
+
sampleRate,
|
|
576
|
+
licenseKey
|
|
577
|
+
}) => {
|
|
578
|
+
return callApi("/api/render", {
|
|
579
|
+
compositionId,
|
|
580
|
+
type: "video",
|
|
581
|
+
outName,
|
|
582
|
+
imageFormat,
|
|
583
|
+
jpegQuality,
|
|
584
|
+
scale,
|
|
585
|
+
logLevel,
|
|
586
|
+
codec,
|
|
587
|
+
concurrency,
|
|
588
|
+
crf,
|
|
589
|
+
gopSize,
|
|
590
|
+
endFrame,
|
|
591
|
+
startFrame,
|
|
592
|
+
muted,
|
|
593
|
+
enforceAudioTrack,
|
|
594
|
+
proResProfile,
|
|
595
|
+
x264Preset,
|
|
596
|
+
pixelFormat,
|
|
597
|
+
audioBitrate,
|
|
598
|
+
videoBitrate,
|
|
599
|
+
everyNthFrame,
|
|
600
|
+
numberOfGifLoops,
|
|
601
|
+
delayRenderTimeout,
|
|
602
|
+
audioCodec,
|
|
603
|
+
disallowParallelEncoding,
|
|
604
|
+
chromiumOptions,
|
|
605
|
+
envVariables,
|
|
606
|
+
serializedInputPropsWithCustomSchema: NoReactInternals.serializeJSONWithSpecialTypes({
|
|
607
|
+
data: inputProps,
|
|
608
|
+
staticBase: window.remotion_staticBase,
|
|
609
|
+
indent: undefined
|
|
610
|
+
}).serializedString,
|
|
611
|
+
offthreadVideoCacheSizeInBytes,
|
|
612
|
+
offthreadVideoThreads,
|
|
613
|
+
colorSpace,
|
|
614
|
+
multiProcessOnLinux,
|
|
615
|
+
encodingBufferSize,
|
|
616
|
+
encodingMaxRate,
|
|
617
|
+
beepOnFinish,
|
|
618
|
+
repro,
|
|
619
|
+
forSeamlessAacConcatenation,
|
|
620
|
+
separateAudioTo,
|
|
621
|
+
metadata,
|
|
622
|
+
hardwareAcceleration,
|
|
623
|
+
chromeMode,
|
|
624
|
+
mediaCacheSizeInBytes,
|
|
625
|
+
sampleRate,
|
|
626
|
+
licenseKey
|
|
627
|
+
});
|
|
628
|
+
};
|
|
629
|
+
var unsubscribeFromFileExistenceWatcher = ({
|
|
630
|
+
file,
|
|
631
|
+
clientId
|
|
632
|
+
}) => {
|
|
633
|
+
return callApi("/api/unsubscribe-from-file-existence", { file, clientId });
|
|
634
|
+
};
|
|
635
|
+
var subscribeToFileExistenceWatcher = async ({
|
|
636
|
+
file,
|
|
637
|
+
clientId
|
|
638
|
+
}) => {
|
|
639
|
+
const { exists } = await callApi("/api/subscribe-to-file-existence", {
|
|
640
|
+
file,
|
|
641
|
+
clientId
|
|
642
|
+
});
|
|
643
|
+
return exists;
|
|
644
|
+
};
|
|
645
|
+
var openInFileExplorer = ({ directory }) => {
|
|
646
|
+
const body = {
|
|
647
|
+
directory
|
|
648
|
+
};
|
|
649
|
+
return callApi("/api/open-in-file-explorer", body);
|
|
650
|
+
};
|
|
651
|
+
var applyCodemod = ({
|
|
652
|
+
codemod,
|
|
653
|
+
dryRun,
|
|
654
|
+
symbolicatedStack,
|
|
655
|
+
signal
|
|
656
|
+
}) => {
|
|
657
|
+
const body = {
|
|
658
|
+
codemod,
|
|
659
|
+
dryRun,
|
|
660
|
+
symbolicatedStack
|
|
661
|
+
};
|
|
662
|
+
const browserStudioOperations = getBrowserStudioOperations();
|
|
663
|
+
if (browserStudioOperations !== null) {
|
|
664
|
+
return browserStudioOperations.applyCodemod(body);
|
|
665
|
+
}
|
|
666
|
+
return callApi("/api/apply-codemod", body, signal);
|
|
667
|
+
};
|
|
668
|
+
var removeRenderJob = (job) => {
|
|
669
|
+
return callApi("/api/remove-render", {
|
|
670
|
+
jobId: job.id
|
|
671
|
+
});
|
|
672
|
+
};
|
|
673
|
+
var cancelRenderJob = (job) => {
|
|
674
|
+
return callApi("/api/cancel", {
|
|
675
|
+
jobId: job.id
|
|
676
|
+
});
|
|
677
|
+
};
|
|
678
|
+
var updateAvailable = (signal) => {
|
|
679
|
+
return callApi("/api/update-available", {}, signal);
|
|
680
|
+
};
|
|
681
|
+
var getReleaseNotes = (currentVersion, latestVersion, signal) => {
|
|
682
|
+
return callApi("/api/release-notes", { currentVersion, latestVersion }, signal);
|
|
683
|
+
};
|
|
684
|
+
var callUpdateDefaultPropsApi = (compositionId, defaultProps, enumPaths) => {
|
|
685
|
+
const body = {
|
|
686
|
+
compositionId,
|
|
687
|
+
defaultProps: NoReactInternals.serializeJSONWithSpecialTypes({
|
|
688
|
+
data: defaultProps,
|
|
689
|
+
indent: undefined,
|
|
690
|
+
staticBase: window.remotion_staticBase
|
|
691
|
+
}).serializedString,
|
|
692
|
+
enumPaths
|
|
693
|
+
};
|
|
694
|
+
const browserStudioOperations = getBrowserStudioOperations();
|
|
695
|
+
if (browserStudioOperations !== null) {
|
|
696
|
+
return browserStudioOperations.updateDefaultProps(body);
|
|
697
|
+
}
|
|
698
|
+
return callApi("/api/update-default-props", body);
|
|
699
|
+
};
|
|
700
|
+
var applyVisualControlChange = ({
|
|
701
|
+
fileName,
|
|
702
|
+
changes
|
|
703
|
+
}) => {
|
|
704
|
+
return callApi("/api/apply-visual-control-change", {
|
|
705
|
+
fileName,
|
|
706
|
+
changes
|
|
707
|
+
});
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
// src/api/watch-public-folder.ts
|
|
711
|
+
import { getRemotionEnvironment as getRemotionEnvironment3 } from "remotion";
|
|
712
|
+
var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
|
|
713
|
+
var watchPublicFolder = (callback) => {
|
|
714
|
+
if (!getRemotionEnvironment3().isStudio) {
|
|
715
|
+
console.warn("The watchPublicFolder() API is only available while using the Remotion Studio.");
|
|
716
|
+
return { cancel: () => {
|
|
717
|
+
return;
|
|
718
|
+
} };
|
|
719
|
+
}
|
|
720
|
+
if (window.remotion_isReadOnlyStudio && !getBrowserStudioOperations()) {
|
|
721
|
+
throw new Error("watchPublicFolder() is not available in read-only Studio");
|
|
722
|
+
}
|
|
723
|
+
const emitUpdate = () => {
|
|
724
|
+
callback(getStaticFiles());
|
|
725
|
+
};
|
|
726
|
+
window.addEventListener(WATCH_REMOTION_STATIC_FILES, emitUpdate);
|
|
727
|
+
const cancel = () => {
|
|
728
|
+
return window.removeEventListener(WATCH_REMOTION_STATIC_FILES, emitUpdate);
|
|
729
|
+
};
|
|
730
|
+
return { cancel };
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
// src/components/RenderModal/SchemaEditor/scroll-to-default-props-path.ts
|
|
734
|
+
import React from "react";
|
|
735
|
+
var DEFAULT_PROPS_PATH_CLASSNAME = "__remotion-default-props-editor-label";
|
|
736
|
+
var DEFAULT_PROPS_PATH_ACTIVE_CLASSNAME = "__remotion-default-props-editor-label-active";
|
|
737
|
+
var defaultPropsEditorScrollableAreaRef = React.createRef();
|
|
738
|
+
|
|
739
|
+
// src/components/RenderModal/SchemaEditor/zod-schema-type.ts
|
|
740
|
+
var zodSafeParse = (schema, data) => {
|
|
741
|
+
return schema.safeParse(data);
|
|
742
|
+
};
|
|
743
|
+
var getZodDef = (schema) => {
|
|
744
|
+
if (schema._def)
|
|
745
|
+
return schema._def;
|
|
746
|
+
if (schema._zod)
|
|
747
|
+
return schema._zod.def;
|
|
748
|
+
throw new Error("Invalid zod schema: missing _def and _zod");
|
|
749
|
+
};
|
|
750
|
+
var v3TypeNameMap = {
|
|
751
|
+
ZodString: "string",
|
|
752
|
+
ZodNumber: "number",
|
|
753
|
+
ZodBoolean: "boolean",
|
|
754
|
+
ZodObject: "object",
|
|
755
|
+
ZodArray: "array",
|
|
756
|
+
ZodEnum: "enum",
|
|
757
|
+
ZodUnion: "union",
|
|
758
|
+
ZodDiscriminatedUnion: "discriminatedUnion",
|
|
759
|
+
ZodOptional: "optional",
|
|
760
|
+
ZodNullable: "nullable",
|
|
761
|
+
ZodDefault: "default",
|
|
762
|
+
ZodTuple: "tuple",
|
|
763
|
+
ZodDate: "date",
|
|
764
|
+
ZodAny: "any",
|
|
765
|
+
ZodUnknown: "unknown",
|
|
766
|
+
ZodBigInt: "bigint",
|
|
767
|
+
ZodNull: "null",
|
|
768
|
+
ZodUndefined: "undefined",
|
|
769
|
+
ZodEffects: "effects",
|
|
770
|
+
ZodLiteral: "literal",
|
|
771
|
+
ZodRecord: "record",
|
|
772
|
+
ZodNever: "never",
|
|
773
|
+
ZodVoid: "void",
|
|
774
|
+
ZodNaN: "nan",
|
|
775
|
+
ZodSymbol: "symbol",
|
|
776
|
+
ZodIntersection: "intersection",
|
|
777
|
+
ZodMap: "map",
|
|
778
|
+
ZodSet: "set",
|
|
779
|
+
ZodLazy: "lazy",
|
|
780
|
+
ZodFunction: "function",
|
|
781
|
+
ZodNativeEnum: "nativeEnum",
|
|
782
|
+
ZodCatch: "catch",
|
|
783
|
+
ZodPromise: "promise",
|
|
784
|
+
ZodBranded: "branded",
|
|
785
|
+
ZodPipeline: "pipeline"
|
|
786
|
+
};
|
|
787
|
+
var isZodV3Schema = (schema) => {
|
|
788
|
+
const def = getZodDef(schema);
|
|
789
|
+
return "typeName" in def;
|
|
790
|
+
};
|
|
791
|
+
var getZodSchemaType = (schema) => {
|
|
792
|
+
const def = getZodDef(schema);
|
|
793
|
+
if ("typeName" in def) {
|
|
794
|
+
const { typeName } = def;
|
|
795
|
+
return v3TypeNameMap[typeName] ?? typeName;
|
|
796
|
+
}
|
|
797
|
+
const { type } = def;
|
|
798
|
+
if (type === "union" && def.discriminator !== undefined) {
|
|
799
|
+
return "discriminatedUnion";
|
|
800
|
+
}
|
|
801
|
+
return type;
|
|
802
|
+
};
|
|
803
|
+
var getZodSchemaDescription = (schema) => {
|
|
804
|
+
if (isZodV3Schema(schema)) {
|
|
805
|
+
return getZodDef(schema).description;
|
|
806
|
+
}
|
|
807
|
+
return schema.description;
|
|
808
|
+
};
|
|
809
|
+
var REMOTION_BRAND_PREFIX = "__remotion-";
|
|
810
|
+
var getUserFacingDescription = (schema) => {
|
|
811
|
+
const description = getZodSchemaDescription(schema);
|
|
812
|
+
if (!description || description.startsWith(REMOTION_BRAND_PREFIX)) {
|
|
813
|
+
return null;
|
|
814
|
+
}
|
|
815
|
+
return description;
|
|
816
|
+
};
|
|
817
|
+
var getObjectShape = (schema) => {
|
|
818
|
+
const { shape } = getZodDef(schema);
|
|
819
|
+
return typeof shape === "function" ? shape() : shape;
|
|
820
|
+
};
|
|
821
|
+
var getArrayElement = (schema) => {
|
|
822
|
+
const def = getZodDef(schema);
|
|
823
|
+
return isZodV3Schema(schema) ? def.type : def.element;
|
|
824
|
+
};
|
|
825
|
+
var getInnerType = (schema) => {
|
|
826
|
+
return getZodDef(schema).innerType;
|
|
827
|
+
};
|
|
828
|
+
var getEffectsInner = (schema) => {
|
|
829
|
+
return getZodDef(schema).schema;
|
|
830
|
+
};
|
|
831
|
+
var getLiteralValue = (schema) => {
|
|
832
|
+
const def = getZodDef(schema);
|
|
833
|
+
if (isZodV3Schema(schema)) {
|
|
834
|
+
return def.value;
|
|
835
|
+
}
|
|
836
|
+
return def.values?.[0];
|
|
837
|
+
};
|
|
838
|
+
var getEnumValues = (schema) => {
|
|
839
|
+
const def = getZodDef(schema);
|
|
840
|
+
if (isZodV3Schema(schema)) {
|
|
841
|
+
return def.values;
|
|
842
|
+
}
|
|
843
|
+
const { entries } = def;
|
|
844
|
+
return Object.values(entries);
|
|
845
|
+
};
|
|
846
|
+
var getFirstEnumValue = (schema) => {
|
|
847
|
+
const def = getZodDef(schema);
|
|
848
|
+
if (isZodV3Schema(schema)) {
|
|
849
|
+
if (def.typeName === "ZodNativeEnum") {
|
|
850
|
+
const vals = Object.values(def.values);
|
|
851
|
+
return vals[0];
|
|
852
|
+
}
|
|
853
|
+
return def.values[0];
|
|
854
|
+
}
|
|
855
|
+
const { entries } = def;
|
|
856
|
+
const pairs = Object.entries(entries);
|
|
857
|
+
const hasReverseMapping = pairs.some(([key, value]) => key !== String(value));
|
|
858
|
+
if (hasReverseMapping) {
|
|
859
|
+
const forwardPairs = pairs.filter(([key]) => Number.isNaN(Number(key)));
|
|
860
|
+
if (forwardPairs.length > 0) {
|
|
861
|
+
return forwardPairs[0][1];
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
return Object.values(entries)[0];
|
|
865
|
+
};
|
|
866
|
+
var getUnionOptions = (schema) => {
|
|
867
|
+
return getZodDef(schema).options;
|
|
868
|
+
};
|
|
869
|
+
var getDefaultValue = (schema) => {
|
|
870
|
+
const dv = getZodDef(schema).defaultValue;
|
|
871
|
+
return typeof dv === "function" ? dv() : dv;
|
|
872
|
+
};
|
|
873
|
+
var getDiscriminator = (schema) => {
|
|
874
|
+
return getZodDef(schema).discriminator;
|
|
875
|
+
};
|
|
876
|
+
var getDiscriminatedOptionKeys = (schema) => {
|
|
877
|
+
const def = getZodDef(schema);
|
|
878
|
+
const discriminator = getDiscriminator(schema);
|
|
879
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
880
|
+
return [...def.optionsMap.keys()];
|
|
881
|
+
}
|
|
882
|
+
const options = getUnionOptions(schema);
|
|
883
|
+
return options.map((option) => {
|
|
884
|
+
const shape = getObjectShape(option);
|
|
885
|
+
const discriminatorSchema = shape[discriminator];
|
|
886
|
+
return getLiteralValue(discriminatorSchema);
|
|
887
|
+
});
|
|
888
|
+
};
|
|
889
|
+
var getDiscriminatedOption = (schema, discriminatorValue) => {
|
|
890
|
+
const def = getZodDef(schema);
|
|
891
|
+
const discriminator = getDiscriminator(schema);
|
|
892
|
+
if (isZodV3Schema(schema) && def.optionsMap) {
|
|
893
|
+
return def.optionsMap.get(discriminatorValue);
|
|
894
|
+
}
|
|
895
|
+
const options = getUnionOptions(schema);
|
|
896
|
+
return options.find((option) => {
|
|
897
|
+
const shape = getObjectShape(option);
|
|
898
|
+
const discriminatorSchema = shape[discriminator];
|
|
899
|
+
return getLiteralValue(discriminatorSchema) === discriminatorValue;
|
|
900
|
+
});
|
|
901
|
+
};
|
|
902
|
+
var getIntersectionSchemas = (schema) => {
|
|
903
|
+
const def = getZodDef(schema);
|
|
904
|
+
return { left: def.left, right: def.right };
|
|
905
|
+
};
|
|
906
|
+
var getTupleItems = (schema) => {
|
|
907
|
+
return getZodDef(schema).items;
|
|
908
|
+
};
|
|
909
|
+
var getRecordValueType = (schema) => {
|
|
910
|
+
return getZodDef(schema).valueType;
|
|
911
|
+
};
|
|
912
|
+
var getRecordKeyType = (schema) => {
|
|
913
|
+
return getZodDef(schema).keyType;
|
|
914
|
+
};
|
|
915
|
+
var getPipelineOutput = (schema) => {
|
|
916
|
+
return getZodDef(schema).out;
|
|
917
|
+
};
|
|
918
|
+
var getPipelineInput = (schema) => {
|
|
919
|
+
return getZodDef(schema).in;
|
|
920
|
+
};
|
|
921
|
+
var getBrandedInner = (schema) => {
|
|
922
|
+
return isZodV3Schema(schema) ? getZodDef(schema).type : schema;
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
// src/components/RenderModal/SchemaEditor/extract-enum-json-paths.ts
|
|
926
|
+
var extractEnumJsonPaths = ({
|
|
927
|
+
schema,
|
|
928
|
+
zodRuntime,
|
|
929
|
+
currentPath,
|
|
930
|
+
zodTypes
|
|
931
|
+
}) => {
|
|
932
|
+
const description = getZodSchemaDescription(schema);
|
|
933
|
+
if (zodTypes && description === zodTypes.ZodZypesInternals.REMOTION_MATRIX_BRAND) {
|
|
934
|
+
return [currentPath];
|
|
935
|
+
}
|
|
936
|
+
const typeName = getZodSchemaType(schema);
|
|
937
|
+
switch (typeName) {
|
|
938
|
+
case "object": {
|
|
939
|
+
const shape = getObjectShape(schema);
|
|
940
|
+
const keys = Object.keys(shape);
|
|
941
|
+
return keys.map((key) => {
|
|
942
|
+
return extractEnumJsonPaths({
|
|
943
|
+
schema: shape[key],
|
|
944
|
+
zodRuntime,
|
|
945
|
+
currentPath: [...currentPath, key],
|
|
946
|
+
zodTypes
|
|
947
|
+
});
|
|
948
|
+
}).flat(1);
|
|
949
|
+
}
|
|
950
|
+
case "array": {
|
|
951
|
+
return extractEnumJsonPaths({
|
|
952
|
+
schema: getArrayElement(schema),
|
|
953
|
+
zodRuntime,
|
|
954
|
+
currentPath: [...currentPath, "[]"],
|
|
955
|
+
zodTypes
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
case "union": {
|
|
959
|
+
return getUnionOptions(schema).map((option) => {
|
|
960
|
+
return extractEnumJsonPaths({
|
|
961
|
+
schema: option,
|
|
962
|
+
zodRuntime,
|
|
963
|
+
currentPath,
|
|
964
|
+
zodTypes
|
|
965
|
+
});
|
|
966
|
+
}).flat(1);
|
|
967
|
+
}
|
|
968
|
+
case "discriminatedUnion": {
|
|
969
|
+
return getUnionOptions(schema).map((op) => {
|
|
970
|
+
return extractEnumJsonPaths({
|
|
971
|
+
schema: op,
|
|
972
|
+
zodRuntime,
|
|
973
|
+
currentPath,
|
|
974
|
+
zodTypes
|
|
975
|
+
});
|
|
976
|
+
}).flat(1);
|
|
977
|
+
}
|
|
978
|
+
case "literal": {
|
|
979
|
+
return [currentPath];
|
|
980
|
+
}
|
|
981
|
+
case "effects": {
|
|
982
|
+
return extractEnumJsonPaths({
|
|
983
|
+
schema: getEffectsInner(schema),
|
|
984
|
+
zodRuntime,
|
|
985
|
+
currentPath,
|
|
986
|
+
zodTypes
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
case "intersection": {
|
|
990
|
+
const { left, right } = getIntersectionSchemas(schema);
|
|
991
|
+
const leftValue = extractEnumJsonPaths({
|
|
992
|
+
schema: left,
|
|
993
|
+
zodRuntime,
|
|
994
|
+
currentPath,
|
|
995
|
+
zodTypes
|
|
996
|
+
});
|
|
997
|
+
const rightValue = extractEnumJsonPaths({
|
|
998
|
+
schema: right,
|
|
999
|
+
zodRuntime,
|
|
1000
|
+
currentPath,
|
|
1001
|
+
zodTypes
|
|
1002
|
+
});
|
|
1003
|
+
return [...leftValue, ...rightValue];
|
|
1004
|
+
}
|
|
1005
|
+
case "tuple": {
|
|
1006
|
+
return getTupleItems(schema).map((item, i) => extractEnumJsonPaths({
|
|
1007
|
+
schema: item,
|
|
1008
|
+
zodRuntime,
|
|
1009
|
+
currentPath: [...currentPath, i],
|
|
1010
|
+
zodTypes
|
|
1011
|
+
})).flat(1);
|
|
1012
|
+
}
|
|
1013
|
+
case "record": {
|
|
1014
|
+
const recordPath = [...currentPath, "{}"];
|
|
1015
|
+
const keyResults = extractEnumJsonPaths({
|
|
1016
|
+
schema: getRecordKeyType(schema),
|
|
1017
|
+
zodRuntime,
|
|
1018
|
+
currentPath: recordPath,
|
|
1019
|
+
zodTypes
|
|
1020
|
+
});
|
|
1021
|
+
const valueResults = extractEnumJsonPaths({
|
|
1022
|
+
schema: getRecordValueType(schema),
|
|
1023
|
+
zodRuntime,
|
|
1024
|
+
currentPath: recordPath,
|
|
1025
|
+
zodTypes
|
|
1026
|
+
});
|
|
1027
|
+
return [...keyResults, ...valueResults];
|
|
1028
|
+
}
|
|
1029
|
+
case "function": {
|
|
1030
|
+
throw new Error("Cannot create a value for type function");
|
|
1031
|
+
}
|
|
1032
|
+
case "enum": {
|
|
1033
|
+
return [currentPath];
|
|
1034
|
+
}
|
|
1035
|
+
case "nativeEnum": {
|
|
1036
|
+
return [];
|
|
1037
|
+
}
|
|
1038
|
+
case "optional":
|
|
1039
|
+
case "nullable":
|
|
1040
|
+
case "catch": {
|
|
1041
|
+
return extractEnumJsonPaths({
|
|
1042
|
+
schema: getInnerType(schema),
|
|
1043
|
+
zodRuntime,
|
|
1044
|
+
currentPath,
|
|
1045
|
+
zodTypes
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
case "default": {
|
|
1049
|
+
return extractEnumJsonPaths({
|
|
1050
|
+
schema: getInnerType(schema),
|
|
1051
|
+
zodRuntime,
|
|
1052
|
+
currentPath,
|
|
1053
|
+
zodTypes
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
case "promise": {
|
|
1057
|
+
return [];
|
|
1058
|
+
}
|
|
1059
|
+
case "branded": {
|
|
1060
|
+
return extractEnumJsonPaths({
|
|
1061
|
+
schema: getBrandedInner(schema),
|
|
1062
|
+
zodRuntime,
|
|
1063
|
+
currentPath,
|
|
1064
|
+
zodTypes
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
case "pipeline":
|
|
1068
|
+
case "pipe": {
|
|
1069
|
+
return extractEnumJsonPaths({
|
|
1070
|
+
schema: getPipelineOutput(schema),
|
|
1071
|
+
zodRuntime,
|
|
1072
|
+
currentPath,
|
|
1073
|
+
zodTypes
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
case "string":
|
|
1077
|
+
case "number":
|
|
1078
|
+
case "bigint":
|
|
1079
|
+
case "boolean":
|
|
1080
|
+
case "nan":
|
|
1081
|
+
case "date":
|
|
1082
|
+
case "symbol":
|
|
1083
|
+
case "undefined":
|
|
1084
|
+
case "null":
|
|
1085
|
+
case "any":
|
|
1086
|
+
case "unknown":
|
|
1087
|
+
case "never":
|
|
1088
|
+
case "void":
|
|
1089
|
+
case "map":
|
|
1090
|
+
case "lazy":
|
|
1091
|
+
case "set":
|
|
1092
|
+
case "custom": {
|
|
1093
|
+
return [];
|
|
1094
|
+
}
|
|
1095
|
+
default:
|
|
1096
|
+
throw new Error("Not implemented: " + typeName);
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
// src/helpers/use-sync-external-store.ts
|
|
1101
|
+
import { Internals } from "remotion";
|
|
1102
|
+
var { useSyncExternalStore } = Internals;
|
|
1103
|
+
|
|
1104
|
+
// src/visual-controls/visual-control-store.ts
|
|
1105
|
+
var version = 0;
|
|
1106
|
+
var listeners2 = new Set;
|
|
1107
|
+
var visualControlStore = {
|
|
1108
|
+
subscribe(listener) {
|
|
1109
|
+
listeners2.add(listener);
|
|
1110
|
+
return () => {
|
|
1111
|
+
listeners2.delete(listener);
|
|
1112
|
+
};
|
|
1113
|
+
},
|
|
1114
|
+
getSnapshot() {
|
|
1115
|
+
return version;
|
|
1116
|
+
},
|
|
1117
|
+
emitChange() {
|
|
1118
|
+
version++;
|
|
1119
|
+
for (const listener of listeners2) {
|
|
1120
|
+
listener();
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
|
|
1125
|
+
// src/components/get-zod-if-possible.tsx
|
|
1126
|
+
import {
|
|
1127
|
+
createContext,
|
|
1128
|
+
useContext,
|
|
1129
|
+
useEffect,
|
|
1130
|
+
useMemo,
|
|
1131
|
+
useState
|
|
1132
|
+
} from "react";
|
|
1133
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1134
|
+
async function getZodIfPossible() {
|
|
1135
|
+
try {
|
|
1136
|
+
const { z } = await import("zod");
|
|
1137
|
+
return z;
|
|
1138
|
+
} catch {
|
|
1139
|
+
return null;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
var getZodV3IfPossible = async () => {
|
|
1143
|
+
try {
|
|
1144
|
+
const mod = await import("zod/v3");
|
|
1145
|
+
return mod;
|
|
1146
|
+
} catch {
|
|
1147
|
+
return null;
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
var getZTypesIfPossible = async () => {
|
|
1151
|
+
try {
|
|
1152
|
+
const mod = await import("@remotion/zod-types");
|
|
1153
|
+
return mod;
|
|
1154
|
+
} catch {
|
|
1155
|
+
return null;
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
function useZodIfPossible() {
|
|
1159
|
+
const context = useContext(ZodContext);
|
|
1160
|
+
return context?.zod ?? null;
|
|
1161
|
+
}
|
|
1162
|
+
var useZodTypesIfPossible = () => {
|
|
1163
|
+
const context = useContext(ZodContext);
|
|
1164
|
+
return context?.zodTypes ?? null;
|
|
1165
|
+
};
|
|
1166
|
+
var ZodContext = createContext(null);
|
|
1167
|
+
var ZodProvider = ({ children }) => {
|
|
1168
|
+
const [zod, setZod] = useState(null);
|
|
1169
|
+
const [zodV3, setZodV3] = useState(null);
|
|
1170
|
+
const [zodTypes, setZodTypes] = useState(null);
|
|
1171
|
+
useEffect(() => {
|
|
1172
|
+
getZodIfPossible().then((z) => setZod(z));
|
|
1173
|
+
}, []);
|
|
1174
|
+
useEffect(() => {
|
|
1175
|
+
getZodV3IfPossible().then((z) => setZodV3(z));
|
|
1176
|
+
}, []);
|
|
1177
|
+
useEffect(() => {
|
|
1178
|
+
getZTypesIfPossible().then((z) => setZodTypes(z));
|
|
1179
|
+
}, []);
|
|
1180
|
+
const contextValue = useMemo(() => {
|
|
1181
|
+
return {
|
|
1182
|
+
zod,
|
|
1183
|
+
zodV3,
|
|
1184
|
+
zodTypes
|
|
1185
|
+
};
|
|
1186
|
+
}, [zod, zodV3, zodTypes]);
|
|
1187
|
+
return /* @__PURE__ */ jsx7(ZodContext.Provider, {
|
|
1188
|
+
value: contextValue,
|
|
1189
|
+
children
|
|
1190
|
+
});
|
|
1191
|
+
};
|
|
1192
|
+
|
|
1193
|
+
// src/visual-controls/VisualControls.tsx
|
|
1194
|
+
import {
|
|
1195
|
+
createContext as createContext2,
|
|
1196
|
+
createRef,
|
|
1197
|
+
useCallback,
|
|
1198
|
+
useEffect as useEffect2,
|
|
1199
|
+
useImperativeHandle,
|
|
1200
|
+
useMemo as useMemo2,
|
|
1201
|
+
useRef,
|
|
1202
|
+
useState as useState2
|
|
1203
|
+
} from "react";
|
|
1204
|
+
import { useRemotionEnvironment } from "remotion";
|
|
1205
|
+
|
|
1206
|
+
// src/api/get-zod-schema-from-primitive.ts
|
|
1207
|
+
function getZodSchemaFromPrimitive(value, z) {
|
|
1208
|
+
if (typeof value === "string") {
|
|
1209
|
+
return z.string();
|
|
1210
|
+
}
|
|
1211
|
+
if (typeof value === "number") {
|
|
1212
|
+
return z.number();
|
|
1213
|
+
}
|
|
1214
|
+
let stringified;
|
|
1215
|
+
try {
|
|
1216
|
+
stringified = JSON.stringify(value);
|
|
1217
|
+
} catch {}
|
|
1218
|
+
throw new Error(`visualControl(): Specify a schema for this value: ${stringified ?? "[non-serializable value]"}. See https://remotion.dev/docs/studio/visual-control`);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
// src/helpers/interactivity-enabled.ts
|
|
1222
|
+
var isStudioInteractivityEnabled = () => {
|
|
1223
|
+
return getStudioInteractivityEnabled() && (typeof window === "undefined" || !window.remotion_isReadOnlyStudio);
|
|
1224
|
+
};
|
|
1225
|
+
var isStudioSelectionEnabled = getStudioInteractivityEnabled;
|
|
1226
|
+
|
|
1227
|
+
// src/visual-controls/get-current-edited-value.ts
|
|
1228
|
+
var getVisualControlEditedValue = ({
|
|
1229
|
+
handles,
|
|
1230
|
+
key
|
|
1231
|
+
}) => {
|
|
1232
|
+
const handle = handles?.[key];
|
|
1233
|
+
if (handle === undefined) {
|
|
1234
|
+
return null;
|
|
1235
|
+
}
|
|
1236
|
+
return handle.unsavedValue;
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
// src/visual-controls/VisualControls.tsx
|
|
1240
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1241
|
+
var VisualControlsTabActivatedContext = createContext2(false);
|
|
1242
|
+
var VisualControlsContext = createContext2({
|
|
1243
|
+
handles: {}
|
|
1244
|
+
});
|
|
1245
|
+
var visualControlRef = createRef();
|
|
1246
|
+
var SetVisualControlsContext = createContext2({
|
|
1247
|
+
updateHandles: () => {
|
|
1248
|
+
throw new Error("updateHandles is not implemented");
|
|
1249
|
+
},
|
|
1250
|
+
updateValue: () => {
|
|
1251
|
+
throw new Error("updateValue is not implemented");
|
|
1252
|
+
},
|
|
1253
|
+
visualControl: () => {
|
|
1254
|
+
throw new Error("visualControl is not implemented");
|
|
1255
|
+
}
|
|
1256
|
+
});
|
|
1257
|
+
var VisualControlsProvider = ({ children }) => {
|
|
1258
|
+
const imperativeHandles = useRef({});
|
|
1259
|
+
const [handles, setHandles] = useState2({});
|
|
1260
|
+
const state = useMemo2(() => {
|
|
1261
|
+
return {
|
|
1262
|
+
handles
|
|
1263
|
+
};
|
|
1264
|
+
}, [handles]);
|
|
1265
|
+
const setControl = useCallback((key, value) => {
|
|
1266
|
+
const existingHandle = imperativeHandles.current?.[key];
|
|
1267
|
+
const currentSavedState = existingHandle?.valueInCode;
|
|
1268
|
+
const changedSavedValue = value.valueInCode !== currentSavedState;
|
|
1269
|
+
const changedUnsavedValue = existingHandle === undefined && value.valueInCode !== undefined;
|
|
1270
|
+
imperativeHandles.current = {
|
|
1271
|
+
...imperativeHandles.current,
|
|
1272
|
+
[key]: {
|
|
1273
|
+
...value,
|
|
1274
|
+
unsavedValue: existingHandle !== undefined && !changedSavedValue ? existingHandle.unsavedValue : value.valueInCode,
|
|
1275
|
+
valueInCode: value.valueInCode
|
|
1276
|
+
}
|
|
1277
|
+
};
|
|
1278
|
+
return {
|
|
1279
|
+
changed: changedSavedValue || changedUnsavedValue,
|
|
1280
|
+
currentValue: getVisualControlEditedValue({
|
|
1281
|
+
key,
|
|
1282
|
+
handles: imperativeHandles.current
|
|
1283
|
+
})
|
|
1284
|
+
};
|
|
1285
|
+
}, []);
|
|
1286
|
+
const z = useZodIfPossible();
|
|
1287
|
+
const changedRef = useRef(false);
|
|
1288
|
+
const env = useRemotionEnvironment();
|
|
1289
|
+
const visualControl = useCallback(function(key, value, schema) {
|
|
1290
|
+
if (handles && false) {}
|
|
1291
|
+
if (!env.isStudio) {
|
|
1292
|
+
return value;
|
|
1293
|
+
}
|
|
1294
|
+
if (!isStudioInteractivityEnabled()) {
|
|
1295
|
+
return value;
|
|
1296
|
+
}
|
|
1297
|
+
if (!z) {
|
|
1298
|
+
return value;
|
|
1299
|
+
}
|
|
1300
|
+
const { changed, currentValue } = setControl(key, {
|
|
1301
|
+
valueInCode: value,
|
|
1302
|
+
schema: schema ?? getZodSchemaFromPrimitive(value, z),
|
|
1303
|
+
stack: new Error().stack
|
|
1304
|
+
});
|
|
1305
|
+
if (changed) {
|
|
1306
|
+
changedRef.current = true;
|
|
1307
|
+
}
|
|
1308
|
+
return currentValue;
|
|
1309
|
+
}, [setControl, handles, z, env.isStudio]);
|
|
1310
|
+
const updateHandles = useCallback(() => {
|
|
1311
|
+
setHandles(() => {
|
|
1312
|
+
return imperativeHandles.current;
|
|
1313
|
+
});
|
|
1314
|
+
}, []);
|
|
1315
|
+
const updateValue = useCallback((key, value) => {
|
|
1316
|
+
imperativeHandles.current = {
|
|
1317
|
+
...imperativeHandles.current,
|
|
1318
|
+
[key]: {
|
|
1319
|
+
...imperativeHandles.current[key],
|
|
1320
|
+
unsavedValue: value
|
|
1321
|
+
}
|
|
1322
|
+
};
|
|
1323
|
+
updateHandles();
|
|
1324
|
+
visualControlStore.emitChange();
|
|
1325
|
+
}, [updateHandles]);
|
|
1326
|
+
useImperativeHandle(visualControlRef, () => {
|
|
1327
|
+
return {
|
|
1328
|
+
globalVisualControl: visualControl
|
|
1329
|
+
};
|
|
1330
|
+
}, [visualControl]);
|
|
1331
|
+
useEffect2(() => {
|
|
1332
|
+
visualControlStore.emitChange();
|
|
1333
|
+
}, [visualControl]);
|
|
1334
|
+
useEffect2(() => {
|
|
1335
|
+
const callback = () => {
|
|
1336
|
+
if (imperativeHandles.current) {
|
|
1337
|
+
updateHandles();
|
|
1338
|
+
changedRef.current = false;
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
const interval = setInterval(callback, 100);
|
|
1342
|
+
return () => {
|
|
1343
|
+
clearInterval(interval);
|
|
1344
|
+
};
|
|
1345
|
+
}, [updateHandles]);
|
|
1346
|
+
const setState = useMemo2(() => {
|
|
1347
|
+
return {
|
|
1348
|
+
setControl,
|
|
1349
|
+
updateHandles,
|
|
1350
|
+
updateValue,
|
|
1351
|
+
visualControl
|
|
1352
|
+
};
|
|
1353
|
+
}, [setControl, updateHandles, updateValue, visualControl]);
|
|
1354
|
+
return /* @__PURE__ */ jsx8(VisualControlsTabActivatedContext.Provider, {
|
|
1355
|
+
value: Object.keys(state.handles).length > 0,
|
|
1356
|
+
children: /* @__PURE__ */ jsx8(VisualControlsContext.Provider, {
|
|
1357
|
+
value: state,
|
|
1358
|
+
children: /* @__PURE__ */ jsx8(SetVisualControlsContext.Provider, {
|
|
1359
|
+
value: setState,
|
|
1360
|
+
children
|
|
1361
|
+
})
|
|
1362
|
+
})
|
|
1363
|
+
});
|
|
1364
|
+
};
|
|
1365
|
+
|
|
1366
|
+
export { AppsIcon, CodingAgentIcon, EditorIcon, FinderIcon, TerminalIcon, requestInsertedElementSelection, clearInsertedElementSelection, subscribeToInsertedElementSelection, getInsertedElementSelection, queueSequenceNodePathMutation, takePendingSequenceNodePathMutations, callApi, deleteStaticFile, DEFAULT_PROPS_PATH_CLASSNAME, DEFAULT_PROPS_PATH_ACTIVE_CLASSNAME, defaultPropsEditorScrollableAreaRef, getStaticFiles, shutDownStudio, zodSafeParse, getZodDef, isZodV3Schema, getZodSchemaType, getZodSchemaDescription, getUserFacingDescription, getObjectShape, getArrayElement, getInnerType, getEffectsInner, getLiteralValue, getEnumValues, getFirstEnumValue, getUnionOptions, getDefaultValue, getDiscriminator, getDiscriminatedOptionKeys, getDiscriminatedOption, getIntersectionSchemas, getTupleItems, getRecordValueType, getRecordKeyType, getPipelineOutput, getPipelineInput, getBrandedInner, extractEnumJsonPaths, addStillRenderJob, addSequenceRenderJob, addVideoRenderJob, unsubscribeFromFileExistenceWatcher, subscribeToFileExistenceWatcher, openInFileExplorer, applyCodemod, removeRenderJob, cancelRenderJob, updateAvailable, getReleaseNotes, callUpdateDefaultPropsApi, applyVisualControlChange, useSyncExternalStore, visualControlStore, useZodIfPossible, useZodTypesIfPossible, ZodProvider, isStudioInteractivityEnabled, isStudioSelectionEnabled, getVisualControlEditedValue, VisualControlsContext, visualControlRef, SetVisualControlsContext, VisualControlsProvider, watchPublicFolder };
|