@remotion/studio 4.0.518 → 4.0.519

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 (140) hide show
  1. package/dist/components/AppLaunchButton.d.ts +16 -0
  2. package/dist/components/AppLaunchButton.js +90 -0
  3. package/dist/components/AssetSelector.js +7 -6
  4. package/dist/components/AssetSelectorItem.d.ts +12 -0
  5. package/dist/components/AssetSelectorItem.js +180 -62
  6. package/dist/components/Button.js +20 -7
  7. package/dist/components/Canvas.js +109 -78
  8. package/dist/components/CanvasOrLoading.js +7 -7
  9. package/dist/components/CodingAgentButton.d.ts +7 -0
  10. package/dist/components/CodingAgentButton.js +59 -0
  11. package/dist/components/CompositionContextButton.d.ts +1 -0
  12. package/dist/components/CompositionContextButton.js +6 -3
  13. package/dist/components/CompositionSelector.js +15 -10
  14. package/dist/components/CompositionSelectorItem.js +16 -23
  15. package/dist/components/ConfigureLicenseModal.js +4 -48
  16. package/dist/components/CurrentAsset.js +1 -1
  17. package/dist/components/ElementInstallConfirmation.d.ts +20 -7
  18. package/dist/components/ElementInstallConfirmation.js +325 -32
  19. package/dist/components/FixComputedValueModal.js +5 -131
  20. package/dist/components/InitialCompositionLoader.js +3 -2
  21. package/dist/components/InspectorOpenInEditor.js +48 -33
  22. package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
  23. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
  24. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
  25. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
  26. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
  27. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
  28. package/dist/components/InspectorPanel/common.js +1 -0
  29. package/dist/components/InspectorPanel/styles.js +1 -0
  30. package/dist/components/InspectorSequenceSection.js +8 -3
  31. package/dist/components/InspectorSourceLocation.js +5 -1
  32. package/dist/components/KnownBugs.d.ts +1 -1
  33. package/dist/components/KnownBugs.js +1 -1
  34. package/dist/components/LicenseExplanation.d.ts +2 -0
  35. package/dist/components/LicenseExplanation.js +63 -0
  36. package/dist/components/MenuToolbar.js +7 -1
  37. package/dist/components/Modals.js +1 -2
  38. package/dist/components/NewComposition/InputDragger.js +29 -2
  39. package/dist/components/NewComposition/NewCompDuration.js +1 -1
  40. package/dist/components/NewComposition/NewComposition.d.ts +23 -0
  41. package/dist/components/NewComposition/NewComposition.js +217 -80
  42. package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
  43. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -1
  44. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +21 -13
  45. package/dist/components/RenderQueue/actions.d.ts +1 -0
  46. package/dist/components/RenderQueue/actions.js +5 -1
  47. package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
  48. package/dist/components/SelectedOutlineElement.js +2 -1
  49. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
  50. package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
  51. package/dist/components/SelectedOutlineOverlay.js +21 -26
  52. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  53. package/dist/components/SelectedOutlinePolygon.js +12 -4
  54. package/dist/components/SelectedOutlineRenderer.js +88 -21
  55. package/dist/components/SettingsContext.js +2 -1
  56. package/dist/components/SettingsModal.d.ts +1 -1
  57. package/dist/components/SettingsModal.js +19 -3
  58. package/dist/components/SidebarRenderButton.d.ts +1 -0
  59. package/dist/components/SidebarRenderButton.js +14 -5
  60. package/dist/components/Timeline/SequencePropsObserver.js +29 -14
  61. package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
  62. package/dist/components/Timeline/TimelineRowChrome.js +4 -2
  63. package/dist/components/Timeline/TimelineSequence.js +40 -8
  64. package/dist/components/Timeline/TimelineSequenceItem.js +34 -1
  65. package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
  66. package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
  67. package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
  68. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
  69. package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
  70. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
  71. package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
  72. package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
  73. package/dist/components/TimelineCombobox.js +1 -0
  74. package/dist/components/UpdateCheck.d.ts +0 -8
  75. package/dist/components/UpdateCheck.js +7 -54
  76. package/dist/components/UpdateStatusContext.d.ts +18 -0
  77. package/dist/components/UpdateStatusContext.js +74 -0
  78. package/dist/components/UpdatesSettings.d.ts +2 -0
  79. package/dist/components/UpdatesSettings.js +251 -0
  80. package/dist/components/WebMcp.js +3 -3
  81. package/dist/components/get-open-in-menu-items.d.ts +4 -0
  82. package/dist/components/get-open-in-menu-items.js +28 -24
  83. package/dist/components/root-composition-menu-items.d.ts +4 -1
  84. package/dist/components/root-composition-menu-items.js +38 -1
  85. package/dist/components/selected-outline-geometry.d.ts +21 -2
  86. package/dist/components/selected-outline-geometry.js +16 -5
  87. package/dist/components/selected-outline-measurement.d.ts +40 -1
  88. package/dist/components/selected-outline-measurement.js +239 -1
  89. package/dist/components/selected-outline-order.d.ts +12 -0
  90. package/dist/components/selected-outline-order.js +251 -0
  91. package/dist/components/selected-outline-types.d.ts +15 -2
  92. package/dist/components/selected-outline-uv.js +106 -3
  93. package/dist/components/use-configure-default-apps.d.ts +1 -0
  94. package/dist/components/use-configure-default-apps.js +24 -0
  95. package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
  96. package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
  97. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
  98. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +1 -1
  99. package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
  100. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
  101. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
  102. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
  103. package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
  104. package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
  105. package/dist/esm/{chunk-7prjt5n5.js → chunk-1fkq5bfq.js} +15439 -11610
  106. package/dist/esm/chunk-6jf1natv.js +25 -0
  107. package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
  108. package/dist/esm/chunk-m0jqdbkr.js +14571 -0
  109. package/dist/esm/index.mjs +0 -2
  110. package/dist/esm/internals.mjs +32140 -13755
  111. package/dist/esm/previewEntry.mjs +35408 -17021
  112. package/dist/esm/renderEntry.mjs +6 -3
  113. package/dist/helpers/can-show-updates.d.ts +5 -0
  114. package/dist/helpers/can-show-updates.js +7 -0
  115. package/dist/helpers/colors.d.ts +0 -3
  116. package/dist/helpers/colors.js +2 -5
  117. package/dist/helpers/create-folder-tree.d.ts +5 -0
  118. package/dist/helpers/create-folder-tree.js +24 -1
  119. package/dist/helpers/get-asset-metadata.js +1 -1
  120. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
  121. package/dist/helpers/get-box-quads-polyfill-internals.js +2403 -0
  122. package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
  123. package/dist/helpers/get-box-quads-ponyfill.js +23 -0
  124. package/dist/helpers/get-git-menu-item.d.ts +5 -0
  125. package/dist/helpers/get-git-menu-item.js +15 -1
  126. package/dist/helpers/hoverable.js +10 -5
  127. package/dist/helpers/open-in-editor.js +51 -1
  128. package/dist/helpers/preview-server-events.js +3 -0
  129. package/dist/helpers/timeline-layout.d.ts +0 -1
  130. package/dist/helpers/timeline-layout.js +1 -5
  131. package/dist/helpers/url-state.d.ts +1 -0
  132. package/dist/helpers/url-state.js +12 -5
  133. package/dist/renderEntry.js +2 -0
  134. package/dist/state/folders.d.ts +3 -0
  135. package/dist/state/folders.js +40 -1
  136. package/dist/state/modals.d.ts +1 -6
  137. package/package.json +17 -14
  138. package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
  139. package/dist/components/UpdateModal/UpdateModal.js +0 -104
  140. /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
