@remotion/studio 4.0.428 → 4.0.430

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 (125) hide show
  1. package/README.md +7 -7
  2. package/dist/components/AssetSelectorItem.js +1 -1
  3. package/dist/components/Canvas.js +1 -1
  4. package/dist/components/CopyButton.js +1 -1
  5. package/dist/components/FilePreview.js +1 -1
  6. package/dist/components/InstallPackage.js +1 -1
  7. package/dist/components/Menu/MenuSubItem.js +1 -1
  8. package/dist/components/MenuBuildIndicator.js +1 -1
  9. package/dist/components/MenuToolbar.js +1 -1
  10. package/dist/components/ModalHeader.js +1 -1
  11. package/dist/components/NewComposition/CodemodFooter.js +1 -1
  12. package/dist/components/NewComposition/ComboBox.js +1 -1
  13. package/dist/components/NewComposition/DuplicateComposition.js +15 -15
  14. package/dist/components/NewComposition/InputDragger.d.ts +1 -0
  15. package/dist/components/NewComposition/InputDragger.js +8 -2
  16. package/dist/components/NewComposition/MenuContent.js +1 -1
  17. package/dist/components/NewComposition/NewCompDuration.js +5 -5
  18. package/dist/components/NewComposition/RenameComposition.js +5 -5
  19. package/dist/components/OverrideInputProps.js +1 -1
  20. package/dist/components/PreviewToolbar.js +4 -3
  21. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +3 -3
  22. package/dist/components/RenderButton.js +1 -1
  23. package/dist/components/RenderModal/DataEditor.js +4 -4
  24. package/dist/components/RenderModal/EnforceAudioTrackSetting.js +1 -1
  25. package/dist/components/RenderModal/EnvInput.js +1 -1
  26. package/dist/components/RenderModal/MutedSetting.js +1 -1
  27. package/dist/components/RenderModal/NumberSetting.js +2 -2
  28. package/dist/components/RenderModal/OptionExplainer.js +1 -1
  29. package/dist/components/RenderModal/RenderModalAdvanced.js +2 -2
  30. package/dist/components/RenderModal/RenderModalAudio.js +3 -3
  31. package/dist/components/RenderModal/RenderModalBasic.js +3 -3
  32. package/dist/components/RenderModal/RenderModalGif.js +1 -1
  33. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +2 -2
  34. package/dist/components/RenderModal/RenderModalOutputName.js +1 -1
  35. package/dist/components/RenderModal/RenderModalPicture.js +2 -2
  36. package/dist/components/RenderModal/RenderStatusModal.js +1 -1
  37. package/dist/components/RenderModal/ResolveCompositionBeforeModal.js +1 -1
  38. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +3 -3
  39. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -1
  40. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -1
  41. package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +1 -1
  42. package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +4 -4
  43. package/dist/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +1 -1
  44. package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +1 -1
  45. package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
  46. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +1 -1
  47. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +3 -3
  48. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +1 -1
  49. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +2 -2
  50. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.d.ts +1 -1
  51. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +4 -4
  52. package/dist/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +1 -1
  53. package/dist/components/RenderModal/SchemaEditor/ZodEffectEditor.js +2 -2
  54. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -1
  55. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +2 -2
  56. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +1 -1
  57. package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.d.ts +1 -1
  58. package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +4 -4
  59. package/dist/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +1 -1
  60. package/dist/components/RenderModal/SchemaEditor/ZodNullableEditor.js +1 -1
  61. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +1 -1
  62. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +3 -66
  63. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +1 -1
  64. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +3 -3
  65. package/dist/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +1 -1
  66. package/dist/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +1 -1
  67. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +1 -1
  68. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +2 -2
  69. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +1 -1
  70. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  71. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +1 -1
  72. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +2 -2
  73. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.d.ts +1 -1
  74. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +2 -2
  75. package/dist/components/RenderModal/SchemaEditor/ZodTupleItemEditor.d.ts +1 -1
  76. package/dist/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +1 -1
  77. package/dist/components/RenderModal/SchemaEditor/ZodUnionEditor.js +1 -1
  78. package/dist/components/RenderModal/SchemaEditor/local-state.d.ts +1 -1
  79. package/dist/components/RenderModal/SchemaEditor/zod-number-constraints.d.ts +4 -0
  80. package/dist/components/RenderModal/SchemaEditor/zod-number-constraints.js +70 -0
  81. package/dist/components/RenderModal/SeparateAudioOption.js +2 -2
  82. package/dist/components/RenderModal/ServerRenderModal.js +5 -5
  83. package/dist/components/RenderModal/WebRenderModalAudio.js +3 -3
  84. package/dist/components/RenderModal/WebRenderModalLicense.js +1 -1
  85. package/dist/components/RenderQueue/index.js +2 -2
  86. package/dist/components/RendersTab.js +1 -1
  87. package/dist/components/RunningCalculateMetadata.js +1 -1
  88. package/dist/components/TimeValue.js +1 -1
  89. package/dist/components/Timeline/Timeline.js +2 -2
  90. package/dist/components/Timeline/TimelineDragHandler.js +2 -2
  91. package/dist/components/Timeline/TimelineExpandedSection.d.ts +7 -0
  92. package/dist/components/Timeline/TimelineExpandedSection.js +186 -0
  93. package/dist/components/Timeline/TimelineListItem.js +23 -14
  94. package/dist/components/Timeline/TimelineSchemaField.d.ts +14 -0
  95. package/dist/components/Timeline/TimelineSchemaField.js +106 -0
  96. package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
  97. package/dist/components/Timeline/TimelineSlider.js +2 -2
  98. package/dist/components/Timeline/TimelineStack/index.d.ts +2 -0
  99. package/dist/components/Timeline/TimelineStack/index.js +2 -17
  100. package/dist/components/Timeline/TimelineTimeIndicators.js +1 -1
  101. package/dist/components/Timeline/TimelineTracks.js +9 -6
  102. package/dist/components/Timeline/TimelineVideoInfo.js +49 -34
  103. package/dist/components/Timeline/timeline-scroll-logic.js +1 -1
  104. package/dist/components/UpdateModal/UpdateModal.js +1 -1
  105. package/dist/components/VisualControls/VisualControlHandle.js +5 -5
  106. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +1 -1
  107. package/dist/error-overlay/remotion-overlay/CompositionIdsDropdown.js +1 -1
  108. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
  109. package/dist/error-overlay/remotion-overlay/StackFrame.js +1 -1
  110. package/dist/esm/{chunk-btxgxqx6.js → chunk-59m8tgkh.js} +3700 -3330
  111. package/dist/esm/chunk-m17t3vjq.js +9 -0
  112. package/dist/esm/index.mjs +0 -16
  113. package/dist/esm/internals.mjs +3696 -3341
  114. package/dist/esm/previewEntry.mjs +32590 -32228
  115. package/dist/esm/renderEntry.mjs +3 -5
  116. package/dist/helpers/calculate-timeline.js +1 -0
  117. package/dist/helpers/extract-frames.js +23 -7
  118. package/dist/helpers/get-timeline-sequence-layout.js +4 -18
  119. package/dist/helpers/timeline-layout.d.ts +14 -0
  120. package/dist/helpers/timeline-layout.js +33 -1
  121. package/dist/helpers/use-menu-structure.js +1 -1
  122. package/dist/previewEntry.js +1 -2
  123. package/dist/renderEntry.js +0 -1
  124. package/package.json +12 -11
  125. package/dist/esm/chunk-6jf1natv.js +0 -25
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZodTextareaEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const RemTextarea_1 = require("../../NewComposition/RemTextarea");
7
6
  const get_zod_if_possible_1 = require("../../get-zod-if-possible");
