@remotion/studio 4.0.507 → 4.0.509

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 (191) hide show
  1. package/dist/FastRefreshProvider.js +13 -9
  2. package/dist/Studio.d.ts +5 -0
  3. package/dist/Studio.js +2 -2
  4. package/dist/components/Canvas.js +35 -5
  5. package/dist/components/CodingAgentIcon.d.ts +3 -1
  6. package/dist/components/CodingAgentIcon.js +4 -9
  7. package/dist/components/ColorPicker/AlphaSlider.js +2 -2
  8. package/dist/components/ColorPicker/HueSlider.js +2 -2
  9. package/dist/components/ColorPicker/SaturationValueArea.js +2 -2
  10. package/dist/components/ConfigureDefaultEditorModal.js +1 -1
  11. package/dist/components/ContextMenu.d.ts +1 -0
  12. package/dist/components/ContextMenu.js +32 -5
  13. package/dist/components/EditorContent.js +4 -3
  14. package/dist/components/EditorGuides/Guide.js +2 -2
  15. package/dist/components/EditorRuler/index.js +2 -2
  16. package/dist/components/ExplorerPanel.js +19 -1
  17. package/dist/components/InlineAction.d.ts +2 -1
  18. package/dist/components/InlineAction.js +3 -3
  19. package/dist/components/InspectorLocationCopy.js +1 -1
  20. package/dist/components/InspectorOpenInEditor.d.ts +1 -0
  21. package/dist/components/InspectorOpenInEditor.js +52 -8
  22. package/dist/components/InspectorPanel/AlignmentControls.js +2 -2
  23. package/dist/components/InspectorPanel/CompositionInspector.js +3 -1
  24. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +3 -3
  25. package/dist/components/InspectorPanel/styles.js +1 -1
  26. package/dist/components/InspectorSequenceSection.js +36 -4
  27. package/dist/components/Menu/MenuItem.js +2 -2
  28. package/dist/components/MenuBuildIndicator.js +1 -1
  29. package/dist/components/ModalContainer.js +1 -1
  30. package/dist/components/Modals.js +2 -9
  31. package/dist/components/NewComposition/InputDragger.js +2 -2
  32. package/dist/components/NewComposition/NewComposition.d.ts +2 -0
  33. package/dist/components/NewComposition/NewComposition.js +38 -6
  34. package/dist/components/NewComposition/get-new-composition-defaults.d.ts +1 -1
  35. package/dist/components/NewComposition/get-new-composition-defaults.js +9 -1
  36. package/dist/components/PlayPause.d.ts +1 -1
  37. package/dist/components/PlayPause.js +61 -12
  38. package/dist/components/RenderButton.js +16 -12
  39. package/dist/components/RenderModal/GuiRenderStatus.js +23 -6
  40. package/dist/components/RenderModal/InfoBubble.d.ts +1 -0
  41. package/dist/components/RenderModal/InfoBubble.js +6 -4
  42. package/dist/components/RenderModal/InfoTooltip.d.ts +1 -0
  43. package/dist/components/RenderModal/InfoTooltip.js +12 -12
  44. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +5 -0
  45. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +16 -3
  46. package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +1 -1
  47. package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +2 -0
  48. package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +3 -2
  49. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  50. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  51. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +2 -1
  52. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  53. package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +1 -1
  54. package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
  55. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  56. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +1 -1
  57. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +6 -1
  58. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  59. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  60. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +1 -1
  61. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
  62. package/dist/components/RenderModal/SchemaEditor/ZodTupleEditor.js +1 -1
  63. package/dist/components/RenderModal/SchemaEditor/zod-schema-type.d.ts +1 -0
  64. package/dist/components/RenderModal/SchemaEditor/zod-schema-type.js +12 -1
  65. package/dist/components/SelectedOutlineCanvasRotation.d.ts +9 -0
  66. package/dist/components/SelectedOutlineCanvasRotation.js +239 -0
  67. package/dist/components/SelectedOutlineCropControls.js +2 -2
  68. package/dist/components/SelectedOutlineElement.d.ts +2 -1
  69. package/dist/components/SelectedOutlineElement.js +40 -5
  70. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  71. package/dist/components/SelectedOutlineOverlay.js +55 -26
  72. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  73. package/dist/components/SelectedOutlinePolygon.js +6 -5
  74. package/dist/components/SelectedOutlineRenderer.d.ts +1 -0
  75. package/dist/components/SelectedOutlineRenderer.js +24 -7
  76. package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +6 -0
  77. package/dist/components/SelectedOutlineRotationCornerHandle.js +9 -7
  78. package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +2 -0
  79. package/dist/components/SelectedOutlineScaleEdgeLine.js +11 -7
  80. package/dist/components/SelectedOutlineTransformOriginHandle.js +50 -24
  81. package/dist/components/SelectedOutlineUvControls.js +8 -8
  82. package/dist/components/SequencePropsSubscriptionProvider.js +8 -0
  83. package/dist/components/SettingsModalFooter.js +1 -1
  84. package/dist/components/Splitter/SplitterHandle.js +2 -2
  85. package/dist/components/Tabs/index.d.ts +2 -0
  86. package/dist/components/Tabs/index.js +2 -2
  87. package/dist/components/Timeline/EasingEditorModal.js +2 -2
  88. package/dist/components/Timeline/SequencePropsObserver.js +97 -1
  89. package/dist/components/Timeline/SubscribeToNodePaths.js +4 -2
  90. package/dist/components/Timeline/Timeline.js +55 -1
  91. package/dist/components/Timeline/TimelineClipboardKeybindings.js +99 -35
  92. package/dist/components/Timeline/TimelineDragHandler.js +2 -2
  93. package/dist/components/Timeline/TimelineEffectItem.js +1 -4
  94. package/dist/components/Timeline/TimelineEffectPropItem.js +7 -0
  95. package/dist/components/Timeline/TimelineFieldRowContent.js +10 -3
  96. package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -2
  97. package/dist/components/Timeline/TimelineLayerEye.js +2 -2
  98. package/dist/components/Timeline/TimelineRotationField.js +84 -12
  99. package/dist/components/Timeline/TimelineScaleField.js +58 -4
  100. package/dist/components/Timeline/TimelineSelection.d.ts +4 -0
  101. package/dist/components/Timeline/TimelineSelection.js +47 -4
  102. package/dist/components/Timeline/TimelineSequenceItem.js +43 -25
  103. package/dist/components/Timeline/TimelineSequencePropItem.js +12 -3
  104. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +6 -6
  105. package/dist/components/Timeline/TimelineTransformOriginField.js +78 -4
  106. package/dist/components/Timeline/TimelineTranslateField.js +55 -15
  107. package/dist/components/Timeline/Transform3DModeContext.d.ts +1 -0
  108. package/dist/components/Timeline/Transform3DModeContext.js +5 -0
  109. package/dist/components/Timeline/delete-selected-timeline-item.js +0 -6
  110. package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -6
  111. package/dist/components/Timeline/keyframe-clipboard.d.ts +5 -1
  112. package/dist/components/Timeline/keyframe-clipboard.js +3 -2
  113. package/dist/components/Timeline/save-sequence-prop.js +16 -7
  114. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +31 -0
  115. package/dist/components/Timeline/sequence-prop-clipboard.js +142 -0
  116. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -1
  117. package/dist/components/Timeline/sequence-props-subscription-store.js +5 -2
  118. package/dist/components/Timeline/timeline-field-display-utils.js +2 -2
  119. package/dist/components/Timeline/timeline-field-row-layout.d.ts +6 -0
  120. package/dist/components/Timeline/timeline-field-row-layout.js +16 -1
  121. package/dist/components/Timeline/timeline-rotation-utils.d.ts +16 -0
  122. package/dist/components/Timeline/timeline-rotation-utils.js +145 -4
  123. package/dist/components/Timeline/timeline-translate-utils.d.ts +3 -2
  124. package/dist/components/Timeline/timeline-translate-utils.js +8 -4
  125. package/dist/components/Timeline/transform-3d-mode.d.ts +6 -0
  126. package/dist/components/Timeline/transform-3d-mode.js +36 -0
  127. package/dist/components/Timeline/transform-origin-utils.d.ts +4 -0
  128. package/dist/components/Timeline/transform-origin-utils.js +12 -6
  129. package/dist/components/Timeline/update-selected-easing.js +8 -0
  130. package/dist/components/Timeline/use-open-sequence-in-apps.js +3 -1
  131. package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +5 -1
  132. package/dist/components/Timeline/use-resolved-stack-react-to-change.js +67 -10
  133. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -1
  134. package/dist/components/Timeline/use-sequence-props-subscription.js +7 -2
  135. package/dist/components/Timeline/use-timeline-keyframe-drag.js +4 -4
  136. package/dist/components/call-api.js +2 -0
  137. package/dist/components/canvas-rotation-cursor.d.ts +1 -0
  138. package/dist/components/canvas-rotation-cursor.js +14 -0
  139. package/dist/components/folder-menu-items.js +1 -0
  140. package/dist/components/get-open-in-menu-items.d.ts +8 -1
  141. package/dist/components/get-open-in-menu-items.js +93 -8
  142. package/dist/components/import-assets.js +7 -0
  143. package/dist/components/root-composition-menu-items.js +1 -0
  144. package/dist/components/selected-outline-control-layout.d.ts +14 -0
  145. package/dist/components/selected-outline-control-layout.js +94 -0
  146. package/dist/components/selected-outline-drag.d.ts +11 -5
  147. package/dist/components/selected-outline-drag.js +80 -42
  148. package/dist/components/selected-outline-measurement.d.ts +5 -0
  149. package/dist/components/selected-outline-measurement.js +28 -1
  150. package/dist/components/selected-outline-types.d.ts +6 -0
  151. package/dist/components/use-default-editor-info.js +28 -3
  152. package/dist/esm/{chunk-ptnd65a9.js → chunk-jdn6nkbk.js} +10087 -7919
  153. package/dist/esm/{chunk-fgedsvhb.js → chunk-r46yxrjr.js} +1 -2
  154. package/dist/esm/index.mjs +357 -2
  155. package/dist/esm/internals.mjs +10086 -7918
  156. package/dist/esm/previewEntry.mjs +9926 -7758
  157. package/dist/esm/renderEntry.mjs +4 -2
  158. package/dist/helpers/get-box-quads-polyfill-internals.js +10 -2
  159. package/dist/helpers/get-canvas-capture-import.d.ts +7 -0
  160. package/dist/helpers/get-canvas-capture-import.js +43 -0
  161. package/dist/helpers/get-git-menu-item.d.ts +1 -1
  162. package/dist/helpers/get-git-menu-item.js +33 -3
  163. package/dist/helpers/inserted-element-selection.d.ts +12 -0
  164. package/dist/helpers/inserted-element-selection.js +29 -0
  165. package/dist/helpers/open-in-editor.d.ts +3 -1
  166. package/dist/helpers/open-in-editor.js +5 -1
  167. package/dist/helpers/pointer-session.d.ts +6 -2
  168. package/dist/helpers/pointer-session.js +29 -12
  169. package/dist/helpers/preview-server-events.js +4 -0
  170. package/dist/helpers/sequence-node-path-mutations.d.ts +4 -0
  171. package/dist/helpers/sequence-node-path-mutations.js +31 -0
  172. package/dist/helpers/use-create-composition.d.ts +15 -2
  173. package/dist/helpers/use-create-composition.js +11 -17
  174. package/dist/helpers/use-menu-structure.js +1 -0
  175. package/dist/icons/cube.d.ts +4 -0
  176. package/dist/icons/cube.js +6 -0
  177. package/dist/icons/finder.d.ts +4 -0
  178. package/dist/icons/finder.js +8 -0
  179. package/dist/icons/github.d.ts +4 -0
  180. package/dist/icons/github.js +11 -0
  181. package/dist/icons/terminal.d.ts +6 -0
  182. package/dist/icons/terminal.js +46 -0
  183. package/dist/index.d.ts +15 -0
  184. package/dist/index.js +8 -0
  185. package/dist/renderEntry.js +2 -2
  186. package/dist/state/modals.d.ts +9 -1
  187. package/dist/state/transform-3d-mode.d.ts +10 -0
  188. package/dist/state/transform-3d-mode.js +27 -0
  189. package/dist/state/z-index.d.ts +0 -1
  190. package/dist/state/z-index.js +28 -37
  191. package/package.json +12 -12
