@remotion/studio 4.0.462 → 4.0.464

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 (83) hide show
  1. package/dist/components/AssetSelector.js +2 -6
  2. package/dist/components/CanvasOrLoading.js +1 -1
  3. package/dist/components/ColorPicker/AlphaSlider.d.ts +9 -0
  4. package/dist/components/ColorPicker/AlphaSlider.js +88 -0
  5. package/dist/components/ColorPicker/ColorPicker.d.ts +18 -0
  6. package/dist/components/ColorPicker/ColorPicker.js +176 -0
  7. package/dist/components/ColorPicker/ColorPickerPopup.d.ts +8 -0
  8. package/dist/components/ColorPicker/ColorPickerPopup.js +276 -0
  9. package/dist/components/ColorPicker/HueSlider.d.ts +6 -0
  10. package/dist/components/ColorPicker/HueSlider.js +68 -0
  11. package/dist/components/ColorPicker/SaturationValueArea.d.ts +14 -0
  12. package/dist/components/ColorPicker/SaturationValueArea.js +93 -0
  13. package/dist/components/ColorPicker/checker.d.ts +4 -0
  14. package/dist/components/ColorPicker/checker.js +9 -0
  15. package/dist/components/CompSelectorRef.js +2 -6
  16. package/dist/components/ExpandedTracksProvider.d.ts +2 -0
  17. package/dist/components/ExpandedTracksProvider.js +23 -21
  18. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +8 -47
  19. package/dist/components/Timeline/Padder.js +2 -2
  20. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +1 -1
  21. package/dist/components/Timeline/SubscribeToNodePaths.js +3 -3
  22. package/dist/components/Timeline/Timeline.js +4 -7
  23. package/dist/components/Timeline/TimelineColorField.js +18 -156
  24. package/dist/components/Timeline/TimelineEffectFieldRow.d.ts +1 -2
  25. package/dist/components/Timeline/TimelineEffectFieldRow.js +38 -57
  26. package/dist/components/Timeline/TimelineEffectGroupRow.d.ts +16 -0
  27. package/dist/components/Timeline/TimelineEffectGroupRow.js +76 -0
  28. package/dist/components/Timeline/TimelineExpandedRow.js +18 -29
  29. package/dist/components/Timeline/TimelineFieldRow.d.ts +1 -2
  30. package/dist/components/Timeline/TimelineFieldRow.js +24 -55
  31. package/dist/components/Timeline/TimelineImageInfo.js +5 -17
  32. package/dist/components/Timeline/TimelineLayerEye.d.ts +5 -3
  33. package/dist/components/Timeline/TimelineLayerEye.js +18 -1
  34. package/dist/components/Timeline/TimelineListItem.d.ts +0 -1
  35. package/dist/components/Timeline/TimelineListItem.js +64 -23
  36. package/dist/components/Timeline/TimelineRowChrome.d.ts +8 -0
  37. package/dist/components/Timeline/TimelineRowChrome.js +21 -0
  38. package/dist/components/Timeline/TimelineTracks.js +0 -4
  39. package/dist/components/Timeline/save-effect-prop.d.ts +13 -0
  40. package/dist/components/Timeline/save-effect-prop.js +31 -0
  41. package/dist/components/Timeline/save-prop-queue.d.ts +11 -0
  42. package/dist/components/Timeline/save-prop-queue.js +54 -0
  43. package/dist/components/Timeline/save-sequence-prop.d.ts +12 -0
  44. package/dist/components/Timeline/save-sequence-prop.js +29 -0
  45. package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -0
  46. package/dist/components/Timeline/should-show-track-in-timeline.js +23 -0
  47. package/dist/components/Timeline/timeline-field-row-layout.d.ts +2 -0
  48. package/dist/components/Timeline/timeline-field-row-layout.js +14 -0
  49. package/dist/components/Timeline/timeline-indent.d.ts +1 -0
  50. package/dist/components/Timeline/timeline-indent.js +4 -0
  51. package/dist/components/Timeline/timeline-row-layout.d.ts +11 -0
  52. package/dist/components/Timeline/timeline-row-layout.js +27 -0
  53. package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +2 -0
  54. package/dist/components/Timeline/use-resolved-stack-react-to-change.js +59 -0
  55. package/dist/components/Timeline/use-sequence-props-subscription.js +27 -1
  56. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +5 -3
  57. package/dist/esm/{chunk-yvg1f56k.js → chunk-mawnnpzg.js} +5147 -4012
  58. package/dist/esm/internals.mjs +5147 -4012
  59. package/dist/esm/previewEntry.mjs +5159 -4025
  60. package/dist/esm/renderEntry.mjs +1 -1
  61. package/dist/helpers/client-id.d.ts +2 -9
  62. package/dist/helpers/client-id.js +15 -40
  63. package/dist/helpers/color-conversion.d.ts +36 -0
  64. package/dist/helpers/color-conversion.js +121 -0
  65. package/dist/helpers/inject-css.js +4 -7
  66. package/dist/helpers/migrate-expanded-tracks-for-subscription-key.d.ts +3 -0
  67. package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +26 -0
  68. package/dist/helpers/persist-boolean-map.d.ts +5 -0
  69. package/dist/helpers/persist-boolean-map.js +56 -0
  70. package/dist/helpers/persist-open-folders.d.ts +4 -3
  71. package/dist/helpers/persist-open-folders.js +4 -7
  72. package/dist/helpers/preview-server-events.d.ts +15 -0
  73. package/dist/helpers/preview-server-events.js +81 -0
  74. package/dist/helpers/timeline-layout.d.ts +6 -2
  75. package/dist/helpers/timeline-layout.js +31 -25
  76. package/dist/hot-middleware-client/client.js +10 -16
  77. package/package.json +10 -10
  78. package/dist/components/NewComposition/RemInputTypeColor.d.ts +0 -8
  79. package/dist/components/NewComposition/RemInputTypeColor.js +0 -53
  80. package/dist/components/Timeline/is-collapsed.d.ts +0 -2
  81. package/dist/components/Timeline/is-collapsed.js +0 -10
  82. package/dist/helpers/color-math.d.ts +0 -1
  83. package/dist/helpers/color-math.js +0 -13
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HueSlider = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const color_conversion_1 = require("../../helpers/color-conversion");
7
+ const SLIDER_HEIGHT = 12;
8
+ const HANDLE_WIDTH = 8;
9
+ const containerStyle = {
10
+ position: 'relative',
11
+ height: SLIDER_HEIGHT,
12
+ width: '100%',
13
+ borderRadius: 3,
14
+ cursor: 'ew-resize',
15
+ background: 'linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)',
16
+ touchAction: 'none',
17
+ };
18
+ const HueSlider = ({ hue, onChange, onChangeComplete }) => {
19
+ const ref = (0, react_1.useRef)(null);
20
+ const updateFromEvent = (0, react_1.useCallback)((clientX, isFinal) => {
21
+ const { current } = ref;
22
+ if (!current) {
23
+ return;
24
+ }
25
+ const rect = current.getBoundingClientRect();
26
+ const x = (0, color_conversion_1.clamp)((clientX - rect.left) / rect.width, 0, 1);
27
+ const next = x * 360;
28
+ if (isFinal) {
29
+ onChangeComplete(next);
30
+ }
31
+ else {
32
+ onChange(next);
33
+ }
34
+ }, [onChange, onChangeComplete]);
35
+ const onPointerDown = (0, react_1.useCallback)((e) => {
36
+ if (e.button !== 0) {
37
+ return;
38
+ }
39
+ e.preventDefault();
40
+ updateFromEvent(e.clientX, false);
41
+ const onMove = (ev) => {
42
+ updateFromEvent(ev.clientX, false);
43
+ };
44
+ const onUp = (ev) => {
45
+ window.removeEventListener('pointermove', onMove);
46
+ window.removeEventListener('pointerup', onUp);
47
+ updateFromEvent(ev.clientX, true);
48
+ };
49
+ window.addEventListener('pointermove', onMove);
50
+ window.addEventListener('pointerup', onUp);
51
+ }, [updateFromEvent]);
52
+ const handleStyle = (0, react_1.useMemo)(() => {
53
+ return {
54
+ position: 'absolute',
55
+ top: -2,
56
+ left: `${(hue / 360) * 100}%`,
57
+ marginLeft: -HANDLE_WIDTH / 2,
58
+ width: HANDLE_WIDTH,
59
+ height: SLIDER_HEIGHT + 4,
60
+ borderRadius: 2,
61
+ border: '2px solid #fff',
62
+ boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.6)',
63
+ pointerEvents: 'none',
64
+ };
65
+ }, [hue]);
66
+ return (jsx_runtime_1.jsx("div", { ref: ref, style: containerStyle, onPointerDown: onPointerDown, children: jsx_runtime_1.jsx("div", { style: handleStyle }) }));
67
+ };
68
+ exports.HueSlider = HueSlider;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export declare const SaturationValueArea: React.FC<{
3
+ readonly hue: number;
4
+ readonly saturation: number;
5
+ readonly value: number;
6
+ readonly onChange: (next: {
7
+ s: number;
8
+ v: number;
9
+ }) => void;
10
+ readonly onChangeComplete: (next: {
11
+ s: number;
12
+ v: number;
13
+ }) => void;
14
+ }>;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SaturationValueArea = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const color_conversion_1 = require("../../helpers/color-conversion");
7
+ const AREA_HEIGHT = 140;
8
+ const containerStyle = {
9
+ position: 'relative',
10
+ width: '100%',
11
+ height: AREA_HEIGHT,
12
+ cursor: 'crosshair',
13
+ borderRadius: 3,
14
+ overflow: 'hidden',
15
+ touchAction: 'none',
16
+ };
17
+ const valueOverlay = {
18
+ position: 'absolute',
19
+ inset: 0,
20
+ background: 'linear-gradient(to top, #000, transparent)',
21
+ };
22
+ const saturationOverlay = {
23
+ position: 'absolute',
24
+ inset: 0,
25
+ background: 'linear-gradient(to right, #fff, transparent)',
26
+ };
27
+ const SaturationValueArea = ({ hue, saturation, value, onChange, onChangeComplete }) => {
28
+ const containerRef = (0, react_1.useRef)(null);
29
+ const baseColor = (0, react_1.useMemo)(() => {
30
+ const { r, g, b } = (0, color_conversion_1.hsvToRgb)({ h: hue, s: 1, v: 1 });
31
+ return `rgb(${r}, ${g}, ${b})`;
32
+ }, [hue]);
33
+ const updateFromEvent = (0, react_1.useCallback)((clientX, clientY, isFinal) => {
34
+ const { current } = containerRef;
35
+ if (!current) {
36
+ return;
37
+ }
38
+ const rect = current.getBoundingClientRect();
39
+ const x = (0, color_conversion_1.clamp)((clientX - rect.left) / rect.width, 0, 1);
40
+ const y = (0, color_conversion_1.clamp)((clientY - rect.top) / rect.height, 0, 1);
41
+ const next = { s: x, v: 1 - y };
42
+ if (isFinal) {
43
+ onChangeComplete(next);
44
+ }
45
+ else {
46
+ onChange(next);
47
+ }
48
+ }, [onChange, onChangeComplete]);
49
+ const onPointerDown = (0, react_1.useCallback)((e) => {
50
+ var _a, _b;
51
+ if (e.button !== 0) {
52
+ return;
53
+ }
54
+ e.preventDefault();
55
+ (_b = (_a = e.target).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, e.pointerId);
56
+ updateFromEvent(e.clientX, e.clientY, false);
57
+ const onMove = (ev) => {
58
+ updateFromEvent(ev.clientX, ev.clientY, false);
59
+ };
60
+ const onUp = (ev) => {
61
+ window.removeEventListener('pointermove', onMove);
62
+ window.removeEventListener('pointerup', onUp);
63
+ updateFromEvent(ev.clientX, ev.clientY, true);
64
+ };
65
+ window.addEventListener('pointermove', onMove);
66
+ window.addEventListener('pointerup', onUp);
67
+ }, [updateFromEvent]);
68
+ const containerWithBg = (0, react_1.useMemo)(() => {
69
+ return {
70
+ ...containerStyle,
71
+ backgroundColor: baseColor,
72
+ };
73
+ }, [baseColor]);
74
+ const handleStyle = (0, react_1.useMemo)(() => {
75
+ return {
76
+ position: 'absolute',
77
+ left: `${saturation * 100}%`,
78
+ top: `${(1 - value) * 100}%`,
79
+ width: 12,
80
+ height: 12,
81
+ marginLeft: -6,
82
+ marginTop: -6,
83
+ borderRadius: '50%',
84
+ border: '2px solid #fff',
85
+ boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.6)',
86
+ pointerEvents: 'none',
87
+ };
88
+ }, [saturation, value]);
89
+ return (jsx_runtime_1.jsxs("div", { ref: containerRef, style: containerWithBg, onPointerDown: onPointerDown, children: [
90
+ jsx_runtime_1.jsx("div", { style: saturationOverlay }), jsx_runtime_1.jsx("div", { style: valueOverlay }), jsx_runtime_1.jsx("div", { style: handleStyle })
91
+ ] }));
92
+ };
93
+ exports.SaturationValueArea = SaturationValueArea;
@@ -0,0 +1,4 @@
1
+ export declare const CHECKER_BACKGROUND_IMAGE = "linear-gradient(45deg, #888 25%, transparent 25%), linear-gradient(-45deg, #888 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #888 75%), linear-gradient(-45deg, transparent 75%, #888 75%)";
2
+ export declare const CHECKER_BACKGROUND_SIZE = "8px 8px";
3
+ export declare const CHECKER_BACKGROUND_POSITION = "0 0, 0 4px, 4px -4px, -4px 0";
4
+ export declare const CHECKER_BACKGROUND_COLOR = "#444";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHECKER_BACKGROUND_COLOR = exports.CHECKER_BACKGROUND_POSITION = exports.CHECKER_BACKGROUND_SIZE = exports.CHECKER_BACKGROUND_IMAGE = void 0;
4
+ // Checkerboard background used to indicate transparency in color swatches
5
+ // and the alpha slider. Rendered as a CSS gradient so we don't need an asset.
6
+ exports.CHECKER_BACKGROUND_IMAGE = 'linear-gradient(45deg, #888 25%, transparent 25%), linear-gradient(-45deg, #888 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #888 75%), linear-gradient(-45deg, transparent 75%, #888 75%)';
7
+ exports.CHECKER_BACKGROUND_SIZE = '8px 8px';
8
+ exports.CHECKER_BACKGROUND_POSITION = '0 0, 0 4px, 4px -4px, -4px 0';
9
+ exports.CHECKER_BACKGROUND_COLOR = '#444';
@@ -5,6 +5,7 @@ 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 create_folder_tree_1 = require("../helpers/create-folder-tree");
8
+ const persist_boolean_map_1 = require("../helpers/persist-boolean-map");
8
9
  const persist_open_folders_1 = require("../helpers/persist-open-folders");
