@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.
Files changed (171) hide show
  1. package/dist/components/AssetSelector.js +8 -14
  2. package/dist/components/Button.d.ts +1 -0
  3. package/dist/components/Button.js +8 -5
  4. package/dist/components/CompactExplanation.d.ts +12 -0
  5. package/dist/components/CompactExplanation.js +52 -0
  6. package/dist/components/CompositionSelector.js +2 -4
  7. package/dist/components/CurrentAsset.d.ts +3 -1
  8. package/dist/components/CurrentAsset.js +42 -34
  9. package/dist/components/CurrentComposition.d.ts +1 -1
  10. package/dist/components/CurrentComposition.js +38 -31
  11. package/dist/components/DefaultPropsEditor.d.ts +12 -2
  12. package/dist/components/DefaultPropsEditor.js +2 -2
  13. package/dist/components/EffectPickerModal.d.ts +5 -0
  14. package/dist/components/EffectPickerModal.js +179 -0
  15. package/dist/components/InspectorInfoHeader.d.ts +11 -0
  16. package/dist/components/InspectorInfoHeader.js +55 -0
  17. package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
  18. package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
  19. package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
  20. package/dist/components/InspectorPanel/EasingInspector.js +41 -0
  21. package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
  22. package/dist/components/InspectorPanel/GuideInspector.js +55 -0
  23. package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
  24. package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
  25. package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
  26. package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
  27. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
  28. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +116 -0
  29. package/dist/components/InspectorPanel/common.d.ts +15 -0
  30. package/dist/components/InspectorPanel/common.js +18 -0
  31. package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
  32. package/dist/components/InspectorPanel/inspector-selection.js +34 -0
  33. package/dist/components/InspectorPanel/styles.d.ts +27 -0
  34. package/dist/components/InspectorPanel/styles.js +178 -0
  35. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
  36. package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
  37. package/dist/components/InspectorPanel.d.ts +8 -0
  38. package/dist/components/InspectorPanel.js +26 -0
  39. package/dist/components/InspectorPanelLayout.d.ts +1 -0
  40. package/dist/components/InspectorPanelLayout.js +4 -0
  41. package/dist/components/InspectorSequenceSection.d.ts +16 -0
  42. package/dist/components/InspectorSequenceSection.js +147 -0
  43. package/dist/components/InspectorSourceLocation.d.ts +7 -0
  44. package/dist/components/InspectorSourceLocation.js +71 -0
  45. package/dist/components/Modals.js +3 -3
  46. package/dist/components/NewComposition/InputDragger.js +1 -1
  47. package/dist/components/NewComposition/RemInput.d.ts +1 -0
  48. package/dist/components/NewComposition/RemInput.js +8 -2
  49. package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
  50. package/dist/components/NewComposition/RemTextarea.js +8 -2
  51. package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
  52. package/dist/components/NewComposition/ValidationMessage.js +16 -5
  53. package/dist/components/OptionsPanel.d.ts +1 -1
  54. package/dist/components/OptionsPanel.js +8 -17
  55. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
  56. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
  57. package/dist/components/QuickSwitcher/shared.d.ts +4 -0
  58. package/dist/components/QuickSwitcher/shared.js +24 -0
  59. package/dist/components/RenderModal/DataEditor.d.ts +29 -2
  60. package/dist/components/RenderModal/DataEditor.js +107 -56
  61. package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
  62. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
  63. package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
  64. package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
  65. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
  66. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
  67. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
  68. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
  69. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
  70. package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
  71. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  72. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  73. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
  74. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  75. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
  76. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
  77. package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
  78. package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
  79. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  80. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
  81. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
  82. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  83. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  84. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
  85. package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
  86. package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
  87. package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
  88. package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
  89. package/dist/components/RendersTab.js +1 -1
  90. package/dist/components/SegmentedControl.d.ts +3 -0
  91. package/dist/components/SegmentedControl.js +11 -5
  92. package/dist/components/SelectedOutlineElement.js +57 -24
  93. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  94. package/dist/components/SelectedOutlineOverlay.js +41 -29
  95. package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
  96. package/dist/components/SelectedOutlineUvControls.js +64 -10
  97. package/dist/components/Tabs/index.js +4 -4
  98. package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
  99. package/dist/components/Timeline/EasingEditorModal.js +597 -124
  100. package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
  101. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
  102. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
  103. package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
  104. package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
  105. package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
  106. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
  107. package/dist/components/Timeline/TimelineEffectPropItem.js +24 -20
  108. package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
  109. package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
  110. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
  111. package/dist/components/Timeline/TimelineExpandedSection.js +5 -19
  112. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
  113. package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
  114. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
  115. package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
  116. package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
  117. package/dist/components/Timeline/TimelineNumberField.js +5 -11
  118. package/dist/components/Timeline/TimelineRotationField.js +5 -6
  119. package/dist/components/Timeline/TimelineScaleField.js +4 -8
  120. package/dist/components/Timeline/TimelineSelection.d.ts +6 -0
  121. package/dist/components/Timeline/TimelineSelection.js +109 -14
  122. package/dist/components/Timeline/TimelineSequence.js +19 -3
  123. package/dist/components/Timeline/TimelineSequenceItem.js +12 -67
  124. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
  125. package/dist/components/Timeline/TimelineSequencePropItem.js +56 -52
  126. package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
  127. package/dist/components/Timeline/TimelineTranslateField.js +4 -5
  128. package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
  129. package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
  130. package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
  131. package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
  132. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
  133. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
  134. package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
  135. package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
  136. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
  137. package/dist/components/Timeline/reset-selected-timeline-props.js +19 -5
  138. package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
  139. package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
  140. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
  141. package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
  142. package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
  143. package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
  144. package/dist/components/Timeline/update-selected-easing.js +40 -9
  145. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
  146. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
  147. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
  148. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +11 -0
  149. package/dist/components/Timeline/use-timeline-expanded-tree.js +33 -0
  150. package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
  151. package/dist/components/VisualControls/VisualControlsContent.js +4 -5
  152. package/dist/components/effect-drag-and-drop.d.ts +10 -0
  153. package/dist/components/effect-drag-and-drop.js +17 -8
  154. package/dist/components/effect-picker-search.d.ts +5 -0
  155. package/dist/components/effect-picker-search.js +77 -0
  156. package/dist/components/selected-outline-drag.d.ts +21 -2
  157. package/dist/components/selected-outline-drag.js +31 -6
  158. package/dist/components/selected-outline-types.d.ts +7 -7
  159. package/dist/components/selected-outline-uv.d.ts +4 -3
  160. package/dist/components/selected-outline-uv.js +6 -2
  161. package/dist/esm/{chunk-hrw9799x.js → chunk-fge2mq5p.js} +16535 -13311
  162. package/dist/esm/internals.mjs +16535 -13311
  163. package/dist/esm/previewEntry.mjs +17141 -13917
  164. package/dist/esm/renderEntry.mjs +1 -1
  165. package/dist/helpers/render-codec-label.d.ts +2 -0
  166. package/dist/helpers/render-codec-label.js +49 -0
  167. package/dist/helpers/timeline-layout.d.ts +4 -4
  168. package/dist/helpers/use-media-metadata.d.ts +8 -2
  169. package/dist/helpers/use-media-metadata.js +17 -4
  170. package/dist/state/modals.d.ts +9 -4
  171. 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 = async ({ clientId, dragData, fileName, nodePath, }) => {
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)(dragData.effect.importPath);
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: dragData.effect.name,
58
- effectImportPath: dragData.effect.importPath,
59
- effectConfig: dragData.effect.config,
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 ${dragData.effect.name}()`, 2000);
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.addEffectFromDragData = addEffectFromDragData;
82
+ exports.addEffectToSequence = addEffectToSequence;
@@ -0,0 +1,5 @@
1
+ import type { EffectCatalogItem } from '@remotion/studio-shared';
2
+ export declare const filterEffectCatalog: ({ items, query, }: {
3
+ readonly items: readonly EffectCatalogItem[];
4
+ readonly query: string;
5
+ }) => EffectCatalogItem[];
@@ -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, SequenceSchema } from 'remotion';
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: SequenceSchema;
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 transformOriginSnapTargets = [
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.selectedOutlineTransformOriginSnapThresholdPx = 10;
460
- const snapSelectedOutlineTransformOriginUv = ({ point, points, thresholdPx = exports.selectedOutlineTransformOriginSnapThresholdPx, uv, }) => {
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 transformOriginSnapTargets) {
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.snapSelectedOutlineTransformOriginUv = snapSelectedOutlineTransformOriginUv;
498
+ exports.snapSelectedOutlineUv = snapSelectedOutlineUv;
499
+ exports.selectedOutlineTransformOriginSnapThresholdPx = exports.selectedOutlineUvSnapThresholdPx;
500
+ exports.snapSelectedOutlineTransformOriginUv = exports.snapSelectedOutlineUv;
@@ -1,4 +1,4 @@
1
- import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, SequenceFieldSchema, SequencePropsSubscriptionKey, SequenceSchema, TSequence } from 'remotion';
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: SequenceSchema;
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: SequenceSchema;
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<SequenceFieldSchema, {
51
+ export type ScaleFieldSchema = Extract<InteractivitySchemaField, {
52
52
  type: 'scale';
53
53
  }>;
54
- export type RotationFieldSchema = Extract<SequenceFieldSchema, {
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: SequenceSchema;
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: SequenceSchema;
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, SequenceFieldSchema, SequencePropsSubscriptionKey, SequenceSchema, TSequence } from 'remotion';
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<SequenceFieldSchema, {
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: SequenceSchema;
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,