@@ -2,7 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getOpenInMenuItems = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const no_react_1 = require("remotion/no-react");
6
+ const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
7
+ const get_git_menu_item_1 = require("../helpers/get-git-menu-item");
5
8
  const editor_1 = require("../icons/editor");
9
+ const finder_1 = require("../icons/finder");
10
+ const github_1 = require("../icons/github");
11
+ const terminal_1 = require("../icons/terminal");
6
12
  const CodingAgentIcon_1 = require("./CodingAgentIcon");
7
13
  const menuLabel = {
8
14
  color: 'inherit',
@@ -10,8 +16,10 @@ const menuLabel = {
10
16
  fontSize: 13,
11
17
  lineHeight: '16px',
12
18
  };
13
- const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, excludeCodingAgentId, excludeEditorId, onConfigureApps, onOpenInCodingAgent, onOpenInEditor, }) => {
14
- var _a, _b;
19
+ const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, excludeCodingAgentId, excludeEditorId, fileManagerDisabled, folder, location, onConfigureApps, onOpenInCodingAgent, onOpenInEditor, onOpenInFileExplorer, onOpenInTerminal, }) => {
20
+ var _a, _b, _c;
21
+ const showFinder = window.remotion_fileSystemPlatform === 'darwin';
22
+ const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
15
23
  const editors = ((_a = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors) !== null && _a !== void 0 ? _a : [])
16
24
  .filter((editor) => editor.id !== excludeEditorId)
17
25
  .map((editor) => ({
@@ -36,20 +44,64 @@ const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, exclu
36
44
  id: `open-in-coding-agent-${codingAgent.id}`,
37
45
  keyHint: null,
38
46
  label: jsx_runtime_1.jsx("span", { style: menuLabel, children: codingAgent.name }),
39
- leftItem: jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { iconDataUrl: codingAgent.iconDataUrl }),
47
+ leftItem: jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { codingAgentId: codingAgent.id, size: 18 }),
40
48
  onClick: () => onOpenInCodingAgent(codingAgent.id, codingAgent.nameWithType),
41
49
  quickSwitcherLabel: null,
42
50
  subMenu: null,
43
51
  type: 'item',
44
52
  value: `coding-agent-${codingAgent.id}`,
45
53
  }));