7
+ const RemTextarea_1 = require("../../NewComposition/RemTextarea");
8
8
  const Fieldset_1 = require("./Fieldset");
9
+ const local_state_1 = require("./local-state");
9
10
  const SchemaLabel_1 = require("./SchemaLabel");
10
11
  const ZodFieldValidation_1 = require("./ZodFieldValidation");
11
- const local_state_1 = require("./local-state");
12
12
  const fullWidth = {
13
13
  width: '100%',
14
14
  };
@@ -1,6 +1,6 @@
1
- import type { UpdaterFunction } from './ZodSwitch';
2
1
  import type { AnyZodSchema } from './zod-schema-type';
3
2
  import type { JSONPath } from './zod-types';
3
+ import type { UpdaterFunction } from './ZodSwitch';
4
4
  export declare const ZodTupleItemEditor: React.FC<{
5
5
  jsonPath: JSONPath;
6
6
  onChange: UpdaterFunction<unknown[]>;
@@ -1,6 +1,6 @@
1
- import type { UpdaterFunction } from './ZodSwitch';
2
1
  import type { AnyZodSchema } from './zod-schema-type';
3
2
  import type { JSONPath } from './zod-types';
3
+ import type { UpdaterFunction } from './ZodSwitch';
4
4
  export declare const ZodUnionEditor: React.FC<{
5
5
  showSaveButton: boolean;
6
6
  jsonPath: JSONPath;
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZodUnionEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const zod_schema_type_1 = require("./zod-schema-type");
5
6
  const ZodNonEditableValue_1 = require("./ZodNonEditableValue");
6
7
  const ZodOrNullishEditor_1 = require("./ZodOrNullishEditor");
7
- const zod_schema_type_1 = require("./zod-schema-type");
8
8
  const findNull = (value) => {
9
9
  const nullIndex = value.findIndex((v) => {
10
10
  const type = (0, zod_schema_type_1.getZodSchemaType)(v);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import type { UpdaterFunction } from './ZodSwitch';
3
2
  import type { AnyZodSchema, ZodSafeParseResult } from './zod-schema-type';
3
+ import type { UpdaterFunction } from './ZodSwitch';
4
4
  export type LocalState<T> = {
5
5
  value: T;
6
6
  zodValidation: ZodSafeParseResult;
@@ -0,0 +1,4 @@
1
+ import type { AnyZodSchema } from './zod-schema-type';
2
+ export declare const getZodNumberMinimum: (schema: AnyZodSchema) => number;
3
+ export declare const getZodNumberMaximum: (schema: AnyZodSchema) => number;
4
+ export declare const getZodNumberStep: (schema: AnyZodSchema) => number | undefined;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getZodNumberStep = exports.getZodNumberMaximum = exports.getZodNumberMinimum = void 0;
4
+ const zod_schema_type_1 = require("./zod-schema-type");
5
+ const getZodNumberMinimum = (schema) => {
6
+ var _a;
7
+ const { checks } = (0, zod_schema_type_1.getZodDef)(schema);
8
+ if (!checks)
9
+ return -Infinity;
10
+ if ((0, zod_schema_type_1.isZodV3Schema)(schema)) {
11
+ // v3: {kind: "min", value: 0, inclusive: true}
12
+ const minCheck = checks.find((c) => c.kind === 'min');
13
+ if (!minCheck || !minCheck.inclusive)
14
+ return -Infinity;
15
+ return minCheck.value;
16
+ }
17
+ // v4: check objects with _zod.def = {check: "greater_than", value: 0, inclusive: true}
18
+ for (const c of checks) {
19
+ const def = (_a = c._zod) === null || _a === void 0 ? void 0 : _a.def;
20
+ if ((def === null || def === void 0 ? void 0 : def.check) === 'greater_than' && def.inclusive) {
21
+ return def.value;
22
+ }
23
+ }
24
+ return -Infinity;
25
+ };
26
+ exports.getZodNumberMinimum = getZodNumberMinimum;
27
+ const getZodNumberMaximum = (schema) => {
28
+ var _a;
29
+ const { checks } = (0, zod_schema_type_1.getZodDef)(schema);
30
+ if (!checks)
31
+ return Infinity;
32
+ if ((0, zod_schema_type_1.isZodV3Schema)(schema)) {
33
+ // v3: {kind: "max", value: 100, inclusive: true}
34
+ const maxCheck = checks.find((c) => c.kind === 'max');
35
+ if (!maxCheck || !maxCheck.inclusive)
36
+ return Infinity;
37
+ return maxCheck.value;
38
+ }
39
+ // v4: check objects with _zod.def = {check: "less_than", value: 100, inclusive: true}
40
+ for (const c of checks) {
41
+ const def = (_a = c._zod) === null || _a === void 0 ? void 0 : _a.def;
42
+ if ((def === null || def === void 0 ? void 0 : def.check) === 'less_than' && def.inclusive) {
43
+ return def.value;
44
+ }
45
+ }
46
+ return Infinity;
47
+ };
48
+ exports.getZodNumberMaximum = getZodNumberMaximum;
49
+ const getZodNumberStep = (schema) => {
50
+ var _a;
51
+ const { checks } = (0, zod_schema_type_1.getZodDef)(schema);
52
+ if (!checks)
53
+ return undefined;
54
+ if ((0, zod_schema_type_1.isZodV3Schema)(schema)) {
55
+ // v3: {kind: "multipleOf", value: 5}
56
+ const multipleStep = checks.find((c) => c.kind === 'multipleOf');
57
+ if (!multipleStep)
58
+ return undefined;
59
+ return multipleStep.value;
60
+ }
61
+ // v4: check objects with _zod.def = {check: "multiple_of", value: 5}
62
+ for (const c of checks) {
63
+ const def = (_a = c._zod) === null || _a === void 0 ? void 0 : _a.def;
64
+ if ((def === null || def === void 0 ? void 0 : def.check) === 'multiple_of') {
65
+ return def.value;
66
+ }
67
+ }
68
+ return undefined;
69
+ };
70
+ exports.getZodNumberStep = getZodNumberStep;
@@ -7,10 +7,10 @@ const react_1 = require("react");
7
7
  const use_file_existence_1 = require("../../helpers/use-file-existence");
8
8
  const Checkbox_1 = require("../Checkbox");
9
9
  const layout_1 = require("../layout");
10
- const OptionExplainerBubble_1 = require("./OptionExplainerBubble");
11
- const RenderModalOutputName_1 = require("./RenderModalOutputName");
12
10
  const get_string_before_suffix_1 = require("./get-string-before-suffix");
13
11
  const layout_2 = require("./layout");
12
+ const OptionExplainerBubble_1 = require("./OptionExplainerBubble");
13
+ const RenderModalOutputName_1 = require("./RenderModalOutputName");
14
14
  const SeparateAudioOptionInput = ({ separateAudioTo, setSeparateAudioTo, audioCodec }) => {
15
15
  const existence = (0, use_file_existence_1.useFileExistence)(separateAudioTo);
16
16
  const onValueChange = (0, react_1.useCallback)((e) => {
@@ -10,8 +10,8 @@ const colors_1 = require("../../helpers/colors");
10
10
  const convert_env_variables_1 = require("../../helpers/convert-env-variables");
11
11
  const render_modal_sections_1 = require("../../helpers/render-modal-sections");
12
12
  const use_keybinding_1 = require("../../helpers/use-keybinding");
13
- const Checkmark_1 = require("../../icons/Checkmark");
14
13
  const audio_1 = require("../../icons/audio");
14
+ const Checkmark_1 = require("../../icons/Checkmark");
15
15
  const data_1 = require("../../icons/data");
16
16
  const file_1 = require("../../icons/file");
17
17
  const frame_1 = require("../../icons/frame");
@@ -29,16 +29,16 @@ const SegmentedControl_1 = require("../SegmentedControl");
29
29
  const vertical_1 = require("../Tabs/vertical");
30
30
  const CrfSetting_1 = require("./CrfSetting");
31
31
  const DataEditor_1 = require("./DataEditor");
32
+ const get_default_codecs_1 = require("./get-default-codecs");
33
+ const get_string_before_suffix_1 = require("./get-string-before-suffix");
34
+ const out_name_checker_1 = require("./out-name-checker");
35
+ const render_modals_1 = require("./render-modals");
32
36
  const RenderModalAdvanced_1 = require("./RenderModalAdvanced");
33
37
  const RenderModalAudio_1 = require("./RenderModalAudio");
34
38
  const RenderModalBasic_1 = require("./RenderModalBasic");
35
39
  const RenderModalGif_1 = require("./RenderModalGif");
36
40
  const RenderModalPicture_1 = require("./RenderModalPicture");
37
41
  const ResolveCompositionBeforeModal_1 = require("./ResolveCompositionBeforeModal");
38
- const get_default_codecs_1 = require("./get-default-codecs");
39
- const get_string_before_suffix_1 = require("./get-string-before-suffix");
40
- const out_name_checker_1 = require("./out-name-checker");
41
- const render_modals_1 = require("./render-modals");
42
42
  const initialState = { type: 'idle' };
43
43
  const reducer = (state, action) => {
44
44
  if (action.type === 'start') {
@@ -5,13 +5,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const web_renderer_1 = require("@remotion/web-renderer");
6
6
  const react_1 = require("react");
7
7
  const Checkmark_1 = require("../../icons/Checkmark");
8
+ const layout_1 = require("../layout");
8
9
  const is_menu_item_1 = require("../Menu/is-menu-item");
9
10
  const ComboBox_1 = require("../NewComposition/ComboBox");
10
- const layout_1 = require("../layout");
11
- const MutedSetting_1 = require("./MutedSetting");
12
- const RenderModalHr_1 = require("./RenderModalHr");
13
11
  const layout_2 = require("./layout");
12
+ const MutedSetting_1 = require("./MutedSetting");
14
13
  const quality_options_1 = require("./quality-options");
14
+ const RenderModalHr_1 = require("./RenderModalHr");
15
15
  const container = {
16
16
  flex: 1,
17
17
  overflowY: 'auto',
@@ -5,9 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../../helpers/colors");
7
7
  const Checkbox_1 = require("../Checkbox");
8
+ const layout_1 = require("../layout");
8
9
  const RemInput_1 = require("../NewComposition/RemInput");
9
10
  const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
10
- const layout_1 = require("../layout");
11
11
  const WebRenderModalLicenseKeyDetails_1 = require("./WebRenderModalLicenseKeyDetails");
12
12
  exports.row = {
13
13
  display: 'flex',
@@ -40,10 +40,10 @@ const remotion_1 = require("remotion");
40
40
  const client_id_1 = require("../../helpers/client-id");
41
41
  const colors_1 = require("../../helpers/colors");
42
42
  const show_browser_rendering_1 = require("../../helpers/show-browser-rendering");
43
- const is_menu_item_1 = require("../Menu/is-menu-item");
44
43
  const layout_1 = require("../layout");
45
- const RenderQueueItem_1 = require("./RenderQueueItem");
44
+ const is_menu_item_1 = require("../Menu/is-menu-item");
46
45
  const context_1 = require("./context");
46
+ const RenderQueueItem_1 = require("./RenderQueueItem");
47
47
  const separatorStyle = {
48
48
  borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
49
49
  };
@@ -5,9 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const colors_1 = require("../helpers/colors");
8
+ const layout_1 = require("./layout");
8
9
  const context_1 = require("./RenderQueue/context");
9
10
  const Tabs_1 = require("./Tabs");
10
- const layout_1 = require("./layout");
11
11
  const row = {
12
12
  display: 'flex',
13
13
  flexDirection: 'row',
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RunningCalculateMetadata = exports.loaderLabel = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const colors_1 = require("../helpers/colors");
6
+ const layout_1 = require("./layout");
6
7
  const styles_1 = require("./Menu/styles");
7
8
  const Spinner_1 = require("./Spinner");
8
- const layout_1 = require("./layout");
9
9
  exports.loaderLabel = {
10
10
  fontSize: 14,
11
11
  color: colors_1.LIGHT_TEXT,
@@ -9,8 +9,8 @@ const colors_1 = require("../helpers/colors");
9
9
  const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
10
10
  const use_keybinding_1 = require("../helpers/use-keybinding");
11
11
  const render_frame_1 = require("../state/render-frame");
12
- const InputDragger_1 = require("./NewComposition/InputDragger");
13
12
  const layout_1 = require("./layout");
13
+ const InputDragger_1 = require("./NewComposition/InputDragger");
14
14
  const text = {
15
15
  color: 'white',
16
16
  display: 'flex',
@@ -11,7 +11,9 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
11
11
  const SplitterContainer_1 = require("../Splitter/SplitterContainer");
12
12
  const SplitterElement_1 = require("../Splitter/SplitterElement");
13
13
  const SplitterHandle_1 = require("../Splitter/SplitterHandle");
14
+ const is_collapsed_1 = require("./is-collapsed");
14
15
  const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
16
+ const timeline_refs_1 = require("./timeline-refs");
15
17
  const TimelineDragHandler_1 = require("./TimelineDragHandler");
16
18
  const TimelineInOutPointer_1 = require("./TimelineInOutPointer");
17
19
  const TimelineList_1 = require("./TimelineList");
@@ -21,8 +23,6 @@ const TimelineSlider_1 = require("./TimelineSlider");
21
23
  const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
22
24
  const TimelineTracks_1 = require("./TimelineTracks");
23
25
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
24
- const is_collapsed_1 = require("./is-collapsed");
25
- const timeline_refs_1 = require("./timeline-refs");
26
26
  const container = {
27
27
  minHeight: '100%',
28
28
  flex: 1,
@@ -13,12 +13,12 @@ const z_index_1 = require("../../state/z-index");
13
13
  const ContextMenu_1 = require("../ContextMenu");
14
14
  const is_menu_item_1 = require("../Menu/is-menu-item");
15
15
  const TimelineInOutToggle_1 = require("../TimelineInOutToggle");
16
+ const timeline_refs_1 = require("./timeline-refs");
17
+ const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
16
18
  const TimelineInOutPointer_1 = require("./TimelineInOutPointer");
17
19
  const TimelineInOutPointerHandle_1 = require("./TimelineInOutPointerHandle");
18
20
  const TimelineSlider_1 = require("./TimelineSlider");
19
21
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
20
- const timeline_refs_1 = require("./timeline-refs");
21
- const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
22
22
  const inner = {
23
23
  overflowY: 'auto',
24
24
  overflowX: 'hidden',
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { TSequence } from 'remotion';
3
+ import type { OriginalPosition } from '../../error-overlay/react-overlay/utils/get-source-map';
4
+ export declare const TimelineExpandedSection: React.FC<{
5
+ readonly sequence: TSequence;
6
+ readonly originalLocation: OriginalPosition | null;
7
+ }>;
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimelineExpandedSection = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const client_id_1 = require("../../helpers/client-id");
8
+ const colors_1 = require("../../helpers/colors");
9
+ const timeline_layout_1 = require("../../helpers/timeline-layout");
10
+ const call_api_1 = require("../call-api");
11
+ const TimelineSchemaField_1 = require("./TimelineSchemaField");
12
+ const expandedSectionBase = {
13
+ color: 'white',
14
+ fontFamily: 'Arial, Helvetica, sans-serif',
15
+ fontSize: 12,
16
+ display: 'flex',
17
+ flexDirection: 'column',
18
+ paddingLeft: 28,
19
+ paddingRight: 10,
20
+ borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
21
+ };
22
+ const fieldRow = {
23
+ display: 'flex',
24
+ alignItems: 'center',
25
+ gap: 8,
26
+ };
27
+ const fieldName = {
28
+ fontSize: 12,
29
+ };
30
+ const fieldLabelRow = {
31
+ flex: 1,
32
+ display: 'flex',
33
+ flexDirection: 'row',
34
+ alignItems: 'center',
35
+ gap: 6,
36
+ };
37
+ const TimelineFieldRow = ({ field, onSave, onDragValueChange, onDragEnd, propStatus }) => {
38
+ var _a, _b;
39
+ return (jsx_runtime_1.jsxs("div", { style: { ...fieldRow, height: field.rowHeight }, children: [
40
+ jsx_runtime_1.jsx("div", { style: fieldLabelRow, children: jsx_runtime_1.jsx("span", { style: fieldName, children: (_a = field.description) !== null && _a !== void 0 ? _a : field.key }) }), jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, canUpdate: (_b = propStatus === null || propStatus === void 0 ? void 0 : propStatus.canUpdate) !== null && _b !== void 0 ? _b : false })
41
+ ] }));
42
+ };
43
+ const TimelineExpandedSection = ({ sequence, originalLocation }) => {
44
+ var _a;
45
+ var _b, _c, _d, _e;
46
+ const [propStatuses, setPropStatuses] = (0, react_1.useState)(null);
47
+ const { previewServerState: state, subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
48
+ const clientId = state.type === 'connected' ? state.clientId : undefined;
49
+ const schemaFields = (0, react_1.useMemo)(() => (0, timeline_layout_1.getSchemaFields)(sequence.controls), [sequence.controls]);
50
+ const validatedLocation = (0, react_1.useMemo)(() => {
51
+ var _a;
52
+ if (!originalLocation ||
53
+ !originalLocation.source ||
54
+ !originalLocation.line) {
55
+ return null;
56
+ }
57
+ return {
58
+ source: originalLocation.source,
59
+ line: originalLocation.line,
60
+ column: (_a = originalLocation.column) !== null && _a !== void 0 ? _a : 0,
61
+ };
62
+ }, [originalLocation]);
63
+ const locationSource = (_b = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) !== null && _b !== void 0 ? _b : null;
64
+ const locationLine = (_c = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.line) !== null && _c !== void 0 ? _c : null;
65
+ const locationColumn = (_d = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.column) !== null && _d !== void 0 ? _d : null;
66
+ const schemaKeysString = (0, react_1.useMemo)(() => (schemaFields ? schemaFields.map((f) => f.key).join(',') : null), [schemaFields]);
67
+ const currentLocationSource = (0, react_1.useRef)(locationSource);
68
+ currentLocationSource.current = locationSource;
69
+ const currentLocationLine = (0, react_1.useRef)(locationLine);
70
+ currentLocationLine.current = locationLine;
71
+ const currentLocationColumn = (0, react_1.useRef)(locationColumn);
72
+ currentLocationColumn.current = locationColumn;
73
+ (0, react_1.useEffect)(() => {
74
+ if (!clientId ||
75
+ !locationSource ||
76
+ !locationLine ||
77
+ locationColumn === null ||
78
+ !schemaKeysString) {
79
+ setPropStatuses(null);
80
+ return;
81
+ }
82
+ const keys = schemaKeysString.split(',');
83
+ (0, call_api_1.callApi)('/api/subscribe-to-sequence-props', {
84
+ fileName: locationSource,
85
+ line: locationLine,
86
+ column: locationColumn,
87
+ keys,
88
+ clientId,
89
+ })
90
+ .then((result) => {
91
+ if (currentLocationSource.current !== locationSource ||
92
+ currentLocationLine.current !== locationLine ||
93
+ currentLocationColumn.current !== locationColumn) {
94
+ return;
95
+ }
96
+ if (result.canUpdate) {
97
+ setPropStatuses(result.props);
98
+ }
99
+ else {
100
+ setPropStatuses(null);
101
+ }
102
+ })
103
+ .catch(() => {
104
+ setPropStatuses(null);
105
+ });
106
+ return () => {
107
+ (0, call_api_1.callApi)('/api/unsubscribe-from-sequence-props', {
108
+ fileName: locationSource,
109
+ line: locationLine,
110
+ column: locationColumn,
111
+ clientId,
112
+ }).catch(() => {
113
+ // Ignore unsubscribe errors
114
+ });
115
+ };
116
+ }, [
117
+ clientId,
118
+ locationSource,
119
+ locationLine,
120
+ locationColumn,
121
+ schemaKeysString,
122
+ ]);
123
+ (0, react_1.useEffect)(() => {
124
+ if (!locationSource || !locationLine || locationColumn === null) {
125
+ return;
126
+ }
127
+ const listener = (event) => {
128
+ if (event.type !== 'sequence-props-updated') {
129
+ return;
130
+ }
131
+ if (event.fileName !== currentLocationSource.current ||
132
+ event.line !== currentLocationLine.current ||
133
+ event.column !== currentLocationColumn.current) {
134
+ return;
135
+ }
136
+ if (event.result.canUpdate) {
137
+ setPropStatuses(event.result.props);
138
+ }
139
+ else {
140
+ setPropStatuses(null);
141
+ }
142
+ };
143
+ const unsub = subscribeToEvent('sequence-props-updated', listener);
144
+ return () => {
145
+ unsub();
146
+ };
147
+ }, [locationSource, locationLine, locationColumn, subscribeToEvent]);
148
+ const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)(sequence.controls), [sequence.controls]);
149
+ const { setOverride, clearOverrides } = (0, react_1.useContext)(remotion_1.Internals.SequenceControlOverrideContext);
150
+ const onSave = (0, react_1.useCallback)((key, value) => {
151
+ if (!propStatuses || !validatedLocation) {
152
+ return Promise.reject(new Error('Cannot save'));
153
+ }
154
+ const status = propStatuses[key];
155
+ if (!status || !status.canUpdate) {
156
+ return Promise.reject(new Error('Cannot save'));
157
+ }
158
+ const field = schemaFields === null || schemaFields === void 0 ? void 0 : schemaFields.find((f) => f.key === key);
159
+ const defaultValue = field && field.fieldSchema.default !== undefined
160
+ ? JSON.stringify(field.fieldSchema.default)
161
+ : null;
162
+ return (0, call_api_1.callApi)('/api/save-sequence-props', {
163
+ fileName: validatedLocation.source,
164
+ line: validatedLocation.line,
165
+ column: validatedLocation.column,
166
+ key,
167
+ value: JSON.stringify(value),
168
+ enumPaths: [],
169
+ defaultValue,
170
+ }).then(() => undefined);
171
+ }, [propStatuses, validatedLocation, schemaFields]);
172
+ const overrideId = (_e = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.overrideId) !== null && _e !== void 0 ? _e : sequence.id;
173
+ const onDragValueChange = (0, react_1.useCallback)((key, value) => {
174
+ setOverride(overrideId, key, value);
175
+ }, [setOverride, overrideId]);
176
+ const onDragEnd = (0, react_1.useCallback)(() => {
177
+ clearOverrides(overrideId);
178
+ }, [clearOverrides, overrideId]);
179
+ return (jsx_runtime_1.jsx("div", { style: { ...expandedSectionBase, height: expandedHeight }, children: schemaFields
180
+ ? schemaFields.map((field) => {
181
+ var _a;
182
+ return (jsx_runtime_1.jsx(TimelineFieldRow, { field: field, propStatus: (_a = propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses[field.key]) !== null && _a !== void 0 ? _a : null, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd }, field.key));
183
+ })
184
+ : 'No schema' }));
185
+ };
186
+ exports.TimelineExpandedSection = TimelineExpandedSection;
@@ -4,11 +4,14 @@ exports.TimelineListItem = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
+ const client_id_1 = require("../../helpers/client-id");
7
8
  const colors_1 = require("../../helpers/colors");
8
9
  const timeline_layout_1 = require("../../helpers/timeline-layout");
9
10
  const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
11
+ const TimelineExpandedSection_1 = require("./TimelineExpandedSection");
10
12
  const TimelineLayerEye_1 = require("./TimelineLayerEye");
11
13
  const TimelineStack_1 = require("./TimelineStack");
14
+ const get_stack_1 = require("./TimelineStack/get-stack");
12
15
  const SPACING = 5;
13
16
  const space = {
14
17
  width: SPACING,
@@ -32,22 +35,28 @@ const arrowButton = {
32
35
  outline: 'none',
33
36
  lineHeight: 1,
34
37
  };
35
- const expandedSection = {
36
- height: timeline_layout_1.TIMELINE_TRACK_EXPANDED_HEIGHT,
37
- color: 'white',
38
- fontFamily: 'Arial, Helvetica, sans-serif',
39
- fontSize: 12,
40
- display: 'flex',
41
- alignItems: 'center',
42
- paddingLeft: 28,
43
- borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
44
- };
45
38
  const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
46
39
  var _a;
47
- const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED);
40
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
41
+ const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) &&
42
+ previewServerState.type === 'connected';
48
43
  const { hidden, setHidden } = (0, react_1.useContext)(remotion_1.Internals.SequenceVisibilityToggleContext);
49
44
  const { expandedTracks, toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksContext);
50
- const isExpanded = (_a = expandedTracks[sequence.id]) !== null && _a !== void 0 ? _a : false;
45
+ const [originalLocation, setOriginalLocation] = (0, react_1.useState)(null);
46
+ (0, react_1.useEffect)(() => {
47
+ if (!sequence.stack) {
48
+ return;
49
+ }
50
+ (0, get_stack_1.getOriginalLocationFromStack)(sequence.stack, 'sequence')
51
+ .then((frame) => {
52
+ setOriginalLocation(frame);
53
+ })
54
+ .catch((err) => {
55
+ // eslint-disable-next-line no-console
56
+ console.error('Could not get original location of Sequence', err);
57
+ });
58
+ }, [sequence.stack]);
59
+ const isExpanded = visualModeEnabled && ((_a = expandedTracks[sequence.id]) !== null && _a !== void 0 ? _a : false);
51
60
  const onToggleExpand = (0, react_1.useCallback)(() => {
52
61
  toggleTrack(sequence.id);
53
62
  }, [sequence.id, toggleTrack]);
@@ -92,7 +101,7 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
92
101
  }, [isExpanded]);
93
102
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
94
103
  jsx_runtime_1.jsxs("div", { style: outer, children: [
95
- jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility }), jsx_runtime_1.jsx("div", { style: padder }), sequence.parent && nestedDepth > 0 ? jsx_runtime_1.jsx("div", { style: space }) : null, visualModeEnabled ? (jsx_runtime_1.jsx("button", { type: "button", style: arrowStyle, onClick: onToggleExpand, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} track`, children: jsx_runtime_1.jsx("svg", { width: "12", height: "12", viewBox: "0 0 8 8", style: { display: 'block' }, children: jsx_runtime_1.jsx("path", { d: "M2 1L6 4L2 7Z", fill: "white" }) }) })) : null, jsx_runtime_1.jsx(TimelineStack_1.TimelineStack, { sequence: sequence, isCompact: isCompact })
96
- ] }), visualModeEnabled && isExpanded ? (jsx_runtime_1.jsx("div", { style: expandedSection, children: "Expanded track details" })) : null] }));
104
+ jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility }), jsx_runtime_1.jsx("div", { style: padder }), sequence.parent && nestedDepth > 0 ? jsx_runtime_1.jsx("div", { style: space }) : null, visualModeEnabled ? (sequence.controls ? (jsx_runtime_1.jsx("button", { type: "button", style: arrowStyle, onClick: onToggleExpand, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} track`, children: jsx_runtime_1.jsx("svg", { width: "12", height: "12", viewBox: "0 0 8 8", style: { display: 'block' }, children: jsx_runtime_1.jsx("path", { d: "M2 1L6 4L2 7Z", fill: "white" }) }) })) : (jsx_runtime_1.jsx("div", { style: arrowButton }))) : null, jsx_runtime_1.jsx(TimelineStack_1.TimelineStack, { sequence: sequence, isCompact: isCompact, originalLocation: originalLocation })
105
+ ] }), visualModeEnabled && isExpanded && sequence.controls ? (jsx_runtime_1.jsx(TimelineExpandedSection_1.TimelineExpandedSection, { sequence: sequence, originalLocation: originalLocation })) : null] }));
97
106
  };
98
107
  exports.TimelineListItem = TimelineListItem;
@@ -0,0 +1,14 @@
1
+ import type { CanUpdateSequencePropStatus } from '@remotion/studio-shared';
2
+ import React from 'react';
3
+ import type { SchemaFieldInfo } from '../../helpers/timeline-layout';
4
+ export declare const TimelineFieldValue: React.FC<{
5
+ readonly field: SchemaFieldInfo;
6
+ readonly onSave: (key: string, value: unknown) => Promise<void>;
7
+ readonly onDragValueChange: (key: string, value: unknown) => void;
8
+ readonly onDragEnd: () => void;
9
+ readonly canUpdate: boolean;
10
+ readonly propStatus: CanUpdateSequencePropStatus | null;
11
+ }>;
12
+ export declare const TimelineFieldSavingSpinner: React.FC<{
13
+ readonly saving: boolean;
14
+ }>;