@remotion/studio 4.0.484 → 4.0.485
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/ContextMenu.js +75 -1
- package/dist/components/CurrentComposition.js +3 -2
- package/dist/components/InlineCompositionName.d.ts +7 -0
- package/dist/components/InlineCompositionName.js +58 -0
- package/dist/components/InlineEditableTitle.d.ts +7 -0
- package/dist/components/InlineEditableTitle.js +129 -0
- package/dist/components/InspectorPanel/KeyframeInspector.js +1 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +17 -30
- package/dist/components/InspectorPanel/styles.js +2 -2
- package/dist/components/InspectorSequenceSection.js +34 -1
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +7 -1
- package/dist/components/NewComposition/CodemodFooter.js +17 -12
- package/dist/components/NewComposition/DeleteComposition.js +7 -1
- package/dist/components/NewComposition/DeleteFolder.js +7 -1
- package/dist/components/NewComposition/DuplicateComposition.js +17 -10
- package/dist/components/NewComposition/InputAndValidationContainer.d.ts +3 -0
- package/dist/components/NewComposition/InputAndValidationContainer.js +15 -0
- package/dist/components/NewComposition/NewCompDuration.js +7 -6
- package/dist/components/NewComposition/NewComposition.d.ts +5 -1
- package/dist/components/NewComposition/NewComposition.js +29 -86
- package/dist/components/NewComposition/RenameComposition.js +13 -14
- package/dist/components/NewComposition/RenameFolder.js +9 -2
- package/dist/components/NewComposition/RenameStaticFile.js +2 -1
- package/dist/components/NewComposition/ValidationMessage.js +9 -1
- package/dist/components/OptionsPanel.d.ts +0 -3
- package/dist/components/OptionsPanel.js +7 -3
- package/dist/components/RenderModal/ServerRenderModal.js +4 -3
- package/dist/components/RenderModal/WebRenderModal.js +2 -1
- package/dist/components/SelectedOutlineElement.js +45 -3
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +15 -3
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +34 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -1
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +19 -101
- package/dist/components/Timeline/TimelineSequencePropItem.js +6 -3
- package/dist/components/Timeline/TimelineTextContentField.d.ts +12 -0
- package/dist/components/Timeline/TimelineTextContentField.js +100 -0
- package/dist/components/Timeline/TimelineWidthProvider.js +18 -3
- package/dist/components/Timeline/focus-inspector-field.d.ts +16 -0
- package/dist/components/Timeline/focus-inspector-field.js +49 -0
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +38 -0
- package/dist/components/Timeline/split-selected-timeline-item.js +156 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +2 -0
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
- package/dist/components/Timeline/use-rename-sequence.d.ts +30 -0
- package/dist/components/Timeline/use-rename-sequence.js +115 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
- package/dist/components/Timeline/use-timeline-height.js +1 -0
- package/dist/components/composition-menu-items.js +3 -0
- package/dist/components/folder-menu-items.js +20 -0
- package/dist/components/options-sidebar-tabs.d.ts +4 -0
- package/dist/components/options-sidebar-tabs.js +5 -0
- package/dist/components/selected-outline-types.d.ts +6 -1
- package/dist/esm/{chunk-9erwh79m.js → chunk-103pp4n7.js} +6734 -5683
- package/dist/esm/internals.mjs +6734 -5683
- package/dist/esm/previewEntry.mjs +6649 -5598
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/render-codec-label.d.ts +1 -1
- package/dist/helpers/timeline-layout.d.ts +4 -3
- package/dist/helpers/timeline-layout.js +3 -1
- package/dist/helpers/use-create-composition.d.ts +35 -0
- package/dist/helpers/use-create-composition.js +111 -0
- package/dist/helpers/use-rename-composition.d.ts +16 -0
- package/dist/helpers/use-rename-composition.js +49 -0
- package/dist/state/modals.d.ts +3 -0
- package/dist/state/timeline-zoom.js +17 -14
- package/dist/state/z-index.d.ts +1 -0
- package/dist/state/z-index.js +11 -2
- package/package.json +12 -12
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -209,7 +209,7 @@ var renderContent = (Root) => {
|
|
|
209
209
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
210
210
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
211
211
|
}));
|
|
212
|
-
import("./chunk-
|
|
212
|
+
import("./chunk-103pp4n7.js").then(({ StudioInternals }) => {
|
|
213
213
|
window.remotion_isStudio = true;
|
|
214
214
|
window.remotion_isReadOnlyStudio = true;
|
|
215
215
|
window.remotion_inputProps = "{}";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const renderHumanReadableAudioCodec: (codec: "aac" | "ac3" | "alaw" | "eac3" | "flac" | "mp3" | "opus" | "pcm-f32" | "pcm-f32be" | "pcm-f64" | "pcm-f64be" | "pcm-s16" | "pcm-s16be" | "pcm-s24" | "pcm-s24be" | "pcm-s32" | "pcm-s32be" | "pcm-s8" | "pcm-u8" | "ulaw" | "vorbis" | null) => string;
|
|
2
|
-
export declare const renderHumanReadableVideoCodec: (codec: "av1" | "avc" | "hevc" | "vp8" | "vp9" | null) => string;
|
|
2
|
+
export declare const renderHumanReadableVideoCodec: (codec: "av1" | "avc" | "hevc" | "prores" | "vp8" | "vp9" | null) => string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type AnySchemaFieldInfo, type DragOverrides, type EffectSchemaFieldInfo, type SchemaFieldGroup, type SchemaFieldGroupInfo, type PropStatuses, type SchemaFieldInfo, type SequenceControls
|
|
1
|
+
import { type AnySchemaFieldInfo, type DragOverrides, type EffectSchemaFieldInfo, type InteractivitySchemaFieldInfo, type SchemaFieldGroup, type SchemaFieldGroupInfo, type PropStatuses, type SchemaFieldInfo, type SequenceControls } from '@remotion/studio-shared';
|
|
2
2
|
import type { GetDragOverrides, GetEffectDragOverrides, InteractivitySchema as InteractivitySchemaShape, TSequence } from 'remotion';
|
|
3
3
|
import type { GetIsExpanded } from '../components/ExpandedTracksProvider';
|
|
4
4
|
import type { SequenceNodePathInfo } from './get-timeline-sequence-sort-key';
|
|
5
5
|
export { SCHEMA_FIELD_GROUPS, getEffectFieldsToShow, getFieldsToShow, getSchemaFieldGroup, SCHEMA_FIELD_ROW_HEIGHT, } from '@remotion/studio-shared';
|
|
6
|
-
export type { AnySchemaFieldInfo, DragOverrides, EffectSchemaFieldInfo, PropStatuses, SchemaFieldGroup, SchemaFieldGroupInfo, SchemaFieldInfo, SequenceControls,
|
|
6
|
+
export type { AnySchemaFieldInfo, DragOverrides, EffectSchemaFieldInfo, InteractivitySchemaFieldInfo, PropStatuses, SchemaFieldGroup, SchemaFieldGroupInfo, SchemaFieldInfo, SequenceControls, };
|
|
7
7
|
export declare const TIMELINE_PADDING = 16;
|
|
8
8
|
export declare const TIMELINE_BORDER = 1;
|
|
9
9
|
export declare const TIMELINE_ITEM_BORDER_BOTTOM = 1;
|
|
@@ -29,12 +29,13 @@ export type TimelineTreeNode = {
|
|
|
29
29
|
readonly label: string;
|
|
30
30
|
readonly field: AnySchemaFieldInfo | null;
|
|
31
31
|
};
|
|
32
|
-
export declare const buildTimelineTree: ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, propStatuses, }: {
|
|
32
|
+
export declare const buildTimelineTree: ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, propStatuses, includeTextContent, }: {
|
|
33
33
|
sequence: TSequence;
|
|
34
34
|
nodePathInfo: SequenceNodePathInfo;
|
|
35
35
|
getDragOverrides: GetDragOverrides;
|
|
36
36
|
getEffectDragOverrides: GetEffectDragOverrides;
|
|
37
37
|
propStatuses: PropStatuses;
|
|
38
|
+
includeTextContent: boolean;
|
|
38
39
|
}) => TimelineTreeNode[];
|
|
39
40
|
export type FlatTreeRow = {
|
|
40
41
|
readonly node: TimelineTreeNode;
|
|
@@ -14,7 +14,7 @@ exports.TIMELINE_ITEM_BORDER_BOTTOM = 1;
|
|
|
14
14
|
exports.TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
|
|
15
15
|
exports.TREE_GROUP_ROW_HEIGHT = 22;
|
|
16
16
|
exports.EXPANDED_SECTION_PADDING_RIGHT = 10;
|
|
17
|
-
const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, propStatuses, }) => {
|
|
17
|
+
const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, propStatuses, includeTextContent, }) => {
|
|
18
18
|
var _a;
|
|
19
19
|
const roots = [];
|
|
20
20
|
const { sequenceSubscriptionKey, index, auxiliaryKeys, supportsEffects } = nodePathInfo;
|
|
@@ -24,6 +24,7 @@ const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffect
|
|
|
24
24
|
getDragOverrides,
|
|
25
25
|
propStatuses,
|
|
26
26
|
nodePath: sequenceSubscriptionKey,
|
|
27
|
+
includeTextContent,
|
|
27
28
|
});
|
|
28
29
|
if (controlFields && controlFields.length > 0) {
|
|
29
30
|
for (const f of controlFields) {
|
|
@@ -134,6 +135,7 @@ const getExpandedTrackHeight = ({ sequence, nodePathInfo, getIsExpanded, propSta
|
|
|
134
135
|
getDragOverrides: () => ({}),
|
|
135
136
|
getEffectDragOverrides: () => ({}),
|
|
136
137
|
propStatuses,
|
|
138
|
+
includeTextContent: false,
|
|
137
139
|
});
|
|
138
140
|
const flat = (0, exports.flattenVisibleTreeNodes)({ nodes: tree, getIsExpanded });
|
|
139
141
|
if (flat.length === 0) {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
|
+
export declare const getUniqueCompositionName: (compositions: import("remotion").AnyComposition[]) => string;
|
|
3
|
+
export declare const useCreateComposition: ({ compositions, durationInFrames, folderName, newId, parentName, selectedFrameRate, size, }: {
|
|
4
|
+
compositions: import("remotion").AnyComposition[];
|
|
5
|
+
durationInFrames: number;
|
|
6
|
+
folderName: string | null;
|
|
7
|
+
newId: string;
|
|
8
|
+
parentName: string | null;
|
|
9
|
+
selectedFrameRate: number;
|
|
10
|
+
size: {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
}) => {
|
|
15
|
+
codemod: {
|
|
16
|
+
type: "new-composition";
|
|
17
|
+
newId: string;
|
|
18
|
+
componentName: string;
|
|
19
|
+
componentImportPath: string;
|
|
20
|
+
folderName: string | null;
|
|
21
|
+
parentName: string | null;
|
|
22
|
+
newHeight: number;
|
|
23
|
+
newWidth: number;
|
|
24
|
+
newFps: number;
|
|
25
|
+
newDurationInFrames: number;
|
|
26
|
+
};
|
|
27
|
+
createComposition: ({ signal, symbolicatedStack, }: {
|
|
28
|
+
signal: AbortSignal;
|
|
29
|
+
symbolicatedStack: SymbolicatedStackFrame | null;
|
|
30
|
+
}) => Promise<import("@remotion/studio-shared").ApplyCodemodResponse>;
|
|
31
|
+
heightValidationMessage: string | null;
|
|
32
|
+
nameValidationMessage: string | null;
|
|
33
|
+
valid: boolean;
|
|
34
|
+
widthValidationMessage: string | null;
|
|
35
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCreateComposition = exports.getUniqueCompositionName = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const actions_1 = require("../components/RenderQueue/actions");
|
|
7
|
+
const url_state_1 = require("./url-state");
|
|
8
|
+
const validate_new_comp_data_1 = require("./validate-new-comp-data");
|
|
9
|
+
const toPascalCase = (value) => {
|
|
10
|
+
var _a;
|
|
11
|
+
const words = (_a = value.match(/[a-zA-Z0-9]+/g)) !== null && _a !== void 0 ? _a : [];
|
|
12
|
+
const candidate = words
|
|
13
|
+
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)
|
|
14
|
+
.join('');
|
|
15
|
+
if (!candidate) {
|
|
16
|
+
return 'NewComposition';
|
|
17
|
+
}
|
|
18
|
+
if (/^[0-9]/.test(candidate)) {
|
|
19
|
+
return `Composition${candidate}`;
|
|
20
|
+
}
|
|
21
|
+
return candidate;
|
|
22
|
+
};
|
|
23
|
+
const waitForComposition = (compositionId) => {
|
|
24
|
+
return new Promise((resolve) => {
|
|
25
|
+
const started = Date.now();
|
|
26
|
+
const interval = window.setInterval(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
var _b;
|
|
29
|
+
const compositionNames = (_b = (_a = window.remotion_getCompositionNames) === null || _a === void 0 ? void 0 : _a.call(window)) !== null && _b !== void 0 ? _b : [];
|
|
30
|
+
if (compositionNames.includes(compositionId) ||
|
|
31
|
+
Date.now() - started > 10000) {
|
|
32
|
+
window.clearInterval(interval);
|
|
33
|
+
resolve();
|
|
34
|
+
}
|
|
35
|
+
}, 100);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const getUniqueCompositionName = (compositions) => {
|
|
39
|
+
let counter = 1;
|
|
40
|
+
while (true) {
|
|
41
|
+
const name = counter === 1 ? 'NewComposition' : `NewComposition${counter}`;
|
|
42
|
+
const err = (0, validate_new_comp_data_1.validateCompositionName)(name, compositions);
|
|
43
|
+
if (!err) {
|
|
44
|
+
return name;
|
|
45
|
+
}
|
|
46
|
+
counter++;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.getUniqueCompositionName = getUniqueCompositionName;
|
|
50
|
+
const useCreateComposition = ({ compositions, durationInFrames, folderName, newId, parentName, selectedFrameRate, size, }) => {
|
|
51
|
+
const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
|
|
52
|
+
const componentName = (0, react_1.useMemo)(() => toPascalCase(newId), [newId]);
|
|
53
|
+
const nameValidationMessage = (0, react_1.useMemo)(() => {
|
|
54
|
+
return (0, validate_new_comp_data_1.validateCompositionName)(newId, compositions);
|
|
55
|
+
}, [compositions, newId]);
|
|
56
|
+
const widthValidationMessage = (0, react_1.useMemo)(() => {
|
|
57
|
+
return (0, validate_new_comp_data_1.validateCompositionDimension)('Width', size.width);
|
|
58
|
+
}, [size.width]);
|
|
59
|
+
const heightValidationMessage = (0, react_1.useMemo)(() => {
|
|
60
|
+
return (0, validate_new_comp_data_1.validateCompositionDimension)('Height', size.height);
|
|
61
|
+
}, [size.height]);
|
|
62
|
+
const codemod = (0, react_1.useMemo)(() => {
|
|
63
|
+
return {
|
|
64
|
+
type: 'new-composition',
|
|
65
|
+
newDurationInFrames: Number(durationInFrames),
|
|
66
|
+
newFps: Number(selectedFrameRate),
|
|
67
|
+
newHeight: Number(size.height),
|
|
68
|
+
newWidth: Number(size.width),
|
|
69
|
+
newId,
|
|
70
|
+
componentName,
|
|
71
|
+
componentImportPath: `./${componentName}`,
|
|
72
|
+
folderName,
|
|
73
|
+
parentName,
|
|
74
|
+
};
|
|
75
|
+
}, [
|
|
76
|
+
componentName,
|
|
77
|
+
durationInFrames,
|
|
78
|
+
folderName,
|
|
79
|
+
newId,
|
|
80
|
+
parentName,
|
|
81
|
+
selectedFrameRate,
|
|
82
|
+
size.height,
|
|
83
|
+
size.width,
|
|
84
|
+
]);
|
|
85
|
+
const valid = nameValidationMessage === null &&
|
|
86
|
+
widthValidationMessage === null &&
|
|
87
|
+
heightValidationMessage === null;
|
|
88
|
+
const createComposition = (0, react_1.useCallback)(async ({ signal, symbolicatedStack, }) => {
|
|
89
|
+
const result = await (0, actions_1.applyCodemod)({
|
|
90
|
+
codemod,
|
|
91
|
+
dryRun: false,
|
|
92
|
+
signal,
|
|
93
|
+
symbolicatedStack,
|
|
94
|
+
});
|
|
95
|
+
if (result.success) {
|
|
96
|
+
await waitForComposition(newId);
|
|
97
|
+
setCanvasContent({ type: 'composition', compositionId: newId });
|
|
98
|
+
(0, url_state_1.pushUrl)(`/${newId}`);
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}, [codemod, newId, setCanvasContent]);
|
|
102
|
+
return {
|
|
103
|
+
codemod,
|
|
104
|
+
createComposition,
|
|
105
|
+
heightValidationMessage,
|
|
106
|
+
nameValidationMessage,
|
|
107
|
+
valid,
|
|
108
|
+
widthValidationMessage,
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
exports.useCreateComposition = useCreateComposition;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RecastCodemod, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
|
+
export declare const useRenameComposition: ({ compositions, currentId, newId, }: {
|
|
3
|
+
compositions: import("remotion").AnyComposition[];
|
|
4
|
+
currentId: string;
|
|
5
|
+
newId: string;
|
|
6
|
+
}) => {
|
|
7
|
+
codemod: RecastCodemod;
|
|
8
|
+
getValidationMessage: (value: string) => string | null;
|
|
9
|
+
renameComposition: ({ newCompositionId, signal, symbolicatedStack, }: {
|
|
10
|
+
newCompositionId: string;
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
symbolicatedStack: SymbolicatedStackFrame | null;
|
|
13
|
+
}) => Promise<import("@remotion/studio-shared").ApplyCodemodResponse>;
|
|
14
|
+
valid: boolean;
|
|
15
|
+
validationMessage: string | null;
|
|
16
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRenameComposition = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const actions_1 = require("../components/RenderQueue/actions");
|
|
6
|
+
const url_state_1 = require("./url-state");
|
|
7
|
+
const validate_new_comp_data_1 = require("./validate-new-comp-data");
|
|
8
|
+
const useRenameComposition = ({ compositions, currentId, newId, }) => {
|
|
9
|
+
const getValidationMessage = (0, react_1.useCallback)((value) => {
|
|
10
|
+
if (value === currentId) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return (0, validate_new_comp_data_1.validateCompositionName)(value, compositions);
|
|
14
|
+
}, [compositions, currentId]);
|
|
15
|
+
const getCodemod = (0, react_1.useCallback)((value) => {
|
|
16
|
+
return {
|
|
17
|
+
type: 'rename-composition',
|
|
18
|
+
idToRename: currentId,
|
|
19
|
+
newId: value,
|
|
20
|
+
};
|
|
21
|
+
}, [currentId]);
|
|
22
|
+
const validationMessage = (0, react_1.useMemo)(() => {
|
|
23
|
+
return getValidationMessage(newId);
|
|
24
|
+
}, [getValidationMessage, newId]);
|
|
25
|
+
const codemod = (0, react_1.useMemo)(() => {
|
|
26
|
+
return getCodemod(newId);
|
|
27
|
+
}, [getCodemod, newId]);
|
|
28
|
+
const valid = validationMessage === null && currentId !== newId;
|
|
29
|
+
const renameComposition = (0, react_1.useCallback)(async ({ newCompositionId, signal, symbolicatedStack, }) => {
|
|
30
|
+
const result = await (0, actions_1.applyCodemod)({
|
|
31
|
+
codemod: getCodemod(newCompositionId),
|
|
32
|
+
dryRun: false,
|
|
33
|
+
signal,
|
|
34
|
+
symbolicatedStack,
|
|
35
|
+
});
|
|
36
|
+
if (result.success) {
|
|
37
|
+
(0, url_state_1.pushUrl)(`/${newCompositionId}`);
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}, [getCodemod]);
|
|
41
|
+
return {
|
|
42
|
+
codemod,
|
|
43
|
+
getValidationMessage,
|
|
44
|
+
renameComposition,
|
|
45
|
+
valid,
|
|
46
|
+
validationMessage,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
exports.useRenameComposition = useRenameComposition;
|
package/dist/state/modals.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TimelineZoomContext = exports.TimelineZoomCtx = exports.TIMELINE_MAX_ZOOM = exports.TIMELINE_MIN_ZOOM = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const react_dom_1 = require("react-dom");
|
|
6
7
|
const imperative_state_1 = require("../components/Timeline/imperative-state");
|
|
7
8
|
const timeline_scroll_logic_1 = require("../components/Timeline/timeline-scroll-logic");
|
|
8
9
|
const ZoomPersistor_1 = require("../components/ZoomPersistor");
|
|
@@ -17,21 +18,23 @@ exports.TimelineZoomCtx = (0, react_1.createContext)({
|
|
|
17
18
|
const TimelineZoomContext = ({ children }) => {
|
|
18
19
|
const [zoom, setZoomState] = (0, react_1.useState)(() => (0, ZoomPersistor_1.getZoomFromLocalStorage)());
|
|
19
20
|
const setZoom = (0, react_1.useCallback)((compositionId, callback, options) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
(0, react_dom_1.flushSync)(() => {
|
|
22
|
+
setZoomState((prevZoomMap) => {
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
|
+
const newZoomWithFloatingPointErrors = Math.min(exports.TIMELINE_MAX_ZOOM, Math.max(exports.TIMELINE_MIN_ZOOM, callback((_a = prevZoomMap[compositionId]) !== null && _a !== void 0 ? _a : exports.TIMELINE_MIN_ZOOM)));
|
|
25
|
+
const newZoom = Math.round(newZoomWithFloatingPointErrors * 10) / 10;
|
|
26
|
+
const anchorFrame = (_b = options === null || options === void 0 ? void 0 : options.anchorFrame) !== null && _b !== void 0 ? _b : null;
|
|
27
|
+
const anchorContentX = (_c = options === null || options === void 0 ? void 0 : options.anchorContentX) !== null && _c !== void 0 ? _c : null;
|
|
28
|
+
(0, timeline_scroll_logic_1.zoomAndPreserveCursor)({
|
|
29
|
+
oldZoom: (_d = prevZoomMap[compositionId]) !== null && _d !== void 0 ? _d : exports.TIMELINE_MIN_ZOOM,
|
|
30
|
+
newZoom,
|
|
31
|
+
currentDurationInFrames: (0, imperative_state_1.getCurrentDuration)(),
|
|
32
|
+
currentFrame: (0, imperative_state_1.getCurrentFrame)(),
|
|
33
|
+
anchorFrame,
|
|
34
|
+
anchorContentX,
|
|
35
|
+
});
|
|
36
|
+
return { ...prevZoomMap, [compositionId]: newZoom };
|
|
33
37
|
});
|
|
34
|
-
return { ...prevZoomMap, [compositionId]: newZoom };
|
|
35
38
|
});
|
|
36
39
|
}, []);
|
|
37
40
|
const value = (0, react_1.useMemo)(() => {
|
package/dist/state/z-index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const HigherZIndex: React.FC<{
|
|
|
4
4
|
readonly onOutsideClick: (target: Node) => void;
|
|
5
5
|
readonly children: React.ReactNode;
|
|
6
6
|
readonly disabled?: boolean;
|
|
7
|
+
readonly outsideClickButton?: 'any' | 'primary';
|
|
7
8
|
}>;
|
|
8
9
|
export declare const useZIndex: () => {
|
|
9
10
|
currentZIndex: number;
|
package/dist/state/z-index.js
CHANGED
|
@@ -31,7 +31,7 @@ const EscapeHook = ({ onEscape }) => {
|
|
|
31
31
|
}, [keybindings, onEscape]);
|
|
32
32
|
return null;
|
|
33
33
|
};
|
|
34
|
-
const HigherZIndex = ({ children, onEscape, onOutsideClick, disabled }) => {
|
|
34
|
+
const HigherZIndex = ({ children, onEscape, onOutsideClick, disabled, outsideClickButton = 'any', }) => {
|
|
35
35
|
const context = (0, react_1.useContext)(ZIndexContext);
|
|
36
36
|
const highestContext = (0, react_1.useContext)(highest_z_index_1.HighestZIndexContext);
|
|
37
37
|
const containerRef = (0, react_1.useRef)(null);
|
|
@@ -52,6 +52,9 @@ const HigherZIndex = ({ children, onEscape, onOutsideClick, disabled }) => {
|
|
|
52
52
|
let onUp = null;
|
|
53
53
|
const listener = (downEvent) => {
|
|
54
54
|
var _a;
|
|
55
|
+
if (outsideClickButton === 'primary' && downEvent.button !== 0) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
55
58
|
const outsideClick = !((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.contains(downEvent.target));
|
|
56
59
|
if (!outsideClick) {
|
|
57
60
|
return;
|
|
@@ -83,7 +86,13 @@ const HigherZIndex = ({ children, onEscape, onOutsideClick, disabled }) => {
|
|
|
83
86
|
onUp = null;
|
|
84
87
|
return window.removeEventListener('pointerdown', listener, true);
|
|
85
88
|
};
|
|
86
|
-
}, [
|
|
89
|
+
}, [
|
|
90
|
+
currentIndex,
|
|
91
|
+
disabled,
|
|
92
|
+
highestContext.highestIndex,
|
|
93
|
+
onOutsideClick,
|
|
94
|
+
outsideClickButton,
|
|
95
|
+
]);
|
|
87
96
|
const value = (0, react_1.useMemo)(() => {
|
|
88
97
|
return {
|
|
89
98
|
currentIndex,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.485",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"semver": "7.5.3",
|
|
28
|
-
"remotion": "4.0.
|
|
29
|
-
"@remotion/canvas-capture": "4.0.
|
|
30
|
-
"@remotion/player": "4.0.
|
|
31
|
-
"@remotion/media-utils": "4.0.
|
|
32
|
-
"@remotion/renderer": "4.0.
|
|
33
|
-
"@remotion/web-renderer": "4.0.
|
|
34
|
-
"@remotion/studio-shared": "4.0.
|
|
35
|
-
"@remotion/timeline-utils": "4.0.
|
|
36
|
-
"@remotion/zod-types": "4.0.
|
|
28
|
+
"remotion": "4.0.485",
|
|
29
|
+
"@remotion/canvas-capture": "4.0.485",
|
|
30
|
+
"@remotion/player": "4.0.485",
|
|
31
|
+
"@remotion/media-utils": "4.0.485",
|
|
32
|
+
"@remotion/renderer": "4.0.485",
|
|
33
|
+
"@remotion/web-renderer": "4.0.485",
|
|
34
|
+
"@remotion/studio-shared": "4.0.485",
|
|
35
|
+
"@remotion/timeline-utils": "4.0.485",
|
|
36
|
+
"@remotion/zod-types": "4.0.485",
|
|
37
37
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
38
|
-
"mediabunny": "1.
|
|
38
|
+
"mediabunny": "1.50.3",
|
|
39
39
|
"memfs": "3.4.3",
|
|
40
40
|
"open": "8.4.2",
|
|
41
41
|
"zod": "4.3.6"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"react": "19.2.3",
|
|
45
45
|
"react-dom": "19.2.3",
|
|
46
46
|
"@types/semver": "7.5.3",
|
|
47
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
47
|
+
"@remotion/eslint-config-internal": "4.0.485",
|
|
48
48
|
"eslint": "9.19.0",
|
|
49
49
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
50
50
|
},
|