@@ -0,0 +1,10 @@
1
+ export type GetBoxQuadsBox = 'margin' | 'border' | 'padding' | 'content';
2
+ export type GetBoxQuadsPonyfillOptions = {
3
+ readonly box?: GetBoxQuadsBox;
4
+ readonly relativeTo?: Element;
5
+ };
6
+ /**
7
+ * Returns border/margin/padding/content box quads for an element.
8
+ * Uses the native API when available, otherwise the getBoxQuads ponyfill.
9
+ */
10
+ export declare const getBoxQuadsPonyfill: (element: Element, options?: GetBoxQuadsPonyfillOptions | undefined) => readonly DOMQuad[] | null;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBoxQuadsPonyfill = void 0;
4
+ const get_box_quads_polyfill_internals_js_1 = require("./get-box-quads-polyfill-internals.js");
5
+ const hasNativeGetBoxQuads = (element) => {
6
+ return (typeof element.getBoxQuads === 'function');
7
+ };
8
+ /**
9
+ * Returns border/margin/padding/content box quads for an element.
10
+ * Uses the native API when available, otherwise the getBoxQuads ponyfill.
11
+ */
12
+ const getBoxQuadsPonyfill = (element, options) => {
13
+ try {
14
+ if (hasNativeGetBoxQuads(element)) {
15
+ return element.getBoxQuads(options);
16
+ }
17
+ return (0, get_box_quads_polyfill_internals_js_1.getBoxQuads)(element, options);
18
+ }
19
+ catch (_a) {
20
+ return null;
21
+ }
22
+ };
23
+ exports.getBoxQuadsPonyfill = getBoxQuadsPonyfill;
@@ -4,4 +4,9 @@ import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-
4
4
  export declare const getGitSourceName: (gitSource: GitSource) => string;
