@remotion/studio 4.0.489 → 4.0.491

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.
Files changed (109) hide show
  1. package/dist/components/Canvas.js +20 -2
  2. package/dist/components/CurrentComposition.js +4 -1
  3. package/dist/components/EditorContent.js +1 -1
  4. package/dist/components/GlobalKeybindings.d.ts +1 -3
  5. package/dist/components/GlobalKeybindings.js +2 -9
  6. package/dist/components/InspectorLocationCopy.d.ts +7 -0
  7. package/dist/components/InspectorLocationCopy.js +65 -0
  8. package/dist/components/InspectorPanel/AlignmentControls.d.ts +5 -0
  9. package/dist/components/InspectorPanel/AlignmentControls.js +205 -0
  10. package/dist/components/InspectorPanel/EasingInspector.js +8 -2
  11. package/dist/components/InspectorPanel/KeyframeSettings.d.ts +5 -0
  12. package/dist/components/InspectorPanel/KeyframeSettings.js +142 -0
  13. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +4 -3
  14. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -1
  15. package/dist/components/InspectorPanel/alignment-controls.d.ts +12 -0
  16. package/dist/components/InspectorPanel/alignment-controls.js +42 -0
  17. package/dist/components/InspectorSequenceSection.d.ts +1 -0
  18. package/dist/components/InspectorSequenceSection.js +2 -2
  19. package/dist/components/KeyboardShortcutsExplainer.js +4 -0
  20. package/dist/components/MobilePanel.js +9 -3
  21. package/dist/components/Modals.js +1 -2
  22. package/dist/components/NewComposition/CancelButton.d.ts +1 -0
  23. package/dist/components/NewComposition/CancelButton.js +6 -2
  24. package/dist/components/OptionsPanel.js +4 -8
  25. package/dist/components/OutlineToggle.d.ts +3 -1
  26. package/dist/components/OutlineToggle.js +2 -2
  27. package/dist/components/Preview.js +1 -1
  28. package/dist/components/PreviewToolbar.js +1 -1
  29. package/dist/components/RenderButton.js +9 -33
  30. package/dist/components/RenderModal/WebRenderModal.js +3 -8
  31. package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +0 -2
  32. package/dist/components/RenderModal/WebRenderModalAdvanced.js +2 -9
  33. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +0 -2
  34. package/dist/components/RenderQueue/client-side-render-types.d.ts +0 -1
  35. package/dist/components/RenderQueue/index.js +0 -9
  36. package/dist/components/SelectedOutlineElement.js +40 -38
  37. package/dist/components/SelectedOutlineOverlay.d.ts +7 -2
  38. package/dist/components/SelectedOutlineOverlay.js +249 -22
  39. package/dist/components/SnappingToggle.d.ts +3 -1
  40. package/dist/components/SnappingToggle.js +2 -2
  41. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +20 -1
  42. package/dist/components/Timeline/TimelineClipboardKeybindings.js +304 -155
  43. package/dist/components/Timeline/TimelineEffectPropItem.js +9 -61
  44. package/dist/components/Timeline/TimelineFieldLabel.d.ts +1 -0
  45. package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
  46. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +8 -0
  47. package/dist/components/Timeline/TimelineFieldRowContent.js +16 -0
  48. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  49. package/dist/components/Timeline/TimelineRowChrome.js +2 -0
  50. package/dist/components/Timeline/TimelineSequence.js +2 -4
  51. package/dist/components/Timeline/TimelineSequenceItem.js +6 -9
  52. package/dist/components/Timeline/TimelineSequenceName.js +1 -3
  53. package/dist/components/Timeline/TimelineSequencePropItem.js +10 -59
  54. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -0
  55. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +18 -6
  56. package/dist/components/Timeline/TimelineTextContentField.js +12 -5
  57. package/dist/components/Timeline/TimelineVideoInfo.d.ts +3 -1
  58. package/dist/components/Timeline/TimelineVideoInfo.js +11 -4
  59. package/dist/components/Timeline/delete-selected-timeline-item.js +4 -5
  60. package/dist/components/Timeline/effects-clipboard.d.ts +14 -0
  61. package/dist/components/Timeline/effects-clipboard.js +68 -0
  62. package/dist/components/Timeline/get-sequence-context-menu-items.js +37 -0
  63. package/dist/components/Timeline/get-timeline-media-start-frame.d.ts +6 -0
  64. package/dist/components/Timeline/get-timeline-media-start-frame.js +15 -0
  65. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -2
  66. package/dist/components/Timeline/sequence-props-subscription-store.js +4 -2
  67. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -0
  68. package/dist/components/Timeline/timeline-field-row-layout.js +8 -1
  69. package/dist/components/Timeline/timeline-row-layout.d.ts +1 -1
  70. package/dist/components/Timeline/timeline-row-layout.js +1 -1
  71. package/dist/components/Timeline/use-sequence-props-subscription.js +10 -1
  72. package/dist/components/import-assets.d.ts +5 -0
  73. package/dist/components/import-assets.js +10 -2
  74. package/dist/components/selected-outline-measurement.d.ts +4 -0
  75. package/dist/components/selected-outline-measurement.js +3 -1
  76. package/dist/components/selected-outline-types.d.ts +1 -6
  77. package/dist/esm/{chunk-jrta3xaf.js → chunk-9wh9k3jj.js} +10393 -9551
  78. package/dist/esm/index.mjs +0 -1
  79. package/dist/esm/internals.mjs +10393 -9551
  80. package/dist/esm/previewEntry.mjs +7603 -6761
  81. package/dist/esm/renderEntry.mjs +1 -1
  82. package/dist/helpers/format-file-location.d.ts +5 -0
  83. package/dist/helpers/format-file-location.js +9 -1
  84. package/dist/helpers/install-required-package.d.ts +1 -0
  85. package/dist/helpers/install-required-package.js +3 -2
  86. package/dist/helpers/retry-payload.js +0 -1
  87. package/dist/helpers/studio-runtime-config.d.ts +0 -1
  88. package/dist/helpers/studio-runtime-config.js +1 -6
  89. package/dist/helpers/use-menu-structure.js +15 -18
  90. package/dist/icons/align-bottom.d.ts +3 -0
  91. package/dist/icons/align-bottom.js +12 -0
  92. package/dist/icons/align-center-horizontal.d.ts +3 -0
  93. package/dist/icons/align-center-horizontal.js +12 -0
  94. package/dist/icons/align-center-vertical.d.ts +3 -0
  95. package/dist/icons/align-center-vertical.js +12 -0
  96. package/dist/icons/align-left.d.ts +3 -0
  97. package/dist/icons/align-left.js +12 -0
  98. package/dist/icons/align-right.d.ts +3 -0
  99. package/dist/icons/align-right.js +12 -0
  100. package/dist/icons/align-top.d.ts +3 -0
  101. package/dist/icons/align-top.js +12 -0
  102. package/dist/state/modals.d.ts +1 -3
  103. package/package.json +11 -11
  104. package/dist/components/RenderModal/WebRendererExperimentalBadge.d.ts +0 -1
  105. package/dist/components/RenderModal/WebRendererExperimentalBadge.js +0 -35
  106. package/dist/components/Timeline/KeyframeSettingsModal.d.ts +0 -15
  107. package/dist/components/Timeline/KeyframeSettingsModal.js +0 -151
  108. package/dist/helpers/show-browser-rendering.d.ts +0 -1
  109. package/dist/helpers/show-browser-rendering.js +0 -5
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readClipboardTextAndEffectsEnvelope = exports.writeEffectsClipboardEnvelope = exports.parseEffectsClipboardHtml = exports.makeEffectsClipboardHtml = void 0;
4
+ const studio_shared_1 = require("@remotion/studio-shared");
5
+ const attribute = 'data-remotion-effects-clipboard';
6
+ const getClipboardLabel = (effects) => effects === 1 ? 'Remotion effect' : `${effects} Remotion effects`;
7
+ const makeEffectsClipboardHtml = (envelope) => `<span ${attribute}="${encodeURIComponent(JSON.stringify(envelope))}">${getClipboardLabel(envelope.payload.effects.length)}</span>`;
8
+ exports.makeEffectsClipboardHtml = makeEffectsClipboardHtml;
9
+ const parseEffectsClipboardHtml = (html) => {
10
+ const match = html.match(new RegExp(`${attribute}=["']([^"']+)["']`, 'i'));
11
+ if (!(match === null || match === void 0 ? void 0 : match[1])) {
12
+ return null;
13
+ }
14
+ try {
15
+ const candidate = JSON.parse(decodeURIComponent(match[1]));
16
+ if (candidate.envelopeVersion !== 1 ||
17
+ (candidate.sourceIdentity !== null &&
18
+ typeof candidate.sourceIdentity !== 'string') ||
19
+ !Array.isArray(candidate.originalEffectIndices) ||
20
+ !candidate.originalEffectIndices.every((index) => Number.isInteger(index) && index >= 0)) {
21
+ return null;
22
+ }
23
+ const result = (0, studio_shared_1.parseEffectClipboardDataResult)(JSON.stringify(candidate.payload));
24
+ if (result.status !== 'valid') {
25
+ return null;
26
+ }
27
+ const originalEffectIndices = candidate.originalEffectIndices;
28
+ const sourceIdentity = candidate.sourceIdentity;
29
+ if ((sourceIdentity === null && originalEffectIndices.length !== 0) ||
30
+ (sourceIdentity !== null &&
31
+ (originalEffectIndices.length !== result.data.effects.length ||
32
+ new Set(originalEffectIndices).size !== originalEffectIndices.length))) {
33
+ return null;
34
+ }
35
+ return {
36
+ envelopeVersion: 1,
37
+ payload: result.data,
38
+ sourceIdentity,
39
+ originalEffectIndices,
40
+ };
41
+ }
42
+ catch (_a) {
43
+ return null;
44
+ }
45
+ };
46
+ exports.parseEffectsClipboardHtml = parseEffectsClipboardHtml;
47
+ const writeEffectsClipboardEnvelope = async (envelope) => {
48
+ const label = getClipboardLabel(envelope.payload.effects.length);
49
+ await navigator.clipboard.write([
50
+ new ClipboardItem({
51
+ 'text/html': new Blob([(0, exports.makeEffectsClipboardHtml)(envelope)], {
52
+ type: 'text/html',
53
+ }),
54
+ 'text/plain': new Blob([label], { type: 'text/plain' }),
55
+ }),
56
+ ]);
57
+ };
58
+ exports.writeEffectsClipboardEnvelope = writeEffectsClipboardEnvelope;
59
+ const readClipboardTextAndEffectsEnvelope = (clipboardData) => {
60
+ const html = clipboardData.types.includes('text/html')
61
+ ? clipboardData.getData('text/html')
62
+ : '';
63
+ return {
64
+ text: clipboardData.getData('text/plain'),
65
+ envelope: html === '' ? null : (0, exports.parseEffectsClipboardHtml)(html),
66
+ };
67
+ };
68
+ exports.readClipboardTextAndEffectsEnvelope = readClipboardTextAndEffectsEnvelope;
@@ -21,9 +21,12 @@ const normalizeMenuDividers = (items) => {
21
21
  }
