@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.
- package/dist/components/AssetSelector.js +2 -6
- package/dist/components/CanvasOrLoading.js +1 -1
- package/dist/components/ColorPicker/AlphaSlider.d.ts +9 -0
- package/dist/components/ColorPicker/AlphaSlider.js +88 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +18 -0
- package/dist/components/ColorPicker/ColorPicker.js +176 -0
- package/dist/components/ColorPicker/ColorPickerPopup.d.ts +8 -0
- package/dist/components/ColorPicker/ColorPickerPopup.js +276 -0
- package/dist/components/ColorPicker/HueSlider.d.ts +6 -0
- package/dist/components/ColorPicker/HueSlider.js +68 -0
- package/dist/components/ColorPicker/SaturationValueArea.d.ts +14 -0
- package/dist/components/ColorPicker/SaturationValueArea.js +93 -0
- package/dist/components/ColorPicker/checker.d.ts +4 -0
- package/dist/components/ColorPicker/checker.js +9 -0
- package/dist/components/CompSelectorRef.js +2 -6
- package/dist/components/ExpandedTracksProvider.d.ts +2 -0
- package/dist/components/ExpandedTracksProvider.js +23 -21
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +8 -47
- package/dist/components/Timeline/Padder.js +2 -2
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +1 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +3 -3
- package/dist/components/Timeline/Timeline.js +4 -7
- package/dist/components/Timeline/TimelineColorField.js +18 -156
- package/dist/components/Timeline/TimelineEffectFieldRow.d.ts +1 -2
- package/dist/components/Timeline/TimelineEffectFieldRow.js +38 -57
- package/dist/components/Timeline/TimelineEffectGroupRow.d.ts +16 -0
- package/dist/components/Timeline/TimelineEffectGroupRow.js +76 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +18 -29
- package/dist/components/Timeline/TimelineFieldRow.d.ts +1 -2
- package/dist/components/Timeline/TimelineFieldRow.js +24 -55
- package/dist/components/Timeline/TimelineImageInfo.js +5 -17
- package/dist/components/Timeline/TimelineLayerEye.d.ts +5 -3
- package/dist/components/Timeline/TimelineLayerEye.js +18 -1
- package/dist/components/Timeline/TimelineListItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineListItem.js +64 -23
- package/dist/components/Timeline/TimelineRowChrome.d.ts +8 -0
- package/dist/components/Timeline/TimelineRowChrome.js +21 -0
- package/dist/components/Timeline/TimelineTracks.js +0 -4
- package/dist/components/Timeline/save-effect-prop.d.ts +13 -0
- package/dist/components/Timeline/save-effect-prop.js +31 -0
- package/dist/components/Timeline/save-prop-queue.d.ts +11 -0
- package/dist/components/Timeline/save-prop-queue.js +54 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +12 -0
- package/dist/components/Timeline/save-sequence-prop.js +29 -0
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -0
- package/dist/components/Timeline/should-show-track-in-timeline.js +23 -0
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +2 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +14 -0
- package/dist/components/Timeline/timeline-indent.d.ts +1 -0
- package/dist/components/Timeline/timeline-indent.js +4 -0
- package/dist/components/Timeline/timeline-row-layout.d.ts +11 -0
- package/dist/components/Timeline/timeline-row-layout.js +27 -0
- package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +2 -0
- package/dist/components/Timeline/use-resolved-stack-react-to-change.js +59 -0
- package/dist/components/Timeline/use-sequence-props-subscription.js +27 -1
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +5 -3
- package/dist/esm/{chunk-yvg1f56k.js → chunk-mawnnpzg.js} +5147 -4012
- package/dist/esm/internals.mjs +5147 -4012
- package/dist/esm/previewEntry.mjs +5159 -4025
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/client-id.d.ts +2 -9
- package/dist/helpers/client-id.js +15 -40
- package/dist/helpers/color-conversion.d.ts +36 -0
- package/dist/helpers/color-conversion.js +121 -0
- package/dist/helpers/inject-css.js +4 -7
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.d.ts +3 -0
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +26 -0
- package/dist/helpers/persist-boolean-map.d.ts +5 -0
- package/dist/helpers/persist-boolean-map.js +56 -0
- package/dist/helpers/persist-open-folders.d.ts +4 -3
- package/dist/helpers/persist-open-folders.js +4 -7
- package/dist/helpers/preview-server-events.d.ts +15 -0
- package/dist/helpers/preview-server-events.js +81 -0
- package/dist/helpers/timeline-layout.d.ts +6 -2
- package/dist/helpers/timeline-layout.js +31 -25
- package/dist/hot-middleware-client/client.js +10 -16
- package/package.json +10 -10
- package/dist/components/NewComposition/RemInputTypeColor.d.ts +0 -8
- package/dist/components/NewComposition/RemInputTypeColor.js +0 -53
- package/dist/components/Timeline/is-collapsed.d.ts +0 -2
- package/dist/components/Timeline/is-collapsed.js +0 -10
- package/dist/helpers/color-math.d.ts +0 -1
- package/dist/helpers/color-math.js +0 -13
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const TIMELINE_ROW_BASE_PADDING = 5;
|
|
2
|
+
export declare const TIMELINE_EYE_COLUMN_WIDTH = 22;
|
|
3
|
+
export declare const TIMELINE_ARROW_COLUMN_WIDTH = 16;
|
|
4
|
+
export declare const TIMELINE_FIELD_LABEL_EXTRA_WIDTH = 15;
|
|
5
|
+
export declare const getTimelineRowIndentWidth: (depth: number) => number;
|
|
6
|
+
export declare const getTimelineRowLeftChromeWidth: (depth: number) => number;
|
|
7
|
+
export declare const getTimelineFieldLabelFlexBasis: (depth: number) => string;
|
|
8
|
+
export declare const getExpandedRowDepth: ({ nestedDepth, treeDepth, }: {
|
|
9
|
+
nestedDepth: number;
|
|
10
|
+
treeDepth: number;
|
|
11
|
+
}) => number;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExpandedRowDepth = exports.getTimelineFieldLabelFlexBasis = exports.getTimelineRowLeftChromeWidth = exports.getTimelineRowIndentWidth = exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH = exports.TIMELINE_ARROW_COLUMN_WIDTH = exports.TIMELINE_EYE_COLUMN_WIDTH = exports.TIMELINE_ROW_BASE_PADDING = void 0;
|
|
4
|
+
const timeline_indent_1 = require("./timeline-indent");
|
|
5
|
+
exports.TIMELINE_ROW_BASE_PADDING = 5;
|
|
6
|
+
exports.TIMELINE_EYE_COLUMN_WIDTH = 22;
|
|
7
|
+
exports.TIMELINE_ARROW_COLUMN_WIDTH = 16;
|
|
8
|
+
exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH = 15;
|
|
9
|
+
const getTimelineRowIndentWidth = (depth) => {
|
|
10
|
+
return depth * timeline_indent_1.TIMELINE_INDENT;
|
|
11
|
+
};
|
|
12
|
+
exports.getTimelineRowIndentWidth = getTimelineRowIndentWidth;
|
|
13
|
+
const getTimelineRowLeftChromeWidth = (depth) => {
|
|
14
|
+
return (exports.TIMELINE_ROW_BASE_PADDING +
|
|
15
|
+
exports.TIMELINE_EYE_COLUMN_WIDTH +
|
|
16
|
+
(0, exports.getTimelineRowIndentWidth)(depth) +
|
|
17
|
+
exports.TIMELINE_ARROW_COLUMN_WIDTH);
|
|
18
|
+
};
|
|
19
|
+
exports.getTimelineRowLeftChromeWidth = getTimelineRowLeftChromeWidth;
|
|
20
|
+
const getTimelineFieldLabelFlexBasis = (depth) => {
|
|
21
|
+
return `calc(50% - ${(0, exports.getTimelineRowLeftChromeWidth)(depth) - exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH}px)`;
|
|
22
|
+
};
|
|
23
|
+
exports.getTimelineFieldLabelFlexBasis = getTimelineFieldLabelFlexBasis;
|
|
24
|
+
const getExpandedRowDepth = ({ nestedDepth, treeDepth, }) => {
|
|
25
|
+
return nestedDepth + 1 + treeDepth;
|
|
26
|
+
};
|
|
27
|
+
exports.getExpandedRowDepth = getExpandedRowDepth;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useResolveStackAndReactToChange = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
6
|
+
const use_resolved_stack_1 = require("./use-resolved-stack");
|
|
7
|
+
// This case: https://github.com/remotion-dev/remotion/issues/7393
|
|
8
|
+
// A code change has been made and we cannot re-calculate the stack right away.
|
|
9
|
+
// In that case, we wait for fast refresh, wait for the new stack trace, triggering a new event.
|
|
10
|
+
const matchesLostNodePathEvent = (event, location) => {
|
|
11
|
+
var _a;
|
|
12
|
+
if (!(location === null || location === void 0 ? void 0 : location.source) || !location.line) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return (event.fileName === location.source &&
|
|
16
|
+
event.line === location.line &&
|
|
17
|
+
event.column === ((_a = location.column) !== null && _a !== void 0 ? _a : 0));
|
|
18
|
+
};
|
|
19
|
+
const useResolveStackAndReactToChange = (getStack) => {
|
|
20
|
+
const { subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
21
|
+
const [stack, setStack] = (0, react_1.useState)(() => getStack());
|
|
22
|
+
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(stack);
|
|
23
|
+
const resolvedLocationRef = (0, react_1.useRef)(resolvedLocation);
|
|
24
|
+
resolvedLocationRef.current = resolvedLocation;
|
|
25
|
+
(0, react_1.useEffect)(() => {
|
|
26
|
+
let interval = null;
|
|
27
|
+
const handleEvent = (event) => {
|
|
28
|
+
if (event.type !== 'lost-node-path') {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!matchesLostNodePathEvent(event, resolvedLocationRef.current)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const initialStack = getStack();
|
|
35
|
+
if (interval !== null) {
|
|
36
|
+
clearInterval(interval);
|
|
37
|
+
}
|
|
38
|
+
interval = setInterval(() => {
|
|
39
|
+
const newStack = getStack();
|
|
40
|
+
if (newStack !== initialStack) {
|
|
41
|
+
if (interval !== null) {
|
|
42
|
+
clearInterval(interval);
|
|
43
|
+
interval = null;
|
|
44
|
+
}
|
|
45
|
+
setStack(newStack);
|
|
46
|
+
}
|
|
47
|
+
}, 10);
|
|
48
|
+
};
|
|
49
|
+
const unsubscribe = subscribeToEvent('lost-node-path', handleEvent);
|
|
50
|
+
return () => {
|
|
51
|
+
unsubscribe();
|
|
52
|
+
if (interval !== null) {
|
|
53
|
+
clearInterval(interval);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}, [subscribeToEvent, getStack]);
|
|
57
|
+
return resolvedLocation;
|
|
58
|
+
};
|
|
59
|
+
exports.useResolveStackAndReactToChange = useResolveStackAndReactToChange;
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSequencePropsSubscription = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const remotion_1 = require("remotion");
|
|
6
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
7
9
|
const sequence_props_subscription_store_1 = require("./sequence-props-subscription-store");
|
|
8
10
|
const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, effects, }) => {
|
|
9
11
|
var _a, _b, _c;
|
|
10
12
|
const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
11
13
|
const { setOverrideIdToNodePath } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsSettersContext);
|
|
14
|
+
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
15
|
+
const { migrateExpandedTracksForSubscriptionKey } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
|
|
12
16
|
const { previewServerState: state } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
17
|
+
const previousNodePathRef = (0, react_1.useRef)(null);
|
|
18
|
+
const overrideIdToNodePathMappingsRef = (0, react_1.useRef)(overrideIdToNodePathMappings);
|
|
19
|
+
overrideIdToNodePathMappingsRef.current = overrideIdToNodePathMappings;
|
|
13
20
|
const clientId = state.type === 'connected' ? state.clientId : undefined;
|
|
21
|
+
const effectsSignature = (0, react_1.useMemo)(() => effects.map((effect) => (0, studio_shared_1.getAllSchemaKeys)(effect).join('\0')).join('\0\0'), [effects]);
|
|
14
22
|
const validatedLocation = (0, react_1.useMemo)(() => {
|
|
15
23
|
var _a;
|
|
16
24
|
if (!originalLocation ||
|
|
@@ -28,6 +36,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, ef
|
|
|
28
36
|
const locationLine = (_b = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.line) !== null && _b !== void 0 ? _b : null;
|
|
29
37
|
const locationColumn = (_c = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.column) !== null && _c !== void 0 ? _c : null;
|
|
30
38
|
(0, react_1.useEffect)(() => {
|
|
39
|
+
var _a;
|
|
31
40
|
if (!clientId ||
|
|
32
41
|
!locationSource ||
|
|
33
42
|
!locationLine ||
|
|
@@ -35,6 +44,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, ef
|
|
|
35
44
|
!schema) {
|
|
36
45
|
return;
|
|
37
46
|
}
|
|
47
|
+
const nodePathAtResubscribe = (_a = overrideIdToNodePathMappingsRef.current[overrideId]) !== null && _a !== void 0 ? _a : null;
|
|
38
48
|
const { release } = (0, sequence_props_subscription_store_1.acquireSequencePropsSubscription)({
|
|
39
49
|
fileName: locationSource,
|
|
40
50
|
line: locationLine,
|
|
@@ -49,10 +59,24 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, ef
|
|
|
49
59
|
setCodeValues(result.nodePath, () => result.status);
|
|
50
60
|
},
|
|
51
61
|
applyEach: (result) => {
|
|
62
|
+
var _a;
|
|
52
63
|
if (!result.success) {
|
|
53
64
|
return;
|
|
54
65
|
}
|
|
55
|
-
|
|
66
|
+
const newNodePath = result.nodePath;
|
|
67
|
+
const newNodePathKey = (0, studio_shared_1.stringifySequenceSubscriptionKey)(newNodePath);
|
|
68
|
+
const previousNodePath = (_a = previousNodePathRef.current) !== null && _a !== void 0 ? _a : nodePathAtResubscribe;
|
|
69
|
+
const previousNodePathKey = previousNodePath
|
|
70
|
+
? (0, studio_shared_1.stringifySequenceSubscriptionKey)(previousNodePath)
|
|
71
|
+
: null;
|
|
72
|
+
if (previousNodePathKey === newNodePathKey) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (previousNodePath) {
|
|
76
|
+
migrateExpandedTracksForSubscriptionKey(previousNodePath, newNodePath);
|
|
77
|
+
}
|
|
78
|
+
previousNodePathRef.current = newNodePath;
|
|
79
|
+
setOverrideIdToNodePath(overrideId, newNodePath);
|
|
56
80
|
},
|
|
57
81
|
});
|
|
58
82
|
return () => {
|
|
@@ -61,9 +85,11 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, schema, ef
|
|
|
61
85
|
}, [
|
|
62
86
|
clientId,
|
|
63
87
|
effects,
|
|
88
|
+
effectsSignature,
|
|
64
89
|
locationColumn,
|
|
65
90
|
locationLine,
|
|
66
91
|
locationSource,
|
|
92
|
+
migrateExpandedTracksForSubscriptionKey,
|
|
67
93
|
overrideId,
|
|
68
94
|
schema,
|
|
69
95
|
setCodeValues,
|
|
@@ -12,7 +12,7 @@ const container = {
|
|
|
12
12
|
marginLeft: 6,
|
|
13
13
|
opacity: 0.6,
|
|
14
14
|
verticalAlign: 'middle',
|
|
15
|
-
fontSize:
|
|
15
|
+
fontSize: 'inherit',
|
|
16
16
|
};
|
|
17
17
|
const ShortcutHint = ({ keyToPress, cmdOrCtrl }) => {
|
|
18
18
|
const style = (0, react_1.useMemo)(() => {
|
|
@@ -20,10 +20,12 @@ const ShortcutHint = ({ keyToPress, cmdOrCtrl }) => {
|
|
|
20
20
|
return {
|
|
21
21
|
display: 'inline-block',
|
|
22
22
|
transform: `translateY(2px)`,
|
|
23
|
-
fontSize:
|
|
23
|
+
fontSize: 'inherit',
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
return {
|
|
26
|
+
return {
|
|
27
|
+
fontSize: 'inherit',
|
|
28
|
+
};
|
|
27
29
|
}, [keyToPress]);
|
|
28
30
|
if ((0, use_keybinding_1.areKeyboardShortcutsDisabled)()) {
|
|
29
31
|
return null;
|