@remotion/studio 4.0.478 → 4.0.479
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 +8 -14
- package/dist/components/Button.d.ts +1 -0
- package/dist/components/Button.js +8 -5
- package/dist/components/CompactExplanation.d.ts +12 -0
- package/dist/components/CompactExplanation.js +52 -0
- package/dist/components/CompositionSelector.js +2 -4
- package/dist/components/CurrentAsset.d.ts +3 -1
- package/dist/components/CurrentAsset.js +42 -34
- package/dist/components/CurrentComposition.d.ts +1 -1
- package/dist/components/CurrentComposition.js +38 -31
- package/dist/components/DefaultPropsEditor.d.ts +12 -2
- package/dist/components/DefaultPropsEditor.js +2 -2
- package/dist/components/EffectPickerModal.d.ts +5 -0
- package/dist/components/EffectPickerModal.js +179 -0
- package/dist/components/InspectorInfoHeader.d.ts +11 -0
- package/dist/components/InspectorInfoHeader.js +55 -0
- package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
- package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/EasingInspector.js +41 -0
- package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
- package/dist/components/InspectorPanel/GuideInspector.js +55 -0
- package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
- package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +116 -0
- package/dist/components/InspectorPanel/common.d.ts +15 -0
- package/dist/components/InspectorPanel/common.js +18 -0
- package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
- package/dist/components/InspectorPanel/inspector-selection.js +34 -0
- package/dist/components/InspectorPanel/styles.d.ts +27 -0
- package/dist/components/InspectorPanel/styles.js +178 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
- package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
- package/dist/components/InspectorPanel.d.ts +8 -0
- package/dist/components/InspectorPanel.js +26 -0
- package/dist/components/InspectorPanelLayout.d.ts +1 -0
- package/dist/components/InspectorPanelLayout.js +4 -0
- package/dist/components/InspectorSequenceSection.d.ts +16 -0
- package/dist/components/InspectorSequenceSection.js +147 -0
- package/dist/components/InspectorSourceLocation.d.ts +7 -0
- package/dist/components/InspectorSourceLocation.js +71 -0
- package/dist/components/Modals.js +3 -3
- package/dist/components/NewComposition/InputDragger.js +1 -1
- package/dist/components/NewComposition/RemInput.d.ts +1 -0
- package/dist/components/NewComposition/RemInput.js +8 -2
- package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
- package/dist/components/NewComposition/RemTextarea.js +8 -2
- package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
- package/dist/components/NewComposition/ValidationMessage.js +16 -5
- package/dist/components/OptionsPanel.d.ts +1 -1
- package/dist/components/OptionsPanel.js +8 -17
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
- package/dist/components/QuickSwitcher/shared.d.ts +4 -0
- package/dist/components/QuickSwitcher/shared.js +24 -0
- package/dist/components/RenderModal/DataEditor.d.ts +29 -2
- package/dist/components/RenderModal/DataEditor.js +107 -56
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
- package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
- package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
- package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
- package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
- package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
- package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
- package/dist/components/RendersTab.js +1 -1
- package/dist/components/SegmentedControl.d.ts +3 -0
- package/dist/components/SegmentedControl.js +11 -5
- package/dist/components/SelectedOutlineElement.js +57 -24
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +41 -29
- package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
- package/dist/components/SelectedOutlineUvControls.js +64 -10
- package/dist/components/Tabs/index.js +4 -4
- package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
- package/dist/components/Timeline/EasingEditorModal.js +597 -124
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
- package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +24 -20
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +5 -19
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
- package/dist/components/Timeline/TimelineNumberField.js +5 -11
- package/dist/components/Timeline/TimelineRotationField.js +5 -6
- package/dist/components/Timeline/TimelineScaleField.js +4 -8
- package/dist/components/Timeline/TimelineSelection.d.ts +6 -0
- package/dist/components/Timeline/TimelineSelection.js +109 -14
- package/dist/components/Timeline/TimelineSequence.js +19 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +12 -67
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +56 -52
- package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
- package/dist/components/Timeline/TimelineTranslateField.js +4 -5
- package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
- package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
- package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
- package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
- package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
- package/dist/components/Timeline/reset-selected-timeline-props.js +19 -5
- package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
- package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
- package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
- package/dist/components/Timeline/update-selected-easing.js +40 -9
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +11 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +33 -0
- package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
- package/dist/components/VisualControls/VisualControlsContent.js +4 -5
- package/dist/components/effect-drag-and-drop.d.ts +10 -0
- package/dist/components/effect-drag-and-drop.js +17 -8
- package/dist/components/effect-picker-search.d.ts +5 -0
- package/dist/components/effect-picker-search.js +77 -0
- package/dist/components/selected-outline-drag.d.ts +21 -2
- package/dist/components/selected-outline-drag.js +31 -6
- package/dist/components/selected-outline-types.d.ts +7 -7
- package/dist/components/selected-outline-uv.d.ts +4 -3
- package/dist/components/selected-outline-uv.js +6 -2
- package/dist/esm/{chunk-hrw9799x.js → chunk-fge2mq5p.js} +16535 -13311
- package/dist/esm/internals.mjs +16535 -13311
- package/dist/esm/previewEntry.mjs +17141 -13917
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/render-codec-label.d.ts +2 -0
- package/dist/helpers/render-codec-label.js +49 -0
- package/dist/helpers/timeline-layout.d.ts +4 -4
- package/dist/helpers/use-media-metadata.d.ts +8 -2
- package/dist/helpers/use-media-metadata.js +17 -4
- package/dist/state/modals.d.ts +9 -4
- package/package.json +12 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addEffectFromDragData = exports.getEffectDragData = exports.hasExplicitEffectDragType = exports.hasEffectDragType = void 0;
|
|
3
|
+
exports.addEffectToSequence = exports.addEffectFromDragData = exports.getEffectDragData = exports.hasExplicitEffectDragType = exports.hasEffectDragType = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const install_required_package_1 = require("../helpers/install-required-package");
|
|
6
6
|
const call_api_1 = require("./call-api");
|
|
@@ -47,20 +47,29 @@ const getEffectDragData = (dataTransfer) => {
|
|
|
47
47
|
return null;
|
|
48
48
|
};
|
|
49
49
|
exports.getEffectDragData = getEffectDragData;
|
|
50
|
-
const addEffectFromDragData =
|
|
50
|
+
const addEffectFromDragData = ({ clientId, dragData, fileName, nodePath, }) => {
|
|
51
|
+
return (0, exports.addEffectToSequence)({
|
|
52
|
+
clientId,
|
|
53
|
+
effect: dragData.effect,
|
|
54
|
+
fileName,
|
|
55
|
+
nodePath,
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
exports.addEffectFromDragData = addEffectFromDragData;
|
|
59
|
+
const addEffectToSequence = async ({ clientId, effect, fileName, nodePath, }) => {
|
|
51
60
|
try {
|
|
52
|
-
const requiredPackage = (0, studio_shared_1.getRequiredPackageForEffectImportPath)(
|
|
61
|
+
const requiredPackage = (0, studio_shared_1.getRequiredPackageForEffectImportPath)(effect.importPath);
|
|
53
62
|
await (0, install_required_package_1.installRequiredPackages)(requiredPackage ? [requiredPackage] : []);
|
|
54
63
|
const result = await (0, call_api_1.callApi)('/api/add-effect', {
|
|
55
64
|
fileName,
|
|
56
65
|
sequenceNodePath: nodePath,
|
|
57
|
-
effectName:
|
|
58
|
-
effectImportPath:
|
|
59
|
-
effectConfig:
|
|
66
|
+
effectName: effect.name,
|
|
67
|
+
effectImportPath: effect.importPath,
|
|
68
|
+
effectConfig: effect.config,
|
|
60
69
|
clientId,
|
|
61
70
|
});
|
|
62
71
|
if (result.success) {
|
|
63
|
-
(0, NotificationCenter_1.showNotification)(`Added ${
|
|
72
|
+
(0, NotificationCenter_1.showNotification)(`Added ${effect.name}()`, 2000);
|
|
64
73
|
}
|
|
65
74
|
else {
|
|
66
75
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
@@ -70,4 +79,4 @@ const addEffectFromDragData = async ({ clientId, dragData, fileName, nodePath, }
|
|
|
70
79
|
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
71
80
|
}
|
|
72
81
|
};
|
|
73
|
-
exports.
|
|
82
|
+
exports.addEffectToSequence = addEffectToSequence;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterEffectCatalog = void 0;
|
|
4
|
+
const normalize = (value) => value.trim().toLowerCase();
|
|
5
|
+
const compact = (value) => normalize(value).replace(/[^a-z0-9]/g, '');
|
|
6
|
+
const fuzzyMatches = (query, value) => {
|
|
7
|
+
let index = -1;
|
|
8
|
+
for (const character of query) {
|
|
9
|
+
index = value.indexOf(character, index + 1);
|
|
10
|
+
if (index === -1) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
};
|
|
16
|
+
const getMatchScore = (item, query) => {
|
|
17
|
+
const normalizedQuery = normalize(query);
|
|
18
|
+
const compactQuery = compact(query);
|
|
19
|
+
if (normalizedQuery.length === 0) {
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
22
|
+
const label = normalize(item.label);
|
|
23
|
+
const name = normalize(item.effect.name);
|
|
24
|
+
const primary = [label, name];
|
|
25
|
+
const compactPrimary = primary.map(compact);
|
|
26
|
+
if (primary.some((field) => field === normalizedQuery)) {
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
if (compactQuery.length > 0) {
|
|
30
|
+
if (compactPrimary.some((field) => field === compactQuery)) {
|
|
31
|
+
return 1;
|
|
32
|
+
}
|
|
33
|
+
if (compactPrimary.some((field) => field.startsWith(compactQuery))) {
|
|
34
|
+
return 2;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (primary.some((field) => field.startsWith(normalizedQuery))) {
|
|
38
|
+
return 2;
|
|
39
|
+
}
|
|
40
|
+
if (compactQuery.length > 0) {
|
|
41
|
+
if (compactPrimary.some((field) => field.includes(compactQuery))) {
|
|
42
|
+
return 3;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (primary.some((field) => field.includes(normalizedQuery))) {
|
|
46
|
+
return 3;
|
|
47
|
+
}
|
|
48
|
+
const importPath = normalize(item.effect.importPath);
|
|
49
|
+
if (importPath.includes(normalizedQuery) ||
|
|
50
|
+
(compactQuery.length > 0 && compact(importPath).includes(compactQuery))) {
|
|
51
|
+
return 4;
|
|
52
|
+
}
|
|
53
|
+
const secondary = [normalize(item.category), normalize(item.description)];
|
|
54
|
+
const compactSecondary = secondary.map(compact);
|
|
55
|
+
if (secondary.some((field) => field.includes(normalizedQuery)) ||
|
|
56
|
+
(compactQuery.length > 0 &&
|
|
57
|
+
compactSecondary.some((field) => field.includes(compactQuery)))) {
|
|
58
|
+
return 5;
|
|
59
|
+
}
|
|
60
|
+
if (compactQuery.length > 0 &&
|
|
61
|
+
compactPrimary.some((field) => fuzzyMatches(compactQuery, field))) {
|
|
62
|
+
return 6;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
};
|
|
66
|
+
const filterEffectCatalog = ({ items, query, }) => {
|
|
67
|
+
return items
|
|
68
|
+
.map((item, index) => ({
|
|
69
|
+
item,
|
|
70
|
+
index,
|
|
71
|
+
score: getMatchScore(item, query),
|
|
72
|
+
}))
|
|
73
|
+
.filter((candidate) => candidate.score !== null)
|
|
74
|
+
.sort((a, b) => a.score - b.score || a.index - b.index)
|
|
75
|
+
.map(({ item }) => item);
|
|
76
|
+
};
|
|
77
|
+
exports.filterEffectCatalog = filterEffectCatalog;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import type { GetDragOverrides, SequencePropsSubscriptionKey,
|
|
1
|
+
import type { CanUpdateSequencePropStatus, DragOverrideValue, GetDragOverrides, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
|
|
2
2
|
import { type OutlinePoint } from './selected-outline-geometry';
|
|
3
3
|
import type { SelectedOutlineDragState, SelectedOutlineRotationDragState, SelectedOutlineRotationDragTarget, SelectedOutlineScaleDragState, SelectedOutlineScaleDragTarget, SelectedOutlineDragTarget } from './selected-outline-types';
|
|
4
4
|
import { type UvCoordinate } from './selected-outline-uv';
|
|
5
5
|
import type { SaveSequencePropChange } from './Timeline/save-sequence-prop';
|
|
6
|
+
export declare const getSelectedOutlineActiveSchema: ({ schema, currentRuntimeValueDotNotation, dragOverrides, propStatus, frame, }: {
|
|
7
|
+
readonly schema: InteractivitySchema;
|
|
8
|
+
readonly currentRuntimeValueDotNotation: Record<string, unknown>;
|
|
9
|
+
readonly dragOverrides: Record<string, DragOverrideValue>;
|
|
10
|
+
readonly propStatus: Record<string, CanUpdateSequencePropStatus> | undefined;
|
|
11
|
+
readonly frame: number | null;
|
|
12
|
+
}) => InteractivitySchema;
|
|
6
13
|
export declare const getSelectedOutlineDragStates: ({ dragTargets, getDragOverrides, timelinePosition, }: {
|
|
7
14
|
readonly dragTargets: readonly SelectedOutlineDragTarget[];
|
|
8
15
|
readonly getDragOverrides: GetDragOverrides;
|
|
@@ -35,7 +42,7 @@ export type SelectedOutlineKeyframedDragChange = {
|
|
|
35
42
|
readonly fieldKey: string;
|
|
36
43
|
readonly sourceFrame: number;
|
|
37
44
|
readonly value: unknown;
|
|
38
|
-
readonly schema:
|
|
45
|
+
readonly schema: InteractivitySchema;
|
|
39
46
|
readonly clientId: string;
|
|
40
47
|
};
|
|
41
48
|
export type SelectedOutlineDragChange = SelectedOutlineStaticDragChange | SelectedOutlineKeyframedDragChange;
|
|
@@ -90,6 +97,11 @@ export declare const getSelectedOutlineRotationDragValues: ({ dragStates, rotati
|
|
|
90
97
|
readonly dragStates: readonly SelectedOutlineRotationDragState[];
|
|
91
98
|
readonly rotationDeltaDegrees: number;
|
|
92
99
|
}) => Map<string, string>;
|
|
100
|
+
export declare const selectedOutlineRotationSnapStepDegrees = 15;
|
|
101
|
+
export declare const snapSelectedOutlineRotationDeltaDegrees: ({ dragStates, rotationDeltaDegrees, }: {
|
|
102
|
+
readonly dragStates: readonly SelectedOutlineRotationDragState[];
|
|
103
|
+
readonly rotationDeltaDegrees: number;
|
|
104
|
+
}) => number;
|
|
93
105
|
export declare const getSelectedOutlineRotationDragChanges: ({ dragStates, lastValues, }: {
|
|
94
106
|
readonly dragStates: readonly SelectedOutlineRotationDragState[];
|
|
95
107
|
readonly lastValues: ReadonlyMap<string, string>;
|
|
@@ -130,6 +142,13 @@ export declare const applySelectedOutlineTransformOriginAxisLock: ({ lockedAxis,
|
|
|
130
142
|
readonly startUv: UvCoordinate;
|
|
131
143
|
readonly uv: UvCoordinate;
|
|
132
144
|
}) => UvCoordinate;
|
|
145
|
+
export declare const selectedOutlineUvSnapThresholdPx = 10;
|
|
146
|
+
export declare const snapSelectedOutlineUv: ({ point, points, thresholdPx, uv, }: {
|
|
147
|
+
readonly point: OutlinePoint;
|
|
148
|
+
readonly points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint];
|
|
149
|
+
readonly thresholdPx?: number | undefined;
|
|
150
|
+
readonly uv: UvCoordinate;
|
|
151
|
+
}) => UvCoordinate;
|
|
133
152
|
export declare const selectedOutlineTransformOriginSnapThresholdPx = 10;
|
|
134
153
|
export declare const snapSelectedOutlineTransformOriginUv: ({ point, points, thresholdPx, uv, }: {
|
|
135
154
|
readonly point: OutlinePoint;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.snapSelectedOutlineTransformOriginUv = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.applySelectedOutlineTransformOriginAxisLock = exports.getSelectedOutlineTransformOriginLockedAxis = exports.uvsEqual = exports.compensateTranslateForTransformOrigin = exports.parseCssRotationToRadians = exports.clearSelectedOutlineRotationDragOverrides = exports.clearSelectedOutlineScaleDragOverrides = exports.getSelectedOutlineKeyboardNudgeDirection = exports.clearSelectedOutlineDragOverrides = exports.getSelectedOutlineRotationDragChanges = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragChanges = exports.isSelectedOutlineDragPastThreshold = exports.applySelectedOutlineDragAxisLock = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragStates = void 0;
|
|
3
|
+
exports.snapSelectedOutlineTransformOriginUv = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.snapSelectedOutlineUv = exports.selectedOutlineUvSnapThresholdPx = exports.applySelectedOutlineTransformOriginAxisLock = exports.getSelectedOutlineTransformOriginLockedAxis = exports.uvsEqual = exports.compensateTranslateForTransformOrigin = exports.parseCssRotationToRadians = exports.clearSelectedOutlineRotationDragOverrides = exports.clearSelectedOutlineScaleDragOverrides = exports.getSelectedOutlineKeyboardNudgeDirection = exports.clearSelectedOutlineDragOverrides = exports.getSelectedOutlineRotationDragChanges = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineRotationSnapStepDegrees = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineDragChanges = exports.isSelectedOutlineDragPastThreshold = exports.applySelectedOutlineDragAxisLock = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragStates = exports.getSelectedOutlineActiveSchema = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const no_react_1 = require("remotion/no-react");
|
|
6
6
|
const selected_outline_geometry_1 = require("./selected-outline-geometry");
|
|
@@ -11,6 +11,17 @@ const timeline_field_utils_1 = require("./Timeline/timeline-field-utils");
|
|
|
11
11
|
const timeline_rotation_utils_1 = require("./Timeline/timeline-rotation-utils");
|
|
12
12
|
const timeline_translate_utils_1 = require("./Timeline/timeline-translate-utils");
|
|
13
13
|
const TimelineScaleField_1 = require("./Timeline/TimelineScaleField");
|
|
14
|
+
const getSelectedOutlineActiveSchema = ({ schema, currentRuntimeValueDotNotation, dragOverrides, propStatus, frame, }) => {
|
|
15
|
+
const { merged: valuesDotNotation } = remotion_1.Internals.computeEffectiveSchemaValuesDotNotation({
|
|
16
|
+
schema,
|
|
17
|
+
currentValue: currentRuntimeValueDotNotation,
|
|
18
|
+
overrideValues: dragOverrides,
|
|
19
|
+
propStatus,
|
|
20
|
+
frame,
|
|
21
|
+
});
|
|
22
|
+
return remotion_1.Internals.flattenActiveSchema(schema, (key) => valuesDotNotation[key]);
|
|
23
|
+
};
|
|
24
|
+
exports.getSelectedOutlineActiveSchema = getSelectedOutlineActiveSchema;
|
|
14
25
|
const getSelectedOutlineDragStates = ({ dragTargets, getDragOverrides, timelinePosition, }) => {
|
|
15
26
|
return dragTargets.map((target) => {
|
|
16
27
|
var _a;
|
|
@@ -304,6 +315,18 @@ const getSelectedOutlineRotationDragValues = ({ dragStates, rotationDeltaDegrees
|
|
|
304
315
|
}));
|
|
305
316
|
};
|
|
306
317
|
exports.getSelectedOutlineRotationDragValues = getSelectedOutlineRotationDragValues;
|
|
318
|
+
exports.selectedOutlineRotationSnapStepDegrees = 15;
|
|
319
|
+
const snapSelectedOutlineRotationDeltaDegrees = ({ dragStates, rotationDeltaDegrees, }) => {
|
|
320
|
+
const anchor = dragStates[0];
|
|
321
|
+
if (anchor === undefined) {
|
|
322
|
+
return rotationDeltaDegrees;
|
|
323
|
+
}
|
|
324
|
+
return (Math.round((anchor.startDegrees + rotationDeltaDegrees) /
|
|
325
|
+
exports.selectedOutlineRotationSnapStepDegrees) *
|
|
326
|
+
exports.selectedOutlineRotationSnapStepDegrees -
|
|
327
|
+
anchor.startDegrees);
|
|
328
|
+
};
|
|
329
|
+
exports.snapSelectedOutlineRotationDeltaDegrees = snapSelectedOutlineRotationDeltaDegrees;
|
|
307
330
|
const getSelectedOutlineRotationDragChanges = ({ dragStates, lastValues, }) => {
|
|
308
331
|
const changes = [];
|
|
309
332
|
for (const dragState of dragStates) {
|
|
@@ -445,7 +468,7 @@ const applySelectedOutlineTransformOriginAxisLock = ({ lockedAxis, startUv, uv,
|
|
|
445
468
|
return uv;
|
|
446
469
|
};
|
|
447
470
|
exports.applySelectedOutlineTransformOriginAxisLock = applySelectedOutlineTransformOriginAxisLock;
|
|
448
|
-
const
|
|
471
|
+
const selectedOutlineUvSnapTargets = [
|
|
449
472
|
[0, 0],
|
|
450
473
|
[0.5, 0],
|
|
451
474
|
[1, 0],
|
|
@@ -456,11 +479,11 @@ const transformOriginSnapTargets = [
|
|
|
456
479
|
[0, 0.5],
|
|
457
480
|
[0.5, 0.5],
|
|
458
481
|
];
|
|
459
|
-
exports.
|
|
460
|
-
const
|
|
482
|
+
exports.selectedOutlineUvSnapThresholdPx = 10;
|
|
483
|
+
const snapSelectedOutlineUv = ({ point, points, thresholdPx = exports.selectedOutlineUvSnapThresholdPx, uv, }) => {
|
|
461
484
|
var _a;
|
|
462
485
|
let best = null;
|
|
463
|
-
for (const snapUv of
|
|
486
|
+
for (const snapUv of selectedOutlineUvSnapTargets) {
|
|
464
487
|
const snapPoint = (0, selected_outline_uv_1.getUvHandlePosition)(points, snapUv);
|
|
465
488
|
const distance = Math.hypot(point.x - snapPoint.x, point.y - snapPoint.y);
|
|
466
489
|
if (distance > thresholdPx) {
|
|
@@ -472,4 +495,6 @@ const snapSelectedOutlineTransformOriginUv = ({ point, points, thresholdPx = exp
|
|
|
472
495
|
}
|
|
473
496
|
return (_a = best === null || best === void 0 ? void 0 : best.uv) !== null && _a !== void 0 ? _a : uv;
|
|
474
497
|
};
|
|
475
|
-
exports.
|
|
498
|
+
exports.snapSelectedOutlineUv = snapSelectedOutlineUv;
|
|
499
|
+
exports.selectedOutlineTransformOriginSnapThresholdPx = exports.selectedOutlineUvSnapThresholdPx;
|
|
500
|
+
exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineUv;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic,
|
|
1
|
+
import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchemaField, SequencePropsSubscriptionKey, InteractivitySchema, TSequence } from 'remotion';
|
|
2
2
|
import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
4
4
|
import type { SelectedOutlineUvHandle } from './selected-outline-uv';
|
|
@@ -31,7 +31,7 @@ export type SelectedOutlineDragTarget = {
|
|
|
31
31
|
readonly fieldDefault: string | undefined;
|
|
32
32
|
readonly keyframeDisplayOffset: number;
|
|
33
33
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
34
|
-
readonly schema:
|
|
34
|
+
readonly schema: InteractivitySchema;
|
|
35
35
|
};
|
|
36
36
|
export type SelectedOutlineTransformOriginDragTarget = {
|
|
37
37
|
readonly clientId: string;
|
|
@@ -42,16 +42,16 @@ export type SelectedOutlineTransformOriginDragTarget = {
|
|
|
42
42
|
readonly originValue: string;
|
|
43
43
|
readonly rotateValue: string;
|
|
44
44
|
readonly scaleValue: number | string;
|
|
45
|
-
readonly schema:
|
|
45
|
+
readonly schema: InteractivitySchema;
|
|
46
46
|
readonly sourceFrame: number;
|
|
47
47
|
readonly translateDefault: string | undefined;
|
|
48
48
|
readonly translatePropStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
|
|
49
49
|
readonly translateValue: string;
|
|
50
50
|
};
|
|
51
|
-
export type ScaleFieldSchema = Extract<
|
|
51
|
+
export type ScaleFieldSchema = Extract<InteractivitySchemaField, {
|
|
52
52
|
type: 'scale';
|
|
53
53
|
}>;
|
|
54
|
-
export type RotationFieldSchema = Extract<
|
|
54
|
+
export type RotationFieldSchema = Extract<InteractivitySchemaField, {
|
|
55
55
|
type: 'rotation-css';
|
|
56
56
|
}>;
|
|
57
57
|
export type SelectedOutlineScaleDragTarget = {
|
|
@@ -62,7 +62,7 @@ export type SelectedOutlineScaleDragTarget = {
|
|
|
62
62
|
readonly keyframeDisplayOffset: number;
|
|
63
63
|
readonly linked: boolean;
|
|
64
64
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
65
|
-
readonly schema:
|
|
65
|
+
readonly schema: InteractivitySchema;
|
|
66
66
|
};
|
|
67
67
|
export type SelectedOutlineRotationDragTarget = {
|
|
68
68
|
readonly propStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
|
|
@@ -71,7 +71,7 @@ export type SelectedOutlineRotationDragTarget = {
|
|
|
71
71
|
readonly fieldSchema: RotationFieldSchema;
|
|
72
72
|
readonly keyframeDisplayOffset: number;
|
|
73
73
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
74
|
-
readonly schema:
|
|
74
|
+
readonly schema: InteractivitySchema;
|
|
75
75
|
readonly transformOriginValue: string;
|
|
76
76
|
};
|
|
77
77
|
export type SelectedOutlineDragState = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, GetEffectDragOverrides, PropStatuses,
|
|
1
|
+
import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, GetEffectDragOverrides, PropStatuses, InteractivitySchemaField, SequencePropsSubscriptionKey, InteractivitySchema, TSequence } from 'remotion';
|
|
2
2
|
import { type OutlinePoint } from './selected-outline-geometry';
|
|
3
3
|
export type UvCoordinate = readonly [number, number];
|
|
4
|
-
export type UvCoordinateFieldSchema = Extract<
|
|
4
|
+
export type UvCoordinateFieldSchema = Extract<InteractivitySchemaField, {
|
|
5
5
|
type: 'uv-coordinate';
|
|
6
6
|
}>;
|
|
7
7
|
export type SelectedOutlineUvHandle = {
|
|
@@ -11,8 +11,9 @@ export type SelectedOutlineUvHandle = {
|
|
|
11
11
|
readonly fieldDefault: UvCoordinate | undefined;
|
|
12
12
|
readonly fieldKey: string;
|
|
13
13
|
readonly fieldSchema: UvCoordinateFieldSchema;
|
|
14
|
+
readonly isSelected: boolean;
|
|
14
15
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
15
|
-
readonly schema:
|
|
16
|
+
readonly schema: InteractivitySchema;
|
|
16
17
|
readonly sourceFrame: number;
|
|
17
18
|
readonly value: UvCoordinate;
|
|
18
19
|
};
|
|
@@ -196,6 +196,10 @@ const getSelectedUvHandles = ({ propStatuses, clientId, getEffectDragOverrides,
|
|
|
196
196
|
if (effectStatus.type !== 'can-update-effect') {
|
|
197
197
|
continue;
|
|
198
198
|
}
|
|
199
|
+
const shouldShowUvHandles = selectedFields.allFields || selectedFields.fieldKeys.size > 0;
|
|
200
|
+
if (!shouldShowUvHandles) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
199
203
|
const dragOverrides = getEffectDragOverrides(nodePath, effectIndex);
|
|
200
204
|
const activeSchema = remotion_1.Internals.flattenActiveSchema(effect.schema, (key) => {
|
|
201
205
|
const propStatus = effectStatus.props[key];
|
|
@@ -212,8 +216,7 @@ const getSelectedUvHandles = ({ propStatuses, clientId, getEffectDragOverrides,
|
|
|
212
216
|
});
|
|
213
217
|
});
|
|
214
218
|
for (const [fieldKey, fieldSchema] of Object.entries(activeSchema)) {
|
|
215
|
-
if (fieldSchema.type !== 'uv-coordinate'
|
|
216
|
-
(!selectedFields.allFields && !selectedFields.fieldKeys.has(fieldKey))) {
|
|
219
|
+
if (fieldSchema.type !== 'uv-coordinate') {
|
|
217
220
|
continue;
|
|
218
221
|
}
|
|
219
222
|
const propStatus = effectStatus.props[fieldKey];
|
|
@@ -240,6 +243,7 @@ const getSelectedUvHandles = ({ propStatuses, clientId, getEffectDragOverrides,
|
|
|
240
243
|
fieldDefault: fieldSchema.default,
|
|
241
244
|
fieldKey,
|
|
242
245
|
fieldSchema,
|
|
246
|
+
isSelected: selectedFields.fieldKeys.has(fieldKey),
|
|
243
247
|
nodePath,
|
|
244
248
|
schema: effect.schema,
|
|
245
249
|
sourceFrame,
|