9
10
  const folders_1 = require("../state/folders");
10
11
  const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
@@ -14,13 +15,8 @@ const CompSelectorRef = ({ children }) => {
14
15
  const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
15
16
  const toggleFolder = (0, react_1.useCallback)((folderName, parentName) => {
16
17
  setCompositionFoldersExpanded((p) => {
17
- var _a;
18
18
  const key = (0, persist_open_folders_1.openFolderKey)({ folderName, parentName });
19
- const prev = (_a = p[key]) !== null && _a !== void 0 ? _a : false;
20
- const foldersExpandedState = {
21
- ...p,
22
- [key]: !prev,
23
- };
19
+ const foldersExpandedState = (0, persist_boolean_map_1.toggleBooleanMapKey)(p, key);
24
20
  (0, persist_open_folders_1.persistExpandedFolders)('compositions', foldersExpandedState);
25
21
  return foldersExpandedState;
26
22
  });
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { SequencePropsSubscriptionKey } from 'remotion';
2
3
  import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
3
4
  export type GetIsExpanded = (nodePathInfo: SequenceNodePathInfo) => boolean;
4
5
  type ExpandedTracksGetterContextValue = {
@@ -6,6 +7,7 @@ type ExpandedTracksGetterContextValue = {
6
7
  };
7
8
  type ExpandedTracksSetterContextValue = {
8
9
  readonly toggleTrack: (nodePathInfo: SequenceNodePathInfo) => void;
10
+ readonly migrateExpandedTracksForSubscriptionKey: (oldKey: SequencePropsSubscriptionKey, newKey: SequencePropsSubscriptionKey) => void;
9
11
  };
10
12
  export declare const ExpandedTracksGetterContext: React.Context<ExpandedTracksGetterContextValue>;
11
13
  export declare const ExpandedTracksSetterContext: React.Context<ExpandedTracksSetterContextValue>;
@@ -4,30 +4,16 @@ exports.ExpandedTracksProvider = exports.ExpandedTracksSetterContext = exports.E
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const react_1 = require("react");
7
+ const migrate_expanded_tracks_for_subscription_key_1 = require("../helpers/migrate-expanded-tracks-for-subscription-key");
8
+ const persist_boolean_map_1 = require("../helpers/persist-boolean-map");
7
9
  const nodePathInfoToExpandedKey = (info) => [
8
10
  (0, studio_shared_1.stringifySequenceExpandedRowKey)(info.sequenceSubscriptionKey),
9
11
  info.auxiliaryKeys.join('.'),
10
12
  info.index,
11
13
  ].join('.');
12
- const LOCAL_STORAGE_KEY = 'remotion.editor.expandedTracks';
14
+ const SESSION_STORAGE_KEY = 'remotion.editor.expandedTracks';
13
15
  const loadExpandedTracks = () => {
14
- if (typeof window === 'undefined') {
15
- return {};
16
- }
17
- const item = window.localStorage.getItem(LOCAL_STORAGE_KEY);
18
- if (item === null) {
19
- return {};
20
- }
21
- try {
22
- const parsed = JSON.parse(item);
23
- if (parsed && typeof parsed === 'object') {
24
- return parsed;
25
- }
26
- return {};
27
- }
28
- catch (_a) {
29
- return {};
30
- }
16
+ return (0, persist_boolean_map_1.loadPersistedBooleanMap)(SESSION_STORAGE_KEY);
31
17
  };
32
18
  exports.ExpandedTracksGetterContext = (0, react_1.createContext)({
33
19
  getIsExpanded: () => {
@@ -38,14 +24,27 @@ exports.ExpandedTracksSetterContext = (0, react_1.createContext)({
38
24
  toggleTrack: () => {
39
25
  throw new Error('ExpandedTracksSetterContext not initialized');
40
26
  },
27
+ migrateExpandedTracksForSubscriptionKey: () => {
28
+ throw new Error('ExpandedTracksSetterContext not initialized');
29
+ },
41
30
  });
42
31
  const ExpandedTracksProvider = ({ children }) => {
43
32
  const [expandedTracks, setExpandedTracks] = (0, react_1.useState)(loadExpandedTracks);
44
33
  const toggleTrack = (0, react_1.useCallback)((nodePathInfo) => {
45
34
  setExpandedTracks((prev) => {
46
35
  const key = nodePathInfoToExpandedKey(nodePathInfo);
47
- const next = { ...prev, [key]: !prev[key] };
48
- window.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(next));
36
+ const next = (0, persist_boolean_map_1.toggleBooleanMapKey)(prev, key);
37
+ (0, persist_boolean_map_1.persistBooleanMap)(SESSION_STORAGE_KEY, next);
38
+ return next;
39
+ });
40
+ }, []);
41
+ const migrateExpandedTracks = (0, react_1.useCallback)((oldKey, newKey) => {
42
+ setExpandedTracks((prev) => {
43
+ const next = (0, migrate_expanded_tracks_for_subscription_key_1.migrateExpandedTracksForSubscriptionKey)(prev, oldKey, newKey);
44
+ if (!next) {
45
+ return prev;
46
+ }
47
+ (0, persist_boolean_map_1.persistBooleanMap)(SESSION_STORAGE_KEY, next);
49
48
  return next;
50
49
  });
51
50
  }, []);
@@ -55,7 +54,10 @@ const ExpandedTracksProvider = ({ children }) => {
55
54
  return (_a = expandedTracks[nodePathInfoToExpandedKey(nodePathInfo)]) !== null && _a !== void 0 ? _a : false;
56
55
  },
57
56
  }), [expandedTracks]);
58
- const setterValue = (0, react_1.useMemo)(() => ({ toggleTrack }), [toggleTrack]);
57
+ const setterValue = (0, react_1.useMemo)(() => ({
58
+ toggleTrack,
59
+ migrateExpandedTracksForSubscriptionKey: migrateExpandedTracks,
60
+ }), [toggleTrack, migrateExpandedTracks]);
59
61
  return (jsx_runtime_1.jsx(exports.ExpandedTracksSetterContext.Provider, { value: setterValue, children: jsx_runtime_1.jsx(exports.ExpandedTracksGetterContext.Provider, { value: getterValue, children: children }) }));
60
62
  };
61
63
  exports.ExpandedTracksProvider = ExpandedTracksProvider;
@@ -3,12 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZodColorEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const color_math_1 = require("../../../helpers/color-math");
7
- const get_zod_if_possible_1 = require("../../get-zod-if-possible");
6
+ const ColorPicker_1 = require("../../ColorPicker/ColorPicker");
8
7
  const layout_1 = require("../../layout");
9
- const InputDragger_1 = require("../../NewComposition/InputDragger");
10
8
  const RemInput_1 = require("../../NewComposition/RemInput");
11
- const RemInputTypeColor_1 = require("../../NewComposition/RemInputTypeColor");
12
9
  const Fieldset_1 = require("./Fieldset");
13
10
  const SchemaLabel_1 = require("./SchemaLabel");
14
11
  const zod_schema_type_1 = require("./zod-schema-type");
@@ -17,25 +14,13 @@ const fullWidth = {
17
14
  width: '100%',
18
15
  };
19
16
  const ZodColorEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad }) => {
20
- const z = (0, get_zod_if_possible_1.useZodIfPossible)();
21
- if (!z) {
22
- throw new Error('expected zod');
23
- }
24
- const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
25
- if (!zodTypes) {
26
- throw new Error('expected zod color');
27
- }
28
17
  const localValue = (0, react_1.useMemo)(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
29
- const { a, b, g, r } = localValue.success
30
- ? zodTypes.ZodZypesInternals.parseColor(value)
31
- : { a: 1, b: 0, g: 0, r: 0 };
32
- const onChange = (0, react_1.useCallback)((e) => {
33
- const newColor = (0, color_math_1.colorWithNewOpacity)(e.target.value, Math.round(a), zodTypes);
34
- setValue(() => newColor, { shouldSave: false });
35
- }, [a, setValue, zodTypes]);
36
- const onColorBlur = (0, react_1.useCallback)(() => {
37
- setValue(() => value, { shouldSave: true });
38
- }, [setValue, value]);
18
+ const onPickerChange = (0, react_1.useCallback)((next) => {
19
+ setValue(() => next, { shouldSave: false });
20
+ }, [setValue]);
21
+ const onPickerComplete = (0, react_1.useCallback)((next) => {
22
+ setValue(() => next, { shouldSave: true });
23
+ }, [setValue]);
39
24
  const onTextChange = (0, react_1.useCallback)((e) => {
40
25
  const newValue = e.target.value;
41
26
  setValue(() => newValue, { shouldSave: false });
@@ -43,35 +28,11 @@ const ZodColorEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad })
43
28
  const onTextBlur = (0, react_1.useCallback)(() => {
44
29
  setValue(() => value, { shouldSave: true });
45
30
  }, [setValue, value]);
46
- const rgb = `#${r.toString(16).padStart(2, '0')}${g
47
- .toString(16)
48
- .padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
49
31
  const status = localValue.success ? 'ok' : 'error';
50
- const colorPicker = (0, react_1.useMemo)(() => {
51
- return {
52
- height: 39,
53
- width: 45,
54
- display: 'inline-block',
55
- };
56
- }, []);
57
- const onOpacityChange = (0, react_1.useCallback)((newValue) => {
58
- const newColor = (0, color_math_1.colorWithNewOpacity)(value, Math.round((Number(newValue) / 100) * 255), zodTypes);
59
- setValue(() => newColor, { shouldSave: true });
60
- }, [setValue, value, zodTypes]);
61
- const onOpacityValueChange = (0, react_1.useCallback)((newValue) => {
62
- const newColor = (0, color_math_1.colorWithNewOpacity)(value, Math.round((Number(newValue) / 100) * 255), zodTypes);
63
- setValue(() => newColor, { shouldSave: false });
64
- }, [setValue, value, zodTypes]);
65
- const onOpacityValueChangeEnd = (0, react_1.useCallback)((newValue) => {
66
- const newColor = (0, color_math_1.colorWithNewOpacity)(value, Math.round((Number(newValue) / 100) * 255), zodTypes);
67
- setValue(() => newColor, { shouldSave: true });
68
- }, [setValue, value, zodTypes]);
69
32
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
70
33
  jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: localValue.success, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
71
34
  jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
72
- jsx_runtime_1.jsx("div", { style: colorPicker, children: jsx_runtime_1.jsx(RemInputTypeColor_1.RemInputTypeColor, { type: "color", style: {
73
- height: 39,
74
- }, value: rgb, onChange: onChange, onBlur: onColorBlur, className: "__remotion_color_picker", status: status, name: jsonPath.join('.') }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1, block: true }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: value, status: status, placeholder: jsonPath.join('.'), onChange: onTextChange, onBlur: onTextBlur, rightAlign: false }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx(InputDragger_1.InputDragger, { onTextChange: onOpacityChange, onValueChange: onOpacityValueChange, onValueChangeEnd: onOpacityValueChangeEnd, status: status, value: (a / 255) * 100, min: 0, max: 100, step: 1, formatter: (v) => `${Math.round(Number(v))}%`, rightAlign: false })
35
+ jsx_runtime_1.jsx(ColorPicker_1.ColorPicker, { value: value, status: status, onChange: onPickerChange, onChangeComplete: onPickerComplete, width: 45, height: 39, name: jsonPath.join('.') }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1, block: true }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: value, status: status, placeholder: jsonPath.join('.'), onChange: onTextChange, onBlur: onTextBlur, rightAlign: false })
75
36
  ] }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: localValue })
76
37
  ] })
77
38
  ] }));
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Padder = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const TimelineListItem_1 = require("./TimelineListItem");
6
+ const timeline_indent_1 = require("./timeline-indent");
7
7
  const Padder = ({ depth }) => {
8
8
  const style = (0, react_1.useMemo)(() => ({
9
- width: TimelineListItem_1.INDENT * depth,
9
+ width: timeline_indent_1.TIMELINE_INDENT * depth,
10
10
  flexShrink: 0,
11
11
  }), [depth]);
12
12
  return jsx_runtime_1.jsx("div", { style: style });
@@ -3,6 +3,6 @@ import type { EffectDefinition, SequenceSchema } from 'remotion';
3
3
  export declare const SubscribeToNodePaths: FC<{
4
4
  readonly overrideId: string;
5
5
  readonly schema: SequenceSchema;
6
- readonly stack: string;
6
+ readonly getStack: () => string | null;
7
7
  readonly effects: readonly EffectDefinition<unknown>[];
8
8
  }>;
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SubscribeToNodePaths = void 0;
4
4
  const react_1 = require("react");
5
5
  const no_react_1 = require("remotion/no-react");
6
- const use_resolved_stack_1 = require("./use-resolved-stack");
6
+ const use_resolved_stack_react_to_change_1 = require("./use-resolved-stack-react-to-change");
7
7
  const use_sequence_props_subscription_1 = require("./use-sequence-props-subscription");
8
- const SubscribeToNodePaths = ({ overrideId, schema, stack, effects }) => {
9
- const originalLocation = (0, use_resolved_stack_1.useResolvedStack)(stack);
8
+ const SubscribeToNodePaths = ({ overrideId, schema, getStack, effects }) => {
9
+ const originalLocation = (0, use_resolved_stack_react_to_change_1.useResolveStackAndReactToChange)(getStack);
10
10
  const effectSubscriptions = (0, react_1.useMemo)(() => {
11
11
  return effects
12
12
  .map((effect) => {
@@ -44,9 +44,9 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
44
44
  const SplitterContainer_1 = require("../Splitter/SplitterContainer");
45
45
  const SplitterElement_1 = require("../Splitter/SplitterElement");
46
46
  const SplitterHandle_1 = require("../Splitter/SplitterHandle");
47
- const is_collapsed_1 = require("./is-collapsed");
48
47
  const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
49
48
  const SequencePropsObserver_1 = require("./SequencePropsObserver");
49
+ const should_show_track_in_timeline_1 = require("./should-show-track-in-timeline");
50
50
  const SubscribeToNodePaths_1 = require("./SubscribeToNodePaths");
51
51
  const timeline_refs_1 = require("./timeline-refs");
52
52
  const TimelineDragHandler_1 = require("./TimelineDragHandler");
@@ -88,10 +88,7 @@ const TimelineInner = () => {
88
88
  }, [sequences, videoConfigIsNull, overrideIdToNodePathMappings]);
89
89
  const durationInFrames = (_a = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _a !== void 0 ? _a : 0;
90
90
  const filtered = (0, react_1.useMemo)(() => {
91
- return timeline.filter((t) => !(0, is_collapsed_1.isTrackHidden)(t) &&
92
- t.sequence.from <= durationInFrames &&
93
- t.sequence.duration > 0 &&
94
- t.sequence.showInTimeline);
91
+ return timeline.filter((t) => (0, should_show_track_in_timeline_1.shouldShowTrackInTimeline)(t, durationInFrames));
95
92
  }, [durationInFrames, timeline]);
96
93
  const shown = (0, react_1.useMemo)(() => {
97
94
  return filtered.length > MaxTimelineTracks_1.MAX_TIMELINE_TRACKS
@@ -100,10 +97,10 @@ const TimelineInner = () => {
100
97
  }, [filtered]);
101
98
  const hasBeenCut = filtered.length > shown.length;
102
99
  return (jsx_runtime_1.jsxs("div", { ref: timeline_refs_1.timelineVerticalScroll, style: container, className: 'css-reset ' + is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [sequences.map((sequence) => {
103
- if (!sequence.controls || !previewConnected || !sequence.stack) {
100
+ if (!sequence.controls || !previewConnected || !sequence.getStack()) {
104
101
  return null;
105
102
  }
106
- return (jsx_runtime_1.jsx(SubscribeToNodePaths_1.SubscribeToNodePaths, { overrideId: sequence.controls.overrideId, schema: sequence.controls.schema, stack: sequence.stack, effects: sequence.effects }, sequence.id));
103
+ return (jsx_runtime_1.jsx(SubscribeToNodePaths_1.SubscribeToNodePaths, { overrideId: sequence.controls.overrideId, schema: sequence.controls.schema, getStack: sequence.getStack, effects: sequence.effects }, sequence.id));
107
104
  }), jsx_runtime_1.jsx(SequencePropsObserver_1.SequencePropsObserver, {}), jsx_runtime_1.jsxs(TimelineWidthProvider_1.TimelineWidthProvider, { children: [
108
105
  jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsx(TimelineHeightContainer_1.TimelineHeightContainer, { shown: shown, hasBeenCut: hasBeenCut, children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, children: [
109
106
  jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "flexer", sticky: jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimePlaceholders, {}), children: jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown }) }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: "none" }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "anti-flexer", sticky: null, children: jsx_runtime_1.jsxs(TimelineScrollable_1.TimelineScrollable, { children: [