22
22
  return normalized;
23
23
  };
24
+ const interactiveSvgComponentIdentity = 'dev.remotion.remotion.Interactive.Svg';
24
25
  const getSequenceContextMenuItems = ({ assetLinkInfo, canOpenInEditor, deleteDisabled, disableInteractivityDisabled, duplicateDisabled, fileLocation, includeSourceEditItems, onDeleteSequenceFromSource, onDisableSequenceInteractivity, onDuplicateSequenceFromSource, openInEditor, originalLocation, selectAsset, sequence, sourceActions = [], }) => {
26
+ var _a, _b;
25
27
  const editorName = window.remotion_editorName;
26
28
  const { documentationLink } = sequence;
29
+ const isInteractiveSvg = ((_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.componentIdentity) === interactiveSvgComponentIdentity;
27
30
  const items = [
28
31
  editorName
29
32
  ? {
@@ -101,6 +104,40 @@ const getSequenceContextMenuItems = ({ assetLinkInfo, canOpenInEditor, deleteDis
101
104
  id: 'sequence-link-divider',
102
105
  }
103
106
  : null,
107
+ isInteractiveSvg
108
+ ? {
109
+ type: 'item',
110
+ id: 'copy-svg',
111
+ keyHint: null,
112
+ label: 'Copy SVG',
113
+ leftItem: null,
114
+ disabled: !((_b = sequence.refForOutline) === null || _b === void 0 ? void 0 : _b.current),
115
+ onClick: () => {
116
+ var _a;
117
+ const svg = (_a = sequence.refForOutline) === null || _a === void 0 ? void 0 : _a.current;
118
+ if (!svg) {
119
+ return;
120
+ }
121
+ navigator.clipboard
122
+ .writeText(svg.outerHTML)
123
+ .then(() => {
124
+ (0, NotificationCenter_1.showNotification)('Copied SVG to clipboard', 1000);
125
+ })
126
+ .catch((err) => {
127
+ (0, NotificationCenter_1.showNotification)(`Could not copy to clipboard: ${err.message}`, 1000);
128
+ });
129
+ },
130
+ quickSwitcherLabel: null,
131
+ subMenu: null,
132
+ value: 'copy-svg',
133
+ }
134
+ : null,
135
+ isInteractiveSvg
136
+ ? {
137
+ type: 'divider',
138
+ id: 'copy-svg-divider',
139
+ }
140
+ : null,
104
141
  sourceActions.length > 0
105
142
  ? {
106
143
  type: 'divider',
@@ -0,0 +1,6 @@
1
+ export declare const getTimelineMediaStartFrame: ({ startMediaFrom, mediaFrameAtSequenceZero, sequenceFrameOffset, playbackRate, }: {
2
+ startMediaFrom: number;
3
+ mediaFrameAtSequenceZero: number | null;
4
+ sequenceFrameOffset: number;
5
+ playbackRate: number;
6
+ }) => number;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTimelineMediaStartFrame = void 0;
4
+ const no_react_1 = require("remotion/no-react");
5
+ const getTimelineMediaStartFrame = ({ startMediaFrom, mediaFrameAtSequenceZero, sequenceFrameOffset, playbackRate, }) => {
6
+ if (mediaFrameAtSequenceZero !== null) {
7
+ return mediaFrameAtSequenceZero + sequenceFrameOffset * playbackRate;
8
+ }
9
+ return no_react_1.NoReactInternals.getExpectedMediaFrameUncorrected({
10
+ frame: sequenceFrameOffset,
11
+ startFrom: startMediaFrom,
12
+ playbackRate,
13
+ });
14
+ };
15
+ exports.getTimelineMediaStartFrame = getTimelineMediaStartFrame;
@@ -1,8 +1,8 @@
1
- import type { SequenceNodePath, InteractivitySchema } from 'remotion';
1
+ import type { SequenceNodePath, InteractivitySchema, VideoConfigValues } from 'remotion';
2
2
  import { callApi } from '../call-api';
3
3
  type SubscribeResult = Awaited<ReturnType<typeof callApi<'/api/subscribe-to-sequence-props'>>>;
4
4
  type ApplyResult = (result: SubscribeResult) => void;
5
- export declare const acquireSequencePropsSubscription: ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, }: {
5
+ export declare const acquireSequencePropsSubscription: ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, }: {
6
6
  fileName: string;
7
7
  line: number;
8
8
  column: number;
@@ -13,6 +13,7 @@ export declare const acquireSequencePropsSubscription: ({ fileName, line, column
13
13
  clientId: string;
14
14
  applyOnce: ApplyResult;
15
15
  applyEach: ApplyResult;
16
+ videoConfigValues: VideoConfigValues;
16
17
  }) => {
17
18
  release: () => void;
18
19
  };
@@ -4,9 +4,9 @@ exports.acquireSequencePropsSubscription = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const remotion_1 = require("remotion");
6
6
  const call_api_1 = require("../call-api");
7
- const makeKey = ({ fileName, line, column, componentIdentity, sequenceKeys, effectKeys, }) => `${fileName}\0${line}\0${column}\0${componentIdentity !== null && componentIdentity !== void 0 ? componentIdentity : ''}\0${sequenceKeys.join('\0')}\0${effectKeys.map((keys) => keys.join('\0')).join('\0\0')}`;
7
+ const makeKey = ({ fileName, line, column, componentIdentity, sequenceKeys, effectKeys, videoConfigValues, }) => `${fileName}\0${line}\0${column}\0${componentIdentity !== null && componentIdentity !== void 0 ? componentIdentity : ''}\0${sequenceKeys.join('\0')}\0${effectKeys.map((keys) => keys.join('\0')).join('\0\0')}\0${JSON.stringify(videoConfigValues)}`;
8
8
  const entries = new Map();
9
- const acquireSequencePropsSubscription = ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, }) => {
9
+ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, }) => {
10
10
  const sequenceKeys = (0, studio_shared_1.getAllSchemaKeys)(schema);
11
11
  const effectKeys = effects.map((effect) => (0, studio_shared_1.getAllSchemaKeys)(effect));
12
12
  const key = makeKey({
@@ -16,6 +16,7 @@ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, comp
16
16
  componentIdentity,
17
17
  sequenceKeys,
18
18
  effectKeys,
19
+ videoConfigValues,
19
20
  });
20
21
  let entry = entries.get(key);
21
22
  if (!entry) {
@@ -28,6 +29,7 @@ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, comp
28
29
  keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
29
30
  effects: effectKeys,
30
31
  clientId,
32
+ videoConfigValues,
31
33
  });
32
34
  const created = {
33
35
  refCount: 0,
@@ -1,3 +1,4 @@
1
1
  import type React from 'react';
2
2
  export declare const getTimelineFieldLabelRowStyle: (depth: number) => React.CSSProperties;
3
3
  export declare const timelineFieldValueColumnStyle: React.CSSProperties;
4
+ export declare const timelineStackedFieldContentStyle: React.CSSProperties;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.timelineFieldValueColumnStyle = exports.getTimelineFieldLabelRowStyle = void 0;
3
+ exports.timelineStackedFieldContentStyle = exports.timelineFieldValueColumnStyle = exports.getTimelineFieldLabelRowStyle = void 0;
4
4
  const timeline_layout_1 = require("../../helpers/timeline-layout");
5
5
  const timeline_row_layout_1 = require("./timeline-row-layout");
6
6
  const getTimelineFieldLabelRowStyle = (depth) => {
@@ -22,3 +22,10 @@ exports.timelineFieldValueColumnStyle = {
22
22
  minWidth: 0,
23
23
  paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
24
24
  };
25
+ exports.timelineStackedFieldContentStyle = {
26
+ alignSelf: 'stretch',
27
+ display: 'flex',
28
+ flex: 1,
29
+ flexDirection: 'column',
30
+ minWidth: 0,
31
+ };
@@ -1,4 +1,4 @@
1
- export declare const TIMELINE_ROW_BASE_PADDING = 5;
1
+ export declare const TIMELINE_ROW_BASE_PADDING = 10;
2
2
  export declare const TIMELINE_EYE_COLUMN_WIDTH = 22;
3
3
  export declare const TIMELINE_ARROW_COLUMN_WIDTH = 16;
4
4
  export declare const TIMELINE_KEYFRAME_CONTROLS_WIDTH = 38;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExpandedRowDepth = exports.getTimelineFieldLabelFlexBasis = exports.getTimelineRowLeftChromeWidth = exports.getTimelineRowIndentWidth = exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH = exports.TIMELINE_KEYFRAME_CONTROLS_WIDTH = exports.TIMELINE_ARROW_COLUMN_WIDTH = exports.TIMELINE_EYE_COLUMN_WIDTH = exports.TIMELINE_ROW_BASE_PADDING = void 0;
4
4
  const timeline_indent_1 = require("./timeline-indent");
5
- exports.TIMELINE_ROW_BASE_PADDING = 5;
5
+ exports.TIMELINE_ROW_BASE_PADDING = 10;
6
6
  exports.TIMELINE_EYE_COLUMN_WIDTH = 22;
7
7
  exports.TIMELINE_ARROW_COLUMN_WIDTH = 16;
8
8
  exports.TIMELINE_KEYFRAME_CONTROLS_WIDTH = 38;
@@ -18,6 +18,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
18
18
  const overrideIdToNodePathMappingsRef = (0, react_1.useRef)(overrideIdToNodePathMappings);
19
19
  overrideIdToNodePathMappingsRef.current = overrideIdToNodePathMappings;
20
20
  const clientId = state.type === 'connected' ? state.clientId : undefined;
21
+ const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
21
22
  const effectsSignature = (0, react_1.useMemo)(() => effects.map((effect) => (0, studio_shared_1.getAllSchemaKeys)(effect).join('\0')).join('\0\0'), [effects]);
22
23
  const validatedLocation = (0, react_1.useMemo)(() => {
23
24
  var _a;
@@ -41,7 +42,8 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
41
42
  !locationSource ||
42
43
  !locationLine ||
43
44
  locationColumn === null ||
44
- !schema) {
45
+ !schema ||
46
+ videoConfig === null) {
45
47
  return;
46
48
  }
47
49
  const nodePathAtResubscribe = (_a = overrideIdToNodePathMappingsRef.current[overrideId]) !== null && _a !== void 0 ? _a : null;
@@ -54,6 +56,12 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
54
56
  effects,
55
57
  nodePath: (_b = nodePathAtResubscribe === null || nodePathAtResubscribe === void 0 ? void 0 : nodePathAtResubscribe.nodePath) !== null && _b !== void 0 ? _b : null,
56
58
  clientId,
59
+ videoConfigValues: {
60
+ durationInFrames: videoConfig.durationInFrames,
61
+ fps: videoConfig.fps,
62
+ height: videoConfig.height,
63
+ width: videoConfig.width,
64
+ },
57
65
  applyOnce: (result) => {
58
66
  if (!result.success) {
59
67
  return;
@@ -97,6 +105,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
97
105
  schema,
98
106
  setPropStatuses,
99
107
  setOverrideIdToNodePath,
108
+ videoConfig,
100
109
  ]);
101
110
  };
102
111
  exports.useSequencePropsSubscription = useSequencePropsSubscription;
@@ -29,6 +29,10 @@ export declare const getAssetElementFromPath: (assetPath: string) => {
29
29
  } | null;
30
30
  position: InsertableCompositionElementPosition | null;
31
31
  } | null;
32
+ export declare const getElementPositionForDrop: ({ dimensions, dropPosition, }: {
33
+ dimensions: Dimensions | null;
34
+ dropPosition: InsertElementDropPosition | null;
35
+ }) => InsertableCompositionElementPosition | null;
32
36
  export declare const getComponentDimensions: (component: {
33
37
  componentName: string;
34
38
  dimensions?: import("@remotion/studio-shared").ComponentDimensions | undefined;
@@ -83,6 +87,7 @@ export declare const insertElement: ({ compositionFile, compositionId, dropPosit
83
87
  compositionId: string;
84
88
  dropPosition: InsertElementDropPosition | null;
85
89
  element: {
90
+ dependencies: string[];
86
91
  slug: string;
87
92
  displayName: string;
88
93
  sourceCode: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.insertElement = exports.insertComposition = exports.insertComponent = exports.insertExistingAssets = exports.insertRemoteAudio = exports.importRemoteAsset = exports.importAssets = exports.pickFilesToImport = exports.getComponentDimensions = exports.getAssetElementFromPath = exports.getAssetElement = void 0;
3
+ exports.insertElement = exports.insertComposition = exports.insertComponent = exports.insertExistingAssets = exports.insertRemoteAudio = exports.importRemoteAsset = exports.importAssets = exports.pickFilesToImport = exports.getComponentDimensions = exports.getElementPositionForDrop = exports.getAssetElementFromPath = exports.getAssetElement = void 0;
4
4
  const media_utils_1 = require("@remotion/media-utils");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const remotion_1 = require("remotion");
@@ -174,6 +174,13 @@ const getCenteredPosition = ({ dimensions, dropPosition, }) => {
174
174
  y: dropPosition.centerY - dimensions.height / 2,
175
175
  };
176
176
  };
177
+ const getElementPositionForDrop = ({ dimensions, dropPosition, }) => {
178
+ if (dimensions === null) {
179
+ return null;
180
+ }
181
+ return getCenteredPosition({ dimensions, dropPosition });
182
+ };
183
+ exports.getElementPositionForDrop = getElementPositionForDrop;
177
184
  const getComponentPropNumber = (props, name) => {
178
185
  const prop = props.find((p) => p.name === name);
179
186
  return typeof (prop === null || prop === void 0 ? void 0 : prop.value) === 'number' ? prop.value : null;
@@ -625,11 +632,12 @@ const insertComposition = async ({ composition, compositionFile, compositionId,
625
632
  exports.insertComposition = insertComposition;
626
633
  const insertElement = async ({ compositionFile, compositionId, dropPosition, element, }) => {
627
634
  try {
635
+ await (0, install_required_package_1.installRequiredPackages)(element.dependencies);
628
636
  const response = await (0, call_api_1.callApi)('/api/insert-element', {
629
637
  compositionFile,
630
638
  compositionId,
631
639
  element,
632
- position: getCenteredPosition({
640
+ position: (0, exports.getElementPositionForDrop)({
633
641
  dimensions: element.dimensions,
634
642
  dropPosition,
635
643
  }),
@@ -48,6 +48,10 @@ export declare const getOutlineSelectionInteraction: ({ shiftKey, metaKey, ctrlK
48
48
  readonly metaKey: boolean;
49
49
  readonly ctrlKey: boolean;
50
50
  }) => TimelineSelectionInteraction;
51
+ export declare const getOutlineDoubleClickAction: ({ button, canOpenInEditor, }: {
52
+ readonly button: number;
53
+ readonly canOpenInEditor: boolean;
54
+ }) => "open-in-editor" | null;
51
55
  type SelectedEffectFields = {
52
56
  allFields: boolean;
53
57
  fieldKeys: Set<string>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedTransformOriginInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
3
+ exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedTransformOriginInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineDoubleClickAction = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
4
4
  const calculate_timeline_1 = require("../helpers/calculate-timeline");
5
5
  const colors_1 = require("../helpers/colors");
6
6
  const get_box_quads_ponyfill_1 = require("../helpers/get-box-quads-ponyfill");
@@ -220,6 +220,8 @@ const getOutlineSelectionInteraction = ({ shiftKey, metaKey, ctrlKey, }) => ({
220
220
  toggleKey: metaKey || ctrlKey,
221
221
  });
222
222
  exports.getOutlineSelectionInteraction = getOutlineSelectionInteraction;
223
+ const getOutlineDoubleClickAction = ({ button, canOpenInEditor, }) => button === 0 && canOpenInEditor ? 'open-in-editor' : null;
224
+ exports.getOutlineDoubleClickAction = getOutlineDoubleClickAction;
223
225
  const getKeyframeOrEasingField = (item) => {
224
226
  if (item.type !== 'keyframe' && item.type !== 'easing') {
225
227
  return null;
@@ -1,4 +1,4 @@
1
- import type { CanUpdateSequencePropStatus, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchema, InteractivitySchemaField, SequencePropsSubscriptionKey, TSequence } from 'remotion';
1
+ import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchema, InteractivitySchemaField, SequencePropsSubscriptionKey, TSequence } from 'remotion';
2
2
  import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
3
3
  import type { ComboboxValue } from './NewComposition/ComboBox';
4
4
  import type { SelectedOutlineUvHandle } from './selected-outline-uv';
@@ -18,7 +18,6 @@ export type SelectedOutlineTarget = {
18
18
  readonly scaleDrag: SelectedOutlineScaleDragTarget | null;
19
19
  readonly rotationDrag: SelectedOutlineRotationDragTarget | null;
20
20
  readonly transformOriginDrag: SelectedOutlineTransformOriginDragTarget | null;
21
- readonly textEdit: SelectedOutlineTextEditTarget | null;
22
21
  readonly uvHandles: readonly SelectedOutlineUvHandle[];
23
22
  };
24
23
  export type SelectedOutlineEffectDropTarget = {
@@ -26,10 +25,6 @@ export type SelectedOutlineEffectDropTarget = {
26
25
  readonly fileName: string;
27
26
  readonly nodePath: SequencePropsSubscriptionKey;
28
27
  };
29
- export type SelectedOutlineTextEditTarget = {
30
- readonly nodePath: SequencePropsSubscriptionKey;
31
- readonly propStatus: CanUpdateSequencePropStatus;
32
- };
33
28
  export type SelectedOutlineDragTarget = {
34
29
  readonly propStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
35
30
  readonly clientId: string;