5
5
  export declare const getGitSourceBranchUrl: (gitSource: GitSource) => string;
6
6
  export declare const getGitRefUrl: (gitSource: GitSource, originalLocation: OriginalPosition, remotionRoot: string) => string;
7
+ export declare const hasReadOnlyGitSource: () => boolean;
8
+ export declare const openGitSource: ({ folder, location, }: {
9
+ folder: boolean;
10
+ location: OriginalPosition | null;
11
+ }) => void;
7
12
  export declare const getGitMenuItem: () => ComboboxValue | null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGitMenuItem = exports.getGitRefUrl = exports.getGitSourceBranchUrl = exports.getGitSourceName = void 0;
3
+ exports.getGitMenuItem = exports.openGitSource = exports.hasReadOnlyGitSource = exports.getGitRefUrl = exports.getGitSourceBranchUrl = exports.getGitSourceName = void 0;
4
4
  const getGitSourceName = (gitSource) => {
5
5
  if (gitSource.type === 'github') {
6
6
  return 'GitHub';
@@ -52,6 +52,20 @@ const getGitRefUrl = (gitSource, originalLocation, remotionRoot) => {
52
52
  throw new Error('Unknown git source type');
53
53
  };
54
54
  exports.getGitRefUrl = getGitRefUrl;
55
+ const hasReadOnlyGitSource = () => {
56
+ return Boolean(window.remotion_isReadOnlyStudio && window.remotion_gitSource);
57
+ };
58
+ exports.hasReadOnlyGitSource = hasReadOnlyGitSource;
59
+ const openGitSource = ({ folder, location, }) => {
60
+ const gitSource = window.remotion_gitSource;
61
+ if (!gitSource) {
62
+ return;
63
+ }
64
+ window.open(folder || !location
65
+ ? (0, exports.getGitSourceBranchUrl)(gitSource)
66
+ : (0, exports.getGitRefUrl)(gitSource, location, window.remotion_cwd), '_blank');
67
+ };
68
+ exports.openGitSource = openGitSource;
55
69
  const getGitMenuItem = () => {
56
70
  if (!window.remotion_gitSource) {
57
71
  return null;
@@ -50,18 +50,23 @@ const makeHoverableCSS = () => `
50
50
  }
51
51
 
52
52
  @media (hover: hover) {
53
- ${hoverable}:hover,
54
- ${hoverGroup}:hover ${hoverable} {
53
+ ${hoverable}:hover {
55
54
  background-color: var(${HOVER_BG_VARIABLE}, var(${BG_VARIABLE}, ${colors_1.TRANSPARENT}));
56
55
  }
57
56
 
58
57
  ${hoverable}:hover,
59
- ${hoverable}:hover *,
60
- ${hoverGroup}:hover ${hoverable},
61
- ${hoverGroup}:hover ${hoverable} * {
58
+ ${hoverable}:hover * {
62
59
  color: var(${HOVER_COLOR_VARIABLE}, var(${COLOR_VARIABLE}, inherit));
63
60
  }
64
61
 
62
+ /* An outer hoverable must not put a nested inline action into its hover
63
+ state. The nested action should only use its hover color when the
64
+ pointer is over the action itself. */
65
+ ${hoverable}:hover ${hoverable}:not(:hover),
66
+ ${hoverable}:hover ${hoverable}:not(:hover) * {
67
+ color: var(${COLOR_VARIABLE}, inherit);
68
+ }
69
+
65
70
  ${hoverGroup} ${reveal} {
66
71
  opacity: 0;
67
72
  }
@@ -1,8 +1,42 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.openCompositionComponentInEditor = exports.preloadCompositionComponentInfo = exports.loadCompositionComponentInfo = exports.useCachedCompositionComponentInfo = exports.getCachedCompositionComponentInfo = exports.subscribeToCompositionComponentInfo = exports.openOriginalPositionInEditorAtProperty = exports.openOriginalPositionInEditor = exports.openInGitClient = exports.openInTerminal = exports.openInCodingAgent = exports.openInEditor = void 0;
4
37
  const react_1 = require("react");
5
38
  const call_api_1 = require("../components/call-api");
39
+ const get_stack_1 = require("../components/Timeline/TimelineStack/get-stack");
6
40
  const browser_studio_operations_1 = require("./browser-studio-operations");
7
41
  const openInEditor = (stack, editorId) => {
8
42
  const { originalFileName, originalLineNumber, originalColumnNumber, originalFunctionName, originalScriptCode, } = stack;
@@ -125,7 +159,23 @@ const loadCompositionComponentInfo = async ({ compositionFile, compositionId, })
125
159
  const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
126
160
  const body = browserStudioOperations
127
161
  ? await browserStudioOperations.getCompositionComponentInfo(request)
128
- : await (0, call_api_1.callApi)('/api/composition-component-info', request);
162
+ : typeof window !== 'undefined' && window.remotion_isReadOnlyStudio
163
+ ? await (async () => {
164
+ const files = (0, get_stack_1.getSourceMapFilesForSource)(compositionFile);
165
+ if (files === null) {
166
+ throw new Error(`Could not find source map contents for ${compositionFile}`);
167
+ }
168
+ const { resolveCompositionComponentLocation } = await Promise.resolve().then(() => __importStar(require('@remotion/studio-codemods/resolve-composition-component-location')));
169
+ return {
170
+ canAddSequence: false,
171
+ location: resolveCompositionComponentLocation({
172
+ compositionFile,
173
+ compositionId,
174
+ project: { files, rootDir: '.' },
175
+ }),
176
+ };
177
+ })()
178
+ : await (0, call_api_1.callApi)('/api/composition-component-info', request);
129
179
  const result = {
130
180
  location: body.location,
131
181
  canAddSequence: body.canAddSequence,
@@ -90,6 +90,9 @@ const ensurePreviewServerEventSource = () => {
90
90
  if (connectToBrowserStudio()) {
91
91
  return;
92
92
  }
93
+ if (window.remotion_isReadOnlyStudio) {
94
+ return;
95
+ }
93
96
  if (typeof EventSource === 'undefined') {
94
97
  return;
95
98
  }
@@ -62,7 +62,6 @@ export declare const getExpandedTrackHeight: ({ sequence, nodePathInfo, getIsExp
62
62
  export declare const TIMELINE_LAYER_FILMSTRIP_HEIGHT = 26;
63
63
  export declare const TIMELINE_VIDEO_INFO_WAVEFORM_HEIGHT = 17;
64
64
  export declare const TIMELINE_LAYER_HEIGHT_VIDEO: number;
65
- export declare const TIMELINE_LAYER_HEIGHT_IMAGE = 26;
66
65
  export declare const TIMELINE_LAYER_HEIGHT_AUDIO = 34;
67
66
  export declare const TIMELINE_LAYER_HEIGHT_DEFAULT = 21;
68
67
  export declare const TIMELINE_LIST_ITEM_ROW_HEIGHT = 21;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTimelineLayerHeight = exports.TIMELINE_LIST_ITEM_ROW_HEIGHT = exports.TIMELINE_LAYER_HEIGHT_DEFAULT = exports.TIMELINE_LAYER_HEIGHT_AUDIO = exports.TIMELINE_LAYER_HEIGHT_IMAGE = exports.TIMELINE_LAYER_HEIGHT_VIDEO = exports.TIMELINE_VIDEO_INFO_WAVEFORM_HEIGHT = exports.TIMELINE_LAYER_FILMSTRIP_HEIGHT = exports.getExpandedTrackHeight = exports.getTreeRowHeight = exports.flattenVisibleTreeNodes = exports.buildTimelineTree = exports.EXPANDED_SECTION_PADDING_RIGHT = exports.TREE_GROUP_ROW_HEIGHT = exports.TIMELINE_TRACK_EXPANDED_HEIGHT = exports.TIMELINE_ITEM_BORDER_BOTTOM = exports.TIMELINE_BORDER = exports.TIMELINE_PADDING = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.getSchemaFieldGroup = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_GROUPS = void 0;
3
+ exports.getTimelineLayerHeight = exports.TIMELINE_LIST_ITEM_ROW_HEIGHT = exports.TIMELINE_LAYER_HEIGHT_DEFAULT = exports.TIMELINE_LAYER_HEIGHT_AUDIO = exports.TIMELINE_LAYER_HEIGHT_VIDEO = exports.TIMELINE_VIDEO_INFO_WAVEFORM_HEIGHT = exports.TIMELINE_LAYER_FILMSTRIP_HEIGHT = exports.getExpandedTrackHeight = exports.getTreeRowHeight = exports.flattenVisibleTreeNodes = exports.buildTimelineTree = exports.EXPANDED_SECTION_PADDING_RIGHT = exports.TREE_GROUP_ROW_HEIGHT = exports.TIMELINE_TRACK_EXPANDED_HEIGHT = exports.TIMELINE_ITEM_BORDER_BOTTOM = exports.TIMELINE_BORDER = exports.TIMELINE_PADDING = exports.SCHEMA_FIELD_ROW_HEIGHT = exports.getSchemaFieldGroup = exports.getFieldsToShow = exports.getEffectFieldsToShow = exports.SCHEMA_FIELD_GROUPS = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const studio_shared_2 = require("@remotion/studio-shared");
6
6
  Object.defineProperty(exports, "SCHEMA_FIELD_GROUPS", { enumerable: true, get: function () { return studio_shared_2.SCHEMA_FIELD_GROUPS; } });
@@ -162,7 +162,6 @@ exports.TIMELINE_LAYER_FILMSTRIP_HEIGHT = 26;
162
162
  // The waveform stripe rendered underneath the filmstrip in TimelineVideoInfo.
163
163
  exports.TIMELINE_VIDEO_INFO_WAVEFORM_HEIGHT = 17;
164
164
  exports.TIMELINE_LAYER_HEIGHT_VIDEO = 2 + exports.TIMELINE_LAYER_FILMSTRIP_HEIGHT + exports.TIMELINE_VIDEO_INFO_WAVEFORM_HEIGHT;
165
- exports.TIMELINE_LAYER_HEIGHT_IMAGE = 26;
166
165
  exports.TIMELINE_LAYER_HEIGHT_AUDIO = 34;
167
166
  exports.TIMELINE_LAYER_HEIGHT_DEFAULT = 21;
168
167
  // The horizontal row inside a timeline list item (eye + arrow + label).
@@ -171,9 +170,6 @@ const getTimelineLayerHeight = (type) => {
171
170
  if (type === 'video') {
172
171
  return exports.TIMELINE_LAYER_HEIGHT_VIDEO;
173
172
  }
174
- if (type === 'image') {
175
- return exports.TIMELINE_LAYER_HEIGHT_IMAGE;
176
- }
177
173
  if (type === 'audio') {
178
174
  return exports.TIMELINE_LAYER_HEIGHT_AUDIO;
179
175
  }
@@ -1,3 +1,4 @@
1
+ export declare const getNavigationWindow: () => Window;
1
2
  export declare const getUrlForRoute: (route: string) => string;
2
3
  export declare const pushUrl: (url: string) => void;
3
4
  export declare const replaceUrl: (url: string) => void;
@@ -1,25 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRoute = exports.reloadUrl = exports.clearUrl = exports.replaceUrl = exports.pushUrl = exports.getUrlForRoute = void 0;
3
+ exports.getRoute = exports.reloadUrl = exports.clearUrl = exports.replaceUrl = exports.pushUrl = exports.getUrlForRoute = exports.getNavigationWindow = void 0;
4
4
  const getUrlHandlingType = () => {
5
5
  if (window.remotion_isReadOnlyStudio || window.remotion_browserStudio) {
6
6
  return 'query-string';
7
7
  }
8
8
  return 'spa';
9
9
  };
10
+ const getNavigationWindow = () => {
11
+ if (window.remotion_browserStudio && window.parent !== window) {
12
+ return window.parent;
13
+ }
14
+ return window;
15
+ };
16
+ exports.getNavigationWindow = getNavigationWindow;
10
17
  const getUrlForRoute = (route) => {
11
18
  if (getUrlHandlingType() === 'query-string') {
12
- return `${window.location.pathname}?${route}`;
19
+ return `${(0, exports.getNavigationWindow)().location.pathname}?${route}`;
13
20
  }
14
21
  return route;
15
22
  };
16
23
  exports.getUrlForRoute = getUrlForRoute;
17
24
  const pushUrl = (url) => {
18
- window.history.pushState({}, 'Studio', (0, exports.getUrlForRoute)(url));
25
+ (0, exports.getNavigationWindow)().history.pushState({}, 'Studio', (0, exports.getUrlForRoute)(url));
19
26
  };
20
27
  exports.pushUrl = pushUrl;
21
28
  const replaceUrl = (url) => {
22
- window.history.replaceState({}, 'Studio', (0, exports.getUrlForRoute)(url));
29
+ (0, exports.getNavigationWindow)().history.replaceState({}, 'Studio', (0, exports.getUrlForRoute)(url));
23
30
  };
24
31
  exports.replaceUrl = replaceUrl;
25
32
  const clearUrl = () => {
@@ -32,7 +39,7 @@ const reloadUrl = () => {
32
39
  exports.reloadUrl = reloadUrl;
33
40
  const getRoute = () => {
34
41
  if (getUrlHandlingType() === 'query-string') {
35
- const route = window.location.search.substring(1);
42
+ const route = (0, exports.getNavigationWindow)().location.search.substring(1);
36
43
  return route.startsWith('/') ? route : '';
37
44
  }
38
45
  return window.location.pathname;
@@ -202,9 +202,11 @@ const renderContent = (Root) => {
202
202
  }
203
203
  renderToDOM(jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(DelayedSpinner, {}) }));
204
204
  Promise.resolve().then(() => __importStar(require('./internals'))).then(({ StudioInternals }) => {
205
+ var _a;
205
206
  window.remotion_isStudio = true;
206
207
  window.remotion_isReadOnlyStudio = true;
207
208
  window.remotion_inputProps = '{}';
209
+ (_a = window.remotion_enableSequenceStackTraces) === null || _a === void 0 ? void 0 : _a.call(window);
208
210
  renderToDOM(jsx_runtime_1.jsx(StudioInternals.Studio, { readOnly: true, rootComponent: Root }));
209
211
  })
210
212
  .catch((err) => {
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { ExpandedFoldersState } from '../helpers/persist-open-folders';
3
+ export type CompositionSortOrder = 'registration' | 'alphabetical';
3
4
  type TFolderContext = {
4
5
  compositionFoldersExpanded: ExpandedFoldersState;
5
6
  setCompositionFoldersExpanded: React.Dispatch<React.SetStateAction<ExpandedFoldersState>>;
6
7
  assetFoldersExpanded: ExpandedFoldersState;
7
8
  setAssetFoldersExpanded: React.Dispatch<React.SetStateAction<ExpandedFoldersState>>;
9
+ compositionSortOrder: CompositionSortOrder;
10
+ setCompositionSortOrder: (sortOrder: CompositionSortOrder) => void;
8
11
  };
9
12
  export declare const FolderContext: React.Context<TFolderContext>;
10
13
  export declare const FolderContextProvider: React.FC<{
@@ -4,6 +4,29 @@ exports.FolderContextProvider = exports.FolderContext = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const persist_open_folders_1 = require("../helpers/persist-open-folders");
7
+ const compositionSortOrderKey = 'remotion.compositionSortOrder';
8
+ const loadCompositionSortOrder = () => {
9
+ if (typeof window === 'undefined') {
10
+ return 'registration';
11
+ }
12
+ try {
13
+ return window.localStorage.getItem(compositionSortOrderKey) ===
14
+ 'alphabetical'
15
+ ? 'alphabetical'
16
+ : 'registration';
17
+ }
18
+ catch (_a) {
19
+ return 'registration';
20
+ }
21
+ };
22
+ const persistCompositionSortOrder = (sortOrder) => {
23
+ try {
24
+ window.localStorage.setItem(compositionSortOrderKey, sortOrder);
25
+ }
26
+ catch (_a) {
27
+ // Ignore quota errors or disabled storage.
28
+ }
29
+ };
7
30
  exports.FolderContext = (0, react_1.createContext)({
8
31
  compositionFoldersExpanded: {},
9
32
  setCompositionFoldersExpanded: () => {
@@ -13,18 +36,34 @@ exports.FolderContext = (0, react_1.createContext)({
13
36
  setAssetFoldersExpanded: () => {
14
37
  throw new Error('default state');
15
38
  },
39
+ compositionSortOrder: 'registration',
40
+ setCompositionSortOrder: () => {
41
+ throw new Error('default state');
42
+ },
16
43
  });
17
44
  const FolderContextProvider = ({ children }) => {
18
45
  const [compositionFoldersExpanded, setCompositionFoldersExpanded] = (0, react_1.useState)(() => (0, persist_open_folders_1.loadExpandedFolders)('compositions'));
19
46
  const [assetFoldersExpanded, setAssetFoldersExpanded] = (0, react_1.useState)(() => (0, persist_open_folders_1.loadExpandedFolders)('assets'));
47
+ const [compositionSortOrder, setCompositionSortOrderState] = (0, react_1.useState)(loadCompositionSortOrder);
48
+ const setCompositionSortOrder = (0, react_1.useCallback)((sortOrder) => {
49
+ persistCompositionSortOrder(sortOrder);
50
+ setCompositionSortOrderState(sortOrder);
51
+ }, []);
20
52
  const value = (0, react_1.useMemo)(() => {
21
53
  return {
22
54
  compositionFoldersExpanded,
23
55
  setCompositionFoldersExpanded,
24
56
  assetFoldersExpanded,
25
57
  setAssetFoldersExpanded,
58
+ compositionSortOrder,
59
+ setCompositionSortOrder,
26
60
  };
27
- }, [assetFoldersExpanded, compositionFoldersExpanded]);
61
+ }, [
62
+ assetFoldersExpanded,
63
+ compositionFoldersExpanded,
64
+ compositionSortOrder,
65
+ setCompositionSortOrder,
66
+ ]);
28
67
  return (jsx_runtime_1.jsx(exports.FolderContext.Provider, { value: value, children: children }));
29
68
  };
30
69
  exports.FolderContextProvider = FolderContextProvider;
@@ -8,7 +8,6 @@ import type { StaticFile } from '../api/get-static-files';
8
8
  import type { CompType } from '../components/NewComposition/DuplicateComposition';
9
9
  import type { QuickSwitcherMode } from '../components/QuickSwitcher/NoResults';
10
10
  import type { RenderType } from '../components/RenderModal/RenderModalAdvanced';
11
- import type { Bug, UpdateInfo } from '../components/UpdateCheck';
12
11
  export type WebRenderModalState = {
13
12
  type: 'web-render';
14
13
  initialFrame: number;
@@ -154,15 +153,11 @@ export type ModalState = {
154
153
  type: 'input-props-override';
155
154
  } | {
156
155
  type: 'settings';
157
- initialTab: 'apps' | 'rendering' | 'studio' | 'packages' | 'shortcuts' | 'license';
156
+ initialTab: 'apps' | 'rendering' | 'studio' | 'packages' | 'shortcuts' | 'skills' | 'updates' | 'license';
158
157
  initialPublicLicenseKey: string | null;
159
158
  } | RenderModalState | WebRenderModalState | {
160
159
  type: 'render-progress';
161
160
  jobId: string;
162
- } | {
163
- type: 'update';
164
- info: UpdateInfo;
165
- knownBugs: Bug[];
166
161
  } | {
167
162
  type: 'fix-computed-value';
168
163
  prop: string;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
4
4
  },
5
5
  "name": "@remotion/studio",
6
- "version": "4.0.518",
6
+ "version": "4.0.519",
7
7
  "description": "APIs for interacting with the Remotion Studio",
8
8
  "main": "dist",
9
9
  "scripts": {
@@ -25,19 +25,20 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@tanstack/react-virtual": "3.14.9",
28
- "@remotion/canvas": "4.0.518",
29
- "@remotion/studio-protocol": "4.0.518",
28
+ "@remotion/canvas": "4.0.519",
29
+ "@remotion/studio-protocol": "4.0.519",
30
+ "@remotion/studio-codemods": "4.0.519",
30
31
  "semver": "7.5.3",
31
- "remotion": "4.0.518",
32
- "@remotion/captions": "4.0.518",
33
- "@remotion/media": "4.0.518",
34
- "@remotion/player": "4.0.518",
35
- "@remotion/media-utils": "4.0.518",
36
- "@remotion/renderer": "4.0.518",
37
- "@remotion/web-renderer": "4.0.518",
38
- "@remotion/studio-shared": "4.0.518",
39
- "@remotion/timeline-utils": "4.0.518",
40
- "@remotion/zod-types": "4.0.518",
32
+ "remotion": "4.0.519",
33
+ "@remotion/captions": "4.0.519",
34
+ "@remotion/media": "4.0.519",
35
+ "@remotion/player": "4.0.519",
36
+ "@remotion/media-utils": "4.0.519",
37
+ "@remotion/renderer": "4.0.519",
38
+ "@remotion/web-renderer": "4.0.519",
39
+ "@remotion/studio-shared": "4.0.519",
40
+ "@remotion/timeline-utils": "4.0.519",
41
+ "@remotion/zod-types": "4.0.519",
41
42
  "@jridgewell/trace-mapping": "0.3.31",
42
43
  "mediabunny": "1.55.1",
43
44
  "memfs": "3.4.3",
@@ -45,10 +46,12 @@
45
46
  "zod": "4.4.3"
46
47
  },
47
48
  "devDependencies": {
49
+ "@happy-dom/global-registrator": "14.5.1",
48
50
  "react": "19.2.3",
49
51
  "react-dom": "19.2.3",
52
+ "@testing-library/react": "16.1.0",
50
53
  "@types/semver": "7.5.3",
51
- "@remotion/eslint-config-internal": "4.0.518",
54
+ "@remotion/eslint-config-internal": "4.0.519",
52
55
  "eslint": "9.19.0",
53
56
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
54
57
  },
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import type { Bug, UpdateInfo } from '../UpdateCheck';
3
- export declare const UpdateModal: React.FC<{
4
- readonly info: UpdateInfo;
5
- readonly knownBugs: Bug[];
6
- }>;
@@ -1,104 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateModal = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const colors_1 = require("../../helpers/colors");
7
- const copy_text_1 = require("../../helpers/copy-text");
8
- const clipboard_1 = require("../../icons/clipboard");
9
- const InlineAction_1 = require("../InlineAction");
10
- const KnownBugs_1 = require("../KnownBugs");
11
- const ModalHeader_1 = require("../ModalHeader");
12
- const DismissableModal_1 = require("../NewComposition/DismissableModal");
13
- const NotificationCenter_1 = require("../Notifications/NotificationCenter");
14
- const container = {
15
- padding: '0 16px 8px',
16
- };
17
- const panelStyle = {
18
- borderRadius: 6,
19
- overflow: 'hidden',
20
- };
21
- const text = {
22
- color: colors_1.LIGHT_TEXT,
23
- fontFamily: 'sans-serif',
24
- fontSize: 14,
25
- lineHeight: 1.5,
26
- };
27
- const title = {
28
- paddingTop: 12,
29
- paddingBottom: 8,
30
- ...text,
31
- };
32
- const commandField = {
33
- alignItems: 'center',
34
- background: colors_1.SELECTED_BACKGROUND,
35
- borderRadius: 6,
36
- boxSizing: 'border-box',
37
- display: 'flex',
38
- marginBottom: 10,
39
- marginTop: 10,
40
- padding: '8px 8px 8px 10px',
41
- width: '100%',
42
- };
43
- const code = {
44
- color: colors_1.WHITE,
45
- flex: 1,
46
- fontFamily: 'monospace',
47
- fontSize: 14,
48
- lineHeight: 1.5,
49
- margin: 0,
50
- minWidth: 0,
51
- overflowX: 'auto',
52
- whiteSpace: 'pre',
53
- };
54
- const copyIcon = {
55
- flexShrink: 0,
56
- height: 12,
57
- width: 12,
58
- };
59
- const link = {
60
- ...text,
61
- fontWeight: 'bold',
62
- color: colors_1.BLUE,
63
- textDecoration: 'none',
64
- };
65
- const commands = {
66
- npm: 'npx remotion upgrade',
67
- yarn: 'yarn remotion upgrade',
68
- pnpm: 'pnpm exec remotion upgrade',
69
- bun: 'bun remotion upgrade',
70
- unknown: 'npx remotion upgrade',
71
- };
72
- const skillsUpdateCommand = 'npx remotion skills update';
73
- const remotionUpgradeSkill = '/remotion-upgrade';
74
- const UpdateModal = ({ info, knownBugs }) => {
75
- const hasKnownBugs = (0, react_1.useMemo)(() => {
76
- return knownBugs && (knownBugs === null || knownBugs === void 0 ? void 0 : knownBugs.length) > 0;
77
- }, [knownBugs]);
78
- const updateAction = info.remotionUpgradeSkillAvailable
79
- ? remotionUpgradeSkill
80
- : info.updateAvailable
81
- ? commands[info.packageManager]
82
- : skillsUpdateCommand;
83
- const updateActionType = info.remotionUpgradeSkillAvailable
84
- ? 'skill'
85
- : 'command';
86
- const onClick = (0, react_1.useCallback)(() => {
87
- (0, copy_text_1.copyText)(updateAction).catch((err) => {
88
- (0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
89
- });
90
- }, [updateAction]);
91
- const renderCopyAction = (0, react_1.useCallback)((color) => {
92
- return jsx_runtime_1.jsx(clipboard_1.ClipboardIcon, { color: color, style: copyIcon });
93
- }, []);
94
- return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
95
- jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Update available" }), jsx_runtime_1.jsxs("div", { style: container, children: [hasKnownBugs && info.updateAvailable ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
96
- jsx_runtime_1.jsxs("div", { style: title, children: ["The currently installed version ", info.currentVersion, " has the following known bugs:"] }), jsx_runtime_1.jsx(KnownBugs_1.KnownBugs, { bugs: knownBugs }), jsx_runtime_1.jsx("div", { style: { height: '20px' } }), jsx_runtime_1.jsxs("div", { style: text, children: ["To upgrade, run the following ", updateActionType, ":"] })
97
- ] })) : info.updateAvailable ? (jsx_runtime_1.jsxs("div", { style: title, children: ["A new update for Remotion is available! Run the following", ' ', updateActionType, ":"] })) : (jsx_runtime_1.jsxs("div", { style: title, children: ["Your Remotion Agent Skills are out of date. Run the following", ' ', updateActionType, ":"] })), jsx_runtime_1.jsxs("div", { style: commandField, children: [
98
- jsx_runtime_1.jsx("pre", { style: code, children: updateAction }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onClick, renderAction: renderCopyAction, title: "Copy command" })
99
- ] }), info.updateAvailable ? (jsx_runtime_1.jsxs("div", { style: text, children: ["This will upgrade Remotion from ", info.currentVersion, " to", ' ', info.latestVersion, info.skillsUpdateAvailable
100
- ? ' and update your project Remotion Agent Skills.'
101
- : '.'] })) : null, info.updateAvailable ? (jsx_runtime_1.jsxs("div", { style: text, children: ["Read the", ' ', jsx_runtime_1.jsx("a", { style: link, target: "_blank", href: "https://github.com/remotion-dev/remotion/releases", children: "Release notes" }), ' ', "to know what", "'s", " new in Remotion."] })) : null] })
102
- ] }));
103
- };
104
- exports.UpdateModal = UpdateModal;