54
+ const terminals = folder ? ((_c = codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.installedTerminals) !== null && _c !== void 0 ? _c : []) : [];
55
+ const gitHubItem = window.remotion_gitSource
56
+ ? {
57
+ id: 'open-in-github',
58
+ keyHint: null,
59
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "GitHub.com" }),
60
+ leftItem: jsx_runtime_1.jsx(github_1.GitHubIcon, { size: 18 }),
61
+ onClick: () => {
62
+ const gitSource = window.remotion_gitSource;
63
+ if (!gitSource) {
64
+ return;
65
+ }
66
+ window.open(folder || !location
67
+ ? (0, get_git_menu_item_1.getGitSourceBranchUrl)(gitSource)
68
+ : (0, get_git_menu_item_1.getGitRefUrl)(gitSource, location, window.remotion_cwd), '_blank');
69
+ },
70
+ quickSwitcherLabel: null,
71
+ subMenu: null,
72
+ type: 'item',
73
+ value: 'github',
74
+ }
75
+ : null;
76
+ const systemApps = [
77
+ gitHubItem,
78
+ showFinder
79
+ ? {
80
+ disabled: fileManagerDisabled,
81
+ id: 'open-in-file-explorer',
82
+ keyHint: null,
83
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: fileManagerName }),
84
+ leftItem: jsx_runtime_1.jsx(finder_1.FinderIcon, { size: 18 }),
85
+ onClick: () => {
86
+ if (!fileManagerDisabled) {
87
+ onOpenInFileExplorer();
88
+ }
89
+ },
90
+ quickSwitcherLabel: null,
91
+ subMenu: null,
92
+ type: 'item',
93
+ value: 'file-explorer',
94
+ }
95
+ : null,
96
+ ].filter(no_react_1.NoReactInternals.truthy);
97
+ const hasCategorizedApps = editors.length > 0 || codingAgents.length > 0 || terminals.length > 0;
46
98
  return [
47
99
  ...(editors.length > 0
48
100
  ? [
49
101
  {
50
102
  type: 'section-header',
51
- id: 'editors-header',
52
- label: 'Editors',
103
+ id: 'editor-header',
104
+ label: 'Editor',
53
105
  },
54
106
  ...editors,
55
107
  ]
@@ -58,13 +110,46 @@ const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, exclu
58
110
  ? [
59
111
  {
60
112
  type: 'section-header',
61
- id: 'agents-header',
62
- label: 'Agents',
113
+ id: 'agent-header',
114
+ label: 'Agent',
63
115
  },
64
116
  ...codingAgents,
65
117
  ]
66
118
  : []),
67
- ...(editors.length > 0 || codingAgents.length > 0
119
+ ...(terminals.length > 0
120
+ ? [
121
+ {
122
+ type: 'section-header',
123
+ id: 'terminal-header',
124
+ label: 'Terminal',
125
+ },
126
+ ...terminals.map((terminal) => ({
127
+ id: `open-in-terminal-${terminal.id}`,
128
+ keyHint: null,
129
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: terminal.name }),
130
+ leftItem: jsx_runtime_1.jsx(terminal_1.TerminalIcon, { terminalId: terminal.id, size: 18 }),
131
+ onClick: () => onOpenInTerminal === null || onOpenInTerminal === void 0 ? void 0 : onOpenInTerminal(terminal.id),
132
+ quickSwitcherLabel: null,
133
+ subMenu: null,
134
+ type: 'item',
135
+ value: `terminal-${terminal.id}`,
136
+ })),
137
+ ]
138
+ : []),
139
+ ...(systemApps.length > 0
140
+ ? [
141
+ ...(hasCategorizedApps
142
+ ? [
143
+ {
144
+ type: 'divider',
145
+ id: 'open-in-system-apps-divider',
146
+ },
147
+ ]
148
+ : []),
149
+ ...systemApps,
150
+ ]
151
+ : []),
152
+ ...(hasCategorizedApps || systemApps.length > 0
68
153
  ? [{ type: 'divider', id: 'open-in-settings-divider' }]
69
154
  : []),
