@remotion/studio 4.0.507 → 4.0.509
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/FastRefreshProvider.js +13 -9
- package/dist/Studio.d.ts +5 -0
- package/dist/Studio.js +2 -2
- package/dist/components/Canvas.js +35 -5
- package/dist/components/CodingAgentIcon.d.ts +3 -1
- package/dist/components/CodingAgentIcon.js +4 -9
- package/dist/components/ColorPicker/AlphaSlider.js +2 -2
- package/dist/components/ColorPicker/HueSlider.js +2 -2
- package/dist/components/ColorPicker/SaturationValueArea.js +2 -2
- package/dist/components/ConfigureDefaultEditorModal.js +1 -1
- package/dist/components/ContextMenu.d.ts +1 -0
- package/dist/components/ContextMenu.js +32 -5
- package/dist/components/EditorContent.js +4 -3
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EditorRuler/index.js +2 -2
- package/dist/components/ExplorerPanel.js +19 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +3 -3
- package/dist/components/InspectorLocationCopy.js +1 -1
- package/dist/components/InspectorOpenInEditor.d.ts +1 -0
- package/dist/components/InspectorOpenInEditor.js +52 -8
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +3 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +3 -3
- package/dist/components/InspectorPanel/styles.js +1 -1
- package/dist/components/InspectorSequenceSection.js +36 -4
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/ModalContainer.js +1 -1
- package/dist/components/Modals.js +2 -9
- package/dist/components/NewComposition/InputDragger.js +2 -2
- package/dist/components/NewComposition/NewComposition.d.ts +2 -0
- package/dist/components/NewComposition/NewComposition.js +38 -6
- package/dist/components/NewComposition/get-new-composition-defaults.d.ts +1 -1
- package/dist/components/NewComposition/get-new-composition-defaults.js +9 -1
- package/dist/components/PlayPause.d.ts +1 -1
- package/dist/components/PlayPause.js +61 -12
- package/dist/components/RenderButton.js +16 -12
- package/dist/components/RenderModal/GuiRenderStatus.js +23 -6
- package/dist/components/RenderModal/InfoBubble.d.ts +1 -0
- package/dist/components/RenderModal/InfoBubble.js +6 -4
- package/dist/components/RenderModal/InfoTooltip.d.ts +1 -0
- package/dist/components/RenderModal/InfoTooltip.js +12 -12
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +5 -0
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +16 -3
- package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +2 -0
- package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +3 -2
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +6 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTupleEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/zod-schema-type.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/zod-schema-type.js +12 -1
- package/dist/components/SelectedOutlineCanvasRotation.d.ts +9 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +239 -0
- package/dist/components/SelectedOutlineCropControls.js +2 -2
- package/dist/components/SelectedOutlineElement.d.ts +2 -1
- package/dist/components/SelectedOutlineElement.js +40 -5
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +55 -26
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +6 -5
- package/dist/components/SelectedOutlineRenderer.d.ts +1 -0
- package/dist/components/SelectedOutlineRenderer.js +24 -7
- package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +6 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.js +9 -7
- package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +2 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.js +11 -7
- package/dist/components/SelectedOutlineTransformOriginHandle.js +50 -24
- package/dist/components/SelectedOutlineUvControls.js +8 -8
- package/dist/components/SequencePropsSubscriptionProvider.js +8 -0
- package/dist/components/SettingsModalFooter.js +1 -1
- package/dist/components/Splitter/SplitterHandle.js +2 -2
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Timeline/EasingEditorModal.js +2 -2
- package/dist/components/Timeline/SequencePropsObserver.js +97 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +4 -2
- package/dist/components/Timeline/Timeline.js +55 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +99 -35
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineEffectItem.js +1 -4
- package/dist/components/Timeline/TimelineEffectPropItem.js +7 -0
- package/dist/components/Timeline/TimelineFieldRowContent.js +10 -3
- package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineLayerEye.js +2 -2
- package/dist/components/Timeline/TimelineRotationField.js +84 -12
- package/dist/components/Timeline/TimelineScaleField.js +58 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +4 -0
- package/dist/components/Timeline/TimelineSelection.js +47 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +43 -25
- package/dist/components/Timeline/TimelineSequencePropItem.js +12 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +6 -6
- package/dist/components/Timeline/TimelineTransformOriginField.js +78 -4
- package/dist/components/Timeline/TimelineTranslateField.js +55 -15
- package/dist/components/Timeline/Transform3DModeContext.d.ts +1 -0
- package/dist/components/Timeline/Transform3DModeContext.js +5 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +0 -6
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -6
- package/dist/components/Timeline/keyframe-clipboard.d.ts +5 -1
- package/dist/components/Timeline/keyframe-clipboard.js +3 -2
- package/dist/components/Timeline/save-sequence-prop.js +16 -7
- package/dist/components/Timeline/sequence-prop-clipboard.d.ts +31 -0
- package/dist/components/Timeline/sequence-prop-clipboard.js +142 -0
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -1
- package/dist/components/Timeline/sequence-props-subscription-store.js +5 -2
- package/dist/components/Timeline/timeline-field-display-utils.js +2 -2
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +6 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +16 -1
- package/dist/components/Timeline/timeline-rotation-utils.d.ts +16 -0
- package/dist/components/Timeline/timeline-rotation-utils.js +145 -4
- package/dist/components/Timeline/timeline-translate-utils.d.ts +3 -2
- package/dist/components/Timeline/timeline-translate-utils.js +8 -4
- package/dist/components/Timeline/transform-3d-mode.d.ts +6 -0
- package/dist/components/Timeline/transform-3d-mode.js +36 -0
- package/dist/components/Timeline/transform-origin-utils.d.ts +4 -0
- package/dist/components/Timeline/transform-origin-utils.js +12 -6
- package/dist/components/Timeline/update-selected-easing.js +8 -0
- package/dist/components/Timeline/use-open-sequence-in-apps.js +3 -1
- package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +5 -1
- package/dist/components/Timeline/use-resolved-stack-react-to-change.js +67 -10
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +7 -2
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +4 -4
- package/dist/components/call-api.js +2 -0
- package/dist/components/canvas-rotation-cursor.d.ts +1 -0
- package/dist/components/canvas-rotation-cursor.js +14 -0
- package/dist/components/folder-menu-items.js +1 -0
- package/dist/components/get-open-in-menu-items.d.ts +8 -1
- package/dist/components/get-open-in-menu-items.js +93 -8
- package/dist/components/import-assets.js +7 -0
- package/dist/components/root-composition-menu-items.js +1 -0
- package/dist/components/selected-outline-control-layout.d.ts +14 -0
- package/dist/components/selected-outline-control-layout.js +94 -0
- package/dist/components/selected-outline-drag.d.ts +11 -5
- package/dist/components/selected-outline-drag.js +80 -42
- package/dist/components/selected-outline-measurement.d.ts +5 -0
- package/dist/components/selected-outline-measurement.js +28 -1
- package/dist/components/selected-outline-types.d.ts +6 -0
- package/dist/components/use-default-editor-info.js +28 -3
- package/dist/esm/{chunk-ptnd65a9.js → chunk-jdn6nkbk.js} +10087 -7919
- package/dist/esm/{chunk-fgedsvhb.js → chunk-r46yxrjr.js} +1 -2
- package/dist/esm/index.mjs +357 -2
- package/dist/esm/internals.mjs +10086 -7918
- package/dist/esm/previewEntry.mjs +9926 -7758
- package/dist/esm/renderEntry.mjs +4 -2
- package/dist/helpers/get-box-quads-polyfill-internals.js +10 -2
- package/dist/helpers/get-canvas-capture-import.d.ts +7 -0
- package/dist/helpers/get-canvas-capture-import.js +43 -0
- package/dist/helpers/get-git-menu-item.d.ts +1 -1
- package/dist/helpers/get-git-menu-item.js +33 -3
- package/dist/helpers/inserted-element-selection.d.ts +12 -0
- package/dist/helpers/inserted-element-selection.js +29 -0
- package/dist/helpers/open-in-editor.d.ts +3 -1
- package/dist/helpers/open-in-editor.js +5 -1
- package/dist/helpers/pointer-session.d.ts +6 -2
- package/dist/helpers/pointer-session.js +29 -12
- package/dist/helpers/preview-server-events.js +4 -0
- package/dist/helpers/sequence-node-path-mutations.d.ts +4 -0
- package/dist/helpers/sequence-node-path-mutations.js +31 -0
- package/dist/helpers/use-create-composition.d.ts +15 -2
- package/dist/helpers/use-create-composition.js +11 -17
- package/dist/helpers/use-menu-structure.js +1 -0
- package/dist/icons/cube.d.ts +4 -0
- package/dist/icons/cube.js +6 -0
- package/dist/icons/finder.d.ts +4 -0
- package/dist/icons/finder.js +8 -0
- package/dist/icons/github.d.ts +4 -0
- package/dist/icons/github.js +11 -0
- package/dist/icons/terminal.d.ts +6 -0
- package/dist/icons/terminal.js +46 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +8 -0
- package/dist/renderEntry.js +2 -2
- package/dist/state/modals.d.ts +9 -1
- package/dist/state/transform-3d-mode.d.ts +10 -0
- package/dist/state/transform-3d-mode.js +27 -0
- package/dist/state/z-index.d.ts +0 -1
- package/dist/state/z-index.js +28 -37
- package/package.json +12 -12
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
WHITE,
|
|
5
5
|
__require,
|
|
6
6
|
__toESM
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-r46yxrjr.js";
|
|
8
8
|
|
|
9
9
|
// src/renderEntry.tsx
|
|
10
10
|
import { useContext, useEffect, useRef, useState } from "react";
|
|
@@ -170,6 +170,7 @@ var renderContent = (Root) => {
|
|
|
170
170
|
numberOfAudioTags: 0,
|
|
171
171
|
audioLatencyHint: window.remotion_audioLatencyHint ?? "playback",
|
|
172
172
|
previewSampleRate: window.remotion_previewSampleRate,
|
|
173
|
+
_experimentalKeepAudioContextAlive: false,
|
|
173
174
|
children: /* @__PURE__ */ jsxs(Internals.RenderAssetManagerProvider, {
|
|
174
175
|
collectAssets: null,
|
|
175
176
|
children: [
|
|
@@ -197,6 +198,7 @@ var renderContent = (Root) => {
|
|
|
197
198
|
numberOfAudioTags: 0,
|
|
198
199
|
audioLatencyHint: window.remotion_audioLatencyHint ?? "playback",
|
|
199
200
|
previewSampleRate: window.remotion_previewSampleRate,
|
|
201
|
+
_experimentalKeepAudioContextAlive: false,
|
|
200
202
|
children: /* @__PURE__ */ jsx(Internals.RenderAssetManagerProvider, {
|
|
201
203
|
collectAssets: null,
|
|
202
204
|
children: /* @__PURE__ */ jsx(Root, {})
|
|
@@ -212,7 +214,7 @@ var renderContent = (Root) => {
|
|
|
212
214
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
213
215
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
214
216
|
}));
|
|
215
|
-
import("./chunk-
|
|
217
|
+
import("./chunk-jdn6nkbk.js").then(({ StudioInternals }) => {
|
|
216
218
|
window.remotion_isStudio = true;
|
|
217
219
|
window.remotion_isReadOnlyStudio = true;
|
|
218
220
|
window.remotion_inputProps = "{}";
|
|
@@ -1658,10 +1658,18 @@ function getElementCombinedTransform(element, iframes) {
|
|
|
1658
1658
|
m.multiplySelf(new DOMMatrix('translate(' + tr.replaceAll(' ', ',') + ')'));
|
|
1659
1659
|
}
|
|
1660
1660
|
if (hasRotate) {
|
|
1661
|
-
|
|
1661
|
+
const rotateParts = s.rotate.trim().split(/\s+/);
|
|
1662
|
+
const rotateTransform = rotateParts.length === 1
|
|
1663
|
+
? `rotate(${rotateParts[0]})`
|
|
1664
|
+
: rotateParts.length === 2 && /^[xyz]$/i.test(rotateParts[0])
|
|
1665
|
+
? `rotate${rotateParts[0].toUpperCase()}(${rotateParts[1]})`
|
|
1666
|
+
: `rotate3d(${rotateParts.join(',')})`;
|
|
1667
|
+
m.multiplySelf(new DOMMatrix(rotateTransform));
|
|
1662
1668
|
}
|
|
1663
1669
|
if (hasScale) {
|
|
1664
|
-
|
|
1670
|
+
const scaleParts = s.scale.trim().split(/\s+/);
|
|
1671
|
+
const scaleFunction = scaleParts.length === 3 ? 'scale3d' : 'scale';
|
|
1672
|
+
m.multiplySelf(new DOMMatrix(`${scaleFunction}(${scaleParts.join(',')})`));
|
|
1665
1673
|
}
|
|
1666
1674
|
if (hasOffsetPath) {
|
|
1667
1675
|
m.multiplySelf(computeOffsetTransformMatrix(element));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCanvasCaptureImport = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const mediabunny_1 = require("mediabunny");
|
|
6
|
+
const getCanvasCaptureImport = async (file) => {
|
|
7
|
+
const input = new mediabunny_1.Input({
|
|
8
|
+
formats: mediabunny_1.ALL_FORMATS,
|
|
9
|
+
source: new mediabunny_1.BlobSource(file),
|
|
10
|
+
});
|
|
11
|
+
try {
|
|
12
|
+
const [metadata, videoTrack] = await Promise.all([
|
|
13
|
+
input.getMetadataTags(),
|
|
14
|
+
input.getPrimaryVideoTrack(),
|
|
15
|
+
]);
|
|
16
|
+
const data = (0, studio_shared_1.parseCanvasCaptureData)(metadata);
|
|
17
|
+
if (data === null || videoTrack === null) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const [durationFromMetadata, width, height] = await Promise.all([
|
|
21
|
+
input.getDurationFromMetadata(),
|
|
22
|
+
videoTrack.getDisplayWidth(),
|
|
23
|
+
videoTrack.getDisplayHeight(),
|
|
24
|
+
]);
|
|
25
|
+
const durationInSeconds = durationFromMetadata !== null && durationFromMetadata !== void 0 ? durationFromMetadata : (await input.computeDuration([videoTrack]));
|
|
26
|
+
if (!Number.isFinite(durationInSeconds) ||
|
|
27
|
+
durationInSeconds <= 0 ||
|
|
28
|
+
!Number.isFinite(width) ||
|
|
29
|
+
width <= 0 ||
|
|
30
|
+
!Number.isFinite(height) ||
|
|
31
|
+
height <= 0) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return { data, durationInSeconds, file, height, width };
|
|
35
|
+
}
|
|
36
|
+
catch (_a) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
input.dispose();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.getCanvasCaptureImport = getCanvasCaptureImport;
|
|
@@ -3,5 +3,5 @@ import type { ComboboxValue } from '../components/NewComposition/ComboBox';
|
|
|
3
3
|
import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
4
4
|
export declare const getGitSourceName: (gitSource: GitSource) => string;
|
|
5
5
|
export declare const getGitSourceBranchUrl: (gitSource: GitSource) => string;
|
|
6
|
-
export declare const getGitRefUrl: (gitSource: GitSource, originalLocation: OriginalPosition) => string;
|
|
6
|
+
export declare const getGitRefUrl: (gitSource: GitSource, originalLocation: OriginalPosition, remotionRoot: string) => string;
|
|
7
7
|
export declare const getGitMenuItem: () => ComboboxValue | null;
|
|
@@ -10,14 +10,44 @@ const getGitSourceName = (gitSource) => {
|
|
|
10
10
|
exports.getGitSourceName = getGitSourceName;
|
|
11
11
|
const getGitSourceBranchUrl = (gitSource) => {
|
|
12
12
|
if (gitSource.type === 'github') {
|
|
13
|
-
|
|
13
|
+
const relativeFromGitRoot = gitSource.relativeFromGitRoot.replaceAll('\\', '/');
|
|
14
|
+
return `https://github.com/${gitSource.org}/${gitSource.name}/tree/${gitSource.ref}${relativeFromGitRoot ? `/${relativeFromGitRoot}` : ''}`;
|
|
14
15
|
}
|
|
15
16
|
throw new Error('Unknown git source type');
|
|
16
17
|
};
|
|
17
18
|
exports.getGitSourceBranchUrl = getGitSourceBranchUrl;
|
|
18
|
-
const getGitRefUrl = (gitSource, originalLocation) => {
|
|
19
|
+
const getGitRefUrl = (gitSource, originalLocation, remotionRoot) => {
|
|
19
20
|
if (gitSource.type === 'github') {
|
|
20
|
-
|
|
21
|
+
if (!originalLocation.source) {
|
|
22
|
+
return (0, exports.getGitSourceBranchUrl)(gitSource);
|
|
23
|
+
}
|
|
24
|
+
const source = originalLocation.source.replaceAll('\\', '/');
|
|
25
|
+
const root = remotionRoot.replaceAll('\\', '/').replace(/\/+$/, '');
|
|
26
|
+
const shouldCompareCaseInsensitive = /^[a-z]:\//i.test(source) || /^[a-z]:\//i.test(root);
|
|
27
|
+
const comparableSource = shouldCompareCaseInsensitive
|
|
28
|
+
? source.toLowerCase()
|
|
29
|
+
: source;
|
|
30
|
+
const comparableRoot = shouldCompareCaseInsensitive
|
|
31
|
+
? root.toLowerCase()
|
|
32
|
+
: root;
|
|
33
|
+
const sourceIsInsideRoot = root.length > 0 && comparableSource.startsWith(`${comparableRoot}/`);
|
|
34
|
+
const relativeSource = sourceIsInsideRoot
|
|
35
|
+
? source.slice(root.length + 1)
|
|
36
|
+
: source.replace(/^\.\/+/, '');
|
|
37
|
+
if (/^(?:[a-z]:\/|\/)/i.test(relativeSource)) {
|
|
38
|
+
return (0, exports.getGitSourceBranchUrl)(gitSource);
|
|
39
|
+
}
|
|
40
|
+
const filePath = [
|
|
41
|
+
gitSource.relativeFromGitRoot.replaceAll('\\', '/'),
|
|
42
|
+
relativeSource,
|
|
43
|
+
]
|
|
44
|
+
.filter(Boolean)
|
|
45
|
+
.map((part) => part.replace(/^\/+|\/+$/g, ''))
|
|
46
|
+
.join('/');
|
|
47
|
+
const lineSuffix = originalLocation.line
|
|
48
|
+
? `#L${originalLocation.line}`
|
|
49
|
+
: '';
|
|
50
|
+
return `https://github.com/${gitSource.org}/${gitSource.name}/blob/${gitSource.ref}/${filePath}${lineSuffix}`;
|
|
21
51
|
}
|
|
22
52
|
throw new Error('Unknown git source type');
|
|
23
53
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SequenceNodePath } from 'remotion';
|
|
2
|
+
export type PendingInsertedElementSelection = {
|
|
3
|
+
compositionId: string;
|
|
4
|
+
nodePath: {
|
|
5
|
+
absolutePath: string;
|
|
6
|
+
nodePath: SequenceNodePath;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const requestInsertedElementSelection: (selection: PendingInsertedElementSelection) => void;
|
|
10
|
+
export declare const clearInsertedElementSelection: (selection: PendingInsertedElementSelection) => void;
|
|
11
|
+
export declare const subscribeToInsertedElementSelection: (listener: () => void) => () => boolean;
|
|
12
|
+
export declare const getInsertedElementSelection: () => PendingInsertedElementSelection | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInsertedElementSelection = exports.subscribeToInsertedElementSelection = exports.clearInsertedElementSelection = exports.requestInsertedElementSelection = void 0;
|
|
4
|
+
let pendingSelection = null;
|
|
5
|
+
const listeners = new Set();
|
|
6
|
+
const requestInsertedElementSelection = (selection) => {
|
|
7
|
+
pendingSelection = selection;
|
|
8
|
+
for (const listener of listeners) {
|
|
9
|
+
listener();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.requestInsertedElementSelection = requestInsertedElementSelection;
|
|
13
|
+
const clearInsertedElementSelection = (selection) => {
|
|
14
|
+
if (pendingSelection !== selection) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
pendingSelection = null;
|
|
18
|
+
for (const listener of listeners) {
|
|
19
|
+
listener();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.clearInsertedElementSelection = clearInsertedElementSelection;
|
|
23
|
+
const subscribeToInsertedElementSelection = (listener) => {
|
|
24
|
+
listeners.add(listener);
|
|
25
|
+
return () => listeners.delete(listener);
|
|
26
|
+
};
|
|
27
|
+
exports.subscribeToInsertedElementSelection = subscribeToInsertedElementSelection;
|
|
28
|
+
const getInsertedElementSelection = () => pendingSelection;
|
|
29
|
+
exports.getInsertedElementSelection = getInsertedElementSelection;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TerminalId } from '@remotion/studio-shared';
|
|
2
|
+
import type { CompositionComponentInfoResponse, EditorPickerId, OpenInTerminalResponse, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
3
|
import type { CodePosition, OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
3
4
|
export declare const openInEditor: (stack: SymbolicatedStackFrame, editorId: EditorPickerId | null) => Promise<import("@remotion/studio-shared").OpenInEditorResponse>;
|
|
4
5
|
export declare const openInCodingAgent: (codingAgentId: "claude-code" | "codex" | "copilot" | "cursor", prompt: string | null) => Promise<import("@remotion/studio-shared").OpenInCodingAgentResponse>;
|
|
6
|
+
export declare const openInTerminal: (terminalId: TerminalId, directory: string) => Promise<OpenInTerminalResponse>;
|
|
5
7
|
export declare const openOriginalPositionInEditor: (originalPosition: OriginalPosition, editorId: EditorPickerId | null) => Promise<void>;
|
|
6
8
|
export declare const openOriginalPositionInEditorAtProperty: ({ originalPosition, property, }: {
|
|
7
9
|
originalPosition: CodePosition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.openCompositionComponentInEditor = exports.preloadCompositionComponentInfo = exports.loadCompositionComponentInfo = exports.useCachedCompositionComponentInfo = exports.getCachedCompositionComponentInfo = exports.subscribeToCompositionComponentInfo = exports.openOriginalPositionInEditorAtProperty = exports.openOriginalPositionInEditor = exports.openInCodingAgent = exports.openInEditor = void 0;
|
|
3
|
+
exports.openCompositionComponentInEditor = exports.preloadCompositionComponentInfo = exports.loadCompositionComponentInfo = exports.useCachedCompositionComponentInfo = exports.getCachedCompositionComponentInfo = exports.subscribeToCompositionComponentInfo = exports.openOriginalPositionInEditorAtProperty = exports.openOriginalPositionInEditor = exports.openInTerminal = exports.openInCodingAgent = exports.openInEditor = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const call_api_1 = require("../components/call-api");
|
|
6
6
|
const browser_studio_operations_1 = require("./browser-studio-operations");
|
|
@@ -22,6 +22,10 @@ const openInCodingAgent = (codingAgentId, prompt) => {
|
|
|
22
22
|
return (0, call_api_1.callApi)('/api/open-in-coding-agent', { codingAgentId, prompt });
|
|
23
23
|
};
|
|
24
24
|
exports.openInCodingAgent = openInCodingAgent;
|
|
25
|
+
const openInTerminal = (terminalId, directory) => {
|
|
26
|
+
return (0, call_api_1.callApi)('/api/open-in-terminal', { directory, terminalId });
|
|
27
|
+
};
|
|
28
|
+
exports.openInTerminal = openInTerminal;
|
|
25
29
|
const openOriginalPositionInEditor = async (originalPosition, editorId) => {
|
|
26
30
|
const response = await (0, exports.openInEditor)({
|
|
27
31
|
originalColumnNumber: originalPosition.column,
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export type PointerSessionEndReason = 'pointerup' | 'pointercancel' | 'lostpointercapture' | 'blur' | 'visibilitychange' | 'buttons-released' | 'manual';
|
|
2
2
|
type PointerSessionEvent = Pick<PointerEvent, 'button' | 'pointerId'>;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const startCapturedPointerSession: ({ event, captureTarget, onMove, onEnd, }: {
|
|
4
4
|
event: PointerSessionEvent;
|
|
5
|
-
|
|
5
|
+
captureTarget: Element;
|
|
6
6
|
onMove?: ((event: PointerEvent) => void) | undefined;
|
|
7
7
|
onEnd: (reason: PointerSessionEndReason, event: PointerEvent | null) => void;
|
|
8
8
|
}) => () => void;
|
|
9
|
+
export declare const observePointerRelease: ({ event, onEnd, }: {
|
|
10
|
+
event: PointerSessionEvent;
|
|
11
|
+
onEnd: (reason: PointerSessionEndReason, event: PointerEvent | null) => void;
|
|
12
|
+
}) => () => void;
|
|
9
13
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.observePointerRelease = exports.startCapturedPointerSession = void 0;
|
|
4
4
|
const getButtonMask = (button) => {
|
|
5
5
|
if (button === 0) {
|
|
6
6
|
return 1;
|
|
@@ -13,7 +13,7 @@ const getButtonMask = (button) => {
|
|
|
13
13
|
}
|
|
14
14
|
return 1 << button;
|
|
15
15
|
};
|
|
16
|
-
const startPointerSession = ({ event,
|
|
16
|
+
const startPointerSession = ({ event, captureTarget, onMove, onEnd, }) => {
|
|
17
17
|
var _a;
|
|
18
18
|
const { pointerId } = event;
|
|
19
19
|
const buttonMask = getButtonMask(event.button);
|
|
@@ -25,10 +25,10 @@ const startPointerSession = ({ event, target, onMove, onEnd, }) => {
|
|
|
25
25
|
window.removeEventListener('pointercancel', handleCancel);
|
|
26
26
|
window.removeEventListener('blur', handleBlur);
|
|
27
27
|
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
28
|
-
|
|
29
|
-
if ((_a =
|
|
28
|
+
captureTarget === null || captureTarget === void 0 ? void 0 : captureTarget.removeEventListener('lostpointercapture', handleLostPointerCapture);
|
|
29
|
+
if ((_a = captureTarget === null || captureTarget === void 0 ? void 0 : captureTarget.hasPointerCapture) === null || _a === void 0 ? void 0 : _a.call(captureTarget, pointerId)) {
|
|
30
30
|
try {
|
|
31
|
-
|
|
31
|
+
captureTarget.releasePointerCapture(pointerId);
|
|
32
32
|
}
|
|
33
33
|
catch (_b) {
|
|
34
34
|
// The browser may already have released capture.
|
|
@@ -77,18 +77,35 @@ const startPointerSession = ({ event, target, onMove, onEnd, }) => {
|
|
|
77
77
|
end('visibilitychange', null);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
if (captureTarget) {
|
|
81
|
+
try {
|
|
82
|
+
(_a = captureTarget.setPointerCapture) === null || _a === void 0 ? void 0 : _a.call(captureTarget, pointerId);
|
|
83
|
+
}
|
|
84
|
+
catch (_b) {
|
|
85
|
+
// Capture is best-effort for detached targets.
|
|
86
|
+
}
|
|
87
|
+
captureTarget.addEventListener('lostpointercapture', handleLostPointerCapture);
|
|
85
88
|
}
|
|
86
89
|
window.addEventListener('pointermove', handleMove);
|
|
87
90
|
window.addEventListener('pointerup', handleUp);
|
|
88
91
|
window.addEventListener('pointercancel', handleCancel);
|
|
89
92
|
window.addEventListener('blur', handleBlur);
|
|
90
93
|
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
91
|
-
target.addEventListener('lostpointercapture', handleLostPointerCapture);
|
|
92
94
|
return () => end('manual', null);
|
|
93
95
|
};
|
|
94
|
-
|
|
96
|
+
// Use for a gesture owned by a Studio control, such as a slider or resize
|
|
97
|
+
// handle. `captureTarget` is normally the pointerdown handler's currentTarget.
|
|
98
|
+
const startCapturedPointerSession = ({ event, captureTarget, onMove, onEnd, }) => {
|
|
99
|
+
return startPointerSession({ event, captureTarget, onMove, onEnd });
|
|
100
|
+
};
|
|
101
|
+
exports.startCapturedPointerSession = startCapturedPointerSession;
|
|
102
|
+
// Use when observing a gesture that started elsewhere. This deliberately does
|
|
103
|
+
// not capture the pointer from the element under it.
|
|
104
|
+
const observePointerRelease = ({ event, onEnd, }) => {
|
|
105
|
+
return startPointerSession({
|
|
106
|
+
event,
|
|
107
|
+
captureTarget: null,
|
|
108
|
+
onEnd,
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
exports.observePointerRelease = observePointerRelease;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.subscribeToPreviewServerConnectionState = exports.subscribeToPreviewServerEvents = exports.ensurePreviewServerEventSource = void 0;
|
|
6
6
|
const browser_studio_operations_1 = require("./browser-studio-operations");
|
|
7
|
+
const sequence_node_path_mutations_1 = require("./sequence-node-path-mutations");
|
|
7
8
|
let source = null;
|
|
8
9
|
let unsubscribeFromBrowserStudio = null;
|
|
9
10
|
let browserStudioReadyListenerInstalled = false;
|
|
@@ -18,6 +19,9 @@ const notifyConnectionState = () => {
|
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
const dispatch = (event) => {
|
|
22
|
+
if (event.type === 'sequence-node-paths-remapped') {
|
|
23
|
+
(0, sequence_node_path_mutations_1.queueSequenceNodePathMutation)(event.mutation);
|
|
24
|
+
}
|
|
21
25
|
if (event.type === 'init') {
|
|
22
26
|
lastInitEvent = event;
|
|
23
27
|
connectionState = {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SequenceNodePathMutation } from '@remotion/studio-shared';
|
|
2
|
+
export declare const queueSequenceNodePathMutation: (mutation: SequenceNodePathMutation) => void;
|
|
3
|
+
export declare const queueSequenceNodePathMutationFromApiResponse: (response: unknown) => void;
|
|
4
|
+
export declare const takePendingSequenceNodePathMutations: () => SequenceNodePathMutation[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.takePendingSequenceNodePathMutations = exports.queueSequenceNodePathMutationFromApiResponse = exports.queueSequenceNodePathMutation = void 0;
|
|
4
|
+
const pendingMutations = [];
|
|
5
|
+
const seenMutationIds = new Set();
|
|
6
|
+
const queueSequenceNodePathMutation = (mutation) => {
|
|
7
|
+
if (seenMutationIds.has(mutation.mutationId)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
seenMutationIds.add(mutation.mutationId);
|
|
11
|
+
pendingMutations.push(mutation);
|
|
12
|
+
};
|
|
13
|
+
exports.queueSequenceNodePathMutation = queueSequenceNodePathMutation;
|
|
14
|
+
const queueSequenceNodePathMutationFromApiResponse = (response) => {
|
|
15
|
+
if (typeof response !== 'object' ||
|
|
16
|
+
response === null ||
|
|
17
|
+
!('nodePathMutation' in response)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const { nodePathMutation } = response;
|
|
21
|
+
if (typeof nodePathMutation !== 'object' ||
|
|
22
|
+
nodePathMutation === null ||
|
|
23
|
+
!('mutationId' in nodePathMutation) ||
|
|
24
|
+
typeof nodePathMutation.mutationId !== 'string') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
(0, exports.queueSequenceNodePathMutation)(nodePathMutation);
|
|
28
|
+
};
|
|
29
|
+
exports.queueSequenceNodePathMutationFromApiResponse = queueSequenceNodePathMutationFromApiResponse;
|
|
30
|
+
const takePendingSequenceNodePathMutations = () => pendingMutations.splice(0);
|
|
31
|
+
exports.takePendingSequenceNodePathMutations = takePendingSequenceNodePathMutations;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
1
|
+
import type { CanvasCaptureData, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
2
|
export declare const getUniqueCompositionName: (compositions: import("remotion").AnyComposition[]) => string;
|
|
3
|
-
export declare const useCreateComposition: ({ compositions, durationInFrames, folderName, newId, parentName, selectedFrameRate, size, }: {
|
|
3
|
+
export declare const useCreateComposition: ({ compositions, durationInFrames, folderName, newId, parentName, selectedFrameRate, size, canvasCapture, }: {
|
|
4
4
|
compositions: import("remotion").AnyComposition[];
|
|
5
5
|
durationInFrames: number;
|
|
6
6
|
folderName: string | null;
|
|
@@ -11,6 +11,12 @@ export declare const useCreateComposition: ({ compositions, durationInFrames, fo
|
|
|
11
11
|
width: number;
|
|
12
12
|
height: number;
|
|
13
13
|
};
|
|
14
|
+
canvasCapture: {
|
|
15
|
+
readonly data: CanvasCaptureData;
|
|
16
|
+
readonly videoFileName: string;
|
|
17
|
+
readonly videoHeight: number;
|
|
18
|
+
readonly videoWidth: number;
|
|
19
|
+
} | null;
|
|
14
20
|
}) => {
|
|
15
21
|
codemod: {
|
|
16
22
|
type: "new-composition";
|
|
@@ -23,6 +29,13 @@ export declare const useCreateComposition: ({ compositions, durationInFrames, fo
|
|
|
23
29
|
newWidth: number;
|
|
24
30
|
newFps: number;
|
|
25
31
|
newDurationInFrames: number;
|
|
32
|
+
canvasCapture: {
|
|
33
|
+
readonly videoFileName: string;
|
|
34
|
+
readonly videoHeight: number;
|
|
35
|
+
readonly videoWidth: number;
|
|
36
|
+
readonly keyframeFps: number;
|
|
37
|
+
readonly data: CanvasCaptureData;
|
|
38
|
+
} | null;
|
|
26
39
|
};
|
|
27
40
|
createComposition: ({ signal, symbolicatedStack, }: {
|
|
28
41
|
signal: AbortSignal;
|
|
@@ -19,21 +19,6 @@ const toPascalCase = (value) => {
|
|
|
19
19
|
}
|
|
20
20
|
return candidate;
|
|
21
21
|
};
|
|
22
|
-
const waitForComposition = (compositionId) => {
|
|
23
|
-
return new Promise((resolve) => {
|
|
24
|
-
const started = Date.now();
|
|
25
|
-
const interval = window.setInterval(() => {
|
|
26
|
-
var _a;
|
|
27
|
-
var _b;
|
|
28
|
-
const compositionNames = (_b = (_a = window.remotion_getCompositionNames) === null || _a === void 0 ? void 0 : _a.call(window)) !== null && _b !== void 0 ? _b : [];
|
|
29
|
-
if (compositionNames.includes(compositionId) ||
|
|
30
|
-
Date.now() - started > 10000) {
|
|
31
|
-
window.clearInterval(interval);
|
|
32
|
-
resolve();
|
|
33
|
-
}
|
|
34
|
-
}, 100);
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
22
|
const getUniqueCompositionName = (compositions) => {
|
|
38
23
|
let counter = 1;
|
|
39
24
|
while (true) {
|
|
@@ -46,7 +31,7 @@ const getUniqueCompositionName = (compositions) => {
|
|
|
46
31
|
}
|
|
47
32
|
};
|
|
48
33
|
exports.getUniqueCompositionName = getUniqueCompositionName;
|
|
49
|
-
const useCreateComposition = ({ compositions, durationInFrames, folderName, newId, parentName, selectedFrameRate, size, }) => {
|
|
34
|
+
const useCreateComposition = ({ compositions, durationInFrames, folderName, newId, parentName, selectedFrameRate, size, canvasCapture, }) => {
|
|
50
35
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
51
36
|
const componentName = (0, react_1.useMemo)(() => toPascalCase(newId), [newId]);
|
|
52
37
|
const nameValidationMessage = (0, react_1.useMemo)(() => {
|
|
@@ -70,8 +55,18 @@ const useCreateComposition = ({ compositions, durationInFrames, folderName, newI
|
|
|
70
55
|
componentImportPath: `./${componentName}`,
|
|
71
56
|
folderName,
|
|
72
57
|
parentName,
|
|
58
|
+
canvasCapture: canvasCapture === null
|
|
59
|
+
? null
|
|
60
|
+
: {
|
|
61
|
+
data: canvasCapture.data,
|
|
62
|
+
keyframeFps: Number(selectedFrameRate),
|
|
63
|
+
videoFileName: canvasCapture.videoFileName,
|
|
64
|
+
videoHeight: canvasCapture.videoHeight,
|
|
65
|
+
videoWidth: canvasCapture.videoWidth,
|
|
66
|
+
},
|
|
73
67
|
};
|
|
74
68
|
}, [
|
|
69
|
+
canvasCapture,
|
|
75
70
|
componentName,
|
|
76
71
|
durationInFrames,
|
|
77
72
|
folderName,
|
|
@@ -92,7 +87,6 @@ const useCreateComposition = ({ compositions, durationInFrames, folderName, newI
|
|
|
92
87
|
symbolicatedStack,
|
|
93
88
|
});
|
|
94
89
|
if (result.success) {
|
|
95
|
-
await waitForComposition(newId);
|
|
96
90
|
selectComposition({
|
|
97
91
|
id: newId,
|
|
98
92
|
folderName,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CubeIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const CubeIcon = ({ color, ...props }) => (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", ...props, children: jsx_runtime_1.jsx("path", { fill: color, d: "M234.5 5.7c13.6-7.6 29.3-7.6 42.9 0l192 107.3c14.2 7.9 22.9 22.9 22.9 39.2v207.6c0 16.3-8.8 31.2-22.9 39.2l-192 107.3c-13.6 7.6-29.3 7.6-42.9 0l-192-107.3c-14.2-7.9-22.9-22.9-22.9-39.2V152.2c0-16.3 8.8-31.2 22.9-39.2l192-107.3zM256 50.4L82.2 147.5 256 244.7l173.8-97.2L256 50.4zm-192 137v172.4l168 93.9V281.3L64 187.4zm216 266.3l168-93.9V187.4l-168 93.9v172.4z" }) }));
|
|
6
|
+
exports.CubeIcon = CubeIcon;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FinderIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const FinderIcon = ({ size }) => {
|
|
6
|
+
return (jsx_runtime_1.jsx("img", { alt: "", "aria-hidden": true, "data-file-manager-icon": "finder", draggable: false, src: "/api/app-icon/file-manager/finder.png", style: { flexShrink: 0, height: size, width: size } }));
|
|
7
|
+
};
|
|
8
|
+
exports.FinderIcon = FinderIcon;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GitHubIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
// Brand shape adapted from Simple Icons (CC0 1.0):
|
|
7
|
+
// https://github.com/simple-icons/simple-icons/blob/develop/icons/github.svg
|
|
8
|
+
const GitHubIcon = ({ size }) => {
|
|
9
|
+
return (jsx_runtime_1.jsx("svg", { "aria-hidden": true, "data-github-icon": true, style: { flexShrink: 0, height: size, width: size }, viewBox: "0 0 24 24", children: jsx_runtime_1.jsx("path", { d: "M12 .3a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58v-2.23c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.34-1.76-1.34-1.76-1.09-.75.08-.73.08-.73 1.2.09 1.84 1.24 1.84 1.24 1.07 1.83 2.81 1.3 3.5.99.11-.78.42-1.31.76-1.61-2.67-.31-5.47-1.34-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1.01-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.29-1.55 3.3-1.23 3.3-1.23.65 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.6-2.81 5.62-5.48 5.92.43.37.81 1.1.81 2.22v3.3c0 .32.22.7.82.58A12 12 0 0 0 12 .3Z", fill: colors_1.CURRENT_COLOR }) }));
|
|
10
|
+
};
|
|
11
|
+
exports.GitHubIcon = GitHubIcon;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const apps_1 = require("./apps");
|
|
7
|
+
// Brand shapes adapted from Simple Icons (CC0 1.0):
|
|
8
|
+
// https://github.com/simple-icons/simple-icons/tree/34c22501f9ac9f22b12f825677ccbab1fb22e14b/icons
|
|
9
|
+
const iconStyle = (size) => ({
|
|
10
|
+
flexShrink: 0,
|
|
11
|
+
height: size,
|
|
12
|
+
width: size,
|
|
13
|
+
});
|
|
14
|
+
const simpleTerminalIcons = {
|
|
15
|
+
warp: {
|
|
16
|
+
color: '#01A4FF',
|
|
17
|
+
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',
|
|
18
|
+
},
|
|
19
|
+
wezterm: {
|
|
20
|
+
color: '#4E49EE',
|
|
21
|
+
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',
|
|
22
|
+
},
|
|
23
|
+
alacritty: {
|
|
24
|
+
color: '#F46D01',
|
|
25
|
+
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',
|
|
26
|
+
},
|
|
27
|
+
'gnome-terminal': {
|
|
28
|
+
color: colors_1.CURRENT_COLOR,
|
|
29
|
+
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',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const TerminalIcon = ({ terminalId, size }) => {
|
|
33
|
+
const hasArtwork = terminalId === 'terminal' ||
|
|
34
|
+
terminalId === 'iterm2' ||
|
|
35
|
+
terminalId === 'ghostty' ||
|
|
36
|
+
terminalId === 'windows-terminal';
|
|
37
|
+
if (hasArtwork) {
|
|
38
|
+
return (jsx_runtime_1.jsx("img", { alt: "", "aria-hidden": true, "data-terminal-icon": terminalId, draggable: false, src: `/api/app-icon/terminal/${terminalId}.png`, style: iconStyle(size) }));
|
|
39
|
+
}
|
|
40
|
+
const icon = simpleTerminalIcons[terminalId];
|
|
41
|
+
if (!icon) {
|
|
42
|
+
return (jsx_runtime_1.jsx(apps_1.AppsIcon, { "aria-hidden": true, "data-terminal-icon": terminalId, height: size, width: size }));
|
|
43
|
+
}
|
|
44
|
+
return (jsx_runtime_1.jsx("svg", { "aria-hidden": true, "data-terminal-icon": terminalId, style: iconStyle(size), viewBox: "0 0 24 24", children: jsx_runtime_1.jsx("path", { d: icon.path, fill: icon.color }) }));
|
|
45
|
+
};
|
|
46
|
+
exports.TerminalIcon = TerminalIcon;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,21 @@ export { watchPublicFolder } from './api/watch-public-folder';
|
|
|
16
16
|
export { watchStaticFile } from './api/watch-static-file';
|
|
17
17
|
export { writeStaticFile } from './api/write-static-file';
|
|
18
18
|
export declare const StudioInternals: {
|
|
19
|
+
CodingAgentIcon: import("react").FC<{
|
|
20
|
+
readonly codingAgentId: "claude-code" | "codex" | "copilot" | "cursor" | null;
|
|
21
|
+
readonly size: number;
|
|
22
|
+
}>;
|
|
23
|
+
EditorIcon: import("react").FC<{
|
|
24
|
+
readonly editorId: import("@remotion/studio-shared").EditorPickerId | null;
|
|
25
|
+
readonly size: number | null;
|
|
26
|
+
}>;
|
|
27
|
+
FinderIcon: import("react").FC<{
|
|
28
|
+
readonly size: number;
|
|
29
|
+
}>;
|
|
30
|
+
TerminalIcon: import("react").FC<{
|
|
31
|
+
readonly terminalId: import("@remotion/studio-shared").TerminalId;
|
|
32
|
+
readonly size: number;
|
|
33
|
+
}>;
|
|
19
34
|
createComposition: <Schema extends import("remotion").AnyZodObject, Props extends Record<string, unknown>>({ ...other }: import("remotion").CompositionProps<Schema, Props>) => () => import("react/jsx-runtime").JSX.Element;
|
|
20
35
|
createStill: <Schema extends import("remotion").AnyZodObject, Props extends Record<string, unknown>>({ ...other }: import("remotion").StillProps<Schema, Props>) => () => import("react/jsx-runtime").JSX.Element;
|
|
21
36
|
};
|