@remotion/studio 4.0.463 → 4.0.465
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/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/ExpandedTracksProvider.d.ts +2 -0
- package/dist/components/ExpandedTracksProvider.js +18 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
- package/dist/components/NewComposition/CodemodFooter.js +35 -23
- package/dist/components/NewComposition/DeleteComposition.js +3 -1
- package/dist/components/NewComposition/DiffPreview.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +3 -1
- package/dist/components/NewComposition/RenameComposition.js +4 -2
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +8 -47
- package/dist/components/RenderQueue/actions.d.ts +2 -1
- package/dist/components/RenderQueue/actions.js +2 -1
- package/dist/components/Timeline/Padder.js +2 -2
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +1 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +9 -4
- 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 +22 -31
- package/dist/components/Timeline/TimelineEffectGroupRow.d.ts +1 -2
- package/dist/components/Timeline/TimelineEffectGroupRow.js +67 -12
- package/dist/components/Timeline/TimelineExpandedRow.js +15 -30
- package/dist/components/Timeline/TimelineFieldRow.d.ts +1 -2
- package/dist/components/Timeline/TimelineFieldRow.js +19 -16
- package/dist/components/Timeline/TimelineImageInfo.js +5 -17
- package/dist/components/Timeline/TimelineListItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineListItem.js +12 -14
- package/dist/components/Timeline/TimelineRowChrome.d.ts +8 -0
- package/dist/components/Timeline/TimelineRowChrome.js +21 -0
- package/dist/components/Timeline/TimelineTimeIndicators.js +4 -11
- package/dist/components/Timeline/TimelineTracks.js +0 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +25 -8
- package/dist/components/Timeline/get-timeline-video-info-widths.d.ts +9 -0
- package/dist/components/Timeline/get-timeline-video-info-widths.js +11 -0
- package/dist/components/Timeline/save-effect-prop.d.ts +2 -1
- package/dist/components/Timeline/save-effect-prop.js +2 -13
- package/dist/components/Timeline/save-prop-queue.d.ts +1 -2
- package/dist/components/Timeline/save-prop-queue.js +3 -12
- package/dist/components/Timeline/save-sequence-prop.d.ts +2 -1
- package/dist/components/Timeline/save-sequence-prop.js +2 -11
- 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-resolved-stack.d.ts +1 -0
- package/dist/components/Timeline/use-resolved-stack.js +10 -1
- 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-6jf1natv.js +25 -0
- package/dist/esm/{chunk-b0m62frw.js → chunk-pqk2qd0d.js} +4971 -4013
- package/dist/esm/index.mjs +16 -0
- package/dist/esm/internals.mjs +4984 -4011
- package/dist/esm/previewEntry.mjs +4995 -4023
- package/dist/esm/renderEntry.mjs +4 -3
- 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/preview-server-events.d.ts +15 -0
- package/dist/helpers/preview-server-events.js +81 -0
- package/dist/helpers/resolved-stack-to-symbolicated.d.ts +3 -0
- package/dist/helpers/resolved-stack-to-symbolicated.js +16 -0
- package/dist/helpers/timeline-layout.d.ts +0 -1
- package/dist/helpers/timeline-layout.js +29 -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/esm/chunk-5gtx3pza.js +0 -9
- package/dist/helpers/color-math.d.ts +0 -1
- package/dist/helpers/color-math.js +0 -13
|
@@ -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,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useResolvedStack = void 0;
|
|
3
|
+
exports.useResolvedStack = exports.hasResolvedStack = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const get_stack_1 = require("./TimelineStack/get-stack");
|
|
7
7
|
const resolvedCache = new Map();
|
|
8
|
+
const hasResolvedStack = (stack) => {
|
|
9
|
+
if (!stack) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return resolvedCache.has(stack);
|
|
13
|
+
};
|
|
14
|
+
exports.hasResolvedStack = hasResolvedStack;
|
|
8
15
|
const inFlight = new Set();
|
|
9
16
|
const subscribers = new Map();
|
|
10
17
|
const useResolvedStack = (stack) => {
|
|
@@ -40,6 +47,8 @@ const useResolvedStack = (stack) => {
|
|
|
40
47
|
.catch((err) => {
|
|
41
48
|
// eslint-disable-next-line no-console
|
|
42
49
|
console.error('Could not get original location of Sequence', err);
|
|
50
|
+
resolvedCache.set(stack, null);
|
|
51
|
+
subs.forEach((fn) => fn(null));
|
|
43
52
|
})
|
|
44
53
|
.finally(() => {
|
|
45
54
|
inFlight.delete(stack);
|
|
@@ -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;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
+
for (let key of __getOwnPropNames(mod))
|
|
10
|
+
if (!__hasOwnProp.call(to, key))
|
|
11
|
+
__defProp(to, key, {
|
|
12
|
+
get: () => mod[key],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
18
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
19
|
+
}) : x)(function(x) {
|
|
20
|
+
if (typeof require !== "undefined")
|
|
21
|
+
return require.apply(this, arguments);
|
|
22
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { __toESM, __require };
|