70
155
  {
@@ -7,6 +7,7 @@ const no_react_1 = require("remotion/no-react");
7
7
  const get_static_files_1 = require("../api/get-static-files");
8
8
  const write_static_file_1 = require("../api/write-static-file");
9
9
  const clipboard_figma_1 = require("../helpers/clipboard-figma");
10
+ const inserted_element_selection_1 = require("../helpers/inserted-element-selection");
10
11
  const install_required_package_1 = require("../helpers/install-required-package");
11
12
  const use_media_metadata_1 = require("../helpers/use-media-metadata");
12
13
  const call_api_1 = require("./call-api");
@@ -504,6 +505,12 @@ const insertCompositionElement = async ({ compositionFile, compositionId, elemen
504
505
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
505
506
  return false;
506
507
  }
508
+ if (result.insertedNodePath !== null) {
509
+ (0, inserted_element_selection_1.requestInsertedElementSelection)({
510
+ compositionId,
511
+ nodePath: result.insertedNodePath,
512
+ });
513
+ }
507
514
  return true;
508
515
  };
509
516
  const downloadRemoteAsset = (url) => {
@@ -14,6 +14,7 @@ const getRootCompositionMenuItems = ({ connectionStatus, readOnlyStudio, setSele
14
14
  folderName: null,
15
15
  parentName: null,
16
16
  stack: null,
17
+ canvasCapture: null,
17
18
  });
18
19
  },
19
20
  quickSwitcherLabel: 'New composition...',
@@ -0,0 +1,14 @@
1
+ import type { OutlinePoint } from './selected-outline-geometry';
2
+ export type SelectedOutlineControlCorner = 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
3
+ export declare const getSelectedOutlineControlLayout: (points: readonly [OutlinePoint, OutlinePoint, OutlinePoint, OutlinePoint]) => {
4
+ rotationCorners: {
5
+ corner: "bottom-left" | "bottom-right" | "top-left" | "top-right";
6
+ point: OutlinePoint;
7
+ }[];
8
+ rotationHandleRadius: number;
9
+ scaleEdges: ("bottom" | "left" | "right" | "top")[];
10
+ scaleHitWidth: {
11
+ horizontal: number;
12
+ vertical: number;
13
+ };
14
+ };
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSelectedOutlineControlLayout = void 0;
4
+ // Outline points are measured in overlay pixels, keeping these sizes independent of canvas zoom.
5
+ const handleSize = 8;
6
+ const targetHalfSize = 4.5;
7
+ const smallOutlineSize = handleSize * 4;
8
+ const tinyOutlineSize = handleSize * 2;
9
+ const distance = (from, to) => Math.hypot(to.x - from.x, to.y - from.y);
10
+ const normalize = (point) => {
11
+ const length = Math.hypot(point.x, point.y);
12
+ if (length < 0.001) {
13
+ return null;
14
+ }
15
+ return { x: point.x / length, y: point.y / length };
16
+ };
17
+ const getRotationHandlePoint = ({ corner, points, radius, }) => {
18
+ const [topLeft, topRight, bottomRight, bottomLeft] = points;
19
+ const { point, adjacent } = {
20
+ 'top-left': { point: topLeft, adjacent: [topRight, bottomLeft] },
21
+ 'top-right': { point: topRight, adjacent: [topLeft, bottomRight] },
22
+ 'bottom-right': { point: bottomRight, adjacent: [topRight, bottomLeft] },
23
+ 'bottom-left': { point: bottomLeft, adjacent: [topLeft, bottomRight] },
24
+ }[corner];
25
+ const firstDirection = normalize({
26
+ x: point.x - adjacent[0].x,
27
+ y: point.y - adjacent[0].y,
28
+ });
29
+ const secondDirection = normalize({
30
+ x: point.x - adjacent[1].x,
31
+ y: point.y - adjacent[1].y,
32
+ });
33
+ const outlineCenter = {
34
+ x: (topLeft.x + topRight.x + bottomRight.x + bottomLeft.x) / 4,
35
+ y: (topLeft.y + topRight.y + bottomRight.y + bottomLeft.y) / 4,
36
+ };
37
+ const fallbackDirection = normalize({
38
+ x: point.x - outlineCenter.x,
39
+ y: point.y - outlineCenter.y,
40
+ });
41
+ const direction = firstDirection === null || secondDirection === null
42
+ ? fallbackDirection
43
+ : normalize({
44
+ x: firstDirection.x + secondDirection.x,
45
+ y: firstDirection.y + secondDirection.y,
46
+ });
47
+ if (direction === null) {
48
+ return point;
49
+ }
50
+ return {
51
+ x: point.x + direction.x * radius,
52
+ y: point.y + direction.y * radius,
53
+ };
54
+ };
55
+ const getSelectedOutlineControlLayout = (points) => {
56
+ const [topLeft, topRight, bottomRight, bottomLeft] = points;
57
+ const horizontalExtent = (distance(topLeft, topRight) + distance(bottomLeft, bottomRight)) / 2;
58
+ const verticalExtent = (distance(topLeft, bottomLeft) + distance(topRight, bottomRight)) / 2;
59
+ const isSmallX = horizontalExtent < smallOutlineSize;
60
+ const isSmallY = verticalExtent < smallOutlineSize;
61
+ const isTinyX = horizontalExtent < tinyOutlineSize;
62
+ const isTinyY = verticalExtent < tinyOutlineSize;
63
+ const targetHalfSizeX = isSmallX ? targetHalfSize / 2 : targetHalfSize;
64
+ const targetHalfSizeY = isSmallY ? targetHalfSize / 2 : targetHalfSize;
65
+ const rotationHandleRadius = Math.max(targetHalfSizeX, targetHalfSizeY) * 1.5;
66
+ const scaleEdges = ['top', 'right', 'bottom', 'left'].filter((edge) => {
67
+ // Preserve one scale control per axis when opposite edge targets would overlap.
68
+ if (edge === 'top') {
69
+ return !isTinyY;
70
+ }
71
+ if (edge === 'left') {
72
+ return !isTinyX;
73
+ }
74
+ return true;
75
+ });
76
+ const rotationCorners = ['top-left', 'top-right', 'bottom-right', 'bottom-left'].map((corner) => ({
77
+ corner,
78
+ point: getRotationHandlePoint({
79
+ corner,
80
+ points,
81
+ radius: rotationHandleRadius,
82
+ }),
83
+ }));
84
+ return {
85
+ rotationCorners: isTinyX || isTinyY ? [] : rotationCorners,
86
+ rotationHandleRadius,
87
+ scaleEdges,
88
+ scaleHitWidth: {
89
+ horizontal: targetHalfSizeY * 2,
90
+ vertical: targetHalfSizeX * 2,
91
+ },
92
+ };
93
+ };
94
+ exports.getSelectedOutlineControlLayout = getSelectedOutlineControlLayout;
@@ -4,6 +4,8 @@ import type { SelectedOutlineCropDragTarget, SelectedOutlineCropFieldKey, Select
4
4
  import { type UvCoordinate } from './selected-outline-uv';
5
5
  import type { AddSequenceKeyframeChange } from './Timeline/call-add-keyframe';
6
6
  import type { SaveSequencePropChange } from './Timeline/save-sequence-prop';
7
+ import { type ParsedCssRotation } from './Timeline/timeline-rotation-utils';
8
+ import { type ParsedTranslate } from './Timeline/timeline-translate-utils';
7
9
  export declare const getSelectedOutlineActiveSchema: ({ schema, currentRuntimeValueDotNotation, dragOverrides, propStatus, frame, }: {
8
10
  readonly schema: InteractivitySchema;
9
11
  readonly currentRuntimeValueDotNotation: Record<string, unknown>;
@@ -125,6 +127,11 @@ export declare const getSelectedOutlineRotationDragStates: ({ dragTargets, getDr
125
127
  readonly getDragOverrides: GetDragOverrides;
126
128
  readonly timelinePosition: number;
127
129
  }) => SelectedOutlineRotationDragState[];
130
+ export declare const getSelectedOutline3DRotationDragValues: ({ dragStates, rotationXDeltaDegrees, rotationYDeltaDegrees, }: {
131
+ readonly dragStates: readonly SelectedOutlineRotationDragState[];
132
+ readonly rotationXDeltaDegrees: number;
133
+ readonly rotationYDeltaDegrees: number;
134
+ }) => Map<string, string>;
128
135
  export declare const getSelectedOutlineRotationDragValues: ({ dragStates, rotationDeltaDegrees, }: {
129
136
  readonly dragStates: readonly SelectedOutlineRotationDragState[];
130
137
  readonly rotationDeltaDegrees: number;
@@ -151,16 +158,15 @@ export declare const clearSelectedOutlineRotationDragOverrides: ({ clearDragOver
151
158
  readonly clearDragOverrides: (nodePath: SequencePropsSubscriptionKey) => void;
152
159
  readonly dragStates: readonly SelectedOutlineRotationDragState[];
153
160
  }) => void;
154
- export declare const parseCssRotationToRadians: (value: string) => number | null;
155
- export declare const compensateTranslateForTransformOrigin: ({ startTranslate, deltaOrigin, rotate, scale, }: {
161
+ export declare const compensateTranslateForTransformOrigin: ({ startTranslate, deltaOrigin, rotation, scale, }: {
156
162
  readonly startTranslate: readonly [number, number];
157
163
  readonly deltaOrigin: readonly [number, number];
158
- readonly rotate: number;
159
- readonly scale: readonly [number, number];
164
+ readonly rotation: ParsedCssRotation;
165
+ readonly scale: readonly [number, number, number];
160
166
  }) => readonly [number, number];
161
167
  export declare const getSelectedOutlineTransformOriginDragChanges: ({ target, startTranslate, origin, translate, }: {
162
168
  readonly target: SelectedOutlineTransformOriginDragTarget;
163
- readonly startTranslate: readonly [number, number];
169
+ readonly startTranslate: ParsedTranslate;
164
170
  readonly origin: string;
165
171
  readonly translate: string;
166
172
  }) => {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.snapSelectedOutlineTransformOriginUv = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.snapSelectedOutlineUv = exports.selectedOutlineUvSnapThresholdPx = exports.applySelectedOutlineTransformOriginAxisLock = exports.getSelectedOutlineTransformOriginLockedAxis = exports.uvsEqual = exports.getSelectedOutlineTransformOriginDragChanges = 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.getSelectedOutlineCropDragChanges = exports.getSelectedOutlineCropDragValues = exports.getSelectedOutlineCropFollowingTransformOrigin = exports.getSelectedOutlineDragChanges = exports.isSelectedOutlineDragPastThreshold = exports.applySelectedOutlineDragAxisLock = exports.getSelectedOutlineDragValues = exports.getSelectedOutlineDragStates = exports.getSelectedOutlineActiveSchema = void 0;
3
+ exports.snapSelectedOutlineTransformOriginUv = exports.selectedOutlineTransformOriginSnapThresholdPx = exports.snapSelectedOutlineUv = exports.selectedOutlineUvSnapThresholdPx = exports.applySelectedOutlineTransformOriginAxisLock = exports.getSelectedOutlineTransformOriginLockedAxis = exports.uvsEqual = exports.getSelectedOutlineTransformOriginDragChanges = exports.compensateTranslateForTransformOrigin = exports.clearSelectedOutlineRotationDragOverrides = exports.clearSelectedOutlineScaleDragOverrides = exports.getSelectedOutlineKeyboardNudgeDirection = exports.clearSelectedOutlineDragOverrides = exports.getSelectedOutlineRotationDragChanges = exports.snapSelectedOutlineRotationDeltaDegrees = exports.selectedOutlineRotationSnapStepDegrees = exports.getSelectedOutlineRotationDragValues = exports.getSelectedOutline3DRotationDragValues = exports.getSelectedOutlineRotationDragStates = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineKeyboardNudgeDeltas = exports.getSelectedOutlineKeyboardNudgeDelta = exports.getSelectedOutlineCropDragChanges = exports.getSelectedOutlineCropDragValues = exports.getSelectedOutlineCropFollowingTransformOrigin = 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");
@@ -35,7 +35,7 @@ const getSelectedOutlineDragStates = ({ dragTargets, getDragOverrides, timelineP
35
35
  frame: sourceFrame,
36
36
  shouldResortToDefaultValueIfUndefined: true,
37
37
  });
38
- const [startX, startY] = (0, timeline_translate_utils_1.parseTranslate)(String(effectiveValue !== null && effectiveValue !== void 0 ? effectiveValue : '0px 0px'));
38
+ const [startX, startY, startZ] = (0, timeline_translate_utils_1.parseTranslate)(String(effectiveValue !== null && effectiveValue !== void 0 ? effectiveValue : '0px 0px'));
39
39
  return {
40
40
  defaultValue: target.fieldDefault !== undefined
41
41
  ? JSON.stringify(target.fieldDefault)
@@ -44,6 +44,7 @@ const getSelectedOutlineDragStates = ({ dragTargets, getDragOverrides, timelineP
44
44
  sourceFrame,
45
45
  startX,
46
46
  startY,
47
+ startZ,
47
48
  target,
48
49
  };
49
50
  });
@@ -52,7 +53,11 @@ exports.getSelectedOutlineDragStates = getSelectedOutlineDragStates;
52
53
  const getSelectedOutlineDragValues = ({ dragStates, deltaX, deltaY, }) => {
53
54
  return new Map(dragStates.map((dragState) => [
54
55
  dragState.key,
55
- (0, timeline_translate_utils_1.serializeTranslate)(dragState.startX + deltaX, dragState.startY + deltaY),
56
+ (0, timeline_translate_utils_1.serializeTranslate)([
57
+ dragState.startX + deltaX,
58
+ dragState.startY + deltaY,
59
+ dragState.startZ,
60
+ ]),
56
61
  ]));
57
62
  };
58
63
  exports.getSelectedOutlineDragValues = getSelectedOutlineDragValues;
@@ -78,7 +83,11 @@ const getSelectedOutlineDragChanges = ({ dragStates, lastValues, }) => {
78
83
  continue;
79
84
  }
80
85
  if (dragState.target.propStatus.status === 'keyframed') {
81
- const startValue = (0, timeline_translate_utils_1.serializeTranslate)(dragState.startX, dragState.startY);
86
+ const startValue = (0, timeline_translate_utils_1.serializeTranslate)([
87
+ dragState.startX,
88
+ dragState.startY,
89
+ dragState.startZ,
90
+ ]);
82
91
  if (value === startValue) {
83
92
  continue;
84
93
  }
@@ -426,24 +435,62 @@ const getSelectedOutlineRotationDragStates = ({ dragTargets, getDragOverrides, t
426
435
  frame: sourceFrame,
427
436
  shouldResortToDefaultValueIfUndefined: true,
428
437
  });
438
+ const startValue = String(effectiveValue !== null && effectiveValue !== void 0 ? effectiveValue : '0deg');
429
439
  return {
430
440
  defaultValue: target.fieldDefault !== undefined
431
441
  ? JSON.stringify(target.fieldDefault)
432
442
  : null,
433
443
  key: remotion_1.Internals.makeSequencePropsSubscriptionKey(target.nodePath),
434
444
  sourceFrame,
435
- startDegrees: (0, timeline_rotation_utils_1.parseCssRotationToDegrees)(String(effectiveValue !== null && effectiveValue !== void 0 ? effectiveValue : '0deg')),
445
+ startDegrees: (0, timeline_rotation_utils_1.parseCssRotationToDegrees)(startValue),
446
+ startRotation: (0, timeline_rotation_utils_1.parseCssRotationToEuler)(startValue),
447
+ startValue,
436
448
  target,
437
449
  };
438
450
  });
439
451
  };
440
452
  exports.getSelectedOutlineRotationDragStates = getSelectedOutlineRotationDragStates;
453
+ const getSelectedOutline3DRotationDragValues = ({ dragStates, rotationXDeltaDegrees, rotationYDeltaDegrees, }) => {
454
+ return new Map(dragStates.map((dragState) => {
455
+ const decimalPlaces = Math.max(6, (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
456
+ defaultDecimalPlaces: 1,
457
+ step: dragState.target.fieldSchema.step,
458
+ }));
459
+ const { startRotation } = dragState;
460
+ return [
461
+ dragState.key,
462
+ (0, timeline_rotation_utils_1.serializeCssRotationFromEuler)({
463
+ rotation: [
464
+ startRotation[0] + rotationXDeltaDegrees,
465
+ startRotation[1] + rotationYDeltaDegrees,
466
+ startRotation[2],
467
+ ],
468
+ decimalPlaces,
469
+ }),
470
+ ];
471
+ }));
472
+ };
473
+ exports.getSelectedOutline3DRotationDragValues = getSelectedOutline3DRotationDragValues;
441
474
  const getSelectedOutlineRotationDragValues = ({ dragStates, rotationDeltaDegrees, }) => {
442
475
  return new Map(dragStates.map((dragState) => {
443
476
  const decimalPlaces = (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
444
477
  defaultDecimalPlaces: 1,
445
478
  step: dragState.target.fieldSchema.step,
446
479
  });
480
+ const { startRotation } = dragState;
481
+ if (dragState.target.transform3DMode) {
482
+ return [
483
+ dragState.key,
484
+ (0, timeline_rotation_utils_1.serializeCssRotationFromEuler)({
485
+ rotation: [
486
+ startRotation[0],
487
+ startRotation[1],
488
+ startRotation[2] + rotationDeltaDegrees,
489
+ ],
490
+ decimalPlaces: Math.max(6, decimalPlaces),
491
+ }),
492
+ ];
493
+ }
447
494
  return [
448
495
  dragState.key,
449
496
  (0, timeline_rotation_utils_1.serializeCssRotation)(dragState.startDegrees + rotationDeltaDegrees, decimalPlaces),
@@ -457,10 +504,11 @@ const snapSelectedOutlineRotationDeltaDegrees = ({ dragStates, rotationDeltaDegr
457
504
  if (anchor === undefined) {
458
505
  return rotationDeltaDegrees;
459
506
  }
460
- return (Math.round((anchor.startDegrees + rotationDeltaDegrees) /
507
+ const startDegrees = anchor.startRotation[2];
508
+ return (Math.round((startDegrees + rotationDeltaDegrees) /
461
509
  exports.selectedOutlineRotationSnapStepDegrees) *
462
510
  exports.selectedOutlineRotationSnapStepDegrees -
463
- anchor.startDegrees);
511
+ startDegrees);
464
512
  };
465
513
  exports.snapSelectedOutlineRotationDeltaDegrees = snapSelectedOutlineRotationDeltaDegrees;
466
514
  const getSelectedOutlineRotationDragChanges = ({ dragStates, lastValues, }) => {
@@ -471,11 +519,7 @@ const getSelectedOutlineRotationDragChanges = ({ dragStates, lastValues, }) => {
471
519
  continue;
472
520
  }
473
521
  if (dragState.target.propStatus.status === 'keyframed') {
474
- const decimalPlaces = (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
475
- defaultDecimalPlaces: 1,
476
- step: dragState.target.fieldSchema.step,
477
- });
478
- const startValue = (0, timeline_rotation_utils_1.serializeCssRotation)(dragState.startDegrees, decimalPlaces);
522
+ const { startValue } = dragState;
479
523
  if (value === startValue) {
480
524
  continue;
481
525
  }
@@ -545,36 +589,26 @@ const clearSelectedOutlineRotationDragOverrides = ({ clearDragOverrides, dragSta
545
589
  }
546
590
  };
547
591
  exports.clearSelectedOutlineRotationDragOverrides = clearSelectedOutlineRotationDragOverrides;
548
- const parseCssRotationToRadians = (value) => {
549
- const match = value
550
- .trim()
551
- .match(/^([+-]?(?:\d+\.?\d*|\.\d+))(deg|rad|turn|grad)$/);
552
- if (!match) {
553
- return null;
554
- }
555
- const number = Number(match[1]);
556
- if (!Number.isFinite(number)) {
557
- return null;
558
- }
559
- if (match[2] === 'rad') {
560
- return number;
561
- }
562
- if (match[2] === 'turn') {
563
- return number * Math.PI * 2;
564
- }
565
- if (match[2] === 'grad') {
566
- return (number / 400) * Math.PI * 2;
592
+ const compensateTranslateForTransformOrigin = ({ startTranslate, deltaOrigin, rotation, scale, }) => {
593
+ const [rawAxisX, rawAxisY, rawAxisZ] = rotation.axis;
594
+ const axisLength = Math.hypot(rawAxisX, rawAxisY, rawAxisZ);
595
+ if (axisLength === 0) {
596
+ return [
597
+ startTranslate[0] + deltaOrigin[0] * (scale[0] - 1),
598
+ startTranslate[1] + deltaOrigin[1] * (scale[1] - 1),
599
+ ];
567
600
  }
568
- return (number / 180) * Math.PI;
569
- };
570
- exports.parseCssRotationToRadians = parseCssRotationToRadians;
571
- const compensateTranslateForTransformOrigin = ({ startTranslate, deltaOrigin, rotate, scale, }) => {
572
- const cos = Math.cos(rotate);
573
- const sin = Math.sin(rotate);
574
- const matrixA = cos * scale[0];
575
- const matrixB = sin * scale[0];
576
- const matrixC = -sin * scale[1];
577
- const matrixD = cos * scale[1];
601
+ const axisX = rawAxisX / axisLength;
602
+ const axisY = rawAxisY / axisLength;
603
+ const axisZ = rawAxisZ / axisLength;
604
+ const radians = (rotation.degrees * Math.PI) / 180;
605
+ const cos = Math.cos(radians);
606
+ const sin = Math.sin(radians);
607
+ const oneMinusCos = 1 - cos;
608
+ const matrixA = (cos + axisX * axisX * oneMinusCos) * scale[0];
609
+ const matrixB = (axisY * axisX * oneMinusCos + axisZ * sin) * scale[0];
610
+ const matrixC = (axisX * axisY * oneMinusCos - axisZ * sin) * scale[1];
611
+ const matrixD = (cos + axisY * axisY * oneMinusCos) * scale[1];
578
612
  const transformedDeltaX = matrixA * deltaOrigin[0] + matrixC * deltaOrigin[1];
579
613
  const transformedDeltaY = matrixB * deltaOrigin[0] + matrixD * deltaOrigin[1];
580
614
  const compensationX = deltaOrigin[0] - transformedDeltaX;
@@ -648,7 +682,11 @@ const getSelectedOutlineTransformOriginDragChanges = ({ target, startTranslate,
648
682
  nodePath: target.nodePath,
649
683
  fieldKey: selected_outline_types_1.translateFieldKey,
650
684
  sourceFrame: keyframe.frame,
651
- value: (0, timeline_translate_utils_1.serializeTranslate)(keyframeTranslate[0] + deltaTranslateX, keyframeTranslate[1] + deltaTranslateY),
685
+ value: (0, timeline_translate_utils_1.serializeTranslate)([
686
+ keyframeTranslate[0] + deltaTranslateX,
687
+ keyframeTranslate[1] + deltaTranslateY,
688
+ keyframeTranslate[2],
689
+ ]),
652
690
  schema: target.schema,
653
691
  });
654
692
  }
@@ -63,12 +63,17 @@ type SelectedTransformOriginInfo = {
63
63
  readonly sequenceKey: string;
64
64
  readonly displayFrame: number | null;
65
65
  };
66
+ export type SelectedRotationInfo = {
67
+ readonly sequenceKey: string;
68
+ readonly displayFrame: number | null;
69
+ };
66
70
  export type SelectedCropInfo = {
67
71
  readonly sequenceKey: string;
68
72
  readonly displayFrame: number | null;
69
73
  };
70
74
  export declare const getSelectedCropInfo: (selectedItems: readonly TimelineSelection[]) => SelectedCropInfo | null;
71
75
  export declare const getSelectedTransformOriginInfo: (selectedItems: readonly TimelineSelection[]) => SelectedTransformOriginInfo | null;
76
+ export declare const getSelectedRotationInfo: (selectedItems: readonly TimelineSelection[]) => SelectedRotationInfo | null;
72
77
  export declare const getSequencesWithSelectableOutlines: ({ sequences, overrideIdsToNodePaths, compositions, timelinePosition, }: {
73
78
  readonly sequences: readonly TSequence[];
74
79
  readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedTransformOriginInfo = exports.getSelectedCropInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.cropOutlinePoints = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
3
+ exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedRotationInfo = exports.getSelectedTransformOriginInfo = exports.getSelectedCropInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.cropOutlinePoints = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
4
4
  const calculate_timeline_1 = require("../helpers/calculate-timeline");
5
5
  const colors_1 = require("../helpers/colors");
6
6
  const get_box_quads_ponyfill_1 = require("../helpers/get-box-quads-ponyfill");
@@ -352,6 +352,33 @@ const getSelectedTransformOriginInfo = (selectedItems) => {
352
352
  };
353
353
  };
354
354
  exports.getSelectedTransformOriginInfo = getSelectedTransformOriginInfo;
355
+ const getSelectedRotationInfo = (selectedItems) => {
356
+ if (selectedItems.length !== 1) {
357
+ return null;
358
+ }
359
+ const [selectedItem] = selectedItems;
360
+ if (selectedItem.type === 'sequence-prop' &&
361
+ selectedItem.key === selected_outline_types_1.rotateFieldKey) {
362
+ return {
363
+ sequenceKey: (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(selectedItem.nodePathInfo),
364
+ displayFrame: null,
365
+ };
366
+ }
367
+ if (selectedItem.type !== 'keyframe' && selectedItem.type !== 'easing') {
368
+ return null;
369
+ }
370
+ const field = getKeyframeOrEasingField(selectedItem);
371
+ if ((field === null || field === void 0 ? void 0 : field.type) !== 'sequence' || field.fieldKey !== selected_outline_types_1.rotateFieldKey) {
372
+ return null;
373
+ }
374
+ return {
375
+ sequenceKey: (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(selectedItem.nodePathInfo),
376
+ displayFrame: selectedItem.type === 'keyframe'
377
+ ? selectedItem.frame
378
+ : selectedItem.fromFrame,
379
+ };
380
+ };
381
+ exports.getSelectedRotationInfo = getSelectedRotationInfo;
355
382
  const getSequencesWithSelectableOutlines = ({ sequences, overrideIdsToNodePaths, compositions = [], timelinePosition, }) => {
356
383
  return (0, calculate_timeline_1.calculateTimeline)({
357
384
  sequences: [...sequences],
@@ -12,9 +12,11 @@ export type SelectedOutlineLayoutTarget = {
12
12
  readonly ref: React.RefObject<Element | null>;
13
13
  readonly selected: boolean;
14
14
  readonly selectedForCrop: boolean;
15
+ readonly selectedForRotation: boolean;
15
16
  readonly selectedForTransformOrigin: boolean;
16
17
  readonly selectedForUvHandles: boolean;
17
18
  readonly showSelectedOutline: boolean;
19
+ readonly transformOriginValue: string;
18
20
  readonly selection: TimelineSelection;
19
21
  readonly sequence: TSequence;
20
22
  readonly crop: {
@@ -113,6 +115,7 @@ export type SelectedOutlineRotationDragTarget = {
113
115
  readonly keyframeDisplayOffset: number;
114
116
  readonly nodePath: SequencePropsSubscriptionKey;
115
117
  readonly schema: InteractivitySchema;
118
+ readonly transform3DMode: boolean;
116
119
  readonly transformOriginValue: string;
117
120
  };
118
121
  export type SelectedOutlineDragState = {
@@ -121,6 +124,7 @@ export type SelectedOutlineDragState = {
121
124
  readonly sourceFrame: number;
122
125
  readonly startX: number;
123
126
  readonly startY: number;
127
+ readonly startZ: number | null;
124
128
  readonly target: SelectedOutlineDragTarget;
125
129
  };
126
130
  export type SelectedOutlineScaleDragState = {
@@ -137,6 +141,8 @@ export type SelectedOutlineRotationDragState = {
137
141
  readonly key: string;
138
142
  readonly sourceFrame: number;
139
143
  readonly startDegrees: number;
144
+ readonly startRotation: readonly [number, number, number];
145
+ readonly startValue: string;
140
146
  readonly target: SelectedOutlineRotationDragTarget;
141
147
  };
142
148
  export type SequenceWithSelectedOutline = {